@alfadocs/ui-kit 1.12.6 → 1.14.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.
Files changed (182) hide show
  1. package/dist/_chunks/actions-cell-renderer-yy03OgRL.js +137 -0
  2. package/dist/_chunks/{address-fields-CZP4Wncx.js → address-fields-CZ0pEdEI.js} +4 -4
  3. package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js → ai-prompt-input-CrHr-5H8.js} +2 -2
  4. package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js → anamnesis-summary-rows-CRWO8x8g.js} +4 -4
  5. package/dist/_chunks/{audio-recorder-EWBCNIsd.js → audio-recorder-DXG6LTtO.js} +2 -2
  6. package/dist/_chunks/{autocomplete-BrONKN8l.js → autocomplete-MpBhz-fG.js} +86 -74
  7. package/dist/_chunks/{balance-badge-cell-7L6nzB29.js → balance-badge-cell-CgkxYO96.js} +9 -8
  8. package/dist/_chunks/{bishop-score-Cnu0xs-z.js → bishop-score-CJUVBfAu.js} +2 -2
  9. package/dist/_chunks/{booking-CBHKdsZl.js → booking-DQbo6mQF.js} +609 -591
  10. package/dist/_chunks/{calendar-B4Gnyu1C.js → calendar-CHT9Rm3M.js} +2 -2
  11. package/dist/_chunks/{calendar-event-card-Bjdbik8G.js → calendar-event-card-BjdHZaqz.js} +18 -14
  12. package/dist/_chunks/calendar-plus-BFrIRE4r.js +19 -0
  13. package/dist/_chunks/calendar-workspace-DI49_t6t.js +7429 -0
  14. package/dist/_chunks/{care-plan-card-aDN4oem9.js → care-plan-card-D-FMfDKH.js} +2 -2
  15. package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js → care-plan-entry-card-Bvw_9T-d.js} +2 -2
  16. package/dist/_chunks/{care-plan-header-CkpPyQqG.js → care-plan-header-B5CBE0zu.js} +2 -2
  17. package/dist/_chunks/{city-input-towzBenY.js → city-input-DaQc-Hbj.js} +2 -2
  18. package/dist/_chunks/clipboard-list-rSzfIYZB.js +25 -0
  19. package/dist/_chunks/{color-picker-oZ6zYks8.js → color-picker-CU303VjY.js} +4 -2
  20. package/dist/_chunks/{combobox-DiMLItyu.js → combobox-D7_NLE2Z.js} +89 -81
  21. package/dist/_chunks/{contact-profile-card-BMIBr5s9.js → contact-profile-card-BZqi8Hck.js} +38 -36
  22. package/dist/_chunks/{country-select-UEF9BEeQ.js → country-select-DzbPFktV.js} +2 -2
  23. package/dist/_chunks/data-table-DC5rO3Ty.js +1817 -0
  24. package/dist/_chunks/{document-preview-oyx9RhCo.js → document-preview-CDb-n_W7.js} +2 -2
  25. package/dist/_chunks/{face-scheme-CZaKm6fG.js → face-scheme-DA2vjqaM.js} +2 -2
  26. package/dist/_chunks/{field-value-DG8zaZvo.js → field-value-D-vkX9uL.js} +120 -140
  27. package/dist/_chunks/{file-manager-C0y7HBAN.js → file-manager-DJMeB3V8.js} +138 -153
  28. package/dist/_chunks/folder-plus-CutOs4DP.js +22 -0
  29. package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js → gestational-age-calculator-CiOQjzgx.js} +2 -2
  30. package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
  31. package/dist/_chunks/key-value-pair-BIBdZBLg.js +188 -0
  32. package/dist/_chunks/{link-cell-renderer-CenJx-_7.js → link-cell-renderer-CIASXsVM.js} +4 -4
  33. package/dist/_chunks/{multi-select-DqL4o0qV.js → multi-select-DYOvx2SJ.js} +56 -48
  34. package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js → muscle-scheme-BSJsI4-I.js} +2 -2
  35. package/dist/_chunks/{notes-panel-CymneXtl.js → notes-panel-DYAtlq_i.js} +2 -2
  36. package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js → optical-prescription-BvwuqTpl.js} +2 -2
  37. package/dist/_chunks/{patient-details-xrqe13az.js → patient-details-BfzvFnxQ.js} +75 -94
  38. package/dist/_chunks/{patient-search-D5ufYoRc.js → patient-search-HeEUB-_X.js} +2 -2
  39. package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js → patient-summary-card-D5Vfa321.js} +3 -3
  40. package/dist/_chunks/{payment-request-card-YVCcCZ25.js → payment-request-card-lmKLwsDs.js} +2 -2
  41. package/dist/_chunks/{periodontal-chart-BatZEFar.js → periodontal-chart-B9fphroR.js} +2 -2
  42. package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js → periodontal-chart-card-qEZPXj83.js} +2 -2
  43. package/dist/_chunks/{practice-results-D7ygCj_W.js → practice-results-DL_ExLYE.js} +159 -172
  44. package/dist/_chunks/{pregnancy-dating-DtToyMyc.js → pregnancy-dating-D2wchD11.js} +2 -2
  45. package/dist/_chunks/{province-select-BDywtmL-.js → province-select-BBc7s7vR.js} +2 -2
  46. package/dist/_chunks/{rich-text-editor-BDfFtK4H.js → rich-text-editor-DtbcA6s1.js} +2 -2
  47. package/dist/_chunks/{select-BW5ecXlX.js → select-Bi8zril7.js} +165 -136
  48. package/dist/_chunks/signature-CpFNpsVK.js +21 -0
  49. package/dist/_chunks/{signature-field-0rFODJlW.js → signature-field-CEiPe-vX.js} +19 -34
  50. package/dist/_chunks/{signature-request-DVDTKLjM.js → signature-request-CUe903hj.js} +2 -2
  51. package/dist/_chunks/smartphone-C0rFF2if.js +15 -0
  52. package/dist/_chunks/{tabs-CBb2AidH.js → tabs-DqKtTIjZ.js} +2 -2
  53. package/dist/_chunks/{tasks-panel-Do5SFp-j.js → tasks-panel-DPCNaRko.js} +2 -2
  54. package/dist/_chunks/{toast.agent-D1tdg6DS.js → toast-YZz2sBzB.js} +160 -212
  55. package/dist/_chunks/toast.agent-DNQ0JYGv.js +56 -0
  56. package/dist/_chunks/{tooth-scheme-WdyVymQ1.js → tooth-scheme-2IsmbE6w.js} +2 -2
  57. package/dist/_chunks/{unit-converter-BPumXMA6.js → unit-converter-C6jMjqL9.js} +2 -2
  58. package/dist/_chunks/{workflow-map-DE_ribRM.js → workflow-map-dNzJjBWG.js} +104 -113
  59. package/dist/agent-catalog.json +867 -1
  60. package/dist/agent-i18n/en.json +27 -0
  61. package/dist/components/_shared/option.d.ts +1 -0
  62. package/dist/components/address-fields/index.js +1 -1
  63. package/dist/components/ai-prompt-input/index.js +1 -1
  64. package/dist/components/audio-recorder/index.js +1 -1
  65. package/dist/components/autocomplete/index.js +1 -1
  66. package/dist/components/bishop-score/index.js +1 -1
  67. package/dist/components/booking/index.js +1 -1
  68. package/dist/components/calendar/index.js +1 -1
  69. package/dist/components/calendar-event-card/index.js +1 -1
  70. package/dist/components/care-plan-card/index.js +1 -1
  71. package/dist/components/care-plan-entry-card/index.js +1 -1
  72. package/dist/components/care-plan-header/index.js +1 -1
  73. package/dist/components/city-input/index.js +1 -1
  74. package/dist/components/color-picker/index.js +1 -1
  75. package/dist/components/combobox/index.js +1 -1
  76. package/dist/components/contact-profile-card/index.js +1 -1
  77. package/dist/components/country-select/index.js +1 -1
  78. package/dist/components/data-table/index.js +39 -38
  79. package/dist/components/document-preview/index.js +1 -1
  80. package/dist/components/face-scheme/index.js +1 -1
  81. package/dist/components/file-manager/index.js +1 -1
  82. package/dist/components/gestational-age-calculator/index.js +1 -1
  83. package/dist/components/index.d.ts +1 -0
  84. package/dist/components/key-value-pair/index.js +1 -1
  85. package/dist/components/key-value-pair/key-value-pair.d.ts +16 -0
  86. package/dist/components/multi-select/index.js +1 -1
  87. package/dist/components/muscle-scheme/index.js +1 -1
  88. package/dist/components/notes-panel/index.js +1 -1
  89. package/dist/components/optical-prescription/index.js +1 -1
  90. package/dist/components/patient-details/index.js +1 -1
  91. package/dist/components/patient-search/index.js +1 -1
  92. package/dist/components/patient-summary-card/index.js +1 -1
  93. package/dist/components/patient-table/index.js +1 -1
  94. package/dist/components/payment-card/index.js +1 -1
  95. package/dist/components/periodontal-chart/index.js +1 -1
  96. package/dist/components/periodontal-chart-card/index.js +1 -1
  97. package/dist/components/practice-results/index.js +1 -1
  98. package/dist/components/pregnancy-dating/index.js +1 -1
  99. package/dist/components/province-select/index.js +1 -1
  100. package/dist/components/rich-text-editor/index.js +1 -1
  101. package/dist/components/select/index.js +1 -1
  102. package/dist/components/select/select.d.ts +24 -0
  103. package/dist/components/signature-field/index.js +1 -1
  104. package/dist/components/skeleton-scheme/index.js +1 -1
  105. package/dist/components/tabs/index.js +1 -1
  106. package/dist/components/tasks-panel/index.js +1 -1
  107. package/dist/components/toast/index.js +7 -6
  108. package/dist/components/tooth-scheme/index.js +1 -1
  109. package/dist/components/unit-converter/index.js +1 -1
  110. package/dist/components/workflow/index.js +1 -1
  111. package/dist/i18n/locales/ar.d.ts +680 -0
  112. package/dist/i18n/locales/ar.js +680 -0
  113. package/dist/i18n/locales/de.d.ts +680 -0
  114. package/dist/i18n/locales/de.js +680 -0
  115. package/dist/i18n/locales/el.d.ts +680 -0
  116. package/dist/i18n/locales/el.js +680 -0
  117. package/dist/i18n/locales/en.d.ts +680 -0
  118. package/dist/i18n/locales/en.js +680 -0
  119. package/dist/i18n/locales/es.d.ts +680 -0
  120. package/dist/i18n/locales/es.js +680 -0
  121. package/dist/i18n/locales/fr.d.ts +680 -0
  122. package/dist/i18n/locales/fr.js +680 -0
  123. package/dist/i18n/locales/hi.d.ts +680 -0
  124. package/dist/i18n/locales/hi.js +680 -0
  125. package/dist/i18n/locales/it.d.ts +680 -0
  126. package/dist/i18n/locales/it.js +680 -0
  127. package/dist/i18n/locales/ja.d.ts +680 -0
  128. package/dist/i18n/locales/ja.js +680 -0
  129. package/dist/i18n/locales/nl.d.ts +680 -0
  130. package/dist/i18n/locales/nl.js +680 -0
  131. package/dist/i18n/locales/pl.d.ts +680 -0
  132. package/dist/i18n/locales/pl.js +680 -0
  133. package/dist/i18n/locales/pt.d.ts +680 -0
  134. package/dist/i18n/locales/pt.js +680 -0
  135. package/dist/i18n/locales/ro.d.ts +680 -0
  136. package/dist/i18n/locales/ro.js +680 -0
  137. package/dist/i18n/locales/ru.d.ts +680 -0
  138. package/dist/i18n/locales/ru.js +680 -0
  139. package/dist/i18n/locales/sq.d.ts +680 -0
  140. package/dist/i18n/locales/sq.js +680 -0
  141. package/dist/i18n/locales/sv.d.ts +680 -0
  142. package/dist/i18n/locales/sv.js +680 -0
  143. package/dist/i18n/locales/tr.d.ts +680 -0
  144. package/dist/i18n/locales/tr.js +680 -0
  145. package/dist/i18n/locales/zh.d.ts +680 -0
  146. package/dist/i18n/locales/zh.js +680 -0
  147. package/dist/index.js +830 -812
  148. package/dist/locales/ar.json +680 -0
  149. package/dist/locales/de.json +680 -0
  150. package/dist/locales/el.json +680 -0
  151. package/dist/locales/en.json +680 -0
  152. package/dist/locales/es.json +680 -0
  153. package/dist/locales/fr.json +680 -0
  154. package/dist/locales/hi.json +680 -0
  155. package/dist/locales/it.json +680 -0
  156. package/dist/locales/ja.json +680 -0
  157. package/dist/locales/nl.json +680 -0
  158. package/dist/locales/pl.json +680 -0
  159. package/dist/locales/pt.json +680 -0
  160. package/dist/locales/ro.json +680 -0
  161. package/dist/locales/ru.json +680 -0
  162. package/dist/locales/sq.json +680 -0
  163. package/dist/locales/sv.json +680 -0
  164. package/dist/locales/tr.json +680 -0
  165. package/dist/locales/zh.json +680 -0
  166. package/dist/patterns/anamnesis/index.js +1 -1
  167. package/dist/patterns/calendar/calendar-workspace.d.ts +62 -0
  168. package/dist/patterns/calendar/calendar-workspace.model.d.ts +358 -0
  169. package/dist/patterns/calendar/calendar.data.d.ts +122 -0
  170. package/dist/patterns/calendar/calendar.host.d.ts +10 -0
  171. package/dist/patterns/calendar/calendar.journey.d.ts +119 -0
  172. package/dist/patterns/calendar/calendar.model.d.ts +684 -0
  173. package/dist/patterns/calendar/calendar.preferences.d.ts +74 -0
  174. package/dist/patterns/calendar/calendar.sheets.d.ts +398 -0
  175. package/dist/patterns/calendar/calendar.surface.d.ts +77 -0
  176. package/dist/patterns/calendar/calendar.types.d.ts +413 -0
  177. package/dist/patterns/calendar/index.d.ts +13 -0
  178. package/dist/patterns/calendar/index.js +19 -0
  179. package/dist/patterns/signature-request/index.js +1 -1
  180. package/package.json +5 -1
  181. package/dist/_chunks/actions-cell-renderer-DnSLrgQD.js +0 -1945
  182. package/dist/_chunks/key-value-pair-BubG4fUa.js +0 -144
@@ -1,4 +1,4 @@
1
- import { A as e, a as i, L as r, P as n, S as o, T as t, b as l, c as d, d as g, e as A, f as m, g as c, h as E, i as P, j as f, k as S, l as h, m as u, n as T, o as I, p as N, r as R, q as _, s as C, t as L, u as b } from "../../_chunks/anamnesis-summary-rows-BfhxWPO3.js";
1
+ import { A as e, a as i, L as r, P as n, S as o, T as t, b as l, c as d, d as g, e as A, f as m, g as c, h as E, i as P, j as f, k as S, l as h, m as u, n as T, o as I, p as N, r as R, q as _, s as C, t as L, u as b } from "../../_chunks/anamnesis-summary-rows-CRWO8x8g.js";
2
2
  export {
3
3
  e as Anamnesis,
4
4
  i as AnamnesisConfigEditor,
@@ -0,0 +1,62 @@
1
+ import { type CalendarData } from './calendar.data';
2
+ import type { CalendarJourney } from './calendar.journey';
3
+ import { type CalendarPreferenceAdapter } from './calendar.preferences';
4
+ import { type EditorPrefill } from './calendar.model';
5
+ import { type WorkspaceDisplaySettings } from './calendar-workspace.model';
6
+ export declare const WORKSPACE_TOOL: {
7
+ readonly appointments: "appointments";
8
+ readonly editor: "appointment-editor";
9
+ readonly waitingList: "waiting-list";
10
+ readonly bookings: "online-bookings";
11
+ readonly findSlots: "find-slots";
12
+ };
13
+ export interface CalendarWorkspaceProps {
14
+ /** The domain state and its handlers — the host implements them. */
15
+ journey: CalendarJourney;
16
+ /** The practice's read model, stable for a page load. */
17
+ data: CalendarData;
18
+ locale?: string;
19
+ /** Host-level cog overrides. */
20
+ initialDisplay?: Partial<WorkspaceDisplaySettings>;
21
+ /** The platform's `practice_appointment_edit` right — false turns the
22
+ * page read-only (no drag, no create, details without write actions). */
23
+ permissions?: {
24
+ editAppointment?: boolean;
25
+ };
26
+ /** Deep link `focusAppointmentId`: open on the appointment's day, ring
27
+ * and scroll to its card and dock its details. */
28
+ focusAppointmentId?: string;
29
+ /** Deep link `createParameters`: arrive in CREATE mode — the banner
30
+ * stands and the next free-slot click opens the editor prefilled. */
31
+ createParameters?: {
32
+ prefill: EditorPrefill;
33
+ patientName?: string;
34
+ };
35
+ /** Deep link `freeSlotClicked`: jump to the slot and open the editor
36
+ * prefilled with it. */
37
+ freeSlot?: EditorPrefill;
38
+ /** Platform advisories the finder raises when the scheduler is empty. */
39
+ businessHours?: {
40
+ practice?: boolean;
41
+ operators?: boolean;
42
+ };
43
+ /** Where the cog's settings, the view, the weekend choice and the
44
+ * chair / operator selections are remembered — the host's per-user
45
+ * store. Defaults to the session-scoped in-memory adapter. */
46
+ preferences?: CalendarPreferenceAdapter;
47
+ /** The grid's instance id — the agent registry's handle for this
48
+ * calendar and the DOM hook anything outside React reaches it by.
49
+ * Override it only when two workspaces share one page. */
50
+ id?: string;
51
+ }
52
+ /**
53
+ * The cog's settings as the workspace opens with them: the remembered
54
+ * entry under the workspace's own key, a caller's `initialDisplay`
55
+ * winning for the keys it names. Exported so a host seeding its journey
56
+ * (row colours follow `colorAssociation`) starts from the same values
57
+ * the workspace will show.
58
+ */
59
+ export declare function initialWorkspaceDisplay(initialDisplay: Partial<WorkspaceDisplaySettings> | undefined, preferences?: CalendarPreferenceAdapter): WorkspaceDisplaySettings;
60
+ /** The workspace root: the read model, then the rail scope, then the page. */
61
+ export declare function CalendarWorkspace({ data, ...props }: CalendarWorkspaceProps): import("react/jsx-runtime").JSX.Element;
62
+ //# sourceMappingURL=calendar-workspace.d.ts.map
@@ -0,0 +1,358 @@
1
+ /**
2
+ * Calendar demo, Increment 1 — the pure model the rail-hosted surface
3
+ * adds on top of `calendar.model.ts`: the four-way range view with its
4
+ * keyboard shortcuts, the extended display settings (default duration,
5
+ * name display, map link), the practice-hours time axis, the platform's
6
+ * filter semantics (nothing ticked = everyone) and the split-button
7
+ * badge count. No React, no i18n lookups. Every read of practice data
8
+ * goes through the explicit `data: CalendarData` parameter.
9
+ */
10
+ import type { AppointmentItem } from '../../components/appointment-card';
11
+ import type { CalendarResource } from '../../components/calendar';
12
+ import type { CalendarData } from './calendar.data';
13
+ import type { CalendarPatient, CalendarWaitingEntry } from './calendar.types';
14
+ import { type CalendarRow, type DisplaySettings, type EditorDraft, type EditorPrefill, type WaitingQuickView } from './calendar.model';
15
+ /** The platform's four ranges; "Working week" became the Show-weekends
16
+ * item, so it is no longer a view of its own. */
17
+ export type WorkspaceViewId = 'day' | 'threeDays' | 'week' | 'month';
18
+ export declare const WORKSPACE_VIEWS: readonly WorkspaceViewId[];
19
+ /** CalendarView stem per range — composed with the column axis. */
20
+ export declare const WORKSPACE_VIEW_STEM: Record<WorkspaceViewId, 'Day' | 'ThreeDays' | 'Week' | 'Month'>;
21
+ /** Google-Calendar-style single-key shortcuts (X = 3 days, as GCal). */
22
+ export declare const VIEW_SHORTCUT_KEYS: Record<WorkspaceViewId, string>;
23
+ export declare const readWorkspaceViewId: (raw: unknown) => WorkspaceViewId | undefined;
24
+ /** The range a bare key press selects, case-insensitive; undefined when
25
+ * the key is not a shortcut. */
26
+ export declare function viewForShortcutKey(key: string): WorkspaceViewId | undefined;
27
+ export declare function shortcutAllowedOn(target: EventTarget | null): boolean;
28
+ /** The keydown shape the shortcut resolver reads — a subset of
29
+ * KeyboardEvent so tests can pass plain objects. */
30
+ export interface ShortcutKeydown {
31
+ key: string;
32
+ altKey: boolean;
33
+ ctrlKey: boolean;
34
+ metaKey: boolean;
35
+ shiftKey: boolean;
36
+ repeat: boolean;
37
+ defaultPrevented: boolean;
38
+ target: EventTarget | null;
39
+ }
40
+ /** The range a page-level keydown switches to, or undefined when the
41
+ * press must be left alone (modifier, auto-repeat, typing, an open
42
+ * menu or dialog, already handled). */
43
+ export declare function shortcutViewForKeydown(event: ShortcutKeydown): WorkspaceViewId | undefined;
44
+ /** Weekend visibility is a per-user choice now (platform hidden days):
45
+ * off hides Saturday and Sunday in every range view. */
46
+ export declare function weekendHiddenDays(showWeekends: boolean): number[];
47
+ export type OperatorNameDisplay = 'full' | 'initials';
48
+ export type ChairNameDisplay = 'full' | 'short';
49
+ export interface WorkspaceDisplaySettings extends DisplaySettings {
50
+ /** The per-user default appointment length (platform 30). */
51
+ defaultDurationMin: number;
52
+ /** Column header treatment for people: dot + name, or initials disc. */
53
+ operatorNameDisplay: OperatorNameDisplay;
54
+ /** Column header treatment for chairs: full name or the short code. */
55
+ chairNameDisplay: ChairNameDisplay;
56
+ /** Show the Google Maps link in the appointment details. */
57
+ mapsLink: boolean;
58
+ }
59
+ export declare const DEFAULT_DURATION_RANGE: {
60
+ readonly min: 5;
61
+ readonly max: 240;
62
+ readonly step: 5;
63
+ };
64
+ export declare const DEFAULT_WORKSPACE_DISPLAY: WorkspaceDisplaySettings;
65
+ /** Remembered Increment 1 display settings, validated per field over the
66
+ * Increment 1 defaults (a Final State shape keeps every knob it knows). */
67
+ export declare function readWorkspaceDisplaySettings(raw: unknown): WorkspaceDisplaySettings | undefined;
68
+ /** Earliest opening and latest closing across the practice's week —
69
+ * the platform's `openingTime` / `closingTime` for the time axis. */
70
+ export declare function practiceDayWindow(data: CalendarData): {
71
+ min: string;
72
+ max: string;
73
+ };
74
+ /** The axis for a cog window: `working` is the practice's own hours;
75
+ * extended and full stay the Final State overrides. */
76
+ export declare function workspaceDayWindow(window: DisplaySettings['window'], data: CalendarData): {
77
+ min: string;
78
+ max: string;
79
+ };
80
+ /** The ids a selection shows: the ticked ones, or all when none is. */
81
+ export declare function effectiveIds(selected: readonly string[], all: readonly string[]): string[];
82
+ /** Tick or untick `ids` in a selection (a row or a whole group). */
83
+ export declare function toggleSelectedIds(prev: readonly string[], ids: readonly string[], checked: boolean | 'indeterminate'): string[];
84
+ /** What the Reset chip counts: every ticked chair and operator. */
85
+ export declare function activeFilterCount(selectedChairIds: readonly string[], selectedOperatorIds: readonly string[]): number;
86
+ /**
87
+ * Disabled operators holding at least one appointment that STARTS inside
88
+ * the visible range — the platform's carve-out
89
+ * (`NewCalendar/Library.js`: `isActive(op) || hasAppointments(op)`).
90
+ * Their column stands whatever the "Show disabled operators" switch
91
+ * says, so hiding the operator can never hide an appointment.
92
+ */
93
+ export declare function bookedDisabledOperatorIds(rows: readonly CalendarRow[], inactiveIds: readonly string[], range: {
94
+ start: number;
95
+ end: number;
96
+ } | null): string[];
97
+ /**
98
+ * The operators the grid may give a column to when NOTHING is ticked:
99
+ * every active one, the disabled ones while the switch reveals them, and
100
+ * any disabled operator the carve-out keeps. An explicit selection still
101
+ * wins over all three (platform: `kept.filter(selected)`).
102
+ */
103
+ export declare function columnableOperatorIds(args: {
104
+ operators: readonly CalendarResource[];
105
+ inactiveIds: readonly string[];
106
+ showDisabled: boolean;
107
+ keepIds: readonly string[];
108
+ }): string[];
109
+ /** The operators the filter list offers — disabled ones only once the
110
+ * session switch reveals them (the carve-out is a column, not a row). */
111
+ export declare function listedOperators(operators: readonly CalendarResource[], inactiveIds: readonly string[], showDisabled: boolean): CalendarResource[];
112
+ /** Chair column label per the cog: the full name, or the fixture's short
113
+ * code (the platform's "first two letters" setting). */
114
+ export declare function chairResourceTitle(chair: CalendarResource, mode: ChairNameDisplay): string;
115
+ /** Operator column label: the plain name, or the name plus the muted
116
+ * Disabled marker when the practice has disabled them. The kit Calendar
117
+ * renders a resource header from its `title`, so the marker rides
118
+ * there — and reaches the Avatar's accessible name under initials. */
119
+ export declare function operatorResourceTitle(operator: CalendarResource, isDisabled: boolean, disabledLabel: string): string;
120
+ /** Whole minutes between two instants — the resize toast's figure. */
121
+ export declare function minutesBetween(start: Date | string, end: Date | string): number;
122
+ /** Re-ends one appointment. The resize path writes through this twice —
123
+ * once for the drag, once for the Undo that restores the old end — so
124
+ * the two can never drift apart. */
125
+ export declare function rowsWithEnd(rows: readonly CalendarRow[], eventId: string, end: Date): CalendarRow[];
126
+ /** The platform's recurring-mode chooser (move, delete, save on edit). */
127
+ export type RecurringScope = 'this' | 'following' | 'all';
128
+ export declare const RECURRING_SCOPES: readonly RecurringScope[];
129
+ /** Literal map (not a template) so key extractors see every key. */
130
+ export declare const RECURRING_SCOPE_LABEL_KEY: Record<RecurringScope, string>;
131
+ /** How the create form asks for the required documents' signature. */
132
+ export type RequiredDocsSignMode = 'sms' | 'email' | 'none';
133
+ /** What the editor reports beside the draft — the platform-only choices
134
+ * the shared `EditorDraft` never needed. */
135
+ export interface EditorDraftExtras {
136
+ recurringSaveMode?: RecurringScope;
137
+ requiredDocsSignMode?: RequiredDocsSignMode;
138
+ branchId?: string;
139
+ }
140
+ /** Delete confirmation choices — the recurring scope and, for a
141
+ * price-list recurrence parent, the care-plan cleanup. */
142
+ export interface DeleteOptions {
143
+ scope: RecurringScope;
144
+ removeFromCarePlan?: boolean;
145
+ }
146
+ /** The occurrences a scope names, in series order — the event itself
147
+ * for `this`, it and its later occurrences for `following`, the whole
148
+ * series for `all`. A row outside a series only ever names itself. */
149
+ export declare function seriesScopeEventIds(rows: readonly CalendarRow[], eventId: string, scope: RecurringScope): string[];
150
+ /** Every timed appointment overlapping `[start, end)` — cancelled and
151
+ * absent ones, tasks, washes and the row itself never count (platform
152
+ * busy check). */
153
+ export declare function slotConflicts(rows: readonly CalendarRow[], slot: {
154
+ start: Date;
155
+ end: Date;
156
+ chairId?: string;
157
+ operatorId?: string;
158
+ excludeEventId?: string;
159
+ }): {
160
+ chairBusy: boolean;
161
+ operatorBusy: boolean;
162
+ };
163
+ /** Devices the chosen cares need, deduplicated, in care order. */
164
+ export declare function devicesForCares(cares: readonly {
165
+ careId?: string;
166
+ }[] | undefined, devicesByCare: Readonly<Record<string, readonly string[]>>): string[];
167
+ /** Which sign channels a patient can take a request on. */
168
+ export declare function signChannelsFor(patient: CalendarPatient | undefined): {
169
+ sms: boolean;
170
+ email: boolean;
171
+ };
172
+ /** The platform's default: SMS when the patient can take one, else
173
+ * email, else nothing. */
174
+ export declare function defaultSignMode(patient: CalendarPatient | undefined): RequiredDocsSignMode;
175
+ /** Google Maps search for the patient's address — the popover's map link. */
176
+ export declare function patientMapsUrl(patient: CalendarPatient): string;
177
+ /** A CREATE mode armed by a deep link (`createParameters`) or the
178
+ * Backlog's Schedule: the next empty-slot click opens the editor with
179
+ * this context already filled in (platform `_switchMode('create')`). */
180
+ export interface CreateModeRequest {
181
+ tick: number;
182
+ prefill: EditorPrefill;
183
+ /** Named in the banner when the context carries a patient. */
184
+ patientName?: string;
185
+ }
186
+ /** Legible ink for a mode banner tinted with an appointment colour. The
187
+ * Google palette ships no text colour, so the pair is settled by the
188
+ * kit's own contrast maths rather than by eye. */
189
+ export declare function bannerTextColor(backgroundHex?: string): string | undefined;
190
+ /** A Move… or Copy… armed from the details dialog: the next empty-slot
191
+ * click places the source appointment there. */
192
+ export interface PlacementRequest {
193
+ kind: 'move' | 'copy';
194
+ eventId: string;
195
+ /** Copy only — carry the linked treatments along (platform's two copies). */
196
+ withTreatments?: boolean;
197
+ /** Armed from a waiting-list Reschedule — the entry leaves the queue
198
+ * once the move lands (platform parity). */
199
+ waitingEntryId?: string;
200
+ }
201
+ /** The platform's "Copia & incolla": the same appointment on a new slot
202
+ * with a fresh id — never a series member, treatments only on request.
203
+ * An all-day source stays all-day on the target date. */
204
+ export declare function copyRowAt(source: CalendarRow, target: {
205
+ start: Date;
206
+ resourceId?: string;
207
+ axisKind: DisplaySettings['resourceKind'];
208
+ }, id: string, withTreatments: boolean): CalendarRow;
209
+ /** Apply an edit saved with "this and following" / "all" to the other
210
+ * occurrences: each keeps its own day shifted by the same delta as the
211
+ * edited one, and takes the edited duration, allocation, colour, status,
212
+ * type and description. */
213
+ export declare function applySeriesEdit(rows: readonly CalendarRow[], primaryPrev: CalendarRow, draft: EditorDraft, siblingIds: readonly string[], data: CalendarData): CalendarRow[];
214
+ /** What the post-save toast needs to decide whether the saved
215
+ * appointment is on screen: its day and its allocation. */
216
+ export interface SaveNotice {
217
+ tick: number;
218
+ date: Date;
219
+ chairId?: string;
220
+ operatorId?: string;
221
+ }
222
+ /** Why a saved appointment is not on the grid right now — empty when it
223
+ * is visible. The "Go to" action undoes exactly these. */
224
+ export declare function hiddenReasons(notice: Pick<SaveNotice, 'date' | 'chairId' | 'operatorId'>, view: {
225
+ visibleRange: {
226
+ start: number;
227
+ end: number;
228
+ } | null;
229
+ hiddenDays: readonly number[];
230
+ selectedChairIds: readonly string[];
231
+ selectedOperatorIds: readonly string[];
232
+ }): Array<'range' | 'weekend' | 'chair' | 'operator'>;
233
+ /**
234
+ * The platform DASHBOARD widget's window (`upcomingAppointmentsAction`):
235
+ * NOW → `forwardDays` later at 23:59:59.999, cancelled excluded, date
236
+ * ascending, no row limit. `backDays` is 0 at rest — the kit timeline's
237
+ * presets and its edge loaders widen the derived window in place of a
238
+ * fetch, so the panel can look further than the platform's seven days.
239
+ */
240
+ export interface UpcomingWindow {
241
+ /** Days of history the panel has been widened to; 0 starts at NOW. */
242
+ backDays: number;
243
+ /** Days ahead — the platform's seven at rest. */
244
+ forwardDays: number;
245
+ }
246
+ /** Platform default: now to the end of the seventh day. */
247
+ export declare const UPCOMING_FORWARD_DAYS = 7;
248
+ /** How far one widening step reaches at either edge. */
249
+ export declare const UPCOMING_STEP_DAYS = 7;
250
+ /** Where the widening stops — the demo's own ceiling, not the platform's. */
251
+ export declare const UPCOMING_MAX_DAYS = 180;
252
+ export declare const DEFAULT_UPCOMING_WINDOW: UpcomingWindow;
253
+ /** Epoch bounds of a window, inclusive of its closing second. */
254
+ export declare function upcomingWindowBounds(nowIso: string, window: UpcomingWindow): {
255
+ startMs: number;
256
+ endMs: number;
257
+ };
258
+ /** One widening step at either edge, capped at the ceiling. */
259
+ export declare function widenUpcomingWindow(window: UpcomingWindow, edge: 'earlier' | 'later'): UpcomingWindow;
260
+ /** Widen just far enough to reach `targetIso` — the timeline's presets and
261
+ * its jump-to-date land on days the default seven never covered. */
262
+ export declare function upcomingWindowCovering(window: UpcomingWindow, nowIso: string, targetIso: string): UpcomingWindow;
263
+ /**
264
+ * The rows the widget lists: appointments starting inside the window,
265
+ * cancelled excluded, date ascending. Background washes and the composing
266
+ * draft never qualify; tasks are already out of the Increment 1 feed.
267
+ */
268
+ export declare function upcomingAppointmentRows(rows: CalendarRow[], bounds: {
269
+ startMs: number;
270
+ endMs: number;
271
+ }): CalendarRow[];
272
+ /** One agenda row as the kit timeline's item — identity, allocation and
273
+ * care lines; the row id stays the event id so a click maps straight
274
+ * back onto the grid. */
275
+ export declare function upcomingAppointmentItem(row: CalendarRow, privacy: boolean, data: CalendarData): AppointmentItem;
276
+ /** How far back the platform's booking query looks, on `createdAt`. */
277
+ export declare const ONLINE_BOOKINGS_WINDOW_DAYS = 30;
278
+ /**
279
+ * Bookings still to check: created online (or through the API) within
280
+ * the last 30 days, not cancelled, and still missing a patient OR an
281
+ * operator. Mirrors the repository query behind the platform's alert
282
+ * strip; Increment 1 renders the same count on a toolbar button.
283
+ */
284
+ export declare function onlineBookingsToCheck(rows: readonly CalendarRow[], data: CalendarData): CalendarRow[];
285
+ /**
286
+ * One row of the platform's "Prenotazioni online" page, which Increment 1
287
+ * hosts in the rail instead of sending the user to a separate page.
288
+ * Columns mirror it: when it was booked, what was asked for, whether it
289
+ * was paid online, and what is still missing before it is a real
290
+ * appointment.
291
+ */
292
+ export interface BookingRowView {
293
+ row: CalendarRow;
294
+ eventId: string;
295
+ /** The appointment's own start. */
296
+ start: Date;
297
+ /** Platform `createdAt` — "del <date>" under the appointment date. */
298
+ bookedAt: Date | null;
299
+ /** The booking reason, or the platform's "Non specificato". */
300
+ reason: string | null;
301
+ chairTitle: string | null;
302
+ /** Stripe amount when the patient paid at booking. */
303
+ paidOnline: number | null;
304
+ needsPatient: boolean;
305
+ needsOperator: boolean;
306
+ /** Booked after the user last opened the page — the "(Nuovo)" marker. */
307
+ isNew: boolean;
308
+ }
309
+ /** Bookings made after this instant carry the platform's "(Nuovo)" tag. */
310
+ export declare const DEFAULT_BOOKINGS_LAST_SEEN_ISO = "2026-06-23T00:00:00";
311
+ export declare function bookingRowView(row: CalendarRow, data: CalendarData, lastSeenMs?: number): BookingRowView;
312
+ /** The nine advanced inputs, all optional. Empty = the input is unset;
313
+ * `operatorId` also accepts `NONE`, the platform's "no operator". */
314
+ export interface WaitingListFilters {
315
+ patientId: string;
316
+ patientAssigned: '' | 'yes' | 'no';
317
+ operatorId: string;
318
+ appointmentScheduled: '' | 'yes' | 'no';
319
+ appointmentFrom?: Date;
320
+ appointmentTo?: Date;
321
+ waitingFrom?: Date;
322
+ waitingTo?: Date;
323
+ description: string;
324
+ }
325
+ export declare const EMPTY_WAITING_FILTERS: WaitingListFilters;
326
+ /** How many of the nine inputs carry a value — the toggle's badge. */
327
+ export declare function waitingFiltersActiveCount(filters: WaitingListFilters): number;
328
+ /**
329
+ * One waiting row resolved the way the platform's serializer resolves
330
+ * it: the entry's OWN patient, the linked appointment with its patient,
331
+ * care line and colour, and the operator default. `noConnection` is the
332
+ * platform's "Nessun collegamento" test — none of the four is present.
333
+ */
334
+ export interface WaitingListRowView {
335
+ entry: CalendarWaitingEntry;
336
+ /** Platform `patientId` / `patientName` / `patientPhoneNumber`. */
337
+ patient?: CalendarPatient;
338
+ /** The linked appointment, live from the grid's rows. */
339
+ appointment?: CalendarRow;
340
+ /** Platform `appointmentPatientId` — the linked appointment's patient. */
341
+ appointmentPatient?: CalendarPatient;
342
+ /** Platform `operatorName`. */
343
+ operatorTitle?: string;
344
+ /** Platform `appointmentName` — the linked appointment's care line. */
345
+ appointmentName?: string;
346
+ noConnection: boolean;
347
+ }
348
+ export declare function waitingListRowView(entry: CalendarWaitingEntry, rows: readonly CalendarRow[], data: CalendarData): WaitingListRowView;
349
+ /**
350
+ * The platform's advanced predicates, in its own order. A patient
351
+ * matches the entry's OWN patient or the linked appointment's; the
352
+ * operator and the description only ever read the ENTRY's own fields.
353
+ */
354
+ export declare function waitingEntryMatchesFilters(view: WaitingListRowView, filters: WaitingListFilters, data: CalendarData): boolean;
355
+ /** The quick view first, then the advanced predicates — the platform's
356
+ * own order (`_filterForAdvancedSearch` re-runs the view). */
357
+ export declare function filterWaitingEntries(entries: readonly CalendarWaitingEntry[], rows: readonly CalendarRow[], quickView: WaitingQuickView, filters: WaitingListFilters, data: CalendarData): WaitingListRowView[];
358
+ //# sourceMappingURL=calendar-workspace.model.d.ts.map
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Calendar pattern — the READ MODEL the host supplies, stable for a page
3
+ * load: the practice's resources, catalogue, agenda extras and lookups.
4
+ * It mirrors what the demo once read straight from its fixture module —
5
+ * one property per constant, one method per fixture-backed helper — so
6
+ * the demos hand in their fixtures and the platform island hands in what
7
+ * `/internalApi/...` returned, and the model, panels and surface compute
8
+ * from either without knowing which.
9
+ *
10
+ * Provided once with `<CalendarDataProvider value={data}>`; components
11
+ * read it with `useCalendarData()`, pure model functions take it as an
12
+ * explicit `data` parameter — never a module-level global.
13
+ *
14
+ * Every REQUIRED member is one the shipped runtime actually reads. The
15
+ * handful marked optional are read only by the story-only Final State
16
+ * demo (`src/patterns/demos/calendar/`), which keeps supplying them; a
17
+ * platform host mounting `CalendarWorkspace` can leave them out.
18
+ */
19
+ import { type ReactNode } from 'react';
20
+ import type { CalendarResource } from '../../components/calendar';
21
+ import type { AppointmentItem } from '../../components/appointment-card';
22
+ import type { NotesPanelNote } from '../../components/notes-panel';
23
+ import type { TasksPanelItem } from '../../components/tasks-panel';
24
+ import type { CalendarAppointmentMeta, CalendarBaseEvent, CalendarBookingContact, CalendarBranch, CalendarBusinessHours, CalendarCare, CalendarCareEntry, CalendarCareLink, CalendarCarePlan, CalendarClosure, CalendarHistoryEntry, CalendarHoliday, CalendarOperatorGroup, CalendarPatient, CalendarPracticeFeatures, CalendarPriceList, CalendarTaskDetail, CalendarWaitingEntry } from './calendar.types';
25
+ export interface CalendarData {
26
+ chairs: readonly CalendarResource[];
27
+ operators: readonly CalendarResource[];
28
+ /** Operator groups (platform `OperatorGroup`) for the grouped filter. */
29
+ operatorGroups: readonly CalendarOperatorGroup[];
30
+ /** Operators the practice has disabled (platform `isActive === false`). */
31
+ inactiveOperatorIds: readonly string[];
32
+ /** Operator id → local ISO dates the operator is away. */
33
+ operatorAbsences: Record<string, readonly string[]>;
34
+ /** Operator id → absence display title (a sibling map, optional per operator). */
35
+ operatorAbsenceTitles: Record<string, string>;
36
+ holidays: readonly CalendarHoliday[];
37
+ /** Practice-closed local ISO dates. */
38
+ closedDates: readonly string[];
39
+ /** JS `getDay()` numbers the practice does not work. Optional: the
40
+ * shipped workspace derives its hidden days from `businessHours` and
41
+ * the weekend toggle; only the Final State demo reads this. */
42
+ nonWorkingDays?: readonly number[];
43
+ businessHours: CalendarBusinessHours;
44
+ /** The clock every relative label and ledger stamp is pinned to. */
45
+ nowIso: string;
46
+ /** The date the calendar opens on. */
47
+ initialDateIso: string;
48
+ cares: readonly CalendarCare[];
49
+ priceLists: readonly CalendarPriceList[];
50
+ /** Optional: no shipped code reads the flat list — the panels go
51
+ * through `carePlanById` / `openCarePlansForPatient`. */
52
+ carePlans?: readonly CalendarCarePlan[];
53
+ patients: readonly CalendarPatient[];
54
+ /** The appointments and tasks as the host loaded them, no resource axis. */
55
+ baseEvents: readonly CalendarBaseEvent[];
56
+ /** Event id → appointment extras (patient, operator, chair, care, billing). */
57
+ metaById: Record<string, CalendarAppointmentMeta>;
58
+ /** Event id → the note the patient left on the online booking form. */
59
+ bookingNotes: Record<string, string>;
60
+ /** Event id → what the person typed on the booking website. */
61
+ bookingContacts: Record<string, CalendarBookingContact>;
62
+ /** Task-event id → its chair / operator axis (tasks carry no meta).
63
+ * Optional: the shipped workspace drops tasks at the feed boundary;
64
+ * only the Final State demo, which shows them, reads this. */
65
+ taskAxis?: Record<string, {
66
+ chairId: string;
67
+ operatorId: string;
68
+ }>;
69
+ /** Event id → platform-shaped task detail. */
70
+ taskDetails: Record<string, CalendarTaskDetail>;
71
+ /** The waiting list as loaded — the journey seeds its state from it. */
72
+ waitingList: readonly CalendarWaitingEntry[];
73
+ /** Event id → the modification ledger as loaded. Optional: the
74
+ * workspace reads the ledger off `CalendarJourney.history`, which the
75
+ * host seeds however it likes. */
76
+ appointmentHistory?: Record<string, CalendarHistoryEntry[]>;
77
+ practiceFeatures: CalendarPracticeFeatures;
78
+ branches: readonly CalendarBranch[];
79
+ /** Care id → the medical devices it needs. */
80
+ careDevices: Readonly<Record<string, readonly string[]>>;
81
+ /** Patient id → required documents still unsigned. */
82
+ unsignedRequiredDocs: Readonly<Record<string, number>>;
83
+ /** Patients with an advanced e-signature (AES) setup. */
84
+ patientsWithAes: ReadonlySet<string>;
85
+ /** Appointment id → the deposit paid online when booking. */
86
+ paidOnline: Readonly<Record<string, number>>;
87
+ /** Appointment id → the phone typed on the booking site. */
88
+ bookingPhones: Readonly<Record<string, string>>;
89
+ patientById(id: string): CalendarPatient | undefined;
90
+ patientNotes(patientId: string): NotesPanelNote[];
91
+ patientAppointments(patientId: string): AppointmentItem[];
92
+ patientTasks(patientId: string): TasksPanelItem[];
93
+ careById(id: string): CalendarCare | undefined;
94
+ carePlanById(id: string): CalendarCarePlan | undefined;
95
+ /** Optional: no shipped code calls it — the editor links through
96
+ * `openCarePlansForPatient`, the details panel through
97
+ * `carePlanById`. */
98
+ carePlansForPatient?(patientId: string): CalendarCarePlan[];
99
+ /** Plans the editor may link to: not discarded or closed, with undone lines. */
100
+ openCarePlansForPatient(patientId: string): CalendarCarePlan[];
101
+ /** The care entries a link resolves to — plan lines in plan order, or
102
+ * the price-list picks. Unknown ids are dropped. */
103
+ careEntriesFromLink(link: CalendarCareLink): CalendarCareEntry[];
104
+ /** Closed dates plus holidays, unless the practice stays open on them. */
105
+ practiceClosedOn(dateIso: string): boolean;
106
+ /** Why a date (or, given an operator, that column) cannot take a
107
+ * booking — closed > holiday > absence; null when it can. */
108
+ closureOn(dateIso: string, operatorId?: string): CalendarClosure | null;
109
+ /** Local dates in [from, to] with practice hours that are neither
110
+ * closed nor a holiday. */
111
+ openDatesBetween(from: Date, to: Date): string[];
112
+ /** Waiting-since instant for an entry (platform `createdAt`). */
113
+ waitingSinceIso(entry: CalendarWaitingEntry): string;
114
+ }
115
+ /** Wrap whatever renders the calendar's panels and surface — one provider
116
+ * per subtree is fine (a rail renders its panels outside the page tree). */
117
+ export declare function CalendarDataProvider({ value, children, }: {
118
+ value: CalendarData;
119
+ children?: ReactNode;
120
+ }): import("react").FunctionComponentElement<import("react").ProviderProps<CalendarData | null>>;
121
+ export declare function useCalendarData(): CalendarData;
122
+ //# sourceMappingURL=calendar.data.d.ts.map
@@ -0,0 +1,10 @@
1
+ export type SheetId = 'appointment-editor' | 'appointment-details' | 'find-slots' | 'backlog' | 'patient-care-plan';
2
+ export interface SheetHostContext {
3
+ open(id: SheetId): void;
4
+ close(): void;
5
+ }
6
+ /** Wrap whatever renders the panels and the surface — one provider per
7
+ * subtree is fine (a rail renders its panels outside the page tree). */
8
+ export declare const SheetHostProvider: import("react").Provider<SheetHostContext | null>;
9
+ export declare function useSheetHost(): SheetHostContext;
10
+ //# sourceMappingURL=calendar.host.d.ts.map