Skip to content

feat: add Storybook stories for remaining UI primitives#1

Open
Dennis-Ritchie1 wants to merge 2 commits into
mainfrom
feat/ui-storybook-stories
Open

feat: add Storybook stories for remaining UI primitives#1
Dennis-Ritchie1 wants to merge 2 commits into
mainfrom
feat/ui-storybook-stories

Conversation

@Dennis-Ritchie1

Copy link
Copy Markdown
Owner

Description

Storybook was configured with only a preview setup. Several primitives in frontend/src/components/UI/ had no stories. This PR adds story coverage so every UI primitive has a default plus meaningful variants.

Changes

  • ConfirmModal.stories.tsx — default, no-description, destructive action, and closed states (uses @storybook/test fn() for callbacks).
  • ProgressIndicator.stories.tsx — pending, in-progress, completed, and error states.
  • InsufficientBalanceWarning.stories.tsx — testnet, mainnet, and large-shortfall states, wrapped in mocked WalletContext / ToastContext providers.
  • .gitignore — ignore the storybook-static/ build output.

Button.stories.tsx and Input.stories.tsx already existed, so all five primitives (Button, Input, ConfirmModal, ProgressIndicator, InsufficientBalanceWarning) are now covered.

The build-storybook step already runs in .github/workflows/storybook.yml, so no workflow change was needed.

Acceptance criteria

  • Each UI primitive has at least 2 stories (default + variant)
  • Default / variant states cover disabled, loading, and error where applicable
  • npm run build-storybook succeeds locally
  • CI Storybook build (storybook.yml) exercises the same build

Verification

cd frontend
npm ci --legacy-peer-deps
npm run build-storybook   # ✓ builds, output in storybook-static/

Notes

Scope was kept strictly to the Storybook stories deliverable. Pre-existing repo-wide lint/format/test baseline issues (unrelated to these additive story files) were intentionally left untouched.

…InsufficientBalanceWarning

Adds *.stories.tsx coverage for the remaining UI primitives so every
component in src/components/UI/ has a default plus meaningful variants:

- ConfirmModal: default, no-description, destructive, and closed states
- ProgressIndicator: pending, in-progress, completed, and error states
- InsufficientBalanceWarning: testnet, mainnet, and large-shortfall states
  (wrapped in mocked Wallet/Toast context providers)

Also ignores the Storybook build output (storybook-static/). The
build-storybook step already runs in .github/workflows/storybook.yml and
passes locally via `npm run build-storybook`.
The Storybook CI job installs with `npm install --legacy-peer-deps`, which
skips peer dependencies. esbuild was only present as a peer dep, so
esbuild-register (used to evaluate .storybook/main.ts) failed with
"Cannot find module 'esbuild'" in CI. Declaring esbuild directly ensures
it is hoisted to top-level node_modules during the workflow build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant