Sha256: c26461e6ddd3a9313852891ee021a0d157347f76fa416d860e3ae1dee4164ac0

Contents?: true

Size: 1.31 KB

Versions: 23

Compression:

Stored size: 1.31 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,
  // @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,
  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-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

23 entries across 23 versions & 1 rubygems

Version Path
playbook_ui-4.8.2 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.8.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.7.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.7.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.6.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.6.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.5.2 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.5.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.5.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.4.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.4.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.3.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.3.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.2.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.1.2 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.1.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.1.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.0.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-4.0.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-3.5.0 app/pb_kits/playbook/pb_table/_table.jsx