@alfadocs/ui-kit-debug 1.94.0 → 1.95.0
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/_chunks/{anamnesis-summary-rows-IMohuz0D.js → anamnesis-summary-rows-DTZ3per6.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-IMohuz0D.js.map → anamnesis-summary-rows-DTZ3per6.js.map} +1 -1
- package/dist/_chunks/{calendar-appointment-editor-dialog-CsVWoRcP.js → calendar-appointment-editor-dialog-WDKc3jMA.js} +3 -3
- package/dist/_chunks/{calendar-appointment-editor-dialog-CsVWoRcP.js.map → calendar-appointment-editor-dialog-WDKc3jMA.js.map} +1 -1
- package/dist/_chunks/chart-pMkQN-qy.js +1550 -0
- package/dist/_chunks/chart-pMkQN-qy.js.map +1 -0
- package/dist/_chunks/{date-time-picker-n-yrlMJq.js → date-time-picker-cwsWiB4q.js} +2 -2
- package/dist/_chunks/{date-time-picker-n-yrlMJq.js.map → date-time-picker-cwsWiB4q.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-K41Wy7LB.js → hcg-doubling-DQe1ptNB.js} +2 -2
- package/dist/_chunks/{hcg-doubling-K41Wy7LB.js.map → hcg-doubling-DQe1ptNB.js.map} +1 -1
- package/dist/_chunks/{reserved.agent-XU88crNW.js → reserved.agent-BvwjDyne.js} +2 -2
- package/dist/_chunks/{reserved.agent-XU88crNW.js.map → reserved.agent-BvwjDyne.js.map} +1 -1
- package/dist/_chunks/{slot-grid-B-IAFX3C.js → slot-grid-BhjaLJ0o.js} +229 -214
- package/dist/_chunks/{slot-grid-B-IAFX3C.js.map → slot-grid-BhjaLJ0o.js.map} +1 -1
- package/dist/_chunks/{task-editor-BZeSBxwU.js → task-editor-Cv7xSakv.js} +2 -2
- package/dist/_chunks/{task-editor-BZeSBxwU.js.map → task-editor-Cv7xSakv.js.map} +1 -1
- package/dist/_chunks/time-picker-DSt-ns5F.js +914 -0
- package/dist/_chunks/time-picker-DSt-ns5F.js.map +1 -0
- package/dist/agent-catalog.json +12 -4
- package/dist/agent-i18n/en.json +2 -2
- package/dist/apexcharts.css +4 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/chart/chart-axis-scale.d.ts +21 -0
- package/dist/components/chart/chart-axis-scale.d.ts.map +1 -0
- package/dist/components/chart/chart.agent.d.ts.map +1 -1
- package/dist/components/chart/chart.d.ts +55 -0
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.d.ts +1 -1
- package/dist/components/chart/index.d.ts.map +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts +15 -8
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +4 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +6 -3
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +5 -2
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +7 -4
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +5 -2
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +7 -4
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +5 -2
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +6 -3
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +5 -2
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +7 -4
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +4 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +6 -3
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +5 -2
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +7 -4
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +5 -2
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +7 -4
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +5 -2
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +7 -4
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +5 -2
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +7 -4
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +5 -2
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +7 -4
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +4 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +6 -3
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +5 -2
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +7 -4
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +5 -2
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +7 -4
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +5 -2
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +7 -4
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +5 -2
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +7 -4
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +5 -2
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +7 -4
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +5 -2
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +7 -4
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/locales/ar.json +6 -3
- package/dist/locales/de.json +7 -4
- package/dist/locales/el.json +7 -4
- package/dist/locales/en.json +6 -3
- package/dist/locales/es.json +7 -4
- package/dist/locales/fr.json +6 -3
- package/dist/locales/hi.json +7 -4
- package/dist/locales/it.json +7 -4
- package/dist/locales/ja.json +7 -4
- package/dist/locales/nl.json +7 -4
- package/dist/locales/pl.json +7 -4
- package/dist/locales/pt.json +6 -3
- package/dist/locales/ro.json +7 -4
- package/dist/locales/ru.json +7 -4
- package/dist/locales/sq.json +7 -4
- package/dist/locales/sv.json +7 -4
- package/dist/locales/tr.json +7 -4
- package/dist/locales/zh.json +7 -4
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +3 -0
- package/package.json +1 -1
- package/dist/_chunks/chart-D4huJSru.js +0 -1340
- package/dist/_chunks/chart-D4huJSru.js.map +0 -1
- package/dist/_chunks/time-picker-DVfyAR81.js +0 -871
- package/dist/_chunks/time-picker-DVfyAR81.js.map +0 -1
|
@@ -1,871 +0,0 @@
|
|
|
1
|
-
import { jsxs as je, jsx as g, Fragment as bt } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as yt, useContext as kt, useState as oe, useRef as d, useCallback as G, useEffect as be, useMemo as ye, useImperativeHandle as wt } from "react";
|
|
3
|
-
import { c as C } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as xt } from "react-i18next";
|
|
5
|
-
import * as W from "@radix-ui/react-popover";
|
|
6
|
-
import { u as Dt, F as Tt, a as Mt } from "./form-field-context-DtiROUJV.js";
|
|
7
|
-
import { u as Pt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
8
|
-
import { u as Ct } from "./registry-DvAUVLHh.js";
|
|
9
|
-
import { C as At } from "./clock-Drd4Wtis.js";
|
|
10
|
-
const zt = {
|
|
11
|
-
id: "time-picker",
|
|
12
|
-
capabilities: ["select_single", "set_value", "open", "close"],
|
|
13
|
-
state: {
|
|
14
|
-
value: {
|
|
15
|
-
type: "HH:MM",
|
|
16
|
-
descriptionKey: "ui.agent.timePicker.state.value",
|
|
17
|
-
description: "Currently-selected time as 24h HH:MM (always present — defaults to 00:00 when unset).",
|
|
18
|
-
read: (r) => {
|
|
19
|
-
const o = r.getValue();
|
|
20
|
-
if (!o) return null;
|
|
21
|
-
const u = String(o.hours).padStart(2, "0"), b = String(o.minutes).padStart(2, "0");
|
|
22
|
-
return `${u}:${b}`;
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
isOpen: {
|
|
26
|
-
type: "boolean",
|
|
27
|
-
descriptionKey: "ui.agent.timePicker.state.isOpen",
|
|
28
|
-
description: "Whether the time dropdown is open. Always false unless the picker has the dropdown prop.",
|
|
29
|
-
read: (r) => r.isOpen()
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
actions: {
|
|
33
|
-
set_time: {
|
|
34
|
-
safety: "write",
|
|
35
|
-
argsType: "{ time: string }",
|
|
36
|
-
argsSchema: {
|
|
37
|
-
type: "object",
|
|
38
|
-
properties: {
|
|
39
|
-
time: { type: "string", pattern: "^([01][0-9]|2[0-3]):[0-5][0-9]$" }
|
|
40
|
-
},
|
|
41
|
-
required: ["time"]
|
|
42
|
-
},
|
|
43
|
-
idempotent: !0,
|
|
44
|
-
descriptionKey: "ui.agent.timePicker.actions.setTime",
|
|
45
|
-
description: "Set the time using a 24h HH:MM string.",
|
|
46
|
-
examples: [{ args: { time: "14:30" }, note: "2:30 PM in 24h form." }],
|
|
47
|
-
invoke: (r, o) => {
|
|
48
|
-
const [u, b] = o.time.split(":");
|
|
49
|
-
r.setValue({
|
|
50
|
-
hours: Number.parseInt(u ?? "0", 10),
|
|
51
|
-
minutes: Number.parseInt(b ?? "0", 10)
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
clear: {
|
|
56
|
-
safety: "destructive",
|
|
57
|
-
idempotent: !0,
|
|
58
|
-
descriptionKey: "ui.agent.timePicker.actions.clear",
|
|
59
|
-
description: "Clear the time (resets to 00:00).",
|
|
60
|
-
invoke: (r) => {
|
|
61
|
-
r.clear();
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
open: {
|
|
65
|
-
safety: "read",
|
|
66
|
-
descriptionKey: "ui.agent.timePicker.actions.open",
|
|
67
|
-
description: "Open the time dropdown without moving focus. A no-op unless the picker has the dropdown prop and is enabled.",
|
|
68
|
-
invoke: (r) => {
|
|
69
|
-
r.open();
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
close: {
|
|
73
|
-
safety: "read",
|
|
74
|
-
descriptionKey: "ui.agent.timePicker.actions.close",
|
|
75
|
-
description: "Close the time dropdown. A no-op unless the picker has the dropdown prop.",
|
|
76
|
-
invoke: (r) => {
|
|
77
|
-
r.close();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
domHooks: {
|
|
82
|
-
root: {
|
|
83
|
-
attr: "data-component",
|
|
84
|
-
value: "time-picker",
|
|
85
|
-
description: "Marks the TimePicker wrapper."
|
|
86
|
-
},
|
|
87
|
-
instanceId: {
|
|
88
|
-
attr: "data-component-id",
|
|
89
|
-
sourceProp: "id",
|
|
90
|
-
description: "Sourced from the id prop."
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
function Ht(r) {
|
|
95
|
-
try {
|
|
96
|
-
const o = new Intl.DateTimeFormat(r, {
|
|
97
|
-
hour: "numeric"
|
|
98
|
-
}).resolvedOptions();
|
|
99
|
-
return o.hourCycle === "h12" || o.hourCycle === "h11";
|
|
100
|
-
} catch {
|
|
101
|
-
return !1;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function It(r) {
|
|
105
|
-
var o, u;
|
|
106
|
-
try {
|
|
107
|
-
const b = ((o = new Intl.DateTimeFormat(r, {
|
|
108
|
-
hour: "numeric",
|
|
109
|
-
hour12: !0
|
|
110
|
-
}).formatToParts(new Date(2e3, 0, 1, 9)).find((w) => w.type === "dayPeriod")) == null ? void 0 : o.value) ?? "AM", k = ((u = new Intl.DateTimeFormat(r, {
|
|
111
|
-
hour: "numeric",
|
|
112
|
-
hour12: !0
|
|
113
|
-
}).formatToParts(new Date(2e3, 0, 1, 15)).find((w) => w.type === "dayPeriod")) == null ? void 0 : u.value) ?? "PM";
|
|
114
|
-
return { am: b, pm: k };
|
|
115
|
-
} catch {
|
|
116
|
-
return { am: "AM", pm: "PM" };
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function H(r, o, u) {
|
|
120
|
-
return Math.min(u, Math.max(o, r));
|
|
121
|
-
}
|
|
122
|
-
function Be(r) {
|
|
123
|
-
return Math.floor(59 / r) * r;
|
|
124
|
-
}
|
|
125
|
-
function Ft(r, o) {
|
|
126
|
-
const u = Math.round(H(r, 0, 59) / o) * o;
|
|
127
|
-
return H(u, 0, Be(o));
|
|
128
|
-
}
|
|
129
|
-
function Ot(r, o, u) {
|
|
130
|
-
const b = Be(o);
|
|
131
|
-
if (u === 1) {
|
|
132
|
-
const w = Math.floor(r / o) * o + o;
|
|
133
|
-
return w > b ? 0 : w;
|
|
134
|
-
}
|
|
135
|
-
const k = Math.ceil(r / o) * o - o;
|
|
136
|
-
return k < 0 ? b : k;
|
|
137
|
-
}
|
|
138
|
-
function Rt(r) {
|
|
139
|
-
const o = (u) => Number.isFinite(u) ? Math.trunc(u) : 0;
|
|
140
|
-
return {
|
|
141
|
-
hours: H(o(r.hours), 0, 23),
|
|
142
|
-
minutes: H(o(r.minutes), 0, 59)
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function ke(r) {
|
|
146
|
-
return r === 0 ? 12 : r > 12 ? r - 12 : r;
|
|
147
|
-
}
|
|
148
|
-
function Ee(r, o) {
|
|
149
|
-
return o ? r === 12 ? 12 : r + 12 : r === 12 ? 0 : r;
|
|
150
|
-
}
|
|
151
|
-
const J = (r) => String(r).padStart(2, "0");
|
|
152
|
-
function Lt(r) {
|
|
153
|
-
r.stopPropagation();
|
|
154
|
-
}
|
|
155
|
-
const Kt = C(
|
|
156
|
-
[
|
|
157
|
-
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
158
|
-
"ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--control-border)] ds:bg-background",
|
|
159
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
160
|
-
"ds:focus-within:outline-[length:var(--focus-ring-width)] ds:focus-within:outline-solid",
|
|
161
|
-
"ds:focus-within:outline-ring ds:focus-within:outline-offset-[length:var(--focus-ring-offset)]",
|
|
162
|
-
"ds:forced-colors:focus-within:outline-[CanvasText]"
|
|
163
|
-
].join(" "),
|
|
164
|
-
{
|
|
165
|
-
variants: {
|
|
166
|
-
size: {
|
|
167
|
-
sm: "ds:h-8 ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]",
|
|
168
|
-
md: "ds:h-[var(--min-target-size)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-base)]",
|
|
169
|
-
lg: "ds:h-12 ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-lg)]"
|
|
170
|
-
},
|
|
171
|
-
tone: {
|
|
172
|
-
default: "ds:border-[color:var(--control-border)]",
|
|
173
|
-
error: "ds:border-destructive"
|
|
174
|
-
},
|
|
175
|
-
isDisabled: {
|
|
176
|
-
true: "ds:cursor-not-allowed ds:opacity-50",
|
|
177
|
-
false: ""
|
|
178
|
-
},
|
|
179
|
-
/** `dropdown` on and enabled: a click anywhere on the field opens the list. */
|
|
180
|
-
opensOnClick: {
|
|
181
|
-
true: "ds:cursor-pointer",
|
|
182
|
-
false: ""
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
defaultVariants: {
|
|
186
|
-
size: "md",
|
|
187
|
-
tone: "default",
|
|
188
|
-
isDisabled: !1,
|
|
189
|
-
opensOnClick: !1
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
), Ne = C(
|
|
193
|
-
[
|
|
194
|
-
"ds:inline-flex ds:items-center ds:justify-center",
|
|
195
|
-
"ds:rounded-[var(--radius-sm)] ds:text-center ds:tabular-nums",
|
|
196
|
-
"ds:bg-transparent ds:text-foreground",
|
|
197
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
198
|
-
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
199
|
-
"ds:select-none"
|
|
200
|
-
].join(" "),
|
|
201
|
-
{
|
|
202
|
-
variants: {
|
|
203
|
-
size: {
|
|
204
|
-
sm: "ds:min-w-6 ds:h-6 ds:text-[length:var(--font-size-sm)]",
|
|
205
|
-
md: "ds:min-w-8 ds:h-8 ds:text-[length:var(--font-size-base)]",
|
|
206
|
-
lg: "ds:min-w-10 ds:h-10 ds:text-[length:var(--font-size-lg)]"
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
defaultVariants: { size: "md" }
|
|
210
|
-
}
|
|
211
|
-
), St = C(
|
|
212
|
-
[
|
|
213
|
-
"ds:inline-flex ds:items-center ds:justify-center",
|
|
214
|
-
"ds:rounded-[var(--radius-sm)] ds:text-center",
|
|
215
|
-
"ds:bg-transparent ds:text-foreground ds:cursor-pointer",
|
|
216
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
217
|
-
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
218
|
-
"ds:select-none",
|
|
219
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
220
|
-
"ds:hover:bg-muted"
|
|
221
|
-
].join(" "),
|
|
222
|
-
{
|
|
223
|
-
variants: {
|
|
224
|
-
size: {
|
|
225
|
-
sm: "ds:min-w-8 ds:h-6 ds:text-[length:var(--font-size-sm)] ds:ps-1 ds:pe-1",
|
|
226
|
-
md: "ds:min-w-10 ds:h-8 ds:text-[length:var(--font-size-base)] ds:ps-1.5 ds:pe-1.5",
|
|
227
|
-
lg: "ds:min-w-12 ds:h-10 ds:text-[length:var(--font-size-lg)] ds:ps-2 ds:pe-2"
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
defaultVariants: { size: "md" }
|
|
231
|
-
}
|
|
232
|
-
), Vt = C("ds:text-muted-foreground ds:select-none", {
|
|
233
|
-
variants: {
|
|
234
|
-
size: {
|
|
235
|
-
sm: "ds:text-[length:var(--font-size-sm)]",
|
|
236
|
-
md: "ds:text-[length:var(--font-size-base)]",
|
|
237
|
-
lg: "ds:text-[length:var(--font-size-lg)]"
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
defaultVariants: { size: "md" }
|
|
241
|
-
}), jt = C(
|
|
242
|
-
[
|
|
243
|
-
"ds:relative ds:inline-flex ds:shrink-0 ds:self-stretch ds:items-center ds:justify-center",
|
|
244
|
-
"ds:before:absolute ds:before:inset-x-0 ds:before:-inset-y-px",
|
|
245
|
-
"ds:rounded-e-[var(--radius-sm)] ds:bg-transparent ds:text-muted-foreground ds:cursor-pointer",
|
|
246
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
247
|
-
"ds:hover:bg-muted ds:hover:text-foreground",
|
|
248
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring",
|
|
249
|
-
"ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]",
|
|
250
|
-
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
251
|
-
"ds:disabled:cursor-not-allowed ds:disabled:hover:bg-transparent"
|
|
252
|
-
].join(" "),
|
|
253
|
-
{
|
|
254
|
-
variants: {
|
|
255
|
-
size: {
|
|
256
|
-
sm: "ds:min-w-8 ds:-me-[var(--spacing-sm)] ds:[&_svg]:size-4",
|
|
257
|
-
md: "ds:min-w-[var(--min-target-size)] ds:-me-[var(--spacing-md)] ds:[&_svg]:size-4",
|
|
258
|
-
lg: "ds:min-w-12 ds:-me-[var(--spacing-md)] ds:[&_svg]:size-5"
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
defaultVariants: { size: "md" }
|
|
262
|
-
}
|
|
263
|
-
), Et = C(
|
|
264
|
-
[
|
|
265
|
-
"ds:z-[var(--z-popover)] ds:flex ds:rounded-[var(--radius-md)]",
|
|
266
|
-
"ds:border ds:border-border ds:bg-background ds:text-foreground ds:shadow-[var(--shadow-lg)]",
|
|
267
|
-
"ds:p-[var(--spacing-xs)]"
|
|
268
|
-
].join(" "),
|
|
269
|
-
{
|
|
270
|
-
variants: {
|
|
271
|
-
size: {
|
|
272
|
-
sm: "ds:[--time-picker-option-size:var(--spacing-xl)] ds:text-[length:var(--font-size-sm)]",
|
|
273
|
-
md: "ds:[--time-picker-option-size:var(--min-target-size)] ds:text-[length:var(--font-size-base)]",
|
|
274
|
-
lg: "ds:[--time-picker-option-size:var(--spacing-2xl)] ds:text-[length:var(--font-size-lg)]"
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
defaultVariants: { size: "md" }
|
|
278
|
-
}
|
|
279
|
-
), Nt = C(
|
|
280
|
-
[
|
|
281
|
-
"ds:relative ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
282
|
-
"ds:max-h-[calc(var(--time-picker-option-size)*6.5)] ds:overflow-y-auto ds:overscroll-contain",
|
|
283
|
-
"ds:p-[var(--spacing-2xs)]"
|
|
284
|
-
].join(" "),
|
|
285
|
-
{
|
|
286
|
-
variants: {
|
|
287
|
-
separated: {
|
|
288
|
-
true: "ds:border-s ds:border-border",
|
|
289
|
-
false: ""
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
defaultVariants: { separated: !1 }
|
|
293
|
-
}
|
|
294
|
-
), Bt = C(
|
|
295
|
-
[
|
|
296
|
-
"ds:flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
297
|
-
"ds:h-[var(--time-picker-option-size)] ds:min-w-[var(--time-picker-option-size)]",
|
|
298
|
-
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
299
|
-
"ds:rounded-[var(--radius-sm)] ds:tabular-nums ds:whitespace-nowrap",
|
|
300
|
-
"ds:cursor-pointer ds:select-none",
|
|
301
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
302
|
-
// Inset ring: the column scrolls, so an outset ring would be clipped.
|
|
303
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
304
|
-
"ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
|
|
305
|
-
].join(" "),
|
|
306
|
-
{
|
|
307
|
-
variants: {
|
|
308
|
-
// The kit's selected treatment (the calendar's selected day): solid
|
|
309
|
-
// primary. Paired with aria-selected, so not colour alone.
|
|
310
|
-
selected: {
|
|
311
|
-
true: [
|
|
312
|
-
"ds:bg-primary ds:text-primary-foreground ds:font-semibold ds:hover:bg-primary-hover",
|
|
313
|
-
"ds:focus-visible:outline-primary-foreground",
|
|
314
|
-
"ds:forced-colors:bg-[Highlight] ds:forced-colors:text-[HighlightText]",
|
|
315
|
-
// CanvasText can sit close to Highlight in some contrast themes.
|
|
316
|
-
"ds:forced-colors:focus-visible:outline-[HighlightText]"
|
|
317
|
-
].join(" "),
|
|
318
|
-
false: [
|
|
319
|
-
"ds:text-foreground ds:hover:bg-muted ds:focus-visible:outline-ring",
|
|
320
|
-
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
321
|
-
].join(" ")
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
defaultVariants: { selected: !1 }
|
|
325
|
-
}
|
|
326
|
-
);
|
|
327
|
-
function Ut({
|
|
328
|
-
columns: r,
|
|
329
|
-
columnRefs: o,
|
|
330
|
-
onPick: u,
|
|
331
|
-
onOptionKeyDown: b
|
|
332
|
-
}) {
|
|
333
|
-
const k = r.map((h) => h.selectedIndex).join(":"), w = d(!1);
|
|
334
|
-
return Pt(() => {
|
|
335
|
-
const h = !w.current;
|
|
336
|
-
w.current = !0;
|
|
337
|
-
for (const l of Object.values(o.current)) {
|
|
338
|
-
if (!l) continue;
|
|
339
|
-
const i = l.querySelector('[aria-selected="true"]') ?? l.querySelector('[role="option"][tabindex="0"]');
|
|
340
|
-
if (!i) continue;
|
|
341
|
-
const D = i.offsetTop, I = D + i.offsetHeight, V = D >= l.scrollTop && I <= l.scrollTop + l.clientHeight;
|
|
342
|
-
(h || !V) && (l.scrollTop = D - (l.clientHeight - i.offsetHeight) / 2);
|
|
343
|
-
}
|
|
344
|
-
}, [k, o]), /* @__PURE__ */ g(bt, { children: r.map((h, l) => /* @__PURE__ */ g(
|
|
345
|
-
"div",
|
|
346
|
-
{
|
|
347
|
-
ref: (i) => {
|
|
348
|
-
o.current[h.key] = i;
|
|
349
|
-
},
|
|
350
|
-
role: "listbox",
|
|
351
|
-
"aria-label": h.label,
|
|
352
|
-
"data-column": h.key,
|
|
353
|
-
className: Nt({ separated: l > 0 }),
|
|
354
|
-
children: h.options.map((i, D) => {
|
|
355
|
-
const I = D === h.selectedIndex;
|
|
356
|
-
return /* @__PURE__ */ g(
|
|
357
|
-
"div",
|
|
358
|
-
{
|
|
359
|
-
role: "option",
|
|
360
|
-
"aria-selected": I,
|
|
361
|
-
tabIndex: D === h.anchorIndex ? 0 : -1,
|
|
362
|
-
"data-value": i.value,
|
|
363
|
-
className: Bt({ selected: I }),
|
|
364
|
-
onClick: () => u(h.key, i.value),
|
|
365
|
-
onKeyDown: (V) => b(V, l, D),
|
|
366
|
-
children: i.label
|
|
367
|
-
},
|
|
368
|
-
i.value
|
|
369
|
-
);
|
|
370
|
-
})
|
|
371
|
-
},
|
|
372
|
-
h.key
|
|
373
|
-
)) });
|
|
374
|
-
}
|
|
375
|
-
const _t = yt(
|
|
376
|
-
({
|
|
377
|
-
value: r,
|
|
378
|
-
defaultValue: o,
|
|
379
|
-
onChange: u,
|
|
380
|
-
hour12: b,
|
|
381
|
-
minuteStep: k = 1,
|
|
382
|
-
fullWidthSeparator: w = !1,
|
|
383
|
-
periodLabels: h,
|
|
384
|
-
size: l = "md",
|
|
385
|
-
dropdown: i = !1,
|
|
386
|
-
disabled: D,
|
|
387
|
-
className: I,
|
|
388
|
-
id: V,
|
|
389
|
-
"aria-label": we,
|
|
390
|
-
"aria-labelledby": Ue
|
|
391
|
-
}, _e) => {
|
|
392
|
-
const { t: j, i18n: xe } = xt("ui"), A = Dt(), qe = kt(Tt) !== null, F = Mt(A, V), c = !!(A.disabled || D), $e = A.invalid ? "error" : "default", m = b !== void 0 ? b : Ht(xe.language), Ge = It(xe.language), O = h ?? Ge, ie = r !== void 0, [We, Je] = oe(
|
|
393
|
-
r ?? o ?? { hours: 0, minutes: 0 }
|
|
394
|
-
), p = ie ? r : We, T = d(p);
|
|
395
|
-
T.current = p;
|
|
396
|
-
const y = G(
|
|
397
|
-
(e) => {
|
|
398
|
-
T.current = e, ie || Je(e), u == null || u(e);
|
|
399
|
-
},
|
|
400
|
-
[ie, u]
|
|
401
|
-
), E = d(null), R = d(null), L = d(null), Q = d(null), X = d(""), Y = d(""), M = d(null), P = d(null), Z = () => {
|
|
402
|
-
X.current = "", M.current && (clearTimeout(M.current), M.current = null);
|
|
403
|
-
}, ee = () => {
|
|
404
|
-
Y.current = "", P.current && (clearTimeout(P.current), P.current = null);
|
|
405
|
-
}, De = (e) => {
|
|
406
|
-
const t = T.current, n = H(
|
|
407
|
-
parseInt(e, 10),
|
|
408
|
-
m ? 1 : 0,
|
|
409
|
-
m ? 12 : 23
|
|
410
|
-
);
|
|
411
|
-
y({
|
|
412
|
-
...t,
|
|
413
|
-
hours: m ? Ee(n, t.hours >= 12) : n
|
|
414
|
-
});
|
|
415
|
-
}, Te = (e) => {
|
|
416
|
-
y({
|
|
417
|
-
...T.current,
|
|
418
|
-
minutes: Ft(parseInt(e, 10), k)
|
|
419
|
-
});
|
|
420
|
-
}, te = () => {
|
|
421
|
-
const e = X.current;
|
|
422
|
-
Z(), e && De(e);
|
|
423
|
-
}, re = () => {
|
|
424
|
-
const e = Y.current;
|
|
425
|
-
ee(), e && Te(e);
|
|
426
|
-
}, ae = d({
|
|
427
|
-
hour: te,
|
|
428
|
-
minute: re
|
|
429
|
-
});
|
|
430
|
-
ae.current = { hour: te, minute: re }, be(() => () => {
|
|
431
|
-
M.current && clearTimeout(M.current), P.current && clearTimeout(P.current);
|
|
432
|
-
}, []);
|
|
433
|
-
const Qe = w ? ":" : ":", Me = J(m ? ke(p.hours) : p.hours), Pe = J(p.minutes), N = p.hours >= 12, [z, Xe] = oe(!1), Ye = i && z, ce = d(z);
|
|
434
|
-
ce.current = z;
|
|
435
|
-
const x = G((e) => {
|
|
436
|
-
ce.current = e, Xe(e);
|
|
437
|
-
}, []), [Ce, Ze] = oe("ltr"), ne = d("pointer"), ue = d("hour"), B = d(null), U = d(!1), _ = d(null), le = d(null), de = d(
|
|
438
|
-
{}
|
|
439
|
-
), fe = G((e) => {
|
|
440
|
-
var t, n;
|
|
441
|
-
(n = (t = de.current[e]) == null ? void 0 : t.querySelector('[role="option"][tabindex="0"]')) == null || n.focus({ preventScroll: !0 });
|
|
442
|
-
}, []), se = G(
|
|
443
|
-
(e) => {
|
|
444
|
-
if (e) {
|
|
445
|
-
if (c) return;
|
|
446
|
-
const t = E.current;
|
|
447
|
-
Ze(
|
|
448
|
-
t && window.getComputedStyle(t).direction === "rtl" ? "rtl" : "ltr"
|
|
449
|
-
), U.current = !1;
|
|
450
|
-
}
|
|
451
|
-
x(e);
|
|
452
|
-
},
|
|
453
|
-
[c, x]
|
|
454
|
-
), Ae = (e, t, n) => {
|
|
455
|
-
if (!(!i || c)) {
|
|
456
|
-
if (ne.current = e, ue.current = t, B.current = n, z) {
|
|
457
|
-
e === "keyboard" && fe(t);
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
se(!0);
|
|
461
|
-
}
|
|
462
|
-
};
|
|
463
|
-
be(() => {
|
|
464
|
-
z && (!i || c) && x(!1);
|
|
465
|
-
}, [z, i, c, x]);
|
|
466
|
-
const me = (e, t) => !i || !e.altKey ? !1 : e.key === "ArrowUp" && z ? (e.preventDefault(), x(!1), !0) : e.key !== "ArrowDown" ? !1 : (e.preventDefault(), te(), re(), Ae("keyboard", t, e.currentTarget), !0), et = (e) => {
|
|
467
|
-
var t, n;
|
|
468
|
-
if (!c && !me(e, "hour")) {
|
|
469
|
-
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
470
|
-
e.preventDefault(), Z();
|
|
471
|
-
const s = T.current, a = e.key === "ArrowUp" ? 1 : -1, v = 23;
|
|
472
|
-
let f = s.hours + a;
|
|
473
|
-
f < 0 && (f = v), f > v && (f = 0), y({ ...s, hours: f });
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
if (e.key === "Tab" && !e.shiftKey) {
|
|
477
|
-
e.preventDefault(), (t = L.current) == null || t.focus();
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
if (e.key.length === 1 && e.key >= "0" && e.key <= "9") {
|
|
481
|
-
e.preventDefault(), M.current && clearTimeout(M.current);
|
|
482
|
-
const s = X.current + e.key;
|
|
483
|
-
s.length >= 2 || parseInt(s, 10) > (m ? 1 : 2) ? (Z(), De(s), (n = L.current) == null || n.focus()) : (X.current = s, M.current = setTimeout(
|
|
484
|
-
() => ae.current.hour(),
|
|
485
|
-
1e3
|
|
486
|
-
));
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}, tt = (e) => {
|
|
490
|
-
var t, n, s;
|
|
491
|
-
if (!c && !me(e, "minute")) {
|
|
492
|
-
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
493
|
-
e.preventDefault(), ee();
|
|
494
|
-
const a = T.current;
|
|
495
|
-
y({
|
|
496
|
-
...a,
|
|
497
|
-
minutes: Ot(
|
|
498
|
-
a.minutes,
|
|
499
|
-
k,
|
|
500
|
-
e.key === "ArrowUp" ? 1 : -1
|
|
501
|
-
)
|
|
502
|
-
});
|
|
503
|
-
return;
|
|
504
|
-
}
|
|
505
|
-
if (e.key === "Tab" && !e.shiftKey && m) {
|
|
506
|
-
e.preventDefault(), (t = Q.current) == null || t.focus();
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
if (e.key === "Tab" && e.shiftKey) {
|
|
510
|
-
e.preventDefault(), (n = R.current) == null || n.focus();
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
if (e.key.length === 1 && e.key >= "0" && e.key <= "9") {
|
|
514
|
-
e.preventDefault(), P.current && clearTimeout(P.current);
|
|
515
|
-
const a = Y.current + e.key;
|
|
516
|
-
a.length >= 2 || parseInt(a, 10) > 5 ? (ee(), Te(a), m && ((s = Q.current) == null || s.focus())) : (Y.current = a, P.current = setTimeout(
|
|
517
|
-
() => ae.current.minute(),
|
|
518
|
-
1e3
|
|
519
|
-
));
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}, rt = (e) => {
|
|
523
|
-
var s;
|
|
524
|
-
if (c || me(e, "period")) return;
|
|
525
|
-
const t = T.current, n = t.hours >= 12;
|
|
526
|
-
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
527
|
-
e.preventDefault();
|
|
528
|
-
const a = n ? t.hours - 12 : t.hours + 12;
|
|
529
|
-
y({ ...t, hours: H(a, 0, 23) });
|
|
530
|
-
return;
|
|
531
|
-
}
|
|
532
|
-
if (e.key === "Tab" && e.shiftKey) {
|
|
533
|
-
e.preventDefault(), (s = L.current) == null || s.focus();
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
(e.key === "a" || e.key === "A") && (e.preventDefault(), n && y({ ...t, hours: t.hours - 12 })), (e.key === "p" || e.key === "P") && (e.preventDefault(), n || y({ ...t, hours: t.hours + 12 }));
|
|
537
|
-
}, nt = () => {
|
|
538
|
-
te();
|
|
539
|
-
}, st = () => {
|
|
540
|
-
re();
|
|
541
|
-
}, ze = j("inputs.timePicker.hour", "Hour"), He = j("inputs.timePicker.minute", "Minute"), Ie = j("inputs.timePicker.period", "Period"), ot = j("inputs.timePicker.groupLabel", "Time"), it = j(
|
|
542
|
-
"inputs.timePicker.openDropdown",
|
|
543
|
-
"Choose time"
|
|
544
|
-
), pe = `${A.id}-label`, he = qe && !!A.label, [at, Fe] = oe(!0), ve = Ue ?? (!we && he && at ? pe : void 0), Oe = ve ? void 0 : we ?? ot;
|
|
545
|
-
be(() => {
|
|
546
|
-
var v;
|
|
547
|
-
if (!he) return;
|
|
548
|
-
const e = (v = E.current) == null ? void 0 : v.getRootNode(), t = e instanceof Document || e instanceof ShadowRoot ? e.getElementById(pe) : null;
|
|
549
|
-
if (!(t instanceof HTMLLabelElement)) {
|
|
550
|
-
Fe(!1);
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
const n = () => Fe(t.htmlFor === F);
|
|
554
|
-
n();
|
|
555
|
-
const s = new MutationObserver(n);
|
|
556
|
-
s.observe(t, { attributes: !0, attributeFilter: ["for"] });
|
|
557
|
-
const a = () => {
|
|
558
|
-
var f;
|
|
559
|
-
t.htmlFor !== F || c || (f = R.current) == null || f.focus();
|
|
560
|
-
};
|
|
561
|
-
return t.addEventListener("click", a), () => {
|
|
562
|
-
s.disconnect(), t.removeEventListener("click", a);
|
|
563
|
-
};
|
|
564
|
-
}, [he, pe, F, c]);
|
|
565
|
-
const Re = ye(
|
|
566
|
-
() => Array.from(
|
|
567
|
-
{ length: m ? 12 : 24 },
|
|
568
|
-
(e, t) => m ? t + 1 : t
|
|
569
|
-
).map((e) => ({ value: e, label: J(e) })),
|
|
570
|
-
[m]
|
|
571
|
-
), ge = ye(() => {
|
|
572
|
-
const e = [];
|
|
573
|
-
for (let t = 0; t <= 59; t += k)
|
|
574
|
-
e.push({ value: t, label: J(t) });
|
|
575
|
-
return e;
|
|
576
|
-
}, [k]), K = [];
|
|
577
|
-
if (i) {
|
|
578
|
-
const e = Re.findIndex(
|
|
579
|
-
(n) => n.value === (m ? ke(p.hours) : p.hours)
|
|
580
|
-
);
|
|
581
|
-
K.push({
|
|
582
|
-
key: "hour",
|
|
583
|
-
label: ze,
|
|
584
|
-
options: Re,
|
|
585
|
-
selectedIndex: e,
|
|
586
|
-
anchorIndex: Math.max(e, 0)
|
|
587
|
-
});
|
|
588
|
-
const t = ge.findIndex(
|
|
589
|
-
(n) => n.value === p.minutes
|
|
590
|
-
);
|
|
591
|
-
K.push({
|
|
592
|
-
key: "minute",
|
|
593
|
-
label: He,
|
|
594
|
-
options: ge,
|
|
595
|
-
selectedIndex: t,
|
|
596
|
-
anchorIndex: t >= 0 ? t : H(
|
|
597
|
-
Math.floor(p.minutes / k),
|
|
598
|
-
0,
|
|
599
|
-
ge.length - 1
|
|
600
|
-
)
|
|
601
|
-
}), m && K.push({
|
|
602
|
-
key: "period",
|
|
603
|
-
label: Ie,
|
|
604
|
-
options: [
|
|
605
|
-
{ value: 0, label: O.am },
|
|
606
|
-
{ value: 1, label: O.pm }
|
|
607
|
-
],
|
|
608
|
-
selectedIndex: N ? 1 : 0,
|
|
609
|
-
anchorIndex: N ? 1 : 0
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
const Le = (e, t) => {
|
|
613
|
-
var s;
|
|
614
|
-
Z(), ee();
|
|
615
|
-
const n = T.current;
|
|
616
|
-
if (e === "hour") {
|
|
617
|
-
const a = m ? Ee(t, n.hours >= 12) : t;
|
|
618
|
-
a !== n.hours && y({ ...n, hours: a });
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
if (e === "period") {
|
|
622
|
-
const a = t === 1;
|
|
623
|
-
a !== n.hours >= 12 && y({ ...n, hours: a ? n.hours + 12 : n.hours - 12 });
|
|
624
|
-
return;
|
|
625
|
-
}
|
|
626
|
-
t !== n.minutes && y({ ...n, minutes: t }), (s = L.current) == null || s.focus(), x(!1);
|
|
627
|
-
}, ct = (e, t, n) => {
|
|
628
|
-
var f, q, Se;
|
|
629
|
-
const s = K[t];
|
|
630
|
-
if (!s) return;
|
|
631
|
-
const a = s.options.length - 1, v = (S) => {
|
|
632
|
-
var $, Ve;
|
|
633
|
-
(Ve = ($ = de.current[s.key]) == null ? void 0 : $.querySelectorAll('[role="option"]')[S]) == null || Ve.focus();
|
|
634
|
-
};
|
|
635
|
-
if (e.altKey && e.key === "ArrowUp") {
|
|
636
|
-
e.preventDefault(), (f = B.current) == null || f.focus(), x(!1);
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
switch (e.key) {
|
|
640
|
-
case "ArrowDown":
|
|
641
|
-
e.preventDefault(), v(Math.min(n + 1, a));
|
|
642
|
-
break;
|
|
643
|
-
case "ArrowUp":
|
|
644
|
-
e.preventDefault(), v(Math.max(n - 1, 0));
|
|
645
|
-
break;
|
|
646
|
-
case "Home":
|
|
647
|
-
e.preventDefault(), v(0);
|
|
648
|
-
break;
|
|
649
|
-
case "End":
|
|
650
|
-
e.preventDefault(), v(a);
|
|
651
|
-
break;
|
|
652
|
-
case "ArrowLeft":
|
|
653
|
-
case "ArrowRight": {
|
|
654
|
-
e.preventDefault();
|
|
655
|
-
const S = e.key === "ArrowRight" == (Ce === "ltr"), $ = K[t + (S ? 1 : -1)];
|
|
656
|
-
$ && fe($.key);
|
|
657
|
-
break;
|
|
658
|
-
}
|
|
659
|
-
case "Enter":
|
|
660
|
-
case " ": {
|
|
661
|
-
e.preventDefault();
|
|
662
|
-
const S = s.options[n];
|
|
663
|
-
S && Le(s.key, S.value);
|
|
664
|
-
break;
|
|
665
|
-
}
|
|
666
|
-
case "Tab":
|
|
667
|
-
U.current = !0, e.shiftKey ? (q = R.current) == null || q.focus() : (Se = le.current) == null || Se.focus(), x(!1);
|
|
668
|
-
break;
|
|
669
|
-
}
|
|
670
|
-
}, ut = (e) => {
|
|
671
|
-
var a, v;
|
|
672
|
-
if (!i || c) return;
|
|
673
|
-
const t = e.target;
|
|
674
|
-
if (!(t instanceof Node) || (a = le.current) != null && a.contains(t)) return;
|
|
675
|
-
const n = [R.current, L.current, Q.current];
|
|
676
|
-
let s = n.find((f) => f == null ? void 0 : f.contains(t)) ?? null;
|
|
677
|
-
if (!s) {
|
|
678
|
-
const f = (v = t.ownerDocument) == null ? void 0 : v.activeElement;
|
|
679
|
-
s = n.find((q) => q && q === f) ?? R.current, s && s !== f && s.focus();
|
|
680
|
-
}
|
|
681
|
-
Ae("pointer", "hour", s);
|
|
682
|
-
}, lt = (e) => {
|
|
683
|
-
ne.current = e.detail === 0 ? "keyboard" : "pointer", ue.current = "hour", B.current = e.currentTarget;
|
|
684
|
-
}, dt = (e) => {
|
|
685
|
-
e.preventDefault(), ne.current === "keyboard" && fe(ue.current);
|
|
686
|
-
}, ft = (e) => {
|
|
687
|
-
var s;
|
|
688
|
-
e.preventDefault();
|
|
689
|
-
const t = U.current;
|
|
690
|
-
if (U.current = !1, t) return;
|
|
691
|
-
const n = document.activeElement;
|
|
692
|
-
(!n || n === document.body) && ((s = B.current) == null || s.focus());
|
|
693
|
-
}, mt = (e) => {
|
|
694
|
-
var n;
|
|
695
|
-
const t = e.target;
|
|
696
|
-
if (t instanceof Node && ((n = E.current) != null && n.contains(t))) {
|
|
697
|
-
e.preventDefault();
|
|
698
|
-
return;
|
|
699
|
-
}
|
|
700
|
-
U.current = !0;
|
|
701
|
-
}, pt = () => {
|
|
702
|
-
var e, t;
|
|
703
|
-
(e = _.current) != null && e.contains(document.activeElement) && ((t = B.current) == null || t.focus());
|
|
704
|
-
}, ht = G((e) => {
|
|
705
|
-
var n, s;
|
|
706
|
-
const t = Lt;
|
|
707
|
-
(n = _.current) == null || n.removeEventListener("wheel", t), (s = _.current) == null || s.removeEventListener("touchmove", t), _.current = e, e == null || e.addEventListener("wheel", t, { passive: !0 }), e == null || e.addEventListener("touchmove", t, { passive: !0 });
|
|
708
|
-
}, []), vt = (e) => {
|
|
709
|
-
var t;
|
|
710
|
-
(t = _.current) != null && t.contains(document.activeElement) || e.preventDefault();
|
|
711
|
-
}, gt = ye(
|
|
712
|
-
() => ({
|
|
713
|
-
getValue: () => p,
|
|
714
|
-
setValue: (e) => y(Rt(e)),
|
|
715
|
-
clear: () => y({ hours: 0, minutes: 0 }),
|
|
716
|
-
isOpen: () => i && ce.current,
|
|
717
|
-
open: () => {
|
|
718
|
-
!i || c || (ne.current = "pointer", se(!0));
|
|
719
|
-
},
|
|
720
|
-
close: () => {
|
|
721
|
-
i && x(!1);
|
|
722
|
-
}
|
|
723
|
-
}),
|
|
724
|
-
[
|
|
725
|
-
p,
|
|
726
|
-
y,
|
|
727
|
-
i,
|
|
728
|
-
c,
|
|
729
|
-
se,
|
|
730
|
-
x
|
|
731
|
-
]
|
|
732
|
-
);
|
|
733
|
-
wt(_e, () => E.current, []), Ct(zt, gt, F);
|
|
734
|
-
const Ke = (
|
|
735
|
-
// eslint-disable-next-line jsx-a11y/role-supports-aria-props, jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- aria-invalid is a global ARIA state conveying group-level validation; the click is a pointer shortcut to the list, which the keyboard opens with Alt+ArrowDown or the clock button
|
|
736
|
-
/* @__PURE__ */ je(
|
|
737
|
-
"div",
|
|
738
|
-
{
|
|
739
|
-
ref: E,
|
|
740
|
-
id: F,
|
|
741
|
-
role: "group",
|
|
742
|
-
"aria-label": Oe,
|
|
743
|
-
"aria-labelledby": ve,
|
|
744
|
-
"aria-describedby": A.describedBy || void 0,
|
|
745
|
-
"aria-invalid": A.invalid || void 0,
|
|
746
|
-
"aria-disabled": c || void 0,
|
|
747
|
-
"data-component": "time-picker",
|
|
748
|
-
"data-component-id": F,
|
|
749
|
-
className: Kt({
|
|
750
|
-
size: l,
|
|
751
|
-
tone: $e,
|
|
752
|
-
isDisabled: c,
|
|
753
|
-
opensOnClick: i && !c,
|
|
754
|
-
className: I
|
|
755
|
-
}),
|
|
756
|
-
onClick: i ? ut : void 0,
|
|
757
|
-
children: [
|
|
758
|
-
/* @__PURE__ */ g(
|
|
759
|
-
"span",
|
|
760
|
-
{
|
|
761
|
-
ref: R,
|
|
762
|
-
role: "spinbutton",
|
|
763
|
-
"aria-disabled": c || void 0,
|
|
764
|
-
"aria-label": ze,
|
|
765
|
-
"aria-valuemin": m ? 1 : 0,
|
|
766
|
-
"aria-valuemax": m ? 12 : 23,
|
|
767
|
-
"aria-valuenow": m ? ke(p.hours) : p.hours,
|
|
768
|
-
"aria-valuetext": Me,
|
|
769
|
-
"aria-keyshortcuts": i ? "Alt+ArrowDown" : void 0,
|
|
770
|
-
tabIndex: c ? -1 : 0,
|
|
771
|
-
inputMode: "numeric",
|
|
772
|
-
onKeyDown: et,
|
|
773
|
-
onBlur: nt,
|
|
774
|
-
className: Ne({ size: l }),
|
|
775
|
-
children: Me
|
|
776
|
-
}
|
|
777
|
-
),
|
|
778
|
-
/* @__PURE__ */ g("span", { "aria-hidden": "true", className: Vt({ size: l }), children: Qe }),
|
|
779
|
-
/* @__PURE__ */ g(
|
|
780
|
-
"span",
|
|
781
|
-
{
|
|
782
|
-
ref: L,
|
|
783
|
-
role: "spinbutton",
|
|
784
|
-
"aria-disabled": c || void 0,
|
|
785
|
-
"aria-label": He,
|
|
786
|
-
"aria-valuemin": 0,
|
|
787
|
-
"aria-valuemax": 59,
|
|
788
|
-
"aria-valuenow": p.minutes,
|
|
789
|
-
"aria-valuetext": Pe,
|
|
790
|
-
"aria-keyshortcuts": i ? "Alt+ArrowDown" : void 0,
|
|
791
|
-
tabIndex: c ? -1 : 0,
|
|
792
|
-
inputMode: "numeric",
|
|
793
|
-
onKeyDown: tt,
|
|
794
|
-
onBlur: st,
|
|
795
|
-
className: Ne({ size: l }),
|
|
796
|
-
children: Pe
|
|
797
|
-
}
|
|
798
|
-
),
|
|
799
|
-
m ? /* @__PURE__ */ g(
|
|
800
|
-
"span",
|
|
801
|
-
{
|
|
802
|
-
ref: Q,
|
|
803
|
-
role: "spinbutton",
|
|
804
|
-
"aria-disabled": c || void 0,
|
|
805
|
-
"aria-label": Ie,
|
|
806
|
-
"aria-valuemin": 0,
|
|
807
|
-
"aria-valuemax": 1,
|
|
808
|
-
"aria-valuenow": N ? 1 : 0,
|
|
809
|
-
"aria-valuetext": N ? O.pm : O.am,
|
|
810
|
-
"aria-keyshortcuts": i ? "Alt+ArrowDown" : void 0,
|
|
811
|
-
tabIndex: c ? -1 : 0,
|
|
812
|
-
onKeyDown: rt,
|
|
813
|
-
className: St({ size: l }),
|
|
814
|
-
children: N ? O.pm : O.am
|
|
815
|
-
}
|
|
816
|
-
) : null,
|
|
817
|
-
i ? /* @__PURE__ */ g(W.Trigger, { asChild: !0, children: /* @__PURE__ */ g(
|
|
818
|
-
"button",
|
|
819
|
-
{
|
|
820
|
-
ref: le,
|
|
821
|
-
type: "button",
|
|
822
|
-
"aria-label": it,
|
|
823
|
-
disabled: c,
|
|
824
|
-
onClick: lt,
|
|
825
|
-
className: jt({ size: l }),
|
|
826
|
-
children: /* @__PURE__ */ g(At, { "aria-hidden": "true" })
|
|
827
|
-
}
|
|
828
|
-
) }) : null
|
|
829
|
-
]
|
|
830
|
-
}
|
|
831
|
-
)
|
|
832
|
-
);
|
|
833
|
-
return i ? /* @__PURE__ */ je(W.Root, { open: Ye, onOpenChange: se, children: [
|
|
834
|
-
/* @__PURE__ */ g(W.Anchor, { asChild: !0, children: Ke }),
|
|
835
|
-
/* @__PURE__ */ g(W.Portal, { children: /* @__PURE__ */ g(
|
|
836
|
-
W.Content,
|
|
837
|
-
{
|
|
838
|
-
ref: ht,
|
|
839
|
-
side: "bottom",
|
|
840
|
-
align: "start",
|
|
841
|
-
sideOffset: 4,
|
|
842
|
-
dir: Ce,
|
|
843
|
-
"data-component": "time-picker-dropdown",
|
|
844
|
-
"aria-label": Oe,
|
|
845
|
-
"aria-labelledby": ve,
|
|
846
|
-
className: Et({ size: l }),
|
|
847
|
-
onOpenAutoFocus: dt,
|
|
848
|
-
onCloseAutoFocus: ft,
|
|
849
|
-
onInteractOutside: mt,
|
|
850
|
-
onEscapeKeyDown: pt,
|
|
851
|
-
onMouseDown: vt,
|
|
852
|
-
children: /* @__PURE__ */ g(
|
|
853
|
-
Ut,
|
|
854
|
-
{
|
|
855
|
-
columns: K,
|
|
856
|
-
columnRefs: de,
|
|
857
|
-
onPick: Le,
|
|
858
|
-
onOptionKeyDown: ct
|
|
859
|
-
}
|
|
860
|
-
)
|
|
861
|
-
}
|
|
862
|
-
) })
|
|
863
|
-
] }) : Ke;
|
|
864
|
-
}
|
|
865
|
-
);
|
|
866
|
-
_t.displayName = "TimePicker";
|
|
867
|
-
export {
|
|
868
|
-
_t as T,
|
|
869
|
-
zt as t
|
|
870
|
-
};
|
|
871
|
-
//# sourceMappingURL=time-picker-DVfyAR81.js.map
|