@hellboy/ds 0.1.2
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 +111 -0
- package/dist/index.css +3699 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +1087 -0
- package/dist/index.d.ts +1087 -0
- package/dist/index.js +3391 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3287 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme.css +55 -0
- package/hellboy-ds-0.1.2.tgz +0 -0
- package/package.json +42 -0
- package/src/components/badge/Badge.tsx +29 -0
- package/src/components/badge/index.ts +1 -0
- package/src/components/banner/Banner.tsx +48 -0
- package/src/components/banner/banner.css +44 -0
- package/src/components/banner/index.ts +1 -0
- package/src/components/button/button.tsx +127 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/card/card.tsx +57 -0
- package/src/components/card/index.ts +1 -0
- package/src/components/checkbox/Checkbox.tsx +98 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/code-block/code-block.tsx +44 -0
- package/src/components/code-block/index.ts +1 -0
- package/src/components/color-control/color-control.tsx +322 -0
- package/src/components/color-control/index.ts +1 -0
- package/src/components/drag-handle/DragHandle.tsx +78 -0
- package/src/components/drag-handle/index.ts +1 -0
- package/src/components/drawer/drawer.tsx +82 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/floating-bar/floating-bar.tsx +52 -0
- package/src/components/floating-bar/index.ts +2 -0
- package/src/components/footer/footer.tsx +28 -0
- package/src/components/footer/index.ts +1 -0
- package/src/components/grid/Grid.tsx +53 -0
- package/src/components/grid/index.ts +1 -0
- package/src/components/header/header.tsx +57 -0
- package/src/components/header/index.ts +1 -0
- package/src/components/icons/icons.tsx +44 -0
- package/src/components/icons/index.ts +1 -0
- package/src/components/index.ts +29 -0
- package/src/components/input/DatePicker.tsx +133 -0
- package/src/components/input/Input.tsx +220 -0
- package/src/components/input/InputDate.tsx +10 -0
- package/src/components/input/InputDateTime.tsx +10 -0
- package/src/components/input/InputEmail.tsx +10 -0
- package/src/components/input/InputField.tsx +137 -0
- package/src/components/input/InputNumber.tsx +10 -0
- package/src/components/input/InputPassword.tsx +10 -0
- package/src/components/input/InputSearch.tsx +10 -0
- package/src/components/input/InputTel.tsx +10 -0
- package/src/components/input/InputText.tsx +10 -0
- package/src/components/input/InputTime.tsx +10 -0
- package/src/components/input/InputUrl.tsx +10 -0
- package/src/components/input/TimePicker.tsx +151 -0
- package/src/components/input/index.ts +11 -0
- package/src/components/layout/Layout.tsx +244 -0
- package/src/components/layout/index.ts +1 -0
- package/src/components/list/List.tsx +159 -0
- package/src/components/list/index.ts +1 -0
- package/src/components/navbar/MenuCategory.tsx +20 -0
- package/src/components/navbar/MenuGroup.tsx +288 -0
- package/src/components/navbar/MenuItem.tsx +65 -0
- package/src/components/navbar/Navbar.tsx +23 -0
- package/src/components/navbar/index.ts +4 -0
- package/src/components/page/index.ts +1 -0
- package/src/components/page/page.tsx +46 -0
- package/src/components/page-index/PageIndex.tsx +275 -0
- package/src/components/page-index/index.ts +1 -0
- package/src/components/popover/index.ts +1 -0
- package/src/components/popover/popover.tsx +199 -0
- package/src/components/radio/Radio.tsx +176 -0
- package/src/components/radio/index.ts +1 -0
- package/src/components/section/index.ts +1 -0
- package/src/components/section/section.tsx +66 -0
- package/src/components/select/Select.tsx +212 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/slider/Slider.tsx +267 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/switch.tsx +99 -0
- package/src/components/table/Table.tsx +147 -0
- package/src/components/table/index.ts +1 -0
- package/src/components/theme-control/index.ts +1 -0
- package/src/components/theme-control/theme-control.tsx +78 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/tooltip.tsx +207 -0
- package/src/contexts/NavbarTooltipContext.tsx +48 -0
- package/src/contexts/index.ts +1 -0
- package/src/foundations/motion.md +136 -0
- package/src/index.ts +40 -0
- package/src/style/_shared/field.css +69 -0
- package/src/style/components/badge/badge.css +74 -0
- package/src/style/components/button/button.css +244 -0
- package/src/style/components/card/card.css +69 -0
- package/src/style/components/checkbox.css +142 -0
- package/src/style/components/code-block/code-block.css +34 -0
- package/src/style/components/color-control/color-control.css +126 -0
- package/src/style/components/drag-handle/drag-handle.css +68 -0
- package/src/style/components/drawer/drawer.css +210 -0
- package/src/style/components/floating-bar/floating-bar.css +39 -0
- package/src/style/components/footer/footer.css +108 -0
- package/src/style/components/grid/grid.css +33 -0
- package/src/style/components/header/header.css +44 -0
- package/src/style/components/icons/icons.css +44 -0
- package/src/style/components/input/input.css +393 -0
- package/src/style/components/layout/layout.css +205 -0
- package/src/style/components/list/list.css +140 -0
- package/src/style/components/navbar/navbar.css +342 -0
- package/src/style/components/page/page.css +46 -0
- package/src/style/components/page-index/page-index.css +158 -0
- package/src/style/components/popover/popover.css +44 -0
- package/src/style/components/radio.css +178 -0
- package/src/style/components/section/section.css +67 -0
- package/src/style/components/select/select.css +143 -0
- package/src/style/components/slider/slider.css +159 -0
- package/src/style/components/switch/switch.css +267 -0
- package/src/style/components/table/table.css +108 -0
- package/src/style/components/theme-control/theme-control.css +35 -0
- package/src/style/components/tooltip/tooltip.css +52 -0
- package/src/style/foundations/global.css +316 -0
- package/src/style/foundations/motion.css +164 -0
- package/src/style/foundations/spacing.css +51 -0
- package/src/style/foundations/typography.css +39 -0
- package/src/style/foundations/z-index.css +81 -0
- package/src/style/modes/dark.css +146 -0
- package/src/style/modes/light.css +147 -0
- package/src/style/semantic.css +52 -0
- package/src/style/styles.css +51 -0
- package/src/style/themes/theme.json +37 -0
- package/src/utils/README.md +305 -0
- package/src/utils/USER_PREFERENCES.md +558 -0
- package/src/utils/theme.ts +127 -0
- package/src/utils/user-preferences.ts +577 -0
- package/tsconfig.json +25 -0
- package/tsup.config.ts +52 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1087 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { ReactNode } from 'react';
|
|
3
|
+
import { ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, DialogProps, useDialogStore } from '@ariakit/react';
|
|
4
|
+
|
|
5
|
+
interface NavbarTooltipContextType {
|
|
6
|
+
hasOpenPopover: boolean;
|
|
7
|
+
setHasOpenPopover: (open: boolean) => void;
|
|
8
|
+
openPopover: (id: string) => void;
|
|
9
|
+
closePopover: (id: string) => void;
|
|
10
|
+
activePopoverId: string | null;
|
|
11
|
+
}
|
|
12
|
+
declare const NavbarTooltipProvider: React.FC<{
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
declare const useNavbarTooltip: () => NavbarTooltipContextType;
|
|
16
|
+
|
|
17
|
+
type IconName = string;
|
|
18
|
+
interface IconProps {
|
|
19
|
+
name: IconName;
|
|
20
|
+
size?: number;
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Render a skeleton placeholder instead of the real icon (useful while downloading/loading) */
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
/** aria-label for icon-only buttons etc. */
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
}
|
|
27
|
+
declare const Icon: React__default.FC<IconProps>;
|
|
28
|
+
|
|
29
|
+
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
30
|
+
type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
31
|
+
interface ButtonProps extends Omit<ButtonProps$1, 'children'> {
|
|
32
|
+
/**
|
|
33
|
+
* Visual variant of the button
|
|
34
|
+
* @default 'primary'
|
|
35
|
+
*/
|
|
36
|
+
variant?: ButtonVariant;
|
|
37
|
+
/**
|
|
38
|
+
* Size of the button
|
|
39
|
+
* @default 'md'
|
|
40
|
+
*/
|
|
41
|
+
size?: ButtonSize;
|
|
42
|
+
/**
|
|
43
|
+
* Button content
|
|
44
|
+
*/
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the button is in a loading state
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
isLoading?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Full width button
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
fullWidth?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Icon to display at the start of the button
|
|
58
|
+
*/
|
|
59
|
+
startIcon?: IconName;
|
|
60
|
+
/**
|
|
61
|
+
* Icon to display at the end of the button
|
|
62
|
+
*/
|
|
63
|
+
endIcon?: IconName;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the button should only display an icon (no text)
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
iconOnly?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* URL to navigate to when button is clicked (makes it work like a link)
|
|
71
|
+
*/
|
|
72
|
+
href?: string;
|
|
73
|
+
}
|
|
74
|
+
declare const Button: React__default.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
75
|
+
|
|
76
|
+
type BadgeVariant = 'primary' | 'secondary' | 'tertiary' | 'accent' | 'success' | 'warning' | 'error' | 'info';
|
|
77
|
+
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
78
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
79
|
+
variant?: BadgeVariant;
|
|
80
|
+
size?: BadgeSize;
|
|
81
|
+
children: React.ReactNode;
|
|
82
|
+
}
|
|
83
|
+
declare const Badge: React.FC<BadgeProps>;
|
|
84
|
+
|
|
85
|
+
type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
86
|
+
interface CheckboxProps extends Omit<CheckboxProps$1, 'children' | 'size'> {
|
|
87
|
+
/**
|
|
88
|
+
* Size of the checkbox
|
|
89
|
+
* @default 'md'
|
|
90
|
+
*/
|
|
91
|
+
size?: CheckboxSize;
|
|
92
|
+
/**
|
|
93
|
+
* Label text for the checkbox
|
|
94
|
+
*/
|
|
95
|
+
label?: React__default.ReactNode;
|
|
96
|
+
/**
|
|
97
|
+
* Error message to display below the checkbox
|
|
98
|
+
*/
|
|
99
|
+
error?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Helper text to display below the checkbox
|
|
102
|
+
*/
|
|
103
|
+
helperText?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the checkbox is in an indeterminate state
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
indeterminate?: boolean;
|
|
109
|
+
}
|
|
110
|
+
declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
111
|
+
|
|
112
|
+
type SwitchSize = 'sm' | 'md' | 'lg';
|
|
113
|
+
interface SwitchProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
114
|
+
/**
|
|
115
|
+
* Size of the switch
|
|
116
|
+
* @default 'md'
|
|
117
|
+
*/
|
|
118
|
+
size?: SwitchSize;
|
|
119
|
+
/**
|
|
120
|
+
* Label text for the switch
|
|
121
|
+
*/
|
|
122
|
+
label?: React__default.ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* Icon to display when switch is ON
|
|
125
|
+
*/
|
|
126
|
+
onIcon?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Icon to display when switch is OFF
|
|
129
|
+
*/
|
|
130
|
+
offIcon?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Error message to display below the switch
|
|
133
|
+
*/
|
|
134
|
+
error?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Helper text to display below the switch
|
|
137
|
+
*/
|
|
138
|
+
helperText?: string;
|
|
139
|
+
}
|
|
140
|
+
declare const Switch: React__default.ForwardRefExoticComponent<SwitchProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
141
|
+
|
|
142
|
+
type LayoutVariant = "single" | "stacked" | "sidebar-main-sidebar";
|
|
143
|
+
interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
144
|
+
variant?: LayoutVariant;
|
|
145
|
+
header?: React.ReactNode;
|
|
146
|
+
footer?: React.ReactNode;
|
|
147
|
+
sidebarLeft?: React.ReactNode;
|
|
148
|
+
sidebarRight?: React.ReactNode;
|
|
149
|
+
bottomBar?: React.ReactNode;
|
|
150
|
+
resizable?: boolean;
|
|
151
|
+
}
|
|
152
|
+
declare const Layout: React.FC<LayoutProps>;
|
|
153
|
+
|
|
154
|
+
type PageWidth = 'full' | 'wide' | 'medium' | 'narrow';
|
|
155
|
+
interface PageProps {
|
|
156
|
+
/**
|
|
157
|
+
* Page content width
|
|
158
|
+
* - full: 100% width
|
|
159
|
+
* - wide: 1400px max
|
|
160
|
+
* - medium: 1200px max (default)
|
|
161
|
+
* - narrow: 800px max
|
|
162
|
+
* @default 'medium'
|
|
163
|
+
*/
|
|
164
|
+
width?: PageWidth;
|
|
165
|
+
/**
|
|
166
|
+
* Page content
|
|
167
|
+
*/
|
|
168
|
+
children: ReactNode;
|
|
169
|
+
/**
|
|
170
|
+
* Custom class name
|
|
171
|
+
*/
|
|
172
|
+
className?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Page Component
|
|
176
|
+
* Main content container with responsive width control
|
|
177
|
+
* Use inside Layout's children for consistent content sizing
|
|
178
|
+
*/
|
|
179
|
+
declare const Page: React__default.FC<PageProps>;
|
|
180
|
+
|
|
181
|
+
interface HeaderProps {
|
|
182
|
+
/**
|
|
183
|
+
* Header title
|
|
184
|
+
*/
|
|
185
|
+
title?: ReactNode;
|
|
186
|
+
/**
|
|
187
|
+
* Header subtitle/description
|
|
188
|
+
*/
|
|
189
|
+
subtitle?: ReactNode;
|
|
190
|
+
/**
|
|
191
|
+
* Header content - overrides title/subtitle
|
|
192
|
+
*/
|
|
193
|
+
children?: ReactNode;
|
|
194
|
+
/**
|
|
195
|
+
* Custom class name
|
|
196
|
+
*/
|
|
197
|
+
className?: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Header component for page headers
|
|
201
|
+
* Displays title, subtitle, or custom content
|
|
202
|
+
*/
|
|
203
|
+
declare const Header: React__default.FC<HeaderProps>;
|
|
204
|
+
|
|
205
|
+
type SectionSize = 'sm' | 'md' | 'lg';
|
|
206
|
+
interface SectionProps {
|
|
207
|
+
/**
|
|
208
|
+
* Section title
|
|
209
|
+
*/
|
|
210
|
+
title?: ReactNode;
|
|
211
|
+
/**
|
|
212
|
+
* Section content
|
|
213
|
+
*/
|
|
214
|
+
children: ReactNode;
|
|
215
|
+
/**
|
|
216
|
+
* Section size/padding
|
|
217
|
+
* @default 'md'
|
|
218
|
+
*/
|
|
219
|
+
size?: SectionSize;
|
|
220
|
+
/**
|
|
221
|
+
* Custom class name
|
|
222
|
+
*/
|
|
223
|
+
className?: string;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Section component for content areas
|
|
227
|
+
* Provides consistent spacing and styling for content sections
|
|
228
|
+
*/
|
|
229
|
+
declare const Section: React__default.FC<SectionProps>;
|
|
230
|
+
|
|
231
|
+
type CodeBlockVariant = 'block' | 'inline';
|
|
232
|
+
interface CodeBlockProps {
|
|
233
|
+
/**
|
|
234
|
+
* Code content
|
|
235
|
+
*/
|
|
236
|
+
children: ReactNode;
|
|
237
|
+
/**
|
|
238
|
+
* Variant of the code block
|
|
239
|
+
* @default 'block'
|
|
240
|
+
*/
|
|
241
|
+
variant?: CodeBlockVariant;
|
|
242
|
+
/**
|
|
243
|
+
* Custom class name
|
|
244
|
+
*/
|
|
245
|
+
className?: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* CodeBlock component for displaying code snippets
|
|
249
|
+
*/
|
|
250
|
+
declare const CodeBlock: React__default.FC<CodeBlockProps>;
|
|
251
|
+
|
|
252
|
+
interface NavbarProps {
|
|
253
|
+
children: React.ReactNode;
|
|
254
|
+
className?: string;
|
|
255
|
+
/** Default width (px) the navbar should assume when expanded and no user preference exists */
|
|
256
|
+
defaultExpandedWidth?: number;
|
|
257
|
+
}
|
|
258
|
+
declare const Navbar: React.FC<NavbarProps>;
|
|
259
|
+
|
|
260
|
+
interface MenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
261
|
+
icon?: string;
|
|
262
|
+
active?: boolean;
|
|
263
|
+
children: React.ReactNode;
|
|
264
|
+
as?: React.ElementType<any>;
|
|
265
|
+
isCollapsed?: boolean;
|
|
266
|
+
showTooltipWhenCollapsed?: boolean;
|
|
267
|
+
[key: string]: any;
|
|
268
|
+
}
|
|
269
|
+
declare const MenuItem: React.FC<MenuItemProps>;
|
|
270
|
+
|
|
271
|
+
interface MenuGroupProps {
|
|
272
|
+
title: string;
|
|
273
|
+
icon?: string;
|
|
274
|
+
children: React.ReactNode;
|
|
275
|
+
defaultExpanded?: boolean;
|
|
276
|
+
autoExpand?: boolean;
|
|
277
|
+
expandable?: boolean;
|
|
278
|
+
isCollapsed?: boolean;
|
|
279
|
+
}
|
|
280
|
+
declare const MenuGroup: React.FC<MenuGroupProps>;
|
|
281
|
+
|
|
282
|
+
interface MenuCategoryProps {
|
|
283
|
+
title: string;
|
|
284
|
+
children: React.ReactNode;
|
|
285
|
+
}
|
|
286
|
+
declare const MenuCategory: React.FC<MenuCategoryProps>;
|
|
287
|
+
|
|
288
|
+
type Theme$1 = 'light' | 'dark';
|
|
289
|
+
interface ThemeControlProps {
|
|
290
|
+
onThemeChange?: (theme: Theme$1) => void;
|
|
291
|
+
}
|
|
292
|
+
declare const ThemeControl: React.FC<ThemeControlProps>;
|
|
293
|
+
|
|
294
|
+
type CardVariant = 'default' | 'elevated' | 'outlined';
|
|
295
|
+
interface CardProps {
|
|
296
|
+
/**
|
|
297
|
+
* Visual variant of the card
|
|
298
|
+
* @default 'default'
|
|
299
|
+
*/
|
|
300
|
+
variant?: CardVariant;
|
|
301
|
+
/**
|
|
302
|
+
* Card content
|
|
303
|
+
*/
|
|
304
|
+
children: ReactNode;
|
|
305
|
+
/**
|
|
306
|
+
* Additional CSS classes
|
|
307
|
+
*/
|
|
308
|
+
className?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Click handler for interactive cards
|
|
311
|
+
*/
|
|
312
|
+
onClick?: () => void;
|
|
313
|
+
}
|
|
314
|
+
declare const Card: React__default.FC<CardProps>;
|
|
315
|
+
|
|
316
|
+
declare const ColorControl: React__default.FC;
|
|
317
|
+
|
|
318
|
+
type GridColumns = number | "auto-fit" | "auto-fill";
|
|
319
|
+
interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
320
|
+
/**
|
|
321
|
+
* Number of columns or auto-fit/auto-fill
|
|
322
|
+
* @default "auto-fit"
|
|
323
|
+
*/
|
|
324
|
+
columns?: GridColumns;
|
|
325
|
+
/**
|
|
326
|
+
* Minimum width for each column (when using auto-fit/auto-fill)
|
|
327
|
+
* @default "250px"
|
|
328
|
+
*/
|
|
329
|
+
minWidth?: string;
|
|
330
|
+
/**
|
|
331
|
+
* Gap between grid items
|
|
332
|
+
* @default "1rem"
|
|
333
|
+
*/
|
|
334
|
+
gap?: string;
|
|
335
|
+
/**
|
|
336
|
+
* Maximum number of columns (when columns is a number)
|
|
337
|
+
*/
|
|
338
|
+
maxColumns?: number;
|
|
339
|
+
}
|
|
340
|
+
declare const Grid: React.FC<GridProps>;
|
|
341
|
+
|
|
342
|
+
interface SliderProps {
|
|
343
|
+
/**
|
|
344
|
+
* Minimum value
|
|
345
|
+
* @default 0
|
|
346
|
+
*/
|
|
347
|
+
min?: number;
|
|
348
|
+
/**
|
|
349
|
+
* Maximum value
|
|
350
|
+
* @default 100
|
|
351
|
+
*/
|
|
352
|
+
max?: number;
|
|
353
|
+
/**
|
|
354
|
+
* Current value
|
|
355
|
+
*/
|
|
356
|
+
value: number;
|
|
357
|
+
/**
|
|
358
|
+
* Step increment
|
|
359
|
+
* @default 1
|
|
360
|
+
*/
|
|
361
|
+
step?: number;
|
|
362
|
+
/**
|
|
363
|
+
* Callback when value changes
|
|
364
|
+
*/
|
|
365
|
+
onChange: (value: number) => void;
|
|
366
|
+
/**
|
|
367
|
+
* Callback when drag starts
|
|
368
|
+
*/
|
|
369
|
+
onDragStart?: () => void;
|
|
370
|
+
/**
|
|
371
|
+
* Callback when drag ends (value committed)
|
|
372
|
+
*/
|
|
373
|
+
onChangeEnd?: (value: number) => void;
|
|
374
|
+
/**
|
|
375
|
+
* Label for the slider
|
|
376
|
+
*/
|
|
377
|
+
label?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Show value display
|
|
380
|
+
* @default true
|
|
381
|
+
*/
|
|
382
|
+
showValue?: boolean;
|
|
383
|
+
/**
|
|
384
|
+
* Custom class name
|
|
385
|
+
*/
|
|
386
|
+
className?: string;
|
|
387
|
+
/**
|
|
388
|
+
* Disabled state
|
|
389
|
+
* @default false
|
|
390
|
+
*/
|
|
391
|
+
disabled?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* Slider type for different backgrounds
|
|
394
|
+
* @default 'default'
|
|
395
|
+
*/
|
|
396
|
+
type?: 'default' | 'hue' | 'saturation' | 'lightness';
|
|
397
|
+
/**
|
|
398
|
+
* Base color for saturation/lightness gradients (hsl values)
|
|
399
|
+
*/
|
|
400
|
+
baseHue?: number;
|
|
401
|
+
/**
|
|
402
|
+
* Base saturation for lightness gradient (0-100)
|
|
403
|
+
*/
|
|
404
|
+
baseSaturation?: number;
|
|
405
|
+
}
|
|
406
|
+
declare const Slider: React__default.FC<SliderProps>;
|
|
407
|
+
|
|
408
|
+
interface DragHandleProps {
|
|
409
|
+
onResize: (delta: number) => void;
|
|
410
|
+
onResizeEnd?: () => void;
|
|
411
|
+
orientation?: 'vertical' | 'horizontal';
|
|
412
|
+
className?: string;
|
|
413
|
+
}
|
|
414
|
+
declare const DragHandle: React__default.FC<DragHandleProps>;
|
|
415
|
+
|
|
416
|
+
interface FooterProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
417
|
+
children?: React__default.ReactNode;
|
|
418
|
+
}
|
|
419
|
+
declare const Footer: React__default.FC<FooterProps>;
|
|
420
|
+
|
|
421
|
+
interface InputFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
|
|
422
|
+
/**
|
|
423
|
+
* Input native type (text, email, password, etc.)
|
|
424
|
+
*/
|
|
425
|
+
type?: string;
|
|
426
|
+
/**
|
|
427
|
+
* Label text
|
|
428
|
+
*/
|
|
429
|
+
label?: string;
|
|
430
|
+
/**
|
|
431
|
+
* Helper text shown below the input
|
|
432
|
+
*/
|
|
433
|
+
helperText?: string;
|
|
434
|
+
/**
|
|
435
|
+
* Error message - when present, input is in error state
|
|
436
|
+
*/
|
|
437
|
+
error?: string;
|
|
438
|
+
/**
|
|
439
|
+
* Icon name from our icon library (shown on the left)
|
|
440
|
+
*/
|
|
441
|
+
icon?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Icon name for the right side
|
|
444
|
+
*/
|
|
445
|
+
iconRight?: string;
|
|
446
|
+
/**
|
|
447
|
+
* Full width input
|
|
448
|
+
* @default false
|
|
449
|
+
*/
|
|
450
|
+
fullWidth?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Size variant
|
|
453
|
+
* @default 'md'
|
|
454
|
+
*/
|
|
455
|
+
size?: 'sm' | 'md' | 'lg';
|
|
456
|
+
/**
|
|
457
|
+
* Custom class name
|
|
458
|
+
*/
|
|
459
|
+
className?: string;
|
|
460
|
+
/**
|
|
461
|
+
* Right icon click handler
|
|
462
|
+
*/
|
|
463
|
+
onRightIconClick?: () => void;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local';
|
|
467
|
+
interface InputProps extends Omit<InputFieldProps, 'type' | 'iconRight' | 'onRightIconClick'> {
|
|
468
|
+
/**
|
|
469
|
+
* Input type with extended support for date/time pickers
|
|
470
|
+
* @default 'text'
|
|
471
|
+
*/
|
|
472
|
+
type?: InputType;
|
|
473
|
+
/**
|
|
474
|
+
* Show milliseconds in time picker (only for time type)
|
|
475
|
+
* @default false
|
|
476
|
+
*/
|
|
477
|
+
showMilliseconds?: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* Minute step in time picker (only for time type)
|
|
480
|
+
* @default 1
|
|
481
|
+
*/
|
|
482
|
+
minuteStep?: 1 | 5 | 15 | 30;
|
|
483
|
+
/**
|
|
484
|
+
* Show clear button for search inputs when they have value
|
|
485
|
+
* @default true
|
|
486
|
+
*/
|
|
487
|
+
showClear?: boolean;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
interface InputTextProps extends Omit<InputProps, 'type'> {
|
|
491
|
+
}
|
|
492
|
+
declare const InputText: React__default.ForwardRefExoticComponent<InputTextProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
493
|
+
|
|
494
|
+
interface InputEmailProps extends Omit<InputProps, 'type'> {
|
|
495
|
+
}
|
|
496
|
+
declare const InputEmail: React__default.ForwardRefExoticComponent<InputEmailProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
497
|
+
|
|
498
|
+
interface InputPasswordProps extends Omit<InputProps, 'type'> {
|
|
499
|
+
}
|
|
500
|
+
declare const InputPassword: React__default.ForwardRefExoticComponent<InputPasswordProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
501
|
+
|
|
502
|
+
interface InputSearchProps extends Omit<InputProps, 'type'> {
|
|
503
|
+
}
|
|
504
|
+
declare const InputSearch: React__default.ForwardRefExoticComponent<InputSearchProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
505
|
+
|
|
506
|
+
interface InputTelProps extends Omit<InputProps, 'type'> {
|
|
507
|
+
}
|
|
508
|
+
declare const InputTel: React__default.ForwardRefExoticComponent<InputTelProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
509
|
+
|
|
510
|
+
interface InputUrlProps extends Omit<InputProps, 'type'> {
|
|
511
|
+
}
|
|
512
|
+
declare const InputUrl: React__default.ForwardRefExoticComponent<InputUrlProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
513
|
+
|
|
514
|
+
interface InputNumberProps extends Omit<InputProps, 'type'> {
|
|
515
|
+
}
|
|
516
|
+
declare const InputNumber: React__default.ForwardRefExoticComponent<InputNumberProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
517
|
+
|
|
518
|
+
interface InputDateProps extends Omit<InputProps, 'type'> {
|
|
519
|
+
}
|
|
520
|
+
declare const InputDate: React__default.ForwardRefExoticComponent<InputDateProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
521
|
+
|
|
522
|
+
interface InputTimeProps extends Omit<InputProps, 'type'> {
|
|
523
|
+
}
|
|
524
|
+
declare const InputTime: React__default.ForwardRefExoticComponent<InputTimeProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
525
|
+
|
|
526
|
+
interface InputDateTimeProps extends Omit<InputProps, 'type'> {
|
|
527
|
+
}
|
|
528
|
+
declare const InputDateTime: React__default.ForwardRefExoticComponent<InputDateTimeProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
529
|
+
|
|
530
|
+
interface ListItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
531
|
+
/**
|
|
532
|
+
* Item content
|
|
533
|
+
*/
|
|
534
|
+
children: React.ReactNode;
|
|
535
|
+
/**
|
|
536
|
+
* Icon name from our icon library
|
|
537
|
+
*/
|
|
538
|
+
icon?: string;
|
|
539
|
+
/**
|
|
540
|
+
* Whether the item is selected
|
|
541
|
+
*/
|
|
542
|
+
selected?: boolean;
|
|
543
|
+
/**
|
|
544
|
+
* Whether the item is disabled
|
|
545
|
+
*/
|
|
546
|
+
disabled?: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Click handler
|
|
549
|
+
*/
|
|
550
|
+
onClick?: () => void;
|
|
551
|
+
/**
|
|
552
|
+
* Custom class name
|
|
553
|
+
*/
|
|
554
|
+
className?: string;
|
|
555
|
+
/**
|
|
556
|
+
* Category label for organizing items (display only)
|
|
557
|
+
*/
|
|
558
|
+
category?: string;
|
|
559
|
+
}
|
|
560
|
+
declare const ListItem: React.FC<ListItemProps>;
|
|
561
|
+
interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
562
|
+
/**
|
|
563
|
+
* List items
|
|
564
|
+
*/
|
|
565
|
+
children: React.ReactNode;
|
|
566
|
+
/**
|
|
567
|
+
* Custom class name
|
|
568
|
+
*/
|
|
569
|
+
className?: string;
|
|
570
|
+
}
|
|
571
|
+
declare const List: React.FC<ListProps>;
|
|
572
|
+
|
|
573
|
+
type RadioSize = 'sm' | 'md' | 'lg';
|
|
574
|
+
interface RadioProps extends Omit<RadioProps$1, 'children' | 'size'> {
|
|
575
|
+
/**
|
|
576
|
+
* Size of the radio button
|
|
577
|
+
* @default 'md'
|
|
578
|
+
*/
|
|
579
|
+
size?: RadioSize;
|
|
580
|
+
/**
|
|
581
|
+
* Label text for the radio button
|
|
582
|
+
*/
|
|
583
|
+
label?: React__default.ReactNode;
|
|
584
|
+
/**
|
|
585
|
+
* Error state
|
|
586
|
+
*/
|
|
587
|
+
error?: boolean;
|
|
588
|
+
}
|
|
589
|
+
interface RadioGroupProps extends Omit<RadioGroupProps$1, 'onChange'> {
|
|
590
|
+
/**
|
|
591
|
+
* Size of all radio buttons in the group
|
|
592
|
+
* @default 'md'
|
|
593
|
+
*/
|
|
594
|
+
size?: RadioSize;
|
|
595
|
+
/**
|
|
596
|
+
* Label for the radio group
|
|
597
|
+
*/
|
|
598
|
+
label?: string;
|
|
599
|
+
/**
|
|
600
|
+
* Error message to display below the radio group
|
|
601
|
+
*/
|
|
602
|
+
error?: string;
|
|
603
|
+
/**
|
|
604
|
+
* Helper text to display below the radio group
|
|
605
|
+
*/
|
|
606
|
+
helperText?: string;
|
|
607
|
+
/**
|
|
608
|
+
* Children (Radio components)
|
|
609
|
+
*/
|
|
610
|
+
children: React__default.ReactNode;
|
|
611
|
+
/**
|
|
612
|
+
* Orientation of the radio group
|
|
613
|
+
* @default 'vertical'
|
|
614
|
+
*/
|
|
615
|
+
orientation?: 'horizontal' | 'vertical';
|
|
616
|
+
/**
|
|
617
|
+
* The value of the selected radio button
|
|
618
|
+
*/
|
|
619
|
+
value?: string | number | null;
|
|
620
|
+
/**
|
|
621
|
+
* Callback when the selected value changes
|
|
622
|
+
*/
|
|
623
|
+
onChange?: (value: string | number | null) => void;
|
|
624
|
+
}
|
|
625
|
+
declare const Radio: React__default.ForwardRefExoticComponent<Omit<RadioProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
626
|
+
declare const RadioGroup: React__default.ForwardRefExoticComponent<Omit<RadioGroupProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
627
|
+
|
|
628
|
+
interface SelectOption {
|
|
629
|
+
value: string;
|
|
630
|
+
label: string;
|
|
631
|
+
icon?: string;
|
|
632
|
+
disabled?: boolean;
|
|
633
|
+
}
|
|
634
|
+
interface SelectProps {
|
|
635
|
+
/**
|
|
636
|
+
* Select options
|
|
637
|
+
*/
|
|
638
|
+
options: SelectOption[];
|
|
639
|
+
/**
|
|
640
|
+
* Current value
|
|
641
|
+
*/
|
|
642
|
+
value?: string;
|
|
643
|
+
/**
|
|
644
|
+
* Change handler
|
|
645
|
+
*/
|
|
646
|
+
onChange?: (value: string) => void;
|
|
647
|
+
/**
|
|
648
|
+
* Label text
|
|
649
|
+
*/
|
|
650
|
+
label?: string;
|
|
651
|
+
/**
|
|
652
|
+
* Placeholder when no value selected
|
|
653
|
+
*/
|
|
654
|
+
placeholder?: string;
|
|
655
|
+
/**
|
|
656
|
+
* Helper text shown below the select
|
|
657
|
+
*/
|
|
658
|
+
helperText?: string;
|
|
659
|
+
/**
|
|
660
|
+
* Error message - when present, select is in error state
|
|
661
|
+
*/
|
|
662
|
+
error?: string;
|
|
663
|
+
/**
|
|
664
|
+
* Whether the select is disabled
|
|
665
|
+
*/
|
|
666
|
+
disabled?: boolean;
|
|
667
|
+
/**
|
|
668
|
+
* Full width select
|
|
669
|
+
* @default false
|
|
670
|
+
*/
|
|
671
|
+
fullWidth?: boolean;
|
|
672
|
+
/**
|
|
673
|
+
* Size variant
|
|
674
|
+
* @default 'md'
|
|
675
|
+
*/
|
|
676
|
+
size?: 'sm' | 'md' | 'lg';
|
|
677
|
+
/**
|
|
678
|
+
* Custom class name
|
|
679
|
+
*/
|
|
680
|
+
className?: string;
|
|
681
|
+
/**
|
|
682
|
+
* ID for accessibility
|
|
683
|
+
*/
|
|
684
|
+
id?: string;
|
|
685
|
+
}
|
|
686
|
+
declare const Select: React.FC<SelectProps>;
|
|
687
|
+
|
|
688
|
+
type BannerType = 'info' | 'warning' | 'error' | 'success';
|
|
689
|
+
interface BannerProps {
|
|
690
|
+
type?: BannerType;
|
|
691
|
+
children: ReactNode;
|
|
692
|
+
icon?: string;
|
|
693
|
+
onDismiss?: () => void;
|
|
694
|
+
}
|
|
695
|
+
declare const Banner: React__default.FC<BannerProps>;
|
|
696
|
+
|
|
697
|
+
type FloatingBarPosition = 'top' | 'bottom';
|
|
698
|
+
interface FloatingBarProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
699
|
+
/**
|
|
700
|
+
* Position of the floating bar
|
|
701
|
+
* @default 'bottom'
|
|
702
|
+
*/
|
|
703
|
+
position?: FloatingBarPosition;
|
|
704
|
+
/**
|
|
705
|
+
* Content of the floating bar
|
|
706
|
+
*/
|
|
707
|
+
children: React__default.ReactNode;
|
|
708
|
+
/**
|
|
709
|
+
* Additional CSS classes
|
|
710
|
+
*/
|
|
711
|
+
className?: string;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* FloatingBar Component
|
|
715
|
+
* A floating bar that sticks to the top or bottom within the main layout container
|
|
716
|
+
*/
|
|
717
|
+
declare const FloatingBar: React__default.FC<FloatingBarProps>;
|
|
718
|
+
|
|
719
|
+
interface PopoverProps {
|
|
720
|
+
trigger: React.ReactNode;
|
|
721
|
+
children: React.ReactNode;
|
|
722
|
+
isOpen?: boolean;
|
|
723
|
+
onToggle?: () => void;
|
|
724
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
725
|
+
}
|
|
726
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
727
|
+
|
|
728
|
+
interface TooltipProps {
|
|
729
|
+
content: React.ReactNode;
|
|
730
|
+
children: React.ReactNode;
|
|
731
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
732
|
+
delay?: number;
|
|
733
|
+
disabled?: boolean;
|
|
734
|
+
}
|
|
735
|
+
declare const Tooltip: React.FC<TooltipProps>;
|
|
736
|
+
|
|
737
|
+
type DrawerPlacement = "top" | "bottom" | "left" | "right";
|
|
738
|
+
interface DrawerProps extends Omit<DialogProps, "children"> {
|
|
739
|
+
children: React.ReactNode;
|
|
740
|
+
title?: string;
|
|
741
|
+
placement?: DrawerPlacement;
|
|
742
|
+
size?: string | number;
|
|
743
|
+
store: ReturnType<typeof useDialogStore>;
|
|
744
|
+
}
|
|
745
|
+
declare const Drawer: React.FC<DrawerProps>;
|
|
746
|
+
|
|
747
|
+
interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
748
|
+
/**
|
|
749
|
+
* Whether the table should have a border
|
|
750
|
+
*/
|
|
751
|
+
bordered?: boolean;
|
|
752
|
+
/**
|
|
753
|
+
* Whether the table should have striped rows
|
|
754
|
+
*/
|
|
755
|
+
striped?: boolean;
|
|
756
|
+
/**
|
|
757
|
+
* Whether the table should have hover effects
|
|
758
|
+
*/
|
|
759
|
+
hover?: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* Size variant for the table
|
|
762
|
+
*/
|
|
763
|
+
size?: "sm" | "md" | "lg";
|
|
764
|
+
}
|
|
765
|
+
interface TableHeadProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
766
|
+
}
|
|
767
|
+
interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
768
|
+
}
|
|
769
|
+
interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
770
|
+
}
|
|
771
|
+
interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
772
|
+
/**
|
|
773
|
+
* Whether this is a header cell
|
|
774
|
+
*/
|
|
775
|
+
header?: boolean;
|
|
776
|
+
}
|
|
777
|
+
interface TableContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
778
|
+
}
|
|
779
|
+
declare const Table: React.FC<TableProps>;
|
|
780
|
+
declare const TableHead: React.FC<TableHeadProps>;
|
|
781
|
+
declare const TableBody: React.FC<TableBodyProps>;
|
|
782
|
+
declare const TableRow: React.FC<TableRowProps>;
|
|
783
|
+
declare const TableCell: React.FC<TableCellProps>;
|
|
784
|
+
declare const TableContainer: React.FC<TableContainerProps>;
|
|
785
|
+
|
|
786
|
+
interface PageIndexProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
787
|
+
/**
|
|
788
|
+
* Custom title for the index
|
|
789
|
+
*/
|
|
790
|
+
title?: string;
|
|
791
|
+
/**
|
|
792
|
+
* Whether the sidebar is collapsed
|
|
793
|
+
*/
|
|
794
|
+
collapsed?: boolean;
|
|
795
|
+
}
|
|
796
|
+
declare const PageIndex: React.FC<PageIndexProps>;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Theme Utility
|
|
800
|
+
* Manages data-theme attribute on <html>, localStorage persistence, and prefers-color-scheme fallback
|
|
801
|
+
*
|
|
802
|
+
* Priority: data-theme (explicit) > prefers-color-scheme (OS preference) > light (default)
|
|
803
|
+
*
|
|
804
|
+
* This utility now uses the User Preferences system for storage.
|
|
805
|
+
* See USER_PREFERENCES.md for more details on the underlying storage system.
|
|
806
|
+
*/
|
|
807
|
+
type Theme = 'light' | 'dark';
|
|
808
|
+
/**
|
|
809
|
+
* Apply theme to document element
|
|
810
|
+
*/
|
|
811
|
+
declare const applyTheme: (theme: Theme) => void;
|
|
812
|
+
/**
|
|
813
|
+
* Get current theme.
|
|
814
|
+
* Sources of truth (simplified):
|
|
815
|
+
* - `data-theme` attribute on <html>
|
|
816
|
+
* - OS `prefers-color-scheme`
|
|
817
|
+
* - default: 'light'
|
|
818
|
+
*/
|
|
819
|
+
declare const getTheme: () => Theme;
|
|
820
|
+
/**
|
|
821
|
+
* Backwards-compatible alias
|
|
822
|
+
*/
|
|
823
|
+
declare const getSavedTheme: () => Theme;
|
|
824
|
+
/**
|
|
825
|
+
* Set theme on document (no persistence)
|
|
826
|
+
*/
|
|
827
|
+
declare const setTheme: (theme: Theme) => void;
|
|
828
|
+
/**
|
|
829
|
+
* Initialize theme on startup (mode-only)
|
|
830
|
+
*/
|
|
831
|
+
declare const initializeTheme: () => void;
|
|
832
|
+
/**
|
|
833
|
+
* Listen to system theme changes. Only calls callback when OS preference
|
|
834
|
+
* changes. Consumers decide whether to apply it.
|
|
835
|
+
*/
|
|
836
|
+
declare const onSystemThemeChange: (callback: (theme: Theme) => void) => (() => void);
|
|
837
|
+
/**
|
|
838
|
+
* Toggle between light and dark themes (no persistence)
|
|
839
|
+
*/
|
|
840
|
+
declare const toggleTheme: () => Theme;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* User Preferences Utility
|
|
844
|
+
*
|
|
845
|
+
* A comprehensive user preference management system for the Hellboy Design System.
|
|
846
|
+
* This utility provides a practical, opinionated solution for storing and retrieving
|
|
847
|
+
* user preferences using localStorage with optional IndexedDB fallback.
|
|
848
|
+
*
|
|
849
|
+
* Philosophy:
|
|
850
|
+
* The Hellboy Design System aims to maximize development velocity by providing
|
|
851
|
+
* complete, practical solutions rather than staying purely agnostic. While many
|
|
852
|
+
* design systems focus solely on visual components, we believe in delivering
|
|
853
|
+
* utilities that solve common real-world problems developers face.
|
|
854
|
+
*
|
|
855
|
+
* This preference system is designed to be:
|
|
856
|
+
* - Easy to use with minimal configuration
|
|
857
|
+
* - Type-safe with TypeScript
|
|
858
|
+
* - Persistent across sessions
|
|
859
|
+
* - Extensible for custom preferences
|
|
860
|
+
* - Framework-agnostic (works with React, Vue, vanilla JS, etc.)
|
|
861
|
+
*
|
|
862
|
+
* Supported preference categories:
|
|
863
|
+
* - Theme preferences (light/dark mode, custom colors)
|
|
864
|
+
* - Layout preferences (sidebar widths, panel sizes)
|
|
865
|
+
* - Component states (drawer positions, table column widths)
|
|
866
|
+
* - User-specific settings (language, timezone, etc.)
|
|
867
|
+
*/
|
|
868
|
+
/**
|
|
869
|
+
* Storage backend types
|
|
870
|
+
*/
|
|
871
|
+
type StorageBackend = 'localStorage' | 'indexedDB';
|
|
872
|
+
/**
|
|
873
|
+
* Base preference key type for type safety
|
|
874
|
+
*/
|
|
875
|
+
type PreferenceKey = string;
|
|
876
|
+
/**
|
|
877
|
+
* User preferences interface
|
|
878
|
+
* Extend this interface to add custom preference types
|
|
879
|
+
*/
|
|
880
|
+
interface UserPreferences {
|
|
881
|
+
theme?: 'light' | 'dark';
|
|
882
|
+
colorConfig?: {
|
|
883
|
+
primaryHue?: number;
|
|
884
|
+
primarySaturation?: number;
|
|
885
|
+
primaryLightness?: number;
|
|
886
|
+
secondaryHue?: number;
|
|
887
|
+
secondarySaturation?: number;
|
|
888
|
+
secondaryLightness?: number;
|
|
889
|
+
accentHue?: number;
|
|
890
|
+
accentSaturation?: number;
|
|
891
|
+
accentLightness?: number;
|
|
892
|
+
successHue?: number;
|
|
893
|
+
successSaturation?: number;
|
|
894
|
+
successLightness?: number;
|
|
895
|
+
warningHue?: number;
|
|
896
|
+
warningSaturation?: number;
|
|
897
|
+
warningLightness?: number;
|
|
898
|
+
errorHue?: number;
|
|
899
|
+
errorSaturation?: number;
|
|
900
|
+
errorLightness?: number;
|
|
901
|
+
infoHue?: number;
|
|
902
|
+
infoSaturation?: number;
|
|
903
|
+
infoLightness?: number;
|
|
904
|
+
};
|
|
905
|
+
layout?: {
|
|
906
|
+
leftSidebarWidth?: number;
|
|
907
|
+
rightSidebarWidth?: number;
|
|
908
|
+
bottomBarHeight?: number;
|
|
909
|
+
navbarCollapsed?: boolean;
|
|
910
|
+
};
|
|
911
|
+
components?: {
|
|
912
|
+
[componentName: string]: {
|
|
913
|
+
[key: string]: any;
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
custom?: {
|
|
917
|
+
[key: string]: any;
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Storage configuration
|
|
922
|
+
*/
|
|
923
|
+
interface StorageConfig {
|
|
924
|
+
backend: StorageBackend;
|
|
925
|
+
prefix: string;
|
|
926
|
+
dbName?: string;
|
|
927
|
+
storeName?: string;
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Configure the preference storage system
|
|
931
|
+
* Call this once at app initialization if you need custom configuration
|
|
932
|
+
*
|
|
933
|
+
* @param userConfig - Custom storage configuration
|
|
934
|
+
*
|
|
935
|
+
* @example
|
|
936
|
+
* ```ts
|
|
937
|
+
* import { configurePreferences } from '@hellboy/ds';
|
|
938
|
+
*
|
|
939
|
+
* configurePreferences({
|
|
940
|
+
* backend: 'localStorage',
|
|
941
|
+
* prefix: 'my-app'
|
|
942
|
+
* });
|
|
943
|
+
* ```
|
|
944
|
+
*/
|
|
945
|
+
declare const configurePreferences: (userConfig: Partial<StorageConfig>) => void;
|
|
946
|
+
/**
|
|
947
|
+
* Get a preference value
|
|
948
|
+
*
|
|
949
|
+
* @param key - Preference key
|
|
950
|
+
* @param defaultValue - Default value if preference doesn't exist
|
|
951
|
+
* @returns The preference value or default value
|
|
952
|
+
*
|
|
953
|
+
* @example
|
|
954
|
+
* ```ts
|
|
955
|
+
* import { getPreference } from '@hellboy/ds';
|
|
956
|
+
*
|
|
957
|
+
* const theme = getPreference('theme', 'light');
|
|
958
|
+
* const sidebarWidth = getPreference('layout.leftSidebarWidth', 280);
|
|
959
|
+
* ```
|
|
960
|
+
*/
|
|
961
|
+
declare const getPreference: <T = any>(key: PreferenceKey, defaultValue?: T) => T | undefined;
|
|
962
|
+
/**
|
|
963
|
+
* Async version for IndexedDB (future use)
|
|
964
|
+
*/
|
|
965
|
+
declare const getPreferenceAsync: <T = any>(key: PreferenceKey, defaultValue?: T) => Promise<T | undefined>;
|
|
966
|
+
/**
|
|
967
|
+
* Set a preference value
|
|
968
|
+
*
|
|
969
|
+
* @param key - Preference key
|
|
970
|
+
* @param value - Preference value to store
|
|
971
|
+
*
|
|
972
|
+
* @example
|
|
973
|
+
* ```ts
|
|
974
|
+
* import { setPreference } from '@hellboy/ds';
|
|
975
|
+
*
|
|
976
|
+
* setPreference('theme', 'dark');
|
|
977
|
+
* setPreference('layout.leftSidebarWidth', 320);
|
|
978
|
+
* ```
|
|
979
|
+
*/
|
|
980
|
+
declare const setPreference: <T = any>(key: PreferenceKey, value: T) => void;
|
|
981
|
+
/**
|
|
982
|
+
* Async version for IndexedDB (future use)
|
|
983
|
+
*/
|
|
984
|
+
declare const setPreferenceAsync: <T = any>(key: PreferenceKey, value: T) => Promise<void>;
|
|
985
|
+
/**
|
|
986
|
+
* Remove a preference
|
|
987
|
+
*
|
|
988
|
+
* @param key - Preference key to remove
|
|
989
|
+
*
|
|
990
|
+
* @example
|
|
991
|
+
* ```ts
|
|
992
|
+
* import { removePreference } from '@hellboy/ds';
|
|
993
|
+
*
|
|
994
|
+
* removePreference('layout.leftSidebarWidth');
|
|
995
|
+
* ```
|
|
996
|
+
*/
|
|
997
|
+
declare const removePreference: (key: PreferenceKey) => void;
|
|
998
|
+
/**
|
|
999
|
+
* Async version for IndexedDB (future use)
|
|
1000
|
+
*/
|
|
1001
|
+
declare const removePreferenceAsync: (key: PreferenceKey) => Promise<void>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Clear all preferences
|
|
1004
|
+
*
|
|
1005
|
+
* @example
|
|
1006
|
+
* ```ts
|
|
1007
|
+
* import { clearPreferences } from '@hellboy/ds';
|
|
1008
|
+
*
|
|
1009
|
+
* clearPreferences(); // Removes all hellboy-ds preferences
|
|
1010
|
+
* ```
|
|
1011
|
+
*/
|
|
1012
|
+
declare const clearPreferences: () => void;
|
|
1013
|
+
/**
|
|
1014
|
+
* Async version for IndexedDB (future use)
|
|
1015
|
+
*/
|
|
1016
|
+
declare const clearPreferencesAsync: () => Promise<void>;
|
|
1017
|
+
/**
|
|
1018
|
+
* Get all preferences as an object
|
|
1019
|
+
*
|
|
1020
|
+
* @returns Object containing all stored preferences
|
|
1021
|
+
*
|
|
1022
|
+
* @example
|
|
1023
|
+
* ```ts
|
|
1024
|
+
* import { getAllPreferences } from '@hellboy/ds';
|
|
1025
|
+
*
|
|
1026
|
+
* const allPrefs = getAllPreferences();
|
|
1027
|
+
* console.log(allPrefs);
|
|
1028
|
+
* // { 'theme': 'dark', 'layout.leftSidebarWidth': 320, ... }
|
|
1029
|
+
* ```
|
|
1030
|
+
*/
|
|
1031
|
+
declare const getAllPreferences: () => Record<string, any>;
|
|
1032
|
+
/**
|
|
1033
|
+
* Export preferences as JSON
|
|
1034
|
+
* Useful for backup or migration
|
|
1035
|
+
*
|
|
1036
|
+
* @returns JSON string of all preferences
|
|
1037
|
+
*
|
|
1038
|
+
* @example
|
|
1039
|
+
* ```ts
|
|
1040
|
+
* import { exportPreferences } from '@hellboy/ds';
|
|
1041
|
+
*
|
|
1042
|
+
* const json = exportPreferences();
|
|
1043
|
+
* // Download or save to file
|
|
1044
|
+
* const blob = new Blob([json], { type: 'application/json' });
|
|
1045
|
+
* const url = URL.createObjectURL(blob);
|
|
1046
|
+
* ```
|
|
1047
|
+
*/
|
|
1048
|
+
declare const exportPreferences: () => string;
|
|
1049
|
+
/**
|
|
1050
|
+
* Import preferences from JSON
|
|
1051
|
+
* Useful for restoring from backup
|
|
1052
|
+
*
|
|
1053
|
+
* @param json - JSON string of preferences to import
|
|
1054
|
+
* @param merge - Whether to merge with existing preferences (default: false)
|
|
1055
|
+
*
|
|
1056
|
+
* @example
|
|
1057
|
+
* ```ts
|
|
1058
|
+
* import { importPreferences } from '@hellboy/ds';
|
|
1059
|
+
*
|
|
1060
|
+
* const json = '{"theme":"dark","layout.leftSidebarWidth":320}';
|
|
1061
|
+
* importPreferences(json, true); // Merge with existing
|
|
1062
|
+
* ```
|
|
1063
|
+
*/
|
|
1064
|
+
declare const importPreferences: (json: string, merge?: boolean) => void;
|
|
1065
|
+
/**
|
|
1066
|
+
* Create a preference namespace for better organization
|
|
1067
|
+
* Returns scoped get/set functions
|
|
1068
|
+
*
|
|
1069
|
+
* @param namespace - Namespace prefix
|
|
1070
|
+
*
|
|
1071
|
+
* @example
|
|
1072
|
+
* ```ts
|
|
1073
|
+
* import { createPreferenceNamespace } from '@hellboy/ds';
|
|
1074
|
+
*
|
|
1075
|
+
* const layoutPrefs = createPreferenceNamespace('layout');
|
|
1076
|
+
* layoutPrefs.set('sidebarWidth', 300);
|
|
1077
|
+
* const width = layoutPrefs.get('sidebarWidth', 280);
|
|
1078
|
+
* ```
|
|
1079
|
+
*/
|
|
1080
|
+
declare const createPreferenceNamespace: (namespace: string) => {
|
|
1081
|
+
get: <T = any>(key: string, defaultValue?: T) => T | undefined;
|
|
1082
|
+
set: <T = any>(key: string, value: T) => void;
|
|
1083
|
+
remove: (key: string) => void;
|
|
1084
|
+
clear: () => void;
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
export { Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Banner, type BannerProps, type BannerType, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, type CheckboxSize, CodeBlock, type CodeBlockProps, type CodeBlockVariant, ColorControl, DragHandle, type DragHandleProps, Drawer, FloatingBar, type FloatingBarPosition, type FloatingBarProps, Footer, type FooterProps, Grid, type GridColumns, type GridProps, Header, type HeaderProps, Icon, type IconName, type IconProps, InputDate, type InputDateProps, InputDateTime, type InputDateTimeProps, InputEmail, type InputEmailProps, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, InputSearch, type InputSearchProps, InputTel, type InputTelProps, InputText, type InputTextProps, InputTime, type InputTimeProps, InputUrl, type InputUrlProps, Layout, type LayoutProps, type LayoutVariant, List, ListItem, type ListItemProps, type ListProps, MenuCategory, type MenuCategoryProps, MenuGroup, type MenuGroupProps, MenuItem, type MenuItemProps, Navbar, type NavbarProps, NavbarTooltipProvider, Page, PageIndex, type PageProps, type PageWidth, Popover, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, Section, type SectionProps, type SectionSize, Select, type SelectOption, type SelectProps, Slider, type SliderProps, Switch, type SwitchProps, type SwitchSize, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, ThemeControl, type ThemeControlProps, Tooltip, type UserPreferences, applyTheme, clearPreferences, clearPreferencesAsync, configurePreferences, createPreferenceNamespace, exportPreferences, getAllPreferences, getPreference, getPreferenceAsync, getSavedTheme, getTheme, importPreferences, initializeTheme, onSystemThemeChange, removePreference, removePreferenceAsync, setPreference, setPreferenceAsync, setTheme, toggleTheme, useNavbarTooltip };
|