@bigtablet/design-system 2.5.0 → 3.1.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 +113 -218
- package/dist/index.css +9240 -646
- package/dist/index.d.ts +976 -78
- package/dist/index.js +1890 -1018
- package/dist/styles/a11y/_index.scss +64 -4
- package/dist/styles/border-width/_index.scss +1 -0
- package/dist/styles/colors/_index.scss +238 -38
- package/dist/styles/elevation/_index.scss +36 -5
- package/dist/styles/motion/_index.scss +19 -4
- package/dist/styles/skeleton/_index.scss +5 -3
- package/dist/styles/typography/_index.scss +71 -0
- package/dist/vanilla/bigtablet.min.css +1 -1
- package/package.json +29 -28
package/README.md
CHANGED
|
@@ -1,301 +1,196 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img width="1800" height="300" alt="
|
|
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
|
-
|
|
5
|
+
<br />
|
|
6
|
+
<br />
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
[](LICENSE)
|
|
9
|
-
[](https://github.com/Bigtablet/bigtablet-design-system/actions)
|
|
10
|
-
[](https://github.com/Bigtablet/bigtablet-design-system/actions/workflows/ci.yml)
|
|
8
|
+
### Bigtablet Design System
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
The unified UI library powering Bigtablet products.<br />
|
|
11
|
+
Crafted for clarity. Built on tokens. Ships with dark mode.
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
<br />
|
|
15
14
|
|
|
16
|
-
>
|
|
17
|
-
|
|
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
|
-
[
|
|
21
|
+
[**Documentation**](./docs/COMPONENTS.md) · [Storybook](#development) · [NPM](https://www.npmjs.com/package/@bigtablet/design-system) · [🇰🇷 한국어](./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 {
|
|
76
|
-
import
|
|
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
|
-
<
|
|
83
|
-
<
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
+
<br />
|
|
100
44
|
|
|
101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
53
|
+
<br />
|
|
110
54
|
|
|
111
|
-
|
|
112
|
-
// app/layout.tsx or _app.tsx
|
|
113
|
-
import { AlertProvider, ToastProvider } from '@bigtablet/design-system';
|
|
55
|
+
## Install
|
|
114
56
|
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
61
|
+
Requires React 19 + lucide-react ≥ 0.552. Compatible with Next.js 13+.
|
|
131
62
|
|
|
132
|
-
|
|
133
|
-
|
|
63
|
+
<details>
|
|
64
|
+
<summary><b>One-line setup</b> — auto-detect package manager + framework</summary>
|
|
134
65
|
|
|
135
|
-
|
|
136
|
-
const { showAlert } = useAlert();
|
|
66
|
+
<br />
|
|
137
67
|
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
72
|
+
Detects npm / yarn / pnpm / bun and React / Next.js, installs deps, prints CSS + provider setup steps.
|
|
156
73
|
|
|
157
|
-
|
|
158
|
-
import { useToast } from '@bigtablet/design-system';
|
|
74
|
+
</details>
|
|
159
75
|
|
|
160
|
-
|
|
161
|
-
const toast = useToast();
|
|
76
|
+
<br />
|
|
162
77
|
|
|
163
|
-
|
|
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
|
-
|
|
80
|
+
```tsx
|
|
81
|
+
import { ThemeProvider, AlertProvider, ToastProvider } from "@bigtablet/design-system";
|
|
177
82
|
|
|
178
|
-
|
|
83
|
+
<ThemeProvider>
|
|
84
|
+
<AlertProvider>
|
|
85
|
+
<ToastProvider>{children}</ToastProvider>
|
|
86
|
+
</AlertProvider>
|
|
87
|
+
</ThemeProvider>
|
|
88
|
+
```
|
|
179
89
|
|
|
180
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
197
|
-
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
+
→ Full API · [`docs/COMPONENTS.md`](./docs/COMPONENTS.md)
|
|
223
114
|
|
|
224
|
-
|
|
115
|
+
<br />
|
|
225
116
|
|
|
226
|
-
|
|
117
|
+
## Design tokens
|
|
227
118
|
|
|
228
119
|
```scss
|
|
229
|
-
// SCSS
|
|
230
120
|
@use "src/styles/token" as token;
|
|
231
121
|
|
|
232
|
-
.
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
|
|
241
|
-
|
|
242
|
-
color: var(--bt-color-text-
|
|
243
|
-
padding: var(--bt-spacing-
|
|
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
|
-
|
|
141
|
+
`colors` · `spacing` · `typography` · `radius` · `elevation` · `motion` · `z-index` · `breakpoints` · `border-width` · `opacity` · `a11y`
|
|
249
142
|
|
|
250
|
-
|
|
143
|
+
<br />
|
|
251
144
|
|
|
252
|
-
##
|
|
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
|
-
|
|
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
|
+
→ 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
|
|
268
|
-
pnpm storybook
|
|
269
|
-
pnpm
|
|
270
|
-
pnpm
|
|
271
|
-
pnpm
|
|
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
|
-
|
|
277
|
-
|
|
278
|
-
---
|
|
170
|
+
<br />
|
|
279
171
|
|
|
280
|
-
##
|
|
172
|
+
## Documentation
|
|
281
173
|
|
|
282
|
-
|
|
|
283
|
-
|
|
284
|
-
|
|
|
285
|
-
|
|
|
286
|
-
|
|
|
287
|
-
|
|
|
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
|
-
|
|
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>
|