@alfadocs/ui-kit 1.121.0 → 1.122.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/addDays-CuE8wLqb.js +9 -0
- package/dist/_chunks/{anamnesis-summary-rows-BbAREK-3.js → anamnesis-summary-rows-CtcULkvc.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-86YVlMYJ.js → antenatal-schedule-timeline-XHbig8On.js} +3 -3
- package/dist/_chunks/{appointment-timeline-CC7nmBOH.js → appointment-timeline-Czd4PBkF.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-DPjab0eJ.js → balance-badge-cell-DtxbGJcA.js} +2 -2
- package/dist/_chunks/{bill-line-table-DUMEHnQ4.js → bill-line-table-HrynB7ND.js} +2 -2
- package/dist/_chunks/{calendar-appointment-editor-dialog-rw02sXGw.js → calendar-appointment-editor-dialog-CiCmsBCH.js} +5 -5
- package/dist/_chunks/{cycle-calculator-C8nWAeTk.js → cycle-calculator-WFhMfJHt.js} +4 -3
- package/dist/_chunks/{data-grid-Bbf8t4z3.js → data-grid-C71BhGDw.js} +2 -2
- package/dist/_chunks/{date-picker-DBVTj6lO.js → date-picker-BmVBVpVu.js} +3 -3
- package/dist/_chunks/{date-picker-variants-J1EeAhIH.js → date-picker-variants-DmfVRNDB.js} +184 -188
- package/dist/_chunks/{date-range-panel-CT6nXjRM.js → date-range-panel-CT9Pk-HF.js} +2 -2
- package/dist/_chunks/{date-range-picker-PTRpDkXT.js → date-range-picker-2Up_FRrM.js} +40 -39
- package/dist/_chunks/{date-time-picker-CJnqiQoT.js → date-time-picker-C6b_Vymc.js} +2 -2
- package/dist/_chunks/{default-tabs-Cxkw1Ws0.js → default-tabs-RvCI5uN0.js} +3 -3
- package/dist/_chunks/{due-date-calculator-c1NJPw9F.js → due-date-calculator-CALlODZe.js} +4 -4
- package/dist/_chunks/{gestational-age-calculator-Cg4Gq42R.js → gestational-age-calculator-mB6brTlp.js} +5 -5
- package/dist/_chunks/{hcg-doubling-BjTa_77t.js → hcg-doubling-Dhdt3Jyd.js} +3 -3
- package/dist/_chunks/{invoice-upload-list-CsFsRgbt.js → invoice-upload-list-C95s5Q7m.js} +3 -3
- package/dist/_chunks/{kit-extensions-C3oL0WTp.js → kit-extensions-DUaIYyMD.js} +4 -4
- package/dist/_chunks/{link-cell-renderer-NFNGdAGt.js → link-cell-renderer-BEaLczk2.js} +2 -2
- package/dist/_chunks/{map-view-h6ngp2xi.js → map-view-QWdQLHi9.js} +543 -495
- package/dist/_chunks/{parse-BLBWPIgE.js → parse-BFur8Byx.js} +2 -2
- package/dist/_chunks/{patient-details-C4dHR4iu.js → patient-details-Cba9HQj_.js} +2 -2
- package/dist/_chunks/{patient-field-row-0QP8KCVp.js → patient-field-row-CtDihADs.js} +2 -2
- package/dist/_chunks/{patient-summary-card-x0-AhCyC.js → patient-summary-card-DnLdbtsw.js} +2 -2
- package/dist/_chunks/practice-results-BCLqPdgn.js +2683 -0
- package/dist/_chunks/{pregnancy-dating-BO6diQMZ.js → pregnancy-dating-BNI32qNw.js} +5 -5
- package/dist/_chunks/{radiograph-panel.agent-Dcv16n7u.js → radiograph-panel.agent-B-r3BoqU.js} +3 -3
- package/dist/_chunks/{reserved.agent-DRSZ8UcL.js → reserved.agent-CCwsOb3M.js} +8 -7
- package/dist/_chunks/{send-registration-link-form-DuZQuKnI.js → send-registration-link-form-BjkXr0TD.js} +3 -3
- package/dist/_chunks/{slot-grid-b4eZXokb.js → slot-grid-DEZRB4Yb.js} +234 -207
- package/dist/_chunks/subDays-DC99JK7a.js +8 -0
- package/dist/_chunks/{task-editor-Czcx9B-3.js → task-editor-C05yx7JJ.js} +2 -2
- package/dist/_chunks/{toolbar-DoKcoE2q.js → toolbar-Dznu_Dou.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-B-SXnszJ.js → use-appointment-details-read-Bm408XzX.js} +2 -2
- package/dist/agent-catalog.json +3 -3
- package/dist/agent-i18n/en.json +1 -1
- package/dist/browser-support.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/bill-line-table/index.js +1 -1
- package/dist/components/bill-table/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-grid/index.js +2 -2
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/invoice-upload-list/index.js +1 -1
- package/dist/components/map-view/index.d.ts +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +18 -0
- 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/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results-slot-card.d.ts +38 -0
- package/dist/components/practice-results/practice-results.d.ts +32 -2
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/slot-grid/slot-grid.d.ts +19 -0
- package/dist/components/task-editor/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/host-compat.css +9 -1
- package/dist/i18n/locales/ar.d.ts +5 -0
- package/dist/i18n/locales/ar.js +6 -1
- package/dist/i18n/locales/de.d.ts +5 -0
- package/dist/i18n/locales/de.js +6 -1
- package/dist/i18n/locales/el.d.ts +5 -0
- package/dist/i18n/locales/el.js +6 -1
- package/dist/i18n/locales/en.d.ts +5 -0
- package/dist/i18n/locales/en.js +5 -0
- package/dist/i18n/locales/es.d.ts +5 -0
- package/dist/i18n/locales/es.js +6 -1
- package/dist/i18n/locales/fr.d.ts +5 -0
- package/dist/i18n/locales/fr.js +6 -1
- package/dist/i18n/locales/hi.d.ts +5 -0
- package/dist/i18n/locales/hi.js +6 -1
- package/dist/i18n/locales/it.d.ts +5 -0
- package/dist/i18n/locales/it.js +6 -1
- package/dist/i18n/locales/ja.d.ts +5 -0
- package/dist/i18n/locales/ja.js +6 -1
- package/dist/i18n/locales/nl.d.ts +5 -0
- package/dist/i18n/locales/nl.js +6 -1
- package/dist/i18n/locales/pl.d.ts +5 -0
- package/dist/i18n/locales/pl.js +6 -1
- package/dist/i18n/locales/pt.d.ts +5 -0
- package/dist/i18n/locales/pt.js +6 -1
- package/dist/i18n/locales/ro.d.ts +5 -0
- package/dist/i18n/locales/ro.js +6 -1
- package/dist/i18n/locales/ru.d.ts +5 -0
- package/dist/i18n/locales/ru.js +6 -1
- package/dist/i18n/locales/sq.d.ts +5 -0
- package/dist/i18n/locales/sq.js +6 -1
- package/dist/i18n/locales/sv.d.ts +5 -0
- package/dist/i18n/locales/sv.js +6 -1
- package/dist/i18n/locales/tr.d.ts +5 -0
- package/dist/i18n/locales/tr.js +6 -1
- package/dist/i18n/locales/zh.d.ts +5 -0
- package/dist/i18n/locales/zh.js +6 -1
- package/dist/index.js +30 -30
- package/dist/locales/ar.json +6 -1
- package/dist/locales/de.json +6 -1
- package/dist/locales/el.json +6 -1
- package/dist/locales/en.json +5 -0
- package/dist/locales/es.json +6 -1
- package/dist/locales/fr.json +6 -1
- package/dist/locales/hi.json +6 -1
- package/dist/locales/it.json +6 -1
- package/dist/locales/ja.json +6 -1
- package/dist/locales/nl.json +6 -1
- package/dist/locales/pl.json +6 -1
- package/dist/locales/pt.json +6 -1
- package/dist/locales/ro.json +6 -1
- package/dist/locales/ru.json +6 -1
- package/dist/locales/sq.json +6 -1
- package/dist/locales/sv.json +6 -1
- package/dist/locales/tr.json +6 -1
- package/dist/locales/zh.json +6 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/send-registration-link-form/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/practice-results-yCresv86.js +0 -2326
- package/dist/_chunks/subDays-Bsoy023P.js +0 -8
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as a, jsxs as b, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as xe, useId as Se, useState as ke, useCallback as M, useRef as De, useEffect as Ie, useMemo as Ge } from "react";
|
|
3
3
|
import { c as g } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { B as
|
|
6
|
-
import { I as
|
|
7
|
-
import { E as
|
|
8
|
-
import { S as
|
|
9
|
-
import { u as
|
|
10
|
-
import { a as
|
|
11
|
-
import { p as
|
|
12
|
-
const
|
|
4
|
+
import { useTranslation as Ne } from "react-i18next";
|
|
5
|
+
import { B as Q } from "./button-DohK_Ak_.js";
|
|
6
|
+
import { I as U } from "./icon-button-S8_weU3g.js";
|
|
7
|
+
import { E as Ke } from "./empty-state-DwJ5YNzz.js";
|
|
8
|
+
import { S as Y } from "./skeleton-tTWJpvAq.js";
|
|
9
|
+
import { u as Me } from "./registry-DvAUVLHh.js";
|
|
10
|
+
import { a as ze, f as Ce } from "./format-ql5WTsYT.js";
|
|
11
|
+
import { p as Re } from "./parseISO-Dl4T9peU.js";
|
|
12
|
+
const Le = {
|
|
13
13
|
id: "slot-grid",
|
|
14
14
|
// pick → `select_slot` + the `selectedSlotId` state slot.
|
|
15
15
|
// range_navigate → `next_days` / `previous_days` + `hasNext` / `hasPrevious`.
|
|
@@ -102,7 +102,7 @@ const Me = {
|
|
|
102
102
|
note: "Book the 09:30 slot on 1 September."
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
|
-
invoke: (e,
|
|
105
|
+
invoke: (e, r) => e.selectSlot(r.slotId)
|
|
106
106
|
},
|
|
107
107
|
next_days: {
|
|
108
108
|
// View-window paging only — the consumer fetches, nothing is persisted.
|
|
@@ -165,7 +165,7 @@ const Me = {
|
|
|
165
165
|
note: "Reveal the rest of 1 September so every slot button is clickable."
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
|
-
invoke: (e,
|
|
168
|
+
invoke: (e, r) => e.showMoreDay(r.dayKey)
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
171
|
domHooks: {
|
|
@@ -185,7 +185,7 @@ const Me = {
|
|
|
185
185
|
description: "Per-slot button identifier sourced from each `SlotGridSlot.id` — an availability id, never a patient id. DOM-driving agents activate a slot via native click on the matching button."
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
},
|
|
188
|
+
}, Be = g(
|
|
189
189
|
[
|
|
190
190
|
"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
191
191
|
"ds:text-[var(--foreground)]",
|
|
@@ -201,9 +201,9 @@ const Me = {
|
|
|
201
201
|
},
|
|
202
202
|
defaultVariants: { size: "md" }
|
|
203
203
|
}
|
|
204
|
-
),
|
|
204
|
+
), Ee = g(
|
|
205
205
|
"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full"
|
|
206
|
-
),
|
|
206
|
+
), Ve = 12, je = g(
|
|
207
207
|
"ds:grid ds:gap-[var(--spacing-sm)] ds:w-full ds:auto-rows-min ds:items-start",
|
|
208
208
|
{
|
|
209
209
|
variants: {
|
|
@@ -225,10 +225,10 @@ const Me = {
|
|
|
225
225
|
defaultVariants: { cols: 1 }
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
|
-
function
|
|
229
|
-
return Math.max(1, Math.min(e,
|
|
228
|
+
function Te(e) {
|
|
229
|
+
return Math.max(1, Math.min(e, Ve));
|
|
230
230
|
}
|
|
231
|
-
const
|
|
231
|
+
const Z = g(
|
|
232
232
|
[
|
|
233
233
|
"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
234
234
|
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
@@ -237,7 +237,7 @@ const Q = g(
|
|
|
237
237
|
"ds:bg-[var(--card)]",
|
|
238
238
|
"ds:min-w-0"
|
|
239
239
|
].join(" ")
|
|
240
|
-
),
|
|
240
|
+
), Pe = g(
|
|
241
241
|
[
|
|
242
242
|
"ds:font-[var(--font-weight-semibold)]",
|
|
243
243
|
"ds:text-[var(--foreground)]",
|
|
@@ -254,9 +254,9 @@ const Q = g(
|
|
|
254
254
|
},
|
|
255
255
|
defaultVariants: { size: "md" }
|
|
256
256
|
}
|
|
257
|
-
),
|
|
257
|
+
), ee = g(
|
|
258
258
|
"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full ds:m-0 ds:p-0 ds:list-none"
|
|
259
|
-
),
|
|
259
|
+
), _e = g(
|
|
260
260
|
[
|
|
261
261
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
262
262
|
"ds:w-full",
|
|
@@ -280,40 +280,44 @@ const Q = g(
|
|
|
280
280
|
].join(" "),
|
|
281
281
|
{
|
|
282
282
|
variants: {
|
|
283
|
+
nowrap: {
|
|
284
|
+
true: "ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap",
|
|
285
|
+
false: ""
|
|
286
|
+
},
|
|
283
287
|
size: {
|
|
284
288
|
sm: "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:text-[length:var(--font-size-xs)] ds:h-8",
|
|
285
289
|
md: "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-sm)] ds:h-10",
|
|
286
290
|
lg: "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-base)] ds:h-12"
|
|
287
291
|
}
|
|
288
292
|
},
|
|
289
|
-
defaultVariants: { size: "md" }
|
|
293
|
+
defaultVariants: { size: "md", nowrap: !1 }
|
|
290
294
|
}
|
|
291
295
|
);
|
|
292
|
-
function
|
|
293
|
-
return e instanceof Date ? e :
|
|
296
|
+
function y(e) {
|
|
297
|
+
return e instanceof Date ? e : Re(e);
|
|
294
298
|
}
|
|
295
|
-
function z(e,
|
|
296
|
-
return `${
|
|
299
|
+
function z(e, r) {
|
|
300
|
+
return `${y(e.date).toISOString()}-${r}`;
|
|
297
301
|
}
|
|
298
|
-
function
|
|
299
|
-
return
|
|
302
|
+
function D(e) {
|
|
303
|
+
return Ce(y(e.date), "yyyy-MM-dd");
|
|
300
304
|
}
|
|
301
|
-
function
|
|
302
|
-
return
|
|
305
|
+
function at(e, r) {
|
|
306
|
+
return ze(y(e), y(r));
|
|
303
307
|
}
|
|
304
|
-
function
|
|
305
|
-
for (const
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
+
function rt(e) {
|
|
309
|
+
for (const r of e) {
|
|
310
|
+
const o = r.slots.find((l) => l.available !== !1);
|
|
311
|
+
if (o) return { day: r, slot: o };
|
|
308
312
|
}
|
|
309
313
|
}
|
|
310
|
-
function
|
|
314
|
+
function te(e, r, o) {
|
|
311
315
|
try {
|
|
312
|
-
return new Intl.DateTimeFormat(
|
|
316
|
+
return new Intl.DateTimeFormat(r, {
|
|
313
317
|
weekday: "short",
|
|
314
318
|
month: "short",
|
|
315
319
|
day: "numeric",
|
|
316
|
-
timeZone:
|
|
320
|
+
timeZone: o
|
|
317
321
|
}).format(e);
|
|
318
322
|
} catch {
|
|
319
323
|
return new Intl.DateTimeFormat("en", {
|
|
@@ -323,36 +327,36 @@ function Y(e, a, d) {
|
|
|
323
327
|
}).format(e);
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
|
-
function
|
|
330
|
+
function se(e, r, o) {
|
|
327
331
|
if (e.label !== void 0) return e.label;
|
|
328
|
-
const
|
|
332
|
+
const l = y(e.start);
|
|
329
333
|
try {
|
|
330
|
-
const
|
|
334
|
+
const p = new Intl.DateTimeFormat(r, {
|
|
331
335
|
hour: "numeric",
|
|
332
336
|
minute: "2-digit",
|
|
333
|
-
timeZone:
|
|
337
|
+
timeZone: o
|
|
334
338
|
});
|
|
335
339
|
if (e.end) {
|
|
336
|
-
const
|
|
337
|
-
if (typeof
|
|
340
|
+
const v = y(e.end);
|
|
341
|
+
if (typeof p.formatRange == "function")
|
|
338
342
|
try {
|
|
339
|
-
return
|
|
343
|
+
return p.formatRange(l, v);
|
|
340
344
|
} catch {
|
|
341
345
|
}
|
|
342
|
-
return `${
|
|
346
|
+
return `${p.format(l)} – ${p.format(v)}`;
|
|
343
347
|
}
|
|
344
|
-
return
|
|
348
|
+
return p.format(l);
|
|
345
349
|
} catch {
|
|
346
|
-
return
|
|
350
|
+
return l.toISOString();
|
|
347
351
|
}
|
|
348
352
|
}
|
|
349
|
-
function
|
|
353
|
+
function $e(e, r, o, l, p) {
|
|
350
354
|
if (e.ariaLabel !== void 0) return e.ariaLabel;
|
|
351
|
-
const
|
|
352
|
-
return
|
|
355
|
+
const v = se(e, o, l), c = r.label !== void 0 ? r.label : te(y(r.date), o, l);
|
|
356
|
+
return p({ time: v, day: c });
|
|
353
357
|
}
|
|
354
|
-
function
|
|
355
|
-
return /* @__PURE__ */
|
|
358
|
+
function Ae() {
|
|
359
|
+
return /* @__PURE__ */ a(
|
|
356
360
|
"svg",
|
|
357
361
|
{
|
|
358
362
|
"aria-hidden": "true",
|
|
@@ -363,12 +367,12 @@ function Te() {
|
|
|
363
367
|
strokeLinecap: "round",
|
|
364
368
|
strokeLinejoin: "round",
|
|
365
369
|
className: "ds:size-4",
|
|
366
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ a("path", { d: "M15 18l-6-6 6-6" })
|
|
367
371
|
}
|
|
368
372
|
);
|
|
369
373
|
}
|
|
370
|
-
function
|
|
371
|
-
return /* @__PURE__ */
|
|
374
|
+
function He() {
|
|
375
|
+
return /* @__PURE__ */ a(
|
|
372
376
|
"svg",
|
|
373
377
|
{
|
|
374
378
|
"aria-hidden": "true",
|
|
@@ -379,290 +383,313 @@ function Pe() {
|
|
|
379
383
|
strokeLinecap: "round",
|
|
380
384
|
strokeLinejoin: "round",
|
|
381
385
|
className: "ds:size-4",
|
|
382
|
-
children: /* @__PURE__ */
|
|
386
|
+
children: /* @__PURE__ */ a("path", { d: "M9 6l6 6-6 6" })
|
|
383
387
|
}
|
|
384
388
|
);
|
|
385
389
|
}
|
|
386
|
-
const
|
|
390
|
+
const Oe = xe(
|
|
387
391
|
({
|
|
388
392
|
days: e,
|
|
389
|
-
state:
|
|
390
|
-
emptyDescription:
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
state: r = "default",
|
|
394
|
+
emptyDescription: o,
|
|
395
|
+
compactEmptyDays: l = !1,
|
|
396
|
+
dayHeadingLevel: p = 3,
|
|
397
|
+
nowrapTimes: v = !1,
|
|
398
|
+
size: c = "md",
|
|
399
|
+
selectedSlotId: C,
|
|
400
|
+
maxInitialSlotsPerDay: R = 6,
|
|
401
|
+
locale: ae,
|
|
395
402
|
timeZone: I,
|
|
396
|
-
hasPrevious:
|
|
397
|
-
hasNext:
|
|
398
|
-
showNextAvailable:
|
|
399
|
-
ariaLabel:
|
|
400
|
-
onSlotSelect:
|
|
401
|
-
onPreviousDays:
|
|
402
|
-
onNextDays:
|
|
403
|
-
onShowMore:
|
|
404
|
-
onJumpToNextAvailable:
|
|
405
|
-
className:
|
|
403
|
+
hasPrevious: L = !1,
|
|
404
|
+
hasNext: B = !1,
|
|
405
|
+
showNextAvailable: re = !1,
|
|
406
|
+
ariaLabel: ne,
|
|
407
|
+
onSlotSelect: w,
|
|
408
|
+
onPreviousDays: E,
|
|
409
|
+
onNextDays: V,
|
|
410
|
+
onShowMore: x,
|
|
411
|
+
onJumpToNextAvailable: ie,
|
|
412
|
+
className: oe,
|
|
406
413
|
id: G,
|
|
407
|
-
...
|
|
408
|
-
},
|
|
409
|
-
const { t: u, i18n:
|
|
414
|
+
...de
|
|
415
|
+
}, le) => {
|
|
416
|
+
const { t: u, i18n: ce } = Ne("ui"), N = ae ?? ce.language ?? "en", ue = Se(), [j, pe] = ke({}), T = r === "loading", P = r === "disabled", f = T || P, me = r === "empty" || e.length === 0 || e.every((s) => s.slots.length === 0), fe = ne ?? u("slotGrid.ariaLabel"), S = M(
|
|
410
417
|
(s, t) => {
|
|
411
|
-
|
|
418
|
+
f || s.available !== !1 && (w == null || w(s, t));
|
|
412
419
|
},
|
|
413
|
-
[
|
|
414
|
-
),
|
|
420
|
+
[f, w]
|
|
421
|
+
), _ = M(
|
|
415
422
|
(s, t) => {
|
|
416
|
-
|
|
423
|
+
pe((n) => ({ ...n, [t]: !0 })), x == null || x(s);
|
|
417
424
|
},
|
|
418
|
-
[
|
|
419
|
-
),
|
|
425
|
+
[x]
|
|
426
|
+
), he = M(
|
|
420
427
|
(s, t, n) => {
|
|
421
|
-
(s.key === "Enter" || s.key === " ") && (s.preventDefault(),
|
|
428
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), S(t, n));
|
|
422
429
|
},
|
|
423
|
-
[
|
|
424
|
-
),
|
|
430
|
+
[S]
|
|
431
|
+
), $ = {
|
|
425
432
|
days: e,
|
|
426
|
-
selectedSlotId:
|
|
427
|
-
hasPrevious:
|
|
428
|
-
hasNext:
|
|
429
|
-
state:
|
|
430
|
-
expanded:
|
|
431
|
-
isInteractionSuppressed:
|
|
432
|
-
onPreviousDays:
|
|
433
|
-
onNextDays:
|
|
434
|
-
handleSlotClick:
|
|
435
|
-
handleShowMore:
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
|
|
433
|
+
selectedSlotId: C,
|
|
434
|
+
hasPrevious: L,
|
|
435
|
+
hasNext: B,
|
|
436
|
+
state: r,
|
|
437
|
+
expanded: j,
|
|
438
|
+
isInteractionSuppressed: f,
|
|
439
|
+
onPreviousDays: E,
|
|
440
|
+
onNextDays: V,
|
|
441
|
+
handleSlotClick: S,
|
|
442
|
+
handleShowMore: _
|
|
443
|
+
}, d = De($);
|
|
444
|
+
Ie(() => {
|
|
445
|
+
d.current = $;
|
|
439
446
|
});
|
|
440
|
-
const
|
|
447
|
+
const ye = Ge(
|
|
441
448
|
() => ({
|
|
442
|
-
getStatus: () =>
|
|
443
|
-
getSelectedSlotId: () =>
|
|
444
|
-
getVisibleDays: () =>
|
|
449
|
+
getStatus: () => d.current.state,
|
|
450
|
+
getSelectedSlotId: () => d.current.selectedSlotId ?? null,
|
|
451
|
+
getVisibleDays: () => d.current.days.map(D),
|
|
445
452
|
getSlotsByDay: () => {
|
|
446
453
|
const s = {};
|
|
447
|
-
for (const t of
|
|
448
|
-
const n =
|
|
449
|
-
s[n] = s[n] ? [...s[n], ...
|
|
454
|
+
for (const t of d.current.days) {
|
|
455
|
+
const n = D(t), i = t.slots.filter((m) => m.available !== !1).map((m) => m.id);
|
|
456
|
+
s[n] = s[n] ? [...s[n], ...i] : i;
|
|
450
457
|
}
|
|
451
458
|
return s;
|
|
452
459
|
},
|
|
453
|
-
getExpandedDays: () =>
|
|
454
|
-
(s, t) =>
|
|
455
|
-
).map(
|
|
456
|
-
getHasPrevious: () =>
|
|
457
|
-
getHasNext: () =>
|
|
460
|
+
getExpandedDays: () => d.current.days.filter(
|
|
461
|
+
(s, t) => d.current.expanded[z(s, t)] === !0
|
|
462
|
+
).map(D),
|
|
463
|
+
getHasPrevious: () => d.current.hasPrevious,
|
|
464
|
+
getHasNext: () => d.current.hasNext,
|
|
458
465
|
selectSlot: (s) => {
|
|
459
|
-
const t =
|
|
466
|
+
const t = d.current;
|
|
460
467
|
if (t.isInteractionSuppressed) return !1;
|
|
461
468
|
for (const n of t.days) {
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
469
|
+
const i = n.slots.find((m) => m.id === s);
|
|
470
|
+
if (i)
|
|
471
|
+
return i.available === !1 ? !1 : (t.handleSlotClick(i, n), !0);
|
|
465
472
|
}
|
|
466
473
|
return !1;
|
|
467
474
|
},
|
|
468
475
|
nextDays: () => {
|
|
469
|
-
const s =
|
|
476
|
+
const s = d.current;
|
|
470
477
|
return !s.hasNext || s.isInteractionSuppressed || !s.onNextDays ? !1 : (s.onNextDays(), !0);
|
|
471
478
|
},
|
|
472
479
|
previousDays: () => {
|
|
473
|
-
const s =
|
|
480
|
+
const s = d.current;
|
|
474
481
|
return !s.hasPrevious || s.isInteractionSuppressed || !s.onPreviousDays ? !1 : (s.onPreviousDays(), !0);
|
|
475
482
|
},
|
|
476
483
|
showMoreDay: (s) => {
|
|
477
|
-
const t =
|
|
484
|
+
const t = d.current;
|
|
478
485
|
if (t.isInteractionSuppressed) return !1;
|
|
479
486
|
const n = t.days.findIndex(
|
|
480
|
-
(m) =>
|
|
487
|
+
(m) => D(m) === s
|
|
481
488
|
);
|
|
482
489
|
if (n < 0) return !1;
|
|
483
|
-
const
|
|
484
|
-
return t.handleShowMore(
|
|
490
|
+
const i = t.days[n];
|
|
491
|
+
return t.handleShowMore(i, z(i, n)), !0;
|
|
485
492
|
}
|
|
486
493
|
}),
|
|
487
494
|
[]
|
|
488
495
|
);
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
let
|
|
492
|
-
if (
|
|
493
|
-
|
|
496
|
+
Me(Le, ye, G);
|
|
497
|
+
const ge = `h${p}`, A = Te(e.length || 1), H = je({ cols: A });
|
|
498
|
+
let k;
|
|
499
|
+
if (T)
|
|
500
|
+
k = /* @__PURE__ */ a(
|
|
494
501
|
"div",
|
|
495
502
|
{
|
|
496
|
-
className:
|
|
503
|
+
className: H,
|
|
497
504
|
"data-state": "loading",
|
|
498
505
|
role: "status",
|
|
499
506
|
"aria-live": "polite",
|
|
500
507
|
"aria-label": u("common.loading"),
|
|
501
|
-
children: Array.from({ length:
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
{ length: Math.min(
|
|
505
|
-
(n,
|
|
506
|
-
|
|
508
|
+
children: Array.from({ length: A }, (s, t) => /* @__PURE__ */ b("div", { className: Z(), children: [
|
|
509
|
+
/* @__PURE__ */ a(Y, { variant: "text", size: c, width: "60%" }),
|
|
510
|
+
/* @__PURE__ */ a("div", { className: ee(), children: Array.from(
|
|
511
|
+
{ length: Math.min(R, 4) },
|
|
512
|
+
(n, i) => /* @__PURE__ */ a(
|
|
513
|
+
Y,
|
|
507
514
|
{
|
|
508
515
|
variant: "rounded",
|
|
509
|
-
size:
|
|
516
|
+
size: c,
|
|
510
517
|
height: "40px"
|
|
511
518
|
},
|
|
512
|
-
`loading-slot-${t}-${
|
|
519
|
+
`loading-slot-${t}-${i}`
|
|
513
520
|
)
|
|
514
521
|
) })
|
|
515
522
|
] }, `loading-col-${t}`))
|
|
516
523
|
}
|
|
517
524
|
);
|
|
518
|
-
else if (
|
|
519
|
-
|
|
520
|
-
|
|
525
|
+
else if (me)
|
|
526
|
+
k = l ? /* @__PURE__ */ a(
|
|
527
|
+
"p",
|
|
528
|
+
{
|
|
529
|
+
"data-state": "empty",
|
|
530
|
+
className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0 ds:text-start",
|
|
531
|
+
children: u("slotGrid.noSlots")
|
|
532
|
+
}
|
|
533
|
+
) : /* @__PURE__ */ a("div", { "data-state": "empty", children: /* @__PURE__ */ a(
|
|
534
|
+
Ke,
|
|
521
535
|
{
|
|
522
536
|
variant: "no-results",
|
|
523
537
|
title: u("slotGrid.noSlots"),
|
|
524
|
-
description:
|
|
538
|
+
description: o
|
|
525
539
|
}
|
|
526
540
|
) });
|
|
527
541
|
else {
|
|
528
542
|
const s = e.some((t) => t.slots.length === 0);
|
|
529
|
-
|
|
530
|
-
/* @__PURE__ */
|
|
543
|
+
k = /* @__PURE__ */ b(J, { children: [
|
|
544
|
+
/* @__PURE__ */ a(
|
|
531
545
|
"div",
|
|
532
546
|
{
|
|
533
|
-
className:
|
|
534
|
-
"data-state":
|
|
547
|
+
className: H,
|
|
548
|
+
"data-state": P ? "disabled" : "default",
|
|
535
549
|
children: e.map((t, n) => {
|
|
536
|
-
const
|
|
550
|
+
const i = z(t, n), m = t.label ?? te(y(t.date), N, I), O = `${ue}-day-${n}-header`, F = j[i] ?? !1 ? t.slots : t.slots.slice(0, R), q = t.slots.length - F.length, W = t.slots.length === 0;
|
|
537
551
|
return (
|
|
538
552
|
// Use a plain <div role="group"> rather than <section> — a
|
|
539
553
|
// <section> with aria-labelledby is a landmark, and nesting many
|
|
540
554
|
// landmarks inside the outer slot-grid landmark fails axe's
|
|
541
555
|
// landmark-unique rule.
|
|
542
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ b(
|
|
543
557
|
"div",
|
|
544
558
|
{
|
|
545
559
|
role: "group",
|
|
546
|
-
className:
|
|
547
|
-
"aria-labelledby":
|
|
548
|
-
"data-empty":
|
|
560
|
+
className: Z(),
|
|
561
|
+
"aria-labelledby": O,
|
|
562
|
+
"data-empty": W || void 0,
|
|
549
563
|
children: [
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
564
|
+
/* @__PURE__ */ a(
|
|
565
|
+
ge,
|
|
566
|
+
{
|
|
567
|
+
id: O,
|
|
568
|
+
className: Pe({ size: c }),
|
|
569
|
+
children: m
|
|
570
|
+
}
|
|
571
|
+
),
|
|
572
|
+
W ? /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: l ? /* @__PURE__ */ b(J, { children: [
|
|
573
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", children: "–" }),
|
|
574
|
+
/* @__PURE__ */ a("span", { className: "ds:sr-only", children: u("slotGrid.noSlots") })
|
|
575
|
+
] }) : u("slotGrid.noSlots") }) : null,
|
|
576
|
+
/* @__PURE__ */ a("ul", { className: ee(), children: F.map((h) => {
|
|
577
|
+
const ve = $e(
|
|
578
|
+
h,
|
|
555
579
|
t,
|
|
556
580
|
N,
|
|
557
581
|
I,
|
|
558
|
-
({ time: K, day:
|
|
559
|
-
),
|
|
560
|
-
return /* @__PURE__ */
|
|
582
|
+
({ time: K, day: we }) => u("slotGrid.slotLabel", { time: K, day: we })
|
|
583
|
+
), be = C === h.id, X = h.available === !1 || f;
|
|
584
|
+
return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
561
585
|
"button",
|
|
562
586
|
{
|
|
563
587
|
type: "button",
|
|
564
|
-
className:
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"aria-
|
|
569
|
-
"
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
588
|
+
className: _e({
|
|
589
|
+
size: c,
|
|
590
|
+
nowrap: v
|
|
591
|
+
}),
|
|
592
|
+
"aria-label": ve,
|
|
593
|
+
"aria-pressed": be,
|
|
594
|
+
disabled: X,
|
|
595
|
+
"aria-disabled": X || void 0,
|
|
596
|
+
"data-slot-id": h.id,
|
|
597
|
+
onClick: () => S(h, t),
|
|
598
|
+
onKeyDown: (K) => he(K, h, t),
|
|
599
|
+
children: se(h, N, I)
|
|
573
600
|
}
|
|
574
|
-
) },
|
|
601
|
+
) }, h.id);
|
|
575
602
|
}) }),
|
|
576
|
-
|
|
577
|
-
|
|
603
|
+
q > 0 ? /* @__PURE__ */ a(
|
|
604
|
+
Q,
|
|
578
605
|
{
|
|
579
606
|
intent: "ghost",
|
|
580
|
-
size:
|
|
581
|
-
onClick: () =>
|
|
582
|
-
disabled:
|
|
583
|
-
children: u("slotGrid.showMore", { count:
|
|
607
|
+
size: c === "lg" ? "md" : "sm",
|
|
608
|
+
onClick: () => _(t, i),
|
|
609
|
+
disabled: f,
|
|
610
|
+
children: u("slotGrid.showMore", { count: q })
|
|
584
611
|
}
|
|
585
612
|
) : null
|
|
586
613
|
]
|
|
587
614
|
},
|
|
588
|
-
|
|
615
|
+
i
|
|
589
616
|
)
|
|
590
617
|
);
|
|
591
618
|
})
|
|
592
619
|
}
|
|
593
620
|
),
|
|
594
|
-
s &&
|
|
621
|
+
s && o ? /* @__PURE__ */ a(
|
|
595
622
|
"p",
|
|
596
623
|
{
|
|
597
624
|
className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0 ds:text-start",
|
|
598
625
|
"data-slot-grid-hint": "",
|
|
599
|
-
children:
|
|
626
|
+
children: o
|
|
600
627
|
}
|
|
601
628
|
) : null
|
|
602
629
|
] });
|
|
603
630
|
}
|
|
604
|
-
return /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ b(
|
|
605
632
|
"div",
|
|
606
633
|
{
|
|
607
|
-
ref:
|
|
634
|
+
ref: le,
|
|
608
635
|
id: G,
|
|
609
636
|
role: "region",
|
|
610
|
-
"aria-label":
|
|
611
|
-
className:
|
|
637
|
+
"aria-label": fe,
|
|
638
|
+
className: Be({ size: c, className: oe }),
|
|
612
639
|
"data-component": "slot-grid",
|
|
613
640
|
"data-component-id": G,
|
|
614
|
-
"data-state":
|
|
615
|
-
...
|
|
641
|
+
"data-state": r,
|
|
642
|
+
...de,
|
|
616
643
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
|
|
644
|
+
/* @__PURE__ */ b("div", { className: Ee(), children: [
|
|
645
|
+
/* @__PURE__ */ a(
|
|
646
|
+
U,
|
|
620
647
|
{
|
|
621
|
-
icon: /* @__PURE__ */
|
|
648
|
+
icon: /* @__PURE__ */ a(Ae, {}),
|
|
622
649
|
"aria-label": u("slotGrid.previousDays"),
|
|
623
650
|
className: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)] ds:sm:min-h-[var(--min-target-size)]",
|
|
624
|
-
size:
|
|
651
|
+
size: c === "lg" ? "md" : "sm",
|
|
625
652
|
intent: "ghost",
|
|
626
653
|
flipIconInRtl: !0,
|
|
627
|
-
disabled: !
|
|
628
|
-
onClick:
|
|
654
|
+
disabled: !L || f,
|
|
655
|
+
onClick: E
|
|
629
656
|
}
|
|
630
657
|
),
|
|
631
|
-
|
|
632
|
-
|
|
658
|
+
re ? /* @__PURE__ */ a(
|
|
659
|
+
Q,
|
|
633
660
|
{
|
|
634
661
|
intent: "secondary",
|
|
635
|
-
size:
|
|
636
|
-
disabled:
|
|
637
|
-
onClick:
|
|
662
|
+
size: c === "lg" ? "md" : "sm",
|
|
663
|
+
disabled: f,
|
|
664
|
+
onClick: ie,
|
|
638
665
|
children: u("slotGrid.nextAvailable")
|
|
639
666
|
}
|
|
640
|
-
) : /* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
|
|
667
|
+
) : /* @__PURE__ */ a("span", { "aria-hidden": "true" }),
|
|
668
|
+
/* @__PURE__ */ a(
|
|
669
|
+
U,
|
|
643
670
|
{
|
|
644
|
-
icon: /* @__PURE__ */
|
|
671
|
+
icon: /* @__PURE__ */ a(He, {}),
|
|
645
672
|
"aria-label": u("slotGrid.nextDays"),
|
|
646
673
|
className: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)] ds:sm:min-h-[var(--min-target-size)]",
|
|
647
|
-
size:
|
|
674
|
+
size: c === "lg" ? "md" : "sm",
|
|
648
675
|
intent: "ghost",
|
|
649
676
|
flipIconInRtl: !0,
|
|
650
|
-
disabled: !
|
|
651
|
-
onClick:
|
|
677
|
+
disabled: !B || f,
|
|
678
|
+
onClick: V
|
|
652
679
|
}
|
|
653
680
|
)
|
|
654
681
|
] }),
|
|
655
|
-
|
|
682
|
+
k
|
|
656
683
|
]
|
|
657
684
|
}
|
|
658
685
|
);
|
|
659
686
|
}
|
|
660
687
|
);
|
|
661
|
-
|
|
688
|
+
Oe.displayName = "SlotGrid";
|
|
662
689
|
export {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
690
|
+
Oe as S,
|
|
691
|
+
rt as f,
|
|
692
|
+
at as i,
|
|
693
|
+
Le as s
|
|
667
694
|
};
|
|
668
|
-
//# sourceMappingURL=slot-grid-
|
|
695
|
+
//# sourceMappingURL=slot-grid-DEZRB4Yb.js.map
|