@konstructio/ui 0.0.12-alpha.1 → 0.0.12
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/{index-BVppSRDQ.js → AlertDialogTrigger-D4Tm_9M0.js} +21 -19
- package/dist/{Combination-BQYb0Gw7.js → Combination-Cmu9JRkv.js} +72 -72
- package/dist/{Modal-W2GbkC_F.js → Modal-L73dmnHv.js} +246 -238
- package/dist/{chevron-up-DgLBQCKD.js → chevron-up-CvquEaNg.js} +1 -1
- package/dist/components/AlertDialog/AlertDialog.d.ts +3 -0
- package/dist/components/AlertDialog/AlertDialog.js +23 -20
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +18 -0
- package/dist/components/AlertDialog/AlertDialog.types.js +1 -0
- package/dist/components/AlertDialog/AlertDialog.variants.d.ts +3 -0
- package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +3 -0
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +6 -3
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +6 -0
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.js +1 -0
- package/dist/components/AlertDialog/components/index.d.ts +1 -0
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/AlertDialog/hooks/index.d.ts +1 -0
- package/dist/components/AlertDialog/hooks/useAlertDialog.d.ts +7 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +3 -0
- package/dist/components/Autocomplete/Autocomplete.js +17 -15
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +18 -0
- package/dist/components/Autocomplete/Autocomplete.types.js +1 -0
- package/dist/components/Autocomplete/Autocomplete.variants.d.ts +8 -0
- package/dist/components/Autocomplete/components/List/List.d.ts +3 -0
- package/dist/components/Autocomplete/components/List/List.js +7 -7
- package/dist/components/Autocomplete/components/List/List.types.d.ts +13 -0
- package/dist/components/Autocomplete/components/List/List.types.js +1 -0
- package/dist/components/Autocomplete/components/List/List.variants.d.ts +16 -0
- package/dist/components/Autocomplete/components/index.d.ts +1 -0
- package/dist/components/Autocomplete/hooks/index.d.ts +2 -0
- package/dist/components/Autocomplete/hooks/useAutocomplete.d.ts +17 -0
- package/dist/components/Autocomplete/hooks/useNavigationList.d.ts +10 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +69 -68
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +11 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.variants.d.ts +12 -0
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +17 -16
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.d.ts +3 -0
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +3 -2
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.js +16 -14
- package/dist/components/Button/Button.types.d.ts +7 -0
- package/dist/components/Button/Button.types.js +1 -0
- package/dist/components/Button/Button.variants.d.ts +7 -0
- package/dist/components/Card/Card.d.ts +4 -0
- package/dist/components/Card/Card.js +12 -10
- package/dist/components/Card/Card.types.d.ts +8 -0
- package/dist/components/Card/Card.types.js +1 -0
- package/dist/components/Card/Card.variants.d.ts +10 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.js +15 -13
- package/dist/components/Checkbox/Checkbox.types.d.ts +14 -0
- package/dist/components/Checkbox/Checkbox.types.js +1 -0
- package/dist/components/Checkbox/Checkbox.variants.d.ts +9 -0
- package/dist/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.js +6 -4
- package/dist/components/Dropdown/Dropdown.types.d.ts +16 -0
- package/dist/components/Dropdown/Dropdown.types.js +1 -0
- package/dist/components/Dropdown/Dropdown.variants.d.ts +3 -0
- package/dist/components/Dropdown/components/EmptyList.d.ts +2 -0
- package/dist/components/Dropdown/components/List/List.d.ts +3 -0
- package/dist/components/Dropdown/components/List/List.js +10 -9
- package/dist/components/Dropdown/components/List/List.types.d.ts +6 -0
- package/dist/components/Dropdown/components/List/List.types.js +1 -0
- package/dist/components/Dropdown/components/List/List.variants.d.ts +3 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.d.ts +3 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.js +21 -20
- package/dist/components/Dropdown/components/ListItem/ListItem.types.d.ts +4 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.types.js +1 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.d.ts +3 -0
- package/dist/components/Dropdown/components/Wrapper.d.ts +3 -0
- package/dist/components/Dropdown/components/Wrapper.js +34 -31
- package/dist/components/Dropdown/components/index.d.ts +3 -0
- package/dist/components/Dropdown/contexts/dropdown.context.d.ts +8 -0
- package/dist/components/Dropdown/contexts/dropdown.hook.d.ts +2 -0
- package/dist/components/Dropdown/contexts/dropdown.provider.d.ts +5 -0
- package/dist/components/Dropdown/contexts/dropdown.provider.js +4 -4
- package/dist/components/Dropdown/contexts/index.d.ts +2 -0
- package/dist/components/Dropdown/hooks/useDropdown.d.ts +11 -0
- package/dist/components/Dropdown/hooks/useDropdown.js +14 -12
- package/dist/components/Dropdown/hooks/useNavigationList.d.ts +8 -0
- package/dist/components/Dropdown/hooks/useNavigationList.js +10 -8
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +14 -12
- package/dist/components/Input/Input.types.d.ts +9 -0
- package/dist/components/Input/Input.types.js +1 -0
- package/dist/components/Input/Input.variants.d.ts +4 -0
- package/dist/components/Modal/Modal.d.ts +8 -0
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Modal/Modal.types.d.ts +12 -0
- package/dist/components/Modal/Modal.types.js +1 -0
- package/dist/components/Modal/components/Body/Body.d.ts +3 -0
- package/dist/components/Modal/components/Body/Body.types.d.ts +5 -0
- package/dist/components/Modal/components/Body/Body.types.js +1 -0
- package/dist/components/Modal/components/Footer/Footer.d.ts +3 -0
- package/dist/components/Modal/components/Footer/Footer.types.d.ts +5 -0
- package/dist/components/Modal/components/Footer/Footer.types.js +1 -0
- package/dist/components/Modal/components/Header/Header.d.ts +3 -0
- package/dist/components/Modal/components/Header/Header.types.d.ts +5 -0
- package/dist/components/Modal/components/Header/Header.types.js +1 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.d.ts +3 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.js +9 -7
- package/dist/components/Modal/components/Wrapper/Wrapper.types.d.ts +7 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.types.js +1 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.d.ts +6 -0
- package/dist/components/Modal/components/index.d.ts +4 -0
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.context.d.ts +2 -0
- package/dist/components/Modal/contexts/Modal.provider.d.ts +4 -0
- package/dist/components/Modal/contexts/Modal.provider.js +4 -4
- package/dist/components/Modal/contexts/Modal.types.d.ts +9 -0
- package/dist/components/Modal/contexts/Modal.types.js +1 -0
- package/dist/components/Modal/contexts/index.d.ts +1 -0
- package/dist/components/Modal/hooks/index.d.ts +1 -0
- package/dist/components/Modal/hooks/useModal.d.ts +9 -0
- package/dist/components/NumberInput/NumberInput.d.ts +3 -0
- package/dist/components/NumberInput/NumberInput.js +11 -9
- package/dist/components/NumberInput/NumberInput.types.d.ts +11 -0
- package/dist/components/NumberInput/NumberInput.types.js +1 -0
- package/dist/components/NumberInput/NumberInput.variants.d.ts +11 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +3 -0
- package/dist/components/ProgressBar/ProgressBar.js +16 -13
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +8 -0
- package/dist/components/ProgressBar/ProgressBar.types.js +1 -0
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +7 -0
- package/dist/components/Radio/Radio.d.ts +3 -0
- package/dist/components/Radio/Radio.js +37 -55
- package/dist/components/Radio/Radio.types.d.ts +12 -0
- package/dist/components/Radio/Radio.types.js +1 -0
- package/dist/components/Radio/Radio.variants.d.ts +3 -0
- package/dist/components/Radio/Radio.variants.js +16 -69
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/RadioGroup/RadioGroup.js +27 -37
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +12 -0
- package/dist/components/RadioGroup/RadioGroup.types.js +1 -0
- package/dist/components/Range/Range.d.ts +3 -0
- package/dist/components/Range/Range.js +22 -20
- package/dist/components/Range/Range.types.d.ts +13 -0
- package/dist/components/Range/Range.types.js +1 -0
- package/dist/components/Range/Range.variants.d.ts +14 -0
- package/dist/components/Sidebar/Sidebar.d.ts +5 -0
- package/dist/components/Sidebar/Sidebar.js +22 -20
- package/dist/components/Sidebar/Sidebar.types.d.ts +18 -0
- package/dist/components/Sidebar/Sidebar.types.js +1 -0
- package/dist/components/Sidebar/Sidebar.variants.d.ts +6 -0
- package/dist/components/Sidebar/components/Footer/Footer.d.ts +3 -0
- package/dist/components/Sidebar/components/Footer/Footer.js +12 -9
- package/dist/components/Sidebar/components/Footer/Footer.types.d.ts +6 -0
- package/dist/components/Sidebar/components/Footer/Footer.types.js +1 -0
- package/dist/components/Sidebar/components/Footer/Footer.variants.d.ts +3 -0
- package/dist/components/Sidebar/components/Logo/Logo.d.ts +3 -0
- package/dist/components/Sidebar/components/Logo/Logo.js +12 -9
- package/dist/components/Sidebar/components/Logo/Logo.types.d.ts +6 -0
- package/dist/components/Sidebar/components/Logo/Logo.types.js +1 -0
- package/dist/components/Sidebar/components/Logo/Logo.variants.d.ts +3 -0
- package/dist/components/Sidebar/components/Navigation/Navigation.d.ts +4 -0
- package/dist/components/Sidebar/components/Navigation/Navigation.js +15 -12
- package/dist/components/Sidebar/components/Navigation/Navigation.types.d.ts +16 -0
- package/dist/components/Sidebar/components/Navigation/Navigation.types.js +1 -0
- package/dist/components/Sidebar/components/Navigation/Navigation.variants.d.ts +3 -0
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.d.ts +3 -0
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +26 -24
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.d.ts +7 -0
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.js +1 -0
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.d.ts +3 -0
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.d.ts +3 -0
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +20 -17
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.d.ts +17 -0
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.js +1 -0
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.d.ts +4 -0
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.d.ts +3 -0
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +11 -8
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.d.ts +5 -0
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.js +1 -0
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.d.ts +3 -0
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.d.ts +3 -0
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +13 -10
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.d.ts +8 -0
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.js +1 -0
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.d.ts +3 -0
- package/dist/components/Sidebar/components/Wrapper/Wrapper.d.ts +3 -0
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +27 -29
- package/dist/components/Sidebar/components/index.d.ts +15 -0
- package/dist/components/Slider/Slider.d.ts +3 -0
- package/dist/components/Slider/Slider.js +20 -18
- package/dist/components/Slider/Slider.types.d.ts +13 -0
- package/dist/components/Slider/Slider.types.js +1 -0
- package/dist/components/Slider/Slider.variants.d.ts +11 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/Switch.js +21 -19
- package/dist/components/Switch/Switch.types.d.ts +10 -0
- package/dist/components/Switch/Switch.types.js +1 -0
- package/dist/components/Switch/Switch.variants.d.ts +6 -0
- package/dist/components/Tag/Tag.d.ts +3 -0
- package/dist/components/Tag/Tag.types.d.ts +4 -0
- package/dist/components/Tag/Tag.types.js +1 -0
- package/dist/components/Tag/Tag.variants.d.ts +3 -0
- package/dist/components/TagSelect/TagSelect.d.ts +3 -0
- package/dist/components/TagSelect/TagSelect.js +21 -19
- package/dist/components/TagSelect/TagSelect.types.d.ts +9 -0
- package/dist/components/TagSelect/TagSelect.types.js +1 -0
- package/dist/components/TagSelect/TagSelect.variants.d.ts +9 -0
- package/dist/components/TagSelect/hooks/useTagSelect.d.ts +9 -0
- package/dist/components/TextArea/TextArea.d.ts +3 -0
- package/dist/components/TextArea/TextArea.js +19 -17
- package/dist/components/TextArea/TextArea.types.d.ts +10 -0
- package/dist/components/TextArea/TextArea.types.js +1 -0
- package/dist/components/TextArea/TextArea.variants.d.ts +3 -0
- package/dist/components/Toast/Toast.d.ts +3 -0
- package/dist/components/Toast/Toast.js +54 -52
- package/dist/components/Toast/Toast.types.d.ts +12 -0
- package/dist/components/Toast/Toast.types.js +1 -0
- package/dist/components/Toast/Toast.variants.d.ts +9 -0
- package/dist/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.js +12 -10
- package/dist/components/Tooltip/Tooltip.types.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.types.js +1 -0
- package/dist/components/Tooltip/Tooltip.variants.d.ts +8 -0
- package/dist/components/Tooltip/hooks/useTooltip.d.ts +4 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/index.js +44 -50
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/theme.context.d.ts +6 -0
- package/dist/contexts/theme.hook.d.ts +7 -0
- package/dist/contexts/theme.provider.d.ts +6 -0
- package/dist/contexts/theme.provider.js +14 -84
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useToggle.d.ts +1 -0
- package/dist/{index-1GLoikpT.js → index-BaNV0qac.js} +6585 -6555
- package/dist/{index-CoqDsznq.js → index-BedjZUuB.js} +1 -1
- package/dist/{index-KEdwcThH.js → index-BtibbG81.js} +1 -1
- package/dist/{index-C5psggHV.js → index-D68N8v8R.js} +17 -17
- package/dist/{index-CJsYodgi.js → index-z-AJyzdv.js} +10 -10
- package/dist/index.d.ts +4 -522
- package/dist/index.js +53 -59
- package/dist/js.cookie-OLEfuq_g.js +74 -0
- package/dist/package.json +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/konstruct.d.ts +4 -0
- package/dist/plugins/konstruct.js +3 -3
- package/dist/plugins/utils/colors.d.ts +328 -0
- package/dist/styles.css +1 -1
- package/dist/styles.d.ts +0 -0
- package/dist/styles.js +1 -1
- package/dist/useBreadcrumb-DxYsZvj_.js +1398 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/{x-DU-Zw-L_.js → x-CRBgmX1Q.js} +1 -1
- package/package.json +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +0 -61
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +0 -90
- package/dist/components/Breadcrumb/components/index.js +0 -4
- package/dist/components/RadioCard/RadioCard.js +0 -41
- package/dist/components/RadioCard/RadioCard.variants.js +0 -19
- package/dist/components/RadioCardGroup/RadioCardGroup.js +0 -47
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +0 -21
- package/dist/components/RadioGroup/RadioGroup.variants.js +0 -21
- package/dist/useBreadcrumb-CojbXFVD.js +0 -1279
|
@@ -1,65 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as F, useId as L, useRef as N, useImperativeHandle as $, useEffect as
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as F, useId as L, useRef as N, useImperativeHandle as $, useEffect as f } from "react";
|
|
3
3
|
import { cn as R } from "../../../utils/index.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
4
|
+
import "../../../contexts/theme.context.js";
|
|
5
|
+
import { useTheme as A } from "../../../contexts/theme.hook.js";
|
|
6
|
+
import "../../../js.cookie-OLEfuq_g.js";
|
|
7
|
+
import { dropdownVariants as H } from "../Dropdown.variants.js";
|
|
8
|
+
import { useDropdown as U } from "../hooks/useDropdown.js";
|
|
9
|
+
import { useDropdownContext as W } from "../contexts/dropdown.hook.js";
|
|
10
|
+
import "../contexts/dropdown.context.js";
|
|
11
|
+
import { List as q } from "./List/List.js";
|
|
12
|
+
import { C as z } from "../../../chevron-up-CvquEaNg.js";
|
|
13
|
+
const _ = F(
|
|
11
14
|
({ theme: g, label: p, placeholder: O, name: o, options: a, defaultValue: c }, j) => {
|
|
12
|
-
const d = L(), r = N(null), u = N(null), { wrapperRef: n, wrapperInputRef: h, handleOpen: y, handleOpenIfClosed: E } =
|
|
13
|
-
$(j, () => r.current, [r]),
|
|
15
|
+
const d = L(), r = N(null), u = N(null), { wrapperRef: n, wrapperInputRef: h, handleOpen: y, handleOpenIfClosed: E } = U({ ulRef: u }), { isOpen: x, value: e, setValue: w, toggleOpen: b } = W(), { theme: T } = A(), v = g ?? T, i = o ? `${d}-${o}` : d;
|
|
16
|
+
$(j, () => r.current, [r]), f(() => {
|
|
14
17
|
r.current && (r.current.value = e ? e.value : "");
|
|
15
|
-
}, [e]),
|
|
18
|
+
}, [e]), f(() => {
|
|
16
19
|
if (c) {
|
|
17
|
-
const
|
|
18
|
-
(
|
|
20
|
+
const s = a.find(
|
|
21
|
+
(l) => l.value === c
|
|
19
22
|
);
|
|
20
|
-
|
|
23
|
+
s && w(s);
|
|
21
24
|
}
|
|
22
|
-
}, [c, a, w]),
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
return (
|
|
25
|
+
}, [c, a, w]), f(() => {
|
|
26
|
+
var l;
|
|
27
|
+
const s = new AbortController();
|
|
28
|
+
return (l = n.current) == null || l.addEventListener("focusout", (D) => {
|
|
26
29
|
var I;
|
|
27
30
|
const C = D.relatedTarget;
|
|
28
31
|
(!C || !((I = n.current) != null && I.contains(C))) && b(!1);
|
|
29
32
|
}), () => {
|
|
30
|
-
|
|
33
|
+
s.abort();
|
|
31
34
|
};
|
|
32
35
|
}, [b, n]);
|
|
33
36
|
const k = () => e != null && e.leftIcon ? /* @__PURE__ */ t("span", { className: "w-4 h-4 flex justify-center items-center", children: e.leftIcon }) : null;
|
|
34
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ m("div", { ref: n, className: "flex flex-col w-full relative", children: [
|
|
35
38
|
p ? /* @__PURE__ */ t(
|
|
36
39
|
"label",
|
|
37
40
|
{
|
|
38
|
-
id:
|
|
41
|
+
id: i,
|
|
39
42
|
className: "m-2 cursor-pointer",
|
|
40
|
-
htmlFor:
|
|
43
|
+
htmlFor: i,
|
|
41
44
|
onClick: E,
|
|
42
45
|
children: p
|
|
43
46
|
}
|
|
44
47
|
) : null,
|
|
45
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ m(
|
|
46
49
|
"div",
|
|
47
50
|
{
|
|
48
51
|
ref: h,
|
|
49
|
-
id:
|
|
50
|
-
className: R(
|
|
52
|
+
id: i,
|
|
53
|
+
className: R(H({ theme: v })),
|
|
51
54
|
role: "combobox",
|
|
52
55
|
onClick: y,
|
|
53
56
|
"aria-expanded": x,
|
|
54
57
|
tabIndex: 0,
|
|
55
|
-
"aria-labelledby":
|
|
58
|
+
"aria-labelledby": i,
|
|
56
59
|
children: [
|
|
57
|
-
/* @__PURE__ */ t("span", { className: "text-base text-inherit", children: e ? /* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ t("span", { className: "text-base text-inherit", children: e ? /* @__PURE__ */ m("span", { className: "flex gap-3 items-center", children: [
|
|
58
61
|
k(),
|
|
59
62
|
e.label
|
|
60
63
|
] }) : O }),
|
|
61
64
|
/* @__PURE__ */ t(
|
|
62
|
-
|
|
65
|
+
z,
|
|
63
66
|
{
|
|
64
67
|
className: R(
|
|
65
68
|
"w-4 h-4 text-inherit transition-all duration-50",
|
|
@@ -81,7 +84,7 @@ const X = F(
|
|
|
81
84
|
}
|
|
82
85
|
),
|
|
83
86
|
/* @__PURE__ */ t(
|
|
84
|
-
|
|
87
|
+
q,
|
|
85
88
|
{
|
|
86
89
|
ref: u,
|
|
87
90
|
name: o,
|
|
@@ -95,5 +98,5 @@ const X = F(
|
|
|
95
98
|
}
|
|
96
99
|
);
|
|
97
100
|
export {
|
|
98
|
-
|
|
101
|
+
_ as Wrapper
|
|
99
102
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Option } from '../Dropdown.types';
|
|
2
|
+
export type DropdownContextType = {
|
|
3
|
+
value: Option | null;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
setValue: (value: Option) => void;
|
|
6
|
+
toggleOpen: (value?: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const DropdownContext: import('react').Context<DropdownContextType>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useState as i, useCallback as c } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useToggle as d } from "../../../hooks/useToggle.js";
|
|
4
|
+
import { DropdownContext as f } from "./dropdown.context.js";
|
|
5
5
|
const w = ({ children: t, onChange: o }) => {
|
|
6
|
-
const [e, s] =
|
|
6
|
+
const [e, s] = d(!1), [l, p] = i(null), m = c(
|
|
7
7
|
(r) => {
|
|
8
8
|
o == null || o(r), p(r);
|
|
9
9
|
},
|
|
10
10
|
[o]
|
|
11
11
|
);
|
|
12
12
|
return /* @__PURE__ */ u(
|
|
13
|
-
|
|
13
|
+
f.Provider,
|
|
14
14
|
{
|
|
15
15
|
value: { value: l, isOpen: e, setValue: m, toggleOpen: s },
|
|
16
16
|
children: t
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentRef, RefObject } from 'react';
|
|
2
|
+
type UseDropDownParams = {
|
|
3
|
+
ulRef: RefObject<ComponentRef<'ul'> | null>;
|
|
4
|
+
};
|
|
5
|
+
export declare const useDropdown: ({ ulRef }: UseDropDownParams) => {
|
|
6
|
+
wrapperRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
wrapperInputRef: RefObject<HTMLDivElement | null>;
|
|
8
|
+
handleOpen: () => void;
|
|
9
|
+
handleOpenIfClosed: () => void;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { useRef as u, useEffect as f, useCallback as p } from "react";
|
|
2
|
-
import { useDropdownContext as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { useDropdownContext as w } from "../contexts/dropdown.hook.js";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "../contexts/dropdown.context.js";
|
|
5
|
+
const k = ({ ulRef: a }) => {
|
|
6
|
+
const l = u(null), o = u(null), { isOpen: c, toggleOpen: e } = w();
|
|
5
7
|
f(() => {
|
|
6
8
|
var r;
|
|
7
9
|
const n = new AbortController(), s = (t) => {
|
|
8
10
|
t.key === "Escape" && e(!1);
|
|
9
|
-
},
|
|
11
|
+
}, i = (t) => {
|
|
10
12
|
var d;
|
|
11
13
|
(d = l.current) != null && d.contains(t.target) || e(!1);
|
|
12
14
|
};
|
|
13
15
|
return document.addEventListener("keydown", s, {
|
|
14
16
|
signal: n.signal
|
|
15
|
-
}), document.addEventListener("mousedown",
|
|
17
|
+
}), document.addEventListener("mousedown", i, {
|
|
16
18
|
signal: n.signal
|
|
17
19
|
}), document.addEventListener(
|
|
18
20
|
"visibilitychange",
|
|
@@ -36,10 +38,10 @@ const E = ({ ulRef: i }) => {
|
|
|
36
38
|
const n = new AbortController();
|
|
37
39
|
return (s = o.current) == null || s.addEventListener(
|
|
38
40
|
"keydown",
|
|
39
|
-
(
|
|
41
|
+
(i) => {
|
|
40
42
|
var r;
|
|
41
|
-
if (
|
|
42
|
-
const t = (r =
|
|
43
|
+
if (i.key === "ArrowDown") {
|
|
44
|
+
const t = (r = a.current) == null ? void 0 : r.querySelector("li");
|
|
43
45
|
t && t.focus();
|
|
44
46
|
}
|
|
45
47
|
},
|
|
@@ -47,17 +49,17 @@ const E = ({ ulRef: i }) => {
|
|
|
47
49
|
), () => {
|
|
48
50
|
n.abort();
|
|
49
51
|
};
|
|
50
|
-
}, [o,
|
|
51
|
-
const g = p(() => e(!0), [e]),
|
|
52
|
+
}, [o, a]);
|
|
53
|
+
const g = p(() => e(!0), [e]), m = p(() => {
|
|
52
54
|
c || e(!1);
|
|
53
55
|
}, [c, e]);
|
|
54
56
|
return {
|
|
55
57
|
wrapperRef: l,
|
|
56
58
|
wrapperInputRef: o,
|
|
57
59
|
handleOpen: g,
|
|
58
|
-
handleOpenIfClosed:
|
|
60
|
+
handleOpenIfClosed: m
|
|
59
61
|
};
|
|
60
62
|
};
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
k as useDropdown
|
|
63
65
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentRef, RefObject } from 'react';
|
|
2
|
+
type UseNavigationListProps = {
|
|
3
|
+
ulRef: RefObject<ComponentRef<'ul'> | null>;
|
|
4
|
+
wrapperRef: RefObject<ComponentRef<'div'> | null>;
|
|
5
|
+
wrapperInputRef: RefObject<ComponentRef<'div'> | null>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useNavigationUlList: ({ ulRef, wrapperRef, wrapperInputRef, }: UseNavigationListProps) => void;
|
|
8
|
+
export {};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { useRef as
|
|
1
|
+
import { useRef as k, useEffect as a } from "react";
|
|
2
2
|
import { useDropdownContext as d } from "../contexts/dropdown.hook.js";
|
|
3
|
-
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "../contexts/dropdown.context.js";
|
|
5
|
+
const h = ({
|
|
4
6
|
ulRef: n,
|
|
5
7
|
wrapperRef: f,
|
|
6
8
|
wrapperInputRef: u
|
|
7
9
|
}) => {
|
|
8
|
-
const r =
|
|
10
|
+
const r = k(0), { isOpen: b } = d();
|
|
9
11
|
a(() => {
|
|
10
|
-
var s,
|
|
12
|
+
var s, m;
|
|
11
13
|
const e = ((s = n.current) == null ? void 0 : s.querySelectorAll("li")) ?? [], c = new AbortController(), i = () => {
|
|
12
14
|
r.current < e.length - 1 ? (r.current = r.current + 1, e[r.current].focus()) : (r.current = 0, e[0].focus());
|
|
13
15
|
}, o = () => {
|
|
14
16
|
var t;
|
|
15
17
|
r.current > 0 ? (r.current = r.current - 1, e[r.current].focus()) : (r.current = 0, (t = u.current) == null || t.focus());
|
|
16
18
|
};
|
|
17
|
-
return (
|
|
19
|
+
return (m = n.current) == null || m.addEventListener(
|
|
18
20
|
"keydown",
|
|
19
21
|
(t) => {
|
|
20
|
-
var
|
|
22
|
+
var g;
|
|
21
23
|
switch (t.preventDefault(), t.key) {
|
|
22
24
|
case "ArrowDown": {
|
|
23
25
|
i();
|
|
@@ -28,7 +30,7 @@ const w = ({
|
|
|
28
30
|
break;
|
|
29
31
|
}
|
|
30
32
|
case "ArrowUp": {
|
|
31
|
-
r.current === 0 ? (
|
|
33
|
+
r.current === 0 ? (g = u.current) == null || g.focus() : o();
|
|
32
34
|
break;
|
|
33
35
|
}
|
|
34
36
|
case "Enter": {
|
|
@@ -60,5 +62,5 @@ const w = ({
|
|
|
60
62
|
}, [b]);
|
|
61
63
|
};
|
|
62
64
|
export {
|
|
63
|
-
|
|
65
|
+
h as useNavigationUlList
|
|
64
66
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsxs as y, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import s, { forwardRef as
|
|
2
|
+
import s, { forwardRef as m, useId as b } from "react";
|
|
3
3
|
import { cn as w } from "../../utils/index.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
4
|
+
import "../../contexts/theme.context.js";
|
|
5
|
+
import { useTheme as j } from "../../contexts/theme.hook.js";
|
|
6
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
7
|
+
import { inputVariants as N } from "./Input.variants.js";
|
|
8
|
+
import { P as l } from "../../index-D68N8v8R.js";
|
|
7
9
|
function p() {
|
|
8
10
|
return p = Object.assign || function(e) {
|
|
9
11
|
for (var o = 1; o < arguments.length; o++) {
|
|
@@ -31,7 +33,7 @@ function k(e, o) {
|
|
|
31
33
|
n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
32
34
|
return r;
|
|
33
35
|
}
|
|
34
|
-
var
|
|
36
|
+
var u = m(function(e, o) {
|
|
35
37
|
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, c = P(e, ["color", "size"]);
|
|
36
38
|
return /* @__PURE__ */ s.createElement("svg", p({
|
|
37
39
|
ref: o,
|
|
@@ -60,11 +62,11 @@ var m = u(function(e, o) {
|
|
|
60
62
|
y2: "16"
|
|
61
63
|
}));
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
u.propTypes = {
|
|
64
66
|
color: l.string,
|
|
65
67
|
size: l.oneOfType([l.string, l.number])
|
|
66
68
|
};
|
|
67
|
-
|
|
69
|
+
u.displayName = "AlertCircle";
|
|
68
70
|
function f() {
|
|
69
71
|
return f = Object.assign || function(e) {
|
|
70
72
|
for (var o = 1; o < arguments.length; o++) {
|
|
@@ -92,7 +94,7 @@ function z(e, o) {
|
|
|
92
94
|
n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
93
95
|
return r;
|
|
94
96
|
}
|
|
95
|
-
var h =
|
|
97
|
+
var h = m(function(e, o) {
|
|
96
98
|
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, c = E(e, ["color", "size"]);
|
|
97
99
|
return /* @__PURE__ */ s.createElement("svg", f({
|
|
98
100
|
ref: o,
|
|
@@ -119,7 +121,7 @@ h.propTypes = {
|
|
|
119
121
|
size: l.oneOfType([l.string, l.number])
|
|
120
122
|
};
|
|
121
123
|
h.displayName = "EyeOff";
|
|
122
|
-
const _ =
|
|
124
|
+
const _ = m(
|
|
123
125
|
({
|
|
124
126
|
className: e,
|
|
125
127
|
error: o,
|
|
@@ -131,7 +133,7 @@ const _ = u(
|
|
|
131
133
|
onClickIcon: g,
|
|
132
134
|
...d
|
|
133
135
|
}, x) => {
|
|
134
|
-
const v = b(), { theme: O } =
|
|
136
|
+
const v = b(), { theme: O } = j();
|
|
135
137
|
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
|
|
136
138
|
r ? /* @__PURE__ */ a(
|
|
137
139
|
"label",
|
|
@@ -149,7 +151,7 @@ const _ = u(
|
|
|
149
151
|
ref: x,
|
|
150
152
|
name: n,
|
|
151
153
|
type: i,
|
|
152
|
-
className:
|
|
154
|
+
className: N({
|
|
153
155
|
className: e,
|
|
154
156
|
theme: c ?? O,
|
|
155
157
|
variant: o ? "error" : "default"
|
|
@@ -157,7 +159,7 @@ const _ = u(
|
|
|
157
159
|
...d
|
|
158
160
|
}
|
|
159
161
|
),
|
|
160
|
-
o ? /* @__PURE__ */ a("i", { className: "absolute right-2 text-red-600 top-0 translate-y-[40%]", children: /* @__PURE__ */ a(
|
|
162
|
+
o ? /* @__PURE__ */ a("i", { className: "absolute right-2 text-red-600 top-0 translate-y-[40%]", children: /* @__PURE__ */ a(u, { className: "w-5 h-5" }) }) : null,
|
|
161
163
|
i === "password" ? /* @__PURE__ */ a("i", { className: "absolute right-2 text-slate-400 top-0 translate-y-[40%]", children: /* @__PURE__ */ a(
|
|
162
164
|
h,
|
|
163
165
|
{
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
3
|
+
import { inputVariants } from './Input.variants';
|
|
4
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
5
|
+
label?: string;
|
|
6
|
+
labelClassName?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
onClickIcon?: () => void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { M as d } from "../../Modal-W2GbkC_F.js";
|
|
4
|
-
import "./components/Header/Header.js";
|
|
2
|
+
import "../../index-BaNV0qac.js";
|
|
5
3
|
import "./components/Body/Body.js";
|
|
6
4
|
import "./components/Footer/Footer.js";
|
|
5
|
+
import "./components/Header/Header.js";
|
|
6
|
+
import { M as d } from "../../Modal-L73dmnHv.js";
|
|
7
7
|
import "./hooks/useModal.js";
|
|
8
8
|
export {
|
|
9
9
|
d as Modal
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { modalVariants } from './components/Wrapper/Wrapper.variants';
|
|
4
|
+
export interface ModalProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
5
|
+
className?: string;
|
|
6
|
+
buttonCloseClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
export type ModalChildProps = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../../../index-
|
|
2
|
+
import "../../../../index-BtibbG81.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { W as
|
|
5
|
-
import "../../../../Combination-
|
|
4
|
+
import { W as c } from "../../../../Modal-L73dmnHv.js";
|
|
5
|
+
import "../../../../Combination-Cmu9JRkv.js";
|
|
6
|
+
import "../../../../contexts/theme.context.js";
|
|
7
|
+
import "../../../../contexts/theme.hook.js";
|
|
8
|
+
import "../../../../js.cookie-OLEfuq_g.js";
|
|
6
9
|
import "../../../../utils/index.js";
|
|
7
|
-
import "./Wrapper.variants.js";
|
|
8
10
|
import "../../hooks/useModal.js";
|
|
9
|
-
import "
|
|
10
|
-
import "../../../../
|
|
11
|
+
import "./Wrapper.variants.js";
|
|
12
|
+
import "../../../../x-CRBgmX1Q.js";
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
c as Wrapper
|
|
13
15
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { modalVariants } from './Wrapper.variants';
|
|
4
|
+
export interface WrapperProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
5
|
+
className?: string;
|
|
6
|
+
buttonCloseClassName?: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const modalVariants: (props?: ({
|
|
2
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
3
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
|
+
export declare const buttonCloseVariants: (props?: ({
|
|
5
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Body as e } from "./Body/Body.js";
|
|
2
2
|
import { Footer as t } from "./Footer/Footer.js";
|
|
3
3
|
import { Header as m } from "./Header/Header.js";
|
|
4
|
-
import { W as a } from "../../../Modal-
|
|
4
|
+
import { W as a } from "../../../Modal-L73dmnHv.js";
|
|
5
5
|
export {
|
|
6
6
|
e as Body,
|
|
7
7
|
t as Footer,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as t, useCallback as n } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useToggle as f } from "../../../hooks/useToggle.js";
|
|
4
|
+
import { ModalContext as h } from "./Modal.context.js";
|
|
5
5
|
const x = ({ children: s }) => {
|
|
6
|
-
const [r, l] = t(!0), [a, o] =
|
|
6
|
+
const [r, l] = t(!0), [a, o] = f(!1), [u, c] = t(), e = n(() => o(!0), [o]), d = n(() => o(!1), [o]), p = (m, C = !0) => {
|
|
7
7
|
c(m), e(), l(C);
|
|
8
8
|
};
|
|
9
9
|
return /* @__PURE__ */ i(
|
|
10
|
-
|
|
10
|
+
h.Provider,
|
|
11
11
|
{
|
|
12
12
|
value: {
|
|
13
13
|
content: u,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type State = {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
content: string | ReactNode;
|
|
5
|
+
shouldShowClose: boolean;
|
|
6
|
+
onOpen: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
setContentAndOpen: (content: string | ReactNode, showCloseButton?: boolean) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal.provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useModal';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useModal: () => {
|
|
2
|
+
closeBtnRef: import('react').RefObject<HTMLButtonElement | null>;
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
content: string | import('react').ReactNode;
|
|
5
|
+
shouldShowClose: boolean;
|
|
6
|
+
onOpen: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
setContentAndOpen: (content: string | import('react').ReactNode, showCloseButton?: boolean) => void;
|
|
9
|
+
};
|