@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.31
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/DatePicker.css +1 -1
- package/dist/Modal-5xSxFoaD.js +99 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -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 +30 -33
- 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 +1209 -1147
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +46 -28
- package/dist/components/Dropdown/Dropdown.variants.js +32 -9
- package/dist/components/Dropdown/components/List/List.js +133 -54
- package/dist/components/Dropdown/components/List/List.variants.js +9 -7
- package/dist/components/Dropdown/components/ListItem/ListItem.js +74 -24
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
- package/dist/components/Dropdown/components/Wrapper.js +144 -109
- 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 +26 -8
- package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -19
- package/dist/components/Dropdown/hooks/useDropdown.js +83 -39
- package/dist/components/Dropdown/hooks/useNavigationList.js +28 -36
- 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 +1 -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 +3 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -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 +6139 -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 +45 -24
- 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 +9 -8
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
- 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 +206 -181
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.variants.js +18 -23
- package/dist/components/VirtualizedTable/VirtualizedTable.js +119 -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 +88 -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 +79 -73
- 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-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/index-CSWGJT-v.js +1722 -0
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/index-DDByhzds.js +137 -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-D3xzCzcO.js → index-X4k_cU8k.js} +4 -4
- package/dist/index-kyuBfLcN.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 +184 -18
- package/dist/index.js +106 -98
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/package.json +46 -32
- 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 +46 -32
- package/dist/Modal-V67Uz78z.js +0 -98
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-down-BLZPftpV.js +0 -11
- package/dist/chevron-up-RLP4nX7V.js +0 -54
- 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,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
|
+
};
|