@konstructio/ui 0.0.2 → 0.0.3
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/{AlertDialogTrigger-BIbxXexQ.js → AlertDialogTrigger-lenvKoGF.js} +4 -4
- package/dist/Modal-Bg9UG35z.js +909 -0
- package/dist/{chevron-up-Cmu1oXfj.js → chevron-up-CvquEaNg.js} +1 -1
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.variants.d.ts +1 -1
- package/dist/components/AlertDialog/AlertDialog.variants.js +4 -5
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.variants.d.ts +2 -2
- package/dist/components/Autocomplete/Autocomplete.variants.js +8 -8
- package/dist/components/Autocomplete/components/List.types.d.ts +3 -3
- package/dist/components/Autocomplete/components/List.variants.d.ts +4 -4
- package/dist/components/Autocomplete/components/List.variants.js +13 -13
- package/dist/components/Autocomplete/hooks/useAutocomplete.d.ts +4 -4
- package/dist/components/Autocomplete/hooks/useNavigationList.d.ts +4 -4
- package/dist/components/Breadcrumb/Breadcrumb.js +57 -412
- package/dist/components/Breadcrumb/Breadcrumb.variants.d.ts +3 -3
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +12 -12
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +23 -21
- package/dist/components/Button/Button.variants.d.ts +2 -1
- package/dist/components/Button/Button.variants.js +122 -23
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/Checkbox/Checkbox.variants.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.variants.js +7 -16
- package/dist/components/Dropdown/Dropdown.js +5 -5
- package/dist/components/Dropdown/Dropdown.types.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.variants.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.variants.js +5 -9
- package/dist/components/Dropdown/components/List/List.d.ts +2 -2
- package/dist/components/Dropdown/components/List/List.types.d.ts +3 -3
- package/dist/components/Dropdown/components/List/List.variants.d.ts +1 -1
- package/dist/components/Dropdown/components/List/List.variants.js +3 -3
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.d.ts +1 -1
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +3 -3
- package/dist/components/Dropdown/components/Wrapper.d.ts +2 -2
- package/dist/components/Dropdown/components/Wrapper.js +1 -1
- package/dist/components/Dropdown/contexts/dropdown.provider.d.ts +4 -1
- package/dist/components/Dropdown/contexts/dropdown.provider.js +19 -8
- package/dist/components/Dropdown/hooks/useDropdown.d.ts +4 -4
- package/dist/components/Dropdown/hooks/useNavigationList.d.ts +4 -4
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.d.ts +1 -1
- package/dist/components/Input/Input.variants.js +3 -3
- 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 -3
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.d.ts +2 -2
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +10 -10
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/hooks/useModal.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.js +96 -87
- package/dist/components/NumberInput/NumberInput.variants.d.ts +3 -3
- package/dist/components/NumberInput/NumberInput.variants.js +14 -21
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +2 -2
- package/dist/components/ProgressBar/ProgressBar.variants.js +7 -12
- package/dist/components/Radio/Radio.variants.d.ts +1 -1
- package/dist/components/Radio/Radio.variants.js +4 -7
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Range/Range.variants.d.ts +4 -4
- package/dist/components/Range/Range.variants.js +18 -18
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.variants.d.ts +3 -3
- package/dist/components/Slider/Slider.variants.js +12 -12
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/Switch/Switch.variants.d.ts +2 -2
- package/dist/components/Switch/Switch.variants.js +6 -6
- package/dist/components/Tag/Tag.variants.js +1 -1
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/TagSelect.variants.d.ts +3 -3
- package/dist/components/TagSelect/TagSelect.variants.js +11 -14
- package/dist/components/TagSelect/hooks/useTagSelect.d.ts +1 -1
- package/dist/components/TextArea/TextArea.variants.d.ts +1 -1
- package/dist/components/TextArea/TextArea.variants.js +5 -5
- package/dist/components/Toast/Toast.js +104 -101
- package/dist/components/Toast/Toast.variants.d.ts +3 -3
- package/dist/components/Toast/Toast.variants.js +12 -12
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/Tooltip.variants.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.variants.js +9 -9
- package/dist/components/Tooltip/hooks/useTooltip.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/contexts/theme.context.d.ts +1 -1
- package/dist/contexts/theme.hook.js +3 -6
- package/dist/contexts/theme.provider.d.ts +2 -3
- package/dist/contexts/theme.provider.js +4 -1
- package/dist/index-BBjak_0p.js +47 -0
- package/dist/index-BNmRGtA6.js +34 -0
- package/dist/{index-DFbnnPzA.js → index-Ci9Yg4G1.js} +5 -5
- package/dist/{index-B_GWswUP.js → index-D4Q2rMby.js} +1 -1
- package/dist/{index-DQMInta3.js → index-D68N8v8R.js} +214 -209
- package/dist/index-DoOsnuB6.js +72 -0
- package/dist/{index-2K8qjK4R.js → index-O3j1K921.js} +36 -37
- package/dist/index-OOfdXoxx.js +423 -0
- package/dist/index-ffjBR8Av.js +32 -0
- package/dist/index.js +1 -1
- package/dist/package.json +38 -38
- package/dist/plugins/konstruct.js +61 -50
- package/dist/plugins/utils/colors.d.ts +127 -10
- package/dist/plugins/utils/colors.js +210 -510
- package/dist/styles.css +1 -1
- package/dist/useBreadcrumb-tyxjV-a1.js +1398 -0
- package/dist/utils/index.js +150 -162
- package/dist/x-CRBgmX1Q.js +62 -0
- package/package.json +38 -38
- package/dist/Modal-CO0_SnXD.js +0 -909
- package/dist/index-2hJuj4UN.js +0 -19069
- package/dist/index-4qm4jAkj.js +0 -92
- package/dist/index-BJ7FQg17.js +0 -35
- package/dist/index-BqM_XclQ.js +0 -94
- package/dist/index-BwYCDOHZ.js +0 -44
- package/dist/index-CCavb-1K.js +0 -57
- package/dist/useBreadcrumb-BSMnc4Fu.js +0 -341
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as D, jsx as c, Fragment as ne } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { useState as xe, useRef as Re, useEffect as be, useMemo as te, isValidElement as oe, useCallback as ge } from "react";
|
|
4
|
-
import { r as Se } from "../../index-
|
|
5
|
-
import { c as
|
|
6
|
-
import { u as se, S as j } from "../../index-
|
|
7
|
-
import { c as
|
|
8
|
-
import { B as
|
|
9
|
-
import { P as
|
|
10
|
-
import {
|
|
11
|
-
import { V as ae, X as ke } from "../../index-4qm4jAkj.js";
|
|
4
|
+
import { P as L, r as Se, d as Ie } from "../../index-OOfdXoxx.js";
|
|
5
|
+
import { c as Ne, a as Ae, b as X, d as b, u as Fe } from "../../index-8vgf-x5i.js";
|
|
6
|
+
import { u as se, S as j } from "../../index-DoOsnuB6.js";
|
|
7
|
+
import { c as _e } from "../../index-BBjak_0p.js";
|
|
8
|
+
import { B as De, R as Le, P as Oe } from "../../index-O3j1K921.js";
|
|
9
|
+
import { P as Me } from "../../index-D4Q2rMby.js";
|
|
10
|
+
import { V as ae, R as ke } from "../../index-ffjBR8Av.js";
|
|
12
11
|
import "../../contexts/theme.context.js";
|
|
13
12
|
import { useTheme as Ve } from "../../contexts/theme.hook.js";
|
|
14
13
|
import "../../js.cookie-OLEfuq_g.js";
|
|
15
14
|
import { toastVariants as Ke, closeToastVariants as He, viewportToastVariants as We } from "./Toast.variants.js";
|
|
16
|
-
|
|
15
|
+
import { X as Xe } from "../../x-CRBgmX1Q.js";
|
|
16
|
+
var Q = "ToastProvider", [Z, $e, Ue] = _e("Toast"), [ie, gt] = Ne("Toast", [Ue]), [Ye, $] = ie(Q), ce = (e) => {
|
|
17
17
|
const {
|
|
18
18
|
__scopeToast: r,
|
|
19
19
|
label: o = "Notification",
|
|
20
20
|
duration: t = 5e3,
|
|
21
21
|
swipeDirection: u = "right",
|
|
22
22
|
swipeThreshold: d = 50,
|
|
23
|
-
children:
|
|
23
|
+
children: p
|
|
24
24
|
} = e, [m, v] = s.useState(null), [n, w] = s.useState(0), E = s.useRef(!1), I = s.useRef(!1);
|
|
25
25
|
return o.trim() || console.error(
|
|
26
26
|
`Invalid prop \`label\` supplied to \`${Q}\`. Expected non-empty \`string\`.`
|
|
27
27
|
), /* @__PURE__ */ c(Z.Provider, { scope: r, children: /* @__PURE__ */ c(
|
|
28
|
-
|
|
28
|
+
Ye,
|
|
29
29
|
{
|
|
30
30
|
scope: r,
|
|
31
31
|
label: o,
|
|
@@ -39,19 +39,19 @@ var Q = "ToastProvider", [Z, Xe, Ue] = Fe("Toast"), [ie, bt] = Ie("Toast", [Ue])
|
|
|
39
39
|
onToastRemove: s.useCallback(() => w((R) => R - 1), []),
|
|
40
40
|
isFocusedToastEscapeKeyDownRef: E,
|
|
41
41
|
isClosePausedRef: I,
|
|
42
|
-
children:
|
|
42
|
+
children: p
|
|
43
43
|
}
|
|
44
44
|
) });
|
|
45
45
|
};
|
|
46
46
|
ce.displayName = Q;
|
|
47
|
-
var ue = "ToastViewport",
|
|
47
|
+
var ue = "ToastViewport", Be = ["F8"], z = "toast.viewportPause", G = "toast.viewportResume", le = s.forwardRef(
|
|
48
48
|
(e, r) => {
|
|
49
49
|
const {
|
|
50
50
|
__scopeToast: o,
|
|
51
|
-
hotkey: t =
|
|
51
|
+
hotkey: t = Be,
|
|
52
52
|
label: u = "Notifications ({hotkey})",
|
|
53
53
|
...d
|
|
54
|
-
} = e,
|
|
54
|
+
} = e, p = $(ue, o), m = $e(o), v = s.useRef(null), n = s.useRef(null), w = s.useRef(null), E = s.useRef(null), I = se(r, E, p.onViewportChange), R = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), g = p.toastCount > 0;
|
|
55
55
|
s.useEffect(() => {
|
|
56
56
|
const a = (P) => {
|
|
57
57
|
var T;
|
|
@@ -61,56 +61,56 @@ var ue = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
|
|
|
61
61
|
}, [t]), s.useEffect(() => {
|
|
62
62
|
const a = v.current, P = E.current;
|
|
63
63
|
if (g && a && P) {
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
64
|
+
const f = () => {
|
|
65
|
+
if (!p.isClosePausedRef.current) {
|
|
66
66
|
const C = new CustomEvent(z);
|
|
67
|
-
P.dispatchEvent(C),
|
|
67
|
+
P.dispatchEvent(C), p.isClosePausedRef.current = !0;
|
|
68
68
|
}
|
|
69
69
|
}, T = () => {
|
|
70
|
-
if (
|
|
70
|
+
if (p.isClosePausedRef.current) {
|
|
71
71
|
const C = new CustomEvent(G);
|
|
72
|
-
P.dispatchEvent(C),
|
|
72
|
+
P.dispatchEvent(C), p.isClosePausedRef.current = !1;
|
|
73
73
|
}
|
|
74
74
|
}, h = (C) => {
|
|
75
75
|
!a.contains(C.relatedTarget) && T();
|
|
76
76
|
}, y = () => {
|
|
77
77
|
a.contains(document.activeElement) || T();
|
|
78
78
|
};
|
|
79
|
-
return a.addEventListener("focusin",
|
|
80
|
-
a.removeEventListener("focusin",
|
|
79
|
+
return a.addEventListener("focusin", f), a.addEventListener("focusout", h), a.addEventListener("pointermove", f), a.addEventListener("pointerleave", y), window.addEventListener("blur", f), window.addEventListener("focus", T), () => {
|
|
80
|
+
a.removeEventListener("focusin", f), a.removeEventListener("focusout", h), a.removeEventListener("pointermove", f), a.removeEventListener("pointerleave", y), window.removeEventListener("blur", f), window.removeEventListener("focus", T);
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
}, [g,
|
|
83
|
+
}, [g, p.isClosePausedRef]);
|
|
84
84
|
const l = s.useCallback(
|
|
85
85
|
({ tabbingDirection: a }) => {
|
|
86
|
-
const
|
|
87
|
-
const h = T.ref.current, y = [h, ...
|
|
86
|
+
const f = m().map((T) => {
|
|
87
|
+
const h = T.ref.current, y = [h, ...st(h)];
|
|
88
88
|
return a === "forwards" ? y : y.reverse();
|
|
89
89
|
});
|
|
90
|
-
return (a === "forwards" ?
|
|
90
|
+
return (a === "forwards" ? f.reverse() : f).flat();
|
|
91
91
|
},
|
|
92
92
|
[m]
|
|
93
93
|
);
|
|
94
94
|
return s.useEffect(() => {
|
|
95
95
|
const a = E.current;
|
|
96
96
|
if (a) {
|
|
97
|
-
const P = (
|
|
97
|
+
const P = (f) => {
|
|
98
98
|
var y, C, N;
|
|
99
|
-
const T =
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
99
|
+
const T = f.altKey || f.ctrlKey || f.metaKey;
|
|
100
|
+
if (f.key === "Tab" && !T) {
|
|
101
|
+
const O = document.activeElement, F = f.shiftKey;
|
|
102
|
+
if (f.target === a && F) {
|
|
103
103
|
(y = n.current) == null || y.focus();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
const A = l({ tabbingDirection: F ? "backwards" : "forwards" }), V = A.findIndex((i) => i ===
|
|
107
|
-
q(A.slice(V + 1)) ?
|
|
106
|
+
const A = l({ tabbingDirection: F ? "backwards" : "forwards" }), V = A.findIndex((i) => i === O);
|
|
107
|
+
q(A.slice(V + 1)) ? f.preventDefault() : F ? (C = n.current) == null || C.focus() : (N = w.current) == null || N.focus();
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
return a.addEventListener("keydown", P), () => a.removeEventListener("keydown", P);
|
|
111
111
|
}
|
|
112
|
-
}, [m, l]), /* @__PURE__ */
|
|
113
|
-
|
|
112
|
+
}, [m, l]), /* @__PURE__ */ D(
|
|
113
|
+
De,
|
|
114
114
|
{
|
|
115
115
|
ref: v,
|
|
116
116
|
role: "region",
|
|
@@ -130,7 +130,7 @@ var ue = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
),
|
|
133
|
-
/* @__PURE__ */ c(Z.Slot, { scope: o, children: /* @__PURE__ */ c(
|
|
133
|
+
/* @__PURE__ */ c(Z.Slot, { scope: o, children: /* @__PURE__ */ c(L.ol, { tabIndex: -1, ...d, ref: I }) }),
|
|
134
134
|
g && /* @__PURE__ */ c(
|
|
135
135
|
J,
|
|
136
136
|
{
|
|
@@ -151,7 +151,7 @@ var ue = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
|
|
|
151
151
|
le.displayName = ue;
|
|
152
152
|
var de = "ToastFocusProxy", J = s.forwardRef(
|
|
153
153
|
(e, r) => {
|
|
154
|
-
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...u } = e, d =
|
|
154
|
+
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...u } = e, d = $(de, o);
|
|
155
155
|
return /* @__PURE__ */ c(
|
|
156
156
|
ae,
|
|
157
157
|
{
|
|
@@ -160,9 +160,9 @@ var de = "ToastFocusProxy", J = s.forwardRef(
|
|
|
160
160
|
...u,
|
|
161
161
|
ref: r,
|
|
162
162
|
style: { position: "fixed" },
|
|
163
|
-
onFocus: (
|
|
163
|
+
onFocus: (p) => {
|
|
164
164
|
var n;
|
|
165
|
-
const m =
|
|
165
|
+
const m = p.relatedTarget;
|
|
166
166
|
!((n = d.viewport) != null && n.contains(m)) && t();
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -170,18 +170,18 @@ var de = "ToastFocusProxy", J = s.forwardRef(
|
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
172
|
J.displayName = de;
|
|
173
|
-
var
|
|
173
|
+
var U = "Toast", je = "toast.swipeStart", qe = "toast.swipeMove", ze = "toast.swipeCancel", Ge = "toast.swipeEnd", pe = s.forwardRef(
|
|
174
174
|
(e, r) => {
|
|
175
|
-
const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...
|
|
175
|
+
const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...p } = e, [m = !0, v] = Ae({
|
|
176
176
|
prop: t,
|
|
177
177
|
defaultProp: u,
|
|
178
178
|
onChange: d
|
|
179
179
|
});
|
|
180
|
-
return /* @__PURE__ */ c(
|
|
181
|
-
|
|
180
|
+
return /* @__PURE__ */ c(Me, { present: o || m, children: /* @__PURE__ */ c(
|
|
181
|
+
Ze,
|
|
182
182
|
{
|
|
183
183
|
open: m,
|
|
184
|
-
...
|
|
184
|
+
...p,
|
|
185
185
|
ref: r,
|
|
186
186
|
onClose: () => v(!1),
|
|
187
187
|
onPause: X(e.onPause),
|
|
@@ -204,18 +204,18 @@ var $ = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.sw
|
|
|
204
204
|
) });
|
|
205
205
|
}
|
|
206
206
|
);
|
|
207
|
-
|
|
208
|
-
var [
|
|
207
|
+
pe.displayName = U;
|
|
208
|
+
var [Je, Qe] = ie(U, {
|
|
209
209
|
onClose() {
|
|
210
210
|
}
|
|
211
|
-
}),
|
|
211
|
+
}), Ze = s.forwardRef(
|
|
212
212
|
(e, r) => {
|
|
213
213
|
const {
|
|
214
214
|
__scopeToast: o,
|
|
215
215
|
type: t = "foreground",
|
|
216
216
|
duration: u,
|
|
217
217
|
open: d,
|
|
218
|
-
onClose:
|
|
218
|
+
onClose: p,
|
|
219
219
|
onEscapeKeyDown: m,
|
|
220
220
|
onPause: v,
|
|
221
221
|
onResume: n,
|
|
@@ -224,12 +224,12 @@ var [Ge, Je] = ie($, {
|
|
|
224
224
|
onSwipeCancel: I,
|
|
225
225
|
onSwipeEnd: R,
|
|
226
226
|
...g
|
|
227
|
-
} = e, l = U
|
|
227
|
+
} = e, l = $(U, o), [a, P] = s.useState(null), f = se(r, (i) => P(i)), T = s.useRef(null), h = s.useRef(null), y = u || l.duration, C = s.useRef(0), N = s.useRef(y), O = s.useRef(0), { onToastAdd: F, onToastRemove: Y } = l, _ = X(() => {
|
|
228
228
|
var x;
|
|
229
|
-
(a == null ? void 0 : a.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()),
|
|
229
|
+
(a == null ? void 0 : a.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()), p();
|
|
230
230
|
}), A = s.useCallback(
|
|
231
231
|
(i) => {
|
|
232
|
-
!i || i === 1 / 0 || (window.clearTimeout(
|
|
232
|
+
!i || i === 1 / 0 || (window.clearTimeout(O.current), C.current = (/* @__PURE__ */ new Date()).getTime(), O.current = window.setTimeout(_, i));
|
|
233
233
|
},
|
|
234
234
|
[_]
|
|
235
235
|
);
|
|
@@ -239,8 +239,8 @@ var [Ge, Je] = ie($, {
|
|
|
239
239
|
const x = () => {
|
|
240
240
|
A(N.current), n == null || n();
|
|
241
241
|
}, S = () => {
|
|
242
|
-
const
|
|
243
|
-
N.current = N.current -
|
|
242
|
+
const M = (/* @__PURE__ */ new Date()).getTime() - C.current;
|
|
243
|
+
N.current = N.current - M, window.clearTimeout(O.current), v == null || v();
|
|
244
244
|
};
|
|
245
245
|
return i.addEventListener(z, S), i.addEventListener(G, x), () => {
|
|
246
246
|
i.removeEventListener(z, S), i.removeEventListener(G, x);
|
|
@@ -250,9 +250,9 @@ var [Ge, Je] = ie($, {
|
|
|
250
250
|
d && !l.isClosePausedRef.current && A(y);
|
|
251
251
|
}, [d, y, l.isClosePausedRef, A]), s.useEffect(() => (F(), () => Y()), [F, Y]);
|
|
252
252
|
const V = s.useMemo(() => a ? ye(a) : null, [a]);
|
|
253
|
-
return l.viewport ? /* @__PURE__ */
|
|
253
|
+
return l.viewport ? /* @__PURE__ */ D(ne, { children: [
|
|
254
254
|
V && /* @__PURE__ */ c(
|
|
255
|
-
|
|
255
|
+
et,
|
|
256
256
|
{
|
|
257
257
|
__scopeToast: o,
|
|
258
258
|
role: "status",
|
|
@@ -261,16 +261,16 @@ var [Ge, Je] = ie($, {
|
|
|
261
261
|
children: V
|
|
262
262
|
}
|
|
263
263
|
),
|
|
264
|
-
/* @__PURE__ */ c(
|
|
264
|
+
/* @__PURE__ */ c(Je, { scope: o, onClose: _, children: Se.createPortal(
|
|
265
265
|
/* @__PURE__ */ c(Z.ItemSlot, { scope: o, children: /* @__PURE__ */ c(
|
|
266
|
-
|
|
266
|
+
Le,
|
|
267
267
|
{
|
|
268
268
|
asChild: !0,
|
|
269
269
|
onEscapeKeyDown: b(m, () => {
|
|
270
270
|
l.isFocusedToastEscapeKeyDownRef.current || _(), l.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
271
271
|
}),
|
|
272
272
|
children: /* @__PURE__ */ c(
|
|
273
|
-
|
|
273
|
+
L.li,
|
|
274
274
|
{
|
|
275
275
|
role: "status",
|
|
276
276
|
"aria-live": "off",
|
|
@@ -279,7 +279,7 @@ var [Ge, Je] = ie($, {
|
|
|
279
279
|
"data-state": d ? "open" : "closed",
|
|
280
280
|
"data-swipe-direction": l.swipeDirection,
|
|
281
281
|
...g,
|
|
282
|
-
ref:
|
|
282
|
+
ref: f,
|
|
283
283
|
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
284
284
|
onKeyDown: b(e.onKeyDown, (i) => {
|
|
285
285
|
i.key === "Escape" && (m == null || m(i.nativeEvent), i.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, _()));
|
|
@@ -289,27 +289,27 @@ var [Ge, Je] = ie($, {
|
|
|
289
289
|
}),
|
|
290
290
|
onPointerMove: b(e.onPointerMove, (i) => {
|
|
291
291
|
if (!T.current) return;
|
|
292
|
-
const x = i.clientX - T.current.x, S = i.clientY - T.current.y,
|
|
293
|
-
|
|
292
|
+
const x = i.clientX - T.current.x, S = i.clientY - T.current.y, M = !!h.current, k = ["left", "right"].includes(l.swipeDirection), K = ["left", "up"].includes(l.swipeDirection) ? Math.min : Math.max, Pe = k ? K(0, x) : 0, Ce = k ? 0 : K(0, S), B = i.pointerType === "touch" ? 10 : 2, H = { x: Pe, y: Ce }, ee = { originalEvent: i, delta: H };
|
|
293
|
+
M ? (h.current = H, W(qe, E, ee, {
|
|
294
294
|
discrete: !1
|
|
295
|
-
})) : re(H, l.swipeDirection, B) ? (h.current = H, W(
|
|
295
|
+
})) : re(H, l.swipeDirection, B) ? (h.current = H, W(je, w, ee, {
|
|
296
296
|
discrete: !1
|
|
297
297
|
}), i.target.setPointerCapture(i.pointerId)) : (Math.abs(x) > B || Math.abs(S) > B) && (T.current = null);
|
|
298
298
|
}),
|
|
299
299
|
onPointerUp: b(e.onPointerUp, (i) => {
|
|
300
300
|
const x = h.current, S = i.target;
|
|
301
301
|
if (S.hasPointerCapture(i.pointerId) && S.releasePointerCapture(i.pointerId), h.current = null, T.current = null, x) {
|
|
302
|
-
const
|
|
303
|
-
re(x, l.swipeDirection, l.swipeThreshold) ? W(
|
|
302
|
+
const M = i.currentTarget, k = { originalEvent: i, delta: x };
|
|
303
|
+
re(x, l.swipeDirection, l.swipeThreshold) ? W(Ge, R, k, {
|
|
304
304
|
discrete: !0
|
|
305
305
|
}) : W(
|
|
306
|
-
|
|
306
|
+
ze,
|
|
307
307
|
I,
|
|
308
|
-
|
|
308
|
+
k,
|
|
309
309
|
{
|
|
310
310
|
discrete: !0
|
|
311
311
|
}
|
|
312
|
-
),
|
|
312
|
+
), M.addEventListener("click", (K) => K.preventDefault(), {
|
|
313
313
|
once: !0
|
|
314
314
|
});
|
|
315
315
|
}
|
|
@@ -322,30 +322,30 @@ var [Ge, Je] = ie($, {
|
|
|
322
322
|
) })
|
|
323
323
|
] }) : null;
|
|
324
324
|
}
|
|
325
|
-
),
|
|
326
|
-
const { __scopeToast: r, children: o, ...t } = e, u = U
|
|
327
|
-
return
|
|
325
|
+
), et = (e) => {
|
|
326
|
+
const { __scopeToast: r, children: o, ...t } = e, u = $(U, r), [d, p] = s.useState(!1), [m, v] = s.useState(!1);
|
|
327
|
+
return rt(() => p(!0)), s.useEffect(() => {
|
|
328
328
|
const n = window.setTimeout(() => v(!0), 1e3);
|
|
329
329
|
return () => window.clearTimeout(n);
|
|
330
|
-
}, []), m ? null : /* @__PURE__ */ c(
|
|
330
|
+
}, []), m ? null : /* @__PURE__ */ c(Oe, { asChild: !0, children: /* @__PURE__ */ c(ae, { ...t, children: d && /* @__PURE__ */ D(ne, { children: [
|
|
331
331
|
u.label,
|
|
332
332
|
" ",
|
|
333
333
|
o
|
|
334
334
|
] }) }) });
|
|
335
|
-
},
|
|
335
|
+
}, tt = "ToastTitle", fe = s.forwardRef(
|
|
336
336
|
(e, r) => {
|
|
337
337
|
const { __scopeToast: o, ...t } = e;
|
|
338
|
-
return /* @__PURE__ */ c(
|
|
338
|
+
return /* @__PURE__ */ c(L.div, { ...t, ref: r });
|
|
339
339
|
}
|
|
340
340
|
);
|
|
341
|
-
|
|
342
|
-
var
|
|
341
|
+
fe.displayName = tt;
|
|
342
|
+
var ot = "ToastDescription", me = s.forwardRef(
|
|
343
343
|
(e, r) => {
|
|
344
344
|
const { __scopeToast: o, ...t } = e;
|
|
345
|
-
return /* @__PURE__ */ c(
|
|
345
|
+
return /* @__PURE__ */ c(L.div, { ...t, ref: r });
|
|
346
346
|
}
|
|
347
347
|
);
|
|
348
|
-
me.displayName =
|
|
348
|
+
me.displayName = ot;
|
|
349
349
|
var Te = "ToastAction", ve = s.forwardRef(
|
|
350
350
|
(e, r) => {
|
|
351
351
|
const { altText: o, ...t } = e;
|
|
@@ -357,9 +357,9 @@ var Te = "ToastAction", ve = s.forwardRef(
|
|
|
357
357
|
ve.displayName = Te;
|
|
358
358
|
var we = "ToastClose", Ee = s.forwardRef(
|
|
359
359
|
(e, r) => {
|
|
360
|
-
const { __scopeToast: o, ...t } = e, u =
|
|
360
|
+
const { __scopeToast: o, ...t } = e, u = Qe(we, o);
|
|
361
361
|
return /* @__PURE__ */ c(he, { asChild: !0, children: /* @__PURE__ */ c(
|
|
362
|
-
|
|
362
|
+
L.button,
|
|
363
363
|
{
|
|
364
364
|
type: "button",
|
|
365
365
|
...t,
|
|
@@ -373,7 +373,7 @@ Ee.displayName = we;
|
|
|
373
373
|
var he = s.forwardRef((e, r) => {
|
|
374
374
|
const { __scopeToast: o, altText: t, ...u } = e;
|
|
375
375
|
return /* @__PURE__ */ c(
|
|
376
|
-
|
|
376
|
+
L.div,
|
|
377
377
|
{
|
|
378
378
|
"data-radix-toast-announce-exclude": "",
|
|
379
379
|
"data-radix-toast-announce-alt": t || void 0,
|
|
@@ -385,12 +385,12 @@ var he = s.forwardRef((e, r) => {
|
|
|
385
385
|
function ye(e) {
|
|
386
386
|
const r = [];
|
|
387
387
|
return Array.from(e.childNodes).forEach((t) => {
|
|
388
|
-
if (t.nodeType === t.TEXT_NODE && t.textContent && r.push(t.textContent),
|
|
388
|
+
if (t.nodeType === t.TEXT_NODE && t.textContent && r.push(t.textContent), nt(t)) {
|
|
389
389
|
const u = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
|
|
390
390
|
if (!u)
|
|
391
391
|
if (d) {
|
|
392
|
-
const
|
|
393
|
-
|
|
392
|
+
const p = t.dataset.radixToastAnnounceAlt;
|
|
393
|
+
p && r.push(p);
|
|
394
394
|
} else
|
|
395
395
|
r.push(...ye(t));
|
|
396
396
|
}
|
|
@@ -398,26 +398,26 @@ function ye(e) {
|
|
|
398
398
|
}
|
|
399
399
|
function W(e, r, o, { discrete: t }) {
|
|
400
400
|
const u = o.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
|
|
401
|
-
r && u.addEventListener(e, r, { once: !0 }), t ?
|
|
401
|
+
r && u.addEventListener(e, r, { once: !0 }), t ? Ie(u, d) : u.dispatchEvent(d);
|
|
402
402
|
}
|
|
403
403
|
var re = (e, r, o = 0) => {
|
|
404
404
|
const t = Math.abs(e.x), u = Math.abs(e.y), d = t > u;
|
|
405
405
|
return r === "left" || r === "right" ? d && t > o : !d && u > o;
|
|
406
406
|
};
|
|
407
|
-
function
|
|
407
|
+
function rt(e = () => {
|
|
408
408
|
}) {
|
|
409
409
|
const r = X(e);
|
|
410
|
-
|
|
410
|
+
Fe(() => {
|
|
411
411
|
let o = 0, t = 0;
|
|
412
412
|
return o = window.requestAnimationFrame(() => t = window.requestAnimationFrame(r)), () => {
|
|
413
413
|
window.cancelAnimationFrame(o), window.cancelAnimationFrame(t);
|
|
414
414
|
};
|
|
415
415
|
}, [r]);
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function nt(e) {
|
|
418
418
|
return e.nodeType === e.ELEMENT_NODE;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function st(e) {
|
|
421
421
|
const r = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
422
422
|
acceptNode: (t) => {
|
|
423
423
|
const u = t.tagName === "INPUT" && t.type === "hidden";
|
|
@@ -431,41 +431,44 @@ function q(e) {
|
|
|
431
431
|
const r = document.activeElement;
|
|
432
432
|
return e.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
|
|
433
433
|
}
|
|
434
|
-
var
|
|
435
|
-
const
|
|
434
|
+
var at = ce, it = le, ct = pe, ut = fe, lt = me, dt = ve;
|
|
435
|
+
const St = ({
|
|
436
436
|
title: e,
|
|
437
437
|
duration: r = 5e3,
|
|
438
438
|
titleClassName: o,
|
|
439
439
|
descriptionClassName: t,
|
|
440
440
|
description: u,
|
|
441
441
|
children: d,
|
|
442
|
-
theme:
|
|
442
|
+
theme: p,
|
|
443
443
|
showCloseButton: m = !0,
|
|
444
444
|
className: v
|
|
445
445
|
}) => {
|
|
446
|
-
const [n, w] = xe(!1), E = Re(0), { theme: I } = Ve(), R =
|
|
446
|
+
const [n, w] = xe(!1), E = Re(0), { theme: I } = Ve(), R = p ?? I;
|
|
447
447
|
be(() => () => clearTimeout(E.current), []);
|
|
448
448
|
const g = te(() => oe(e) ? /* @__PURE__ */ c(j, { className: o, children: e }) : /* @__PURE__ */ c("h6", { className: o, children: e }), [e, o]), l = te(() => oe(u) ? /* @__PURE__ */ c(j, { className: t, children: u }) : /* @__PURE__ */ c("h6", { className: t, children: u }), [u, t]), a = ge(() => {
|
|
449
449
|
w(!1), E.current = window.setTimeout(() => w(!0), 100);
|
|
450
450
|
}, []);
|
|
451
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ D(at, { swipeDirection: "right", duration: r, children: [
|
|
452
452
|
/* @__PURE__ */ c(j, { onClick: a, children: d }),
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
|
|
453
|
+
/* @__PURE__ */ D(
|
|
454
|
+
ct,
|
|
455
455
|
{
|
|
456
456
|
className: Ke({ theme: R, className: v }),
|
|
457
457
|
open: n,
|
|
458
458
|
onOpenChange: w,
|
|
459
459
|
children: [
|
|
460
|
-
/* @__PURE__ */ c(
|
|
461
|
-
/* @__PURE__ */ c(
|
|
462
|
-
m && /* @__PURE__ */ c(
|
|
460
|
+
/* @__PURE__ */ c(ut, { asChild: !0, className: "text-lg mb-2 font-semibold", children: g }),
|
|
461
|
+
/* @__PURE__ */ c(lt, { asChild: !0, children: l }),
|
|
462
|
+
m && /* @__PURE__ */ c(dt, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ D("button", { type: "button", className: "absolute right-1.5 top-1.5", children: [
|
|
463
|
+
/* @__PURE__ */ c(Xe, { className: He({ theme: R }) }),
|
|
464
|
+
/* @__PURE__ */ c(ke, { children: "Close toast" })
|
|
465
|
+
] }) })
|
|
463
466
|
]
|
|
464
467
|
}
|
|
465
468
|
),
|
|
466
|
-
/* @__PURE__ */ c(
|
|
469
|
+
/* @__PURE__ */ c(it, { className: We({ theme: R }) })
|
|
467
470
|
] });
|
|
468
471
|
};
|
|
469
472
|
export {
|
|
470
|
-
|
|
473
|
+
St as Toast
|
|
471
474
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const toastVariants: (props?: ({
|
|
2
|
-
theme?: "kubefirst" | "
|
|
2
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
4
|
export declare const viewportToastVariants: (props?: ({
|
|
5
|
-
theme?: "kubefirst" | "
|
|
5
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export declare const closeToastVariants: (props?: ({
|
|
8
|
-
theme?: "kubefirst" | "
|
|
8
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
9
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const a =
|
|
1
|
+
import { c as e } from "../../index-BNmRGtA6.js";
|
|
2
|
+
const a = e(
|
|
3
3
|
[
|
|
4
4
|
"bg-white",
|
|
5
5
|
"rounded-md",
|
|
@@ -20,15 +20,15 @@ const a = t(
|
|
|
20
20
|
variants: {
|
|
21
21
|
theme: {
|
|
22
22
|
kubefirst: ["shadow-purple-200", "border-purple-100"],
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
colony: ["shadow-red-200", "border-red-100"],
|
|
24
|
+
civo: ""
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
defaultVariants: {
|
|
28
28
|
theme: "kubefirst"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
), r =
|
|
31
|
+
), r = e(
|
|
32
32
|
[
|
|
33
33
|
"fixed",
|
|
34
34
|
"bottom-0",
|
|
@@ -47,20 +47,20 @@ const a = t(
|
|
|
47
47
|
variants: {
|
|
48
48
|
theme: {
|
|
49
49
|
kubefirst: "",
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
colony: "",
|
|
51
|
+
civo: ""
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
defaultVariants: {
|
|
55
55
|
theme: "kubefirst"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
),
|
|
58
|
+
), i = e(["top-2", "right-2", "w-4", "h-4"], {
|
|
59
59
|
variants: {
|
|
60
60
|
theme: {
|
|
61
|
-
kubefirst: ["text-kubefirst-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
kubefirst: ["text-kubefirst-primary"],
|
|
62
|
+
colony: ["text-red-400"],
|
|
63
|
+
civo: ""
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
defaultVariants: {
|
|
@@ -68,7 +68,7 @@ const a = t(
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
export {
|
|
71
|
-
|
|
71
|
+
i as closeToastVariants,
|
|
72
72
|
a as toastVariants,
|
|
73
73
|
r as viewportToastVariants
|
|
74
74
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as N, useRef as v, useImperativeHandle as w, useMemo as R, isValidElement as T } from "react";
|
|
3
|
-
import { S as i } from "../../index-
|
|
3
|
+
import { S as i } from "../../index-DoOsnuB6.js";
|
|
4
4
|
import "../../contexts/theme.context.js";
|
|
5
5
|
import { useTheme as V } from "../../contexts/theme.hook.js";
|
|
6
6
|
import "../../js.cookie-OLEfuq_g.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const tooltipVariants: (props?: ({
|
|
2
|
-
theme?: "kubefirst" | "
|
|
2
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
3
3
|
position?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
4
4
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
5
|
export declare const arrowVariants: (props?: ({
|
|
6
|
-
theme?: "kubefirst" | "
|
|
6
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
7
7
|
position?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as r } from "../../index-
|
|
1
|
+
import { c as r } from "../../index-BNmRGtA6.js";
|
|
2
2
|
const e = r(
|
|
3
3
|
[
|
|
4
4
|
"absolute",
|
|
@@ -16,13 +16,13 @@ const e = r(
|
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
18
18
|
theme: {
|
|
19
|
-
kubefirst: "bg-kubefirst-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
kubefirst: "bg-kubefirst-primary",
|
|
20
|
+
colony: "bg-red-700",
|
|
21
|
+
civo: ""
|
|
22
22
|
},
|
|
23
23
|
position: {
|
|
24
|
-
top: ["-top-[
|
|
25
|
-
bottom: ["-bottom-[
|
|
24
|
+
top: ["-top-[120%]", "left-[50%]", "-translate-x-1/2"],
|
|
25
|
+
bottom: ["-bottom-[120%]", "right-[50%]", "translate-x-1/2"],
|
|
26
26
|
right: ["top-1/2", "ml-1", "left-[100%]", "-translate-y-2/4"],
|
|
27
27
|
left: ["top-1/2", "mr-1", "right-[100%]", "-translate-y-2/4"]
|
|
28
28
|
}
|
|
@@ -35,9 +35,9 @@ const e = r(
|
|
|
35
35
|
), o = r(["absolute", "w-0", "h-0"], {
|
|
36
36
|
variants: {
|
|
37
37
|
theme: {
|
|
38
|
-
kubefirst: "border-kubefirst-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
kubefirst: "border-kubefirst-primary",
|
|
39
|
+
colony: "border-red-700",
|
|
40
|
+
civo: ""
|
|
41
41
|
},
|
|
42
42
|
position: {
|
|
43
43
|
top: [
|
package/dist/components/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Button as a } from "./Button/Button.js";
|
|
|
5
5
|
import { Checkbox as u } from "./Checkbox/Checkbox.js";
|
|
6
6
|
import { Dropdown as d } from "./Dropdown/Dropdown.js";
|
|
7
7
|
import { Input as i } from "./Input/Input.js";
|
|
8
|
-
import { M as T } from "../Modal-
|
|
8
|
+
import { M as T } from "../Modal-Bg9UG35z.js";
|
|
9
9
|
import { NumberInput as b } from "./NumberInput/NumberInput.js";
|
|
10
10
|
import { ProgressBar as B } from "./ProgressBar/ProgressBar.js";
|
|
11
11
|
import { Radio as h } from "./Radio/Radio.js";
|