@konstructio/ui 0.0.13-alpha.1 → 0.1.0-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-b348x__d.js → Combination-VYaRRJBZ.js} +155 -157
- package/dist/DatePicker.css +1 -0
- package/dist/Modal-CrG0m703.js +98 -0
- package/dist/assets/icons/components/Search.js +26 -0
- package/dist/assets/icons/components/Warning.js +22 -0
- package/dist/assets/icons/components/index.js +6 -0
- package/dist/chevron-down-UW8ts6wI.js +11 -0
- package/dist/{chevron-up-DgLBQCKD.js → chevron-up-RLP4nX7V.js} +1 -1
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +55 -41
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +79 -0
- package/dist/components/Badge/Badge.variants.js +68 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +44 -53
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -23
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +30 -26
- package/dist/components/Button/Button.variants.js +116 -29
- package/dist/components/Checkbox/Checkbox.js +300 -185
- package/dist/components/Checkbox/Checkbox.variants.js +12 -15
- 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 +2722 -0
- package/dist/components/Datepicker/DatePicker.variants.js +5 -0
- package/dist/components/Divider/Divider.variants.js +9 -12
- package/dist/components/Dropdown/components/List/List.js +55 -18
- package/dist/components/Dropdown/components/List/List.variants.js +5 -3
- package/dist/components/Dropdown/components/ListItem/ListItem.js +28 -22
- package/dist/components/Dropdown/components/Wrapper.js +110 -86
- package/dist/components/Dropdown/contexts/dropdown.context.js +6 -2
- package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
- package/dist/components/Dropdown/contexts/dropdown.provider.js +18 -11
- package/dist/components/Filter/Filter.js +20 -0
- package/dist/components/Filter/Filter.variants.js +22 -0
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +87 -0
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +95 -0
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +87 -0
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +90 -0
- package/dist/components/Filter/components/ResetButton/ResetButton.js +18 -0
- package/dist/components/Filter/components/index.js +8 -0
- package/dist/components/Filter/events/index.js +12 -0
- package/dist/components/Input/Input.js +134 -163
- package/dist/components/Input/Input.variants.js +15 -13
- package/dist/components/Loading/Loading.js +14 -99
- 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/Wrapper/Wrapper.variants.js +4 -6
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/Radio/Radio.variants.js +14 -12
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +141 -126
- package/dist/components/Table/Table.variants.js +5 -6
- package/dist/components/Tabs/Tabs.js +24 -0
- package/dist/components/Tabs/Tabs.variants.js +58 -0
- package/dist/components/Tabs/components/Content.js +19 -0
- package/dist/components/Tabs/components/List.js +20 -0
- package/dist/components/Tabs/components/Trigger.js +26 -0
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/TimePicker/TimePicker.js +8 -0
- package/dist/components/TimePicker/TimePicker.variants.js +62 -0
- package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +96 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
- package/dist/components/TimePicker/components/index.js +4 -0
- package/dist/components/TimePicker/contexts/index.js +8 -0
- package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
- package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
- package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
- package/dist/components/TimePicker/utils/index.js +6 -0
- package/dist/components/Toast/Toast.js +38 -36
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +14 -16
- package/dist/components/index.js +78 -66
- package/dist/createLucideIcon-ByJ0JZvK.js +94 -0
- package/dist/index--EmNlyHx.js +31 -0
- package/dist/{index-Bk324h27.js → index-B5MIi2tR.js} +6 -5
- package/dist/{index-g-TFwd6Y.js → index-BCGvACM9.js} +2 -1
- package/dist/{index-AM3avohj.js → index-BNU3RH-3.js} +3 -3
- package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
- package/dist/index-BdMNhZnh.js +9 -0
- package/dist/index-BvCZBMfr.js +432 -0
- package/dist/index-Cq1I1cG9.js +129 -0
- package/dist/index-Cs8Lv8Wj.js +13 -0
- package/dist/index-CvfCCTEO.js +323 -0
- package/dist/{index-DvFiic6N.js → index-DLYwlPRZ.js} +96 -102
- package/dist/{index-YaQrdkGE.js → index-DNRcvRTB.js} +31 -30
- package/dist/{index-dRxIWVBr.js → index-Dkt8F6CZ.js} +6 -5
- package/dist/{index-G_6jG4Qc.js → index-Dm-ooN_M.js} +18 -18
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/{index-C5psggHV.js → index-h-Ul0anl.js} +1 -2
- package/dist/{index-D9BbbgUq.js → index-rUBNhTeF.js} +2 -2
- package/dist/index.d.ts +128 -17
- package/dist/index.js +84 -72
- package/dist/package.json +37 -37
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +263 -0
- package/dist/ui/kubefirst-theme.css +1 -1
- package/dist/ui/theme.css +11 -0
- package/dist/ui/utilities.css +11 -2
- package/dist/useBreadcrumb-DMERrNkJ.js +1280 -0
- package/dist/utils/index.js +3 -3
- package/dist/{x-DU-Zw-L_.js → x-BPcqkRZd.js} +1 -1
- package/package.json +37 -37
- package/dist/Modal-i7eolhYH.js +0 -926
- package/dist/index-BOx5P4tS.js +0 -423
- package/dist/index-CWKdynYu.js +0 -32
- package/dist/index-bYyfdsls.js +0 -118
- package/dist/useBreadcrumb-BsIeMoR1.js +0 -1279
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as o } from "../../../Badge/Badge.js";
|
|
3
|
+
import { Button as m } from "../../../Button/Button.js";
|
|
4
|
+
import { Checkbox as C } from "../../../Checkbox/Checkbox.js";
|
|
5
|
+
import { cn as n } from "../../../../utils/index.js";
|
|
6
|
+
import { filterButtonIconVariants as y, filterButtonVariants as N } from "../../Filter.variants.js";
|
|
7
|
+
import { useBadgeMultiSelect as B } from "./BadgeMultiSelect.hook.js";
|
|
8
|
+
import { C as O } from "../../../../chevron-down-UW8ts6wI.js";
|
|
9
|
+
const $ = ({
|
|
10
|
+
options: i,
|
|
11
|
+
label: p,
|
|
12
|
+
position: d = "left",
|
|
13
|
+
onApply: f
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
wrapperRef: h,
|
|
17
|
+
isOpen: l,
|
|
18
|
+
selectedOptions: u,
|
|
19
|
+
selectedCount: c,
|
|
20
|
+
handleOpen: g,
|
|
21
|
+
handleResetOptions: b,
|
|
22
|
+
handleApplyOptions: v,
|
|
23
|
+
handleSelectOption: x
|
|
24
|
+
} = B({ onApply: f });
|
|
25
|
+
return i.length === 0 ? null : /* @__PURE__ */ a("div", { ref: h, className: "relative", children: [
|
|
26
|
+
/* @__PURE__ */ a(
|
|
27
|
+
"button",
|
|
28
|
+
{
|
|
29
|
+
className: n(N(), {
|
|
30
|
+
"text-slate-700": l
|
|
31
|
+
}),
|
|
32
|
+
onClick: g,
|
|
33
|
+
children: [
|
|
34
|
+
p,
|
|
35
|
+
c.length > 0 && /* @__PURE__ */ e(o, { label: c.length.toString() }),
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
|
+
O,
|
|
38
|
+
{
|
|
39
|
+
className: n(y(), {
|
|
40
|
+
"rotate-180": l,
|
|
41
|
+
"text-blue-600": l
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
l && /* @__PURE__ */ a(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: n(
|
|
52
|
+
"absolute top-full mt-1 bg-white rounded-md shadow-md animate-in fade-in-0 z-10 border border-gray-200",
|
|
53
|
+
{
|
|
54
|
+
"left-0": d === "left",
|
|
55
|
+
"right-0": d === "right"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ e("div", { className: "py-4", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: i.map((t) => {
|
|
60
|
+
const s = !!u.find(
|
|
61
|
+
(r) => r.id === t.id
|
|
62
|
+
);
|
|
63
|
+
return /* @__PURE__ */ a("div", { className: "flex gap-4 px-6", children: [
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
C,
|
|
66
|
+
{
|
|
67
|
+
defaultChecked: s,
|
|
68
|
+
"data-label": t.id,
|
|
69
|
+
onChange: (r) => x(t, r)
|
|
70
|
+
},
|
|
71
|
+
`${t.id}-${s}`
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ e(o, { label: t.label, variant: t.variant })
|
|
74
|
+
] }, t.id);
|
|
75
|
+
}) }) }),
|
|
76
|
+
/* @__PURE__ */ a("div", { className: "flex justify-center items-center gap-4 py-4 border-t border-gray-200", children: [
|
|
77
|
+
/* @__PURE__ */ e(
|
|
78
|
+
m,
|
|
79
|
+
{
|
|
80
|
+
variant: "secondary",
|
|
81
|
+
appearance: "compact",
|
|
82
|
+
onClick: b,
|
|
83
|
+
children: "Reset"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ e(m, { appearance: "compact", onClick: v, children: "Apply" })
|
|
87
|
+
] })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] });
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
$ as BadgeMultiSelect
|
|
95
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useRef as L, useId as S, useState as E, useMemo as F, useCallback as r, useEffect as f } from "react";
|
|
2
|
+
import { sendOpenFilterEvent as R, FilterEvent as v } from "../../events/index.js";
|
|
3
|
+
const N = ({
|
|
4
|
+
onApply: t
|
|
5
|
+
}) => {
|
|
6
|
+
const c = L(null), n = S(), [h, o] = E(!1), [a, d] = E(), [i, l] = E(), b = F(
|
|
7
|
+
() => i == null ? void 0 : i.toLocaleDateString("en-GB", {
|
|
8
|
+
day: "numeric",
|
|
9
|
+
month: "short",
|
|
10
|
+
year: "numeric"
|
|
11
|
+
}),
|
|
12
|
+
[i]
|
|
13
|
+
), D = r(
|
|
14
|
+
() => o((e) => (e || R(n), !e)),
|
|
15
|
+
[n]
|
|
16
|
+
), O = r(() => {
|
|
17
|
+
l(a), t == null || t(a);
|
|
18
|
+
}, [t, a]), w = r((e) => d(e), []), u = r(() => o(!1), []), C = r(() => {
|
|
19
|
+
d(void 0), l(void 0), t == null || t();
|
|
20
|
+
}, [t]);
|
|
21
|
+
return f(() => {
|
|
22
|
+
const e = new AbortController();
|
|
23
|
+
return document.addEventListener(
|
|
24
|
+
v.OPEN,
|
|
25
|
+
(s) => {
|
|
26
|
+
s.detail !== n && o(!1);
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
signal: e.signal
|
|
30
|
+
}
|
|
31
|
+
), () => {
|
|
32
|
+
e.abort();
|
|
33
|
+
};
|
|
34
|
+
}, [n]), f(() => {
|
|
35
|
+
const e = new AbortController();
|
|
36
|
+
return document.addEventListener(
|
|
37
|
+
v.OPEN,
|
|
38
|
+
(s) => {
|
|
39
|
+
s.detail !== n && o(!1);
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
signal: e.signal
|
|
43
|
+
}
|
|
44
|
+
), document.addEventListener(
|
|
45
|
+
v.RESET,
|
|
46
|
+
() => {
|
|
47
|
+
d(void 0), l(void 0), t == null || t();
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
signal: e.signal
|
|
51
|
+
}
|
|
52
|
+
), () => {
|
|
53
|
+
e.abort();
|
|
54
|
+
};
|
|
55
|
+
}, [n, t]), f(() => {
|
|
56
|
+
const e = new AbortController(), s = (m) => {
|
|
57
|
+
var g;
|
|
58
|
+
(g = c.current) != null && g.contains(m.target) || u();
|
|
59
|
+
};
|
|
60
|
+
return document.addEventListener("mousedown", s, {
|
|
61
|
+
signal: e.signal
|
|
62
|
+
}), document.addEventListener(
|
|
63
|
+
"visibilitychange",
|
|
64
|
+
() => {
|
|
65
|
+
document.hidden && u();
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
signal: e.signal
|
|
69
|
+
}
|
|
70
|
+
), () => {
|
|
71
|
+
e.abort();
|
|
72
|
+
};
|
|
73
|
+
}, [u, c]), {
|
|
74
|
+
id: n,
|
|
75
|
+
appliedDay: b,
|
|
76
|
+
isOpen: h,
|
|
77
|
+
selectedDay: a,
|
|
78
|
+
wrapperRef: c,
|
|
79
|
+
handleApply: O,
|
|
80
|
+
handleOpen: D,
|
|
81
|
+
handleSelect: w,
|
|
82
|
+
handleReset: C
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
N as useDateFilterDropdown
|
|
87
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as g } from "../../../Badge/Badge.js";
|
|
3
|
+
import { Button as i } from "../../../Button/Button.js";
|
|
4
|
+
import { DatePicker as w } from "../../../Datepicker/DatePicker.js";
|
|
5
|
+
import { cn as o } from "../../../../utils/index.js";
|
|
6
|
+
import { filterButtonIconVariants as x, filterButtonVariants as N } from "../../Filter.variants.js";
|
|
7
|
+
import { useDateFilterDropdown as b } from "./DateFilterDropdown.hook.js";
|
|
8
|
+
import { C as y } from "../../../../chevron-down-UW8ts6wI.js";
|
|
9
|
+
const R = ({
|
|
10
|
+
label: p,
|
|
11
|
+
position: l = "left",
|
|
12
|
+
onApply: s
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
id: m,
|
|
16
|
+
appliedDay: n,
|
|
17
|
+
isOpen: a,
|
|
18
|
+
selectedDay: e,
|
|
19
|
+
wrapperRef: c,
|
|
20
|
+
handleApply: d,
|
|
21
|
+
handleOpen: f,
|
|
22
|
+
handleSelect: h,
|
|
23
|
+
handleReset: u
|
|
24
|
+
} = b({ onApply: s });
|
|
25
|
+
return /* @__PURE__ */ r("div", { ref: c, className: "relative", children: [
|
|
26
|
+
/* @__PURE__ */ r(
|
|
27
|
+
"button",
|
|
28
|
+
{
|
|
29
|
+
className: o(N(), {
|
|
30
|
+
"text-slate-700": a
|
|
31
|
+
}),
|
|
32
|
+
onClick: f,
|
|
33
|
+
children: [
|
|
34
|
+
p,
|
|
35
|
+
n && /* @__PURE__ */ t(g, { label: n }),
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
y,
|
|
38
|
+
{
|
|
39
|
+
className: o(x(), {
|
|
40
|
+
"rotate-180": a,
|
|
41
|
+
"text-blue-600": a
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
a && /* @__PURE__ */ r(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: o(
|
|
52
|
+
"absolute top-full mt-1 bg-white rounded-md shadow-md animate-in fade-in-0 z-10 border border-gray-200 flex flex-col gap-4 py-4 px-6",
|
|
53
|
+
{
|
|
54
|
+
"left-0": l === "left",
|
|
55
|
+
"right-0": l === "right"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ t(
|
|
60
|
+
w,
|
|
61
|
+
{
|
|
62
|
+
className: "p-0",
|
|
63
|
+
arrowClassName: "-top-1 right-0",
|
|
64
|
+
monthsClassName: "shadow-none p-0 w-auto",
|
|
65
|
+
defaultSelected: e,
|
|
66
|
+
defaultMonth: e,
|
|
67
|
+
onSelect: h
|
|
68
|
+
},
|
|
69
|
+
(e == null ? void 0 : e.toISOString()) ?? m
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ r("div", { className: "flex justify-end items-center gap-4 py-2", children: [
|
|
72
|
+
/* @__PURE__ */ t(
|
|
73
|
+
i,
|
|
74
|
+
{
|
|
75
|
+
variant: "secondary",
|
|
76
|
+
appearance: "compact",
|
|
77
|
+
onClick: u,
|
|
78
|
+
children: "Reset"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ t(i, { appearance: "compact", onClick: d, children: "Apply" })
|
|
82
|
+
] })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] });
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
R as DateFilterDropdown
|
|
90
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Button as o } from "../../../Button/Button.js";
|
|
3
|
+
import { resetEvent as r } from "../../events/index.js";
|
|
4
|
+
const i = ({ disabled: t }) => /* @__PURE__ */ e(
|
|
5
|
+
o,
|
|
6
|
+
{
|
|
7
|
+
type: "button",
|
|
8
|
+
variant: "text",
|
|
9
|
+
appearance: "compact",
|
|
10
|
+
version: "alternate",
|
|
11
|
+
onClick: r,
|
|
12
|
+
disabled: t,
|
|
13
|
+
children: "Reset"
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
export {
|
|
17
|
+
i as ResetButton
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BadgeMultiSelect as o } from "./BadgeDropdown/BadgeMultiSelect.js";
|
|
2
|
+
import { DateFilterDropdown as p } from "./DateFilterDropdown/DateFilterDropdown.js";
|
|
3
|
+
import { ResetButton as l } from "./ResetButton/ResetButton.js";
|
|
4
|
+
export {
|
|
5
|
+
o as BadgeMultiSelect,
|
|
6
|
+
p as DateFilterDropdown,
|
|
7
|
+
l as ResetButton
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var e = /* @__PURE__ */ ((t) => (t.OPEN = "@konstrtuctio/Filter/event-OPEN", t.RESET = "@konstrtuctio/Filter/event-RESET", t))(e || {});
|
|
2
|
+
const n = (t) => document.dispatchEvent(
|
|
3
|
+
new CustomEvent("@konstrtuctio/Filter/event-OPEN", { detail: t })
|
|
4
|
+
), o = () => document.dispatchEvent(new CustomEvent(
|
|
5
|
+
"@konstrtuctio/Filter/event-RESET"
|
|
6
|
+
/* RESET */
|
|
7
|
+
));
|
|
8
|
+
export {
|
|
9
|
+
e as FilterEvent,
|
|
10
|
+
o as resetEvent,
|
|
11
|
+
n as sendOpenFilterEvent
|
|
12
|
+
};
|
|
@@ -1,110 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import l, { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { inputVariants as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import l, { forwardRef as v, useId as k, useState as z } from "react";
|
|
3
|
+
import { cn as d } from "../../utils/index.js";
|
|
4
|
+
import { inputVariants as _ } from "./Input.variants.js";
|
|
5
|
+
import { SearchIcon as I } from "../../assets/icons/components/Search.js";
|
|
6
|
+
import { Warning as W } from "../../assets/icons/components/Warning.js";
|
|
7
|
+
import { P as i } from "../../index-h-Ul0anl.js";
|
|
8
|
+
function h() {
|
|
9
|
+
return h = Object.assign || function(t) {
|
|
10
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
11
|
+
var o = arguments[r];
|
|
12
|
+
for (var e in o)
|
|
13
|
+
Object.prototype.hasOwnProperty.call(o, e) && (t[e] = o[e]);
|
|
12
14
|
}
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
+
return t;
|
|
16
|
+
}, h.apply(this, arguments);
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
var
|
|
18
|
+
function $(t, r) {
|
|
19
|
+
if (t == null) return {};
|
|
20
|
+
var o = L(t, r), e, n;
|
|
19
21
|
if (Object.getOwnPropertySymbols) {
|
|
20
|
-
var
|
|
21
|
-
for (n = 0; n <
|
|
22
|
-
|
|
22
|
+
var a = Object.getOwnPropertySymbols(t);
|
|
23
|
+
for (n = 0; n < a.length; n++)
|
|
24
|
+
e = a[n], !(r.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(t, e) && (o[e] = t[e]);
|
|
23
25
|
}
|
|
24
|
-
return
|
|
26
|
+
return o;
|
|
25
27
|
}
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
var
|
|
29
|
-
for (
|
|
30
|
-
n =
|
|
31
|
-
return
|
|
28
|
+
function L(t, r) {
|
|
29
|
+
if (t == null) return {};
|
|
30
|
+
var o = {}, e = Object.keys(t), n, a;
|
|
31
|
+
for (a = 0; a < e.length; a++)
|
|
32
|
+
n = e[a], !(r.indexOf(n) >= 0) && (o[n] = t[n]);
|
|
33
|
+
return o;
|
|
32
34
|
}
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
return /* @__PURE__ */ l.createElement("svg",
|
|
36
|
-
ref:
|
|
35
|
+
var y = v(function(t, r) {
|
|
36
|
+
var o = t.color, e = o === void 0 ? "currentColor" : o, n = t.size, a = n === void 0 ? 24 : n, c = $(t, ["color", "size"]);
|
|
37
|
+
return /* @__PURE__ */ l.createElement("svg", h({
|
|
38
|
+
ref: r,
|
|
37
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
40
|
+
width: a,
|
|
41
|
+
height: a,
|
|
40
42
|
viewBox: "0 0 24 24",
|
|
41
43
|
fill: "none",
|
|
42
|
-
stroke:
|
|
44
|
+
stroke: e,
|
|
43
45
|
strokeWidth: "2",
|
|
44
46
|
strokeLinecap: "round",
|
|
45
47
|
strokeLinejoin: "round"
|
|
46
|
-
},
|
|
47
|
-
cx: "12",
|
|
48
|
-
cy: "12",
|
|
49
|
-
r: "10"
|
|
50
|
-
}), /* @__PURE__ */ l.createElement("line", {
|
|
51
|
-
x1: "12",
|
|
52
|
-
y1: "8",
|
|
53
|
-
x2: "12",
|
|
54
|
-
y2: "12"
|
|
55
|
-
}), /* @__PURE__ */ l.createElement("line", {
|
|
56
|
-
x1: "12",
|
|
57
|
-
y1: "16",
|
|
58
|
-
x2: "12.01",
|
|
59
|
-
y2: "16"
|
|
60
|
-
}));
|
|
61
|
-
});
|
|
62
|
-
h.propTypes = {
|
|
63
|
-
color: a.string,
|
|
64
|
-
size: a.oneOfType([a.string, a.number])
|
|
65
|
-
};
|
|
66
|
-
h.displayName = "AlertCircle";
|
|
67
|
-
function m() {
|
|
68
|
-
return m = Object.assign || function(e) {
|
|
69
|
-
for (var o = 1; o < arguments.length; o++) {
|
|
70
|
-
var r = arguments[o];
|
|
71
|
-
for (var t in r)
|
|
72
|
-
Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
73
|
-
}
|
|
74
|
-
return e;
|
|
75
|
-
}, m.apply(this, arguments);
|
|
76
|
-
}
|
|
77
|
-
function _(e, o) {
|
|
78
|
-
if (e == null) return {};
|
|
79
|
-
var r = L(e, o), t, n;
|
|
80
|
-
if (Object.getOwnPropertySymbols) {
|
|
81
|
-
var i = Object.getOwnPropertySymbols(e);
|
|
82
|
-
for (n = 0; n < i.length; n++)
|
|
83
|
-
t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
84
|
-
}
|
|
85
|
-
return r;
|
|
86
|
-
}
|
|
87
|
-
function L(e, o) {
|
|
88
|
-
if (e == null) return {};
|
|
89
|
-
var r = {}, t = Object.keys(e), n, i;
|
|
90
|
-
for (i = 0; i < t.length; i++)
|
|
91
|
-
n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
92
|
-
return r;
|
|
93
|
-
}
|
|
94
|
-
var v = p(function(e, o) {
|
|
95
|
-
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, s = _(e, ["color", "size"]);
|
|
96
|
-
return /* @__PURE__ */ l.createElement("svg", m({
|
|
97
|
-
ref: o,
|
|
98
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
99
|
-
width: i,
|
|
100
|
-
height: i,
|
|
101
|
-
viewBox: "0 0 24 24",
|
|
102
|
-
fill: "none",
|
|
103
|
-
stroke: t,
|
|
104
|
-
strokeWidth: "2",
|
|
105
|
-
strokeLinecap: "round",
|
|
106
|
-
strokeLinejoin: "round"
|
|
107
|
-
}, s), /* @__PURE__ */ l.createElement("path", {
|
|
48
|
+
}, c), /* @__PURE__ */ l.createElement("path", {
|
|
108
49
|
d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"
|
|
109
50
|
}), /* @__PURE__ */ l.createElement("line", {
|
|
110
51
|
x1: "1",
|
|
@@ -113,52 +54,52 @@ var v = p(function(e, o) {
|
|
|
113
54
|
y2: "23"
|
|
114
55
|
}));
|
|
115
56
|
});
|
|
116
|
-
|
|
117
|
-
color:
|
|
118
|
-
size:
|
|
57
|
+
y.propTypes = {
|
|
58
|
+
color: i.string,
|
|
59
|
+
size: i.oneOfType([i.string, i.number])
|
|
119
60
|
};
|
|
120
|
-
|
|
121
|
-
function
|
|
122
|
-
return
|
|
123
|
-
for (var
|
|
124
|
-
var
|
|
125
|
-
for (var
|
|
126
|
-
Object.prototype.hasOwnProperty.call(
|
|
61
|
+
y.displayName = "EyeOff";
|
|
62
|
+
function g() {
|
|
63
|
+
return g = Object.assign || function(t) {
|
|
64
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
65
|
+
var o = arguments[r];
|
|
66
|
+
for (var e in o)
|
|
67
|
+
Object.prototype.hasOwnProperty.call(o, e) && (t[e] = o[e]);
|
|
127
68
|
}
|
|
128
|
-
return
|
|
129
|
-
},
|
|
69
|
+
return t;
|
|
70
|
+
}, g.apply(this, arguments);
|
|
130
71
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
72
|
+
function S(t, r) {
|
|
73
|
+
if (t == null) return {};
|
|
74
|
+
var o = T(t, r), e, n;
|
|
134
75
|
if (Object.getOwnPropertySymbols) {
|
|
135
|
-
var
|
|
136
|
-
for (n = 0; n <
|
|
137
|
-
|
|
76
|
+
var a = Object.getOwnPropertySymbols(t);
|
|
77
|
+
for (n = 0; n < a.length; n++)
|
|
78
|
+
e = a[n], !(r.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(t, e) && (o[e] = t[e]);
|
|
138
79
|
}
|
|
139
|
-
return
|
|
80
|
+
return o;
|
|
140
81
|
}
|
|
141
|
-
function
|
|
142
|
-
if (
|
|
143
|
-
var
|
|
144
|
-
for (
|
|
145
|
-
n =
|
|
146
|
-
return
|
|
82
|
+
function T(t, r) {
|
|
83
|
+
if (t == null) return {};
|
|
84
|
+
var o = {}, e = Object.keys(t), n, a;
|
|
85
|
+
for (a = 0; a < e.length; a++)
|
|
86
|
+
n = e[a], !(r.indexOf(n) >= 0) && (o[n] = t[n]);
|
|
87
|
+
return o;
|
|
147
88
|
}
|
|
148
|
-
var
|
|
149
|
-
var
|
|
150
|
-
return /* @__PURE__ */ l.createElement("svg",
|
|
151
|
-
ref:
|
|
89
|
+
var x = v(function(t, r) {
|
|
90
|
+
var o = t.color, e = o === void 0 ? "currentColor" : o, n = t.size, a = n === void 0 ? 24 : n, c = S(t, ["color", "size"]);
|
|
91
|
+
return /* @__PURE__ */ l.createElement("svg", g({
|
|
92
|
+
ref: r,
|
|
152
93
|
xmlns: "http://www.w3.org/2000/svg",
|
|
153
|
-
width:
|
|
154
|
-
height:
|
|
94
|
+
width: a,
|
|
95
|
+
height: a,
|
|
155
96
|
viewBox: "0 0 24 24",
|
|
156
97
|
fill: "none",
|
|
157
|
-
stroke:
|
|
98
|
+
stroke: e,
|
|
158
99
|
strokeWidth: "2",
|
|
159
100
|
strokeLinecap: "round",
|
|
160
101
|
strokeLinejoin: "round"
|
|
161
|
-
},
|
|
102
|
+
}, c), /* @__PURE__ */ l.createElement("path", {
|
|
162
103
|
d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"
|
|
163
104
|
}), /* @__PURE__ */ l.createElement("circle", {
|
|
164
105
|
cx: "12",
|
|
@@ -166,56 +107,86 @@ var g = p(function(e, o) {
|
|
|
166
107
|
r: "3"
|
|
167
108
|
}));
|
|
168
109
|
});
|
|
169
|
-
|
|
170
|
-
color:
|
|
171
|
-
size:
|
|
110
|
+
x.propTypes = {
|
|
111
|
+
color: i.string,
|
|
112
|
+
size: i.oneOfType([i.string, i.number])
|
|
172
113
|
};
|
|
173
|
-
|
|
174
|
-
const
|
|
114
|
+
x.displayName = "Eye";
|
|
115
|
+
const C = v(
|
|
175
116
|
({
|
|
176
|
-
className:
|
|
177
|
-
error:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
117
|
+
className: t,
|
|
118
|
+
error: r,
|
|
119
|
+
isRequired: o = !1,
|
|
120
|
+
isSearch: e = !1,
|
|
121
|
+
label: n,
|
|
122
|
+
labelClassName: a,
|
|
123
|
+
name: c,
|
|
124
|
+
theme: b,
|
|
125
|
+
type: p = "text",
|
|
126
|
+
helperText: w,
|
|
127
|
+
...j
|
|
128
|
+
}, N) => {
|
|
129
|
+
const O = k(), [u, E] = z(() => p !== "password"), f = typeof r == "string" && r.length >= 0, P = u ? x : y;
|
|
130
|
+
return /* @__PURE__ */ m("div", { className: "flex flex-col gap-2 w-full relative", "data-theme": b, children: [
|
|
131
|
+
n ? /* @__PURE__ */ m(
|
|
132
|
+
"label",
|
|
133
|
+
{
|
|
134
|
+
htmlFor: O,
|
|
135
|
+
className: d(
|
|
136
|
+
"cursor-pointer text-slate-500 flex gap-1 text-sm font-medium",
|
|
137
|
+
a
|
|
138
|
+
),
|
|
139
|
+
children: [
|
|
140
|
+
n,
|
|
141
|
+
" ",
|
|
142
|
+
o ? /* @__PURE__ */ s("span", { className: "text-red-600 text-xs mt-0.5", children: "*" }) : null
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
) : null,
|
|
146
|
+
/* @__PURE__ */ m("div", { className: "relative", children: [
|
|
147
|
+
e ? /* @__PURE__ */ s(
|
|
148
|
+
"i",
|
|
149
|
+
{
|
|
150
|
+
className: d(
|
|
151
|
+
"absolute left-2.5 top-1/2 -translate-y-[50%] text-slate-400",
|
|
152
|
+
f && "text-red-600"
|
|
153
|
+
),
|
|
154
|
+
children: /* @__PURE__ */ s(I, { className: "w-5 h-5" })
|
|
155
|
+
}
|
|
156
|
+
) : null,
|
|
157
|
+
/* @__PURE__ */ s(
|
|
190
158
|
"input",
|
|
191
159
|
{
|
|
192
|
-
id:
|
|
193
|
-
ref:
|
|
194
|
-
name:
|
|
195
|
-
type:
|
|
196
|
-
className:
|
|
197
|
-
|
|
198
|
-
className:
|
|
199
|
-
variant:
|
|
200
|
-
})
|
|
160
|
+
id: O,
|
|
161
|
+
ref: N,
|
|
162
|
+
name: c,
|
|
163
|
+
type: u ? p : "password",
|
|
164
|
+
className: d(
|
|
165
|
+
_({
|
|
166
|
+
className: t,
|
|
167
|
+
variant: f ? "error" : "default"
|
|
168
|
+
}),
|
|
169
|
+
(p === "password" || f) && "pr-10",
|
|
170
|
+
e && "pl-8"
|
|
201
171
|
),
|
|
202
|
-
...
|
|
172
|
+
...j
|
|
203
173
|
}
|
|
204
174
|
),
|
|
205
|
-
|
|
206
|
-
|
|
175
|
+
f ? /* @__PURE__ */ s("i", { className: "absolute right-3 text-red-600 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ s(W, { className: "w-5 h-5" }) }) : null,
|
|
176
|
+
p === "password" && !r ? /* @__PURE__ */ s("i", { className: "absolute right-3 text-slate-400 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ s(
|
|
207
177
|
P,
|
|
208
178
|
{
|
|
209
179
|
className: "w-5 h-5 cursor-pointer",
|
|
210
|
-
onClick: () =>
|
|
180
|
+
onClick: () => E(!u)
|
|
211
181
|
}
|
|
212
182
|
) }) : null
|
|
213
183
|
] }),
|
|
214
|
-
|
|
184
|
+
r ? /* @__PURE__ */ s("span", { className: "text-xs text-red-600", children: r }) : null,
|
|
185
|
+
!r && w ? /* @__PURE__ */ s("span", { className: "text-xs text-slate-600", children: w }) : null
|
|
215
186
|
] });
|
|
216
187
|
}
|
|
217
188
|
);
|
|
218
|
-
|
|
189
|
+
C.displayName = "Input";
|
|
219
190
|
export {
|
|
220
|
-
|
|
191
|
+
C as Input
|
|
221
192
|
};
|