@bigtablet/design-system 2.4.4 → 3.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 CHANGED
@@ -1,301 +1,196 @@
1
1
  <div align="center">
2
2
 
3
- <img width="1800" height="300" alt="Image" src="https://github.com/user-attachments/assets/420a15cc-5be3-447f-9c64-068e946cb118" /> <br>
3
+ <img width="1800" height="300" alt="Bigtablet Design System" src="https://github.com/user-attachments/assets/420a15cc-5be3-447f-9c64-068e946cb118" />
4
4
 
5
- # Bigtablet Design System
5
+ <br />
6
+ <br />
6
7
 
7
- [![npm version](https://img.shields.io/npm/v/@bigtablet/design-system.svg)](https://www.npmjs.com/package/@bigtablet/design-system)
8
- [![https://github.com/Bigtablet/.github/blob/main/BIGTABLET_LICENSE.md](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
- [![Test Coverage](https://img.shields.io/badge/coverage-86%25-brightgreen.svg)](https://github.com/Bigtablet/bigtablet-design-system/actions)
10
- [![CI](https://github.com/Bigtablet/bigtablet-design-system/actions/workflows/ci.yml/badge.svg)](https://github.com/Bigtablet/bigtablet-design-system/actions/workflows/ci.yml)
8
+ ### Bigtablet Design System
11
9
 
12
- [🇰🇷 한국어](./README_KR.md) · 🇺🇸 English
10
+ The unified UI library powering Bigtablet products.<br />
11
+ Crafted for clarity. Built on tokens. Ships with dark mode.
13
12
 
14
- The official design system of Bigtablet — a unified UI library composed of Foundation (design tokens) and UI Components.
13
+ <br />
15
14
 
16
- > **Note**: This is Bigtablet's in-house design system, open-sourced for community reference.
17
- > External use is welcome, but minor versions may include breaking changes without prior notice.
15
+ <p>
16
+ <a href="https://www.npmjs.com/package/@bigtablet/design-system"><img src="https://img.shields.io/npm/v/@bigtablet/design-system?style=for-the-badge&color=121212&labelColor=000" alt="npm" /></a>
17
+ <a href="https://github.com/Bigtablet/.github/blob/main/BIGTABLET_LICENSE.md"><img src="https://img.shields.io/badge/license-Bigtablet-303841?style=for-the-badge&labelColor=000" alt="license" /></a>
18
+ <a href="https://github.com/Bigtablet/bigtablet-design-system/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Bigtablet/bigtablet-design-system/ci.yml?style=for-the-badge&color=10b981&labelColor=000" alt="ci" /></a>
19
+ </p>
18
20
 
19
- [GitHub](https://github.com/Bigtablet/bigtablet-design-system) · [NPM](https://www.npmjs.com/package/@bigtablet/design-system)
21
+ [**Documentation**](./docs/COMPONENTS.md)&nbsp;&nbsp;·&nbsp;&nbsp;[Storybook](#development)&nbsp;&nbsp;·&nbsp;&nbsp;[NPM](https://www.npmjs.com/package/@bigtablet/design-system)&nbsp;&nbsp;·&nbsp;&nbsp;[🇰🇷 한국어](./README_KR.md)
20
22
 
21
23
  </div>
22
24
 
23
- ---
24
-
25
- ## Features
26
-
27
- | Feature | Description |
28
- |---------|-------------|
29
- | ⚛️ **React 19** | Full support for the latest React version |
30
- | 🔷 **TypeScript** | Complete type definitions for all components |
31
- | 📦 **Dual Bundle** | Separate bundles optimized for Pure React and Next.js |
32
- | 🌐 **Vanilla JS** | Supports non-React environments (Thymeleaf, JSP, PHP, etc.) |
33
- | 🎨 **Design Tokens** | Consistent token-based system for colors, typography, spacing |
34
- | ♿ **Accessibility** | Keyboard navigation, screen reader support, full ARIA attributes |
35
- | 🧪 **86% Coverage** | Stable test coverage powered by Vitest |
36
- | 🎭 **Storybook** | Interactive component documentation (run locally via `pnpm storybook`) |
37
- | 🎯 **Zero Dependencies** | No bundled runtime dependencies — peer deps only |
38
-
39
- ---
40
-
41
- ## Installation
42
-
43
- ### One-line setup (recommended)
44
-
45
- Auto-detects your package manager (npm / yarn / pnpm / bun) and environment (React / Next.js), installs the package + peer deps, and prints CSS/Provider setup instructions.
46
-
47
- ```bash
48
- curl -fsSL https://raw.githubusercontent.com/Bigtablet/bigtablet-design-system/main/scripts/setup.sh | sh
49
- ```
50
-
51
- ### Manual
52
-
53
- ```bash
54
- # npm
55
- npm install @bigtablet/design-system react@^19 react-dom@^19 lucide-react
56
-
57
- # yarn
58
- yarn add @bigtablet/design-system react@^19 react-dom@^19 lucide-react
59
-
60
- # pnpm
61
- pnpm add @bigtablet/design-system react@^19 react-dom@^19 lucide-react
62
- ```
63
-
64
- > Requires **React 19** and **lucide-react ≥ 0.552.0**. Compatible with **Next.js 13+**.
65
-
66
- ---
67
-
68
- ## Quick Start
69
-
70
- > ⚠️ **Alert** and **Toast** require Providers at the root of your app — see [Provider Setup](#provider-setup) below.
71
-
72
- ### Pure React
25
+ <br />
73
26
 
74
27
  ```tsx
75
- import { Button, TextField, Modal } from '@bigtablet/design-system';
76
- import '@bigtablet/design-system/style.css';
77
-
78
- function App() {
79
- const [open, setOpen] = React.useState(false);
28
+ import { ThemeProvider, Button, Modal, useToast } from "@bigtablet/design-system";
29
+ import "@bigtablet/design-system/style.css";
80
30
 
31
+ export default function App() {
32
+ const toast = useToast();
81
33
  return (
82
- <div>
83
- <TextField
84
- label="Email"
85
- placeholder="email@example.com"
86
- supportingText="Please enter your work email."
87
- />
88
- <Button variant="primary" onClick={() => setOpen(true)}>Confirm</Button>
89
- <Modal open={open} onClose={() => setOpen(false)} title="Notice">
90
- Hello!
91
- </Modal>
92
- </div>
34
+ <ThemeProvider>
35
+ <Button onClick={() => toast.success("Saved")}>Save</Button>
36
+ </ThemeProvider>
93
37
  );
94
38
  }
95
39
  ```
96
40
 
97
- ### Next.js
41
+ A complete React + TypeScript design system maintained by Bigtablet for internal product work. Open-sourced for reference — external use welcome, but minor versions may include breaking changes.
98
42
 
99
- In a Next.js environment, the `/next` entry point is reserved for future Next.js-specific exports. Currently all components are framework-agnostic:
43
+ <br />
100
44
 
101
- ```tsx
102
- // app/layout.tsx
103
- import { Button, TextField, Modal } from '@bigtablet/design-system';
104
- import '@bigtablet/design-system/style.css';
105
- ```
45
+ ## What's inside
106
46
 
107
- ### Provider Setup
47
+ **40+ components** across forms, display, feedback, navigation, overlay, and layout<br />
48
+ — **11 token domains** — colors, typography, spacing, motion, radius, elevation, and more — exposed as SCSS variables and CSS custom properties<br />
49
+ — **Light + dark mode** out of the box. `[data-theme="dark"]` or `prefers-color-scheme`, no theme provider required (but available via `ThemeProvider` for runtime toggling)<br />
50
+ — **Vanilla JS bundle** for non-React backends — Thymeleaf, JSP, PHP, Django<br />
51
+ — **Accessibility tested** with axe-core in CI · keyboard nav · ARIA throughout
108
52
 
109
- `Alert` and `Toast` require Providers to be added at the root of your app.
53
+ <br />
110
54
 
111
- ```tsx
112
- // app/layout.tsx or _app.tsx
113
- import { AlertProvider, ToastProvider } from '@bigtablet/design-system';
55
+ ## Install
114
56
 
115
- export default function RootLayout({ children }) {
116
- return (
117
- <html>
118
- <body>
119
- <AlertProvider>
120
- <ToastProvider>
121
- {children}
122
- </ToastProvider>
123
- </AlertProvider>
124
- </body>
125
- </html>
126
- );
127
- }
57
+ ```bash
58
+ pnpm add @bigtablet/design-system react@^19 react-dom@^19 lucide-react
128
59
  ```
129
60
 
130
- **Alert usage**
61
+ Requires React 19 + lucide-react ≥ 0.552. Compatible with Next.js 13+.
131
62
 
132
- ```tsx
133
- import { useAlert } from '@bigtablet/design-system';
63
+ <details>
64
+ <summary><b>One-line setup</b> auto-detect package manager + framework</summary>
134
65
 
135
- function MyComponent() {
136
- const { showAlert } = useAlert();
66
+ <br />
137
67
 
138
- return (
139
- <Button
140
- onClick={() =>
141
- showAlert({
142
- title: 'Delete',
143
- message: 'Are you sure you want to delete this?',
144
- showCancel: true,
145
- onConfirm: () => console.log('Deleted'),
146
- })
147
- }
148
- >
149
- Delete
150
- </Button>
151
- );
152
- }
68
+ ```bash
69
+ curl -fsSL https://raw.githubusercontent.com/Bigtablet/bigtablet-design-system/main/scripts/setup.sh | sh
153
70
  ```
154
71
 
155
- **Toast usage**
72
+ Detects npm / yarn / pnpm / bun and React / Next.js, installs deps, prints CSS + provider setup steps.
156
73
 
157
- ```tsx
158
- import { useToast } from '@bigtablet/design-system';
74
+ </details>
159
75
 
160
- function MyComponent() {
161
- const toast = useToast();
76
+ <br />
162
77
 
163
- return (
164
- <div>
165
- <Button onClick={() => toast.success('Saved successfully!')}>Save</Button>
166
- <Button onClick={() => toast.error('An error occurred.')}>Error</Button>
167
- <Button onClick={() => toast.warning('Session expiring soon.')}>Warning</Button>
168
- <Button onClick={() => toast.info('New version available.')}>Info</Button>
169
- {/* Custom duration (ms) as second argument */}
170
- <Button onClick={() => toast.success('Saved!', 5000)}>Save (5s)</Button>
171
- </div>
172
- );
173
- }
174
- ```
78
+ ## Providers
175
79
 
176
- ### Vanilla JS (HTML/CSS/JS)
80
+ ```tsx
81
+ import { ThemeProvider, AlertProvider, ToastProvider } from "@bigtablet/design-system";
177
82
 
178
- For non-React environments (Thymeleaf, JSP, PHP, etc.), use directly via CDN.
83
+ <ThemeProvider>
84
+ <AlertProvider>
85
+ <ToastProvider>{children}</ToastProvider>
86
+ </AlertProvider>
87
+ </ThemeProvider>
88
+ ```
179
89
 
180
- ```html
181
- <link rel="stylesheet" href="https://unpkg.com/@bigtablet/design-system/dist/vanilla/bigtablet.min.css">
182
- <script src="https://unpkg.com/@bigtablet/design-system/dist/vanilla/bigtablet.min.js"></script>
90
+ Use the hooks anywhere:
183
91
 
184
- <!-- Button -->
185
- <button class="bt-button bt-button--md bt-button--primary">Primary</button>
186
- <button class="bt-button bt-button--md bt-button--secondary">Secondary</button>
187
-
188
- <!-- TextField -->
189
- <div class="bt-text-field">
190
- <label class="bt-text-field__label">Name</label>
191
- <div class="bt-text-field__wrap">
192
- <input type="text" class="bt-text-field__input bt-text-field__input--outline bt-text-field__input--md" placeholder="Enter text...">
193
- </div>
194
- </div>
92
+ ```tsx
93
+ const toast = useToast();
94
+ const { showAlert } = useAlert();
195
95
 
196
- <!-- Alert (JS API) -->
197
- <script>
198
- Bigtablet.Alert({
199
- title: 'Confirm',
200
- message: 'Do you want to continue?',
201
- showCancel: true,
202
- onConfirm: () => console.log('Confirmed'),
203
- });
204
- </script>
96
+ toast.success("Saved");
97
+ showAlert({ title: "Delete?", showCancel: true, onConfirm: ... });
205
98
  ```
206
99
 
207
- ---
100
+ <br />
208
101
 
209
102
  ## Components
210
103
 
211
- | Category | Components |
212
- |----------|------------|
213
- | **General** | `Button`, `Select`, `Chip`, `FAB`, `IconButton` |
214
- | **Form** | `TextField`, `Checkbox`, `Radio`, `Toggle`, `DatePicker`, `FileInput` |
215
- | **Feedback** | `Alert`, `Toast`, `Spinner`, `TopLoading`, `LinearProgress` |
216
- | **Navigation** | `Pagination` |
217
- | **Overlay** | `Modal` |
218
- | **Display** | `Card`, `Divider`, `ListItem` |
219
-
220
- 👉 **[Full Component Docs](./docs/COMPONENTS.md)**
104
+ <table>
105
+ <tr><td><b>Forms</b></td><td>Button · IconButton · TextField · Checkbox · Radio · Toggle · Dropdown · DatePicker · FileInput · OTPInput</td></tr>
106
+ <tr><td><b>Display</b></td><td>Card · MediaCard · Hero · Avatar · Badge · Chip · ListItem · Table · Divider · Icon · Accordion</td></tr>
107
+ <tr><td><b>Feedback</b></td><td>Alert · Toast · Spinner · TopLoading · LinearProgress · Skeleton · EmptyState</td></tr>
108
+ <tr><td><b>Navigation</b></td><td>Tabs · Sidebar · NavBar · Breadcrumb · Menu · Pagination</td></tr>
109
+ <tr><td><b>Overlay</b></td><td>Modal · Tooltip</td></tr>
110
+ <tr><td><b>Layout</b></td><td>Container · Section · Stack · Grid</td></tr>
111
+ </table>
221
112
 
222
- ---
113
+ →&nbsp;Full API · [`docs/COMPONENTS.md`](./docs/COMPONENTS.md)
223
114
 
224
- ## Design Tokens
115
+ <br />
225
116
 
226
- SCSS tokens and CSS custom properties are provided for a consistent design.
117
+ ## Design tokens
227
118
 
228
119
  ```scss
229
- // SCSS
230
120
  @use "src/styles/token" as token;
231
121
 
232
- .my-component {
233
- color: token.$color_text_primary;
234
- padding: token.$spacing_md;
122
+ .card {
123
+ background: token.$color_bg_solid;
124
+ color: token.$color_text_heading;
125
+ padding: token.$spacing_16;
235
126
  border-radius: token.$radius_md;
127
+ box-shadow: token.$elevation_level1;
236
128
  }
237
129
  ```
238
130
 
239
131
  ```css
240
- /* CSS Custom Properties */
241
- .my-component {
242
- color: var(--bt-color-text-primary);
243
- padding: var(--bt-spacing-md);
132
+ .card {
133
+ background: var(--bt-color-bg-solid);
134
+ color: var(--bt-color-text-heading);
135
+ padding: var(--bt-spacing-16);
244
136
  border-radius: var(--bt-radius-md);
137
+ box-shadow: var(--bt-elevation-level1);
245
138
  }
246
139
  ```
247
140
 
248
- Main token categories: `colors`, `spacing`, `typography`, `radius`, `shadows`, `motion`, `z-index`, `breakpoints`
141
+ `colors`&nbsp;·&nbsp;`spacing`&nbsp;·&nbsp;`typography`&nbsp;·&nbsp;`radius`&nbsp;·&nbsp;`elevation`&nbsp;·&nbsp;`motion`&nbsp;·&nbsp;`z-index`&nbsp;·&nbsp;`breakpoints`&nbsp;·&nbsp;`border-width`&nbsp;·&nbsp;`opacity`&nbsp;·&nbsp;`a11y`
249
142
 
250
- ---
143
+ <br />
251
144
 
252
- ## Documentation
145
+ ## Vanilla JS
146
+
147
+ For server-rendered apps (Thymeleaf, JSP, PHP, Django):
148
+
149
+ ```html
150
+ <link rel="stylesheet" href="https://unpkg.com/@bigtablet/design-system/dist/vanilla/bigtablet.min.css">
151
+ <script src="https://unpkg.com/@bigtablet/design-system/dist/vanilla/bigtablet.min.js"></script>
152
+
153
+ <button class="bt-button bt-button--md bt-button--primary">Primary</button>
154
+ ```
253
155
 
254
- | Document | Description |
255
- |----------|-------------|
256
- | [Components](./docs/COMPONENTS.md) | Component Props API & usage examples |
257
- | [Vanilla JS](./docs/VANILLA.md) | Integration guide for non-React environments |
258
- | [Architecture](./docs/ARCHITECTURE.md) | Project structure & design principles |
259
- | [Contributing](./docs/CONTRIBUTING.md) | Dev setup & contribution guide |
260
- | [Testing](./docs/TESTING.md) | Test writing patterns & guide |
156
+ →&nbsp;Full guide · [`docs/VANILLA.md`](./docs/VANILLA.md)
261
157
 
262
- ---
158
+ <br />
263
159
 
264
160
  ## Development
265
161
 
266
162
  ```bash
267
- pnpm install # Install dependencies
268
- pnpm storybook # Start Storybook (port 6006)
269
- pnpm build # Build library
270
- pnpm dev # Watch mode
271
- pnpm test # Run tests
272
- pnpm test:storybook # Run a11y tests (Storybook + Playwright)
273
- pnpm test:coverage # Coverage report
163
+ pnpm install
164
+ pnpm storybook # localhost:6006
165
+ pnpm test # Vitest unit
166
+ pnpm test:storybook # a11y + Playwright
167
+ pnpm build # tsup + SCSS copy
274
168
  ```
275
169
 
276
- > Detailed dev setup guide → **[Contributing](./docs/CONTRIBUTING.md)**
277
-
278
- ---
170
+ <br />
279
171
 
280
- ## Browser Support
172
+ ## Documentation
281
173
 
282
- | Browser | Version |
283
- |---------|---------|
284
- | Chrome | 80+ |
285
- | Firefox | 75+ |
286
- | Safari | 13+ |
287
- | Edge | 80+ |
174
+ | | |
175
+ |---|---|
176
+ | 📚 [Components](./docs/COMPONENTS.md) | Props API + usage per component |
177
+ | 🏗️ [Architecture](./docs/ARCHITECTURE.md) | Project structure + design principles |
178
+ | 🤝 [Contributing](./docs/CONTRIBUTING.md) | Dev setup + workflow |
179
+ | 🧪 [Testing](./docs/TESTING.md) | Test patterns + a11y testing |
180
+ | 🌐 [Vanilla JS](./docs/VANILLA.md) | HTML/CSS/JS integration |
288
181
 
289
- ---
182
+ <br />
290
183
 
291
184
  ## License
292
185
 
293
- [Bigtablet License](https://github.com/Bigtablet/.github/blob/main/BIGTABLET_LICENSE.md)
186
+ Licensed under the [Bigtablet License](https://github.com/Bigtablet/.github/blob/main/BIGTABLET_LICENSE.md).
294
187
 
295
- ---
188
+ <br />
296
189
 
297
190
  <div align="center">
298
191
 
299
- [GitHub](https://github.com/Bigtablet/bigtablet-design-system) · [NPM](https://www.npmjs.com/package/@bigtablet/design-system) · [Issues](https://github.com/Bigtablet/bigtablet-design-system/issues)
192
+ <sub>Made with care by the Bigtablet team.</sub>
193
+
194
+ <sub>[GitHub](https://github.com/Bigtablet/bigtablet-design-system) · [Issues](https://github.com/Bigtablet/bigtablet-design-system/issues) · [NPM](https://www.npmjs.com/package/@bigtablet/design-system)</sub>
300
195
 
301
196
  </div>