How digital-go-jp/design-system-example-components works
Main Components
• UI Component Library:
• This includes all the individual components located in src/components. There are subdirectories for each component (e.g., Accordion, Breadcrumbs, Button, etc.) and a versioned grouping under src/components/v1.
• Storybook Environment:
• The .storybook directory holds configuration files (dadsTheme.ts, main.ts, preview.ts, etc.) that define how the components are presented and interacted with in Storybook.
• Design Tokens & Styling:
• Project Configuration & Miscellaneous:
• Files like package.json, tsconfig.json, and others define the development environment.
• Public assets likely used for static files.
• GitHub workflows and CI/CD files under .github indicate the operational/deployment pipeline (though not the central part of the UI architecture, they are important for continuous integration/deployment).
Relationships and Interactions
• At the core is the Component Library:
• Each component (e.g., Button, Accordion) exposes its functionality as well as Storybook stories to demonstrate usage.
• Some components are built with a composition (having parts subfolders for component internals, like in EmergencyBanner and HamburgerMenuButton) which can be shown as sub-components feeding into the main component.
• Styling and Design Tokens:
• A clear relationship exists between the tokens in src/tokens and how Tailwind CSS (via tailwind.config.js) extends component styling. This ensures that components stay consistent with the Digital Agency Design System.
• Storybook as the Visualization Layer:
• External Dependencies and Plugins:
• The inclusion of packages like @digital-go-jp/tailwind-theme-plugin should be highlighted as an external dependency influencing the styling and design tokens.
Architectural Patterns and Design Principles
• Component-Based Architecture:
• The project leverages reusable, modular components and adheres to the React component paradigm.
• Separation of Concerns:
• The structure separates component implementation from styling (via Tailwind CSS), documentation/demos (via Storybook), and design tokens.
• Consistency Through Tokens:
• Use of design tokens and centralized styling configuration promotes consistency across the UI elements.