@hyperpackai/hyperui 0.2.0 → 0.3.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/README.md +13 -0
- package/dist/components/Accordion/index.d.ts +6 -0
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +65 -9
- package/dist/components/Autocomplete/index.d.ts +12 -2
- package/dist/components/Autocomplete/index.d.ts.map +1 -1
- package/dist/components/Autocomplete/index.js +148 -24
- package/dist/components/Backdrop/index.d.ts +2 -1
- package/dist/components/Backdrop/index.d.ts.map +1 -1
- package/dist/components/Backdrop/index.js +6 -3
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +6 -2
- package/dist/components/DashboardLayout/index.d.ts +13 -0
- package/dist/components/DashboardLayout/index.d.ts.map +1 -1
- package/dist/components/DashboardLayout/index.js +50 -7
- package/dist/components/DataTable/index.d.ts +43 -0
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/index.js +126 -21
- package/dist/components/Dialog/index.d.ts +9 -3
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +46 -30
- package/dist/components/Drawer/index.d.ts +11 -3
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +66 -11
- package/dist/components/DropdownMenu/index.d.ts +5 -3
- package/dist/components/DropdownMenu/index.d.ts.map +1 -1
- package/dist/components/DropdownMenu/index.js +56 -13
- package/dist/components/FocusTrap/index.d.ts.map +1 -1
- package/dist/components/FocusTrap/index.js +34 -32
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +18 -4
- package/dist/components/Menu/index.d.ts +6 -2
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +50 -15
- package/dist/components/Modal/index.d.ts +3 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +27 -9
- package/dist/components/NestedNavbar/index.d.ts +33 -0
- package/dist/components/NestedNavbar/index.d.ts.map +1 -0
- package/dist/components/NestedNavbar/index.js +435 -0
- package/dist/components/NestedSidebar/index.d.ts +48 -0
- package/dist/components/NestedSidebar/index.d.ts.map +1 -0
- package/dist/components/NestedSidebar/index.js +368 -0
- package/dist/components/Popover/index.d.ts +11 -3
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +45 -9
- package/dist/components/Radio/index.d.ts +26 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Radio/index.js +61 -2
- package/dist/components/Select/index.d.ts +5 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +22 -5
- package/dist/components/Sheet/index.d.ts +9 -3
- package/dist/components/Sheet/index.d.ts.map +1 -1
- package/dist/components/Sheet/index.js +48 -23
- package/dist/components/Sidebar/index.d.ts +20 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +285 -8
- package/dist/components/SpeedDial/index.d.ts +10 -0
- package/dist/components/SpeedDial/index.d.ts.map +1 -1
- package/dist/components/SpeedDial/index.js +61 -11
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +6 -2
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +47 -8
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/components/TextField/index.js +12 -4
- package/dist/components/Textarea/index.d.ts +5 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +21 -4
- package/dist/components/Transition/index.d.ts +14 -0
- package/dist/components/Transition/index.d.ts.map +1 -0
- package/dist/components/Transition/index.js +49 -0
- package/dist/components/TransitionGroup/index.d.ts +16 -0
- package/dist/components/TransitionGroup/index.d.ts.map +1 -0
- package/dist/components/TransitionGroup/index.js +95 -0
- package/dist/components/data.d.ts +81 -16
- package/dist/components/data.d.ts.map +1 -1
- package/dist/components/data.js +163 -31
- package/dist/components/enterprise.d.ts +85 -26
- package/dist/components/enterprise.d.ts.map +1 -1
- package/dist/components/enterprise.js +211 -36
- package/dist/components/index.d.ts +21 -13
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -2
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.js +3 -0
- package/dist/theme/index.d.ts +5 -6
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +30 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +11 -0
- package/package.json +6 -1
|
@@ -24,7 +24,14 @@ const SELECT_CSS = `
|
|
|
24
24
|
`;
|
|
25
25
|
export function Select(props) {
|
|
26
26
|
injectCSS("hu-select", SELECT_CSS);
|
|
27
|
-
const { options, placeholder, error, label, size = "md", id, ...
|
|
27
|
+
const { options, placeholder, error, helper, label, size = "md", id, class: className, onChange, onValueChange, ...selectProps } = props;
|
|
28
|
+
const handleChange = (event) => {
|
|
29
|
+
onChange?.(event);
|
|
30
|
+
onValueChange?.(event.target.value, event);
|
|
31
|
+
};
|
|
32
|
+
const helperId = id && helper && !error ? `${id}-helper` : undefined;
|
|
33
|
+
const errorId = id && error ? `${id}-error` : undefined;
|
|
34
|
+
const describedBy = [props["aria-describedby"], errorId, helperId].filter(Boolean).join(" ") || undefined;
|
|
28
35
|
const groups = new Map();
|
|
29
36
|
const ungrouped = [];
|
|
30
37
|
for (const opt of options) {
|
|
@@ -44,9 +51,19 @@ export function Select(props) {
|
|
|
44
51
|
for (const [groupLabel, groupOpts] of groups) {
|
|
45
52
|
children.push(h("optgroup", { label: groupLabel }, ...renderOptions(groupOpts)));
|
|
46
53
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
const arrowIcon = h("svg", {
|
|
55
|
+
viewBox: "0 0 16 16",
|
|
56
|
+
fill: "none",
|
|
57
|
+
stroke: "currentColor",
|
|
58
|
+
"stroke-width": "1.5",
|
|
59
|
+
"aria-hidden": "true"
|
|
60
|
+
}, h("path", { d: "M4 6l4 4 4-4" }));
|
|
61
|
+
return h("div", { class: cn("hu-select-wrap", className) }, label && Label({ for: id, required: props.required, children: label }), h("div", { class: "hu-select-field" }, h("select", {
|
|
62
|
+
...selectProps,
|
|
63
|
+
id,
|
|
64
|
+
onChange: handleChange,
|
|
65
|
+
"aria-invalid": error ? "true" : undefined,
|
|
66
|
+
"aria-describedby": describedBy,
|
|
50
67
|
class: cn("hu-select", size !== "md" && `hu-select--${size}`, error && "hu-select--error")
|
|
51
|
-
}, ...children), h("span", { class: "hu-select-arrow",
|
|
68
|
+
}, ...children), h("span", { class: "hu-select-arrow", "aria-hidden": "true" }, arrowIcon)), error && h("span", { id: errorId, class: "hu-input-error-msg", role: "alert" }, error), !error && helper && h("span", { id: helperId, class: "hu-input-helper" }, helper));
|
|
52
69
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { type Signal } from "@hyperpackai/hyperion";
|
|
2
2
|
import { type VNode } from "../../theme/index.js";
|
|
3
3
|
export interface SheetProps {
|
|
4
|
-
open
|
|
4
|
+
open?: boolean | Signal<boolean>;
|
|
5
|
+
defaultOpen?: boolean;
|
|
5
6
|
side?: "right" | "left" | "top" | "bottom";
|
|
6
7
|
title?: string;
|
|
7
8
|
footer?: unknown;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
closeIcon?: unknown;
|
|
10
|
+
closeButton?: unknown | SheetCloseButtonRenderer;
|
|
11
|
+
onClose?: (reason?: SheetCloseReason) => void;
|
|
12
|
+
onOpenChange?: (open: boolean, reason?: SheetCloseReason) => void;
|
|
10
13
|
closeOnBackdrop?: boolean;
|
|
14
|
+
closeOnEscape?: boolean;
|
|
11
15
|
children?: unknown;
|
|
12
16
|
class?: string;
|
|
13
17
|
}
|
|
18
|
+
export type SheetCloseReason = "backdrop" | "escape" | "close-button";
|
|
19
|
+
export type SheetCloseButtonRenderer = (close: (reason?: SheetCloseReason) => void) => unknown;
|
|
14
20
|
export declare function Sheet(props: SheetProps): VNode;
|
|
15
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAiCpE,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,GAAG,wBAAwB,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,KAAK,IAAI,KAAK,OAAO,CAAC;AAE/F,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,CAoD9C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { signal } from "@hyperpackai/hyperion";
|
|
1
2
|
import { injectCSS, cn, h } from "../../theme/index.js";
|
|
2
3
|
import { renderInPortal } from "../../portal.js";
|
|
3
4
|
import { FocusTrap } from "../FocusTrap/index.js";
|
|
@@ -31,31 +32,55 @@ const SHEET_CSS = `
|
|
|
31
32
|
`;
|
|
32
33
|
export function Sheet(props) {
|
|
33
34
|
injectCSS("hu-sheet", SHEET_CSS);
|
|
34
|
-
const { side = "right", title, footer, onClose, onOpenChange, closeOnBackdrop = true, children } = props;
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
const { side = "right", title, footer, onClose, onOpenChange, closeOnBackdrop = true, closeOnEscape = true, children } = props;
|
|
36
|
+
const uncontrolledOpen = signal(props.defaultOpen ?? false);
|
|
37
|
+
const isSignalOpen = typeof props.open === "object" && props.open != null && "peek" in props.open;
|
|
38
|
+
const isControlled = typeof props.open === "boolean" || isSignalOpen;
|
|
39
|
+
const isOpen = () => {
|
|
40
|
+
if (typeof props.open === "boolean")
|
|
41
|
+
return props.open;
|
|
42
|
+
if (isSignalOpen)
|
|
43
|
+
return props.open.value;
|
|
44
|
+
return uncontrolledOpen.value;
|
|
45
|
+
};
|
|
46
|
+
const close = (reason = "close-button") => {
|
|
47
|
+
if (!isControlled)
|
|
48
|
+
uncontrolledOpen.value = false;
|
|
49
|
+
if (isSignalOpen)
|
|
50
|
+
props.open.value = false;
|
|
51
|
+
onOpenChange?.(false, reason);
|
|
52
|
+
onClose?.(reason);
|
|
53
|
+
};
|
|
54
|
+
const closeIcon = props.closeIcon ?? h("svg", {
|
|
55
|
+
viewBox: "0 0 16 16",
|
|
56
|
+
width: "16",
|
|
57
|
+
height: "16",
|
|
58
|
+
fill: "none",
|
|
59
|
+
stroke: "currentColor",
|
|
60
|
+
"stroke-width": "2",
|
|
61
|
+
"aria-hidden": "true"
|
|
62
|
+
}, h("path", { d: "M2 2l12 12M14 2L2 14" }));
|
|
63
|
+
const showDefaultClose = props.closeButton === undefined && Boolean(title || onClose || onOpenChange || isSignalOpen || !isControlled);
|
|
64
|
+
const showCloseButton = props.closeButton !== null && (props.closeButton !== undefined || showDefaultClose);
|
|
42
65
|
const renderSheet = () => renderInPortal(h("div", {}, h("div", {
|
|
43
66
|
class: "hu-sheet-backdrop",
|
|
44
|
-
onClick: closeOnBackdrop ? () =>
|
|
45
|
-
|
|
46
|
-
onClose?.("backdrop");
|
|
47
|
-
} : undefined
|
|
48
|
-
}), FocusTrap({ active: true, restoreFocus: true, autoFocus: true, children: h("div", { class: cn("hu-sheet", `hu-sheet--${side}`, props.class), role: "dialog", "aria-modal": "true" }, title && h("div", { class: "hu-sheet-header" }, h("h2", { class: "hu-sheet-title" }, title), h("button", {
|
|
49
|
-
class: "hu-sheet-close",
|
|
50
|
-
onClick: () => {
|
|
51
|
-
onOpenChange?.(false, "close-button");
|
|
52
|
-
onClose?.("close-button");
|
|
53
|
-
},
|
|
54
|
-
"aria-label": "Close",
|
|
55
|
-
innerHTML: closeSVG
|
|
56
|
-
})), h("div", { class: "hu-sheet-body" }, children), footer && h("div", { class: "hu-sheet-footer" }, footer))
|
|
67
|
+
onClick: closeOnBackdrop ? () => close("backdrop") : undefined
|
|
68
|
+
}), FocusTrap({ active: true, restoreFocus: true, autoFocus: true, onEscape: closeOnEscape ? () => close("escape") : undefined, children: h("div", { class: cn("hu-sheet", `hu-sheet--${side}`, props.class), role: "dialog", "aria-modal": "true" }, (title || showCloseButton) && h("div", { class: "hu-sheet-header" }, title && h("h2", { class: "hu-sheet-title" }, title), showCloseButton && renderSheetCloseButton(props.closeButton, close, closeIcon)), h("div", { class: "hu-sheet-body" }, children), footer && h("div", { class: "hu-sheet-footer" }, footer))
|
|
57
69
|
})), "sheet");
|
|
58
|
-
if (
|
|
59
|
-
return renderSheet();
|
|
70
|
+
if (isControlled && typeof props.open === "boolean") {
|
|
71
|
+
return isOpen() ? renderSheet() : h("span", { "aria-hidden": "true" });
|
|
72
|
+
}
|
|
60
73
|
return (() => isOpen() ? renderSheet() : h("span", { "aria-hidden": "true" }));
|
|
61
74
|
}
|
|
75
|
+
function renderSheetCloseButton(closeButton, close, closeIcon) {
|
|
76
|
+
if (typeof closeButton === "function")
|
|
77
|
+
return closeButton(close);
|
|
78
|
+
if (closeButton != null)
|
|
79
|
+
return closeButton;
|
|
80
|
+
return h("button", {
|
|
81
|
+
type: "button",
|
|
82
|
+
class: "hu-sheet-close",
|
|
83
|
+
onClick: () => close("close-button"),
|
|
84
|
+
"aria-label": "Close"
|
|
85
|
+
}, closeIcon);
|
|
86
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Signal } from "@hyperpackai/hyperion";
|
|
1
2
|
import { type VNode } from "../../theme/index.js";
|
|
2
3
|
export interface SidebarItem {
|
|
3
4
|
id: string;
|
|
@@ -5,18 +6,36 @@ export interface SidebarItem {
|
|
|
5
6
|
icon?: unknown;
|
|
6
7
|
badge?: unknown;
|
|
7
8
|
href?: string;
|
|
8
|
-
active?: boolean;
|
|
9
|
+
active?: boolean | Signal<boolean> | (() => boolean);
|
|
9
10
|
onClick?: () => void;
|
|
10
11
|
}
|
|
11
12
|
export interface SidebarSection {
|
|
12
13
|
label?: string;
|
|
13
14
|
items: SidebarItem[];
|
|
14
15
|
}
|
|
16
|
+
export type SidebarMobileMode = "top" | "side";
|
|
17
|
+
export type SidebarPosition = "static" | "sticky" | "fixed";
|
|
18
|
+
export type SidebarCloseReason = "backdrop" | "close-button" | "item-select" | "escape" | "programmatic" | "trigger";
|
|
19
|
+
export type SidebarCloseButtonRenderer = (close: (reason?: SidebarCloseReason) => void) => unknown;
|
|
15
20
|
export interface SidebarProps {
|
|
16
21
|
header?: unknown;
|
|
17
22
|
sections: SidebarSection[];
|
|
18
23
|
footer?: unknown;
|
|
19
24
|
width?: "sm" | "md" | "lg";
|
|
25
|
+
position?: SidebarPosition;
|
|
26
|
+
topOffset?: string | number;
|
|
27
|
+
height?: string | number;
|
|
28
|
+
responsive?: boolean;
|
|
29
|
+
mobileMode?: SidebarMobileMode;
|
|
30
|
+
menuLabel?: string;
|
|
31
|
+
menuIcon?: unknown;
|
|
32
|
+
drawerTitle?: string;
|
|
33
|
+
closeIcon?: unknown;
|
|
34
|
+
closeButton?: unknown | SidebarCloseButtonRenderer;
|
|
35
|
+
open?: boolean | Signal<boolean>;
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
onOpenChange?: (open: boolean, reason?: SidebarCloseReason) => void;
|
|
38
|
+
onClose?: (reason: SidebarCloseReason) => void;
|
|
20
39
|
class?: string;
|
|
21
40
|
}
|
|
22
41
|
export declare function Sidebar(props: SidebarProps): VNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA0LpE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAAG,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAC;CAAE;AAEzE,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,CAAC;AAC/C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;AACrH,MAAM,MAAM,0BAA0B,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,kBAAkB,KAAK,IAAI,KAAK,OAAO,CAAC;AAEnG,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,GAAG,0BAA0B,CAAC;IACnD,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpE,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,CAwIlD"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
import { signal } from "@hyperpackai/hyperion";
|
|
1
2
|
import { injectCSS, cn, h } from "../../theme/index.js";
|
|
2
3
|
const SIDEBAR_CSS = `
|
|
3
4
|
.hu-sidebar {
|
|
5
|
+
--hu-sidebar-width: 260px;
|
|
6
|
+
--hu-sidebar-top: 0px;
|
|
7
|
+
--hu-sidebar-height: 100vh;
|
|
4
8
|
display: flex; flex-direction: column; height: 100vh; overflow: hidden;
|
|
9
|
+
width: var(--hu-sidebar-width); min-width: var(--hu-sidebar-width);
|
|
5
10
|
background: linear-gradient(180deg, var(--hu-bg), color-mix(in srgb, var(--hu-bg-2) 64%, var(--hu-bg)));
|
|
6
11
|
border-right: 1px solid color-mix(in srgb, var(--hu-border) 82%, transparent);
|
|
7
12
|
position: sticky; top: 0;
|
|
8
13
|
}
|
|
9
|
-
.hu-sidebar--sm {
|
|
10
|
-
.hu-sidebar--md {
|
|
11
|
-
.hu-sidebar--lg {
|
|
14
|
+
.hu-sidebar--sm { --hu-sidebar-width: 220px; }
|
|
15
|
+
.hu-sidebar--md { --hu-sidebar-width: 260px; }
|
|
16
|
+
.hu-sidebar--lg { --hu-sidebar-width: 300px; }
|
|
17
|
+
.hu-sidebar--static { position: relative; top: auto; height: var(--hu-sidebar-height); }
|
|
18
|
+
.hu-sidebar--sticky { position: sticky; top: var(--hu-sidebar-top); height: var(--hu-sidebar-height); }
|
|
19
|
+
.hu-sidebar--fixed { position: fixed; top: var(--hu-sidebar-top); left: 0; bottom: 0; height: var(--hu-sidebar-height); }
|
|
12
20
|
.hu-sidebar-header { padding: var(--hu-space-4) var(--hu-space-4) var(--hu-space-3); border-bottom: 1px solid var(--hu-border); }
|
|
13
21
|
.hu-sidebar-nav { flex: 1; overflow-y: auto; padding: var(--hu-space-2); scrollbar-width: thin; }
|
|
14
22
|
.hu-sidebar-section { margin-bottom: var(--hu-space-4); }
|
|
@@ -24,14 +32,283 @@ const SIDEBAR_CSS = `
|
|
|
24
32
|
.hu-sidebar-item:focus-visible { outline: 2px solid var(--hu-primary); outline-offset: 2px; }
|
|
25
33
|
.hu-sidebar-item--active { background: var(--hu-primary-bg); color: var(--hu-primary); box-shadow: inset 3px 0 0 var(--hu-primary); }
|
|
26
34
|
.hu-sidebar-item-icon { width: 18px; height: 18px; flex-shrink: 0; }
|
|
35
|
+
.hu-sidebar-item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
27
36
|
.hu-sidebar-item-badge { margin-left: auto; }
|
|
28
37
|
.hu-sidebar-footer { padding: var(--hu-space-3) var(--hu-space-4); border-top: 1px solid var(--hu-border); background: color-mix(in srgb, var(--hu-bg-2) 62%, transparent); }
|
|
38
|
+
.hu-sidebar-responsive-root { display: contents; }
|
|
39
|
+
.hu-sidebar-mobile-shell { display: none; }
|
|
40
|
+
.hu-sidebar-mobile-bar {
|
|
41
|
+
width: 100%;
|
|
42
|
+
padding: var(--hu-space-2) var(--hu-space-3);
|
|
43
|
+
background: color-mix(in srgb, var(--hu-bg) 92%, transparent);
|
|
44
|
+
border-bottom: 1px solid var(--hu-border);
|
|
45
|
+
}
|
|
46
|
+
.hu-sidebar-menu-button {
|
|
47
|
+
display: inline-flex; align-items: center; justify-content: center; gap: var(--hu-space-2);
|
|
48
|
+
min-height: 44px; max-width: 100%;
|
|
49
|
+
padding: 0 var(--hu-space-3);
|
|
50
|
+
color: var(--hu-text); background: var(--hu-bg);
|
|
51
|
+
border: 1px solid var(--hu-border); border-radius: var(--hu-radius-md);
|
|
52
|
+
box-shadow: var(--hu-shadow-xs);
|
|
53
|
+
font: inherit; font-size: var(--hu-font-size-md); font-weight: var(--hu-font-weight-semibold);
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
transition: border-color var(--hu-duration) var(--hu-ease), box-shadow var(--hu-duration) var(--hu-ease), background var(--hu-duration) var(--hu-ease);
|
|
56
|
+
}
|
|
57
|
+
.hu-sidebar-menu-button:hover { background: var(--hu-bg-2); border-color: var(--hu-border-2); box-shadow: var(--hu-shadow-sm); }
|
|
58
|
+
.hu-sidebar-menu-button:focus-visible { outline: 2px solid var(--hu-primary); outline-offset: 2px; }
|
|
59
|
+
.hu-sidebar-menu-button__icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; }
|
|
60
|
+
.hu-sidebar-menu-button__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
61
|
+
.hu-sidebar-backdrop {
|
|
62
|
+
position: fixed; inset: 0; z-index: var(--hu-z-backdrop);
|
|
63
|
+
background: var(--hu-overlay);
|
|
64
|
+
animation: hu-sidebar-backdrop-in var(--hu-duration-fast) var(--hu-ease);
|
|
65
|
+
}
|
|
66
|
+
.hu-sidebar-mobile-layer[hidden] { display: none !important; }
|
|
67
|
+
.hu-sidebar-drawer {
|
|
68
|
+
position: fixed; z-index: var(--hu-z-modal);
|
|
69
|
+
top: 0; bottom: 0; left: 0;
|
|
70
|
+
width: min(82vw, 320px);
|
|
71
|
+
display: flex; flex-direction: column;
|
|
72
|
+
background: linear-gradient(180deg, var(--hu-bg), color-mix(in srgb, var(--hu-bg-2) 74%, var(--hu-bg)));
|
|
73
|
+
border-right: 1px solid var(--hu-border);
|
|
74
|
+
box-shadow: var(--hu-shadow-xl);
|
|
75
|
+
animation: hu-sidebar-drawer-in var(--hu-duration-slow) var(--hu-ease-out);
|
|
76
|
+
}
|
|
77
|
+
.hu-sidebar-drawer__header {
|
|
78
|
+
display: flex; align-items: center; justify-content: space-between; gap: var(--hu-space-3);
|
|
79
|
+
padding: var(--hu-space-4);
|
|
80
|
+
border-bottom: 1px solid var(--hu-border);
|
|
81
|
+
}
|
|
82
|
+
.hu-sidebar-drawer__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--hu-font-weight-semibold); color: var(--hu-text); }
|
|
83
|
+
.hu-sidebar-drawer__close {
|
|
84
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
85
|
+
width: 34px; height: 34px; flex-shrink: 0;
|
|
86
|
+
padding: 0; color: var(--hu-text-2); background: var(--hu-bg);
|
|
87
|
+
border: 1px solid var(--hu-border); border-radius: var(--hu-radius-md);
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
.hu-sidebar-drawer__close:hover { color: var(--hu-text); background: var(--hu-bg-3); }
|
|
91
|
+
.hu-sidebar-drawer__content { flex: 1; min-height: 0; overflow-y: auto; padding: var(--hu-space-3) 0; }
|
|
92
|
+
.hu-sidebar-drawer__content .hu-sidebar-nav { flex: none; overflow: visible; padding: 0; }
|
|
93
|
+
.hu-sidebar-drawer__content .hu-sidebar-section { margin-bottom: var(--hu-space-4); padding: 0 var(--hu-space-3); }
|
|
94
|
+
.hu-sidebar-drawer__content .hu-sidebar-section + .hu-sidebar-section { padding-top: var(--hu-space-4); border-top: 1px solid var(--hu-border); }
|
|
95
|
+
.hu-sidebar-drawer__content .hu-sidebar-item { min-height: 44px; border-radius: var(--hu-radius-md); }
|
|
96
|
+
.hu-sidebar-drawer__footer { border-top: 1px solid var(--hu-border); background: color-mix(in srgb, var(--hu-bg-2) 62%, transparent); }
|
|
97
|
+
@keyframes hu-sidebar-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
|
|
98
|
+
@keyframes hu-sidebar-drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
|
|
99
|
+
|
|
100
|
+
@media (max-width: 1024px) {
|
|
101
|
+
.hu-sidebar--responsive {
|
|
102
|
+
--hu-sidebar-width: clamp(208px, 24vw, 232px);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.hu-sidebar--responsive .hu-sidebar-header {
|
|
106
|
+
padding: var(--hu-space-3);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.hu-sidebar--responsive .hu-sidebar-item {
|
|
110
|
+
min-height: 40px;
|
|
111
|
+
padding-inline: var(--hu-space-2);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-side {
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.hu-sidebar-responsive-root {
|
|
119
|
+
display: block;
|
|
120
|
+
width: 100%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.hu-sidebar-mobile-shell {
|
|
124
|
+
display: block;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.hu-sidebar-mobile-bar {
|
|
128
|
+
position: sticky;
|
|
129
|
+
top: var(--hu-sidebar-top);
|
|
130
|
+
z-index: var(--hu-z-sticky);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (max-width: 700px) {
|
|
135
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top {
|
|
136
|
+
position: relative;
|
|
137
|
+
top: auto;
|
|
138
|
+
width: 100%;
|
|
139
|
+
min-width: 0;
|
|
140
|
+
height: auto;
|
|
141
|
+
max-height: none;
|
|
142
|
+
border-right: 0;
|
|
143
|
+
border-bottom: 1px solid color-mix(in srgb, var(--hu-border) 82%, transparent);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top .hu-sidebar-header,
|
|
147
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top .hu-sidebar-footer {
|
|
148
|
+
padding: var(--hu-space-3);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top .hu-sidebar-nav {
|
|
152
|
+
flex: none;
|
|
153
|
+
display: flex;
|
|
154
|
+
gap: var(--hu-space-2);
|
|
155
|
+
overflow-x: auto;
|
|
156
|
+
overflow-y: hidden;
|
|
157
|
+
padding: var(--hu-space-2) var(--hu-space-3);
|
|
158
|
+
scroll-snap-type: x proximity;
|
|
159
|
+
-webkit-overflow-scrolling: touch;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top .hu-sidebar-section {
|
|
163
|
+
display: contents;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top .hu-sidebar-section-label {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top .hu-sidebar-item {
|
|
171
|
+
flex: 0 0 auto;
|
|
172
|
+
width: auto;
|
|
173
|
+
min-width: 112px;
|
|
174
|
+
max-width: 176px;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
scroll-snap-align: start;
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.hu-sidebar--responsive.hu-sidebar--mobile-top .hu-sidebar-item--active {
|
|
181
|
+
box-shadow: inset 0 -3px 0 var(--hu-primary);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
}
|
|
29
185
|
`;
|
|
186
|
+
let sidebarId = 0;
|
|
30
187
|
export function Sidebar(props) {
|
|
31
188
|
injectCSS("hu-sidebar", SIDEBAR_CSS);
|
|
32
|
-
const { header, sections, footer, width = "md" } = props;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
189
|
+
const { header, sections, footer, width = "md", position = "sticky", responsive = true, mobileMode = "top" } = props;
|
|
190
|
+
const generatedId = `hu-sidebar-${++sidebarId}`;
|
|
191
|
+
const drawerId = `${generatedId}-drawer`;
|
|
192
|
+
const drawerTitleId = `${generatedId}-drawer-title`;
|
|
193
|
+
const uncontrolledOpen = signal(props.defaultOpen ?? false);
|
|
194
|
+
const isControlled = typeof props.open === "boolean" || (typeof props.open === "object" && props.open != null && "peek" in props.open);
|
|
195
|
+
const isOpen = () => {
|
|
196
|
+
if (typeof props.open === "boolean")
|
|
197
|
+
return props.open;
|
|
198
|
+
if (typeof props.open === "object" && props.open != null && "peek" in props.open)
|
|
199
|
+
return props.open.value;
|
|
200
|
+
return uncontrolledOpen.value;
|
|
201
|
+
};
|
|
202
|
+
const syncMobileDrawer = (open) => {
|
|
203
|
+
if (typeof document === "undefined")
|
|
204
|
+
return;
|
|
205
|
+
if (typeof document.querySelector !== "function")
|
|
206
|
+
return;
|
|
207
|
+
const root = document.querySelector(`[data-hu-sidebar-root="${generatedId}"]`);
|
|
208
|
+
root?.querySelector(".hu-sidebar-menu-button")?.setAttribute("aria-expanded", String(open));
|
|
209
|
+
const layer = root?.querySelector(".hu-sidebar-mobile-layer");
|
|
210
|
+
if (layer) {
|
|
211
|
+
layer.hidden = !open;
|
|
212
|
+
layer.dataset.open = String(open);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const setOpen = (next, reason = "programmatic") => {
|
|
216
|
+
if (!isControlled)
|
|
217
|
+
uncontrolledOpen.value = next;
|
|
218
|
+
if (typeof props.open === "object" && props.open != null && "peek" in props.open)
|
|
219
|
+
props.open.value = next;
|
|
220
|
+
syncMobileDrawer(next);
|
|
221
|
+
props.onOpenChange?.(next, reason);
|
|
222
|
+
};
|
|
223
|
+
const close = (reason) => {
|
|
224
|
+
setOpen(false, reason);
|
|
225
|
+
props.onClose?.(reason);
|
|
226
|
+
};
|
|
227
|
+
const closeFromCustomButton = (reason = "close-button") => close(reason);
|
|
228
|
+
const menuIcon = props.menuIcon ?? h("span", { class: "hu-sidebar-menu-icon-default", "aria-hidden": "true" }, "☰");
|
|
229
|
+
const menuLabel = props.menuLabel ?? "Menu";
|
|
230
|
+
const drawerTitle = props.drawerTitle ?? menuLabel;
|
|
231
|
+
const closeIcon = props.closeIcon ?? h("svg", {
|
|
232
|
+
viewBox: "0 0 16 16",
|
|
233
|
+
width: "16",
|
|
234
|
+
height: "16",
|
|
235
|
+
fill: "none",
|
|
236
|
+
stroke: "currentColor",
|
|
237
|
+
"stroke-width": "2",
|
|
238
|
+
"aria-hidden": "true"
|
|
239
|
+
}, h("path", { d: "M2 2l12 12M14 2L2 14" }));
|
|
240
|
+
const styleValue = [
|
|
241
|
+
props.topOffset !== undefined ? `--hu-sidebar-top:${formatCssSize(props.topOffset)}` : "",
|
|
242
|
+
props.height !== undefined ? `--hu-sidebar-height:${formatCssSize(props.height)}` : "",
|
|
243
|
+
].filter(Boolean).join(";");
|
|
244
|
+
const renderNav = (closeOnSelect) => h("nav", { class: "hu-sidebar-nav", "aria-label": "Sidebar navigation" }, ...sections.map((section, si) => h("div", { key: si, class: "hu-sidebar-section" }, section.label && h("div", { class: "hu-sidebar-section-label" }, section.label), ...section.items.map((item) => {
|
|
245
|
+
const active = () => isSidebarItemActive(item);
|
|
246
|
+
return h(item.href ? "a" : "button", {
|
|
247
|
+
key: item.id,
|
|
248
|
+
class: () => cn("hu-sidebar-item", active() && "hu-sidebar-item--active"),
|
|
249
|
+
href: item.href,
|
|
250
|
+
type: item.href ? undefined : "button",
|
|
251
|
+
onClick: () => {
|
|
252
|
+
item.onClick?.();
|
|
253
|
+
if (closeOnSelect)
|
|
254
|
+
close("item-select");
|
|
255
|
+
},
|
|
256
|
+
title: item.label, "aria-current": () => active() ? "page" : undefined
|
|
257
|
+
}, item.icon && h("span", { class: "hu-sidebar-item-icon", "aria-hidden": "true" }, item.icon), h("span", { class: "hu-sidebar-item-label" }, item.label), item.badge && h("span", { class: "hu-sidebar-item-badge" }, item.badge));
|
|
258
|
+
}))));
|
|
259
|
+
const sidebar = h("aside", {
|
|
260
|
+
class: cn("hu-sidebar", `hu-sidebar--${width}`, `hu-sidebar--${position}`, responsive && "hu-sidebar--responsive", responsive && `hu-sidebar--mobile-${mobileMode}`, props.class),
|
|
261
|
+
style: styleValue || undefined
|
|
262
|
+
}, header && h("div", { class: "hu-sidebar-header" }, header), renderNav(false), footer && h("div", { class: "hu-sidebar-footer" }, footer));
|
|
263
|
+
if (!responsive || mobileMode === "top")
|
|
264
|
+
return sidebar;
|
|
265
|
+
const drawerLayer = h("div", {
|
|
266
|
+
class: "hu-sidebar-mobile-layer",
|
|
267
|
+
hidden: () => !isOpen(),
|
|
268
|
+
"data-open": () => String(isOpen()),
|
|
269
|
+
onKeyDown: (event) => {
|
|
270
|
+
if (event.key === "Escape")
|
|
271
|
+
close("escape");
|
|
272
|
+
}
|
|
273
|
+
}, h("div", { class: "hu-sidebar-backdrop", onClick: () => close("backdrop") }), h("aside", {
|
|
274
|
+
id: drawerId,
|
|
275
|
+
class: "hu-sidebar-drawer",
|
|
276
|
+
role: "dialog",
|
|
277
|
+
"aria-modal": "true",
|
|
278
|
+
"aria-labelledby": drawerTitleId,
|
|
279
|
+
tabindex: "-1"
|
|
280
|
+
}, h("div", { class: "hu-sidebar-drawer__header" }, h("div", { id: drawerTitleId, class: "hu-sidebar-drawer__title" }, drawerTitle), renderCloseButton(props.closeButton, closeFromCustomButton, closeIcon)), h("div", { class: "hu-sidebar-drawer__content" }, renderNav(true)), footer && h("div", { class: "hu-sidebar-drawer__footer" }, footer)));
|
|
281
|
+
return h("div", { class: "hu-sidebar-responsive-root", style: styleValue || undefined, "data-hu-sidebar-root": generatedId }, sidebar, h("div", { class: "hu-sidebar-mobile-shell" }, h("div", { class: "hu-sidebar-mobile-bar" }, h("button", {
|
|
282
|
+
type: "button",
|
|
283
|
+
class: "hu-sidebar-menu-button",
|
|
284
|
+
"aria-label": menuLabel,
|
|
285
|
+
"aria-controls": drawerId,
|
|
286
|
+
"aria-haspopup": "dialog",
|
|
287
|
+
"aria-expanded": () => String(isOpen()),
|
|
288
|
+
onClick: () => setOpen(true, "trigger")
|
|
289
|
+
}, h("span", { class: "hu-sidebar-menu-button__icon", "aria-hidden": "true" }, menuIcon), h("span", { class: "hu-sidebar-menu-button__label" }, menuLabel))), drawerLayer));
|
|
290
|
+
}
|
|
291
|
+
function formatCssSize(value) {
|
|
292
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
293
|
+
}
|
|
294
|
+
function isSidebarItemActive(item) {
|
|
295
|
+
if (typeof item.active === "function")
|
|
296
|
+
return item.active();
|
|
297
|
+
if (typeof item.active === "object" && item.active != null && "peek" in item.active)
|
|
298
|
+
return item.active.value;
|
|
299
|
+
return item.active === true;
|
|
300
|
+
}
|
|
301
|
+
function renderCloseButton(closeButton, close, closeIcon) {
|
|
302
|
+
if (typeof closeButton === "function") {
|
|
303
|
+
return closeButton(close);
|
|
304
|
+
}
|
|
305
|
+
if (closeButton != null) {
|
|
306
|
+
return closeButton;
|
|
307
|
+
}
|
|
308
|
+
return h("button", {
|
|
309
|
+
type: "button",
|
|
310
|
+
class: "hu-sidebar-drawer__close",
|
|
311
|
+
"aria-label": "Close menu",
|
|
312
|
+
onClick: () => close("close-button")
|
|
313
|
+
}, closeIcon);
|
|
37
314
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Signal } from "@hyperpackai/hyperion";
|
|
1
2
|
import { type VNode } from "../../theme/index.js";
|
|
2
3
|
export interface SpeedDialAction {
|
|
3
4
|
icon: unknown;
|
|
@@ -6,12 +7,21 @@ export interface SpeedDialAction {
|
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export type SpeedDialDirection = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
10
|
+
export type SpeedDialPosition = "fixed" | "absolute" | "static";
|
|
11
|
+
export type SpeedDialCloseReason = "backdrop" | "escape" | "action" | "toggle" | "programmatic";
|
|
9
12
|
export interface SpeedDialProps {
|
|
10
13
|
icon?: unknown;
|
|
11
14
|
openIcon?: unknown;
|
|
15
|
+
open?: boolean | Signal<boolean>;
|
|
16
|
+
defaultOpen?: boolean;
|
|
12
17
|
actions: SpeedDialAction[];
|
|
13
18
|
direction?: SpeedDialDirection;
|
|
19
|
+
position?: SpeedDialPosition;
|
|
14
20
|
backdrop?: boolean;
|
|
21
|
+
closeOnBackdrop?: boolean;
|
|
22
|
+
closeOnEscape?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean, reason?: SpeedDialCloseReason) => void;
|
|
24
|
+
onClose?: (reason?: SpeedDialCloseReason) => void;
|
|
15
25
|
ariaLabel: string;
|
|
16
26
|
}
|
|
17
27
|
export declare function SpeedDial(props: SpeedDialProps): VNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SpeedDial/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SpeedDial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA8DpE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;AAC3F,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEhG,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,KAAK,CAyEtD"}
|