@ds-mo/ui 0.2.3 → 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/dist/components/Accordion/Accordion.d.ts +29 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion/index.d.ts +3 -0
- package/dist/components/Accordion/index.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +18 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/index.d.ts +3 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Banner/Banner.d.ts +16 -0
- package/dist/components/Banner/Banner.d.ts.map +1 -0
- package/dist/components/Banner/index.d.ts +3 -0
- package/dist/components/Banner/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +15 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb/index.d.ts +3 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +85 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +26 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup/index.d.ts +3 -0
- package/dist/components/ButtonGroup/index.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +20 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Divider/Divider.d.ts +9 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/index.d.ts +3 -0
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +9 -0
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState/index.d.ts +3 -0
- package/dist/components/EmptyState/index.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +18 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/index.d.ts +3 -0
- package/dist/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/components/Fade/Fade.d.ts +11 -0
- package/dist/components/Fade/Fade.d.ts.map +1 -0
- package/dist/components/Fade/index.d.ts +3 -0
- package/dist/components/Fade/index.d.ts.map +1 -0
- package/dist/components/Field/Field.d.ts +9 -0
- package/dist/components/Field/Field.d.ts.map +1 -0
- package/dist/components/Field/index.d.ts +3 -0
- package/dist/components/Field/index.d.ts.map +1 -0
- package/dist/components/Header/Header.d.ts +12 -0
- package/dist/components/Header/Header.d.ts.map +1 -0
- package/dist/components/Header/index.d.ts +3 -0
- package/dist/components/Header/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +27 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/LabelWrap/LabelWrap.d.ts +27 -0
- package/dist/components/LabelWrap/LabelWrap.d.ts.map +1 -0
- package/dist/components/LabelWrap/index.d.ts +2 -0
- package/dist/components/LabelWrap/index.d.ts.map +1 -0
- package/dist/components/Loader/Loader.d.ts +33 -0
- package/dist/components/Loader/Loader.d.ts.map +1 -0
- package/dist/components/Loader/index.d.ts +3 -0
- package/dist/components/Loader/index.d.ts.map +1 -0
- package/dist/components/Menu/DestructiveMenuItem.d.ts +12 -0
- package/dist/components/Menu/DestructiveMenuItem.d.ts.map +1 -0
- package/dist/components/Menu/Menu.d.ts +55 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Menu/MenuItem.d.ts +33 -0
- package/dist/components/Menu/MenuItem.d.ts.map +1 -0
- package/dist/components/Menu/index.d.ts +7 -0
- package/dist/components/Menu/index.d.ts.map +1 -0
- package/dist/components/Modal/Modal.d.ts +15 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +16 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/index.d.ts +3 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Radio/Radio.d.ts +35 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Scrollbar/Scrollbar.d.ts +13 -0
- package/dist/components/Scrollbar/Scrollbar.d.ts.map +1 -0
- package/dist/components/Scrollbar/index.d.ts +3 -0
- package/dist/components/Scrollbar/index.d.ts.map +1 -0
- package/dist/components/Select/Select.d.ts +22 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +15 -0
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarItem.d.ts +14 -0
- package/dist/components/Sidebar/SidebarItem.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarSection.d.ts +10 -0
- package/dist/components/Sidebar/SidebarSection.d.ts.map +1 -0
- package/dist/components/Sidebar/index.d.ts +7 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +17 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/Skeleton/index.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +16 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Slider/index.d.ts +3 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Surface/Surface.d.ts +59 -0
- package/dist/components/Surface/Surface.d.ts.map +1 -0
- package/dist/components/Surface/index.d.ts +3 -0
- package/dist/components/Surface/index.d.ts.map +1 -0
- package/dist/components/Tab/Tab.d.ts +21 -0
- package/dist/components/Tab/Tab.d.ts.map +1 -0
- package/dist/components/Tab/index.d.ts +3 -0
- package/dist/components/Tab/index.d.ts.map +1 -0
- package/dist/components/TabGroup/TabGroup.d.ts +26 -0
- package/dist/components/TabGroup/TabGroup.d.ts.map +1 -0
- package/dist/components/TabGroup/index.d.ts +3 -0
- package/dist/components/TabGroup/index.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +46 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Tag/Tag.d.ts +38 -0
- package/dist/components/Tag/Tag.d.ts.map +1 -0
- package/dist/components/Tag/index.d.ts +3 -0
- package/dist/components/Tag/index.d.ts.map +1 -0
- package/dist/components/Text/Text.d.ts +41 -0
- package/dist/components/Text/Text.d.ts.map +1 -0
- package/dist/components/Text/index.d.ts +3 -0
- package/dist/components/Text/index.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts +33 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toggle/Toggle.d.ts +17 -0
- package/dist/components/Toggle/Toggle.d.ts.map +1 -0
- package/dist/components/Toggle/index.d.ts +3 -0
- package/dist/components/Toggle/index.d.ts.map +1 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +35 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts.map +1 -0
- package/dist/components/ToggleButton/index.d.ts +3 -0
- package/dist/components/ToggleButton/index.d.ts.map +1 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +24 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -0
- package/dist/components/ToggleButtonGroup/index.d.ts +3 -0
- package/dist/components/ToggleButtonGroup/index.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +82 -969
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1641 -1165
- package/dist/index.js.map +1 -1
- package/dist/r/badge.json +1 -1
- package/dist/r/banner.json +2 -2
- package/dist/r/loader.json +2 -2
- package/dist/r/menu.json +4 -4
- package/dist/r/select.json +1 -1
- package/dist/r/tab-group.json +1 -1
- package/dist/r/tab.json +1 -1
- package/dist/r/toast.json +1 -1
- package/dist/r/toggle.json +1 -1
- package/dist/types/icons.d.ts +14 -0
- package/dist/types/icons.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/css-tokens.d.ts +11 -0
- package/dist/utils/css-tokens.d.ts.map +1 -0
- package/package.json +17 -12
- package/src/components/Accordion/Accordion.tsx +10 -1
- package/src/components/Badge/Badge.stories.tsx +32 -0
- package/src/components/Badge/Badge.tsx +19 -2
- package/src/components/Banner/Banner.module.css +38 -0
- package/src/components/Banner/Banner.tsx +34 -4
- package/src/components/Button/Button.mdx +143 -0
- package/src/components/Button/Button.stories.tsx +1 -1
- package/src/components/Button/Button.tsx +42 -11
- package/src/components/Checkbox/Checkbox.tsx +6 -3
- package/src/components/Field/Field.tsx +20 -7
- package/src/components/Input/Input.module.css +21 -0
- package/src/components/Input/Input.tsx +62 -21
- package/src/components/Loader/Loader.module.css +17 -0
- package/src/components/Loader/Loader.stories.tsx +9 -0
- package/src/components/Loader/Loader.tsx +42 -20
- package/src/components/Menu/DestructiveMenuItem.tsx +59 -6
- package/src/components/Menu/Menu.tsx +160 -11
- package/src/components/Menu/MenuItem.module.css +2 -0
- package/src/components/Menu/MenuItem.tsx +48 -5
- package/src/components/Modal/Modal.tsx +81 -4
- package/src/components/Radio/Radio.tsx +117 -29
- package/src/components/Scrollbar/Scrollbar.module.css +5 -0
- package/src/components/Scrollbar/Scrollbar.tsx +18 -4
- package/src/components/Select/Select.tsx +139 -9
- package/src/components/Sidebar/Sidebar.module.css +7 -0
- package/src/components/Sidebar/Sidebar.tsx +102 -4
- package/src/components/Slider/Slider.module.css +5 -1
- package/src/components/Slider/Slider.stories.tsx +25 -0
- package/src/components/Slider/Slider.tsx +4 -4
- package/src/components/Tab/Tab.tsx +32 -2
- package/src/components/TabGroup/TabGroup.stories.tsx +46 -15
- package/src/components/TabGroup/TabGroup.tsx +77 -10
- package/src/components/Table/Table.module.css +10 -0
- package/src/components/Table/Table.tsx +58 -29
- package/src/components/Tag/Tag.tsx +5 -2
- package/src/components/Toast/Toast.tsx +44 -8
- package/src/components/Toggle/Toggle.tsx +23 -22
- package/src/components/Tooltip/Tooltip.tsx +42 -6
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e, { Component as t,
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
import
|
|
5
|
-
var
|
|
1
|
+
import e, { Component as t, cloneElement as n, forwardRef as r, isValidElement as i, useCallback as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
|
|
2
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown as g, Cross as _ } from "@ds-mo/icons";
|
|
4
|
+
import v, { createPortal as y } from "react-dom";
|
|
5
|
+
var b = {
|
|
6
6
|
text: "_text_12t2m_1",
|
|
7
7
|
truncate1Line: "_truncate1Line_12t2m_9",
|
|
8
8
|
truncate2Lines: "_truncate2Lines_12t2m_15",
|
|
@@ -32,60 +32,60 @@ var v = {
|
|
|
32
32
|
alignLeft: "_alignLeft_12t2m_156",
|
|
33
33
|
alignCenter: "_alignCenter_12t2m_160",
|
|
34
34
|
alignRight: "_alignRight_12t2m_164"
|
|
35
|
-
}, y = {
|
|
36
|
-
primary: v.colorPrimary,
|
|
37
|
-
secondary: v.colorSecondary,
|
|
38
|
-
tertiary: v.colorTertiary,
|
|
39
|
-
brand: v.colorBrand,
|
|
40
|
-
negative: v.colorNegative,
|
|
41
|
-
positive: v.colorPositive,
|
|
42
|
-
warning: v.colorWarning,
|
|
43
|
-
caution: v.colorCaution,
|
|
44
|
-
ai: v.colorAi,
|
|
45
|
-
"on-strong": v.colorOnStrong,
|
|
46
|
-
"on-bold": v.colorOnBold,
|
|
47
|
-
inherit: v.colorInherit
|
|
48
|
-
}, b = {
|
|
49
|
-
none: v.decorationNone,
|
|
50
|
-
underline: v.decorationUnderline,
|
|
51
|
-
"dotted-underline": v.decorationDottedUnderline
|
|
52
35
|
}, x = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
primary: b.colorPrimary,
|
|
37
|
+
secondary: b.colorSecondary,
|
|
38
|
+
tertiary: b.colorTertiary,
|
|
39
|
+
brand: b.colorBrand,
|
|
40
|
+
negative: b.colorNegative,
|
|
41
|
+
positive: b.colorPositive,
|
|
42
|
+
warning: b.colorWarning,
|
|
43
|
+
caution: b.colorCaution,
|
|
44
|
+
ai: b.colorAi,
|
|
45
|
+
"on-strong": b.colorOnStrong,
|
|
46
|
+
"on-bold": b.colorOnBold,
|
|
47
|
+
inherit: b.colorInherit
|
|
56
48
|
}, S = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
none: b.decorationNone,
|
|
50
|
+
underline: b.decorationUnderline,
|
|
51
|
+
"dotted-underline": b.decorationDottedUnderline
|
|
52
|
+
}, C = {
|
|
53
|
+
left: b.alignLeft,
|
|
54
|
+
center: b.alignCenter,
|
|
55
|
+
right: b.alignRight
|
|
56
|
+
}, w = {
|
|
57
|
+
1: b.truncate1Line,
|
|
58
|
+
2: b.truncate2Lines,
|
|
59
|
+
3: b.truncate3Lines,
|
|
60
|
+
4: b.truncate4Lines,
|
|
61
|
+
5: b.truncate5Lines,
|
|
62
|
+
none: b.noTruncation
|
|
63
|
+
}, T = (e) => e.startsWith("var(--"), E = r(({ variant: e = "text-body-medium", children: t, color: n, decoration: r, italic: i, align: a, lineTruncation: o = "none", wrap: s, as: c = "p", id: l, htmlFor: u, className: d = "", style: f }, p) => {
|
|
64
|
+
let h = s === "nowrap" ? b.wrapNowrap : s === "balance" ? b.wrapBalance : s === "pretty" ? b.wrapPretty : "", g = s === "nowrap" ? "" : w[o], _ = [
|
|
65
65
|
e,
|
|
66
|
-
|
|
66
|
+
b.text,
|
|
67
67
|
h,
|
|
68
68
|
g,
|
|
69
|
-
n && !
|
|
70
|
-
r ?
|
|
71
|
-
i ?
|
|
72
|
-
a ?
|
|
69
|
+
n && !T(n) ? x[n] : "",
|
|
70
|
+
r ? S[r] : "",
|
|
71
|
+
i ? b.italic : "",
|
|
72
|
+
a ? C[a] : "",
|
|
73
73
|
d
|
|
74
|
-
].filter(Boolean).join(" "),
|
|
75
|
-
...
|
|
76
|
-
...n &&
|
|
74
|
+
].filter(Boolean).join(" "), v = {
|
|
75
|
+
...f,
|
|
76
|
+
...n && T(n) ? { color: n } : {}
|
|
77
77
|
};
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
ref:
|
|
78
|
+
return /* @__PURE__ */ m(c, {
|
|
79
|
+
ref: p,
|
|
80
80
|
className: _,
|
|
81
|
-
style: Object.keys(
|
|
81
|
+
style: Object.keys(v).length > 0 ? v : void 0,
|
|
82
82
|
...l ? { id: l } : {},
|
|
83
83
|
...c === "label" && u ? { htmlFor: u } : {},
|
|
84
84
|
children: t
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
var
|
|
87
|
+
E.displayName = "Text";
|
|
88
|
+
var D = {
|
|
89
89
|
surface: "_surface_65ypw_7",
|
|
90
90
|
bgPrimary: "_bgPrimary_65ypw_28",
|
|
91
91
|
bgSecondary: "_bgSecondary_65ypw_32",
|
|
@@ -152,63 +152,63 @@ var T = {
|
|
|
152
152
|
interactive: "_interactive_65ypw_172",
|
|
153
153
|
selected: "_selected_65ypw_199",
|
|
154
154
|
inactive: "_inactive_65ypw_218"
|
|
155
|
-
}, E = {
|
|
156
|
-
primary: T.bgPrimary,
|
|
157
|
-
secondary: T.bgSecondary,
|
|
158
|
-
transparent: T.bgTransparent,
|
|
159
|
-
translucent: T.bgTranslucent
|
|
160
|
-
}, D = {
|
|
161
|
-
none: T.elevationNone,
|
|
162
|
-
depressed: T.elevationDepressed,
|
|
163
|
-
"depressed-md": T.elevationDepressedMd,
|
|
164
|
-
flat: T.elevationFlat,
|
|
165
|
-
elevated: T.elevationElevated,
|
|
166
|
-
floating: T.elevationFloating,
|
|
167
|
-
overlayTop: T.elevationOverlayTop,
|
|
168
|
-
overlayRight: T.elevationOverlayRight,
|
|
169
|
-
overlayBottom: T.elevationOverlayBottom,
|
|
170
|
-
overlayLeft: T.elevationOverlayLeft
|
|
171
155
|
}, O = {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
156
|
+
primary: D.bgPrimary,
|
|
157
|
+
secondary: D.bgSecondary,
|
|
158
|
+
transparent: D.bgTransparent,
|
|
159
|
+
translucent: D.bgTranslucent
|
|
176
160
|
}, k = {
|
|
177
|
-
none:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
161
|
+
none: D.elevationNone,
|
|
162
|
+
depressed: D.elevationDepressed,
|
|
163
|
+
"depressed-md": D.elevationDepressedMd,
|
|
164
|
+
flat: D.elevationFlat,
|
|
165
|
+
elevated: D.elevationElevated,
|
|
166
|
+
floating: D.elevationFloating,
|
|
167
|
+
overlayTop: D.elevationOverlayTop,
|
|
168
|
+
overlayRight: D.elevationOverlayRight,
|
|
169
|
+
overlayBottom: D.elevationOverlayBottom,
|
|
170
|
+
overlayLeft: D.elevationOverlayLeft
|
|
171
|
+
}, ee = {
|
|
172
|
+
top: D.edgeTop,
|
|
173
|
+
right: D.edgeRight,
|
|
174
|
+
bottom: D.edgeBottom,
|
|
175
|
+
left: D.edgeLeft
|
|
176
|
+
}, A = {
|
|
177
|
+
none: D.radiusNone,
|
|
178
|
+
xs: D.radiusXs,
|
|
179
|
+
sm: D.radiusSm,
|
|
180
|
+
md: D.radiusMd,
|
|
181
|
+
lg: D.radiusLg,
|
|
182
|
+
xl: D.radiusXl,
|
|
183
|
+
"2xl": D.radius2xl,
|
|
184
|
+
full: D.radiusFull
|
|
185
|
+
}, j = (e, t) => D[`intent${e.charAt(0).toUpperCase() + e.slice(1)}${t.charAt(0).toUpperCase() + t.slice(1)}`] || "", M = (e) => e in A, N = r(({ children: e, background: t = "transparent", intent: n, contrast: r = "faint", elevation: i = "none", edge: a, radius: o, interactive: s = !1, selected: c = !1, inactive: l = !1, as: u = "div", className: d = "", style: f, type: p, ...h }, g) => {
|
|
186
186
|
let _ = [
|
|
187
|
-
|
|
188
|
-
n ?
|
|
189
|
-
|
|
190
|
-
...a && i === "none" ? Array.isArray(a) ? a.map((e) =>
|
|
191
|
-
o &&
|
|
192
|
-
s ?
|
|
193
|
-
c ?
|
|
194
|
-
l ?
|
|
187
|
+
D.surface,
|
|
188
|
+
n ? j(n, r) : O[t],
|
|
189
|
+
k[i],
|
|
190
|
+
...a && i === "none" ? Array.isArray(a) ? a.map((e) => ee[e]) : [ee[a]] : [],
|
|
191
|
+
o && M(o) ? A[o] : "",
|
|
192
|
+
s ? D.interactive : "",
|
|
193
|
+
c ? D.selected : "",
|
|
194
|
+
l ? D.inactive : "",
|
|
195
195
|
d
|
|
196
196
|
].filter(Boolean).join(" "), v = {
|
|
197
|
-
...
|
|
198
|
-
...o && !
|
|
197
|
+
...f,
|
|
198
|
+
...o && !M(o) ? { borderRadius: o } : {}
|
|
199
199
|
};
|
|
200
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ m(u, {
|
|
201
201
|
ref: g,
|
|
202
202
|
className: _,
|
|
203
|
-
style: o && !
|
|
203
|
+
style: o && !M(o) || f && Object.keys(f).length > 0 ? v : void 0,
|
|
204
204
|
disabled: u === "button" ? l : void 0,
|
|
205
|
-
type: u === "button" ?
|
|
205
|
+
type: u === "button" ? p || "button" : void 0,
|
|
206
206
|
...h,
|
|
207
207
|
children: e
|
|
208
208
|
});
|
|
209
209
|
});
|
|
210
|
-
|
|
211
|
-
var
|
|
210
|
+
N.displayName = "Surface";
|
|
211
|
+
var P = {
|
|
212
212
|
card: "_card_1idsz_6",
|
|
213
213
|
elevationFlat: "_elevationFlat_1idsz_13",
|
|
214
214
|
elevationElevated: "_elevationElevated_1idsz_14",
|
|
@@ -223,72 +223,85 @@ var N = {
|
|
|
223
223
|
};
|
|
224
224
|
//#endregion
|
|
225
225
|
//#region src/utils/cn.ts
|
|
226
|
-
function
|
|
226
|
+
function F(...e) {
|
|
227
227
|
return e.filter(Boolean).join(" ");
|
|
228
228
|
}
|
|
229
229
|
//#endregion
|
|
230
230
|
//#region src/components/Card/Card.tsx
|
|
231
|
-
var
|
|
232
|
-
flat:
|
|
233
|
-
elevated:
|
|
234
|
-
floating:
|
|
235
|
-
},
|
|
236
|
-
sm:
|
|
237
|
-
md:
|
|
238
|
-
lg:
|
|
239
|
-
xl:
|
|
240
|
-
},
|
|
231
|
+
var I = {
|
|
232
|
+
flat: P.elevationFlat,
|
|
233
|
+
elevated: P.elevationElevated,
|
|
234
|
+
floating: P.elevationFloating
|
|
235
|
+
}, L = {
|
|
236
|
+
sm: P.radiusSm,
|
|
237
|
+
md: P.radiusMd,
|
|
238
|
+
lg: P.radiusLg,
|
|
239
|
+
xl: P.radiusXl
|
|
240
|
+
}, R = r(({ children: e, header: t, footer: n, elevation: r = "elevated", radius: i = "lg", className: a, style: o }, s) => /* @__PURE__ */ h("div", {
|
|
241
241
|
ref: s,
|
|
242
|
-
className: P
|
|
242
|
+
className: F(P.card, I[r], L[i], a),
|
|
243
243
|
style: o,
|
|
244
244
|
children: [
|
|
245
|
-
t && /* @__PURE__ */
|
|
246
|
-
className:
|
|
245
|
+
t && /* @__PURE__ */ m("div", {
|
|
246
|
+
className: P.header,
|
|
247
247
|
children: t
|
|
248
248
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
className:
|
|
249
|
+
/* @__PURE__ */ m("div", {
|
|
250
|
+
className: P.body,
|
|
251
251
|
children: e
|
|
252
252
|
}),
|
|
253
|
-
n && /* @__PURE__ */
|
|
254
|
-
className:
|
|
253
|
+
n && /* @__PURE__ */ m("div", {
|
|
254
|
+
className: P.footer,
|
|
255
255
|
children: n
|
|
256
256
|
})
|
|
257
257
|
]
|
|
258
258
|
}));
|
|
259
|
-
|
|
260
|
-
var
|
|
259
|
+
R.displayName = "Card";
|
|
260
|
+
var z = {
|
|
261
261
|
labelWrap: "_labelWrap_1t38o_8",
|
|
262
262
|
sizeSm: "_sizeSm_1t38o_16",
|
|
263
263
|
sizeXs: "_sizeXs_1t38o_19",
|
|
264
264
|
truncate: "_truncate_1t38o_22"
|
|
265
|
-
},
|
|
266
|
-
className:
|
|
265
|
+
}, te = ({ children: e, size: t = "md", truncate: n = !1, className: r }) => /* @__PURE__ */ m("span", {
|
|
266
|
+
className: F(z.labelWrap, t === "sm" && z.sizeSm, t === "xs" && z.sizeXs, n && z.truncate, r),
|
|
267
267
|
children: e
|
|
268
268
|
});
|
|
269
|
-
|
|
270
|
-
var te = {
|
|
271
|
-
loader: "_loader_fz5t7_1",
|
|
272
|
-
spin: "_spin_fz5t7_1"
|
|
273
|
-
}, z = ({ size: e = 20, className: t }) => /* @__PURE__ */ f("svg", {
|
|
274
|
-
width: e,
|
|
275
|
-
height: e,
|
|
276
|
-
viewBox: "0 0 16 16",
|
|
277
|
-
fill: "none",
|
|
278
|
-
className: `${te.loader}${t ? ` ${t}` : ""}`,
|
|
279
|
-
"aria-hidden": "true",
|
|
280
|
-
children: /* @__PURE__ */ f("circle", {
|
|
281
|
-
cx: "8",
|
|
282
|
-
cy: "8",
|
|
283
|
-
r: "5",
|
|
284
|
-
stroke: "currentColor",
|
|
285
|
-
strokeWidth: "1",
|
|
286
|
-
strokeLinecap: "round",
|
|
287
|
-
strokeDasharray: "23.6 7.9"
|
|
288
|
-
})
|
|
289
|
-
});
|
|
290
|
-
z.displayName = "Loader";
|
|
269
|
+
te.displayName = "LabelWrap";
|
|
291
270
|
var B = {
|
|
271
|
+
loader: "_loader_ebm28_1",
|
|
272
|
+
spin: "_spin_ebm28_1",
|
|
273
|
+
status: "_status_ebm28_6",
|
|
274
|
+
visuallyHidden: "_visuallyHidden_ebm28_11"
|
|
275
|
+
}, ne = ({ size: e = 20, className: t, label: n }) => {
|
|
276
|
+
let r = /* @__PURE__ */ m("svg", {
|
|
277
|
+
width: e,
|
|
278
|
+
height: e,
|
|
279
|
+
viewBox: "0 0 16 16",
|
|
280
|
+
fill: "none",
|
|
281
|
+
className: `${B.loader}${t ? ` ${t}` : ""}`,
|
|
282
|
+
"aria-hidden": "true",
|
|
283
|
+
children: /* @__PURE__ */ m("circle", {
|
|
284
|
+
cx: "8",
|
|
285
|
+
cy: "8",
|
|
286
|
+
r: "5",
|
|
287
|
+
stroke: "currentColor",
|
|
288
|
+
strokeWidth: "1",
|
|
289
|
+
strokeLinecap: "round",
|
|
290
|
+
strokeDasharray: "23.6 7.9"
|
|
291
|
+
})
|
|
292
|
+
});
|
|
293
|
+
return n === void 0 ? r : /* @__PURE__ */ h("span", {
|
|
294
|
+
role: "status",
|
|
295
|
+
"aria-live": "polite",
|
|
296
|
+
className: B.status,
|
|
297
|
+
children: [r, /* @__PURE__ */ m("span", {
|
|
298
|
+
className: B.visuallyHidden,
|
|
299
|
+
children: n
|
|
300
|
+
})]
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
ne.displayName = "Loader";
|
|
304
|
+
var V = {
|
|
292
305
|
button: "_button_1vroe_6",
|
|
293
306
|
inactive: "_inactive_1vroe_35",
|
|
294
307
|
onMedium: "_onMedium_1vroe_50",
|
|
@@ -322,50 +335,56 @@ var B = {
|
|
|
322
335
|
rounded: "_rounded_1vroe_302",
|
|
323
336
|
badge: "_badge_1vroe_324",
|
|
324
337
|
fullWidth: "_fullWidth_1vroe_340"
|
|
325
|
-
},
|
|
338
|
+
}, re = {
|
|
326
339
|
xs: 12,
|
|
327
340
|
sm: 16,
|
|
328
341
|
md: 20,
|
|
329
342
|
lg: 24
|
|
330
|
-
},
|
|
343
|
+
}, H = {
|
|
331
344
|
xs: "text-caption-emphasis",
|
|
332
345
|
sm: "text-body-small-emphasis",
|
|
333
346
|
md: "text-body-medium-emphasis",
|
|
334
347
|
lg: "text-body-large-emphasis"
|
|
335
|
-
},
|
|
336
|
-
let j = e ?? "button",
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
+
}, ie = r((e, t) => {
|
|
349
|
+
let { as: n, variant: r = "primary", label: i, icon: a, intent: o = "brand", size: s = "md", rounded: c = !1, fullWidth: l = !1, width: u, contrast: d = "bold", background: f, dropdown: p = !1, badgeCount: _, elevation: v, loading: y = !1, onClick: b, onMouseEnter: x, onMouseLeave: S, className: C, inactive: w = !1, type: T = "button", id: D, "aria-label": O, "aria-labelledby": k, href: ee, target: A, rel: j } = e, M = n ?? "button", N = !n || n === "button", P = !N && n !== "a", I = !w && !y, L = !!a, R = !!i, z = L || y, B = z && !R, ie = R && !z, U = z && R, W = re[s], ae = H[s], oe = v ?? (r === "primary" ? "none" : "flat"), G = oe.charAt(0).toUpperCase() + oe.slice(1), K = F(V.button, V[r], V[`intent${o.charAt(0).toUpperCase() + o.slice(1)}`], s !== "md" && V[`size${s.toUpperCase()}`], c && V.rounded, (w || y) && V.inactive, B && V.iconOnly, ie && V.labelOnly, U && V.iconAndLabel, p && V.dropdown, r === "primary" && o !== "none" && d !== "bold" && V[`contrast${d.charAt(0).toUpperCase() + d.slice(1)}`], V[`elevation${G}`], f && f !== "faint" && V[f === "always-dark" ? "onAlwaysDark" : `on${f.charAt(0).toUpperCase() + f.slice(1)}`], l && V.fullWidth, C);
|
|
350
|
+
B && !O && !k && console.warn("[@ds-mo/ui Button] Icon-only Button is missing an accessible name. Provide `label`, `aria-label`, or `aria-labelledby`.");
|
|
351
|
+
let q = {};
|
|
352
|
+
return N && (q.type = T, q.disabled = w || y), ee && (q.href = ee), A && (q.target = A), j && (q.rel = j), P && (q.role = "button", q.tabIndex = I ? 0 : -1, I && (q.onKeyDown = (e) => {
|
|
353
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
354
|
+
})), /* @__PURE__ */ h(M, {
|
|
355
|
+
ref: t,
|
|
356
|
+
id: D,
|
|
357
|
+
className: K,
|
|
358
|
+
style: u ? { width: u } : void 0,
|
|
359
|
+
onClick: I ? b : void 0,
|
|
360
|
+
onMouseEnter: I ? x : void 0,
|
|
361
|
+
onMouseLeave: I ? S : void 0,
|
|
362
|
+
"aria-label": O,
|
|
363
|
+
"aria-labelledby": k,
|
|
364
|
+
"aria-disabled": w || y || void 0,
|
|
365
|
+
"aria-busy": y || void 0,
|
|
366
|
+
...q,
|
|
348
367
|
children: [
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
truncate:
|
|
352
|
-
children: /* @__PURE__ */
|
|
353
|
-
variant:
|
|
368
|
+
y ? /* @__PURE__ */ m(ne, { size: W }) : a && /* @__PURE__ */ m(a, { size: W }),
|
|
369
|
+
i && /* @__PURE__ */ m(te, {
|
|
370
|
+
truncate: l,
|
|
371
|
+
children: /* @__PURE__ */ m(E, {
|
|
372
|
+
variant: ae,
|
|
354
373
|
as: "span",
|
|
355
374
|
color: "inherit",
|
|
356
|
-
children:
|
|
375
|
+
children: i
|
|
357
376
|
})
|
|
358
377
|
}),
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
className:
|
|
362
|
-
children:
|
|
378
|
+
p && /* @__PURE__ */ m(g, { size: W }),
|
|
379
|
+
_ != null && _ > 0 && /* @__PURE__ */ m("span", {
|
|
380
|
+
className: V.badge,
|
|
381
|
+
children: _ > 9 ? "+" : _
|
|
363
382
|
})
|
|
364
383
|
]
|
|
365
384
|
});
|
|
366
385
|
});
|
|
367
|
-
|
|
368
|
-
var
|
|
386
|
+
ie.displayName = "Button";
|
|
387
|
+
var U = {
|
|
369
388
|
toggleButton: "_toggleButton_ywix4_11",
|
|
370
389
|
inactive: "_inactive_ywix4_38",
|
|
371
390
|
onMedium: "_onMedium_ywix4_51",
|
|
@@ -383,7 +402,7 @@ var H = {
|
|
|
383
402
|
sizeSM: "_sizeSM_ywix4_146",
|
|
384
403
|
sizeXS: "_sizeXS_ywix4_151",
|
|
385
404
|
rounded: "_rounded_ywix4_159"
|
|
386
|
-
},
|
|
405
|
+
}, W = {
|
|
387
406
|
md: 20,
|
|
388
407
|
sm: 16,
|
|
389
408
|
xs: 12
|
|
@@ -391,18 +410,18 @@ var H = {
|
|
|
391
410
|
md: "text-body-medium-emphasis",
|
|
392
411
|
sm: "text-body-small-emphasis",
|
|
393
412
|
xs: "text-caption-emphasis"
|
|
394
|
-
}, oe =
|
|
395
|
-
let
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
ref:
|
|
413
|
+
}, oe = r(({ elevation: e = "elevated", label: t, icon: n, size: r = "md", rounded: i = !1, background: a, pressed: o, onPressedChange: s, inactive: c = !1, className: l, id: u, "aria-label": d }, f) => {
|
|
414
|
+
let p = !!n, g = !!t, _ = p && !g, v = g && !p, y = p && g, b = W[r], x = ae[r], S = e.charAt(0).toUpperCase() + e.slice(1);
|
|
415
|
+
return /* @__PURE__ */ h("button", {
|
|
416
|
+
ref: f,
|
|
398
417
|
id: u,
|
|
399
|
-
className:
|
|
418
|
+
className: F(U.toggleButton, U[`elevation${S}`], r !== "md" && U[`size${r.toUpperCase()}`], i && U.rounded, c && U.inactive, _ && U.iconOnly, v && U.labelOnly, y && U.iconAndLabel, a && a !== "faint" && U[a === "always-dark" ? "onAlwaysDark" : `on${a.charAt(0).toUpperCase() + a.slice(1)}`], o && U.pressed, l),
|
|
400
419
|
onClick: c ? void 0 : () => s(!o),
|
|
401
420
|
type: "button",
|
|
402
421
|
disabled: c,
|
|
403
422
|
"aria-label": d || t || "toggle",
|
|
404
423
|
"aria-pressed": o,
|
|
405
|
-
children: [n && /* @__PURE__ */
|
|
424
|
+
children: [n && /* @__PURE__ */ m(n, { size: b }), t && /* @__PURE__ */ m(te, { children: /* @__PURE__ */ m(E, {
|
|
406
425
|
variant: x,
|
|
407
426
|
as: "span",
|
|
408
427
|
color: "inherit",
|
|
@@ -411,7 +430,7 @@ var H = {
|
|
|
411
430
|
});
|
|
412
431
|
});
|
|
413
432
|
oe.displayName = "ToggleButton";
|
|
414
|
-
var
|
|
433
|
+
var G = {
|
|
415
434
|
group: "_group_1u9mw_5",
|
|
416
435
|
groupElevated: "_groupElevated_1u9mw_27",
|
|
417
436
|
groupFlat: "_groupFlat_1u9mw_31",
|
|
@@ -439,22 +458,22 @@ var U = {
|
|
|
439
458
|
roundedFirstLG: "_roundedFirstLG_1u9mw_155",
|
|
440
459
|
roundedLastLG: "_roundedLastLG_1u9mw_156",
|
|
441
460
|
roundedMidLG: "_roundedMidLG_1u9mw_157"
|
|
442
|
-
},
|
|
461
|
+
}, K = ({ children: t, className: n }) => {
|
|
443
462
|
let r = e.Children.toArray(t).filter(e.isValidElement), i = r.length, a = r[0]?.props, o = a?.variant ?? "secondary", s = a?.elevation ?? (o === "primary" ? "none" : "flat"), c = !!a?.rounded, l = s.charAt(0).toUpperCase() + s.slice(1);
|
|
444
|
-
return /* @__PURE__ */
|
|
445
|
-
className:
|
|
463
|
+
return /* @__PURE__ */ m("div", {
|
|
464
|
+
className: F(G.group, G[`group${l}`], c && G.groupRounded, n),
|
|
446
465
|
role: "group",
|
|
447
466
|
children: r.map((t, n) => {
|
|
448
|
-
let r = t, a = r.props, o = n === 0, s = n === i - 1, c = !o && !s, l = a.variant ?? "secondary", u = a.size ?? "md", d = a.contrast ?? "bold",
|
|
449
|
-
return /* @__PURE__ */
|
|
467
|
+
let r = t, a = r.props, o = n === 0, s = n === i - 1, c = !o && !s, l = a.variant ?? "secondary", u = a.size ?? "md", d = a.contrast ?? "bold", f = a.intent ?? "brand", p = !!a.rounded, g = !!a.icon && !a.label, _ = l === "secondary" && (a.elevation ?? "flat") === "none", v = l === "primary" && f !== "none", y = d.charAt(0).toUpperCase() + d.slice(1), b = u.toUpperCase(), x = p && !g && u !== "xs", S = F(G.divider, _ && G.dividerGhost, _ && u === "xs" && G.dividerGhostXS, _ && u === "sm" && G.dividerGhostSM, _ && u === "lg" && G.dividerGhostLG, v && G[`divider${y}`]);
|
|
468
|
+
return /* @__PURE__ */ h(e.Fragment, { children: [n > 0 && /* @__PURE__ */ m("div", {
|
|
450
469
|
className: S,
|
|
451
470
|
"aria-hidden": "true"
|
|
452
|
-
}), e.cloneElement(r, { className:
|
|
471
|
+
}), e.cloneElement(r, { className: F(a.className, G.item, o && G.first, s && G.last, c && G.middle, _ && G.itemShort, x && o && G[`roundedFirst${b}`], x && s && G[`roundedLast${b}`], x && c && G[`roundedMid${b}`]) })] }, n);
|
|
453
472
|
})
|
|
454
473
|
});
|
|
455
474
|
};
|
|
456
|
-
|
|
457
|
-
var
|
|
475
|
+
K.displayName = "ButtonGroup";
|
|
476
|
+
var q = {
|
|
458
477
|
group: "_group_14dyx_5",
|
|
459
478
|
groupElevated: "_groupElevated_14dyx_27",
|
|
460
479
|
groupFlat: "_groupFlat_14dyx_31",
|
|
@@ -476,22 +495,22 @@ var W = {
|
|
|
476
495
|
roundedFirstSM: "_roundedFirstSM_14dyx_161",
|
|
477
496
|
roundedLastSM: "_roundedLastSM_14dyx_162",
|
|
478
497
|
roundedMidSM: "_roundedMidSM_14dyx_163"
|
|
479
|
-
},
|
|
498
|
+
}, se = ({ children: t, className: n }) => {
|
|
480
499
|
let r = e.Children.toArray(t).filter(e.isValidElement), i = r.length, a = r[0]?.props, o = a?.elevation ?? "elevated", s = !!a?.rounded, c = o.charAt(0).toUpperCase() + o.slice(1);
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
className:
|
|
500
|
+
return /* @__PURE__ */ m("div", {
|
|
501
|
+
className: F(q.group, q[`group${c}`], s && q.groupRounded, n),
|
|
483
502
|
role: "group",
|
|
484
503
|
children: r.map((t, n) => {
|
|
485
|
-
let r = t, a = r.props, o = n === 0, s = n === i - 1, c = !o && !s, l = a.size ?? "md", u = !!a.rounded, d = !!a.pressed,
|
|
486
|
-
return /* @__PURE__ */
|
|
504
|
+
let r = t, a = r.props, o = n === 0, s = n === i - 1, c = !o && !s, l = a.size ?? "md", u = !!a.rounded, d = !!a.pressed, f = !!a.icon && !a.label, p = (a.elevation ?? "elevated") === "none", g = l.toUpperCase(), _ = u && !f && l !== "xs", v = F(q.divider, p && q.dividerGhost, p && l === "xs" && q.dividerGhostXS, p && l === "sm" && q.dividerGhostSM);
|
|
505
|
+
return /* @__PURE__ */ h(e.Fragment, { children: [n > 0 && /* @__PURE__ */ m("div", {
|
|
487
506
|
className: v,
|
|
488
507
|
"aria-hidden": "true"
|
|
489
|
-
}), e.cloneElement(r, { className:
|
|
508
|
+
}), e.cloneElement(r, { className: F(a.className, q.item, o && q.first, s && q.last, c && q.middle, p && q.itemShort, p && d && q.itemPressed, _ && o && q[`roundedFirst${g}`], _ && s && q[`roundedLast${g}`], _ && c && q[`roundedMid${g}`]) })] }, n);
|
|
490
509
|
})
|
|
491
510
|
});
|
|
492
511
|
};
|
|
493
|
-
|
|
494
|
-
var
|
|
512
|
+
se.displayName = "ToggleButtonGroup";
|
|
513
|
+
var J = {
|
|
495
514
|
tag: "_tag_1sd2v_6",
|
|
496
515
|
sizeMd: "_sizeMd_1sd2v_27",
|
|
497
516
|
sizeSm: "_sizeSm_1sd2v_28",
|
|
@@ -531,129 +550,124 @@ var G = {
|
|
|
531
550
|
removable: "_removable_1sd2v_236",
|
|
532
551
|
removeButton: "_removeButton_1sd2v_239",
|
|
533
552
|
inactive: "_inactive_1sd2v_270"
|
|
534
|
-
},
|
|
553
|
+
}, ce = {
|
|
535
554
|
md: 20,
|
|
536
555
|
sm: 16,
|
|
537
556
|
xs: 12
|
|
538
|
-
},
|
|
557
|
+
}, le = {
|
|
539
558
|
md: "text-body-medium",
|
|
540
559
|
sm: "text-body-small",
|
|
541
560
|
xs: "text-caption"
|
|
542
|
-
},
|
|
543
|
-
let x = !!
|
|
544
|
-
return /* @__PURE__ */
|
|
561
|
+
}, ue = r(({ label: e, intent: t = "neutral", contrast: n = "faint", elevation: r = "none", size: i = "md", rounded: a = !1, icon: o, removable: s = !1, onRemove: c, removeIcon: l, maxWidth: u, inactive: d = !1, background: f, onClick: p, pressed: g, onPressedChange: v, className: y }, b) => {
|
|
562
|
+
let x = !!p || !!v, S = s && !!c, C = ce[i], w = le[i], T = r.charAt(0).toUpperCase() + r.slice(1), D = i.toUpperCase();
|
|
563
|
+
return /* @__PURE__ */ h("div", {
|
|
545
564
|
ref: b,
|
|
546
|
-
className:
|
|
565
|
+
className: F(J.tag, J[`intent${t.charAt(0).toUpperCase() + t.slice(1)}`], J[`contrast${n.charAt(0).toUpperCase() + n.slice(1)}`], J[`elevation${T}`], J[`size${i.charAt(0).toUpperCase() + i.slice(1)}`], a && J.rounded, a && !o && J[`roundedLeft${D}`], a && !S && J[`roundedRight${D}`], !!o && J[`iconLeft${D}`], S && J[`iconRight${D}`], s && J.removable, x && J.interactive, f && f !== "faint" && J[f === "always-dark" ? "onAlwaysDark" : `on${f.charAt(0).toUpperCase() + f.slice(1)}`], d && J.inactive, g && J.pressed, y),
|
|
547
566
|
style: u == null ? void 0 : { maxWidth: typeof u == "number" ? `${u}px` : u },
|
|
548
567
|
onClick: x && !d ? () => {
|
|
549
|
-
v?.(!
|
|
568
|
+
v?.(!g), p?.();
|
|
550
569
|
} : void 0,
|
|
551
570
|
onKeyDown: x && !d ? (e) => {
|
|
552
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), v?.(!
|
|
571
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), v?.(!g), p?.());
|
|
553
572
|
} : void 0,
|
|
554
573
|
role: x ? "button" : void 0,
|
|
555
|
-
tabIndex: x
|
|
556
|
-
"aria-pressed":
|
|
574
|
+
tabIndex: x ? d ? -1 : 0 : void 0,
|
|
575
|
+
"aria-pressed": x && g !== void 0 ? !!g : void 0,
|
|
557
576
|
"aria-disabled": d || void 0,
|
|
558
577
|
children: [
|
|
559
|
-
o && /* @__PURE__ */
|
|
560
|
-
/* @__PURE__ */
|
|
578
|
+
o && /* @__PURE__ */ m(o, { size: C }),
|
|
579
|
+
/* @__PURE__ */ m(te, {
|
|
561
580
|
size: i,
|
|
562
|
-
children: /* @__PURE__ */
|
|
563
|
-
variant:
|
|
581
|
+
children: /* @__PURE__ */ m(E, {
|
|
582
|
+
variant: w,
|
|
564
583
|
as: "span",
|
|
565
584
|
color: "inherit",
|
|
566
585
|
children: e
|
|
567
586
|
})
|
|
568
587
|
}),
|
|
569
|
-
s && c && /* @__PURE__ */
|
|
588
|
+
s && c && /* @__PURE__ */ m("button", {
|
|
570
589
|
type: "button",
|
|
571
|
-
className:
|
|
590
|
+
className: J.removeButton,
|
|
572
591
|
onClick: (e) => {
|
|
573
592
|
e.stopPropagation(), c();
|
|
574
593
|
},
|
|
575
594
|
"aria-label": `Remove ${e}`,
|
|
576
595
|
tabIndex: -1,
|
|
577
|
-
children:
|
|
596
|
+
children: m(l || _, { size: C })
|
|
578
597
|
})
|
|
579
598
|
]
|
|
580
599
|
});
|
|
581
600
|
});
|
|
582
|
-
|
|
583
|
-
var
|
|
601
|
+
ue.displayName = "Tag";
|
|
602
|
+
var de = { badge: "_badge_1nscu_1" }, fe = ({ count: e, isSelected: t = !1, className: n, "aria-label": r, labelFormat: i }) => {
|
|
584
603
|
if (e === 0) return null;
|
|
585
|
-
let
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
-
className: `${
|
|
588
|
-
"aria-label":
|
|
589
|
-
children: /* @__PURE__ */
|
|
604
|
+
let a = e > 9 ? "+" : e.toString(), o = r ?? i?.(e) ?? String(e);
|
|
605
|
+
return /* @__PURE__ */ m("span", {
|
|
606
|
+
className: `${de.badge} ${n || ""}`,
|
|
607
|
+
"aria-label": o,
|
|
608
|
+
children: /* @__PURE__ */ m(E, {
|
|
590
609
|
variant: "text-caption-emphasis",
|
|
591
610
|
as: "span",
|
|
592
611
|
color: t ? "primary" : "secondary",
|
|
593
|
-
children:
|
|
612
|
+
children: a
|
|
594
613
|
})
|
|
595
614
|
});
|
|
596
615
|
};
|
|
597
|
-
|
|
598
|
-
var
|
|
616
|
+
fe.displayName = "Badge";
|
|
617
|
+
var pe = {
|
|
599
618
|
toggle: "_toggle_1aw6v_1",
|
|
600
619
|
checked: "_checked_1aw6v_35",
|
|
601
620
|
thumb: "_thumb_1aw6v_39",
|
|
602
621
|
inactive: "_inactive_1aw6v_62"
|
|
603
|
-
},
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
onMouseLeave: () => {
|
|
620
|
-
o && s(!1);
|
|
621
|
-
},
|
|
622
|
-
children: /* @__PURE__ */ f("span", { className: me.thumb })
|
|
623
|
-
});
|
|
624
|
-
});
|
|
625
|
-
he.displayName = "Toggle";
|
|
626
|
-
var ge = {
|
|
622
|
+
}, me = r(({ checked: e = !1, onChange: t, inactive: n = !1, className: r, "aria-label": i, "aria-labelledby": a }, o) => /* @__PURE__ */ m("button", {
|
|
623
|
+
ref: o,
|
|
624
|
+
type: "button",
|
|
625
|
+
role: "switch",
|
|
626
|
+
"aria-checked": e,
|
|
627
|
+
"aria-label": i,
|
|
628
|
+
"aria-labelledby": a,
|
|
629
|
+
disabled: n,
|
|
630
|
+
className: F(pe.toggle, e && pe.checked, n && pe.inactive, r),
|
|
631
|
+
onClick: () => {
|
|
632
|
+
n || t?.(!e);
|
|
633
|
+
},
|
|
634
|
+
children: /* @__PURE__ */ m("span", { className: pe.thumb })
|
|
635
|
+
}));
|
|
636
|
+
me.displayName = "Toggle";
|
|
637
|
+
var he = {
|
|
627
638
|
checkbox: "_checkbox_1brbf_1",
|
|
628
639
|
inactive: "_inactive_1brbf_18",
|
|
629
640
|
box: "_box_1brbf_25",
|
|
630
641
|
boxChecked: "_boxChecked_1brbf_37",
|
|
631
642
|
checkmark: "_checkmark_1brbf_42"
|
|
632
|
-
},
|
|
633
|
-
let
|
|
643
|
+
}, ge = r(({ label: e, checked: t = !1, indeterminate: n = !1, onChange: r, inactive: i = !1, className: a, checkedIcon: o, uncheckedIcon: c, indeterminateIcon: l }, u) => {
|
|
644
|
+
let d = s(), f = () => {
|
|
634
645
|
i || r?.(!t);
|
|
635
|
-
},
|
|
636
|
-
return /* @__PURE__ */
|
|
637
|
-
ref:
|
|
646
|
+
}, p = n || t ? "var(--color-foreground-primary)" : "var(--color-foreground-secondary)", g = n ? l : t ? o : c;
|
|
647
|
+
return /* @__PURE__ */ h("div", {
|
|
648
|
+
ref: u,
|
|
638
649
|
role: "checkbox",
|
|
639
650
|
"aria-checked": n ? "mixed" : t,
|
|
640
|
-
"aria-
|
|
651
|
+
"aria-disabled": i || void 0,
|
|
652
|
+
"aria-labelledby": d,
|
|
653
|
+
"data-inactive": i || void 0,
|
|
641
654
|
tabIndex: i ? -1 : 0,
|
|
642
|
-
className:
|
|
643
|
-
onClick:
|
|
655
|
+
className: F(he.checkbox, i && he.inactive, a),
|
|
656
|
+
onClick: f,
|
|
644
657
|
onKeyDown: (e) => {
|
|
645
|
-
(e.key === " " || e.key === "Enter") && (e.preventDefault(),
|
|
658
|
+
(e.key === " " || e.key === "Enter") && (e.preventDefault(), f());
|
|
646
659
|
},
|
|
647
|
-
children: [
|
|
660
|
+
children: [g ? /* @__PURE__ */ m(g, {
|
|
648
661
|
size: 20,
|
|
649
|
-
color:
|
|
650
|
-
}) : /* @__PURE__ */
|
|
651
|
-
className:
|
|
652
|
-
children: (t || n) && /* @__PURE__ */
|
|
653
|
-
className:
|
|
662
|
+
color: p
|
|
663
|
+
}) : /* @__PURE__ */ m("span", {
|
|
664
|
+
className: F(he.box, (t || n) && he.boxChecked),
|
|
665
|
+
children: (t || n) && /* @__PURE__ */ m("span", {
|
|
666
|
+
className: he.checkmark,
|
|
654
667
|
children: n ? "−" : "✓"
|
|
655
668
|
})
|
|
656
|
-
}), /* @__PURE__ */
|
|
669
|
+
}), /* @__PURE__ */ m(E, {
|
|
670
|
+
id: d,
|
|
657
671
|
variant: "text-body-medium",
|
|
658
672
|
as: "span",
|
|
659
673
|
color: "inherit",
|
|
@@ -661,136 +675,157 @@ var ge = {
|
|
|
661
675
|
})]
|
|
662
676
|
});
|
|
663
677
|
});
|
|
664
|
-
|
|
665
|
-
var
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
678
|
+
ge.displayName = "Checkbox";
|
|
679
|
+
var _e = {
|
|
680
|
+
container: "_container_ce0xu_1",
|
|
681
|
+
wrapper: "_wrapper_ce0xu_8",
|
|
682
|
+
wrapperError: "_wrapperError_ce0xu_23",
|
|
683
|
+
errorText: "_errorText_ce0xu_31",
|
|
684
|
+
row: "_row_ce0xu_37",
|
|
685
|
+
input: "_input_ce0xu_45",
|
|
686
|
+
clearButton: "_clearButton_ce0xu_70",
|
|
687
|
+
suffix: "_suffix_ce0xu_86"
|
|
688
|
+
}, ve = () => !!import.meta.env?.DEV, ye = r(({ value: e, onChange: t, id: n, placeholder: r, autoFocus: i = !1, className: a, type: c = "text", inactive: l = !1, onKeyDown: u, suffix: d, clearIcon: f, "aria-label": p, "aria-labelledby": g, "aria-describedby": _, error: v = !1, errorMessage: y }, b) => {
|
|
689
|
+
let x = `${s()}-error`, S = c === "search" && e.length > 0 && !l, C = v && !!y, w = [_, C ? x : void 0].filter(Boolean).join(" ") || void 0;
|
|
690
|
+
return o(() => {
|
|
691
|
+
ve() && !n && !p && !g && console.warn("[@ds-mo/ui] <Input> is missing an accessible name. Provide one of: `id` (paired with a <label htmlFor>), `aria-label`, or `aria-labelledby`.");
|
|
692
|
+
}, [
|
|
693
|
+
n,
|
|
694
|
+
p,
|
|
695
|
+
g
|
|
696
|
+
]), /* @__PURE__ */ h("div", {
|
|
697
|
+
className: _e.container,
|
|
698
|
+
children: [/* @__PURE__ */ m("div", {
|
|
699
|
+
ref: b,
|
|
700
|
+
className: F(_e.wrapper, v && _e.wrapperError, a),
|
|
701
|
+
children: /* @__PURE__ */ h("div", {
|
|
702
|
+
className: _e.row,
|
|
703
|
+
children: [
|
|
704
|
+
/* @__PURE__ */ m("input", {
|
|
705
|
+
type: c,
|
|
706
|
+
id: n,
|
|
707
|
+
value: e,
|
|
708
|
+
onChange: t,
|
|
709
|
+
onKeyDown: u,
|
|
710
|
+
placeholder: r,
|
|
711
|
+
className: _e.input,
|
|
712
|
+
autoFocus: i,
|
|
713
|
+
disabled: l,
|
|
714
|
+
"aria-label": p,
|
|
715
|
+
"aria-labelledby": g,
|
|
716
|
+
"aria-describedby": w,
|
|
717
|
+
"aria-invalid": v || void 0
|
|
718
|
+
}),
|
|
719
|
+
S && /* @__PURE__ */ m("button", {
|
|
720
|
+
type: "button",
|
|
721
|
+
className: _e.clearButton,
|
|
722
|
+
onClick: () => {
|
|
723
|
+
t({ target: { value: "" } });
|
|
724
|
+
},
|
|
725
|
+
"aria-label": "Clear",
|
|
726
|
+
children: f ? /* @__PURE__ */ m(f, { size: 16 }) : /* @__PURE__ */ m("span", {
|
|
727
|
+
"aria-hidden": !0,
|
|
728
|
+
children: "×"
|
|
729
|
+
})
|
|
730
|
+
}),
|
|
731
|
+
d && /* @__PURE__ */ m("div", {
|
|
732
|
+
className: _e.suffix,
|
|
733
|
+
children: d
|
|
701
734
|
})
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
735
|
+
]
|
|
736
|
+
})
|
|
737
|
+
}), C && /* @__PURE__ */ m("div", {
|
|
738
|
+
id: x,
|
|
739
|
+
role: "alert",
|
|
740
|
+
className: _e.errorText,
|
|
741
|
+
children: y
|
|
742
|
+
})]
|
|
709
743
|
});
|
|
710
744
|
});
|
|
711
745
|
ye.displayName = "Input";
|
|
712
|
-
var
|
|
713
|
-
field: "
|
|
714
|
-
labelRow: "
|
|
715
|
-
track: "
|
|
716
|
-
trackInner: "
|
|
717
|
-
fillTrack: "
|
|
718
|
-
fill: "
|
|
719
|
-
trackAtMin: "
|
|
720
|
-
thumb: "
|
|
721
|
-
trackInactive: "
|
|
722
|
-
input: "
|
|
723
|
-
}, be =
|
|
724
|
-
let
|
|
725
|
-
let t =
|
|
746
|
+
var Y = {
|
|
747
|
+
field: "_field_x9zdb_1",
|
|
748
|
+
labelRow: "_labelRow_x9zdb_2",
|
|
749
|
+
track: "_track_x9zdb_4",
|
|
750
|
+
trackInner: "_trackInner_x9zdb_10",
|
|
751
|
+
fillTrack: "_fillTrack_x9zdb_16",
|
|
752
|
+
fill: "_fill_x9zdb_16",
|
|
753
|
+
trackAtMin: "_trackAtMin_x9zdb_31",
|
|
754
|
+
thumb: "_thumb_x9zdb_33",
|
|
755
|
+
trackInactive: "_trackInactive_x9zdb_53",
|
|
756
|
+
input: "_input_x9zdb_58"
|
|
757
|
+
}, be = r(({ value: e, onChange: t, min: n = 0, max: r = 100, step: i = 1, label: c, id: l, inactive: f = !1, className: p, valueText: g }, _) => {
|
|
758
|
+
let v = s(), y = l ?? v, b = u(null), [x, S] = d(() => {
|
|
759
|
+
let t = r - n;
|
|
726
760
|
return t === 0 ? 0 : Math.round((e - n) / t * 100);
|
|
727
|
-
}),
|
|
728
|
-
let t =
|
|
729
|
-
|
|
761
|
+
}), C = a(() => {
|
|
762
|
+
let t = r - n;
|
|
763
|
+
S(t === 0 ? 0 : Math.round((e - n) / t * 100));
|
|
730
764
|
}, [
|
|
731
765
|
e,
|
|
732
766
|
n,
|
|
733
|
-
|
|
767
|
+
r
|
|
734
768
|
]);
|
|
735
|
-
return
|
|
736
|
-
|
|
737
|
-
}, [
|
|
738
|
-
ref:
|
|
739
|
-
className:
|
|
740
|
-
children: [/* @__PURE__ */
|
|
741
|
-
className:
|
|
742
|
-
children: [/* @__PURE__ */
|
|
769
|
+
return o(() => {
|
|
770
|
+
C();
|
|
771
|
+
}, [C]), /* @__PURE__ */ h("div", {
|
|
772
|
+
ref: _,
|
|
773
|
+
className: F(Y.field, p),
|
|
774
|
+
children: [/* @__PURE__ */ h("div", {
|
|
775
|
+
className: Y.labelRow,
|
|
776
|
+
children: [/* @__PURE__ */ m(E, {
|
|
743
777
|
variant: "text-body-small-emphasis",
|
|
744
778
|
as: "label",
|
|
745
|
-
htmlFor:
|
|
746
|
-
children:
|
|
747
|
-
}), /* @__PURE__ */
|
|
779
|
+
htmlFor: y,
|
|
780
|
+
children: c
|
|
781
|
+
}), /* @__PURE__ */ m(E, {
|
|
748
782
|
variant: "text-body-small-emphasis",
|
|
749
783
|
as: "span",
|
|
750
784
|
children: e
|
|
751
785
|
})]
|
|
752
|
-
}), /* @__PURE__ */
|
|
753
|
-
ref:
|
|
754
|
-
className:
|
|
755
|
-
style: { "--slider-pct":
|
|
756
|
-
children: [/* @__PURE__ */
|
|
757
|
-
className:
|
|
758
|
-
children: [/* @__PURE__ */
|
|
759
|
-
className:
|
|
760
|
-
children: /* @__PURE__ */
|
|
761
|
-
}), /* @__PURE__ */
|
|
762
|
-
}), /* @__PURE__ */
|
|
786
|
+
}), /* @__PURE__ */ h("div", {
|
|
787
|
+
ref: b,
|
|
788
|
+
className: F(Y.track, f && Y.trackInactive, x === 0 && Y.trackAtMin),
|
|
789
|
+
style: { "--slider-pct": x },
|
|
790
|
+
children: [/* @__PURE__ */ h("div", {
|
|
791
|
+
className: Y.trackInner,
|
|
792
|
+
children: [/* @__PURE__ */ m("div", {
|
|
793
|
+
className: Y.fillTrack,
|
|
794
|
+
children: /* @__PURE__ */ m("div", { className: Y.fill })
|
|
795
|
+
}), /* @__PURE__ */ m("div", { className: Y.thumb })]
|
|
796
|
+
}), /* @__PURE__ */ m("input", {
|
|
763
797
|
type: "range",
|
|
764
|
-
id:
|
|
798
|
+
id: y,
|
|
765
799
|
min: n,
|
|
766
|
-
max:
|
|
767
|
-
step:
|
|
800
|
+
max: r,
|
|
801
|
+
step: i,
|
|
768
802
|
value: e,
|
|
769
803
|
onChange: (e) => {
|
|
770
804
|
t(Number(e.target.value));
|
|
771
805
|
},
|
|
772
|
-
disabled:
|
|
773
|
-
className:
|
|
774
|
-
"aria-
|
|
775
|
-
"aria-valuemax": o,
|
|
776
|
-
"aria-valuenow": e
|
|
806
|
+
disabled: f,
|
|
807
|
+
className: Y.input,
|
|
808
|
+
"aria-valuetext": g
|
|
777
809
|
})]
|
|
778
810
|
})]
|
|
779
811
|
});
|
|
780
812
|
});
|
|
781
813
|
be.displayName = "Slider";
|
|
782
|
-
var xe = { field: "_field_140we_1" }, Se =
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
814
|
+
var xe = { field: "_field_140we_1" }, Se = r(({ label: e, children: t, id: r, className: a }, o) => {
|
|
815
|
+
let c = s(), l = r ?? c, u = t;
|
|
816
|
+
return i(t) && t.props.id === void 0 && (u = n(t, { id: l })), /* @__PURE__ */ h("div", {
|
|
817
|
+
ref: o,
|
|
818
|
+
className: F(xe.field, a),
|
|
819
|
+
children: [/* @__PURE__ */ m(E, {
|
|
820
|
+
variant: "text-body-small-emphasis",
|
|
821
|
+
as: "label",
|
|
822
|
+
htmlFor: l,
|
|
823
|
+
children: e
|
|
824
|
+
}), u]
|
|
825
|
+
});
|
|
826
|
+
});
|
|
792
827
|
Se.displayName = "Field";
|
|
793
|
-
var
|
|
828
|
+
var Ce = {
|
|
794
829
|
backdrop: "_backdrop_k4mxw_1",
|
|
795
830
|
modalBackdropFadeIn: "_modalBackdropFadeIn_k4mxw_1",
|
|
796
831
|
closing: "_closing_k4mxw_15",
|
|
@@ -802,211 +837,303 @@ var q = {
|
|
|
802
837
|
subtitle: "_subtitle_k4mxw_55",
|
|
803
838
|
body: "_body_k4mxw_60",
|
|
804
839
|
footer: "_footer_k4mxw_65"
|
|
805
|
-
},
|
|
840
|
+
}, we = {
|
|
806
841
|
sm: "var(--dimension-modal-width-sm, 400px)",
|
|
807
842
|
md: "var(--dimension-modal-width-md, 560px)",
|
|
808
843
|
lg: "var(--dimension-modal-width-lg, 720px)"
|
|
809
|
-
},
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
844
|
+
}, Te = 220, Ee = [
|
|
845
|
+
"a[href]",
|
|
846
|
+
"area[href]",
|
|
847
|
+
"button:not([disabled])",
|
|
848
|
+
"input:not([disabled]):not([type=\"hidden\"])",
|
|
849
|
+
"select:not([disabled])",
|
|
850
|
+
"textarea:not([disabled])",
|
|
851
|
+
"iframe",
|
|
852
|
+
"object",
|
|
853
|
+
"embed",
|
|
854
|
+
"[contenteditable=\"true\"]",
|
|
855
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
856
|
+
].join(","), De = (e) => {
|
|
857
|
+
let t = e.querySelectorAll(Ee);
|
|
858
|
+
return Array.from(t).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true");
|
|
859
|
+
}, Oe = ({ isOpen: e, onClose: t, title: n, subtitle: r, children: i, footer: a, width: c = "md", bodyClassName: f, initialFocus: p }) => {
|
|
860
|
+
let g = u(null), _ = u(null), v = s(), b = s(), [x, S] = d(!1), [C, w] = d(e), T = l(() => c === "sm" || c === "md" || c === "lg" ? we[c] : c, [c]);
|
|
861
|
+
o(() => {
|
|
862
|
+
if (e) w(!0), S(!1);
|
|
863
|
+
else if (C) {
|
|
864
|
+
S(!0);
|
|
815
865
|
let e = setTimeout(() => {
|
|
816
|
-
|
|
817
|
-
},
|
|
866
|
+
w(!1), S(!1);
|
|
867
|
+
}, Te);
|
|
818
868
|
return () => clearTimeout(e);
|
|
819
869
|
}
|
|
820
|
-
}, [e,
|
|
870
|
+
}, [e, C]), o(() => {
|
|
821
871
|
if (!e) return;
|
|
822
872
|
let n = (e) => {
|
|
823
873
|
e.key === "Escape" && t();
|
|
824
874
|
};
|
|
825
875
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
826
|
-
}, [e, t]),
|
|
827
|
-
if (!e || !
|
|
876
|
+
}, [e, t]), o(() => {
|
|
877
|
+
if (!e || !C) return;
|
|
878
|
+
_.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
828
879
|
let t = requestAnimationFrame(() => {
|
|
829
|
-
|
|
880
|
+
let e = g.current;
|
|
881
|
+
if (!e) return;
|
|
882
|
+
if (p?.current) {
|
|
883
|
+
p.current.focus();
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
let t = De(e);
|
|
887
|
+
t.length > 0 ? t[0].focus() : e.focus();
|
|
830
888
|
});
|
|
831
|
-
return () =>
|
|
832
|
-
|
|
833
|
-
|
|
889
|
+
return () => {
|
|
890
|
+
cancelAnimationFrame(t);
|
|
891
|
+
let e = _.current;
|
|
892
|
+
e && document.contains(e) && e.focus(), _.current = null;
|
|
893
|
+
};
|
|
894
|
+
}, [
|
|
895
|
+
e,
|
|
896
|
+
C,
|
|
897
|
+
p
|
|
898
|
+
]);
|
|
899
|
+
let D = (e) => {
|
|
900
|
+
if (e.key !== "Tab") return;
|
|
901
|
+
let t = g.current;
|
|
902
|
+
if (!t) return;
|
|
903
|
+
let n = De(t);
|
|
904
|
+
if (n.length === 0) {
|
|
905
|
+
e.preventDefault(), t.focus();
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
909
|
+
e.shiftKey ? (a === r || a === t || !t.contains(a)) && (e.preventDefault(), i.focus()) : (a === i || !t.contains(a)) && (e.preventDefault(), r.focus());
|
|
910
|
+
};
|
|
911
|
+
if (!C) return null;
|
|
912
|
+
let O = r == null ? void 0 : b;
|
|
913
|
+
return y(/* @__PURE__ */ m("div", {
|
|
914
|
+
className: `${Ce.backdrop} ${x ? Ce.closing : ""}`,
|
|
834
915
|
onMouseDown: (e) => {
|
|
835
916
|
e.target === e.currentTarget && t();
|
|
836
917
|
},
|
|
837
|
-
|
|
838
|
-
|
|
918
|
+
onKeyDown: D,
|
|
919
|
+
children: /* @__PURE__ */ h(N, {
|
|
920
|
+
ref: g,
|
|
839
921
|
background: "primary",
|
|
840
922
|
elevation: "floating",
|
|
841
923
|
radius: "var(--dimension-radius-275, 22px)",
|
|
842
|
-
className:
|
|
843
|
-
style: { width: `min(${
|
|
924
|
+
className: Ce.dialog,
|
|
925
|
+
style: { width: `min(${T}, calc(100vw - 32px))` },
|
|
844
926
|
role: "dialog",
|
|
845
927
|
"aria-modal": "true",
|
|
846
|
-
"aria-labelledby":
|
|
928
|
+
"aria-labelledby": v,
|
|
929
|
+
"aria-describedby": O,
|
|
847
930
|
tabIndex: -1,
|
|
848
931
|
children: [
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
className:
|
|
851
|
-
children: [/* @__PURE__ */
|
|
852
|
-
id:
|
|
932
|
+
/* @__PURE__ */ h("div", {
|
|
933
|
+
className: Ce.header,
|
|
934
|
+
children: [/* @__PURE__ */ m(E, {
|
|
935
|
+
id: v,
|
|
853
936
|
as: "h2",
|
|
854
937
|
variant: "text-title-small",
|
|
855
938
|
children: n
|
|
856
|
-
}), r != null && /* @__PURE__ */
|
|
857
|
-
|
|
939
|
+
}), r != null && /* @__PURE__ */ m("div", {
|
|
940
|
+
id: b,
|
|
941
|
+
className: Ce.subtitle,
|
|
858
942
|
children: r
|
|
859
943
|
})]
|
|
860
944
|
}),
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
className: `${
|
|
863
|
-
children:
|
|
945
|
+
/* @__PURE__ */ m("div", {
|
|
946
|
+
className: `${Ce.body} ${f ?? ""}`.trim(),
|
|
947
|
+
children: i
|
|
864
948
|
}),
|
|
865
|
-
|
|
866
|
-
className:
|
|
867
|
-
children:
|
|
949
|
+
a != null && /* @__PURE__ */ m("div", {
|
|
950
|
+
className: Ce.footer,
|
|
951
|
+
children: a
|
|
868
952
|
})
|
|
869
953
|
]
|
|
870
954
|
})
|
|
871
|
-
}), document.body)
|
|
955
|
+
}), document.body);
|
|
872
956
|
};
|
|
873
|
-
|
|
874
|
-
var
|
|
875
|
-
menuItem: "
|
|
876
|
-
subtext: "
|
|
877
|
-
iconPrefix: "
|
|
878
|
-
menuItemSelected: "
|
|
879
|
-
content: "
|
|
880
|
-
label: "
|
|
881
|
-
menuItemLabelTertiary: "
|
|
882
|
-
menuItemNegative: "
|
|
883
|
-
menuItemInactive: "
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
957
|
+
Oe.displayName = "Modal";
|
|
958
|
+
var X = {
|
|
959
|
+
menuItem: "_menuItem_1yf1s_1",
|
|
960
|
+
subtext: "_subtext_1yf1s_15",
|
|
961
|
+
iconPrefix: "_iconPrefix_1yf1s_17",
|
|
962
|
+
menuItemSelected: "_menuItemSelected_1yf1s_24",
|
|
963
|
+
content: "_content_1yf1s_26",
|
|
964
|
+
label: "_label_1yf1s_34",
|
|
965
|
+
menuItemLabelTertiary: "_menuItemLabelTertiary_1yf1s_37",
|
|
966
|
+
menuItemNegative: "_menuItemNegative_1yf1s_38",
|
|
967
|
+
menuItemInactive: "_menuItemInactive_1yf1s_42",
|
|
968
|
+
menuItemActive: "_menuItemActive_1yf1s_44",
|
|
969
|
+
toggleSuffix: "_toggleSuffix_1yf1s_46",
|
|
970
|
+
toggle: "_toggle_1yf1s_46",
|
|
971
|
+
toggleOn: "_toggleOn_1yf1s_57",
|
|
972
|
+
toggleThumb: "_toggleThumb_1yf1s_59",
|
|
973
|
+
checkSuffix: "_checkSuffix_1yf1s_72",
|
|
974
|
+
chevronSuffix: "_chevronSuffix_1yf1s_79"
|
|
975
|
+
}, ke = r(({ label: e, onClick: t, isSelected: n = !1, isInactive: r = !1, icon: i, labelColor: a, subtext: o, showToggle: s = !1, toggleValue: c = !1, intent: l, selectionStyle: u = "highlight", showTrailingChevron: d = !1, checkIcon: f, chevronIcon: p, role: g, id: _, ariaSelected: v, isActive: y = !1, tabIndex: b, onKeyDown: x, onFocus: S }, C) => {
|
|
976
|
+
let w = u === "radio", T = n && !(u === "noOverlay" || w), D = g ?? (s ? "menuitemcheckbox" : w ? "menuitemradio" : "menuitem"), O = g ? void 0 : D === "menuitemcheckbox" ? !!c : D === "menuitemradio" ? !!n : void 0, k = g && v !== void 0 ? v : void 0;
|
|
977
|
+
return /* @__PURE__ */ h(N, {
|
|
978
|
+
ref: C,
|
|
894
979
|
as: "button",
|
|
895
980
|
interactive: !r,
|
|
896
|
-
selected:
|
|
981
|
+
selected: T,
|
|
897
982
|
radius: "sm",
|
|
898
|
-
className: `${
|
|
983
|
+
className: `${X.menuItem} ${n ? X.menuItemSelected : ""} ${r ? X.menuItemInactive : ""} ${l === "negative" ? X.menuItemNegative : ""} ${a === "tertiary" ? X.menuItemLabelTertiary : ""} ${y ? X.menuItemActive : ""}`,
|
|
899
984
|
onClick: t,
|
|
900
985
|
type: "button",
|
|
901
986
|
inactive: r,
|
|
987
|
+
role: D,
|
|
988
|
+
id: _,
|
|
989
|
+
"aria-checked": O,
|
|
990
|
+
"aria-selected": k,
|
|
991
|
+
"aria-disabled": r || void 0,
|
|
992
|
+
tabIndex: b,
|
|
993
|
+
onKeyDown: x,
|
|
994
|
+
onFocus: S,
|
|
902
995
|
children: [
|
|
903
|
-
i && /* @__PURE__ */
|
|
904
|
-
className:
|
|
905
|
-
|
|
996
|
+
i && /* @__PURE__ */ m("div", {
|
|
997
|
+
className: X.iconPrefix,
|
|
998
|
+
"aria-hidden": "true",
|
|
999
|
+
children: /* @__PURE__ */ m(i, { size: 20 })
|
|
906
1000
|
}),
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
className:
|
|
909
|
-
children: [/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ h("div", {
|
|
1002
|
+
className: X.content,
|
|
1003
|
+
children: [/* @__PURE__ */ m(E, {
|
|
910
1004
|
variant: n ? "text-body-medium-emphasis" : "text-body-medium",
|
|
911
1005
|
color: a,
|
|
912
1006
|
as: "span",
|
|
913
|
-
className:
|
|
1007
|
+
className: X.label,
|
|
914
1008
|
children: e
|
|
915
|
-
}), o && /* @__PURE__ */
|
|
1009
|
+
}), o && /* @__PURE__ */ m(E, {
|
|
916
1010
|
variant: "text-body-small",
|
|
917
1011
|
as: "span",
|
|
918
|
-
className:
|
|
1012
|
+
className: X.subtext,
|
|
919
1013
|
children: o
|
|
920
1014
|
})]
|
|
921
1015
|
}),
|
|
922
|
-
s && /* @__PURE__ */
|
|
923
|
-
className:
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1016
|
+
s && /* @__PURE__ */ m("div", {
|
|
1017
|
+
className: X.toggleSuffix,
|
|
1018
|
+
"aria-hidden": "true",
|
|
1019
|
+
children: /* @__PURE__ */ m("div", {
|
|
1020
|
+
className: `${X.toggle} ${c ? X.toggleOn : ""}`,
|
|
1021
|
+
children: /* @__PURE__ */ m("div", { className: X.toggleThumb })
|
|
927
1022
|
})
|
|
928
1023
|
}),
|
|
929
|
-
|
|
930
|
-
className:
|
|
931
|
-
|
|
1024
|
+
w && n && f && /* @__PURE__ */ m("div", {
|
|
1025
|
+
className: X.checkSuffix,
|
|
1026
|
+
"aria-hidden": "true",
|
|
1027
|
+
children: /* @__PURE__ */ m(f, { size: 20 })
|
|
932
1028
|
}),
|
|
933
|
-
d &&
|
|
934
|
-
className:
|
|
935
|
-
|
|
1029
|
+
d && p && /* @__PURE__ */ m("div", {
|
|
1030
|
+
className: X.chevronSuffix,
|
|
1031
|
+
"aria-hidden": "true",
|
|
1032
|
+
children: /* @__PURE__ */ m(p, { size: 20 })
|
|
936
1033
|
})
|
|
937
1034
|
]
|
|
938
1035
|
});
|
|
939
1036
|
});
|
|
940
|
-
|
|
941
|
-
var
|
|
1037
|
+
ke.displayName = "MenuItem";
|
|
1038
|
+
var Ae = {
|
|
942
1039
|
destructiveMenuItem: "_destructiveMenuItem_1t03u_1",
|
|
943
1040
|
subtext: "_subtext_1t03u_19",
|
|
944
1041
|
progressFill: "_progressFill_1t03u_21",
|
|
945
1042
|
content: "_content_1t03u_44",
|
|
946
1043
|
label: "_label_1t03u_53"
|
|
947
|
-
},
|
|
948
|
-
let [
|
|
949
|
-
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
1044
|
+
}, je = r(({ label: e, onClick: t, holdDuration: n = 4e3, subtext: r, tabIndex: i, onKeyDown: a, onFocus: s }, c) => {
|
|
1045
|
+
let [l, f] = d(0), p = u(null), g = u(0), _ = u(null), v = u(!1), y = () => {
|
|
1046
|
+
f(0), v.current = !1, p.current &&= (clearTimeout(p.current), null), _.current &&= (cancelAnimationFrame(_.current), null);
|
|
1047
|
+
}, b = () => {
|
|
1048
|
+
if (v.current) return;
|
|
1049
|
+
if (v.current = !0, n === 0) {
|
|
1050
|
+
t(), y();
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
g.current = performance.now();
|
|
1054
|
+
let e = () => {
|
|
1055
|
+
let t = performance.now() - g.current, r = Math.min(t / n * 100, 100);
|
|
1056
|
+
f(r), r < 100 && (_.current = requestAnimationFrame(e));
|
|
1057
|
+
};
|
|
1058
|
+
_.current = requestAnimationFrame(e), p.current = window.setTimeout(() => {
|
|
1059
|
+
t(), y();
|
|
1060
|
+
}, n);
|
|
1061
|
+
}, x = (e) => {
|
|
1062
|
+
e.stopPropagation(), e.preventDefault(), b();
|
|
1063
|
+
}, S = (e) => {
|
|
1064
|
+
e.stopPropagation(), y();
|
|
1065
|
+
}, C = (e) => {
|
|
1066
|
+
e.stopPropagation(), y();
|
|
1067
|
+
}, w = (e) => e.key === " " || e.key === "Spacebar";
|
|
1068
|
+
return o(() => () => {
|
|
1069
|
+
y();
|
|
1070
|
+
}, []), /* @__PURE__ */ h("button", {
|
|
1071
|
+
ref: c,
|
|
1072
|
+
className: Ae.destructiveMenuItem,
|
|
1073
|
+
onMouseDown: x,
|
|
1074
|
+
onMouseUp: S,
|
|
1075
|
+
onMouseLeave: C,
|
|
1076
|
+
onKeyDown: (e) => {
|
|
1077
|
+
if (w(e)) {
|
|
1078
|
+
if (e.preventDefault(), e.repeat) return;
|
|
1079
|
+
e.stopPropagation(), b();
|
|
959
1080
|
return;
|
|
960
1081
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
m.current = requestAnimationFrame(r), u.current = window.setTimeout(() => {
|
|
967
|
-
t(), h();
|
|
968
|
-
}, n);
|
|
1082
|
+
if (e.key === "Enter") {
|
|
1083
|
+
e.preventDefault();
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
a?.(e);
|
|
969
1087
|
},
|
|
970
|
-
|
|
971
|
-
e.stopPropagation(),
|
|
1088
|
+
onKeyUp: (e) => {
|
|
1089
|
+
w(e) && (e.preventDefault(), e.stopPropagation(), y());
|
|
972
1090
|
},
|
|
973
|
-
|
|
974
|
-
|
|
1091
|
+
onBlur: () => {
|
|
1092
|
+
y();
|
|
975
1093
|
},
|
|
1094
|
+
onFocus: s,
|
|
976
1095
|
type: "button",
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
className:
|
|
982
|
-
|
|
1096
|
+
role: "menuitem",
|
|
1097
|
+
tabIndex: i ?? -1,
|
|
1098
|
+
"aria-keyshortcuts": "Space",
|
|
1099
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1100
|
+
className: Ae.progressFill,
|
|
1101
|
+
style: { width: `${l}%` },
|
|
1102
|
+
role: "progressbar",
|
|
1103
|
+
"aria-valuenow": Math.round(l),
|
|
1104
|
+
"aria-valuemin": 0,
|
|
1105
|
+
"aria-valuemax": 100,
|
|
1106
|
+
"aria-label": `Hold to confirm ${e}`
|
|
1107
|
+
}), /* @__PURE__ */ h("div", {
|
|
1108
|
+
className: Ae.content,
|
|
1109
|
+
children: [/* @__PURE__ */ m(E, {
|
|
983
1110
|
variant: "text-body-medium",
|
|
984
1111
|
as: "span",
|
|
985
|
-
className:
|
|
1112
|
+
className: Ae.label,
|
|
986
1113
|
children: e
|
|
987
|
-
}), r && /* @__PURE__ */
|
|
1114
|
+
}), r && /* @__PURE__ */ m(E, {
|
|
988
1115
|
variant: "text-body-small",
|
|
989
1116
|
as: "span",
|
|
990
|
-
className:
|
|
1117
|
+
className: Ae.subtext,
|
|
991
1118
|
children: r
|
|
992
1119
|
})]
|
|
993
1120
|
})]
|
|
994
1121
|
});
|
|
995
1122
|
});
|
|
996
|
-
|
|
1123
|
+
je.displayName = "DestructiveMenuItem";
|
|
997
1124
|
//#endregion
|
|
998
1125
|
//#region src/utils/css-tokens.ts
|
|
999
|
-
function
|
|
1126
|
+
function Me(e, t) {
|
|
1000
1127
|
if (typeof document > "u") return t;
|
|
1001
1128
|
let n = getComputedStyle(document.documentElement).getPropertyValue(e).trim(), r = parseFloat(n);
|
|
1002
1129
|
return Number.isNaN(r) ? t : r;
|
|
1003
1130
|
}
|
|
1004
|
-
function
|
|
1131
|
+
function Ne(e, t) {
|
|
1005
1132
|
if (typeof document > "u") return t;
|
|
1006
1133
|
let n = getComputedStyle(document.documentElement).getPropertyValue(e).trim();
|
|
1007
1134
|
return n.endsWith("ms") ? parseFloat(n) || t : n.endsWith("s") && (parseFloat(n) || 0) * 1e3 || t;
|
|
1008
1135
|
}
|
|
1009
|
-
var
|
|
1136
|
+
var Pe = {
|
|
1010
1137
|
menuContainer: "_menuContainer_ljt4d_1",
|
|
1011
1138
|
menuFadeIn: "_menuFadeIn_ljt4d_1",
|
|
1012
1139
|
closing: "_closing_ljt4d_21",
|
|
@@ -1014,78 +1141,83 @@ var je = {
|
|
|
1014
1141
|
menuSection: "_menuSection_ljt4d_30",
|
|
1015
1142
|
sectionHeader: "_sectionHeader_ljt4d_37",
|
|
1016
1143
|
sectionLabel: "_sectionLabel_ljt4d_46"
|
|
1017
|
-
},
|
|
1018
|
-
let [
|
|
1144
|
+
}, Fe = 220, Ie = ({ isOpen: e, onClose: t, anchorRef: n, items: r, sections: i, side: s = "bottom", align: f = "start", sideOffset: p = 4, alignOffset: g = 0, sideOffsetToken: _, alignOffsetToken: v, width: b, minWidth: x, maxWidth: S, matchAnchorWidth: C = !1, matchAnchorWidthOffset: w = 0, usePortal: T = !0, role: D = "menu", id: O, ariaLabel: k, activeIndex: ee, getOptionId: A }) => {
|
|
1145
|
+
let j = D === "listbox", [M, P] = d(!1), [F, I] = d(e), [L, R] = d(!1), [z, te] = d({
|
|
1019
1146
|
x: 0,
|
|
1020
1147
|
y: 0
|
|
1021
|
-
}), [
|
|
1148
|
+
}), [B, ne] = d({
|
|
1022
1149
|
width: 0,
|
|
1023
1150
|
height: 0
|
|
1024
|
-
}), [
|
|
1151
|
+
}), [V, re] = d({
|
|
1025
1152
|
width: 0,
|
|
1026
1153
|
height: 0
|
|
1027
|
-
}),
|
|
1028
|
-
!
|
|
1029
|
-
let
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1154
|
+
}), [H, ie] = d(0), U = u(!1), W = u(null), ae = u([]), oe = u([]), G = u(!1), K = i || (r ? [{ items: r }] : []), q = K.some((e) => e.items.length > 0);
|
|
1155
|
+
!M && K.length > 0 && q && (ae.current = K);
|
|
1156
|
+
let se = M ? ae.current : K, J = l(() => {
|
|
1157
|
+
let e = [];
|
|
1158
|
+
return se.forEach((t) => {
|
|
1159
|
+
t.items.forEach((t) => e.push(t));
|
|
1160
|
+
}), e;
|
|
1161
|
+
}, [se]);
|
|
1162
|
+
o(() => {
|
|
1163
|
+
if (e) I(!0), P(!1), R(!1), U.current = !1;
|
|
1164
|
+
else if (F) {
|
|
1165
|
+
P(!0);
|
|
1034
1166
|
let e = setTimeout(() => {
|
|
1035
|
-
|
|
1036
|
-
},
|
|
1167
|
+
I(!1), P(!1), U.current = !1;
|
|
1168
|
+
}, Fe);
|
|
1037
1169
|
return () => clearTimeout(e);
|
|
1038
1170
|
}
|
|
1039
|
-
}, [e,
|
|
1040
|
-
if (!e || !
|
|
1171
|
+
}, [e, F]), c(() => {
|
|
1172
|
+
if (!e || !F || !W.current) return;
|
|
1041
1173
|
let t = () => {
|
|
1042
|
-
if (!
|
|
1043
|
-
let e =
|
|
1044
|
-
e.width > 0 && e.height > 0 &&
|
|
1174
|
+
if (!W.current) return;
|
|
1175
|
+
let e = W.current.getBoundingClientRect();
|
|
1176
|
+
e.width > 0 && e.height > 0 && ne({
|
|
1045
1177
|
width: e.width,
|
|
1046
1178
|
height: e.height
|
|
1047
1179
|
});
|
|
1048
1180
|
};
|
|
1049
1181
|
if (t(), requestAnimationFrame(() => requestAnimationFrame(t)), typeof ResizeObserver < "u") {
|
|
1050
1182
|
let e = new ResizeObserver(t);
|
|
1051
|
-
return e.observe(
|
|
1183
|
+
return e.observe(W.current), () => e.disconnect();
|
|
1052
1184
|
}
|
|
1053
1185
|
}, [
|
|
1054
1186
|
e,
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
]),
|
|
1058
|
-
if (!e || !
|
|
1187
|
+
F,
|
|
1188
|
+
K.length
|
|
1189
|
+
]), c(() => {
|
|
1190
|
+
if (!e || !F || !n.current || !W.current) return;
|
|
1059
1191
|
let t = () => {
|
|
1060
|
-
let e = n.current, t =
|
|
1192
|
+
let e = n.current, t = W.current;
|
|
1061
1193
|
if (!e || !t) return;
|
|
1062
|
-
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = i.width ||
|
|
1063
|
-
|
|
1194
|
+
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = i.width || B.width || 200, o = i.height || B.height || 160;
|
|
1195
|
+
re({
|
|
1064
1196
|
width: r.width,
|
|
1065
1197
|
height: r.height
|
|
1066
1198
|
});
|
|
1067
|
-
let c =
|
|
1199
|
+
let c = _ == null ? p : Me(_, 12), l = v == null ? g : Me(v, 4), u = 0, d = 0;
|
|
1068
1200
|
switch (s) {
|
|
1069
1201
|
case "top":
|
|
1070
|
-
|
|
1202
|
+
d = r.top - o - c, u = f === "start" ? r.left + l : f === "end" ? r.right - a + l : r.left + r.width / 2 - a / 2 + l;
|
|
1071
1203
|
break;
|
|
1072
1204
|
case "bottom":
|
|
1073
|
-
|
|
1205
|
+
d = r.bottom + c, u = f === "start" ? r.left + l : f === "end" ? r.right - a + l : r.left + r.width / 2 - a / 2 + l;
|
|
1074
1206
|
break;
|
|
1075
1207
|
case "left":
|
|
1076
|
-
|
|
1208
|
+
u = r.left - a - c, d = f === "start" ? r.top + l : f === "end" ? r.bottom - o + l : r.top + r.height / 2 - o / 2 + l;
|
|
1077
1209
|
break;
|
|
1078
1210
|
case "right":
|
|
1079
|
-
|
|
1211
|
+
u = r.right + c, d = f === "start" ? r.top + l : f === "end" ? r.bottom - o + l : r.top + r.height / 2 - o / 2 + l;
|
|
1080
1212
|
break;
|
|
1081
1213
|
}
|
|
1082
|
-
|
|
1083
|
-
x: Math.min(Math.max(
|
|
1084
|
-
y: Math.min(Math.max(
|
|
1085
|
-
}),
|
|
1214
|
+
te({
|
|
1215
|
+
x: Math.min(Math.max(u, 4), window.innerWidth - a - 4),
|
|
1216
|
+
y: Math.min(Math.max(d, 4), window.innerHeight - o - 4)
|
|
1217
|
+
}), U.current = !0, R(!0);
|
|
1086
1218
|
};
|
|
1087
|
-
|
|
1088
|
-
|
|
1219
|
+
U.current || (t(), requestAnimationFrame(() => {
|
|
1220
|
+
U.current || t();
|
|
1089
1221
|
}));
|
|
1090
1222
|
let r = () => t();
|
|
1091
1223
|
return window.addEventListener("scroll", r, !0), window.addEventListener("resize", r), () => {
|
|
@@ -1093,519 +1225,710 @@ var je = {
|
|
|
1093
1225
|
};
|
|
1094
1226
|
}, [
|
|
1095
1227
|
e,
|
|
1096
|
-
|
|
1228
|
+
F,
|
|
1097
1229
|
n,
|
|
1098
1230
|
s,
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
m,
|
|
1102
|
-
h,
|
|
1231
|
+
f,
|
|
1232
|
+
p,
|
|
1103
1233
|
g,
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1234
|
+
_,
|
|
1235
|
+
v,
|
|
1236
|
+
B.width,
|
|
1237
|
+
B.height,
|
|
1238
|
+
K.length,
|
|
1239
|
+
w
|
|
1240
|
+
]);
|
|
1241
|
+
let ce = a(() => {
|
|
1242
|
+
let e = document.activeElement;
|
|
1243
|
+
e && W.current?.contains(e) && n.current && n.current.focus(), t();
|
|
1244
|
+
}, [t, n]);
|
|
1245
|
+
o(() => {
|
|
1246
|
+
if (!e || !F) return;
|
|
1110
1247
|
let r = (e) => {
|
|
1111
1248
|
let r = e.target;
|
|
1112
|
-
|
|
1249
|
+
W.current?.contains(r) || n.current?.contains(r) || t();
|
|
1113
1250
|
};
|
|
1114
1251
|
return document.addEventListener("mousedown", r, !0), () => document.removeEventListener("mousedown", r, !0);
|
|
1115
1252
|
}, [
|
|
1116
1253
|
e,
|
|
1117
|
-
|
|
1254
|
+
F,
|
|
1118
1255
|
t,
|
|
1119
1256
|
n
|
|
1120
|
-
]),
|
|
1257
|
+
]), o(() => {
|
|
1121
1258
|
if (!e) return;
|
|
1122
1259
|
let n = (e) => {
|
|
1123
|
-
e.key === "Escape" && t();
|
|
1260
|
+
e.key === "Escape" && (j ? t() : (e.preventDefault(), ce()));
|
|
1124
1261
|
};
|
|
1125
1262
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
1126
|
-
}, [
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1263
|
+
}, [
|
|
1264
|
+
e,
|
|
1265
|
+
j,
|
|
1266
|
+
t,
|
|
1267
|
+
ce
|
|
1268
|
+
]), o(() => {
|
|
1269
|
+
if (!e) {
|
|
1270
|
+
G.current = !1;
|
|
1271
|
+
return;
|
|
1133
1272
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1273
|
+
if (j || !L || G.current) return;
|
|
1274
|
+
let t = J.findIndex((e) => !e.isInactive), n = t >= 0 ? t : 0;
|
|
1275
|
+
ie(n), oe.current[n]?.focus(), G.current = !0;
|
|
1276
|
+
}, [
|
|
1277
|
+
e,
|
|
1278
|
+
j,
|
|
1279
|
+
L,
|
|
1280
|
+
J
|
|
1281
|
+
]);
|
|
1282
|
+
let le = a((e) => {
|
|
1283
|
+
ie(e), oe.current[e]?.focus();
|
|
1284
|
+
}, []), ue = a((e) => {
|
|
1285
|
+
if (j || !J.length) return;
|
|
1286
|
+
let t = [];
|
|
1287
|
+
if (J.forEach((e, n) => {
|
|
1288
|
+
e.isInactive || t.push(n);
|
|
1289
|
+
}), !t.length) return;
|
|
1290
|
+
let n = t.indexOf(H), r = n < 0 ? 0 : n;
|
|
1291
|
+
switch (e.key) {
|
|
1292
|
+
case "ArrowDown":
|
|
1293
|
+
e.preventDefault(), e.stopPropagation(), le(t[(r + 1) % t.length]);
|
|
1294
|
+
break;
|
|
1295
|
+
case "ArrowUp":
|
|
1296
|
+
e.preventDefault(), e.stopPropagation(), le(t[(r - 1 + t.length) % t.length]);
|
|
1297
|
+
break;
|
|
1298
|
+
case "Home":
|
|
1299
|
+
e.preventDefault(), e.stopPropagation(), le(t[0]);
|
|
1300
|
+
break;
|
|
1301
|
+
case "End":
|
|
1302
|
+
e.preventDefault(), e.stopPropagation(), le(t[t.length - 1]);
|
|
1303
|
+
break;
|
|
1304
|
+
case "Tab":
|
|
1305
|
+
e.preventDefault(), ce();
|
|
1306
|
+
break;
|
|
1307
|
+
}
|
|
1308
|
+
}, [
|
|
1309
|
+
j,
|
|
1310
|
+
J,
|
|
1311
|
+
H,
|
|
1312
|
+
le,
|
|
1313
|
+
ce
|
|
1314
|
+
]);
|
|
1315
|
+
if (!F || se.length === 0) return null;
|
|
1316
|
+
let de = (e) => (t) => {
|
|
1317
|
+
oe.current[e] = t;
|
|
1318
|
+
}, fe = (e) => () => {
|
|
1319
|
+
ie(e);
|
|
1320
|
+
}, pe = (e) => {
|
|
1321
|
+
e.isInactive || (e.onClick(), !e.keepOpenOnClick && (j ? t() : ce()));
|
|
1322
|
+
}, me = (e, n, r) => {
|
|
1323
|
+
if (e.isDestructive) {
|
|
1324
|
+
let i = j ? -1 : H === r ? 0 : -1;
|
|
1325
|
+
return /* @__PURE__ */ m(je, {
|
|
1326
|
+
ref: de(r),
|
|
1327
|
+
label: e.label,
|
|
1328
|
+
subtext: e.subtext,
|
|
1329
|
+
holdDuration: e.holdDuration ?? 4e3,
|
|
1330
|
+
onClick: () => {
|
|
1331
|
+
e.onClick(), e.keepOpenOnClick || (j ? t() : ce());
|
|
1332
|
+
},
|
|
1333
|
+
tabIndex: i,
|
|
1334
|
+
onFocus: fe(r)
|
|
1335
|
+
}, n);
|
|
1336
|
+
}
|
|
1337
|
+
let i = j && A ? A(r) : void 0, a = j ? -1 : H === r ? 0 : -1;
|
|
1338
|
+
return /* @__PURE__ */ m(ke, {
|
|
1339
|
+
ref: de(r),
|
|
1340
|
+
icon: e.icon,
|
|
1341
|
+
label: e.label,
|
|
1342
|
+
subtext: e.subtext,
|
|
1343
|
+
onClick: () => pe(e),
|
|
1344
|
+
isSelected: e.isSelected,
|
|
1345
|
+
isInactive: e.isInactive,
|
|
1346
|
+
intent: e.intent,
|
|
1347
|
+
showToggle: e.showToggle,
|
|
1348
|
+
toggleValue: e.toggleValue,
|
|
1349
|
+
selectionStyle: e.selectionStyle,
|
|
1350
|
+
role: j ? "option" : void 0,
|
|
1351
|
+
id: i,
|
|
1352
|
+
ariaSelected: j ? !!e.isSelected : void 0,
|
|
1353
|
+
isActive: j && ee === r,
|
|
1354
|
+
tabIndex: a,
|
|
1355
|
+
onFocus: fe(r)
|
|
1356
|
+
}, n);
|
|
1357
|
+
}, he = {
|
|
1148
1358
|
position: "absolute",
|
|
1149
1359
|
left: 0,
|
|
1150
1360
|
top: 0,
|
|
1151
|
-
transform: `translate(${Math.round(
|
|
1361
|
+
transform: `translate(${Math.round(z.x)}px, ${Math.round(z.y)}px)`,
|
|
1152
1362
|
willChange: "transform",
|
|
1153
1363
|
zIndex: 9998,
|
|
1154
|
-
visibility:
|
|
1155
|
-
...
|
|
1156
|
-
...
|
|
1157
|
-
...
|
|
1158
|
-
},
|
|
1159
|
-
ref:
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1364
|
+
visibility: L ? "visible" : "hidden",
|
|
1365
|
+
...C && V.width > 0 ? { width: `${V.width + w}px` } : b ? { width: b } : {},
|
|
1366
|
+
...x ? { minWidth: x } : {},
|
|
1367
|
+
...S ? { maxWidth: S } : {}
|
|
1368
|
+
}, ge = 0, _e = k ?? (j ? void 0 : "Menu"), ve = /* @__PURE__ */ m("div", {
|
|
1369
|
+
ref: W,
|
|
1370
|
+
id: O,
|
|
1371
|
+
className: `${Pe.menuContainer} ${M ? Pe.closing : ""}`,
|
|
1372
|
+
style: he,
|
|
1373
|
+
role: D,
|
|
1374
|
+
"aria-label": _e,
|
|
1375
|
+
"aria-orientation": "vertical",
|
|
1376
|
+
onKeyDown: ue,
|
|
1377
|
+
children: se.map((e, t) => /* @__PURE__ */ h(N, {
|
|
1165
1378
|
as: "div",
|
|
1166
|
-
className:
|
|
1167
|
-
edge: t <
|
|
1379
|
+
className: Pe.menuSection,
|
|
1380
|
+
edge: t < se.length - 1 ? "bottom" : void 0,
|
|
1168
1381
|
elevation: "none",
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1382
|
+
role: e.header ? "group" : void 0,
|
|
1383
|
+
"aria-label": e.header,
|
|
1384
|
+
children: [e.header && /* @__PURE__ */ m("div", {
|
|
1385
|
+
className: Pe.sectionHeader,
|
|
1386
|
+
"aria-hidden": "true",
|
|
1387
|
+
children: /* @__PURE__ */ m(E, {
|
|
1172
1388
|
variant: "text-body-small-emphasis",
|
|
1173
1389
|
as: "span",
|
|
1174
|
-
className:
|
|
1390
|
+
className: Pe.sectionLabel,
|
|
1175
1391
|
children: e.header
|
|
1176
1392
|
})
|
|
1177
|
-
}), e.items.map((e, t) =>
|
|
1393
|
+
}), e.items.map((e, t) => me(e, t, ge++))]
|
|
1178
1394
|
}, t))
|
|
1179
1395
|
});
|
|
1180
|
-
return
|
|
1396
|
+
return T ? y(ve, document.body) : ve;
|
|
1181
1397
|
};
|
|
1182
|
-
|
|
1183
|
-
var
|
|
1398
|
+
Ie.displayName = "Menu";
|
|
1399
|
+
var Le = {
|
|
1184
1400
|
tooltip: "_tooltip_3kdaq_1",
|
|
1185
1401
|
tooltipFadeIn: "_tooltipFadeIn_3kdaq_1",
|
|
1186
1402
|
tooltipInner: "_tooltipInner_3kdaq_14",
|
|
1187
1403
|
keyHint: "_keyHint_3kdaq_21",
|
|
1188
1404
|
closing: "_closing_3kdaq_33",
|
|
1189
1405
|
tooltipFadeOut: "_tooltipFadeOut_3kdaq_1"
|
|
1190
|
-
},
|
|
1191
|
-
let
|
|
1192
|
-
|
|
1406
|
+
}, Re = 1e3, ze = 300, Be = 200, Ve = 0, He = ({ label: t, children: n, delay: r, side: i = "top", align: l = "center", sideOffset: f = 4, alignOffset: g = 0, shortcutKey: _, shortcutKeyPosition: v = "end", usePortal: b = !0 }) => {
|
|
1407
|
+
let x = Ne("--effect-animation-delay-medium-3", Re), S = r ?? x, C = u(null), w = u(null), T = s(), D = a((t) => {
|
|
1408
|
+
C.current = t;
|
|
1193
1409
|
let r = e.Children.only(n), i = "ref" in r ? r.ref : void 0;
|
|
1194
1410
|
typeof i == "function" ? i(t) : i && typeof i == "object" && (i.current = t);
|
|
1195
|
-
}, [n]), [
|
|
1411
|
+
}, [n]), [O, k] = d(!1), [ee, A] = d(!1), [j, M] = d(!1), [N, P] = d({
|
|
1196
1412
|
x: 0,
|
|
1197
1413
|
y: 0
|
|
1198
|
-
}), [
|
|
1414
|
+
}), [F, I] = d({
|
|
1199
1415
|
width: 0,
|
|
1200
1416
|
height: 0
|
|
1201
|
-
}),
|
|
1202
|
-
|
|
1203
|
-
},
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1417
|
+
}), L = u(null), R = u(null), z = () => {
|
|
1418
|
+
L.current &&= (clearTimeout(L.current), null);
|
|
1419
|
+
}, te = () => {
|
|
1420
|
+
if (z(), Date.now() - Ve < ze) {
|
|
1421
|
+
k(!0), M(!0), A(!1);
|
|
1206
1422
|
return;
|
|
1207
1423
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
},
|
|
1211
|
-
},
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
},
|
|
1424
|
+
L.current = setTimeout(() => {
|
|
1425
|
+
L.current = null, k(!0), M(!0), A(!1);
|
|
1426
|
+
}, S);
|
|
1427
|
+
}, B = () => {
|
|
1428
|
+
z(), R.current &&= (clearTimeout(R.current), null), !(!O && !j) && (Ve = Date.now(), A(!0), R.current = setTimeout(() => {
|
|
1429
|
+
R.current = null, M(!1), k(!1), A(!1);
|
|
1430
|
+
}, Be));
|
|
1215
1431
|
};
|
|
1216
|
-
|
|
1217
|
-
|
|
1432
|
+
o(() => () => {
|
|
1433
|
+
z(), R.current && clearTimeout(R.current);
|
|
1218
1434
|
}, []), o(() => {
|
|
1219
|
-
if (!
|
|
1435
|
+
if (!j) return;
|
|
1436
|
+
let e = (e) => {
|
|
1437
|
+
e.key === "Escape" && B();
|
|
1438
|
+
};
|
|
1439
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1440
|
+
}, [j]), c(() => {
|
|
1441
|
+
if (!j || !w.current) return;
|
|
1220
1442
|
let e = () => {
|
|
1221
|
-
if (!
|
|
1222
|
-
let e =
|
|
1223
|
-
t > 0 && n > 0 &&
|
|
1443
|
+
if (!w.current) return;
|
|
1444
|
+
let e = w.current.getBoundingClientRect(), t = e.width || w.current.offsetWidth, n = e.height || w.current.offsetHeight;
|
|
1445
|
+
t > 0 && n > 0 && I({
|
|
1224
1446
|
width: t,
|
|
1225
1447
|
height: n
|
|
1226
1448
|
});
|
|
1227
1449
|
};
|
|
1228
1450
|
if (e(), requestAnimationFrame(e), typeof ResizeObserver < "u") {
|
|
1229
1451
|
let t = new ResizeObserver(e);
|
|
1230
|
-
return t.observe(
|
|
1452
|
+
return t.observe(w.current), () => t.disconnect();
|
|
1231
1453
|
}
|
|
1232
1454
|
}, [
|
|
1233
|
-
|
|
1455
|
+
j,
|
|
1234
1456
|
t,
|
|
1235
|
-
|
|
1457
|
+
_,
|
|
1236
1458
|
v
|
|
1237
|
-
]),
|
|
1238
|
-
if (!
|
|
1459
|
+
]), c(() => {
|
|
1460
|
+
if (!j || !C.current || !w.current) return;
|
|
1239
1461
|
let e = () => {
|
|
1240
|
-
if (!
|
|
1241
|
-
let e =
|
|
1242
|
-
switch (
|
|
1462
|
+
if (!C.current || !w.current) return;
|
|
1463
|
+
let e = C.current.getBoundingClientRect(), t = w.current.getBoundingClientRect().width || F.width || 80, n = w.current.getBoundingClientRect().height || F.height || 24, r = 0, a = 0;
|
|
1464
|
+
switch (i) {
|
|
1243
1465
|
case "top":
|
|
1244
|
-
|
|
1466
|
+
a = e.top - n - f, r = l === "start" ? e.left + g : l === "end" ? e.right - t + g : e.left + e.width / 2 - t / 2 + g;
|
|
1245
1467
|
break;
|
|
1246
1468
|
case "bottom":
|
|
1247
|
-
|
|
1469
|
+
a = e.bottom + f, r = l === "start" ? e.left + g : l === "end" ? e.right - t + g : e.left + e.width / 2 - t / 2 + g;
|
|
1248
1470
|
break;
|
|
1249
1471
|
case "left":
|
|
1250
|
-
r = e.left - t -
|
|
1472
|
+
r = e.left - t - f, a = l === "start" ? e.top + g : l === "end" ? e.bottom - n + g : e.top + e.height / 2 - n / 2 + g;
|
|
1251
1473
|
break;
|
|
1252
1474
|
case "right":
|
|
1253
|
-
r = e.right +
|
|
1475
|
+
r = e.right + f, a = l === "start" ? e.top + g : l === "end" ? e.bottom - n + g : e.top + e.height / 2 - n / 2 + g;
|
|
1254
1476
|
break;
|
|
1255
1477
|
}
|
|
1256
|
-
|
|
1478
|
+
P({
|
|
1257
1479
|
x: Math.min(Math.max(r, 4), window.innerWidth - t - 4),
|
|
1258
|
-
y: Math.min(Math.max(
|
|
1480
|
+
y: Math.min(Math.max(a, 4), window.innerHeight - n - 4)
|
|
1259
1481
|
});
|
|
1260
1482
|
};
|
|
1261
1483
|
e(), requestAnimationFrame(() => requestAnimationFrame(e));
|
|
1262
1484
|
}, [
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1485
|
+
j,
|
|
1486
|
+
i,
|
|
1487
|
+
l,
|
|
1488
|
+
f,
|
|
1489
|
+
g,
|
|
1490
|
+
F.width,
|
|
1491
|
+
F.height,
|
|
1270
1492
|
t
|
|
1271
|
-
]),
|
|
1272
|
-
if (!
|
|
1493
|
+
]), o(() => {
|
|
1494
|
+
if (!j) return;
|
|
1273
1495
|
let e = () => {
|
|
1274
|
-
if (!
|
|
1275
|
-
let e =
|
|
1276
|
-
switch (
|
|
1496
|
+
if (!C.current || !w.current) return;
|
|
1497
|
+
let e = C.current.getBoundingClientRect(), t = F.width || 80, n = F.height || 24, r = 0, a = 0;
|
|
1498
|
+
switch (i) {
|
|
1277
1499
|
case "top":
|
|
1278
|
-
|
|
1500
|
+
a = e.top - n - f, r = l === "start" ? e.left + g : l === "end" ? e.right - t + g : e.left + e.width / 2 - t / 2 + g;
|
|
1279
1501
|
break;
|
|
1280
1502
|
case "bottom":
|
|
1281
|
-
|
|
1503
|
+
a = e.bottom + f, r = l === "start" ? e.left + g : l === "end" ? e.right - t + g : e.left + e.width / 2 - t / 2 + g;
|
|
1282
1504
|
break;
|
|
1283
1505
|
case "left":
|
|
1284
|
-
r = e.left - t -
|
|
1506
|
+
r = e.left - t - f, a = l === "start" ? e.top + g : l === "end" ? e.bottom - n + g : e.top + e.height / 2 - n / 2 + g;
|
|
1285
1507
|
break;
|
|
1286
1508
|
case "right":
|
|
1287
|
-
r = e.right +
|
|
1509
|
+
r = e.right + f, a = l === "start" ? e.top + g : l === "end" ? e.bottom - n + g : e.top + e.height / 2 - n / 2 + g;
|
|
1288
1510
|
break;
|
|
1289
1511
|
}
|
|
1290
|
-
|
|
1512
|
+
P({
|
|
1291
1513
|
x: Math.min(Math.max(r, 4), window.innerWidth - t - 4),
|
|
1292
|
-
y: Math.min(Math.max(
|
|
1514
|
+
y: Math.min(Math.max(a, 4), window.innerHeight - n - 4)
|
|
1293
1515
|
});
|
|
1294
1516
|
};
|
|
1295
1517
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
1296
1518
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
1297
1519
|
};
|
|
1298
1520
|
}, [
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1521
|
+
j,
|
|
1522
|
+
i,
|
|
1523
|
+
l,
|
|
1524
|
+
f,
|
|
1525
|
+
g,
|
|
1526
|
+
F.width,
|
|
1527
|
+
F.height
|
|
1306
1528
|
]);
|
|
1307
|
-
let
|
|
1308
|
-
className:
|
|
1529
|
+
let ne = _ ? /* @__PURE__ */ m("div", {
|
|
1530
|
+
className: Le.keyHint,
|
|
1309
1531
|
"aria-hidden": !0,
|
|
1310
|
-
children: /* @__PURE__ */
|
|
1532
|
+
children: /* @__PURE__ */ m(E, {
|
|
1311
1533
|
variant: "text-caption-emphasis",
|
|
1312
1534
|
as: "span",
|
|
1313
1535
|
color: "primary",
|
|
1314
|
-
children:
|
|
1536
|
+
children: _
|
|
1315
1537
|
})
|
|
1316
|
-
}) : null,
|
|
1317
|
-
ref:
|
|
1318
|
-
|
|
1538
|
+
}) : null, V = j ? /* @__PURE__ */ m("div", {
|
|
1539
|
+
ref: w,
|
|
1540
|
+
id: T,
|
|
1541
|
+
className: `${Le.tooltip} ${ee ? Le.closing : ""}`,
|
|
1319
1542
|
style: {
|
|
1320
1543
|
position: "fixed",
|
|
1321
1544
|
left: 0,
|
|
1322
1545
|
top: 0,
|
|
1323
|
-
transform: `translate(${Math.round(
|
|
1546
|
+
transform: `translate(${Math.round(N.x)}px, ${Math.round(N.y)}px)`,
|
|
1324
1547
|
willChange: "transform",
|
|
1325
1548
|
zIndex: 1e4
|
|
1326
1549
|
},
|
|
1327
1550
|
role: "tooltip",
|
|
1328
|
-
|
|
1329
|
-
|
|
1551
|
+
onMouseEnter: te,
|
|
1552
|
+
onMouseLeave: B,
|
|
1553
|
+
children: /* @__PURE__ */ h("div", {
|
|
1554
|
+
className: Le.tooltipInner,
|
|
1330
1555
|
children: [
|
|
1331
|
-
|
|
1332
|
-
/* @__PURE__ */
|
|
1556
|
+
_ && v === "start" && ne,
|
|
1557
|
+
/* @__PURE__ */ m(E, {
|
|
1333
1558
|
variant: "text-body-small",
|
|
1334
1559
|
as: "span",
|
|
1335
1560
|
color: "primary",
|
|
1336
1561
|
children: t
|
|
1337
1562
|
}),
|
|
1338
|
-
|
|
1563
|
+
_ && v === "end" && ne
|
|
1339
1564
|
]
|
|
1340
1565
|
})
|
|
1341
|
-
}) : null,
|
|
1342
|
-
return /* @__PURE__ */ p
|
|
1343
|
-
ref:
|
|
1566
|
+
}) : null, re = e.Children.only(n), H = e.isValidElement(re) ? re : null, ie = [H?.props["aria-describedby"], j ? T : void 0].filter(Boolean).join(" ") || void 0;
|
|
1567
|
+
return /* @__PURE__ */ h(p, { children: [H ? e.cloneElement(H, {
|
|
1568
|
+
ref: D,
|
|
1569
|
+
"aria-describedby": ie,
|
|
1344
1570
|
onMouseEnter: (e) => {
|
|
1345
|
-
|
|
1571
|
+
te(), H.props.onMouseEnter?.(e);
|
|
1346
1572
|
},
|
|
1347
1573
|
onMouseLeave: (e) => {
|
|
1348
|
-
|
|
1574
|
+
B(), H.props.onMouseLeave?.(e);
|
|
1575
|
+
},
|
|
1576
|
+
onFocus: (e) => {
|
|
1577
|
+
te(), H.props.onFocus?.(e);
|
|
1578
|
+
},
|
|
1579
|
+
onBlur: (e) => {
|
|
1580
|
+
B(), H.props.onBlur?.(e);
|
|
1349
1581
|
}
|
|
1350
|
-
}) : n,
|
|
1582
|
+
}) : n, b ? y(V, document.body) : V] });
|
|
1351
1583
|
};
|
|
1352
|
-
|
|
1353
|
-
var
|
|
1584
|
+
He.displayName = "Tooltip";
|
|
1585
|
+
var Ue = {
|
|
1354
1586
|
selectWrapper: "_selectWrapper_17kkf_1",
|
|
1355
1587
|
selectButton: "_selectButton_17kkf_6",
|
|
1356
1588
|
chevron: "_chevron_17kkf_26"
|
|
1357
|
-
},
|
|
1358
|
-
let [
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1589
|
+
}, We = r(({ value: e, onChange: t, options: n, placeholder: r = "Select option", className: i, inactive: c = !1, id: l, chevronIcon: f, "aria-label": p, "aria-labelledby": g }, _) => {
|
|
1590
|
+
let [v, y] = d(!1), [b, x] = d(-1), S = u(null), C = s(), w = l ?? `select-${C}`, T = `${w}-listbox`, D = a((e) => `${w}-option-${e}`, [w]), O = n.findIndex((t) => t.value === e), k = O >= 0 ? n[O] : void 0, ee = k?.label || r, A = a((e) => {
|
|
1591
|
+
let r = n[e];
|
|
1592
|
+
r && (t(r.value), y(!1));
|
|
1593
|
+
}, [n, t]), j = a((e) => {
|
|
1594
|
+
c || n.length === 0 || (x(Math.max(0, Math.min(n.length - 1, e))), y(!0));
|
|
1595
|
+
}, [c, n.length]);
|
|
1596
|
+
o(() => {
|
|
1597
|
+
x(v ? (e) => e >= 0 && e < n.length ? e : O >= 0 ? O : 0 : -1);
|
|
1598
|
+
}, [
|
|
1599
|
+
v,
|
|
1600
|
+
n.length,
|
|
1601
|
+
O
|
|
1602
|
+
]);
|
|
1603
|
+
let M = n.map((t, n) => ({
|
|
1604
|
+
label: t.label,
|
|
1605
|
+
onClick: () => A(n),
|
|
1606
|
+
isSelected: t.value === e
|
|
1607
|
+
})), P = () => {
|
|
1608
|
+
c || (v ? y(!1) : j(O >= 0 ? O : 0));
|
|
1609
|
+
}, F = (e) => {
|
|
1610
|
+
if (c || n.length === 0) return;
|
|
1611
|
+
let t = n.length - 1;
|
|
1612
|
+
if (!v) switch (e.key) {
|
|
1613
|
+
case "ArrowDown":
|
|
1614
|
+
case "ArrowUp":
|
|
1615
|
+
case "Enter":
|
|
1616
|
+
case " ":
|
|
1617
|
+
e.preventDefault(), j(O >= 0 ? O : 0);
|
|
1618
|
+
return;
|
|
1619
|
+
case "Home":
|
|
1620
|
+
e.preventDefault(), j(0);
|
|
1621
|
+
return;
|
|
1622
|
+
case "End":
|
|
1623
|
+
e.preventDefault(), j(t);
|
|
1624
|
+
return;
|
|
1625
|
+
default: return;
|
|
1626
|
+
}
|
|
1627
|
+
switch (e.key) {
|
|
1628
|
+
case "ArrowDown":
|
|
1629
|
+
e.preventDefault(), x((e) => Math.min(t, (e < 0 ? -1 : e) + 1));
|
|
1630
|
+
break;
|
|
1631
|
+
case "ArrowUp":
|
|
1632
|
+
e.preventDefault(), x((e) => Math.max(0, (e < 0 ? n.length : e) - 1));
|
|
1633
|
+
break;
|
|
1634
|
+
case "Home":
|
|
1635
|
+
e.preventDefault(), x(0);
|
|
1636
|
+
break;
|
|
1637
|
+
case "End":
|
|
1638
|
+
e.preventDefault(), x(t);
|
|
1639
|
+
break;
|
|
1640
|
+
case "Enter":
|
|
1641
|
+
case " ":
|
|
1642
|
+
e.preventDefault(), b >= 0 && A(b);
|
|
1643
|
+
break;
|
|
1644
|
+
case "Escape":
|
|
1645
|
+
e.preventDefault(), y(!1);
|
|
1646
|
+
break;
|
|
1647
|
+
case "Tab":
|
|
1648
|
+
y(!1);
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
}, I = v && b >= 0 ? D(b) : void 0;
|
|
1652
|
+
return /* @__PURE__ */ h("div", {
|
|
1653
|
+
ref: _,
|
|
1654
|
+
className: `${Ue.selectWrapper} ${i || ""}`,
|
|
1655
|
+
children: [/* @__PURE__ */ h(N, {
|
|
1656
|
+
id: w,
|
|
1657
|
+
ref: S,
|
|
1371
1658
|
as: "button",
|
|
1372
1659
|
type: "button",
|
|
1373
1660
|
elevation: "elevated",
|
|
1374
1661
|
radius: "sm",
|
|
1375
1662
|
interactive: !0,
|
|
1376
|
-
selected:
|
|
1377
|
-
className:
|
|
1378
|
-
onClick:
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1663
|
+
selected: v,
|
|
1664
|
+
className: Ue.selectButton,
|
|
1665
|
+
onClick: P,
|
|
1666
|
+
onKeyDown: F,
|
|
1667
|
+
inactive: c,
|
|
1668
|
+
role: "combobox",
|
|
1669
|
+
"aria-haspopup": "listbox",
|
|
1670
|
+
"aria-expanded": v,
|
|
1671
|
+
"aria-controls": v ? T : void 0,
|
|
1672
|
+
"aria-activedescendant": I,
|
|
1673
|
+
"aria-label": p,
|
|
1674
|
+
"aria-labelledby": g,
|
|
1675
|
+
children: [/* @__PURE__ */ m(E, {
|
|
1383
1676
|
variant: "text-body-medium",
|
|
1384
1677
|
as: "span",
|
|
1385
|
-
color:
|
|
1386
|
-
children:
|
|
1387
|
-
}),
|
|
1388
|
-
className:
|
|
1389
|
-
children: /* @__PURE__ */ f
|
|
1678
|
+
color: k ? "primary" : "secondary",
|
|
1679
|
+
children: ee
|
|
1680
|
+
}), f && /* @__PURE__ */ m("span", {
|
|
1681
|
+
className: Ue.chevron,
|
|
1682
|
+
children: /* @__PURE__ */ m(f, { size: 16 })
|
|
1390
1683
|
})]
|
|
1391
|
-
}), /* @__PURE__ */
|
|
1392
|
-
isOpen:
|
|
1393
|
-
onClose: () =>
|
|
1394
|
-
anchorRef:
|
|
1395
|
-
items:
|
|
1684
|
+
}), /* @__PURE__ */ m(Ie, {
|
|
1685
|
+
isOpen: v,
|
|
1686
|
+
onClose: () => y(!1),
|
|
1687
|
+
anchorRef: S,
|
|
1688
|
+
items: M,
|
|
1396
1689
|
side: "bottom",
|
|
1397
1690
|
align: "start",
|
|
1398
1691
|
sideOffset: 4,
|
|
1399
1692
|
alignOffset: -4,
|
|
1400
1693
|
matchAnchorWidth: !0,
|
|
1401
|
-
matchAnchorWidthOffset: 8
|
|
1694
|
+
matchAnchorWidthOffset: 8,
|
|
1695
|
+
role: "listbox",
|
|
1696
|
+
id: T,
|
|
1697
|
+
activeIndex: b,
|
|
1698
|
+
getOptionId: D
|
|
1402
1699
|
})]
|
|
1403
1700
|
});
|
|
1404
1701
|
});
|
|
1405
|
-
|
|
1406
|
-
var
|
|
1407
|
-
bannerWrapper: "
|
|
1408
|
-
banner: "
|
|
1409
|
-
bannerHeaderSurface: "
|
|
1410
|
-
bannerHeader: "
|
|
1411
|
-
bannerBody: "
|
|
1412
|
-
message: "
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1702
|
+
We.displayName = "Select";
|
|
1703
|
+
var Z = {
|
|
1704
|
+
bannerWrapper: "_bannerWrapper_1vv8f_1",
|
|
1705
|
+
banner: "_banner_1vv8f_1",
|
|
1706
|
+
bannerHeaderSurface: "_bannerHeaderSurface_1vv8f_10",
|
|
1707
|
+
bannerHeader: "_bannerHeader_1vv8f_10",
|
|
1708
|
+
bannerBody: "_bannerBody_1vv8f_30",
|
|
1709
|
+
message: "_message_1vv8f_38",
|
|
1710
|
+
dismiss: "_dismiss_1vv8f_46",
|
|
1711
|
+
floatingPosition: "_floatingPosition_1vv8f_79",
|
|
1712
|
+
floatingToast: "_floatingToast_1vv8f_87",
|
|
1713
|
+
toastFadeIn: "_toastFadeIn_1vv8f_1",
|
|
1714
|
+
closing: "_closing_1vv8f_93",
|
|
1715
|
+
toastFadeOut: "_toastFadeOut_1vv8f_1"
|
|
1716
|
+
}, Ge = 4e3, Ke = 200, qe = (e, t) => t === "bold" ? "var(--color-foreground-on-bold-background-primary)" : `var(--color-foreground-${t === "faint" ? "bold" : t === "medium" ? "strong" : "medium"}-${e})`, Je = ({ intent: e, contrast: t, message: n, header: r = !1, className: i = "", floating: s = !1, onDismiss: c, dismissLabel: l = "Dismiss" }) => {
|
|
1717
|
+
let f = Ne("--effect-animation-delay-long-2", Ge), p = qe(e, t), [g, v] = d(!1), b = u(null), x = u(null), S = a(() => {
|
|
1718
|
+
b.current && clearTimeout(b.current), x.current && clearTimeout(x.current), b.current = null, s ? (v(!0), x.current = setTimeout(() => {
|
|
1719
|
+
x.current = null, c?.();
|
|
1720
|
+
}, Ke)) : c?.();
|
|
1721
|
+
}, [s, c]), C = a(() => {
|
|
1722
|
+
b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
1723
|
+
b.current = null, S();
|
|
1724
|
+
}, f);
|
|
1725
|
+
}, [S, f]);
|
|
1726
|
+
o(() => (s && n && C(), () => {
|
|
1727
|
+
b.current && clearTimeout(b.current), x.current && clearTimeout(x.current);
|
|
1428
1728
|
}), [
|
|
1429
1729
|
s,
|
|
1430
1730
|
n,
|
|
1431
|
-
|
|
1731
|
+
C
|
|
1432
1732
|
]);
|
|
1433
|
-
let
|
|
1434
|
-
className: `${
|
|
1435
|
-
style: { "--banner-content":
|
|
1436
|
-
|
|
1733
|
+
let w = e === "negative", T = w ? "alert" : "status", D = w ? void 0 : "polite", O = /* @__PURE__ */ m("div", {
|
|
1734
|
+
className: `${Z.bannerWrapper} ${i}`.trim(),
|
|
1735
|
+
style: { "--banner-content": p },
|
|
1736
|
+
role: T,
|
|
1737
|
+
"aria-live": D,
|
|
1738
|
+
children: /* @__PURE__ */ h(N, {
|
|
1437
1739
|
elevation: s ? "floating" : "elevated",
|
|
1438
1740
|
intent: e,
|
|
1439
1741
|
contrast: t,
|
|
1440
1742
|
radius: "sm",
|
|
1441
|
-
className:
|
|
1442
|
-
children: [
|
|
1443
|
-
className:
|
|
1444
|
-
children: /* @__PURE__ */
|
|
1445
|
-
className:
|
|
1743
|
+
className: Z.banner,
|
|
1744
|
+
children: [r && /* @__PURE__ */ m("div", {
|
|
1745
|
+
className: Z.bannerHeaderSurface,
|
|
1746
|
+
children: /* @__PURE__ */ m("div", {
|
|
1747
|
+
className: Z.bannerHeader,
|
|
1446
1748
|
"aria-hidden": !0
|
|
1447
1749
|
})
|
|
1448
|
-
}), /* @__PURE__ */
|
|
1449
|
-
className:
|
|
1450
|
-
children: /* @__PURE__ */
|
|
1750
|
+
}), /* @__PURE__ */ h("div", {
|
|
1751
|
+
className: Z.bannerBody,
|
|
1752
|
+
children: [/* @__PURE__ */ m(E, {
|
|
1451
1753
|
variant: "text-body-medium",
|
|
1452
1754
|
as: "span",
|
|
1453
|
-
className:
|
|
1755
|
+
className: Z.message,
|
|
1454
1756
|
children: n
|
|
1455
|
-
})
|
|
1757
|
+
}), c && /* @__PURE__ */ m("button", {
|
|
1758
|
+
type: "button",
|
|
1759
|
+
className: Z.dismiss,
|
|
1760
|
+
onClick: S,
|
|
1761
|
+
"aria-label": l,
|
|
1762
|
+
children: /* @__PURE__ */ m(_, { size: 16 })
|
|
1763
|
+
})]
|
|
1456
1764
|
})]
|
|
1457
1765
|
})
|
|
1458
1766
|
});
|
|
1459
|
-
return s ?
|
|
1460
|
-
className:
|
|
1767
|
+
return s ? y(/* @__PURE__ */ m("div", {
|
|
1768
|
+
className: Z.floatingPosition,
|
|
1461
1769
|
style: { zIndex: 9998 },
|
|
1462
|
-
children: /* @__PURE__ */
|
|
1463
|
-
className: `${
|
|
1464
|
-
children:
|
|
1770
|
+
children: /* @__PURE__ */ m("div", {
|
|
1771
|
+
className: `${Z.floatingToast} ${g ? Z.closing : ""}`,
|
|
1772
|
+
children: O
|
|
1465
1773
|
})
|
|
1466
|
-
}), document.body) :
|
|
1774
|
+
}), document.body) : O;
|
|
1467
1775
|
};
|
|
1468
|
-
|
|
1469
|
-
var
|
|
1470
|
-
tableWrapper: "
|
|
1471
|
-
tableScroll: "
|
|
1472
|
-
table: "
|
|
1473
|
-
headerRow: "
|
|
1474
|
-
headerCell: "
|
|
1475
|
-
sortable: "
|
|
1476
|
-
sortIndicator: "
|
|
1477
|
-
row: "
|
|
1478
|
-
cell: "
|
|
1479
|
-
rowSelected: "
|
|
1480
|
-
rowClickable: "
|
|
1481
|
-
alignRight: "
|
|
1482
|
-
alignCenter: "
|
|
1483
|
-
emptyRow: "
|
|
1484
|
-
skeleton: "
|
|
1485
|
-
shimmer: "
|
|
1486
|
-
pagination: "
|
|
1487
|
-
pageButton: "
|
|
1776
|
+
Je.displayName = "Banner";
|
|
1777
|
+
var Q = {
|
|
1778
|
+
tableWrapper: "_tableWrapper_b4sqy_1",
|
|
1779
|
+
tableScroll: "_tableScroll_b4sqy_9",
|
|
1780
|
+
table: "_table_b4sqy_1",
|
|
1781
|
+
headerRow: "_headerRow_b4sqy_20",
|
|
1782
|
+
headerCell: "_headerCell_b4sqy_24",
|
|
1783
|
+
sortable: "_sortable_b4sqy_38",
|
|
1784
|
+
sortIndicator: "_sortIndicator_b4sqy_51",
|
|
1785
|
+
row: "_row_b4sqy_56",
|
|
1786
|
+
cell: "_cell_b4sqy_60",
|
|
1787
|
+
rowSelected: "_rowSelected_b4sqy_64",
|
|
1788
|
+
rowClickable: "_rowClickable_b4sqy_68",
|
|
1789
|
+
alignRight: "_alignRight_b4sqy_87",
|
|
1790
|
+
alignCenter: "_alignCenter_b4sqy_88",
|
|
1791
|
+
emptyRow: "_emptyRow_b4sqy_90",
|
|
1792
|
+
skeleton: "_skeleton_b4sqy_98",
|
|
1793
|
+
shimmer: "_shimmer_b4sqy_1",
|
|
1794
|
+
pagination: "_pagination_b4sqy_112",
|
|
1795
|
+
pageButton: "_pageButton_b4sqy_122"
|
|
1488
1796
|
};
|
|
1489
1797
|
//#endregion
|
|
1490
1798
|
//#region src/components/Table/Table.tsx
|
|
1491
|
-
function
|
|
1799
|
+
function Ye(e, t) {
|
|
1492
1800
|
if (e.accessorKey) return t[e.accessorKey];
|
|
1493
1801
|
if (e.accessor) return e.accessor(t);
|
|
1494
1802
|
}
|
|
1495
|
-
function
|
|
1803
|
+
function Xe(e, t, n) {
|
|
1496
1804
|
let r = n === "asc" ? 1 : -1;
|
|
1497
1805
|
return e == null && t == null ? 0 : e == null ? r : t == null ? -r : typeof e == "number" && typeof t == "number" ? (e - t) * r : String(e).localeCompare(String(t)) * r;
|
|
1498
1806
|
}
|
|
1499
|
-
function
|
|
1500
|
-
let
|
|
1807
|
+
function Ze({ columns: e, data: t, sortState: n, onSort: r, className: i, onRowClick: a, selectedRows: o, loading: s = !1, pagination: c, onPaginationChange: u, emptyMessage: d = "No results found." }) {
|
|
1808
|
+
let f = l(() => e.filter((e) => !e.hide), [e]), p = l(() => f.map((e) => e.width ? typeof e.width == "number" ? `${e.width}px` : e.width : "minmax(120px, 1fr)").join(" "), [f]), g = l(() => {
|
|
1501
1809
|
if (!n) return t;
|
|
1502
1810
|
let r = e.find((e) => e.id === n.columnId);
|
|
1503
|
-
return r ? [...t].sort((e, t) =>
|
|
1811
|
+
return r ? [...t].sort((e, t) => Xe(Ye(r, e), Ye(r, t), n.direction)) : t;
|
|
1504
1812
|
}, [
|
|
1505
1813
|
t,
|
|
1506
1814
|
e,
|
|
1507
1815
|
n
|
|
1508
|
-
]), _ =
|
|
1509
|
-
if (!
|
|
1510
|
-
let e =
|
|
1511
|
-
return g.slice(e, e +
|
|
1512
|
-
}, [g,
|
|
1816
|
+
]), _ = l(() => {
|
|
1817
|
+
if (!c) return g;
|
|
1818
|
+
let e = c.pageIndex * c.pageSize;
|
|
1819
|
+
return g.slice(e, e + c.pageSize);
|
|
1820
|
+
}, [g, c]), v = c ? Math.ceil(g.length / c.pageSize) : 1, y = !s && _.length === 0, b = (e) => {
|
|
1513
1821
|
r && r(e);
|
|
1514
1822
|
};
|
|
1515
|
-
return /* @__PURE__ */
|
|
1516
|
-
className:
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1823
|
+
return /* @__PURE__ */ h("div", {
|
|
1824
|
+
className: F(Q.tableWrapper, i),
|
|
1825
|
+
"aria-busy": s || void 0,
|
|
1826
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1827
|
+
className: Q.tableScroll,
|
|
1828
|
+
children: /* @__PURE__ */ h("div", {
|
|
1829
|
+
className: Q.table,
|
|
1830
|
+
style: { gridTemplateColumns: p },
|
|
1522
1831
|
role: "table",
|
|
1523
1832
|
children: [
|
|
1524
|
-
/* @__PURE__ */
|
|
1525
|
-
className:
|
|
1833
|
+
/* @__PURE__ */ m("div", {
|
|
1834
|
+
className: Q.headerRow,
|
|
1526
1835
|
role: "row",
|
|
1527
|
-
children:
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
"
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1836
|
+
children: f.map((e) => {
|
|
1837
|
+
let t = n?.columnId === e.id, r = e.sortable ? t ? n.direction === "asc" ? "ascending" : "descending" : "none" : void 0, i = () => e.sortable && b(e.id);
|
|
1838
|
+
return /* @__PURE__ */ h("div", {
|
|
1839
|
+
className: F(Q.headerCell, e.sortable && Q.sortable, e.align === "right" && Q.alignRight, e.align === "center" && Q.alignCenter),
|
|
1840
|
+
role: "columnheader",
|
|
1841
|
+
"aria-sort": r,
|
|
1842
|
+
tabIndex: e.sortable ? 0 : void 0,
|
|
1843
|
+
onClick: i,
|
|
1844
|
+
onKeyDown: e.sortable ? (e) => {
|
|
1845
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
|
|
1846
|
+
} : void 0,
|
|
1847
|
+
style: e.minWidth ? { minWidth: typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth } : void 0,
|
|
1848
|
+
children: [typeof e.header == "string" ? /* @__PURE__ */ m(E, {
|
|
1849
|
+
variant: "text-body-small-emphasis",
|
|
1850
|
+
as: "span",
|
|
1851
|
+
color: "secondary",
|
|
1852
|
+
children: e.header
|
|
1853
|
+
}) : e.header, t && /* @__PURE__ */ m("span", {
|
|
1854
|
+
className: Q.sortIndicator,
|
|
1855
|
+
"aria-hidden": !0,
|
|
1856
|
+
children: n.direction === "asc" ? "↑" : "↓"
|
|
1857
|
+
})]
|
|
1858
|
+
}, e.id);
|
|
1859
|
+
})
|
|
1543
1860
|
}),
|
|
1544
|
-
|
|
1545
|
-
className:
|
|
1546
|
-
role: "row",
|
|
1547
|
-
|
|
1548
|
-
|
|
1861
|
+
s && Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ m("div", {
|
|
1862
|
+
className: Q.row,
|
|
1863
|
+
role: t === 0 ? "status" : "row",
|
|
1864
|
+
"aria-label": t === 0 ? "Loading" : void 0,
|
|
1865
|
+
children: f.map((e) => /* @__PURE__ */ m("div", {
|
|
1866
|
+
className: Q.cell,
|
|
1549
1867
|
role: "cell",
|
|
1550
|
-
children: /* @__PURE__ */
|
|
1868
|
+
children: /* @__PURE__ */ m("div", { className: Q.skeleton })
|
|
1551
1869
|
}, e.id))
|
|
1552
1870
|
}, `skeleton-${t}`)),
|
|
1553
|
-
y && /* @__PURE__ */
|
|
1554
|
-
className:
|
|
1871
|
+
y && /* @__PURE__ */ m("div", {
|
|
1872
|
+
className: Q.emptyRow,
|
|
1555
1873
|
style: { gridColumn: "1 / -1" },
|
|
1556
|
-
children: /* @__PURE__ */
|
|
1874
|
+
children: /* @__PURE__ */ m(E, {
|
|
1557
1875
|
variant: "text-body-medium",
|
|
1558
1876
|
as: "p",
|
|
1559
1877
|
color: "secondary",
|
|
1560
1878
|
children: d
|
|
1561
1879
|
})
|
|
1562
1880
|
}),
|
|
1563
|
-
!
|
|
1564
|
-
let n = o?.has(t);
|
|
1565
|
-
return /* @__PURE__ */
|
|
1566
|
-
className:
|
|
1881
|
+
!s && _.map((e, t) => {
|
|
1882
|
+
let n = o?.has(t), r = !!a;
|
|
1883
|
+
return /* @__PURE__ */ m("div", {
|
|
1884
|
+
className: F(Q.row, n && Q.rowSelected, r && Q.rowClickable),
|
|
1567
1885
|
role: "row",
|
|
1886
|
+
tabIndex: r ? 0 : void 0,
|
|
1887
|
+
"aria-selected": o ? !!n : void 0,
|
|
1568
1888
|
onClick: () => a?.(e, t),
|
|
1569
|
-
|
|
1570
|
-
|
|
1889
|
+
onKeyDown: r ? (n) => {
|
|
1890
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), a?.(e, t));
|
|
1891
|
+
} : void 0,
|
|
1892
|
+
children: f.map((n) => /* @__PURE__ */ m("div", {
|
|
1893
|
+
className: F(Q.cell, n.align === "right" && Q.alignRight, n.align === "center" && Q.alignCenter),
|
|
1571
1894
|
role: "cell",
|
|
1572
|
-
children: n.renderCell ? n.renderCell(e, t) : /* @__PURE__ */
|
|
1895
|
+
children: n.renderCell ? n.renderCell(e, t) : /* @__PURE__ */ m(E, {
|
|
1573
1896
|
variant: "text-body-medium",
|
|
1574
1897
|
as: "span",
|
|
1575
1898
|
lineTruncation: 1,
|
|
1576
|
-
children: String(
|
|
1899
|
+
children: String(Ye(n, e) ?? "")
|
|
1577
1900
|
})
|
|
1578
1901
|
}, n.id))
|
|
1579
1902
|
}, t);
|
|
1580
1903
|
})
|
|
1581
1904
|
]
|
|
1582
1905
|
})
|
|
1583
|
-
}),
|
|
1584
|
-
className:
|
|
1906
|
+
}), c && u && v > 1 && /* @__PURE__ */ h("div", {
|
|
1907
|
+
className: Q.pagination,
|
|
1585
1908
|
children: [
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
className:
|
|
1588
|
-
disabled:
|
|
1589
|
-
onClick: () => u(
|
|
1909
|
+
/* @__PURE__ */ m("button", {
|
|
1910
|
+
className: Q.pageButton,
|
|
1911
|
+
disabled: c.pageIndex === 0,
|
|
1912
|
+
onClick: () => u(c.pageIndex - 1, c.pageSize),
|
|
1590
1913
|
type: "button",
|
|
1591
|
-
children: /* @__PURE__ */
|
|
1914
|
+
children: /* @__PURE__ */ m(E, {
|
|
1592
1915
|
variant: "text-body-small",
|
|
1593
1916
|
as: "span",
|
|
1594
1917
|
children: "Previous"
|
|
1595
1918
|
})
|
|
1596
1919
|
}),
|
|
1597
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ m(E, {
|
|
1598
1921
|
variant: "text-body-small",
|
|
1599
1922
|
as: "span",
|
|
1600
1923
|
color: "secondary",
|
|
1601
|
-
children: `Page ${
|
|
1924
|
+
children: `Page ${c.pageIndex + 1} of ${v}`
|
|
1602
1925
|
}),
|
|
1603
|
-
/* @__PURE__ */
|
|
1604
|
-
className:
|
|
1605
|
-
disabled:
|
|
1606
|
-
onClick: () => u(
|
|
1926
|
+
/* @__PURE__ */ m("button", {
|
|
1927
|
+
className: Q.pageButton,
|
|
1928
|
+
disabled: c.pageIndex >= v - 1,
|
|
1929
|
+
onClick: () => u(c.pageIndex + 1, c.pageSize),
|
|
1607
1930
|
type: "button",
|
|
1608
|
-
children: /* @__PURE__ */
|
|
1931
|
+
children: /* @__PURE__ */ m(E, {
|
|
1609
1932
|
variant: "text-body-small",
|
|
1610
1933
|
as: "span",
|
|
1611
1934
|
children: "Next"
|
|
@@ -1615,62 +1938,68 @@ function Je({ columns: e, data: t, sortState: n, onSort: r, className: i, onRowC
|
|
|
1615
1938
|
})]
|
|
1616
1939
|
});
|
|
1617
1940
|
}
|
|
1618
|
-
|
|
1619
|
-
var
|
|
1941
|
+
Ze.displayName = "Table";
|
|
1942
|
+
var Qe = {
|
|
1620
1943
|
tab: "_tab_7ngwl_5",
|
|
1621
1944
|
tabSelected: "_tabSelected_7ngwl_33",
|
|
1622
1945
|
onMedium: "_onMedium_7ngwl_39",
|
|
1623
1946
|
onBold: "_onBold_7ngwl_44",
|
|
1624
1947
|
onStrong: "_onStrong_7ngwl_52",
|
|
1625
1948
|
onAlwaysDark: "_onAlwaysDark_7ngwl_60"
|
|
1626
|
-
},
|
|
1627
|
-
let
|
|
1628
|
-
return /* @__PURE__ */
|
|
1629
|
-
ref:
|
|
1949
|
+
}, $e = r(({ id: e, controls: t, label: n, isSelected: r = !1, disabled: i = !1, background: a, onClick: o, onKeyDown: s, onFocus: c, tabIndex: l, className: u }, d) => {
|
|
1950
|
+
let f = a && a !== "faint" ? Qe[a === "always-dark" ? "onAlwaysDark" : `on${a.charAt(0).toUpperCase() + a.slice(1)}`] : void 0, p = l ?? (r ? 0 : -1);
|
|
1951
|
+
return /* @__PURE__ */ m("button", {
|
|
1952
|
+
ref: d,
|
|
1630
1953
|
id: e,
|
|
1631
|
-
className:
|
|
1632
|
-
onClick:
|
|
1954
|
+
className: F(Qe.tab, r && Qe.tabSelected, f, u),
|
|
1955
|
+
onClick: o,
|
|
1956
|
+
onKeyDown: s,
|
|
1957
|
+
onFocus: c,
|
|
1633
1958
|
type: "button",
|
|
1634
|
-
"aria-selected": n,
|
|
1635
1959
|
role: "tab",
|
|
1636
|
-
|
|
1637
|
-
|
|
1960
|
+
"aria-selected": r,
|
|
1961
|
+
"aria-controls": t,
|
|
1962
|
+
"aria-disabled": i || void 0,
|
|
1963
|
+
disabled: i,
|
|
1964
|
+
tabIndex: p,
|
|
1965
|
+
children: /* @__PURE__ */ m(E, {
|
|
1966
|
+
variant: r ? "text-body-medium-emphasis" : "text-body-medium",
|
|
1638
1967
|
as: "span",
|
|
1639
|
-
children:
|
|
1968
|
+
children: n
|
|
1640
1969
|
})
|
|
1641
1970
|
});
|
|
1642
1971
|
});
|
|
1643
|
-
|
|
1644
|
-
var
|
|
1972
|
+
$e.displayName = "Tab";
|
|
1973
|
+
var et = { emptyState: "_emptyState_1988v_1" }, tt = {
|
|
1645
1974
|
"no-content": "No page contents to display.",
|
|
1646
1975
|
"no-results": "No results found.",
|
|
1647
1976
|
"no-results-filter": "No results found. Please update search criteria.",
|
|
1648
1977
|
"no-access": "You don't have access to this page."
|
|
1649
|
-
},
|
|
1978
|
+
}, nt = r(({ type: e = "no-content", message: t, className: n }, r) => /* @__PURE__ */ m("div", {
|
|
1650
1979
|
ref: r,
|
|
1651
|
-
className:
|
|
1652
|
-
children: /* @__PURE__ */
|
|
1980
|
+
className: F(et.emptyState, n),
|
|
1981
|
+
children: /* @__PURE__ */ m(E, {
|
|
1653
1982
|
variant: "text-body-medium",
|
|
1654
1983
|
as: "p",
|
|
1655
1984
|
color: "secondary",
|
|
1656
|
-
children: t ||
|
|
1985
|
+
children: t || tt[e]
|
|
1657
1986
|
})
|
|
1658
1987
|
}));
|
|
1659
|
-
|
|
1660
|
-
var
|
|
1988
|
+
nt.displayName = "EmptyState";
|
|
1989
|
+
var rt = {
|
|
1661
1990
|
fade: "_fade_8nnao_1",
|
|
1662
1991
|
fadeTop: "_fadeTop_8nnao_13",
|
|
1663
1992
|
fadeBottom: "_fadeBottom_8nnao_18",
|
|
1664
1993
|
fadeLeft: "_fadeLeft_8nnao_23",
|
|
1665
1994
|
fadeRight: "_fadeRight_8nnao_28"
|
|
1666
|
-
},
|
|
1995
|
+
}, it = {
|
|
1667
1996
|
top: "fadeTop",
|
|
1668
1997
|
bottom: "fadeBottom",
|
|
1669
1998
|
left: "fadeLeft",
|
|
1670
1999
|
right: "fadeRight"
|
|
1671
|
-
},
|
|
2000
|
+
}, at = r(({ side: e, height: t, background: n = "var(--color-background-secondary)", className: r, style: i = {} }, a) => /* @__PURE__ */ m("div", {
|
|
1672
2001
|
ref: a,
|
|
1673
|
-
className:
|
|
2002
|
+
className: F(rt.fade, rt[it[e]], r),
|
|
1674
2003
|
style: {
|
|
1675
2004
|
...i,
|
|
1676
2005
|
height: t,
|
|
@@ -1678,22 +2007,22 @@ var et = {
|
|
|
1678
2007
|
},
|
|
1679
2008
|
"aria-hidden": "true"
|
|
1680
2009
|
}));
|
|
1681
|
-
|
|
1682
|
-
var
|
|
1683
|
-
container: "
|
|
1684
|
-
content: "
|
|
1685
|
-
track: "
|
|
1686
|
-
thumb: "
|
|
1687
|
-
trackHorizontal: "
|
|
1688
|
-
thumbHorizontal: "
|
|
1689
|
-
thick: "
|
|
1690
|
-
},
|
|
1691
|
-
let
|
|
1692
|
-
|
|
1693
|
-
}, [
|
|
1694
|
-
|
|
1695
|
-
}, []), R =
|
|
1696
|
-
let e =
|
|
2010
|
+
at.displayName = "Fade";
|
|
2011
|
+
var ot = {
|
|
2012
|
+
container: "_container_1pmuk_1",
|
|
2013
|
+
content: "_content_1pmuk_8",
|
|
2014
|
+
track: "_track_1pmuk_25",
|
|
2015
|
+
thumb: "_thumb_1pmuk_40",
|
|
2016
|
+
trackHorizontal: "_trackHorizontal_1pmuk_54",
|
|
2017
|
+
thumbHorizontal: "_thumbHorizontal_1pmuk_69",
|
|
2018
|
+
thick: "_thick_1pmuk_83"
|
|
2019
|
+
}, st = ({ children: e, className: t, variant: n = "default", showTrackOnHover: r = !0, onScroll: i, fadeOverlay: s, contentRef: c }) => {
|
|
2020
|
+
let l = u(null), f = u(null), p = c || f, g = u(null), _ = u(null), [v, y] = d(0), [b, x] = d(0), [S, C] = d(0), [w, T] = d(0), [E, D] = d(!1), [O, k] = d(!1), [ee, A] = d(!1), j = u(0), M = u(0), N = u(0), P = u(0), I = a(() => {
|
|
2021
|
+
r && A(!0);
|
|
2022
|
+
}, [r]), L = a(() => {
|
|
2023
|
+
A(!1);
|
|
2024
|
+
}, []), R = a(() => {
|
|
2025
|
+
let e = l.current, t = p.current;
|
|
1697
2026
|
if (!e || !t) return;
|
|
1698
2027
|
let n = e.clientHeight, r = e.clientWidth, i = t.scrollHeight, a = t.scrollWidth, o = t.scrollTop, s = t.scrollLeft;
|
|
1699
2028
|
if (i <= n) y(0);
|
|
@@ -1706,20 +2035,20 @@ var rt = {
|
|
|
1706
2035
|
let e = r / a, t = Math.max(20, r * e);
|
|
1707
2036
|
C(t), T(s / (a - r) * (r - t));
|
|
1708
2037
|
}
|
|
1709
|
-
}, [
|
|
1710
|
-
|
|
1711
|
-
let e =
|
|
2038
|
+
}, [p]);
|
|
2039
|
+
o(() => {
|
|
2040
|
+
let e = p.current;
|
|
1712
2041
|
if (!e) return;
|
|
1713
2042
|
let t = (e) => {
|
|
1714
|
-
R(),
|
|
2043
|
+
R(), i && i(e);
|
|
1715
2044
|
};
|
|
1716
2045
|
return e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t);
|
|
1717
2046
|
}, [
|
|
1718
2047
|
R,
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
]),
|
|
1722
|
-
let e =
|
|
2048
|
+
i,
|
|
2049
|
+
p
|
|
2050
|
+
]), o(() => {
|
|
2051
|
+
let e = p.current;
|
|
1723
2052
|
if (!e) return;
|
|
1724
2053
|
let t = () => R();
|
|
1725
2054
|
if (window.addEventListener("resize", t), typeof ResizeObserver < "u") {
|
|
@@ -1729,84 +2058,87 @@ var rt = {
|
|
|
1729
2058
|
};
|
|
1730
2059
|
}
|
|
1731
2060
|
return () => window.removeEventListener("resize", t);
|
|
1732
|
-
}, [R,
|
|
2061
|
+
}, [R, p]), o(() => {
|
|
1733
2062
|
R();
|
|
1734
2063
|
}, [R, e]);
|
|
1735
|
-
let
|
|
2064
|
+
let z = a((e) => {
|
|
1736
2065
|
e.preventDefault(), e.stopPropagation();
|
|
1737
|
-
let t =
|
|
2066
|
+
let t = p.current;
|
|
1738
2067
|
if (!t) return;
|
|
1739
|
-
D(!0),
|
|
2068
|
+
D(!0), j.current = e.clientY, M.current = t.scrollTop;
|
|
1740
2069
|
let n = (e) => {
|
|
1741
|
-
let n =
|
|
2070
|
+
let n = l.current;
|
|
1742
2071
|
if (!n || !t) return;
|
|
1743
|
-
let r = e.clientY -
|
|
1744
|
-
t.scrollTop = Math.max(0, Math.min(i,
|
|
2072
|
+
let r = e.clientY - j.current, i = t.scrollHeight - n.clientHeight, a = i / (n.clientHeight - v);
|
|
2073
|
+
t.scrollTop = Math.max(0, Math.min(i, M.current + r * a));
|
|
1745
2074
|
}, r = () => {
|
|
1746
2075
|
D(!1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r);
|
|
1747
2076
|
};
|
|
1748
2077
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", r);
|
|
1749
|
-
}, [v,
|
|
2078
|
+
}, [v, p]), te = a((e) => {
|
|
1750
2079
|
e.preventDefault(), e.stopPropagation();
|
|
1751
|
-
let t =
|
|
2080
|
+
let t = p.current;
|
|
1752
2081
|
if (!t) return;
|
|
1753
|
-
k(!0),
|
|
2082
|
+
k(!0), N.current = e.clientX, P.current = t.scrollLeft;
|
|
1754
2083
|
let n = (e) => {
|
|
1755
|
-
let n =
|
|
2084
|
+
let n = l.current;
|
|
1756
2085
|
if (!n || !t) return;
|
|
1757
|
-
let r = e.clientX -
|
|
1758
|
-
t.scrollLeft = Math.max(0, Math.min(i,
|
|
2086
|
+
let r = e.clientX - N.current, i = t.scrollWidth - n.clientWidth, a = i / (n.clientWidth - S);
|
|
2087
|
+
t.scrollLeft = Math.max(0, Math.min(i, P.current + r * a));
|
|
1759
2088
|
}, r = () => {
|
|
1760
2089
|
k(!1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r);
|
|
1761
2090
|
};
|
|
1762
2091
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", r);
|
|
1763
|
-
}, [S,
|
|
1764
|
-
return /* @__PURE__ */
|
|
1765
|
-
ref:
|
|
1766
|
-
className:
|
|
2092
|
+
}, [S, p]), B = v > 0, ne = S > 0, V = r && (ee || E || O), re = B || ne;
|
|
2093
|
+
return /* @__PURE__ */ h("div", {
|
|
2094
|
+
ref: l,
|
|
2095
|
+
className: F(ot.container, n === "thick" && ot.thick, t),
|
|
1767
2096
|
onMouseEnter: I,
|
|
1768
2097
|
onMouseLeave: L,
|
|
1769
2098
|
"data-dragging": E || O,
|
|
1770
|
-
"data-show-track":
|
|
2099
|
+
"data-show-track": V ? "true" : "false",
|
|
1771
2100
|
children: [
|
|
1772
|
-
/* @__PURE__ */
|
|
1773
|
-
ref:
|
|
1774
|
-
className:
|
|
2101
|
+
/* @__PURE__ */ m("div", {
|
|
2102
|
+
ref: p,
|
|
2103
|
+
className: ot.content,
|
|
2104
|
+
tabIndex: re ? 0 : void 0,
|
|
1775
2105
|
children: e
|
|
1776
2106
|
}),
|
|
1777
2107
|
s,
|
|
1778
|
-
B && /* @__PURE__ */
|
|
1779
|
-
className:
|
|
1780
|
-
|
|
2108
|
+
B && /* @__PURE__ */ m("div", {
|
|
2109
|
+
className: ot.track,
|
|
2110
|
+
"aria-hidden": "true",
|
|
2111
|
+
children: /* @__PURE__ */ m("div", {
|
|
1781
2112
|
ref: g,
|
|
1782
|
-
className:
|
|
2113
|
+
className: ot.thumb,
|
|
1783
2114
|
style: {
|
|
1784
2115
|
height: `${v}px`,
|
|
1785
2116
|
top: `${b}px`
|
|
1786
2117
|
},
|
|
1787
|
-
onMouseDown:
|
|
2118
|
+
onMouseDown: z
|
|
1788
2119
|
})
|
|
1789
2120
|
}),
|
|
1790
|
-
|
|
1791
|
-
className:
|
|
1792
|
-
|
|
2121
|
+
ne && /* @__PURE__ */ m("div", {
|
|
2122
|
+
className: ot.trackHorizontal,
|
|
2123
|
+
"aria-hidden": "true",
|
|
2124
|
+
children: /* @__PURE__ */ m("div", {
|
|
1793
2125
|
ref: _,
|
|
1794
|
-
className:
|
|
2126
|
+
className: ot.thumbHorizontal,
|
|
1795
2127
|
style: {
|
|
1796
2128
|
width: `${S}px`,
|
|
1797
2129
|
left: `${w}px`
|
|
1798
2130
|
},
|
|
1799
|
-
onMouseDown:
|
|
2131
|
+
onMouseDown: te
|
|
1800
2132
|
})
|
|
1801
2133
|
})
|
|
1802
2134
|
]
|
|
1803
2135
|
});
|
|
1804
2136
|
};
|
|
1805
|
-
|
|
1806
|
-
var
|
|
2137
|
+
st.displayName = "Scrollbar";
|
|
2138
|
+
var ct = {
|
|
1807
2139
|
errorBoundary: "_errorBoundary_1avvb_1",
|
|
1808
2140
|
errorDetails: "_errorDetails_1avvb_11"
|
|
1809
|
-
},
|
|
2141
|
+
}, lt = class extends t {
|
|
1810
2142
|
constructor(e) {
|
|
1811
2143
|
super(e), this.handleReset = () => {
|
|
1812
2144
|
this.setState({
|
|
@@ -1828,11 +2160,11 @@ var at = {
|
|
|
1828
2160
|
console.error("ErrorBoundary caught an error:", e, t);
|
|
1829
2161
|
}
|
|
1830
2162
|
render() {
|
|
1831
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
1832
|
-
className:
|
|
1833
|
-
children: [/* @__PURE__ */
|
|
1834
|
-
className:
|
|
1835
|
-
children: /* @__PURE__ */
|
|
2163
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ h("div", {
|
|
2164
|
+
className: ct.errorBoundary,
|
|
2165
|
+
children: [/* @__PURE__ */ m(nt, { type: "no-content" }), /* @__PURE__ */ m("div", {
|
|
2166
|
+
className: ct.errorDetails,
|
|
2167
|
+
children: /* @__PURE__ */ m(E, {
|
|
1836
2168
|
variant: "text-body-small",
|
|
1837
2169
|
as: "p",
|
|
1838
2170
|
color: "secondary",
|
|
@@ -1841,173 +2173,240 @@ var at = {
|
|
|
1841
2173
|
})]
|
|
1842
2174
|
}) : this.props.children;
|
|
1843
2175
|
}
|
|
1844
|
-
},
|
|
1845
|
-
sidebar: "
|
|
1846
|
-
resizing: "
|
|
1847
|
-
collapsed: "
|
|
1848
|
-
mobile: "
|
|
1849
|
-
mini: "
|
|
1850
|
-
itemLabel: "
|
|
1851
|
-
itemBadge: "
|
|
1852
|
-
sectionHeader: "
|
|
1853
|
-
backdrop: "
|
|
1854
|
-
content: "
|
|
1855
|
-
footer: "
|
|
1856
|
-
resizeHandle: "
|
|
1857
|
-
section: "
|
|
1858
|
-
sectionHeaderClickable: "
|
|
1859
|
-
sectionItems: "
|
|
1860
|
-
itemWrapper: "
|
|
1861
|
-
item: "
|
|
1862
|
-
itemSelected: "
|
|
1863
|
-
itemDisabled: "
|
|
1864
|
-
itemIcon: "
|
|
1865
|
-
subItems: "
|
|
1866
|
-
},
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
2176
|
+
}, $ = {
|
|
2177
|
+
sidebar: "_sidebar_3oy49_2",
|
|
2178
|
+
resizing: "_resizing_3oy49_14",
|
|
2179
|
+
collapsed: "_collapsed_3oy49_16",
|
|
2180
|
+
mobile: "_mobile_3oy49_18",
|
|
2181
|
+
mini: "_mini_3oy49_26",
|
|
2182
|
+
itemLabel: "_itemLabel_3oy49_26",
|
|
2183
|
+
itemBadge: "_itemBadge_3oy49_27",
|
|
2184
|
+
sectionHeader: "_sectionHeader_3oy49_28",
|
|
2185
|
+
backdrop: "_backdrop_3oy49_30",
|
|
2186
|
+
content: "_content_3oy49_37",
|
|
2187
|
+
footer: "_footer_3oy49_47",
|
|
2188
|
+
resizeHandle: "_resizeHandle_3oy49_54",
|
|
2189
|
+
section: "_section_3oy49_28",
|
|
2190
|
+
sectionHeaderClickable: "_sectionHeaderClickable_3oy49_94",
|
|
2191
|
+
sectionItems: "_sectionItems_3oy49_96",
|
|
2192
|
+
itemWrapper: "_itemWrapper_3oy49_103",
|
|
2193
|
+
item: "_item_3oy49_26",
|
|
2194
|
+
itemSelected: "_itemSelected_3oy49_137",
|
|
2195
|
+
itemDisabled: "_itemDisabled_3oy49_140",
|
|
2196
|
+
itemIcon: "_itemIcon_3oy49_142",
|
|
2197
|
+
subItems: "_subItems_3oy49_163"
|
|
2198
|
+
}, ut = 56, dt = 240, ft = 480, pt = 180, mt = 140, ht = 16, gt = [
|
|
2199
|
+
"a[href]",
|
|
2200
|
+
"button:not([disabled])",
|
|
2201
|
+
"input:not([disabled])",
|
|
2202
|
+
"select:not([disabled])",
|
|
2203
|
+
"textarea:not([disabled])",
|
|
2204
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
2205
|
+
].join(","), _t = r(({ children: e, isCollapsed: t = !1, onToggle: n, width: r = "default", onWidthChange: i, resizable: s = !0, footer: c, className: l, isMobile: f = !1 }, g) => {
|
|
2206
|
+
let _ = u(null), v = g || _, y = u(null), [b, x] = d(!1), S = r === "mini", C = r === "mini" ? ut : r === "default" ? dt : r, w = a((e) => {
|
|
2207
|
+
if (!s || !i) return;
|
|
2208
|
+
e.preventDefault(), x(!0);
|
|
1870
2209
|
let t = (e) => {
|
|
1871
2210
|
let t = e.clientX;
|
|
1872
|
-
|
|
2211
|
+
i(t < mt ? "mini" : t < pt ? "default" : t);
|
|
1873
2212
|
}, n = () => {
|
|
1874
|
-
|
|
2213
|
+
x(!1), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1875
2214
|
};
|
|
1876
2215
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
|
|
1877
|
-
}, [s,
|
|
1878
|
-
|
|
1879
|
-
|
|
2216
|
+
}, [s, i]), T = a((e) => {
|
|
2217
|
+
if (!(!s || !i)) switch (e.key) {
|
|
2218
|
+
case "ArrowLeft": {
|
|
2219
|
+
if (e.preventDefault(), r === "mini") return;
|
|
2220
|
+
let t = C - ht;
|
|
2221
|
+
i(t < pt ? "mini" : t);
|
|
2222
|
+
break;
|
|
2223
|
+
}
|
|
2224
|
+
case "ArrowRight":
|
|
2225
|
+
if (e.preventDefault(), r === "mini") {
|
|
2226
|
+
i("default");
|
|
2227
|
+
return;
|
|
2228
|
+
}
|
|
2229
|
+
i(Math.min(C + ht, ft));
|
|
2230
|
+
break;
|
|
2231
|
+
case "Home":
|
|
2232
|
+
e.preventDefault(), i("mini");
|
|
2233
|
+
break;
|
|
2234
|
+
case "End":
|
|
2235
|
+
e.preventDefault(), i(ft);
|
|
2236
|
+
break;
|
|
2237
|
+
}
|
|
2238
|
+
}, [
|
|
2239
|
+
s,
|
|
2240
|
+
i,
|
|
2241
|
+
r,
|
|
2242
|
+
C
|
|
2243
|
+
]);
|
|
2244
|
+
o(() => {
|
|
2245
|
+
if (!f || t) return;
|
|
1880
2246
|
let e = (e) => {
|
|
1881
2247
|
e.key === "Escape" && n?.();
|
|
1882
2248
|
};
|
|
1883
2249
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1884
2250
|
}, [
|
|
1885
|
-
|
|
2251
|
+
f,
|
|
1886
2252
|
t,
|
|
1887
2253
|
n
|
|
1888
|
-
])
|
|
1889
|
-
|
|
2254
|
+
]);
|
|
2255
|
+
let E = f && !t;
|
|
2256
|
+
if (o(() => {
|
|
2257
|
+
if (!E) return;
|
|
2258
|
+
y.current = document.activeElement ?? null;
|
|
2259
|
+
let e = v.current;
|
|
2260
|
+
if (!e) return;
|
|
2261
|
+
let t = () => Array.from(e.querySelectorAll(gt)).filter((e) => !e.hasAttribute("aria-hidden") && e.offsetParent !== null);
|
|
2262
|
+
(t()[0] ?? e).focus();
|
|
2263
|
+
let n = (n) => {
|
|
2264
|
+
if (n.key !== "Tab") return;
|
|
2265
|
+
let r = t();
|
|
2266
|
+
if (r.length === 0) {
|
|
2267
|
+
n.preventDefault(), e.focus();
|
|
2268
|
+
return;
|
|
2269
|
+
}
|
|
2270
|
+
let i = r[0], a = r[r.length - 1], o = document.activeElement;
|
|
2271
|
+
n.shiftKey && (o === i || !e.contains(o)) ? (n.preventDefault(), a.focus()) : !n.shiftKey && (o === a || !e.contains(o)) && (n.preventDefault(), i.focus());
|
|
2272
|
+
};
|
|
2273
|
+
return document.addEventListener("keydown", n), () => {
|
|
2274
|
+
document.removeEventListener("keydown", n), y.current?.focus?.(), y.current = null;
|
|
2275
|
+
};
|
|
2276
|
+
}, [E, v]), t && !f) return null;
|
|
2277
|
+
let D = E ? {
|
|
2278
|
+
role: "dialog",
|
|
2279
|
+
"aria-modal": !0,
|
|
2280
|
+
tabIndex: -1
|
|
2281
|
+
} : { role: "navigation" };
|
|
2282
|
+
return /* @__PURE__ */ h(p, { children: [f && !t && /* @__PURE__ */ m("div", {
|
|
2283
|
+
className: $.backdrop,
|
|
1890
2284
|
onClick: n,
|
|
1891
|
-
"aria-hidden":
|
|
1892
|
-
}), /* @__PURE__ */
|
|
2285
|
+
"aria-hidden": "true"
|
|
2286
|
+
}), /* @__PURE__ */ h("aside", {
|
|
1893
2287
|
ref: v,
|
|
1894
|
-
className:
|
|
1895
|
-
style: { width: t ? 0 :
|
|
1896
|
-
role: "navigation",
|
|
2288
|
+
className: F($.sidebar, S && $.mini, f && $.mobile, t && $.collapsed, b && $.resizing, l),
|
|
2289
|
+
style: { width: t ? 0 : C },
|
|
1897
2290
|
"aria-label": "Sidebar",
|
|
2291
|
+
...D,
|
|
1898
2292
|
children: [
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
className:
|
|
2293
|
+
/* @__PURE__ */ m("div", {
|
|
2294
|
+
className: $.content,
|
|
1901
2295
|
children: e
|
|
1902
2296
|
}),
|
|
1903
|
-
|
|
1904
|
-
className:
|
|
1905
|
-
children:
|
|
2297
|
+
c && /* @__PURE__ */ m("div", {
|
|
2298
|
+
className: $.footer,
|
|
2299
|
+
children: c
|
|
1906
2300
|
}),
|
|
1907
|
-
s && !
|
|
1908
|
-
className:
|
|
1909
|
-
onMouseDown:
|
|
2301
|
+
s && !f && /* @__PURE__ */ m("div", {
|
|
2302
|
+
className: $.resizeHandle,
|
|
2303
|
+
onMouseDown: w,
|
|
2304
|
+
onKeyDown: T,
|
|
1910
2305
|
role: "separator",
|
|
1911
2306
|
"aria-orientation": "vertical",
|
|
1912
|
-
"aria-label": "Resize sidebar"
|
|
2307
|
+
"aria-label": "Resize sidebar",
|
|
2308
|
+
"aria-valuenow": C,
|
|
2309
|
+
"aria-valuemin": ut,
|
|
2310
|
+
"aria-valuemax": ft,
|
|
2311
|
+
tabIndex: 0
|
|
1913
2312
|
})
|
|
1914
2313
|
]
|
|
1915
2314
|
})] });
|
|
1916
2315
|
});
|
|
1917
|
-
|
|
2316
|
+
_t.displayName = "Sidebar";
|
|
1918
2317
|
//#endregion
|
|
1919
2318
|
//#region src/components/Sidebar/SidebarSection.tsx
|
|
1920
|
-
var
|
|
1921
|
-
let [o, s] =
|
|
1922
|
-
return /* @__PURE__ */
|
|
2319
|
+
var vt = r(({ label: e, children: t, collapsible: n = !1, defaultCollapsed: r = !1, className: i }, a) => {
|
|
2320
|
+
let [o, s] = d(r);
|
|
2321
|
+
return /* @__PURE__ */ h("div", {
|
|
1923
2322
|
ref: a,
|
|
1924
|
-
className:
|
|
1925
|
-
children: [e && /* @__PURE__ */
|
|
1926
|
-
className:
|
|
2323
|
+
className: F($.section, i),
|
|
2324
|
+
children: [e && /* @__PURE__ */ m("div", {
|
|
2325
|
+
className: F($.sectionHeader, n && $.sectionHeaderClickable),
|
|
1927
2326
|
onClick: n ? () => s((e) => !e) : void 0,
|
|
1928
2327
|
role: n ? "button" : void 0,
|
|
1929
2328
|
"aria-expanded": n ? !o : void 0,
|
|
1930
|
-
children: /* @__PURE__ */
|
|
2329
|
+
children: /* @__PURE__ */ m(E, {
|
|
1931
2330
|
variant: "text-caption-emphasis",
|
|
1932
2331
|
as: "span",
|
|
1933
2332
|
color: "tertiary",
|
|
1934
2333
|
children: e
|
|
1935
2334
|
})
|
|
1936
|
-
}), !o && /* @__PURE__ */
|
|
1937
|
-
className:
|
|
2335
|
+
}), !o && /* @__PURE__ */ m("div", {
|
|
2336
|
+
className: $.sectionItems,
|
|
1938
2337
|
children: t
|
|
1939
2338
|
})]
|
|
1940
2339
|
});
|
|
1941
2340
|
});
|
|
1942
|
-
|
|
2341
|
+
vt.displayName = "SidebarSection";
|
|
1943
2342
|
//#endregion
|
|
1944
2343
|
//#region src/components/Sidebar/SidebarItem.tsx
|
|
1945
|
-
var
|
|
1946
|
-
className:
|
|
1947
|
-
children: [/* @__PURE__ */
|
|
2344
|
+
var yt = r(({ label: e, icon: t, isSelected: n = !1, isDisabled: r = !1, onClick: i, badge: a, children: o, className: s }, c) => /* @__PURE__ */ h("div", {
|
|
2345
|
+
className: F($.itemWrapper, s),
|
|
2346
|
+
children: [/* @__PURE__ */ h("button", {
|
|
1948
2347
|
ref: c,
|
|
1949
|
-
className:
|
|
2348
|
+
className: F($.item, n && $.itemSelected, r && $.itemDisabled),
|
|
1950
2349
|
onClick: i,
|
|
1951
2350
|
disabled: r,
|
|
1952
2351
|
type: "button",
|
|
1953
2352
|
"aria-current": n ? "page" : void 0,
|
|
1954
2353
|
children: [
|
|
1955
|
-
t && /* @__PURE__ */
|
|
1956
|
-
className:
|
|
1957
|
-
children: /* @__PURE__ */
|
|
2354
|
+
t && /* @__PURE__ */ m("span", {
|
|
2355
|
+
className: $.itemIcon,
|
|
2356
|
+
children: /* @__PURE__ */ m(t, { size: 20 })
|
|
1958
2357
|
}),
|
|
1959
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ m(E, {
|
|
1960
2359
|
variant: n ? "text-body-medium-emphasis" : "text-body-medium",
|
|
1961
2360
|
as: "span",
|
|
1962
|
-
className:
|
|
2361
|
+
className: $.itemLabel,
|
|
1963
2362
|
lineTruncation: 1,
|
|
1964
2363
|
children: e
|
|
1965
2364
|
}),
|
|
1966
|
-
a && /* @__PURE__ */
|
|
1967
|
-
className:
|
|
2365
|
+
a && /* @__PURE__ */ m("span", {
|
|
2366
|
+
className: $.itemBadge,
|
|
1968
2367
|
children: a
|
|
1969
2368
|
})
|
|
1970
2369
|
]
|
|
1971
|
-
}), o && n && /* @__PURE__ */
|
|
1972
|
-
className:
|
|
2370
|
+
}), o && n && /* @__PURE__ */ m("div", {
|
|
2371
|
+
className: $.subItems,
|
|
1973
2372
|
children: o
|
|
1974
2373
|
})]
|
|
1975
2374
|
}));
|
|
1976
|
-
|
|
1977
|
-
var
|
|
2375
|
+
yt.displayName = "SidebarItem";
|
|
2376
|
+
var bt = {
|
|
1978
2377
|
header: "_header_1902d_1",
|
|
1979
2378
|
left: "_left_1902d_11",
|
|
1980
2379
|
center: "_center_1902d_19",
|
|
1981
2380
|
right: "_right_1902d_28"
|
|
1982
|
-
},
|
|
2381
|
+
}, xt = r(({ title: e, left: t, center: n, right: r, background: i = "secondary", className: a }, o) => /* @__PURE__ */ h(N, {
|
|
1983
2382
|
ref: o,
|
|
1984
2383
|
as: "header",
|
|
1985
2384
|
background: i,
|
|
1986
2385
|
elevation: "none",
|
|
1987
2386
|
edge: "bottom",
|
|
1988
|
-
className:
|
|
2387
|
+
className: F(bt.header, a),
|
|
1989
2388
|
children: [
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
className:
|
|
1992
|
-
children: [t, e && !n && /* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ h("div", {
|
|
2390
|
+
className: bt.left,
|
|
2391
|
+
children: [t, e && !n && /* @__PURE__ */ m(E, {
|
|
1993
2392
|
variant: "text-title-small",
|
|
1994
2393
|
as: "h1",
|
|
1995
2394
|
lineTruncation: 1,
|
|
1996
2395
|
children: e
|
|
1997
2396
|
})]
|
|
1998
2397
|
}),
|
|
1999
|
-
n && /* @__PURE__ */
|
|
2000
|
-
className:
|
|
2398
|
+
n && /* @__PURE__ */ m("div", {
|
|
2399
|
+
className: bt.center,
|
|
2001
2400
|
children: n
|
|
2002
2401
|
}),
|
|
2003
|
-
/* @__PURE__ */
|
|
2004
|
-
className:
|
|
2402
|
+
/* @__PURE__ */ m("div", {
|
|
2403
|
+
className: bt.right,
|
|
2005
2404
|
children: r
|
|
2006
2405
|
})
|
|
2007
2406
|
]
|
|
2008
2407
|
}));
|
|
2009
|
-
|
|
2010
|
-
var
|
|
2408
|
+
xt.displayName = "Header";
|
|
2409
|
+
var St = {
|
|
2011
2410
|
group: "_group_9khnl_1",
|
|
2012
2411
|
horizontal: "_horizontal_9khnl_7",
|
|
2013
2412
|
radio: "_radio_9khnl_14",
|
|
@@ -2015,37 +2414,72 @@ var gt = {
|
|
|
2015
2414
|
circle: "_circle_9khnl_39",
|
|
2016
2415
|
circleChecked: "_circleChecked_9khnl_52",
|
|
2017
2416
|
dot: "_dot_9khnl_56"
|
|
2018
|
-
},
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2417
|
+
}, Ct = r(({ value: e, onChange: t, options: n, "aria-label": r, "aria-labelledby": i, direction: a = "vertical", inactive: o = !1, className: s }, c) => {
|
|
2418
|
+
!r && !i && globalThis.process?.env?.NODE_ENV !== "production" && console.warn("RadioGroup: an accessible name is required. Pass either `aria-label` or `aria-labelledby`.");
|
|
2419
|
+
let l = u([]), d = (e) => e >= 0 && e < n.length && !o && !n[e].inactive, f = n.reduce((e, t, n) => (d(n) && e.push(n), e), []), p = n.findIndex((t) => t.value === e), h = d(p) ? p : f[0] ?? -1, g = (r) => {
|
|
2420
|
+
l.current[r]?.focus(), n[r].value !== e && t(n[r].value);
|
|
2421
|
+
}, _ = (e, t) => {
|
|
2422
|
+
if (f.length === 0) return;
|
|
2423
|
+
let n = f.indexOf(e);
|
|
2424
|
+
g(f[((n === -1 ? t === 1 ? -1 : 0 : n) + t + f.length) % f.length]);
|
|
2425
|
+
};
|
|
2426
|
+
return /* @__PURE__ */ m("div", {
|
|
2427
|
+
ref: c,
|
|
2428
|
+
role: "radiogroup",
|
|
2429
|
+
"aria-label": r,
|
|
2430
|
+
"aria-labelledby": i,
|
|
2431
|
+
onKeyDown: (e) => {
|
|
2432
|
+
let t = e.target, n = l.current.findIndex((e) => e === t);
|
|
2433
|
+
if (n !== -1) switch (e.key) {
|
|
2434
|
+
case "ArrowDown":
|
|
2435
|
+
case "ArrowRight":
|
|
2436
|
+
e.preventDefault(), _(n, 1);
|
|
2437
|
+
break;
|
|
2438
|
+
case "ArrowUp":
|
|
2439
|
+
case "ArrowLeft":
|
|
2440
|
+
e.preventDefault(), _(n, -1);
|
|
2441
|
+
break;
|
|
2442
|
+
case "Home":
|
|
2443
|
+
e.preventDefault(), f.length && g(f[0]);
|
|
2444
|
+
break;
|
|
2445
|
+
case "End":
|
|
2446
|
+
e.preventDefault(), f.length && g(f[f.length - 1]);
|
|
2447
|
+
break;
|
|
2448
|
+
}
|
|
2449
|
+
},
|
|
2450
|
+
className: F(St.group, a === "horizontal" && St.horizontal, s),
|
|
2451
|
+
children: n.map((n, r) => /* @__PURE__ */ m(wt, {
|
|
2452
|
+
ref: (e) => {
|
|
2453
|
+
l.current[r] = e;
|
|
2454
|
+
},
|
|
2455
|
+
label: n.label,
|
|
2456
|
+
checked: e === n.value,
|
|
2457
|
+
inactive: o || n.inactive,
|
|
2458
|
+
tabIndex: r === h ? 0 : -1,
|
|
2459
|
+
onChange: () => t(n.value)
|
|
2460
|
+
}, n.value))
|
|
2461
|
+
});
|
|
2462
|
+
});
|
|
2463
|
+
Ct.displayName = "RadioGroup";
|
|
2464
|
+
var wt = r(({ label: e, checked: t = !1, onChange: n, inactive: r = !1, tabIndex: i, className: a }, o) => {
|
|
2465
|
+
let s = () => {
|
|
2033
2466
|
!r && !t && n?.();
|
|
2034
2467
|
};
|
|
2035
|
-
return /* @__PURE__ */
|
|
2036
|
-
ref:
|
|
2468
|
+
return /* @__PURE__ */ h("div", {
|
|
2469
|
+
ref: o,
|
|
2037
2470
|
role: "radio",
|
|
2038
2471
|
"aria-checked": t,
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2472
|
+
"aria-disabled": r || void 0,
|
|
2473
|
+
tabIndex: i ?? (r ? -1 : 0),
|
|
2474
|
+
className: F(St.radio, r && St.inactive, a),
|
|
2475
|
+
onClick: s,
|
|
2042
2476
|
onKeyDown: (e) => {
|
|
2043
|
-
(e.key === " " || e.key === "Enter") && (e.preventDefault(),
|
|
2477
|
+
(e.key === " " || e.key === "Enter") && (e.preventDefault(), s());
|
|
2044
2478
|
},
|
|
2045
|
-
children: [/* @__PURE__ */
|
|
2046
|
-
className:
|
|
2047
|
-
children: t && /* @__PURE__ */
|
|
2048
|
-
}), /* @__PURE__ */
|
|
2479
|
+
children: [/* @__PURE__ */ m("span", {
|
|
2480
|
+
className: F(St.circle, t && St.circleChecked),
|
|
2481
|
+
children: t && /* @__PURE__ */ m("span", { className: St.dot })
|
|
2482
|
+
}), /* @__PURE__ */ m(E, {
|
|
2049
2483
|
variant: "text-body-medium",
|
|
2050
2484
|
as: "span",
|
|
2051
2485
|
color: "inherit",
|
|
@@ -2053,57 +2487,76 @@ var vt = n(({ label: e, checked: t = !1, onChange: n, inactive: r = !1, classNam
|
|
|
2053
2487
|
})]
|
|
2054
2488
|
});
|
|
2055
2489
|
});
|
|
2056
|
-
|
|
2057
|
-
var
|
|
2490
|
+
wt.displayName = "RadioItem";
|
|
2491
|
+
var Tt = {
|
|
2058
2492
|
tabGroup: "_tabGroup_1kx0a_1",
|
|
2059
2493
|
tabsRow: "_tabsRow_1kx0a_7",
|
|
2060
2494
|
track: "_track_1kx0a_12",
|
|
2061
2495
|
indicator: "_indicator_1kx0a_18"
|
|
2062
|
-
},
|
|
2063
|
-
let
|
|
2496
|
+
}, Et = r(({ tabs: e, activeIndex: t = 0, onTabChange: n, orientation: r = "horizontal", className: i, "aria-label": s, "aria-labelledby": c }, l) => {
|
|
2497
|
+
let f = u([]), [p, g] = d({
|
|
2064
2498
|
left: 0,
|
|
2065
2499
|
width: 0
|
|
2066
|
-
}),
|
|
2067
|
-
let e =
|
|
2068
|
-
e &&
|
|
2500
|
+
}), _ = a(() => {
|
|
2501
|
+
let e = f.current[t];
|
|
2502
|
+
e && g({
|
|
2069
2503
|
left: e.offsetLeft,
|
|
2070
2504
|
width: e.offsetWidth
|
|
2071
2505
|
});
|
|
2072
2506
|
}, [t]);
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
}, [
|
|
2076
|
-
let e = new ResizeObserver(
|
|
2507
|
+
o(() => {
|
|
2508
|
+
_();
|
|
2509
|
+
}, [_]), o(() => {
|
|
2510
|
+
let e = new ResizeObserver(_), t = f.current[0]?.parentElement;
|
|
2077
2511
|
return t && e.observe(t), () => e.disconnect();
|
|
2078
|
-
}, [
|
|
2079
|
-
|
|
2512
|
+
}, [_]);
|
|
2513
|
+
let v = a((t, n) => {
|
|
2514
|
+
let r = e.length;
|
|
2515
|
+
if (r === 0) return t;
|
|
2516
|
+
let i = t;
|
|
2517
|
+
for (let t = 0; t < r; t++) if (i = (i + n + r) % r, !e[i].disabled) return i;
|
|
2518
|
+
return t;
|
|
2519
|
+
}, [e]), y = a((e) => {
|
|
2520
|
+
e !== t && n?.(e), f.current[e]?.focus();
|
|
2521
|
+
}, [t, n]);
|
|
2522
|
+
return /* @__PURE__ */ h("div", {
|
|
2523
|
+
ref: l,
|
|
2080
2524
|
role: "tablist",
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2525
|
+
"aria-label": s,
|
|
2526
|
+
"aria-labelledby": c,
|
|
2527
|
+
"aria-orientation": r === "vertical" ? "vertical" : void 0,
|
|
2528
|
+
onKeyDown: (n) => {
|
|
2529
|
+
let i = r !== "vertical", a = i ? "ArrowRight" : "ArrowDown", o = i ? "ArrowLeft" : "ArrowUp", s = null;
|
|
2530
|
+
n.key === a ? s = v(t, 1) : n.key === o ? s = v(t, -1) : n.key === "Home" ? s = v(-1, 1) : n.key === "End" && (s = v(e.length, -1)), s !== null && (n.preventDefault(), y(s));
|
|
2531
|
+
},
|
|
2532
|
+
className: F(Tt.tabGroup, i),
|
|
2533
|
+
children: [/* @__PURE__ */ m("div", {
|
|
2534
|
+
className: Tt.tabsRow,
|
|
2535
|
+
children: e.map((e, r) => /* @__PURE__ */ m($e, {
|
|
2085
2536
|
ref: (e) => {
|
|
2086
|
-
|
|
2537
|
+
f.current[r] = e;
|
|
2087
2538
|
},
|
|
2088
2539
|
id: e.id,
|
|
2540
|
+
controls: e.panelId,
|
|
2089
2541
|
label: e.label,
|
|
2090
2542
|
isSelected: r === t,
|
|
2543
|
+
disabled: e.disabled,
|
|
2091
2544
|
onClick: () => n?.(r)
|
|
2092
2545
|
}, e.id ?? r))
|
|
2093
|
-
}), /* @__PURE__ */
|
|
2094
|
-
className:
|
|
2095
|
-
children: /* @__PURE__ */
|
|
2096
|
-
className:
|
|
2546
|
+
}), /* @__PURE__ */ m("div", {
|
|
2547
|
+
className: Tt.track,
|
|
2548
|
+
children: /* @__PURE__ */ m("div", {
|
|
2549
|
+
className: Tt.indicator,
|
|
2097
2550
|
style: {
|
|
2098
|
-
transform: `translateX(${
|
|
2099
|
-
width:
|
|
2551
|
+
transform: `translateX(${p.left}px)`,
|
|
2552
|
+
width: p.width
|
|
2100
2553
|
}
|
|
2101
2554
|
})
|
|
2102
2555
|
})]
|
|
2103
2556
|
});
|
|
2104
2557
|
});
|
|
2105
|
-
|
|
2106
|
-
var
|
|
2558
|
+
Et.displayName = "TabGroup";
|
|
2559
|
+
var Dt = {
|
|
2107
2560
|
accordion: "_accordion_15kid_1",
|
|
2108
2561
|
item: "_item_15kid_8",
|
|
2109
2562
|
inactive: "_inactive_15kid_16",
|
|
@@ -2112,111 +2565,117 @@ var Q = {
|
|
|
2112
2565
|
chevronOpen: "_chevronOpen_15kid_52",
|
|
2113
2566
|
body: "_body_15kid_58",
|
|
2114
2567
|
bodyInner: "_bodyInner_15kid_63"
|
|
2115
|
-
},
|
|
2116
|
-
let [o, s] =
|
|
2568
|
+
}, Ot = r(({ items: e, multiple: t = !1, expandedIds: n, onExpandedChange: r, className: i }, a) => {
|
|
2569
|
+
let [o, s] = d([]), c = n ?? o, l = (e) => {
|
|
2117
2570
|
let n;
|
|
2118
2571
|
n = c.includes(e) ? c.filter((t) => t !== e) : t ? [...c, e] : [e], s(n), r?.(n);
|
|
2119
2572
|
};
|
|
2120
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ m("div", {
|
|
2121
2574
|
ref: a,
|
|
2122
|
-
className:
|
|
2123
|
-
children: e.map((e) => /* @__PURE__ */
|
|
2575
|
+
className: F(Dt.accordion, i),
|
|
2576
|
+
children: e.map((e) => /* @__PURE__ */ m(kt, {
|
|
2124
2577
|
label: e.label,
|
|
2125
2578
|
isExpanded: c.includes(e.id),
|
|
2126
2579
|
inactive: e.inactive,
|
|
2127
|
-
onToggle: () =>
|
|
2580
|
+
onToggle: () => l(e.id),
|
|
2128
2581
|
children: e.content
|
|
2129
2582
|
}, e.id))
|
|
2130
2583
|
});
|
|
2131
2584
|
});
|
|
2132
|
-
|
|
2133
|
-
var
|
|
2134
|
-
let
|
|
2135
|
-
|
|
2585
|
+
Ot.displayName = "Accordion";
|
|
2586
|
+
var kt = r(({ label: e, children: t, isExpanded: n = !1, onToggle: r, inactive: i = !1, className: c }, l) => {
|
|
2587
|
+
let f = u(null), [p, g] = d(0), _ = s(), v = `${_}-trigger`, y = `${_}-panel`, b = a(() => {
|
|
2588
|
+
f.current && g(f.current.scrollHeight);
|
|
2136
2589
|
}, []);
|
|
2137
|
-
return
|
|
2138
|
-
|
|
2139
|
-
let e =
|
|
2590
|
+
return o(() => {
|
|
2591
|
+
b();
|
|
2592
|
+
let e = f.current;
|
|
2140
2593
|
if (!e) return;
|
|
2141
|
-
let t = new ResizeObserver(
|
|
2594
|
+
let t = new ResizeObserver(b);
|
|
2142
2595
|
return t.observe(e), () => t.disconnect();
|
|
2143
|
-
}, [
|
|
2144
|
-
ref:
|
|
2145
|
-
className:
|
|
2146
|
-
children: [/* @__PURE__ */
|
|
2596
|
+
}, [b]), /* @__PURE__ */ h("div", {
|
|
2597
|
+
ref: l,
|
|
2598
|
+
className: F(Dt.item, i && Dt.inactive, c),
|
|
2599
|
+
children: [/* @__PURE__ */ h("button", {
|
|
2147
2600
|
type: "button",
|
|
2148
|
-
|
|
2149
|
-
|
|
2601
|
+
id: v,
|
|
2602
|
+
className: Dt.trigger,
|
|
2603
|
+
onClick: () => !i && r?.(),
|
|
2150
2604
|
"aria-expanded": n,
|
|
2151
|
-
|
|
2152
|
-
|
|
2605
|
+
"aria-controls": y,
|
|
2606
|
+
"aria-disabled": i || void 0,
|
|
2607
|
+
tabIndex: i ? -1 : 0,
|
|
2608
|
+
children: [/* @__PURE__ */ m(E, {
|
|
2153
2609
|
variant: "text-body-medium-emphasis",
|
|
2154
2610
|
as: "span",
|
|
2155
2611
|
color: "inherit",
|
|
2156
2612
|
children: e
|
|
2157
|
-
}), /* @__PURE__ */
|
|
2158
|
-
className:
|
|
2613
|
+
}), /* @__PURE__ */ m("span", {
|
|
2614
|
+
className: F(Dt.chevron, n && Dt.chevronOpen),
|
|
2159
2615
|
children: "›"
|
|
2160
2616
|
})]
|
|
2161
|
-
}), /* @__PURE__ */
|
|
2162
|
-
|
|
2163
|
-
|
|
2617
|
+
}), /* @__PURE__ */ m("div", {
|
|
2618
|
+
id: y,
|
|
2619
|
+
role: "region",
|
|
2620
|
+
"aria-labelledby": v,
|
|
2621
|
+
className: Dt.body,
|
|
2622
|
+
style: { height: n ? p : 0 },
|
|
2164
2623
|
"aria-hidden": !n,
|
|
2165
|
-
children: /* @__PURE__ */
|
|
2166
|
-
ref:
|
|
2167
|
-
className:
|
|
2624
|
+
children: /* @__PURE__ */ m("div", {
|
|
2625
|
+
ref: f,
|
|
2626
|
+
className: Dt.bodyInner,
|
|
2168
2627
|
children: t
|
|
2169
2628
|
})
|
|
2170
2629
|
})]
|
|
2171
2630
|
});
|
|
2172
2631
|
});
|
|
2173
|
-
|
|
2174
|
-
var
|
|
2632
|
+
kt.displayName = "AccordionItem";
|
|
2633
|
+
var At = {
|
|
2175
2634
|
breadcrumb: "_breadcrumb_1xq6b_1",
|
|
2176
2635
|
list: "_list_1xq6b_6",
|
|
2177
2636
|
item: "_item_1xq6b_15",
|
|
2178
2637
|
link: "_link_1xq6b_21",
|
|
2179
2638
|
separator: "_separator_1xq6b_41"
|
|
2180
|
-
},
|
|
2639
|
+
}, jt = r(({ items: e, separator: t = "/", className: n }, r) => /* @__PURE__ */ m("nav", {
|
|
2181
2640
|
ref: r,
|
|
2182
2641
|
"aria-label": "Breadcrumb",
|
|
2183
|
-
className:
|
|
2184
|
-
children: /* @__PURE__ */
|
|
2185
|
-
className:
|
|
2642
|
+
className: F(At.breadcrumb, n),
|
|
2643
|
+
children: /* @__PURE__ */ m("ol", {
|
|
2644
|
+
className: At.list,
|
|
2186
2645
|
children: e.map((n, r) => {
|
|
2187
2646
|
let i = r === e.length - 1;
|
|
2188
|
-
return /* @__PURE__ */
|
|
2189
|
-
className:
|
|
2190
|
-
children: i ? /* @__PURE__ */
|
|
2647
|
+
return /* @__PURE__ */ m("li", {
|
|
2648
|
+
className: At.item,
|
|
2649
|
+
children: i ? /* @__PURE__ */ m(E, {
|
|
2191
2650
|
variant: "text-body-medium-emphasis",
|
|
2192
2651
|
as: "span",
|
|
2193
2652
|
color: "primary",
|
|
2194
2653
|
"aria-current": "page",
|
|
2195
2654
|
children: n.label
|
|
2196
|
-
}) : /* @__PURE__ */ p
|
|
2655
|
+
}) : /* @__PURE__ */ h(p, { children: [n.href ? /* @__PURE__ */ m("a", {
|
|
2197
2656
|
href: n.href,
|
|
2198
|
-
className:
|
|
2657
|
+
className: At.link,
|
|
2199
2658
|
onClick: (e) => {
|
|
2200
2659
|
n.onClick && (e.preventDefault(), n.onClick());
|
|
2201
2660
|
},
|
|
2202
|
-
children: /* @__PURE__ */
|
|
2661
|
+
children: /* @__PURE__ */ m(E, {
|
|
2203
2662
|
variant: "text-body-medium",
|
|
2204
2663
|
as: "span",
|
|
2205
2664
|
color: "inherit",
|
|
2206
2665
|
children: n.label
|
|
2207
2666
|
})
|
|
2208
|
-
}) : /* @__PURE__ */
|
|
2667
|
+
}) : /* @__PURE__ */ m("button", {
|
|
2209
2668
|
type: "button",
|
|
2210
|
-
className:
|
|
2669
|
+
className: At.link,
|
|
2211
2670
|
onClick: n.onClick,
|
|
2212
|
-
children: /* @__PURE__ */
|
|
2671
|
+
children: /* @__PURE__ */ m(E, {
|
|
2213
2672
|
variant: "text-body-medium",
|
|
2214
2673
|
as: "span",
|
|
2215
2674
|
color: "inherit",
|
|
2216
2675
|
children: n.label
|
|
2217
2676
|
})
|
|
2218
|
-
}), /* @__PURE__ */
|
|
2219
|
-
className:
|
|
2677
|
+
}), /* @__PURE__ */ m("span", {
|
|
2678
|
+
className: At.separator,
|
|
2220
2679
|
"aria-hidden": "true",
|
|
2221
2680
|
children: t
|
|
2222
2681
|
})] })
|
|
@@ -2224,8 +2683,8 @@ var Ct = {
|
|
|
2224
2683
|
})
|
|
2225
2684
|
})
|
|
2226
2685
|
}));
|
|
2227
|
-
|
|
2228
|
-
var
|
|
2686
|
+
jt.displayName = "Breadcrumb";
|
|
2687
|
+
var Mt = {
|
|
2229
2688
|
pagination: "_pagination_ax4c0_1",
|
|
2230
2689
|
inactive: "_inactive_ax4c0_9",
|
|
2231
2690
|
button: "_button_ax4c0_16",
|
|
@@ -2235,82 +2694,82 @@ var $ = {
|
|
|
2235
2694
|
};
|
|
2236
2695
|
//#endregion
|
|
2237
2696
|
//#region src/components/Pagination/Pagination.tsx
|
|
2238
|
-
function
|
|
2697
|
+
function Nt(e, t) {
|
|
2239
2698
|
let n = [];
|
|
2240
2699
|
for (let r = e; r <= t; r++) n.push(r);
|
|
2241
2700
|
return n;
|
|
2242
2701
|
}
|
|
2243
|
-
function
|
|
2244
|
-
if (t <= n * 2 + 5) return
|
|
2702
|
+
function Pt(e, t, n) {
|
|
2703
|
+
if (t <= n * 2 + 5) return Nt(1, t);
|
|
2245
2704
|
let r = Math.max(e - n, 2), i = Math.min(e + n, t - 1), a = r > 2, o = i < t - 1;
|
|
2246
2705
|
return !a && o ? [
|
|
2247
|
-
...
|
|
2706
|
+
...Nt(1, n * 2 + 3),
|
|
2248
2707
|
"ellipsis",
|
|
2249
2708
|
t
|
|
2250
2709
|
] : a && !o ? [
|
|
2251
2710
|
1,
|
|
2252
2711
|
"ellipsis",
|
|
2253
|
-
...
|
|
2712
|
+
...Nt(t - (n * 2 + 2), t)
|
|
2254
2713
|
] : [
|
|
2255
2714
|
1,
|
|
2256
2715
|
"ellipsis",
|
|
2257
|
-
...
|
|
2716
|
+
...Nt(r, i),
|
|
2258
2717
|
"ellipsis",
|
|
2259
2718
|
t
|
|
2260
2719
|
];
|
|
2261
2720
|
}
|
|
2262
|
-
var
|
|
2263
|
-
let
|
|
2721
|
+
var Ft = r(({ page: e, totalPages: t, onPageChange: n, siblingCount: r = 1, inactive: i = !1, className: a }, o) => {
|
|
2722
|
+
let s = l(() => Pt(e, t, r), [
|
|
2264
2723
|
e,
|
|
2265
2724
|
t,
|
|
2266
2725
|
r
|
|
2267
2726
|
]);
|
|
2268
|
-
return t <= 1 ? null : /* @__PURE__ */
|
|
2727
|
+
return t <= 1 ? null : /* @__PURE__ */ h("nav", {
|
|
2269
2728
|
ref: o,
|
|
2270
2729
|
"aria-label": "Pagination",
|
|
2271
|
-
className:
|
|
2730
|
+
className: F(Mt.pagination, i && Mt.inactive, a),
|
|
2272
2731
|
children: [
|
|
2273
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ m("button", {
|
|
2274
2733
|
type: "button",
|
|
2275
|
-
className:
|
|
2734
|
+
className: F(Mt.button, Mt.nav),
|
|
2276
2735
|
disabled: e <= 1 || i,
|
|
2277
2736
|
onClick: () => n(e - 1),
|
|
2278
2737
|
"aria-label": "Previous page",
|
|
2279
|
-
children: /* @__PURE__ */
|
|
2738
|
+
children: /* @__PURE__ */ m(E, {
|
|
2280
2739
|
variant: "text-body-small",
|
|
2281
2740
|
as: "span",
|
|
2282
2741
|
color: "inherit",
|
|
2283
2742
|
children: "‹"
|
|
2284
2743
|
})
|
|
2285
2744
|
}),
|
|
2286
|
-
|
|
2287
|
-
className:
|
|
2288
|
-
children: /* @__PURE__ */
|
|
2745
|
+
s.map((t, r) => t === "ellipsis" ? /* @__PURE__ */ m("span", {
|
|
2746
|
+
className: Mt.ellipsis,
|
|
2747
|
+
children: /* @__PURE__ */ m(E, {
|
|
2289
2748
|
variant: "text-body-small",
|
|
2290
2749
|
as: "span",
|
|
2291
2750
|
color: "tertiary",
|
|
2292
2751
|
children: "…"
|
|
2293
2752
|
})
|
|
2294
|
-
}, `e${r}`) : /* @__PURE__ */
|
|
2753
|
+
}, `e${r}`) : /* @__PURE__ */ m("button", {
|
|
2295
2754
|
type: "button",
|
|
2296
|
-
className:
|
|
2755
|
+
className: F(Mt.button, t === e && Mt.active),
|
|
2297
2756
|
onClick: () => n(t),
|
|
2298
2757
|
"aria-current": t === e ? "page" : void 0,
|
|
2299
2758
|
disabled: i,
|
|
2300
|
-
children: /* @__PURE__ */
|
|
2759
|
+
children: /* @__PURE__ */ m(E, {
|
|
2301
2760
|
variant: t === e ? "text-body-small-emphasis" : "text-body-small",
|
|
2302
2761
|
as: "span",
|
|
2303
2762
|
color: "inherit",
|
|
2304
2763
|
children: t
|
|
2305
2764
|
})
|
|
2306
2765
|
}, t)),
|
|
2307
|
-
/* @__PURE__ */
|
|
2766
|
+
/* @__PURE__ */ m("button", {
|
|
2308
2767
|
type: "button",
|
|
2309
|
-
className:
|
|
2768
|
+
className: F(Mt.button, Mt.nav),
|
|
2310
2769
|
disabled: e >= t || i,
|
|
2311
2770
|
onClick: () => n(e + 1),
|
|
2312
2771
|
"aria-label": "Next page",
|
|
2313
|
-
children: /* @__PURE__ */
|
|
2772
|
+
children: /* @__PURE__ */ m(E, {
|
|
2314
2773
|
variant: "text-body-small",
|
|
2315
2774
|
as: "span",
|
|
2316
2775
|
color: "inherit",
|
|
@@ -2320,18 +2779,18 @@ var Dt = n(({ page: e, totalPages: t, onPageChange: n, siblingCount: r = 1, inac
|
|
|
2320
2779
|
]
|
|
2321
2780
|
});
|
|
2322
2781
|
});
|
|
2323
|
-
|
|
2324
|
-
var
|
|
2782
|
+
Ft.displayName = "Pagination";
|
|
2783
|
+
var It = {
|
|
2325
2784
|
divider: "_divider_yo1st_1",
|
|
2326
2785
|
vertical: "_vertical_yo1st_9"
|
|
2327
|
-
},
|
|
2786
|
+
}, Lt = r(({ orientation: e = "horizontal", className: t }, n) => /* @__PURE__ */ m("hr", {
|
|
2328
2787
|
ref: n,
|
|
2329
2788
|
role: "separator",
|
|
2330
2789
|
"aria-orientation": e,
|
|
2331
|
-
className:
|
|
2790
|
+
className: F(It.divider, e === "vertical" && It.vertical, t)
|
|
2332
2791
|
}));
|
|
2333
|
-
|
|
2334
|
-
var
|
|
2792
|
+
Lt.displayName = "Divider";
|
|
2793
|
+
var Rt = {
|
|
2335
2794
|
skeleton: "_skeleton_gebkr_1",
|
|
2336
2795
|
text: "_text_gebkr_9",
|
|
2337
2796
|
circular: "_circular_gebkr_15",
|
|
@@ -2339,28 +2798,28 @@ var At = {
|
|
|
2339
2798
|
textGroup: "_textGroup_gebkr_29",
|
|
2340
2799
|
animate: "_animate_gebkr_37",
|
|
2341
2800
|
shimmer: "_shimmer_gebkr_1"
|
|
2342
|
-
},
|
|
2801
|
+
}, zt = r(({ variant: e = "text", width: t, height: n, lines: r = 1, animate: i = !0, className: a }, o) => e === "text" && r > 1 ? /* @__PURE__ */ m("div", {
|
|
2343
2802
|
ref: o,
|
|
2344
|
-
className:
|
|
2803
|
+
className: F(Rt.textGroup, a),
|
|
2345
2804
|
style: { width: t },
|
|
2346
|
-
children: Array.from({ length: r }, (e, t) => /* @__PURE__ */
|
|
2347
|
-
className:
|
|
2805
|
+
children: Array.from({ length: r }, (e, t) => /* @__PURE__ */ m("div", {
|
|
2806
|
+
className: F(Rt.skeleton, Rt.text, i && Rt.animate),
|
|
2348
2807
|
style: {
|
|
2349
2808
|
width: t === r - 1 ? "60%" : "100%",
|
|
2350
2809
|
height: n
|
|
2351
2810
|
}
|
|
2352
2811
|
}, t))
|
|
2353
|
-
}) : /* @__PURE__ */
|
|
2812
|
+
}) : /* @__PURE__ */ m("div", {
|
|
2354
2813
|
ref: o,
|
|
2355
|
-
className:
|
|
2814
|
+
className: F(Rt.skeleton, Rt[e], i && Rt.animate, a),
|
|
2356
2815
|
style: {
|
|
2357
2816
|
width: t,
|
|
2358
2817
|
height: n
|
|
2359
2818
|
},
|
|
2360
2819
|
"aria-hidden": "true"
|
|
2361
2820
|
}));
|
|
2362
|
-
|
|
2363
|
-
var
|
|
2821
|
+
zt.displayName = "Skeleton";
|
|
2822
|
+
var Bt = {
|
|
2364
2823
|
container: "_container_ssyox_3",
|
|
2365
2824
|
topCenter: "_topCenter_ssyox_16",
|
|
2366
2825
|
topRight: "_topRight_ssyox_23",
|
|
@@ -2371,114 +2830,131 @@ var Mt = {
|
|
|
2371
2830
|
toastExit: "_toastExit_ssyox_54",
|
|
2372
2831
|
fadeOut: "_fadeOut_ssyox_1",
|
|
2373
2832
|
dismiss: "_dismiss_ssyox_58"
|
|
2374
|
-
},
|
|
2375
|
-
function
|
|
2376
|
-
|
|
2833
|
+
}, Vt = [], Ht = /* @__PURE__ */ new Set();
|
|
2834
|
+
function Ut() {
|
|
2835
|
+
Ht.forEach((e) => e());
|
|
2377
2836
|
}
|
|
2378
|
-
function
|
|
2379
|
-
return
|
|
2837
|
+
function Wt() {
|
|
2838
|
+
return Vt;
|
|
2380
2839
|
}
|
|
2381
|
-
function
|
|
2382
|
-
return
|
|
2383
|
-
|
|
2840
|
+
function Gt(e) {
|
|
2841
|
+
return Ht.add(e), () => {
|
|
2842
|
+
Ht.delete(e);
|
|
2384
2843
|
};
|
|
2385
2844
|
}
|
|
2386
|
-
var
|
|
2845
|
+
var Kt = 0, qt = {
|
|
2387
2846
|
show(e) {
|
|
2388
|
-
let t = `toast-${++
|
|
2389
|
-
return
|
|
2847
|
+
let t = `toast-${++Kt}`;
|
|
2848
|
+
return Vt = [...Vt, {
|
|
2390
2849
|
id: t,
|
|
2391
2850
|
...e
|
|
2392
|
-
}],
|
|
2851
|
+
}], Ut(), t;
|
|
2393
2852
|
},
|
|
2394
2853
|
info(e, t) {
|
|
2395
|
-
return
|
|
2854
|
+
return qt.show({
|
|
2396
2855
|
message: e,
|
|
2397
2856
|
intent: "neutral",
|
|
2398
2857
|
...t
|
|
2399
2858
|
});
|
|
2400
2859
|
},
|
|
2401
2860
|
success(e, t) {
|
|
2402
|
-
return
|
|
2861
|
+
return qt.show({
|
|
2403
2862
|
message: e,
|
|
2404
2863
|
intent: "positive",
|
|
2405
2864
|
...t
|
|
2406
2865
|
});
|
|
2407
2866
|
},
|
|
2408
2867
|
error(e, t) {
|
|
2409
|
-
return
|
|
2868
|
+
return qt.show({
|
|
2410
2869
|
message: e,
|
|
2411
2870
|
intent: "negative",
|
|
2412
2871
|
...t
|
|
2413
2872
|
});
|
|
2414
2873
|
},
|
|
2415
2874
|
warning(e, t) {
|
|
2416
|
-
return
|
|
2875
|
+
return qt.show({
|
|
2417
2876
|
message: e,
|
|
2418
2877
|
intent: "warning",
|
|
2419
2878
|
...t
|
|
2420
2879
|
});
|
|
2421
2880
|
},
|
|
2422
2881
|
dismiss(e) {
|
|
2423
|
-
|
|
2882
|
+
Vt = Vt.filter((t) => t.id !== e), Ut();
|
|
2424
2883
|
},
|
|
2425
2884
|
dismissAll() {
|
|
2426
|
-
|
|
2885
|
+
Vt = [], Ut();
|
|
2427
2886
|
}
|
|
2428
2887
|
};
|
|
2429
|
-
function
|
|
2430
|
-
return
|
|
2888
|
+
function Jt() {
|
|
2889
|
+
return f(Gt, Wt, Wt);
|
|
2431
2890
|
}
|
|
2432
|
-
var
|
|
2891
|
+
var Yt = {
|
|
2433
2892
|
neutral: "neutral",
|
|
2434
2893
|
brand: "brand",
|
|
2435
2894
|
positive: "positive",
|
|
2436
2895
|
negative: "negative",
|
|
2437
2896
|
warning: "warning",
|
|
2438
2897
|
caution: "caution"
|
|
2439
|
-
},
|
|
2440
|
-
let [t, n] =
|
|
2898
|
+
}, Xt = ({ data: e }) => {
|
|
2899
|
+
let [t, n] = d(!1), r = u(void 0), i = u(e.duration ?? 4e3), s = u(0), c = u(!1), l = a(() => {
|
|
2441
2900
|
n(!0), setTimeout(() => {
|
|
2442
|
-
|
|
2901
|
+
qt.dismiss(e.id), e.onDismiss?.();
|
|
2443
2902
|
}, 200);
|
|
2444
|
-
}, [e])
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2903
|
+
}, [e]), f = a(() => {
|
|
2904
|
+
r.current &&= (clearTimeout(r.current), void 0);
|
|
2905
|
+
}, []), p = a((e) => {
|
|
2906
|
+
e <= 0 || (s.current = Date.now(), r.current = setTimeout(l, e));
|
|
2907
|
+
}, [l]), g = a(() => {
|
|
2908
|
+
if (c.current || !r.current) return;
|
|
2909
|
+
c.current = !0;
|
|
2910
|
+
let e = Date.now() - s.current;
|
|
2911
|
+
i.current = Math.max(0, i.current - e), f();
|
|
2912
|
+
}, [f]), _ = a(() => {
|
|
2913
|
+
c.current && (c.current = !1, p(i.current));
|
|
2914
|
+
}, [p]);
|
|
2915
|
+
o(() => (i.current = e.duration ?? 4e3, c.current = !1, p(i.current), f), [
|
|
2916
|
+
e.duration,
|
|
2917
|
+
p,
|
|
2918
|
+
f
|
|
2919
|
+
]);
|
|
2920
|
+
let v = e.intent === "negative";
|
|
2921
|
+
return /* @__PURE__ */ h(N, {
|
|
2922
|
+
intent: Yt[e.intent ?? "neutral"],
|
|
2452
2923
|
contrast: "bold",
|
|
2453
2924
|
elevation: "floating",
|
|
2454
2925
|
radius: "lg",
|
|
2455
|
-
className:
|
|
2456
|
-
role: "status",
|
|
2457
|
-
"aria-live": "polite",
|
|
2458
|
-
|
|
2926
|
+
className: F(Bt.toast, t && Bt.toastExit),
|
|
2927
|
+
role: v ? "alert" : "status",
|
|
2928
|
+
"aria-live": v ? "assertive" : "polite",
|
|
2929
|
+
onMouseEnter: g,
|
|
2930
|
+
onMouseLeave: _,
|
|
2931
|
+
onFocus: g,
|
|
2932
|
+
onBlur: _,
|
|
2933
|
+
children: [/* @__PURE__ */ m(E, {
|
|
2459
2934
|
variant: "text-body-medium",
|
|
2460
2935
|
as: "span",
|
|
2461
2936
|
color: "inherit",
|
|
2462
2937
|
children: e.message
|
|
2463
|
-
}), /* @__PURE__ */
|
|
2938
|
+
}), /* @__PURE__ */ m("button", {
|
|
2464
2939
|
type: "button",
|
|
2465
|
-
className:
|
|
2466
|
-
onClick:
|
|
2940
|
+
className: Bt.dismiss,
|
|
2941
|
+
onClick: l,
|
|
2467
2942
|
"aria-label": "Dismiss",
|
|
2468
2943
|
children: "×"
|
|
2469
2944
|
})]
|
|
2470
2945
|
});
|
|
2471
|
-
},
|
|
2472
|
-
let n =
|
|
2473
|
-
return typeof document > "u" ? null :
|
|
2946
|
+
}, Zt = r(({ position: e = "top-center" }, t) => {
|
|
2947
|
+
let n = Jt();
|
|
2948
|
+
return typeof document > "u" ? null : v.createPortal(/* @__PURE__ */ m("div", {
|
|
2474
2949
|
ref: t,
|
|
2475
|
-
className:
|
|
2950
|
+
className: F(Bt.container, Bt[Qt(e)]),
|
|
2951
|
+
role: "region",
|
|
2476
2952
|
"aria-label": "Notifications",
|
|
2477
|
-
children: n.map((e) => /* @__PURE__ */
|
|
2953
|
+
children: n.map((e) => /* @__PURE__ */ m(Xt, { data: e }, e.id))
|
|
2478
2954
|
}), document.body);
|
|
2479
2955
|
});
|
|
2480
|
-
|
|
2481
|
-
function
|
|
2956
|
+
Zt.displayName = "ToastContainer";
|
|
2957
|
+
function Qt(e) {
|
|
2482
2958
|
switch (e) {
|
|
2483
2959
|
case "top-center": return "topCenter";
|
|
2484
2960
|
case "top-right": return "topRight";
|
|
@@ -2487,6 +2963,6 @@ function Wt(e) {
|
|
|
2487
2963
|
}
|
|
2488
2964
|
}
|
|
2489
2965
|
//#endregion
|
|
2490
|
-
export {
|
|
2966
|
+
export { Ot as Accordion, kt as AccordionItem, fe as Badge, Je as Banner, jt as Breadcrumb, ie as Button, K as ButtonGroup, R as Card, ge as Checkbox, je as DestructiveMenuItem, Lt as Divider, nt as EmptyState, lt as ErrorBoundary, at as Fade, Se as Field, xt as Header, ye as Input, ne as Loader, Ie as Menu, ke as MenuItem, Oe as Modal, Ft as Pagination, Ct as RadioGroup, wt as RadioItem, st as Scrollbar, We as Select, _t as Sidebar, yt as SidebarItem, vt as SidebarSection, zt as Skeleton, be as Slider, N as Surface, $e as Tab, Et as TabGroup, Ze as Table, ue as Tag, E as Text, Zt as ToastContainer, me as Toggle, oe as ToggleButton, se as ToggleButtonGroup, He as Tooltip, qt as toast, Jt as useToasts };
|
|
2491
2967
|
|
|
2492
2968
|
//# sourceMappingURL=index.js.map
|