@hellboy/ds 0.1.2 → 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 +568 -71
- 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 +2915 -2068
- 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
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { Slider } from '../slider';
|
|
3
|
-
import '../../style/components/color-control/color-control.css';
|
|
4
|
-
|
|
5
|
-
interface ColorHue {
|
|
6
|
-
primary: number;
|
|
7
|
-
secondary: number;
|
|
8
|
-
accent: number;
|
|
9
|
-
success: number;
|
|
10
|
-
warning: number;
|
|
11
|
-
error: number;
|
|
12
|
-
info: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface ColorSaturation {
|
|
16
|
-
primary: number;
|
|
17
|
-
secondary: number;
|
|
18
|
-
accent: number;
|
|
19
|
-
success: number;
|
|
20
|
-
warning: number;
|
|
21
|
-
error: number;
|
|
22
|
-
info: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface ColorLightness {
|
|
26
|
-
primary: number;
|
|
27
|
-
secondary: number;
|
|
28
|
-
accent: number;
|
|
29
|
-
success: number;
|
|
30
|
-
warning: number;
|
|
31
|
-
error: number;
|
|
32
|
-
info: number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface ColorConfig {
|
|
36
|
-
hues: ColorHue;
|
|
37
|
-
saturations: ColorSaturation;
|
|
38
|
-
lightnesses: ColorLightness;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Function to get CSS variable value as number
|
|
42
|
-
const getCSSVariable = (variable: string): number => {
|
|
43
|
-
if (typeof window === 'undefined') return 0;
|
|
44
|
-
const value = getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
|
|
45
|
-
return value ? parseInt(value, 10) : 0;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Load colors from CSS variables (generated from theme.json)
|
|
49
|
-
const loadColorsFromCSS = (): ColorConfig => {
|
|
50
|
-
return {
|
|
51
|
-
hues: {
|
|
52
|
-
primary: getCSSVariable('--primary-hue'),
|
|
53
|
-
secondary: getCSSVariable('--secondary-hue'),
|
|
54
|
-
accent: getCSSVariable('--accent-hue'),
|
|
55
|
-
success: getCSSVariable('--success-hue'),
|
|
56
|
-
warning: getCSSVariable('--warning-hue'),
|
|
57
|
-
error: getCSSVariable('--error-hue'),
|
|
58
|
-
info: getCSSVariable('--info-hue'),
|
|
59
|
-
},
|
|
60
|
-
saturations: {
|
|
61
|
-
primary: getCSSVariable('--primary-saturation'),
|
|
62
|
-
secondary: getCSSVariable('--secondary-saturation'),
|
|
63
|
-
accent: getCSSVariable('--accent-saturation'),
|
|
64
|
-
success: getCSSVariable('--success-saturation'),
|
|
65
|
-
warning: getCSSVariable('--warning-saturation'),
|
|
66
|
-
error: getCSSVariable('--error-saturation'),
|
|
67
|
-
info: getCSSVariable('--info-saturation'),
|
|
68
|
-
},
|
|
69
|
-
lightnesses: {
|
|
70
|
-
primary: getCSSVariable('--primary-lightness'),
|
|
71
|
-
secondary: getCSSVariable('--secondary-lightness'),
|
|
72
|
-
accent: getCSSVariable('--accent-lightness'),
|
|
73
|
-
success: getCSSVariable('--success-lightness'),
|
|
74
|
-
warning: getCSSVariable('--warning-lightness'),
|
|
75
|
-
error: getCSSVariable('--error-lightness'),
|
|
76
|
-
info: getCSSVariable('--info-lightness'),
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const ColorControl: React.FC = () => {
|
|
82
|
-
const [colors, setColors] = useState<ColorConfig>(() => {
|
|
83
|
-
// Load saved colors from localStorage, fallback to CSS variables from theme.json
|
|
84
|
-
const saved = localStorage.getItem('color-config');
|
|
85
|
-
return saved ? JSON.parse(saved) : loadColorsFromCSS();
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const [pendingColors, setPendingColors] = useState<ColorConfig>(colors);
|
|
89
|
-
|
|
90
|
-
// Initialize CSS on mount
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
const root = document.documentElement;
|
|
93
|
-
// Set hues
|
|
94
|
-
root.style.setProperty('--hue-primary', colors.hues.primary.toString());
|
|
95
|
-
root.style.setProperty('--hue-secondary', colors.hues.secondary.toString());
|
|
96
|
-
root.style.setProperty('--hue-accent', colors.hues.accent.toString());
|
|
97
|
-
root.style.setProperty('--hue-success', colors.hues.success.toString());
|
|
98
|
-
root.style.setProperty('--hue-warning', colors.hues.warning.toString());
|
|
99
|
-
root.style.setProperty('--hue-error', colors.hues.error.toString());
|
|
100
|
-
root.style.setProperty('--hue-info', colors.hues.info.toString());
|
|
101
|
-
|
|
102
|
-
// Set saturations
|
|
103
|
-
root.style.setProperty('--saturation-primary', `${colors.saturations.primary}%`);
|
|
104
|
-
root.style.setProperty('--saturation-secondary', `${colors.saturations.secondary}%`);
|
|
105
|
-
root.style.setProperty('--saturation-accent', `${colors.saturations.accent}%`);
|
|
106
|
-
root.style.setProperty('--saturation-success', `${colors.saturations.success}%`);
|
|
107
|
-
root.style.setProperty('--saturation-warning', `${colors.saturations.warning}%`);
|
|
108
|
-
root.style.setProperty('--saturation-error', `${colors.saturations.error}%`);
|
|
109
|
-
root.style.setProperty('--saturation-info', `${colors.saturations.info}%`);
|
|
110
|
-
|
|
111
|
-
// Set lightnesses
|
|
112
|
-
root.style.setProperty('--lightness-primary', `${colors.lightnesses.primary}%`);
|
|
113
|
-
root.style.setProperty('--lightness-secondary', `${colors.lightnesses.secondary}%`);
|
|
114
|
-
root.style.setProperty('--lightness-accent', `${colors.lightnesses.accent}%`);
|
|
115
|
-
root.style.setProperty('--lightness-success', `${colors.lightnesses.success}%`);
|
|
116
|
-
root.style.setProperty('--lightness-warning', `${colors.lightnesses.warning}%`);
|
|
117
|
-
root.style.setProperty('--lightness-error', `${colors.lightnesses.error}%`);
|
|
118
|
-
root.style.setProperty('--lightness-info', `${colors.lightnesses.info}%`);
|
|
119
|
-
}, []);
|
|
120
|
-
|
|
121
|
-
const commitColorChange = useCallback((color: keyof ColorHue, property: 'hue' | 'saturation' | 'lightness', value: number) => {
|
|
122
|
-
setColors(prev => {
|
|
123
|
-
const newColors = {
|
|
124
|
-
...prev,
|
|
125
|
-
[property === 'hue' ? 'hues' : property === 'saturation' ? 'saturations' : 'lightnesses']: {
|
|
126
|
-
...prev[property === 'hue' ? 'hues' : property === 'saturation' ? 'saturations' : 'lightnesses'],
|
|
127
|
-
[color]: value
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// Update CSS and localStorage immediately after drag ends
|
|
132
|
-
const root = document.documentElement;
|
|
133
|
-
const cssVar = property === 'hue' ? `--hue-${color}` : `--${property}-${color}`;
|
|
134
|
-
const cssValue = property === 'hue' ? value.toString() : `${value}%`;
|
|
135
|
-
root.style.setProperty(cssVar, cssValue);
|
|
136
|
-
localStorage.setItem('color-config', JSON.stringify(newColors));
|
|
137
|
-
|
|
138
|
-
return newColors;
|
|
139
|
-
});
|
|
140
|
-
}, []);
|
|
141
|
-
|
|
142
|
-
const resetToDefaults = useCallback(() => {
|
|
143
|
-
const cssColors = loadColorsFromCSS();
|
|
144
|
-
setColors(cssColors);
|
|
145
|
-
setPendingColors(cssColors);
|
|
146
|
-
}, []);
|
|
147
|
-
|
|
148
|
-
const renderColorControls = (colorName: keyof ColorHue) => {
|
|
149
|
-
const hue = pendingColors.hues[colorName];
|
|
150
|
-
const saturation = pendingColors.saturations[colorName];
|
|
151
|
-
const lightness = pendingColors.lightnesses[colorName];
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<div key={colorName} className="color-control__color-group">
|
|
155
|
-
<h4 className="color-control__color-title">{colorName.charAt(0).toUpperCase() + colorName.slice(1)}</h4>
|
|
156
|
-
|
|
157
|
-
<div className="color-control__controls-row">
|
|
158
|
-
<div className="color-control__control">
|
|
159
|
-
<label className="color-control__label">Hue</label>
|
|
160
|
-
<Slider
|
|
161
|
-
label=""
|
|
162
|
-
value={hue}
|
|
163
|
-
min={0}
|
|
164
|
-
max={360}
|
|
165
|
-
step={1}
|
|
166
|
-
onChange={(v) => setPendingColors(prev => ({
|
|
167
|
-
...prev,
|
|
168
|
-
hues: { ...prev.hues, [colorName]: v }
|
|
169
|
-
}))}
|
|
170
|
-
onChangeEnd={(v) => {
|
|
171
|
-
setPendingColors(prev => ({
|
|
172
|
-
...prev,
|
|
173
|
-
hues: { ...prev.hues, [colorName]: v }
|
|
174
|
-
}));
|
|
175
|
-
commitColorChange(colorName, 'hue', v);
|
|
176
|
-
}}
|
|
177
|
-
type="hue"
|
|
178
|
-
showValue={false}
|
|
179
|
-
/>
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
<div className="color-control__control">
|
|
183
|
-
<label className="color-control__label">Saturation</label>
|
|
184
|
-
<Slider
|
|
185
|
-
label=""
|
|
186
|
-
value={saturation}
|
|
187
|
-
min={0}
|
|
188
|
-
max={100}
|
|
189
|
-
step={1}
|
|
190
|
-
onChange={(v) => setPendingColors(prev => ({
|
|
191
|
-
...prev,
|
|
192
|
-
saturations: { ...prev.saturations, [colorName]: v }
|
|
193
|
-
}))}
|
|
194
|
-
onChangeEnd={(v) => {
|
|
195
|
-
setPendingColors(prev => ({
|
|
196
|
-
...prev,
|
|
197
|
-
saturations: { ...prev.saturations, [colorName]: v }
|
|
198
|
-
}));
|
|
199
|
-
commitColorChange(colorName, 'saturation', v);
|
|
200
|
-
}}
|
|
201
|
-
type="saturation"
|
|
202
|
-
baseHue={hue}
|
|
203
|
-
showValue={false}
|
|
204
|
-
/>
|
|
205
|
-
</div>
|
|
206
|
-
|
|
207
|
-
<div className="color-control__control">
|
|
208
|
-
<label className="color-control__label">Lightness</label>
|
|
209
|
-
<Slider
|
|
210
|
-
label=""
|
|
211
|
-
value={lightness}
|
|
212
|
-
min={0}
|
|
213
|
-
max={100}
|
|
214
|
-
step={1}
|
|
215
|
-
onChange={(v) => setPendingColors(prev => ({
|
|
216
|
-
...prev,
|
|
217
|
-
lightnesses: { ...prev.lightnesses, [colorName]: v }
|
|
218
|
-
}))}
|
|
219
|
-
onChangeEnd={(v) => {
|
|
220
|
-
setPendingColors(prev => ({
|
|
221
|
-
...prev,
|
|
222
|
-
lightnesses: { ...prev.lightnesses, [colorName]: v }
|
|
223
|
-
}));
|
|
224
|
-
commitColorChange(colorName, 'lightness', v);
|
|
225
|
-
}}
|
|
226
|
-
type="lightness"
|
|
227
|
-
baseHue={hue}
|
|
228
|
-
baseSaturation={saturation}
|
|
229
|
-
showValue={false}
|
|
230
|
-
/>
|
|
231
|
-
</div>
|
|
232
|
-
|
|
233
|
-
<div
|
|
234
|
-
className="color-control__preview"
|
|
235
|
-
style={{
|
|
236
|
-
backgroundColor: `hsl(${hue}, ${saturation}%, ${lightness}%)`,
|
|
237
|
-
border: '2px solid var(--color-neutral-300)'
|
|
238
|
-
}}
|
|
239
|
-
/>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
return (
|
|
246
|
-
<div className="color-control">
|
|
247
|
-
<div className="color-control__header">
|
|
248
|
-
<h3 className="color-control__title">Paleta de Cores</h3>
|
|
249
|
-
<p className="color-control__description">
|
|
250
|
-
Ajuste o matiz, saturação e luminosidade das cores. As mudanças são aplicadas instantaneamente.
|
|
251
|
-
</p>
|
|
252
|
-
</div>
|
|
253
|
-
|
|
254
|
-
<div className="color-control__sliders">
|
|
255
|
-
{renderColorControls('primary')}
|
|
256
|
-
{renderColorControls('secondary')}
|
|
257
|
-
{renderColorControls('accent')}
|
|
258
|
-
{renderColorControls('success')}
|
|
259
|
-
{renderColorControls('warning')}
|
|
260
|
-
{renderColorControls('error')}
|
|
261
|
-
{renderColorControls('info')}
|
|
262
|
-
</div>
|
|
263
|
-
|
|
264
|
-
<div className="color-control__actions">
|
|
265
|
-
<button
|
|
266
|
-
onClick={resetToDefaults}
|
|
267
|
-
className="color-control__reset-btn"
|
|
268
|
-
>
|
|
269
|
-
Restaurar Padrões
|
|
270
|
-
</button>
|
|
271
|
-
</div>
|
|
272
|
-
|
|
273
|
-
<div className="color-control__preview-section">
|
|
274
|
-
<h4 className="color-control__preview-title">Prévia das Cores</h4>
|
|
275
|
-
<div className="color-control__color-grid">
|
|
276
|
-
<div
|
|
277
|
-
className="color-control__color-sample"
|
|
278
|
-
style={{ backgroundColor: `hsl(${pendingColors.hues.primary}, ${pendingColors.saturations.primary}%, ${pendingColors.lightnesses.primary}%)` }}
|
|
279
|
-
>
|
|
280
|
-
Primary
|
|
281
|
-
</div>
|
|
282
|
-
<div
|
|
283
|
-
className="color-control__color-sample"
|
|
284
|
-
style={{ backgroundColor: `hsl(${pendingColors.hues.secondary}, ${pendingColors.saturations.secondary}%, ${pendingColors.lightnesses.secondary}%)` }}
|
|
285
|
-
>
|
|
286
|
-
Secondary
|
|
287
|
-
</div>
|
|
288
|
-
<div
|
|
289
|
-
className="color-control__color-sample"
|
|
290
|
-
style={{ backgroundColor: `hsl(${pendingColors.hues.accent}, ${pendingColors.saturations.accent}%, ${pendingColors.lightnesses.accent}%)` }}
|
|
291
|
-
>
|
|
292
|
-
Accent
|
|
293
|
-
</div>
|
|
294
|
-
<div
|
|
295
|
-
className="color-control__color-sample"
|
|
296
|
-
style={{ backgroundColor: `hsl(${pendingColors.hues.success}, ${pendingColors.saturations.success}%, ${pendingColors.lightnesses.success}%)` }}
|
|
297
|
-
>
|
|
298
|
-
Success
|
|
299
|
-
</div>
|
|
300
|
-
<div
|
|
301
|
-
className="color-control__color-sample"
|
|
302
|
-
style={{ backgroundColor: `hsl(${pendingColors.hues.warning}, ${pendingColors.saturations.warning}%, ${pendingColors.lightnesses.warning}%)` }}
|
|
303
|
-
>
|
|
304
|
-
Warning
|
|
305
|
-
</div>
|
|
306
|
-
<div
|
|
307
|
-
className="color-control__color-sample"
|
|
308
|
-
style={{ backgroundColor: `hsl(${pendingColors.hues.error}, ${pendingColors.saturations.error}%, ${pendingColors.lightnesses.error}%)` }}
|
|
309
|
-
>
|
|
310
|
-
Error
|
|
311
|
-
</div>
|
|
312
|
-
<div
|
|
313
|
-
className="color-control__color-sample"
|
|
314
|
-
style={{ backgroundColor: `hsl(${pendingColors.hues.info}, ${pendingColors.saturations.info}%, ${pendingColors.lightnesses.info}%)` }}
|
|
315
|
-
>
|
|
316
|
-
Info
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
</div>
|
|
320
|
-
</div>
|
|
321
|
-
);
|
|
322
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './color-control';
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useCallback } from 'react';
|
|
2
|
-
import '../../style/components/drag-handle/drag-handle.css';
|
|
3
|
-
|
|
4
|
-
export interface DragHandleProps {
|
|
5
|
-
onResize: (delta: number) => void;
|
|
6
|
-
onResizeEnd?: () => void;
|
|
7
|
-
orientation?: 'vertical' | 'horizontal';
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const DragHandle: React.FC<DragHandleProps> = ({
|
|
12
|
-
onResize,
|
|
13
|
-
onResizeEnd,
|
|
14
|
-
orientation = 'vertical',
|
|
15
|
-
className = '',
|
|
16
|
-
}) => {
|
|
17
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
18
|
-
const dragHandleRef = useRef<HTMLDivElement>(null);
|
|
19
|
-
const startPosRef = useRef<number>(0);
|
|
20
|
-
|
|
21
|
-
const handleMouseDown = useCallback((e: React.MouseEvent) => {
|
|
22
|
-
setIsDragging(true);
|
|
23
|
-
startPosRef.current = orientation === 'vertical' ? e.clientX : e.clientY;
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
}, [orientation]);
|
|
26
|
-
|
|
27
|
-
const handleMouseMove = useCallback((e: MouseEvent) => {
|
|
28
|
-
if (!isDragging) return;
|
|
29
|
-
|
|
30
|
-
const currentPos = orientation === 'vertical' ? e.clientX : e.clientY;
|
|
31
|
-
const delta = currentPos - startPosRef.current;
|
|
32
|
-
onResize(delta);
|
|
33
|
-
startPosRef.current = currentPos;
|
|
34
|
-
}, [isDragging, onResize, orientation]);
|
|
35
|
-
|
|
36
|
-
const handleMouseUp = useCallback(() => {
|
|
37
|
-
setIsDragging(false);
|
|
38
|
-
onResizeEnd?.();
|
|
39
|
-
}, [onResizeEnd]);
|
|
40
|
-
|
|
41
|
-
React.useEffect(() => {
|
|
42
|
-
if (isDragging) {
|
|
43
|
-
document.addEventListener('mousemove', handleMouseMove);
|
|
44
|
-
document.addEventListener('mouseup', handleMouseUp);
|
|
45
|
-
document.body.style.cursor = orientation === 'vertical' ? 'col-resize' : 'row-resize';
|
|
46
|
-
document.body.style.userSelect = 'none';
|
|
47
|
-
} else {
|
|
48
|
-
document.removeEventListener('mousemove', handleMouseMove);
|
|
49
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
50
|
-
document.body.style.cursor = '';
|
|
51
|
-
document.body.style.userSelect = '';
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return () => {
|
|
55
|
-
document.removeEventListener('mousemove', handleMouseMove);
|
|
56
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
57
|
-
document.body.style.cursor = '';
|
|
58
|
-
document.body.style.userSelect = '';
|
|
59
|
-
};
|
|
60
|
-
}, [isDragging, handleMouseMove, handleMouseUp, orientation]);
|
|
61
|
-
|
|
62
|
-
const classes = [
|
|
63
|
-
'drag-handle',
|
|
64
|
-
`drag-handle--${orientation}`,
|
|
65
|
-
isDragging && 'drag-handle--dragging',
|
|
66
|
-
className,
|
|
67
|
-
].filter(Boolean).join(' ');
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<div
|
|
71
|
-
ref={dragHandleRef}
|
|
72
|
-
className={classes}
|
|
73
|
-
onMouseDown={handleMouseDown}
|
|
74
|
-
>
|
|
75
|
-
<div className="drag-handle__indicator" />
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './DragHandle';
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Dialog, DialogProps, DialogHeading, useDialogStore } from "@ariakit/react";
|
|
3
|
-
import "../../style/components/drawer/drawer.css";
|
|
4
|
-
|
|
5
|
-
export type DrawerPlacement = "top" | "bottom" | "left" | "right";
|
|
6
|
-
|
|
7
|
-
export interface DrawerProps extends Omit<DialogProps, "children"> {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
title?: string;
|
|
10
|
-
placement?: DrawerPlacement;
|
|
11
|
-
size?: string | number;
|
|
12
|
-
store: ReturnType<typeof useDialogStore>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const Drawer: React.FC<DrawerProps> = ({
|
|
16
|
-
children,
|
|
17
|
-
title,
|
|
18
|
-
placement = "right",
|
|
19
|
-
size = "400px",
|
|
20
|
-
store,
|
|
21
|
-
...props
|
|
22
|
-
}) => {
|
|
23
|
-
const sizeValue = typeof size === "number" ? `${size}px` : size;
|
|
24
|
-
|
|
25
|
-
const getDrawerStyles = (): React.CSSProperties => {
|
|
26
|
-
const baseStyles: React.CSSProperties = {
|
|
27
|
-
zIndex: 1000,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
switch (placement) {
|
|
31
|
-
case "top":
|
|
32
|
-
return {
|
|
33
|
-
...baseStyles,
|
|
34
|
-
height: sizeValue,
|
|
35
|
-
};
|
|
36
|
-
case "bottom":
|
|
37
|
-
return {
|
|
38
|
-
...baseStyles,
|
|
39
|
-
height: sizeValue,
|
|
40
|
-
};
|
|
41
|
-
case "left":
|
|
42
|
-
return {
|
|
43
|
-
...baseStyles,
|
|
44
|
-
width: sizeValue,
|
|
45
|
-
};
|
|
46
|
-
case "right":
|
|
47
|
-
default:
|
|
48
|
-
return {
|
|
49
|
-
...baseStyles,
|
|
50
|
-
width: sizeValue,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<Dialog
|
|
57
|
-
store={store}
|
|
58
|
-
{...props}
|
|
59
|
-
className={`drawer drawer--${placement}`}
|
|
60
|
-
style={getDrawerStyles()}
|
|
61
|
-
backdrop={<div className="drawer__backdrop" />}
|
|
62
|
-
>
|
|
63
|
-
<div className="drawer__content">
|
|
64
|
-
{title && (
|
|
65
|
-
<div className="drawer__header">
|
|
66
|
-
<DialogHeading className="drawer__title">{title}</DialogHeading>
|
|
67
|
-
<button
|
|
68
|
-
className="drawer__close"
|
|
69
|
-
onClick={store.hide}
|
|
70
|
-
aria-label="Close drawer"
|
|
71
|
-
>
|
|
72
|
-
✕
|
|
73
|
-
</button>
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
76
|
-
<div className="drawer__body">
|
|
77
|
-
{children}
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</Dialog>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Drawer, type DrawerProps, type DrawerPlacement } from './drawer';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '../../style/components/floating-bar/floating-bar.css';
|
|
3
|
-
|
|
4
|
-
export type FloatingBarPosition = 'top' | 'bottom';
|
|
5
|
-
|
|
6
|
-
export interface FloatingBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/**
|
|
8
|
-
* Position of the floating bar
|
|
9
|
-
* @default 'bottom'
|
|
10
|
-
*/
|
|
11
|
-
position?: FloatingBarPosition;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Content of the floating bar
|
|
15
|
-
*/
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Additional CSS classes
|
|
20
|
-
*/
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* FloatingBar Component
|
|
26
|
-
* A floating bar that sticks to the top or bottom within the main layout container
|
|
27
|
-
*/
|
|
28
|
-
export const FloatingBar: React.FC<FloatingBarProps> = ({
|
|
29
|
-
position = 'bottom',
|
|
30
|
-
children,
|
|
31
|
-
className = '',
|
|
32
|
-
...props
|
|
33
|
-
}) => {
|
|
34
|
-
const classes = [
|
|
35
|
-
'floating-bar',
|
|
36
|
-
`floating-bar--${position}`,
|
|
37
|
-
className,
|
|
38
|
-
]
|
|
39
|
-
.filter(Boolean)
|
|
40
|
-
.join(' ');
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div
|
|
44
|
-
className={classes}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
<div className="floating-bar__content">
|
|
48
|
-
{children}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '../../style/components/footer/footer.css';
|
|
3
|
-
|
|
4
|
-
export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const Footer: React.FC<FooterProps> = ({ className = '', children, ...props }) => {
|
|
9
|
-
const currentYear = new Date().getFullYear();
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<footer className={`footer ${className}`.trim()} {...props}>
|
|
13
|
-
<div className="footer__container">
|
|
14
|
-
{children ? (
|
|
15
|
-
children
|
|
16
|
-
) : (
|
|
17
|
-
<>
|
|
18
|
-
<div className="footer__bottom">
|
|
19
|
-
<p className="footer__copyright">
|
|
20
|
-
© {currentYear} <strong>HellboyDS</strong> is a design system package published on npm by user <strong>@hellboy</strong>. This project is not affiliated with any comic book, film, television, or other artistic works.
|
|
21
|
-
</p>
|
|
22
|
-
</div>
|
|
23
|
-
</>
|
|
24
|
-
)}
|
|
25
|
-
</div>
|
|
26
|
-
</footer>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Footer, type FooterProps } from './footer';
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import "../../style/components/grid/grid.css";
|
|
3
|
-
|
|
4
|
-
export type GridColumns = number | "auto-fit" | "auto-fill";
|
|
5
|
-
|
|
6
|
-
export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/**
|
|
8
|
-
* Number of columns or auto-fit/auto-fill
|
|
9
|
-
* @default "auto-fit"
|
|
10
|
-
*/
|
|
11
|
-
columns?: GridColumns;
|
|
12
|
-
/**
|
|
13
|
-
* Minimum width for each column (when using auto-fit/auto-fill)
|
|
14
|
-
* @default "250px"
|
|
15
|
-
*/
|
|
16
|
-
minWidth?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Gap between grid items
|
|
19
|
-
* @default "1rem"
|
|
20
|
-
*/
|
|
21
|
-
gap?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Maximum number of columns (when columns is a number)
|
|
24
|
-
*/
|
|
25
|
-
maxColumns?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const Grid: React.FC<GridProps> = ({
|
|
29
|
-
columns = "auto-fit",
|
|
30
|
-
minWidth = "250px",
|
|
31
|
-
gap = "1rem",
|
|
32
|
-
maxColumns,
|
|
33
|
-
className = "",
|
|
34
|
-
children,
|
|
35
|
-
...props
|
|
36
|
-
}) => {
|
|
37
|
-
const gridClass = [
|
|
38
|
-
"grid",
|
|
39
|
-
typeof columns === "number" ? `grid--cols-${Math.min(columns, maxColumns || columns)}` : `grid--${columns}`,
|
|
40
|
-
className
|
|
41
|
-
].filter(Boolean).join(" ");
|
|
42
|
-
|
|
43
|
-
const style = {
|
|
44
|
-
"--grid-min-width": minWidth,
|
|
45
|
-
"--grid-gap": gap,
|
|
46
|
-
} as React.CSSProperties;
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div className={gridClass} style={style} {...props}>
|
|
50
|
-
{children}
|
|
51
|
-
</div>
|
|
52
|
-
);
|
|
53
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Grid";
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useMemo } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface HeaderProps {
|
|
4
|
-
/**
|
|
5
|
-
* Header title
|
|
6
|
-
*/
|
|
7
|
-
title?: ReactNode;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Header subtitle/description
|
|
11
|
-
*/
|
|
12
|
-
subtitle?: ReactNode;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Header content - overrides title/subtitle
|
|
16
|
-
*/
|
|
17
|
-
children?: ReactNode;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Custom class name
|
|
21
|
-
*/
|
|
22
|
-
className?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Header component for page headers
|
|
27
|
-
* Displays title, subtitle, or custom content
|
|
28
|
-
*/
|
|
29
|
-
export const Header: React.FC<HeaderProps> = ({ title, subtitle, children, className }) => {
|
|
30
|
-
// Generate ID from title for page index navigation
|
|
31
|
-
const headerId = useMemo(() => {
|
|
32
|
-
if (typeof title === 'string' && title.trim()) {
|
|
33
|
-
return title
|
|
34
|
-
.toLowerCase()
|
|
35
|
-
.replace(/[^\w\s-]/g, '') // Remove special characters
|
|
36
|
-
.replace(/\s+/g, '-') // Replace spaces with hyphens
|
|
37
|
-
.replace(/-+/g, '-') // Replace multiple hyphens with single
|
|
38
|
-
.trim();
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
}, [title]);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<header className={`header ${className || ''}`} id={headerId}>
|
|
45
|
-
<div className="header__container">
|
|
46
|
-
{children ? (
|
|
47
|
-
children
|
|
48
|
-
) : (
|
|
49
|
-
<>
|
|
50
|
-
{title && <h1 className="header__title">{title}</h1>}
|
|
51
|
-
{subtitle && <p className="header__subtitle">{subtitle}</p>}
|
|
52
|
-
</>
|
|
53
|
-
)}
|
|
54
|
-
</div>
|
|
55
|
-
</header>
|
|
56
|
-
);
|
|
57
|
-
};
|