@alfadocs/ui-kit 1.46.0 → 1.47.1

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.
Files changed (101) hide show
  1. package/dist/_chunks/booking-C4MwImkS.js +3362 -0
  2. package/dist/_chunks/calendar-workspace-BmscntRR.js +12528 -0
  3. package/dist/_chunks/control-room-rail-CdBOXIqX.js +366 -0
  4. package/dist/_chunks/{freemium-paywall-Cz-O9lQD.js → freemium-paywall-BaW5ODc9.js} +2 -2
  5. package/dist/_chunks/{patient-details-DUj1htsH.js → patient-details-yrgkSeEY.js} +2 -2
  6. package/dist/_chunks/{patient-field-row-CO0WR7yA.js → patient-field-row-DCMkFGqI.js} +2 -2
  7. package/dist/_chunks/{patient-summary-card-DNzdYjxE.js → patient-summary-card-CmEFflGS.js} +2 -2
  8. package/dist/_chunks/payment-form-DqJFiplX.js +881 -0
  9. package/dist/_chunks/{phone-input-BsZIoE36.js → phone-input-IWrGOCwm.js} +40 -39
  10. package/dist/_chunks/{stepper-accordion-DmVykr5F.js → stepper-accordion-jMR8NaOB.js} +2 -1
  11. package/dist/agent-catalog.json +5 -4
  12. package/dist/agent-i18n/en.json +2 -2
  13. package/dist/components/booking/booking-types.d.ts +60 -1
  14. package/dist/components/booking/booking.d.ts +1 -1
  15. package/dist/components/booking/details-form.d.ts +5 -1
  16. package/dist/components/booking/index.d.ts +1 -1
  17. package/dist/components/booking/index.js +1 -1
  18. package/dist/components/booking/payment.d.ts +9 -0
  19. package/dist/components/booking/use-booking-payment.d.ts +14 -0
  20. package/dist/components/control-room-rail/control-room-rail.d.ts +9 -2
  21. package/dist/components/control-room-rail/index.d.ts +1 -1
  22. package/dist/components/control-room-rail/index.js +1 -1
  23. package/dist/components/freemium-paywall/index.js +1 -1
  24. package/dist/components/patient-details/index.js +1 -1
  25. package/dist/components/patient-summary-card/index.js +1 -1
  26. package/dist/components/payment-form/index.d.ts +1 -1
  27. package/dist/components/payment-form/index.js +1 -1
  28. package/dist/components/payment-form/payment-form.d.ts +35 -3
  29. package/dist/components/phone-input/index.js +1 -1
  30. package/dist/components/stepper-accordion/index.js +1 -1
  31. package/dist/i18n/locales/ar.d.ts +36 -1
  32. package/dist/i18n/locales/ar.js +36 -1
  33. package/dist/i18n/locales/de.d.ts +36 -1
  34. package/dist/i18n/locales/de.js +36 -1
  35. package/dist/i18n/locales/el.d.ts +36 -1
  36. package/dist/i18n/locales/el.js +36 -1
  37. package/dist/i18n/locales/en.d.ts +36 -1
  38. package/dist/i18n/locales/en.js +36 -1
  39. package/dist/i18n/locales/es.d.ts +36 -1
  40. package/dist/i18n/locales/es.js +36 -1
  41. package/dist/i18n/locales/fr.d.ts +36 -1
  42. package/dist/i18n/locales/fr.js +36 -1
  43. package/dist/i18n/locales/hi.d.ts +36 -1
  44. package/dist/i18n/locales/hi.js +36 -1
  45. package/dist/i18n/locales/it.d.ts +36 -1
  46. package/dist/i18n/locales/it.js +36 -1
  47. package/dist/i18n/locales/ja.d.ts +36 -1
  48. package/dist/i18n/locales/ja.js +36 -1
  49. package/dist/i18n/locales/nl.d.ts +36 -1
  50. package/dist/i18n/locales/nl.js +36 -1
  51. package/dist/i18n/locales/pl.d.ts +36 -1
  52. package/dist/i18n/locales/pl.js +36 -1
  53. package/dist/i18n/locales/pt.d.ts +36 -1
  54. package/dist/i18n/locales/pt.js +36 -1
  55. package/dist/i18n/locales/ro.d.ts +36 -1
  56. package/dist/i18n/locales/ro.js +36 -1
  57. package/dist/i18n/locales/ru.d.ts +36 -1
  58. package/dist/i18n/locales/ru.js +36 -1
  59. package/dist/i18n/locales/sq.d.ts +36 -1
  60. package/dist/i18n/locales/sq.js +36 -1
  61. package/dist/i18n/locales/sv.d.ts +36 -1
  62. package/dist/i18n/locales/sv.js +36 -1
  63. package/dist/i18n/locales/tr.d.ts +36 -1
  64. package/dist/i18n/locales/tr.js +36 -1
  65. package/dist/i18n/locales/zh.d.ts +36 -1
  66. package/dist/i18n/locales/zh.js +36 -1
  67. package/dist/index.js +9 -9
  68. package/dist/locales/ar.json +36 -1
  69. package/dist/locales/de.json +36 -1
  70. package/dist/locales/el.json +36 -1
  71. package/dist/locales/en.json +36 -1
  72. package/dist/locales/es.json +36 -1
  73. package/dist/locales/fr.json +36 -1
  74. package/dist/locales/hi.json +36 -1
  75. package/dist/locales/it.json +36 -1
  76. package/dist/locales/ja.json +36 -1
  77. package/dist/locales/nl.json +36 -1
  78. package/dist/locales/pl.json +36 -1
  79. package/dist/locales/pt.json +36 -1
  80. package/dist/locales/ro.json +36 -1
  81. package/dist/locales/ru.json +36 -1
  82. package/dist/locales/sq.json +36 -1
  83. package/dist/locales/sv.json +36 -1
  84. package/dist/locales/tr.json +36 -1
  85. package/dist/locales/zh.json +36 -1
  86. package/dist/patterns/calendar/calendar-editor-fields.d.ts +33 -0
  87. package/dist/patterns/calendar/calendar-sticky-offset.d.ts +20 -0
  88. package/dist/patterns/calendar/calendar-workspace.d.ts +88 -0
  89. package/dist/patterns/calendar/calendar.data.d.ts +17 -0
  90. package/dist/patterns/calendar/calendar.journey.d.ts +2 -0
  91. package/dist/patterns/calendar/calendar.sheets.d.ts +2 -0
  92. package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
  93. package/dist/patterns/calendar/calendar.types.d.ts +24 -10
  94. package/dist/patterns/calendar/index.d.ts +1 -1
  95. package/dist/patterns/calendar/index.js +1 -1
  96. package/dist/tokens.css +1 -1
  97. package/package.json +1 -1
  98. package/dist/_chunks/booking-B7gA9gFB.js +0 -3017
  99. package/dist/_chunks/calendar-workspace-BB-BZT7W.js +0 -12251
  100. package/dist/_chunks/control-room-rail-Cv7GpMqX.js +0 -354
  101. package/dist/_chunks/payment-form-BHMDqW9C.js +0 -767
@@ -1,3 +1,42 @@
1
+ /**
2
+ * Calendar pattern — the WORKSPACE ROOT.
3
+ *
4
+ * The practice agenda page the platform mounts from the kit: the grid
5
+ * and its two-strip toolbar (`calendar.surface.tsx`) beside a MINIMAL
6
+ * Control Room rail docked inline-end — up to six tools, in strip
7
+ * order: the upcoming Appointments panel (the rail's resting state and
8
+ * its default), ONE appointment editor / details tool, the waiting list,
9
+ * patient notes when in context, online bookings and the free-slot finder. Nothing else — no Inbox,
10
+ * no Alia, no patient tabs, no care plan, no tasks. The panels are the
11
+ * extracted modules from `calendar.sheets.tsx`; `calendar.host.ts`'s
12
+ * open / close seam maps onto the rail's dock, with `close()` returning
13
+ * to the Appointments panel so no path leaves an empty rail.
14
+ *
15
+ * Six is the ceiling, not the floor: `availableTools` narrows the set
16
+ * to what the host can actually back with data, hiding the rail tool AND
17
+ * the toolbar control that opens it, and routing anything aimed at a
18
+ * withheld tool to the Appointments panel. A host with no business
19
+ * hours, holidays or closures must withhold the free-slot finder — it
20
+ * would otherwise report booked and shut-day times as free.
21
+ *
22
+ * The host owns the data and the domain state: it hands in a
23
+ * `CalendarData` read model (`calendar.data.ts`) and a `CalendarJourney`
24
+ * (`calendar.journey.ts`) — the demos from their fixtures and the
25
+ * fixture-backed journey hook, the platform island from
26
+ * `/internalApi/...`. The workspace owns what sits between the two: the
27
+ * cog's display settings, the privacy flag, the one polite region, the
28
+ * editor tool's mode, the placement / create modes, the deep-link
29
+ * effects and the tasks filter. It renders NO header or sidebar — the
30
+ * host page has its own — and expects a bounded block-size from its
31
+ * parent (it fills it; the surface scrolls inside, the rail stays put),
32
+ * exactly what `AppFrame`'s `<main>` gives a page.
33
+ *
34
+ * The confirmations stay kit `Dialog`s — they interrupt rather than
35
+ * dock: the move confirm, the delete confirm with its recurring scope
36
+ * and care-plan cleanup and the Create-bill confirm.
37
+ */
38
+ import type { CalendarView } from '../../components/calendar';
39
+ import { type ControlRoomFavoriteChange } from '../../components/control-room-rail';
1
40
  import { type CalendarAppointmentEditorLoader } from './calendar-editor-hydration';
2
41
  import { type CalendarAppointmentDetailsLoader } from './calendar-appointment-details';
3
42
  import { type CalendarData } from './calendar.data';
@@ -18,6 +57,46 @@ export interface CalendarOnlineBookings {
18
57
  createdAtById?: Readonly<Record<string, string>>;
19
58
  onRetry?: () => void;
20
59
  }
60
+ /** Where a tool panel was opened from. `system` is a dock the workspace
61
+ * made on its own (the resting panel, a return after a save, a
62
+ * toolbar or journey hand-off), not a pick on the rail. */
63
+ export type CalendarToolOpenSource = 'rail' | 'appointment_panel' | 'selection' | 'system';
64
+ /** Where the appointment behind a details panel was selected. `host` is
65
+ * a selection the journey made itself. */
66
+ export type CalendarDetailsOpenSource = 'calendar' | 'appointments_panel' | 'bookings_panel' | 'waiting_list' | 'deep_link' | 'host';
67
+ /**
68
+ * Usage callbacks for the host's analytics. The kit raises no event of
69
+ * its own and passes identifiers only, never patient data: the host owns
70
+ * the calls, the property allow-list and any once-per guard.
71
+ */
72
+ export interface CalendarWorkspaceAnalytics {
73
+ /** A tool panel opened. Not raised again while it stays open. */
74
+ onToolOpen?: (event: {
75
+ toolId: CalendarWorkspaceToolId;
76
+ source: CalendarToolOpenSource;
77
+ view: CalendarView;
78
+ }) => void;
79
+ /** An appointment's preview opened. Raised on EVERY opening: the
80
+ * once-per-appointment guard is the host's. */
81
+ onAppointmentPreviewOpen?: (event: {
82
+ eventId: string;
83
+ view: CalendarView;
84
+ privacy: boolean;
85
+ }) => void;
86
+ /** An appointment's details docked for a new selection. Not raised when
87
+ * details come back after an edit. */
88
+ onAppointmentDetailsOpen?: (event: {
89
+ eventId: string;
90
+ source: CalendarDetailsOpenSource;
91
+ view: CalendarView;
92
+ }) => void;
93
+ /** A rail preference was saved on this device. `resize` is raised only
94
+ * with `persistPanelWidthKey`, since without it nothing is saved. */
95
+ onToolPreferencesChange?: (event: {
96
+ action: ControlRoomFavoriteChange['action'] | 'resize';
97
+ toolId: string;
98
+ }) => void;
99
+ }
21
100
  export interface CalendarWorkspaceProps {
22
101
  /** Optional canonical read for every existing-appointment editor route.
23
102
  * The form waits for this response; failures/refusals expose no editable
@@ -131,6 +210,15 @@ export interface CalendarWorkspaceProps {
131
210
  * it cannot show never marks the cog. */
132
211
  backlogFilters?: Readonly<Record<BacklogGap, boolean>>;
133
212
  onBacklogFiltersChange?: (filters: Readonly<Record<BacklogGap, boolean>>) => void;
213
+ /** Device key the rail saves pinned tools and their order under. Omit
214
+ * it and the rail keeps its generic default, `ui.controlRoom.favorites`. */
215
+ persistFavoritesKey?: string;
216
+ /** Device key the rail saves the panel width under. Omit it and width
217
+ * is not saved, as before. On-device only; nothing reaches a server. */
218
+ persistPanelWidthKey?: string;
219
+ /** Usage callbacks for the host's analytics. Omit it and nothing is
220
+ * reported. */
221
+ analytics?: CalendarWorkspaceAnalytics;
134
222
  }
135
223
  /**
136
224
  * The cog's settings as the workspace opens with them: the remembered
@@ -113,6 +113,23 @@ export interface CalendarData {
113
113
  id: string;
114
114
  name: string;
115
115
  }>;
116
+ /** The task types this practice offers, system and practice-defined in
117
+ * ONE list. Omit it (or `[]`) and the Type field is withheld, as with
118
+ * `companies`. `id` is an opaque token, unique here and never `''`;
119
+ * `custom` only groups the select; `label` is the host's own string,
120
+ * already translated. See calendar.mdx § Tasks. */
121
+ taskTypes?: ReadonlyArray<{
122
+ id: string;
123
+ label: string;
124
+ custom?: boolean;
125
+ }>;
126
+ /** Practice USER accounts a task can be assigned to (platform
127
+ * `practiceUser`) — NOT `operators`, which is the clinician axis. Same
128
+ * withheld-not-disabled contract; `'none'` is reserved for Nobody. */
129
+ taskAssignees?: ReadonlyArray<{
130
+ id: string;
131
+ label: string;
132
+ }>;
116
133
  /** Optional host typeahead. Omit for client filtering of `patients`.
117
134
  * The picker debounces nonblank queries, aborts superseded requests and
118
135
  * keeps the host's result order, including matches by phone or number.
@@ -179,6 +179,8 @@ export interface CalendarJourney {
179
179
  handleEditNote: (patientId: string, noteId: string, content: string) => void | Promise<void>;
180
180
  handleDeleteNote: (patientId: string, noteId: string) => void | Promise<void>;
181
181
  handleToggleNotePin: (patientId: string, noteId: string) => void | Promise<void>;
182
+ /** Flag or unflag a note. Omit it and the flag control is not offered. */
183
+ handleToggleNoteFlag?: (patientId: string, noteId: string) => void | Promise<void>;
182
184
  /** Read a patient's notes: the latest few, or every note. */
183
185
  handleLoadNotes?: (patientId: string, scope: 'preview' | 'all') => void;
184
186
  /**
@@ -73,6 +73,8 @@ export interface PatientNotesSeam {
73
73
  onEditNote: (noteId: string, content: string) => void | Promise<void>;
74
74
  onDeleteNote: (noteId: string) => void | Promise<void>;
75
75
  onTogglePin: (noteId: string) => void | Promise<void>;
76
+ /** Flag or unflag a note. Omitted → no flag control. */
77
+ onToggleFlag?: (noteId: string) => void | Promise<void>;
76
78
  /** The practice's own drafting endpoint. Omitted → no AI affordance. */
77
79
  onRequestAiDraft?: NotesPanelProps['onRequestAiDraft'];
78
80
  /** The host's live transcription. Omitted → no microphone. */
@@ -1,8 +1,9 @@
1
+ import { type CalendarView } from '../../components/calendar';
1
2
  import { type CalendarPreferenceAdapter } from './calendar.preferences';
2
3
  import { type CalendarRow, type RailFocus, type EditorPrefill, type HistoryInput, type AvailabilityContext, type CalendarFreeSlot } from './calendar.model';
3
4
  import { type WorkspaceDisplaySettings, type CreateModeRequest, type PlacementRequest, type SaveNotice, type CalendarWorkspaceToolId } from './calendar-workspace.model';
4
5
  import type { CalendarOccurrenceMove } from './calendar.journey';
5
- export declare function CalendarSurface({ rows, setRows, onFocus, locale, onComposeNew, onComposeTask, onOpenWaitingList, onAddWaitingEntry, onOpenOnlineBookings, onlineBookingsCount, waitingBadgeCount, onVisibleRangeChange, selectedEventId, gotoRequest, onBookSlot, onBookSlotFromFinder, display, setDisplay, onHistory, readOnly, reviewOnlyEventIds, detailsOnEveryClick, placement, onPlacementEnd, createMode, onCreateModeEnd, focusScroll, saveNotice, privacy, onPrivacyChange, availability, availabilityContext, availableTools, schedulerLicenseKey, id, preferences, onMoveOccurrence, }: {
6
+ export declare function CalendarSurface({ rows, setRows, onFocus, locale, onComposeNew, onComposeTask, onOpenWaitingList, onAddWaitingEntry, onOpenOnlineBookings, onlineBookingsCount, waitingBadgeCount, onVisibleRangeChange, selectedEventId, gotoRequest, onBookSlot, onBookSlotFromFinder, display, setDisplay, onHistory, readOnly, reviewOnlyEventIds, detailsOnEveryClick, placement, onPlacementEnd, createMode, onCreateModeEnd, focusScroll, saveNotice, privacy, onPrivacyChange, availability, availabilityContext, availableTools, schedulerLicenseKey, id, preferences, onMoveOccurrence, onViewChange, onPeekOpen, }: {
6
7
  rows: CalendarRow[];
7
8
  setRows: React.Dispatch<React.SetStateAction<CalendarRow[]>>;
8
9
  onFocus: (focus: RailFocus) => void;
@@ -96,5 +97,9 @@ export declare function CalendarSurface({ rows, setRows, onFocus, locale, onComp
96
97
  /** The host's series move (S-C8). With it, a recurring parent's move
97
98
  * always confirms, asks the scope and hides the notify boxes. */
98
99
  onMoveOccurrence?: (move: CalendarOccurrenceMove) => Promise<void>;
100
+ /** The grid's view, on mount and on every change. Usage reporting only. */
101
+ onViewChange?: (view: CalendarView) => void;
102
+ /** An appointment's preview opened. Usage reporting only. */
103
+ onPeekOpen?: (eventId: string) => void;
99
104
  }): import("react/jsx-runtime").JSX.Element;
100
105
  //# sourceMappingURL=calendar.surface.d.ts.map
@@ -324,25 +324,39 @@ export interface CalendarBookingContact {
324
324
  }
325
325
  /**
326
326
  * A calendar task (platform `DoctorReminder`) — the model the task editor
327
- * saves. `note` is the only required field; a task may be about a patient,
328
- * about a company, or neither, but never both (mutually exclusive, like
329
- * `CalendarWaitingEntry`'s three connections). No title separate from the
330
- * note, no priority, no duration — the platform model has none.
327
+ * saves. A task has at most ONE counterpart: a patient, a company, an
328
+ * operator, or none. `TaskType::validate()` refuses more than one with
329
+ * "More than one counterpart is set", so the editor asks for one choice.
330
+ * `note` is required here though the platform allows an empty one; `date`
331
+ * is required on both sides. No title separate from the note, no priority,
332
+ * no duration — the platform model has none.
331
333
  */
332
334
  export interface CalendarTask {
333
335
  id: string;
334
- /** Local wall-clock instant (date + time), as an ISO string. */
336
+ /** An instant as an ISO 8601 string. The editor emits `toISOString()`,
337
+ * so UTC with a `Z`; parse it with `new Date()`, never by slicing the
338
+ * first 16 characters. A zone-less string on read is taken as local. */
335
339
  dateIso: string;
336
- /** The task text — the only required field. */
340
+ /** The task text. Required here, though the platform allows an empty
341
+ * one. */
337
342
  note: string;
338
343
  /** The clinician the task concerns: platform `doctorOperator`, filled
339
- * from `data.operators`. NOT the assignee, which is a practice user
340
- * account the kit does not model. Absent = no operator. */
344
+ * from `data.operators`. NOT the assignee (`assigneeId`), and mutually
345
+ * exclusive with `patientId` and `companyId`. Absent = no operator. */
341
346
  operatorId?: string;
342
- /** Mutually exclusive with `companyId`. */
347
+ /** Mutually exclusive with `companyId` and `operatorId`. */
343
348
  patientId?: string;
344
- /** Mutually exclusive with `patientId` (platform `doctorCompany`). */
349
+ /** Mutually exclusive with `patientId` and `operatorId` (platform
350
+ * `doctorCompany`). */
345
351
  companyId?: string;
352
+ /** Which kind of task — an OPAQUE token from `CalendarData.taskTypes`,
353
+ * round-tripped untouched. The kit never parses it. Optional: a host
354
+ * that supplies no `taskTypes` neither shows the field nor sends one. */
355
+ typeId?: string;
356
+ /** The practice USER the task is assigned to. Independent of the
357
+ * counterpart above: an assigned task may still be about a patient. An
358
+ * id from `CalendarData.taskAssignees`; absent = nobody. */
359
+ assigneeId?: string;
346
360
  done: boolean;
347
361
  }
348
362
  /** The same shape without an identity — what the editor hands the create
@@ -1,4 +1,4 @@
1
- export { CalendarWorkspace, initialWorkspaceDisplay, WORKSPACE_TOOL, type CalendarWorkspaceProps, type CalendarOnlineBookings, type CalendarWorkspaceToolId, } from './calendar-workspace';
1
+ export { CalendarWorkspace, initialWorkspaceDisplay, WORKSPACE_TOOL, type CalendarWorkspaceProps, type CalendarOnlineBookings, type CalendarWorkspaceToolId, type CalendarWorkspaceAnalytics, type CalendarToolOpenSource, type CalendarDetailsOpenSource, } from './calendar-workspace';
2
2
  export { CalendarDataProvider, useCalendarData, type CalendarData, type DayLoadState, } from './calendar.data';
3
3
  export type { CalendarJourney, CalendarOccurrenceMove, PatientNotesLoad, } from './calendar.journey';
4
4
  export type { CalendarAppointmentEditorSnapshot, CalendarAppointmentEditorLoader, CalendarEditorSeries, } from './calendar-editor-hydration';
@@ -1,4 +1,4 @@
1
- import { C as s, a as r, b as E, c as P, D as S, d as o, S as C, V as t, W as d, e as A, i, m as n, r as D, u as W, f as _, g as c } from "../../_chunks/calendar-workspace-BB-BZT7W.js";
1
+ import { C as s, a as r, b as E, c as P, D as S, d as o, S as C, V as t, W as d, e as A, i, m as n, r as D, u as W, f as _, g as c } from "../../_chunks/calendar-workspace-BmscntRR.js";
2
2
  export {
3
3
  s as CALENDAR_PREFERENCE_KEYS,
4
4
  r as CalendarDataProvider,