@konstructio/ui 0.1.0-alpha.9 → 0.1.1-alpha.2
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/DatePicker.css +1 -1
- package/dist/{Modal-CrG0m703.js → Modal-0oht63vU.js} +32 -32
- 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 → chevron-down-CVce9Mvh.js} +2 -2
- package/dist/components/Alert/Alert.js +23 -25
- package/dist/components/Alert/Alert.variants.js +1 -1
- 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/AlertDialog/hooks/useAlertDialog.js +7 -7
- package/dist/components/Autocomplete/Autocomplete.variants.js +3 -4
- package/dist/components/Autocomplete/components/List/List.variants.js +3 -7
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +38 -43
- package/dist/components/Autocomplete/hooks/useNavigationList.js +29 -37
- package/dist/components/Badge/Badge.js +40 -42
- package/dist/components/Badge/Badge.variants.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -21
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +1 -1
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +15 -15
- package/dist/components/Button/Button.variants.js +10 -77
- package/dist/components/Card/Card.variants.js +3 -5
- package/dist/components/Checkbox/Checkbox.js +48 -47
- package/dist/components/Checkbox/Checkbox.variants.js +3 -4
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/Command.variants.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 +13 -13
- 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 +1496 -1577
- package/dist/components/Datepicker/DatePicker.variants.js +1 -1
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +28 -6
- package/dist/components/Dropdown/Dropdown.variants.js +43 -26
- package/dist/components/Dropdown/components/List/List.variants.js +1 -1
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +5 -5
- package/dist/components/Dropdown/components/Wrapper.js +96 -86
- package/dist/components/Dropdown/contexts/dropdown.provider.js +12 -12
- package/dist/components/Dropdown/hooks/useDropdown.js +26 -30
- package/dist/components/Dropdown/hooks/useNavigationList.js +25 -31
- package/dist/components/DropdownButton/DropdownButton.js +135 -0
- package/dist/components/Filter/Filter.variants.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +47 -49
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +41 -42
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +30 -30
- package/dist/components/Filter/components/ResetButton/ResetButton.js +22 -16
- package/dist/components/Input/Input.js +116 -109
- package/dist/components/Input/Input.variants.js +18 -5
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/Loading/Loading.variants.js +1 -2
- 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 +2 -2
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +7 -9
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/hooks/useModal.js +16 -17
- package/dist/components/NumberInput/NumberInput.js +91 -91
- package/dist/components/NumberInput/NumberInput.variants.js +1 -1
- package/dist/components/PieChart/PieChart.js +5138 -0
- package/dist/components/ProgressBar/ProgressBar.js +58 -26
- package/dist/components/ProgressBar/ProgressBar.variants.js +1 -1
- package/dist/components/Radio/Radio.js +64 -48
- package/dist/components/Radio/Radio.variants.js +3 -3
- package/dist/components/RadioCard/RadioCard.js +26 -23
- package/dist/components/RadioCard/RadioCard.variants.js +1 -1
- package/dist/components/RadioCardGroup/RadioCardGroup.js +28 -28
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +37 -37
- package/dist/components/RadioGroup/RadioGroup.variants.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Range/Range.variants.js +2 -3
- package/dist/components/Sidebar/Sidebar.js +4 -3
- package/dist/components/Sidebar/Sidebar.variants.js +1 -1
- package/dist/components/Sidebar/components/Footer/Footer.js +5 -4
- package/dist/components/Sidebar/components/Footer/Footer.variants.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +6 -5
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +1 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.js +5 -4
- package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +1 -1
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +14 -13
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +13 -12
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +1 -1
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +5 -6
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +1 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +9 -8
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +15 -14
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.variants.js +2 -8
- package/dist/components/Switch/Switch.js +54 -54
- package/dist/components/Switch/Switch.variants.js +2 -3
- package/dist/components/Table/Table.variants.js +1 -1
- package/dist/components/Tabs/Tabs.js +20 -16
- package/dist/components/Tabs/Tabs.variants.js +3 -5
- package/dist/components/Tabs/components/Content.js +10 -13
- package/dist/components/Tabs/components/List.js +9 -8
- package/dist/components/Tabs/components/Trigger.js +12 -16
- package/dist/components/Tabs/components/index.js +8 -0
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +1 -1
- package/dist/components/TagSelect/TagSelect.variants.js +1 -1
- package/dist/components/TagSelect/components/Item/Item.variants.js +1 -1
- package/dist/components/TagSelect/components/List/List.variants.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +14 -16
- package/dist/components/TextArea/TextArea.variants.js +4 -5
- package/dist/components/TimePicker/TimePicker.variants.js +6 -7
- package/dist/components/TimePicker/components/HoursList/HoursList.js +21 -26
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +19 -20
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +24 -25
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +33 -34
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +1 -1
- package/dist/components/Toast/Toast.js +223 -232
- package/dist/components/Toast/Toast.variants.js +8 -11
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/Tooltip.variants.js +7 -14
- package/dist/components/Tooltip/hooks/useTooltip.js +8 -9
- package/dist/components/Typography/Typography.js +26 -31
- package/dist/components/Typography/Typography.variants.js +1 -1
- package/dist/components/index.js +78 -66
- package/dist/contexts/theme.provider.js +28 -29
- package/dist/{createLucideIcon-ByJ0JZvK.js → createLucideIcon-BpsAkT97.js} +4 -4
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/{index-CvfCCTEO.js → index-BAraV3ai.js} +7 -7
- package/dist/index-BXuxPoz7.js +435 -0
- package/dist/index-BfXxHr_2.js +125 -0
- package/dist/index-C1g_chDT.js +70 -0
- package/dist/{index-BCGvACM9.js → index-C9T9HQaa.js} +1 -1
- package/dist/{index-Bc1LNrRD.js → index-CZnD2QxM.js} +1 -1
- package/dist/index-CrBonFvu.js +144 -0
- package/dist/{index-rUBNhTeF.js → index-Cvx4lqTq.js} +2 -2
- package/dist/{index-BNmRGtA6.js → index-D29mdTf5.js} +3 -3
- package/dist/{index-Dkt8F6CZ.js → index-D3xzCzcO.js} +12 -12
- package/dist/index-DB2XhXHn.js +431 -0
- package/dist/{index-B5MIi2tR.js → index-DQH6odE9.js} +2 -3
- package/dist/index-Oq5GlCHP.js +131 -0
- package/dist/{index-Cs8Lv8Wj.js → index-bwWKd82e.js} +1 -1
- package/dist/{index--EmNlyHx.js → index-iXyXtdgP.js} +1 -1
- package/dist/index.d.ts +157 -9
- package/dist/index.js +88 -76
- package/dist/package.json +41 -37
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +261 -241
- package/dist/ui/kubefirst-theme.css +4 -4
- package/dist/ui/theme.css +0 -2
- package/dist/{useBreadcrumb-DMERrNkJ.js → useBreadcrumb-B8DnuqkR.js} +254 -261
- package/dist/utils/index.js +25 -26
- package/package.json +41 -37
- package/dist/index-BNU3RH-3.js +0 -133
- package/dist/index-BvCZBMfr.js +0 -432
- package/dist/index-Cq1I1cG9.js +0 -129
- package/dist/index-DLYwlPRZ.js +0 -440
- package/dist/index-DNRcvRTB.js +0 -145
- package/dist/index-Dm-ooN_M.js +0 -71
- package/dist/index-DwYXX2sM.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { S as r } from "../../index-
|
|
2
|
+
import { S as r } from "../../index-DQH6odE9.js";
|
|
3
3
|
import { cn as o } from "../../utils/index.js";
|
|
4
4
|
import { tagVariants as c } from "./Tag.variants.js";
|
|
5
5
|
const u = ({
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { useTagSelect as
|
|
1
|
+
import { useRef as l, useEffect as c, useCallback as u } from "react";
|
|
2
|
+
import { useTagSelect as i } from "../contexts/TagSelect.hook.js";
|
|
3
3
|
const g = () => {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const t = new AbortController(),
|
|
7
|
-
|
|
8
|
-
}, o = (
|
|
9
|
-
|
|
10
|
-
(r = a.current) != null && r.contains(s.target) || e(!1);
|
|
4
|
+
const n = l(null), { onOpen: e } = i();
|
|
5
|
+
c(() => {
|
|
6
|
+
const t = new AbortController(), s = (a) => {
|
|
7
|
+
a.key === "Escape" && e(!1);
|
|
8
|
+
}, o = (a) => {
|
|
9
|
+
n.current?.contains(a.target) || e(!1);
|
|
11
10
|
};
|
|
12
|
-
return document.addEventListener("keydown",
|
|
11
|
+
return document.addEventListener("keydown", s, {
|
|
13
12
|
signal: t.signal
|
|
14
13
|
}), document.addEventListener("mousedown", o, {
|
|
15
14
|
signal: t.signal
|
|
16
15
|
}), () => {
|
|
17
16
|
t.abort();
|
|
18
17
|
};
|
|
19
|
-
}, [e,
|
|
20
|
-
const
|
|
18
|
+
}, [e, n]);
|
|
19
|
+
const r = u(
|
|
21
20
|
(t) => {
|
|
22
|
-
|
|
23
|
-
(n == null ? void 0 : n.closest("[data-value]")) || e(!0);
|
|
21
|
+
t.target?.closest("[data-value]") || e(!0);
|
|
24
22
|
},
|
|
25
23
|
[e]
|
|
26
24
|
);
|
|
27
25
|
return {
|
|
28
|
-
wrapperRef:
|
|
29
|
-
handleOpen:
|
|
26
|
+
wrapperRef: n,
|
|
27
|
+
handleOpen: r
|
|
30
28
|
};
|
|
31
29
|
};
|
|
32
30
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as r } from "../../index-
|
|
2
|
-
const
|
|
1
|
+
import { c as r } from "../../index-D29mdTf5.js";
|
|
2
|
+
const o = r([
|
|
3
3
|
"border",
|
|
4
4
|
"border-gray-200",
|
|
5
5
|
"disabled:cursor-not-allowed",
|
|
@@ -13,9 +13,8 @@ const e = r([
|
|
|
13
13
|
"rounded-md",
|
|
14
14
|
"shadow-xs",
|
|
15
15
|
"w-full",
|
|
16
|
-
"focus:ring-kubefirst-primary"
|
|
17
|
-
"colony:focus:ring-red-700"
|
|
16
|
+
"focus:ring-kubefirst-primary"
|
|
18
17
|
]);
|
|
19
18
|
export {
|
|
20
|
-
|
|
19
|
+
o as textAreaVariants
|
|
21
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as r } from "../../index-
|
|
1
|
+
import { c as r } from "../../index-D29mdTf5.js";
|
|
2
2
|
const t = r([
|
|
3
3
|
"border",
|
|
4
4
|
"rounded",
|
|
@@ -11,8 +11,7 @@ const t = r([
|
|
|
11
11
|
"cursor-pointer",
|
|
12
12
|
"transition-all",
|
|
13
13
|
"transition-duration-100",
|
|
14
|
-
"data-[open=true]:border-
|
|
15
|
-
"data-[open=true]:border-civo-primary",
|
|
14
|
+
"data-[open=true]:border-aurora-500",
|
|
16
15
|
"text-sm"
|
|
17
16
|
]), o = r([
|
|
18
17
|
"snap-y",
|
|
@@ -21,7 +20,7 @@ const t = r([
|
|
|
21
20
|
"scrollbar-none",
|
|
22
21
|
"flex",
|
|
23
22
|
"flex-col"
|
|
24
|
-
]),
|
|
23
|
+
]), n = r([
|
|
25
24
|
"w-[60px]",
|
|
26
25
|
"h-[40px]",
|
|
27
26
|
"snap-start",
|
|
@@ -41,7 +40,7 @@ const t = r([
|
|
|
41
40
|
"data-[active=true]:font-medium",
|
|
42
41
|
"focus-visible:border-blue-200",
|
|
43
42
|
"focus-within:border-blue-200"
|
|
44
|
-
]),
|
|
43
|
+
]), a = r([
|
|
45
44
|
"flex",
|
|
46
45
|
"items-center",
|
|
47
46
|
"justify-center",
|
|
@@ -55,8 +54,8 @@ const t = r([
|
|
|
55
54
|
"text-sm"
|
|
56
55
|
]);
|
|
57
56
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
a as buttonVariants,
|
|
58
|
+
n as liVariants,
|
|
60
59
|
t as timePickerVariants,
|
|
61
60
|
o as ulVariants
|
|
62
61
|
};
|
|
@@ -5,25 +5,20 @@ import { buttonVariants as b, liVariants as d, ulVariants as h } from "../../Tim
|
|
|
5
5
|
import { useTimePickerContext as k } from "../../contexts/time-picker.hook.js";
|
|
6
6
|
const H = ({ hours: l, scrollBehavior: i }) => {
|
|
7
7
|
const n = p(null), u = p(!0), { format: c, onSelectHour: m } = k(), s = c === "12" && l >= 12 ? l - 12 : l, f = v(
|
|
8
|
-
(r,
|
|
9
|
-
|
|
10
|
-
(t = r.currentTarget) == null || t.blur(), m(e);
|
|
8
|
+
(r, t) => {
|
|
9
|
+
r.currentTarget?.blur(), m(t);
|
|
11
10
|
},
|
|
12
11
|
[m]
|
|
13
12
|
);
|
|
14
13
|
if (y(() => {
|
|
15
14
|
if (u.current) {
|
|
16
|
-
const r = n.current,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
block: "center"
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
u.current = !1;
|
|
15
|
+
const r = n.current, t = s === 0 && c === "12" ? 12 : s;
|
|
16
|
+
r && r.querySelector(
|
|
17
|
+
`[data-value="${`0${t}`.slice(-2)}"]`
|
|
18
|
+
)?.scrollIntoView({
|
|
19
|
+
behavior: i,
|
|
20
|
+
block: "center"
|
|
21
|
+
}), u.current = !1;
|
|
27
22
|
}
|
|
28
23
|
}, [c, s, i]), c === "12") {
|
|
29
24
|
const r = s === 0 ? 12 : s;
|
|
@@ -34,12 +29,12 @@ const H = ({ hours: l, scrollBehavior: i }) => {
|
|
|
34
29
|
className: o(h()),
|
|
35
30
|
"aria-label": "hours",
|
|
36
31
|
role: "listbox",
|
|
37
|
-
children: Array.from({ length: 12 }, (
|
|
32
|
+
children: Array.from({ length: 12 }, (t, e) => /* @__PURE__ */ a(
|
|
38
33
|
"li",
|
|
39
34
|
{
|
|
40
35
|
className: o(d()),
|
|
41
|
-
"data-value": `0${
|
|
42
|
-
"data-active": r - 1 ===
|
|
36
|
+
"data-value": `0${e + 1}`.slice(-2),
|
|
37
|
+
"data-active": r - 1 === e,
|
|
43
38
|
role: "presentation",
|
|
44
39
|
children: /* @__PURE__ */ a(
|
|
45
40
|
"button",
|
|
@@ -47,12 +42,12 @@ const H = ({ hours: l, scrollBehavior: i }) => {
|
|
|
47
42
|
type: "button",
|
|
48
43
|
role: "option",
|
|
49
44
|
className: o(b()),
|
|
50
|
-
onClick: (N) => f(N,
|
|
51
|
-
children:
|
|
45
|
+
onClick: (N) => f(N, e + 1),
|
|
46
|
+
children: e + 1
|
|
52
47
|
}
|
|
53
48
|
)
|
|
54
49
|
},
|
|
55
|
-
|
|
50
|
+
e
|
|
56
51
|
))
|
|
57
52
|
}
|
|
58
53
|
);
|
|
@@ -64,12 +59,12 @@ const H = ({ hours: l, scrollBehavior: i }) => {
|
|
|
64
59
|
className: o(h()),
|
|
65
60
|
"aria-label": "hours",
|
|
66
61
|
role: "listbox",
|
|
67
|
-
children: Array.from({ length: 24 }, (r,
|
|
62
|
+
children: Array.from({ length: 24 }, (r, t) => /* @__PURE__ */ a(
|
|
68
63
|
"li",
|
|
69
64
|
{
|
|
70
65
|
className: o(d()),
|
|
71
|
-
"data-value": `0${
|
|
72
|
-
"data-active": l ===
|
|
66
|
+
"data-value": `0${t}`.slice(-2),
|
|
67
|
+
"data-active": l === t,
|
|
73
68
|
role: "presentation",
|
|
74
69
|
children: /* @__PURE__ */ a(
|
|
75
70
|
"button",
|
|
@@ -77,12 +72,12 @@ const H = ({ hours: l, scrollBehavior: i }) => {
|
|
|
77
72
|
type: "button",
|
|
78
73
|
role: "option",
|
|
79
74
|
className: o(b()),
|
|
80
|
-
onClick: (
|
|
81
|
-
children:
|
|
75
|
+
onClick: (e) => f(e, t),
|
|
76
|
+
children: t
|
|
82
77
|
}
|
|
83
78
|
)
|
|
84
79
|
},
|
|
85
|
-
|
|
80
|
+
t
|
|
86
81
|
))
|
|
87
82
|
}
|
|
88
83
|
);
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useCallback as
|
|
1
|
+
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as b } from "react";
|
|
3
3
|
import { cn as t } from "../../../../utils/index.js";
|
|
4
|
-
import { buttonVariants as
|
|
5
|
-
import { useTimePickerContext as
|
|
6
|
-
const
|
|
7
|
-
listClassName:
|
|
4
|
+
import { buttonVariants as n, liVariants as c } from "../../TimePicker.variants.js";
|
|
5
|
+
import { useTimePickerContext as N } from "../../contexts/time-picker.hook.js";
|
|
6
|
+
const x = ({
|
|
7
|
+
listClassName: s,
|
|
8
8
|
listItemClassName: a,
|
|
9
9
|
listItemButtonClassName: i
|
|
10
10
|
}) => {
|
|
11
|
-
const { format:
|
|
12
|
-
(e,
|
|
13
|
-
|
|
14
|
-
(n = e.currentTarget) == null || n.blur(), f();
|
|
11
|
+
const { format: m, isAM: l, onSelectAM: p, onSelectPM: u } = N(), o = b(
|
|
12
|
+
(e, d) => {
|
|
13
|
+
e.currentTarget?.blur(), d();
|
|
15
14
|
},
|
|
16
15
|
[]
|
|
17
16
|
);
|
|
18
|
-
return
|
|
17
|
+
return m === "24" ? null : /* @__PURE__ */ f(
|
|
19
18
|
"ul",
|
|
20
19
|
{
|
|
21
|
-
className: t("flex items-center justify-center flex-col",
|
|
20
|
+
className: t("flex items-center justify-center flex-col", s),
|
|
22
21
|
"aria-label": "meridian",
|
|
23
22
|
role: "listbox",
|
|
24
23
|
children: [
|
|
25
24
|
/* @__PURE__ */ r(
|
|
26
25
|
"li",
|
|
27
26
|
{
|
|
28
|
-
className: t(
|
|
27
|
+
className: t(c({ className: a })),
|
|
29
28
|
"data-active": l,
|
|
30
29
|
role: "presentation",
|
|
31
30
|
children: /* @__PURE__ */ r(
|
|
@@ -33,8 +32,8 @@ const M = ({
|
|
|
33
32
|
{
|
|
34
33
|
type: "button",
|
|
35
34
|
role: "option",
|
|
36
|
-
className: t(
|
|
37
|
-
onClick: (e) => o(e,
|
|
35
|
+
className: t(n({ className: i })),
|
|
36
|
+
onClick: (e) => o(e, p),
|
|
38
37
|
children: "AM"
|
|
39
38
|
}
|
|
40
39
|
)
|
|
@@ -43,7 +42,7 @@ const M = ({
|
|
|
43
42
|
/* @__PURE__ */ r(
|
|
44
43
|
"li",
|
|
45
44
|
{
|
|
46
|
-
className: t(
|
|
45
|
+
className: t(c({ className: a })),
|
|
47
46
|
"data-active": !l,
|
|
48
47
|
role: "presentation",
|
|
49
48
|
children: /* @__PURE__ */ r(
|
|
@@ -51,8 +50,8 @@ const M = ({
|
|
|
51
50
|
{
|
|
52
51
|
type: "button",
|
|
53
52
|
role: "option",
|
|
54
|
-
className: t(
|
|
55
|
-
onClick: (e) => o(e,
|
|
53
|
+
className: t(n({ className: i })),
|
|
54
|
+
onClick: (e) => o(e, u),
|
|
56
55
|
children: "PM"
|
|
57
56
|
}
|
|
58
57
|
)
|
|
@@ -62,7 +61,7 @@ const M = ({
|
|
|
62
61
|
}
|
|
63
62
|
);
|
|
64
63
|
};
|
|
65
|
-
|
|
64
|
+
x.displayName = "MeridianList";
|
|
66
65
|
export {
|
|
67
|
-
|
|
66
|
+
x as MeridianList
|
|
68
67
|
};
|
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as c, useEffect as p, useCallback as f } from "react";
|
|
3
|
+
import { cn as o } from "../../../../utils/index.js";
|
|
4
4
|
import { buttonVariants as b, liVariants as h, ulVariants as d } from "../../TimePicker.variants.js";
|
|
5
5
|
import { useTimePickerContext as k } from "../../contexts/time-picker.hook.js";
|
|
6
|
-
const y = ({ minutes:
|
|
7
|
-
const
|
|
6
|
+
const y = ({ minutes: n, scrollBehavior: a }) => {
|
|
7
|
+
const l = c(null), u = c(n), { onSelectMinute: s } = k();
|
|
8
8
|
p(() => {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const e = `0${u.current}`.slice(-2)
|
|
9
|
+
const t = l.current;
|
|
10
|
+
if (t) {
|
|
11
|
+
const e = `0${u.current}`.slice(-2);
|
|
12
|
+
t.querySelector(
|
|
12
13
|
`[data-value="${e}"]`
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
behavior: l,
|
|
14
|
+
)?.scrollIntoView({
|
|
15
|
+
behavior: a,
|
|
16
16
|
block: "center"
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
}, [
|
|
19
|
+
}, [a]);
|
|
20
20
|
const m = f(
|
|
21
|
-
(
|
|
22
|
-
|
|
23
|
-
c(r), (t = e.currentTarget) == null || t.blur();
|
|
21
|
+
(t, e) => {
|
|
22
|
+
s(t), e.currentTarget?.blur();
|
|
24
23
|
},
|
|
25
|
-
[
|
|
24
|
+
[s]
|
|
26
25
|
);
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ r(
|
|
28
27
|
"ul",
|
|
29
28
|
{
|
|
30
|
-
ref:
|
|
31
|
-
className:
|
|
29
|
+
ref: l,
|
|
30
|
+
className: o(d()),
|
|
32
31
|
"aria-label": "minutes",
|
|
33
32
|
role: "listbox",
|
|
34
|
-
children: Array.from({ length: 60 }, (
|
|
33
|
+
children: Array.from({ length: 60 }, (t, e) => /* @__PURE__ */ r(
|
|
35
34
|
"li",
|
|
36
35
|
{
|
|
37
|
-
className:
|
|
36
|
+
className: o(h()),
|
|
38
37
|
"data-value": `0${e}`.slice(-2),
|
|
39
|
-
"data-active":
|
|
38
|
+
"data-active": n === e,
|
|
40
39
|
role: "presentation",
|
|
41
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ r(
|
|
42
41
|
"button",
|
|
43
42
|
{
|
|
44
43
|
type: "button",
|
|
45
44
|
role: "option",
|
|
46
|
-
className:
|
|
47
|
-
onClick: (
|
|
45
|
+
className: o(b()),
|
|
46
|
+
onClick: (i) => m(e, i),
|
|
48
47
|
children: `0${e}`.slice(-2)
|
|
49
48
|
}
|
|
50
49
|
)
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { timePickerVariants as
|
|
5
|
-
import { WrapperList as
|
|
6
|
-
import { C as
|
|
7
|
-
import { useTimePickerContext as
|
|
8
|
-
const
|
|
9
|
-
name:
|
|
2
|
+
import { useId as N, useState as y, useRef as E, useCallback as O, useEffect as I } from "react";
|
|
3
|
+
import { cn as m } from "../../../../utils/index.js";
|
|
4
|
+
import { timePickerVariants as L } from "../../TimePicker.variants.js";
|
|
5
|
+
import { WrapperList as j } from "../WrapperList/WrapperList.js";
|
|
6
|
+
import { C as P } from "../../../../chevron-down-CVce9Mvh.js";
|
|
7
|
+
import { useTimePickerContext as R } from "../../contexts/time-picker.hook.js";
|
|
8
|
+
const V = ({
|
|
9
|
+
name: d,
|
|
10
10
|
label: i,
|
|
11
|
-
required:
|
|
12
|
-
scrollBehavior:
|
|
13
|
-
className:
|
|
14
|
-
listClassName:
|
|
15
|
-
listItemClassName:
|
|
16
|
-
listItemButtonClassName:
|
|
11
|
+
required: p,
|
|
12
|
+
scrollBehavior: f,
|
|
13
|
+
className: u,
|
|
14
|
+
listClassName: x,
|
|
15
|
+
listItemClassName: h,
|
|
16
|
+
listItemButtonClassName: w
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
const e = new AbortController(),
|
|
18
|
+
const b = N(), [n, r] = y(!1), l = E(null), { format: g, formattedTime: c } = R(), s = d ?? `time-${b}`, k = O(() => r((e) => !e), []);
|
|
19
|
+
return I(() => {
|
|
20
|
+
const e = new AbortController(), v = (o) => {
|
|
21
21
|
o.key === "Escape" && r(!1);
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
(m = l.current) != null && m.contains(o.target) || r(!1);
|
|
22
|
+
}, C = (o) => {
|
|
23
|
+
l.current?.contains(o.target) || r(!1);
|
|
25
24
|
};
|
|
26
|
-
return document.addEventListener("mousedown",
|
|
25
|
+
return document.addEventListener("mousedown", C, {
|
|
27
26
|
signal: e.signal
|
|
28
|
-
}), document.addEventListener("keydown",
|
|
27
|
+
}), document.addEventListener("keydown", v, {
|
|
29
28
|
signal: e.signal
|
|
30
29
|
}), () => {
|
|
31
30
|
e.abort();
|
|
@@ -34,15 +33,15 @@ const $ = ({
|
|
|
34
33
|
"div",
|
|
35
34
|
{
|
|
36
35
|
ref: l,
|
|
37
|
-
className:
|
|
36
|
+
className: m(
|
|
38
37
|
"w-max text-slate-800 text-sm flex flex-col gap-2",
|
|
39
|
-
|
|
38
|
+
g === "12" ? "w-[208px]" : "w-[140px]"
|
|
40
39
|
),
|
|
41
40
|
children: [
|
|
42
41
|
i ? /* @__PURE__ */ t("label", { htmlFor: s, className: "text-slate-500 font-medium", children: [
|
|
43
42
|
i,
|
|
44
43
|
" ",
|
|
45
|
-
|
|
44
|
+
p && /* @__PURE__ */ a("span", { className: "text-red-600", children: "*" })
|
|
46
45
|
] }) : null,
|
|
47
46
|
/* @__PURE__ */ t("div", { className: "relative", children: [
|
|
48
47
|
/* @__PURE__ */ t(
|
|
@@ -52,13 +51,13 @@ const $ = ({
|
|
|
52
51
|
"aria-haspopup": "listbox",
|
|
53
52
|
"aria-expanded": "true",
|
|
54
53
|
"aria-controls": "time-options",
|
|
55
|
-
className:
|
|
54
|
+
className: m(L({ className: u })),
|
|
56
55
|
"data-open": n,
|
|
57
|
-
onClick:
|
|
56
|
+
onClick: k,
|
|
58
57
|
children: [
|
|
59
58
|
c,
|
|
60
59
|
/* @__PURE__ */ a(
|
|
61
|
-
|
|
60
|
+
P,
|
|
62
61
|
{
|
|
63
62
|
className: "w-4 h-4 transition-all text-gray-400 data-[open=true]:rotate-180",
|
|
64
63
|
"data-open": n
|
|
@@ -68,13 +67,13 @@ const $ = ({
|
|
|
68
67
|
}
|
|
69
68
|
),
|
|
70
69
|
/* @__PURE__ */ a(
|
|
71
|
-
|
|
70
|
+
j,
|
|
72
71
|
{
|
|
73
72
|
isOpen: n,
|
|
74
|
-
scrollBehavior:
|
|
75
|
-
listClassName:
|
|
76
|
-
listItemClassName:
|
|
77
|
-
listItemButtonClassName:
|
|
73
|
+
scrollBehavior: f,
|
|
74
|
+
listClassName: x,
|
|
75
|
+
listItemClassName: h,
|
|
76
|
+
listItemButtonClassName: w
|
|
78
77
|
}
|
|
79
78
|
)
|
|
80
79
|
] }),
|
|
@@ -92,5 +91,5 @@ const $ = ({
|
|
|
92
91
|
);
|
|
93
92
|
};
|
|
94
93
|
export {
|
|
95
|
-
|
|
94
|
+
V as Wrapper
|
|
96
95
|
};
|