@alfadocs/ui-kit 1.46.0 → 1.47.1

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 (101) hide show
  1. package/dist/_chunks/booking-C4MwImkS.js +3362 -0
  2. package/dist/_chunks/calendar-workspace-BmscntRR.js +12528 -0
  3. package/dist/_chunks/control-room-rail-CdBOXIqX.js +366 -0
  4. package/dist/_chunks/{freemium-paywall-Cz-O9lQD.js → freemium-paywall-BaW5ODc9.js} +2 -2
  5. package/dist/_chunks/{patient-details-DUj1htsH.js → patient-details-yrgkSeEY.js} +2 -2
  6. package/dist/_chunks/{patient-field-row-CO0WR7yA.js → patient-field-row-DCMkFGqI.js} +2 -2
  7. package/dist/_chunks/{patient-summary-card-DNzdYjxE.js → patient-summary-card-CmEFflGS.js} +2 -2
  8. package/dist/_chunks/payment-form-DqJFiplX.js +881 -0
  9. package/dist/_chunks/{phone-input-BsZIoE36.js → phone-input-IWrGOCwm.js} +40 -39
  10. package/dist/_chunks/{stepper-accordion-DmVykr5F.js → stepper-accordion-jMR8NaOB.js} +2 -1
  11. package/dist/agent-catalog.json +5 -4
  12. package/dist/agent-i18n/en.json +2 -2
  13. package/dist/components/booking/booking-types.d.ts +60 -1
  14. package/dist/components/booking/booking.d.ts +1 -1
  15. package/dist/components/booking/details-form.d.ts +5 -1
  16. package/dist/components/booking/index.d.ts +1 -1
  17. package/dist/components/booking/index.js +1 -1
  18. package/dist/components/booking/payment.d.ts +9 -0
  19. package/dist/components/booking/use-booking-payment.d.ts +14 -0
  20. package/dist/components/control-room-rail/control-room-rail.d.ts +9 -2
  21. package/dist/components/control-room-rail/index.d.ts +1 -1
  22. package/dist/components/control-room-rail/index.js +1 -1
  23. package/dist/components/freemium-paywall/index.js +1 -1
  24. package/dist/components/patient-details/index.js +1 -1
  25. package/dist/components/patient-summary-card/index.js +1 -1
  26. package/dist/components/payment-form/index.d.ts +1 -1
  27. package/dist/components/payment-form/index.js +1 -1
  28. package/dist/components/payment-form/payment-form.d.ts +35 -3
  29. package/dist/components/phone-input/index.js +1 -1
  30. package/dist/components/stepper-accordion/index.js +1 -1
  31. package/dist/i18n/locales/ar.d.ts +36 -1
  32. package/dist/i18n/locales/ar.js +36 -1
  33. package/dist/i18n/locales/de.d.ts +36 -1
  34. package/dist/i18n/locales/de.js +36 -1
  35. package/dist/i18n/locales/el.d.ts +36 -1
  36. package/dist/i18n/locales/el.js +36 -1
  37. package/dist/i18n/locales/en.d.ts +36 -1
  38. package/dist/i18n/locales/en.js +36 -1
  39. package/dist/i18n/locales/es.d.ts +36 -1
  40. package/dist/i18n/locales/es.js +36 -1
  41. package/dist/i18n/locales/fr.d.ts +36 -1
  42. package/dist/i18n/locales/fr.js +36 -1
  43. package/dist/i18n/locales/hi.d.ts +36 -1
  44. package/dist/i18n/locales/hi.js +36 -1
  45. package/dist/i18n/locales/it.d.ts +36 -1
  46. package/dist/i18n/locales/it.js +36 -1
  47. package/dist/i18n/locales/ja.d.ts +36 -1
  48. package/dist/i18n/locales/ja.js +36 -1
  49. package/dist/i18n/locales/nl.d.ts +36 -1
  50. package/dist/i18n/locales/nl.js +36 -1
  51. package/dist/i18n/locales/pl.d.ts +36 -1
  52. package/dist/i18n/locales/pl.js +36 -1
  53. package/dist/i18n/locales/pt.d.ts +36 -1
  54. package/dist/i18n/locales/pt.js +36 -1
  55. package/dist/i18n/locales/ro.d.ts +36 -1
  56. package/dist/i18n/locales/ro.js +36 -1
  57. package/dist/i18n/locales/ru.d.ts +36 -1
  58. package/dist/i18n/locales/ru.js +36 -1
  59. package/dist/i18n/locales/sq.d.ts +36 -1
  60. package/dist/i18n/locales/sq.js +36 -1
  61. package/dist/i18n/locales/sv.d.ts +36 -1
  62. package/dist/i18n/locales/sv.js +36 -1
  63. package/dist/i18n/locales/tr.d.ts +36 -1
  64. package/dist/i18n/locales/tr.js +36 -1
  65. package/dist/i18n/locales/zh.d.ts +36 -1
  66. package/dist/i18n/locales/zh.js +36 -1
  67. package/dist/index.js +9 -9
  68. package/dist/locales/ar.json +36 -1
  69. package/dist/locales/de.json +36 -1
  70. package/dist/locales/el.json +36 -1
  71. package/dist/locales/en.json +36 -1
  72. package/dist/locales/es.json +36 -1
  73. package/dist/locales/fr.json +36 -1
  74. package/dist/locales/hi.json +36 -1
  75. package/dist/locales/it.json +36 -1
  76. package/dist/locales/ja.json +36 -1
  77. package/dist/locales/nl.json +36 -1
  78. package/dist/locales/pl.json +36 -1
  79. package/dist/locales/pt.json +36 -1
  80. package/dist/locales/ro.json +36 -1
  81. package/dist/locales/ru.json +36 -1
  82. package/dist/locales/sq.json +36 -1
  83. package/dist/locales/sv.json +36 -1
  84. package/dist/locales/tr.json +36 -1
  85. package/dist/locales/zh.json +36 -1
  86. package/dist/patterns/calendar/calendar-editor-fields.d.ts +33 -0
  87. package/dist/patterns/calendar/calendar-sticky-offset.d.ts +20 -0
  88. package/dist/patterns/calendar/calendar-workspace.d.ts +88 -0
  89. package/dist/patterns/calendar/calendar.data.d.ts +17 -0
  90. package/dist/patterns/calendar/calendar.journey.d.ts +2 -0
  91. package/dist/patterns/calendar/calendar.sheets.d.ts +2 -0
  92. package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
  93. package/dist/patterns/calendar/calendar.types.d.ts +24 -10
  94. package/dist/patterns/calendar/index.d.ts +1 -1
  95. package/dist/patterns/calendar/index.js +1 -1
  96. package/dist/tokens.css +1 -1
  97. package/package.json +1 -1
  98. package/dist/_chunks/booking-B7gA9gFB.js +0 -3017
  99. package/dist/_chunks/calendar-workspace-BB-BZT7W.js +0 -12251
  100. package/dist/_chunks/control-room-rail-Cv7GpMqX.js +0 -354
  101. package/dist/_chunks/payment-form-BHMDqW9C.js +0 -767
@@ -1,354 +0,0 @@
1
- import { jsx as T, jsxs as U, Fragment as go } from "react/jsx-runtime";
2
- import { useState as E, useCallback as p, useMemo as b, useRef as X, useContext as N, useId as vo, useEffect as ho, createContext as To, forwardRef as bo } from "react";
3
- import { useTranslation as Co } from "react-i18next";
4
- import { I as Y } from "./icon-button-CehAeZoP.js";
5
- import { a as xo } from "./panel-header-D_mTdhUp.js";
6
- import { T as yo } from "./tool-rail-CCFqDfAn.js";
7
- import { u as Z } from "./use-persistent-state-nZwZAnE9.js";
8
- import { S as Ao } from "./star-Bf9L2Uot.js";
9
- import { X as So } from "./x-B5YnXwCz.js";
10
- const wo = {
11
- id: "control-room-rail",
12
- capabilities: ["open", "close", "select_single"],
13
- state: {
14
- activeToolId: {
15
- type: "string | null",
16
- descriptionKey: "ui.toolRail.agent.state.activeToolId",
17
- description: "Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.",
18
- read: (t) => t.getActiveToolId()
19
- }
20
- },
21
- actions: {
22
- open: {
23
- // Pure ephemeral panel state (open) — no data loss, no external effect.
24
- safety: "read",
25
- argsType: "{ id: string }",
26
- argsSchema: {
27
- type: "object",
28
- properties: { id: { type: "string" } },
29
- required: ["id"]
30
- },
31
- idempotent: !0,
32
- descriptionKey: "ui.toolRail.agent.actions.open",
33
- description: "Open the given tool's panel.",
34
- examples: [{ args: { id: "inbox" }, note: "Open the inbox tool panel." }],
35
- invoke: (t, n) => {
36
- t.open(n.id);
37
- }
38
- },
39
- close: {
40
- safety: "read",
41
- idempotent: !0,
42
- descriptionKey: "ui.toolRail.agent.actions.close",
43
- description: "Collapse the rail to its strip (no active tool).",
44
- invoke: (t) => {
45
- t.close();
46
- }
47
- },
48
- select_tool: {
49
- safety: "read",
50
- argsType: "{ id: string | null }",
51
- argsSchema: {
52
- type: "object",
53
- properties: { id: { type: ["string", "null"] } },
54
- required: ["id"]
55
- },
56
- idempotent: !0,
57
- descriptionKey: "ui.toolRail.agent.actions.selectTool",
58
- description: "Set the active tool by id (opens its panel), or pass null to collapse.",
59
- invoke: (t, n) => {
60
- t.setActiveTool(n.id);
61
- }
62
- }
63
- },
64
- domHooks: {
65
- root: {
66
- attr: "data-component",
67
- value: "control-room-rail",
68
- description: "Marks the ControlRoomRail wrapper."
69
- },
70
- instanceId: {
71
- attr: "data-component-id",
72
- sourceProp: "id",
73
- description: "Sourced from the id prop. Required to address a specific rail from the agent."
74
- },
75
- item: {
76
- attr: "data-tool-id",
77
- description: "Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id."
78
- }
79
- }
80
- }, M = To(null);
81
- function Oo({
82
- globalTools: t = [],
83
- children: n
84
- }) {
85
- const [c, s] = E(
86
- () => /* @__PURE__ */ new Map()
87
- ), f = p(
88
- (l, i) => {
89
- s((u) => {
90
- const j = new Map(u);
91
- return j.set(l, i), j;
92
- });
93
- },
94
- []
95
- ), V = p((l) => {
96
- s((i) => {
97
- if (!i.has(l)) return i;
98
- const u = new Map(i);
99
- return u.delete(l), u;
100
- });
101
- }, []), m = b(
102
- () => Array.from(c.values()).flat(),
103
- [c]
104
- ), h = X(null), P = p((l) => {
105
- h.current = l;
106
- }, []), R = p((l) => {
107
- var i;
108
- (i = h.current) == null || i.setActiveTool(l);
109
- }, []), A = p(() => {
110
- var l;
111
- (l = h.current) == null || l.setActiveTool(null);
112
- }, []), C = b(
113
- () => ({
114
- globalTools: t,
115
- contextualTools: m,
116
- registerContextualTools: f,
117
- unregisterContextualTools: V,
118
- registerRail: P,
119
- openTool: R,
120
- closeTool: A
121
- }),
122
- [
123
- t,
124
- m,
125
- f,
126
- V,
127
- P,
128
- R,
129
- A
130
- ]
131
- );
132
- return /* @__PURE__ */ T(M.Provider, { value: C, children: n });
133
- }
134
- function Eo(t) {
135
- const n = N(M), c = n == null ? void 0 : n.registerContextualTools, s = n == null ? void 0 : n.unregisterContextualTools, f = vo();
136
- ho(() => {
137
- if (!(!c || !s))
138
- return c(f, t), () => s(f);
139
- }, [c, s, f, t]);
140
- }
141
- function ko() {
142
- const t = N(M);
143
- return b(() => {
144
- if (!t) return [];
145
- const n = t.contextualTools.map((s) => ({
146
- ...s,
147
- scope: "contextual"
148
- })), c = t.globalTools.map((s) => ({
149
- ...s,
150
- scope: "global"
151
- }));
152
- return [...n, ...c];
153
- }, [t]);
154
- }
155
- function Xo() {
156
- const t = N(M), n = p(() => {
157
- }, []);
158
- return {
159
- openTool: (t == null ? void 0 : t.openTool) ?? n,
160
- closeTool: (t == null ? void 0 : t.closeTool) ?? n
161
- };
162
- }
163
- function Mo() {
164
- const t = N(M), n = p((c) => {
165
- }, []);
166
- return (t == null ? void 0 : t.registerRail) ?? n;
167
- }
168
- const $o = bo(function({
169
- tools: n,
170
- railLabel: c,
171
- reorderable: s = !0,
172
- favoriteIds: f,
173
- defaultFavoriteIds: V,
174
- pinnedFavoriteIds: m,
175
- onFavoriteIdsChange: h,
176
- persistFavoritesKey: P = "ui.controlRoom.favorites",
177
- activeToolId: R,
178
- defaultActiveToolId: A = null,
179
- onActiveToolChange: C,
180
- panelWidth: l,
181
- onPanelWidthChange: i,
182
- persistPanelWidthKey: u,
183
- ...j
184
- }, S) {
185
- const { t: g } = Co(), [F, W] = E(
186
- R ?? A ?? null
187
- ), $ = R !== void 0 ? R : F, I = p(
188
- (o) => {
189
- R === void 0 && W(o), C == null || C(o);
190
- },
191
- [R, C]
192
- ), oo = ko(), x = n ?? oo, _ = f !== void 0, [to, eo] = Z(
193
- P,
194
- () => V ?? x.filter((o) => o.scope === "global").map((o) => o.id),
195
- { disabled: _ }
196
- ), B = _ ? f : to, w = b(() => m != null && m.length ? [
197
- ...m,
198
- ...B.filter((o) => !m.includes(o))
199
- ] : B, [m, B]), H = l !== void 0, [no, D] = Z(u ?? "ui.controlRoom.panelWidth.unused", null, {
200
- disabled: H || !u
201
- }), ro = H ? l : u ? no : void 0, so = p(
202
- (o) => {
203
- !H && u && D(o), i == null || i(o);
204
- },
205
- [
206
- H,
207
- u,
208
- D,
209
- i
210
- ]
211
- ), d = b(() => {
212
- const o = /* @__PURE__ */ new Map();
213
- for (const r of x) o.set(r.id, r);
214
- return o;
215
- }, [x]), k = b(
216
- () => new Set(w.filter((o) => d.has(o))),
217
- [w, d]
218
- ), G = (o) => {
219
- const r = o(w.filter((e) => d.has(e)));
220
- _ || eo((e) => o(e.filter((a) => d.has(a)))), h == null || h(r);
221
- }, J = b(() => {
222
- if (!s) return x;
223
- const o = w.filter((e) => d.has(e)).map((e) => ({
224
- ...d.get(e),
225
- scope: "global",
226
- reorderable: !0
227
- })), r = x.filter((e) => !k.has(e.id)).map((e) => ({
228
- ...e,
229
- scope: "contextual",
230
- reorderable: !0
231
- }));
232
- return [...o, ...r];
233
- }, [s, x, w, d, k]), [lo, io] = E(""), L = X(!1), ao = (o, r) => {
234
- const e = r ? g("controlRoom.pinnedAnnounce", {
235
- tool: o,
236
- defaultValue: "Pinned {{tool}} to favourites"
237
- }) : g("controlRoom.unpinnedAnnounce", {
238
- tool: o,
239
- defaultValue: "Removed {{tool}} from favourites"
240
- });
241
- L.current = !L.current, io(L.current ? e : `${e}​`);
242
- }, co = (o) => {
243
- var r;
244
- ao(((r = d.get(o)) == null ? void 0 : r.label) ?? o, !k.has(o)), G(
245
- (e) => e.includes(o) ? e.filter((a) => a !== o) : [...e, o]
246
- );
247
- }, uo = (o, r) => {
248
- var a;
249
- const e = (a = J[o]) == null ? void 0 : a.id;
250
- e !== void 0 && G((y) => {
251
- const q = y.filter((v) => d.has(v)), z = q.length;
252
- if (o < z) {
253
- if (r >= z) return q.filter((Ro) => Ro !== e);
254
- const v = q.slice();
255
- return v.splice(o, 1), v.splice(r, 0, e), v;
256
- }
257
- if (r <= z) {
258
- const v = q.slice();
259
- return v.splice(Math.min(r, z), 0, e), v;
260
- }
261
- return y;
262
- });
263
- }, po = ({
264
- tool: o,
265
- from: r,
266
- to: e
267
- }) => {
268
- const a = k.size, y = r < a;
269
- return y && e >= a ? g("controlRoom.unpinnedAnnounce", {
270
- tool: o.label,
271
- defaultValue: "Removed {{tool}} from favourites"
272
- }) : !y && e <= a ? g("controlRoom.pinnedAnnounce", {
273
- tool: o.label,
274
- defaultValue: "Pinned {{tool}} to favourites"
275
- }) : y && e < a ? g("controlRoom.reorderAnnounce", {
276
- tool: o.label,
277
- to: e + 1,
278
- total: a,
279
- defaultValue: "{{tool}} moved to position {{to}} of {{total}}"
280
- }) : "";
281
- }, K = X(null), Q = Mo(), fo = p(
282
- (o) => {
283
- K.current = o, Q(o), typeof S == "function" ? S(o) : S && (S.current = o);
284
- },
285
- [Q, S]
286
- ), O = $ != null ? d.get($) ?? null : null, mo = O ? /* @__PURE__ */ U(go, { children: [
287
- s ? (() => {
288
- const o = k.has(O.id);
289
- return /* @__PURE__ */ T(
290
- Y,
291
- {
292
- icon: /* @__PURE__ */ T(
293
- Ao,
294
- {
295
- "aria-hidden": "true",
296
- fill: o ? "currentColor" : "none",
297
- className: o ? "ds:text-[color:var(--accent)]" : void 0
298
- }
299
- ),
300
- intent: "ghost",
301
- size: "sm",
302
- "aria-pressed": o,
303
- "aria-label": g("controlRoom.favorite", {
304
- defaultValue: "Favourite"
305
- }),
306
- onClick: () => co(O.id)
307
- }
308
- );
309
- })() : null,
310
- /* @__PURE__ */ T(
311
- Y,
312
- {
313
- icon: /* @__PURE__ */ T(So, { "aria-hidden": "true" }),
314
- intent: "ghost",
315
- size: "sm",
316
- "aria-label": g("controlRoom.close", { defaultValue: "Close" }),
317
- onClick: () => {
318
- var o;
319
- return (o = K.current) == null ? void 0 : o.close();
320
- }
321
- }
322
- )
323
- ] }) : null;
324
- return /* @__PURE__ */ U(xo, { actions: mo, children: [
325
- /* @__PURE__ */ T(
326
- yo,
327
- {
328
- ref: fo,
329
- dataComponent: "control-room-rail",
330
- agentAdapter: wo,
331
- tools: J,
332
- activeToolId: R,
333
- defaultActiveToolId: A,
334
- onActiveToolChange: I,
335
- panelWidth: ro,
336
- onPanelWidthChange: so,
337
- railLabel: c ?? g("controlRoom.railLabel", { defaultValue: "Control room" }),
338
- onReorder: s ? uo : void 0,
339
- formatReorderAnnouncement: s ? po : void 0,
340
- ...j
341
- }
342
- ),
343
- s ? /* @__PURE__ */ T("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: lo }) : null
344
- ] });
345
- });
346
- export {
347
- Oo as C,
348
- $o as a,
349
- ko as b,
350
- wo as c,
351
- Eo as d,
352
- Xo as u
353
- };
354
- //# sourceMappingURL=control-room-rail-Cv7GpMqX.js.map