@alfadocs/ui-kit 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/{calendar-appointment-editor-dialog-CsVWoRcP.js → calendar-appointment-editor-dialog-WDKc3jMA.js} +3 -3
- package/dist/_chunks/chart-pMkQN-qy.js +1550 -0
- package/dist/_chunks/{date-time-picker-n-yrlMJq.js → date-time-picker-cwsWiB4q.js} +2 -2
- package/dist/_chunks/{hcg-doubling-K41Wy7LB.js → hcg-doubling-DQe1ptNB.js} +2 -2
- package/dist/_chunks/{reserved.agent-XU88crNW.js → reserved.agent-BvwjDyne.js} +2 -2
- package/dist/_chunks/{slot-grid-B-IAFX3C.js → slot-grid-BhjaLJ0o.js} +229 -214
- package/dist/_chunks/{task-editor-BZeSBxwU.js → task-editor-Cv7xSakv.js} +2 -2
- package/dist/_chunks/time-picker-DSt-ns5F.js +914 -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.d.ts +55 -0
- package/dist/components/chart/index.d.ts +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/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/i18n/locales/ar.d.ts +4 -1
- package/dist/i18n/locales/ar.js +6 -3
- package/dist/i18n/locales/de.d.ts +5 -2
- package/dist/i18n/locales/de.js +7 -4
- package/dist/i18n/locales/el.d.ts +5 -2
- package/dist/i18n/locales/el.js +7 -4
- package/dist/i18n/locales/en.d.ts +5 -2
- package/dist/i18n/locales/en.js +6 -3
- package/dist/i18n/locales/es.d.ts +5 -2
- package/dist/i18n/locales/es.js +7 -4
- package/dist/i18n/locales/fr.d.ts +4 -1
- package/dist/i18n/locales/fr.js +6 -3
- package/dist/i18n/locales/hi.d.ts +5 -2
- package/dist/i18n/locales/hi.js +7 -4
- package/dist/i18n/locales/it.d.ts +5 -2
- package/dist/i18n/locales/it.js +7 -4
- package/dist/i18n/locales/ja.d.ts +5 -2
- package/dist/i18n/locales/ja.js +7 -4
- package/dist/i18n/locales/nl.d.ts +5 -2
- package/dist/i18n/locales/nl.js +7 -4
- package/dist/i18n/locales/pl.d.ts +5 -2
- package/dist/i18n/locales/pl.js +7 -4
- package/dist/i18n/locales/pt.d.ts +4 -1
- package/dist/i18n/locales/pt.js +6 -3
- package/dist/i18n/locales/ro.d.ts +5 -2
- package/dist/i18n/locales/ro.js +7 -4
- package/dist/i18n/locales/ru.d.ts +5 -2
- package/dist/i18n/locales/ru.js +7 -4
- package/dist/i18n/locales/sq.d.ts +5 -2
- package/dist/i18n/locales/sq.js +7 -4
- package/dist/i18n/locales/sv.d.ts +5 -2
- package/dist/i18n/locales/sv.js +7 -4
- package/dist/i18n/locales/tr.d.ts +5 -2
- package/dist/i18n/locales/tr.js +7 -4
- package/dist/i18n/locales/zh.d.ts +5 -2
- package/dist/i18n/locales/zh.js +7 -4
- 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/time-picker-DVfyAR81.js +0 -871
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as r, jsxs as v, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as r, jsxs as v, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ge, useId as ve, useState as be, useCallback as M, useRef as we, useEffect as xe, useMemo as Se } 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 { d as
|
|
11
|
-
import { p as
|
|
12
|
-
const
|
|
4
|
+
import { useTranslation as ke } from "react-i18next";
|
|
5
|
+
import { B as W } from "./button-DohK_Ak_.js";
|
|
6
|
+
import { I as X } from "./icon-button-S8_weU3g.js";
|
|
7
|
+
import { E as De } from "./empty-state-DwJ5YNzz.js";
|
|
8
|
+
import { S as J } from "./skeleton-tTWJpvAq.js";
|
|
9
|
+
import { u as Ie } from "./registry-DvAUVLHh.js";
|
|
10
|
+
import { d as Ge, f as Ne } from "./format--x5jypvH.js";
|
|
11
|
+
import { p as Ke } from "./parseISO-DZZ5a-zK.js";
|
|
12
|
+
const Me = {
|
|
13
13
|
id: "slot-grid",
|
|
14
14
|
// pick → `select_slot` + the `selectedSlotId` state slot.
|
|
15
15
|
// range_navigate → `next_days` / `previous_days` + `hasNext` / `hasPrevious`.
|
|
@@ -185,7 +185,7 @@ const Ke = {
|
|
|
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
|
+
}, ze = 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 Ke = {
|
|
|
201
201
|
},
|
|
202
202
|
defaultVariants: { size: "md" }
|
|
203
203
|
}
|
|
204
|
-
),
|
|
204
|
+
), Ce = g(
|
|
205
205
|
"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full"
|
|
206
|
-
),
|
|
206
|
+
), Re = 12, Le = 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 Ke = {
|
|
|
225
225
|
defaultVariants: { cols: 1 }
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
|
-
function
|
|
229
|
-
return Math.max(1, Math.min(e,
|
|
228
|
+
function Ee(e) {
|
|
229
|
+
return Math.max(1, Math.min(e, Re));
|
|
230
230
|
}
|
|
231
|
-
const
|
|
231
|
+
const Q = 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)]",
|
|
@@ -254,9 +254,9 @@ const J = g(
|
|
|
254
254
|
},
|
|
255
255
|
defaultVariants: { size: "md" }
|
|
256
256
|
}
|
|
257
|
-
),
|
|
257
|
+
), U = 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
|
+
), Ve = g(
|
|
260
260
|
[
|
|
261
261
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
262
262
|
"ds:w-full",
|
|
@@ -290,30 +290,30 @@ const J = g(
|
|
|
290
290
|
}
|
|
291
291
|
);
|
|
292
292
|
function h(e) {
|
|
293
|
-
return e instanceof Date ? e :
|
|
293
|
+
return e instanceof Date ? e : Ke(e);
|
|
294
294
|
}
|
|
295
295
|
function z(e, a) {
|
|
296
296
|
return `${h(e.date).toISOString()}-${a}`;
|
|
297
297
|
}
|
|
298
298
|
function k(e) {
|
|
299
|
-
return
|
|
299
|
+
return Ne(h(e.date), "yyyy-MM-dd");
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
return
|
|
301
|
+
function Ze(e, a) {
|
|
302
|
+
return Ge(h(e), h(a));
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function et(e) {
|
|
305
305
|
for (const a of e) {
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
306
|
+
const d = a.slots.find((i) => i.available !== !1);
|
|
307
|
+
if (d) return { day: a, slot: d };
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Y(e, a, d) {
|
|
311
311
|
try {
|
|
312
312
|
return new Intl.DateTimeFormat(a, {
|
|
313
313
|
weekday: "short",
|
|
314
314
|
month: "short",
|
|
315
315
|
day: "numeric",
|
|
316
|
-
timeZone:
|
|
316
|
+
timeZone: d
|
|
317
317
|
}).format(e);
|
|
318
318
|
} catch {
|
|
319
319
|
return new Intl.DateTimeFormat("en", {
|
|
@@ -323,14 +323,14 @@ function U(e, a, o) {
|
|
|
323
323
|
}).format(e);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Z(e, a, d) {
|
|
327
327
|
if (e.label !== void 0) return e.label;
|
|
328
328
|
const i = h(e.start);
|
|
329
329
|
try {
|
|
330
330
|
const c = new Intl.DateTimeFormat(a, {
|
|
331
331
|
hour: "numeric",
|
|
332
332
|
minute: "2-digit",
|
|
333
|
-
timeZone:
|
|
333
|
+
timeZone: d
|
|
334
334
|
});
|
|
335
335
|
if (e.end) {
|
|
336
336
|
const y = h(e.end);
|
|
@@ -346,12 +346,12 @@ function Y(e, a, o) {
|
|
|
346
346
|
return i.toISOString();
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function je(e, a, d, i, c) {
|
|
350
350
|
if (e.ariaLabel !== void 0) return e.ariaLabel;
|
|
351
|
-
const y =
|
|
351
|
+
const y = Z(e, d, i), D = a.label !== void 0 ? a.label : Y(h(a.date), d, i);
|
|
352
352
|
return c({ time: y, day: D });
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Te() {
|
|
355
355
|
return /* @__PURE__ */ r(
|
|
356
356
|
"svg",
|
|
357
357
|
{
|
|
@@ -367,7 +367,7 @@ function je() {
|
|
|
367
367
|
}
|
|
368
368
|
);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Pe() {
|
|
371
371
|
return /* @__PURE__ */ r(
|
|
372
372
|
"svg",
|
|
373
373
|
{
|
|
@@ -383,11 +383,11 @@ function Te() {
|
|
|
383
383
|
}
|
|
384
384
|
);
|
|
385
385
|
}
|
|
386
|
-
const
|
|
386
|
+
const _e = ge(
|
|
387
387
|
({
|
|
388
388
|
days: e,
|
|
389
389
|
state: a = "default",
|
|
390
|
-
emptyDescription:
|
|
390
|
+
emptyDescription: d,
|
|
391
391
|
size: i = "md",
|
|
392
392
|
selectedSlotId: c,
|
|
393
393
|
maxInitialSlotsPerDay: y = 6,
|
|
@@ -395,30 +395,30 @@ const Pe = ye(
|
|
|
395
395
|
timeZone: I,
|
|
396
396
|
hasPrevious: C = !1,
|
|
397
397
|
hasNext: R = !1,
|
|
398
|
-
showNextAvailable:
|
|
399
|
-
ariaLabel:
|
|
398
|
+
showNextAvailable: ee = !1,
|
|
399
|
+
ariaLabel: te,
|
|
400
400
|
onSlotSelect: b,
|
|
401
401
|
onPreviousDays: L,
|
|
402
|
-
onNextDays:
|
|
402
|
+
onNextDays: E,
|
|
403
403
|
onShowMore: w,
|
|
404
|
-
onJumpToNextAvailable:
|
|
405
|
-
className:
|
|
404
|
+
onJumpToNextAvailable: se,
|
|
405
|
+
className: ae,
|
|
406
406
|
id: G,
|
|
407
|
-
...
|
|
408
|
-
},
|
|
409
|
-
const { t:
|
|
410
|
-
(
|
|
411
|
-
|
|
407
|
+
...re
|
|
408
|
+
}, ie) => {
|
|
409
|
+
const { t: u, i18n: ne } = ke("ui"), N = D ?? ne.language ?? "en", oe = ve(), [B, de] = be({}), V = a === "loading", j = a === "disabled", p = V || j, le = a === "empty" || e.length === 0 || e.every((s) => s.slots.length === 0), ce = te ?? u("slotGrid.ariaLabel"), x = M(
|
|
410
|
+
(s, t) => {
|
|
411
|
+
p || s.available !== !1 && (b == null || b(s, t));
|
|
412
412
|
},
|
|
413
|
-
[
|
|
413
|
+
[p, b]
|
|
414
414
|
), T = M(
|
|
415
|
-
(
|
|
416
|
-
|
|
415
|
+
(s, t) => {
|
|
416
|
+
de((n) => ({ ...n, [t]: !0 })), w == null || w(s);
|
|
417
417
|
},
|
|
418
418
|
[w]
|
|
419
|
-
),
|
|
420
|
-
(
|
|
421
|
-
(
|
|
419
|
+
), ue = M(
|
|
420
|
+
(s, t, n) => {
|
|
421
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), x(t, n));
|
|
422
422
|
},
|
|
423
423
|
[x]
|
|
424
424
|
), P = {
|
|
@@ -427,213 +427,228 @@ const Pe = ye(
|
|
|
427
427
|
hasPrevious: C,
|
|
428
428
|
hasNext: R,
|
|
429
429
|
state: a,
|
|
430
|
-
expanded:
|
|
431
|
-
isInteractionSuppressed:
|
|
430
|
+
expanded: B,
|
|
431
|
+
isInteractionSuppressed: p,
|
|
432
432
|
onPreviousDays: L,
|
|
433
|
-
onNextDays:
|
|
433
|
+
onNextDays: E,
|
|
434
434
|
handleSlotClick: x,
|
|
435
435
|
handleShowMore: T
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
}, l = we(P);
|
|
437
|
+
xe(() => {
|
|
438
|
+
l.current = P;
|
|
439
439
|
});
|
|
440
|
-
const
|
|
440
|
+
const me = Se(
|
|
441
441
|
() => ({
|
|
442
|
-
getStatus: () =>
|
|
443
|
-
getSelectedSlotId: () =>
|
|
444
|
-
getVisibleDays: () =>
|
|
442
|
+
getStatus: () => l.current.state,
|
|
443
|
+
getSelectedSlotId: () => l.current.selectedSlotId ?? null,
|
|
444
|
+
getVisibleDays: () => l.current.days.map(k),
|
|
445
445
|
getSlotsByDay: () => {
|
|
446
|
-
const
|
|
447
|
-
for (const
|
|
448
|
-
const n = k(
|
|
449
|
-
|
|
446
|
+
const s = {};
|
|
447
|
+
for (const t of l.current.days) {
|
|
448
|
+
const n = k(t), o = t.slots.filter((m) => m.available !== !1).map((m) => m.id);
|
|
449
|
+
s[n] = s[n] ? [...s[n], ...o] : o;
|
|
450
450
|
}
|
|
451
|
-
return
|
|
451
|
+
return s;
|
|
452
452
|
},
|
|
453
|
-
getExpandedDays: () =>
|
|
454
|
-
(
|
|
453
|
+
getExpandedDays: () => l.current.days.filter(
|
|
454
|
+
(s, t) => l.current.expanded[z(s, t)] === !0
|
|
455
455
|
).map(k),
|
|
456
|
-
getHasPrevious: () =>
|
|
457
|
-
getHasNext: () =>
|
|
458
|
-
selectSlot: (
|
|
459
|
-
const
|
|
460
|
-
if (
|
|
461
|
-
for (const n of
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
456
|
+
getHasPrevious: () => l.current.hasPrevious,
|
|
457
|
+
getHasNext: () => l.current.hasNext,
|
|
458
|
+
selectSlot: (s) => {
|
|
459
|
+
const t = l.current;
|
|
460
|
+
if (t.isInteractionSuppressed) return !1;
|
|
461
|
+
for (const n of t.days) {
|
|
462
|
+
const o = n.slots.find((m) => m.id === s);
|
|
463
|
+
if (o)
|
|
464
|
+
return o.available === !1 ? !1 : (t.handleSlotClick(o, n), !0);
|
|
465
465
|
}
|
|
466
466
|
return !1;
|
|
467
467
|
},
|
|
468
468
|
nextDays: () => {
|
|
469
|
-
const
|
|
470
|
-
return !
|
|
469
|
+
const s = l.current;
|
|
470
|
+
return !s.hasNext || s.isInteractionSuppressed || !s.onNextDays ? !1 : (s.onNextDays(), !0);
|
|
471
471
|
},
|
|
472
472
|
previousDays: () => {
|
|
473
|
-
const
|
|
474
|
-
return !
|
|
473
|
+
const s = l.current;
|
|
474
|
+
return !s.hasPrevious || s.isInteractionSuppressed || !s.onPreviousDays ? !1 : (s.onPreviousDays(), !0);
|
|
475
475
|
},
|
|
476
|
-
showMoreDay: (
|
|
477
|
-
const
|
|
478
|
-
if (
|
|
479
|
-
const n =
|
|
480
|
-
(
|
|
476
|
+
showMoreDay: (s) => {
|
|
477
|
+
const t = l.current;
|
|
478
|
+
if (t.isInteractionSuppressed) return !1;
|
|
479
|
+
const n = t.days.findIndex(
|
|
480
|
+
(m) => k(m) === s
|
|
481
481
|
);
|
|
482
482
|
if (n < 0) return !1;
|
|
483
|
-
const
|
|
484
|
-
return
|
|
483
|
+
const o = t.days[n];
|
|
484
|
+
return t.handleShowMore(o, z(o, n)), !0;
|
|
485
485
|
}
|
|
486
486
|
}),
|
|
487
487
|
[]
|
|
488
488
|
);
|
|
489
|
-
|
|
490
|
-
const _ =
|
|
489
|
+
Ie(Me, me, G);
|
|
490
|
+
const _ = Ee(e.length || 1), A = Le({ cols: _ });
|
|
491
491
|
let S;
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
|
|
503
|
-
{
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
role
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
492
|
+
if (V)
|
|
493
|
+
S = /* @__PURE__ */ r(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
className: A,
|
|
497
|
+
"data-state": "loading",
|
|
498
|
+
role: "status",
|
|
499
|
+
"aria-live": "polite",
|
|
500
|
+
"aria-label": u("common.loading"),
|
|
501
|
+
children: Array.from({ length: _ }, (s, t) => /* @__PURE__ */ v("div", { className: Q(), children: [
|
|
502
|
+
/* @__PURE__ */ r(J, { variant: "text", size: i, width: "60%" }),
|
|
503
|
+
/* @__PURE__ */ r("div", { className: U(), children: Array.from(
|
|
504
|
+
{ length: Math.min(y, 4) },
|
|
505
|
+
(n, o) => /* @__PURE__ */ r(
|
|
506
|
+
J,
|
|
507
|
+
{
|
|
508
|
+
variant: "rounded",
|
|
509
|
+
size: i,
|
|
510
|
+
height: "40px"
|
|
511
|
+
},
|
|
512
|
+
`loading-slot-${t}-${o}`
|
|
513
|
+
)
|
|
514
|
+
) })
|
|
515
|
+
] }, `loading-col-${t}`))
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
else if (le)
|
|
519
|
+
S = /* @__PURE__ */ r("div", { "data-state": "empty", children: /* @__PURE__ */ r(
|
|
520
|
+
De,
|
|
521
|
+
{
|
|
522
|
+
variant: "no-results",
|
|
523
|
+
title: u("slotGrid.noSlots"),
|
|
524
|
+
description: d
|
|
525
|
+
}
|
|
526
|
+
) });
|
|
527
|
+
else {
|
|
528
|
+
const s = e.some((t) => t.slots.length === 0);
|
|
529
|
+
S = /* @__PURE__ */ v(ye, { children: [
|
|
530
|
+
/* @__PURE__ */ r(
|
|
531
|
+
"div",
|
|
532
|
+
{
|
|
533
|
+
className: A,
|
|
534
|
+
"data-state": j ? "disabled" : "default",
|
|
535
|
+
children: e.map((t, n) => {
|
|
536
|
+
const o = z(t, n), m = t.label ?? Y(h(t.date), N, I), $ = `${oe}-day-${n}-header`, H = B[o] ?? !1 ? t.slots : t.slots.slice(0, y), O = t.slots.length - H.length, F = t.slots.length === 0;
|
|
537
|
+
return (
|
|
538
|
+
// Use a plain <div role="group"> rather than <section> — a
|
|
539
|
+
// <section> with aria-labelledby is a landmark, and nesting many
|
|
540
|
+
// landmarks inside the outer slot-grid landmark fails axe's
|
|
541
|
+
// landmark-unique rule.
|
|
542
|
+
/* @__PURE__ */ v(
|
|
543
|
+
"div",
|
|
544
|
+
{
|
|
545
|
+
role: "group",
|
|
546
|
+
className: Q(),
|
|
547
|
+
"aria-labelledby": $,
|
|
548
|
+
"data-empty": F || void 0,
|
|
549
|
+
children: [
|
|
550
|
+
/* @__PURE__ */ r("h3", { id: $, className: Be({ size: i }), children: m }),
|
|
551
|
+
F ? /* @__PURE__ */ r("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: u("slotGrid.noSlots") }) : null,
|
|
552
|
+
/* @__PURE__ */ r("ul", { className: U(), children: H.map((f) => {
|
|
553
|
+
const pe = je(
|
|
554
|
+
f,
|
|
555
|
+
t,
|
|
556
|
+
N,
|
|
557
|
+
I,
|
|
558
|
+
({ time: K, day: he }) => u("slotGrid.slotLabel", { time: K, day: he })
|
|
559
|
+
), fe = c === f.id, q = f.available === !1 || p;
|
|
560
|
+
return /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
561
|
+
"button",
|
|
562
|
+
{
|
|
563
|
+
type: "button",
|
|
564
|
+
className: Ve({ size: i }),
|
|
565
|
+
"aria-label": pe,
|
|
566
|
+
"aria-pressed": fe,
|
|
567
|
+
disabled: q,
|
|
568
|
+
"aria-disabled": q || void 0,
|
|
569
|
+
"data-slot-id": f.id,
|
|
570
|
+
onClick: () => x(f, t),
|
|
571
|
+
onKeyDown: (K) => ue(K, f, t),
|
|
572
|
+
children: Z(f, N, I)
|
|
573
|
+
}
|
|
574
|
+
) }, f.id);
|
|
575
|
+
}) }),
|
|
576
|
+
O > 0 ? /* @__PURE__ */ r(
|
|
577
|
+
W,
|
|
578
|
+
{
|
|
579
|
+
intent: "ghost",
|
|
580
|
+
size: i === "lg" ? "md" : "sm",
|
|
581
|
+
onClick: () => T(t, o),
|
|
582
|
+
disabled: p,
|
|
583
|
+
children: u("slotGrid.showMore", { count: O })
|
|
584
|
+
}
|
|
585
|
+
) : null
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
o
|
|
589
|
+
)
|
|
590
|
+
);
|
|
591
|
+
})
|
|
592
|
+
}
|
|
593
|
+
),
|
|
594
|
+
s && d ? /* @__PURE__ */ r(
|
|
595
|
+
"p",
|
|
596
|
+
{
|
|
597
|
+
className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0 ds:text-start",
|
|
598
|
+
"data-slot-grid-hint": "",
|
|
599
|
+
children: d
|
|
600
|
+
}
|
|
601
|
+
) : null
|
|
602
|
+
] });
|
|
603
|
+
}
|
|
604
|
+
return /* @__PURE__ */ v(
|
|
590
605
|
"div",
|
|
591
606
|
{
|
|
592
|
-
ref:
|
|
607
|
+
ref: ie,
|
|
593
608
|
id: G,
|
|
594
609
|
role: "region",
|
|
595
|
-
"aria-label":
|
|
596
|
-
className:
|
|
610
|
+
"aria-label": ce,
|
|
611
|
+
className: ze({ size: i, className: ae }),
|
|
597
612
|
"data-component": "slot-grid",
|
|
598
613
|
"data-component-id": G,
|
|
599
614
|
"data-state": a,
|
|
600
|
-
...
|
|
615
|
+
...re,
|
|
601
616
|
children: [
|
|
602
|
-
/* @__PURE__ */ v("div", { className:
|
|
617
|
+
/* @__PURE__ */ v("div", { className: Ce(), children: [
|
|
603
618
|
/* @__PURE__ */ r(
|
|
604
|
-
|
|
619
|
+
X,
|
|
605
620
|
{
|
|
606
|
-
icon: /* @__PURE__ */ r(
|
|
607
|
-
"aria-label":
|
|
621
|
+
icon: /* @__PURE__ */ r(Te, {}),
|
|
622
|
+
"aria-label": u("slotGrid.previousDays"),
|
|
608
623
|
className: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)] ds:sm:min-h-[var(--min-target-size)]",
|
|
609
624
|
size: i === "lg" ? "md" : "sm",
|
|
610
625
|
intent: "ghost",
|
|
611
626
|
flipIconInRtl: !0,
|
|
612
|
-
disabled: !C ||
|
|
627
|
+
disabled: !C || p,
|
|
613
628
|
onClick: L
|
|
614
629
|
}
|
|
615
630
|
),
|
|
616
|
-
|
|
617
|
-
|
|
631
|
+
ee ? /* @__PURE__ */ r(
|
|
632
|
+
W,
|
|
618
633
|
{
|
|
619
634
|
intent: "secondary",
|
|
620
635
|
size: i === "lg" ? "md" : "sm",
|
|
621
|
-
disabled:
|
|
622
|
-
onClick:
|
|
623
|
-
children:
|
|
636
|
+
disabled: p,
|
|
637
|
+
onClick: se,
|
|
638
|
+
children: u("slotGrid.nextAvailable")
|
|
624
639
|
}
|
|
625
640
|
) : /* @__PURE__ */ r("span", { "aria-hidden": "true" }),
|
|
626
641
|
/* @__PURE__ */ r(
|
|
627
|
-
|
|
642
|
+
X,
|
|
628
643
|
{
|
|
629
|
-
icon: /* @__PURE__ */ r(
|
|
630
|
-
"aria-label":
|
|
644
|
+
icon: /* @__PURE__ */ r(Pe, {}),
|
|
645
|
+
"aria-label": u("slotGrid.nextDays"),
|
|
631
646
|
className: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)] ds:sm:min-h-[var(--min-target-size)]",
|
|
632
647
|
size: i === "lg" ? "md" : "sm",
|
|
633
648
|
intent: "ghost",
|
|
634
649
|
flipIconInRtl: !0,
|
|
635
|
-
disabled: !R ||
|
|
636
|
-
onClick:
|
|
650
|
+
disabled: !R || p,
|
|
651
|
+
onClick: E
|
|
637
652
|
}
|
|
638
653
|
)
|
|
639
654
|
] }),
|
|
@@ -643,11 +658,11 @@ const Pe = ye(
|
|
|
643
658
|
);
|
|
644
659
|
}
|
|
645
660
|
);
|
|
646
|
-
|
|
661
|
+
_e.displayName = "SlotGrid";
|
|
647
662
|
export {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
663
|
+
_e as S,
|
|
664
|
+
et as f,
|
|
665
|
+
Ze as i,
|
|
666
|
+
Me as s
|
|
652
667
|
};
|
|
653
|
-
//# sourceMappingURL=slot-grid-
|
|
668
|
+
//# sourceMappingURL=slot-grid-BhjaLJ0o.js.map
|
|
@@ -20,7 +20,7 @@ import { S as He } from "./skeleton-tTWJpvAq.js";
|
|
|
20
20
|
import { S as $t } from "./switch-D--x7n6h.js";
|
|
21
21
|
import { T as zt } from "./text-area-COMVJ1yE.js";
|
|
22
22
|
import { T as Oe } from "./text-input-CaG9ApoE.js";
|
|
23
|
-
import { T as qt } from "./time-picker-
|
|
23
|
+
import { T as qt } from "./time-picker-DSt-ns5F.js";
|
|
24
24
|
import { u as Vt } from "./registry-DvAUVLHh.js";
|
|
25
25
|
import { u as Lt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
26
26
|
import { c as Ut } from "./compose-refs-C0k0tdqF.js";
|
|
@@ -1239,4 +1239,4 @@ export {
|
|
|
1239
1239
|
vn as T,
|
|
1240
1240
|
ln as t
|
|
1241
1241
|
};
|
|
1242
|
-
//# sourceMappingURL=task-editor-
|
|
1242
|
+
//# sourceMappingURL=task-editor-Cv7xSakv.js.map
|