@konstructio/ui 0.1.0-alpha.2 → 0.1.0-alpha.21
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/{Combination-b348x__d.js → Combination-VYaRRJBZ.js} +155 -157
- package/dist/DatePicker.css +1 -0
- package/dist/Modal-CrG0m703.js +98 -0
- package/dist/assets/icons/components/Search.js +26 -0
- package/dist/assets/icons/components/Warning.js +22 -0
- package/dist/assets/icons/components/index.js +6 -0
- package/dist/chevron-down-3QGcvbP_.js +11 -0
- package/dist/{chevron-up-DgLBQCKD.js → chevron-up-RLP4nX7V.js} +1 -1
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +55 -41
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +14 -14
- package/dist/components/Badge/Badge.variants.js +18 -17
- package/dist/components/Breadcrumb/Breadcrumb.js +44 -53
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
- package/dist/components/Breadcrumb/components/Item/Item.js +27 -27
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +30 -26
- package/dist/components/Button/Button.variants.js +116 -29
- package/dist/components/Checkbox/Checkbox.js +300 -185
- package/dist/components/Checkbox/Checkbox.variants.js +12 -15
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +2728 -0
- package/dist/components/Datepicker/DatePicker.variants.js +5 -0
- package/dist/components/Dropdown/Dropdown.variants.js +6 -5
- package/dist/components/Dropdown/components/List/List.js +55 -18
- package/dist/components/Dropdown/components/List/List.variants.js +5 -3
- package/dist/components/Dropdown/components/ListItem/ListItem.js +28 -22
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +6 -4
- package/dist/components/Dropdown/components/Wrapper.js +110 -86
- package/dist/components/Dropdown/contexts/dropdown.context.js +6 -2
- package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
- package/dist/components/Dropdown/contexts/dropdown.provider.js +18 -11
- package/dist/components/DropdownButton/DropdownButton.js +136 -0
- package/dist/components/Filter/Filter.js +20 -0
- package/dist/components/Filter/Filter.variants.js +22 -0
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +86 -0
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +95 -0
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +87 -0
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +90 -0
- package/dist/components/Filter/components/ResetButton/ResetButton.js +24 -0
- package/dist/components/Filter/components/index.js +8 -0
- package/dist/components/Filter/events/index.js +12 -0
- package/dist/components/Input/Input.js +134 -163
- package/dist/components/Input/Input.variants.js +15 -13
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +4 -6
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PieChart/PieChart.js +5130 -0
- package/dist/components/Radio/Radio.js +64 -49
- package/dist/components/Radio/Radio.variants.js +14 -12
- package/dist/components/RadioCard/RadioCard.js +23 -21
- package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +141 -126
- package/dist/components/Tabs/Tabs.js +27 -0
- package/dist/components/Tabs/Tabs.variants.js +58 -0
- package/dist/components/Tabs/components/Content.js +19 -0
- package/dist/components/Tabs/components/List.js +20 -0
- package/dist/components/Tabs/components/Trigger.js +26 -0
- package/dist/components/Tabs/components/index.js +8 -0
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/TimePicker/TimePicker.js +8 -0
- package/dist/components/TimePicker/TimePicker.variants.js +62 -0
- package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +96 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
- package/dist/components/TimePicker/components/index.js +4 -0
- package/dist/components/TimePicker/contexts/index.js +8 -0
- package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
- package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
- package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
- package/dist/components/TimePicker/utils/index.js +6 -0
- package/dist/components/Toast/Toast.js +64 -67
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +14 -16
- package/dist/components/index.js +90 -66
- package/dist/createLucideIcon-B7yPYScZ.js +94 -0
- package/dist/index--EmNlyHx.js +31 -0
- package/dist/{index-Bk324h27.js → index-B5MIi2tR.js} +6 -5
- package/dist/{index-g-TFwd6Y.js → index-BCGvACM9.js} +2 -1
- package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
- package/dist/index-BdMNhZnh.js +9 -0
- package/dist/index-BvCZBMfr.js +432 -0
- package/dist/{index-AM3avohj.js → index-CT6_TaZk.js} +3 -3
- package/dist/index-Cq1I1cG9.js +129 -0
- package/dist/index-Cs8Lv8Wj.js +13 -0
- package/dist/{index-YaQrdkGE.js → index-DNRcvRTB.js} +31 -30
- package/dist/index-DdbImHmO.js +323 -0
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/{index-DvFiic6N.js → index-aR9z1Fe3.js} +96 -102
- package/dist/{index-C5psggHV.js → index-h-Ul0anl.js} +1 -2
- package/dist/{index-G_6jG4Qc.js → index-j2KyU-zG.js} +19 -19
- package/dist/{index-dRxIWVBr.js → index-oBRTQ54R.js} +6 -5
- package/dist/{index-D9BbbgUq.js → index-rUBNhTeF.js} +2 -2
- package/dist/index.d.ts +263 -18
- package/dist/index.js +96 -72
- package/dist/package.json +42 -40
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +263 -0
- package/dist/ui/kubefirst-theme.css +1 -1
- package/dist/ui/theme.css +11 -0
- package/dist/useBreadcrumb-DMERrNkJ.js +1280 -0
- package/dist/utils/index.js +4 -4
- package/dist/{x-DU-Zw-L_.js → x-BPcqkRZd.js} +1 -1
- package/package.json +42 -40
- package/dist/Modal-i7eolhYH.js +0 -926
- package/dist/createLucideIcon-CoF3ywd5.js +0 -89
- package/dist/index-BOx5P4tS.js +0 -423
- package/dist/index-CWKdynYu.js +0 -32
- package/dist/index-bYyfdsls.js +0 -118
- package/dist/useBreadcrumb-BsIeMoR1.js +0 -1279
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as c, jsxs as D, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import { u as ae, S as j } from "../../index-
|
|
2
|
+
import { u as ae, S as j } from "../../index-B5MIi2tR.js";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { useRef as Re, useEffect as be, useMemo as oe, isValidElement as re, useCallback as ge } from "react";
|
|
5
|
-
import { P as L, r as Se, d as Ie } from "../../index-
|
|
6
|
-
import { c as Ne, a as Ae, b,
|
|
7
|
-
import { c as _e } from "../../index-
|
|
8
|
-
import { B as De, R as Le, P as Me } from "../../index-
|
|
9
|
-
import { P as Oe } from "../../index-
|
|
10
|
-
import {
|
|
5
|
+
import { P as L, r as Se, d as Ie } from "../../index-BCGvACM9.js";
|
|
6
|
+
import { c as Ne, a as Ae, b, u as Fe } from "../../index-Cq1I1cG9.js";
|
|
7
|
+
import { c as _e } from "../../index-rUBNhTeF.js";
|
|
8
|
+
import { B as De, R as Le, P as Me } from "../../index-DNRcvRTB.js";
|
|
9
|
+
import { P as Oe } from "../../index-j2KyU-zG.js";
|
|
10
|
+
import { u as $ } from "../../index-DwYXX2sM.js";
|
|
11
|
+
import { V as ie, R as ke } from "../../index--EmNlyHx.js";
|
|
11
12
|
import { cn as q } from "../../utils/index.js";
|
|
12
13
|
import { closeToastVariants as Ve, toastVariants as Ke, viewportToastVariants as He } from "./Toast.variants.js";
|
|
13
|
-
import { X as We } from "../../x-
|
|
14
|
-
var Z = "ToastProvider", [ee, Xe, $e] = _e("Toast"), [ce,
|
|
14
|
+
import { X as We } from "../../x-BPcqkRZd.js";
|
|
15
|
+
var Z = "ToastProvider", [ee, Xe, $e] = _e("Toast"), [ce, Rt] = Ne("Toast", [$e]), [Ue, U] = ce(Z), ue = (e) => {
|
|
15
16
|
const {
|
|
16
17
|
__scopeToast: r,
|
|
17
18
|
label: o = "Notification",
|
|
@@ -19,7 +20,7 @@ var Z = "ToastProvider", [ee, Xe, $e] = _e("Toast"), [ce, xt] = Ne("Toast", [$e]
|
|
|
19
20
|
swipeDirection: u = "right",
|
|
20
21
|
swipeThreshold: d = 50,
|
|
21
22
|
children: f
|
|
22
|
-
} = e, [m, v] = s.useState(null), [n,
|
|
23
|
+
} = e, [m, v] = s.useState(null), [n, y] = s.useState(0), w = s.useRef(!1), S = s.useRef(!1);
|
|
23
24
|
return o.trim() || console.error(
|
|
24
25
|
`Invalid prop \`label\` supplied to \`${Z}\`. Expected non-empty \`string\`.`
|
|
25
26
|
), /* @__PURE__ */ c(ee.Provider, { scope: r, children: /* @__PURE__ */ c(
|
|
@@ -33,8 +34,8 @@ var Z = "ToastProvider", [ee, Xe, $e] = _e("Toast"), [ce, xt] = Ne("Toast", [$e]
|
|
|
33
34
|
toastCount: n,
|
|
34
35
|
viewport: m,
|
|
35
36
|
onViewportChange: v,
|
|
36
|
-
onToastAdd: s.useCallback(() =>
|
|
37
|
-
onToastRemove: s.useCallback(() =>
|
|
37
|
+
onToastAdd: s.useCallback(() => y((g) => g + 1), []),
|
|
38
|
+
onToastRemove: s.useCallback(() => y((g) => g - 1), []),
|
|
38
39
|
isFocusedToastEscapeKeyDownRef: w,
|
|
39
40
|
isClosePausedRef: S,
|
|
40
41
|
children: f
|
|
@@ -49,7 +50,7 @@ var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
49
50
|
hotkey: t = Ye,
|
|
50
51
|
label: u = "Notifications ({hotkey})",
|
|
51
52
|
...d
|
|
52
|
-
} = e, f =
|
|
53
|
+
} = e, f = U(le, o), m = Xe(o), v = s.useRef(null), n = s.useRef(null), y = s.useRef(null), w = s.useRef(null), S = ae(r, w, f.onViewportChange), g = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = f.toastCount > 0;
|
|
53
54
|
s.useEffect(() => {
|
|
54
55
|
const i = (C) => {
|
|
55
56
|
var T;
|
|
@@ -71,19 +72,19 @@ var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
71
72
|
}
|
|
72
73
|
}, E = (P) => {
|
|
73
74
|
!i.contains(P.relatedTarget) && T();
|
|
74
|
-
},
|
|
75
|
+
}, h = () => {
|
|
75
76
|
i.contains(document.activeElement) || T();
|
|
76
77
|
};
|
|
77
|
-
return i.addEventListener("focusin", p), i.addEventListener("focusout", E), i.addEventListener("pointermove", p), i.addEventListener("pointerleave",
|
|
78
|
-
i.removeEventListener("focusin", p), i.removeEventListener("focusout", E), i.removeEventListener("pointermove", p), i.removeEventListener("pointerleave",
|
|
78
|
+
return i.addEventListener("focusin", p), i.addEventListener("focusout", E), i.addEventListener("pointermove", p), i.addEventListener("pointerleave", h), window.addEventListener("blur", p), window.addEventListener("focus", T), () => {
|
|
79
|
+
i.removeEventListener("focusin", p), i.removeEventListener("focusout", E), i.removeEventListener("pointermove", p), i.removeEventListener("pointerleave", h), window.removeEventListener("blur", p), window.removeEventListener("focus", T);
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
}, [R, f.isClosePausedRef]);
|
|
82
83
|
const l = s.useCallback(
|
|
83
84
|
({ tabbingDirection: i }) => {
|
|
84
85
|
const p = m().map((T) => {
|
|
85
|
-
const E = T.ref.current,
|
|
86
|
-
return i === "forwards" ?
|
|
86
|
+
const E = T.ref.current, h = [E, ...nt(E)];
|
|
87
|
+
return i === "forwards" ? h : h.reverse();
|
|
87
88
|
});
|
|
88
89
|
return (i === "forwards" ? p.reverse() : p).flat();
|
|
89
90
|
},
|
|
@@ -93,16 +94,16 @@ var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
93
94
|
const i = w.current;
|
|
94
95
|
if (i) {
|
|
95
96
|
const C = (p) => {
|
|
96
|
-
var
|
|
97
|
+
var h, P, N;
|
|
97
98
|
const T = p.altKey || p.ctrlKey || p.metaKey;
|
|
98
99
|
if (p.key === "Tab" && !T) {
|
|
99
100
|
const M = document.activeElement, F = p.shiftKey;
|
|
100
101
|
if (p.target === i && F) {
|
|
101
|
-
(
|
|
102
|
+
(h = n.current) == null || h.focus();
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
|
-
const A = l({ tabbingDirection: F ? "backwards" : "forwards" }),
|
|
105
|
-
z(A.slice(
|
|
105
|
+
const A = l({ tabbingDirection: F ? "backwards" : "forwards" }), K = A.findIndex((a) => a === M);
|
|
106
|
+
z(A.slice(K + 1)) ? p.preventDefault() : F ? (P = n.current) == null || P.focus() : (N = y.current) == null || N.focus();
|
|
106
107
|
}
|
|
107
108
|
};
|
|
108
109
|
return i.addEventListener("keydown", C), () => i.removeEventListener("keydown", C);
|
|
@@ -132,7 +133,7 @@ var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
132
133
|
R && /* @__PURE__ */ c(
|
|
133
134
|
Q,
|
|
134
135
|
{
|
|
135
|
-
ref:
|
|
136
|
+
ref: y,
|
|
136
137
|
onFocusFromOutsideViewport: () => {
|
|
137
138
|
const i = l({
|
|
138
139
|
tabbingDirection: "backwards"
|
|
@@ -149,11 +150,10 @@ var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
149
150
|
de.displayName = le;
|
|
150
151
|
var fe = "ToastFocusProxy", Q = s.forwardRef(
|
|
151
152
|
(e, r) => {
|
|
152
|
-
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...u } = e, d =
|
|
153
|
+
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...u } = e, d = U(fe, o);
|
|
153
154
|
return /* @__PURE__ */ c(
|
|
154
155
|
ie,
|
|
155
156
|
{
|
|
156
|
-
"aria-hidden": !0,
|
|
157
157
|
tabIndex: 0,
|
|
158
158
|
...u,
|
|
159
159
|
ref: r,
|
|
@@ -168,12 +168,13 @@ var fe = "ToastFocusProxy", Q = s.forwardRef(
|
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
170
|
Q.displayName = fe;
|
|
171
|
-
var
|
|
171
|
+
var V = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd", pe = s.forwardRef(
|
|
172
172
|
(e, r) => {
|
|
173
|
-
const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [m
|
|
173
|
+
const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [m, v] = Ae({
|
|
174
174
|
prop: t,
|
|
175
|
-
defaultProp: u,
|
|
176
|
-
onChange: d
|
|
175
|
+
defaultProp: u ?? !0,
|
|
176
|
+
onChange: d,
|
|
177
|
+
caller: V
|
|
177
178
|
});
|
|
178
179
|
return /* @__PURE__ */ c(Oe, { present: o || m, children: /* @__PURE__ */ c(
|
|
179
180
|
Qe,
|
|
@@ -182,28 +183,28 @@ var U = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.sw
|
|
|
182
183
|
...f,
|
|
183
184
|
ref: r,
|
|
184
185
|
onClose: () => v(!1),
|
|
185
|
-
onPause:
|
|
186
|
-
onResume:
|
|
186
|
+
onPause: $(e.onPause),
|
|
187
|
+
onResume: $(e.onResume),
|
|
187
188
|
onSwipeStart: b(e.onSwipeStart, (n) => {
|
|
188
189
|
n.currentTarget.setAttribute("data-swipe", "start");
|
|
189
190
|
}),
|
|
190
191
|
onSwipeMove: b(e.onSwipeMove, (n) => {
|
|
191
|
-
const { x:
|
|
192
|
-
n.currentTarget.setAttribute("data-swipe", "move"), n.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${
|
|
192
|
+
const { x: y, y: w } = n.detail.delta;
|
|
193
|
+
n.currentTarget.setAttribute("data-swipe", "move"), n.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${y}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${w}px`);
|
|
193
194
|
}),
|
|
194
195
|
onSwipeCancel: b(e.onSwipeCancel, (n) => {
|
|
195
196
|
n.currentTarget.setAttribute("data-swipe", "cancel"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
196
197
|
}),
|
|
197
198
|
onSwipeEnd: b(e.onSwipeEnd, (n) => {
|
|
198
|
-
const { x:
|
|
199
|
-
n.currentTarget.setAttribute("data-swipe", "end"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${
|
|
199
|
+
const { x: y, y: w } = n.detail.delta;
|
|
200
|
+
n.currentTarget.setAttribute("data-swipe", "end"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${y}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${w}px`), v(!1);
|
|
200
201
|
})
|
|
201
202
|
}
|
|
202
203
|
) });
|
|
203
204
|
}
|
|
204
205
|
);
|
|
205
|
-
pe.displayName =
|
|
206
|
-
var [Ge, Je] = ce(
|
|
206
|
+
pe.displayName = V;
|
|
207
|
+
var [Ge, Je] = ce(V, {
|
|
207
208
|
onClose() {
|
|
208
209
|
}
|
|
209
210
|
}), Qe = s.forwardRef(
|
|
@@ -217,12 +218,12 @@ var [Ge, Je] = ce(U, {
|
|
|
217
218
|
onEscapeKeyDown: m,
|
|
218
219
|
onPause: v,
|
|
219
220
|
onResume: n,
|
|
220
|
-
onSwipeStart:
|
|
221
|
+
onSwipeStart: y,
|
|
221
222
|
onSwipeMove: w,
|
|
222
223
|
onSwipeCancel: S,
|
|
223
224
|
onSwipeEnd: g,
|
|
224
225
|
...R
|
|
225
|
-
} = e, l =
|
|
226
|
+
} = e, l = U(V, o), [i, C] = s.useState(null), p = ae(r, (a) => C(a)), T = s.useRef(null), E = s.useRef(null), h = u || l.duration, P = s.useRef(0), N = s.useRef(h), M = s.useRef(0), { onToastAdd: F, onToastRemove: Y } = l, _ = $(() => {
|
|
226
227
|
var x;
|
|
227
228
|
(i == null ? void 0 : i.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()), f();
|
|
228
229
|
}), A = s.useCallback(
|
|
@@ -244,19 +245,18 @@ var [Ge, Je] = ce(U, {
|
|
|
244
245
|
a.removeEventListener(G, I), a.removeEventListener(J, x);
|
|
245
246
|
};
|
|
246
247
|
}
|
|
247
|
-
}, [l.viewport,
|
|
248
|
-
d && !l.isClosePausedRef.current && A(
|
|
249
|
-
}, [d,
|
|
250
|
-
const
|
|
248
|
+
}, [l.viewport, h, v, n, A]), s.useEffect(() => {
|
|
249
|
+
d && !l.isClosePausedRef.current && A(h);
|
|
250
|
+
}, [d, h, l.isClosePausedRef, A]), s.useEffect(() => (F(), () => Y()), [F, Y]);
|
|
251
|
+
const K = s.useMemo(() => i ? Ce(i) : null, [i]);
|
|
251
252
|
return l.viewport ? /* @__PURE__ */ D(se, { children: [
|
|
252
|
-
|
|
253
|
+
K && /* @__PURE__ */ c(
|
|
253
254
|
Ze,
|
|
254
255
|
{
|
|
255
256
|
__scopeToast: o,
|
|
256
257
|
role: "status",
|
|
257
258
|
"aria-live": t === "foreground" ? "assertive" : "polite",
|
|
258
|
-
|
|
259
|
-
children: V
|
|
259
|
+
children: K
|
|
260
260
|
}
|
|
261
261
|
),
|
|
262
262
|
/* @__PURE__ */ c(Ge, { scope: o, onClose: _, children: Se.createPortal(
|
|
@@ -270,9 +270,6 @@ var [Ge, Je] = ce(U, {
|
|
|
270
270
|
children: /* @__PURE__ */ c(
|
|
271
271
|
L.li,
|
|
272
272
|
{
|
|
273
|
-
role: "status",
|
|
274
|
-
"aria-live": "off",
|
|
275
|
-
"aria-atomic": !0,
|
|
276
273
|
tabIndex: 0,
|
|
277
274
|
"data-state": d ? "open" : "closed",
|
|
278
275
|
"data-swipe-direction": l.swipeDirection,
|
|
@@ -287,10 +284,10 @@ var [Ge, Je] = ce(U, {
|
|
|
287
284
|
}),
|
|
288
285
|
onPointerMove: b(e.onPointerMove, (a) => {
|
|
289
286
|
if (!T.current) return;
|
|
290
|
-
const x = a.clientX - T.current.x, I = a.clientY - T.current.y, O = !!E.current, k = ["left", "right"].includes(l.swipeDirection),
|
|
291
|
-
O ? (E.current =
|
|
287
|
+
const x = a.clientX - T.current.x, I = a.clientY - T.current.y, O = !!E.current, k = ["left", "right"].includes(l.swipeDirection), H = ["left", "up"].includes(l.swipeDirection) ? Math.min : Math.max, Pe = k ? H(0, x) : 0, xe = k ? 0 : H(0, I), B = a.pointerType === "touch" ? 10 : 2, W = { x: Pe, y: xe }, te = { originalEvent: a, delta: W };
|
|
288
|
+
O ? (E.current = W, X(je, w, te, {
|
|
292
289
|
discrete: !1
|
|
293
|
-
})) : ne(
|
|
290
|
+
})) : ne(W, l.swipeDirection, B) ? (E.current = W, X(Be, y, te, {
|
|
294
291
|
discrete: !1
|
|
295
292
|
}), a.target.setPointerCapture(a.pointerId)) : (Math.abs(x) > B || Math.abs(I) > B) && (T.current = null);
|
|
296
293
|
}),
|
|
@@ -298,16 +295,16 @@ var [Ge, Je] = ce(U, {
|
|
|
298
295
|
const x = E.current, I = a.target;
|
|
299
296
|
if (I.hasPointerCapture(a.pointerId) && I.releasePointerCapture(a.pointerId), E.current = null, T.current = null, x) {
|
|
300
297
|
const O = a.currentTarget, k = { originalEvent: a, delta: x };
|
|
301
|
-
ne(x, l.swipeDirection, l.swipeThreshold) ?
|
|
298
|
+
ne(x, l.swipeDirection, l.swipeThreshold) ? X(ze, g, k, {
|
|
302
299
|
discrete: !0
|
|
303
|
-
}) :
|
|
300
|
+
}) : X(
|
|
304
301
|
qe,
|
|
305
302
|
S,
|
|
306
303
|
k,
|
|
307
304
|
{
|
|
308
305
|
discrete: !0
|
|
309
306
|
}
|
|
310
|
-
), O.addEventListener("click", (
|
|
307
|
+
), O.addEventListener("click", (H) => H.preventDefault(), {
|
|
311
308
|
once: !0
|
|
312
309
|
});
|
|
313
310
|
}
|
|
@@ -321,7 +318,7 @@ var [Ge, Je] = ce(U, {
|
|
|
321
318
|
] }) : null;
|
|
322
319
|
}
|
|
323
320
|
), Ze = (e) => {
|
|
324
|
-
const { __scopeToast: r, children: o, ...t } = e, u =
|
|
321
|
+
const { __scopeToast: r, children: o, ...t } = e, u = U(V, r), [d, f] = s.useState(!1), [m, v] = s.useState(!1);
|
|
325
322
|
return ot(() => f(!0)), s.useEffect(() => {
|
|
326
323
|
const n = window.setTimeout(() => v(!0), 1e3);
|
|
327
324
|
return () => window.clearTimeout(n);
|
|
@@ -347,16 +344,16 @@ Te.displayName = tt;
|
|
|
347
344
|
var ve = "ToastAction", we = s.forwardRef(
|
|
348
345
|
(e, r) => {
|
|
349
346
|
const { altText: o, ...t } = e;
|
|
350
|
-
return o.trim() ? /* @__PURE__ */ c(
|
|
347
|
+
return o.trim() ? /* @__PURE__ */ c(he, { altText: o, asChild: !0, children: /* @__PURE__ */ c(ye, { ...t, ref: r }) }) : (console.error(
|
|
351
348
|
`Invalid prop \`altText\` supplied to \`${ve}\`. Expected non-empty \`string\`.`
|
|
352
349
|
), null);
|
|
353
350
|
}
|
|
354
351
|
);
|
|
355
352
|
we.displayName = ve;
|
|
356
|
-
var Ee = "ToastClose",
|
|
353
|
+
var Ee = "ToastClose", ye = s.forwardRef(
|
|
357
354
|
(e, r) => {
|
|
358
355
|
const { __scopeToast: o, ...t } = e, u = Je(Ee, o);
|
|
359
|
-
return /* @__PURE__ */ c(
|
|
356
|
+
return /* @__PURE__ */ c(he, { asChild: !0, children: /* @__PURE__ */ c(
|
|
360
357
|
L.button,
|
|
361
358
|
{
|
|
362
359
|
type: "button",
|
|
@@ -367,8 +364,8 @@ var Ee = "ToastClose", he = s.forwardRef(
|
|
|
367
364
|
) });
|
|
368
365
|
}
|
|
369
366
|
);
|
|
370
|
-
|
|
371
|
-
var
|
|
367
|
+
ye.displayName = Ee;
|
|
368
|
+
var he = s.forwardRef((e, r) => {
|
|
372
369
|
const { __scopeToast: o, altText: t, ...u } = e;
|
|
373
370
|
return /* @__PURE__ */ c(
|
|
374
371
|
L.div,
|
|
@@ -394,7 +391,7 @@ function Ce(e) {
|
|
|
394
391
|
}
|
|
395
392
|
}), r;
|
|
396
393
|
}
|
|
397
|
-
function
|
|
394
|
+
function X(e, r, o, { discrete: t }) {
|
|
398
395
|
const u = o.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
|
|
399
396
|
r && u.addEventListener(e, r, { once: !0 }), t ? Ie(u, d) : u.dispatchEvent(d);
|
|
400
397
|
}
|
|
@@ -404,7 +401,7 @@ var ne = (e, r, o = 0) => {
|
|
|
404
401
|
};
|
|
405
402
|
function ot(e = () => {
|
|
406
403
|
}) {
|
|
407
|
-
const r =
|
|
404
|
+
const r = $(e);
|
|
408
405
|
Fe(() => {
|
|
409
406
|
let o = 0, t = 0;
|
|
410
407
|
return o = window.requestAnimationFrame(() => t = window.requestAnimationFrame(r)), () => {
|
|
@@ -430,7 +427,7 @@ function z(e) {
|
|
|
430
427
|
return e.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
|
|
431
428
|
}
|
|
432
429
|
var st = ue, at = de, it = pe, ct = me, ut = Te, lt = we;
|
|
433
|
-
const
|
|
430
|
+
const bt = ({
|
|
434
431
|
title: e,
|
|
435
432
|
duration: r = 5e3,
|
|
436
433
|
titleClassName: o,
|
|
@@ -441,7 +438,7 @@ const Rt = ({
|
|
|
441
438
|
showCloseButton: m = !0,
|
|
442
439
|
closeButtonClassName: v,
|
|
443
440
|
className: n,
|
|
444
|
-
open:
|
|
441
|
+
open: y = !1,
|
|
445
442
|
setOpen: w
|
|
446
443
|
}) => {
|
|
447
444
|
const S = Re(0);
|
|
@@ -456,7 +453,7 @@ const Rt = ({
|
|
|
456
453
|
{
|
|
457
454
|
className: q(Ke({ className: n })),
|
|
458
455
|
"data-theme": f,
|
|
459
|
-
open:
|
|
456
|
+
open: y,
|
|
460
457
|
onOpenChange: w,
|
|
461
458
|
children: [
|
|
462
459
|
/* @__PURE__ */ c(ct, { asChild: !0, className: o, children: g }),
|
|
@@ -481,5 +478,5 @@ const Rt = ({
|
|
|
481
478
|
] });
|
|
482
479
|
};
|
|
483
480
|
export {
|
|
484
|
-
|
|
481
|
+
bt as Toast
|
|
485
482
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { S as i } from "../../index-
|
|
2
|
+
import { S as i } from "../../index-B5MIi2tR.js";
|
|
3
3
|
import { forwardRef as v, useRef as N, useImperativeHandle as w, useMemo as h, isValidElement as x } from "react";
|
|
4
4
|
import { cn as o } from "../../utils/index.js";
|
|
5
5
|
import { arrowVariants as R, tooltipVariants as V } from "./Tooltip.variants.js";
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const i = ({
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { cn as f } from "../../utils/index.js";
|
|
3
|
+
import { typographyVariants as h } from "./Typography.variants.js";
|
|
4
|
+
import { S as l } from "../../index-B5MIi2tR.js";
|
|
5
|
+
const d = ({
|
|
7
6
|
className: p,
|
|
8
7
|
theme: m,
|
|
9
8
|
children: s,
|
|
10
9
|
variant: o,
|
|
11
|
-
component:
|
|
12
|
-
asChild:
|
|
10
|
+
component: e,
|
|
11
|
+
asChild: r = !1,
|
|
13
12
|
...t
|
|
14
13
|
}) => {
|
|
15
|
-
const y =
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
14
|
+
const y = r ? l : e ?? (o != null && o.includes("h") ? o : "p");
|
|
15
|
+
return /* @__PURE__ */ c(
|
|
16
|
+
y,
|
|
18
17
|
{
|
|
19
|
-
id: y,
|
|
20
18
|
"data-theme": m,
|
|
21
|
-
className:
|
|
22
|
-
|
|
19
|
+
className: f(
|
|
20
|
+
h({
|
|
23
21
|
className: p,
|
|
24
22
|
variant: o
|
|
25
23
|
})
|
|
@@ -29,7 +27,7 @@ const i = ({
|
|
|
29
27
|
}
|
|
30
28
|
);
|
|
31
29
|
};
|
|
32
|
-
|
|
30
|
+
d.displayName = "Typography";
|
|
33
31
|
export {
|
|
34
|
-
|
|
32
|
+
d as Typography
|
|
35
33
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,72 +1,96 @@
|
|
|
1
|
-
import { Alert as
|
|
1
|
+
import { Alert as e } from "./Alert/Alert.js";
|
|
2
2
|
import { AlertDialog as p } from "./AlertDialog/AlertDialog.js";
|
|
3
3
|
import { Autocomplete as x } from "./Autocomplete/Autocomplete.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
4
|
+
import { Badge as a } from "./Badge/Badge.js";
|
|
5
|
+
import { Breadcrumb as d } from "./Breadcrumb/Breadcrumb.js";
|
|
6
|
+
import { Button as n } from "./Button/Button.js";
|
|
7
|
+
import { Card as u } from "./Card/Card.js";
|
|
8
|
+
import { Checkbox as c } from "./Checkbox/Checkbox.js";
|
|
9
|
+
import { DatePicker as b } from "./Datepicker/DatePicker.js";
|
|
10
|
+
import { Divider as B } from "./Divider/Divider.js";
|
|
11
|
+
import { Dropdown as S } from "./Dropdown/Dropdown.js";
|
|
12
|
+
import { DropdownButton as N } from "./DropdownButton/DropdownButton.js";
|
|
13
|
+
import { Filter as h } from "./Filter/Filter.js";
|
|
14
|
+
import { Input as A } from "./Input/Input.js";
|
|
15
|
+
import { Loading as k } from "./Loading/Loading.js";
|
|
16
|
+
import { M as G } from "../Modal-CrG0m703.js";
|
|
17
|
+
import { NumberInput as M } from "./NumberInput/NumberInput.js";
|
|
18
|
+
import { PieChart as I } from "./PieChart/PieChart.js";
|
|
19
|
+
import { ProgressBar as j } from "./ProgressBar/ProgressBar.js";
|
|
20
|
+
import { Radio as z } from "./Radio/Radio.js";
|
|
21
|
+
import { RadioCard as H } from "./RadioCard/RadioCard.js";
|
|
22
|
+
import { RadioCardGroup as K } from "./RadioCardGroup/RadioCardGroup.js";
|
|
23
|
+
import { RadioGroup as U } from "./RadioGroup/RadioGroup.js";
|
|
24
|
+
import { Range as W } from "./Range/Range.js";
|
|
25
|
+
import { Sidebar as Y } from "./Sidebar/Sidebar.js";
|
|
26
|
+
import { Slider as _ } from "./Slider/Slider.js";
|
|
27
|
+
import { Switch as oo } from "./Switch/Switch.js";
|
|
28
|
+
import { Table as eo } from "./Table/Table.js";
|
|
29
|
+
import { Tabs as po } from "./Tabs/Tabs.js";
|
|
30
|
+
import { Tag as xo } from "./Tag/Tag.js";
|
|
31
|
+
import { TagSelect as ao } from "./TagSelect/TagSelect.js";
|
|
32
|
+
import { TextArea as go } from "./TextArea/TextArea.js";
|
|
33
|
+
import { TimePicker as lo } from "./TimePicker/TimePicker.js";
|
|
34
|
+
import { Toast as To } from "./Toast/Toast.js";
|
|
35
|
+
import { Tooltip as Do } from "./Tooltip/Tooltip.js";
|
|
36
|
+
import { Typography as so } from "./Typography/Typography.js";
|
|
37
|
+
import { BadgeMultiSelect as Co } from "./Filter/components/BadgeDropdown/BadgeMultiSelect.js";
|
|
38
|
+
import { DateFilterDropdown as vo } from "./Filter/components/DateFilterDropdown/DateFilterDropdown.js";
|
|
39
|
+
import { Footer as Ro } from "./Sidebar/components/Footer/Footer.js";
|
|
40
|
+
import { Logo as wo } from "./Sidebar/components/Logo/Logo.js";
|
|
41
|
+
import { Navigation as Po } from "./Sidebar/components/Navigation/Navigation.js";
|
|
42
|
+
import { NavigationGroup as Fo } from "./Sidebar/components/NavigationGroup/NavigationGroup.js";
|
|
43
|
+
import { NavigationOption as Lo } from "./Sidebar/components/NavigationOption/NavigationOption.js";
|
|
44
|
+
import { NavigationSeparator as yo } from "./Sidebar/components/NavigationSeparator/NavigationSeparator.js";
|
|
45
|
+
import { List as Oo } from "./Tabs/components/List.js";
|
|
46
|
+
import { Trigger as qo } from "./Tabs/components/Trigger.js";
|
|
47
|
+
import { Content as Eo } from "./Tabs/components/Content.js";
|
|
36
48
|
export {
|
|
37
|
-
|
|
49
|
+
e as Alert,
|
|
38
50
|
p as AlertDialog,
|
|
39
51
|
x as Autocomplete,
|
|
40
|
-
a as
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
G as
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
a as Badge,
|
|
53
|
+
Co as BadgeMultiSelect,
|
|
54
|
+
d as Breadcrumb,
|
|
55
|
+
n as Button,
|
|
56
|
+
u as Card,
|
|
57
|
+
c as Checkbox,
|
|
58
|
+
Eo as Content,
|
|
59
|
+
vo as DateFilterDropdown,
|
|
60
|
+
b as DatePicker,
|
|
61
|
+
B as Divider,
|
|
62
|
+
S as Dropdown,
|
|
63
|
+
N as DropdownButton,
|
|
64
|
+
h as Filter,
|
|
65
|
+
Ro as Footer,
|
|
66
|
+
A as Input,
|
|
67
|
+
Oo as List,
|
|
68
|
+
k as Loading,
|
|
69
|
+
wo as Logo,
|
|
70
|
+
G as Modal,
|
|
71
|
+
Po as Navigation,
|
|
72
|
+
Fo as NavigationGroup,
|
|
73
|
+
Lo as NavigationOption,
|
|
74
|
+
yo as NavigationSeparator,
|
|
75
|
+
M as NumberInput,
|
|
76
|
+
I as PieChart,
|
|
77
|
+
j as ProgressBar,
|
|
78
|
+
z as Radio,
|
|
79
|
+
H as RadioCard,
|
|
80
|
+
K as RadioCardGroup,
|
|
81
|
+
U as RadioGroup,
|
|
82
|
+
W as Range,
|
|
83
|
+
Y as Sidebar,
|
|
84
|
+
_ as Slider,
|
|
85
|
+
oo as Switch,
|
|
86
|
+
eo as Table,
|
|
87
|
+
po as Tabs,
|
|
88
|
+
xo as Tag,
|
|
89
|
+
ao as TagSelect,
|
|
90
|
+
go as TextArea,
|
|
91
|
+
lo as TimePicker,
|
|
92
|
+
To as Toast,
|
|
93
|
+
Do as Tooltip,
|
|
94
|
+
qo as Trigger,
|
|
95
|
+
so as Typography
|
|
72
96
|
};
|