@hyperpackai/hyperui 0.1.0
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/LICENSE +21 -0
- package/README.md +82 -0
- package/dist/components/Accordion/index.d.ts +17 -0
- package/dist/components/Accordion/index.d.ts.map +1 -0
- package/dist/components/Accordion/index.js +46 -0
- package/dist/components/Alert/index.d.ts +13 -0
- package/dist/components/Alert/index.d.ts.map +1 -0
- package/dist/components/Alert/index.js +46 -0
- package/dist/components/AppBar/index.d.ts +19 -0
- package/dist/components/AppBar/index.d.ts.map +1 -0
- package/dist/components/AppBar/index.js +48 -0
- package/dist/components/AspectRatio/index.d.ts +8 -0
- package/dist/components/AspectRatio/index.d.ts.map +1 -0
- package/dist/components/AspectRatio/index.js +32 -0
- package/dist/components/Autocomplete/index.d.ts +21 -0
- package/dist/components/Autocomplete/index.d.ts.map +1 -0
- package/dist/components/Autocomplete/index.js +94 -0
- package/dist/components/Avatar/index.d.ts +12 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Avatar/index.js +32 -0
- package/dist/components/AvatarGroup/index.d.ts +9 -0
- package/dist/components/AvatarGroup/index.d.ts.map +1 -0
- package/dist/components/AvatarGroup/index.js +24 -0
- package/dist/components/Backdrop/index.d.ts +10 -0
- package/dist/components/Backdrop/index.d.ts.map +1 -0
- package/dist/components/Backdrop/index.js +25 -0
- package/dist/components/Badge/index.d.ts +10 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Badge/index.js +30 -0
- package/dist/components/BottomNavigation/index.d.ts +16 -0
- package/dist/components/BottomNavigation/index.d.ts.map +1 -0
- package/dist/components/BottomNavigation/index.js +43 -0
- package/dist/components/Box/index.d.ts +21 -0
- package/dist/components/Box/index.d.ts.map +1 -0
- package/dist/components/Box/index.js +30 -0
- package/dist/components/Breadcrumb/index.d.ts +13 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/index.js +19 -0
- package/dist/components/Button/index.d.ts +22 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +93 -0
- package/dist/components/ButtonGroup/index.d.ts +9 -0
- package/dist/components/ButtonGroup/index.d.ts.map +1 -0
- package/dist/components/ButtonGroup/index.js +27 -0
- package/dist/components/Card/index.d.ts +14 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Card/index.js +33 -0
- package/dist/components/Checkbox/index.d.ts +17 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Checkbox/index.js +42 -0
- package/dist/components/Chip/index.d.ts +18 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/components/Chip/index.js +60 -0
- package/dist/components/CircularProgress/index.d.ts +14 -0
- package/dist/components/CircularProgress/index.d.ts.map +1 -0
- package/dist/components/CircularProgress/index.js +58 -0
- package/dist/components/ClickAwayListener/index.d.ts +11 -0
- package/dist/components/ClickAwayListener/index.d.ts.map +1 -0
- package/dist/components/ClickAwayListener/index.js +31 -0
- package/dist/components/Code/index.d.ts +9 -0
- package/dist/components/Code/index.d.ts.map +1 -0
- package/dist/components/Code/index.js +50 -0
- package/dist/components/Collapse/index.d.ts +11 -0
- package/dist/components/Collapse/index.d.ts.map +1 -0
- package/dist/components/Collapse/index.js +30 -0
- package/dist/components/CommandPalette/index.d.ts +26 -0
- package/dist/components/CommandPalette/index.d.ts.map +1 -0
- package/dist/components/CommandPalette/index.js +141 -0
- package/dist/components/Container/index.d.ts +11 -0
- package/dist/components/Container/index.d.ts.map +1 -0
- package/dist/components/Container/index.js +18 -0
- package/dist/components/DashboardLayout/index.d.ts +15 -0
- package/dist/components/DashboardLayout/index.d.ts.map +1 -0
- package/dist/components/DashboardLayout/index.js +67 -0
- package/dist/components/DataTable/index.d.ts +27 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/DataTable/index.js +59 -0
- package/dist/components/Dialog/index.d.ts +19 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Dialog/index.js +96 -0
- package/dist/components/Divider/index.d.ts +13 -0
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/Divider/index.js +40 -0
- package/dist/components/Drawer/index.d.ts +17 -0
- package/dist/components/Drawer/index.d.ts.map +1 -0
- package/dist/components/Drawer/index.js +77 -0
- package/dist/components/DropdownMenu/index.d.ts +25 -0
- package/dist/components/DropdownMenu/index.d.ts.map +1 -0
- package/dist/components/DropdownMenu/index.js +67 -0
- package/dist/components/EmptyState/index.d.ts +11 -0
- package/dist/components/EmptyState/index.d.ts.map +1 -0
- package/dist/components/EmptyState/index.js +53 -0
- package/dist/components/ErrorState/index.d.ts +12 -0
- package/dist/components/ErrorState/index.d.ts.map +1 -0
- package/dist/components/ErrorState/index.js +54 -0
- package/dist/components/Fab/index.d.ts +16 -0
- package/dist/components/Fab/index.d.ts.map +1 -0
- package/dist/components/Fab/index.js +39 -0
- package/dist/components/Fade/index.d.ts +10 -0
- package/dist/components/Fade/index.d.ts.map +1 -0
- package/dist/components/Fade/index.js +13 -0
- package/dist/components/FocusTrap/index.d.ts +11 -0
- package/dist/components/FocusTrap/index.d.ts.map +1 -0
- package/dist/components/FocusTrap/index.js +69 -0
- package/dist/components/FormControl/index.d.ts +34 -0
- package/dist/components/FormControl/index.d.ts.map +1 -0
- package/dist/components/FormControl/index.js +52 -0
- package/dist/components/GlobalSearch/index.d.ts +23 -0
- package/dist/components/GlobalSearch/index.d.ts.map +1 -0
- package/dist/components/GlobalSearch/index.js +91 -0
- package/dist/components/Grid/index.d.ts +19 -0
- package/dist/components/Grid/index.d.ts.map +1 -0
- package/dist/components/Grid/index.js +30 -0
- package/dist/components/Grow/index.d.ts +10 -0
- package/dist/components/Grow/index.d.ts.map +1 -0
- package/dist/components/Grow/index.js +13 -0
- package/dist/components/IconButton/index.d.ts +16 -0
- package/dist/components/IconButton/index.d.ts.map +1 -0
- package/dist/components/IconButton/index.js +43 -0
- package/dist/components/ImageList/index.d.ts +21 -0
- package/dist/components/ImageList/index.d.ts.map +1 -0
- package/dist/components/ImageList/index.js +39 -0
- package/dist/components/Input/index.d.ts +33 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/index.js +45 -0
- package/dist/components/Kbd/index.d.ts +8 -0
- package/dist/components/Kbd/index.d.ts.map +1 -0
- package/dist/components/Kbd/index.js +41 -0
- package/dist/components/KeyboardShortcut/index.d.ts +20 -0
- package/dist/components/KeyboardShortcut/index.d.ts.map +1 -0
- package/dist/components/KeyboardShortcut/index.js +63 -0
- package/dist/components/Label/index.d.ts +10 -0
- package/dist/components/Label/index.d.ts.map +1 -0
- package/dist/components/Label/index.js +17 -0
- package/dist/components/LinearProgress/index.d.ts +13 -0
- package/dist/components/LinearProgress/index.d.ts.map +1 -0
- package/dist/components/LinearProgress/index.js +69 -0
- package/dist/components/Link/index.d.ts +16 -0
- package/dist/components/Link/index.d.ts.map +1 -0
- package/dist/components/Link/index.js +25 -0
- package/dist/components/List/index.d.ts +40 -0
- package/dist/components/List/index.d.ts.map +1 -0
- package/dist/components/List/index.js +70 -0
- package/dist/components/LoadingState/index.d.ts +11 -0
- package/dist/components/LoadingState/index.d.ts.map +1 -0
- package/dist/components/LoadingState/index.js +66 -0
- package/dist/components/Menu/index.d.ts +40 -0
- package/dist/components/Menu/index.d.ts.map +1 -0
- package/dist/components/Menu/index.js +103 -0
- package/dist/components/MobileStepper/index.d.ts +16 -0
- package/dist/components/MobileStepper/index.d.ts.map +1 -0
- package/dist/components/MobileStepper/index.js +67 -0
- package/dist/components/Modal/index.d.ts +14 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Modal/index.js +51 -0
- package/dist/components/Navbar/index.d.ts +14 -0
- package/dist/components/Navbar/index.d.ts.map +1 -0
- package/dist/components/Navbar/index.js +27 -0
- package/dist/components/NoSSR/index.d.ts +7 -0
- package/dist/components/NoSSR/index.d.ts.map +1 -0
- package/dist/components/NoSSR/index.js +9 -0
- package/dist/components/PageLayout/index.d.ts +13 -0
- package/dist/components/PageLayout/index.d.ts.map +1 -0
- package/dist/components/PageLayout/index.js +41 -0
- package/dist/components/Pagination/index.d.ts +11 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Pagination/index.js +56 -0
- package/dist/components/Paper/index.d.ts +12 -0
- package/dist/components/Paper/index.d.ts.map +1 -0
- package/dist/components/Paper/index.js +24 -0
- package/dist/components/Popover/index.d.ts +13 -0
- package/dist/components/Popover/index.d.ts.map +1 -0
- package/dist/components/Popover/index.js +34 -0
- package/dist/components/Progress/index.d.ts +13 -0
- package/dist/components/Progress/index.d.ts.map +1 -0
- package/dist/components/Progress/index.js +40 -0
- package/dist/components/Radio/index.d.ts +7 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Radio/index.js +28 -0
- package/dist/components/Rating/index.d.ts +15 -0
- package/dist/components/Rating/index.d.ts.map +1 -0
- package/dist/components/Rating/index.js +41 -0
- package/dist/components/ResizablePanel/index.d.ts +16 -0
- package/dist/components/ResizablePanel/index.d.ts.map +1 -0
- package/dist/components/ResizablePanel/index.js +41 -0
- package/dist/components/ScrollArea/index.d.ts +12 -0
- package/dist/components/ScrollArea/index.d.ts.map +1 -0
- package/dist/components/ScrollArea/index.js +50 -0
- package/dist/components/Select/index.d.ts +23 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Select/index.js +52 -0
- package/dist/components/Sheet/index.d.ts +15 -0
- package/dist/components/Sheet/index.d.ts.map +1 -0
- package/dist/components/Sheet/index.js +61 -0
- package/dist/components/Sidebar/index.d.ts +23 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/Sidebar/index.js +37 -0
- package/dist/components/Skeleton/index.d.ts +9 -0
- package/dist/components/Skeleton/index.d.ts.map +1 -0
- package/dist/components/Skeleton/index.js +22 -0
- package/dist/components/Slide/index.d.ts +12 -0
- package/dist/components/Slide/index.d.ts.map +1 -0
- package/dist/components/Slide/index.js +21 -0
- package/dist/components/Slider/index.d.ts +19 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Slider/index.js +49 -0
- package/dist/components/Snackbar/index.d.ts +28 -0
- package/dist/components/Snackbar/index.d.ts.map +1 -0
- package/dist/components/Snackbar/index.js +71 -0
- package/dist/components/SpeedDial/index.d.ts +18 -0
- package/dist/components/SpeedDial/index.d.ts.map +1 -0
- package/dist/components/SpeedDial/index.js +71 -0
- package/dist/components/Spinner/index.d.ts +10 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Spinner/index.js +67 -0
- package/dist/components/SplitPane/index.d.ts +11 -0
- package/dist/components/SplitPane/index.d.ts.map +1 -0
- package/dist/components/SplitPane/index.js +46 -0
- package/dist/components/Stack/index.d.ts +17 -0
- package/dist/components/Stack/index.d.ts.map +1 -0
- package/dist/components/Stack/index.js +30 -0
- package/dist/components/Stepper/index.d.ts +20 -0
- package/dist/components/Stepper/index.d.ts.map +1 -0
- package/dist/components/Stepper/index.js +66 -0
- package/dist/components/Switch/index.d.ts +13 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Switch/index.js +38 -0
- package/dist/components/Tabs/index.d.ts +20 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/index.js +62 -0
- package/dist/components/TextField/index.d.ts +35 -0
- package/dist/components/TextField/index.d.ts.map +1 -0
- package/dist/components/TextField/index.js +69 -0
- package/dist/components/Textarea/index.d.ts +22 -0
- package/dist/components/Textarea/index.d.ts.map +1 -0
- package/dist/components/Textarea/index.js +27 -0
- package/dist/components/Timeline/index.d.ts +16 -0
- package/dist/components/Timeline/index.d.ts.map +1 -0
- package/dist/components/Timeline/index.js +30 -0
- package/dist/components/Toast/index.d.ts +34 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/index.js +106 -0
- package/dist/components/ToggleButton/index.d.ts +21 -0
- package/dist/components/ToggleButton/index.d.ts.map +1 -0
- package/dist/components/ToggleButton/index.js +81 -0
- package/dist/components/Tooltip/index.d.ts +14 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.js +47 -0
- package/dist/components/TreeView/index.d.ts +19 -0
- package/dist/components/TreeView/index.d.ts.map +1 -0
- package/dist/components/TreeView/index.js +50 -0
- package/dist/components/Typography/index.d.ts +17 -0
- package/dist/components/Typography/index.d.ts.map +1 -0
- package/dist/components/Typography/index.js +44 -0
- package/dist/components/VisuallyHidden/index.d.ts +7 -0
- package/dist/components/VisuallyHidden/index.d.ts.map +1 -0
- package/dist/components/VisuallyHidden/index.js +18 -0
- package/dist/components/Zoom/index.d.ts +10 -0
- package/dist/components/Zoom/index.d.ts.map +1 -0
- package/dist/components/Zoom/index.js +13 -0
- package/dist/components/ai.d.ts +133 -0
- package/dist/components/ai.d.ts.map +1 -0
- package/dist/components/ai.js +184 -0
- package/dist/components/charts.d.ts +143 -0
- package/dist/components/charts.d.ts.map +1 -0
- package/dist/components/charts.js +435 -0
- package/dist/components/data.d.ts +192 -0
- package/dist/components/data.d.ts.map +1 -0
- package/dist/components/data.js +581 -0
- package/dist/components/date.d.ts +73 -0
- package/dist/components/date.d.ts.map +1 -0
- package/dist/components/date.js +199 -0
- package/dist/components/enterprise.d.ts +246 -0
- package/dist/components/enterprise.d.ts.map +1 -0
- package/dist/components/enterprise.js +428 -0
- package/dist/components/form.d.ts +132 -0
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +380 -0
- package/dist/components/index.d.ts +173 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +107 -0
- package/dist/components/inputs.d.ts +169 -0
- package/dist/components/inputs.d.ts.map +1 -0
- package/dist/components/inputs.js +437 -0
- package/dist/components/layout.d.ts +224 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/layout.js +644 -0
- package/dist/components/overlay.d.ts +102 -0
- package/dist/components/overlay.d.ts.map +1 -0
- package/dist/components/overlay.js +318 -0
- package/dist/components/surfaces.d.ts +180 -0
- package/dist/components/surfaces.d.ts.map +1 -0
- package/dist/components/surfaces.js +423 -0
- package/dist/components/typography.d.ts +69 -0
- package/dist/components/typography.d.ts.map +1 -0
- package/dist/components/typography.js +206 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/portal.d.ts +3 -0
- package/dist/portal.d.ts.map +1 -0
- package/dist/portal.js +17 -0
- package/dist/theme/index.d.ts +31 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +258 -0
- package/dist/tokens/component.d.ts +124 -0
- package/dist/tokens/component.d.ts.map +1 -0
- package/dist/tokens/component.js +113 -0
- package/dist/tokens/index.d.ts +494 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +345 -0
- package/dist/tokens/primitives.d.ts +675 -0
- package/dist/tokens/primitives.d.ts.map +1 -0
- package/dist/tokens/primitives.js +356 -0
- package/dist/tokens/semantic.d.ts +252 -0
- package/dist/tokens/semantic.d.ts.map +1 -0
- package/dist/tokens/semantic.js +242 -0
- package/dist/tokens/themes.d.ts +18 -0
- package/dist/tokens/themes.d.ts.map +1 -0
- package/dist/tokens/themes.js +316 -0
- package/package.json +69 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HyperUI Surface & Layout Components
|
|
3
|
+
* Paper · Box · Container · Stack · Grid · ImageList · List
|
|
4
|
+
*/
|
|
5
|
+
import { injectCSS, cn, h } from "../theme/index.js";
|
|
6
|
+
// ============================================================
|
|
7
|
+
// PAPER
|
|
8
|
+
// ============================================================
|
|
9
|
+
const PAPER_CSS = `
|
|
10
|
+
.hu-paper { background: var(--hu-bg); border-radius: var(--hu-radius); transition: box-shadow var(--hu-duration); }
|
|
11
|
+
.hu-paper--elevation-0 { box-shadow: none; }
|
|
12
|
+
.hu-paper--elevation-1 { box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.1); }
|
|
13
|
+
.hu-paper--elevation-2 { box-shadow: 0 3px 6px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.08); }
|
|
14
|
+
.hu-paper--elevation-3 { box-shadow: 0 8px 16px rgba(0,0,0,.12), 0 3px 6px rgba(0,0,0,.08); }
|
|
15
|
+
.hu-paper--elevation-4 { box-shadow: 0 16px 32px rgba(0,0,0,.15), 0 6px 12px rgba(0,0,0,.1); }
|
|
16
|
+
.hu-paper--elevation-5 { box-shadow: 0 24px 48px rgba(0,0,0,.18), 0 10px 20px rgba(0,0,0,.12); }
|
|
17
|
+
.hu-paper--outlined { border: 1px solid var(--hu-border); box-shadow: none; }
|
|
18
|
+
.hu-paper--square { border-radius: 0; }
|
|
19
|
+
`;
|
|
20
|
+
export function Paper(props) {
|
|
21
|
+
injectCSS("hu-paper", PAPER_CSS);
|
|
22
|
+
const { elevation = 1, variant = "elevation", square, component = "div" } = props;
|
|
23
|
+
return h(component, {
|
|
24
|
+
class: cn("hu-paper", variant === "elevation" ? `hu-paper--elevation-${elevation}` : "hu-paper--outlined", square && "hu-paper--square", props.class)
|
|
25
|
+
}, props.children);
|
|
26
|
+
}
|
|
27
|
+
export function Box(props) {
|
|
28
|
+
const { component = "div", display, flexDirection, alignItems, justifyContent, gap, padding, margin, width, height, overflow, position, style, onClick, children } = props;
|
|
29
|
+
const styles = [];
|
|
30
|
+
if (display)
|
|
31
|
+
styles.push(`display:${display}`);
|
|
32
|
+
if (flexDirection)
|
|
33
|
+
styles.push(`flex-direction:${flexDirection}`);
|
|
34
|
+
if (alignItems)
|
|
35
|
+
styles.push(`align-items:${alignItems}`);
|
|
36
|
+
if (justifyContent)
|
|
37
|
+
styles.push(`justify-content:${justifyContent}`);
|
|
38
|
+
if (gap !== undefined)
|
|
39
|
+
styles.push(`gap:${typeof gap === "number" ? `${gap}px` : gap}`);
|
|
40
|
+
if (padding !== undefined)
|
|
41
|
+
styles.push(`padding:${typeof padding === "number" ? `${padding}px` : padding}`);
|
|
42
|
+
if (margin !== undefined)
|
|
43
|
+
styles.push(`margin:${typeof margin === "number" ? `${margin}px` : margin}`);
|
|
44
|
+
if (width !== undefined)
|
|
45
|
+
styles.push(`width:${typeof width === "number" ? `${width}px` : width}`);
|
|
46
|
+
if (height !== undefined)
|
|
47
|
+
styles.push(`height:${typeof height === "number" ? `${height}px` : height}`);
|
|
48
|
+
if (overflow)
|
|
49
|
+
styles.push(`overflow:${overflow}`);
|
|
50
|
+
if (position)
|
|
51
|
+
styles.push(`position:${position}`);
|
|
52
|
+
if (style)
|
|
53
|
+
styles.push(style);
|
|
54
|
+
return h(component, { class: props.class, style: styles.join(";") || undefined, onClick }, children);
|
|
55
|
+
}
|
|
56
|
+
// ============================================================
|
|
57
|
+
// CONTAINER
|
|
58
|
+
// ============================================================
|
|
59
|
+
const CONTAINER_CSS = `
|
|
60
|
+
.hu-container { width: 100%; margin-left: auto; margin-right: auto; padding-left: var(--hu-space-4); padding-right: var(--hu-space-4); box-sizing: border-box; }
|
|
61
|
+
.hu-container--xs { max-width: 444px; }
|
|
62
|
+
.hu-container--sm { max-width: 600px; }
|
|
63
|
+
.hu-container--md { max-width: 900px; }
|
|
64
|
+
.hu-container--lg { max-width: 1200px; }
|
|
65
|
+
.hu-container--xl { max-width: 1536px; }
|
|
66
|
+
.hu-container--fluid { max-width: 100%; }
|
|
67
|
+
.hu-container--disableGutters { padding-left: 0; padding-right: 0; }
|
|
68
|
+
`;
|
|
69
|
+
export function Container(props) {
|
|
70
|
+
injectCSS("hu-container", CONTAINER_CSS);
|
|
71
|
+
const { maxWidth = "lg", disableGutters } = props;
|
|
72
|
+
return h("div", {
|
|
73
|
+
class: cn("hu-container", `hu-container--${maxWidth}`, disableGutters && "hu-container--disableGutters", props.class)
|
|
74
|
+
}, props.children);
|
|
75
|
+
}
|
|
76
|
+
// ============================================================
|
|
77
|
+
// STACK
|
|
78
|
+
// ============================================================
|
|
79
|
+
const STACK_CSS = `
|
|
80
|
+
.hu-stack { display: flex; }
|
|
81
|
+
.hu-stack--row { flex-direction: row; }
|
|
82
|
+
.hu-stack--column { flex-direction: column; }
|
|
83
|
+
.hu-stack--wrap { flex-wrap: wrap; }
|
|
84
|
+
.hu-stack--align-start { align-items: flex-start; }
|
|
85
|
+
.hu-stack--align-center { align-items: center; }
|
|
86
|
+
.hu-stack--align-end { align-items: flex-end; }
|
|
87
|
+
.hu-stack--align-stretch { align-items: stretch; }
|
|
88
|
+
.hu-stack--justify-start { justify-content: flex-start; }
|
|
89
|
+
.hu-stack--justify-center { justify-content: center; }
|
|
90
|
+
.hu-stack--justify-end { justify-content: flex-end; }
|
|
91
|
+
.hu-stack--justify-between { justify-content: space-between; }
|
|
92
|
+
.hu-stack--justify-around { justify-content: space-around; }
|
|
93
|
+
.hu-stack--justify-evenly { justify-content: space-evenly; }
|
|
94
|
+
.hu-stack--divider > * + * { border-top: 1px solid var(--hu-border); }
|
|
95
|
+
.hu-stack--row.hu-stack--divider > * + * { border-top: none; border-left: 1px solid var(--hu-border); }
|
|
96
|
+
`;
|
|
97
|
+
export function Stack(props) {
|
|
98
|
+
injectCSS("hu-stack", STACK_CSS);
|
|
99
|
+
const { direction = "column", spacing, alignItems, justifyContent, flexWrap, divider } = props;
|
|
100
|
+
const gapStyle = spacing !== undefined
|
|
101
|
+
? `gap:${typeof spacing === "number" ? `${spacing * 8}px` : spacing}`
|
|
102
|
+
: undefined;
|
|
103
|
+
return h("div", {
|
|
104
|
+
class: cn("hu-stack", `hu-stack--${direction}`, alignItems && `hu-stack--align-${alignItems}`, justifyContent && `hu-stack--justify-${justifyContent}`, flexWrap && "hu-stack--wrap", divider && "hu-stack--divider", props.class),
|
|
105
|
+
style: gapStyle
|
|
106
|
+
}, props.children);
|
|
107
|
+
}
|
|
108
|
+
// ============================================================
|
|
109
|
+
// GRID
|
|
110
|
+
// ============================================================
|
|
111
|
+
const GRID_CSS = `
|
|
112
|
+
.hu-grid { display: grid; box-sizing: border-box; }
|
|
113
|
+
.hu-grid--container { width: 100%; }
|
|
114
|
+
.hu-grid--item { box-sizing: border-box; }
|
|
115
|
+
`;
|
|
116
|
+
export function Grid(props) {
|
|
117
|
+
injectCSS("hu-grid", GRID_CSS);
|
|
118
|
+
const { container, item, columns = 12, spacing = 0, xs, sm, md, lg, xl } = props;
|
|
119
|
+
const styles = [];
|
|
120
|
+
if (container) {
|
|
121
|
+
styles.push(`grid-template-columns: repeat(${columns}, 1fr)`);
|
|
122
|
+
if (spacing)
|
|
123
|
+
styles.push(`gap: ${spacing * 8}px`);
|
|
124
|
+
if (props.columnSpacing)
|
|
125
|
+
styles.push(`column-gap: ${props.columnSpacing * 8}px`);
|
|
126
|
+
if (props.rowSpacing)
|
|
127
|
+
styles.push(`row-gap: ${props.rowSpacing * 8}px`);
|
|
128
|
+
}
|
|
129
|
+
if (item) {
|
|
130
|
+
const colSpan = (v) => v === true ? "1 / -1" : v === "auto" ? "auto" : v ? `span ${v}` : undefined;
|
|
131
|
+
const span = colSpan(xs) ?? colSpan(sm) ?? colSpan(md) ?? colSpan(lg) ?? colSpan(xl);
|
|
132
|
+
if (span)
|
|
133
|
+
styles.push(`grid-column: ${span}`);
|
|
134
|
+
}
|
|
135
|
+
return h("div", {
|
|
136
|
+
class: cn("hu-grid", container && "hu-grid--container", item && "hu-grid--item", props.class),
|
|
137
|
+
style: styles.join(";") || undefined
|
|
138
|
+
}, props.children);
|
|
139
|
+
}
|
|
140
|
+
// ============================================================
|
|
141
|
+
// IMAGE LIST
|
|
142
|
+
// ============================================================
|
|
143
|
+
const IMAGE_LIST_CSS = `
|
|
144
|
+
.hu-image-list { display: grid; overflow-y: auto; list-style: none; padding: 0; margin: 0; }
|
|
145
|
+
.hu-image-list--standard { align-items: start; }
|
|
146
|
+
.hu-image-list--masonry { display: block; columns: 3; column-gap: 8px; }
|
|
147
|
+
.hu-image-list--quilted { }
|
|
148
|
+
.hu-image-list__item { overflow: hidden; position: relative; }
|
|
149
|
+
.hu-image-list--masonry .hu-image-list__item { break-inside: avoid; margin-bottom: 8px; }
|
|
150
|
+
.hu-image-list__img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
151
|
+
.hu-image-list--standard .hu-image-list__img { height: inherit; }
|
|
152
|
+
.hu-image-list__bar {
|
|
153
|
+
position: absolute; bottom: 0; left: 0; right: 0;
|
|
154
|
+
background: linear-gradient(transparent, rgba(0,0,0,.65));
|
|
155
|
+
padding: var(--hu-space-3) var(--hu-space-2) var(--hu-space-2);
|
|
156
|
+
color: #fff;
|
|
157
|
+
}
|
|
158
|
+
.hu-image-list__bar--top { top: 0; bottom: auto; background: linear-gradient(rgba(0,0,0,.65), transparent); }
|
|
159
|
+
.hu-image-list__title { font-size: var(--hu-font-size-sm); font-weight: var(--hu-font-weight-medium); }
|
|
160
|
+
.hu-image-list__subtitle { font-size: var(--hu-font-size-xs); opacity: .8; }
|
|
161
|
+
`;
|
|
162
|
+
export function ImageList(props) {
|
|
163
|
+
injectCSS("hu-image-list", IMAGE_LIST_CSS);
|
|
164
|
+
const { cols = 3, rowHeight = 180, gap = 8, variant = "standard", items } = props;
|
|
165
|
+
const styles = [
|
|
166
|
+
variant !== "masonry" ? `grid-template-columns: repeat(${cols}, 1fr)` : "",
|
|
167
|
+
variant !== "masonry" ? `grid-auto-rows: ${rowHeight === "auto" ? "auto" : `${rowHeight}px`}` : "",
|
|
168
|
+
`gap: ${gap}px`
|
|
169
|
+
].filter(Boolean);
|
|
170
|
+
return h("ul", {
|
|
171
|
+
class: cn("hu-image-list", `hu-image-list--${variant}`, props.class),
|
|
172
|
+
style: styles.join(";")
|
|
173
|
+
}, ...items.map(item => h("li", {
|
|
174
|
+
class: "hu-image-list__item",
|
|
175
|
+
style: item.cols || item.rows
|
|
176
|
+
? `grid-column: span ${item.cols ?? 1}; grid-row: span ${item.rows ?? 1};`
|
|
177
|
+
: undefined,
|
|
178
|
+
onClick: item.onClick
|
|
179
|
+
}, h("img", { class: "hu-image-list__img", src: item.src, alt: item.alt ?? item.title ?? "" }), item.title && h("div", { class: cn("hu-image-list__bar", item.titleBarPosition === "top" && "hu-image-list__bar--top") }, h("div", { class: "hu-image-list__title" }, item.title), item.subtitle && h("div", { class: "hu-image-list__subtitle" }, item.subtitle)))));
|
|
180
|
+
}
|
|
181
|
+
// ============================================================
|
|
182
|
+
// LIST / LIST ITEM
|
|
183
|
+
// ============================================================
|
|
184
|
+
const LIST_CSS = `
|
|
185
|
+
.hu-list { list-style: none; padding: 0; margin: 0; }
|
|
186
|
+
.hu-list--dense .hu-list-item { padding-top: 4px; padding-bottom: 4px; }
|
|
187
|
+
.hu-list--bordered { border: 1px solid var(--hu-border); border-radius: var(--hu-radius-md); overflow: hidden; }
|
|
188
|
+
.hu-list--bordered .hu-list-item + .hu-list-item { border-top: 1px solid var(--hu-border); }
|
|
189
|
+
.hu-list--disablePadding .hu-list-item { padding-left: 0; padding-right: 0; }
|
|
190
|
+
|
|
191
|
+
.hu-list-subheader {
|
|
192
|
+
padding: var(--hu-space-1-5) var(--hu-space-2) var(--hu-space-1);
|
|
193
|
+
font-size: var(--hu-font-size-xs); font-weight: var(--hu-font-weight-semibold);
|
|
194
|
+
color: var(--hu-text-2); text-transform: uppercase; letter-spacing: .06em;
|
|
195
|
+
line-height: 2.4;
|
|
196
|
+
}
|
|
197
|
+
.hu-list-subheader--sticky { position: sticky; top: 0; background: var(--hu-bg); z-index: 1; }
|
|
198
|
+
|
|
199
|
+
.hu-list-item {
|
|
200
|
+
display: flex; align-items: center;
|
|
201
|
+
padding: var(--hu-space-2-5) var(--hu-space-2);
|
|
202
|
+
min-height: 48px; box-sizing: border-box;
|
|
203
|
+
position: relative;
|
|
204
|
+
}
|
|
205
|
+
.hu-list-item--button { cursor: pointer; transition: background var(--hu-duration); }
|
|
206
|
+
.hu-list-item--button:hover { background: var(--hu-bg-3); }
|
|
207
|
+
.hu-list-item--button:focus-visible { background: var(--hu-bg-3); outline: none; }
|
|
208
|
+
.hu-list-item--selected { background: var(--hu-primary-bg); color: var(--hu-primary); }
|
|
209
|
+
.hu-list-item--disabled { opacity: .5; pointer-events: none; }
|
|
210
|
+
.hu-list-item--divider { border-bottom: 1px solid var(--hu-border); }
|
|
211
|
+
.hu-list-item-icon { min-width: 40px; color: var(--hu-text-2); display: flex; align-items: center; justify-content: flex-start; }
|
|
212
|
+
.hu-list-item-avatar { min-width: 56px; }
|
|
213
|
+
.hu-list-item-text { flex: 1; min-width: 0; }
|
|
214
|
+
.hu-list-item-text__primary { font-size: var(--hu-font-size-sm); color: var(--hu-text); font-weight: var(--hu-font-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
215
|
+
.hu-list-item-text__secondary { font-size: var(--hu-font-size-xs); color: var(--hu-text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
216
|
+
.hu-list-item-secondary-action { margin-left: var(--hu-space-2); }
|
|
217
|
+
`;
|
|
218
|
+
export function ListSubheader(props) {
|
|
219
|
+
injectCSS("hu-list", LIST_CSS);
|
|
220
|
+
return h("li", { class: cn("hu-list-subheader", props.sticky && "hu-list-subheader--sticky", props.class) }, props.children);
|
|
221
|
+
}
|
|
222
|
+
export function List(props) {
|
|
223
|
+
injectCSS("hu-list", LIST_CSS);
|
|
224
|
+
return h("ul", {
|
|
225
|
+
class: cn("hu-list", props.dense && "hu-list--dense", props.bordered && "hu-list--bordered", props.disablePadding && "hu-list--disablePadding", props.class)
|
|
226
|
+
}, props.subheader, props.children);
|
|
227
|
+
}
|
|
228
|
+
export function ListItem(props) {
|
|
229
|
+
injectCSS("hu-list", LIST_CSS);
|
|
230
|
+
const { button, selected, disabled, divider, secondaryAction, onClick, children } = props;
|
|
231
|
+
return h(button ? "button" : "li", {
|
|
232
|
+
class: cn("hu-list-item", button && "hu-list-item--button", selected && "hu-list-item--selected", disabled && "hu-list-item--disabled", divider && "hu-list-item--divider", props.class),
|
|
233
|
+
type: button ? "button" : undefined,
|
|
234
|
+
disabled, onClick, tabindex: button ? "0" : undefined
|
|
235
|
+
}, children, secondaryAction && h("div", { class: "hu-list-item-secondary-action" }, secondaryAction));
|
|
236
|
+
}
|
|
237
|
+
export function ListItemIcon(props) {
|
|
238
|
+
injectCSS("hu-list", LIST_CSS);
|
|
239
|
+
return h("div", { class: cn("hu-list-item-icon", props.class) }, props.children);
|
|
240
|
+
}
|
|
241
|
+
export function ListItemText(props) {
|
|
242
|
+
injectCSS("hu-list", LIST_CSS);
|
|
243
|
+
return h("div", { class: cn("hu-list-item-text", props.class) }, props.primary && h("div", { class: "hu-list-item-text__primary" }, props.primary), props.secondary && h("div", { class: "hu-list-item-text__secondary" }, props.secondary));
|
|
244
|
+
}
|
|
245
|
+
// ============================================================
|
|
246
|
+
// ENTERPRISE LAYOUTS
|
|
247
|
+
// ============================================================
|
|
248
|
+
const ENTERPRISE_LAYOUT_CSS = `
|
|
249
|
+
.hu-page-layout {
|
|
250
|
+
min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto;
|
|
251
|
+
background: var(--hu-bg-2); color: var(--hu-text);
|
|
252
|
+
}
|
|
253
|
+
.hu-page-layout--contained .hu-page-layout__main {
|
|
254
|
+
width: 100%; max-width: var(--hu-page-max, 1200px); margin-inline: auto;
|
|
255
|
+
}
|
|
256
|
+
.hu-page-layout__header {
|
|
257
|
+
position: relative; z-index: var(--hu-z-sticky); background: var(--hu-bg);
|
|
258
|
+
border-block-end: 1px solid var(--hu-border);
|
|
259
|
+
}
|
|
260
|
+
.hu-page-layout__header--sticky { position: sticky; inset-block-start: 0; }
|
|
261
|
+
.hu-page-layout__main {
|
|
262
|
+
min-width: 0; padding: var(--hu-page-padding, var(--hu-space-6));
|
|
263
|
+
}
|
|
264
|
+
.hu-page-layout__footer {
|
|
265
|
+
background: var(--hu-bg); border-block-start: 1px solid var(--hu-border);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.hu-dashboard-layout {
|
|
269
|
+
min-height: 100dvh; display: grid; color: var(--hu-text); background: var(--hu-bg-2);
|
|
270
|
+
grid-template-areas:
|
|
271
|
+
"sidebar header"
|
|
272
|
+
"sidebar main";
|
|
273
|
+
grid-template-columns: var(--hu-dashboard-sidebar, 280px) minmax(0, 1fr);
|
|
274
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
275
|
+
}
|
|
276
|
+
.hu-dashboard-layout--collapsed { grid-template-columns: var(--hu-dashboard-sidebar-collapsed, 72px) minmax(0, 1fr); }
|
|
277
|
+
.hu-dashboard-layout__header {
|
|
278
|
+
grid-area: header; min-width: 0; position: sticky; inset-block-start: 0;
|
|
279
|
+
z-index: var(--hu-z-sticky); background: var(--hu-bg);
|
|
280
|
+
border-block-end: 1px solid var(--hu-border);
|
|
281
|
+
}
|
|
282
|
+
.hu-dashboard-layout__sidebar {
|
|
283
|
+
grid-area: sidebar; min-width: 0; min-height: 0; overflow: auto;
|
|
284
|
+
background: var(--hu-bg); border-inline-end: 1px solid var(--hu-border);
|
|
285
|
+
}
|
|
286
|
+
.hu-dashboard-layout__main {
|
|
287
|
+
grid-area: main; min-width: 0; min-height: 0; overflow: auto;
|
|
288
|
+
padding: var(--hu-dashboard-padding, var(--hu-space-6));
|
|
289
|
+
}
|
|
290
|
+
.hu-dashboard-layout__aside {
|
|
291
|
+
border-inline-start: 1px solid var(--hu-border); background: var(--hu-bg);
|
|
292
|
+
min-width: 0; overflow: auto;
|
|
293
|
+
}
|
|
294
|
+
.hu-dashboard-layout--with-aside {
|
|
295
|
+
grid-template-areas:
|
|
296
|
+
"sidebar header header"
|
|
297
|
+
"sidebar main aside";
|
|
298
|
+
grid-template-columns: var(--hu-dashboard-sidebar, 280px) minmax(0, 1fr) var(--hu-dashboard-aside, 320px);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.hu-split-pane {
|
|
302
|
+
display: grid; min-width: 0; min-height: 0; overflow: hidden;
|
|
303
|
+
background: var(--hu-bg); border: 1px solid var(--hu-border);
|
|
304
|
+
border-radius: var(--hu-radius-md);
|
|
305
|
+
}
|
|
306
|
+
.hu-split-pane--horizontal { grid-template-columns: minmax(0, var(--hu-split-primary, 50%)) auto minmax(0, 1fr); }
|
|
307
|
+
.hu-split-pane--vertical { grid-template-rows: minmax(0, var(--hu-split-primary, 50%)) auto minmax(0, 1fr); }
|
|
308
|
+
.hu-split-pane__pane { min-width: 0; min-height: 0; overflow: auto; }
|
|
309
|
+
.hu-split-pane__separator {
|
|
310
|
+
display: flex; align-items: center; justify-content: center;
|
|
311
|
+
background: var(--hu-bg-3); color: var(--hu-text-3); flex: none;
|
|
312
|
+
}
|
|
313
|
+
.hu-split-pane__separator--horizontal {
|
|
314
|
+
width: var(--hu-split-handle, 8px); cursor: col-resize; border-inline: 1px solid var(--hu-border);
|
|
315
|
+
}
|
|
316
|
+
.hu-split-pane__separator--vertical {
|
|
317
|
+
height: var(--hu-split-handle, 8px); cursor: row-resize; border-block: 1px solid var(--hu-border);
|
|
318
|
+
}
|
|
319
|
+
.hu-split-pane__separator:focus-visible { outline: 2px solid var(--hu-primary); outline-offset: -2px; }
|
|
320
|
+
|
|
321
|
+
.hu-resizable-panel {
|
|
322
|
+
min-width: var(--hu-panel-min-width, 160px); max-width: var(--hu-panel-max-width, none);
|
|
323
|
+
min-height: var(--hu-panel-min-height, 120px); max-height: var(--hu-panel-max-height, none);
|
|
324
|
+
width: var(--hu-panel-width, auto); height: var(--hu-panel-height, auto);
|
|
325
|
+
resize: var(--hu-panel-resize, both); overflow: auto;
|
|
326
|
+
background: var(--hu-bg); border: 1px solid var(--hu-border);
|
|
327
|
+
border-radius: var(--hu-radius-md);
|
|
328
|
+
}
|
|
329
|
+
.hu-resizable-panel__header {
|
|
330
|
+
display: flex; align-items: center; justify-content: space-between; gap: var(--hu-space-3);
|
|
331
|
+
padding: var(--hu-space-3) var(--hu-space-4); border-block-end: 1px solid var(--hu-border);
|
|
332
|
+
font-size: var(--hu-font-size-sm); font-weight: var(--hu-font-weight-semibold);
|
|
333
|
+
}
|
|
334
|
+
.hu-resizable-panel__body { padding: var(--hu-space-4); min-width: 0; }
|
|
335
|
+
|
|
336
|
+
@media (max-width: 768px) {
|
|
337
|
+
.hu-page-layout__main { padding: var(--hu-space-4); }
|
|
338
|
+
.hu-dashboard-layout,
|
|
339
|
+
.hu-dashboard-layout--with-aside {
|
|
340
|
+
grid-template-areas:
|
|
341
|
+
"header"
|
|
342
|
+
"main";
|
|
343
|
+
grid-template-columns: minmax(0, 1fr);
|
|
344
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
345
|
+
}
|
|
346
|
+
.hu-dashboard-layout__sidebar,
|
|
347
|
+
.hu-dashboard-layout__aside { display: none; }
|
|
348
|
+
.hu-dashboard-layout__main { padding: var(--hu-space-4); }
|
|
349
|
+
.hu-split-pane--horizontal { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
|
|
350
|
+
.hu-split-pane--horizontal .hu-split-pane__separator { width: auto; height: var(--hu-split-handle, 8px); cursor: row-resize; border-inline: 0; border-block: 1px solid var(--hu-border); }
|
|
351
|
+
}
|
|
352
|
+
`;
|
|
353
|
+
export function PageLayout(props) {
|
|
354
|
+
injectCSS("hu-enterprise-layout", ENTERPRISE_LAYOUT_CSS);
|
|
355
|
+
const styles = [];
|
|
356
|
+
if (props.maxWidth !== undefined)
|
|
357
|
+
styles.push(`--hu-page-max:${toCssUnit(props.maxWidth)}`);
|
|
358
|
+
if (props.padding !== undefined)
|
|
359
|
+
styles.push(`--hu-page-padding:${toCssUnit(props.padding)}`);
|
|
360
|
+
return h("div", {
|
|
361
|
+
class: cn("hu-page-layout", props.contained && "hu-page-layout--contained", props.class),
|
|
362
|
+
style: styles.join(";") || undefined
|
|
363
|
+
}, props.header && h("header", {
|
|
364
|
+
class: cn("hu-page-layout__header", props.stickyHeader && "hu-page-layout__header--sticky")
|
|
365
|
+
}, props.header), h("main", { class: "hu-page-layout__main" }, props.children), props.footer && h("footer", { class: "hu-page-layout__footer" }, props.footer));
|
|
366
|
+
}
|
|
367
|
+
export function DashboardLayout(props) {
|
|
368
|
+
injectCSS("hu-enterprise-layout", ENTERPRISE_LAYOUT_CSS);
|
|
369
|
+
const styles = [];
|
|
370
|
+
if (props.sidebarWidth !== undefined)
|
|
371
|
+
styles.push(`--hu-dashboard-sidebar:${toCssUnit(props.sidebarWidth)}`);
|
|
372
|
+
if (props.collapsedSidebarWidth !== undefined)
|
|
373
|
+
styles.push(`--hu-dashboard-sidebar-collapsed:${toCssUnit(props.collapsedSidebarWidth)}`);
|
|
374
|
+
if (props.asideWidth !== undefined)
|
|
375
|
+
styles.push(`--hu-dashboard-aside:${toCssUnit(props.asideWidth)}`);
|
|
376
|
+
if (props.padding !== undefined)
|
|
377
|
+
styles.push(`--hu-dashboard-padding:${toCssUnit(props.padding)}`);
|
|
378
|
+
return h("div", {
|
|
379
|
+
class: cn("hu-dashboard-layout", props.collapsed && "hu-dashboard-layout--collapsed", props.aside != null && "hu-dashboard-layout--with-aside", props.class),
|
|
380
|
+
style: styles.join(";") || undefined
|
|
381
|
+
}, props.header && h("header", { class: "hu-dashboard-layout__header" }, props.header), props.sidebar && h("aside", { class: "hu-dashboard-layout__sidebar", "aria-label": "Primary navigation" }, props.sidebar), h("main", { class: "hu-dashboard-layout__main" }, props.children), props.aside && h("aside", { class: "hu-dashboard-layout__aside", "aria-label": "Secondary panel" }, props.aside));
|
|
382
|
+
}
|
|
383
|
+
export function SplitPane(props) {
|
|
384
|
+
injectCSS("hu-enterprise-layout", ENTERPRISE_LAYOUT_CSS);
|
|
385
|
+
const orientation = props.orientation ?? "horizontal";
|
|
386
|
+
const style = props.primarySize !== undefined
|
|
387
|
+
? `--hu-split-primary:${toCssUnit(props.primarySize)}`
|
|
388
|
+
: undefined;
|
|
389
|
+
return h("div", {
|
|
390
|
+
class: cn("hu-split-pane", `hu-split-pane--${orientation}`, props.class),
|
|
391
|
+
style
|
|
392
|
+
}, h("div", { class: "hu-split-pane__pane" }, props.start), h("div", {
|
|
393
|
+
class: cn("hu-split-pane__separator", `hu-split-pane__separator--${orientation}`),
|
|
394
|
+
role: "separator",
|
|
395
|
+
tabindex: "0",
|
|
396
|
+
"aria-orientation": orientation === "horizontal" ? "vertical" : "horizontal",
|
|
397
|
+
"aria-label": props.separatorLabel ?? "Resize panels"
|
|
398
|
+
}), h("div", { class: "hu-split-pane__pane" }, props.end));
|
|
399
|
+
}
|
|
400
|
+
export function ResizablePanel(props) {
|
|
401
|
+
injectCSS("hu-enterprise-layout", ENTERPRISE_LAYOUT_CSS);
|
|
402
|
+
const styles = [];
|
|
403
|
+
if (props.width !== undefined)
|
|
404
|
+
styles.push(`--hu-panel-width:${toCssUnit(props.width)}`);
|
|
405
|
+
if (props.height !== undefined)
|
|
406
|
+
styles.push(`--hu-panel-height:${toCssUnit(props.height)}`);
|
|
407
|
+
if (props.minWidth !== undefined)
|
|
408
|
+
styles.push(`--hu-panel-min-width:${toCssUnit(props.minWidth)}`);
|
|
409
|
+
if (props.maxWidth !== undefined)
|
|
410
|
+
styles.push(`--hu-panel-max-width:${toCssUnit(props.maxWidth)}`);
|
|
411
|
+
if (props.minHeight !== undefined)
|
|
412
|
+
styles.push(`--hu-panel-min-height:${toCssUnit(props.minHeight)}`);
|
|
413
|
+
if (props.maxHeight !== undefined)
|
|
414
|
+
styles.push(`--hu-panel-max-height:${toCssUnit(props.maxHeight)}`);
|
|
415
|
+
styles.push(`--hu-panel-resize:${props.resize ?? "both"}`);
|
|
416
|
+
return h("section", {
|
|
417
|
+
class: cn("hu-resizable-panel", props.class),
|
|
418
|
+
style: styles.join(";")
|
|
419
|
+
}, (props.title || props.actions) && h("div", { class: "hu-resizable-panel__header" }, h("div", {}, props.title), props.actions && h("div", {}, props.actions)), h("div", { class: "hu-resizable-panel__body" }, props.children));
|
|
420
|
+
}
|
|
421
|
+
function toCssUnit(value) {
|
|
422
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
423
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HyperUI Typography Components
|
|
3
|
+
* Typography · Chip · Divider · Link · AvatarGroup
|
|
4
|
+
*/
|
|
5
|
+
import { type VNode } from "../theme/index.js";
|
|
6
|
+
export type TypographyVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "overline" | "inherit";
|
|
7
|
+
export type TypographyColor = "primary" | "secondary" | "error" | "warning" | "info" | "success";
|
|
8
|
+
export type TypographyAlign = "left" | "center" | "right" | "justify";
|
|
9
|
+
export interface TypographyProps {
|
|
10
|
+
variant?: TypographyVariant;
|
|
11
|
+
component?: string;
|
|
12
|
+
color?: TypographyColor;
|
|
13
|
+
align?: TypographyAlign;
|
|
14
|
+
gutterBottom?: boolean;
|
|
15
|
+
noWrap?: boolean;
|
|
16
|
+
paragraph?: boolean;
|
|
17
|
+
class?: string;
|
|
18
|
+
children?: unknown;
|
|
19
|
+
}
|
|
20
|
+
export declare function Typography(props: TypographyProps): VNode;
|
|
21
|
+
export type ChipColor = "default" | "primary" | "secondary" | "error" | "warning" | "info" | "success";
|
|
22
|
+
export type ChipVariant = "filled" | "outlined";
|
|
23
|
+
export type ChipSize = "sm" | "md" | "lg";
|
|
24
|
+
export interface ChipProps {
|
|
25
|
+
label: string;
|
|
26
|
+
color?: ChipColor;
|
|
27
|
+
variant?: ChipVariant;
|
|
28
|
+
size?: ChipSize;
|
|
29
|
+
icon?: unknown;
|
|
30
|
+
avatar?: string;
|
|
31
|
+
onDelete?: () => void;
|
|
32
|
+
onClick?: (e: MouseEvent) => void;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
class?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function Chip(props: ChipProps): VNode;
|
|
37
|
+
export type DividerOrientation = "horizontal" | "vertical";
|
|
38
|
+
export type DividerTextAlign = "left" | "center" | "right";
|
|
39
|
+
export interface DividerProps {
|
|
40
|
+
orientation?: DividerOrientation;
|
|
41
|
+
variant?: "fullWidth" | "inset" | "middle";
|
|
42
|
+
textAlign?: DividerTextAlign;
|
|
43
|
+
dashed?: boolean;
|
|
44
|
+
class?: string;
|
|
45
|
+
children?: unknown;
|
|
46
|
+
}
|
|
47
|
+
export declare function Divider(props: DividerProps): VNode;
|
|
48
|
+
export type LinkColor = "primary" | "inherit" | "secondary" | "error";
|
|
49
|
+
export type LinkUnderline = "none" | "hover" | "always";
|
|
50
|
+
export interface LinkProps {
|
|
51
|
+
href?: string;
|
|
52
|
+
target?: string;
|
|
53
|
+
rel?: string;
|
|
54
|
+
color?: LinkColor;
|
|
55
|
+
underline?: LinkUnderline;
|
|
56
|
+
component?: string;
|
|
57
|
+
onClick?: (e: MouseEvent) => void;
|
|
58
|
+
class?: string;
|
|
59
|
+
children?: unknown;
|
|
60
|
+
}
|
|
61
|
+
export declare function Link(props: LinkProps): VNode;
|
|
62
|
+
export interface AvatarGroupProps {
|
|
63
|
+
max?: number;
|
|
64
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
65
|
+
class?: string;
|
|
66
|
+
children?: unknown[];
|
|
67
|
+
}
|
|
68
|
+
export declare function AvatarGroup(props: AvatarGroupProps): VNode;
|
|
69
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/components/typography.ts"],"names":[],"mappings":"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"}
|