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