@alfadocs/ui-kit 0.73.0 → 0.77.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 (199) hide show
  1. package/dist/_chunks/actions-cell-renderer-DLrcSTK_.js +1546 -0
  2. package/dist/_chunks/{address-fields-COyjgqxA.js → address-fields-7k59FnJ6.js} +2 -2
  3. package/dist/_chunks/{ai-prompt-input-DFm58UjY.js → ai-prompt-input-DziJCGLe.js} +2 -2
  4. package/dist/_chunks/{audio-recorder-CjAY0GAc.js → audio-recorder-Cc3KuL9y.js} +2 -2
  5. package/dist/_chunks/{bishop-score-Bs6t6Zv1.js → bishop-score-DDW5-gb9.js} +2 -2
  6. package/dist/_chunks/{booking-CWnZhZ5g.js → booking-CLmeXtGv.js} +3 -3
  7. package/dist/_chunks/{care-plan-card-CfIP3Vc1.js → care-plan-card-BrwhyIJI.js} +2 -2
  8. package/dist/_chunks/{care-plan-entry-card-CRbS-G00.js → care-plan-entry-card-DWEdCQM3.js} +2 -2
  9. package/dist/_chunks/{country-select-DYHDLEjG.js → country-select-BN9nedAp.js} +2 -2
  10. package/dist/_chunks/data-table-tabs-BEUXiRlu.js +710 -0
  11. package/dist/_chunks/document-preview-CvHnHf6T.js +243 -0
  12. package/dist/_chunks/{document-scanner-BE6Jz4Ob.js → document-scanner-B6h1Ir56.js} +2 -2
  13. package/dist/_chunks/{field-value-DCXJXKab.js → field-value-DHG6gEKS.js} +2 -2
  14. package/dist/_chunks/file-Cwe9VC1A.js +40 -0
  15. package/dist/_chunks/file-manager-DfTG7bxx.js +1771 -0
  16. package/dist/_chunks/{file-upload-B2SXhRiN.js → file-upload-DENvuhfs.js} +98 -129
  17. package/dist/_chunks/flag-Cnmivlrl.js +641 -0
  18. package/dist/_chunks/{gestational-age-calculator-C9Dfis4I.js → gestational-age-calculator-BpYw-WF-.js} +2 -2
  19. package/dist/_chunks/{header-settings-CRQDCYgr.js → header-settings-DMfdx0Vq.js} +2 -2
  20. package/dist/_chunks/{icon-picker-BePK27S-.js → icon-picker-CM9ubkew.js} +2 -2
  21. package/dist/_chunks/link-cell-renderer-BQGUs45d.js +711 -0
  22. package/dist/_chunks/{locale-picker-Cbfqc0_N.js → locale-picker-EyvPrwDc.js} +3 -3
  23. package/dist/_chunks/{marketplace-app-shell-Dm6S-hun.js → marketplace-app-shell-Bxq1PYAj.js} +3 -3
  24. package/dist/_chunks/{muscle-scheme-B9MIkuj0.js → muscle-scheme-CFBE2dme.js} +6 -14
  25. package/dist/_chunks/{notes-panel-B_8-Mebz.js → notes-panel-Cvdp818a.js} +2 -2
  26. package/dist/_chunks/{optical-prescription-BQ75_kf6.js → optical-prescription-BEjYQjiO.js} +2 -2
  27. package/dist/_chunks/{patient-details-JkOI3Ijd.js → patient-details-zy76MRh7.js} +5 -5
  28. package/dist/_chunks/{patient-summary-card-CQOLMH3E.js → patient-summary-card-D6kgdTNn.js} +2 -2
  29. package/dist/_chunks/{patient-table-B_mOe-ZT.js → patient-table-DweKjiXg.js} +122 -118
  30. package/dist/_chunks/periodontal-chart-CYBhr9vc.js +1305 -0
  31. package/dist/_chunks/periodontal-diagnosis-cco40xTa.js +345 -0
  32. package/dist/_chunks/periodontal-risk-chart-bUGkMwDg.js +334 -0
  33. package/dist/_chunks/{phone-input-dtnrvnZf.js → phone-input-D00ZBAm-.js} +2 -2
  34. package/dist/_chunks/{popover-DGTKfLWh.js → popover-Cc0a69sw.js} +31 -28
  35. package/dist/_chunks/{pregnancy-dating-IsDVfqJX.js → pregnancy-dating-msMl_6wz.js} +2 -2
  36. package/dist/_chunks/{radiograph-panel.agent-e488ooH8.js → radiograph-panel.agent-CxF9pVxd.js} +2 -2
  37. package/dist/_chunks/{rich-text-editor-CgA2bYwi.js → rich-text-editor-CCWjNkbx.js} +186 -177
  38. package/dist/_chunks/{select-BmCbJMJS.js → select-BW5ecXlX.js} +13 -13
  39. package/dist/_chunks/{sidebar-CtU35PIX.js → sidebar-C0PbwJBc.js} +357 -320
  40. package/dist/_chunks/signature-request-C-mskXwi.js +318 -0
  41. package/dist/_chunks/{tabs-DVQ941Sj.js → tabs-CVTukWRD.js} +2 -2
  42. package/dist/_chunks/{tasks-panel-LCK5ZXvU.js → tasks-panel-CjGAhIN8.js} +2 -2
  43. package/dist/_chunks/tooth-data-BwuoKFf4.js +660 -0
  44. package/dist/_chunks/tooth-scheme-BzJ6rcte.js +1483 -0
  45. package/dist/_chunks/{unit-converter-3uL_tMCm.js → unit-converter-CSLWFDQh.js} +2 -2
  46. package/dist/agent-catalog.json +1430 -213
  47. package/dist/agent-i18n/en.json +86 -5
  48. package/dist/components/_shared/entity-card/entity-card.d.ts +1 -1
  49. package/dist/components/address-fields/index.js +1 -1
  50. package/dist/components/ai-prompt-input/index.js +1 -1
  51. package/dist/components/anamnesis-card/anamnesis-card.d.ts +1 -1
  52. package/dist/components/appointment-card/appointment-card.d.ts +1 -1
  53. package/dist/components/audio-recorder/index.js +1 -1
  54. package/dist/components/bishop-score/index.js +1 -1
  55. package/dist/components/booking/index.js +1 -1
  56. package/dist/components/card/card.d.ts +1 -1
  57. package/dist/components/care-plan-card/index.js +1 -1
  58. package/dist/components/care-plan-entry-card/index.js +1 -1
  59. package/dist/components/clinical-note-card/clinical-note-card.d.ts +1 -1
  60. package/dist/components/contact-profile-card/contact-profile-card.d.ts +1 -1
  61. package/dist/components/country-select/index.js +1 -1
  62. package/dist/components/data-table/index.js +35 -34
  63. package/dist/components/data-table/toolbar.d.ts +1 -1
  64. package/dist/components/data-table-tabs/data-table-tabs.agent.d.ts +4 -0
  65. package/dist/components/data-table-tabs/data-table-tabs.d.ts +93 -0
  66. package/dist/components/data-table-tabs/index.d.ts +5 -0
  67. package/dist/components/data-table-tabs/index.js +8 -0
  68. package/dist/components/data-table-tabs/use-data-table-filter-tabs.d.ts +63 -0
  69. package/dist/components/document-preview/document-preview.agent.d.ts +4 -0
  70. package/dist/components/document-preview/document-preview.d.ts +64 -0
  71. package/dist/components/document-preview/index.d.ts +4 -0
  72. package/dist/components/document-preview/index.js +6 -0
  73. package/dist/components/document-scanner/index.js +1 -1
  74. package/dist/components/file-manager/dialogs.d.ts +48 -0
  75. package/dist/components/file-manager/file-manager.agent.d.ts +4 -0
  76. package/dist/components/file-manager/file-manager.d.ts +82 -0
  77. package/dist/components/file-manager/folder-tree.d.ts +12 -0
  78. package/dist/components/file-manager/index.d.ts +5 -0
  79. package/dist/components/file-manager/index.js +6 -0
  80. package/dist/components/file-manager/list-view.d.ts +49 -0
  81. package/dist/components/file-manager/toolbar.d.ts +15 -0
  82. package/dist/components/file-manager/types.d.ts +167 -0
  83. package/dist/components/file-manager/utils.d.ts +34 -0
  84. package/dist/components/file-upload/index.js +1 -1
  85. package/dist/components/flag/index.js +1 -1
  86. package/dist/components/gestational-age-calculator/index.js +1 -1
  87. package/dist/components/header-settings/index.js +1 -1
  88. package/dist/components/icon-picker/index.js +1 -1
  89. package/dist/components/index.d.ts +7 -0
  90. package/dist/components/locale-picker/index.js +1 -1
  91. package/dist/components/message-card/message-card.d.ts +1 -1
  92. package/dist/components/muscle-scheme/index.js +1 -1
  93. package/dist/components/notes-panel/index.js +1 -1
  94. package/dist/components/notification-card/notification-card.d.ts +1 -1
  95. package/dist/components/operator-hero/operator-hero.d.ts +1 -1
  96. package/dist/components/optical-prescription/index.js +1 -1
  97. package/dist/components/patient-details/index.js +1 -1
  98. package/dist/components/patient-summary-card/index.js +1 -1
  99. package/dist/components/patient-summary-card/patient-summary-card.d.ts +1 -1
  100. package/dist/components/patient-table/index.js +1 -1
  101. package/dist/components/payment-card/payment-card.d.ts +1 -1
  102. package/dist/components/payment-card/payment-request-card.d.ts +1 -1
  103. package/dist/components/periodontal-chart/index.d.ts +6 -0
  104. package/dist/components/periodontal-chart/index.js +23 -0
  105. package/dist/components/periodontal-chart/periodontal-chart-data.d.ts +164 -0
  106. package/dist/components/periodontal-chart/periodontal-chart.agent.d.ts +4 -0
  107. package/dist/components/periodontal-chart/periodontal-chart.d.ts +71 -0
  108. package/dist/components/periodontal-chart-card/periodontal-chart-card.d.ts +1 -1
  109. package/dist/components/periodontal-diagnosis/index.d.ts +6 -0
  110. package/dist/components/periodontal-diagnosis/index.js +13 -0
  111. package/dist/components/periodontal-diagnosis/periodontal-diagnosis-data.d.ts +30 -0
  112. package/dist/components/periodontal-diagnosis/periodontal-diagnosis.agent.d.ts +4 -0
  113. package/dist/components/periodontal-diagnosis/periodontal-diagnosis.d.ts +44 -0
  114. package/dist/components/periodontal-risk-chart/index.d.ts +6 -0
  115. package/dist/components/periodontal-risk-chart/index.js +9 -0
  116. package/dist/components/periodontal-risk-chart/periodontal-risk-chart.agent.d.ts +4 -0
  117. package/dist/components/periodontal-risk-chart/periodontal-risk-chart.d.ts +28 -0
  118. package/dist/components/periodontal-risk-chart/periodontal-risk-data.d.ts +47 -0
  119. package/dist/components/phone-input/index.js +1 -1
  120. package/dist/components/popover/index.js +1 -1
  121. package/dist/components/popover/popover.d.ts +1 -0
  122. package/dist/components/pregnancy-dating/index.js +1 -1
  123. package/dist/components/product-hub-tray/product-hub-panel.d.ts +1 -1
  124. package/dist/components/radiograph-panel/index.js +1 -1
  125. package/dist/components/rich-text-editor/index.js +1 -1
  126. package/dist/components/select/index.js +1 -1
  127. package/dist/components/sidebar/index.js +1 -1
  128. package/dist/components/sidebar/sidebar.d.ts +9 -0
  129. package/dist/components/skeleton-scheme/index.js +5 -13
  130. package/dist/components/stat/stat.d.ts +1 -1
  131. package/dist/components/tabs/index.js +1 -1
  132. package/dist/components/tasks-panel/index.js +1 -1
  133. package/dist/components/tooth-scheme/index.js +29 -28
  134. package/dist/components/unit-converter/index.js +1 -1
  135. package/dist/i18n/locales/ar.d.ts +321 -0
  136. package/dist/i18n/locales/ar.js +321 -0
  137. package/dist/i18n/locales/de.d.ts +321 -0
  138. package/dist/i18n/locales/de.js +321 -0
  139. package/dist/i18n/locales/el.d.ts +321 -0
  140. package/dist/i18n/locales/el.js +321 -0
  141. package/dist/i18n/locales/en.d.ts +321 -0
  142. package/dist/i18n/locales/en.js +321 -0
  143. package/dist/i18n/locales/es.d.ts +321 -0
  144. package/dist/i18n/locales/es.js +321 -0
  145. package/dist/i18n/locales/fr.d.ts +321 -0
  146. package/dist/i18n/locales/fr.js +321 -0
  147. package/dist/i18n/locales/hi.d.ts +321 -0
  148. package/dist/i18n/locales/hi.js +321 -0
  149. package/dist/i18n/locales/it.d.ts +321 -0
  150. package/dist/i18n/locales/it.js +321 -0
  151. package/dist/i18n/locales/ja.d.ts +321 -0
  152. package/dist/i18n/locales/ja.js +321 -0
  153. package/dist/i18n/locales/nl.d.ts +321 -0
  154. package/dist/i18n/locales/nl.js +321 -0
  155. package/dist/i18n/locales/pl.d.ts +321 -0
  156. package/dist/i18n/locales/pl.js +321 -0
  157. package/dist/i18n/locales/pt.d.ts +321 -0
  158. package/dist/i18n/locales/pt.js +321 -0
  159. package/dist/i18n/locales/ro.d.ts +321 -0
  160. package/dist/i18n/locales/ro.js +321 -0
  161. package/dist/i18n/locales/ru.d.ts +321 -0
  162. package/dist/i18n/locales/ru.js +321 -0
  163. package/dist/i18n/locales/sq.d.ts +321 -0
  164. package/dist/i18n/locales/sq.js +321 -0
  165. package/dist/i18n/locales/sv.d.ts +321 -0
  166. package/dist/i18n/locales/sv.js +321 -0
  167. package/dist/i18n/locales/tr.d.ts +321 -0
  168. package/dist/i18n/locales/tr.js +321 -0
  169. package/dist/i18n/locales/zh.d.ts +321 -0
  170. package/dist/i18n/locales/zh.js +321 -0
  171. package/dist/index.js +834 -783
  172. package/dist/locales/ar.json +321 -0
  173. package/dist/locales/de.json +321 -0
  174. package/dist/locales/el.json +321 -0
  175. package/dist/locales/en.json +321 -0
  176. package/dist/locales/es.json +321 -0
  177. package/dist/locales/fr.json +321 -0
  178. package/dist/locales/hi.json +321 -0
  179. package/dist/locales/it.json +321 -0
  180. package/dist/locales/ja.json +321 -0
  181. package/dist/locales/nl.json +321 -0
  182. package/dist/locales/pl.json +321 -0
  183. package/dist/locales/pt.json +321 -0
  184. package/dist/locales/ro.json +321 -0
  185. package/dist/locales/ru.json +321 -0
  186. package/dist/locales/sq.json +321 -0
  187. package/dist/locales/sv.json +321 -0
  188. package/dist/locales/tr.json +321 -0
  189. package/dist/locales/zh.json +321 -0
  190. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  191. package/dist/patterns/signature-request/index.d.ts +3 -0
  192. package/dist/patterns/signature-request/index.js +5 -0
  193. package/dist/patterns/signature-request/signature-request.d.ts +81 -0
  194. package/dist/tokens.css +1 -1
  195. package/package.json +29 -1
  196. package/dist/_chunks/columns-2-8lq4-b8e.js +0 -15
  197. package/dist/_chunks/flag-DZ6V7-hU.js +0 -637
  198. package/dist/_chunks/link-cell-renderer-CLI7sBkX.js +0 -2210
  199. package/dist/_chunks/tooth-scheme-CX49GycY.js +0 -2133
@@ -0,0 +1,345 @@
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as J, useId as Q, useState as W, useRef as Y } from "react";
3
+ import { c as Z } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as ee } from "react-i18next";
5
+ import { B as te } from "./badge-DCOqV9mI.js";
6
+ import { C as j } from "./card-DPmk26CL.js";
7
+ import { C as ae } from "./checkbox-BuZ1u__2.js";
8
+ import { R as y } from "./radio-TWf9Q-mp.js";
9
+ import { R as D } from "./radio-group-CI-6SmSw.js";
10
+ import { u as oe } from "./registry-DvAUVLHh.js";
11
+ const se = {
12
+ enum: [1, 2, 3, 4],
13
+ description: "Periodontitis stage I–IV, as the integers 1–4."
14
+ }, ie = {
15
+ enum: ["A", "B", "C"],
16
+ description: "Periodontitis grade A–C (rate of progression)."
17
+ }, re = {
18
+ enum: ["localised", "generalised", "molarIncisor"],
19
+ description: "Distribution: localised (<30%), generalised (≥30%), or molar-incisor."
20
+ }, ne = {
21
+ id: "periodontal-diagnosis",
22
+ // set_value — set stage / grade / extent / a factor. Each set_* action's
23
+ // enum argsSchema already conveys that the field is a closed choice.
24
+ capabilities: ["set_value"],
25
+ state: {
26
+ diagnosis: {
27
+ type: "object",
28
+ descriptionKey: "ui.agent.periodontalDiagnosis.state.diagnosis",
29
+ description: "Recorded stage (1–4), grade (A–C), extent, and ticked contributing-factor ids. The free-text note is never included.",
30
+ read: (a) => a.getDiagnosis()
31
+ },
32
+ summary: {
33
+ type: "string",
34
+ descriptionKey: "ui.agent.periodontalDiagnosis.state.summary",
35
+ description: 'The composed, localised diagnosis sentence (e.g. "Periodontitis — Stage III · Grade B · generalised").',
36
+ read: (a) => a.getSummary()
37
+ },
38
+ complete: {
39
+ type: "boolean",
40
+ descriptionKey: "ui.agent.periodontalDiagnosis.state.complete",
41
+ description: "True once both a stage and a grade are recorded.",
42
+ read: (a) => a.isComplete()
43
+ }
44
+ },
45
+ actions: {
46
+ get_diagnosis: {
47
+ safety: "read",
48
+ argsType: "{}",
49
+ argsSchema: { type: "object", properties: {} },
50
+ returns: "object",
51
+ returnsSchema: { type: "object" },
52
+ idempotent: !0,
53
+ descriptionKey: "ui.agent.periodontalDiagnosis.actions.getDiagnosis",
54
+ description: "Read the recorded stage / grade / extent / factors. The note is never returned.",
55
+ invoke: (a) => a.getDiagnosis()
56
+ },
57
+ set_stage: {
58
+ safety: "write",
59
+ argsType: "{ stage: 1 | 2 | 3 | 4 }",
60
+ argsSchema: {
61
+ type: "object",
62
+ properties: { stage: se },
63
+ required: ["stage"]
64
+ },
65
+ idempotent: !0,
66
+ descriptionKey: "ui.agent.periodontalDiagnosis.actions.setStage",
67
+ description: "Record the periodontitis stage (I–IV).",
68
+ invoke: (a, i) => {
69
+ a.setStage(i.stage);
70
+ }
71
+ },
72
+ set_grade: {
73
+ safety: "write",
74
+ argsType: "{ grade: 'A' | 'B' | 'C' }",
75
+ argsSchema: {
76
+ type: "object",
77
+ properties: { grade: ie },
78
+ required: ["grade"]
79
+ },
80
+ idempotent: !0,
81
+ descriptionKey: "ui.agent.periodontalDiagnosis.actions.setGrade",
82
+ description: "Record the periodontitis grade (A–C).",
83
+ invoke: (a, i) => {
84
+ a.setGrade(i.grade);
85
+ }
86
+ },
87
+ set_extent: {
88
+ safety: "write",
89
+ argsType: "{ extent: 'localised' | 'generalised' | 'molarIncisor' }",
90
+ argsSchema: {
91
+ type: "object",
92
+ properties: { extent: re },
93
+ required: ["extent"]
94
+ },
95
+ idempotent: !0,
96
+ descriptionKey: "ui.agent.periodontalDiagnosis.actions.setExtent",
97
+ description: "Record the distribution / extent.",
98
+ invoke: (a, i) => {
99
+ a.setExtent(i.extent);
100
+ }
101
+ },
102
+ toggle_factor: {
103
+ safety: "write",
104
+ argsType: "{ id: string; value: boolean }",
105
+ argsSchema: {
106
+ type: "object",
107
+ properties: {
108
+ id: { type: "string", description: "Contributing-factor id." },
109
+ value: { type: "boolean" }
110
+ },
111
+ required: ["id", "value"]
112
+ },
113
+ idempotent: !0,
114
+ descriptionKey: "ui.agent.periodontalDiagnosis.actions.toggleFactor",
115
+ description: "Tick or clear a contributing factor.",
116
+ invoke: (a, i) => {
117
+ a.toggleFactor(i.id, i.value);
118
+ }
119
+ },
120
+ clear_diagnosis: {
121
+ safety: "destructive",
122
+ argsType: "{}",
123
+ argsSchema: { type: "object", properties: {} },
124
+ idempotent: !0,
125
+ descriptionKey: "ui.agent.periodontalDiagnosis.actions.clearDiagnosis",
126
+ description: "Reset the whole diagnosis to empty.",
127
+ invoke: (a) => {
128
+ a.clear();
129
+ }
130
+ }
131
+ },
132
+ domHooks: {
133
+ root: {
134
+ attr: "data-component",
135
+ value: "periodontal-diagnosis",
136
+ description: "Marks the PeriodontalDiagnosis root group."
137
+ },
138
+ instanceId: {
139
+ attr: "data-component-id",
140
+ sourceProp: "id",
141
+ description: "Sourced from the id prop."
142
+ }
143
+ }
144
+ }, de = [1, 2, 3, 4], le = [
145
+ "A",
146
+ "B",
147
+ "C"
148
+ ], ce = [
149
+ "localised",
150
+ "generalised",
151
+ "molarIncisor"
152
+ ], u = {
153
+ 1: "I",
154
+ 2: "II",
155
+ 3: "III",
156
+ 4: "IV"
157
+ }, ge = [
158
+ "interdentalCal",
159
+ "radiographicBoneLoss",
160
+ "toothLossPerio",
161
+ "probingDepth6",
162
+ "boneLossAgeOver1",
163
+ "smoker",
164
+ "diabetes"
165
+ ];
166
+ function k(a) {
167
+ return a.stage != null && a.grade != null;
168
+ }
169
+ function P() {
170
+ return {};
171
+ }
172
+ const pe = Z("ds:w-full ds:text-[color:var(--foreground)]", {
173
+ variants: {
174
+ surface: { flat: "", elevated: "" }
175
+ },
176
+ defaultVariants: { surface: "elevated" }
177
+ }), ue = J(
178
+ ({
179
+ value: a,
180
+ defaultValue: i,
181
+ onChange: m,
182
+ mode: w = "interactive",
183
+ disabled: g = !1,
184
+ factors: L = ge,
185
+ surface: b = "elevated",
186
+ "aria-label": O,
187
+ id: f,
188
+ className: K,
189
+ ...B
190
+ }, $) => {
191
+ const { t } = ee(), F = Q(), x = a !== void 0, [M, q] = W(
192
+ i ?? P()
193
+ ), s = x ? a : M, r = Y(s);
194
+ r.current = s;
195
+ const n = (e) => {
196
+ r.current = e, x || q(e), m == null || m(e);
197
+ }, S = (e) => n({ ...r.current, stage: e }), I = (e) => n({ ...r.current, grade: e }), N = (e) => n({ ...r.current, extent: e }), T = (e, l) => {
198
+ const p = new Set(r.current.factors ?? []);
199
+ l ?? !p.has(e) ? p.add(e) : p.delete(e), n({ ...r.current, factors: [...p] });
200
+ }, z = () => n(P()), C = k(s), h = s.factors ?? [], A = (e) => t("periodontalDiagnosis.stage.option", {
201
+ roman: u[e],
202
+ defaultValue: `Stage ${u[e]}`
203
+ }), R = (e) => t("periodontalDiagnosis.grade.option", {
204
+ grade: e,
205
+ defaultValue: `Grade ${e}`
206
+ }), v = (e) => t(`periodontalDiagnosis.extent.${e}`, {
207
+ defaultValue: e === "localised" ? "Localised" : e === "generalised" ? "Generalised" : "Molar-incisor"
208
+ }), E = (e) => t(`periodontalDiagnosis.factor.${e}`, { defaultValue: e }), d = [];
209
+ s.stage != null && d.push(
210
+ t("periodontalDiagnosis.summary.stage", {
211
+ roman: u[s.stage],
212
+ defaultValue: `Stage ${u[s.stage]}`
213
+ })
214
+ ), s.grade != null && d.push(
215
+ t("periodontalDiagnosis.summary.grade", {
216
+ grade: s.grade,
217
+ defaultValue: `Grade ${s.grade}`
218
+ })
219
+ ), s.extent != null && d.push(v(s.extent));
220
+ const _ = d.length ? `${t("periodontalDiagnosis.term", "Periodontitis")} — ${d.join(" · ")}` : t("periodontalDiagnosis.summary.none", "No diagnosis recorded yet");
221
+ oe(
222
+ ne,
223
+ {
224
+ getDiagnosis: () => {
225
+ const { note: e, ...l } = r.current;
226
+ return l;
227
+ },
228
+ getSummary: () => _,
229
+ isComplete: () => k(r.current),
230
+ setStage: S,
231
+ setGrade: I,
232
+ setExtent: N,
233
+ toggleFactor: T,
234
+ clear: z
235
+ },
236
+ f
237
+ );
238
+ const G = t("periodontalDiagnosis.heading", "Periodontal diagnosis"), H = O ?? G, X = /* @__PURE__ */ c("dl", { className: "type-body-sm ds:grid ds:grid-cols-[auto_1fr] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-2xs)] ds:m-0", children: [
239
+ /* @__PURE__ */ o("dt", { className: "ds:text-[color:var(--muted-foreground)]", children: t("periodontalDiagnosis.stage.label", "Staging") }),
240
+ /* @__PURE__ */ o("dd", { className: "ds:m-0", children: s.stage != null ? A(s.stage) : t("periodontalDiagnosis.unset", "—") }),
241
+ /* @__PURE__ */ o("dt", { className: "ds:text-[color:var(--muted-foreground)]", children: t("periodontalDiagnosis.grade.label", "Grading") }),
242
+ /* @__PURE__ */ o("dd", { className: "ds:m-0", children: s.grade != null ? R(s.grade) : t("periodontalDiagnosis.unset", "—") }),
243
+ /* @__PURE__ */ o("dt", { className: "ds:text-[color:var(--muted-foreground)]", children: t("periodontalDiagnosis.extent.label", "Extent") }),
244
+ /* @__PURE__ */ o("dd", { className: "ds:m-0", children: s.extent != null ? v(s.extent) : t("periodontalDiagnosis.unset", "—") }),
245
+ /* @__PURE__ */ o("dt", { className: "ds:text-[color:var(--muted-foreground)]", children: t("periodontalDiagnosis.factors.label", "Contributing factors") }),
246
+ /* @__PURE__ */ o("dd", { className: "ds:m-0", children: h.length ? h.map((e) => E(e)).join(", ") : t("periodontalDiagnosis.unset", "—") })
247
+ ] }), U = /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
248
+ /* @__PURE__ */ o(
249
+ D,
250
+ {
251
+ variant: "horizontal",
252
+ label: t("periodontalDiagnosis.stage.label", "Staging"),
253
+ description: t(
254
+ "periodontalDiagnosis.stage.description",
255
+ "Severity and complexity of management."
256
+ ),
257
+ value: s.stage != null ? String(s.stage) : "",
258
+ onValueChange: (e) => S(Number(e)),
259
+ disabled: g,
260
+ children: de.map((e) => /* @__PURE__ */ o(y, { value: String(e), label: A(e) }, e))
261
+ }
262
+ ),
263
+ /* @__PURE__ */ o(
264
+ D,
265
+ {
266
+ variant: "horizontal",
267
+ label: t("periodontalDiagnosis.grade.label", "Grading"),
268
+ description: t(
269
+ "periodontalDiagnosis.grade.description",
270
+ "Rate of progression."
271
+ ),
272
+ value: s.grade ?? "",
273
+ onValueChange: (e) => I(e),
274
+ disabled: g,
275
+ children: le.map((e) => /* @__PURE__ */ o(y, { value: e, label: R(e) }, e))
276
+ }
277
+ ),
278
+ /* @__PURE__ */ o(
279
+ D,
280
+ {
281
+ variant: "horizontal",
282
+ label: t("periodontalDiagnosis.extent.label", "Extent"),
283
+ value: s.extent ?? "",
284
+ onValueChange: (e) => N(e),
285
+ disabled: g,
286
+ children: ce.map((e) => /* @__PURE__ */ o(y, { value: e, label: v(e) }, e))
287
+ }
288
+ ),
289
+ /* @__PURE__ */ c("fieldset", { className: "ds:m-0 ds:border-0 ds:p-0", children: [
290
+ /* @__PURE__ */ o("legend", { className: "type-label ds:mb-[var(--spacing-xs)] ds:p-0 ds:text-[color:var(--foreground)]", children: t("periodontalDiagnosis.factors.label", "Contributing factors") }),
291
+ /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: L.map((e) => /* @__PURE__ */ o(
292
+ ae,
293
+ {
294
+ label: E(e),
295
+ checked: h.includes(e),
296
+ onCheckedChange: (l) => T(e, l === !0),
297
+ disabled: g
298
+ },
299
+ e
300
+ )) })
301
+ ] })
302
+ ] }), V = /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
303
+ /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
304
+ /* @__PURE__ */ o(
305
+ "h2",
306
+ {
307
+ id: F,
308
+ className: "type-title-card ds:m-0 ds:text-[color:var(--foreground)]",
309
+ children: G
310
+ }
311
+ ),
312
+ /* @__PURE__ */ o(te, { variant: C ? "brand" : "neutral", size: "md", children: C ? t("periodontalDiagnosis.status.complete", "Complete") : t("periodontalDiagnosis.status.incomplete", "Incomplete") })
313
+ ] }),
314
+ /* @__PURE__ */ o("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--foreground)]", children: _ }),
315
+ w === "display" ? X : U
316
+ ] });
317
+ return /* @__PURE__ */ o(
318
+ "div",
319
+ {
320
+ ref: $,
321
+ role: "group",
322
+ "aria-label": H,
323
+ "data-component": "periodontal-diagnosis",
324
+ "data-component-id": f,
325
+ id: f,
326
+ className: pe({ surface: b, className: K }),
327
+ ...B,
328
+ children: b === "elevated" ? /* @__PURE__ */ o(j, { variant: "elevated", children: /* @__PURE__ */ o(j.Body, { children: V }) }) : V
329
+ }
330
+ );
331
+ }
332
+ );
333
+ ue.displayName = "PeriodontalDiagnosis";
334
+ export {
335
+ ge as D,
336
+ ce as P,
337
+ u as S,
338
+ le as a,
339
+ de as b,
340
+ ue as c,
341
+ P as e,
342
+ k as i,
343
+ ne as p
344
+ };
345
+ //# sourceMappingURL=periodontal-diagnosis-cco40xTa.js.map
@@ -0,0 +1,334 @@
1
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as T, useId as $, useMemo as S } from "react";
3
+ import { c as _ } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as j } from "react-i18next";
5
+ import { B as w } from "./badge-DCOqV9mI.js";
6
+ import { C as N } from "./card-DPmk26CL.js";
7
+ import { u as M } from "./registry-DvAUVLHh.js";
8
+ const B = {
9
+ id: "periodontal-risk-chart",
10
+ capabilities: [],
11
+ state: {
12
+ overall: {
13
+ type: "string",
14
+ descriptionKey: "ui.agent.periodontalRiskChart.state.overall",
15
+ description: 'Overall periodontal risk verdict — "low" | "moderate" | "high". Aggregate only.',
16
+ read: (o) => o.getOverall()
17
+ },
18
+ factorLevels: {
19
+ type: "object",
20
+ descriptionKey: "ui.agent.periodontalRiskChart.state.factorLevels",
21
+ description: 'Per-factor risk levels keyed by factor (bleeding, pockets, toothLoss, boneLossAge, smoking, systemic) — each "low" | "moderate" | "high". No raw values.',
22
+ read: (o) => o.getFactorLevels()
23
+ }
24
+ },
25
+ actions: {},
26
+ domHooks: {
27
+ root: {
28
+ attr: "data-component",
29
+ value: "periodontal-risk-chart",
30
+ description: "Marks the PeriodontalRiskChart root region."
31
+ },
32
+ instanceId: {
33
+ attr: "data-component-id",
34
+ sourceProp: "id",
35
+ description: "Sourced from the id prop."
36
+ }
37
+ }
38
+ }, A = [
39
+ "bleeding",
40
+ "pockets",
41
+ "toothLoss",
42
+ "boneLossAge",
43
+ "smoking",
44
+ "systemic"
45
+ ], D = {
46
+ low: 0.4,
47
+ moderate: 0.7,
48
+ high: 1
49
+ };
50
+ function te(o) {
51
+ return o === "high" ? 2 : o === "moderate" ? 1 : 0;
52
+ }
53
+ function x(o, l, s) {
54
+ return o >= s ? "high" : o >= l ? "moderate" : "low";
55
+ }
56
+ const U = {
57
+ none: "low",
58
+ former: "low",
59
+ light: "moderate",
60
+ moderate: "high",
61
+ heavy: "high"
62
+ };
63
+ function K(o) {
64
+ const l = [], s = (e, d, a) => l.push({ factor: e, level: d, radius: D[d], valueText: a });
65
+ {
66
+ const e = o.bleedingPercent;
67
+ s(
68
+ "bleeding",
69
+ e == null ? "low" : x(e, 10, 26),
70
+ e == null ? null : `${Math.round(e)}%`
71
+ );
72
+ }
73
+ {
74
+ const e = o.pocketsOver5mm;
75
+ s(
76
+ "pockets",
77
+ e == null ? "low" : x(e, 5, 9),
78
+ e == null ? null : String(e)
79
+ );
80
+ }
81
+ {
82
+ const e = o.toothLoss;
83
+ s(
84
+ "toothLoss",
85
+ e == null ? "low" : x(e, 5, 9),
86
+ e == null ? null : String(e)
87
+ );
88
+ }
89
+ {
90
+ const e = o.boneLossPercent, d = o.ageYears;
91
+ if (e == null || d == null || d <= 0)
92
+ s("boneLossAge", "low", null);
93
+ else {
94
+ const a = e / d;
95
+ s(
96
+ "boneLossAge",
97
+ a > 1 ? "high" : a >= 0.5 ? "moderate" : "low",
98
+ a.toFixed(2)
99
+ );
100
+ }
101
+ }
102
+ {
103
+ const e = o.smoking;
104
+ s("smoking", e == null ? "low" : U[e], e ?? null);
105
+ }
106
+ {
107
+ const e = o.systemic;
108
+ s("systemic", e ? "high" : "low", e == null ? null : e ? "yes" : "no");
109
+ }
110
+ const g = l.filter((e) => e.level === "high").length, p = l.filter((e) => e.level === "moderate").length, y = g > 0 || p >= 2 ? "high" : p === 1 ? "moderate" : "low";
111
+ return { factors: l, overall: y };
112
+ }
113
+ const f = 240, W = _("ds:w-full ds:text-[color:var(--foreground)]", {
114
+ variants: {
115
+ surface: { flat: "", elevated: "" }
116
+ },
117
+ defaultVariants: { surface: "elevated" }
118
+ }), k = f / 2, h = f / 2 - 16;
119
+ function v(o, l) {
120
+ const s = (-90 + o * 60) * Math.PI / 180;
121
+ return { x: k + l * Math.cos(s), y: k + l * Math.sin(s) };
122
+ }
123
+ function u(o) {
124
+ return A.map((l, s) => {
125
+ const g = v(s, h * o);
126
+ return `${g.x.toFixed(1)},${g.y.toFixed(1)}`;
127
+ }).join(" ");
128
+ }
129
+ const C = {
130
+ low: "success",
131
+ moderate: "warning",
132
+ high: "error"
133
+ }, z = {
134
+ low: "Low",
135
+ moderate: "Moderate",
136
+ high: "High"
137
+ }, G = {
138
+ bleeding: "Bleeding on probing",
139
+ pockets: "Residual pockets ≥5 mm",
140
+ toothLoss: "Tooth loss",
141
+ boneLossAge: "Bone loss / age",
142
+ smoking: "Smoking",
143
+ systemic: "Systemic / genetic"
144
+ }, H = T(
145
+ ({
146
+ inputs: o,
147
+ surface: l = "elevated",
148
+ locale: s,
149
+ "aria-label": g,
150
+ id: p,
151
+ className: y,
152
+ ...e
153
+ }, d) => {
154
+ const { t: a, i18n: O } = j(), E = $(), F = s ?? O.language ?? "en", c = S(() => K(o), [o]);
155
+ M(
156
+ B,
157
+ {
158
+ getOverall: () => c.overall,
159
+ getFactorLevels: () => Object.fromEntries(
160
+ c.factors.map((t) => [t.factor, t.level])
161
+ )
162
+ },
163
+ p
164
+ );
165
+ const P = c.factors.map((t, n) => {
166
+ const i = v(n, h * t.radius);
167
+ return `${i.x.toFixed(1)},${i.y.toFixed(1)}`;
168
+ }).join(" "), b = (t) => a(`periodontalRiskChart.level.${t}`, {
169
+ defaultValue: z[t]
170
+ }), V = (t, n) => {
171
+ if (n == null)
172
+ return a("periodontalRiskChart.valueUnset", "not recorded");
173
+ if (t === "smoking")
174
+ return a(`periodontalRiskChart.smoking.${n}`, { defaultValue: n });
175
+ if (t === "systemic")
176
+ return a(`periodontalRiskChart.systemic.${n}`, { defaultValue: n });
177
+ if (t === "bleeding") {
178
+ const i = Number.parseFloat(n);
179
+ if (Number.isFinite(i))
180
+ try {
181
+ return a("periodontalRiskChart.percent", {
182
+ value: new Intl.NumberFormat(F, {
183
+ maximumFractionDigits: 0
184
+ }).format(i),
185
+ defaultValue: "{{value}}%"
186
+ });
187
+ } catch {
188
+ return n;
189
+ }
190
+ }
191
+ return n;
192
+ }, L = a("periodontalRiskChart.heading", "Periodontal risk"), I = g ?? L, R = /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
193
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
194
+ /* @__PURE__ */ r(
195
+ "h2",
196
+ {
197
+ id: E,
198
+ className: "type-title-card ds:m-0 ds:text-[color:var(--foreground)]",
199
+ children: L
200
+ }
201
+ ),
202
+ /* @__PURE__ */ m("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
203
+ /* @__PURE__ */ r("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: a("periodontalRiskChart.overall.label", "Overall") }),
204
+ /* @__PURE__ */ r(w, { variant: C[c.overall], size: "sm", children: b(c.overall) })
205
+ ] })
206
+ ] }),
207
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-lg)]", children: [
208
+ /* @__PURE__ */ m(
209
+ "svg",
210
+ {
211
+ viewBox: `0 0 ${f} ${f}`,
212
+ className: "ds:w-full ds:max-w-[240px] ds:aspect-square",
213
+ "aria-hidden": "true",
214
+ focusable: "false",
215
+ children: [
216
+ /* @__PURE__ */ r(
217
+ "polygon",
218
+ {
219
+ points: u(1),
220
+ fill: "var(--destructive)",
221
+ fillOpacity: 0.1
222
+ }
223
+ ),
224
+ /* @__PURE__ */ r(
225
+ "polygon",
226
+ {
227
+ points: u(0.7),
228
+ fill: "var(--warning)",
229
+ fillOpacity: 0.12
230
+ }
231
+ ),
232
+ /* @__PURE__ */ r(
233
+ "polygon",
234
+ {
235
+ points: u(0.4),
236
+ fill: "var(--success)",
237
+ fillOpacity: 0.14
238
+ }
239
+ ),
240
+ [1, 0.7, 0.4].map((t) => /* @__PURE__ */ r(
241
+ "polygon",
242
+ {
243
+ points: u(t),
244
+ fill: "none",
245
+ stroke: "var(--border)",
246
+ strokeWidth: 1
247
+ },
248
+ t
249
+ )),
250
+ A.map((t, n) => {
251
+ const i = v(n, h);
252
+ return /* @__PURE__ */ r(
253
+ "line",
254
+ {
255
+ x1: k,
256
+ y1: k,
257
+ x2: i.x,
258
+ y2: i.y,
259
+ stroke: "var(--border)",
260
+ strokeWidth: 1
261
+ },
262
+ n
263
+ );
264
+ }),
265
+ /* @__PURE__ */ r(
266
+ "polygon",
267
+ {
268
+ points: P,
269
+ fill: "var(--primary)",
270
+ fillOpacity: 0.18,
271
+ stroke: "var(--primary)",
272
+ strokeWidth: 2,
273
+ strokeLinejoin: "round"
274
+ }
275
+ ),
276
+ c.factors.map((t, n) => {
277
+ const i = v(n, h * t.radius);
278
+ return /* @__PURE__ */ r(
279
+ "circle",
280
+ {
281
+ cx: i.x,
282
+ cy: i.y,
283
+ r: 3,
284
+ fill: "var(--primary)"
285
+ },
286
+ t.factor
287
+ );
288
+ })
289
+ ]
290
+ }
291
+ ),
292
+ /* @__PURE__ */ r(
293
+ "dl",
294
+ {
295
+ className: "type-body-sm ds:grid ds:min-w-[12rem] ds:flex-1 ds:grid-cols-[auto_1fr] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-2xs)] ds:m-0",
296
+ "aria-label": a("periodontalRiskChart.factors.label", "Risk factors"),
297
+ children: c.factors.map((t) => /* @__PURE__ */ m("div", { className: "ds:contents", children: [
298
+ /* @__PURE__ */ r("dt", { className: "ds:text-[color:var(--muted-foreground)]", children: a(`periodontalRiskChart.factor.${t.factor}`, {
299
+ defaultValue: G[t.factor]
300
+ }) }),
301
+ /* @__PURE__ */ m("dd", { className: "ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
302
+ /* @__PURE__ */ r(w, { variant: C[t.level], size: "sm", children: b(t.level) }),
303
+ /* @__PURE__ */ r("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: V(t.factor, t.valueText) })
304
+ ] })
305
+ ] }, t.factor))
306
+ }
307
+ )
308
+ ] })
309
+ ] });
310
+ return /* @__PURE__ */ r(
311
+ "div",
312
+ {
313
+ ref: d,
314
+ role: "group",
315
+ "aria-label": I,
316
+ "data-component": "periodontal-risk-chart",
317
+ "data-component-id": p,
318
+ id: p,
319
+ className: W({ surface: l, className: y }),
320
+ ...e,
321
+ children: l === "elevated" ? /* @__PURE__ */ r(N, { variant: "elevated", children: /* @__PURE__ */ r(N.Body, { children: R }) }) : R
322
+ }
323
+ );
324
+ }
325
+ );
326
+ H.displayName = "PeriodontalRiskChart";
327
+ export {
328
+ A as P,
329
+ H as a,
330
+ K as c,
331
+ B as p,
332
+ te as r
333
+ };
334
+ //# sourceMappingURL=periodontal-risk-chart-bUGkMwDg.js.map
@@ -10,7 +10,7 @@ import { getCountries as qe, parsePhoneNumberFromString as L, AsYouType as q, ge
10
10
  import { u as He, F as _e } from "./form-field-context-B3APVHKx.js";
11
11
  import { c as Ge } from "./compose-refs-C0k0tdqF.js";
12
12
  import { n as J } from "./normalize-diacritics-BNGbFNlJ.js";
13
- import { a as Q } from "./flag-DZ6V7-hU.js";
13
+ import { a as Q } from "./flag-Cnmivlrl.js";
14
14
  import { C as Oe } from "./chevron-down-DWE7GSq9.js";
15
15
  const Ue = {
16
16
  id: "phone-input",
@@ -577,4 +577,4 @@ export {
577
577
  pe as c,
578
578
  We as p
579
579
  };
580
- //# sourceMappingURL=phone-input-dtnrvnZf.js.map
580
+ //# sourceMappingURL=phone-input-D00ZBAm-.js.map