diff --git a/labware-library/src/components/ui/LabeledValueTable.js b/labware-library/src/components/ui/LabeledValueTable.js index 3ce6bf2259b..90769226a10 100644 --- a/labware-library/src/components/ui/LabeledValueTable.js +++ b/labware-library/src/components/ui/LabeledValueTable.js @@ -1,13 +1,10 @@ // @flow import * as React from 'react' -import cx from 'classnames' import { Table, TableEntry, TABLE_COLUMN } from './Table' import { LabelText, LABEL_LEFT } from './LabelText' import { Value } from './Value' -import { ClickableIcon } from './ClickableIcon' - -import styles from './styles.css' +import { TableTitle } from './TableTitle' import type { TableDirection } from './Table' @@ -42,37 +39,3 @@ export function LabeledValueTable(props: LabledValueTableProps) { ) } - -type TableTitleProps = {| - label: React.Node, - diagram?: React.Node, -|} - -export function TableTitle(props: TableTitleProps) { - const [guideVisible, setGuideVisible] = React.useState(false) - const toggleGuide = () => setGuideVisible(!guideVisible) - const { label, diagram } = props - - const iconClassName = cx(styles.info_button, { - [styles.active]: guideVisible, - }) - - const contentClassName = cx(styles.expandable_content, { - [styles.open]: guideVisible, - }) - - return ( -
-
- {label} - -
-
{diagram}
-
- ) -} diff --git a/labware-library/src/components/ui/TableTitle.js b/labware-library/src/components/ui/TableTitle.js new file mode 100644 index 00000000000..4b90a108de1 --- /dev/null +++ b/labware-library/src/components/ui/TableTitle.js @@ -0,0 +1,44 @@ +// @flow + +// Table Title with expandable measurement diagrams +import * as React from 'react' +import cx from 'classnames' + +import { LabelText, LABEL_LEFT } from './LabelText' +import { ClickableIcon } from './ClickableIcon' + +import styles from './styles.css' + +type TableTitleProps = {| + label: React.Node, + diagram?: React.Node, +|} + +export function TableTitle(props: TableTitleProps) { + const [guideVisible, setGuideVisible] = React.useState(false) + const toggleGuide = () => setGuideVisible(!guideVisible) + const { label, diagram } = props + + const iconClassName = cx(styles.info_button, { + [styles.active]: guideVisible, + }) + + const contentClassName = cx(styles.expandable_content, { + [styles.open]: guideVisible, + }) + + return ( + <> +
+ {label} + +
+
{diagram}
+ + ) +} diff --git a/labware-library/src/components/ui/styles.css b/labware-library/src/components/ui/styles.css index 4c5e5f79ae4..082c7948be1 100644 --- a/labware-library/src/components/ui/styles.css +++ b/labware-library/src/components/ui/styles.css @@ -48,9 +48,7 @@ .table_title { padding-bottom: var(--spacing-1); border-bottom: var(--bd-light); -} -.table_title_text { @apply --flex-between; align-items: center;