Sha256: 64ec6ba84e408104fb39b41805b4aad424fa269bc1536bd760d02dfe5df7b52b

Contents?: true

Size: 1.08 KB

Versions: 11

Compression:

Stored size: 1.08 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'

import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'

import { globalProps } from '../utilities/globalProps.js'

type ButtonToolbarProps = {
  aria?: object,
  children?: array<React.ReactChild>,
  className?: string,
  connected?: boolean,
  data?: object,
  id?: string,
  onClick?: EventHandler,
  orientation?: "horizontal" | "vertical",
  text?: string,
  variant?: string,
}

const ButtonToolbar  = (props: ButtonToolbarProps) => {
  const {
    aria = {},
    children,
    className,
    connected = false,
    data = {},
    id,
    orientation = 'horizontal',
    text,
  } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)

  const classes = classnames(
    buildCss('pb_button_toolbar_kit', orientation, { connected }),
    globalProps(props),
    className
  )

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classes}
        id={id}
    >
      {children || text}
    </div>
  )
}

export default ButtonToolbar

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
playbook_ui-7.0.1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-6.8.2.pre.alpha1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-7.0.0.pre.alpha15 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-7.0.1.pre.alpha14 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-7.0.0.pre.alpha14 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-7.0.0.pre.alpha13 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-7.0.0.pre.alpha12 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-7.0.0 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-7.0.0.pre.alpha11 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-6.8.1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-6.8.0 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx