Add Storybook stories for all components and hooks#397
Merged
Conversation
Agent-Logs-Url: https://github.com/linn/react-components-library/sessions/9a479ef6-d099-463a-8484-230d8cde1bac Co-authored-by: lewisrenfrew <16683709+lewisrenfrew@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Storybook stories for components and hooks
Add Storybook stories for all components and hooks
Apr 21, 2026
lewisrenfrew
approved these changes
Apr 21, 2026
richardiphillips
approved these changes
Apr 21, 2026
Copilot stopped work on behalf of
lewisrenfrew due to an error
April 21, 2026 14:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Storybook infrastructure has been in place since July 2025 but only
NavigationandPagehad stories. This fills out the library properly with 23 new files covering all key components and hooks.Component stories (21 files, co-located with components)
Each story file uses
args/argTypesfor live controls,fn()for callbacks, and multiple named exports for meaningful visual states.InputField,Dropdown,SearchInputFieldDatePicker,DateTimePicker,LinnWeekPickerLocalizationProvider+AdapterMomentCreateButton,ReportDataGridMemoryRouterPrevNextButtonsGridcontainerConfirmDialog,SnackbarMessagevisible: trueby default so the component is immediately visible in canvasReportDataGridMemoryRouterHook documentation (2 MDX pages under
src/hooks/)useSearch.mdxanduseDelete.mdx— each covers signature, parameters, return value, and annotated usage examples. MDX 3 (Storybook 9) doesn't support GFM pipe tables so these use HTML<table>elements.Screenshots
InputField — canvas + 21 auto-wired controls:

ReportDataGrid — colour attribute rendering:

DatePicker —

LocalizationProviderdecorator working, min/max controls wired:ConfirmDialog — open modal with editable title/button text controls:

useDelete MDX — rendered HTML tables for parameters and return value:

No existing source files were modified.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
storybook.js.org/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/react-components-library/react-components-library/node_modules/.bin/storybook build src/components/Panel.stories.js(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/react-components-library/react-components-library/node_modules/.bin/storybook dev -p 6006 --no-open(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Goal
Add Storybook stories for the components and hooks in this library. The Storybook infrastructure is already in place (
.storybook/main.js,deploy-github-pages.ymlCI), but currently onlyNavigation.stories.jsandPage.stories.jsexist. We want to fill this out properly.What to do
add-storybook-stories.stories.jsfiles for all (or as many as practical) components undersrc/components/src/hooks/, use Storybookdocs-style MDX or stories with interactive demos where possible — if a hook is too backend-coupled (e.g. makes API calls), a simple MDX doc page explaining usage is finesrc/stories/Navigation.stories.jsas a referenceNavigation.stories.jsorPage.stories.jsImportant context
sxprops@storybook/react-webpack5and@storybook/addon-docs../src/**/*.stories.@(js|jsx|mjs|ts|tsx)— so stories can live alongside components or insrc/stories/src/components/InputField.stories.js) rather than putting everything insrc/stories/argsandargTypesin stories so Storybook controls workNavigation.stories.jsuses aMemoryRouterwrapper — use similar patterns for any components that use React Router linksComponents to cover (at minimum)
InputField,Dropdown,CheckboxWithLabel,OnOffSwitch,DatePicker,DateTimePicker,LinnWeekPicker,BackButton,CreateButton,SaveBackCancelButtons,PrevNextButtons,ExportButton,LinkButton,Loading,ErrorCard,SnackbarMessage,ConfirmDialog,Panel,Breadcrumbs,SearchInputField,ReportDataGridHooks to document:
useSearch,useDelete— MDX doc pages are fine for these.Reference files
.storybook/main.js— Storybook config.storybook/preview.js— global decorators/parameterssrc/stories/Navigation.stories.js— existing story to use as style referencesrc/components/<ComponentName>.js— read each one before writing its storyThe following is the prior conversation context from the user's chat exploration (may be truncated):
User: can you read this repo and the last few commits to get a feel for it?
Assistant: Here's a summary of what I found:
🗂️
linn/react-components-libraryDescription: A common repository of reusable React components presented in a Storybook development environment.
mainlinnGitHub org)👥 Contributors (from recent commits)
Primarily lewisrenfrew (you!) and richardiphillips, with some contributions from OliverMclachlan.
🕓 Recent Commit Highlights
autoCompleteparam (#395).toString()inuseSearch(#390)ReportDataGrid(#389)useDeletehook (#387)ReportDataGridrow count option & show/hide tweaks (#379, #380)🔍 Overall Feel
This is an internal shared React component library for the Linn organisation, built with:
sxprop references and DataGrid mentions)useSearch,useDeleteReportDataGridcomponent that's seen a lot of activity (row counts, colour attributes, dark mode)This pull request was created from Copilot chat.