bluconndesign 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -0
- package/dist/index.d.mts +2178 -0
- package/dist/index.d.ts +2178 -0
- package/dist/index.js +12390 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12277 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme/index.d.mts +102 -0
- package/dist/theme/index.d.ts +102 -0
- package/dist/theme/index.js +2262 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/index.mjs +2139 -0
- package/dist/theme/index.mjs.map +1 -0
- package/dist/theme-BTyiMh3f.d.mts +310 -0
- package/dist/theme-BTyiMh3f.d.ts +310 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Design System
|
|
2
|
+
|
|
3
|
+
An internal design system built with **React**, **Material-UI**, and **TypeScript**. This package provides a set of reusable UI components and a customized theme to ensure visual consistency across applications.
|
|
4
|
+
|
|
5
|
+
## 🚀 Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js (v18 or higher recommended)
|
|
10
|
+
- npm or yarn
|
|
11
|
+
|
|
12
|
+
### Installation
|
|
13
|
+
|
|
14
|
+
1. Clone the repository
|
|
15
|
+
2. Install dependencies:
|
|
16
|
+
```bash
|
|
17
|
+
npm install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 🛠️ Development
|
|
21
|
+
|
|
22
|
+
We use **Storybook** for component development and documentation.
|
|
23
|
+
|
|
24
|
+
### Running Storybook
|
|
25
|
+
To start the local development server for Storybook:
|
|
26
|
+
```bash
|
|
27
|
+
npm run storybook
|
|
28
|
+
```
|
|
29
|
+
This will open the Storybook UI in your browser (usually at `http://localhost:6006`).
|
|
30
|
+
|
|
31
|
+
### Building the Library
|
|
32
|
+
To build the design system for production distribution:
|
|
33
|
+
```bash
|
|
34
|
+
npm run build
|
|
35
|
+
```
|
|
36
|
+
The output will be in the `dist/` directory.
|
|
37
|
+
|
|
38
|
+
## 🏗️ How to Change
|
|
39
|
+
|
|
40
|
+
### 1. Adding or Modifying Components
|
|
41
|
+
Components are located in `src/components/`. Each component follows this structure:
|
|
42
|
+
```text
|
|
43
|
+
src/components/MyComponent/
|
|
44
|
+
├── MyComponent.tsx # Component logic
|
|
45
|
+
├── MyComponent.stories.tsx # Storybook stories/documentation
|
|
46
|
+
└── index.ts # Public export
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**To add a new component:**
|
|
50
|
+
1. Create a new directory in `src/components/`.
|
|
51
|
+
2. Implement your component and its stories.
|
|
52
|
+
3. Export the component from `src/components/index.ts`.
|
|
53
|
+
|
|
54
|
+
### 2. Customizing the Theme
|
|
55
|
+
The theme is globally managed in `src/theme/`.
|
|
56
|
+
|
|
57
|
+
- **Colors**: Modified in `src/theme/colour.ts` or via design tokens in `src/tokens/`.
|
|
58
|
+
- **Typography**: Configured in `src/theme/typography.ts`.
|
|
59
|
+
- **Component Overrides**: MUI component defaults (like button padding or border-radius) are customized in `src/theme/components/`.
|
|
60
|
+
- **Main Config**: `src/theme/theme.ts` brings everything together.
|
|
61
|
+
|
|
62
|
+
### 3. Design Tokens
|
|
63
|
+
Shared tokens (colors, spacing, etc.) are stored in `src/tokens/`. Updating these tokens will automatically propagate changes to the theme.
|
|
64
|
+
|
|
65
|
+
## 📁 Project Structure
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
├── .storybook/ # Storybook configuration
|
|
69
|
+
├── src/
|
|
70
|
+
│ ├── components/ # UI Components
|
|
71
|
+
│ ├── theme/ # MUI Theme configuration
|
|
72
|
+
│ ├── tokens/ # Design tokens (JSON)
|
|
73
|
+
│ ├── index.ts # Main entry point (exports all components)
|
|
74
|
+
│ └── theme/index.ts # Theme entry point (exports the theme)
|
|
75
|
+
├── dist/ # Compiled build artifacts
|
|
76
|
+
└── tsup.config.ts # Build configuration (tsup)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 📦 Usage in Other Projects
|
|
80
|
+
|
|
81
|
+
Once published, you can use the design system in your React app:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { Button } from 'design_system';
|
|
85
|
+
import { theme } from 'design_system/theme';
|
|
86
|
+
import { ThemeProvider } from '@mui/material';
|
|
87
|
+
|
|
88
|
+
function App() {
|
|
89
|
+
return (
|
|
90
|
+
<ThemeProvider theme={theme}>
|
|
91
|
+
<Button variant="contained">Click Me</Button>
|
|
92
|
+
</ThemeProvider>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|