@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
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
// src/components/hero/Hero.tsx
|
|
2
|
+
import React, { useEffect, useRef, useState, useImperativeHandle } from "react";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var useParallax = (enabled, backgroundImage, backgroundSize, _backgroundPosition, parallaxSpeed = 0.5) => {
|
|
5
|
+
const [offsetY, setOffsetY] = useState(0);
|
|
6
|
+
const [imageDimensions, setImageDimensions] = useState(null);
|
|
7
|
+
const elementRef = useRef(null);
|
|
8
|
+
const getHeroHeight = () => {
|
|
9
|
+
if (!elementRef.current) return 0;
|
|
10
|
+
const computedStyle = window.getComputedStyle(elementRef.current);
|
|
11
|
+
const heightValue = computedStyle.height;
|
|
12
|
+
if (heightValue.endsWith("px")) {
|
|
13
|
+
return parseFloat(heightValue);
|
|
14
|
+
} else if (heightValue.endsWith("vh")) {
|
|
15
|
+
return parseFloat(heightValue) / 100 * window.innerHeight;
|
|
16
|
+
} else if (heightValue.endsWith("rem")) {
|
|
17
|
+
return parseFloat(heightValue) * parseFloat(window.getComputedStyle(document.documentElement).fontSize);
|
|
18
|
+
}
|
|
19
|
+
return parseFloat(heightValue) || 400;
|
|
20
|
+
};
|
|
21
|
+
const getHeroWidth = () => {
|
|
22
|
+
if (!elementRef.current) return 0;
|
|
23
|
+
const computedStyle = window.getComputedStyle(elementRef.current);
|
|
24
|
+
const widthValue = computedStyle.width;
|
|
25
|
+
if (widthValue.endsWith("px")) {
|
|
26
|
+
return parseFloat(widthValue);
|
|
27
|
+
} else if (widthValue.endsWith("vw")) {
|
|
28
|
+
return parseFloat(widthValue) / 100 * window.innerWidth;
|
|
29
|
+
} else if (widthValue.endsWith("rem")) {
|
|
30
|
+
return parseFloat(widthValue) * parseFloat(window.getComputedStyle(document.documentElement).fontSize);
|
|
31
|
+
}
|
|
32
|
+
return parseFloat(widthValue) || 800;
|
|
33
|
+
};
|
|
34
|
+
const calculateEffectiveImageSize = (naturalWidth, naturalHeight, containerWidth, containerHeight, bgSize) => {
|
|
35
|
+
const aspectRatio = naturalWidth / naturalHeight;
|
|
36
|
+
const containerAspectRatio = containerWidth / containerHeight;
|
|
37
|
+
if (bgSize === "cover") {
|
|
38
|
+
if (aspectRatio > containerAspectRatio) {
|
|
39
|
+
return {
|
|
40
|
+
width: containerHeight * aspectRatio,
|
|
41
|
+
height: containerHeight
|
|
42
|
+
};
|
|
43
|
+
} else {
|
|
44
|
+
return {
|
|
45
|
+
width: containerWidth,
|
|
46
|
+
height: containerWidth / aspectRatio
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
} else if (bgSize === "contain") {
|
|
50
|
+
if (aspectRatio > containerAspectRatio) {
|
|
51
|
+
return {
|
|
52
|
+
width: containerWidth,
|
|
53
|
+
height: containerWidth / aspectRatio
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
return {
|
|
57
|
+
width: containerHeight * aspectRatio,
|
|
58
|
+
height: containerHeight
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
} else if (bgSize.includes("px")) {
|
|
62
|
+
const sizeParts = bgSize.split(" ");
|
|
63
|
+
if (sizeParts.length === 1) {
|
|
64
|
+
const size = parseFloat(sizeParts[0]);
|
|
65
|
+
return { width: size, height: size };
|
|
66
|
+
} else {
|
|
67
|
+
return {
|
|
68
|
+
width: parseFloat(sizeParts[0]),
|
|
69
|
+
height: parseFloat(sizeParts[1])
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
return { width: naturalWidth, height: naturalHeight };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!enabled || !backgroundImage) return;
|
|
78
|
+
const img = new Image();
|
|
79
|
+
img.onload = () => {
|
|
80
|
+
setImageDimensions({
|
|
81
|
+
width: img.naturalWidth,
|
|
82
|
+
height: img.naturalHeight
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
img.src = backgroundImage;
|
|
86
|
+
}, [enabled, backgroundImage]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!enabled || !elementRef.current) return;
|
|
89
|
+
const getScrollParent = (element) => {
|
|
90
|
+
let currentElement = element.parentElement;
|
|
91
|
+
while (currentElement) {
|
|
92
|
+
const style = window.getComputedStyle(currentElement);
|
|
93
|
+
const hasScroll = style.overflowY === "auto" || style.overflowY === "scroll";
|
|
94
|
+
if (hasScroll) {
|
|
95
|
+
return currentElement;
|
|
96
|
+
}
|
|
97
|
+
currentElement = currentElement.parentElement;
|
|
98
|
+
}
|
|
99
|
+
return window.document.documentElement;
|
|
100
|
+
};
|
|
101
|
+
const scrollParent = getScrollParent(elementRef.current);
|
|
102
|
+
const isWindowScroll = scrollParent === document.documentElement;
|
|
103
|
+
const handleScroll = () => {
|
|
104
|
+
if (!elementRef.current) return;
|
|
105
|
+
const heroHeight = getHeroHeight();
|
|
106
|
+
const heroWidth = getHeroWidth();
|
|
107
|
+
let scrolled;
|
|
108
|
+
if (isWindowScroll) {
|
|
109
|
+
const rect = elementRef.current.getBoundingClientRect();
|
|
110
|
+
scrolled = Math.max(0, -rect.top);
|
|
111
|
+
} else {
|
|
112
|
+
const rect = elementRef.current.getBoundingClientRect();
|
|
113
|
+
const parentRect = scrollParent.getBoundingClientRect();
|
|
114
|
+
scrolled = Math.max(0, parentRect.top - rect.top);
|
|
115
|
+
}
|
|
116
|
+
let parallaxOffset;
|
|
117
|
+
if (typeof parallaxSpeed === "number") {
|
|
118
|
+
parallaxOffset = scrolled * -parallaxSpeed;
|
|
119
|
+
} else if (parallaxSpeed.includes("%")) {
|
|
120
|
+
const percent = parseFloat(parallaxSpeed) / 100;
|
|
121
|
+
parallaxOffset = scrolled * -percent;
|
|
122
|
+
} else {
|
|
123
|
+
const maxMovement = parseFloat(parallaxSpeed);
|
|
124
|
+
const ratio = Math.min(1, scrolled / heroHeight);
|
|
125
|
+
parallaxOffset = -maxMovement * ratio;
|
|
126
|
+
}
|
|
127
|
+
if (imageDimensions && backgroundSize) {
|
|
128
|
+
const effectiveSize = calculateEffectiveImageSize(
|
|
129
|
+
imageDimensions.width,
|
|
130
|
+
imageDimensions.height,
|
|
131
|
+
heroWidth,
|
|
132
|
+
heroHeight,
|
|
133
|
+
backgroundSize
|
|
134
|
+
);
|
|
135
|
+
const availableOffset = (effectiveSize.height - heroHeight) / 2;
|
|
136
|
+
if (availableOffset > 0) {
|
|
137
|
+
parallaxOffset = Math.max(-availableOffset, Math.min(availableOffset, parallaxOffset));
|
|
138
|
+
} else {
|
|
139
|
+
parallaxOffset = 0;
|
|
140
|
+
}
|
|
141
|
+
} else if (imageDimensions && imageDimensions.height <= heroHeight) {
|
|
142
|
+
parallaxOffset = 0;
|
|
143
|
+
}
|
|
144
|
+
setOffsetY(parallaxOffset);
|
|
145
|
+
};
|
|
146
|
+
scrollParent.addEventListener("scroll", handleScroll, { passive: true });
|
|
147
|
+
handleScroll();
|
|
148
|
+
return () => scrollParent.removeEventListener("scroll", handleScroll);
|
|
149
|
+
}, [enabled, imageDimensions, backgroundSize]);
|
|
150
|
+
return { offsetY, elementRef };
|
|
151
|
+
};
|
|
152
|
+
var Hero = React.forwardRef(
|
|
153
|
+
({
|
|
154
|
+
title,
|
|
155
|
+
subtitle,
|
|
156
|
+
action,
|
|
157
|
+
backgroundColor,
|
|
158
|
+
backgroundImage,
|
|
159
|
+
backgroundPosition = "center",
|
|
160
|
+
backgroundSize = "cover",
|
|
161
|
+
backgroundYOffset = 0,
|
|
162
|
+
height = "50vh",
|
|
163
|
+
padding,
|
|
164
|
+
align = "center",
|
|
165
|
+
verticalAlign = "center",
|
|
166
|
+
className,
|
|
167
|
+
style,
|
|
168
|
+
children,
|
|
169
|
+
parallax = false,
|
|
170
|
+
parallaxSpeed = 0.5,
|
|
171
|
+
titleColor,
|
|
172
|
+
subtitleColor,
|
|
173
|
+
blur = false,
|
|
174
|
+
backgroundAuthor,
|
|
175
|
+
backgroundAuthorLink,
|
|
176
|
+
...props
|
|
177
|
+
}, ref) => {
|
|
178
|
+
const { offsetY, elementRef } = useParallax(parallax, backgroundImage, backgroundSize, backgroundPosition, parallaxSpeed);
|
|
179
|
+
useImperativeHandle(ref, () => elementRef.current);
|
|
180
|
+
const titleStyle = titleColor ? { color: titleColor } : {};
|
|
181
|
+
const subtitleStyle = subtitleColor ? { color: subtitleColor } : {};
|
|
182
|
+
const heroClasses = [
|
|
183
|
+
"hero",
|
|
184
|
+
`hero--align-${align}`,
|
|
185
|
+
`hero--vertical-${verticalAlign}`,
|
|
186
|
+
parallax && "hero--parallax",
|
|
187
|
+
className
|
|
188
|
+
].filter(Boolean).join(" ");
|
|
189
|
+
const heroStyle = {
|
|
190
|
+
...style,
|
|
191
|
+
height,
|
|
192
|
+
backgroundColor,
|
|
193
|
+
padding
|
|
194
|
+
};
|
|
195
|
+
const getBackgroundPositionY = () => {
|
|
196
|
+
if (!parallax) return backgroundPosition;
|
|
197
|
+
let baseOffset = 0;
|
|
198
|
+
if (typeof backgroundYOffset === "number") {
|
|
199
|
+
baseOffset = backgroundYOffset;
|
|
200
|
+
} else if (typeof backgroundYOffset === "string") {
|
|
201
|
+
if (backgroundYOffset.includes("%")) {
|
|
202
|
+
return `center calc(${backgroundYOffset} + ${offsetY}px)`;
|
|
203
|
+
}
|
|
204
|
+
baseOffset = parseFloat(backgroundYOffset);
|
|
205
|
+
}
|
|
206
|
+
const finalY = baseOffset + offsetY;
|
|
207
|
+
return `center ${finalY}px`;
|
|
208
|
+
};
|
|
209
|
+
const backgroundStyle = backgroundImage ? {
|
|
210
|
+
backgroundImage: `url(${backgroundImage})`,
|
|
211
|
+
backgroundPosition: getBackgroundPositionY(),
|
|
212
|
+
backgroundSize,
|
|
213
|
+
filter: blur ? "blur(2px)" : void 0
|
|
214
|
+
} : {};
|
|
215
|
+
return /* @__PURE__ */ jsxs(
|
|
216
|
+
"section",
|
|
217
|
+
{
|
|
218
|
+
ref: elementRef,
|
|
219
|
+
className: heroClasses,
|
|
220
|
+
style: heroStyle,
|
|
221
|
+
...props,
|
|
222
|
+
children: [
|
|
223
|
+
backgroundImage && backgroundAuthor && /* @__PURE__ */ jsxs("div", { className: "hero__background-image-author", children: [
|
|
224
|
+
"Image by ",
|
|
225
|
+
backgroundAuthorLink ? /* @__PURE__ */ jsx("a", { href: backgroundAuthorLink, className: "link-action", target: "_blank", rel: "noopener noreferrer", children: backgroundAuthor }) : backgroundAuthor
|
|
226
|
+
] }),
|
|
227
|
+
backgroundImage && /* @__PURE__ */ jsx(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
className: "hero__background",
|
|
231
|
+
style: backgroundStyle
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ jsx("div", { className: "hero__overlay" }),
|
|
235
|
+
/* @__PURE__ */ jsx("div", { className: "hero__content", children: children ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
236
|
+
title && /* @__PURE__ */ jsx("h1", { className: "hero__title", style: titleStyle, children: title }),
|
|
237
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "hero__subtitle", style: subtitleStyle, children: subtitle }),
|
|
238
|
+
action && /* @__PURE__ */ jsx("div", { className: "hero__action", children: action })
|
|
239
|
+
] }) })
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
Hero.displayName = "Hero";
|
|
246
|
+
export {
|
|
247
|
+
Hero
|
|
248
|
+
};
|
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* src/style/components/icons/icons.css */
|
|
2
2
|
.icon {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
.icon--skeleton {
|
|
9
|
-
background:
|
|
8
|
+
background:
|
|
9
|
+
linear-gradient(
|
|
10
|
+
90deg,
|
|
11
|
+
rgba(0, 0, 0, 0.06) 0%,
|
|
12
|
+
rgba(0, 0, 0, 0.03) 50%,
|
|
13
|
+
rgba(0, 0, 0, 0.06) 100%);
|
|
10
14
|
border-radius: 4px;
|
|
11
15
|
animation: hb-skeleton 1.2s ease-in-out infinite;
|
|
12
16
|
}
|
|
13
|
-
|
|
14
17
|
@keyframes hb-skeleton {
|
|
15
|
-
0% {
|
|
16
|
-
|
|
18
|
+
0% {
|
|
19
|
+
background-position: 200% 0;
|
|
20
|
+
}
|
|
21
|
+
100% {
|
|
22
|
+
background-position: -200% 0;
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Icon Component Styles
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
25
|
.icon {
|
|
23
26
|
display: inline-block;
|
|
24
27
|
flex-shrink: 0;
|
|
25
28
|
transition: color var(--transition-base, 0.2s ease);
|
|
26
29
|
}
|
|
27
|
-
|
|
28
30
|
.icon--interactive {
|
|
29
31
|
cursor: pointer;
|
|
30
32
|
color: var(--color-foreground-1);
|
|
31
33
|
}
|
|
32
|
-
|
|
33
34
|
.icon--interactive:hover:not(:disabled) {
|
|
34
35
|
color: var(--color-action-primary-hover);
|
|
35
36
|
}
|
|
36
|
-
|
|
37
37
|
.icon--interactive:active:not(:disabled) {
|
|
38
38
|
color: var(--color-action-primary-active);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
40
|
.icon--interactive:disabled {
|
|
42
41
|
cursor: not-allowed;
|
|
43
42
|
color: var(--color-foreground-2);
|
|
44
|
-
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export { I as Icon, a as IconName, b as IconProps } from '../icons-Czahnf-r.mjs';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Centralized icon constants for the Hellboy Design System
|
|
6
|
+
* Provides consistent icon mappings across all components
|
|
7
|
+
*/
|
|
8
|
+
declare const INPUT_TYPE_ICONS: Record<string, string>;
|
|
9
|
+
declare const BANNER_TYPE_ICONS: Record<string, string>;
|
|
10
|
+
declare const ACTION_ICONS: {
|
|
11
|
+
readonly close: "x-mark-solid";
|
|
12
|
+
readonly back: "arrow-left-solid";
|
|
13
|
+
readonly forward: "arrow-right-solid";
|
|
14
|
+
readonly up: "arrow-up-solid";
|
|
15
|
+
readonly down: "arrow-down-solid";
|
|
16
|
+
readonly expand: "chevron-down-solid";
|
|
17
|
+
readonly collapse: "chevron-up-solid";
|
|
18
|
+
readonly menu: "bars-3-solid";
|
|
19
|
+
readonly more: "ellipsis-horizontal-solid";
|
|
20
|
+
readonly check: "check-solid";
|
|
21
|
+
readonly cross: "x-mark-solid";
|
|
22
|
+
readonly plus: "plus-solid";
|
|
23
|
+
readonly minus: "minus-solid";
|
|
24
|
+
readonly search: "magnifying-glass-solid";
|
|
25
|
+
readonly clear: "x-mark-solid";
|
|
26
|
+
readonly loading: "arrow-path-solid";
|
|
27
|
+
readonly error: "exclamation-triangle-solid";
|
|
28
|
+
readonly warning: "exclamation-triangle-solid";
|
|
29
|
+
readonly info: "information-circle-solid";
|
|
30
|
+
readonly success: "check-circle-solid";
|
|
31
|
+
};
|
|
32
|
+
declare const NAVIGATION_ICONS: {
|
|
33
|
+
readonly home: "home-solid";
|
|
34
|
+
readonly dashboard: "squares-2x2-solid";
|
|
35
|
+
readonly profile: "user-solid";
|
|
36
|
+
readonly settings: "cog-solid";
|
|
37
|
+
readonly logout: "arrow-right-on-rectangle-solid";
|
|
38
|
+
readonly login: "arrow-left-on-rectangle-solid";
|
|
39
|
+
readonly notifications: "bell-solid";
|
|
40
|
+
readonly messages: "chat-bubble-left-solid";
|
|
41
|
+
readonly help: "question-mark-circle-solid";
|
|
42
|
+
readonly support: "lifebuoy-solid";
|
|
43
|
+
readonly chevronDown: "chevron-down-solid";
|
|
44
|
+
readonly chevronUp: "chevron-up-solid";
|
|
45
|
+
readonly chevronLeft: "chevron-left-solid";
|
|
46
|
+
readonly chevronRight: "chevron-right-solid";
|
|
47
|
+
};
|
|
48
|
+
declare const STATUS_ICONS: {
|
|
49
|
+
readonly online: "check-circle-solid";
|
|
50
|
+
readonly offline: "x-circle-solid";
|
|
51
|
+
readonly pending: "clock-solid";
|
|
52
|
+
readonly active: "check-circle-solid";
|
|
53
|
+
readonly inactive: "x-circle-solid";
|
|
54
|
+
readonly loading: "arrow-path-solid";
|
|
55
|
+
readonly error: "exclamation-triangle-solid";
|
|
56
|
+
readonly warning: "exclamation-triangle-solid";
|
|
57
|
+
readonly success: "check-circle-solid";
|
|
58
|
+
readonly info: "information-circle-solid";
|
|
59
|
+
};
|
|
60
|
+
declare const FILE_TYPE_ICONS: {
|
|
61
|
+
readonly pdf: "document-solid";
|
|
62
|
+
readonly doc: "document-text-solid";
|
|
63
|
+
readonly docx: "document-text-solid";
|
|
64
|
+
readonly xls: "document-chart-bar-solid";
|
|
65
|
+
readonly xlsx: "document-chart-bar-solid";
|
|
66
|
+
readonly ppt: "presentation-chart-bar-solid";
|
|
67
|
+
readonly pptx: "presentation-chart-bar-solid";
|
|
68
|
+
readonly txt: "document-text-solid";
|
|
69
|
+
readonly csv: "table-cells-solid";
|
|
70
|
+
readonly zip: "archive-box-solid";
|
|
71
|
+
readonly image: "photo-solid";
|
|
72
|
+
readonly video: "video-camera-solid";
|
|
73
|
+
readonly audio: "musical-note-solid";
|
|
74
|
+
readonly default: "document-solid";
|
|
75
|
+
};
|
|
76
|
+
declare const SWITCH_ICONS: {
|
|
77
|
+
readonly moon: "moon-solid";
|
|
78
|
+
readonly sun: "sun-solid";
|
|
79
|
+
readonly speakerWave: "speaker-wave-solid";
|
|
80
|
+
readonly speakerXMark: "speaker-x-mark-solid";
|
|
81
|
+
readonly volumeUp: "speaker-wave-solid";
|
|
82
|
+
readonly volumeMute: "speaker-x-mark-solid";
|
|
83
|
+
readonly power: "power-solid";
|
|
84
|
+
readonly play: "play-solid";
|
|
85
|
+
readonly pause: "pause-solid";
|
|
86
|
+
readonly eye: "eye-solid";
|
|
87
|
+
readonly eyeSlash: "eye-slash-solid";
|
|
88
|
+
readonly wifi: "wifi-solid";
|
|
89
|
+
readonly wifiSlash: "wifi-slash-solid";
|
|
90
|
+
readonly lockClosed: "lock-closed-solid";
|
|
91
|
+
readonly lockOpen: "lock-open-solid";
|
|
92
|
+
readonly check: "check-solid";
|
|
93
|
+
readonly xMark: "x-mark-solid";
|
|
94
|
+
};
|
|
95
|
+
declare const CHECKBOX_ICONS: {
|
|
96
|
+
readonly checked: "check-solid";
|
|
97
|
+
readonly indeterminate: "minus-solid";
|
|
98
|
+
};
|
|
99
|
+
declare const LIST_ICONS: {
|
|
100
|
+
readonly selected: "check-solid";
|
|
101
|
+
readonly unselected: "circle-solid";
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { ACTION_ICONS, BANNER_TYPE_ICONS, CHECKBOX_ICONS, FILE_TYPE_ICONS, INPUT_TYPE_ICONS, LIST_ICONS, NAVIGATION_ICONS, STATUS_ICONS, SWITCH_ICONS };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export { I as Icon, a as IconName, b as IconProps } from '../icons-Czahnf-r.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Centralized icon constants for the Hellboy Design System
|
|
6
|
+
* Provides consistent icon mappings across all components
|
|
7
|
+
*/
|
|
8
|
+
declare const INPUT_TYPE_ICONS: Record<string, string>;
|
|
9
|
+
declare const BANNER_TYPE_ICONS: Record<string, string>;
|
|
10
|
+
declare const ACTION_ICONS: {
|
|
11
|
+
readonly close: "x-mark-solid";
|
|
12
|
+
readonly back: "arrow-left-solid";
|
|
13
|
+
readonly forward: "arrow-right-solid";
|
|
14
|
+
readonly up: "arrow-up-solid";
|
|
15
|
+
readonly down: "arrow-down-solid";
|
|
16
|
+
readonly expand: "chevron-down-solid";
|
|
17
|
+
readonly collapse: "chevron-up-solid";
|
|
18
|
+
readonly menu: "bars-3-solid";
|
|
19
|
+
readonly more: "ellipsis-horizontal-solid";
|
|
20
|
+
readonly check: "check-solid";
|
|
21
|
+
readonly cross: "x-mark-solid";
|
|
22
|
+
readonly plus: "plus-solid";
|
|
23
|
+
readonly minus: "minus-solid";
|
|
24
|
+
readonly search: "magnifying-glass-solid";
|
|
25
|
+
readonly clear: "x-mark-solid";
|
|
26
|
+
readonly loading: "arrow-path-solid";
|
|
27
|
+
readonly error: "exclamation-triangle-solid";
|
|
28
|
+
readonly warning: "exclamation-triangle-solid";
|
|
29
|
+
readonly info: "information-circle-solid";
|
|
30
|
+
readonly success: "check-circle-solid";
|
|
31
|
+
};
|
|
32
|
+
declare const NAVIGATION_ICONS: {
|
|
33
|
+
readonly home: "home-solid";
|
|
34
|
+
readonly dashboard: "squares-2x2-solid";
|
|
35
|
+
readonly profile: "user-solid";
|
|
36
|
+
readonly settings: "cog-solid";
|
|
37
|
+
readonly logout: "arrow-right-on-rectangle-solid";
|
|
38
|
+
readonly login: "arrow-left-on-rectangle-solid";
|
|
39
|
+
readonly notifications: "bell-solid";
|
|
40
|
+
readonly messages: "chat-bubble-left-solid";
|
|
41
|
+
readonly help: "question-mark-circle-solid";
|
|
42
|
+
readonly support: "lifebuoy-solid";
|
|
43
|
+
readonly chevronDown: "chevron-down-solid";
|
|
44
|
+
readonly chevronUp: "chevron-up-solid";
|
|
45
|
+
readonly chevronLeft: "chevron-left-solid";
|
|
46
|
+
readonly chevronRight: "chevron-right-solid";
|
|
47
|
+
};
|
|
48
|
+
declare const STATUS_ICONS: {
|
|
49
|
+
readonly online: "check-circle-solid";
|
|
50
|
+
readonly offline: "x-circle-solid";
|
|
51
|
+
readonly pending: "clock-solid";
|
|
52
|
+
readonly active: "check-circle-solid";
|
|
53
|
+
readonly inactive: "x-circle-solid";
|
|
54
|
+
readonly loading: "arrow-path-solid";
|
|
55
|
+
readonly error: "exclamation-triangle-solid";
|
|
56
|
+
readonly warning: "exclamation-triangle-solid";
|
|
57
|
+
readonly success: "check-circle-solid";
|
|
58
|
+
readonly info: "information-circle-solid";
|
|
59
|
+
};
|
|
60
|
+
declare const FILE_TYPE_ICONS: {
|
|
61
|
+
readonly pdf: "document-solid";
|
|
62
|
+
readonly doc: "document-text-solid";
|
|
63
|
+
readonly docx: "document-text-solid";
|
|
64
|
+
readonly xls: "document-chart-bar-solid";
|
|
65
|
+
readonly xlsx: "document-chart-bar-solid";
|
|
66
|
+
readonly ppt: "presentation-chart-bar-solid";
|
|
67
|
+
readonly pptx: "presentation-chart-bar-solid";
|
|
68
|
+
readonly txt: "document-text-solid";
|
|
69
|
+
readonly csv: "table-cells-solid";
|
|
70
|
+
readonly zip: "archive-box-solid";
|
|
71
|
+
readonly image: "photo-solid";
|
|
72
|
+
readonly video: "video-camera-solid";
|
|
73
|
+
readonly audio: "musical-note-solid";
|
|
74
|
+
readonly default: "document-solid";
|
|
75
|
+
};
|
|
76
|
+
declare const SWITCH_ICONS: {
|
|
77
|
+
readonly moon: "moon-solid";
|
|
78
|
+
readonly sun: "sun-solid";
|
|
79
|
+
readonly speakerWave: "speaker-wave-solid";
|
|
80
|
+
readonly speakerXMark: "speaker-x-mark-solid";
|
|
81
|
+
readonly volumeUp: "speaker-wave-solid";
|
|
82
|
+
readonly volumeMute: "speaker-x-mark-solid";
|
|
83
|
+
readonly power: "power-solid";
|
|
84
|
+
readonly play: "play-solid";
|
|
85
|
+
readonly pause: "pause-solid";
|
|
86
|
+
readonly eye: "eye-solid";
|
|
87
|
+
readonly eyeSlash: "eye-slash-solid";
|
|
88
|
+
readonly wifi: "wifi-solid";
|
|
89
|
+
readonly wifiSlash: "wifi-slash-solid";
|
|
90
|
+
readonly lockClosed: "lock-closed-solid";
|
|
91
|
+
readonly lockOpen: "lock-open-solid";
|
|
92
|
+
readonly check: "check-solid";
|
|
93
|
+
readonly xMark: "x-mark-solid";
|
|
94
|
+
};
|
|
95
|
+
declare const CHECKBOX_ICONS: {
|
|
96
|
+
readonly checked: "check-solid";
|
|
97
|
+
readonly indeterminate: "minus-solid";
|
|
98
|
+
};
|
|
99
|
+
declare const LIST_ICONS: {
|
|
100
|
+
readonly selected: "check-solid";
|
|
101
|
+
readonly unselected: "circle-solid";
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { ACTION_ICONS, BANNER_TYPE_ICONS, CHECKBOX_ICONS, FILE_TYPE_ICONS, INPUT_TYPE_ICONS, LIST_ICONS, NAVIGATION_ICONS, STATUS_ICONS, SWITCH_ICONS };
|