Sha256: 69f4ad0f49ab057c97e93907657e20a7a3c35ccf7ee6773c7e5653d27fb5db00

Contents?: true

Size: 1.15 KB

Versions: 20

Compression:

Stored size: 1.15 KB

Contents

import React from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
import { globalProps, GlobalProps } from '../utilities/globalProps'

type ListItemProps = {
  aria?: { [key: string]: string },
  children: React.ReactNode[] | React.ReactNode,
  className?: string,
  data?: Record<string, unknown>,
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
  id?: string,
  tabIndex?: number,
} & GlobalProps

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

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

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

export default ListItem

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
playbook_ui-13.28.0.pre.alpha.PBNTR297gradientoverlay3029 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.28.0.pre.alpha.dialogturbostreameventlistener3017 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1338alpha3001 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2987 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2986 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2984 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.27.0 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.26.0.pre.alpha.PBNTR291Dropdownrailsv22840 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12820 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12816 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.25.0.pre.alpha.PBNTR291Dropdownrailsv22812 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.26.0 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2785 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2783 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.25.0.pre.alpha.PBNTR272Dropdownkitv42769 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.25.0.pre.alpha.barchartfix2766 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.25.0.pre.alpha.PLAY761globalpaddingpropsbuttons2713 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.25.0 app/pb_kits/playbook/pb_list/_list_item.tsx
playbook_ui-13.24.0.pre.alpha.PBNTR261NewKitDropdown2681 app/pb_kits/playbook/pb_list/_list_item.tsx