Sha256: d6da304ded0343c6bc88b5184482cc5ed6f4324f9a6602b121ad5ef83d18869b

Contents?: true

Size: 1 KB

Versions: 115

Compression:

Stored size: 1 KB

Contents

/* @flow */
import React from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
import { globalProps } from '../utilities/globalProps.js'
import { List } from  '..'
import SelectableListItem from './_item.jsx'

type SelectableListProps = {
  aria?: object,
  children?: Node,
  className?: string,
  data?: object,
  id?: string,
  variant?: 'checkbox' | 'radio',
}

const SelectableList = (props: SelectableListProps) => {
  const {
    aria = {},
    children,
    className,
    data = {},
    id,
  } = props

  const ariaProps = buildAriaProps(aria)
  const classes = classnames(buildCss('pb_selectable_list_kit'), globalProps(props), className)
  const dataProps = buildDataProps(data)

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

SelectableList.Item = SelectableListItem

export default SelectableList

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
playbook_ui-9.19.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.19.0.pre.alphafonts app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.18.0.flow.bin.alpha app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.18.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.17.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.17.0.pre.decouple.website2 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.16.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.15.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.15.0.pre.decouple.website1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.14.1.alpha.radio.alignment app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.14.1.alpha.highcharts9 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.14.1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.13.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.12.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.12.0.pre.text.addon app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.11.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.10.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.10.0.pre.alpha2 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-9.10.0.pre.alpha1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx