@alfadocs/ui-kit 1.147.1 → 1.147.2

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 (81) hide show
  1. package/dist/_chunks/{appointment-details-panel.history-eqPMKmW0.js → appointment-details-panel.history-BxNqcA-r.js} +109 -110
  2. package/dist/_chunks/{calendar-appointment-editor-dialog-sY-k0GGW.js → calendar-appointment-editor-dialog-CoIFwj9g.js} +4 -4
  3. package/dist/_chunks/{calendar-waiting-list-panel-Bm7NAZdk.js → calendar-waiting-list-panel-DuALuqLD.js} +2 -2
  4. package/dist/_chunks/{calendar.sheets-CCvdZF-R.js → calendar.sheets-CueyPkTT.js} +3 -3
  5. package/dist/_chunks/editable-description-BsSjLnSx.js +193 -0
  6. package/dist/_chunks/{editable-description.agent-Bm_LBV2j.js → editable-description.agent-zyyR_hxB.js} +2 -2
  7. package/dist/_chunks/{notes-panel-C9aB1Cma.js → notes-panel-BHMnLbEH.js} +2 -2
  8. package/dist/_chunks/{rich-text-editor-CJXc5GgH.js → rich-text-editor-BAcJq1PO.js} +445 -437
  9. package/dist/_chunks/{use-appointment-details-read-Dod21IxM.js → use-appointment-details-read-CC74Y-r5.js} +417 -422
  10. package/dist/agent-catalog.json +2 -2
  11. package/dist/appointment-editor-panel/index.js +1 -1
  12. package/dist/browser-support.js +1 -1
  13. package/dist/components/appointment-details-panel/appointment-details-panel.history.d.ts +4 -6
  14. package/dist/components/appointment-details-panel/index.js +1 -1
  15. package/dist/components/editable-description/editable-description.d.ts +2 -1
  16. package/dist/components/editable-description/index.js +2 -2
  17. package/dist/components/notes-panel/index.js +1 -1
  18. package/dist/components/rich-text-editor/index.js +1 -1
  19. package/dist/core.css +1 -1
  20. package/dist/find-free-slots-panel/index.js +1 -1
  21. package/dist/i18n/locales/ar.d.ts +0 -1
  22. package/dist/i18n/locales/ar.js +1 -2
  23. package/dist/i18n/locales/de.d.ts +0 -1
  24. package/dist/i18n/locales/de.js +1 -2
  25. package/dist/i18n/locales/el.d.ts +0 -1
  26. package/dist/i18n/locales/el.js +1 -2
  27. package/dist/i18n/locales/en.d.ts +0 -1
  28. package/dist/i18n/locales/en.js +1 -2
  29. package/dist/i18n/locales/es.d.ts +0 -1
  30. package/dist/i18n/locales/es.js +1 -2
  31. package/dist/i18n/locales/fr.d.ts +0 -1
  32. package/dist/i18n/locales/fr.js +1 -2
  33. package/dist/i18n/locales/hi.d.ts +0 -1
  34. package/dist/i18n/locales/hi.js +1 -2
  35. package/dist/i18n/locales/it.d.ts +0 -1
  36. package/dist/i18n/locales/it.js +1 -2
  37. package/dist/i18n/locales/ja.d.ts +0 -1
  38. package/dist/i18n/locales/ja.js +1 -2
  39. package/dist/i18n/locales/nl.d.ts +0 -1
  40. package/dist/i18n/locales/nl.js +1 -2
  41. package/dist/i18n/locales/pl.d.ts +0 -1
  42. package/dist/i18n/locales/pl.js +1 -2
  43. package/dist/i18n/locales/pt.d.ts +0 -1
  44. package/dist/i18n/locales/pt.js +1 -2
  45. package/dist/i18n/locales/ro.d.ts +0 -1
  46. package/dist/i18n/locales/ro.js +1 -2
  47. package/dist/i18n/locales/ru.d.ts +0 -1
  48. package/dist/i18n/locales/ru.js +1 -2
  49. package/dist/i18n/locales/sq.d.ts +0 -1
  50. package/dist/i18n/locales/sq.js +1 -2
  51. package/dist/i18n/locales/sv.d.ts +0 -1
  52. package/dist/i18n/locales/sv.js +1 -2
  53. package/dist/i18n/locales/tr.d.ts +0 -1
  54. package/dist/i18n/locales/tr.js +1 -2
  55. package/dist/i18n/locales/zh.d.ts +0 -1
  56. package/dist/i18n/locales/zh.js +1 -2
  57. package/dist/index.js +7 -7
  58. package/dist/locales/ar.json +1 -2
  59. package/dist/locales/de.json +1 -2
  60. package/dist/locales/el.json +1 -2
  61. package/dist/locales/en.json +1 -2
  62. package/dist/locales/es.json +1 -2
  63. package/dist/locales/fr.json +1 -2
  64. package/dist/locales/hi.json +1 -2
  65. package/dist/locales/it.json +1 -2
  66. package/dist/locales/ja.json +1 -2
  67. package/dist/locales/nl.json +1 -2
  68. package/dist/locales/pl.json +1 -2
  69. package/dist/locales/pt.json +1 -2
  70. package/dist/locales/ro.json +1 -2
  71. package/dist/locales/ru.json +1 -2
  72. package/dist/locales/sq.json +1 -2
  73. package/dist/locales/sv.json +1 -2
  74. package/dist/locales/tr.json +1 -2
  75. package/dist/locales/zh.json +1 -2
  76. package/dist/online-bookings-panel/index.js +1 -1
  77. package/dist/patterns/calendar/index.js +2 -2
  78. package/dist/tokens.css +1 -1
  79. package/dist/waiting-list-panel/index.js +2 -2
  80. package/package.json +1 -1
  81. package/dist/_chunks/editable-description-BQauSuCG.js +0 -142
@@ -0,0 +1,193 @@
1
+ import { jsx as s, jsxs as o } from "react/jsx-runtime";
2
+ import { forwardRef as H, useState as A, useRef as B, useMemo as q, useCallback as F, useLayoutEffect as G } from "react";
3
+ import { c as l } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as J } from "react-i18next";
5
+ import { B as K } from "./button-Dp4j9ygh.js";
6
+ import { I as Q } from "./icon-button-u9VMQn3x.js";
7
+ import { C as U, S as X } from "./skeleton-tTWJpvAq.js";
8
+ import { P as Y } from "./pencil-B1sKKyuT.js";
9
+ const D = l(
10
+ "ds:flex ds:min-w-0 ds:items-start ds:gap-[var(--spacing-xs)]"
11
+ ), j = l(
12
+ [
13
+ "ds:m-0 ds:flex ds:min-w-0 ds:flex-1 ds:list-none ds:flex-col ds:p-0",
14
+ "ds:gap-[var(--spacing-2xs)]"
15
+ ].join(" ")
16
+ ), Z = ["80%", "60%", "66%"], ee = l(
17
+ "ds:m-0 ds:min-w-0 ds:flex-1 type-body-sm ds:text-[color:var(--muted-foreground)]"
18
+ ), z = l(
19
+ "ds:flex ds:items-start ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[color:var(--foreground)]"
20
+ ), R = l(
21
+ [
22
+ "ds:mt-[var(--spacing-sm)] ds:size-[var(--spacing-xs)] ds:shrink-0 ds:self-start",
23
+ "ds:rounded-[var(--radius-full)] ds:bg-[color:var(--border)]"
24
+ ].join(" ")
25
+ ), te = [
26
+ "ds:min-w-0 ds:[overflow-wrap:anywhere]",
27
+ "ds:data-[clamp]:overflow-hidden ds:data-[clamp]:[display:-webkit-box]",
28
+ "ds:data-[clamp]:[-webkit-box-orient:vertical]",
29
+ "ds:data-[clamp]:[-webkit-line-clamp:var(--editable-description-rows)]"
30
+ ].join(" "), se = H(
31
+ ({
32
+ value: g,
33
+ maxLines: v = 3,
34
+ loading: u = !1,
35
+ onEdit: x,
36
+ editButtonRef: L,
37
+ emptyLabel: M,
38
+ editLabel: I,
39
+ seeMoreLabel: O,
40
+ showLessLabel: T,
41
+ className: y,
42
+ ...w
43
+ }, N) => {
44
+ const { t: c } = J("ui"), [n, V] = A(!1), k = B(!1);
45
+ u && (k.current = !0);
46
+ const $ = k.current ? U : "", r = q(
47
+ () => (g ?? "").split(/\r?\n/).map((e) => e.trim()).filter(Boolean),
48
+ [g]
49
+ ), h = Math.max(1, v), b = B(null), [P, W] = A(r.length > h), m = F(() => {
50
+ const e = b.current;
51
+ if (!e) return;
52
+ const a = Array.from(
53
+ e.querySelectorAll("[data-editable-description-line]")
54
+ ), d = a.map((t) => t.lastElementChild);
55
+ for (const t of a) t.removeAttribute("data-hidden");
56
+ for (const t of d)
57
+ t.removeAttribute("data-clamp"), t.style.removeProperty("--editable-description-rows");
58
+ let i = h, p = !1;
59
+ a.forEach((t, _) => {
60
+ const f = d[_], E = parseFloat(getComputedStyle(f).lineHeight), S = E > 0 ? Math.max(
61
+ 1,
62
+ Math.round(f.getBoundingClientRect().height / E)
63
+ ) : 1;
64
+ if (i <= 0) {
65
+ p = !0, n || t.setAttribute("data-hidden", "");
66
+ return;
67
+ }
68
+ if (S > i) {
69
+ p = !0, n || (f.setAttribute("data-clamp", ""), f.style.setProperty(
70
+ "--editable-description-rows",
71
+ String(i)
72
+ )), i = 0;
73
+ return;
74
+ }
75
+ i -= S;
76
+ }), W((t) => t === p ? t : p);
77
+ }, [n, h]);
78
+ G(() => {
79
+ var i;
80
+ const e = b.current;
81
+ if (!e || (m(), typeof ResizeObserver > "u")) return;
82
+ let a = e.clientWidth;
83
+ const d = new ResizeObserver(() => {
84
+ e.clientWidth !== a && (a = e.clientWidth, m());
85
+ });
86
+ return d.observe(e), (i = document.fonts) == null || i.ready.then(m), () => d.disconnect();
87
+ }, [m, r]);
88
+ const C = I ?? c("editableDescription.edit");
89
+ return u && r.length === 0 ? /* @__PURE__ */ s(
90
+ "div",
91
+ {
92
+ ...w,
93
+ ref: N,
94
+ "data-component": "editable-description",
95
+ "data-loading": "",
96
+ "aria-busy": "true",
97
+ className: [D(), y].filter(Boolean).join(" "),
98
+ children: /* @__PURE__ */ s("ul", { "aria-hidden": "true", className: j(), children: Z.slice(0, Math.max(1, v)).map(
99
+ (e, a) => /* @__PURE__ */ o("li", { className: z(), children: [
100
+ /* @__PURE__ */ s("span", { className: R() }),
101
+ /* @__PURE__ */ s(
102
+ X,
103
+ {
104
+ variant: "text",
105
+ size: "sm",
106
+ stagger: a,
107
+ width: e,
108
+ className: "ds:mt-[var(--spacing-xs)]"
109
+ }
110
+ )
111
+ ] }, e)
112
+ ) })
113
+ }
114
+ ) : /* @__PURE__ */ o(
115
+ "div",
116
+ {
117
+ ...w,
118
+ ref: N,
119
+ "data-component": "editable-description",
120
+ "data-empty": r.length === 0 ? "" : void 0,
121
+ "aria-busy": u || void 0,
122
+ className: [D(), y].filter(Boolean).join(" "),
123
+ children: [
124
+ r.length === 0 ? /* @__PURE__ */ s("p", { "data-editable-description-empty": "", className: ee(), children: M ?? c("editableDescription.empty") }) : /* @__PURE__ */ o(
125
+ "ul",
126
+ {
127
+ ref: b,
128
+ className: `${j()} ${$}`.trim(),
129
+ children: [
130
+ r.map((e, a) => /* @__PURE__ */ o(
131
+ "li",
132
+ {
133
+ "data-editable-description-line": "",
134
+ className: `${z()} ds:data-[hidden]:hidden`,
135
+ children: [
136
+ /* @__PURE__ */ s("span", { "aria-hidden": "true", className: R() }),
137
+ /* @__PURE__ */ s("span", { className: te, children: e })
138
+ ]
139
+ },
140
+ `${a}-${e}`
141
+ )),
142
+ P ? (
143
+ // An ITEM of the list, aligned with the text rather than the
144
+ // dots, so opening it does not shift the column.
145
+ /* @__PURE__ */ o("li", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-xs)]", children: [
146
+ /* @__PURE__ */ s(
147
+ "span",
148
+ {
149
+ "aria-hidden": "true",
150
+ className: "ds:size-[var(--spacing-xs)] ds:shrink-0"
151
+ }
152
+ ),
153
+ /* @__PURE__ */ s(
154
+ K,
155
+ {
156
+ intent: "link",
157
+ size: "sm",
158
+ "data-editable-description-toggle": "",
159
+ className: "ds:!ps-0 ds:!pe-0",
160
+ "aria-expanded": n,
161
+ onClick: () => V((e) => !e),
162
+ children: n ? T ?? c("editableDescription.showLess") : O ?? c("editableDescription.seeMore")
163
+ }
164
+ )
165
+ ] })
166
+ ) : null
167
+ ]
168
+ }
169
+ ),
170
+ x ? /* @__PURE__ */ s(
171
+ Q,
172
+ {
173
+ ref: L,
174
+ icon: /* @__PURE__ */ s(Y, { "aria-hidden": "true" }),
175
+ intent: "ghost",
176
+ size: "sm",
177
+ className: "ds:-mt-[var(--spacing-sm)] ds:shrink-0",
178
+ "aria-label": C,
179
+ tooltip: C,
180
+ "data-editable-description-edit": "",
181
+ onClick: x
182
+ }
183
+ ) : null
184
+ ]
185
+ }
186
+ );
187
+ }
188
+ );
189
+ se.displayName = "EditableDescription";
190
+ export {
191
+ se as E
192
+ };
193
+ //# sourceMappingURL=editable-description-BsSjLnSx.js.map
@@ -11,11 +11,11 @@ const e = {
11
11
  },
12
12
  item: {
13
13
  attr: "data-editable-description-line",
14
- description: "One visible description line."
14
+ description: "One description line. While collapsed, a line past the row limit is hidden and carries `data-hidden`."
15
15
  }
16
16
  }
17
17
  };
18
18
  export {
19
19
  e
20
20
  };
21
- //# sourceMappingURL=editable-description.agent-Bm_LBV2j.js.map
21
+ //# sourceMappingURL=editable-description.agent-zyyR_hxB.js.map
@@ -6,7 +6,7 @@ import { g as vt } from "./get-error-message-DbFUzuja.js";
6
6
  import { h as Nt } from "./handled-rejection-C-6Dq0As.js";
7
7
  import { u as Hn } from "./registry-DvAUVLHh.js";
8
8
  import { C as Mn } from "./clinical-note-card-D-9xmRpf.js";
9
- import { R as Wn } from "./rich-text-editor-CJXc5GgH.js";
9
+ import { R as Wn } from "./rich-text-editor-BAcJq1PO.js";
10
10
  import { T as $n } from "./text-area-COMVJ1yE.js";
11
11
  import { A as L } from "./alert-C4WKViaS.js";
12
12
  import { B as ne } from "./button-Dp4j9ygh.js";
@@ -1113,4 +1113,4 @@ const qr = _n(
1113
1113
  export {
1114
1114
  qr as N
1115
1115
  };
1116
- //# sourceMappingURL=notes-panel-C9aB1Cma.js.map
1116
+ //# sourceMappingURL=notes-panel-BHMnLbEH.js.map