@yenio-pld/blocks 1.2.0-rc.15 → 1.2.0-rc.17
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/index.cjs +294 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.js +294 -116
- package/dist/index.js.map +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -179,6 +179,32 @@ function avatarFallbackStyle(name) {
|
|
|
179
179
|
function cn(...inputs) {
|
|
180
180
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
181
181
|
}
|
|
182
|
+
var SIZE_CLASS = {
|
|
183
|
+
sm: "max-w-[140px]",
|
|
184
|
+
md: "max-w-[220px]",
|
|
185
|
+
lg: "max-w-[280px]"
|
|
186
|
+
};
|
|
187
|
+
function ProductIllustration({
|
|
188
|
+
src,
|
|
189
|
+
alt = "",
|
|
190
|
+
className,
|
|
191
|
+
size = "md"
|
|
192
|
+
}) {
|
|
193
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
194
|
+
"img",
|
|
195
|
+
{
|
|
196
|
+
src,
|
|
197
|
+
alt,
|
|
198
|
+
loading: "lazy",
|
|
199
|
+
decoding: "async",
|
|
200
|
+
className: cn(
|
|
201
|
+
"mx-auto h-auto w-full object-contain",
|
|
202
|
+
SIZE_CLASS[size],
|
|
203
|
+
className
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
182
208
|
function LoadingState({
|
|
183
209
|
label,
|
|
184
210
|
className
|
|
@@ -236,6 +262,7 @@ function EmptyState({
|
|
|
236
262
|
description,
|
|
237
263
|
action,
|
|
238
264
|
icon: Icon = lucideReact.Inbox,
|
|
265
|
+
illustration,
|
|
239
266
|
variant = "default",
|
|
240
267
|
className
|
|
241
268
|
}) {
|
|
@@ -250,7 +277,14 @@ function EmptyState({
|
|
|
250
277
|
),
|
|
251
278
|
children: [
|
|
252
279
|
/* @__PURE__ */ jsxRuntime.jsxs(empty_js.EmptyHeader, { className: "gap-3", children: [
|
|
253
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
280
|
+
illustration ? /* @__PURE__ */ jsxRuntime.jsx(empty_js.EmptyMedia, { variant: "default", className: "mb-0 w-full max-w-[240px]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
281
|
+
ProductIllustration,
|
|
282
|
+
{
|
|
283
|
+
src: illustration.src,
|
|
284
|
+
alt: illustration.alt ?? "",
|
|
285
|
+
size: isCompact ? "sm" : "md"
|
|
286
|
+
}
|
|
287
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
254
288
|
empty_js.EmptyMedia,
|
|
255
289
|
{
|
|
256
290
|
variant: "icon",
|
|
@@ -603,6 +637,7 @@ function DataTableBody({
|
|
|
603
637
|
rowKey,
|
|
604
638
|
emptyTitle,
|
|
605
639
|
emptyDescription,
|
|
640
|
+
emptyIllustration,
|
|
606
641
|
skeletonRows
|
|
607
642
|
}) {
|
|
608
643
|
switch (mode) {
|
|
@@ -621,7 +656,8 @@ function DataTableBody({
|
|
|
621
656
|
{
|
|
622
657
|
variant: "compact",
|
|
623
658
|
title: emptyTitle,
|
|
624
|
-
description: emptyDescription
|
|
659
|
+
description: emptyDescription,
|
|
660
|
+
illustration: emptyIllustration
|
|
625
661
|
}
|
|
626
662
|
) }) });
|
|
627
663
|
case "rows":
|
|
@@ -646,6 +682,7 @@ function DataTable({
|
|
|
646
682
|
toolbar,
|
|
647
683
|
emptyTitle,
|
|
648
684
|
emptyDescription,
|
|
685
|
+
emptyIllustration,
|
|
649
686
|
loading = false,
|
|
650
687
|
skeletonRows = DATA_TABLE_DEFAULT_SKELETON_ROWS,
|
|
651
688
|
loadMore,
|
|
@@ -667,6 +704,7 @@ function DataTable({
|
|
|
667
704
|
rowKey,
|
|
668
705
|
emptyTitle,
|
|
669
706
|
emptyDescription,
|
|
707
|
+
emptyIllustration,
|
|
670
708
|
skeletonRows
|
|
671
709
|
}
|
|
672
710
|
) })
|
|
@@ -3154,7 +3192,7 @@ function CountryPicker({
|
|
|
3154
3192
|
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
|
|
3155
3193
|
),
|
|
3156
3194
|
children: [
|
|
3157
|
-
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "
|
|
3195
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block px-2 py-2", children: labels.noResults }) }),
|
|
3158
3196
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3159
3197
|
combobox_js.Combobox.List,
|
|
3160
3198
|
{
|
|
@@ -3165,12 +3203,12 @@ function CountryPicker({
|
|
|
3165
3203
|
{
|
|
3166
3204
|
value: item,
|
|
3167
3205
|
className: cn(
|
|
3168
|
-
"relative flex cursor-default items-center gap-2 rounded-md py-1.5
|
|
3206
|
+
"relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none select-none",
|
|
3169
3207
|
"data-highlighted:bg-accent data-highlighted:text-accent-foreground"
|
|
3170
3208
|
),
|
|
3171
3209
|
children: [
|
|
3172
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3173
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
3210
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children: item.label }),
|
|
3211
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "flex size-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) })
|
|
3174
3212
|
]
|
|
3175
3213
|
},
|
|
3176
3214
|
item.value
|
|
@@ -3187,6 +3225,18 @@ function CountryPicker({
|
|
|
3187
3225
|
)
|
|
3188
3226
|
] });
|
|
3189
3227
|
}
|
|
3228
|
+
function useMediaQuery(query) {
|
|
3229
|
+
const [matches, setMatches] = React6.useState(false);
|
|
3230
|
+
React6.useEffect(() => {
|
|
3231
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
3232
|
+
const mql = window.matchMedia(query);
|
|
3233
|
+
const onChange = () => setMatches(mql.matches);
|
|
3234
|
+
onChange();
|
|
3235
|
+
mql.addEventListener("change", onChange);
|
|
3236
|
+
return () => mql.removeEventListener("change", onChange);
|
|
3237
|
+
}, [query]);
|
|
3238
|
+
return matches;
|
|
3239
|
+
}
|
|
3190
3240
|
|
|
3191
3241
|
// src/data/sat-tax-regimes.json
|
|
3192
3242
|
var sat_tax_regimes_default = {
|
|
@@ -3343,7 +3393,9 @@ function filterTaxRegimes(query, locale) {
|
|
|
3343
3393
|
return code.includes(needle) || label.includes(needle);
|
|
3344
3394
|
});
|
|
3345
3395
|
}
|
|
3396
|
+
var MD_UP = "(min-width: 768px)";
|
|
3346
3397
|
var INPUT_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
3398
|
+
var TRIGGER_CLASS = "flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 py-1 text-left text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
3347
3399
|
function defaultLabels3(locale) {
|
|
3348
3400
|
const es = locale === "es-MX";
|
|
3349
3401
|
return {
|
|
@@ -3351,7 +3403,8 @@ function defaultLabels3(locale) {
|
|
|
3351
3403
|
search: es ? "Buscar r\xE9gimen fiscal" : "Search tax regime",
|
|
3352
3404
|
noResults: es ? "Sin resultados" : "No results",
|
|
3353
3405
|
clear: es ? "Limpiar" : "Clear",
|
|
3354
|
-
open: es ? "Abrir lista" : "Open list"
|
|
3406
|
+
open: es ? "Abrir lista" : "Open list",
|
|
3407
|
+
title: es ? "R\xE9gimen fiscal" : "Tax regime"
|
|
3355
3408
|
};
|
|
3356
3409
|
}
|
|
3357
3410
|
function findItem2(items, code) {
|
|
@@ -3376,119 +3429,244 @@ function TaxRegimePicker({
|
|
|
3376
3429
|
const items = React6__namespace.useMemo(() => taxRegimePickerItems(locale), [locale]);
|
|
3377
3430
|
const selected = React6__namespace.useMemo(() => findItem2(items, value), [items, value]);
|
|
3378
3431
|
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3432
|
+
const isMdUp = useMediaQuery(MD_UP);
|
|
3433
|
+
const [open, setOpen] = React6__namespace.useState(false);
|
|
3434
|
+
const [query, setQuery] = React6__namespace.useState("");
|
|
3435
|
+
const searchRef = React6__namespace.useRef(null);
|
|
3436
|
+
const filtered = React6__namespace.useMemo(
|
|
3437
|
+
() => filterTaxRegimes(query, locale),
|
|
3438
|
+
[locale, query]
|
|
3439
|
+
);
|
|
3440
|
+
function setOpenState(next) {
|
|
3441
|
+
setOpen(next);
|
|
3442
|
+
if (!next) setQuery("");
|
|
3443
|
+
}
|
|
3444
|
+
function selectItem(item) {
|
|
3445
|
+
onValueChange(item.value);
|
|
3446
|
+
setOpenState(false);
|
|
3447
|
+
}
|
|
3448
|
+
function clearSelection() {
|
|
3449
|
+
onValueChange("");
|
|
3450
|
+
setQuery("");
|
|
3451
|
+
}
|
|
3452
|
+
React6__namespace.useEffect(() => {
|
|
3453
|
+
if (!open || isMdUp) return;
|
|
3454
|
+
const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
|
|
3455
|
+
return () => window.clearTimeout(handle);
|
|
3456
|
+
}, [isMdUp, open]);
|
|
3457
|
+
const sheetTitle = labels.title || labels.placeholder;
|
|
3458
|
+
const display = selected?.label ?? "";
|
|
3459
|
+
const hidden = name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim() }) : null;
|
|
3460
|
+
if (isMdUp) {
|
|
3461
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3462
|
+
hidden,
|
|
3463
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3464
|
+
combobox_js.Combobox.Root,
|
|
3465
|
+
{
|
|
3466
|
+
items,
|
|
3467
|
+
value: selected,
|
|
3468
|
+
onValueChange: (item) => {
|
|
3469
|
+
onValueChange(item?.value ?? "");
|
|
3470
|
+
},
|
|
3471
|
+
disabled,
|
|
3472
|
+
itemToStringLabel: (item) => item.label,
|
|
3473
|
+
itemToStringValue: (item) => item.value,
|
|
3474
|
+
isItemEqualToValue: (item, current) => item.value === current.value,
|
|
3475
|
+
children: [
|
|
3476
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3477
|
+
combobox_js.Combobox.InputGroup,
|
|
3478
|
+
{
|
|
3479
|
+
className: cn("relative flex w-full items-center", className),
|
|
3480
|
+
children: [
|
|
3419
3481
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3420
|
-
combobox_js.Combobox.
|
|
3482
|
+
combobox_js.Combobox.Input,
|
|
3421
3483
|
{
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3484
|
+
id,
|
|
3485
|
+
required,
|
|
3486
|
+
"aria-invalid": ariaInvalid,
|
|
3487
|
+
...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
|
|
3488
|
+
placeholder: labels.placeholder,
|
|
3489
|
+
className: cn(INPUT_CLASS2, "pr-16")
|
|
3425
3490
|
}
|
|
3426
|
-
)
|
|
3427
|
-
] })
|
|
3428
|
-
]
|
|
3429
|
-
}
|
|
3430
|
-
),
|
|
3431
|
-
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Portal, { container: dialogPortalContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3432
|
-
combobox_js.Combobox.Positioner,
|
|
3433
|
-
{
|
|
3434
|
-
className: "pointer-events-auto isolate z-[60] outline-none",
|
|
3435
|
-
sideOffset: 4,
|
|
3436
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3437
|
-
combobox_js.Combobox.Popup,
|
|
3438
|
-
{
|
|
3439
|
-
className: cn(
|
|
3440
|
-
"pointer-events-auto z-[60] max-h-60 w-(--anchor-width) min-w-[16rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",
|
|
3441
|
-
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
|
|
3442
3491
|
),
|
|
3443
|
-
children: [
|
|
3444
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3492
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
|
|
3493
|
+
allowEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3494
|
+
combobox_js.Combobox.Clear,
|
|
3495
|
+
{
|
|
3496
|
+
className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3497
|
+
"aria-label": labels.clear,
|
|
3498
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4", "aria-hidden": true })
|
|
3499
|
+
}
|
|
3500
|
+
) : null,
|
|
3445
3501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3446
|
-
combobox_js.Combobox.
|
|
3502
|
+
combobox_js.Combobox.Trigger,
|
|
3447
3503
|
{
|
|
3448
|
-
className: "
|
|
3449
|
-
|
|
3450
|
-
children:
|
|
3451
|
-
combobox_js.Combobox.Item,
|
|
3452
|
-
{
|
|
3453
|
-
value: item,
|
|
3454
|
-
className: cn(
|
|
3455
|
-
"relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none",
|
|
3456
|
-
"data-highlighted:bg-accent data-highlighted:text-accent-foreground"
|
|
3457
|
-
),
|
|
3458
|
-
children: [
|
|
3459
|
-
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) }),
|
|
3460
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
3461
|
-
]
|
|
3462
|
-
},
|
|
3463
|
-
item.value
|
|
3464
|
-
)
|
|
3504
|
+
className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3505
|
+
"aria-label": labels.open,
|
|
3506
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4", "aria-hidden": true })
|
|
3465
3507
|
}
|
|
3466
3508
|
)
|
|
3467
|
-
]
|
|
3509
|
+
] })
|
|
3510
|
+
]
|
|
3511
|
+
}
|
|
3512
|
+
),
|
|
3513
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Portal, { container: dialogPortalContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3514
|
+
combobox_js.Combobox.Positioner,
|
|
3515
|
+
{
|
|
3516
|
+
className: "pointer-events-auto isolate z-[60] outline-none",
|
|
3517
|
+
sideOffset: 4,
|
|
3518
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3519
|
+
combobox_js.Combobox.Popup,
|
|
3520
|
+
{
|
|
3521
|
+
className: cn(
|
|
3522
|
+
"pointer-events-auto z-[60] max-h-60 w-(--anchor-width) min-w-[16rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",
|
|
3523
|
+
"motion-safe:data-open:animate-in motion-safe:data-open:fade-in-0 motion-safe:data-open:zoom-in-95"
|
|
3524
|
+
),
|
|
3525
|
+
children: [
|
|
3526
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block px-2 py-2", children: labels.noResults }) }),
|
|
3527
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3528
|
+
combobox_js.Combobox.List,
|
|
3529
|
+
{
|
|
3530
|
+
className: "max-h-60 overflow-y-auto p-1 outline-none",
|
|
3531
|
+
onWheel: (event) => event.stopPropagation(),
|
|
3532
|
+
children: (item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3533
|
+
combobox_js.Combobox.Item,
|
|
3534
|
+
{
|
|
3535
|
+
value: item,
|
|
3536
|
+
className: cn(
|
|
3537
|
+
"relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none select-none",
|
|
3538
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground"
|
|
3539
|
+
),
|
|
3540
|
+
children: [
|
|
3541
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children: item.label }),
|
|
3542
|
+
/* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "flex size-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) })
|
|
3543
|
+
]
|
|
3544
|
+
},
|
|
3545
|
+
item.value
|
|
3546
|
+
)
|
|
3547
|
+
}
|
|
3548
|
+
)
|
|
3549
|
+
]
|
|
3550
|
+
}
|
|
3551
|
+
)
|
|
3552
|
+
}
|
|
3553
|
+
) })
|
|
3554
|
+
]
|
|
3555
|
+
}
|
|
3556
|
+
)
|
|
3557
|
+
] });
|
|
3558
|
+
}
|
|
3559
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative w-full", className), children: [
|
|
3560
|
+
hidden,
|
|
3561
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-1", children: [
|
|
3562
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3563
|
+
"button",
|
|
3564
|
+
{
|
|
3565
|
+
"aria-expanded": open,
|
|
3566
|
+
"aria-haspopup": "dialog",
|
|
3567
|
+
"aria-invalid": ariaInvalid,
|
|
3568
|
+
"aria-label": labels.ariaLabel || labels.open,
|
|
3569
|
+
"aria-required": required || void 0,
|
|
3570
|
+
className: TRIGGER_CLASS,
|
|
3571
|
+
disabled,
|
|
3572
|
+
id,
|
|
3573
|
+
type: "button",
|
|
3574
|
+
onClick: () => setOpenState(true),
|
|
3575
|
+
children: [
|
|
3576
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3577
|
+
"span",
|
|
3578
|
+
{
|
|
3579
|
+
className: cn(
|
|
3580
|
+
"min-w-0 flex-1 truncate",
|
|
3581
|
+
display ? "text-foreground" : "text-muted-foreground"
|
|
3582
|
+
),
|
|
3583
|
+
children: display || labels.placeholder
|
|
3584
|
+
}
|
|
3585
|
+
),
|
|
3586
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3587
|
+
lucideReact.ChevronDownIcon,
|
|
3588
|
+
{
|
|
3589
|
+
"aria-hidden": true,
|
|
3590
|
+
className: "size-4 shrink-0 text-muted-foreground"
|
|
3591
|
+
}
|
|
3592
|
+
)
|
|
3593
|
+
]
|
|
3594
|
+
}
|
|
3595
|
+
),
|
|
3596
|
+
allowEmpty && value ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3597
|
+
button_js.Button,
|
|
3598
|
+
{
|
|
3599
|
+
"aria-label": labels.clear,
|
|
3600
|
+
disabled,
|
|
3601
|
+
size: "icon",
|
|
3602
|
+
type: "button",
|
|
3603
|
+
variant: "ghost",
|
|
3604
|
+
onClick: clearSelection,
|
|
3605
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4", "aria-hidden": true })
|
|
3606
|
+
}
|
|
3607
|
+
) : null
|
|
3608
|
+
] }),
|
|
3609
|
+
/* @__PURE__ */ jsxRuntime.jsx(drawer_js.Drawer, { open, onOpenChange: setOpenState, children: /* @__PURE__ */ jsxRuntime.jsxs(drawer_js.DrawerContent, { className: "max-h-[85vh]", children: [
|
|
3610
|
+
/* @__PURE__ */ jsxRuntime.jsxs(drawer_js.DrawerHeader, { className: "flex flex-row items-center justify-between gap-2 text-left md:text-left", children: [
|
|
3611
|
+
/* @__PURE__ */ jsxRuntime.jsx(drawer_js.DrawerTitle, { children: sheetTitle }),
|
|
3612
|
+
allowEmpty && value ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3613
|
+
button_js.Button,
|
|
3614
|
+
{
|
|
3615
|
+
size: "sm",
|
|
3616
|
+
type: "button",
|
|
3617
|
+
variant: "ghost",
|
|
3618
|
+
onClick: () => {
|
|
3619
|
+
clearSelection();
|
|
3620
|
+
setOpenState(false);
|
|
3621
|
+
},
|
|
3622
|
+
children: labels.clear
|
|
3623
|
+
}
|
|
3624
|
+
) : null
|
|
3625
|
+
] }),
|
|
3626
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 border-b border-border bg-background px-4 pb-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3627
|
+
input_js.Input,
|
|
3628
|
+
{
|
|
3629
|
+
ref: searchRef,
|
|
3630
|
+
"aria-label": labels.search,
|
|
3631
|
+
disabled,
|
|
3632
|
+
placeholder: labels.search,
|
|
3633
|
+
value: query,
|
|
3634
|
+
onChange: (event) => setQuery(event.target.value)
|
|
3635
|
+
}
|
|
3636
|
+
) }),
|
|
3637
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto px-2 pb-4", children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-3 text-sm text-muted-foreground", children: labels.noResults }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1 p-1", role: "listbox", children: filtered.map((item) => {
|
|
3638
|
+
const isSelected = item.value === value.trim();
|
|
3639
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3640
|
+
"button",
|
|
3641
|
+
{
|
|
3642
|
+
"aria-selected": isSelected,
|
|
3643
|
+
className: cn(
|
|
3644
|
+
"flex w-full items-center gap-2 rounded-lg px-3 py-3 text-left text-sm outline-none transition-colors",
|
|
3645
|
+
"hover:bg-muted/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
3646
|
+
isSelected ? "bg-accent" : null
|
|
3647
|
+
),
|
|
3648
|
+
role: "option",
|
|
3649
|
+
type: "button",
|
|
3650
|
+
onClick: () => selectItem(item),
|
|
3651
|
+
children: [
|
|
3652
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children: item.label }),
|
|
3653
|
+
isSelected ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3654
|
+
lucideReact.CheckIcon,
|
|
3655
|
+
{
|
|
3656
|
+
"aria-hidden": true,
|
|
3657
|
+
className: "size-4 shrink-0 text-foreground"
|
|
3468
3658
|
}
|
|
3469
|
-
)
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
}
|
|
3474
|
-
)
|
|
3659
|
+
) : null
|
|
3660
|
+
]
|
|
3661
|
+
}
|
|
3662
|
+
) }, item.value);
|
|
3663
|
+
}) }) })
|
|
3664
|
+
] }) })
|
|
3475
3665
|
] });
|
|
3476
3666
|
}
|
|
3477
|
-
|
|
3478
|
-
const [matches, setMatches] = React6.useState(false);
|
|
3479
|
-
React6.useEffect(() => {
|
|
3480
|
-
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
3481
|
-
const mql = window.matchMedia(query);
|
|
3482
|
-
const onChange = () => setMatches(mql.matches);
|
|
3483
|
-
onChange();
|
|
3484
|
-
mql.addEventListener("change", onChange);
|
|
3485
|
-
return () => mql.removeEventListener("change", onChange);
|
|
3486
|
-
}, [query]);
|
|
3487
|
-
return matches;
|
|
3488
|
-
}
|
|
3489
|
-
var TRIGGER_CLASS = "flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 py-1 text-left text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
3667
|
+
var TRIGGER_CLASS2 = "flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 py-1 text-left text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
3490
3668
|
var SEARCH_CLASS = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 md:text-sm dark:bg-input/30";
|
|
3491
|
-
var
|
|
3669
|
+
var MD_UP2 = "(min-width: 768px)";
|
|
3492
3670
|
function LoadingRows() {
|
|
3493
3671
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 p-2", role: "status", children: [
|
|
3494
3672
|
/* @__PURE__ */ jsxRuntime.jsx(skeleton_js.Skeleton, { className: "h-8 w-full motion-reduce:animate-none" }),
|
|
@@ -3528,7 +3706,7 @@ function SearchablePicker({
|
|
|
3528
3706
|
onCreate,
|
|
3529
3707
|
createLabel
|
|
3530
3708
|
}) {
|
|
3531
|
-
const isMdUp = useMediaQuery(
|
|
3709
|
+
const isMdUp = useMediaQuery(MD_UP2);
|
|
3532
3710
|
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
3533
3711
|
const [open, setOpen] = React6__namespace.useState(false);
|
|
3534
3712
|
const searchRef = React6__namespace.useRef(null);
|
|
@@ -3624,7 +3802,7 @@ function SearchablePicker({
|
|
|
3624
3802
|
id,
|
|
3625
3803
|
"aria-invalid": ariaInvalid,
|
|
3626
3804
|
"aria-label": openLabel,
|
|
3627
|
-
className: cn(
|
|
3805
|
+
className: cn(TRIGGER_CLASS2, allowClear && value ? "pr-1" : null),
|
|
3628
3806
|
disabled,
|
|
3629
3807
|
children: [
|
|
3630
3808
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3725,7 +3903,7 @@ function SearchablePicker({
|
|
|
3725
3903
|
"aria-haspopup": "dialog",
|
|
3726
3904
|
"aria-invalid": ariaInvalid,
|
|
3727
3905
|
"aria-label": openLabel,
|
|
3728
|
-
className:
|
|
3906
|
+
className: TRIGGER_CLASS2,
|
|
3729
3907
|
disabled,
|
|
3730
3908
|
id,
|
|
3731
3909
|
type: "button",
|
|
@@ -4176,7 +4354,7 @@ function PasswordInput({
|
|
|
4176
4354
|
)
|
|
4177
4355
|
] });
|
|
4178
4356
|
}
|
|
4179
|
-
var
|
|
4357
|
+
var MD_UP3 = "(min-width: 768px)";
|
|
4180
4358
|
var ROW_CLASS = "flex h-8 w-full min-w-0 items-stretch overflow-hidden rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
4181
4359
|
var SEARCH_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 md:text-sm dark:bg-input/30";
|
|
4182
4360
|
function isCountryCode(value) {
|
|
@@ -4281,7 +4459,7 @@ function PhoneInput({
|
|
|
4281
4459
|
const [open, setOpen] = React6__namespace.useState(false);
|
|
4282
4460
|
const [query, setQuery] = React6__namespace.useState("");
|
|
4283
4461
|
const lastEmittedRef = React6__namespace.useRef(value);
|
|
4284
|
-
const isMdUp = useMediaQuery(
|
|
4462
|
+
const isMdUp = useMediaQuery(MD_UP3);
|
|
4285
4463
|
const dialogPortalContainer = dialog_js.useDialogPortalContainer();
|
|
4286
4464
|
const searchRef = React6__namespace.useRef(null);
|
|
4287
4465
|
React6__namespace.useEffect(() => {
|
|
@@ -6533,7 +6711,7 @@ function OptionRow({
|
|
|
6533
6711
|
),
|
|
6534
6712
|
...props,
|
|
6535
6713
|
children: [
|
|
6536
|
-
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-5", children: icon }) : null,
|
|
6714
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground [&_img]:size-9 [&_img]:object-contain [&_svg]:size-5", children: icon }) : null,
|
|
6537
6715
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
6538
6716
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
6539
6717
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: title }),
|
|
@@ -6970,7 +7148,7 @@ function SectionCard({
|
|
|
6970
7148
|
] }),
|
|
6971
7149
|
headerAction ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: headerAction }) : null
|
|
6972
7150
|
] }),
|
|
6973
|
-
/* @__PURE__ */ jsxRuntime.jsx(card_js.CardContent, { children }),
|
|
7151
|
+
children != null ? /* @__PURE__ */ jsxRuntime.jsx(card_js.CardContent, { children }) : null,
|
|
6974
7152
|
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end border-t border-border/60 px-6 pb-6 pt-4", children: footer }) : null
|
|
6975
7153
|
]
|
|
6976
7154
|
}
|
|
@@ -7645,6 +7823,7 @@ exports.PageTitleSkeleton = PageTitleSkeleton;
|
|
|
7645
7823
|
exports.PaginatedCombobox = PaginatedCombobox;
|
|
7646
7824
|
exports.PasswordInput = PasswordInput;
|
|
7647
7825
|
exports.PhoneInput = PhoneInput;
|
|
7826
|
+
exports.ProductIllustration = ProductIllustration;
|
|
7648
7827
|
exports.QueueLayout = QueueLayout;
|
|
7649
7828
|
exports.RfcInput = RfcInput;
|
|
7650
7829
|
exports.RiskBadge = RiskBadge;
|