@alfadocs/ui-kit 0.82.0 → 0.83.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 (79) hide show
  1. package/dist/_chunks/{actions-cell-renderer-DLrcSTK_.js → actions-cell-renderer-DaL80uqL.js} +2 -2
  2. package/dist/_chunks/chart-GFLv4cXm.js +609 -0
  3. package/dist/_chunks/{editable-currency-cell-renderer-GwfA9tTR.js → editable-currency-cell-renderer-Dus_sBvX.js} +2 -2
  4. package/dist/_chunks/{face-scheme-C0rk21gg.js → face-scheme-CjQAHvSP.js} +2 -2
  5. package/dist/_chunks/{file-manager-DfTG7bxx.js → file-manager-DLJlinIO.js} +3 -3
  6. package/dist/_chunks/{header-settings-DMfdx0Vq.js → header-settings-CLwFqMHI.js} +2 -2
  7. package/dist/_chunks/{icon-button-group-C_lqXTAj.js → icon-button-group-BLHPN6jg.js} +178 -163
  8. package/dist/_chunks/{marketplace-app-shell-Bxq1PYAj.js → marketplace-app-shell-Br2yebEK.js} +2 -2
  9. package/dist/_chunks/{patient-table-DweKjiXg.js → patient-table-BHzmUbzu.js} +2 -2
  10. package/dist/_chunks/{theme-toggle-BJCz_UOi.js → theme-toggle-B4mOrQX1.js} +2 -2
  11. package/dist/agent-catalog.json +57 -4
  12. package/dist/agent-i18n/en.json +7 -1
  13. package/dist/components/chart/chart.d.ts +36 -1
  14. package/dist/components/chart/index.js +1 -1
  15. package/dist/components/data-table/index.js +2 -2
  16. package/dist/components/face-scheme/index.js +1 -1
  17. package/dist/components/file-manager/index.js +1 -1
  18. package/dist/components/header-settings/index.js +1 -1
  19. package/dist/components/icon-button-group/index.js +1 -1
  20. package/dist/components/patient-table/index.js +1 -1
  21. package/dist/components/theme-toggle/index.js +1 -1
  22. package/dist/i18n/locales/ar.d.ts +8 -0
  23. package/dist/i18n/locales/ar.js +8 -0
  24. package/dist/i18n/locales/de.d.ts +8 -0
  25. package/dist/i18n/locales/de.js +8 -0
  26. package/dist/i18n/locales/el.d.ts +8 -0
  27. package/dist/i18n/locales/el.js +8 -0
  28. package/dist/i18n/locales/en.d.ts +8 -0
  29. package/dist/i18n/locales/en.js +8 -0
  30. package/dist/i18n/locales/es.d.ts +8 -0
  31. package/dist/i18n/locales/es.js +8 -0
  32. package/dist/i18n/locales/fr.d.ts +8 -0
  33. package/dist/i18n/locales/fr.js +8 -0
  34. package/dist/i18n/locales/hi.d.ts +8 -0
  35. package/dist/i18n/locales/hi.js +8 -0
  36. package/dist/i18n/locales/it.d.ts +8 -0
  37. package/dist/i18n/locales/it.js +8 -0
  38. package/dist/i18n/locales/ja.d.ts +8 -0
  39. package/dist/i18n/locales/ja.js +8 -0
  40. package/dist/i18n/locales/nl.d.ts +8 -0
  41. package/dist/i18n/locales/nl.js +8 -0
  42. package/dist/i18n/locales/pl.d.ts +8 -0
  43. package/dist/i18n/locales/pl.js +8 -0
  44. package/dist/i18n/locales/pt.d.ts +8 -0
  45. package/dist/i18n/locales/pt.js +8 -0
  46. package/dist/i18n/locales/ro.d.ts +8 -0
  47. package/dist/i18n/locales/ro.js +8 -0
  48. package/dist/i18n/locales/ru.d.ts +8 -0
  49. package/dist/i18n/locales/ru.js +8 -0
  50. package/dist/i18n/locales/sq.d.ts +8 -0
  51. package/dist/i18n/locales/sq.js +8 -0
  52. package/dist/i18n/locales/sv.d.ts +8 -0
  53. package/dist/i18n/locales/sv.js +8 -0
  54. package/dist/i18n/locales/tr.d.ts +8 -0
  55. package/dist/i18n/locales/tr.js +8 -0
  56. package/dist/i18n/locales/zh.d.ts +8 -0
  57. package/dist/i18n/locales/zh.js +8 -0
  58. package/dist/index.js +9 -9
  59. package/dist/locales/ar.json +8 -0
  60. package/dist/locales/de.json +8 -0
  61. package/dist/locales/el.json +8 -0
  62. package/dist/locales/en.json +8 -0
  63. package/dist/locales/es.json +8 -0
  64. package/dist/locales/fr.json +8 -0
  65. package/dist/locales/hi.json +8 -0
  66. package/dist/locales/it.json +8 -0
  67. package/dist/locales/ja.json +8 -0
  68. package/dist/locales/nl.json +8 -0
  69. package/dist/locales/pl.json +8 -0
  70. package/dist/locales/pt.json +8 -0
  71. package/dist/locales/ro.json +8 -0
  72. package/dist/locales/ru.json +8 -0
  73. package/dist/locales/sq.json +8 -0
  74. package/dist/locales/sv.json +8 -0
  75. package/dist/locales/tr.json +8 -0
  76. package/dist/locales/zh.json +8 -0
  77. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  78. package/package.json +1 -1
  79. package/dist/_chunks/chart-CpkpA74k.js +0 -374
@@ -1,374 +0,0 @@
1
- import { jsxs as S, jsx as d } from "react/jsx-runtime";
2
- import { forwardRef as et, useId as rt, useMemo as c, useRef as at, useState as U, useEffect as k, useImperativeHandle as ot } from "react";
3
- import { c as nt } from "./index-D2ZczOXr.js";
4
- import { useTranslation as it } from "react-i18next";
5
- import st from "react-apexcharts";
6
- import H from "apexcharts";
7
- import { u as ct, g as _ } from "./apexcharts-theme-BJigns_V.js";
8
- import { u as dt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
- import { u as lt } from "./registry-DvAUVLHh.js";
10
- const mt = {
11
- id: "chart",
12
- capabilities: [],
13
- state: {},
14
- actions: {
15
- update_series: {
16
- // Replacing the rendered series mutates what the chart displays — it
17
- // is a write, reversible by pushing the prior series back.
18
- safety: "write",
19
- argsType: "series",
20
- // `series` is `ChartSeries[]` (line/bar/area) OR `number[]`
21
- // (pie/donut/radialBar). Both shapes are accepted; the handle routes
22
- // by chart type internally.
23
- argsSchema: {
24
- type: "object",
25
- properties: {
26
- series: {
27
- oneOf: [
28
- {
29
- type: "array",
30
- description: "Categorical series for line / bar / area charts.",
31
- items: {
32
- type: "object",
33
- properties: {
34
- name: { type: "string" },
35
- data: { type: "array", items: { type: "number" } }
36
- },
37
- required: ["name", "data"]
38
- }
39
- },
40
- {
41
- type: "array",
42
- description: "Flat values for pie / donut / radialBar charts.",
43
- items: { type: "number" }
44
- }
45
- ]
46
- }
47
- },
48
- required: ["series"]
49
- },
50
- idempotent: !0,
51
- descriptionKey: "ui.agent.chart.actions.updateSeries",
52
- description: "Replace the chart series without remounting.",
53
- invoke: (o, l) => {
54
- o.updateSeries(l.series);
55
- }
56
- },
57
- export_png: {
58
- safety: "read",
59
- returns: "string (PNG data URI)",
60
- returnsSchema: {
61
- type: "string",
62
- description: "A `data:image/png;base64,…` URI of the rendered chart."
63
- },
64
- idempotent: !0,
65
- descriptionKey: "ui.agent.chart.actions.exportPng",
66
- description: "Return a PNG data URI of the chart for export or screenshotting.",
67
- invoke: (o) => o.dataURI()
68
- }
69
- },
70
- domHooks: {
71
- root: { attr: "data-component", value: "chart" },
72
- instanceId: {
73
- attr: "data-component-id",
74
- sourceProp: "id",
75
- description: "Sourced from the id prop."
76
- }
77
- }
78
- }, ut = nt("ds:relative ds:block ds:w-full", {
79
- variants: {
80
- density: {
81
- compact: "ds:min-h-[var(--chart-min-height-compact)]",
82
- comfortable: "ds:min-h-[var(--chart-min-height-comfortable)]",
83
- // Applied when an explicit `height` prop is given and no density was
84
- // requested: the wrapper must not exceed the caller's height (a 96px
85
- // KPI chart inside a card must not reserve 320px).
86
- none: ""
87
- }
88
- },
89
- defaultVariants: { density: "comfortable" }
90
- }), pt = [
91
- "verticalLines",
92
- "horizontalLines",
93
- "slantedLines",
94
- "squares",
95
- "circles"
96
- ], ht = ["line", "bar", "area"], ft = ["pie", "donut", "radialBar"];
97
- function T(o) {
98
- return ft.includes(o);
99
- }
100
- function bt(o) {
101
- return ht.includes(o);
102
- }
103
- function gt(o, l) {
104
- return T(l) ? [
105
- {
106
- name: "",
107
- data: o
108
- }
109
- ] : o;
110
- }
111
- const yt = et(
112
- ({
113
- title: o,
114
- id: l,
115
- type: r,
116
- series: h,
117
- categories: y,
118
- labels: f,
119
- height: O,
120
- width: M,
121
- patterns: A = !1,
122
- colors: v,
123
- toolbar: x = !1,
124
- locale: j,
125
- radialValueFormatter: m,
126
- valueFormatter: N,
127
- density: D,
128
- className: W
129
- }, q) => {
130
- const { t: a, i18n: Y } = it(), P = rt(), u = c(
131
- () => `chart-${P.replace(/[^a-zA-Z0-9-_]/g, "")}`,
132
- [P]
133
- ), R = `${u}-summary`, I = at(null), [z, Z] = U(0);
134
- ct(I);
135
- const p = j ?? Y.language ?? "en", [B, K] = U(
136
- () => {
137
- try {
138
- return _();
139
- } catch {
140
- return {};
141
- }
142
- }
143
- );
144
- k(() => {
145
- if (typeof document > "u") return;
146
- let t;
147
- const e = new MutationObserver(() => {
148
- clearTimeout(t), t = setTimeout(() => {
149
- try {
150
- K(_());
151
- } catch {
152
- }
153
- }, 50);
154
- });
155
- return e.observe(document.documentElement, {
156
- attributes: !0,
157
- attributeFilter: ["class"]
158
- }), () => {
159
- clearTimeout(t), e.disconnect();
160
- };
161
- }, []), k(() => {
162
- const t = I.current;
163
- if (!t || typeof ResizeObserver > "u") return;
164
- const e = new ResizeObserver((n) => {
165
- const i = n[0];
166
- i && Z(Math.floor(i.contentRect.width));
167
- });
168
- return e.observe(t), () => e.disconnect();
169
- }, []);
170
- const C = c(
171
- () => ({
172
- async dataURI() {
173
- const t = H.getChartByID(u);
174
- return t ? (await t.dataURI()).imgURI : "";
175
- },
176
- updateSeries(t) {
177
- const e = H.getChartByID(u);
178
- e && (T(r), e.updateSeries(t));
179
- }
180
- }),
181
- [u, r]
182
- );
183
- ot(q, () => C, [C]), lt(mt, C, l);
184
- const w = typeof document < "u" && document.documentElement.dir === "rtl", E = c(
185
- () => gt(h, r),
186
- [h, r]
187
- ), $ = c(
188
- () => new Intl.NumberFormat(p),
189
- [p]
190
- ), b = c(
191
- () => N ?? ((t) => $.format(t)),
192
- [N, $]
193
- ), G = c(
194
- () => ({
195
- name: p,
196
- options: {
197
- toolbar: {
198
- download: a("chart.toolbar.download"),
199
- selection: a("chart.toolbar.selection"),
200
- selectionZoom: a("chart.toolbar.selectionZoom"),
201
- zoomIn: a("chart.toolbar.zoomIn"),
202
- zoomOut: a("chart.toolbar.zoomOut"),
203
- pan: a("chart.toolbar.pan"),
204
- reset: a("chart.toolbar.reset"),
205
- exportToSVG: a("chart.toolbar.exportToSVG"),
206
- exportToPNG: a("chart.toolbar.exportToPNG"),
207
- exportToCSV: a("chart.toolbar.exportToCSV")
208
- }
209
- }
210
- }),
211
- [p, a]
212
- ), L = dt(), V = c(() => {
213
- var n, i, g;
214
- const t = B, e = {
215
- ...t,
216
- chart: {
217
- ...t.chart,
218
- id: u,
219
- toolbar: { show: x },
220
- zoom: { enabled: x },
221
- animations: {
222
- enabled: !L,
223
- dynamicAnimation: { enabled: !L }
224
- },
225
- locales: [G],
226
- defaultLocale: p,
227
- parentHeightOffset: 0
228
- },
229
- // Only set `labels` when the consumer actually supplied them (slice
230
- // charts). Emitting `labels: undefined` crashes ApexCharts' bar
231
- // renderer — `parseDataAxisCharts` reads `labels.length` and throws
232
- // "Cannot read properties of undefined (reading 'length')", which
233
- // aborts the render and leaves a blank chart. Absent is safe; area /
234
- // line tolerate the undefined but bar does not, so never pass it.
235
- ...f ? { labels: f } : {},
236
- legend: {
237
- ...t.legend,
238
- position: "bottom",
239
- // ApexCharts legend.horizontalAlign is a physical prop mapped internally
240
- // to the chart's own text flow. For RTL we flip via `yaxis.opposite`
241
- // and ApexCharts' own `direction: 'rtl'` handling; legend stays anchored
242
- // to the inline-start by asking for 'left' on LTR and 'right' on RTL.
243
- horizontalAlign: w ? "right" : "left",
244
- fontFamily: "inherit"
245
- },
246
- tooltip: {
247
- ...t.tooltip,
248
- y: {
249
- formatter: (s) => b(s)
250
- }
251
- },
252
- noData: {
253
- text: a("chart.noData")
254
- }
255
- };
256
- if (v && v.length > 0 && (e.colors = v), bt(r) && (e.xaxis = {
257
- ...t.xaxis,
258
- categories: y ?? []
259
- }, e.yaxis = {
260
- ...t.yaxis,
261
- opposite: w,
262
- labels: {
263
- formatter: (s) => b(s)
264
- }
265
- }, e.stroke = {
266
- curve: "smooth",
267
- width: r === "bar" ? 0 : 2
268
- }, e.dataLabels = { enabled: !1 }), r === "radialBar" && m) {
269
- const s = t.plotOptions ?? {};
270
- e.plotOptions = {
271
- ...s,
272
- radialBar: {
273
- ...s.radialBar ?? {},
274
- dataLabels: {
275
- ...((n = s.radialBar) == null ? void 0 : n.dataLabels) ?? {},
276
- value: {
277
- ...((g = (i = s.radialBar) == null ? void 0 : i.dataLabels) == null ? void 0 : g.value) ?? {},
278
- formatter: (tt) => m(Number(tt))
279
- }
280
- }
281
- }
282
- };
283
- }
284
- return A ? e.fill = {
285
- type: "pattern",
286
- opacity: r === "area" ? 0.3 : 1,
287
- pattern: {
288
- style: [...pt],
289
- strokeWidth: 2
290
- }
291
- } : r === "area" && (e.fill = {
292
- type: "gradient",
293
- opacity: 0.3
294
- }), e;
295
- }, [
296
- B,
297
- u,
298
- x,
299
- L,
300
- G,
301
- p,
302
- f,
303
- b,
304
- a,
305
- r,
306
- y,
307
- w,
308
- A,
309
- v,
310
- m
311
- ]), F = M ?? (z > 0 ? z : "100%"), J = O ?? 320, Q = c(() => {
312
- const t = T(r) ? f ?? [] : y ?? [], e = E;
313
- return /* @__PURE__ */ S("table", { id: R, className: "ds:sr-only", children: [
314
- /* @__PURE__ */ d("caption", { children: o }),
315
- /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ S("tr", { children: [
316
- /* @__PURE__ */ d("th", { scope: "col", children: a("chart.table.series") }),
317
- t.map((n, i) => /* @__PURE__ */ d("th", { scope: "col", children: n }, `${n}-${i}`))
318
- ] }) }),
319
- /* @__PURE__ */ d("tbody", { children: e.map((n, i) => /* @__PURE__ */ S("tr", { children: [
320
- /* @__PURE__ */ d("th", { scope: "row", children: n.name || a("chart.table.value") }),
321
- n.data.map((g, s) => /* @__PURE__ */ d("td", { children: r === "radialBar" && m ? m(g) : b(g) }, `${i}-${s}`))
322
- ] }, `${n.name}-${i}`)) })
323
- ] });
324
- }, [
325
- r,
326
- E,
327
- f,
328
- y,
329
- R,
330
- o,
331
- a,
332
- b,
333
- m
334
- ]), X = c(() => (T(r), h), [h, r]);
335
- return /* @__PURE__ */ S(
336
- "div",
337
- {
338
- ref: I,
339
- role: "img",
340
- "aria-label": o,
341
- "aria-describedby": R,
342
- className: ut({
343
- // Explicit height wins over the density min-height unless the
344
- // caller also asked for a density explicitly.
345
- density: D ?? (O !== void 0 ? "none" : void 0),
346
- className: W
347
- }),
348
- "data-component": "chart",
349
- "data-component-id": l,
350
- children: [
351
- Q,
352
- /* @__PURE__ */ d(
353
- st,
354
- {
355
- type: r,
356
- series: X,
357
- options: V,
358
- width: F,
359
- height: J,
360
- "aria-hidden": "true"
361
- }
362
- )
363
- ]
364
- }
365
- );
366
- }
367
- );
368
- yt.displayName = "Chart";
369
- export {
370
- yt as C,
371
- ut as a,
372
- mt as c
373
- };
374
- //# sourceMappingURL=chart-CpkpA74k.js.map