@konstructio/ui 0.1.2-alpha.4 → 0.1.2-alpha.40
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-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-CtAG97Ts.js +99 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-left-C4LEg1fH.js +7 -0
- package/dist/chevron-up-CRyLc5Ml.js +54 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +42 -44
- package/dist/components/Badge/Badge.variants.js +8 -6
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Card/Card.variants.js +5 -9
- package/dist/components/Checkbox/Checkbox.js +6 -6
- 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 +1243 -1191
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +37 -31
- package/dist/components/Dropdown/Dropdown.variants.js +9 -4
- package/dist/components/Dropdown/components/List/List.js +128 -59
- package/dist/components/Dropdown/components/ListItem/ListItem.js +90 -39
- package/dist/components/Dropdown/components/Wrapper.js +141 -134
- package/dist/components/Dropdown/constants/index.js +4 -0
- package/dist/components/Dropdown/constants/pagination.js +4 -0
- package/dist/components/Dropdown/contexts/dropdown.context.js +17 -0
- package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -20
- package/dist/components/Dropdown/hooks/useDropdown.js +74 -29
- package/dist/components/Dropdown/hooks/useNavigationList.js +27 -39
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.variants.js +2 -2
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +2 -1
- package/dist/components/Loading/Loading.js +1 -7
- 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/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +34 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +38 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +37 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +105 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +647 -664
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +8 -8
- package/dist/components/Switch/Switch.variants.js +4 -4
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.variants.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Toast/Toast.js +283 -255
- package/dist/components/Toast/Toast.variants.js +37 -24
- package/dist/components/Tooltip/Tooltip.js +15 -14
- package/dist/components/Tooltip/Tooltip.variants.js +5 -4
- package/dist/components/Typography/Typography.variants.js +18 -23
- package/dist/components/VirtualizedTable/VirtualizedTable.js +121 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
- package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
- package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
- package/dist/components/VirtualizedTable/assets/index.js +6 -0
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +93 -0
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
- package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +16 -0
- package/dist/components/VirtualizedTable/constants/index.js +5 -0
- package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
- package/dist/components/VirtualizedTable/contexts/index.js +8 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
- package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
- package/dist/components/index.js +88 -80
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
- package/dist/index-2hB40Iuc.js +1873 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
- package/dist/index-BtQfgaSF.js +60 -0
- package/dist/index-C3tHPg8y.js +662 -0
- package/dist/index-C65LtGuU.js +137 -0
- package/dist/index-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/index-CSWGJT-v.js +1722 -0
- package/dist/{index-D3xzCzcO.js → index-CdwPV0FE.js} +4 -4
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/index-Dbt2vBmS.js +136 -0
- package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
- package/dist/index-DrWQH0QF.js +55 -0
- package/dist/index-Ds6U2x4Z.js +479 -0
- package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
- package/dist/index-ohdbKsws.js +27 -0
- package/dist/index.d.ts +232 -23
- package/dist/index.js +112 -102
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +48 -34
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +191 -167
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
- package/package.json +48 -34
- package/dist/Modal-V67Uz78z.js +0 -98
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-down-BLZPftpV.js +0 -11
- package/dist/index-BXuxPoz7.js +0 -435
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-C9T9HQaa.js +0 -423
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-Oq5GlCHP.js +0 -131
- package/dist/index-iXyXtdgP.js +0 -31
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsx as a, Fragment as O, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { c as I, b as x } from "./index-CIAmiWcw.js";
|
|
4
|
+
import { u } from "./index-DLcqcWxM.js";
|
|
5
|
+
import { c as A, R as M, P as L, O as $, W as F, C as B, T as G, d as W, b as v, e as j } from "./index-Ds6U2x4Z.js";
|
|
6
|
+
import { Button as Y } from "./components/Button/Button.js";
|
|
7
|
+
import { cn as k } from "./utils/index.js";
|
|
8
|
+
var q = Symbol("radix.slottable");
|
|
9
|
+
// @__NO_SIDE_EFFECTS__
|
|
10
|
+
function H(r) {
|
|
11
|
+
const e = ({ children: o }) => /* @__PURE__ */ a(O, { children: o });
|
|
12
|
+
return e.displayName = `${r}.Slottable`, e.__radixId = q, e;
|
|
13
|
+
}
|
|
14
|
+
var D = "AlertDialog", [V, ne] = I(D, [
|
|
15
|
+
A
|
|
16
|
+
]), s = A(), f = (r) => {
|
|
17
|
+
const { __scopeAlertDialog: e, ...o } = r, t = s(e);
|
|
18
|
+
return /* @__PURE__ */ a(M, { ...t, ...o, modal: !0 });
|
|
19
|
+
};
|
|
20
|
+
f.displayName = D;
|
|
21
|
+
var z = "AlertDialogTrigger", m = l.forwardRef(
|
|
22
|
+
(r, e) => {
|
|
23
|
+
const { __scopeAlertDialog: o, ...t } = r, i = s(o);
|
|
24
|
+
return /* @__PURE__ */ a(j, { ...i, ...t, ref: e });
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
m.displayName = z;
|
|
28
|
+
var J = "AlertDialogPortal", _ = (r) => {
|
|
29
|
+
const { __scopeAlertDialog: e, ...o } = r, t = s(e);
|
|
30
|
+
return /* @__PURE__ */ a(L, { ...t, ...o });
|
|
31
|
+
};
|
|
32
|
+
_.displayName = J;
|
|
33
|
+
var K = "AlertDialogOverlay", y = l.forwardRef(
|
|
34
|
+
(r, e) => {
|
|
35
|
+
const { __scopeAlertDialog: o, ...t } = r, i = s(o);
|
|
36
|
+
return /* @__PURE__ */ a($, { ...i, ...t, ref: e });
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
y.displayName = K;
|
|
40
|
+
var n = "AlertDialogContent", [Q, U] = V(n), X = /* @__PURE__ */ H("AlertDialogContent"), N = l.forwardRef(
|
|
41
|
+
(r, e) => {
|
|
42
|
+
const { __scopeAlertDialog: o, children: t, ...i } = r, d = s(o), p = l.useRef(null), P = u(e, p), g = l.useRef(null);
|
|
43
|
+
return /* @__PURE__ */ a(
|
|
44
|
+
F,
|
|
45
|
+
{
|
|
46
|
+
contentName: n,
|
|
47
|
+
titleName: h,
|
|
48
|
+
docsSlug: "alert-dialog",
|
|
49
|
+
children: /* @__PURE__ */ a(Q, { scope: o, cancelRef: g, children: /* @__PURE__ */ w(
|
|
50
|
+
B,
|
|
51
|
+
{
|
|
52
|
+
role: "alertdialog",
|
|
53
|
+
...d,
|
|
54
|
+
...i,
|
|
55
|
+
ref: P,
|
|
56
|
+
onOpenAutoFocus: x(i.onOpenAutoFocus, (c) => {
|
|
57
|
+
c.preventDefault(), g.current?.focus({ preventScroll: !0 });
|
|
58
|
+
}),
|
|
59
|
+
onPointerDownOutside: (c) => c.preventDefault(),
|
|
60
|
+
onInteractOutside: (c) => c.preventDefault(),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ a(X, { children: t }),
|
|
63
|
+
/* @__PURE__ */ a(ee, { contentRef: p })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
) })
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
N.displayName = n;
|
|
72
|
+
var h = "AlertDialogTitle", R = l.forwardRef(
|
|
73
|
+
(r, e) => {
|
|
74
|
+
const { __scopeAlertDialog: o, ...t } = r, i = s(o);
|
|
75
|
+
return /* @__PURE__ */ a(G, { ...i, ...t, ref: e });
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
R.displayName = h;
|
|
79
|
+
var C = "AlertDialogDescription", S = l.forwardRef((r, e) => {
|
|
80
|
+
const { __scopeAlertDialog: o, ...t } = r, i = s(o);
|
|
81
|
+
return /* @__PURE__ */ a(W, { ...i, ...t, ref: e });
|
|
82
|
+
});
|
|
83
|
+
S.displayName = C;
|
|
84
|
+
var Z = "AlertDialogAction", E = l.forwardRef(
|
|
85
|
+
(r, e) => {
|
|
86
|
+
const { __scopeAlertDialog: o, ...t } = r, i = s(o);
|
|
87
|
+
return /* @__PURE__ */ a(v, { ...i, ...t, ref: e });
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
E.displayName = Z;
|
|
91
|
+
var T = "AlertDialogCancel", b = l.forwardRef(
|
|
92
|
+
(r, e) => {
|
|
93
|
+
const { __scopeAlertDialog: o, ...t } = r, { cancelRef: i } = U(T, o), d = s(o), p = u(e, i);
|
|
94
|
+
return /* @__PURE__ */ a(v, { ...d, ...t, ref: p });
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
b.displayName = T;
|
|
98
|
+
var ee = ({ contentRef: r }) => {
|
|
99
|
+
const e = `\`${n}\` requires a description for the component to be accessible for screen reader users.
|
|
100
|
+
|
|
101
|
+
You can add a description to the \`${n}\` by passing a \`${C}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
102
|
+
|
|
103
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${n}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
104
|
+
|
|
105
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
|
106
|
+
return l.useEffect(() => {
|
|
107
|
+
document.getElementById(
|
|
108
|
+
r.current?.getAttribute("aria-describedby")
|
|
109
|
+
) || console.warn(e);
|
|
110
|
+
}, [e, r]), null;
|
|
111
|
+
}, ce = f, re = m, pe = _, de = y, ge = N, ue = E, Ae = b, ve = R, De = S;
|
|
112
|
+
const fe = ({
|
|
113
|
+
"data-theme": r,
|
|
114
|
+
className: e,
|
|
115
|
+
text: o,
|
|
116
|
+
onOpen: t
|
|
117
|
+
}) => /* @__PURE__ */ a(re, { asChild: !0, children: /* @__PURE__ */ a(
|
|
118
|
+
Y,
|
|
119
|
+
{
|
|
120
|
+
type: "button",
|
|
121
|
+
"data-theme": r,
|
|
122
|
+
className: k(e),
|
|
123
|
+
onClick: t,
|
|
124
|
+
children: o
|
|
125
|
+
}
|
|
126
|
+
) });
|
|
127
|
+
export {
|
|
128
|
+
fe as A,
|
|
129
|
+
ge as C,
|
|
130
|
+
De as D,
|
|
131
|
+
de as O,
|
|
132
|
+
pe as P,
|
|
133
|
+
ce as R,
|
|
134
|
+
ve as T,
|
|
135
|
+
Ae as a,
|
|
136
|
+
ue as b
|
|
137
|
+
};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import * as y from "react-dom";
|
|
4
|
+
import { c as E } from "./index-DLcqcWxM.js";
|
|
5
|
+
function M(e, t) {
|
|
6
|
+
const n = r.createContext(t), s = (i) => {
|
|
7
|
+
const { children: u, ...c } = i, l = r.useMemo(() => c, Object.values(c));
|
|
8
|
+
return /* @__PURE__ */ m(n.Provider, { value: l, children: u });
|
|
9
|
+
};
|
|
10
|
+
s.displayName = e + "Provider";
|
|
11
|
+
function o(i) {
|
|
12
|
+
const u = r.useContext(n);
|
|
13
|
+
if (u) return u;
|
|
14
|
+
if (t !== void 0) return t;
|
|
15
|
+
throw new Error(`\`${i}\` must be used within \`${e}\``);
|
|
16
|
+
}
|
|
17
|
+
return [s, o];
|
|
18
|
+
}
|
|
19
|
+
function W(e, t = []) {
|
|
20
|
+
let n = [];
|
|
21
|
+
function s(i, u) {
|
|
22
|
+
const c = r.createContext(u), l = n.length;
|
|
23
|
+
n = [...n, u];
|
|
24
|
+
const f = (a) => {
|
|
25
|
+
const { scope: v, children: C, ...p } = a, h = v?.[e]?.[l] || c, S = r.useMemo(() => p, Object.values(p));
|
|
26
|
+
return /* @__PURE__ */ m(h.Provider, { value: S, children: C });
|
|
27
|
+
};
|
|
28
|
+
f.displayName = i + "Provider";
|
|
29
|
+
function d(a, v) {
|
|
30
|
+
const C = v?.[e]?.[l] || c, p = r.useContext(C);
|
|
31
|
+
if (p) return p;
|
|
32
|
+
if (u !== void 0) return u;
|
|
33
|
+
throw new Error(`\`${a}\` must be used within \`${i}\``);
|
|
34
|
+
}
|
|
35
|
+
return [f, d];
|
|
36
|
+
}
|
|
37
|
+
const o = () => {
|
|
38
|
+
const i = n.map((u) => r.createContext(u));
|
|
39
|
+
return function(c) {
|
|
40
|
+
const l = c?.[e] || i;
|
|
41
|
+
return r.useMemo(
|
|
42
|
+
() => ({ [`__scope${e}`]: { ...c, [e]: l } }),
|
|
43
|
+
[c, l]
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
return o.scopeName = e, [s, x(o, ...t)];
|
|
48
|
+
}
|
|
49
|
+
function x(...e) {
|
|
50
|
+
const t = e[0];
|
|
51
|
+
if (e.length === 1) return t;
|
|
52
|
+
const n = () => {
|
|
53
|
+
const s = e.map((o) => ({
|
|
54
|
+
useScope: o(),
|
|
55
|
+
scopeName: o.scopeName
|
|
56
|
+
}));
|
|
57
|
+
return function(i) {
|
|
58
|
+
const u = s.reduce((c, { useScope: l, scopeName: f }) => {
|
|
59
|
+
const a = l(i)[`__scope${f}`];
|
|
60
|
+
return { ...c, ...a };
|
|
61
|
+
}, {});
|
|
62
|
+
return r.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
return n.scopeName = t.scopeName, n;
|
|
66
|
+
}
|
|
67
|
+
function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
68
|
+
return function(o) {
|
|
69
|
+
if (e?.(o), n === !1 || !o.defaultPrevented)
|
|
70
|
+
return t?.(o);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var P = globalThis?.document ? r.useLayoutEffect : () => {
|
|
74
|
+
}, b = r[" useInsertionEffect ".trim().toString()] || P;
|
|
75
|
+
function H({
|
|
76
|
+
prop: e,
|
|
77
|
+
defaultProp: t,
|
|
78
|
+
onChange: n = () => {
|
|
79
|
+
},
|
|
80
|
+
caller: s
|
|
81
|
+
}) {
|
|
82
|
+
const [o, i, u] = g({
|
|
83
|
+
defaultProp: t,
|
|
84
|
+
onChange: n
|
|
85
|
+
}), c = e !== void 0, l = c ? e : o;
|
|
86
|
+
{
|
|
87
|
+
const d = r.useRef(e !== void 0);
|
|
88
|
+
r.useEffect(() => {
|
|
89
|
+
const a = d.current;
|
|
90
|
+
a !== c && console.warn(
|
|
91
|
+
`${s} is changing from ${a ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
92
|
+
), d.current = c;
|
|
93
|
+
}, [c, s]);
|
|
94
|
+
}
|
|
95
|
+
const f = r.useCallback(
|
|
96
|
+
(d) => {
|
|
97
|
+
if (c) {
|
|
98
|
+
const a = w(d) ? d(e) : d;
|
|
99
|
+
a !== e && u.current?.(a);
|
|
100
|
+
} else
|
|
101
|
+
i(d);
|
|
102
|
+
},
|
|
103
|
+
[c, e, i, u]
|
|
104
|
+
);
|
|
105
|
+
return [l, f];
|
|
106
|
+
}
|
|
107
|
+
function g({
|
|
108
|
+
defaultProp: e,
|
|
109
|
+
onChange: t
|
|
110
|
+
}) {
|
|
111
|
+
const [n, s] = r.useState(e), o = r.useRef(n), i = r.useRef(t);
|
|
112
|
+
return b(() => {
|
|
113
|
+
i.current = t;
|
|
114
|
+
}, [t]), r.useEffect(() => {
|
|
115
|
+
o.current !== n && (i.current?.(n), o.current = n);
|
|
116
|
+
}, [n, o]), [n, s, i];
|
|
117
|
+
}
|
|
118
|
+
function w(e) {
|
|
119
|
+
return typeof e == "function";
|
|
120
|
+
}
|
|
121
|
+
// @__NO_SIDE_EFFECTS__
|
|
122
|
+
function R(e) {
|
|
123
|
+
const t = /* @__PURE__ */ $(e), n = r.forwardRef((s, o) => {
|
|
124
|
+
const { children: i, ...u } = s, c = r.Children.toArray(i), l = c.find(O);
|
|
125
|
+
if (l) {
|
|
126
|
+
const f = l.props.children, d = c.map((a) => a === l ? r.Children.count(f) > 1 ? r.Children.only(null) : r.isValidElement(f) ? f.props.children : null : a);
|
|
127
|
+
return /* @__PURE__ */ m(t, { ...u, ref: o, children: r.isValidElement(f) ? r.cloneElement(f, void 0, d) : null });
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ m(t, { ...u, ref: o, children: i });
|
|
130
|
+
});
|
|
131
|
+
return n.displayName = `${e}.Slot`, n;
|
|
132
|
+
}
|
|
133
|
+
// @__NO_SIDE_EFFECTS__
|
|
134
|
+
function $(e) {
|
|
135
|
+
const t = r.forwardRef((n, s) => {
|
|
136
|
+
const { children: o, ...i } = n;
|
|
137
|
+
if (r.isValidElement(o)) {
|
|
138
|
+
const u = D(o), c = N(i, o.props);
|
|
139
|
+
return o.type !== r.Fragment && (c.ref = s ? E(s, u) : u), r.cloneElement(o, c);
|
|
140
|
+
}
|
|
141
|
+
return r.Children.count(o) > 1 ? r.Children.only(null) : null;
|
|
142
|
+
});
|
|
143
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
144
|
+
}
|
|
145
|
+
var _ = Symbol("radix.slottable");
|
|
146
|
+
function O(e) {
|
|
147
|
+
return r.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === _;
|
|
148
|
+
}
|
|
149
|
+
function N(e, t) {
|
|
150
|
+
const n = { ...t };
|
|
151
|
+
for (const s in t) {
|
|
152
|
+
const o = e[s], i = t[s];
|
|
153
|
+
/^on[A-Z]/.test(s) ? o && i ? n[s] = (...c) => {
|
|
154
|
+
const l = i(...c);
|
|
155
|
+
return o(...c), l;
|
|
156
|
+
} : o && (n[s] = o) : s === "style" ? n[s] = { ...o, ...i } : s === "className" && (n[s] = [o, i].filter(Boolean).join(" "));
|
|
157
|
+
}
|
|
158
|
+
return { ...e, ...n };
|
|
159
|
+
}
|
|
160
|
+
function D(e) {
|
|
161
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
162
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
163
|
+
}
|
|
164
|
+
var I = [
|
|
165
|
+
"a",
|
|
166
|
+
"button",
|
|
167
|
+
"div",
|
|
168
|
+
"form",
|
|
169
|
+
"h2",
|
|
170
|
+
"h3",
|
|
171
|
+
"img",
|
|
172
|
+
"input",
|
|
173
|
+
"label",
|
|
174
|
+
"li",
|
|
175
|
+
"nav",
|
|
176
|
+
"ol",
|
|
177
|
+
"p",
|
|
178
|
+
"select",
|
|
179
|
+
"span",
|
|
180
|
+
"svg",
|
|
181
|
+
"ul"
|
|
182
|
+
], L = I.reduce((e, t) => {
|
|
183
|
+
const n = /* @__PURE__ */ R(`Primitive.${t}`), s = r.forwardRef((o, i) => {
|
|
184
|
+
const { asChild: u, ...c } = o, l = u ? n : t;
|
|
185
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(l, { ...c, ref: i });
|
|
186
|
+
});
|
|
187
|
+
return s.displayName = `Primitive.${t}`, { ...e, [t]: s };
|
|
188
|
+
}, {});
|
|
189
|
+
function T(e, t) {
|
|
190
|
+
e && y.flushSync(() => e.dispatchEvent(t));
|
|
191
|
+
}
|
|
192
|
+
export {
|
|
193
|
+
L as P,
|
|
194
|
+
H as a,
|
|
195
|
+
A as b,
|
|
196
|
+
W as c,
|
|
197
|
+
T as d,
|
|
198
|
+
M as e,
|
|
199
|
+
P as u
|
|
200
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import m from "react-dom";
|
|
3
|
+
import { u as c, P as f } from "./index-CIAmiWcw.js";
|
|
4
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
+
var u = "Portal", p = o.forwardRef((r, a) => {
|
|
6
|
+
const { container: e, ...s } = r, [n, i] = o.useState(!1);
|
|
7
|
+
c(() => i(!0), []);
|
|
8
|
+
const t = e || n && globalThis?.document?.body;
|
|
9
|
+
return t ? m.createPortal(/* @__PURE__ */ l(f.div, { ...s, ref: a }), t) : null;
|
|
10
|
+
});
|
|
11
|
+
p.displayName = u;
|
|
12
|
+
export {
|
|
13
|
+
p as P
|
|
14
|
+
};
|