@konstructio/ui 0.1.0-alpha.6 → 0.1.0-alpha.8
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-Dyw3lLGQ.js → Combination-VYaRRJBZ.js} +82 -78
- package/dist/{Modal-CdsrVAoM.js → Modal-CrG0m703.js} +1 -1
- package/dist/chevron-down-UW8ts6wI.js +11 -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/Badge/Badge.js +2 -2
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +92 -87
- package/dist/components/Checkbox/Checkbox.variants.js +2 -2
- package/dist/components/Command/Command.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +279 -268
- 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 +82 -0
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +87 -0
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +77 -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 +8 -8
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +28 -34
- package/dist/components/index.js +66 -60
- package/dist/{createLucideIcon-vyksFS6P.js → createLucideIcon-ByJ0JZvK.js} +4 -4
- package/dist/{index-CI55pdPK.js → index-BNU3RH-3.js} +1 -1
- package/dist/{index-Cod3awtw.js → index-DLYwlPRZ.js} +1 -1
- package/dist/{index-Cj4IZ4ka.js → index-Dkt8F6CZ.js} +1 -1
- package/dist/index.d.ts +48 -4
- package/dist/index.js +74 -68
- package/dist/package.json +22 -25
- package/dist/styles.css +1 -1
- package/package.json +22 -25
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../../utils/index.js";
|
|
3
|
+
import { filterVariants as a } from "./Filter.variants.js";
|
|
4
|
+
import { BadgeMultiSelect as l } from "./components/BadgeDropdown/BadgeMultiSelect.js";
|
|
5
|
+
import { DateFilterDropdown as p } from "./components/DateFilterDropdown/DateFilterDropdown.js";
|
|
6
|
+
import { ResetButton as s } from "./components/ResetButton/ResetButton.js";
|
|
7
|
+
const t = ({
|
|
8
|
+
className: e,
|
|
9
|
+
theme: o = "civo",
|
|
10
|
+
children: r
|
|
11
|
+
}) => /* @__PURE__ */ i("div", { className: m(a({ className: e })), "data-theme": o, children: r });
|
|
12
|
+
t.displayName = "Filter";
|
|
13
|
+
t.BadgeMultiSelect = l;
|
|
14
|
+
t.DateFilterDropdown = p;
|
|
15
|
+
t.ResetButton = s;
|
|
16
|
+
export {
|
|
17
|
+
l as BadgeMultiSelect,
|
|
18
|
+
p as DateFilterDropdown,
|
|
19
|
+
t as Filter
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { c as t } from "../../index-BNmRGtA6.js";
|
|
2
|
+
const a = t(["flex", "gap-8", "items-center"]), n = t([
|
|
3
|
+
"flex",
|
|
4
|
+
"items-center",
|
|
5
|
+
"gap-1",
|
|
6
|
+
"text-slate-500",
|
|
7
|
+
"cursor-pointer",
|
|
8
|
+
"text-sm",
|
|
9
|
+
"w-max"
|
|
10
|
+
]), r = t([
|
|
11
|
+
"text-slate-400",
|
|
12
|
+
"h-[20px]",
|
|
13
|
+
"w-[20px]",
|
|
14
|
+
"transition-all",
|
|
15
|
+
"duration-150",
|
|
16
|
+
"ease-in-out"
|
|
17
|
+
]);
|
|
18
|
+
export {
|
|
19
|
+
r as filterButtonIconVariants,
|
|
20
|
+
n as filterButtonVariants,
|
|
21
|
+
a as filterVariants
|
|
22
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useId as C, useRef as S, useState as m, useEffect as f, useCallback as r, useMemo as w } from "react";
|
|
2
|
+
import { FilterEvent as E, sendOpenFilterEvent as L } from "../../events/index.js";
|
|
3
|
+
const I = ({
|
|
4
|
+
onApply: t
|
|
5
|
+
}) => {
|
|
6
|
+
const a = C(), c = S(null), [g, l] = m(!1), [n, d] = m([]);
|
|
7
|
+
f(() => {
|
|
8
|
+
const e = new AbortController();
|
|
9
|
+
return document.addEventListener(
|
|
10
|
+
E.OPEN,
|
|
11
|
+
(s) => {
|
|
12
|
+
s.detail !== a && l(!1);
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
signal: e.signal
|
|
16
|
+
}
|
|
17
|
+
), document.addEventListener(
|
|
18
|
+
E.RESET,
|
|
19
|
+
() => {
|
|
20
|
+
d([]), t == null || t([]);
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
signal: e.signal
|
|
24
|
+
}
|
|
25
|
+
), () => {
|
|
26
|
+
e.abort();
|
|
27
|
+
};
|
|
28
|
+
}, [a, t]);
|
|
29
|
+
const O = r(
|
|
30
|
+
() => l((e) => (e || (L(a), d(
|
|
31
|
+
(s) => s.filter((i) => i.isApplied)
|
|
32
|
+
)), !e)),
|
|
33
|
+
[a, l]
|
|
34
|
+
), o = r(() => l(!1), []), h = r(
|
|
35
|
+
(e, s) => {
|
|
36
|
+
d(s ? [
|
|
37
|
+
...n,
|
|
38
|
+
{ ...e, isApplied: !1 }
|
|
39
|
+
] : n.map((i) => i.id === e.id ? { ...i, isRemoved: !0 } : i));
|
|
40
|
+
},
|
|
41
|
+
[d, n]
|
|
42
|
+
), v = r(() => {
|
|
43
|
+
d([]), t == null || t([]);
|
|
44
|
+
}, [t]), R = r(() => {
|
|
45
|
+
d(
|
|
46
|
+
(e) => e == null ? void 0 : e.filter((s) => !s.isRemoved).map((s) => ({ ...s, isApplied: !0 }))
|
|
47
|
+
), t == null || t(
|
|
48
|
+
n.map(
|
|
49
|
+
({ isApplied: e, isRemoved: s, ...i }) => i
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}, [t, n, d]), b = w(
|
|
53
|
+
() => n.filter((e) => e.isApplied),
|
|
54
|
+
[n]
|
|
55
|
+
);
|
|
56
|
+
return f(() => {
|
|
57
|
+
const e = new AbortController(), s = (i) => {
|
|
58
|
+
var u;
|
|
59
|
+
(u = c.current) != null && u.contains(i.target) || o();
|
|
60
|
+
};
|
|
61
|
+
return document.addEventListener("mousedown", s, {
|
|
62
|
+
signal: e.signal
|
|
63
|
+
}), document.addEventListener(
|
|
64
|
+
"visibilitychange",
|
|
65
|
+
() => {
|
|
66
|
+
document.hidden && o();
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
signal: e.signal
|
|
70
|
+
}
|
|
71
|
+
), () => {
|
|
72
|
+
e.abort();
|
|
73
|
+
};
|
|
74
|
+
}, [o, c]), {
|
|
75
|
+
isOpen: g,
|
|
76
|
+
selectedCount: b,
|
|
77
|
+
selectedOptions: n,
|
|
78
|
+
wrapperRef: c,
|
|
79
|
+
handleApplyOptions: R,
|
|
80
|
+
handleOpen: O,
|
|
81
|
+
handleResetOptions: v,
|
|
82
|
+
handleSelectOption: h
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
I as useBadgeMultiSelect
|
|
87
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as c } from "../../../Badge/Badge.js";
|
|
3
|
+
import { Button as s } from "../../../Button/Button.js";
|
|
4
|
+
import { Checkbox as x } from "../../../Checkbox/Checkbox.js";
|
|
5
|
+
import { cn as o } from "../../../../utils/index.js";
|
|
6
|
+
import { filterButtonIconVariants as C, filterButtonVariants as y } from "../../Filter.variants.js";
|
|
7
|
+
import { useBadgeMultiSelect as N } from "./BadgeMultiSelect.hook.js";
|
|
8
|
+
import { C as B } from "../../../../chevron-down-UW8ts6wI.js";
|
|
9
|
+
const V = ({
|
|
10
|
+
options: n,
|
|
11
|
+
label: m,
|
|
12
|
+
onApply: p
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
wrapperRef: f,
|
|
16
|
+
isOpen: l,
|
|
17
|
+
selectedOptions: h,
|
|
18
|
+
selectedCount: i,
|
|
19
|
+
handleOpen: u,
|
|
20
|
+
handleResetOptions: g,
|
|
21
|
+
handleApplyOptions: b,
|
|
22
|
+
handleSelectOption: v
|
|
23
|
+
} = N({ onApply: p });
|
|
24
|
+
return n.length === 0 ? null : /* @__PURE__ */ t("div", { ref: f, className: "relative", children: [
|
|
25
|
+
/* @__PURE__ */ t(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
className: o(y(), {
|
|
29
|
+
"text-slate-700": l
|
|
30
|
+
}),
|
|
31
|
+
onClick: u,
|
|
32
|
+
children: [
|
|
33
|
+
m,
|
|
34
|
+
i.length > 0 && /* @__PURE__ */ e(c, { label: i.length.toString() }),
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
B,
|
|
37
|
+
{
|
|
38
|
+
className: o(C(), {
|
|
39
|
+
"rotate-180": l,
|
|
40
|
+
"text-blue-600": l
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
l && /* @__PURE__ */ t("div", { className: "absolute top-full mt-1 left-0 bg-white rounded-md shadow-md animate-in fade-in-0 z-10 border border-gray-200", children: [
|
|
48
|
+
/* @__PURE__ */ e("div", { className: "py-4", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: n.map((a) => {
|
|
49
|
+
const d = !!h.find(
|
|
50
|
+
(r) => r.id === a.id
|
|
51
|
+
);
|
|
52
|
+
return /* @__PURE__ */ t("div", { className: "flex gap-4 px-6", children: [
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
x,
|
|
55
|
+
{
|
|
56
|
+
defaultChecked: d,
|
|
57
|
+
"data-label": a.id,
|
|
58
|
+
onChange: (r) => v(a, r)
|
|
59
|
+
},
|
|
60
|
+
`${a.id}-${d}`
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(c, { label: a.label, variant: a.variant })
|
|
63
|
+
] }, a.id);
|
|
64
|
+
}) }) }),
|
|
65
|
+
/* @__PURE__ */ t("div", { className: "flex justify-center items-center gap-4 py-4 border-t border-gray-200", children: [
|
|
66
|
+
/* @__PURE__ */ e(
|
|
67
|
+
s,
|
|
68
|
+
{
|
|
69
|
+
variant: "secondary",
|
|
70
|
+
appearance: "compact",
|
|
71
|
+
onClick: g,
|
|
72
|
+
children: "Reset"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ e(s, { appearance: "compact", onClick: b, children: "Apply" })
|
|
76
|
+
] })
|
|
77
|
+
] })
|
|
78
|
+
] });
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
V as BadgeMultiSelect
|
|
82
|
+
};
|
|
@@ -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,77 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as u } from "../../../Badge/Badge.js";
|
|
3
|
+
import { Button as n } from "../../../Button/Button.js";
|
|
4
|
+
import { DatePicker as w } from "../../../Datepicker/DatePicker.js";
|
|
5
|
+
import { cn as l } 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 g } from "../../../../chevron-down-UW8ts6wI.js";
|
|
9
|
+
const O = ({
|
|
10
|
+
label: i,
|
|
11
|
+
onApply: p
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
id: s,
|
|
15
|
+
appliedDay: o,
|
|
16
|
+
isOpen: a,
|
|
17
|
+
selectedDay: e,
|
|
18
|
+
wrapperRef: m,
|
|
19
|
+
handleApply: c,
|
|
20
|
+
handleOpen: d,
|
|
21
|
+
handleSelect: f,
|
|
22
|
+
handleReset: h
|
|
23
|
+
} = b({ onApply: p });
|
|
24
|
+
return /* @__PURE__ */ r("div", { ref: m, className: "relative", children: [
|
|
25
|
+
/* @__PURE__ */ r(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
className: l(N(), {
|
|
29
|
+
"text-slate-700": a
|
|
30
|
+
}),
|
|
31
|
+
onClick: d,
|
|
32
|
+
children: [
|
|
33
|
+
i,
|
|
34
|
+
o && /* @__PURE__ */ t(u, { label: o }),
|
|
35
|
+
/* @__PURE__ */ t(
|
|
36
|
+
g,
|
|
37
|
+
{
|
|
38
|
+
className: l(x(), {
|
|
39
|
+
"rotate-180": a,
|
|
40
|
+
"text-blue-600": a
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
a && /* @__PURE__ */ r("div", { className: "absolute top-full mt-1 left-0 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", children: [
|
|
48
|
+
/* @__PURE__ */ t(
|
|
49
|
+
w,
|
|
50
|
+
{
|
|
51
|
+
className: "p-0",
|
|
52
|
+
arrowClassName: "-top-1 right-0",
|
|
53
|
+
monthsClassName: "shadow-none p-0 w-auto",
|
|
54
|
+
defaultSelected: e,
|
|
55
|
+
defaultMonth: e,
|
|
56
|
+
onSelect: f
|
|
57
|
+
},
|
|
58
|
+
(e == null ? void 0 : e.toISOString()) ?? s
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ r("div", { className: "flex justify-end items-center gap-4 py-2", children: [
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
n,
|
|
63
|
+
{
|
|
64
|
+
variant: "secondary",
|
|
65
|
+
appearance: "compact",
|
|
66
|
+
onClick: h,
|
|
67
|
+
children: "Reset"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ t(n, { appearance: "compact", onClick: c, children: "Apply" })
|
|
71
|
+
] })
|
|
72
|
+
] })
|
|
73
|
+
] });
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
O as DateFilterDropdown
|
|
77
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -120,11 +120,11 @@ const V = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200
|
|
|
120
120
|
labelClassName: i,
|
|
121
121
|
name: c,
|
|
122
122
|
theme: b,
|
|
123
|
-
type:
|
|
123
|
+
type: p = "text",
|
|
124
124
|
helperText: y,
|
|
125
125
|
...C
|
|
126
126
|
}, j) => {
|
|
127
|
-
const O = E(), [u, N] = _(() =>
|
|
127
|
+
const O = E(), [u, N] = _(() => p !== "password"), f = typeof r == "string" && r.length >= 0, P = u ? x : w;
|
|
128
128
|
return /* @__PURE__ */ h("div", { className: "flex flex-col gap-2 w-full relative", "data-theme": b, children: [
|
|
129
129
|
n ? /* @__PURE__ */ h(
|
|
130
130
|
"label",
|
|
@@ -147,7 +147,7 @@ const V = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200
|
|
|
147
147
|
{
|
|
148
148
|
className: d(
|
|
149
149
|
"absolute left-2.5 top-1/2 -translate-y-[50%] text-slate-400",
|
|
150
|
-
|
|
150
|
+
f && "text-red-600"
|
|
151
151
|
),
|
|
152
152
|
children: /* @__PURE__ */ l(V, { className: "w-5 h-5" })
|
|
153
153
|
}
|
|
@@ -158,20 +158,20 @@ const V = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200
|
|
|
158
158
|
id: O,
|
|
159
159
|
ref: j,
|
|
160
160
|
name: c,
|
|
161
|
-
type: u ?
|
|
161
|
+
type: u ? p : "password",
|
|
162
162
|
className: d(
|
|
163
163
|
k({
|
|
164
164
|
className: e,
|
|
165
|
-
variant:
|
|
165
|
+
variant: f ? "error" : "default"
|
|
166
166
|
}),
|
|
167
|
-
(
|
|
167
|
+
(p === "password" || f) && "pr-10",
|
|
168
168
|
t && "pl-8"
|
|
169
169
|
),
|
|
170
170
|
...C
|
|
171
171
|
}
|
|
172
172
|
),
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
f ? /* @__PURE__ */ l("i", { className: "absolute right-3 text-red-600 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ l(W, { className: "w-5 h-5" }) }) : null,
|
|
174
|
+
p === "password" && !r ? /* @__PURE__ */ l("i", { className: "absolute right-3 text-slate-400 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ l(
|
|
175
175
|
P,
|
|
176
176
|
{
|
|
177
177
|
className: "w-5 h-5 cursor-pointer",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cn as c } from "../../utils/index.js";
|
|
3
3
|
import { loadingVariants as i } from "./Loading.variants.js";
|
|
4
|
-
import { c as t } from "../../createLucideIcon-
|
|
4
|
+
import { c as t } from "../../createLucideIcon-ByJ0JZvK.js";
|
|
5
5
|
/**
|
|
6
|
-
* @license lucide-react v0.
|
|
6
|
+
* @license lucide-react v0.513.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../index-BCGvACM9.js";
|
|
4
|
-
import { M as d } from "../../Modal-
|
|
4
|
+
import { M as d } from "../../Modal-CrG0m703.js";
|
|
5
5
|
import "./components/Header/Header.js";
|
|
6
6
|
import "./components/Body/Body.js";
|
|
7
7
|
import "./components/Footer/Footer.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../../../index--EmNlyHx.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import "../../../../Combination-
|
|
5
|
-
import { W as f } from "../../../../Modal-
|
|
4
|
+
import "../../../../Combination-VYaRRJBZ.js";
|
|
5
|
+
import { W as f } from "../../../../Modal-CrG0m703.js";
|
|
6
6
|
import "../../../../utils/index.js";
|
|
7
7
|
import "./Wrapper.variants.js";
|
|
8
8
|
import "../../../../x-BPcqkRZd.js";
|
|
@@ -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-CrG0m703.js";
|
|
5
5
|
export {
|
|
6
6
|
e as Body,
|
|
7
7
|
t as Footer,
|
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import { cn as
|
|
2
|
+
import { useId as y, useState as E, useRef as O, useCallback as I, useEffect as L } from "react";
|
|
3
|
+
import { cn as d } from "../../../../utils/index.js";
|
|
4
4
|
import { timePickerVariants as j } from "../../TimePicker.variants.js";
|
|
5
5
|
import { WrapperList as P } from "../WrapperList/WrapperList.js";
|
|
6
|
-
import {
|
|
6
|
+
import { C as R } from "../../../../chevron-down-UW8ts6wI.js";
|
|
7
7
|
import { useTimePickerContext as T } from "../../contexts/time-picker.hook.js";
|
|
8
|
-
|
|
9
|
-
* @license lucide-react v0.511.0 - ISC
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the ISC license.
|
|
12
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/
|
|
14
|
-
const W = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], _ = R("chevron-down", W), $ = ({
|
|
8
|
+
const $ = ({
|
|
15
9
|
name: p,
|
|
16
10
|
label: i,
|
|
17
|
-
required:
|
|
18
|
-
scrollBehavior:
|
|
19
|
-
className:
|
|
20
|
-
listClassName:
|
|
11
|
+
required: f,
|
|
12
|
+
scrollBehavior: u,
|
|
13
|
+
className: x,
|
|
14
|
+
listClassName: h,
|
|
21
15
|
listItemClassName: w,
|
|
22
16
|
listItemButtonClassName: b
|
|
23
17
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
const e = new AbortController(),
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
var
|
|
30
|
-
(
|
|
18
|
+
const g = y(), [n, r] = E(!1), l = O(null), { format: k, formattedTime: c } = T(), s = p ?? `time-${g}`, v = I(() => r((e) => !e), []);
|
|
19
|
+
return L(() => {
|
|
20
|
+
const e = new AbortController(), C = (o) => {
|
|
21
|
+
o.key === "Escape" && r(!1);
|
|
22
|
+
}, N = (o) => {
|
|
23
|
+
var m;
|
|
24
|
+
(m = l.current) != null && m.contains(o.target) || r(!1);
|
|
31
25
|
};
|
|
32
|
-
return document.addEventListener("mousedown",
|
|
26
|
+
return document.addEventListener("mousedown", N, {
|
|
33
27
|
signal: e.signal
|
|
34
|
-
}), document.addEventListener("keydown",
|
|
28
|
+
}), document.addEventListener("keydown", C, {
|
|
35
29
|
signal: e.signal
|
|
36
30
|
}), () => {
|
|
37
31
|
e.abort();
|
|
@@ -40,31 +34,31 @@ const W = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], _ = R("chevron-down"
|
|
|
40
34
|
"div",
|
|
41
35
|
{
|
|
42
36
|
ref: l,
|
|
43
|
-
className:
|
|
37
|
+
className: d(
|
|
44
38
|
"w-max text-slate-800 text-sm flex flex-col gap-2",
|
|
45
|
-
|
|
39
|
+
k === "12" ? "w-[208px]" : "w-[140px]"
|
|
46
40
|
),
|
|
47
41
|
children: [
|
|
48
|
-
i ? /* @__PURE__ */ t("label", { htmlFor:
|
|
42
|
+
i ? /* @__PURE__ */ t("label", { htmlFor: s, className: "text-slate-500 font-medium", children: [
|
|
49
43
|
i,
|
|
50
44
|
" ",
|
|
51
|
-
|
|
45
|
+
f && /* @__PURE__ */ a("span", { className: "text-red-600", children: "*" })
|
|
52
46
|
] }) : null,
|
|
53
47
|
/* @__PURE__ */ t("div", { className: "relative", children: [
|
|
54
48
|
/* @__PURE__ */ t(
|
|
55
49
|
"button",
|
|
56
50
|
{
|
|
57
|
-
"aria-label":
|
|
51
|
+
"aria-label": s,
|
|
58
52
|
"aria-haspopup": "listbox",
|
|
59
53
|
"aria-expanded": "true",
|
|
60
54
|
"aria-controls": "time-options",
|
|
61
|
-
className:
|
|
55
|
+
className: d(j({ className: x })),
|
|
62
56
|
"data-open": n,
|
|
63
|
-
onClick:
|
|
57
|
+
onClick: v,
|
|
64
58
|
children: [
|
|
65
59
|
c,
|
|
66
60
|
/* @__PURE__ */ a(
|
|
67
|
-
|
|
61
|
+
R,
|
|
68
62
|
{
|
|
69
63
|
className: "w-4 h-4 transition-all text-gray-400 data-[open=true]:rotate-180",
|
|
70
64
|
"data-open": n
|
|
@@ -77,8 +71,8 @@ const W = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], _ = R("chevron-down"
|
|
|
77
71
|
P,
|
|
78
72
|
{
|
|
79
73
|
isOpen: n,
|
|
80
|
-
scrollBehavior:
|
|
81
|
-
listClassName:
|
|
74
|
+
scrollBehavior: u,
|
|
75
|
+
listClassName: h,
|
|
82
76
|
listItemClassName: w,
|
|
83
77
|
listItemButtonClassName: b
|
|
84
78
|
}
|
|
@@ -88,7 +82,7 @@ const W = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], _ = R("chevron-down"
|
|
|
88
82
|
"input",
|
|
89
83
|
{
|
|
90
84
|
type: "hidden",
|
|
91
|
-
name:
|
|
85
|
+
name: s,
|
|
92
86
|
value: c,
|
|
93
87
|
className: "hidden"
|
|
94
88
|
}
|