[DLS-606] feat(storybook): add stories for Table, DataTable, Dialog and ListItem#655
[DLS-606] feat(storybook): add stories for Table, DataTable, Dialog and ListItem#655
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
68098c4 to
677d826
Compare
3f0898f to
ab903c9
Compare
ab903c9 to
ac1a394
Compare
There was a problem hiding this comment.
Pull request overview
Adds new Storybook examples to document richer usage patterns for core UI components (Table/DataTable filtering & action bars, Dialog “muted” info state, and ListItem leading icon patterns) within libs/ui-react.
Changes:
- Add Table stories demonstrating an action bar with a Select using a
MediaButtontrigger, plusTableCellContentleading-content icon patterns (CryptoIcon/MediaImage). - Add multiple DataTable stories showcasing client-side and server-side filtering patterns (TanStack
columnFilters,manualFiltering, and combined filters). - Extend Dialog stories with a “Muted” info-state variant using the
bg-gradient-mutedoverlay. - Add a ListItem story demonstrating network vs media icon leading patterns.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| libs/ui-react/src/lib/Components/Table/Table.stories.tsx | Adds new Table stories for action bar + Select trigger and leading icon patterns. |
| libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx | Adds new DataTable filtering stories (client-side, server-side, multiple filters) using Select triggers. |
| libs/ui-react/src/lib/Components/Dialog/Dialog.stories.tsx | Adds “Muted” info-state dialog variant with gradient overlay + docs snippet. |
| libs/ui-react/src/lib/Components/ListItem/ListItem.stories.tsx | Adds ListItem story demonstrating CryptoIcon vs MediaImage leading patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ac1a394 to
3be226a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <ListItem density='expanded' onClick={() => {}}> | ||
| <ListItemLeading> | ||
| <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' /> | ||
| <ListItemContent> | ||
| <ListItemTitle>Bitcoin</ListItemTitle> | ||
| <ListItemDescription>BTC · Layer 1</ListItemDescription> | ||
| </ListItemContent> | ||
| </ListItemLeading> | ||
| <ListItemTrailing> | ||
| <ListItemContent> | ||
| <ListItemTitle>$43,250.00</ListItemTitle> | ||
| <ListItemDescription className='text-success'> | ||
| +2.5% | ||
| </ListItemDescription> | ||
| </ListItemContent> | ||
| </ListItemTrailing> | ||
| </ListItem> |
| /** | ||
| * Client-side column filtering powered by TanStack's built-in `columnFilters` state | ||
| * and `getFilteredRowModel`. The Select updates `columnFilters` via | ||
| * `onColumnFiltersChange`; TanStack handles matching rows automatically. | ||
| * Combine with `DataTableGlobalSearchInput` for full-text + column filtering. | ||
| */ |
|
|
||
| <Dialog> | ||
| <DialogTrigger asChild> | ||
| <Button appearance='base'>Muted</Button> |
| /** | ||
| * Server-side filtering with `manualFiltering: true`. Filter state is owned by | ||
| * the component and synced to the backend via `onColumnFiltersChange` and | ||
| * `onGlobalFilterChange`. In this demo the "API call" is simulated locally, but | ||
| * the pattern is identical to a real fetch: change a filter → callback fires → | ||
| * you refetch with the new params → pass fresh data back as `data`. | ||
| */ |
| <DialogHeader density='compact' className='relative' /> | ||
| <DialogBody> | ||
| <div className='flex flex-col items-center gap-24 overflow-hidden'> | ||
| <div className='relative flex flex-col items-center gap-24 overflow-hidden'> |
| <DialogHeader density='compact' className='relative' /> | ||
| <DialogBody> | ||
| <div className='flex flex-col items-center gap-24 overflow-hidden'> | ||
| <div className='relative flex flex-col items-center gap-24 overflow-hidden'> |
There was a problem hiding this comment.
| <div className='relative flex flex-col items-center gap-24 overflow-hidden'> | |
| <div className='flex flex-col items-center gap-24 overflow-hidden'> |
- DataTable: add WithClientSideColumnFilter (tanstack columnFilters API), WithServerSideFilters (manualFiltering with simulated backend), and WithMultipleFilters (global search + two simultaneous column selects) - Dialog: add WithGradientMuted story (bg-gradient-muted overlay pattern) - ListItem: add WithNetworkAndMediaIcon story (CryptoIcon + MediaImage as primary leading elements) - Table: add WithNetworkAndMediaIcon story (CryptoIcon + MediaImage in TableCellContent leadingContent) Made-with: Cursor
- DataTable/Table WithActionBarAndSelectTrigger: wrap filteredData in useMemo to prevent infinite re-render loop (new array reference on every render was causing TanStack to reprocess and re-render in a loop) - Dialog: merge WithGradientMuted into InfoStateVariants alongside the existing error/success variants instead of a separate story Made-with: Cursor
Made-with: Cursor
- DataTable: remove WithActionBarAndSelectTrigger (filters already documented) - DataTable: rename WithMultipleFilters → WithClientSideFilters, drop JSDoc - Table: remove JSDoc comment above WithNetworkAndMediaIcon - ListItem: remove WithNetworkAndMediaIcon story; move CryptoIcon examples (BTC/ETH) into CompositionShowcase; remove MediaImage items per review Made-with: Cursor
…log gradient - Add '__all__' sentinel to Select items in Table and DataTable stories so selecting "All categories" / "All performance" is an explicit item rather than relying on clearing state; updates value binding and onValueChange accordingly across WithActionBarAndSelectTrigger, WithClientSideColumnFilter, WithServerSideFilters, and WithClientSideFilters - Add `relative` positioning to the gradient-overlay wrapper div in all six Dialog info-state stories (InfoStateVariants + standalone error/success/muted) so the absolute overlay is contained within its sibling block Made-with: Cursor
- Dialog: revert 'relative' from info-state gradient wrappers (aammami-ledger) - DataTable: remove JSDoc comments above new filter stories (gamegee) - DataTable: remove redundant WithClientSideFilters story (gamegee) - Table/DataTable: add w-208 to SelectContent to prevent content cropping (gamegee) Co-authored-by: Cursor <cursoragent@cursor.com>
fa0c41c to
c9e9a35
Compare
|







Closes DLS-606.
Changes
DataTable
Table
Dialog
ListItem