@alfadocs/ui-kit 1.39.0 → 1.41.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 (113) hide show
  1. package/dist/_chunks/{ai-consent-banner-DvtaM3yg.js → ai-consent-banner-D7I2U-cz.js} +37 -36
  2. package/dist/_chunks/arrow-left-BfaGqVam.js +15 -0
  3. package/dist/_chunks/{booking-Dn3jvv3K.js → booking-D43ASl8y.js} +1109 -1103
  4. package/dist/_chunks/{calendar-workspace-B-fUbm62.js → calendar-workspace-UllCER2k.js} +2170 -2163
  5. package/dist/_chunks/{contact-profile-card-Zt6WNg1u.js → contact-profile-card-C0WpwpVV.js} +38 -33
  6. package/dist/_chunks/editor-overlay-DwNKaI22.js +93 -0
  7. package/dist/_chunks/format-price-DAbh61Lz.js +51 -0
  8. package/dist/_chunks/help-me-write-templates-GB70jnV9.js +764 -0
  9. package/dist/_chunks/{marketplace-app-shell-d2EtcUbe.js → marketplace-app-shell-D_g9BaDI.js} +2 -2
  10. package/dist/_chunks/{money-BY-HmKhZ.js → money-BXLBIRVO.js} +2 -2
  11. package/dist/_chunks/{notes-panel-CAD1Ytcj.js → notes-panel-_diLt8Cj.js} +76 -73
  12. package/dist/_chunks/{panel-subview-Cc2Wtt7D.js → panel-subview-PMBRPFOa.js} +49 -59
  13. package/dist/_chunks/{practice-results-D_jjzwgf.js → practice-results-D11Zpt27.js} +50 -45
  14. package/dist/_chunks/rich-text-editor-D7AKKAQ2.js +3119 -0
  15. package/dist/_chunks/{sidebar-C-Gr2LL-.js → sidebar-ClTY9lLI.js} +160 -169
  16. package/dist/_chunks/{treatment-receipt-dUm99mdn.js → treatment-receipt-DU0OewqH.js} +2 -2
  17. package/dist/_chunks/trending-up-C_luYBzS.js +15 -0
  18. package/dist/_chunks/wand-sparkles-DAjKyhz7.js +27 -0
  19. package/dist/agent-catalog.json +87 -1
  20. package/dist/agent-i18n/en.json +7 -0
  21. package/dist/components/_shared/format-price.d.ts +6 -0
  22. package/dist/components/_shared/index.d.ts +1 -1
  23. package/dist/components/ai-consent-banner/ai-consent-banner.d.ts +9 -0
  24. package/dist/components/ai-consent-banner/index.d.ts +1 -1
  25. package/dist/components/ai-consent-banner/index.js +1 -1
  26. package/dist/components/booking/booking-types.d.ts +6 -0
  27. package/dist/components/booking/cascade.d.ts +6 -0
  28. package/dist/components/booking/index.js +1 -1
  29. package/dist/components/contact-profile-card/contact-profile-card.d.ts +2 -2
  30. package/dist/components/contact-profile-card/index.js +1 -1
  31. package/dist/components/editor-overlay/index.js +1 -1
  32. package/dist/components/index.d.ts +1 -0
  33. package/dist/components/money/index.js +1 -1
  34. package/dist/components/notes-panel/index.d.ts +1 -0
  35. package/dist/components/notes-panel/index.js +1 -1
  36. package/dist/components/notes-panel/notes-panel.d.ts +8 -1
  37. package/dist/components/panel-subview/index.js +1 -1
  38. package/dist/components/practice-results/index.js +1 -1
  39. package/dist/components/practice-results/practice-results.d.ts +2 -1
  40. package/dist/components/rich-text-editor/editor-toolbar.d.ts +6 -1
  41. package/dist/components/rich-text-editor/index.d.ts +1 -1
  42. package/dist/components/rich-text-editor/index.js +1 -1
  43. package/dist/components/rich-text-editor/rich-text-editor.d.ts +122 -0
  44. package/dist/components/sidebar/index.js +1 -1
  45. package/dist/components/treatment-receipt/index.js +1 -1
  46. package/dist/host-compat.css +13 -1
  47. package/dist/i18n/locales/ar.d.ts +92 -11
  48. package/dist/i18n/locales/ar.js +94 -13
  49. package/dist/i18n/locales/de.d.ts +92 -11
  50. package/dist/i18n/locales/de.js +94 -13
  51. package/dist/i18n/locales/el.d.ts +92 -11
  52. package/dist/i18n/locales/el.js +94 -13
  53. package/dist/i18n/locales/en.d.ts +81 -0
  54. package/dist/i18n/locales/en.js +83 -2
  55. package/dist/i18n/locales/es.d.ts +92 -11
  56. package/dist/i18n/locales/es.js +94 -13
  57. package/dist/i18n/locales/fr.d.ts +92 -11
  58. package/dist/i18n/locales/fr.js +94 -13
  59. package/dist/i18n/locales/hi.d.ts +92 -11
  60. package/dist/i18n/locales/hi.js +94 -13
  61. package/dist/i18n/locales/it.d.ts +92 -11
  62. package/dist/i18n/locales/it.js +94 -13
  63. package/dist/i18n/locales/ja.d.ts +92 -11
  64. package/dist/i18n/locales/ja.js +94 -13
  65. package/dist/i18n/locales/nl.d.ts +92 -11
  66. package/dist/i18n/locales/nl.js +94 -13
  67. package/dist/i18n/locales/pl.d.ts +92 -11
  68. package/dist/i18n/locales/pl.js +94 -13
  69. package/dist/i18n/locales/pt.d.ts +92 -11
  70. package/dist/i18n/locales/pt.js +94 -13
  71. package/dist/i18n/locales/ro.d.ts +92 -11
  72. package/dist/i18n/locales/ro.js +94 -13
  73. package/dist/i18n/locales/ru.d.ts +92 -11
  74. package/dist/i18n/locales/ru.js +94 -13
  75. package/dist/i18n/locales/sq.d.ts +92 -11
  76. package/dist/i18n/locales/sq.js +94 -13
  77. package/dist/i18n/locales/sv.d.ts +92 -11
  78. package/dist/i18n/locales/sv.js +94 -13
  79. package/dist/i18n/locales/tr.d.ts +92 -11
  80. package/dist/i18n/locales/tr.js +94 -13
  81. package/dist/i18n/locales/zh.d.ts +92 -11
  82. package/dist/i18n/locales/zh.js +94 -13
  83. package/dist/index.js +143 -136
  84. package/dist/locales/ar.json +94 -13
  85. package/dist/locales/de.json +94 -13
  86. package/dist/locales/el.json +94 -13
  87. package/dist/locales/en.json +83 -2
  88. package/dist/locales/es.json +94 -13
  89. package/dist/locales/fr.json +94 -13
  90. package/dist/locales/hi.json +94 -13
  91. package/dist/locales/it.json +94 -13
  92. package/dist/locales/ja.json +94 -13
  93. package/dist/locales/nl.json +94 -13
  94. package/dist/locales/pl.json +94 -13
  95. package/dist/locales/pt.json +94 -13
  96. package/dist/locales/ro.json +94 -13
  97. package/dist/locales/ru.json +94 -13
  98. package/dist/locales/sq.json +94 -13
  99. package/dist/locales/sv.json +94 -13
  100. package/dist/locales/tr.json +94 -13
  101. package/dist/locales/zh.json +94 -13
  102. package/dist/patterns/calendar/calendar.journey.d.ts +9 -1
  103. package/dist/patterns/calendar/calendar.sheets.d.ts +6 -1
  104. package/dist/patterns/calendar/index.js +1 -1
  105. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +164 -0
  106. package/dist/patterns/help-me-write-templates/index.d.ts +3 -0
  107. package/dist/patterns/help-me-write-templates/index.js +10 -0
  108. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  109. package/dist/tokens.css +51 -42
  110. package/package.json +5 -1
  111. package/dist/_chunks/editor-overlay-9tcPXNWt.js +0 -89
  112. package/dist/_chunks/format-price-BkMEbeW3.js +0 -47
  113. package/dist/_chunks/rich-text-editor-C6fE-uP4.js +0 -2627
@@ -3,7 +3,7 @@ import { forwardRef as R, useRef as j } from "react";
3
3
  import { c as g } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as L } from "react-i18next";
5
5
  import { B as f } from "./badge-BudgzTe_.js";
6
- import { M as u } from "./money-BY-HmKhZ.js";
6
+ import { M as u } from "./money-BXLBIRVO.js";
7
7
  import { C as z, S as h } from "./skeleton-B1KTdJ4N.js";
8
8
  import { T as S } from "./tag-Ci3xJPcH.js";
9
9
  const v = "type-label ds:text-[color:var(--muted-foreground)]", x = g(
@@ -157,4 +157,4 @@ E.displayName = "TreatmentReceipt";
157
157
  export {
158
158
  E as T
159
159
  };
160
- //# sourceMappingURL=treatment-receipt-dUm99mdn.js.map
160
+ //# sourceMappingURL=treatment-receipt-DU0OewqH.js.map
@@ -0,0 +1,15 @@
1
+ import { c as e } from "./createLucideIcon-DhHxpK9K.js";
2
+ /**
3
+ * @license lucide-react v1.22.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const o = [
9
+ ["path", { d: "M16 7h6v6", key: "box55l" }],
10
+ ["path", { d: "m22 7-8.5 8.5-5-5L2 17", key: "1t1m79" }]
11
+ ], n = e("trending-up", o);
12
+ export {
13
+ n as T
14
+ };
15
+ //# sourceMappingURL=trending-up-C_luYBzS.js.map
@@ -0,0 +1,27 @@
1
+ import { c as a } from "./createLucideIcon-DhHxpK9K.js";
2
+ /**
3
+ * @license lucide-react v1.22.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const e = [
9
+ [
10
+ "path",
11
+ {
12
+ d: "m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",
13
+ key: "ul74o6"
14
+ }
15
+ ],
16
+ ["path", { d: "m14 7 3 3", key: "1r5n42" }],
17
+ ["path", { d: "M5 6v4", key: "ilb8ba" }],
18
+ ["path", { d: "M19 14v4", key: "blhpug" }],
19
+ ["path", { d: "M10 2v2", key: "7u0qdc" }],
20
+ ["path", { d: "M7 8H3", key: "zfb6yr" }],
21
+ ["path", { d: "M21 16h-4", key: "1cnmox" }],
22
+ ["path", { d: "M11 3H9", key: "1obp7u" }]
23
+ ], d = a("wand-sparkles", e);
24
+ export {
25
+ d as W
26
+ };
27
+ //# sourceMappingURL=wand-sparkles-DAjKyhz7.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.39.0",
3
+ "packageVersion": "1.41.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -18564,6 +18564,92 @@
18564
18564
  }
18565
18565
  ]
18566
18566
  },
18567
+ {
18568
+ "kind": "pattern",
18569
+ "id": "help-me-write-templates",
18570
+ "composes": [
18571
+ {
18572
+ "component": "rich-text-editor",
18573
+ "as": "editor"
18574
+ },
18575
+ {
18576
+ "component": "editor-overlay",
18577
+ "as": "assistantBar"
18578
+ },
18579
+ {
18580
+ "component": "text-area",
18581
+ "as": "prompt"
18582
+ },
18583
+ {
18584
+ "component": "dropdown-menu",
18585
+ "as": "templatesMenu",
18586
+ "entity": "template"
18587
+ },
18588
+ {
18589
+ "component": "dialog",
18590
+ "as": "templateManager",
18591
+ "entity": "template"
18592
+ },
18593
+ {
18594
+ "component": "dialog",
18595
+ "as": "deleteConfirmation",
18596
+ "entity": "template"
18597
+ },
18598
+ {
18599
+ "component": "alert",
18600
+ "as": "creditsExhausted"
18601
+ },
18602
+ {
18603
+ "component": "alert",
18604
+ "as": "undoNotice"
18605
+ }
18606
+ ],
18607
+ "workflows": [
18608
+ {
18609
+ "name": "run_template",
18610
+ "safety": "phi",
18611
+ "description": "Open the Alia Writing Assistant from the editor's AI pill, open the Templates menu (default template first) and pick a template. It rewrites the selected text, or the whole note when nothing is selected; the draft shows beside the note. Replace swaps the source for the draft, Insert below keeps it and adds the draft after it; the notice that follows offers Undo. Any text typed in the prompt first goes along as extra instructions. Out of AI credits shows a notice instead of a draft.",
18612
+ "descriptionKey": "ui.agent.helpMeWriteTemplates.workflows.runTemplate",
18613
+ "uiActions": [
18614
+ "dropdown-menu.open",
18615
+ "dropdown-menu.close"
18616
+ ],
18617
+ "stateReads": [
18618
+ "dropdown-menu.isOpen"
18619
+ ],
18620
+ "apiActions": [
18621
+ "aiTemplate.generate"
18622
+ ]
18623
+ },
18624
+ {
18625
+ "name": "free_prompt",
18626
+ "safety": "phi",
18627
+ "description": "Type (or dictate with the bar mic) what to write and press Write; the draft is inserted at the caret on Insert.",
18628
+ "descriptionKey": "ui.agent.helpMeWriteTemplates.workflows.freePrompt",
18629
+ "uiActions": [],
18630
+ "apiActions": [
18631
+ "aiTemplate.generate"
18632
+ ]
18633
+ },
18634
+ {
18635
+ "name": "manage_templates",
18636
+ "safety": "write",
18637
+ "description": "Open Manage templates from the Templates menu: list the practice's templates, create or edit one (name, optional short description, instructions for the AI, use as default; names are unique) and delete one after a confirmation. Shown only when the host allows managing.",
18638
+ "descriptionKey": "ui.agent.helpMeWriteTemplates.workflows.manageTemplates",
18639
+ "uiActions": [
18640
+ "dialog.close",
18641
+ "dialog.dismiss"
18642
+ ],
18643
+ "stateReads": [
18644
+ "dialog.isOpen"
18645
+ ],
18646
+ "apiActions": [
18647
+ "aiTemplate.save",
18648
+ "aiTemplate.delete"
18649
+ ]
18650
+ }
18651
+ ]
18652
+ },
18567
18653
  {
18568
18654
  "kind": "pattern",
18569
18655
  "id": "invoices",
@@ -1741,6 +1741,13 @@
1741
1741
  "reviewEfficiency": "Read the Studio efficiency gauge and open the settings checklist to complete the remaining configuration steps."
1742
1742
  }
1743
1743
  },
1744
+ "helpMeWriteTemplates": {
1745
+ "workflows": {
1746
+ "runTemplate": "Open the Alia Writing Assistant from the editor's AI pill, open the Templates menu (default template first) and pick a template. It rewrites the selected text, or the whole note when nothing is selected; the draft shows beside the note. Replace swaps the source for the draft, Insert below keeps it and adds the draft after it; the notice that follows offers Undo. Any text typed in the prompt first goes along as extra instructions. Out of AI credits shows a notice instead of a draft.",
1747
+ "freePrompt": "Type (or dictate with the bar mic) what to write and press Write; the draft is inserted at the caret on Insert.",
1748
+ "manageTemplates": "Open Manage templates from the Templates menu: list the practice's templates, create or edit one (name, optional short description, instructions for the AI, use as default; names are unique) and delete one after a confirmation. Shown only when the host allows managing."
1749
+ }
1750
+ },
1744
1751
  "invoices": {
1745
1752
  "workflows": {
1746
1753
  "filterInvoices": "Narrow the ledger by number, relation, status, date range or amount using the per-column filters.",
@@ -18,6 +18,12 @@
18
18
  * behaviour differs.
19
19
  */
20
20
  export declare function formatPrice(minorUnits: number, currency: string, locale: string): string;
21
+ /**
22
+ * A first-visit price caption: `0` means the visit is free, so it reads as
23
+ * the caller's translated word ("Free" / "Gratuito"), never as "€0.00".
24
+ * Any other amount goes through {@link formatPrice} unchanged.
25
+ */
26
+ export declare function formatPriceOrFree(minorUnits: number, currency: string, locale: string, freeLabel: string): string;
21
27
  /**
22
28
  * The same amount as {@link formatPrice}, but broken into its typed parts so
23
29
  * a renderer can treat the fraction differently from the rest.
@@ -8,7 +8,7 @@ export { computeDueDate, trimesterForWeeks, gestationalMilestones, trimesterHigh
8
8
  export { computeAntenatalSchedule, type AntenatalEvent, type ResolvedAntenatalEvent, type AntenatalScheduleOptions, type AntenatalCategory, type AntenatalStatus, type AntenatalCondition, type ScheduleLocale, type GdmRisk, } from './antenatal-schedule';
9
9
  export { AntenatalScheduleTimeline, type AntenatalScheduleTimelineProps, } from './antenatal-schedule-timeline';
10
10
  export { InsertButton, buildResultText, buildResultHtml, buildResultCardSvg, svgCardToPngDataUri, svgCardToPng, type InsertButtonProps, type InsertVariant, type InsertPayload, type InsertPngResult, type InsertMode, type InsertCardData, type InsertCardField, type InsertCardGauge, type SvgCardToPngOptions, } from './insert-result';
11
- export { formatPrice } from './format-price';
11
+ export { formatPrice, formatPriceOrFree } from './format-price';
12
12
  export { normalizeDiacritics } from './normalize-diacritics';
13
13
  export { useDebouncedCallback } from './use-debounced-callback';
14
14
  export { useFocusTrap, type UseFocusTrapOptions } from './use-focus-trap';
@@ -4,6 +4,8 @@ declare const rootVariants: (props?: ({
4
4
  state?: "required" | "pending" | "granted" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export type AiConsentState = NonNullable<VariantProps<typeof rootVariants>['state']>;
7
+ /** Heading levels `AiConsentBanner.headingLevel` accepts. */
8
+ export type AiConsentBannerHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
7
9
  /** Agent-readiness curated handle. Exposes the structural consent state only. */
8
10
  export interface AiConsentBannerHandle {
9
11
  /** Current derived state: 'granted' | 'required' | 'pending'. */
@@ -37,6 +39,13 @@ export interface AiConsentBannerProps extends Omit<ComponentPropsWithoutRef<'div
37
39
  pending?: boolean;
38
40
  /** Fired when the operator confirms the consent grant. */
39
41
  onGrantConsent?: () => void;
42
+ /**
43
+ * Heading level for the banner's own title, so it can be nested under a
44
+ * host section's heading without skipping levels (axe `heading-order`).
45
+ * Additive: default `5` matches the banner's original, unconditional
46
+ * `<h5>` — every existing consumer is unaffected.
47
+ */
48
+ headingLevel?: AiConsentBannerHeadingLevel;
40
49
  /** Override the region's accessible name. */
41
50
  'aria-label'?: string;
42
51
  }
@@ -1,4 +1,4 @@
1
1
  export { AiConsentBanner } from './ai-consent-banner';
2
- export type { AiConsentBannerProps, AiConsentBannerHandle, AiConsentState, } from './ai-consent-banner';
2
+ export type { AiConsentBannerProps, AiConsentBannerHandle, AiConsentState, AiConsentBannerHeadingLevel, } from './ai-consent-banner';
3
3
  export { aiConsentBannerAgent } from './ai-consent-banner.agent';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { A as e, a as o } from "../../_chunks/ai-consent-banner-DvtaM3yg.js";
1
+ import { A as e, a as o } from "../../_chunks/ai-consent-banner-D7I2U-cz.js";
2
2
  export {
3
3
  e as AiConsentBanner,
4
4
  o as aiConsentBannerAgent
@@ -159,6 +159,12 @@ export interface BookingProps extends Omit<ComponentPropsWithoutRef<'div'>, 'ari
159
159
  allowOperatorSelection?: boolean;
160
160
  /** Pins step 4 to this operator. */
161
161
  lockedOperatorId?: string;
162
+ /**
163
+ * Default: false. When true, the operators offered for a service are the
164
+ * ones linked to that service, even when specialties are on. The specialty
165
+ * only groups services.
166
+ */
167
+ operatorsByService?: boolean;
162
168
  specialties?: BookingSpecialty[];
163
169
  services: BookingService[];
164
170
  operators?: BookingOperator[];
@@ -15,6 +15,12 @@ export interface CascadePolicy {
15
15
  lockedOperatorId?: string;
16
16
  /** Defaults to `false`. When true, single-service lists auto-pre-fill. */
17
17
  autoSelectSingleService?: boolean;
18
+ /**
19
+ * Defaults to `false`. When true, the operators offered come from the
20
+ * chosen service (`appointmentBookingReasonIds`) even when specialties are
21
+ * on; the specialty only groups services. Added in 1.40.0.
22
+ */
23
+ operatorsByService?: boolean;
18
24
  }
19
25
  export interface CascadeInputs extends CascadePolicy {
20
26
  specialties: BookingSpecialty[];
@@ -1,4 +1,4 @@
1
- import { B as A, C as R, O as a, b as s } from "../../_chunks/booking-Dn3jvv3K.js";
1
+ import { B as A, C as R, O as a, b as s } from "../../_chunks/booking-D43ASl8y.js";
2
2
  export {
3
3
  A as Booking,
4
4
  R as CONFIRMATION_CHANNEL_ORDER,
@@ -93,8 +93,8 @@ export interface ContactProfileCardProps extends Omit<ComponentPropsWithoutRef<'
93
93
  insurances?: string[];
94
94
  /**
95
95
  * First-visit price in the smallest currency unit (cents / centesimi).
96
- * Formatted via `Intl.NumberFormat`. Omit when the consumer doesn't
97
- * want to show the price.
96
+ * Formatted via `Intl.NumberFormat`; `0` renders the translated word
97
+ * "Free". Omit when the consumer doesn't want to show the price.
98
98
  */
99
99
  firstVisitPriceCents?: number;
100
100
  /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */
@@ -1,4 +1,4 @@
1
- import { C as _, a as O, b as o, c as r } from "../../_chunks/contact-profile-card-Zt6WNg1u.js";
1
+ import { C as _, a as O, b as o, c as r } from "../../_chunks/contact-profile-card-C0WpwpVV.js";
2
2
  export {
3
3
  _ as CONTACT_PROFILE_CARD_ROW_ICONS,
4
4
  O as CONTACT_PROFILE_CARD_ROW_KEYS,
@@ -1,4 +1,4 @@
1
- import { E as a } from "../../_chunks/editor-overlay-9tcPXNWt.js";
1
+ import { E as a } from "../../_chunks/editor-overlay-DwNKaI22.js";
2
2
  export {
3
3
  a as EditorOverlay
4
4
  };
@@ -215,6 +215,7 @@ export * from './workflow';
215
215
  export * from '../patterns/alia-assistant';
216
216
  export * from '../patterns/anamnesis';
217
217
  export * from '../patterns/calendar';
218
+ export * from '../patterns/help-me-write-templates';
218
219
  export * from '../patterns/marketplace-app-shell';
219
220
  export * from '../patterns/payment-automation-upsell';
220
221
  export * from '../patterns/signature-request';
@@ -1,4 +1,4 @@
1
- import { M as m } from "../../_chunks/money-BY-HmKhZ.js";
1
+ import { M as m } from "../../_chunks/money-BXLBIRVO.js";
2
2
  import { m as n } from "../../_chunks/money.agent-BjJ6gOkx.js";
3
3
  export {
4
4
  m as Money,
@@ -1,3 +1,4 @@
1
1
  export { NotesPanel } from './notes-panel';
2
2
  export type { NotesPanelProps, NotesPanelNote, NotesPanelNoteActions, NotesPanelSubmission, } from './notes-panel';
3
+ export type { AiConsentGate } from '../rich-text-editor';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { N as a } from "../../_chunks/notes-panel-CAD1Ytcj.js";
1
+ import { N as a } from "../../_chunks/notes-panel-_diLt8Cj.js";
2
2
  export {
3
3
  a as NotesPanel
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  import type { ClinicalNoteCardProps } from '../clinical-note-card';
3
- import type { RichTextEditorProps, RichTextEditorToolbar, RedactorFactory } from '../rich-text-editor';
3
+ import type { RichTextEditorProps, RichTextEditorToolbar, RedactorFactory, AiConsentGate } from '../rich-text-editor';
4
4
  /**
5
5
  * One note in the panel — the data subset of `ClinicalNoteCard`.
6
6
  *
@@ -138,6 +138,13 @@ export interface NotesPanelProps extends Omit<HTMLAttributes<HTMLElement>, 'titl
138
138
  onDictate?: RichTextEditorProps['onDictate'];
139
139
  onProofread?: RichTextEditorProps['onProofread'];
140
140
  onAutoFormat?: RichTextEditorProps['onAutoFormat'];
141
+ /**
142
+ * Patient AI-consent gate for Help-me-write + both mics, forwarded
143
+ * straight to the rich composer. See `AiConsentGate`. Omit for today's
144
+ * ungated behaviour. Ignored by the `'plain'` composer (it offers
145
+ * neither affordance).
146
+ */
147
+ aiConsent?: AiConsentGate;
141
148
  /** Toggle a note's pinned state — renders an inline pin button per note. */
142
149
  onTogglePin?: (id: string) => void;
143
150
  /** Toggle a note's flagged state — renders an inline flag button per note. */
@@ -1,4 +1,4 @@
1
- import { P as o } from "../../_chunks/panel-subview-Cc2Wtt7D.js";
1
+ import { P as o } from "../../_chunks/panel-subview-PMBRPFOa.js";
2
2
  import { p as r } from "../../_chunks/panel-subview.agent-BIBvE-IW.js";
3
3
  export {
4
4
  o as PanelSubview,
@@ -1,4 +1,4 @@
1
- import { P as t, p as a } from "../../_chunks/practice-results-D_jjzwgf.js";
1
+ import { P as t, p as a } from "../../_chunks/practice-results-D11Zpt27.js";
2
2
  export {
3
3
  t as PracticeResults,
4
4
  a as practiceResultsAgent
@@ -85,7 +85,8 @@ export interface PracticeResult {
85
85
  * `ContactProfileCard.firstVisitPriceCents` — the KIT formats, the
86
86
  * consumer never hands over a pre-rendered string.
87
87
  *
88
- * `0` is a real value meaning "free" and renders as such. Omit the
88
+ * `0` is a real value meaning "free" and renders the translated word
89
+ * "Free" (`common.freeOfCharge`), never a zero amount. Omit the
89
90
  * field (or pass `undefined`) when the practice has not set a price —
90
91
  * the row then disappears completely. Added for HTP-6136.
91
92
  */
@@ -1,4 +1,5 @@
1
1
  import { type RefObject } from 'react';
2
+ import type { RichTextEditorVariable } from './rich-text-editor';
2
3
  export type EditorToolbarPreset = 'minimal' | 'standard' | 'full';
3
4
  export interface EditorToolbarProps {
4
5
  /** Dispatch a Redactor command (and refresh active state). */
@@ -30,6 +31,10 @@ export interface EditorToolbarProps {
30
31
  * wired to a menu.
31
32
  */
32
33
  showExtensions?: boolean;
34
+ /** Template variables for the "Insert variable" menu (hidden when empty). */
35
+ variables?: RichTextEditorVariable[];
36
+ /** Insert a variable chip at the saved caret. */
37
+ insertVariable?: (token: string) => void;
33
38
  }
34
39
  export interface TableFloatingToolbarProps {
35
40
  active: ReadonlySet<string>;
@@ -63,5 +68,5 @@ export interface ImageFloatingToolbarProps {
63
68
  setImageWidth: (pct: number) => void;
64
69
  }
65
70
  export declare function ImageFloatingToolbar({ areaRef, activeImageEl: img, applyImageClass, setImageWidth, }: ImageFloatingToolbarProps): React.JSX.Element | null;
66
- export declare function EditorToolbar({ run, active, preset, insertHtml, insertTable, saveSelection, restoreSelection, getSelectedText, uploadImage, enableColor, enableImage, enableTable, showExtensions, }: EditorToolbarProps): React.JSX.Element;
71
+ export declare function EditorToolbar({ run, active, preset, insertHtml, insertTable, saveSelection, restoreSelection, getSelectedText, uploadImage, enableColor, enableImage, enableTable, showExtensions, variables, insertVariable, }: EditorToolbarProps): React.JSX.Element;
67
72
  //# sourceMappingURL=editor-toolbar.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export { RichTextEditor, wrapperVariants } from './rich-text-editor';
2
- export type { RichTextEditorHandle, RichTextEditorProps, RichTextEditorToolbar, RedactorFactory, } from './rich-text-editor';
2
+ export type { RichTextEditorHandle, RichTextEditorProps, RichTextEditorToolbar, RedactorFactory, AiConsentGate, RichTextEditorVariable, HelpMeWriteRenderContext, } from './rich-text-editor';
3
3
  export { richTextEditorAgent } from './rich-text-editor.agent';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { R as a, r as e, w as i } from "../../_chunks/rich-text-editor-C6fE-uP4.js";
1
+ import { R as a, r as e, w as i } from "../../_chunks/rich-text-editor-D7AKKAQ2.js";
2
2
  export {
3
3
  a as RichTextEditor,
4
4
  e as richTextEditorAgent,
@@ -1,7 +1,76 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import '../../tokens/themes/bridges/redactor-theme.css';
3
+ import { type AiConsentBannerHeadingLevel } from '../ai-consent-banner';
3
4
  export type RedactorFactory = (selector: string | HTMLElement, command?: unknown, ...args: unknown[]) => unknown;
4
5
  export type RichTextEditorToolbar = 'minimal' | 'standard' | 'full';
6
+ /**
7
+ * Patient AI-consent gate for the Help-me-write action and both dictation
8
+ * mics (the editor's own, and the one inside the Help-me-write overlay).
9
+ * Omit entirely for today's ungated behaviour — no existing host breaks.
10
+ *
11
+ * Present and `granted: false`: the affordances stay visible (this never
12
+ * hides a control), but opening one shows the kit's `AiConsentBanner` in
13
+ * the same docked slot instead of calling `onRequestAiDraft` / `onDictate`.
14
+ * When `granted` flips `true` the reader carries on without reopening
15
+ * anything — the editor resumes exactly the action it gated.
16
+ *
17
+ * Present and `granted: true`: normal behaviour, and the Help-me-write
18
+ * privacy notice records that consent was given.
19
+ */
20
+ export interface AiConsentGate {
21
+ /** Whether AI consent has already been recorded for the current patient. */
22
+ granted: boolean;
23
+ /** When consent was granted — passed straight to `AiConsentBanner`. */
24
+ grantedAt?: string | number | Date;
25
+ /** Who granted consent — passed straight to `AiConsentBanner`. */
26
+ grantedBy?: string;
27
+ /** Whether the signed-in reader may grant consent. Default `true`; treated
28
+ * as `false` when `onGrant` is absent, so no dead Grant control shows. */
29
+ canGrant?: boolean;
30
+ /** The grant is being persisted server-side (host-driven busy state). */
31
+ pending?: boolean;
32
+ /**
33
+ * Fired when the reader confirms the grant in the banner. A returned
34
+ * promise drives the banner's own pending/Spinner state until it settles,
35
+ * in addition to (or absent) a host-supplied `pending`.
36
+ */
37
+ onGrant?: () => void | Promise<void>;
38
+ }
39
+ /** A template variable the toolbar's "Insert variable" menu offers. */
40
+ export interface RichTextEditorVariable {
41
+ /** Inserted as `[[token]]`. Letters, digits and underscores only. */
42
+ token: string;
43
+ /** Human label shown in the menu (translated by the host). */
44
+ label: string;
45
+ /** Optional second line in the menu. */
46
+ description?: string;
47
+ }
48
+ /** What a host's own Help-me-write surface gets from `renderHelpMeWrite`. */
49
+ export interface HelpMeWriteRenderContext {
50
+ /** Whether the surface should show (consent is already granted). */
51
+ open: boolean;
52
+ onClose: () => void;
53
+ /** Text of the selection when the reader opened it; '' for a caret. */
54
+ selectionText: string;
55
+ getHTML: () => string;
56
+ getText: () => string;
57
+ /** Insert at the saved caret, replacing the saved selection if any. */
58
+ insertAtSelection: (html: string) => void;
59
+ /** Insert just after the saved selection (or at the saved caret). */
60
+ insertAfterSelection: (html: string) => void;
61
+ /** Replace the whole document. */
62
+ setContent: (html: string) => void;
63
+ /** The editor's own dictation seam, for a mic inside the surface. */
64
+ onDictate?: RichTextEditorProps['onDictate'];
65
+ /** The kit's privacy notice, including the consent-recorded line. */
66
+ privacyNotice: ReactNode;
67
+ /**
68
+ * Opened because dictation ran out of AI credits (its `onDictate` rejected
69
+ * with an error named `AiCreditsExhaustedError`): show the out-of-credits
70
+ * state rather than the prompt.
71
+ */
72
+ creditsExhausted: boolean;
73
+ }
5
74
  export interface RichTextEditorProps {
6
75
  /** Opaque instance id — emitted as `data-component-id` for the agent registry. */
7
76
  id?: string;
@@ -38,6 +107,12 @@ export interface RichTextEditorProps {
38
107
  lang?: string;
39
108
  /** Consumer image-upload endpoint → Redactor `imageUpload`. Omitted if absent. */
40
109
  imageUploadUrl?: string;
110
+ /**
111
+ * Upload an image yourself (your own API client, auth or storage) and
112
+ * resolve its URL. Wins over `imageUploadUrl` for the toolbar's image
113
+ * dialog; either one shows the insert-image control.
114
+ */
115
+ onUploadImage?: (file: File, signal?: AbortSignal) => Promise<string>;
41
116
  /** App keyboard-shortcut seam (e.g. Ctrl/Cmd+Enter to save). */
42
117
  onKeyDown?: (event: KeyboardEvent) => void;
43
118
  /**
@@ -54,6 +129,20 @@ export interface RichTextEditorProps {
54
129
  aiDraftFormat?: 'html' | 'text';
55
130
  /** Override the compliance notice shown in the Help-me-write dialog. */
56
131
  aiPrivacyNotice?: ReactNode;
132
+ /**
133
+ * Patient AI-consent gate for Help-me-write + both mics. See
134
+ * `AiConsentGate`. Omit for today's ungated behaviour.
135
+ */
136
+ aiConsent?: AiConsentGate;
137
+ /**
138
+ * Heading level for the `AiConsentBanner` shown while the gate is open —
139
+ * forwarded straight to its own `headingLevel` so it nests correctly under
140
+ * whatever heading the host has above this editor (axe `heading-order`).
141
+ * Default `5` (the banner's own default) suits a standalone editor with no
142
+ * heading directly above it; a host wrapping the editor under its own
143
+ * heading (e.g. `NotesPanel`'s `h2`) should pass one level below it.
144
+ */
145
+ aiConsentHeadingLevel?: AiConsentBannerHeadingLevel;
57
146
  /**
58
147
  * Voice dictation. When provided, a DS mic toggle + live-transcript region
59
148
  * appear. The kit owns the UI; the consumer runs mic capture + transcription
@@ -82,6 +171,39 @@ export interface RichTextEditorProps {
82
171
  html: string;
83
172
  signal: AbortSignal;
84
173
  }) => Promise<string>;
174
+ /**
175
+ * Template variables. When provided, the toolbar gains an "Insert variable"
176
+ * menu that inserts `[[TOKEN]]` as a chip (Redactor's native `variable`
177
+ * component, the same markup as platform's plugin). Bare `[[TOKEN]]` text
178
+ * for these tokens in inbound content renders as a chip too.
179
+ */
180
+ variables?: RichTextEditorVariable[];
181
+ /**
182
+ * Decide whether a `[[TOKEN]]` is valid. Default: it is one of `variables`
183
+ * (any letter case). Invalid tokens render as error chips with a message
184
+ * under the editor, and are reported through `onVariableValidityChange`.
185
+ */
186
+ validateVariable?: (token: string) => boolean;
187
+ /**
188
+ * The invalid `[[TOKEN]]`s in the document, each once, whenever that set
189
+ * changes (`[]` when all are valid). Use it to block saving.
190
+ */
191
+ onVariableValidityChange?: (invalidTokens: string[]) => void;
192
+ /**
193
+ * Bring your own Help-me-write surface (e.g. with practice templates). The
194
+ * kit keeps the FAB segment, the consent gate and resume-after-grant, and
195
+ * calls this instead of rendering its own overlay. Render an
196
+ * `EditorOverlay` from it to dock in the same slot. Wins over the built-in
197
+ * overlay when both this and `onRequestAiDraft` are set.
198
+ */
199
+ renderHelpMeWrite?: (ctx: HelpMeWriteRenderContext) => ReactNode;
200
+ /**
201
+ * An AI call ran out of credits: `onDictate` rejected with an error named
202
+ * `AiCreditsExhaustedError`. With `renderHelpMeWrite` the kit also opens
203
+ * that surface on its out-of-credits state; without it, the dictation
204
+ * error line shows.
205
+ */
206
+ onAiCreditsExhausted?: () => void;
85
207
  }
86
208
  /** Block/inline formats the editor can toggle via `applyFormat`. */
87
209
  export type EditorFormat = 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph';
@@ -1,4 +1,4 @@
1
- import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as p, k as l, l as c, m as g, n as u, o as I, p as P, q as f, s as h, u as B } from "../../_chunks/sidebar-C-Gr2LL-.js";
1
+ import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as p, k as l, l as c, m as g, n as u, o as I, p as P, q as f, s as h, u as B } from "../../_chunks/sidebar-ClTY9lLI.js";
2
2
  import { u as k } from "../../_chunks/use-persistent-state-nZwZAnE9.js";
3
3
  export {
4
4
  r as Sidebar,
@@ -1,4 +1,4 @@
1
- import { T as r } from "../../_chunks/treatment-receipt-dUm99mdn.js";
1
+ import { T as r } from "../../_chunks/treatment-receipt-DU0OewqH.js";
2
2
  import { t as m } from "../../_chunks/treatment-receipt.agent-bpFm2RPH.js";
3
3
  export {
4
4
  r as TreatmentReceipt,
@@ -205,7 +205,7 @@
205
205
 
206
206
  /* ───────────────────────────────────────────────────────────────────────
207
207
  SECTION B — non-token declarations. ORIGINAL LAYER PRESERVED.
208
- 139 declarations across 135 rules.
208
+ 143 declarations across 139 rules.
209
209
 
210
210
  Kit-authored arbitrary-value utilities (`ds:w-[20rem]`) and the
211
211
  vendored AG Grid rules. These set real properties on real elements,
@@ -523,6 +523,9 @@
523
523
  .ds\:text-\[7rem\] {
524
524
  font-size:112px;
525
525
  }
526
+ .ds\:\[block-size\:14rem\] {
527
+ block-size:224px;
528
+ }
526
529
  .ds\:\[block-size\:44rem\] {
527
530
  block-size:704px;
528
531
  }
@@ -556,6 +559,12 @@
556
559
  .ds\:\[max-block-size\:12rem\] {
557
560
  max-block-size:192px;
558
561
  }
562
+ .ds\:\[max-block-size\:14rem\] {
563
+ max-block-size:224px;
564
+ }
565
+ .ds\:\[max-block-size\:16rem\] {
566
+ max-block-size:256px;
567
+ }
559
568
  .ds\:\[max-inline-size\:6\.5rem\] {
560
569
  max-inline-size:104px;
561
570
  }
@@ -580,6 +589,9 @@
580
589
  .ds\:\[max-inline-size\:48rem\] {
581
590
  max-inline-size:768px;
582
591
  }
592
+ .ds\:\[max-inline-size\:64rem\] {
593
+ max-inline-size:1024px;
594
+ }
583
595
  .ds\:\[min-block-size\:18rem\] {
584
596
  min-block-size:288px;
585
597
  }