@hellboy/ds 0.1.2 → 0.1.3
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 +214 -67
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/style/foundations/global.css +1 -1
package/README.md
CHANGED
|
@@ -1,65 +1,119 @@
|
|
|
1
|
-
# Hellboy Design System
|
|
1
|
+
# Hellboy Design System
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A comprehensive, accessible-first design system built with React, TypeScript, and modern web standards.
|
|
4
4
|
|
|
5
5
|
## 📦 Package Contents
|
|
6
6
|
|
|
7
|
-
### Tokens
|
|
8
|
-
- **Colors**:
|
|
9
|
-
- **Typography**:
|
|
10
|
-
- **Spacing**: Consistent spacing scale
|
|
7
|
+
### 🎨 Design Tokens
|
|
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`
|
|
11
12
|
|
|
12
|
-
### Foundations
|
|
13
|
-
- **Global
|
|
14
|
-
- **
|
|
13
|
+
### 🧱 Foundations
|
|
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
|
|
15
17
|
|
|
16
|
-
### Components
|
|
17
|
-
|
|
18
|
+
### 🎯 Components
|
|
19
|
+
|
|
20
|
+
**Layout & Structure**
|
|
21
|
+
- **Layout** - Main application layout with navigation
|
|
22
|
+
- **Page** - Page wrapper with consistent spacing
|
|
23
|
+
- **Header** - Page headers with titles, subtitles, and tags
|
|
24
|
+
- **Section** - Content sections with automatic indexing
|
|
25
|
+
- **Grid** - Responsive grid system
|
|
26
|
+
- **Card** - Content cards with variants
|
|
27
|
+
- **Footer** - Page footer component
|
|
28
|
+
|
|
29
|
+
**Forms & Inputs**
|
|
30
|
+
- **Button** - Interactive buttons with variants, sizes, icons, and loading states
|
|
31
|
+
- **Checkbox** - Accessible checkboxes with label support
|
|
32
|
+
- **Radio** - Radio button groups
|
|
33
|
+
- **Select** - Dropdown selection component
|
|
34
|
+
- **Input** - Text inputs (text, email, password, search, tel, url, number, date, time, datetime)
|
|
35
|
+
- **Slider** - Range slider control
|
|
36
|
+
|
|
37
|
+
**Navigation**
|
|
38
|
+
- **Navbar** - Main navigation bar with routing
|
|
39
|
+
- **FloatingBar** - Floating action bar
|
|
40
|
+
|
|
41
|
+
**Feedback & Display**
|
|
42
|
+
- **Badge** - Status and label badges
|
|
43
|
+
- **Banner** - Alert and notification banners
|
|
44
|
+
- **CodeBlock** - Syntax-highlighted code display
|
|
45
|
+
- **List** - Structured list component
|
|
46
|
+
|
|
47
|
+
**Interactive**
|
|
48
|
+
- **ThemeControl** - Theme switcher component
|
|
49
|
+
- **ColorControl** - Color customization interface
|
|
50
|
+
- **DragHandle** - Drag and drop handles
|
|
51
|
+
- **Icons** - Iconify integration with thousands of icons
|
|
18
52
|
|
|
19
53
|
## 🚀 Getting Started
|
|
20
54
|
|
|
21
55
|
### Installation
|
|
22
56
|
|
|
23
57
|
```bash
|
|
24
|
-
npm install @hellboy
|
|
58
|
+
npm install @hellboy/ds @ariakit/react react react-dom
|
|
25
59
|
```
|
|
26
60
|
|
|
27
61
|
### Usage
|
|
28
62
|
|
|
29
63
|
```tsx
|
|
30
|
-
import { Button,
|
|
31
|
-
|
|
32
|
-
// Inject global styles once at app initialization
|
|
33
|
-
injectGlobalStyles();
|
|
64
|
+
import { Button, Layout, Page, Header, Section } from '@hellboy/ds';
|
|
65
|
+
import '@hellboy/ds/styles.css';
|
|
34
66
|
|
|
35
|
-
// Use the Button component
|
|
36
67
|
export function App() {
|
|
37
68
|
return (
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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>
|
|
46
93
|
);
|
|
47
94
|
}
|
|
48
95
|
```
|
|
49
96
|
|
|
50
|
-
## 🎨
|
|
97
|
+
## 🎨 Theme System
|
|
51
98
|
|
|
52
|
-
|
|
99
|
+
Hellboy includes a comprehensive theming system with light/dark modes and customizable colors:
|
|
53
100
|
|
|
54
101
|
```tsx
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
102
|
+
import { getUserPreferences, setUserPreferences } from '@hellboy/ds';
|
|
103
|
+
|
|
104
|
+
// Get current preferences
|
|
105
|
+
const prefs = getUserPreferences();
|
|
106
|
+
console.log(prefs.theme); // 'light' | 'dark' | 'auto'
|
|
107
|
+
|
|
108
|
+
// Update theme
|
|
109
|
+
setUserPreferences({ theme: 'dark' });
|
|
110
|
+
|
|
111
|
+
// Customize colors
|
|
112
|
+
setUserPreferences({
|
|
113
|
+
colors: {
|
|
114
|
+
primary: { hue: 220, saturation: 70, lightness: 50 }
|
|
115
|
+
}
|
|
116
|
+
});
|
|
63
117
|
```
|
|
64
118
|
|
|
65
119
|
## 📝 Building
|
|
@@ -72,40 +126,133 @@ npm run clean # Clean dist directory
|
|
|
72
126
|
|
|
73
127
|
## 📋 Features
|
|
74
128
|
|
|
75
|
-
- ✅ Built with AriaKit
|
|
76
|
-
- ✅ Full
|
|
77
|
-
- ✅
|
|
78
|
-
- ✅
|
|
79
|
-
- ✅
|
|
80
|
-
- ✅
|
|
81
|
-
- ✅
|
|
82
|
-
- ✅
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- `
|
|
95
|
-
|
|
96
|
-
### Button Props
|
|
97
|
-
- `variant` - Button style variant
|
|
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
|
+
## 🔄 Component API Examples
|
|
140
|
+
|
|
141
|
+
### Button
|
|
142
|
+
|
|
143
|
+
**Variants:** `primary` | `secondary` | `tertiary` | `ghost`
|
|
144
|
+
|
|
145
|
+
**Sizes:** `xs` | `sm` | `md` (default) | `lg`
|
|
146
|
+
|
|
147
|
+
**Props:**
|
|
148
|
+
- `variant` - Visual style
|
|
98
149
|
- `size` - Button size
|
|
99
150
|
- `isLoading` - Show loading spinner
|
|
100
|
-
- `disabled` - Disable
|
|
101
|
-
- `fullWidth` -
|
|
102
|
-
-
|
|
151
|
+
- `disabled` - Disable interaction
|
|
152
|
+
- `fullWidth` - Expand to container width
|
|
153
|
+
- `startIcon` / `endIcon` - Icon names from Iconify
|
|
154
|
+
- `iconOnly` - Icon-only button (requires `aria-label`)
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
<Button size="xs">Extra Small</Button>
|
|
158
|
+
<Button size="sm">Small</Button>
|
|
159
|
+
<Button size="md">Medium (Default)</Button>
|
|
160
|
+
<Button size="lg">Large</Button>
|
|
161
|
+
|
|
162
|
+
<Button variant="primary">Primary</Button>
|
|
163
|
+
<Button variant="secondary">Secondary</Button>
|
|
164
|
+
<Button variant="tertiary">Tertiary</Button>
|
|
165
|
+
<Button variant="ghost">Ghost</Button>
|
|
166
|
+
|
|
167
|
+
<Button startIcon="mdi:check">Save</Button>
|
|
168
|
+
<Button endIcon="mdi:arrow-right">Next</Button>
|
|
169
|
+
<Button iconOnly aria-label="Settings">
|
|
170
|
+
<Icon name="mdi:cog" />
|
|
171
|
+
</Button>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Input Types
|
|
175
|
+
|
|
176
|
+
All inputs support standard HTML input props plus:
|
|
177
|
+
- `label` - Input label text
|
|
178
|
+
- `helperText` - Helper text below input
|
|
179
|
+
- `error` - Error message
|
|
180
|
+
- `fullWidth` - Expand to container width
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
<InputText label="Name" placeholder="Enter your name" />
|
|
184
|
+
<InputEmail label="Email" required />
|
|
185
|
+
<InputPassword label="Password" />
|
|
186
|
+
<InputDate label="Birthday" />
|
|
187
|
+
<InputNumber label="Age" min={0} max={120} />
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Card
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
<Card variant="elevated">
|
|
194
|
+
<h3>Card Title</h3>
|
|
195
|
+
<p>Card content goes here</p>
|
|
196
|
+
</Card>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Badge
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
<Badge variant="primary">New</Badge>
|
|
203
|
+
<Badge variant="success">Active</Badge>
|
|
204
|
+
<Badge variant="error">Error</Badge>
|
|
205
|
+
```
|
|
103
206
|
|
|
104
207
|
## ♿ Accessibility
|
|
105
208
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
- Screen
|
|
110
|
-
- Focus
|
|
111
|
-
- Semantic HTML
|
|
209
|
+
Every component is built with accessibility as a core principle:
|
|
210
|
+
|
|
211
|
+
- **Keyboard Navigation**: Full support across all interactive components with logical tab order
|
|
212
|
+
- **Screen Reader Support**: Proper ARIA labels, roles, and live regions
|
|
213
|
+
- **Focus Management**: Visible focus indicators respecting user preferences
|
|
214
|
+
- **Semantic HTML**: Native elements enhanced with ARIA when needed
|
|
215
|
+
- **Color Contrast**: WCAG AA compliant color combinations in both themes
|
|
216
|
+
- **Motion Respect**: Honors `prefers-reduced-motion` for animations
|
|
217
|
+
- **AriaKit Foundation**: Leverages battle-tested accessibility primitives
|
|
218
|
+
|
|
219
|
+
## 🏗️ Development Status
|
|
220
|
+
|
|
221
|
+
Hellboy Design System is currently in **active development** (v0.1.x). The core architecture and components are production-ready for testing and exploration, with ongoing iterations to enhance functionality and accessibility coverage.
|
|
222
|
+
|
|
223
|
+
**What's Ready:**
|
|
224
|
+
- Core theming system with light/dark modes
|
|
225
|
+
- 25+ production-ready components
|
|
226
|
+
- Full TypeScript support
|
|
227
|
+
- Comprehensive accessibility features
|
|
228
|
+
|
|
229
|
+
**In Progress:**
|
|
230
|
+
- Additional component variants
|
|
231
|
+
- Enhanced customization APIs
|
|
232
|
+
- Expanded documentation
|
|
233
|
+
- Performance optimizations
|
|
234
|
+
|
|
235
|
+
## 📦 Package Structure
|
|
236
|
+
|
|
237
|
+
```
|
|
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
|
+
|
|
248
|
+
## 🤝 Contributing
|
|
249
|
+
|
|
250
|
+
This is an evolving design system. Feedback and contributions are welcome as the system matures toward its comprehensive vision of balanced, accessible, and beautiful design.
|
|
251
|
+
|
|
252
|
+
## 📄 License
|
|
253
|
+
|
|
254
|
+
MIT
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
**Built with the philosophy of balance:** Light and Dark, Chaos and Precision, Beauty and Function. ✨
|
package/dist/index.css
CHANGED
|
@@ -302,7 +302,7 @@ h6 {
|
|
|
302
302
|
font-weight: var(--font-weight-semibold);
|
|
303
303
|
line-height: var(--line-height-tight);
|
|
304
304
|
color: var(--color-text-primary);
|
|
305
|
-
margin:
|
|
305
|
+
margin: var(--spacing-6) 0 var(--spacing-2) 0;
|
|
306
306
|
}
|
|
307
307
|
h1 {
|
|
308
308
|
font-size: var(--font-size-4xl);
|