@konstructio/ui 0.1.2-alpha.44 → 0.1.2-alpha.47
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/components/AlertDialog/AlertDialog.js +39 -37
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +23 -26
- package/dist/components/Badge/Badge.variants.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Checkbox/Checkbox.js +104 -100
- package/dist/components/Checkbox/Checkbox.variants.js +30 -7
- package/dist/components/Counter/Counter.js +210 -0
- package/dist/components/Counter/Counter.variants.js +70 -0
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +9 -10
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -32
- 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.variants.js +10 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +4 -4
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +16 -7
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +92 -74
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +53 -29
- package/dist/components/PhoneNumberInput/components/Wrapper.js +139 -120
- package/dist/components/Radio/Radio.js +47 -44
- package/dist/components/Radio/Radio.variants.js +12 -8
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +3 -3
- package/dist/components/{Dropdown → Select}/components/List/List.js +48 -43
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +8 -5
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.js +20 -20
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +3 -2
- package/dist/components/{Dropdown → Select}/components/Wrapper.js +70 -70
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/{Dropdown/contexts/dropdown.context.js → Select/contexts/select.context.js} +2 -2
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/{Dropdown → Select}/hooks/useNavigationList.js +3 -3
- package/dist/components/{Dropdown/hooks/useDropdown.js → Select/hooks/useSelect.js} +33 -33
- package/dist/components/Switch/Switch.js +153 -125
- package/dist/components/Switch/Switch.variants.js +15 -6
- package/dist/components/TimePicker/TimePicker.variants.js +11 -6
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +50 -35
- package/dist/components/Typography/Typography.js +24 -28
- package/dist/components/Typography/Typography.variants.js +49 -46
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +14 -14
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +10 -10
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/index.js +84 -80
- package/dist/{index-CPU02rhe.js → index-D6KzX_ef.js} +13 -12
- package/dist/index.d.ts +134 -81
- package/dist/index.js +114 -110
- package/dist/package.json +4 -4
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +6 -5
- package/dist/ui/theme.css +27 -0
- package/dist/x-BXShoIAM.js +8 -0
- package/package.json +4 -4
- package/dist/components/Dropdown/Dropdown.js +0 -48
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -58
- package/dist/components/Dropdown/contexts/index.js +0 -6
- package/dist/components/NumberInput/NumberInput.js +0 -179
- package/dist/components/NumberInput/NumberInput.variants.js +0 -50
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
- /package/dist/components/{Dropdown → Select}/constants/index.js +0 -0
- /package/dist/components/{Dropdown → Select}/constants/pagination.js +0 -0
|
@@ -1,115 +1,116 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { a as
|
|
1
|
+
import { jsxs as y, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { forwardRef as M, useRef as $, useId as j, useImperativeHandle as z, useEffect as A } from "react";
|
|
4
|
+
import { a as U, c as q, P as N, b as F } from "../../index-DKfEnhKr.js";
|
|
5
5
|
import { u as P } from "../../index-DLcqcWxM.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { u as L } from "../../index-BZPx6jYI.js";
|
|
7
|
+
import { u as O } from "../../index-DtEcCIrM.js";
|
|
8
|
+
import { Typography as R } from "../Typography/Typography.js";
|
|
9
|
+
import { cn as C } from "../../utils/index.js";
|
|
10
|
+
import { thumbVariants as V, switchVariants as D } from "./Switch.variants.js";
|
|
11
|
+
var k = "Switch", [W, ne] = q(k), [X, G] = W(k), g = p.forwardRef(
|
|
12
|
+
(o, d) => {
|
|
12
13
|
const {
|
|
13
|
-
__scopeSwitch:
|
|
14
|
-
name:
|
|
15
|
-
checked:
|
|
16
|
-
defaultChecked:
|
|
17
|
-
required:
|
|
18
|
-
disabled:
|
|
19
|
-
value:
|
|
20
|
-
onCheckedChange:
|
|
21
|
-
form:
|
|
22
|
-
...
|
|
23
|
-
} =
|
|
24
|
-
prop:
|
|
25
|
-
defaultProp:
|
|
26
|
-
onChange:
|
|
27
|
-
caller:
|
|
14
|
+
__scopeSwitch: e,
|
|
15
|
+
name: c,
|
|
16
|
+
checked: t,
|
|
17
|
+
defaultChecked: S,
|
|
18
|
+
required: r,
|
|
19
|
+
disabled: n,
|
|
20
|
+
value: a = "on",
|
|
21
|
+
onCheckedChange: v,
|
|
22
|
+
form: i,
|
|
23
|
+
...u
|
|
24
|
+
} = o, [f, m] = p.useState(null), s = P(d, (x) => m(x)), h = p.useRef(!1), b = f ? i || !!f.closest("form") : !0, [w, T] = U({
|
|
25
|
+
prop: t,
|
|
26
|
+
defaultProp: S ?? !1,
|
|
27
|
+
onChange: v,
|
|
28
|
+
caller: k
|
|
28
29
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ y(X, { scope: e, checked: w, disabled: n, children: [
|
|
31
|
+
/* @__PURE__ */ l(
|
|
31
32
|
N.button,
|
|
32
33
|
{
|
|
33
34
|
type: "button",
|
|
34
35
|
role: "switch",
|
|
35
|
-
"aria-checked":
|
|
36
|
-
"aria-required":
|
|
37
|
-
"data-state":
|
|
38
|
-
"data-disabled":
|
|
39
|
-
disabled:
|
|
40
|
-
value:
|
|
41
|
-
...
|
|
42
|
-
ref:
|
|
43
|
-
onClick:
|
|
44
|
-
|
|
36
|
+
"aria-checked": w,
|
|
37
|
+
"aria-required": r,
|
|
38
|
+
"data-state": B(w),
|
|
39
|
+
"data-disabled": n ? "" : void 0,
|
|
40
|
+
disabled: n,
|
|
41
|
+
value: a,
|
|
42
|
+
...u,
|
|
43
|
+
ref: s,
|
|
44
|
+
onClick: F(o.onClick, (x) => {
|
|
45
|
+
T((H) => !H), b && (h.current = x.isPropagationStopped(), h.current || x.stopPropagation());
|
|
45
46
|
})
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
b && /* @__PURE__ */ l(
|
|
50
|
+
I,
|
|
50
51
|
{
|
|
51
|
-
control:
|
|
52
|
-
bubbles: !
|
|
53
|
-
name:
|
|
54
|
-
value:
|
|
55
|
-
checked:
|
|
56
|
-
required:
|
|
57
|
-
disabled:
|
|
58
|
-
form:
|
|
52
|
+
control: f,
|
|
53
|
+
bubbles: !h.current,
|
|
54
|
+
name: c,
|
|
55
|
+
value: a,
|
|
56
|
+
checked: w,
|
|
57
|
+
required: r,
|
|
58
|
+
disabled: n,
|
|
59
|
+
form: i,
|
|
59
60
|
style: { transform: "translateX(-100%)" }
|
|
60
61
|
}
|
|
61
62
|
)
|
|
62
63
|
] });
|
|
63
64
|
}
|
|
64
65
|
);
|
|
65
|
-
|
|
66
|
-
var
|
|
67
|
-
(
|
|
68
|
-
const { __scopeSwitch:
|
|
69
|
-
return /* @__PURE__ */
|
|
66
|
+
g.displayName = k;
|
|
67
|
+
var E = "SwitchThumb", _ = p.forwardRef(
|
|
68
|
+
(o, d) => {
|
|
69
|
+
const { __scopeSwitch: e, ...c } = o, t = G(E, e);
|
|
70
|
+
return /* @__PURE__ */ l(
|
|
70
71
|
N.span,
|
|
71
72
|
{
|
|
72
|
-
"data-state":
|
|
73
|
-
"data-disabled":
|
|
74
|
-
...
|
|
75
|
-
ref:
|
|
73
|
+
"data-state": B(t.checked),
|
|
74
|
+
"data-disabled": t.disabled ? "" : void 0,
|
|
75
|
+
...c,
|
|
76
|
+
ref: d
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
80
|
);
|
|
80
|
-
|
|
81
|
-
var
|
|
81
|
+
_.displayName = E;
|
|
82
|
+
var J = "SwitchBubbleInput", I = p.forwardRef(
|
|
82
83
|
({
|
|
83
|
-
__scopeSwitch:
|
|
84
|
-
control:
|
|
85
|
-
checked:
|
|
86
|
-
bubbles:
|
|
87
|
-
...
|
|
88
|
-
},
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
93
|
-
const
|
|
94
|
-
|
|
84
|
+
__scopeSwitch: o,
|
|
85
|
+
control: d,
|
|
86
|
+
checked: e,
|
|
87
|
+
bubbles: c = !0,
|
|
88
|
+
...t
|
|
89
|
+
}, S) => {
|
|
90
|
+
const r = p.useRef(null), n = P(r, S), a = L(e), v = O(d);
|
|
91
|
+
return p.useEffect(() => {
|
|
92
|
+
const i = r.current;
|
|
93
|
+
if (!i) return;
|
|
94
|
+
const u = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(
|
|
95
|
+
u,
|
|
95
96
|
"checked"
|
|
96
97
|
).set;
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
|
|
98
|
+
if (a !== e && m) {
|
|
99
|
+
const s = new Event("click", { bubbles: c });
|
|
100
|
+
m.call(i, e), i.dispatchEvent(s);
|
|
100
101
|
}
|
|
101
|
-
}, [
|
|
102
|
+
}, [a, e, c]), /* @__PURE__ */ l(
|
|
102
103
|
"input",
|
|
103
104
|
{
|
|
104
105
|
type: "checkbox",
|
|
105
106
|
"aria-hidden": !0,
|
|
106
|
-
defaultChecked:
|
|
107
|
-
...
|
|
107
|
+
defaultChecked: e,
|
|
108
|
+
...t,
|
|
108
109
|
tabIndex: -1,
|
|
109
|
-
ref:
|
|
110
|
+
ref: n,
|
|
110
111
|
style: {
|
|
111
|
-
...
|
|
112
|
-
...
|
|
112
|
+
...t.style,
|
|
113
|
+
...v,
|
|
113
114
|
position: "absolute",
|
|
114
115
|
pointerEvents: "none",
|
|
115
116
|
opacity: 0,
|
|
@@ -119,72 +120,99 @@ var G = "SwitchBubbleInput", _ = h.forwardRef(
|
|
|
119
120
|
);
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
|
-
|
|
123
|
-
function
|
|
124
|
-
return
|
|
123
|
+
I.displayName = J;
|
|
124
|
+
function B(o) {
|
|
125
|
+
return o ? "checked" : "unchecked";
|
|
125
126
|
}
|
|
126
|
-
var
|
|
127
|
-
const
|
|
127
|
+
var K = g, Q = _;
|
|
128
|
+
const ie = M(
|
|
128
129
|
({
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
130
|
+
alignment: o = "horizontal",
|
|
131
|
+
className: d,
|
|
132
|
+
defaultChecked: e,
|
|
133
|
+
disabled: c = !1,
|
|
134
|
+
helperText: t,
|
|
135
|
+
helperTextClassName: S,
|
|
136
|
+
label: r,
|
|
137
|
+
labelClassName: n,
|
|
138
|
+
name: a,
|
|
139
|
+
theme: v,
|
|
140
|
+
thumbClassName: i,
|
|
141
|
+
value: u,
|
|
142
|
+
onChange: f
|
|
143
|
+
}, m) => {
|
|
144
|
+
const s = $(null), h = j(), b = a ? `${h}-${a}` : h;
|
|
145
|
+
return z(m, () => s.current, [s]), A(() => {
|
|
146
|
+
s.current && (s.current.value = `${u}`);
|
|
147
|
+
}, [u]), /* @__PURE__ */ y(
|
|
144
148
|
"div",
|
|
145
149
|
{
|
|
146
|
-
className:
|
|
147
|
-
"w-full
|
|
148
|
-
|
|
150
|
+
className: C(
|
|
151
|
+
"w-full",
|
|
152
|
+
"flex",
|
|
153
|
+
"gap-3",
|
|
154
|
+
o === "vertical" ? "flex-col" : "flex-row"
|
|
149
155
|
),
|
|
150
|
-
"data-theme":
|
|
156
|
+
"data-theme": v,
|
|
151
157
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
|
|
158
|
+
/* @__PURE__ */ l(
|
|
159
|
+
K,
|
|
154
160
|
{
|
|
155
|
-
id:
|
|
156
|
-
defaultChecked:
|
|
157
|
-
checked:
|
|
158
|
-
onCheckedChange: (w) =>
|
|
159
|
-
className:
|
|
160
|
-
"aria-label":
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
id: b,
|
|
162
|
+
defaultChecked: e,
|
|
163
|
+
checked: u,
|
|
164
|
+
onCheckedChange: (w) => f?.(w),
|
|
165
|
+
className: C(D({ className: d })),
|
|
166
|
+
"aria-label": r,
|
|
167
|
+
disabled: c,
|
|
168
|
+
children: /* @__PURE__ */ l(
|
|
169
|
+
Q,
|
|
163
170
|
{
|
|
164
|
-
className:
|
|
165
|
-
className:
|
|
171
|
+
className: V({
|
|
172
|
+
className: i
|
|
166
173
|
})
|
|
167
174
|
}
|
|
168
175
|
)
|
|
169
176
|
}
|
|
170
177
|
),
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
r ? /* @__PURE__ */ y(
|
|
179
|
+
R,
|
|
173
180
|
{
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
component: "label",
|
|
182
|
+
className: C(
|
|
183
|
+
"flex",
|
|
184
|
+
"flex-col",
|
|
185
|
+
"text-sm",
|
|
186
|
+
"dark:text-white",
|
|
187
|
+
"select-none",
|
|
188
|
+
n
|
|
189
|
+
),
|
|
190
|
+
htmlFor: b,
|
|
176
191
|
style: { paddingRight: 15 },
|
|
177
192
|
children: [
|
|
178
|
-
|
|
179
|
-
|
|
193
|
+
r,
|
|
194
|
+
t ? /* @__PURE__ */ l(
|
|
195
|
+
R,
|
|
196
|
+
{
|
|
197
|
+
component: "span",
|
|
198
|
+
className: C(
|
|
199
|
+
"text-xs",
|
|
200
|
+
"select-none",
|
|
201
|
+
"text-slate-600",
|
|
202
|
+
"dark:text-metal-400",
|
|
203
|
+
S
|
|
204
|
+
),
|
|
205
|
+
children: t
|
|
206
|
+
}
|
|
207
|
+
) : null
|
|
180
208
|
]
|
|
181
209
|
}
|
|
182
210
|
) : null,
|
|
183
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ l(
|
|
184
212
|
"input",
|
|
185
213
|
{
|
|
186
|
-
ref:
|
|
187
|
-
name:
|
|
214
|
+
ref: s,
|
|
215
|
+
name: a,
|
|
188
216
|
type: "text",
|
|
189
217
|
className: "hidden",
|
|
190
218
|
"aria-hidden": "true"
|
|
@@ -196,5 +224,5 @@ const ce = H(
|
|
|
196
224
|
}
|
|
197
225
|
);
|
|
198
226
|
export {
|
|
199
|
-
|
|
227
|
+
ie as Switch
|
|
200
228
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as a } from "../../index-D29mdTf5.js";
|
|
2
|
-
const
|
|
2
|
+
const t = a([
|
|
3
3
|
"w-10",
|
|
4
4
|
"h-5",
|
|
5
5
|
"flex",
|
|
@@ -8,14 +8,23 @@ const r = a([
|
|
|
8
8
|
"shadow",
|
|
9
9
|
"focus:shadow-md",
|
|
10
10
|
"data-[state=unchecked]:bg-gray-300",
|
|
11
|
-
"dark:data-[state=unchecked]:bg-
|
|
11
|
+
"dark:data-[state=unchecked]:bg-metal-600",
|
|
12
12
|
"transition-all",
|
|
13
13
|
"delay-10",
|
|
14
14
|
"duration-250",
|
|
15
15
|
"cursor-pointer",
|
|
16
16
|
"bg-aurora-500",
|
|
17
|
-
"kubefirst:bg-kubefirst-primary"
|
|
18
|
-
]
|
|
17
|
+
"kubefirst:bg-kubefirst-primary",
|
|
18
|
+
"[&+label,&+span]:cursor-pointer",
|
|
19
|
+
"disabled:[&+label,&+span,&]:cursor-not-allowed",
|
|
20
|
+
"disabled:bg-gray-200",
|
|
21
|
+
"disabled:data-[state=unchecked]:[&>span]:bg-white",
|
|
22
|
+
"disabled:data-[state=unchecked]:bg-gray-200",
|
|
23
|
+
"dark:disabled:bg-metal-700",
|
|
24
|
+
"dark:disabled:data-[state=unchecked]:[&>span]:bg-metal-600",
|
|
25
|
+
"dark:disabled:data-[state=unchecked]:bg-metal-700",
|
|
26
|
+
"dark:disabled:[&>span]:bg-metal-600"
|
|
27
|
+
]), d = a([
|
|
19
28
|
"block",
|
|
20
29
|
"w-4",
|
|
21
30
|
"h-4",
|
|
@@ -31,6 +40,6 @@ const r = a([
|
|
|
31
40
|
"duration-300"
|
|
32
41
|
]);
|
|
33
42
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
t as switchVariants,
|
|
44
|
+
d as thumbVariants
|
|
36
45
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const e =
|
|
1
|
+
import { c as r } from "../../index-D29mdTf5.js";
|
|
2
|
+
const e = r([
|
|
3
3
|
"border",
|
|
4
4
|
"rounded",
|
|
5
5
|
"p-2.5",
|
|
@@ -7,8 +7,10 @@ const e = t([
|
|
|
7
7
|
"flex",
|
|
8
8
|
"items-center",
|
|
9
9
|
"justify-between",
|
|
10
|
+
"bg-white",
|
|
10
11
|
"border-gray-300",
|
|
11
12
|
"dark:border-metal-700",
|
|
13
|
+
"dark:bg-metal-800",
|
|
12
14
|
"cursor-pointer",
|
|
13
15
|
"transition-all",
|
|
14
16
|
"transition-duration-100",
|
|
@@ -16,7 +18,7 @@ const e = t([
|
|
|
16
18
|
"text-sm",
|
|
17
19
|
"text-slate-800",
|
|
18
20
|
"dark:text-slate-50"
|
|
19
|
-
]), a =
|
|
21
|
+
]), a = r([
|
|
20
22
|
"snap-y",
|
|
21
23
|
"snap-mandatory",
|
|
22
24
|
"overflow-y-scroll",
|
|
@@ -24,7 +26,7 @@ const e = t([
|
|
|
24
26
|
"flex",
|
|
25
27
|
"flex-col",
|
|
26
28
|
"dark:text-metal-50"
|
|
27
|
-
]), o =
|
|
29
|
+
]), o = r([
|
|
28
30
|
"w-15",
|
|
29
31
|
"h-10",
|
|
30
32
|
"snap-start",
|
|
@@ -46,8 +48,11 @@ const e = t([
|
|
|
46
48
|
"focus-within:border-blue-200",
|
|
47
49
|
"dark:focus-within:border-aurora-50",
|
|
48
50
|
"dark:data-[active=true]:bg-aurora-500",
|
|
49
|
-
"dark:data-[active=true]:
|
|
50
|
-
|
|
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([
|
|
51
56
|
"flex",
|
|
52
57
|
"items-center",
|
|
53
58
|
"justify-center",
|
|
@@ -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
|
};
|