@alfadocs/ui-kit 1.25.0 → 1.25.1-calendar.10

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 (51) hide show
  1. package/dist/_chunks/{address-fields-CZ0pEdEI.js → address-fields-jFfjxOQR.js} +3 -3
  2. package/dist/_chunks/{appointment-card-Dzr3GeVz.js → appointment-card-CvUFFEdS.js} +8 -6
  3. package/dist/_chunks/{appointment-timeline-DhHwmHo1.js → appointment-timeline-DsMZY7U9.js} +2 -2
  4. package/dist/_chunks/{appointment-tray-4FUu_5NX.js → appointment-tray-Z2GaOIYQ.js} +2 -2
  5. package/dist/_chunks/{booking-WXKbA69C.js → booking-B8C7jMrn.js} +2 -2
  6. package/dist/_chunks/{calendar-CI9MINcR.js → calendar-CBqU-UIR.js} +4 -2
  7. package/dist/_chunks/calendar-workspace-k7BG8yIE.js +7902 -0
  8. package/dist/_chunks/{color-picker-CU303VjY.js → color-picker-Bl5f0iK1.js} +28 -25
  9. package/dist/_chunks/{combobox-D7_NLE2Z.js → combobox-DnSdYssy.js} +216 -215
  10. package/dist/_chunks/{country-select-DzbPFktV.js → country-select-CfDNFG5c.js} +2 -2
  11. package/dist/_chunks/{face-scheme-DA2vjqaM.js → face-scheme-l-CQyLs-.js} +2 -2
  12. package/dist/_chunks/{notes-panel-CTNpsByN.js → notes-panel-D4S2VwDx.js} +2 -2
  13. package/dist/_chunks/{patient-details-DYAmq76G.js → patient-details-CdfursHt.js} +3 -3
  14. package/dist/_chunks/{province-select-BBc7s7vR.js → province-select-BaUnkg4S.js} +2 -2
  15. package/dist/_chunks/{rich-text-editor-lSCiE0Zz.js → rich-text-editor-VJATL1Tk.js} +2 -2
  16. package/dist/agent-catalog.json +6 -3
  17. package/dist/agent-i18n/en.json +2 -2
  18. package/dist/components/address-fields/index.js +1 -1
  19. package/dist/components/appointment-card/index.js +2 -2
  20. package/dist/components/appointment-timeline/index.js +1 -1
  21. package/dist/components/booking/index.js +1 -1
  22. package/dist/components/calendar/index.js +1 -1
  23. package/dist/components/color-picker/index.js +1 -1
  24. package/dist/components/combobox/combobox.d.ts +5 -0
  25. package/dist/components/combobox/index.js +1 -1
  26. package/dist/components/country-select/index.js +1 -1
  27. package/dist/components/face-scheme/index.js +1 -1
  28. package/dist/components/notes-panel/index.js +1 -1
  29. package/dist/components/patient-details/index.js +1 -1
  30. package/dist/components/province-select/index.js +1 -1
  31. package/dist/components/rich-text-editor/index.js +1 -1
  32. package/dist/i18n/locales/de.d.ts +10 -10
  33. package/dist/i18n/locales/de.js +10 -10
  34. package/dist/i18n/locales/it.d.ts +10 -10
  35. package/dist/i18n/locales/it.js +10 -10
  36. package/dist/index.js +15 -15
  37. package/dist/locales/de.json +10 -10
  38. package/dist/locales/it.json +10 -10
  39. package/dist/patterns/calendar/calendar-editor-hydration.d.ts +36 -0
  40. package/dist/patterns/calendar/calendar-patient-picker.d.ts +11 -0
  41. package/dist/patterns/calendar/calendar-workspace.d.ts +21 -1
  42. package/dist/patterns/calendar/calendar-workspace.model.d.ts +1 -3
  43. package/dist/patterns/calendar/calendar.data.d.ts +17 -0
  44. package/dist/patterns/calendar/calendar.journey.d.ts +3 -1
  45. package/dist/patterns/calendar/calendar.model.d.ts +9 -0
  46. package/dist/patterns/calendar/calendar.sheets.d.ts +12 -4
  47. package/dist/patterns/calendar/calendar.surface.d.ts +3 -1
  48. package/dist/patterns/calendar/index.d.ts +3 -2
  49. package/dist/patterns/calendar/index.js +1 -1
  50. package/package.json +3 -2
  51. package/dist/_chunks/calendar-workspace-Dy4ZKtW0.js +0 -7506
@@ -362,9 +362,7 @@ export interface BookingRowView {
362
362
  /** Booked after the user last opened the page — the "(Nuovo)" marker. */
363
363
  isNew: boolean;
364
364
  }
365
- /** Bookings made after this instant carry the platform's "(Nuovo)" tag. */
366
- export declare const DEFAULT_BOOKINGS_LAST_SEEN_ISO = "2026-06-23T00:00:00";
367
- export declare function bookingRowView(row: CalendarRow, data: CalendarData, lastSeenMs?: number): BookingRowView;
365
+ export declare function bookingRowView(row: CalendarRow, data: CalendarData, lastSeenMs?: number | null, createdAtIso?: string): BookingRowView;
368
366
  /** The nine advanced inputs, all optional. Empty = the input is unset;
369
367
  * `operatorId` also accepts `NONE`, the platform's "no operator". */
370
368
  export interface WaitingListFilters {
@@ -22,6 +22,7 @@
22
22
  */
23
23
  import { type ReactNode } from 'react';
24
24
  import type { CalendarResource } from '../../components/calendar';
25
+ import type { PaletteSwatch } from '../../components/color-picker';
25
26
  import type { AppointmentItem } from '../../components/appointment-card';
26
27
  import type { NotesPanelNote } from '../../components/notes-panel';
27
28
  import type { TasksPanelItem } from '../../components/tasks-panel';
@@ -37,6 +38,13 @@ export interface CalendarData {
37
38
  operatorAbsences: Record<string, readonly string[]>;
38
39
  /** Operator id → absence display title (a sibling map, optional per operator). */
39
40
  operatorAbsenceTitles: Record<string, string>;
41
+ /**
42
+ * Appointment colours the host accepts. When omitted, the workspace uses
43
+ * its documented Google-style fallback palette for demos and legacy hosts.
44
+ * A platform host should provide its configured DoctorColor values so a
45
+ * colour selected in the editor always maps back to a writable colour id.
46
+ */
47
+ appointmentPalette?: readonly PaletteSwatch[];
40
48
  holidays: readonly CalendarHoliday[];
41
49
  /** Practice-closed local ISO dates. */
42
50
  closedDates: readonly string[];
@@ -61,6 +69,15 @@ export interface CalendarData {
61
69
  * through `carePlanById` / `openCarePlansForPatient`. */
62
70
  carePlans?: readonly CalendarCarePlan[];
63
71
  patients: readonly CalendarPatient[];
72
+ /** Optional host typeahead. Omit for client filtering of `patients`.
73
+ * The picker debounces nonblank queries, aborts superseded requests and
74
+ * keeps the host's result order, including matches by phone or number.
75
+ * Before resolving, make returned records available through `patientById`
76
+ * so other patient-dependent fields can resolve the chosen id. Reject
77
+ * failures; an empty array means a successful search with no matches. */
78
+ searchPatients?(query: string, options: {
79
+ signal: AbortSignal;
80
+ }): Promise<readonly CalendarPatient[]>;
64
81
  /** The appointments and tasks as the host loaded them, no resource axis. */
65
82
  baseEvents: readonly CalendarBaseEvent[];
66
83
  /** Event id → appointment extras (patient, operator, chair, care, billing). */
@@ -90,7 +90,9 @@ export interface CalendarJourney {
90
90
  handleFindSlotsForWaiting: (entry: CalendarWaitingEntry) => void;
91
91
  clearFindSlotsSeed: () => void;
92
92
  handleBookSlotFromFinder: (prefill: EditorPrefill) => void;
93
- handleCreateAppointment: (draft: EditorDraft) => void;
93
+ /** Resolve only after the write is accepted. Reject with a safe,
94
+ * user-facing Error message to keep the editor open with its draft. */
95
+ handleCreateAppointment: (draft: EditorDraft) => void | Promise<void>;
94
96
  /**
95
97
  * Commit a new note on the patient's record. The HOST builds the
96
98
  * stored note — its id, its timestamp and its AUTHOR, who is the
@@ -136,6 +136,15 @@ export declare function formatDay(locale: string, value: Date | string): string;
136
136
  * the platform popover's "(NN anni)" beside the patient's name. Pinned
137
137
  * to `data.nowIso` so the figure never drifts under a test. */
138
138
  export declare function patientAgeYears(dobIso: string, data: CalendarData): number;
139
+ /** Per-appointment capabilities from the host's canonical read. Omitted
140
+ * capabilities preserve the existing editor behaviour. Locked fields
141
+ * are omitted from drafts, so the host must preserve their stored values. */
142
+ export interface CalendarEditorCapabilities {
143
+ editCare?: boolean;
144
+ editPatient?: boolean;
145
+ editDescription?: boolean;
146
+ editRecurrence?: boolean;
147
+ }
139
148
  export interface EditorPrefill {
140
149
  /** Set = the editor EDITS this existing event; unset = create. */
141
150
  editEventId?: string;
@@ -22,6 +22,7 @@
22
22
  * the demos or the shared story shell.
23
23
  */
24
24
  import { type ReactNode } from 'react';
25
+ import type { CalendarEditorCapabilities } from './calendar.model';
25
26
  import { type CalendarEvent } from '../../components/calendar';
26
27
  import { type NotesPanelNote, type NotesPanelProps, type NotesPanelSubmission } from '../../components/notes-panel';
27
28
  import { type ColorAssociation, type CalendarCarePlan, type CalendarAnamnesisAnswer, type CalendarOperatorGroup, type CalendarPatient, type CalendarWaitingEntry, type CalendarHistoryEntry, type CalendarSignChannel, type PatientRef } from './calendar.types';
@@ -145,9 +146,12 @@ export interface EditorPlatformOptions {
145
146
  * reached from a prefill with `simpleSave: false` (audit C13). */
146
147
  onSaveAndReturn?: () => void;
147
148
  }
148
- export declare function AppointmentEditorPanel({ prefill, onSave, onDelete, onDuplicate, panelTitle, headerIcon, identity, after, closeOnSave, onDraftChange, slotPatch, colorAssociation, locale, scheduleByEntry, history, notes, onMove, onCopy, onWhatsApp, readOnly, platform, className, }: {
149
+ export declare function AppointmentEditorPanel({ prefill, onSave, onDelete, onDuplicate, panelTitle, headerIcon, identity, after, closeOnSave, onDraftChange, slotPatch, colorAssociation, locale, scheduleByEntry, history, notes, onMove, onCopy, onWhatsApp, readOnly, capabilities, platform, className, }: {
149
150
  prefill?: EditorPrefill;
150
- onSave: (draft: EditorDraft, extras?: EditorDraftExtras) => void;
151
+ capabilities?: CalendarEditorCapabilities;
152
+ /** The editor closes only after acceptance. A rejection leaves the
153
+ * draft intact and displays its safe, user-facing Error message. */
154
+ onSave: (draft: EditorDraft, extras?: EditorDraftExtras) => void | Promise<void>;
151
155
  /** Live composition feed — the grid mirrors the slot being filled as a
152
156
  * draft placeholder while this panel is open. Emits `null` on unmount
153
157
  * so the placeholder clears with the panel. */
@@ -297,15 +301,19 @@ export declare function BacklogPanel({ items, locale, seed, signRequests, onProc
297
301
  * mode (create / move banner) instead of opening the editor at once. */
298
302
  onPlaceWaiting?: (entry: CalendarWaitingEntry) => void;
299
303
  }): import("react/jsx-runtime").JSX.Element;
300
- export declare function BookingsPanel({ bookings, locale, privacy, onShowInCalendar, onComplete, }: {
304
+ export declare function BookingsPanel({ bookings, locale, privacy, status, lastSeenIso, createdAtById, onRetry, onShowInCalendar, onComplete, }: {
301
305
  bookings: readonly CalendarRow[];
302
306
  locale?: string;
303
307
  /** Masks the patient names, in step with the grid. */
304
308
  privacy?: boolean;
309
+ status?: 'loading' | 'ready' | 'error';
310
+ lastSeenIso?: string | null;
311
+ createdAtById?: Readonly<Record<string, string>>;
312
+ onRetry?: () => void;
305
313
  /** Steers the grid to the booking and rings its card. */
306
314
  onShowInCalendar: (eventId: string) => void;
307
315
  /** Opens the editor to complete it (platform "Completa appuntamento"). */
308
- onComplete: (row: CalendarRow) => void;
316
+ onComplete?: (row: CalendarRow) => void;
309
317
  }): import("react/jsx-runtime").JSX.Element;
310
318
  export declare function WaitingListPanel({ entries, rows, locale, onPlaceWaiting, onRemoveWaiting, onOpenEntryForm, onOpenPatient, onOpenAppointment, readOnly, }: {
311
319
  entries: CalendarWaitingEntry[];
@@ -1,7 +1,7 @@
1
1
  import { type CalendarPreferenceAdapter } from './calendar.preferences';
2
2
  import { type CalendarRow, type RailFocus, type EditorPrefill, type HistoryInput, type AvailabilityContext, type CalendarFreeSlot } from './calendar.model';
3
3
  import { type WorkspaceDisplaySettings, type CreateModeRequest, type PlacementRequest, type SaveNotice, type CalendarWorkspaceToolId } from './calendar-workspace.model';
4
- export declare function CalendarSurface({ rows, setRows, onFocus, locale, onComposeNew, onOpenWaitingList, onAddWaitingEntry, onOpenOnlineBookings, onlineBookingsCount, waitingBadgeCount, onVisibleRangeChange, selectedEventId, gotoRequest, onBookSlot, display, setDisplay, onHistory, readOnly, placement, onPlacementEnd, createMode, onCreateModeEnd, focusScroll, saveNotice, privacy, onPrivacyChange, availability, availabilityContext, availableTools, schedulerLicenseKey, id, preferences, }: {
4
+ export declare function CalendarSurface({ rows, setRows, onFocus, locale, onComposeNew, onOpenWaitingList, onAddWaitingEntry, onOpenOnlineBookings, onlineBookingsCount, waitingBadgeCount, onVisibleRangeChange, selectedEventId, gotoRequest, onBookSlot, display, setDisplay, onHistory, readOnly, reviewOnlyEventIds, placement, onPlacementEnd, createMode, onCreateModeEnd, focusScroll, saveNotice, privacy, onPrivacyChange, availability, availabilityContext, availableTools, schedulerLicenseKey, id, preferences, }: {
5
5
  rows: CalendarRow[];
6
6
  setRows: React.Dispatch<React.SetStateAction<CalendarRow[]>>;
7
7
  onFocus: (focus: RailFocus) => void;
@@ -16,6 +16,8 @@ export declare function CalendarSurface({ rows, setRows, onFocus, locale, onComp
16
16
  availabilityContext: AvailabilityContext | null;
17
17
  /** No edit permission: no drag, no slot-click create. */
18
18
  readOnly?: boolean;
19
+ /** Host queue rows whose canonical editor data is not available yet. */
20
+ reviewOnlyEventIds?: ReadonlySet<string>;
19
21
  /** A Move… / Copy… armed from the details panel — the grid shows the
20
22
  * mode banner and the next empty-slot click places the appointment. */
21
23
  placement?: PlacementRequest | null;
@@ -1,9 +1,10 @@
1
- export { CalendarWorkspace, initialWorkspaceDisplay, WORKSPACE_TOOL, type CalendarWorkspaceProps, type CalendarWorkspaceToolId, } from './calendar-workspace';
1
+ export { CalendarWorkspace, initialWorkspaceDisplay, WORKSPACE_TOOL, type CalendarWorkspaceProps, type CalendarOnlineBookings, type CalendarWorkspaceToolId, } from './calendar-workspace';
2
2
  export { CalendarDataProvider, useCalendarData, type CalendarData, } from './calendar.data';
3
3
  export type { CalendarJourney } from './calendar.journey';
4
+ export type { CalendarAppointmentEditorSnapshot, CalendarAppointmentEditorLoader, } from './calendar-editor-hydration';
4
5
  export { SheetHostProvider, useSheetHost, type SheetHostContext, type SheetId, } from './calendar.host';
5
6
  export { CALENDAR_PREFERENCE_KEYS, memoryPreferenceAdapter, resetCalendarPreferences, usePersistedPreference, type CalendarPreferenceAdapter, } from './calendar.preferences';
6
- export { DEFAULT_DISPLAY, VIEW_OPTIONS, type AvailabilityContext, type BacklogFilter, type BacklogItem, type BacklogType, type CalendarFreeSlot, type CalendarRow, type CalendarSeries, type DisplaySettings, type DraftSlot, type EditorDraft, type EditorPrefill, type EditorRecurrence, type FindSlotsSeed, type HistoryInput, type PendingMove, type RailFocus, type RecurrenceFrequency, type SlotPatch, type ViewOption, type ViewOptionId, type WaitingEntryDraft, } from './calendar.model';
7
+ export { DEFAULT_DISPLAY, VIEW_OPTIONS, type AvailabilityContext, type BacklogFilter, type BacklogItem, type BacklogType, type CalendarFreeSlot, type CalendarEditorCapabilities, type CalendarRow, type CalendarSeries, type DisplaySettings, type DraftSlot, type EditorDraft, type EditorPrefill, type EditorRecurrence, type FindSlotsSeed, type HistoryInput, type PendingMove, type RailFocus, type RecurrenceFrequency, type SlotPatch, type ViewOption, type ViewOptionId, type WaitingEntryDraft, } from './calendar.model';
7
8
  export { DEFAULT_WORKSPACE_DISPLAY, WORKSPACE_VIEWS, type ChairNameDisplay, type DeleteOptions, type EditorDraftExtras, type OperatorNameDisplay, type RecurringScope, type RequiredDocsSignMode, type WorkspaceDisplaySettings, type WorkspaceViewId, } from './calendar-workspace.model';
8
9
  export type { AssociationColorSources, CalendarAnamnesisAnswer, CalendarAppointmentMeta, CalendarBaseEvent, CalendarBookingContact, CalendarBranch, CalendarBusinessHours, CalendarCare, CalendarCareEntry, CalendarCareLink, CalendarCarePlan, CalendarCarePlanEntry, CalendarClosure, CalendarDayHours, CalendarHistoryEntry, CalendarHistoryField, CalendarHistoryKind, CalendarHoliday, CalendarOperatorFilterGroup, CalendarOperatorGroup, CalendarPatient, CalendarPhoneLabel, CalendarPhoneNumber, CalendarPractice, CalendarPracticeFeatures, CalendarPriceList, CalendarSignChannel, CalendarSignDocument, CalendarTaskDetail, CalendarWaitingEntry, CalendarWeeklyHours, CareDescriptionMode, ColorAssociation, } from './calendar.types';
9
10
  export type { CalendarEvent, CalendarEventStatus, CalendarResource, } from '../../components/calendar';
@@ -1,4 +1,4 @@
1
- import { C as s, a as r, b as E, D as P, c as t, S, V as A, W as C, d, i as o, m as D, r as i, u as n, e as W, f as _ } from "../../_chunks/calendar-workspace-Dy4ZKtW0.js";
1
+ import { C as s, a as r, b as E, D as P, c as t, S, V as A, W as C, d, i as o, m as D, r as i, u as n, e as W, f as _ } from "../../_chunks/calendar-workspace-k7BG8yIE.js";
2
2
  export {
3
3
  s as CALENDAR_PREFERENCE_KEYS,
4
4
  r as CalendarDataProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "1.25.0",
3
+ "version": "1.25.1-calendar.10",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -888,7 +888,8 @@
888
888
  },
889
889
  "publishConfig": {
890
890
  "access": "public",
891
- "registry": "https://registry.npmjs.org/"
891
+ "registry": "https://registry.npmjs.org/",
892
+ "tag": "calendar-preview"
892
893
  },
893
894
  "engines": {
894
895
  "node": ">=22.6.0"