Sha256: d792d4ba1dfcde9128620b5985e2e1c6f9436a1eade6983573b1054ded811bee

Contents?: true

Size: 940 Bytes

Versions: 7

Compression:

Stored size: 940 Bytes

Contents

/* @flow */

import React, { type Node } from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
import { globalProps } from '../utilities/globalProps.js'

type ListItemProps = {
  aria?: object,
  children: Array<Node> | Node,
  className?: String,
  data?: object,
  id?: String,
  tabIndex?: String,
}

const ListItem = (props: ListItemProps) => {
  const {
    aria = {},
    children,
    className,
    data = {},
    id,
    tabIndex,
  } = props

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

  return (
    <>
      <li
          {...ariaProps}
          {...dataProps}
          className={classes}
          id={id}
          tabIndex={tabIndex}
      >
        {children}
      </li>
    </>
  )
}

export default ListItem

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_list/_list_item.jsx
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_list/_list_item.jsx
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_list/_list_item.jsx
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_list/_list_item.jsx
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_list/_list_item.jsx
playbook_ui-6.1.0 app/pb_kits/playbook/pb_list/_list_item.jsx
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_list/_list_item.jsx