@alfadocs/ui-kit 1.126.0 → 1.127.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 (34) hide show
  1. package/dist/_chunks/{balance-badge-cell-DtxbGJcA.js → balance-badge-cell-BtFge7Y6.js} +3 -3
  2. package/dist/_chunks/{bill-line-table-HrynB7ND.js → bill-line-table-BRxX0Awq.js} +2 -2
  3. package/dist/_chunks/{calendar-appointment-editor-dialog-CiCmsBCH.js → calendar-appointment-editor-dialog-B-zYgCgH.js} +2 -2
  4. package/dist/_chunks/{data-grid-C71BhGDw.js → data-grid-bzvkQ3kc.js} +446 -423
  5. package/dist/_chunks/{data-table-DhYx-hCD.js → data-table-BCfkcPti.js} +2 -2
  6. package/dist/_chunks/{default-tabs-RvCI5uN0.js → default-tabs-yEfqAPuT.js} +3 -3
  7. package/dist/_chunks/{file-manager-DNq-sEsy.js → file-manager-Dpwv0qs-.js} +2 -2
  8. package/dist/_chunks/{heatmap-BurtKmeu.js → heatmap-Ds5DJBUL.js} +2 -2
  9. package/dist/_chunks/{invoice-upload-list-C95s5Q7m.js → invoice-upload-list-CgS_TBuX.js} +12 -12
  10. package/dist/_chunks/{link-cell-renderer-BEaLczk2.js → link-cell-renderer-CC9VHU68.js} +2 -2
  11. package/dist/_chunks/{parts-CcyRkB8t.js → parts-tGzYz0uG.js} +42 -36
  12. package/dist/_chunks/{toolbar-Dznu_Dou.js → toolbar-Co46MEn9.js} +3 -3
  13. package/dist/_chunks/warehouse-load-summary-DkAKXcw0.js +289 -0
  14. package/dist/agent-catalog.json +1 -1
  15. package/dist/browser-support.js +1 -1
  16. package/dist/components/bill-line-table/index.js +1 -1
  17. package/dist/components/bill-table/index.js +1 -1
  18. package/dist/components/data-grid/data-grid.variants.d.ts +3 -1
  19. package/dist/components/data-grid/index.js +2 -2
  20. package/dist/components/data-table/index.js +2 -2
  21. package/dist/components/file-manager/index.js +1 -1
  22. package/dist/components/heatmap/index.js +1 -1
  23. package/dist/components/invoice-upload-list/index.js +1 -1
  24. package/dist/components/patient-table/index.js +1 -1
  25. package/dist/components/warehouse-load-summary/index.js +1 -1
  26. package/dist/components/warehouse-load-summary/types.d.ts +6 -0
  27. package/dist/components/warehouse-load-summary/warehouse-load-summary.d.ts +1 -1
  28. package/dist/core.css +1 -1
  29. package/dist/host-legacy.css +9 -0
  30. package/dist/index.js +12 -12
  31. package/dist/patterns/calendar/index.js +1 -1
  32. package/dist/tokens.css +1 -1
  33. package/package.json +1 -1
  34. package/dist/_chunks/warehouse-load-summary-D88M4Ii7.js +0 -255
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "1.126.0",
3
+ "version": "1.127.0",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -1,255 +0,0 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
- import { useId as A, useRef as _, useEffect as F, useMemo as y } from "react";
3
- import { useTranslation as W } from "react-i18next";
4
- import { u as C } from "./registry-DvAUVLHh.js";
5
- import { A as f } from "./alert-C4WKViaS.js";
6
- import { S as R } from "./stat-WGLdn5Vn.js";
7
- import { a as j } from "./stat-group-CC4-O-Fj.js";
8
- import { W as U, w as k } from "./counts-BXtzNv_G.js";
9
- const H = /* @__PURE__ */ new Set([
10
- "itemsUpdated",
11
- "filesWithErrors"
12
- ]), D = /* @__PURE__ */ new Set([
13
- "invoicesLoaded",
14
- "filesWithErrors"
15
- ]);
16
- function p(a) {
17
- return typeof a == "number" && Number.isFinite(a) && a >= 0;
18
- }
19
- function O(a, t) {
20
- const n = [];
21
- for (const s of U) {
22
- if (t === "invoice" && D.has(s)) continue;
23
- const i = a[s];
24
- if (!p(i)) continue;
25
- const r = Math.trunc(i);
26
- r === 0 && H.has(s) || n.push({ key: s, count: r });
27
- }
28
- return n;
29
- }
30
- function V(a, t, n) {
31
- if (a) return a;
32
- const i = (t.filesWithErrors ?? 0) > 0 || n.length > 0, r = p(t.invoicesLoaded) && t.invoicesLoaded >= 1 || p(t.linesLoaded) && t.linesLoaded >= 1;
33
- return i ? r ? "partial" : "error" : r ? "success" : "unchanged";
34
- }
35
- const $ = {
36
- id: "warehouse-load-summary",
37
- capabilities: [],
38
- state: {
39
- counts: {
40
- type: "Record<string, number>",
41
- description: "The counts shown, by key (invoicesLoaded, itemsCreated, itemsUpdated, linesLoaded, linesAlreadyLoaded, linesSkipped, filesWithErrors). Hidden counts are absent.",
42
- read: (a) => a.getCounts()
43
- },
44
- failedFileIds: {
45
- type: "string[]",
46
- description: "Ids of the failed files listed. File names and error texts are not read.",
47
- read: (a) => a.getFailedFileIds()
48
- }
49
- },
50
- actions: {},
51
- domHooks: {
52
- root: {
53
- attr: "data-component",
54
- value: "warehouse-load-summary",
55
- description: "Marks the summary root."
56
- },
57
- instanceId: {
58
- attr: "data-component-id",
59
- sourceProp: "id",
60
- description: "Sourced from the id prop."
61
- },
62
- item: {
63
- attr: "data-file-id",
64
- description: "Each failed file row emits its id as data-file-id."
65
- }
66
- }
67
- }, B = {
68
- success: "success",
69
- partial: "warning",
70
- error: "error",
71
- unchanged: "info"
72
- }, M = [], S = {
73
- filesWithErrors: "destructive"
74
- };
75
- function te({
76
- counts: a,
77
- scope: t = "batch",
78
- outcome: n,
79
- failedFiles: s = M,
80
- headingLevel: i = 2,
81
- focusOnMount: r = !0,
82
- actions: h,
83
- id: g,
84
- className: E
85
- }) {
86
- const { t: d, i18n: I } = W("ui"), m = I.language, v = A(), L = _(null);
87
- F(() => {
88
- var e;
89
- r && ((e = L.current) == null || e.focus({ preventScroll: !0 }));
90
- }, [r]);
91
- const l = y(() => O(a, t), [a, t]), c = V(n, a, s), x = y(
92
- () => ({
93
- getCounts: () => Object.fromEntries(l.map((e) => [e.key, e.count])),
94
- getFailedFileIds: () => s.map((e) => e.id)
95
- }),
96
- [l, s]
97
- );
98
- C($, x, g);
99
- const N = d(`warehouseLoadSummary.title.${t}.${c}`, {
100
- defaultValue: Y[t][c]
101
- }), T = l.filter((e) => e.count > 0).map((e) => k(d, m, e.key, e.count)), w = G(T, m);
102
- return /* @__PURE__ */ u(
103
- "div",
104
- {
105
- "data-component": "warehouse-load-summary",
106
- "data-component-id": g,
107
- "data-outcome": c,
108
- className: ["ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", E].filter(Boolean).join(" "),
109
- children: [
110
- /* @__PURE__ */ u(
111
- f,
112
- {
113
- variant: B[c],
114
- announce: r ? "off" : "polite",
115
- children: [
116
- /* @__PURE__ */ o(
117
- f.Title,
118
- {
119
- ref: L,
120
- tabIndex: -1,
121
- className: "ds:outline-none",
122
- as: `h${i}`,
123
- children: N
124
- }
125
- ),
126
- w ? /* @__PURE__ */ o(f.Description, { children: w }) : null
127
- ]
128
- }
129
- ),
130
- l.length > 0 ? /* @__PURE__ */ o(
131
- j,
132
- {
133
- "aria-label": d("warehouseLoadSummary.counts", {
134
- defaultValue: "Load counts"
135
- }),
136
- maxColumns: 4,
137
- children: l.map(({ key: e, count: b }) => /* @__PURE__ */ o(
138
- R,
139
- {
140
- variant: "outlined",
141
- size: "sm",
142
- label: d(`warehouseLoadSummary.stat.${e}`, {
143
- defaultValue: z[e]
144
- }),
145
- value: b,
146
- locale: m,
147
- intent: b > 0 && e in S ? S[e] : "foreground"
148
- },
149
- e
150
- ))
151
- }
152
- ) : null,
153
- s.length > 0 ? /* @__PURE__ */ u(
154
- "div",
155
- {
156
- role: "group",
157
- "aria-labelledby": v,
158
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
159
- children: [
160
- /* @__PURE__ */ o(
161
- K,
162
- {
163
- as: `h${Math.min(i + 1, 6)}`,
164
- id: v,
165
- children: d("warehouseLoadSummary.failedFiles", {
166
- defaultValue: "Files that could not be loaded"
167
- })
168
- }
169
- ),
170
- /* @__PURE__ */ o(
171
- "ul",
172
- {
173
- role: "list",
174
- className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-xs)] ds:p-0",
175
- children: s.map((e) => /* @__PURE__ */ u(
176
- "li",
177
- {
178
- "data-file-id": e.id,
179
- className: "ds:flex ds:flex-col ds:break-words ds:border-s-[length:var(--border-width-md)] ds:border-s-[color:var(--destructive)] ds:ps-[var(--spacing-sm)]",
180
- children: [
181
- /* @__PURE__ */ o(
182
- "span",
183
- {
184
- dir: "auto",
185
- className: "type-label ds:text-[var(--foreground)]",
186
- children: e.fileName
187
- }
188
- ),
189
- /* @__PURE__ */ o(
190
- "span",
191
- {
192
- dir: "auto",
193
- className: "type-meta ds:text-[var(--muted-foreground)]",
194
- children: e.error
195
- }
196
- )
197
- ]
198
- },
199
- e.id
200
- ))
201
- }
202
- )
203
- ]
204
- }
205
- ) : null,
206
- h ? /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-wrap ds:justify-end ds:gap-[var(--spacing-sm)]", children: h }) : null
207
- ]
208
- }
209
- );
210
- }
211
- const Y = {
212
- invoice: {
213
- success: "Invoice loaded",
214
- partial: "Invoice loaded with warnings",
215
- error: "The invoice could not be loaded",
216
- unchanged: "Nothing new to load"
217
- },
218
- batch: {
219
- success: "Invoices loaded",
220
- partial: "Invoices loaded, some files failed",
221
- error: "No invoices were loaded",
222
- unchanged: "Nothing new to load"
223
- }
224
- }, z = {
225
- invoicesLoaded: "Invoices loaded",
226
- itemsCreated: "Items created",
227
- itemsUpdated: "Items updated",
228
- linesLoaded: "Lines loaded",
229
- linesAlreadyLoaded: "Lines already loaded",
230
- linesSkipped: "Lines skipped",
231
- filesWithErrors: "Files with errors"
232
- };
233
- function G(a, t) {
234
- if (a.length === 0) return "";
235
- try {
236
- return new Intl.ListFormat(t, {
237
- style: "long",
238
- type: "conjunction"
239
- }).format(a);
240
- } catch {
241
- return a.join(", ");
242
- }
243
- }
244
- function K({
245
- as: a,
246
- id: t,
247
- children: n
248
- }) {
249
- return /* @__PURE__ */ o(a, { id: t, className: "type-label ds:m-0 ds:text-[var(--foreground)]", children: n });
250
- }
251
- export {
252
- te as W,
253
- $ as w
254
- };
255
- //# sourceMappingURL=warehouse-load-summary-D88M4Ii7.js.map