Skip to content

Scaffold UI library with Storybook and add NavBar component#25

Merged
krellekrelle merged 5 commits into
mainfrom
feat/ui-library
May 27, 2026
Merged

Scaffold UI library with Storybook and add NavBar component#25
krellekrelle merged 5 commits into
mainfrom
feat/ui-library

Conversation

@krellekrelle

@krellekrelle krellekrelle commented May 27, 2026

Copy link
Copy Markdown
Owner

This pull request introduces the initial implementation of a new React UI component library, including core components, their styles, Storybook configuration, and packaging setup. The main focus is on providing reusable, styled components (Button, Card, Badge, NavBar), complete with Storybook stories for documentation and testing, and setting up the project for distribution as a package.

Component Implementation and Exports:

  • Added Button, Card, Badge, and NavBar components with corresponding TypeScript types, CSS modules for styling, and index files for exports. Each component supports variants, sizing, and composability as appropriate. (src/components/Button/Button.tsx, src/components/Card/Card.tsx, src/components/Badge/Badge.tsx, src/components/NavBar/NavBar.tsx, src/components/Button/index.ts, src/components/Card/index.ts, src/components/Badge/index.ts, src/components/NavBar/index.ts) [1] [2] [3] [4] [5] [6] [7] [8]

  • Created CSS modules for each component, defining consistent design tokens, variants, and responsive styles. (src/components/Button/Button.module.css, src/components/Card/Card.module.css, src/components/Badge/Badge.module.css, src/components/NavBar/NavBar.module.css) [1] [2] [3] [4]

Storybook Integration:

  • Added Storybook stories for all components, demonstrating their variants, states, and usage patterns to facilitate documentation and visual testing. (src/components/Button/Button.stories.tsx, src/components/Card/Card.stories.tsx, src/components/Badge/Badge.stories.tsx, src/components/NavBar/NavBar.stories.tsx) [1] [2] [3] [4]

  • Configured Storybook with Vite for fast development, including a preview file to apply design tokens and set up controls/layout. (.storybook/main.ts, .storybook/preview.ts) [1] [2]

Project Setup and Packaging:

  • Added a package.json for the UI library, specifying build scripts, dependencies, and export structure for compatibility with modern bundlers and consumers. (package.json)

  • Created a central index.ts entry point to export all components and import design tokens CSS. (src/index.ts)

- React 18 + TypeScript + Vite library mode
- Storybook 8 with react-vite framework
- Design tokens CSS (colors, spacing, typography, shadows)
- Button: primary/secondary/ghost/danger variants, sm/md/lg sizes
- Card: optional title and footer slots
- Badge: success/warning/error/info/neutral variants
  - UserStatus story maps to platform three-tier user status
- Tokens: update semantic colors to platform dark theme (#0b162b bg,
  #e5eefc text, rgba borders, Inter font-family)
- NavBar: sticky top bar with glass/blur effect matching platform style
  - Props: title, subtitle, links[], user, actions
  - User pill with avatar initial + Badge for user status
  - Active link highlight with blue tint
  - Stories: TitleOnly, WithUser, WithNavLinks, WithActions, user statuses
- Replace vanilla HTML/CSS/JS with React 18 + Vite frontend
- NavBar: subtitle='Platform', title, user pill, back to dashboard action
- Card: greeting text + meta list (service, user, timestamp) + footer button
- Button: 'New Message' (primary), '← Dashboard' (ghost)
- App.css: page background gradient + meta-list layout (no component CSS)

- server.js: serve frontend/dist/ statically, add /api/user endpoint
- Dockerfile: multi-stage build (frontend-build → production server)
  - Build context expanded to monorepo root for ui-library access
- docker-compose.yml: build context: . / dockerfile: hello-world-app/Dockerfile
- vite.config.js: resolve alias points to ui-library/src (no pre-build needed)
- Add .dockerignore at monorepo root: exclude **/node_modules/, .git/,
  **/dist/ — prevents local npm symlinks conflicting with Docker COPY
- Remove .dockerignore from .gitignore so it can be tracked
- CI: matrix include override for hello-world-app (context '.', explicit dockerfile)
- CI: trigger hello-world-app rebuild on ui-library/** changes
- CI: always-explicit file: path (no empty-string fallback)
@krellekrelle
krellekrelle merged commit e5828c3 into main May 27, 2026
5 checks passed
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