Sha256: 559b53540b948c328b7b26b16b3629117578e96f1292cea1b3f34ac90a7d2c48

Contents?: true

Size: 1.42 KB

Versions: 15

Compression:

Stored size: 1.42 KB

Contents

/* @flow */

import React, { type Node } from 'react'
import classnames from 'classnames'

type TableProps = {
  children: Array<Node> | Node,
  className: string,
  container: boolean,
  dark: boolean,
  dataTable: boolean,
  // @deprecated disable_hover since version 3.2.0, please use `disableHover`
  disable_hover: boolean, // eslint-disable-line camelcase
  disableHover: boolean,
  responsive: "collapse" | "scroll" | "none",
  // @deprecated single_line since version 3.2.0, please use `singleLine`
  single_line: boolean, // eslint-disable-line camelcase
  singleLine: boolean,
  size: "sm" | "md" | "lg",
}

const Table = ({
  children,
  className,
  container = true,
  dark = false,
  dataTable = false,
  disable_hover = false, // eslint-disable-line camelcase
  disableHover = false,
  responsive = 'collapse',
  single_line = false, // eslint-disable-line camelcase
  singleLine = false,
  size = 'sm',
}: TableProps) => {
  disableHover = disableHover || disable_hover // eslint-disable-line camelcase
  singleLine = singleLine || single_line // eslint-disable-line camelcase

  const classes = classnames(className, 'pb_table', `table-${size}`, `table-responsive-${responsive}`, {
    'table-card': container,
    'table-dark': dark,
    'data_table': dataTable,
    'single-line': singleLine,
    'no-hover': disableHover,
  })

  return (
    <table className={classes}>
      {children}
    </table>
  )
}

export default Table

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.16.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.15.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.14.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.13.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.13.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.12.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.11.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.10.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.9.0 app/pb_kits/playbook/pb_table/_table.jsx