@alfadocs/ui-kit 0.21.0 → 0.24.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.
- package/dist/_chunks/{autocomplete-BxfabhZ8.js → autocomplete-C7xq06bP.js} +40 -40
- package/dist/_chunks/editable-currency-cell-renderer-DJB5MxAI.js +2349 -0
- package/dist/_chunks/locale-picker-CYBhgSHR.js +575 -0
- package/dist/_chunks/{patient-shell-DavGODt9.js → patient-shell-B164drIa.js} +40 -55
- package/dist/_chunks/settings-ca2Yi9R8.js +21 -0
- package/dist/_chunks/sun-Eweh5fvi.js +50 -0
- package/dist/_chunks/{theme-toggle-BswYl0Yp.js → theme-toggle-FrotC2VI.js} +85 -127
- package/dist/_chunks/use-locale-BkCIHujH.js +20 -0
- package/dist/_chunks/use-scroll-to-first-error-BrK7dKB_.js +55 -0
- package/dist/_chunks/{whatsapp-button-CtlLwM3M.js → whatsapp-button-DUjlWGKf.js} +26 -25
- package/dist/agent-catalog.json +59 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/data-table/filters/number-filter.d.ts +56 -0
- package/dist/components/data-table/filters/text-filter.d.ts +49 -0
- package/dist/components/data-table/index.d.ts +4 -0
- package/dist/components/data-table/index.js +25 -21
- package/dist/components/header-settings/index.js +205 -0
- package/dist/components/locale-picker/index.js +7 -0
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/whatsapp-button/index.js +1 -1
- package/dist/components/whatsapp-button/whatsapp-button.d.ts +14 -1
- package/dist/fonts/Lexend-VF-latin-ext.woff2 +0 -0
- package/dist/fonts/Lexend-VF-latin.woff2 +0 -0
- package/dist/fonts/Lexend-VF-vietnamese.woff2 +0 -0
- package/dist/fonts/NotoSansArabic-VF-arabic.woff2 +0 -0
- package/dist/fonts/NotoSansDevanagari-VF-devanagari.woff2 +0 -0
- package/dist/hooks/index.js +29 -28
- package/dist/i18n/config.d.ts +1 -1
- package/dist/i18n/config.js +20944 -2110
- package/dist/i18n/locales/ar.d.ts +1225 -0
- package/dist/i18n/locales/de.d.ts +1225 -0
- package/dist/i18n/locales/el.d.ts +1222 -0
- package/dist/i18n/locales/es.d.ts +1222 -0
- package/dist/i18n/locales/fr.d.ts +1222 -0
- package/dist/i18n/locales/hi.d.ts +1222 -0
- package/dist/i18n/locales/ja.d.ts +1222 -0
- package/dist/i18n/locales/nl.d.ts +1222 -0
- package/dist/i18n/locales/pl.d.ts +1222 -0
- package/dist/i18n/locales/pt.d.ts +1223 -0
- package/dist/i18n/locales/ro.d.ts +1222 -0
- package/dist/i18n/locales/ru.d.ts +1222 -0
- package/dist/i18n/locales/sq.d.ts +1222 -0
- package/dist/i18n/locales/sv.d.ts +1222 -0
- package/dist/i18n/locales/tr.d.ts +1222 -0
- package/dist/i18n/locales/zh.d.ts +1222 -0
- package/dist/i18n/resources.d.ts +342 -1040
- package/dist/index.js +512 -507
- package/dist/locales/ar.json +1217 -1
- package/dist/locales/de.json +207 -13
- package/dist/locales/el.json +1217 -0
- package/dist/locales/en.json +147 -3
- package/dist/locales/es.json +1217 -0
- package/dist/locales/fr.json +1217 -0
- package/dist/locales/hi.json +1217 -0
- package/dist/locales/it.json +178 -3
- package/dist/locales/ja.json +1217 -0
- package/dist/locales/nl.json +1217 -0
- package/dist/locales/pl.json +1217 -0
- package/dist/locales/pt.json +1217 -0
- package/dist/locales/ro.json +1217 -0
- package/dist/locales/ru.json +1217 -0
- package/dist/locales/sq.json +1217 -0
- package/dist/locales/sv.json +1217 -0
- package/dist/locales/tr.json +1217 -0
- package/dist/locales/zh.json +1217 -0
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +2 -2
- package/package.json +13 -1
- package/dist/_chunks/editable-currency-cell-renderer-1t42gENX.js +0 -1972
- package/dist/_chunks/use-locale-C5rS3Xon.js +0 -71
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as We, useId as Ye, useState as $, useRef as c, useCallback as D, useEffect as R, useMemo as
|
|
2
|
+
import { forwardRef as We, useId as Ye, useState as $, useRef as c, useCallback as D, useEffect as R, useMemo as G } from "react";
|
|
3
3
|
import { _ as f } from "./index-4xgbg-sn.js";
|
|
4
4
|
import * as T from "@radix-ui/react-popover";
|
|
5
5
|
import { c as A } from "./index-D2ZczOXr.js";
|
|
@@ -166,22 +166,22 @@ const ct = We(
|
|
|
166
166
|
id: z,
|
|
167
167
|
className: Re,
|
|
168
168
|
"aria-label": Y
|
|
169
|
-
},
|
|
170
|
-
const { t:
|
|
169
|
+
}, k) {
|
|
170
|
+
const { t: y, i18n: Ne } = Ze(), x = et(), Ie = Ye(), g = z ?? x.id ?? Ie, Z = `${g}-listbox`, Ee = `${g}-live`, h = !!(x.disabled || ke), _e = !!(x.required || xe), ee = x.invalid, $e = ee ? "error" : Ce ?? "default", De = x.describedBy || void 0, [Te, te] = tt({
|
|
171
171
|
value: he,
|
|
172
172
|
defaultValue: ve ?? "",
|
|
173
173
|
onChange: be
|
|
174
|
-
}), r = Te ?? "", [i, d] = $(!1), [
|
|
174
|
+
}), r = Te ?? "", [i, d] = $(!1), [w, se] = $([]), [V, j] = $(!1), [p, Ae] = $(""), N = c(!1), U = c(null), q = c(r), ne = c(/* @__PURE__ */ new Map()), oe = c(/* @__PURE__ */ new Map()), H = c(null), L = c(null), Fe = D(
|
|
175
175
|
(e) => {
|
|
176
|
-
H.current = e, typeof
|
|
176
|
+
H.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
|
|
177
177
|
},
|
|
178
|
-
[
|
|
178
|
+
[k]
|
|
179
179
|
), ae = Ne.language;
|
|
180
180
|
R(() => {
|
|
181
181
|
const e = /* @__PURE__ */ new Map();
|
|
182
|
-
for (const t of
|
|
182
|
+
for (const t of w) e.set(t.value, t);
|
|
183
183
|
ne.current = e;
|
|
184
|
-
}, [
|
|
184
|
+
}, [w]), R(() => {
|
|
185
185
|
const e = /* @__PURE__ */ new Map();
|
|
186
186
|
if (v) for (const t of v) e.set(t.value, t);
|
|
187
187
|
oe.current = e;
|
|
@@ -199,11 +199,11 @@ const ct = We(
|
|
|
199
199
|
});
|
|
200
200
|
},
|
|
201
201
|
[h, b, l, ae]
|
|
202
|
-
),
|
|
202
|
+
), C = at(Be, F);
|
|
203
203
|
R(() => () => {
|
|
204
204
|
var e;
|
|
205
|
-
|
|
206
|
-
}, [
|
|
205
|
+
C.cancel(), (e = U.current) == null || e.abort();
|
|
206
|
+
}, [C]);
|
|
207
207
|
const m = D(
|
|
208
208
|
(e) => {
|
|
209
209
|
te(e);
|
|
@@ -218,18 +218,18 @@ const ct = We(
|
|
|
218
218
|
},
|
|
219
219
|
[]
|
|
220
220
|
), Me = (e) => {
|
|
221
|
-
m(e), !(h || b) && (i || d(!0), !N.current &&
|
|
221
|
+
m(e), !(h || b) && (i || d(!0), !N.current && C(e));
|
|
222
222
|
}, Pe = (e) => {
|
|
223
223
|
N.current = !0;
|
|
224
224
|
}, ze = (e) => {
|
|
225
225
|
N.current = !1;
|
|
226
226
|
const t = e.currentTarget.value;
|
|
227
|
-
|
|
227
|
+
C(t);
|
|
228
228
|
}, je = (e) => {
|
|
229
|
-
h || b || (d(!0), r &&
|
|
229
|
+
h || b || (d(!0), r && C(r));
|
|
230
230
|
}, Ue = (e) => {
|
|
231
231
|
const t = e.relatedTarget;
|
|
232
|
-
if (!(t &&
|
|
232
|
+
if (!(t && L.current && L.current.contains(t))) {
|
|
233
233
|
if (ye && p) {
|
|
234
234
|
const n = re(p);
|
|
235
235
|
n && (m(n.option.label), u == null || u(n.option));
|
|
@@ -243,7 +243,7 @@ const ct = We(
|
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
245
245
|
if (e.key === "ArrowDown" && !i) {
|
|
246
|
-
e.preventDefault(), d(!0), r &&
|
|
246
|
+
e.preventDefault(), d(!0), r && C(r);
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
249
|
if (e.key === "Tab" && i && p) {
|
|
@@ -254,32 +254,32 @@ const ct = We(
|
|
|
254
254
|
}, ie = (e, t) => {
|
|
255
255
|
var n;
|
|
256
256
|
m(t.label), e === "recent" ? B == null || B(t) : u == null || u(t), d(!1), (n = H.current) == null || n.focus();
|
|
257
|
-
},
|
|
257
|
+
}, O = (e) => {
|
|
258
258
|
e.preventDefault();
|
|
259
|
-
}, I = !!(v && v.length > 0) && r.length === 0, He =
|
|
260
|
-
() => st(
|
|
261
|
-
[
|
|
262
|
-
),
|
|
259
|
+
}, I = !!(v && v.length > 0) && r.length === 0, He = G(
|
|
260
|
+
() => st(w),
|
|
261
|
+
[w]
|
|
262
|
+
), Le = !!M, Oe = !!P || V, Qe = dt({
|
|
263
263
|
size: we,
|
|
264
264
|
tone: $e,
|
|
265
265
|
className: Re
|
|
266
|
-
}),
|
|
266
|
+
}), Ge = G(() => {
|
|
267
267
|
if (!p) return;
|
|
268
268
|
const [e, t] = p.split(":");
|
|
269
269
|
if (!(!t || e !== "recent" && e !== "option"))
|
|
270
270
|
return J(g, e, t);
|
|
271
|
-
}, [p, g]), E =
|
|
271
|
+
}, [p, g]), E = w.length > 0, de = !I && !E && !V && r.length > 0, le = V && !E, Se = I || E || de || le, Q = c(r);
|
|
272
272
|
R(() => {
|
|
273
|
-
|
|
273
|
+
Q.current = r;
|
|
274
274
|
}, [r]);
|
|
275
275
|
const ue = c(i);
|
|
276
276
|
R(() => {
|
|
277
277
|
ue.current = i;
|
|
278
278
|
}, [i]);
|
|
279
|
-
const Ke =
|
|
279
|
+
const Ke = G(
|
|
280
280
|
() => ({
|
|
281
|
-
getValue: () =>
|
|
282
|
-
getQuery: () =>
|
|
281
|
+
getValue: () => Q.current || null,
|
|
282
|
+
getQuery: () => Q.current,
|
|
283
283
|
getIsOpen: () => ue.current,
|
|
284
284
|
setValue: (e) => {
|
|
285
285
|
m(e ?? "");
|
|
@@ -300,7 +300,7 @@ const ct = We(
|
|
|
300
300
|
[m]
|
|
301
301
|
);
|
|
302
302
|
rt(it, Ke, z);
|
|
303
|
-
const Xe =
|
|
303
|
+
const Xe = w.length, Je = V ? y("common.loading", "Loading…") : i && r.length > 0 ? y("inputs.autocomplete.results", {
|
|
304
304
|
count: Xe,
|
|
305
305
|
defaultValue: "{{count}} results"
|
|
306
306
|
}) : "";
|
|
@@ -320,7 +320,7 @@ const ct = We(
|
|
|
320
320
|
/* @__PURE__ */ o(T.Anchor, { asChild: !0, children: /* @__PURE__ */ _(
|
|
321
321
|
"div",
|
|
322
322
|
{
|
|
323
|
-
className:
|
|
323
|
+
className: Qe,
|
|
324
324
|
"data-component": "autocomplete",
|
|
325
325
|
"data-component-id": z,
|
|
326
326
|
"data-disabled": h || void 0,
|
|
@@ -347,12 +347,12 @@ const ct = We(
|
|
|
347
347
|
"aria-autocomplete": "both",
|
|
348
348
|
"aria-expanded": i,
|
|
349
349
|
"aria-controls": i ? Z : void 0,
|
|
350
|
-
"aria-activedescendant":
|
|
350
|
+
"aria-activedescendant": Ge,
|
|
351
351
|
"aria-describedby": De,
|
|
352
352
|
"aria-invalid": ee || void 0,
|
|
353
|
-
"aria-label": Y,
|
|
353
|
+
"aria-label": Y ?? y("inputs.autocomplete.ariaLabel"),
|
|
354
354
|
autoComplete: "off",
|
|
355
|
-
className: lt({ hasStart:
|
|
355
|
+
className: lt({ hasStart: Le, hasEnd: Oe })
|
|
356
356
|
}
|
|
357
357
|
),
|
|
358
358
|
V ? /* @__PURE__ */ o("span", { className: `${X} ds:pe-3`, "aria-hidden": "true", children: /* @__PURE__ */ o(pe, { size: "sm" }) }) : P ? /* @__PURE__ */ o("span", { "aria-hidden": "true", className: `${X} ds:pe-3`, children: P }) : null,
|
|
@@ -373,7 +373,7 @@ const ct = We(
|
|
|
373
373
|
/* @__PURE__ */ o(T.Portal, { forceMount: !0, children: /* @__PURE__ */ o(
|
|
374
374
|
T.Content,
|
|
375
375
|
{
|
|
376
|
-
ref:
|
|
376
|
+
ref: L,
|
|
377
377
|
forceMount: !0,
|
|
378
378
|
hidden: !i,
|
|
379
379
|
side: "bottom",
|
|
@@ -391,7 +391,7 @@ const ct = We(
|
|
|
391
391
|
d(!1);
|
|
392
392
|
},
|
|
393
393
|
onEscapeKeyDown: () => d(!1),
|
|
394
|
-
onMouseDown:
|
|
394
|
+
onMouseDown: O,
|
|
395
395
|
className: ut(),
|
|
396
396
|
children: /* @__PURE__ */ _(
|
|
397
397
|
f.List,
|
|
@@ -402,7 +402,7 @@ const ct = We(
|
|
|
402
402
|
I ? /* @__PURE__ */ o(
|
|
403
403
|
f.Group,
|
|
404
404
|
{
|
|
405
|
-
heading:
|
|
405
|
+
heading: y("inputs.autocomplete.recent", "Recent"),
|
|
406
406
|
className: fe,
|
|
407
407
|
children: (v ?? []).map((e) => /* @__PURE__ */ o(
|
|
408
408
|
f.Item,
|
|
@@ -411,7 +411,7 @@ const ct = We(
|
|
|
411
411
|
value: ge("recent", e.value),
|
|
412
412
|
disabled: e.disabled,
|
|
413
413
|
onSelect: () => ie("recent", e),
|
|
414
|
-
onMouseDown:
|
|
414
|
+
onMouseDown: O,
|
|
415
415
|
className: me(),
|
|
416
416
|
children: e.label
|
|
417
417
|
},
|
|
@@ -419,10 +419,10 @@ const ct = We(
|
|
|
419
419
|
))
|
|
420
420
|
}
|
|
421
421
|
) : null,
|
|
422
|
-
de ? /* @__PURE__ */ o("div", { className: "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", children:
|
|
422
|
+
de ? /* @__PURE__ */ o("div", { className: "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", children: y("inputs.autocomplete.noResults", "No results") }) : null,
|
|
423
423
|
le ? /* @__PURE__ */ _("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", children: [
|
|
424
424
|
/* @__PURE__ */ o(pe, { size: "sm" }),
|
|
425
|
-
/* @__PURE__ */ o("span", { children:
|
|
425
|
+
/* @__PURE__ */ o("span", { children: y("common.loading", "Loading…") })
|
|
426
426
|
] }) : null,
|
|
427
427
|
!I && E ? He.map((e, t) => {
|
|
428
428
|
const n = e.items.map((a) => /* @__PURE__ */ o(
|
|
@@ -432,7 +432,7 @@ const ct = We(
|
|
|
432
432
|
value: ge("option", a.value),
|
|
433
433
|
disabled: a.disabled,
|
|
434
434
|
onSelect: () => ie("option", a),
|
|
435
|
-
onMouseDown:
|
|
435
|
+
onMouseDown: O,
|
|
436
436
|
className: me(),
|
|
437
437
|
children: a.label
|
|
438
438
|
},
|
|
@@ -466,4 +466,4 @@ export {
|
|
|
466
466
|
it as a,
|
|
467
467
|
dt as b
|
|
468
468
|
};
|
|
469
|
-
//# sourceMappingURL=autocomplete-
|
|
469
|
+
//# sourceMappingURL=autocomplete-C7xq06bP.js.map
|