@alfadocs/ui-kit 0.84.0 → 0.85.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 (66) hide show
  1. package/dist/_chunks/{ai-consent-banner-DUhr1yNj.js → ai-consent-banner-BXD7W6FI.js} +2 -2
  2. package/dist/_chunks/{alert-KJbsPYkI.js → alert-Cxaqd-QO.js} +12 -12
  3. package/dist/_chunks/{audio-recorder-Cc3KuL9y.js → audio-recorder-BjnB7V8n.js} +2 -2
  4. package/dist/_chunks/{booking-CLmeXtGv.js → booking-BvCu2XWY.js} +2 -2
  5. package/dist/_chunks/{document-preview-nwfulDEs.js → document-preview-DXl9migE.js} +2 -2
  6. package/dist/_chunks/{document-scanner-B6h1Ir56.js → document-scanner-cS_ispQs.js} +3 -3
  7. package/dist/_chunks/{entity-summary--vP698Jn.js → entity-summary-BILN4wEG.js} +2 -2
  8. package/dist/_chunks/{field-value-DHG6gEKS.js → field-value-BRVbZJej.js} +133 -144
  9. package/dist/_chunks/{file-manager-DLJlinIO.js → file-manager-B9LZzT5E.js} +129 -129
  10. package/dist/_chunks/{file-upload-DENvuhfs.js → file-upload-CwxdqkMK.js} +134 -146
  11. package/dist/_chunks/{freemium-paywall-CmV642PA.js → freemium-paywall-Dr2342_S.js} +2 -2
  12. package/dist/_chunks/{marketplace-app-shell-Br2yebEK.js → marketplace-app-shell-Chcj4q4z.js} +2 -2
  13. package/dist/_chunks/message-square-Bye4ATvx.js +20 -0
  14. package/dist/_chunks/{notes-panel-Cvdp818a.js → notes-panel-BLjlYBt-.js} +2 -2
  15. package/dist/_chunks/{patient-details-COvYWp2e.js → patient-details-B9LCdyWW.js} +2 -2
  16. package/dist/_chunks/{patient-search-BaUJ_Y-N.js → patient-search-vtRTSdf6.js} +2 -2
  17. package/dist/_chunks/{patient-summary-card-D6kgdTNn.js → patient-summary-card-vn1H4xWj.js} +2 -2
  18. package/dist/_chunks/{patient-table-BHzmUbzu.js → patient-table-B6AKMTm3.js} +182 -196
  19. package/dist/_chunks/{payment-form-DL9xk9BA.js → payment-form-BoGxEmGn.js} +2 -2
  20. package/dist/_chunks/{payment-request-card-d-RmzsUd.js → payment-request-card-CygO1anM.js} +72 -70
  21. package/dist/_chunks/{pdf-viewer-DF3VMaPo.js → pdf-viewer-CcOuR2wj.js} +2 -2
  22. package/dist/_chunks/{practice-results-BCr7jMt1.js → practice-results-yKbwIxqa.js} +2 -2
  23. package/dist/_chunks/{radiograph-panel.agent-CxF9pVxd.js → radiograph-panel.agent-M9XD4ze4.js} +2 -2
  24. package/dist/_chunks/{rich-text-editor-CCWjNkbx.js → rich-text-editor-RRkBN_WB.js} +2 -2
  25. package/dist/_chunks/{session-countdown-C8AsE072.js → session-countdown-Bc70VXN1.js} +58 -48
  26. package/dist/_chunks/{sign-document-Bfk0WpWV.js → sign-document-DI561d1C.js} +2 -2
  27. package/dist/_chunks/{signature-request-CEOrCDyk.js → signature-request-D_6jgDZd.js} +60 -77
  28. package/dist/_chunks/{task-tray-Br3vc0O1.js → task-tray-CLIqIXUZ.js} +58 -70
  29. package/dist/_chunks/{toast.agent-uV8CeAy6.js → toast.agent-Iw2jWdce.js} +2 -2
  30. package/dist/_chunks/{warning-stack-BlG_Ujy3.js → warning-stack-CAHQ0xxS.js} +2 -2
  31. package/dist/_chunks/{workflow-map-C643Q43h.js → workflow-map-SIfAhmWz.js} +2 -2
  32. package/dist/agent-catalog.json +1 -1
  33. package/dist/components/ai-consent-banner/index.js +1 -1
  34. package/dist/components/alert/index.js +1 -1
  35. package/dist/components/audio-recorder/index.js +1 -1
  36. package/dist/components/booking/index.js +1 -1
  37. package/dist/components/document-preview/index.js +1 -1
  38. package/dist/components/document-scanner/index.js +1 -1
  39. package/dist/components/entity-summary/index.js +1 -1
  40. package/dist/components/file-manager/index.js +1 -1
  41. package/dist/components/file-upload/index.js +1 -1
  42. package/dist/components/freemium-paywall/index.js +1 -1
  43. package/dist/components/notes-panel/index.js +1 -1
  44. package/dist/components/patient-details/index.js +1 -1
  45. package/dist/components/patient-search/index.js +1 -1
  46. package/dist/components/patient-summary-card/index.js +1 -1
  47. package/dist/components/patient-table/index.js +1 -1
  48. package/dist/components/payment-card/index.js +1 -1
  49. package/dist/components/payment-form/index.js +1 -1
  50. package/dist/components/pdf-viewer/index.js +1 -1
  51. package/dist/components/practice-results/index.js +1 -1
  52. package/dist/components/radiograph-panel/index.js +1 -1
  53. package/dist/components/rich-text-editor/index.js +1 -1
  54. package/dist/components/select/select.d.ts +8 -5
  55. package/dist/components/session-countdown/index.js +1 -1
  56. package/dist/components/sign-document/index.js +1 -1
  57. package/dist/components/task-tray/index.js +1 -1
  58. package/dist/components/toast/index.js +1 -1
  59. package/dist/components/warning-stack/index.js +1 -1
  60. package/dist/components/workflow/index.js +1 -1
  61. package/dist/index.js +434 -445
  62. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  63. package/dist/patterns/signature-request/index.js +1 -1
  64. package/dist/tokens.css +1 -1
  65. package/package.json +5 -3
  66. package/dist/_chunks/circle-x-W8Enq3i4.js +0 -16
@@ -1,19 +1,20 @@
1
- import { useMemo as O, useCallback as D, useState as H, cloneElement as X } from "react";
1
+ import { useMemo as O, useCallback as D, useState as E, cloneElement as X } from "react";
2
2
  import { u as J } from "./use-controllable-state-BiY4xTzM.js";
3
- import { jsxs as F, jsx as r, Fragment as Q } from "react/jsx-runtime";
4
- import { useTranslation as z } from "react-i18next";
3
+ import { jsxs as I, jsx as r, Fragment as Q } from "react/jsx-runtime";
4
+ import { useTranslation as P } from "react-i18next";
5
5
  import { B as W } from "./button-CPGiR_bH.js";
6
- import { I as $ } from "./icon-button-C_kbcd7I.js";
7
- import { C as j } from "./checkbox-BuZ1u__2.js";
6
+ import { I as j } from "./icon-button-C_kbcd7I.js";
7
+ import { C as $ } from "./checkbox-BuZ1u__2.js";
8
8
  import { P as T } from "./popover-Cc0a69sw.js";
9
9
  import { S as Y } from "./separator-CYU_bGFn.js";
10
- import { c as P } from "./createLucideIcon-DhHxpK9K.js";
11
- import { G as Z } from "./grip-vertical-onSb1JXO.js";
12
- import { B as U } from "./badge-DCOqV9mI.js";
13
- import { L as ee } from "./link-CPb_pZPr.js";
14
- import { T as te } from "./transaction-chip-DJCstquX.js";
15
- import { H as ne } from "./hash-CSQ9SChR.js";
16
- import { C as re } from "./calendar-days-BGWklvE-.js";
10
+ import { S as Z } from "./settings-d25ju_6L.js";
11
+ import { G as ee } from "./grip-vertical-onSb1JXO.js";
12
+ import { B as H } from "./badge-DCOqV9mI.js";
13
+ import { L as te } from "./link-CPb_pZPr.js";
14
+ import { T as ne } from "./transaction-chip-DJCstquX.js";
15
+ import { H as re } from "./hash-CSQ9SChR.js";
16
+ import { C as ae } from "./calendar-days-BGWklvE-.js";
17
+ import { c as U } from "./createLucideIcon-DhHxpK9K.js";
17
18
  import { U as se } from "./user-B12p7bVF.js";
18
19
  /**
19
20
  * @license lucide-react v1.22.0 - ISC
@@ -21,7 +22,7 @@ import { U as se } from "./user-B12p7bVF.js";
21
22
  * This source code is licensed under the ISC license.
22
23
  * See the LICENSE file in the root directory of this source tree.
23
24
  */
24
- const ae = [
25
+ const ie = [
25
26
  ["path", { d: "M5 22h14", key: "ehvnwv" }],
26
27
  ["path", { d: "M5 2h14", key: "pdyrp9" }],
27
28
  [
@@ -35,62 +36,50 @@ const ae = [
35
36
  "path",
36
37
  { d: "M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2", key: "1vvvr6" }
37
38
  ]
38
- ], ie = P("hourglass", ae);
39
+ ], oe = U("hourglass", ie);
39
40
  /**
40
41
  * @license lucide-react v1.22.0 - ISC
41
42
  *
42
43
  * This source code is licensed under the ISC license.
43
44
  * See the LICENSE file in the root directory of this source tree.
44
45
  */
45
- const oe = [
46
+ const le = [
46
47
  ["path", { d: "M16 3h5v5", key: "1806ms" }],
47
48
  ["path", { d: "m21 3-6.75 6.75", key: "pv0uzu" }],
48
49
  ["circle", { cx: "10", cy: "14", r: "6", key: "1qwbdc" }]
49
- ], ce = P("mars", oe);
50
- /**
51
- * @license lucide-react v1.22.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */
56
- const le = [
57
- ["path", { d: "M14 17H5", key: "gfn3mx" }],
58
- ["path", { d: "M19 7h-9", key: "6i9tg" }],
59
- ["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
60
- ["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
61
- ], de = P("settings-2", le);
50
+ ], ce = U("mars", le);
62
51
  /**
63
52
  * @license lucide-react v1.22.0 - ISC
64
53
  *
65
54
  * This source code is licensed under the ISC license.
66
55
  * See the LICENSE file in the root directory of this source tree.
67
56
  */
68
- const ue = [
57
+ const de = [
69
58
  ["path", { d: "M12 15v7", key: "t2xh3l" }],
70
59
  ["path", { d: "M9 19h6", key: "456am0" }],
71
60
  ["circle", { cx: "12", cy: "9", r: "6", key: "1nw4tq" }]
72
- ], me = P("venus", ue);
61
+ ], ue = U("venus", de);
73
62
  function G(e) {
74
63
  return e.flatMap((d) => d.fields.map((t) => t.id));
75
64
  }
76
- function _e(e, d) {
77
- const t = d ?? G(e), m = new Map(t.map((a, y) => [a, y]));
78
- return e.map((a) => ({
79
- section: a,
80
- fields: a.fields.filter((y) => m.has(y.id)).sort(
65
+ function ze(e, d) {
66
+ const t = d ?? G(e), m = new Map(t.map((s, y) => [s, y]));
67
+ return e.map((s) => ({
68
+ section: s,
69
+ fields: s.fields.filter((y) => m.has(y.id)).sort(
81
70
  (y, S) => m.get(y.id) - m.get(S.id)
82
71
  )
83
72
  }));
84
73
  }
85
- function ze(e, { value: d, defaultValue: t, onChange: m } = {}) {
86
- const a = O(
74
+ function Pe(e, { value: d, defaultValue: t, onChange: m } = {}) {
75
+ const s = O(
87
76
  () => G(e),
88
77
  [e]
89
78
  ), [y, S] = J({
90
79
  value: d,
91
- defaultValue: t ?? a,
80
+ defaultValue: t ?? s,
92
81
  onChange: m
93
- }), i = y ?? t ?? a, x = O(() => {
82
+ }), i = y ?? t ?? s, x = O(() => {
94
83
  const p = /* @__PURE__ */ new Map();
95
84
  for (const f of e)
96
85
  for (const g of f.fields)
@@ -101,7 +90,7 @@ function ze(e, { value: d, defaultValue: t, onChange: m } = {}) {
101
90
  S(p.filter((f) => x.has(f)));
102
91
  },
103
92
  [S, x]
104
- ), I = D(
93
+ ), M = D(
105
94
  (p) => {
106
95
  u(
107
96
  i.includes(p) ? i.filter((f) => f !== p) : [...i, p]
@@ -113,7 +102,7 @@ function ze(e, { value: d, defaultValue: t, onChange: m } = {}) {
113
102
  var w;
114
103
  const g = ((w = e.find((o) => o.id === p)) == null ? void 0 : w.fields.map((o) => o.id)) ?? [], V = new Set(g);
115
104
  if (f) {
116
- const o = g.filter((c) => !i.includes(c));
105
+ const o = g.filter((l) => !i.includes(l));
117
106
  u([...i, ...o]);
118
107
  } else
119
108
  u(i.filter((o) => !V.has(o)));
@@ -126,94 +115,94 @@ function ze(e, { value: d, defaultValue: t, onChange: m } = {}) {
126
115
  const g = (A = x.get(p)) == null ? void 0 : A.sectionId, V = (n = x.get(f)) == null ? void 0 : n.sectionId;
127
116
  if (!g || g !== V) return;
128
117
  const w = new Set(
129
- ((C = e.find((l) => l.id === g)) == null ? void 0 : C.fields.map((l) => l.id)) ?? []
130
- ), o = i.filter((l) => w.has(l)), c = o.indexOf(p), v = o.indexOf(f);
131
- if (c < 0 || v < 0) return;
132
- const [k] = o.splice(c, 1);
133
- o.splice(v, 0, k);
118
+ ((C = e.find((c) => c.id === g)) == null ? void 0 : C.fields.map((c) => c.id)) ?? []
119
+ ), o = i.filter((c) => w.has(c)), l = o.indexOf(p), v = o.indexOf(f);
120
+ if (l < 0 || v < 0) return;
121
+ const [b] = o.splice(l, 1);
122
+ o.splice(v, 0, b);
134
123
  let h = 0;
135
- const E = i.map(
136
- (l) => w.has(l) ? o[h++] : l
124
+ const B = i.map(
125
+ (c) => w.has(c) ? o[h++] : c
137
126
  );
138
- u(E);
127
+ u(B);
139
128
  },
140
129
  [x, e, i, u]
141
- ), B = D(() => {
142
- u(t ?? a);
143
- }, [t, a, u]);
130
+ ), _ = D(() => {
131
+ u(t ?? s);
132
+ }, [t, s, u]);
144
133
  return {
145
134
  visible: i,
146
- catalogueIds: a,
135
+ catalogueIds: s,
147
136
  fieldById: x,
148
137
  setOrder: u,
149
- toggleField: I,
138
+ toggleField: M,
150
139
  toggleSection: L,
151
140
  moveFieldOnto: N,
152
- reset: B
141
+ reset: _
153
142
  };
154
143
  }
155
- function Pe({
144
+ function Le({
156
145
  sections: e,
157
146
  visible: d,
158
147
  onToggleField: t,
159
148
  onToggleSection: m,
160
- onMoveFieldOnto: a,
149
+ onMoveFieldOnto: s,
161
150
  onReset: y,
162
151
  label: S
163
152
  }) {
164
- const { t: i } = z(), x = O(() => new Set(d), [d]), [u, I] = H(null), [L, N] = H(null), [B, p] = H(""), { sectionOfField: f, labelOfField: g } = O(() => {
165
- const c = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
166
- for (const k of e)
167
- for (const h of k.fields)
168
- c.set(h.id, k.id), v.set(h.id, h.label);
169
- return { sectionOfField: c, labelOfField: v };
153
+ const { t: i } = P(), x = O(() => new Set(d), [d]), [u, M] = E(null), [L, N] = E(null), [_, p] = E(""), { sectionOfField: f, labelOfField: g } = O(() => {
154
+ const l = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
155
+ for (const b of e)
156
+ for (const h of b.fields)
157
+ l.set(h.id, b.id), v.set(h.id, h.label);
158
+ return { sectionOfField: l, labelOfField: v };
170
159
  }, [e]), V = u ? f.get(u) : void 0, w = D(() => {
171
- I(null), N(null);
160
+ M(null), N(null);
172
161
  }, []), o = D(
173
- (c, v, k) => {
162
+ (l, v, b) => {
174
163
  p(
175
164
  i("fieldPicker.moved", {
176
- field: g.get(c) ?? "",
165
+ field: g.get(l) ?? "",
177
166
  position: v + 1,
178
- count: k,
167
+ count: b,
179
168
  defaultValue: "Moved {{field}} to position {{position}} of {{count}}"
180
169
  })
181
170
  );
182
171
  },
183
172
  [i, g]
184
173
  );
185
- return /* @__PURE__ */ F(T.Root, { children: [
174
+ return /* @__PURE__ */ I(T.Root, { children: [
186
175
  /* @__PURE__ */ r(T.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
187
- $,
176
+ j,
188
177
  {
189
178
  size: "sm",
190
179
  intent: "outline",
191
- icon: /* @__PURE__ */ r(de, { "aria-hidden": "true" }),
180
+ icon: /* @__PURE__ */ r(Z, { "aria-hidden": "true" }),
192
181
  "aria-label": S ?? i("fieldPicker.trigger", { defaultValue: "Customize fields" }),
193
182
  className: "ds:shrink-0"
194
183
  }
195
184
  ) }),
196
- /* @__PURE__ */ F(T.Content, { align: "end", size: "sm", children: [
185
+ /* @__PURE__ */ I(T.Content, { align: "end", size: "sm", children: [
197
186
  /* @__PURE__ */ r(T.Heading, { children: i("fieldPicker.title", { defaultValue: "Customize fields" }) }),
198
- /* @__PURE__ */ F("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-xs)]", children: [
199
- e.map((c) => {
200
- const v = c.fields.map((n) => n.id), k = v.filter(
187
+ /* @__PURE__ */ I("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-xs)]", children: [
188
+ e.map((l) => {
189
+ const v = l.fields.map((n) => n.id), b = v.filter(
201
190
  (n) => x.has(n)
202
191
  ).length, h = d.filter(
203
192
  (n) => v.includes(n)
204
- ), E = k === 0 ? !1 : k === v.length ? !0 : "indeterminate", A = !!c.heading;
205
- return /* @__PURE__ */ F(
193
+ ), B = b === 0 ? !1 : b === v.length ? !0 : "indeterminate", A = !!l.heading;
194
+ return /* @__PURE__ */ I(
206
195
  "div",
207
196
  {
208
197
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
209
198
  children: [
210
199
  A ? /* @__PURE__ */ r(
211
- j,
200
+ $,
212
201
  {
213
202
  size: "sm",
214
- label: c.heading,
215
- checked: E,
216
- onCheckedChange: (n) => m(c.id, n === !0)
203
+ label: l.heading,
204
+ checked: B,
205
+ onCheckedChange: (n) => m(l.id, n === !0)
217
206
  }
218
207
  ) : null,
219
208
  /* @__PURE__ */ r(
@@ -223,26 +212,26 @@ function Pe({
223
212
  "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)]",
224
213
  A ? "ds:ps-[var(--spacing-md)]" : "ds:ps-0"
225
214
  ].join(" "),
226
- children: c.fields.map((n) => {
227
- const C = x.has(n.id), l = h.indexOf(n.id), b = h.length, q = u === n.id, K = L === n.id && u !== null && u !== n.id && V === c.id;
228
- return /* @__PURE__ */ F(
215
+ children: l.fields.map((n) => {
216
+ const C = x.has(n.id), c = h.indexOf(n.id), k = h.length, q = u === n.id, K = L === n.id && u !== null && u !== n.id && V === l.id;
217
+ return /* @__PURE__ */ I(
229
218
  "li",
230
219
  {
231
220
  ...C ? {
232
221
  draggable: !0,
233
- onDragStart: (s) => {
234
- I(n.id), s.dataTransfer.effectAllowed = "move", s.dataTransfer.setData("text/plain", n.id);
222
+ onDragStart: (a) => {
223
+ M(n.id), a.dataTransfer.effectAllowed = "move", a.dataTransfer.setData("text/plain", n.id);
235
224
  },
236
- onDragOver: (s) => {
237
- u === null || V !== c.id || (s.preventDefault(), s.dataTransfer.dropEffect = "move", N(n.id));
225
+ onDragOver: (a) => {
226
+ u === null || V !== l.id || (a.preventDefault(), a.dataTransfer.dropEffect = "move", N(n.id));
238
227
  },
239
228
  onDragLeave: () => N(
240
- (s) => s === n.id ? null : s
229
+ (a) => a === n.id ? null : a
241
230
  ),
242
- onDrop: (s) => {
243
- s.preventDefault();
244
- const M = s.dataTransfer.getData("text/plain");
245
- M && M !== n.id && f.get(M) === c.id && (a(M, n.id), o(M, l, b)), w();
231
+ onDrop: (a) => {
232
+ a.preventDefault();
233
+ const F = a.dataTransfer.getData("text/plain");
234
+ F && F !== n.id && f.get(F) === l.id && (s(F, n.id), o(F, c, k)), w();
246
235
  },
247
236
  onDragEnd: w
248
237
  } : {},
@@ -253,7 +242,7 @@ function Pe({
253
242
  ].filter(Boolean).join(" "),
254
243
  children: [
255
244
  /* @__PURE__ */ r(
256
- j,
245
+ $,
257
246
  {
258
247
  size: "sm",
259
248
  label: n.label,
@@ -262,40 +251,40 @@ function Pe({
262
251
  }
263
252
  ),
264
253
  C ? /* @__PURE__ */ r(
265
- $,
254
+ j,
266
255
  {
267
256
  size: "sm",
268
257
  intent: "ghost",
269
- icon: /* @__PURE__ */ r(Z, { "aria-hidden": "true" }),
258
+ icon: /* @__PURE__ */ r(ee, { "aria-hidden": "true" }),
270
259
  "aria-label": i("fieldPicker.reorder", {
271
260
  field: n.label,
272
261
  defaultValue: "Reorder {{field}}. Press Alt + Up or Alt + Down to move."
273
262
  }),
274
263
  "aria-keyshortcuts": "Alt+ArrowUp Alt+ArrowDown Alt+Home Alt+End",
275
264
  className: "ds:shrink-0 ds:cursor-grab ds:active:cursor-grabbing",
276
- onKeyDown: (s) => {
277
- if (s.altKey) {
278
- if (s.key === "ArrowUp") {
279
- if (l <= 0) return;
280
- s.preventDefault(), a(
265
+ onKeyDown: (a) => {
266
+ if (a.altKey) {
267
+ if (a.key === "ArrowUp") {
268
+ if (c <= 0) return;
269
+ a.preventDefault(), s(
281
270
  n.id,
282
- h[l - 1]
283
- ), o(n.id, l - 1, b);
284
- } else if (s.key === "ArrowDown") {
285
- if (l >= b - 1) return;
286
- s.preventDefault(), a(
271
+ h[c - 1]
272
+ ), o(n.id, c - 1, k);
273
+ } else if (a.key === "ArrowDown") {
274
+ if (c >= k - 1) return;
275
+ a.preventDefault(), s(
287
276
  n.id,
288
- h[l + 1]
289
- ), o(n.id, l + 1, b);
290
- } else if (s.key === "Home") {
291
- if (l <= 0) return;
292
- s.preventDefault(), a(n.id, h[0]), o(n.id, 0, b);
293
- } else if (s.key === "End") {
294
- if (l >= b - 1) return;
295
- s.preventDefault(), a(
277
+ h[c + 1]
278
+ ), o(n.id, c + 1, k);
279
+ } else if (a.key === "Home") {
280
+ if (c <= 0) return;
281
+ a.preventDefault(), s(n.id, h[0]), o(n.id, 0, k);
282
+ } else if (a.key === "End") {
283
+ if (c >= k - 1) return;
284
+ a.preventDefault(), s(
296
285
  n.id,
297
- h[b - 1]
298
- ), o(n.id, b - 1, b);
286
+ h[k - 1]
287
+ ), o(n.id, k - 1, k);
299
288
  }
300
289
  }
301
290
  }
@@ -310,28 +299,28 @@ function Pe({
310
299
  )
311
300
  ]
312
301
  },
313
- c.id
302
+ l.id
314
303
  );
315
304
  }),
316
305
  /* @__PURE__ */ r(Y, { orientation: "horizontal" }),
317
306
  /* @__PURE__ */ r(W, { type: "button", size: "sm", intent: "ghost", onClick: y, children: i("fieldPicker.reset", { defaultValue: "Reset to defaults" }) })
318
307
  ] }),
319
- /* @__PURE__ */ r("span", { role: "status", className: "ds:sr-only", children: B })
308
+ /* @__PURE__ */ r("span", { role: "status", className: "ds:sr-only", children: _ })
320
309
  ] })
321
310
  ] });
322
311
  }
323
- const R = "ds:text-[color:var(--foreground)]", pe = {
312
+ const R = "ds:text-[color:var(--foreground)]", me = {
324
313
  m: "Male",
325
314
  f: "Female",
326
315
  x: "Other"
327
316
  };
328
- function _({
317
+ function z({
329
318
  icon: e,
330
319
  mono: d,
331
320
  children: t
332
321
  }) {
333
322
  return /* @__PURE__ */ r(
334
- U,
323
+ H,
335
324
  {
336
325
  variant: "neutral",
337
326
  className: d ? "ds:font-mono" : void 0,
@@ -342,26 +331,26 @@ function _({
342
331
  }
343
332
  );
344
333
  }
345
- function fe({ code: e }) {
346
- const { t: d } = z(), t = e.toLowerCase(), m = d(`patientField.sex.${t}`, {
347
- defaultValue: pe[t] ?? e
334
+ function pe({ code: e }) {
335
+ const { t: d } = P(), t = e.toLowerCase(), m = d(`patientField.sex.${t}`, {
336
+ defaultValue: me[t] ?? e
348
337
  });
349
- return t === "f" ? /* @__PURE__ */ r(U, { variant: "accentSoft", leading: /* @__PURE__ */ r(me, {}), children: m }) : t === "m" ? /* @__PURE__ */ r(U, { variant: "info", leading: /* @__PURE__ */ r(ce, {}), children: m }) : /* @__PURE__ */ r(_, { icon: /* @__PURE__ */ r(se, {}), children: m });
338
+ return t === "f" ? /* @__PURE__ */ r(H, { variant: "accentSoft", leading: /* @__PURE__ */ r(ue, {}), children: m }) : t === "m" ? /* @__PURE__ */ r(H, { variant: "info", leading: /* @__PURE__ */ r(ce, {}), children: m }) : /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(se, {}), children: m });
350
339
  }
351
- function ge({ years: e }) {
352
- const { t: d } = z();
353
- return /* @__PURE__ */ r(_, { icon: /* @__PURE__ */ r(ie, {}), children: d("patientField.age", {
340
+ function fe({ years: e }) {
341
+ const { t: d } = P();
342
+ return /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(oe, {}), children: d("patientField.age", {
354
343
  count: e,
355
344
  defaultValue: "{{count}} years old"
356
345
  }) });
357
346
  }
358
- function Le({ field: e }) {
359
- const { i18n: d } = z();
347
+ function _e({ field: e }) {
348
+ const { i18n: d } = P();
360
349
  if (e.kind === "email" || e.kind === "phone") {
361
350
  const t = typeof e.value == "string" ? e.value : e.copyText ?? (typeof e.editValue == "string" ? e.editValue : "");
362
351
  if (t) {
363
352
  const m = e.kind === "email" ? `mailto:${t.trim()}` : `tel:${t.replace(/[^+\d]/g, "")}`;
364
- return /* @__PURE__ */ r(ee, { href: m, children: t });
353
+ return /* @__PURE__ */ r(te, { href: m, children: t });
365
354
  }
366
355
  }
367
356
  if (e.value != null)
@@ -370,27 +359,27 @@ function Le({ field: e }) {
370
359
  return null;
371
360
  switch (e.kind) {
372
361
  case "sex":
373
- return /* @__PURE__ */ r(fe, { code: String(e.editValue ?? "") });
362
+ return /* @__PURE__ */ r(pe, { code: String(e.editValue ?? "") });
374
363
  case "age": {
375
364
  const t = typeof e.editValue == "number" ? e.editValue : Number(e.editValue);
376
- return Number.isFinite(t) ? /* @__PURE__ */ r(ge, { years: t }) : null;
365
+ return Number.isFinite(t) ? /* @__PURE__ */ r(fe, { years: t }) : null;
377
366
  }
378
367
  case "dob": {
379
- const t = e.editValue, m = t instanceof Date ? t : new Date(String(t ?? "")), a = Number.isNaN(m.getTime()) ? String(t ?? "") : new Intl.DateTimeFormat(d.language, {
368
+ const t = e.editValue, m = t instanceof Date ? t : new Date(String(t ?? "")), s = Number.isNaN(m.getTime()) ? String(t ?? "") : new Intl.DateTimeFormat(d.language, {
380
369
  day: "numeric",
381
370
  month: "short",
382
371
  year: "numeric"
383
372
  }).format(m);
384
- return a ? /* @__PURE__ */ r(_, { icon: /* @__PURE__ */ r(re, {}), children: a }) : null;
373
+ return s ? /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(ae, {}), children: s }) : null;
385
374
  }
386
375
  case "fiscalCode": {
387
376
  const t = e.copyText ?? (typeof e.editValue == "string" ? e.editValue : "");
388
- return t ? /* @__PURE__ */ r(_, { icon: /* @__PURE__ */ r(ne, {}), mono: !0, children: t }) : null;
377
+ return t ? /* @__PURE__ */ r(z, { icon: /* @__PURE__ */ r(re, {}), mono: !0, children: t }) : null;
389
378
  }
390
379
  case "discount": {
391
380
  const t = typeof e.editValue == "number" ? e.editValue : Number(e.editValue);
392
381
  return Number.isFinite(t) ? /* @__PURE__ */ r(
393
- te,
382
+ ne,
394
383
  {
395
384
  state: "discount",
396
385
  amount: Math.abs(t),
@@ -404,12 +393,12 @@ function Le({ field: e }) {
404
393
  }
405
394
  }
406
395
  export {
407
- ge as A,
408
- Pe as F,
409
- _ as N,
410
- fe as S,
411
- Le as a,
412
- _e as r,
413
- ze as u
396
+ fe as A,
397
+ Le as F,
398
+ z as N,
399
+ pe as S,
400
+ _e as a,
401
+ ze as r,
402
+ Pe as u
414
403
  };
415
- //# sourceMappingURL=field-value-DHG6gEKS.js.map
404
+ //# sourceMappingURL=field-value-BRVbZJej.js.map