@konstructio/ui 0.0.12-alpha.1 → 0.0.12-alpha.10
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-BQYb0Gw7.js → Combination-b348x__d.js} +24 -24
- package/dist/Modal-B-E9uaA6.js +922 -0
- package/dist/components/Alert/Alert.js +58 -0
- package/dist/components/Alert/Alert.variants.js +77 -0
- 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/Autocomplete/Autocomplete.variants.js +0 -1
- package/dist/components/Autocomplete/components/List/List.js +3 -3
- package/dist/components/Breadcrumb/Breadcrumb.js +3 -3
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +18 -15
- package/dist/components/Breadcrumb/components/Item/Item.js +4 -4
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Card/Card.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +5 -5
- package/dist/components/Command/Command.js +32 -0
- package/dist/components/Command/Command.variants.js +97 -0
- package/dist/components/Command/components/Command.js +8 -0
- package/dist/components/Command/components/CommandEmpty.js +15 -0
- package/dist/components/Command/components/CommandGroup.js +19 -0
- package/dist/components/Command/components/CommandInput.js +84 -0
- package/dist/components/Command/components/CommandItem.js +29 -0
- package/dist/components/Command/components/CommandList.js +16 -0
- package/dist/components/Command/components/CommandSeparator.js +16 -0
- package/dist/components/Command/components/CommandShortcut.js +19 -0
- package/dist/components/Command/components/DialogContent.js +31 -0
- package/dist/components/Command/components/DialogOverlay.js +19 -0
- package/dist/components/Command/components/index.js +20 -0
- package/dist/components/Command/contexts/Command.context.js +13 -0
- package/dist/components/Command/contexts/Command.provider.js +24 -0
- package/dist/components/Command/contexts/index.js +6 -0
- package/dist/components/Divider/Divider.js +10 -0
- package/dist/components/Divider/Divider.variants.js +14 -0
- package/dist/components/Dropdown/Dropdown.variants.js +22 -3
- package/dist/components/Dropdown/components/List/List.variants.js +4 -4
- package/dist/components/Dropdown/components/ListItem/ListItem.js +19 -18
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +6 -4
- package/dist/components/Dropdown/components/Wrapper.js +88 -57
- package/dist/components/Input/Input.js +112 -67
- package/dist/components/Input/Input.variants.js +5 -6
- package/dist/components/Loading/Loading.js +109 -0
- package/dist/components/Loading/Loading.variants.js +19 -0
- package/dist/components/Modal/Modal.js +3 -3
- 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 -5
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +3 -3
- package/dist/components/Radio/Radio.js +4 -4
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +4 -4
- package/dist/components/Sidebar/Sidebar.variants.js +2 -1
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +9 -15
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +2 -2
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +6 -5
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +3 -3
- package/dist/components/Slider/Slider.js +14 -14
- package/dist/components/Switch/Switch.js +17 -17
- package/dist/components/Tag/Tag.js +17 -5
- package/dist/components/Tag/Tag.variants.js +11 -1
- package/dist/components/TagSelect/TagSelect.js +6 -71
- package/dist/components/TagSelect/TagSelect.variants.js +29 -50
- package/dist/components/TagSelect/components/Item/Item.js +23 -0
- package/dist/components/TagSelect/components/Item/Item.variants.js +31 -0
- package/dist/components/TagSelect/components/List/List.js +13 -0
- package/dist/components/TagSelect/components/List/List.variants.js +37 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +88 -0
- package/dist/components/TagSelect/components/index.js +8 -0
- package/dist/components/TagSelect/contexts/TagSelect.context.js +19 -0
- package/dist/components/TagSelect/contexts/TagSelect.hook.js +11 -0
- package/dist/components/TagSelect/contexts/TagSelect.provider.js +69 -0
- package/dist/components/TagSelect/contexts/index.js +6 -0
- package/dist/components/TagSelect/hooks/useTagSelect.js +22 -27
- package/dist/components/TextArea/TextArea.js +28 -22
- package/dist/components/TextArea/TextArea.variants.js +0 -1
- package/dist/components/Toast/Toast.js +143 -130
- package/dist/components/Toast/Toast.variants.js +2 -3
- package/dist/components/Tooltip/Tooltip.js +4 -4
- package/dist/components/Typography/Typography.js +31 -0
- package/dist/components/Typography/Typography.variants.js +63 -0
- package/dist/components/index.js +61 -53
- package/dist/{index-BxeV34ij.js → index-4ecjw_Aj.js} +1 -1
- package/dist/index-B_6_jmOO.js +68 -0
- package/dist/{index-BBjak_0p.js → index-BbsJ0VIJ.js} +2 -2
- package/dist/{index-CJsYodgi.js → index-BzaHYXkt.js} +9 -9
- package/dist/{index-KEdwcThH.js → index-CbTU3cnP.js} +1 -1
- package/dist/{index-8vgf-x5i.js → index-Cva-e5M4.js} +2 -2
- package/dist/index-CzSBQN5S.js +432 -0
- package/dist/index-D7QNmo_D.js +422 -0
- package/dist/index-DUA6Y_AE.js +126 -0
- package/dist/{index-CoqDsznq.js → index-D_76wh4w.js} +3 -3
- package/dist/{index-D4Q2rMby.js → index-Dj1pom3_.js} +2 -2
- package/dist/index-DyKo5ZJT.js +446 -0
- package/dist/index.d.ts +61 -7
- package/dist/index.js +76 -68
- package/dist/package.json +36 -35
- package/dist/plugins/konstruct.js +34 -31
- package/dist/plugins/utils/animation.styles.js +162 -0
- package/dist/plugins/utils/index.js +7 -0
- package/dist/styles.css +1 -1
- package/dist/{useBreadcrumb-CojbXFVD.js → useBreadcrumb-BsIeMoR1.js} +47 -47
- package/dist/utils/index.js +320 -322
- package/package.json +36 -35
- package/dist/Modal-W2GbkC_F.js +0 -906
- package/dist/index-1GLoikpT.js +0 -19134
- package/dist/index-BVppSRDQ.js +0 -551
- package/dist/index-DoOsnuB6.js +0 -72
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { V as r } from "../../../index-CzSBQN5S.js";
|
|
4
|
+
import { cn as t } from "../../../utils/index.js";
|
|
5
|
+
const s = p(({ className: o, ...a }, m) => /* @__PURE__ */ e(
|
|
6
|
+
r.Separator,
|
|
7
|
+
{
|
|
8
|
+
ref: m,
|
|
9
|
+
className: t("-mx-1 h-px border-t border-neutral-900/45 mb-2", o),
|
|
10
|
+
...a
|
|
11
|
+
}
|
|
12
|
+
));
|
|
13
|
+
s.displayName = r.Separator.displayName;
|
|
14
|
+
export {
|
|
15
|
+
s as CommandSeparator
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { cn as r } from "../../../utils/index.js";
|
|
3
|
+
const a = ({
|
|
4
|
+
className: t,
|
|
5
|
+
...o
|
|
6
|
+
}) => /* @__PURE__ */ m(
|
|
7
|
+
"span",
|
|
8
|
+
{
|
|
9
|
+
className: r(
|
|
10
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
11
|
+
t
|
|
12
|
+
),
|
|
13
|
+
...o
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
a.displayName = "CommandShortcut";
|
|
17
|
+
export {
|
|
18
|
+
a as CommandShortcut
|
|
19
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import { a as r, C as o, b as l } from "../../../index-DyKo5ZJT.js";
|
|
4
|
+
import { cn as m } from "../../../utils/index.js";
|
|
5
|
+
import { DialogOverlay as p } from "./DialogOverlay.js";
|
|
6
|
+
import { X as c } from "../../../x-DU-Zw-L_.js";
|
|
7
|
+
const f = i(({ className: e, children: s, ...n }, d) => /* @__PURE__ */ t(r, { children: [
|
|
8
|
+
/* @__PURE__ */ a(p, {}),
|
|
9
|
+
/* @__PURE__ */ t(
|
|
10
|
+
o,
|
|
11
|
+
{
|
|
12
|
+
ref: d,
|
|
13
|
+
className: m(
|
|
14
|
+
"fixed text-white left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
15
|
+
e
|
|
16
|
+
),
|
|
17
|
+
...n,
|
|
18
|
+
children: [
|
|
19
|
+
s,
|
|
20
|
+
/* @__PURE__ */ t(l, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-white", children: [
|
|
21
|
+
/* @__PURE__ */ a(c, { className: "h-4 w-4" }),
|
|
22
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
|
|
23
|
+
] })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
] }));
|
|
28
|
+
f.displayName = o.displayName;
|
|
29
|
+
export {
|
|
30
|
+
f as DialogContent
|
|
31
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import { O as a } from "../../../index-DyKo5ZJT.js";
|
|
4
|
+
import { cn as m } from "../../../utils/index.js";
|
|
5
|
+
const r = i(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
6
|
+
a,
|
|
7
|
+
{
|
|
8
|
+
ref: o,
|
|
9
|
+
className: m(
|
|
10
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
11
|
+
t
|
|
12
|
+
),
|
|
13
|
+
...e
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
r.displayName = a.displayName;
|
|
17
|
+
export {
|
|
18
|
+
r as DialogOverlay
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommandEmpty as r } from "./CommandEmpty.js";
|
|
2
|
+
import { CommandGroup as p } from "./CommandGroup.js";
|
|
3
|
+
import { CommandInput as a } from "./CommandInput.js";
|
|
4
|
+
import { CommandItem as f } from "./CommandItem.js";
|
|
5
|
+
import { CommandList as C } from "./CommandList.js";
|
|
6
|
+
import { CommandSeparator as u } from "./CommandSeparator.js";
|
|
7
|
+
import { CommandShortcut as I } from "./CommandShortcut.js";
|
|
8
|
+
import { DialogContent as c } from "./DialogContent.js";
|
|
9
|
+
import { Command as h } from "./Command.js";
|
|
10
|
+
export {
|
|
11
|
+
h as Command,
|
|
12
|
+
r as CommandEmpty,
|
|
13
|
+
p as CommandGroup,
|
|
14
|
+
a as CommandInput,
|
|
15
|
+
f as CommandItem,
|
|
16
|
+
C as CommandList,
|
|
17
|
+
u as CommandSeparator,
|
|
18
|
+
I as CommandShortcut,
|
|
19
|
+
c as DialogContent
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext as e } from "react";
|
|
2
|
+
const t = {
|
|
3
|
+
isOpen: !1,
|
|
4
|
+
setOpen: () => {
|
|
5
|
+
throw new Error("onOpen is not implemented");
|
|
6
|
+
},
|
|
7
|
+
toggleOpen: () => {
|
|
8
|
+
throw new Error("toggleOpen is not implemented");
|
|
9
|
+
}
|
|
10
|
+
}, o = e(t);
|
|
11
|
+
export {
|
|
12
|
+
o as CommandContext
|
|
13
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CommandContext as s } from "./Command.context.js";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback as e } from "react";
|
|
4
|
+
import { useToggle as p } from "../../../hooks/useToggle.js";
|
|
5
|
+
const f = ({ children: t }) => {
|
|
6
|
+
const [r, o] = p(!1), n = e(
|
|
7
|
+
(l) => o(l),
|
|
8
|
+
[o]
|
|
9
|
+
), m = e(() => o(), [o]);
|
|
10
|
+
return /* @__PURE__ */ a(
|
|
11
|
+
s.Provider,
|
|
12
|
+
{
|
|
13
|
+
value: {
|
|
14
|
+
isOpen: r,
|
|
15
|
+
setOpen: n,
|
|
16
|
+
toggleOpen: m
|
|
17
|
+
},
|
|
18
|
+
children: t
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
f as CommandProvider
|
|
24
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { dividerVariants as a } from "./Divider.variants.js";
|
|
3
|
+
const d = ({
|
|
4
|
+
className: i,
|
|
5
|
+
...r
|
|
6
|
+
}) => /* @__PURE__ */ e("div", { className: a({ className: i }), ...r });
|
|
7
|
+
d.displayName = "Divider";
|
|
8
|
+
export {
|
|
9
|
+
d as Divider
|
|
10
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as e } from "../../index-BNmRGtA6.js";
|
|
2
|
-
const
|
|
2
|
+
const t = e(
|
|
3
3
|
[
|
|
4
4
|
"border",
|
|
5
5
|
"cursor-pointer",
|
|
@@ -13,7 +13,8 @@ const a = e(
|
|
|
13
13
|
"rounded-md",
|
|
14
14
|
"transition-all",
|
|
15
15
|
"w-full",
|
|
16
|
-
"outline-none"
|
|
16
|
+
"outline-none",
|
|
17
|
+
"h-9"
|
|
17
18
|
],
|
|
18
19
|
{
|
|
19
20
|
variants: {
|
|
@@ -35,7 +36,25 @@ const a = e(
|
|
|
35
36
|
theme: "kubefirst"
|
|
36
37
|
}
|
|
37
38
|
}
|
|
39
|
+
), a = e(
|
|
40
|
+
[
|
|
41
|
+
"mb-1",
|
|
42
|
+
"cursor-pointer",
|
|
43
|
+
"text-[14px]",
|
|
44
|
+
"leading-[20px]",
|
|
45
|
+
"tracking-[0.1px]"
|
|
46
|
+
],
|
|
47
|
+
{
|
|
48
|
+
variants: {
|
|
49
|
+
theme: {
|
|
50
|
+
kubefirst: "",
|
|
51
|
+
colony: "",
|
|
52
|
+
civo: ""
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
38
56
|
);
|
|
39
57
|
export {
|
|
40
|
-
|
|
58
|
+
t as dropdownVariants,
|
|
59
|
+
a as labelVariants
|
|
41
60
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const
|
|
1
|
+
import { c as t } from "../../../../index-BNmRGtA6.js";
|
|
2
|
+
const o = t(
|
|
3
3
|
[
|
|
4
4
|
"absolute",
|
|
5
5
|
"bg-white",
|
|
@@ -20,7 +20,7 @@ const t = r(
|
|
|
20
20
|
variants: {
|
|
21
21
|
theme: {
|
|
22
22
|
colony: ["border-red-400"],
|
|
23
|
-
kubefirst: ["
|
|
23
|
+
kubefirst: ["text-zinc-700"],
|
|
24
24
|
civo: ""
|
|
25
25
|
}
|
|
26
26
|
},
|
|
@@ -30,5 +30,5 @@ const t = r(
|
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
o as listVariants
|
|
34
34
|
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsxs as f, jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useCallback as s } from "react";
|
|
3
3
|
import { cn as d } from "../../../../utils/index.js";
|
|
4
|
-
import { listItemVariants as
|
|
4
|
+
import { listItemVariants as u } from "./ListItem.variants.js";
|
|
5
|
+
import { Typography as h } from "../../../Typography/Typography.js";
|
|
5
6
|
import { useDropdownContext as x } from "../../contexts/dropdown.hook.js";
|
|
6
|
-
const
|
|
7
|
-
const { setValue: n, toggleOpen:
|
|
8
|
-
(
|
|
9
|
-
n(
|
|
7
|
+
const g = ({ theme: a, ...e }) => {
|
|
8
|
+
const { setValue: n, toggleOpen: r } = x(), c = p(null), l = s(
|
|
9
|
+
(t) => {
|
|
10
|
+
n(t), r(!1);
|
|
10
11
|
},
|
|
11
|
-
[n,
|
|
12
|
-
),
|
|
13
|
-
(
|
|
14
|
-
|
|
12
|
+
[n, r]
|
|
13
|
+
), i = s(
|
|
14
|
+
(t, m) => {
|
|
15
|
+
t.key === "Enter" && l(m);
|
|
15
16
|
},
|
|
16
|
-
[
|
|
17
|
+
[l]
|
|
17
18
|
);
|
|
18
19
|
return /* @__PURE__ */ f(
|
|
19
20
|
"li",
|
|
20
21
|
{
|
|
21
22
|
ref: c,
|
|
22
23
|
role: "option",
|
|
23
|
-
className: d(
|
|
24
|
+
className: d(u({ theme: a })),
|
|
24
25
|
tabIndex: 0,
|
|
25
|
-
onClick: () =>
|
|
26
|
-
onKeyDown: (
|
|
26
|
+
onClick: () => l(e),
|
|
27
|
+
onKeyDown: (t) => i(t, e),
|
|
27
28
|
children: [
|
|
28
|
-
e.leftIcon ? /* @__PURE__ */
|
|
29
|
-
e.label
|
|
29
|
+
e.leftIcon ? /* @__PURE__ */ o("span", { className: "w-4 h-4 flex justify-center items-center", children: e.leftIcon }) : null,
|
|
30
|
+
/* @__PURE__ */ o(h, { variant: "body2", className: "text-zinc-700", children: e.label })
|
|
30
31
|
]
|
|
31
32
|
}
|
|
32
33
|
);
|
|
33
34
|
};
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
g as ListItem
|
|
36
37
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as e } from "../../../../index-BNmRGtA6.js";
|
|
2
|
-
const
|
|
2
|
+
const o = e(
|
|
3
3
|
[
|
|
4
4
|
"cursor-pointer",
|
|
5
5
|
"py-2",
|
|
@@ -10,12 +10,14 @@ const t = e(
|
|
|
10
10
|
"w-full",
|
|
11
11
|
"flex",
|
|
12
12
|
"items-center",
|
|
13
|
-
"gap-3"
|
|
13
|
+
"gap-3",
|
|
14
|
+
"hover:bg-slate-50",
|
|
15
|
+
"focus:bg-slate-50"
|
|
14
16
|
],
|
|
15
17
|
{
|
|
16
18
|
variants: {
|
|
17
19
|
theme: {
|
|
18
|
-
kubefirst: ["
|
|
20
|
+
kubefirst: [""],
|
|
19
21
|
colony: ["focus:bg-red-100", "hover:bg-red-100"],
|
|
20
22
|
civo: ""
|
|
21
23
|
}
|
|
@@ -26,5 +28,5 @@ const t = e(
|
|
|
26
28
|
}
|
|
27
29
|
);
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
o as listItemVariants
|
|
30
32
|
};
|
|
@@ -1,69 +1,99 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { dropdownVariants as
|
|
5
|
-
import { useDropdown as
|
|
6
|
-
import { List as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $, useId as A, useRef as y, useImperativeHandle as H, useEffect as d } from "react";
|
|
3
|
+
import { cn as p } from "../../../utils/index.js";
|
|
4
|
+
import { labelVariants as U, dropdownVariants as V } from "../Dropdown.variants.js";
|
|
5
|
+
import { useDropdown as W } from "../hooks/useDropdown.js";
|
|
6
|
+
import { List as B } from "./List/List.js";
|
|
7
|
+
import { Typography as R } from "../../Typography/Typography.js";
|
|
8
|
+
import { C as G } from "../../../chevron-up-DgLBQCKD.js";
|
|
9
|
+
import { useDropdownContext as J } from "../contexts/dropdown.hook.js";
|
|
10
|
+
import { useTheme as K } from "../../../contexts/theme.hook.js";
|
|
11
|
+
const te = $(
|
|
12
|
+
({
|
|
13
|
+
theme: O,
|
|
14
|
+
label: u,
|
|
15
|
+
labelClassName: T,
|
|
16
|
+
placeholder: j,
|
|
17
|
+
name: o,
|
|
18
|
+
options: c,
|
|
19
|
+
defaultValue: m,
|
|
20
|
+
required: h
|
|
21
|
+
}, z) => {
|
|
22
|
+
const x = A(), r = y(null), b = y(null), { wrapperRef: n, wrapperInputRef: w, handleOpen: E, handleOpenIfClosed: k } = W({ ulRef: b }), { isOpen: v, value: e, setValue: N, toggleOpen: C } = J(), { theme: D } = K(), f = O ?? D, l = o ? `${x}-${o}` : x;
|
|
23
|
+
H(z, () => r.current, [r]), d(() => {
|
|
14
24
|
r.current && (r.current.value = e ? e.value : "");
|
|
15
|
-
}, [e]),
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
(
|
|
25
|
+
}, [e]), d(() => {
|
|
26
|
+
if (m) {
|
|
27
|
+
const a = c.find(
|
|
28
|
+
(s) => s.value === m
|
|
19
29
|
);
|
|
20
|
-
|
|
30
|
+
a && N(a);
|
|
21
31
|
}
|
|
22
|
-
}, [
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
return (
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
(!
|
|
32
|
+
}, [m, c, N]), d(() => {
|
|
33
|
+
var s;
|
|
34
|
+
const a = new AbortController();
|
|
35
|
+
return (s = n.current) == null || s.addEventListener("focusout", (L) => {
|
|
36
|
+
var g;
|
|
37
|
+
const I = L.relatedTarget;
|
|
38
|
+
(!I || !((g = n.current) != null && g.contains(I))) && C(!1);
|
|
29
39
|
}), () => {
|
|
30
|
-
|
|
40
|
+
a.abort();
|
|
31
41
|
};
|
|
32
|
-
}, [
|
|
33
|
-
const
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
42
|
+
}, [C, n]);
|
|
43
|
+
const F = () => e != null && e.leftIcon ? /* @__PURE__ */ t("span", { className: "w-4 h-4 flex justify-center items-center", children: e.leftIcon }) : null;
|
|
44
|
+
return /* @__PURE__ */ i("div", { ref: n, className: "flex flex-col w-full relative", children: [
|
|
45
|
+
u ? /* @__PURE__ */ i(
|
|
36
46
|
"label",
|
|
37
47
|
{
|
|
38
|
-
id:
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
id: l,
|
|
49
|
+
className: p(
|
|
50
|
+
U({ theme: f }),
|
|
51
|
+
T
|
|
52
|
+
),
|
|
53
|
+
htmlFor: l,
|
|
54
|
+
onClick: k,
|
|
55
|
+
children: [
|
|
56
|
+
u,
|
|
57
|
+
h ? /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" }) : null
|
|
58
|
+
]
|
|
43
59
|
}
|
|
44
60
|
) : null,
|
|
45
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ i(
|
|
46
62
|
"div",
|
|
47
63
|
{
|
|
48
|
-
ref:
|
|
49
|
-
id:
|
|
50
|
-
className:
|
|
64
|
+
ref: w,
|
|
65
|
+
id: l,
|
|
66
|
+
className: p(V({ theme: f })),
|
|
51
67
|
role: "combobox",
|
|
52
|
-
onClick:
|
|
53
|
-
"aria-expanded":
|
|
68
|
+
onClick: E,
|
|
69
|
+
"aria-expanded": v,
|
|
54
70
|
tabIndex: 0,
|
|
55
|
-
"aria-labelledby":
|
|
71
|
+
"aria-labelledby": l,
|
|
56
72
|
children: [
|
|
57
|
-
/* @__PURE__ */ t("span", { className: "text-base text-inherit", children: e ? /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
/* @__PURE__ */ t("span", { className: "text-base text-inherit", children: e ? /* @__PURE__ */ i(
|
|
74
|
+
R,
|
|
75
|
+
{
|
|
76
|
+
variant: "body2",
|
|
77
|
+
className: "flex gap-3 items-center text-zinc-700",
|
|
78
|
+
children: [
|
|
79
|
+
F(),
|
|
80
|
+
e.label
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
) : /* @__PURE__ */ t(
|
|
84
|
+
R,
|
|
85
|
+
{
|
|
86
|
+
variant: "body2",
|
|
87
|
+
className: "flex gap-3 items-center text-zinc-700",
|
|
88
|
+
children: j
|
|
89
|
+
}
|
|
90
|
+
) }),
|
|
61
91
|
/* @__PURE__ */ t(
|
|
62
|
-
|
|
92
|
+
G,
|
|
63
93
|
{
|
|
64
|
-
className:
|
|
65
|
-
"w-4 h-4 text-
|
|
66
|
-
|
|
94
|
+
className: p(
|
|
95
|
+
"w-4 h-4 text-zinc-500 transition-all duration-50",
|
|
96
|
+
v ? "rotate-0" : "rotate-180"
|
|
67
97
|
)
|
|
68
98
|
}
|
|
69
99
|
)
|
|
@@ -77,23 +107,24 @@ const X = F(
|
|
|
77
107
|
type: "text",
|
|
78
108
|
name: o,
|
|
79
109
|
className: "hidden",
|
|
80
|
-
"aria-hidden": "true"
|
|
110
|
+
"aria-hidden": "true",
|
|
111
|
+
required: h
|
|
81
112
|
}
|
|
82
113
|
),
|
|
83
114
|
/* @__PURE__ */ t(
|
|
84
|
-
|
|
115
|
+
B,
|
|
85
116
|
{
|
|
86
|
-
ref:
|
|
117
|
+
ref: b,
|
|
87
118
|
name: o,
|
|
88
119
|
wrapperRef: n,
|
|
89
|
-
wrapperInputRef:
|
|
90
|
-
options:
|
|
91
|
-
theme:
|
|
120
|
+
wrapperInputRef: w,
|
|
121
|
+
options: c,
|
|
122
|
+
theme: f
|
|
92
123
|
}
|
|
93
124
|
)
|
|
94
125
|
] });
|
|
95
126
|
}
|
|
96
127
|
);
|
|
97
128
|
export {
|
|
98
|
-
|
|
129
|
+
te as Wrapper
|
|
99
130
|
};
|