Sha256: 67643f47d1f6cb3e2c543bd5c4715791a557ddf5191ebf155bdbc2e2e12db1d9

Contents?: true

Size: 1.37 KB

Versions: 66

Compression:

Stored size: 1.37 KB

Contents

/* @flow */

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

type TableProps = {
  aria?: object,
  children: array<Node> | Node,
  className: string,
  container: boolean,
  dark?: boolean,
  data?: object,
  dataTable: boolean,
  disableHover: boolean,
  id?: string,
  responsive: "collapse" | "scroll" | "none",
  singleLine: boolean,
  size: "sm" | "md" | "lg",
}

const Table = (props: TableProps) => {
  const {
    aria = {},
    children,
    className,
    container = true,
    dark,
    data = {},
    dataTable = false,
    disableHover = false,
    id,
    responsive = 'collapse',
    singleLine = false,
    size = 'sm',
  } = props

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

  return (
    <table
        {...ariaProps}
        {...dataProps}
        className={classnames(
        'pb_table',
        `table-${size}`,
        `table-responsive-${responsive}`,
        {
          'table-card': container,
          'table-dark': dark,
          'data_table': dataTable,
          'single-line': singleLine,
          'no-hover': disableHover,
        },
        globalProps(props),
        className
      )}
        id={id}
    >
      {children}
    </table>
  )
}

export default Table

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
playbook_ui-7.14.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.13.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.12.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.12.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.11.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.11.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.10.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.9.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.8.4 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.8.3 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.8.2 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.8.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.8.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.7.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.6.2.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.6.2 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-7.6.1.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx