Sha256: 3e35f9d47190a8f2bd3eb1e1a250d58a0953ca26197df56cfd0d81662a2bed2a

Contents?: true

Size: 1.01 KB

Versions: 130

Compression:

Stored size: 1.01 KB

Contents

/* @flow */
import React from 'react'
import classnames from 'classnames'

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

import List from  '../pb_list/_list'
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

130 entries across 130 versions & 1 rubygems

Version Path
playbook_ui-11.12.1.pre.alpha.charts1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.12.1.pre.alpha.passphrase1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.12.1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.13.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.12.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.11.0.pre.alpha.paginate2 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.11.0.pre.alpha.dialog2 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.11.0.pre.alpha.paginate1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.11.0.pre.alpha.renderer1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.11.0.pre.alpha.dialog1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.11.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.10.0.pre.alpha.pre.bold1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.10.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.9.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.9.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.8.1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.8.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.7.0.pre.alpha.table1 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx
playbook_ui-11.7.0 app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx