@alfadocs/ui-kit 0.75.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 (91) hide show
  1. package/dist/_chunks/{address-fields-COyjgqxA.js → address-fields-7k59FnJ6.js} +2 -2
  2. package/dist/_chunks/{booking-B1Qkcl3c.js → booking-CLmeXtGv.js} +2 -2
  3. package/dist/_chunks/{country-select-DYHDLEjG.js → country-select-BN9nedAp.js} +2 -2
  4. package/dist/_chunks/document-preview-CvHnHf6T.js +243 -0
  5. package/dist/_chunks/{file-manager-UF8dkQF1.js → file-manager-DfTG7bxx.js} +394 -399
  6. package/dist/_chunks/flag-Cnmivlrl.js +641 -0
  7. package/dist/_chunks/{header-settings-4cwQzeFc.js → header-settings-DMfdx0Vq.js} +2 -2
  8. package/dist/_chunks/{locale-picker-GNF3lo8K.js → locale-picker-EyvPrwDc.js} +2 -2
  9. package/dist/_chunks/{marketplace-app-shell-D_1tF4La.js → marketplace-app-shell-Bxq1PYAj.js} +2 -2
  10. package/dist/_chunks/{patient-details-DP4wKyq4.js → patient-details-zy76MRh7.js} +3 -3
  11. package/dist/_chunks/periodontal-chart-CYBhr9vc.js +1305 -0
  12. package/dist/_chunks/{phone-input-dtnrvnZf.js → phone-input-D00ZBAm-.js} +2 -2
  13. package/dist/agent-catalog.json +149 -1
  14. package/dist/agent-i18n/en.json +2 -0
  15. package/dist/components/address-fields/index.js +1 -1
  16. package/dist/components/booking/index.js +1 -1
  17. package/dist/components/country-select/index.js +1 -1
  18. package/dist/components/document-preview/document-preview.d.ts +25 -2
  19. package/dist/components/document-preview/index.d.ts +1 -1
  20. package/dist/components/document-preview/index.js +1 -1
  21. package/dist/components/file-manager/index.js +1 -1
  22. package/dist/components/flag/index.js +1 -1
  23. package/dist/components/header-settings/index.js +1 -1
  24. package/dist/components/locale-picker/index.js +1 -1
  25. package/dist/components/patient-details/index.js +1 -1
  26. package/dist/components/periodontal-chart/index.d.ts +2 -2
  27. package/dist/components/periodontal-chart/index.js +8 -7
  28. package/dist/components/periodontal-chart/periodontal-chart-data.d.ts +45 -0
  29. package/dist/components/periodontal-chart/periodontal-chart.d.ts +3 -1
  30. package/dist/components/phone-input/index.js +1 -1
  31. package/dist/i18n/locales/ar.d.ts +2 -1
  32. package/dist/i18n/locales/ar.js +2 -1
  33. package/dist/i18n/locales/de.d.ts +2 -1
  34. package/dist/i18n/locales/de.js +2 -1
  35. package/dist/i18n/locales/el.d.ts +2 -1
  36. package/dist/i18n/locales/el.js +2 -1
  37. package/dist/i18n/locales/en.d.ts +2 -1
  38. package/dist/i18n/locales/en.js +2 -1
  39. package/dist/i18n/locales/es.d.ts +2 -1
  40. package/dist/i18n/locales/es.js +2 -1
  41. package/dist/i18n/locales/fr.d.ts +2 -1
  42. package/dist/i18n/locales/fr.js +2 -1
  43. package/dist/i18n/locales/hi.d.ts +2 -1
  44. package/dist/i18n/locales/hi.js +2 -1
  45. package/dist/i18n/locales/it.d.ts +2 -1
  46. package/dist/i18n/locales/it.js +2 -1
  47. package/dist/i18n/locales/ja.d.ts +2 -1
  48. package/dist/i18n/locales/ja.js +2 -1
  49. package/dist/i18n/locales/nl.d.ts +2 -1
  50. package/dist/i18n/locales/nl.js +2 -1
  51. package/dist/i18n/locales/pl.d.ts +2 -1
  52. package/dist/i18n/locales/pl.js +2 -1
  53. package/dist/i18n/locales/pt.d.ts +2 -1
  54. package/dist/i18n/locales/pt.js +2 -1
  55. package/dist/i18n/locales/ro.d.ts +2 -1
  56. package/dist/i18n/locales/ro.js +2 -1
  57. package/dist/i18n/locales/ru.d.ts +2 -1
  58. package/dist/i18n/locales/ru.js +2 -1
  59. package/dist/i18n/locales/sq.d.ts +2 -1
  60. package/dist/i18n/locales/sq.js +2 -1
  61. package/dist/i18n/locales/sv.d.ts +2 -1
  62. package/dist/i18n/locales/sv.js +2 -1
  63. package/dist/i18n/locales/tr.d.ts +2 -1
  64. package/dist/i18n/locales/tr.js +2 -1
  65. package/dist/i18n/locales/zh.d.ts +2 -1
  66. package/dist/i18n/locales/zh.js +2 -1
  67. package/dist/index.js +217 -216
  68. package/dist/locales/ar.json +2 -1
  69. package/dist/locales/de.json +2 -1
  70. package/dist/locales/el.json +2 -1
  71. package/dist/locales/en.json +2 -1
  72. package/dist/locales/es.json +2 -1
  73. package/dist/locales/fr.json +2 -1
  74. package/dist/locales/hi.json +2 -1
  75. package/dist/locales/it.json +2 -1
  76. package/dist/locales/ja.json +2 -1
  77. package/dist/locales/nl.json +2 -1
  78. package/dist/locales/pl.json +2 -1
  79. package/dist/locales/pt.json +2 -1
  80. package/dist/locales/ro.json +2 -1
  81. package/dist/locales/ru.json +2 -1
  82. package/dist/locales/sq.json +2 -1
  83. package/dist/locales/sv.json +2 -1
  84. package/dist/locales/tr.json +2 -1
  85. package/dist/locales/zh.json +2 -1
  86. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  87. package/dist/tokens.css +1 -1
  88. package/package.json +1 -1
  89. package/dist/_chunks/document-preview-CGSM_au9.js +0 -181
  90. package/dist/_chunks/flag-DZ6V7-hU.js +0 -637
  91. package/dist/_chunks/periodontal-chart-D8hOFmde.js +0 -1173
@@ -2,7 +2,7 @@ import { jsx as s } from "react/jsx-runtime";
2
2
  import { forwardRef as _, useRef as j, useEffect as k, useCallback as E, useMemo as x } from "react";
3
3
  import { c as L } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as N } from "react-i18next";
5
- import { C as O } from "./country-select-DYHDLEjG.js";
5
+ import { C as O } from "./country-select-BN9nedAp.js";
6
6
  import { P as B } from "./province-select-BDywtmL-.js";
7
7
  import { P as q } from "./postal-code-input-BznBxVxf.js";
8
8
  import { C as H } from "./city-input-towzBenY.js";
@@ -243,4 +243,4 @@ export {
243
243
  Z as A,
244
244
  Y as a
245
245
  };
246
- //# sourceMappingURL=address-fields-COyjgqxA.js.map
246
+ //# sourceMappingURL=address-fields-7k59FnJ6.js.map
@@ -10,7 +10,7 @@ import { C as Bt } from "./checkbox-group-CfqMv57d.js";
10
10
  import { D as Et } from "./date-picker-DzQS8mvt.js";
11
11
  import { E as Rt } from "./email-input-Dpe63k0K.js";
12
12
  import { F as Z } from "./form-field-M5UpX65Z.js";
13
- import { P as Vt } from "./phone-input-dtnrvnZf.js";
13
+ import { P as Vt } from "./phone-input-D00ZBAm-.js";
14
14
  import { T as Lt } from "./text-area-Bt3p7Pt0.js";
15
15
  import { T as Ce } from "./text-input-CUvCb6ST.js";
16
16
  import { S as Ft } from "./spinner-hbwuKwMf.js";
@@ -2692,4 +2692,4 @@ export {
2692
2692
  X as O,
2693
2693
  Cs as b
2694
2694
  };
2695
- //# sourceMappingURL=booking-B1Qkcl3c.js.map
2695
+ //# sourceMappingURL=booking-CLmeXtGv.js.map
@@ -2,7 +2,7 @@ import { jsx as O } from "react/jsx-runtime";
2
2
  import { forwardRef as P, useMemo as n, useCallback as x, useRef as aa, useEffect as ea } from "react";
3
3
  import { useTranslation as ra } from "react-i18next";
4
4
  import { C as ia } from "./combobox-DiMLItyu.js";
5
- import { h as ca, a as sa } from "./flag-DZ6V7-hU.js";
5
+ import { h as ca, a as sa } from "./flag-Cnmivlrl.js";
6
6
  import { u as ta } from "./use-controllable-state-BiY4xTzM.js";
7
7
  import { u as oa } from "./registry-DvAUVLHh.js";
8
8
  const N = {
@@ -706,4 +706,4 @@ export {
706
706
  ua as c,
707
707
  Aa as r
708
708
  };
709
- //# sourceMappingURL=country-select-DYHDLEjG.js.map
709
+ //# sourceMappingURL=country-select-BN9nedAp.js.map
@@ -0,0 +1,243 @@
1
+ import { jsxs as d, Fragment as g, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as j, useMemo as S, useState as C, useImperativeHandle as W } from "react";
3
+ import { c as U } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as $ } from "react-i18next";
5
+ import { B as h } from "./badge-DCOqV9mI.js";
6
+ import { E as G } from "./empty-state-CrLsi0XI.js";
7
+ import { P as Y } from "./panel-header-D313n_9-.js";
8
+ import { P as q } from "./pdf-viewer-DF3VMaPo.js";
9
+ import { T as J, b as O, c as Q, a as X } from "./tabs-CVTukWRD.js";
10
+ import { u as Z } from "./registry-DvAUVLHh.js";
11
+ import { F as ee, a as te } from "./file-Cwe9VC1A.js";
12
+ import { F as ae } from "./file-text-5yv6r2ls.js";
13
+ import { c as ie } from "./createLucideIcon-DhHxpK9K.js";
14
+ /**
15
+ * @license lucide-react v1.22.0 - ISC
16
+ *
17
+ * This source code is licensed under the ISC license.
18
+ * See the LICENSE file in the root directory of this source tree.
19
+ */
20
+ const ne = [
21
+ ["path", { d: "M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8", key: "14sh0y" }],
22
+ [
23
+ "path",
24
+ {
25
+ d: "M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",
26
+ key: "1970lx"
27
+ }
28
+ ],
29
+ ["path", { d: "M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1", key: "l4dndm" }]
30
+ ], se = ie("files", ne), re = {
31
+ id: "document-preview",
32
+ capabilities: [],
33
+ state: {
34
+ kind: {
35
+ type: "'pdf' | 'image' | 'metadata' | 'empty'",
36
+ descriptionKey: "ui.agent.documentPreview.state.kind",
37
+ description: "Which render branch is active: pdf, image, metadata (no inline preview), or empty (no document). Structural — never the document name.",
38
+ read: (i) => i.getKind()
39
+ }
40
+ },
41
+ actions: {
42
+ get_name: {
43
+ // phi (not read): resolves the document display name, which can identify
44
+ // patients. PRS §26 — phi outranks read so the host gates it behind
45
+ // stricter confirm + audit. The always-on kind slot stays name-free.
46
+ safety: "phi",
47
+ returns: "string | undefined",
48
+ returnsSchema: { type: ["string", "null"] },
49
+ idempotent: !0,
50
+ descriptionKey: "ui.agent.documentPreview.actions.getName",
51
+ description: "Read the display name of the previewed document. May identify a patient (PHI).",
52
+ invoke: (i) => i.getName()
53
+ }
54
+ },
55
+ domHooks: {
56
+ root: {
57
+ attr: "data-component",
58
+ value: "document-preview",
59
+ description: "Marks the DocumentPreview region."
60
+ },
61
+ instanceId: {
62
+ attr: "data-component-id",
63
+ sourceProp: "id",
64
+ description: "Sourced from the id prop."
65
+ }
66
+ }
67
+ }, de = U(
68
+ [
69
+ "ds:flex ds:h-full ds:min-h-0 ds:min-w-0 ds:flex-col ds:overflow-auto",
70
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
71
+ "ds:focus-visible:outline-solid",
72
+ "ds:focus-visible:outline-ring"
73
+ ].join(" ")
74
+ ), me = {
75
+ signed: "success",
76
+ pending: "warning"
77
+ };
78
+ function k(i, n, l) {
79
+ if (!i) return "empty";
80
+ const r = n ?? "";
81
+ return r === "application/pdf" && l ? "pdf" : r.startsWith("image/") && l ? "image" : "metadata";
82
+ }
83
+ function B(i) {
84
+ const n = i ?? "";
85
+ return n.startsWith("image/") ? ee : n === "application/pdf" || n.startsWith("text/") || n.includes("word") ? ae : te;
86
+ }
87
+ const oe = [
88
+ "documentPreview.units.bytes",
89
+ "documentPreview.units.kilobytes",
90
+ "documentPreview.units.megabytes",
91
+ "documentPreview.units.gigabytes"
92
+ ], M = ["B", "KB", "MB", "GB"];
93
+ function le(i, n, l) {
94
+ let r = i, m = 0;
95
+ for (; r >= 1024 && m < M.length - 1; )
96
+ r /= 1024, m++;
97
+ return `${new Intl.NumberFormat(n, {
98
+ maximumFractionDigits: m === 0 ? 0 : 1
99
+ }).format(r)} ${l(oe[m], M[m])}`;
100
+ }
101
+ const ce = j(({ id: i, name: n, mimeType: l, src: r, metadata: m, documents: u, className: K }, D) => {
102
+ const { t: s, i18n: v } = $(), o = S(() => u && u.length > 0 ? u : n ? [{ id: i ?? n, name: n, mimeType: l, src: r, metadata: m }] : [], [u, i, n, l, r, m]), w = o.length > 1, [L, _] = C(void 0), a = o.find((e) => e.id === L) ?? o[0], y = S(
103
+ () => ({
104
+ getKind: () => a ? k(a.name, a.mimeType, a.src) : "empty",
105
+ getName: () => a == null ? void 0 : a.name
106
+ }),
107
+ [a]
108
+ );
109
+ W(D, () => y, [y]), Z(re, y, i);
110
+ const b = (e) => {
111
+ var N, P, x, T, I, z, A, F;
112
+ const f = k(e.name, e.mimeType, e.src);
113
+ if (f === "pdf" && e.src)
114
+ return /* @__PURE__ */ t(
115
+ q,
116
+ {
117
+ src: e.src,
118
+ toolbarVariant: "minimal",
119
+ ariaLabel: e.name,
120
+ className: "ds:h-full"
121
+ }
122
+ );
123
+ if (f === "image" && e.src)
124
+ return /* @__PURE__ */ t(
125
+ "img",
126
+ {
127
+ src: e.src,
128
+ alt: s("documentPreview.imageAlt", "Preview of {{name}}", {
129
+ name: e.name
130
+ }),
131
+ className: "ds:max-h-full ds:max-w-full ds:ms-auto ds:me-auto ds:object-contain"
132
+ }
133
+ );
134
+ const c = (N = e.metadata) == null ? void 0 : N.signatureStatus, R = !!((P = e.metadata) != null && P.documentType) || !!((x = e.metadata) != null && x.clinical) || c !== void 0 && c !== "none";
135
+ return /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
136
+ R && /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
137
+ ((T = e.metadata) == null ? void 0 : T.documentType) && /* @__PURE__ */ t(h, { variant: "neutral", size: "sm", children: e.metadata.documentType }),
138
+ ((I = e.metadata) == null ? void 0 : I.clinical) && /* @__PURE__ */ t(h, { variant: "info", size: "sm", children: s("documentPreview.clinical", "Clinical") }),
139
+ c && c !== "none" && /* @__PURE__ */ t(h, { variant: me[c], size: "sm", withDot: !0, children: s(`documentPreview.signature.${c}`, c) })
140
+ ] }),
141
+ /* @__PURE__ */ d("dl", { className: "ds:grid ds:grid-cols-[auto_1fr] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] type-body-sm", children: [
142
+ ((z = e.metadata) == null ? void 0 : z.size) !== void 0 && /* @__PURE__ */ d(g, { children: [
143
+ /* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.size", "Size") }),
144
+ /* @__PURE__ */ t("dd", { className: "ds:m-0", children: le(e.metadata.size, v.language, s) })
145
+ ] }),
146
+ ((A = e.metadata) == null ? void 0 : A.updatedAt) && /* @__PURE__ */ d(g, { children: [
147
+ /* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.modified", "Modified") }),
148
+ /* @__PURE__ */ t("dd", { className: "ds:m-0", children: new Intl.DateTimeFormat(v.language, {
149
+ dateStyle: "medium"
150
+ }).format(new Date(e.metadata.updatedAt)) })
151
+ ] }),
152
+ ((F = e.metadata) == null ? void 0 : F.expiresAt) && /* @__PURE__ */ d(g, { children: [
153
+ /* @__PURE__ */ t("dt", { className: "ds:text-muted-foreground", children: s("documentPreview.fields.expires", "Expires") }),
154
+ /* @__PURE__ */ t("dd", { className: "ds:m-0", children: new Intl.DateTimeFormat(v.language, {
155
+ dateStyle: "medium"
156
+ }).format(new Date(e.metadata.expiresAt)) })
157
+ ] })
158
+ ] }),
159
+ /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-muted-foreground", children: s("documentPreview.noPreview", "No preview available.") })
160
+ ] });
161
+ }, V = B(a == null ? void 0 : a.mimeType), E = w ? /* @__PURE__ */ t(se, { "aria-hidden": "true" }) : /* @__PURE__ */ t(V, { "aria-hidden": "true" }), H = w ? /* @__PURE__ */ d(g, { children: [
162
+ s("documentPreview.multiTitle", "Documents"),
163
+ /* @__PURE__ */ t(h, { variant: "neutral", size: "sm", children: o.length })
164
+ ] }) : a == null ? void 0 : a.name;
165
+ let p;
166
+ return o.length === 0 ? p = /* @__PURE__ */ t(
167
+ G,
168
+ {
169
+ variant: "first-use",
170
+ size: "sm",
171
+ title: s("documentPreview.emptyTitle", "No document selected"),
172
+ description: s(
173
+ "documentPreview.emptyDescription",
174
+ "Select a document to preview it here."
175
+ )
176
+ }
177
+ ) : w ? p = /* @__PURE__ */ d(
178
+ J,
179
+ {
180
+ value: (a == null ? void 0 : a.id) ?? "",
181
+ onValueChange: _,
182
+ variant: "underlined",
183
+ size: "sm",
184
+ className: "ds:min-h-0 ds:flex-1 ds:pt-[var(--spacing-sm)]",
185
+ children: [
186
+ /* @__PURE__ */ t(
187
+ O,
188
+ {
189
+ "aria-label": s("documentPreview.tabsLabel", "Selected documents"),
190
+ className: "ds:gap-[var(--spacing-sm)]",
191
+ children: o.map((e) => {
192
+ const f = B(e.mimeType);
193
+ return /* @__PURE__ */ t(
194
+ Q,
195
+ {
196
+ value: e.id,
197
+ icon: /* @__PURE__ */ t(
198
+ f,
199
+ {
200
+ "aria-hidden": "true",
201
+ className: "ds:size-4 ds:text-[color:var(--accent)]"
202
+ }
203
+ ),
204
+ className: "ds:[min-inline-size:0]",
205
+ children: /* @__PURE__ */ t("span", { className: "ds:block ds:truncate ds:[min-inline-size:0]", children: e.name })
206
+ },
207
+ e.id
208
+ );
209
+ })
210
+ }
211
+ ),
212
+ o.map((e) => /* @__PURE__ */ t(
213
+ X,
214
+ {
215
+ value: e.id,
216
+ className: "ds:min-h-0 ds:flex-1",
217
+ children: b(e)
218
+ },
219
+ e.id
220
+ ))
221
+ ]
222
+ }
223
+ ) : p = b(a), /* @__PURE__ */ d(
224
+ "section",
225
+ {
226
+ "data-component": "document-preview",
227
+ "data-component-id": i,
228
+ tabIndex: 0,
229
+ "aria-label": s("documentPreview.regionLabel", "Document preview"),
230
+ className: de({ className: K }),
231
+ children: [
232
+ o.length > 0 && /* @__PURE__ */ t(Y, { sticky: !0, icon: E, title: H }),
233
+ p
234
+ ]
235
+ }
236
+ );
237
+ });
238
+ ce.displayName = "DocumentPreview";
239
+ export {
240
+ ce as D,
241
+ re as d
242
+ };
243
+ //# sourceMappingURL=document-preview-CvHnHf6T.js.map