@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.51
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-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-CjC-CIJ8.js +99 -0
- package/dist/assets/icons/index.js +7 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/chevron-up-DEfvgPCw.js +54 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +81 -53
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +41 -44
- package/dist/components/Badge/Badge.variants.js +52 -13
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Card/Card.variants.js +7 -12
- package/dist/components/Checkbox/Checkbox.js +108 -105
- package/dist/components/Checkbox/Checkbox.variants.js +34 -7
- 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/Counter/Counter.js +210 -0
- package/dist/components/Counter/Counter.variants.js +70 -0
- package/dist/components/Datepicker/DatePicker.js +1587 -1353
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/Filter.variants.js +8 -7
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +221 -0
- package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +24 -19
- package/dist/components/Loading/Loading.js +1 -7
- 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/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +463 -482
- package/dist/components/Radio/Radio.js +47 -44
- package/dist/components/Radio/Radio.variants.js +12 -8
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +10 -10
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
- package/dist/components/Select/components/List/List.js +172 -0
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
- package/dist/components/Select/components/ListItem/ListItem.js +117 -0
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
- package/dist/components/Select/components/Wrapper.js +226 -0
- package/dist/components/Select/constants/index.js +4 -0
- package/dist/components/Select/constants/pagination.js +4 -0
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/Select/contexts/select.context.js +36 -0
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/Select/hooks/useNavigationList.js +50 -0
- package/dist/components/Select/hooks/useSelect.js +103 -0
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +156 -129
- package/dist/components/Switch/Switch.variants.js +19 -10
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +4 -3
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +26 -14
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
- package/dist/components/Toast/Toast.js +283 -256
- package/dist/components/Toast/Toast.variants.js +37 -24
- package/dist/components/Tooltip/Tooltip.js +15 -14
- package/dist/components/Tooltip/Tooltip.variants.js +5 -4
- package/dist/components/Typography/Typography.js +23 -25
- package/dist/components/Typography/Typography.variants.js +55 -52
- package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
- package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +8 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +68 -761
- package/dist/components/index.js +94 -86
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
- package/dist/index-BG8O18ZY.js +93 -0
- package/dist/index-BKjcReYh.js +55 -0
- package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
- package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
- package/dist/index-BmVmDQGH.js +662 -0
- package/dist/index-BvoZGpli.js +60 -0
- package/dist/index-Byr10W8m.js +1873 -0
- package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
- package/dist/index-CeZcoQDw.js +479 -0
- package/dist/index-D6KzX_ef.js +135 -0
- package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
- package/dist/index-DKfEnhKr.js +200 -0
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
- package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
- package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
- package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
- package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
- package/dist/index.d.ts +2142 -99
- package/dist/index.js +116 -106
- package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +43 -33
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +194 -168
- package/dist/ui/theme.css +27 -0
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/x-BXShoIAM.js +8 -0
- package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
- package/package.json +43 -33
- package/dist/Modal-D-NOEWMX.js +0 -98
- package/dist/chevron-down-MZvQoT2F.js +0 -11
- package/dist/chevron-right-VYBOBhRt.js +0 -19
- package/dist/components/Dropdown/Dropdown.js +0 -42
- package/dist/components/Dropdown/components/List/List.js +0 -79
- package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
- package/dist/components/Dropdown/components/Wrapper.js +0 -205
- package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
- package/dist/components/Dropdown/contexts/index.js +0 -6
- package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
- package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
- package/dist/components/NumberInput/NumberInput.js +0 -179
- package/dist/components/NumberInput/NumberInput.variants.js +0 -50
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
- package/dist/index-BITvcJAz.js +0 -423
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DBbEcSUG.js +0 -31
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-DzIBBMjs.js +0 -436
- package/dist/index-os7vysFS.js +0 -131
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
|
@@ -1,135 +1,86 @@
|
|
|
1
1
|
import "../Item/Item.js";
|
|
2
|
-
import { List as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import
|
|
5
|
-
import { Tag as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { useTagSelect as
|
|
8
|
-
import { labelVariants as
|
|
9
|
-
import { X as
|
|
10
|
-
import {
|
|
11
|
-
import { useTagSelect as
|
|
12
|
-
|
|
13
|
-
return u = Object.assign || function(e) {
|
|
14
|
-
for (var o = 1; o < arguments.length; o++) {
|
|
15
|
-
var t = arguments[o];
|
|
16
|
-
for (var r in t)
|
|
17
|
-
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
18
|
-
}
|
|
19
|
-
return e;
|
|
20
|
-
}, u.apply(this, arguments);
|
|
21
|
-
}
|
|
22
|
-
function L(e, o) {
|
|
23
|
-
if (e == null) return {};
|
|
24
|
-
var t = W(e, o), r, n;
|
|
25
|
-
if (Object.getOwnPropertySymbols) {
|
|
26
|
-
var a = Object.getOwnPropertySymbols(e);
|
|
27
|
-
for (n = 0; n < a.length; n++)
|
|
28
|
-
r = a[n], !(o.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
}
|
|
32
|
-
function W(e, o) {
|
|
33
|
-
if (e == null) return {};
|
|
34
|
-
var t = {}, r = Object.keys(e), n, a;
|
|
35
|
-
for (a = 0; a < r.length; a++)
|
|
36
|
-
n = r[a], !(o.indexOf(n) >= 0) && (t[n] = e[n]);
|
|
37
|
-
return t;
|
|
38
|
-
}
|
|
39
|
-
var d = w(function(e, o) {
|
|
40
|
-
var t = e.color, r = t === void 0 ? "currentColor" : t, n = e.size, a = n === void 0 ? 24 : n, c = L(e, ["color", "size"]);
|
|
41
|
-
return /* @__PURE__ */ b.createElement("svg", u({
|
|
42
|
-
ref: o,
|
|
43
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
-
width: a,
|
|
45
|
-
height: a,
|
|
46
|
-
viewBox: "0 0 24 24",
|
|
47
|
-
fill: "none",
|
|
48
|
-
stroke: r,
|
|
49
|
-
strokeWidth: "2",
|
|
50
|
-
strokeLinecap: "round",
|
|
51
|
-
strokeLinejoin: "round"
|
|
52
|
-
}, c), /* @__PURE__ */ b.createElement("polyline", {
|
|
53
|
-
points: "18 15 12 9 6 15"
|
|
54
|
-
}));
|
|
55
|
-
});
|
|
56
|
-
d.propTypes = {
|
|
57
|
-
color: p.string,
|
|
58
|
-
size: p.oneOfType([p.string, p.number])
|
|
59
|
-
};
|
|
60
|
-
d.displayName = "ChevronUp";
|
|
61
|
-
const G = w(
|
|
2
|
+
import { List as g } from "../List/List.js";
|
|
3
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef as w, useId as T, useImperativeHandle as b } from "react";
|
|
5
|
+
import { Tag as C } from "../../../Tag/Tag.js";
|
|
6
|
+
import { cn as r } from "../../../../utils/index.js";
|
|
7
|
+
import { useTagSelect as S } from "../../hooks/useTagSelect.js";
|
|
8
|
+
import { labelVariants as k, tagSelectVariants as R, wrapperVariants as I } from "../../TagSelect.variants.js";
|
|
9
|
+
import { X as O } from "../../../../x-Eoa9FJjA.js";
|
|
10
|
+
import { C as V } from "../../../../chevron-up-DEfvgPCw.js";
|
|
11
|
+
import { useTagSelect as j } from "../../contexts/TagSelect.hook.js";
|
|
12
|
+
const B = w(
|
|
62
13
|
({
|
|
63
|
-
label:
|
|
64
|
-
labelClassName:
|
|
14
|
+
label: o,
|
|
15
|
+
labelClassName: c,
|
|
65
16
|
name: t,
|
|
66
|
-
placeholder:
|
|
67
|
-
theme:
|
|
68
|
-
wrapperClassName:
|
|
69
|
-
},
|
|
70
|
-
const
|
|
71
|
-
return
|
|
17
|
+
placeholder: p = "Select a value...",
|
|
18
|
+
theme: d,
|
|
19
|
+
wrapperClassName: f
|
|
20
|
+
}, h) => {
|
|
21
|
+
const i = T(), { selectedTags: n, isOpen: s, onOpen: u, onRemoveTag: x, inputRef: l } = j(), { wrapperRef: N, handleOpen: v } = S();
|
|
22
|
+
return b(h, () => l.current, [l]), /* @__PURE__ */ m(
|
|
72
23
|
"div",
|
|
73
24
|
{
|
|
74
|
-
ref:
|
|
75
|
-
className:
|
|
76
|
-
|
|
77
|
-
className:
|
|
25
|
+
ref: N,
|
|
26
|
+
className: r(
|
|
27
|
+
I({
|
|
28
|
+
className: f
|
|
78
29
|
})
|
|
79
30
|
),
|
|
80
|
-
"data-theme":
|
|
31
|
+
"data-theme": d,
|
|
81
32
|
children: [
|
|
82
|
-
|
|
33
|
+
o ? /* @__PURE__ */ e(
|
|
83
34
|
"label",
|
|
84
35
|
{
|
|
85
|
-
htmlFor: t ??
|
|
86
|
-
className:
|
|
87
|
-
|
|
88
|
-
className:
|
|
36
|
+
htmlFor: t ?? i,
|
|
37
|
+
className: r(
|
|
38
|
+
k({
|
|
39
|
+
className: c
|
|
89
40
|
})
|
|
90
41
|
),
|
|
91
|
-
onClick: () =>
|
|
92
|
-
children:
|
|
42
|
+
onClick: () => u(!0),
|
|
43
|
+
children: o
|
|
93
44
|
}
|
|
94
45
|
) : null,
|
|
95
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ m(
|
|
96
47
|
"div",
|
|
97
48
|
{
|
|
98
|
-
id: t ??
|
|
99
|
-
className:
|
|
49
|
+
id: t ?? i,
|
|
50
|
+
className: r(R()),
|
|
100
51
|
role: "combobox",
|
|
101
|
-
onClick:
|
|
102
|
-
"aria-expanded":
|
|
52
|
+
onClick: v,
|
|
53
|
+
"aria-expanded": s,
|
|
103
54
|
children: [
|
|
104
|
-
|
|
105
|
-
|
|
55
|
+
n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: p }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: n.map((a) => /* @__PURE__ */ e(
|
|
56
|
+
C,
|
|
106
57
|
{
|
|
107
|
-
...
|
|
58
|
+
...a,
|
|
108
59
|
className: "select-none",
|
|
109
|
-
rightIcon: /* @__PURE__ */
|
|
110
|
-
"data-value":
|
|
60
|
+
rightIcon: /* @__PURE__ */ e(O, { className: "w-3 h-3", onClick: () => x(a) }),
|
|
61
|
+
"data-value": a.label
|
|
111
62
|
},
|
|
112
|
-
|
|
63
|
+
a.id
|
|
113
64
|
)) }),
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
V,
|
|
116
67
|
{
|
|
117
|
-
className:
|
|
68
|
+
className: r(
|
|
118
69
|
"w-4 h-4 text-inherit transition-all duration-50 shrink-0",
|
|
119
|
-
|
|
70
|
+
s ? "rotate-0" : "rotate-180"
|
|
120
71
|
)
|
|
121
72
|
}
|
|
122
73
|
)
|
|
123
74
|
]
|
|
124
75
|
}
|
|
125
76
|
),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
77
|
+
/* @__PURE__ */ e("input", { ref: l, type: "text", name: t, className: "hidden" }),
|
|
78
|
+
s ? /* @__PURE__ */ e(g, {}) : null
|
|
128
79
|
]
|
|
129
80
|
}
|
|
130
81
|
);
|
|
131
82
|
}
|
|
132
83
|
);
|
|
133
84
|
export {
|
|
134
|
-
|
|
85
|
+
B as Wrapper
|
|
135
86
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { TimePickerProvider as m } from "./contexts/time-picker.provider.js";
|
|
3
3
|
import { Wrapper as o } from "./components/Wrapper/Wrapper.js";
|
|
4
4
|
const p = ({ format: i = "12", ...e }) => /* @__PURE__ */ r(m, { format: i, children: /* @__PURE__ */ r(o, { ...e }) });
|
|
5
|
-
p.displayName = "
|
|
5
|
+
p.displayName = "KonstructTimePicker";
|
|
6
6
|
export {
|
|
7
7
|
p as TimePicker
|
|
8
8
|
};
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
import { c as r } from "../../index-D29mdTf5.js";
|
|
2
|
-
const
|
|
2
|
+
const e = r([
|
|
3
3
|
"border",
|
|
4
4
|
"rounded",
|
|
5
|
-
"p-
|
|
5
|
+
"p-2.5",
|
|
6
6
|
"w-full",
|
|
7
7
|
"flex",
|
|
8
8
|
"items-center",
|
|
9
9
|
"justify-between",
|
|
10
|
+
"bg-white",
|
|
10
11
|
"border-gray-300",
|
|
12
|
+
"dark:border-metal-700",
|
|
13
|
+
"dark:bg-metal-800",
|
|
11
14
|
"cursor-pointer",
|
|
12
15
|
"transition-all",
|
|
13
16
|
"transition-duration-100",
|
|
14
17
|
"data-[open=true]:border-aurora-500",
|
|
15
|
-
"text-sm"
|
|
16
|
-
|
|
18
|
+
"text-sm",
|
|
19
|
+
"text-slate-800",
|
|
20
|
+
"dark:text-slate-50"
|
|
21
|
+
]), a = r([
|
|
17
22
|
"snap-y",
|
|
18
23
|
"snap-mandatory",
|
|
19
24
|
"overflow-y-scroll",
|
|
20
25
|
"scrollbar-none",
|
|
21
26
|
"flex",
|
|
22
|
-
"flex-col"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
27
|
+
"flex-col",
|
|
28
|
+
"dark:text-metal-50"
|
|
29
|
+
]), o = r([
|
|
30
|
+
"w-15",
|
|
31
|
+
"h-10",
|
|
26
32
|
"snap-start",
|
|
27
33
|
"rounded",
|
|
28
34
|
"transition-all",
|
|
@@ -39,8 +45,14 @@ const t = r([
|
|
|
39
45
|
"data-[active=true]:text-white",
|
|
40
46
|
"data-[active=true]:font-medium",
|
|
41
47
|
"focus-visible:border-blue-200",
|
|
42
|
-
"focus-within:border-blue-200"
|
|
43
|
-
|
|
48
|
+
"focus-within:border-blue-200",
|
|
49
|
+
"dark:focus-within:border-aurora-50",
|
|
50
|
+
"dark:data-[active=true]:bg-aurora-500",
|
|
51
|
+
"dark:data-[active=true]:hover:border-aurora-50",
|
|
52
|
+
"dark:hover:border-transparent",
|
|
53
|
+
"dark:data-[active=true]:text-metal-900",
|
|
54
|
+
"dark:hover:bg-metal-700"
|
|
55
|
+
]), n = r([
|
|
44
56
|
"flex",
|
|
45
57
|
"items-center",
|
|
46
58
|
"justify-center",
|
|
@@ -54,8 +66,8 @@ const t = r([
|
|
|
54
66
|
"text-sm"
|
|
55
67
|
]);
|
|
56
68
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
n as buttonVariants,
|
|
70
|
+
o as liVariants,
|
|
71
|
+
e as timePickerVariants,
|
|
72
|
+
a as ulVariants
|
|
61
73
|
};
|
|
@@ -1,39 +1,44 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as b } from "react";
|
|
3
3
|
import { cn as t } from "../../../../utils/index.js";
|
|
4
|
-
import { buttonVariants as n, liVariants as
|
|
5
|
-
import { useTimePickerContext as
|
|
6
|
-
const
|
|
7
|
-
listClassName:
|
|
8
|
-
listItemClassName:
|
|
9
|
-
listItemButtonClassName:
|
|
4
|
+
import { buttonVariants as n, liVariants as s } from "../../TimePicker.variants.js";
|
|
5
|
+
import { useTimePickerContext as x } from "../../contexts/time-picker.hook.js";
|
|
6
|
+
const N = ({
|
|
7
|
+
listClassName: c,
|
|
8
|
+
listItemClassName: i,
|
|
9
|
+
listItemButtonClassName: l
|
|
10
10
|
}) => {
|
|
11
|
-
const { format: m, isAM:
|
|
12
|
-
(e,
|
|
13
|
-
e.currentTarget?.blur(),
|
|
11
|
+
const { format: m, isAM: a, onSelectAM: d, onSelectPM: p } = x(), o = b(
|
|
12
|
+
(e, u) => {
|
|
13
|
+
e.currentTarget?.blur(), u();
|
|
14
14
|
},
|
|
15
15
|
[]
|
|
16
16
|
);
|
|
17
17
|
return m === "24" ? null : /* @__PURE__ */ f(
|
|
18
18
|
"ul",
|
|
19
19
|
{
|
|
20
|
-
className: t("flex items-center justify-center flex-col",
|
|
20
|
+
className: t("flex items-center justify-center flex-col", c),
|
|
21
21
|
"aria-label": "meridian",
|
|
22
22
|
role: "listbox",
|
|
23
23
|
children: [
|
|
24
24
|
/* @__PURE__ */ r(
|
|
25
25
|
"li",
|
|
26
26
|
{
|
|
27
|
-
className: t(
|
|
28
|
-
"data-active":
|
|
27
|
+
className: t(s({ className: i })),
|
|
28
|
+
"data-active": a,
|
|
29
29
|
role: "presentation",
|
|
30
30
|
children: /* @__PURE__ */ r(
|
|
31
31
|
"button",
|
|
32
32
|
{
|
|
33
33
|
type: "button",
|
|
34
34
|
role: "option",
|
|
35
|
-
className: t(
|
|
36
|
-
|
|
35
|
+
className: t(
|
|
36
|
+
n({ className: l }),
|
|
37
|
+
{
|
|
38
|
+
"dark:text-slate-50": !a
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
onClick: (e) => o(e, d),
|
|
37
42
|
children: "AM"
|
|
38
43
|
}
|
|
39
44
|
)
|
|
@@ -42,16 +47,21 @@ const x = ({
|
|
|
42
47
|
/* @__PURE__ */ r(
|
|
43
48
|
"li",
|
|
44
49
|
{
|
|
45
|
-
className: t(
|
|
46
|
-
"data-active": !
|
|
50
|
+
className: t(s({ className: i })),
|
|
51
|
+
"data-active": !a,
|
|
47
52
|
role: "presentation",
|
|
48
53
|
children: /* @__PURE__ */ r(
|
|
49
54
|
"button",
|
|
50
55
|
{
|
|
51
56
|
type: "button",
|
|
52
57
|
role: "option",
|
|
53
|
-
className: t(
|
|
54
|
-
|
|
58
|
+
className: t(
|
|
59
|
+
n({ className: l }),
|
|
60
|
+
{
|
|
61
|
+
"dark:text-slate-50": a
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
onClick: (e) => o(e, p),
|
|
55
65
|
children: "PM"
|
|
56
66
|
}
|
|
57
67
|
)
|
|
@@ -61,7 +71,7 @@ const x = ({
|
|
|
61
71
|
}
|
|
62
72
|
);
|
|
63
73
|
};
|
|
64
|
-
|
|
74
|
+
N.displayName = "MeridianList";
|
|
65
75
|
export {
|
|
66
|
-
|
|
76
|
+
N as MeridianList
|
|
67
77
|
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useId as N, useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useId as N, useState as E, useRef as L, useCallback as O, useEffect as I } from "react";
|
|
3
|
+
import { Typography as c } from "../../../Typography/Typography.js";
|
|
4
|
+
import { cn as d } from "../../../../utils/index.js";
|
|
5
|
+
import { timePickerVariants as T } from "../../TimePicker.variants.js";
|
|
5
6
|
import { WrapperList as j } from "../WrapperList/WrapperList.js";
|
|
6
|
-
import { C as P } from "../../../../chevron-down-
|
|
7
|
+
import { C as P } from "../../../../chevron-down-DgT-uSF9.js";
|
|
7
8
|
import { useTimePickerContext as R } from "../../contexts/time-picker.hook.js";
|
|
8
|
-
const
|
|
9
|
-
name:
|
|
9
|
+
const q = ({
|
|
10
|
+
name: p,
|
|
10
11
|
label: i,
|
|
11
|
-
|
|
12
|
-
scrollBehavior:
|
|
13
|
-
className:
|
|
12
|
+
isRequired: f,
|
|
13
|
+
scrollBehavior: u,
|
|
14
|
+
className: h,
|
|
14
15
|
listClassName: x,
|
|
15
|
-
listItemClassName:
|
|
16
|
-
listItemButtonClassName:
|
|
16
|
+
listItemClassName: w,
|
|
17
|
+
listItemButtonClassName: b
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
+
const g = N(), [n, r] = E(!1), l = L(null), { format: k, formattedTime: m } = R(), o = p ?? `time-${g}`, v = O(() => r((e) => !e), []);
|
|
19
20
|
return I(() => {
|
|
20
|
-
const e = new AbortController(),
|
|
21
|
-
|
|
22
|
-
}, C = (
|
|
23
|
-
l.current?.contains(
|
|
21
|
+
const e = new AbortController(), y = (s) => {
|
|
22
|
+
s.key === "Escape" && r(!1);
|
|
23
|
+
}, C = (s) => {
|
|
24
|
+
l.current?.contains(s.target) || r(!1);
|
|
24
25
|
};
|
|
25
26
|
return document.addEventListener("mousedown", C, {
|
|
26
27
|
signal: e.signal
|
|
27
|
-
}), document.addEventListener("keydown",
|
|
28
|
+
}), document.addEventListener("keydown", y, {
|
|
28
29
|
signal: e.signal
|
|
29
30
|
}), () => {
|
|
30
31
|
e.abort();
|
|
@@ -33,29 +34,50 @@ const V = ({
|
|
|
33
34
|
"div",
|
|
34
35
|
{
|
|
35
36
|
ref: l,
|
|
36
|
-
className:
|
|
37
|
-
"w-max
|
|
38
|
-
|
|
37
|
+
className: d(
|
|
38
|
+
"w-max",
|
|
39
|
+
"text-slate-800",
|
|
40
|
+
"text-sm",
|
|
41
|
+
"flex",
|
|
42
|
+
"flex-col",
|
|
43
|
+
"gap-2",
|
|
44
|
+
k === "12" ? "w-53 min-w-53" : "w-36 min-w-36"
|
|
39
45
|
),
|
|
40
46
|
children: [
|
|
41
|
-
i ? /* @__PURE__ */ t(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
i ? /* @__PURE__ */ t(
|
|
48
|
+
c,
|
|
49
|
+
{
|
|
50
|
+
component: "label",
|
|
51
|
+
variant: "labelLarge",
|
|
52
|
+
htmlFor: o,
|
|
53
|
+
className: "font-medium",
|
|
54
|
+
children: [
|
|
55
|
+
i,
|
|
56
|
+
" ",
|
|
57
|
+
f && /* @__PURE__ */ a(
|
|
58
|
+
c,
|
|
59
|
+
{
|
|
60
|
+
component: "span",
|
|
61
|
+
className: "text-red-600 dark:text-red-500 text-sm font-normal",
|
|
62
|
+
children: "*"
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
) : null,
|
|
46
68
|
/* @__PURE__ */ t("div", { className: "relative", children: [
|
|
47
69
|
/* @__PURE__ */ t(
|
|
48
70
|
"button",
|
|
49
71
|
{
|
|
50
|
-
"aria-label":
|
|
72
|
+
"aria-label": o,
|
|
51
73
|
"aria-haspopup": "listbox",
|
|
52
74
|
"aria-expanded": "true",
|
|
53
75
|
"aria-controls": "time-options",
|
|
54
|
-
className:
|
|
76
|
+
className: d(T({ className: h })),
|
|
55
77
|
"data-open": n,
|
|
56
|
-
onClick:
|
|
78
|
+
onClick: v,
|
|
57
79
|
children: [
|
|
58
|
-
|
|
80
|
+
m,
|
|
59
81
|
/* @__PURE__ */ a(
|
|
60
82
|
P,
|
|
61
83
|
{
|
|
@@ -70,10 +92,10 @@ const V = ({
|
|
|
70
92
|
j,
|
|
71
93
|
{
|
|
72
94
|
isOpen: n,
|
|
73
|
-
scrollBehavior:
|
|
95
|
+
scrollBehavior: u,
|
|
74
96
|
listClassName: x,
|
|
75
|
-
listItemClassName:
|
|
76
|
-
listItemButtonClassName:
|
|
97
|
+
listItemClassName: w,
|
|
98
|
+
listItemButtonClassName: b
|
|
77
99
|
}
|
|
78
100
|
)
|
|
79
101
|
] }),
|
|
@@ -81,8 +103,8 @@ const V = ({
|
|
|
81
103
|
"input",
|
|
82
104
|
{
|
|
83
105
|
type: "hidden",
|
|
84
|
-
name:
|
|
85
|
-
value:
|
|
106
|
+
name: o,
|
|
107
|
+
value: m,
|
|
86
108
|
className: "hidden"
|
|
87
109
|
}
|
|
88
110
|
)
|
|
@@ -91,5 +113,5 @@ const V = ({
|
|
|
91
113
|
);
|
|
92
114
|
};
|
|
93
115
|
export {
|
|
94
|
-
|
|
116
|
+
q as Wrapper
|
|
95
117
|
};
|
|
@@ -1,51 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as n } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { getHours as
|
|
5
|
-
import { HoursList as
|
|
6
|
-
import { MeridianList as
|
|
7
|
-
import { MinutesList as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
scrollBehavior: p,
|
|
3
|
+
import { cn as c } from "../../../../utils/index.js";
|
|
4
|
+
import { getHours as s, getMinutes as x } from "../../utils/index.js";
|
|
5
|
+
import { HoursList as g } from "../HoursList/HoursList.js";
|
|
6
|
+
import { MeridianList as b } from "../MeridianList/MeridianList.js";
|
|
7
|
+
import { MinutesList as M } from "../MinutesList/MinutesList.js";
|
|
8
|
+
import { useTimePickerContext as h } from "../../contexts/time-picker.hook.js";
|
|
9
|
+
const T = ({
|
|
10
|
+
isOpen: d,
|
|
11
|
+
scrollBehavior: m,
|
|
13
12
|
listClassName: o,
|
|
14
|
-
listItemClassName:
|
|
15
|
-
listItemButtonClassName:
|
|
13
|
+
listItemClassName: e,
|
|
14
|
+
listItemButtonClassName: i
|
|
16
15
|
}) => {
|
|
17
|
-
const { time: r } =
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
16
|
+
const { time: r } = h(), p = n(() => s(r), [r]), u = n(() => x(r), [r]);
|
|
17
|
+
return d ? /* @__PURE__ */ f(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
role: "group",
|
|
21
|
+
className: c(
|
|
22
|
+
"flex gap-1.5 p-2 rounded-md shadow w-full max-h-[216px] absolute mt-1 bg-white z-10 animate-in fade-in-0 zoom-in-95 dark:bg-metal-800 dark:border dark:border-metal-700"
|
|
23
|
+
),
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ t(
|
|
26
|
+
g,
|
|
27
|
+
{
|
|
28
|
+
hours: p,
|
|
29
|
+
scrollBehavior: m,
|
|
30
|
+
listClassName: o,
|
|
31
|
+
listItemClassName: e,
|
|
32
|
+
listItemButtonClassName: i
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ t(
|
|
36
|
+
M,
|
|
37
|
+
{
|
|
38
|
+
minutes: u,
|
|
39
|
+
scrollBehavior: m,
|
|
40
|
+
listClassName: o,
|
|
41
|
+
listItemClassName: e,
|
|
42
|
+
listItemButtonClassName: i
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ t(
|
|
46
|
+
b,
|
|
47
|
+
{
|
|
48
|
+
listClassName: o,
|
|
49
|
+
listItemClassName: e,
|
|
50
|
+
listItemButtonClassName: i
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) : null;
|
|
48
56
|
};
|
|
49
57
|
export {
|
|
50
|
-
|
|
58
|
+
T as WrapperList
|
|
51
59
|
};
|