diff --git a/packages/table/src/lib/Table.stories.tsx b/packages/table/src/lib/Table.stories.tsx index 0558895d4..3f4e89a9c 100644 --- a/packages/table/src/lib/Table.stories.tsx +++ b/packages/table/src/lib/Table.stories.tsx @@ -4,7 +4,11 @@ import type { Meta, StoryObj } from '@storybook/react'; import { useMemo, useState } from 'react'; import Checkbox from '@mui/material/Checkbox'; +import { IconButton } from '@availity/mui-button'; import { StatusChip, StatusChipProps } from '@availity/mui-chip'; +import { CollapseIcon, ExpandIcon } from '@availity/mui-icon'; +import { Box, Grid } from '@availity/mui-layout'; +import { Collapse } from '@availity/mui-transitions'; import { Typography } from '@availity/mui-typography'; import { visuallyHidden } from '@availity/mui-utils'; import Patients from '../../../../data/patients.json'; @@ -459,3 +463,85 @@ export const _PaginatedTable: StoryObj = { ); }, }; + +export const _ExpandableTable: StoryObj = { + render: (args: TableProps) => { + return ( + + + Table + + + + +
Expand Row
+ Payer + Patient First Name + Patient Last Name + Birth Date +
+
+ + {dataRows.map((row) => { + const [open, setOpen] = useState(false); + return ( + <> + + + setOpen(!open)} + > + {open ? : } + + + {row.payerName} + {row.firstName} + {row.lastName} + {/* TODO: switch to dayjs */} + {new Date(row.birthDate).toLocaleDateString('en-us')} + + + + + + + + + Subscriber Member Id + + + {row.subscriberMemberId} + + + + + Subscriber Relationship + + + {row.subscriberRelationship} + + + + + Subscriber Relationship Code + + + {row.subscriberRelationshipCode} + + + + + + + + + ); + })} + +
+
+ ); + }, +}; diff --git a/packages/table/src/lib/TableRow.stories.tsx b/packages/table/src/lib/TableRow.stories.tsx index 7a64ba3da..2436580cd 100644 --- a/packages/table/src/lib/TableRow.stories.tsx +++ b/packages/table/src/lib/TableRow.stories.tsx @@ -3,6 +3,12 @@ import type { Meta, StoryObj } from '@storybook/react'; import { TableRow, TableRowProps } from './TableRow'; import { TableBody, TableCell } from '..'; +import { useState } from 'react'; +import { IconButton } from '@availity/mui-button'; +import { CollapseIcon, ExpandIcon } from '@availity/mui-icon'; +import { Box, Grid } from '@availity/mui-layout'; +import { Collapse } from '@availity/mui-transitions'; +import { Typography } from '@availity/mui-typography'; const meta: Meta = { title: 'Components/Table/TableRow', @@ -26,3 +32,87 @@ export const _TableRow: StoryObj = { ), }; + +export const _CollapsibleRow: StoryObj = { + render: (args: TableRowProps) => { + const [open, setOpen] = useState(false); + + return ( + + + + setOpen(!open)} + > + {open ? : } + + + Cell 1 + Cell 2 + Cell 3 + + + + + + + + + Extra Data 1 + + + Lorem Ipsum + + + + + Extra Data 2 + + + Lorem Ipsum + + + + + Extra Data 3 + + + Lorem Ipsum + + + + + + + Extra Data 4 + + + Lorem Ipsum + + + + + Extra Data 5 + + + Lorem Ipsum + + + + + Extra Data 6 + + + Lorem Ipsum + + + + + + + + + )}, +};