@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,9 +1,6 @@
|
|
|
1
|
-
import { useContext as
|
|
2
|
-
import { ThemeContext as
|
|
3
|
-
const m = () =>
|
|
4
|
-
const t = e(o);
|
|
5
|
-
return t || {};
|
|
6
|
-
};
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { ThemeContext as e } from "./theme.context.js";
|
|
3
|
+
const m = () => t(e);
|
|
7
4
|
export {
|
|
8
5
|
m as useTheme
|
|
9
6
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { ThemeContextType } from './theme.context';
|
|
3
|
-
type
|
|
3
|
+
export type ThemeContextProps = PropsWithChildren & {
|
|
4
4
|
theme?: ThemeContextType['theme'];
|
|
5
5
|
};
|
|
6
|
-
export declare const ThemeProvider: FC<
|
|
7
|
-
export {};
|
|
6
|
+
export declare const ThemeProvider: FC<ThemeContextProps>;
|
|
@@ -3,7 +3,10 @@ import { useState as i } from "react";
|
|
|
3
3
|
import { a as n } from "../js.cookie-OLEfuq_g.js";
|
|
4
4
|
import { isClient as s } from "../utils/index.js";
|
|
5
5
|
import { ThemeContext as f } from "./theme.context.js";
|
|
6
|
-
const v = ({
|
|
6
|
+
const v = ({
|
|
7
|
+
children: r,
|
|
8
|
+
theme: e
|
|
9
|
+
}) => {
|
|
7
10
|
const [t, o] = i(() => {
|
|
8
11
|
if (e)
|
|
9
12
|
return e;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import n from "react";
|
|
2
|
+
import { c as O } from "./index-8vgf-x5i.js";
|
|
3
|
+
import { u as I, S as x } from "./index-DoOsnuB6.js";
|
|
4
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
5
|
+
function L(s) {
|
|
6
|
+
const f = s + "CollectionProvider", [A, N] = O(f), [_, a] = A(
|
|
7
|
+
f,
|
|
8
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
9
|
+
), u = (c) => {
|
|
10
|
+
const { scope: e, children: l } = c, o = n.useRef(null), t = n.useRef(/* @__PURE__ */ new Map()).current;
|
|
11
|
+
return /* @__PURE__ */ m(_, { scope: e, itemMap: t, collectionRef: o, children: l });
|
|
12
|
+
};
|
|
13
|
+
u.displayName = f;
|
|
14
|
+
const d = s + "CollectionSlot", p = n.forwardRef(
|
|
15
|
+
(c, e) => {
|
|
16
|
+
const { scope: l, children: o } = c, t = a(d, l), r = I(e, t.collectionRef);
|
|
17
|
+
return /* @__PURE__ */ m(x, { ref: r, children: o });
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
p.displayName = d;
|
|
21
|
+
const C = s + "CollectionItemSlot", R = "data-radix-collection-item", M = n.forwardRef(
|
|
22
|
+
(c, e) => {
|
|
23
|
+
const { scope: l, children: o, ...t } = c, r = n.useRef(null), S = I(e, r), i = a(C, l);
|
|
24
|
+
return n.useEffect(() => (i.itemMap.set(r, { ref: r, ...t }), () => void i.itemMap.delete(r))), /* @__PURE__ */ m(x, { [R]: "", ref: S, children: o });
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
M.displayName = C;
|
|
28
|
+
function E(c) {
|
|
29
|
+
const e = a(s + "CollectionConsumer", c);
|
|
30
|
+
return n.useCallback(() => {
|
|
31
|
+
const o = e.collectionRef.current;
|
|
32
|
+
if (!o) return [];
|
|
33
|
+
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
|
34
|
+
return Array.from(e.itemMap.values()).sort(
|
|
35
|
+
(i, T) => t.indexOf(i.ref.current) - t.indexOf(T.ref.current)
|
|
36
|
+
);
|
|
37
|
+
}, [e.collectionRef, e.itemMap]);
|
|
38
|
+
}
|
|
39
|
+
return [
|
|
40
|
+
{ Provider: u, Slot: p, ItemSlot: M },
|
|
41
|
+
E,
|
|
42
|
+
N
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
L as c
|
|
47
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { c as O } from "./clsx-OuTLNxxd.js";
|
|
2
|
+
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
+
var u;
|
|
4
|
+
if ((l == null ? void 0 : l.variants) == null) return y(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
5
|
+
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
+
const a = n == null ? void 0 : n[t], s = d == null ? void 0 : d[t];
|
|
7
|
+
if (a === null) return null;
|
|
8
|
+
const i = m(a) || m(s);
|
|
9
|
+
return r[t][i];
|
|
10
|
+
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
+
let [s, i] = a;
|
|
12
|
+
return i === void 0 || (t[s] = i), t;
|
|
13
|
+
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
+
let { class: s, className: i, ...f } = a;
|
|
15
|
+
return Object.entries(f).every((C) => {
|
|
16
|
+
let [c, o] = C;
|
|
17
|
+
return Array.isArray(o) ? o.includes({
|
|
18
|
+
...d,
|
|
19
|
+
...v
|
|
20
|
+
}[c]) : {
|
|
21
|
+
...d,
|
|
22
|
+
...v
|
|
23
|
+
}[c] === o;
|
|
24
|
+
}) ? [
|
|
25
|
+
...t,
|
|
26
|
+
s,
|
|
27
|
+
i
|
|
28
|
+
] : t;
|
|
29
|
+
}, []);
|
|
30
|
+
return y(e, V, N, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
j as c
|
|
34
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as d from "react";
|
|
2
2
|
import { c as ae, a as ce, d as _ } from "./index-8vgf-x5i.js";
|
|
3
|
-
import { u as K } from "./index-
|
|
3
|
+
import { u as K } from "./index-DoOsnuB6.js";
|
|
4
4
|
import { jsx as g, jsxs as le } from "react/jsx-runtime";
|
|
5
5
|
import { a as de, u as ue } from "./index-BxeV34ij.js";
|
|
6
|
-
import { P as T } from "./index-
|
|
7
|
-
import { c as fe } from "./index-
|
|
6
|
+
import { P as T } from "./index-OOfdXoxx.js";
|
|
7
|
+
import { c as fe } from "./index-BBjak_0p.js";
|
|
8
8
|
function $(e, [t, n]) {
|
|
9
9
|
return Math.min(n, Math.max(t, e));
|
|
10
10
|
}
|
|
@@ -131,7 +131,7 @@ var [J, Q] = W(M, {
|
|
|
131
131
|
onSlideEnd: l,
|
|
132
132
|
onStepKeyDown: m,
|
|
133
133
|
...x
|
|
134
|
-
} = e, [s, u] = d.useState(null), v = K(t, (w) => u(w)), P = d.useRef(), S = pe(i), p = S === "ltr", f = p && !c || !p && c;
|
|
134
|
+
} = e, [s, u] = d.useState(null), v = K(t, (w) => u(w)), P = d.useRef(void 0), S = pe(i), p = S === "ltr", f = p && !c || !p && c;
|
|
135
135
|
function D(w) {
|
|
136
136
|
const h = P.current || s.getBoundingClientRect(), A = [0, h.width], H = F(A, f ? [n, o] : [o, n]);
|
|
137
137
|
return P.current = h, H(w - h.left);
|
|
@@ -186,7 +186,7 @@ var [J, Q] = W(M, {
|
|
|
186
186
|
onSlideEnd: a,
|
|
187
187
|
onStepKeyDown: l,
|
|
188
188
|
...m
|
|
189
|
-
} = e, x = d.useRef(null), s = K(t, x), u = d.useRef(), v = !i;
|
|
189
|
+
} = e, x = d.useRef(null), s = K(t, x), u = d.useRef(void 0), v = !i;
|
|
190
190
|
function P(S) {
|
|
191
191
|
const p = u.current || x.current.getBoundingClientRect(), f = [0, p.height], w = F(f, v ? [o, n] : [n, o]);
|
|
192
192
|
return u.current = p, w(S - p.top);
|