Sha256: 51d1f6bb143b4b9118a8cd4e586eed4591a5789b3d94804bc5ae2cf91b9a3119

Contents?: true

Size: 1.09 KB

Versions: 32

Compression:

Stored size: 1.09 KB

Contents

/* @flow */

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

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

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

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

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

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

  const classes = classnames(
    buildCss('pb_button_toolbar_kit', orientation, variant),
    globalProps(props),
    className
  )

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

export default ButtonToolbar

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
playbook_ui-11.1.2 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.1.2.pre.alpha1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.1.1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.1.1.pre.alpha1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.1.0 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.0.1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.0.0 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.0.0.pre.alpha.2 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-11.0.0.pre.alpha.1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.27.0.pre.lazysizes1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.27.0.pre.datepicker1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.0 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.0.pre.alpha5 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.0.pre.rc1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.0.pre.alpha.sticky1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.0.pre.alpha.display1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.0.pre.alpha3 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.25.1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
playbook_ui-10.26.0.pre.alpha1 app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx