@hellboy/ds 0.1.3 → 0.2.7
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 +512 -162
- package/{src/style/components/badge → dist/components}/badge.css +9 -25
- package/dist/components/badge.d.mts +12 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +42 -0
- package/dist/components/badge.mjs +15 -0
- package/dist/components/banner.css +280 -0
- package/dist/components/banner.d.mts +12 -0
- package/dist/components/banner.d.ts +12 -0
- package/dist/components/banner.js +184 -0
- package/dist/components/banner.mjs +147 -0
- package/dist/components/button-group.css +289 -0
- package/dist/components/button-group.d.mts +81 -0
- package/dist/components/button-group.d.ts +81 -0
- package/dist/components/button-group.js +180 -0
- package/dist/components/button-group.mjs +143 -0
- package/{src/style/components/button → dist/components}/button.css +59 -62
- package/dist/components/button.d.mts +57 -0
- package/dist/components/button.d.ts +57 -0
- package/dist/components/button.js +129 -0
- package/dist/components/button.mjs +92 -0
- package/{src/style/components/card → dist/components}/card.css +9 -30
- package/dist/components/card.d.mts +31 -0
- package/dist/components/card.d.ts +31 -0
- package/dist/components/card.js +59 -0
- package/dist/components/card.mjs +32 -0
- package/{src/style → dist}/components/checkbox.css +51 -43
- package/dist/components/checkbox.d.mts +31 -0
- package/dist/components/checkbox.d.ts +31 -0
- package/dist/components/checkbox.js +130 -0
- package/dist/components/checkbox.mjs +93 -0
- package/{src/style/components/code-block → dist/components}/code-block.css +3 -7
- package/dist/components/code-block.d.mts +24 -0
- package/dist/components/code-block.d.ts +24 -0
- package/dist/components/code-block.js +43 -0
- package/dist/components/code-block.mjs +16 -0
- package/dist/components/color-control.css +285 -0
- package/dist/components/color-control.d.mts +5 -0
- package/dist/components/color-control.d.ts +5 -0
- package/dist/components/color-control.js +534 -0
- package/dist/components/color-control.mjs +497 -0
- package/dist/components/dialog.css +930 -0
- package/dist/components/dialog.d.mts +32 -0
- package/dist/components/dialog.d.ts +32 -0
- package/dist/components/dialog.js +1111 -0
- package/dist/components/dialog.mjs +1074 -0
- package/dist/components/divider.css +356 -0
- package/dist/components/divider.d.mts +32 -0
- package/dist/components/divider.d.ts +32 -0
- package/dist/components/divider.js +344 -0
- package/dist/components/divider.mjs +307 -0
- package/{src/style/components/drag-handle → dist/components}/drag-handle.css +3 -18
- package/dist/components/drag-handle.d.mts +11 -0
- package/dist/components/drag-handle.d.ts +11 -0
- package/dist/components/drag-handle.js +103 -0
- package/dist/components/drag-handle.mjs +66 -0
- package/dist/components/drawer.css +1027 -0
- package/dist/components/drawer.d.mts +14 -0
- package/dist/components/drawer.d.ts +14 -0
- package/dist/components/drawer.js +1072 -0
- package/dist/components/drawer.mjs +1035 -0
- package/dist/components/floating-bar.css +17 -0
- package/dist/components/floating-bar.d.mts +25 -0
- package/dist/components/floating-bar.d.ts +25 -0
- package/dist/components/floating-bar.js +52 -0
- package/dist/components/floating-bar.mjs +25 -0
- package/dist/components/footer.css +40 -0
- package/dist/components/footer.d.mts +8 -0
- package/dist/components/footer.d.ts +8 -0
- package/dist/components/footer.js +44 -0
- package/dist/components/footer.mjs +17 -0
- package/dist/components/grid.css +47 -0
- package/dist/components/grid.d.mts +27 -0
- package/dist/components/grid.d.ts +27 -0
- package/dist/components/grid.js +52 -0
- package/dist/components/grid.mjs +25 -0
- package/dist/components/header.css +1075 -0
- package/dist/components/header.d.mts +35 -0
- package/dist/components/header.d.ts +35 -0
- package/dist/components/header.js +1402 -0
- package/dist/components/header.mjs +1365 -0
- package/dist/components/hero.css +121 -0
- package/dist/components/hero.d.mts +111 -0
- package/dist/components/hero.d.ts +111 -0
- package/dist/components/hero.js +285 -0
- package/dist/components/hero.mjs +248 -0
- package/{src/style/components/icons → dist/components}/icons.css +14 -15
- package/dist/components/icons.d.mts +104 -0
- package/dist/components/icons.d.ts +104 -0
- package/dist/components/icons.js +239 -0
- package/dist/components/icons.mjs +203 -0
- package/{src/style/components/input → dist/components}/input.css +189 -102
- package/dist/components/input.d.mts +114 -0
- package/dist/components/input.d.ts +114 -0
- package/dist/components/input.js +926 -0
- package/dist/components/input.mjs +879 -0
- package/dist/components/layout.css +551 -0
- package/dist/components/layout.d.mts +16 -0
- package/dist/components/layout.d.ts +16 -0
- package/dist/components/layout.js +387 -0
- package/dist/components/layout.mjs +352 -0
- package/{src/style/components/list → dist/components}/list.css +47 -41
- package/dist/components/list.d.mts +46 -0
- package/dist/components/list.d.ts +46 -0
- package/dist/components/list.js +124 -0
- package/dist/components/list.mjs +96 -0
- package/dist/components/navbar.css +706 -0
- package/dist/components/navbar.d.mts +56 -0
- package/dist/components/navbar.d.ts +56 -0
- package/dist/components/navbar.js +994 -0
- package/dist/components/navbar.mjs +952 -0
- package/{src/style/components/page-index → dist/components}/page-index.css +2 -47
- package/dist/components/page-index.d.mts +25 -0
- package/dist/components/page-index.d.ts +25 -0
- package/dist/components/page-index.js +239 -0
- package/dist/components/page-index.mjs +202 -0
- package/{src/style/components/page → dist/components}/page.css +4 -15
- package/dist/components/page.d.mts +30 -0
- package/dist/components/page.d.ts +30 -0
- package/dist/components/page.js +40 -0
- package/dist/components/page.mjs +13 -0
- package/dist/components/popover.css +87 -0
- package/dist/components/popover.d.mts +22 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +243 -0
- package/dist/components/popover.mjs +206 -0
- package/{src/style → dist}/components/radio.css +8 -51
- package/dist/components/radio.d.mts +59 -0
- package/dist/components/radio.d.ts +59 -0
- package/dist/components/radio.js +133 -0
- package/dist/components/radio.mjs +95 -0
- package/dist/components/section.css +993 -0
- package/dist/components/section.d.mts +33 -0
- package/dist/components/section.d.ts +33 -0
- package/dist/components/section.js +1401 -0
- package/dist/components/section.mjs +1364 -0
- package/dist/components/select.css +391 -0
- package/dist/components/select.d.mts +63 -0
- package/dist/components/select.d.ts +63 -0
- package/dist/components/select.js +452 -0
- package/dist/components/select.mjs +415 -0
- package/{src/style/components/slider → dist/components}/slider.css +55 -33
- package/dist/components/slider.d.mts +69 -0
- package/dist/components/slider.d.ts +69 -0
- package/dist/components/slider.js +254 -0
- package/dist/components/slider.mjs +217 -0
- package/dist/components/switch.css +1081 -0
- package/dist/components/switch.d.mts +33 -0
- package/dist/components/switch.d.ts +33 -0
- package/dist/components/switch.js +1092 -0
- package/dist/components/switch.mjs +1055 -0
- package/{src/style/components/table → dist/components}/table.css +3 -28
- package/dist/components/table.d.mts +42 -0
- package/dist/components/table.d.ts +42 -0
- package/dist/components/table.js +108 -0
- package/dist/components/table.mjs +76 -0
- package/dist/components/tag.css +97 -0
- package/dist/components/tag.d.mts +12 -0
- package/dist/components/tag.d.ts +12 -0
- package/dist/components/tag.js +42 -0
- package/dist/components/tag.mjs +15 -0
- package/dist/components/textarea.css +1359 -0
- package/dist/components/textarea.d.mts +84 -0
- package/dist/components/textarea.d.ts +84 -0
- package/dist/components/textarea.js +1962 -0
- package/dist/components/textarea.mjs +1924 -0
- package/{src/style/components/theme-control → dist/components}/theme-control.css +3 -7
- package/dist/components/theme-control.d.mts +9 -0
- package/dist/components/theme-control.d.ts +9 -0
- package/dist/components/theme-control.js +235 -0
- package/dist/components/theme-control.mjs +200 -0
- package/{src/style/components/tooltip → dist/components}/tooltip.css +5 -13
- package/dist/components/tooltip.d.mts +12 -0
- package/dist/components/tooltip.d.ts +12 -0
- package/dist/components/tooltip.js +200 -0
- package/dist/components/tooltip.mjs +163 -0
- package/dist/icons-Czahnf-r.d.mts +15 -0
- package/dist/icons-Czahnf-r.d.ts +15 -0
- package/dist/index.css +2914 -2067
- package/dist/index.d.mts +144 -721
- package/dist/index.d.ts +144 -721
- package/dist/index.js +4076 -2282
- package/dist/index.mjs +4132 -2366
- package/dist/theme.css +34 -34
- package/package.json +27 -8
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/hellboy-ds-0.1.2.tgz +0 -0
- package/src/components/badge/Badge.tsx +0 -29
- package/src/components/badge/index.ts +0 -1
- package/src/components/banner/Banner.tsx +0 -48
- package/src/components/banner/banner.css +0 -44
- package/src/components/banner/index.ts +0 -1
- package/src/components/button/button.tsx +0 -127
- package/src/components/button/index.ts +0 -1
- package/src/components/card/card.tsx +0 -57
- package/src/components/card/index.ts +0 -1
- package/src/components/checkbox/Checkbox.tsx +0 -98
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/code-block/code-block.tsx +0 -44
- package/src/components/code-block/index.ts +0 -1
- package/src/components/color-control/color-control.tsx +0 -322
- package/src/components/color-control/index.ts +0 -1
- package/src/components/drag-handle/DragHandle.tsx +0 -78
- package/src/components/drag-handle/index.ts +0 -1
- package/src/components/drawer/drawer.tsx +0 -82
- package/src/components/drawer/index.ts +0 -1
- package/src/components/floating-bar/floating-bar.tsx +0 -52
- package/src/components/floating-bar/index.ts +0 -2
- package/src/components/footer/footer.tsx +0 -28
- package/src/components/footer/index.ts +0 -1
- package/src/components/grid/Grid.tsx +0 -53
- package/src/components/grid/index.ts +0 -1
- package/src/components/header/header.tsx +0 -57
- package/src/components/header/index.ts +0 -1
- package/src/components/icons/icons.tsx +0 -44
- package/src/components/icons/index.ts +0 -1
- package/src/components/index.ts +0 -29
- package/src/components/input/DatePicker.tsx +0 -133
- package/src/components/input/Input.tsx +0 -220
- package/src/components/input/InputDate.tsx +0 -10
- package/src/components/input/InputDateTime.tsx +0 -10
- package/src/components/input/InputEmail.tsx +0 -10
- package/src/components/input/InputField.tsx +0 -137
- package/src/components/input/InputNumber.tsx +0 -10
- package/src/components/input/InputPassword.tsx +0 -10
- package/src/components/input/InputSearch.tsx +0 -10
- package/src/components/input/InputTel.tsx +0 -10
- package/src/components/input/InputText.tsx +0 -10
- package/src/components/input/InputTime.tsx +0 -10
- package/src/components/input/InputUrl.tsx +0 -10
- package/src/components/input/TimePicker.tsx +0 -151
- package/src/components/input/index.ts +0 -11
- package/src/components/layout/Layout.tsx +0 -244
- package/src/components/layout/index.ts +0 -1
- package/src/components/list/List.tsx +0 -159
- package/src/components/list/index.ts +0 -1
- package/src/components/navbar/MenuCategory.tsx +0 -20
- package/src/components/navbar/MenuGroup.tsx +0 -288
- package/src/components/navbar/MenuItem.tsx +0 -65
- package/src/components/navbar/Navbar.tsx +0 -23
- package/src/components/navbar/index.ts +0 -4
- package/src/components/page/index.ts +0 -1
- package/src/components/page/page.tsx +0 -46
- package/src/components/page-index/PageIndex.tsx +0 -275
- package/src/components/page-index/index.ts +0 -1
- package/src/components/popover/index.ts +0 -1
- package/src/components/popover/popover.tsx +0 -199
- package/src/components/radio/Radio.tsx +0 -176
- package/src/components/radio/index.ts +0 -1
- package/src/components/section/index.ts +0 -1
- package/src/components/section/section.tsx +0 -66
- package/src/components/select/Select.tsx +0 -212
- package/src/components/select/index.ts +0 -1
- package/src/components/slider/Slider.tsx +0 -267
- package/src/components/slider/index.ts +0 -1
- package/src/components/switch/index.ts +0 -1
- package/src/components/switch/switch.tsx +0 -99
- package/src/components/table/Table.tsx +0 -147
- package/src/components/table/index.ts +0 -1
- package/src/components/theme-control/index.ts +0 -1
- package/src/components/theme-control/theme-control.tsx +0 -78
- package/src/components/tooltip/index.ts +0 -1
- package/src/components/tooltip/tooltip.tsx +0 -207
- package/src/contexts/NavbarTooltipContext.tsx +0 -48
- package/src/contexts/index.ts +0 -1
- package/src/foundations/motion.md +0 -136
- package/src/index.ts +0 -40
- package/src/style/_shared/field.css +0 -69
- package/src/style/components/color-control/color-control.css +0 -126
- package/src/style/components/drawer/drawer.css +0 -210
- package/src/style/components/floating-bar/floating-bar.css +0 -39
- package/src/style/components/footer/footer.css +0 -108
- package/src/style/components/grid/grid.css +0 -33
- package/src/style/components/header/header.css +0 -44
- package/src/style/components/layout/layout.css +0 -205
- package/src/style/components/navbar/navbar.css +0 -342
- package/src/style/components/popover/popover.css +0 -44
- package/src/style/components/section/section.css +0 -67
- package/src/style/components/select/select.css +0 -143
- package/src/style/components/switch/switch.css +0 -267
- package/src/style/foundations/global.css +0 -316
- package/src/style/foundations/motion.css +0 -164
- package/src/style/foundations/spacing.css +0 -51
- package/src/style/foundations/typography.css +0 -39
- package/src/style/foundations/z-index.css +0 -81
- package/src/style/modes/dark.css +0 -146
- package/src/style/modes/light.css +0 -147
- package/src/style/semantic.css +0 -52
- package/src/style/styles.css +0 -51
- package/src/style/themes/theme.json +0 -37
- package/src/utils/README.md +0 -305
- package/src/utils/USER_PREFERENCES.md +0 -558
- package/src/utils/theme.ts +0 -127
- package/src/utils/user-preferences.ts +0 -577
- package/tsconfig.json +0 -25
- package/tsup.config.ts +0 -52
package/README.md
CHANGED
|
@@ -1,149 +1,296 @@
|
|
|
1
|
-
# Hellboy Design System
|
|
1
|
+
# 🔥 @hellboy/ds - Hellboy Design System
|
|
2
2
|
|
|
3
|
-
A comprehensive, accessible-first design system
|
|
3
|
+
> _Where chaos meets precision: A comprehensive, accessible-first design system for modern React applications_
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@hellboy/ds)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
[](https://reactjs.org/)
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
- **Colors**: HSLA-based semantic color system with 7 base hues (primary, secondary, accent, success, warning, error, info)
|
|
9
|
-
- **Typography**: Signika (headings) and Rubik (body) font families with consistent scale
|
|
10
|
-
- **Spacing**: Consistent spacing scale from `--spacing-1` to `--spacing-16`
|
|
11
|
-
- **Motion**: Transition tokens respecting `prefers-reduced-motion`
|
|
10
|
+
A complete design system with **42+ production-ready components**, dual theming (light/dark), and comprehensive accessibility features built with React, TypeScript, and modern web standards.
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
- **Global Styles**: Base HTML resets and typography
|
|
15
|
-
- **Theme System**: Light/Dark modes with automatic system preference detection
|
|
16
|
-
- **User Preferences**: Persistent theme and color settings
|
|
12
|
+
## ✨ Features
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
- 🎨 **42+ Components** - Buttons, inputs, dialogs, tables, and more
|
|
15
|
+
- 🌓 **Dual Theme System** - Light and dark modes with customizable colors (HSLA-based)
|
|
16
|
+
- ♿ **Accessibility First** - WCAG 2.1 AA compliant with AriaKit primitives
|
|
17
|
+
- 📱 **Desktop Priority** - Optimized for desktop (1024px+), tablet/mobile in roadmap
|
|
18
|
+
- 🎯 **TypeScript Native** - Full type safety and IntelliSense support
|
|
19
|
+
- 🔌 **Auto Dependencies** - Components automatically include all required dependencies
|
|
20
|
+
- 🎭 **150,000+ Icons** - Iconify integration for extensive icon library
|
|
21
|
+
- 📦 **Tree-shakeable** - Import only what you need
|
|
22
|
+
- 🚀 **CSS-First** - Minimal runtime overhead with CSS custom properties
|
|
23
|
+
- 💾 **Persistent Preferences** - User theme and color choices saved locally
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
## 🚀 Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @hellboy/ds
|
|
29
|
+
|
|
30
|
+
# Peer dependencies (if not already installed)
|
|
31
|
+
npm install react react-dom
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**That's it!** All component dependencies are automatically included in the CSS bundles.
|
|
35
|
+
|
|
36
|
+
## 📖 Quick Start
|
|
37
|
+
|
|
38
|
+
### Basic Usage
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import '@hellboy/ds/dist/index.css';
|
|
42
|
+
import { Button, Input, Dialog, Banner, ThemeControl } from '@hellboy/ds';
|
|
43
|
+
|
|
44
|
+
export function App() {
|
|
45
|
+
return (
|
|
46
|
+
<div>
|
|
47
|
+
{/* Theme switcher in top-right corner */}
|
|
48
|
+
<ThemeControl />
|
|
49
|
+
|
|
50
|
+
{/* Components work out of the box */}
|
|
51
|
+
<Banner type="info">
|
|
52
|
+
Welcome to Hellboy Design System!
|
|
53
|
+
</Banner>
|
|
54
|
+
|
|
55
|
+
<Button variant="primary">Primary Action</Button>
|
|
56
|
+
<Input label="Email" type="email" placeholder="you@example.com" />
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Advanced: Tree-shaking (Individual Components)
|
|
63
|
+
|
|
64
|
+
Import only specific components to reduce bundle size:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
// Option 1: Single component import (recommended)
|
|
68
|
+
import '@hellboy/ds/dist/index.css';
|
|
69
|
+
import { Button } from '@hellboy/ds';
|
|
70
|
+
|
|
71
|
+
// Option 2: Subpath imports (maximum tree-shaking)
|
|
72
|
+
import '@hellboy/ds/components/button/css';
|
|
73
|
+
import { Button } from '@hellboy/ds/components/button';
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Note**: Each component's CSS already includes all its dependencies (foundations, themes, utilities), so you never need to import foundation files manually.
|
|
77
|
+
|
|
78
|
+
## 🔌 Auto-Dependency Injection
|
|
79
|
+
|
|
80
|
+
Every component automatically includes everything it needs:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
// ✅ This works - button.css includes:
|
|
84
|
+
// - Component styles
|
|
85
|
+
// - Foundation CSS (typography, spacing, colors)
|
|
86
|
+
// - Theme variables (light/dark)
|
|
87
|
+
// - Shared utilities
|
|
88
|
+
import '@hellboy/ds/components/button/css';
|
|
89
|
+
import { Button } from '@hellboy/ds/components/button';
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Zero configuration required!** Just import and use.
|
|
93
|
+
|
|
94
|
+
## 🧱 Available Components (42+)
|
|
95
|
+
|
|
96
|
+
### Layout & Structure
|
|
21
97
|
- **Layout** - Main application layout with navigation
|
|
22
|
-
- **Page** - Page wrapper with consistent spacing
|
|
98
|
+
- **Page** - Page wrapper with consistent spacing
|
|
23
99
|
- **Header** - Page headers with titles, subtitles, and tags
|
|
100
|
+
- **Hero** - Hero sections for landing pages
|
|
24
101
|
- **Section** - Content sections with automatic indexing
|
|
25
102
|
- **Grid** - Responsive grid system
|
|
26
103
|
- **Card** - Content cards with variants
|
|
27
104
|
- **Footer** - Page footer component
|
|
105
|
+
- **Divider** - Visual content separators
|
|
28
106
|
|
|
29
|
-
|
|
30
|
-
- **Button** - Interactive buttons
|
|
107
|
+
### Forms & Inputs
|
|
108
|
+
- **Button** - Interactive buttons (4 variants, 4 sizes, icons, loading states)
|
|
109
|
+
- Dependencies: foundations, icons, theme
|
|
110
|
+
- **ButtonGroup** - Grouped button controls
|
|
31
111
|
- **Checkbox** - Accessible checkboxes with label support
|
|
112
|
+
- Dependencies: foundations, theme
|
|
32
113
|
- **Radio** - Radio button groups
|
|
114
|
+
- Dependencies: foundations, theme
|
|
33
115
|
- **Select** - Dropdown selection component
|
|
34
|
-
-
|
|
116
|
+
- Dependencies: foundations, popover, theme
|
|
117
|
+
- **Input** - Text inputs with multiple types
|
|
118
|
+
- `InputText`, `InputEmail`, `InputPassword`, `InputNumber`, `InputTel`, `InputUrl`, `InputSearch`, `InputDate`, `InputTime`, `InputDateTime`
|
|
119
|
+
- Dependencies: foundations, icons, theme, popover (for date/time)
|
|
120
|
+
- **Textarea** - Multi-line text input
|
|
121
|
+
- Dependencies: foundations, theme
|
|
122
|
+
- **RichTextarea** - Rich text editor with formatting toolbar
|
|
123
|
+
- Dependencies: foundations, icons, floatingbar, select, tooltip, theme
|
|
124
|
+
- External: DOMPurify for HTML sanitization
|
|
35
125
|
- **Slider** - Range slider control
|
|
36
|
-
|
|
37
|
-
**
|
|
38
|
-
-
|
|
126
|
+
- Dependencies: foundations, theme
|
|
127
|
+
- **Switch** - Toggle switch component
|
|
128
|
+
- Dependencies: foundations, theme
|
|
129
|
+
|
|
130
|
+
### Navigation
|
|
131
|
+
- **Navbar** - Main navigation bar with routing and tooltips
|
|
132
|
+
- Dependencies: foundations, button, tooltip, backdrop, theme
|
|
133
|
+
- **Breadcrumbs** - Breadcrumb navigation
|
|
134
|
+
- Dependencies: foundations, theme
|
|
39
135
|
- **FloatingBar** - Floating action bar
|
|
40
|
-
|
|
41
|
-
**
|
|
42
|
-
-
|
|
43
|
-
|
|
136
|
+
- Dependencies: foundations, theme
|
|
137
|
+
- **PageIndex** - Auto-generated page navigation from sections
|
|
138
|
+
- Dependencies: foundations, theme
|
|
139
|
+
|
|
140
|
+
### Feedback & Display
|
|
141
|
+
- **Badge** - Status and label badges (8 variants)
|
|
142
|
+
- Dependencies: foundations, theme
|
|
143
|
+
- **Tag** - Categorization tags (8 variants, 3 sizes)
|
|
144
|
+
- Dependencies: foundations, theme
|
|
145
|
+
- **Banner** - Alert and notification banners (4 types: info, success, warning, error)
|
|
146
|
+
- Dependencies: foundations, icons, button, theme
|
|
147
|
+
- **Dialog** - Modal dialogs with backdrop
|
|
148
|
+
- Dependencies: foundations, backdrop, theme
|
|
149
|
+
- External: React Portal
|
|
150
|
+
- **Drawer** - Slide-out panel component
|
|
151
|
+
- Dependencies: foundations, backdrop, theme
|
|
152
|
+
- **Tooltip** - Contextual tooltips with auto-positioning
|
|
153
|
+
- Dependencies: foundations, theme
|
|
154
|
+
- External: React Portal
|
|
44
155
|
- **CodeBlock** - Syntax-highlighted code display
|
|
156
|
+
- Dependencies: foundations, button, theme
|
|
45
157
|
- **List** - Structured list component
|
|
46
|
-
|
|
47
|
-
**
|
|
48
|
-
-
|
|
158
|
+
- Dependencies: foundations, theme
|
|
159
|
+
- **Table** - Data tables with headers, rows, cells
|
|
160
|
+
- Components: `Table`, `TableContainer`, `TableHead`, `TableBody`, `TableRow`, `TableCell`
|
|
161
|
+
- Dependencies: foundations, theme
|
|
162
|
+
|
|
163
|
+
### Interactive
|
|
164
|
+
- **ThemeControl** - Theme switcher component (light/dark toggle)
|
|
165
|
+
- Dependencies: foundations, button, theme
|
|
49
166
|
- **ColorControl** - Color customization interface
|
|
167
|
+
- Dependencies: foundations, input, button, theme
|
|
50
168
|
- **DragHandle** - Drag and drop handles
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
169
|
+
- Dependencies: foundations, icons, theme
|
|
170
|
+
- **Popover** - Floating popover component with positioning
|
|
171
|
+
- Dependencies: foundations, theme
|
|
172
|
+
- External: React Portal
|
|
173
|
+
- **Icon** - Icon component with Iconify integration
|
|
174
|
+
- Dependencies: foundations
|
|
175
|
+
- External: @iconify/react (150,000+ icons)
|
|
176
|
+
|
|
177
|
+
### Shared Components
|
|
178
|
+
- **Backdrop** - Modal/dialog backdrop overlay
|
|
179
|
+
- Dependencies: foundations, theme
|
|
180
|
+
|
|
181
|
+
## 📦 Dependencies
|
|
182
|
+
|
|
183
|
+
### Included Dependencies (Auto-installed with package)
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"@ariakit/react": "^0.4.0", // Accessible component primitives
|
|
187
|
+
"@iconify/react": "^6.0.2", // Icon framework (150,000+ icons)
|
|
188
|
+
"dompurify": "^3.2.2" // HTML sanitization (RichTextarea)
|
|
189
|
+
}
|
|
59
190
|
```
|
|
60
191
|
|
|
61
|
-
###
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export function App() {
|
|
68
|
-
return (
|
|
69
|
-
<Layout>
|
|
70
|
-
<Page>
|
|
71
|
-
<Header
|
|
72
|
-
title="Welcome"
|
|
73
|
-
subtitle="Hellboy Design System"
|
|
74
|
-
tags={['React', 'TypeScript', 'Accessible']}
|
|
75
|
-
/>
|
|
76
|
-
|
|
77
|
-
<Section title="Getting Started">
|
|
78
|
-
<Button>Primary Button</Button>
|
|
79
|
-
<Button variant="secondary">Secondary Button</Button>
|
|
80
|
-
<Button variant="tertiary">Tertiary Button</Button>
|
|
81
|
-
<Button variant="ghost">Ghost Button</Button>
|
|
82
|
-
|
|
83
|
-
<Button size="xs">Extra Small</Button>
|
|
84
|
-
<Button size="sm">Small</Button>
|
|
85
|
-
<Button size="md">Medium</Button>
|
|
86
|
-
<Button size="lg">Large</Button>
|
|
87
|
-
|
|
88
|
-
<Button isLoading>Loading...</Button>
|
|
89
|
-
<Button startIcon="mdi:check">With Icon</Button>
|
|
90
|
-
</Section>
|
|
91
|
-
</Page>
|
|
92
|
-
</Layout>
|
|
93
|
-
);
|
|
192
|
+
### Peer Dependencies (Required by your app)
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
196
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
94
197
|
}
|
|
95
198
|
```
|
|
96
199
|
|
|
200
|
+
**Note**: Components automatically handle their CSS dependencies. When you import a component's CSS, it includes all required foundation styles, theme variables, and utilities.
|
|
201
|
+
|
|
97
202
|
## 🎨 Theme System
|
|
98
203
|
|
|
99
|
-
|
|
204
|
+
### Using Themes
|
|
100
205
|
|
|
101
206
|
```tsx
|
|
102
|
-
import { getUserPreferences, setUserPreferences } from '@hellboy/ds';
|
|
207
|
+
import { setTheme, getTheme, getUserPreferences, setUserPreferences } from '@hellboy/ds';
|
|
103
208
|
|
|
104
|
-
// Get current
|
|
209
|
+
// Get current theme
|
|
210
|
+
const currentTheme = getTheme(); // 'light' | 'dark'
|
|
211
|
+
|
|
212
|
+
// Set theme (persists to localStorage)
|
|
213
|
+
setTheme('dark');
|
|
214
|
+
|
|
215
|
+
// Get all user preferences
|
|
105
216
|
const prefs = getUserPreferences();
|
|
106
217
|
console.log(prefs.theme); // 'light' | 'dark' | 'auto'
|
|
107
218
|
|
|
108
|
-
// Update
|
|
109
|
-
setUserPreferences({
|
|
110
|
-
|
|
111
|
-
// Customize colors
|
|
112
|
-
setUserPreferences({
|
|
219
|
+
// Update preferences
|
|
220
|
+
setUserPreferences({
|
|
221
|
+
theme: 'dark',
|
|
113
222
|
colors: {
|
|
114
223
|
primary: { hue: 220, saturation: 70, lightness: 50 }
|
|
115
224
|
}
|
|
116
225
|
});
|
|
117
226
|
```
|
|
118
227
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
228
|
+
### Theme Features
|
|
229
|
+
- 🌓 **Dual Modes**: Light and dark themes included
|
|
230
|
+
- 🎨 **Customizable**: 7 color hues (primary, secondary, accent, success, warning, error, info)
|
|
231
|
+
- 💾 **Persistent**: Preferences saved to localStorage
|
|
232
|
+
- 🔄 **Auto Detection**: Respects system preference (prefers-color-scheme)
|
|
233
|
+
- 📐 **HSLA-based**: Hue, Saturation, Lightness, Alpha for easy customization
|
|
234
|
+
|
|
235
|
+
### CSS Custom Properties
|
|
236
|
+
|
|
237
|
+
Themes use CSS custom properties that you can override:
|
|
238
|
+
|
|
239
|
+
```css
|
|
240
|
+
:root {
|
|
241
|
+
/* Color hues (0-360) */
|
|
242
|
+
--primary-hue: 330;
|
|
243
|
+
--secondary-hue: 240;
|
|
244
|
+
--accent-hue: 180;
|
|
245
|
+
|
|
246
|
+
/* Semantic colors */
|
|
247
|
+
--color-primary: hsl(var(--primary-hue), 70%, 50%);
|
|
248
|
+
--color-on-primary: hsl(var(--primary-hue), 70%, 10%);
|
|
249
|
+
|
|
250
|
+
/* Typography */
|
|
251
|
+
--font-family-heading: 'Signika', sans-serif;
|
|
252
|
+
--font-family-body: 'Rubik', sans-serif;
|
|
253
|
+
|
|
254
|
+
/* Spacing scale */
|
|
255
|
+
--spacing-1: 0.25rem; /* 4px */
|
|
256
|
+
--spacing-2: 0.5rem; /* 8px */
|
|
257
|
+
/* ... up to spacing-16 */
|
|
258
|
+
}
|
|
125
259
|
```
|
|
126
260
|
|
|
127
|
-
## 📋 Features
|
|
128
|
-
|
|
129
|
-
- ✅ **Accessibility-First**: Built with WCAG 2.1 AA compliance and AriaKit primitives
|
|
130
|
-
- ✅ **TypeScript Native**: Full type safety and IntelliSense support
|
|
131
|
-
- ✅ **Theme System**: Light/Dark modes with customizable colors (HSLA-based)
|
|
132
|
-
- ✅ **Responsive**: Mobile-first, adaptive components
|
|
133
|
-
- ✅ **Iconify Integration**: Access to thousands of icons
|
|
134
|
-
- ✅ **Persistent Preferences**: User theme and color choices saved locally
|
|
135
|
-
- ✅ **Modern Stack**: React 18+, CSS Custom Properties, Vite-optimized
|
|
136
|
-
- ✅ **Semantic HTML**: Proper markup with ARIA attributes
|
|
137
|
-
- ✅ **Performance**: CSS-first styling, minimal runtime overhead
|
|
138
|
-
|
|
139
261
|
## 🔄 Component API Examples
|
|
140
262
|
|
|
141
263
|
### Button
|
|
142
264
|
|
|
143
|
-
**Variants:** `primary` | `secondary` | `tertiary` | `ghost`
|
|
144
|
-
|
|
265
|
+
**Variants:** `primary` | `secondary` | `tertiary` | `ghost`
|
|
145
266
|
**Sizes:** `xs` | `sm` | `md` (default) | `lg`
|
|
146
267
|
|
|
268
|
+
```tsx
|
|
269
|
+
import { Button } from '@hellboy/ds';
|
|
270
|
+
|
|
271
|
+
// Variants
|
|
272
|
+
<Button variant="primary">Primary</Button>
|
|
273
|
+
<Button variant="secondary">Secondary</Button>
|
|
274
|
+
<Button variant="tertiary">Tertiary</Button>
|
|
275
|
+
<Button variant="ghost">Ghost</Button>
|
|
276
|
+
|
|
277
|
+
// Sizes
|
|
278
|
+
<Button size="xs">Extra Small</Button>
|
|
279
|
+
<Button size="sm">Small</Button>
|
|
280
|
+
<Button size="md">Medium</Button>
|
|
281
|
+
<Button size="lg">Large</Button>
|
|
282
|
+
|
|
283
|
+
// With icons (150,000+ from Iconify)
|
|
284
|
+
<Button startIcon="mdi:check">Save</Button>
|
|
285
|
+
<Button endIcon="mdi:arrow-right">Next</Button>
|
|
286
|
+
<Button iconOnly aria-label="Settings" startIcon="mdi:cog" />
|
|
287
|
+
|
|
288
|
+
// States
|
|
289
|
+
<Button isLoading>Saving...</Button>
|
|
290
|
+
<Button disabled>Disabled</Button>
|
|
291
|
+
<Button fullWidth>Full Width</Button>
|
|
292
|
+
```
|
|
293
|
+
|
|
147
294
|
**Props:**
|
|
148
295
|
- `variant` - Visual style
|
|
149
296
|
- `size` - Button size
|
|
@@ -153,106 +300,309 @@ npm run clean # Clean dist directory
|
|
|
153
300
|
- `startIcon` / `endIcon` - Icon names from Iconify
|
|
154
301
|
- `iconOnly` - Icon-only button (requires `aria-label`)
|
|
155
302
|
|
|
303
|
+
### Input Components
|
|
304
|
+
|
|
305
|
+
All input types: `InputText`, `InputEmail`, `InputPassword`, `InputNumber`, `InputTel`, `InputUrl`, `InputSearch`, `InputDate`, `InputTime`, `InputDateTime`
|
|
306
|
+
|
|
156
307
|
```tsx
|
|
157
|
-
|
|
158
|
-
<Button size="sm">Small</Button>
|
|
159
|
-
<Button size="md">Medium (Default)</Button>
|
|
160
|
-
<Button size="lg">Large</Button>
|
|
308
|
+
import { InputText, InputEmail, InputPassword, InputNumber } from '@hellboy/ds';
|
|
161
309
|
|
|
162
|
-
|
|
163
|
-
<
|
|
164
|
-
<
|
|
165
|
-
<
|
|
310
|
+
// Basic inputs
|
|
311
|
+
<InputText label="Name" placeholder="Enter your name" />
|
|
312
|
+
<InputEmail label="Email" required />
|
|
313
|
+
<InputPassword label="Password" />
|
|
166
314
|
|
|
167
|
-
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
315
|
+
// With states
|
|
316
|
+
<InputText
|
|
317
|
+
label="Username"
|
|
318
|
+
helperText="Choose a unique username"
|
|
319
|
+
error={errors.username}
|
|
320
|
+
/>
|
|
321
|
+
|
|
322
|
+
// Number input with constraints
|
|
323
|
+
<InputNumber
|
|
324
|
+
label="Age"
|
|
325
|
+
min={0}
|
|
326
|
+
max={120}
|
|
327
|
+
step={1}
|
|
328
|
+
/>
|
|
329
|
+
|
|
330
|
+
// Date/Time pickers
|
|
331
|
+
<InputDate label="Birthday" />
|
|
332
|
+
<InputTime label="Meeting Time" />
|
|
333
|
+
<InputDateTime label="Event Start" />
|
|
173
334
|
|
|
174
|
-
|
|
335
|
+
// Sizes
|
|
336
|
+
<InputText size="sm" label="Small" />
|
|
337
|
+
<InputText size="md" label="Medium" />
|
|
338
|
+
<InputText size="lg" label="Large" />
|
|
339
|
+
```
|
|
175
340
|
|
|
176
|
-
|
|
341
|
+
**Props:**
|
|
177
342
|
- `label` - Input label text
|
|
178
343
|
- `helperText` - Helper text below input
|
|
179
|
-
- `error` - Error message
|
|
344
|
+
- `error` - Error message (triggers error state)
|
|
180
345
|
- `fullWidth` - Expand to container width
|
|
346
|
+
- `size` - Input size: `sm` | `md` | `lg`
|
|
347
|
+
|
|
348
|
+
### Textarea
|
|
181
349
|
|
|
182
350
|
```tsx
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<
|
|
187
|
-
|
|
351
|
+
import { Textarea, RichTextarea } from '@hellboy/ds';
|
|
352
|
+
|
|
353
|
+
// Simple textarea
|
|
354
|
+
<Textarea
|
|
355
|
+
label="Comments"
|
|
356
|
+
placeholder="Enter your feedback..."
|
|
357
|
+
rows={4}
|
|
358
|
+
/>
|
|
359
|
+
|
|
360
|
+
// Rich text editor
|
|
361
|
+
<RichTextarea
|
|
362
|
+
value={content}
|
|
363
|
+
onChange={setContent}
|
|
364
|
+
placeholder="Start typing..."
|
|
365
|
+
toolbarOptions={['bold', 'italic', 'link', 'orderedList', 'unorderedList']}
|
|
366
|
+
showTopToolbar={true}
|
|
367
|
+
/>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Banner
|
|
371
|
+
|
|
372
|
+
**Types:** `info` | `success` | `warning` | `error`
|
|
373
|
+
|
|
374
|
+
```tsx
|
|
375
|
+
import { Banner } from '@hellboy/ds';
|
|
376
|
+
|
|
377
|
+
<Banner type="info">
|
|
378
|
+
This is an informational message.
|
|
379
|
+
</Banner>
|
|
380
|
+
|
|
381
|
+
<Banner type="success" onDismiss={() => console.log('Dismissed')}>
|
|
382
|
+
<strong>Success!</strong> Your changes have been saved.
|
|
383
|
+
</Banner>
|
|
384
|
+
|
|
385
|
+
<Banner type="warning">
|
|
386
|
+
<strong>Warning:</strong> This action cannot be undone.
|
|
387
|
+
</Banner>
|
|
388
|
+
|
|
389
|
+
<Banner type="error">
|
|
390
|
+
<strong>Error:</strong> Something went wrong.
|
|
391
|
+
</Banner>
|
|
188
392
|
```
|
|
189
393
|
|
|
190
|
-
###
|
|
394
|
+
### Dialog
|
|
191
395
|
|
|
192
396
|
```tsx
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
397
|
+
import { Dialog, Button } from '@hellboy/ds';
|
|
398
|
+
import { useState } from 'react';
|
|
399
|
+
|
|
400
|
+
function MyComponent() {
|
|
401
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
402
|
+
|
|
403
|
+
return (
|
|
404
|
+
<>
|
|
405
|
+
<Button onClick={() => setIsOpen(true)}>Open Dialog</Button>
|
|
406
|
+
|
|
407
|
+
<Dialog
|
|
408
|
+
open={isOpen}
|
|
409
|
+
onClose={() => setIsOpen(false)}
|
|
410
|
+
title="Confirm Action"
|
|
411
|
+
size="md" // sm | md | lg
|
|
412
|
+
>
|
|
413
|
+
<p>Are you sure you want to continue?</p>
|
|
414
|
+
|
|
415
|
+
<div style={{ display: 'flex', gap: '1rem', marginTop: '1rem' }}>
|
|
416
|
+
<Button variant="secondary" onClick={() => setIsOpen(false)}>
|
|
417
|
+
Cancel
|
|
418
|
+
</Button>
|
|
419
|
+
<Button onClick={() => setIsOpen(false)}>
|
|
420
|
+
Confirm
|
|
421
|
+
</Button>
|
|
422
|
+
</div>
|
|
423
|
+
</Dialog>
|
|
424
|
+
</>
|
|
425
|
+
);
|
|
426
|
+
}
|
|
197
427
|
```
|
|
198
428
|
|
|
199
|
-
###
|
|
429
|
+
### Table
|
|
200
430
|
|
|
201
431
|
```tsx
|
|
432
|
+
import { Table, TableContainer, TableHead, TableBody, TableRow, TableCell } from '@hellboy/ds';
|
|
433
|
+
|
|
434
|
+
<TableContainer>
|
|
435
|
+
<Table bordered striped hover>
|
|
436
|
+
<TableHead>
|
|
437
|
+
<TableRow>
|
|
438
|
+
<TableCell header>ID</TableCell>
|
|
439
|
+
<TableCell header>Name</TableCell>
|
|
440
|
+
<TableCell header>Email</TableCell>
|
|
441
|
+
</TableRow>
|
|
442
|
+
</TableHead>
|
|
443
|
+
<TableBody>
|
|
444
|
+
{users.map(user => (
|
|
445
|
+
<TableRow key={user.id}>
|
|
446
|
+
<TableCell>{user.id}</TableCell>
|
|
447
|
+
<TableCell>{user.name}</TableCell>
|
|
448
|
+
<TableCell>{user.email}</TableCell>
|
|
449
|
+
</TableRow>
|
|
450
|
+
))}
|
|
451
|
+
</TableBody>
|
|
452
|
+
</Table>
|
|
453
|
+
</TableContainer>
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Tooltip
|
|
457
|
+
|
|
458
|
+
```tsx
|
|
459
|
+
import { Tooltip, Button } from '@hellboy/ds';
|
|
460
|
+
|
|
461
|
+
<Tooltip content="This is a helpful tip" placement="top">
|
|
462
|
+
<Button>Hover me</Button>
|
|
463
|
+
</Tooltip>
|
|
464
|
+
|
|
465
|
+
<Tooltip
|
|
466
|
+
content={<strong>Rich content</strong>}
|
|
467
|
+
placement="bottom"
|
|
468
|
+
delay={500}
|
|
469
|
+
>
|
|
470
|
+
<span>Delayed tooltip</span>
|
|
471
|
+
</Tooltip>
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### Tag & Badge
|
|
475
|
+
|
|
476
|
+
```tsx
|
|
477
|
+
import { Tag, Badge } from '@hellboy/ds';
|
|
478
|
+
|
|
479
|
+
// Tags (8 variants, 3 sizes)
|
|
480
|
+
<Tag variant="primary">Primary</Tag>
|
|
481
|
+
<Tag variant="success" size="sm">Small Success</Tag>
|
|
482
|
+
<Tag variant="warning" size="lg">Large Warning</Tag>
|
|
483
|
+
|
|
484
|
+
// Badges
|
|
202
485
|
<Badge variant="primary">New</Badge>
|
|
203
|
-
<Badge variant="
|
|
204
|
-
|
|
486
|
+
<Badge variant="error">5</Badge>
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Theme Control
|
|
490
|
+
|
|
491
|
+
```tsx
|
|
492
|
+
import { ThemeControl } from '@hellboy/ds';
|
|
493
|
+
|
|
494
|
+
// Theme switcher component
|
|
495
|
+
<ThemeControl />
|
|
496
|
+
|
|
497
|
+
// Or use programmatically
|
|
498
|
+
import { setTheme, getTheme } from '@hellboy/ds';
|
|
499
|
+
|
|
500
|
+
const currentTheme = getTheme(); // 'light' | 'dark'
|
|
501
|
+
setTheme('dark');
|
|
205
502
|
```
|
|
206
503
|
|
|
504
|
+
## 🖥️ Platform Support
|
|
505
|
+
|
|
506
|
+
**Current Focus: Desktop Applications (1024px+)**
|
|
507
|
+
|
|
508
|
+
Hellboy Design System is currently optimized for desktop experiences. All components are designed, tested, and optimized primarily for desktop interfaces.
|
|
509
|
+
|
|
510
|
+
**Roadmap:**
|
|
511
|
+
- 📱 **Tablet Support** (768px - 1023px) - Q2 2026
|
|
512
|
+
- 📲 **Mobile Support** (< 768px) - Q3 2026
|
|
513
|
+
- 🎯 **Responsive Utilities** - Q2 2026
|
|
514
|
+
|
|
207
515
|
## ♿ Accessibility
|
|
208
516
|
|
|
209
517
|
Every component is built with accessibility as a core principle:
|
|
210
518
|
|
|
211
|
-
- **
|
|
212
|
-
- **
|
|
213
|
-
- **
|
|
214
|
-
- **
|
|
215
|
-
- **
|
|
216
|
-
- **
|
|
217
|
-
- **
|
|
519
|
+
- ✅ **WCAG 2.1 AA Compliant** - Color contrast, focus indicators, semantic HTML
|
|
520
|
+
- ⌨️ **Keyboard Navigation** - Full keyboard support with logical tab order
|
|
521
|
+
- 🔊 **Screen Reader Support** - Proper ARIA labels, roles, and live regions
|
|
522
|
+
- 🎯 **Focus Management** - Visible focus indicators respecting user preferences
|
|
523
|
+
- 🏗️ **Semantic HTML** - Native elements enhanced with ARIA when needed
|
|
524
|
+
- 🎨 **Color Contrast** - AA compliant in both light and dark themes
|
|
525
|
+
- ⚡ **Motion Respect** - Honors `prefers-reduced-motion` for animations
|
|
526
|
+
- 🔧 **AriaKit Foundation** - Built on battle-tested accessibility primitives from AriaKit
|
|
218
527
|
|
|
219
|
-
##
|
|
528
|
+
## 📐 Package Architecture
|
|
220
529
|
|
|
221
|
-
|
|
530
|
+
### Build Output
|
|
222
531
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
532
|
+
```
|
|
533
|
+
dist/
|
|
534
|
+
├── index.css # Complete CSS bundle (~120 KB minified)
|
|
535
|
+
├── index.js # All components (CommonJS)
|
|
536
|
+
├── index.mjs # All components (ESM)
|
|
537
|
+
├── index.d.ts # TypeScript declarations
|
|
538
|
+
├── theme.css # Theme variables only
|
|
539
|
+
└── components/
|
|
540
|
+
├── button.js # Button component (CommonJS)
|
|
541
|
+
├── button.mjs # Button component (ESM)
|
|
542
|
+
├── button.d.ts # Button TypeScript types
|
|
543
|
+
├── button.css # Button styles + all dependencies
|
|
544
|
+
└── ... (42 components)
|
|
545
|
+
```
|
|
228
546
|
|
|
229
|
-
|
|
230
|
-
- Additional component variants
|
|
231
|
-
- Enhanced customization APIs
|
|
232
|
-
- Expanded documentation
|
|
233
|
-
- Performance optimizations
|
|
547
|
+
### Import Patterns
|
|
234
548
|
|
|
235
|
-
|
|
549
|
+
```tsx
|
|
550
|
+
// ✅ Recommended: Full bundle
|
|
551
|
+
import '@hellboy/ds/dist/index.css';
|
|
552
|
+
import { Button, Input, Dialog } from '@hellboy/ds';
|
|
236
553
|
|
|
554
|
+
// ✅ Advanced: Individual components (maximum tree-shaking)
|
|
555
|
+
import '@hellboy/ds/components/button/css';
|
|
556
|
+
import { Button } from '@hellboy/ds/components/button';
|
|
557
|
+
|
|
558
|
+
// ✅ Theme only (if building custom CSS)
|
|
559
|
+
import '@hellboy/ds/dist/theme.css';
|
|
237
560
|
```
|
|
238
|
-
@hellboy/ds
|
|
239
|
-
├── components/ # All React components
|
|
240
|
-
├── style/ # CSS and theming
|
|
241
|
-
│ ├── foundations/ # Base styles
|
|
242
|
-
│ ├── themes/ # Light/dark themes
|
|
243
|
-
│ └── components/ # Component styles
|
|
244
|
-
├── utils/ # Utility functions
|
|
245
|
-
└── contexts/ # React contexts
|
|
246
|
-
```
|
|
247
561
|
|
|
248
|
-
|
|
562
|
+
**Note**: Each component's CSS file includes all its dependencies, so you never need to manually import foundation files.
|
|
563
|
+
|
|
564
|
+
## 🚀 Getting Started Examples
|
|
249
565
|
|
|
250
|
-
|
|
566
|
+
### Simple Page
|
|
567
|
+
|
|
568
|
+
```tsx
|
|
569
|
+
import '@hellboy/ds/dist/index.css';
|
|
570
|
+
import { Button, Input, Banner } from '@hellboy/ds';
|
|
251
571
|
|
|
252
|
-
|
|
572
|
+
function App() {
|
|
573
|
+
return (
|
|
574
|
+
<div style={{ padding: '2rem' }}>
|
|
575
|
+
<Banner type="info">Welcome to Hellboy DS!</Banner>
|
|
576
|
+
|
|
577
|
+
<form style={{ marginTop: '1rem' }}>
|
|
578
|
+
<Input label="Email" type="email" />
|
|
579
|
+
<Input label="Password" type="password" />
|
|
580
|
+
<Button type="submit" fullWidth>Sign In</Button>
|
|
581
|
+
</form>
|
|
582
|
+
</div>
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
```
|
|
253
586
|
|
|
254
|
-
|
|
587
|
+
### With Theme Switching
|
|
255
588
|
|
|
256
|
-
|
|
589
|
+
```tsx
|
|
590
|
+
import '@hellboy/ds/dist/index.css';
|
|
591
|
+
import { ThemeControl, Button, Card } from '@hellboy/ds';
|
|
257
592
|
|
|
258
|
-
|
|
593
|
+
function App() {
|
|
594
|
+
return (
|
|
595
|
+
<div style={{ padding: '2rem' }}>
|
|
596
|
+
<div style={{ position: 'fixed', top: '1rem', right: '1rem' }}>
|
|
597
|
+
<ThemeControl />
|
|
598
|
+
</div>
|
|
599
|
+
|
|
600
|
+
<Card>
|
|
601
|
+
<h1>My App</h1>
|
|
602
|
+
<p>Theme automatically applies to all components!</p>
|
|
603
|
+
<Button>Click me</Button>
|
|
604
|
+
</Card>
|
|
605
|
+
</div>
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
```
|