@mikenotthepope/substrateui 0.1.3 → 0.2.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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/{chunk-IRBORST3.js → chunk-GK4MVBBR.js} +14 -3
- package/dist/chunk-GK4MVBBR.js.map +1 -0
- package/dist/index.d.ts +151 -24
- package/dist/index.js +274 -81
- package/dist/index.js.map +1 -1
- package/dist/organisms.d.ts +9 -2
- package/dist/organisms.js +21 -7
- package/dist/organisms.js.map +1 -1
- package/dist/styles.css +0 -187
- package/package.json +6 -1
- package/dist/chunk-IRBORST3.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Stack } from './chunk-
|
|
3
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Center, Stack, Tabs, TabsContent, TabsList, TabsTrigger } from './chunk-
|
|
2
|
+
import { useLabels, resolveLabels, Stack } from './chunk-GK4MVBBR.js';
|
|
3
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Center, Stack, Tabs, TabsContent, TabsList, TabsTrigger } from './chunk-GK4MVBBR.js';
|
|
4
4
|
import { __objRest, __spreadValues, cn, __spreadProps } from './chunk-IQWAGBDM.js';
|
|
5
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
6
6
|
import { ChevronDown, ChevronRight, MoreHorizontal, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, ArrowLeft, ArrowRight, Check, X, Search, ChevronsUpDown, Circle, ArrowUp, ArrowDown, ArrowUpDown, Settings2, CalendarIcon, Dot, ChevronLeft, GripVertical, ChevronUp, PanelLeft, LoaderCircle, OctagonX, TriangleAlert, Info, CircleCheck } from 'lucide-react';
|
|
@@ -464,13 +464,23 @@ function Badge(_a) {
|
|
|
464
464
|
var _b = _a, { className, variant } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
465
465
|
return /* @__PURE__ */ jsx("div", __spreadValues({ "data-slot": "badge", className: cn(badgeVariants({ variant }), className) }, props));
|
|
466
466
|
}
|
|
467
|
+
var defaultBreadcrumbLabels = {
|
|
468
|
+
breadcrumb: "breadcrumb",
|
|
469
|
+
more: "More"
|
|
470
|
+
};
|
|
467
471
|
function Breadcrumb(_a) {
|
|
468
472
|
var _b = _a, {
|
|
469
|
-
ref
|
|
473
|
+
ref,
|
|
474
|
+
"aria-label": ariaLabel,
|
|
475
|
+
labels: labelsProp
|
|
470
476
|
} = _b, props = __objRest(_b, [
|
|
471
|
-
"ref"
|
|
477
|
+
"ref",
|
|
478
|
+
"aria-label",
|
|
479
|
+
"labels"
|
|
472
480
|
]);
|
|
473
|
-
|
|
481
|
+
const ctx = useLabels();
|
|
482
|
+
const labels = resolveLabels(defaultBreadcrumbLabels, ctx.breadcrumb, labelsProp);
|
|
483
|
+
return /* @__PURE__ */ jsx("nav", __spreadValues({ ref, "aria-label": ariaLabel != null ? ariaLabel : labels.breadcrumb, "data-slot": "breadcrumb" }, props));
|
|
474
484
|
}
|
|
475
485
|
function BreadcrumbList(_a) {
|
|
476
486
|
var _b = _a, {
|
|
@@ -571,10 +581,17 @@ function BreadcrumbSeparator(_a) {
|
|
|
571
581
|
}
|
|
572
582
|
function BreadcrumbEllipsis(_a) {
|
|
573
583
|
var _b = _a, {
|
|
574
|
-
className
|
|
584
|
+
className,
|
|
585
|
+
label,
|
|
586
|
+
labels: labelsProp
|
|
575
587
|
} = _b, props = __objRest(_b, [
|
|
576
|
-
"className"
|
|
588
|
+
"className",
|
|
589
|
+
"label",
|
|
590
|
+
"labels"
|
|
577
591
|
]);
|
|
592
|
+
const ctx = useLabels();
|
|
593
|
+
const labels = resolveLabels(defaultBreadcrumbLabels, ctx.breadcrumb, labelsProp);
|
|
594
|
+
const resolvedLabel = label != null ? label : labels.more;
|
|
578
595
|
return /* @__PURE__ */ jsxs(
|
|
579
596
|
"span",
|
|
580
597
|
__spreadProps(__spreadValues({
|
|
@@ -585,7 +602,7 @@ function BreadcrumbEllipsis(_a) {
|
|
|
585
602
|
}, props), {
|
|
586
603
|
children: [
|
|
587
604
|
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
588
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
605
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: resolvedLabel })
|
|
589
606
|
]
|
|
590
607
|
})
|
|
591
608
|
);
|
|
@@ -805,6 +822,10 @@ function CalendarDayButton(_a) {
|
|
|
805
822
|
}, props)
|
|
806
823
|
);
|
|
807
824
|
}
|
|
825
|
+
var defaultCarouselLabels = {
|
|
826
|
+
previousSlide: "Previous slide",
|
|
827
|
+
nextSlide: "Next slide"
|
|
828
|
+
};
|
|
808
829
|
var CarouselContext = React3.createContext(null);
|
|
809
830
|
function useCarousel() {
|
|
810
831
|
const context = React3.useContext(CarouselContext);
|
|
@@ -961,14 +982,18 @@ function CarouselPrevious(_a) {
|
|
|
961
982
|
className,
|
|
962
983
|
variant = "outline",
|
|
963
984
|
size = "icon",
|
|
985
|
+
labels: labelsProp,
|
|
964
986
|
ref
|
|
965
987
|
} = _b, props = __objRest(_b, [
|
|
966
988
|
"className",
|
|
967
989
|
"variant",
|
|
968
990
|
"size",
|
|
991
|
+
"labels",
|
|
969
992
|
"ref"
|
|
970
993
|
]);
|
|
971
994
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
995
|
+
const ctx = useLabels();
|
|
996
|
+
const labels = resolveLabels(defaultCarouselLabels, ctx.carousel, labelsProp);
|
|
972
997
|
return /* @__PURE__ */ jsxs(
|
|
973
998
|
Button,
|
|
974
999
|
__spreadProps(__spreadValues({
|
|
@@ -986,7 +1011,7 @@ function CarouselPrevious(_a) {
|
|
|
986
1011
|
}, props), {
|
|
987
1012
|
children: [
|
|
988
1013
|
/* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4" }),
|
|
989
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
1014
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: labels.previousSlide })
|
|
990
1015
|
]
|
|
991
1016
|
})
|
|
992
1017
|
);
|
|
@@ -996,14 +1021,18 @@ function CarouselNext(_a) {
|
|
|
996
1021
|
className,
|
|
997
1022
|
variant = "outline",
|
|
998
1023
|
size = "icon",
|
|
1024
|
+
labels: labelsProp,
|
|
999
1025
|
ref
|
|
1000
1026
|
} = _b, props = __objRest(_b, [
|
|
1001
1027
|
"className",
|
|
1002
1028
|
"variant",
|
|
1003
1029
|
"size",
|
|
1030
|
+
"labels",
|
|
1004
1031
|
"ref"
|
|
1005
1032
|
]);
|
|
1006
1033
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
1034
|
+
const ctx = useLabels();
|
|
1035
|
+
const labels = resolveLabels(defaultCarouselLabels, ctx.carousel, labelsProp);
|
|
1007
1036
|
return /* @__PURE__ */ jsxs(
|
|
1008
1037
|
Button,
|
|
1009
1038
|
__spreadProps(__spreadValues({
|
|
@@ -1021,7 +1050,7 @@ function CarouselNext(_a) {
|
|
|
1021
1050
|
}, props), {
|
|
1022
1051
|
children: [
|
|
1023
1052
|
/* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4" }),
|
|
1024
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
1053
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: labels.nextSlide })
|
|
1025
1054
|
]
|
|
1026
1055
|
})
|
|
1027
1056
|
);
|
|
@@ -1359,6 +1388,9 @@ function Cluster(_a) {
|
|
|
1359
1388
|
var Collapsible = CollapsiblePrimitive.Root;
|
|
1360
1389
|
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
1361
1390
|
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
1391
|
+
var defaultDialogLabels = {
|
|
1392
|
+
close: "Close"
|
|
1393
|
+
};
|
|
1362
1394
|
var Dialog = DialogPrimitive.Root;
|
|
1363
1395
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1364
1396
|
var DialogPortal = DialogPrimitive.Portal;
|
|
@@ -1387,12 +1419,16 @@ function DialogContent(_a) {
|
|
|
1387
1419
|
var _b = _a, {
|
|
1388
1420
|
className,
|
|
1389
1421
|
children,
|
|
1422
|
+
labels: labelsProp,
|
|
1390
1423
|
ref
|
|
1391
1424
|
} = _b, props = __objRest(_b, [
|
|
1392
1425
|
"className",
|
|
1393
1426
|
"children",
|
|
1427
|
+
"labels",
|
|
1394
1428
|
"ref"
|
|
1395
1429
|
]);
|
|
1430
|
+
const ctx = useLabels();
|
|
1431
|
+
const labels = resolveLabels(defaultDialogLabels, ctx.dialog, labelsProp);
|
|
1396
1432
|
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1397
1433
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
1398
1434
|
/* @__PURE__ */ jsxs(
|
|
@@ -1409,7 +1445,7 @@ function DialogContent(_a) {
|
|
|
1409
1445
|
children,
|
|
1410
1446
|
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute end-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1411
1447
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1412
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
1448
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: labels.close })
|
|
1413
1449
|
] })
|
|
1414
1450
|
]
|
|
1415
1451
|
})
|
|
@@ -1668,23 +1704,37 @@ function PopoverContent(_a) {
|
|
|
1668
1704
|
}, props)
|
|
1669
1705
|
) });
|
|
1670
1706
|
}
|
|
1707
|
+
var defaultComboboxLabels = {
|
|
1708
|
+
placeholder: "Select...",
|
|
1709
|
+
searchPlaceholder: "Search...",
|
|
1710
|
+
noResults: "No results found."
|
|
1711
|
+
};
|
|
1671
1712
|
function Combobox(_a) {
|
|
1672
1713
|
var _b = _a, {
|
|
1673
1714
|
options,
|
|
1674
|
-
placeholder
|
|
1675
|
-
searchPlaceholder
|
|
1676
|
-
emptyMessage
|
|
1715
|
+
placeholder: placeholder,
|
|
1716
|
+
searchPlaceholder,
|
|
1717
|
+
emptyMessage,
|
|
1718
|
+
labels: labelsProp,
|
|
1677
1719
|
className,
|
|
1678
1720
|
disabled
|
|
1679
1721
|
} = _b, props = __objRest(_b, [
|
|
1680
1722
|
"options",
|
|
1723
|
+
// These deprecated props are still accepted and forwarded into the labels
|
|
1724
|
+
// API below for backward compatibility (see ComboboxBaseProps).
|
|
1725
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
1681
1726
|
"placeholder",
|
|
1682
1727
|
"searchPlaceholder",
|
|
1683
1728
|
"emptyMessage",
|
|
1729
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
1730
|
+
"labels",
|
|
1684
1731
|
"className",
|
|
1685
1732
|
"disabled"
|
|
1686
1733
|
]);
|
|
1687
1734
|
var _a2;
|
|
1735
|
+
const ctx = useLabels();
|
|
1736
|
+
const mergedProp = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, labelsProp), placeholder != null && { placeholder }), searchPlaceholder != null && { searchPlaceholder }), emptyMessage != null && { noResults: emptyMessage });
|
|
1737
|
+
const labels = resolveLabels(defaultComboboxLabels, ctx.combobox, mergedProp);
|
|
1688
1738
|
const [open, setOpen] = React3.useState(false);
|
|
1689
1739
|
const isMultiple = props.multiple === true;
|
|
1690
1740
|
const selectedValues = isMultiple ? (_a2 = props.value) != null ? _a2 : [] : props.value ? [props.value] : [];
|
|
@@ -1732,7 +1782,7 @@ function Combobox(_a) {
|
|
|
1732
1782
|
const opt = options.find((o) => o.value === props.value);
|
|
1733
1783
|
return /* @__PURE__ */ jsx("span", { children: (_a3 = opt == null ? void 0 : opt.label) != null ? _a3 : props.value });
|
|
1734
1784
|
}
|
|
1735
|
-
return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: placeholder });
|
|
1785
|
+
return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: labels.placeholder });
|
|
1736
1786
|
};
|
|
1737
1787
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
1738
1788
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
@@ -1754,9 +1804,9 @@ function Combobox(_a) {
|
|
|
1754
1804
|
}
|
|
1755
1805
|
) }),
|
|
1756
1806
|
/* @__PURE__ */ jsx(PopoverContent, { className: "w-[--radix-popover-trigger-width] p-0", children: /* @__PURE__ */ jsxs(Command, { children: [
|
|
1757
|
-
/* @__PURE__ */ jsx(CommandInput, { placeholder: searchPlaceholder }),
|
|
1807
|
+
/* @__PURE__ */ jsx(CommandInput, { placeholder: labels.searchPlaceholder }),
|
|
1758
1808
|
/* @__PURE__ */ jsxs(CommandList, { children: [
|
|
1759
|
-
/* @__PURE__ */ jsx(CommandEmpty, { children:
|
|
1809
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: labels.noResults }),
|
|
1760
1810
|
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
1761
1811
|
CommandItem,
|
|
1762
1812
|
{
|
|
@@ -2346,11 +2396,28 @@ function TableCaption(_a) {
|
|
|
2346
2396
|
}, props)
|
|
2347
2397
|
);
|
|
2348
2398
|
}
|
|
2399
|
+
var defaultLabels = {
|
|
2400
|
+
previous: "Previous",
|
|
2401
|
+
next: "Next",
|
|
2402
|
+
noResults: "No results.",
|
|
2403
|
+
view: "View",
|
|
2404
|
+
toggleColumns: "Toggle columns",
|
|
2405
|
+
selectAll: "Select all",
|
|
2406
|
+
selectRow: "Select row",
|
|
2407
|
+
rowsSelected: (selected, total) => `${selected} of ${total} row(s) selected.`,
|
|
2408
|
+
pageOf: (page, total) => `Page ${page} of ${total}`,
|
|
2409
|
+
sortedAscending: (title) => `${title}, sorted ascending. Click to sort descending.`,
|
|
2410
|
+
sortedDescending: (title) => `${title}, sorted descending. Click to remove sort.`,
|
|
2411
|
+
notSorted: (title) => `${title}, not sorted. Click to sort ascending.`
|
|
2412
|
+
};
|
|
2349
2413
|
function DataTableColumnHeader({
|
|
2350
2414
|
column,
|
|
2351
2415
|
title,
|
|
2352
|
-
className
|
|
2416
|
+
className,
|
|
2417
|
+
labels: labelsProp
|
|
2353
2418
|
}) {
|
|
2419
|
+
const ctx = useLabels();
|
|
2420
|
+
const labels = resolveLabels(defaultLabels, ctx.dataTable, labelsProp);
|
|
2354
2421
|
if (!column.getCanSort()) {
|
|
2355
2422
|
return /* @__PURE__ */ jsx("div", { className: cn(className), children: title });
|
|
2356
2423
|
}
|
|
@@ -2362,7 +2429,7 @@ function DataTableColumnHeader({
|
|
|
2362
2429
|
size: "sm",
|
|
2363
2430
|
className: cn("-ms-3 h-8 font-mono text-xs", className),
|
|
2364
2431
|
onClick: () => column.toggleSorting(sorted === "asc"),
|
|
2365
|
-
"aria-label": sorted === "asc" ?
|
|
2432
|
+
"aria-label": sorted === "asc" ? labels.sortedAscending(title) : sorted === "desc" ? labels.sortedDescending(title) : labels.notSorted(title),
|
|
2366
2433
|
children: [
|
|
2367
2434
|
title,
|
|
2368
2435
|
sorted === "asc" ? /* @__PURE__ */ jsx(ArrowUp, { className: "ms-2 size-3.5", "aria-hidden": "true" }) : sorted === "desc" ? /* @__PURE__ */ jsx(ArrowDown, { className: "ms-2 size-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ArrowUpDown, { className: "ms-2 size-3.5", "aria-hidden": "true" })
|
|
@@ -2371,15 +2438,18 @@ function DataTableColumnHeader({
|
|
|
2371
2438
|
);
|
|
2372
2439
|
}
|
|
2373
2440
|
function DataTableViewOptions({
|
|
2374
|
-
table
|
|
2441
|
+
table,
|
|
2442
|
+
labels: labelsProp
|
|
2375
2443
|
}) {
|
|
2444
|
+
const ctx = useLabels();
|
|
2445
|
+
const labels = resolveLabels(defaultLabels, ctx.dataTable, labelsProp);
|
|
2376
2446
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
2377
2447
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "ms-auto h-8 border-2", children: [
|
|
2378
2448
|
/* @__PURE__ */ jsx(Settings2, { className: "me-2 size-4" }),
|
|
2379
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs", children:
|
|
2449
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs", children: labels.view })
|
|
2380
2450
|
] }) }),
|
|
2381
2451
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-40", children: [
|
|
2382
|
-
/* @__PURE__ */ jsx(DropdownMenuLabel, { className: "font-mono text-xs", children:
|
|
2452
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { className: "font-mono text-xs", children: labels.toggleColumns }),
|
|
2383
2453
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
2384
2454
|
table.getAllColumns().filter(
|
|
2385
2455
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
@@ -2397,24 +2467,21 @@ function DataTableViewOptions({
|
|
|
2397
2467
|
] });
|
|
2398
2468
|
}
|
|
2399
2469
|
function DataTablePagination({
|
|
2400
|
-
table
|
|
2470
|
+
table,
|
|
2471
|
+
labels: labelsProp
|
|
2401
2472
|
}) {
|
|
2473
|
+
const ctx = useLabels();
|
|
2474
|
+
const labels = resolveLabels(defaultLabels, ctx.dataTable, labelsProp);
|
|
2402
2475
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-2 py-4", children: [
|
|
2403
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 font-mono text-xs text-muted-foreground", children: labels.rowsSelected(
|
|
2404
2477
|
table.getFilteredSelectedRowModel().rows.length,
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
table.getFilteredRowModel().rows.length,
|
|
2408
|
-
" row(s) selected."
|
|
2409
|
-
] }),
|
|
2478
|
+
table.getFilteredRowModel().rows.length
|
|
2479
|
+
) }),
|
|
2410
2480
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2411
|
-
/* @__PURE__ */
|
|
2412
|
-
"Page ",
|
|
2481
|
+
/* @__PURE__ */ jsx("div", { className: "font-mono text-xs text-muted-foreground", children: labels.pageOf(
|
|
2413
2482
|
table.getState().pagination.pageIndex + 1,
|
|
2414
|
-
" of",
|
|
2415
|
-
" ",
|
|
2416
2483
|
table.getPageCount()
|
|
2417
|
-
|
|
2484
|
+
) }),
|
|
2418
2485
|
/* @__PURE__ */ jsx(
|
|
2419
2486
|
Button,
|
|
2420
2487
|
{
|
|
@@ -2423,8 +2490,8 @@ function DataTablePagination({
|
|
|
2423
2490
|
className: "h-8 border-2",
|
|
2424
2491
|
onClick: () => table.previousPage(),
|
|
2425
2492
|
disabled: !table.getCanPreviousPage(),
|
|
2426
|
-
"aria-label":
|
|
2427
|
-
children:
|
|
2493
|
+
"aria-label": labels.previous,
|
|
2494
|
+
children: labels.previous
|
|
2428
2495
|
}
|
|
2429
2496
|
),
|
|
2430
2497
|
/* @__PURE__ */ jsx(
|
|
@@ -2435,8 +2502,8 @@ function DataTablePagination({
|
|
|
2435
2502
|
className: "h-8 border-2",
|
|
2436
2503
|
onClick: () => table.nextPage(),
|
|
2437
2504
|
disabled: !table.getCanNextPage(),
|
|
2438
|
-
"aria-label":
|
|
2439
|
-
children:
|
|
2505
|
+
"aria-label": labels.next,
|
|
2506
|
+
children: labels.next
|
|
2440
2507
|
}
|
|
2441
2508
|
)
|
|
2442
2509
|
] })
|
|
@@ -2452,7 +2519,8 @@ function DataTableToolbar({ children, className }) {
|
|
|
2452
2519
|
}
|
|
2453
2520
|
);
|
|
2454
2521
|
}
|
|
2455
|
-
function createSelectColumn() {
|
|
2522
|
+
function createSelectColumn(labels) {
|
|
2523
|
+
const resolved = resolveLabels(defaultLabels, void 0, labels);
|
|
2456
2524
|
return {
|
|
2457
2525
|
id: "select",
|
|
2458
2526
|
header: ({ table }) => /* @__PURE__ */ jsx(
|
|
@@ -2460,7 +2528,7 @@ function createSelectColumn() {
|
|
|
2460
2528
|
{
|
|
2461
2529
|
checked: table.getIsAllPageRowsSelected() || table.getIsSomePageRowsSelected() && "indeterminate",
|
|
2462
2530
|
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
2463
|
-
"aria-label":
|
|
2531
|
+
"aria-label": resolved.selectAll
|
|
2464
2532
|
}
|
|
2465
2533
|
),
|
|
2466
2534
|
cell: ({ row }) => /* @__PURE__ */ jsx(
|
|
@@ -2468,7 +2536,7 @@ function createSelectColumn() {
|
|
|
2468
2536
|
{
|
|
2469
2537
|
checked: row.getIsSelected(),
|
|
2470
2538
|
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
2471
|
-
"aria-label":
|
|
2539
|
+
"aria-label": resolved.selectRow
|
|
2472
2540
|
}
|
|
2473
2541
|
),
|
|
2474
2542
|
enableSorting: false,
|
|
@@ -2479,9 +2547,12 @@ function DataTable({
|
|
|
2479
2547
|
columns,
|
|
2480
2548
|
data,
|
|
2481
2549
|
className,
|
|
2482
|
-
toolbar
|
|
2550
|
+
toolbar,
|
|
2551
|
+
labels: labelsProp
|
|
2483
2552
|
}) {
|
|
2484
2553
|
var _a;
|
|
2554
|
+
const ctx = useLabels();
|
|
2555
|
+
const labels = resolveLabels(defaultLabels, ctx.dataTable, labelsProp);
|
|
2485
2556
|
const [sorting, setSorting] = React3.useState([]);
|
|
2486
2557
|
const [columnFilters, setColumnFilters] = React3.useState([]);
|
|
2487
2558
|
const [columnVisibility, setColumnVisibility] = React3.useState({});
|
|
@@ -2527,34 +2598,56 @@ function DataTable({
|
|
|
2527
2598
|
{
|
|
2528
2599
|
colSpan: columns.length,
|
|
2529
2600
|
className: "h-24 text-center text-muted-foreground",
|
|
2530
|
-
children:
|
|
2601
|
+
children: labels.noResults
|
|
2531
2602
|
}
|
|
2532
2603
|
) }) })
|
|
2533
2604
|
] }) }),
|
|
2534
|
-
/* @__PURE__ */ jsx(DataTablePagination, { table })
|
|
2605
|
+
/* @__PURE__ */ jsx(DataTablePagination, { table, labels: labelsProp })
|
|
2535
2606
|
] });
|
|
2536
2607
|
}
|
|
2537
|
-
function
|
|
2538
|
-
return new Intl.DateTimeFormat(
|
|
2608
|
+
function defaultFormatDate(date, locale) {
|
|
2609
|
+
return new Intl.DateTimeFormat(locale, {
|
|
2539
2610
|
month: "long",
|
|
2540
2611
|
day: "numeric",
|
|
2541
2612
|
year: "numeric"
|
|
2542
2613
|
}).format(date);
|
|
2543
2614
|
}
|
|
2544
|
-
function
|
|
2545
|
-
return new Intl.DateTimeFormat(
|
|
2615
|
+
function defaultFormatDateShort(date, locale) {
|
|
2616
|
+
return new Intl.DateTimeFormat(locale, {
|
|
2546
2617
|
month: "short",
|
|
2547
2618
|
day: "numeric",
|
|
2548
2619
|
year: "numeric"
|
|
2549
2620
|
}).format(date);
|
|
2550
2621
|
}
|
|
2622
|
+
var defaultDatePickerLabels = {
|
|
2623
|
+
placeholder: "Pick a date",
|
|
2624
|
+
rangePlaceholder: "Pick a date range",
|
|
2625
|
+
locale: "en-US",
|
|
2626
|
+
formatDate: (date) => defaultFormatDate(date, "en-US"),
|
|
2627
|
+
formatDateShort: (date) => defaultFormatDateShort(date, "en-US")
|
|
2628
|
+
};
|
|
2629
|
+
function resolveDatePickerLabels(context, prop) {
|
|
2630
|
+
var _a, _b, _c, _d;
|
|
2631
|
+
const merged = resolveLabels(defaultDatePickerLabels, context, prop);
|
|
2632
|
+
const locale = merged.locale;
|
|
2633
|
+
return __spreadProps(__spreadValues({}, merged), {
|
|
2634
|
+
formatDate: (_b = (_a = prop == null ? void 0 : prop.formatDate) != null ? _a : context == null ? void 0 : context.formatDate) != null ? _b : ((date) => defaultFormatDate(date, locale)),
|
|
2635
|
+
formatDateShort: (_d = (_c = prop == null ? void 0 : prop.formatDateShort) != null ? _c : context == null ? void 0 : context.formatDateShort) != null ? _d : ((date) => defaultFormatDateShort(date, locale))
|
|
2636
|
+
});
|
|
2637
|
+
}
|
|
2551
2638
|
function DatePicker({
|
|
2552
2639
|
date,
|
|
2553
2640
|
onDateChange,
|
|
2554
|
-
|
|
2641
|
+
// Deprecated; forwarded into the labels API below for backward compatibility.
|
|
2642
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2643
|
+
placeholder,
|
|
2644
|
+
labels: labelsProp,
|
|
2555
2645
|
className,
|
|
2556
2646
|
disabled
|
|
2557
2647
|
}) {
|
|
2648
|
+
const ctx = useLabels();
|
|
2649
|
+
const mergedProp = __spreadValues(__spreadValues({}, labelsProp), placeholder != null && { placeholder });
|
|
2650
|
+
const labels = resolveDatePickerLabels(ctx.datePicker, mergedProp);
|
|
2558
2651
|
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
2559
2652
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
2560
2653
|
Button,
|
|
@@ -2568,7 +2661,7 @@ function DatePicker({
|
|
|
2568
2661
|
),
|
|
2569
2662
|
children: [
|
|
2570
2663
|
/* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
|
|
2571
|
-
date ? /* @__PURE__ */ jsx("span", { children: formatDate(date) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: placeholder })
|
|
2664
|
+
date ? /* @__PURE__ */ jsx("span", { children: labels.formatDate(date) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: labels.placeholder })
|
|
2572
2665
|
]
|
|
2573
2666
|
}
|
|
2574
2667
|
) }),
|
|
@@ -2585,10 +2678,16 @@ function DatePicker({
|
|
|
2585
2678
|
function DateRangePicker({
|
|
2586
2679
|
dateRange,
|
|
2587
2680
|
onDateRangeChange,
|
|
2588
|
-
|
|
2681
|
+
// Deprecated; forwarded into the labels API below for backward compatibility.
|
|
2682
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2683
|
+
placeholder,
|
|
2684
|
+
labels: labelsProp,
|
|
2589
2685
|
className,
|
|
2590
2686
|
disabled
|
|
2591
2687
|
}) {
|
|
2688
|
+
const ctx = useLabels();
|
|
2689
|
+
const mergedProp = __spreadValues(__spreadValues({}, labelsProp), placeholder != null && { rangePlaceholder: placeholder });
|
|
2690
|
+
const labels = resolveDatePickerLabels(ctx.datePicker, mergedProp);
|
|
2592
2691
|
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
2593
2692
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
2594
2693
|
Button,
|
|
@@ -2603,9 +2702,9 @@ function DateRangePicker({
|
|
|
2603
2702
|
children: [
|
|
2604
2703
|
/* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
|
|
2605
2704
|
(dateRange == null ? void 0 : dateRange.from) ? /* @__PURE__ */ jsxs("span", { children: [
|
|
2606
|
-
formatDateShort(dateRange.from),
|
|
2607
|
-
dateRange.to && ` \u2013 ${formatDateShort(dateRange.to)}`
|
|
2608
|
-
] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children:
|
|
2705
|
+
labels.formatDateShort(dateRange.from),
|
|
2706
|
+
dateRange.to && ` \u2013 ${labels.formatDateShort(dateRange.to)}`
|
|
2707
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: labels.rangePlaceholder })
|
|
2609
2708
|
]
|
|
2610
2709
|
}
|
|
2611
2710
|
) }),
|
|
@@ -3949,13 +4048,29 @@ function NavigationMenuIndicator(_a) {
|
|
|
3949
4048
|
})
|
|
3950
4049
|
);
|
|
3951
4050
|
}
|
|
4051
|
+
var defaultPaginationLabels = {
|
|
4052
|
+
pagination: "pagination",
|
|
4053
|
+
previous: "Previous",
|
|
4054
|
+
next: "Next",
|
|
4055
|
+
morePages: "More pages"
|
|
4056
|
+
};
|
|
3952
4057
|
function Pagination(_a) {
|
|
3953
|
-
var _b = _a, {
|
|
4058
|
+
var _b = _a, {
|
|
4059
|
+
className,
|
|
4060
|
+
"aria-label": ariaLabel,
|
|
4061
|
+
labels: labelsProp
|
|
4062
|
+
} = _b, props = __objRest(_b, [
|
|
4063
|
+
"className",
|
|
4064
|
+
"aria-label",
|
|
4065
|
+
"labels"
|
|
4066
|
+
]);
|
|
4067
|
+
const ctx = useLabels();
|
|
4068
|
+
const labels = resolveLabels(defaultPaginationLabels, ctx.pagination, labelsProp);
|
|
3954
4069
|
return /* @__PURE__ */ jsx(
|
|
3955
4070
|
"nav",
|
|
3956
4071
|
__spreadValues({
|
|
3957
4072
|
role: "navigation",
|
|
3958
|
-
"aria-label":
|
|
4073
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.pagination,
|
|
3959
4074
|
"data-slot": "pagination",
|
|
3960
4075
|
className: cn("mx-auto flex w-full justify-center", className)
|
|
3961
4076
|
}, props)
|
|
@@ -4015,41 +4130,57 @@ function PaginationLink(_a) {
|
|
|
4015
4130
|
}
|
|
4016
4131
|
function PaginationPrevious(_a) {
|
|
4017
4132
|
var _b = _a, {
|
|
4018
|
-
className
|
|
4133
|
+
className,
|
|
4134
|
+
label,
|
|
4135
|
+
labels: labelsProp
|
|
4019
4136
|
} = _b, props = __objRest(_b, [
|
|
4020
|
-
"className"
|
|
4137
|
+
"className",
|
|
4138
|
+
"label",
|
|
4139
|
+
"labels"
|
|
4021
4140
|
]);
|
|
4141
|
+
var _a2;
|
|
4142
|
+
const ctx = useLabels();
|
|
4143
|
+
const labels = resolveLabels(defaultPaginationLabels, ctx.pagination, labelsProp);
|
|
4144
|
+
const resolvedLabel = label != null ? label : labels.previous;
|
|
4022
4145
|
return /* @__PURE__ */ jsxs(
|
|
4023
4146
|
PaginationLink,
|
|
4024
4147
|
__spreadProps(__spreadValues({
|
|
4025
|
-
"aria-label": "
|
|
4148
|
+
"aria-label": (_a2 = props["aria-label"]) != null ? _a2 : resolvedLabel,
|
|
4026
4149
|
size: "default",
|
|
4027
4150
|
"data-slot": "pagination-previous",
|
|
4028
4151
|
className: cn("gap-1 ps-2.5", className)
|
|
4029
4152
|
}, props), {
|
|
4030
4153
|
children: [
|
|
4031
4154
|
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
4032
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
4155
|
+
/* @__PURE__ */ jsx("span", { children: resolvedLabel })
|
|
4033
4156
|
]
|
|
4034
4157
|
})
|
|
4035
4158
|
);
|
|
4036
4159
|
}
|
|
4037
4160
|
function PaginationNext(_a) {
|
|
4038
4161
|
var _b = _a, {
|
|
4039
|
-
className
|
|
4162
|
+
className,
|
|
4163
|
+
label,
|
|
4164
|
+
labels: labelsProp
|
|
4040
4165
|
} = _b, props = __objRest(_b, [
|
|
4041
|
-
"className"
|
|
4166
|
+
"className",
|
|
4167
|
+
"label",
|
|
4168
|
+
"labels"
|
|
4042
4169
|
]);
|
|
4170
|
+
var _a2;
|
|
4171
|
+
const ctx = useLabels();
|
|
4172
|
+
const labels = resolveLabels(defaultPaginationLabels, ctx.pagination, labelsProp);
|
|
4173
|
+
const resolvedLabel = label != null ? label : labels.next;
|
|
4043
4174
|
return /* @__PURE__ */ jsxs(
|
|
4044
4175
|
PaginationLink,
|
|
4045
4176
|
__spreadProps(__spreadValues({
|
|
4046
|
-
"aria-label": "
|
|
4177
|
+
"aria-label": (_a2 = props["aria-label"]) != null ? _a2 : resolvedLabel,
|
|
4047
4178
|
size: "default",
|
|
4048
4179
|
"data-slot": "pagination-next",
|
|
4049
4180
|
className: cn("gap-1 pe-2.5", className)
|
|
4050
4181
|
}, props), {
|
|
4051
4182
|
children: [
|
|
4052
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
4183
|
+
/* @__PURE__ */ jsx("span", { children: resolvedLabel }),
|
|
4053
4184
|
/* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
4054
4185
|
]
|
|
4055
4186
|
})
|
|
@@ -4057,10 +4188,17 @@ function PaginationNext(_a) {
|
|
|
4057
4188
|
}
|
|
4058
4189
|
function PaginationEllipsis(_a) {
|
|
4059
4190
|
var _b = _a, {
|
|
4060
|
-
className
|
|
4191
|
+
className,
|
|
4192
|
+
label,
|
|
4193
|
+
labels: labelsProp
|
|
4061
4194
|
} = _b, props = __objRest(_b, [
|
|
4062
|
-
"className"
|
|
4195
|
+
"className",
|
|
4196
|
+
"label",
|
|
4197
|
+
"labels"
|
|
4063
4198
|
]);
|
|
4199
|
+
const ctx = useLabels();
|
|
4200
|
+
const labels = resolveLabels(defaultPaginationLabels, ctx.pagination, labelsProp);
|
|
4201
|
+
const resolvedLabel = label != null ? label : labels.morePages;
|
|
4064
4202
|
return /* @__PURE__ */ jsxs(
|
|
4065
4203
|
"span",
|
|
4066
4204
|
__spreadProps(__spreadValues({
|
|
@@ -4070,7 +4208,7 @@ function PaginationEllipsis(_a) {
|
|
|
4070
4208
|
}, props), {
|
|
4071
4209
|
children: [
|
|
4072
4210
|
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
4073
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
4211
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: resolvedLabel })
|
|
4074
4212
|
]
|
|
4075
4213
|
})
|
|
4076
4214
|
);
|
|
@@ -4234,13 +4372,19 @@ function ScrollBar(_a) {
|
|
|
4234
4372
|
})
|
|
4235
4373
|
);
|
|
4236
4374
|
}
|
|
4375
|
+
var defaultSearchFieldLabels = {
|
|
4376
|
+
placeholder: "Search...",
|
|
4377
|
+
clearSearch: "Clear search"
|
|
4378
|
+
};
|
|
4237
4379
|
function SearchField(_a) {
|
|
4238
4380
|
var _b = _a, {
|
|
4239
|
-
placeholder
|
|
4381
|
+
placeholder,
|
|
4240
4382
|
shortcut,
|
|
4241
4383
|
value,
|
|
4242
4384
|
onChange,
|
|
4243
4385
|
onClear,
|
|
4386
|
+
clearLabel,
|
|
4387
|
+
labels: labelsProp,
|
|
4244
4388
|
className
|
|
4245
4389
|
} = _b, props = __objRest(_b, [
|
|
4246
4390
|
"placeholder",
|
|
@@ -4248,8 +4392,14 @@ function SearchField(_a) {
|
|
|
4248
4392
|
"value",
|
|
4249
4393
|
"onChange",
|
|
4250
4394
|
"onClear",
|
|
4395
|
+
"clearLabel",
|
|
4396
|
+
"labels",
|
|
4251
4397
|
"className"
|
|
4252
4398
|
]);
|
|
4399
|
+
const ctx = useLabels();
|
|
4400
|
+
const labels = resolveLabels(defaultSearchFieldLabels, ctx.searchField, labelsProp);
|
|
4401
|
+
const resolvedPlaceholder = placeholder != null ? placeholder : labels.placeholder;
|
|
4402
|
+
const resolvedClearLabel = clearLabel != null ? clearLabel : labels.clearSearch;
|
|
4253
4403
|
return /* @__PURE__ */ jsxs(
|
|
4254
4404
|
InputGroup,
|
|
4255
4405
|
__spreadProps(__spreadValues({
|
|
@@ -4263,10 +4413,10 @@ function SearchField(_a) {
|
|
|
4263
4413
|
Input,
|
|
4264
4414
|
{
|
|
4265
4415
|
type: "search",
|
|
4266
|
-
placeholder,
|
|
4416
|
+
placeholder: resolvedPlaceholder,
|
|
4267
4417
|
value,
|
|
4268
4418
|
onChange: (e) => onChange(e.target.value),
|
|
4269
|
-
"aria-label":
|
|
4419
|
+
"aria-label": resolvedPlaceholder,
|
|
4270
4420
|
className: "border-0 focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
4271
4421
|
}
|
|
4272
4422
|
),
|
|
@@ -4274,7 +4424,7 @@ function SearchField(_a) {
|
|
|
4274
4424
|
"button",
|
|
4275
4425
|
{
|
|
4276
4426
|
type: "button",
|
|
4277
|
-
"aria-label":
|
|
4427
|
+
"aria-label": resolvedClearLabel,
|
|
4278
4428
|
onClick: () => {
|
|
4279
4429
|
onChange("");
|
|
4280
4430
|
onClear == null ? void 0 : onClear();
|
|
@@ -4496,6 +4646,9 @@ function Separator6(_a) {
|
|
|
4496
4646
|
}, props)
|
|
4497
4647
|
);
|
|
4498
4648
|
}
|
|
4649
|
+
var defaultSheetLabels = {
|
|
4650
|
+
close: "Close"
|
|
4651
|
+
};
|
|
4499
4652
|
var Sheet = DialogPrimitive.Root;
|
|
4500
4653
|
var SheetTrigger = DialogPrimitive.Trigger;
|
|
4501
4654
|
var SheetClose = DialogPrimitive.Close;
|
|
@@ -4542,13 +4695,17 @@ function SheetContent(_a) {
|
|
|
4542
4695
|
side = "right",
|
|
4543
4696
|
className,
|
|
4544
4697
|
children,
|
|
4698
|
+
labels: labelsProp,
|
|
4545
4699
|
ref
|
|
4546
4700
|
} = _b, props = __objRest(_b, [
|
|
4547
4701
|
"side",
|
|
4548
4702
|
"className",
|
|
4549
4703
|
"children",
|
|
4704
|
+
"labels",
|
|
4550
4705
|
"ref"
|
|
4551
4706
|
]);
|
|
4707
|
+
const ctx = useLabels();
|
|
4708
|
+
const labels = resolveLabels(defaultSheetLabels, ctx.sheet, labelsProp);
|
|
4552
4709
|
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
4553
4710
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
4554
4711
|
/* @__PURE__ */ jsxs(
|
|
@@ -4562,7 +4719,7 @@ function SheetContent(_a) {
|
|
|
4562
4719
|
children,
|
|
4563
4720
|
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute end-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
4564
4721
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
4565
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
4722
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: labels.close })
|
|
4566
4723
|
] })
|
|
4567
4724
|
]
|
|
4568
4725
|
})
|
|
@@ -4690,6 +4847,11 @@ function TooltipContent(_a) {
|
|
|
4690
4847
|
}, props)
|
|
4691
4848
|
);
|
|
4692
4849
|
}
|
|
4850
|
+
var defaultSidebarLabels = {
|
|
4851
|
+
toggleSidebar: "Toggle Sidebar",
|
|
4852
|
+
mobileTitle: "Sidebar",
|
|
4853
|
+
mobileDescription: "Displays the mobile sidebar."
|
|
4854
|
+
};
|
|
4693
4855
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
4694
4856
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
4695
4857
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -4789,6 +4951,9 @@ function Sidebar(_a) {
|
|
|
4789
4951
|
collapsible = "offcanvas",
|
|
4790
4952
|
className,
|
|
4791
4953
|
children,
|
|
4954
|
+
mobileTitle,
|
|
4955
|
+
mobileDescription,
|
|
4956
|
+
labels: labelsProp,
|
|
4792
4957
|
ref
|
|
4793
4958
|
} = _b, props = __objRest(_b, [
|
|
4794
4959
|
"side",
|
|
@@ -4796,9 +4961,16 @@ function Sidebar(_a) {
|
|
|
4796
4961
|
"collapsible",
|
|
4797
4962
|
"className",
|
|
4798
4963
|
"children",
|
|
4964
|
+
"mobileTitle",
|
|
4965
|
+
"mobileDescription",
|
|
4966
|
+
"labels",
|
|
4799
4967
|
"ref"
|
|
4800
4968
|
]);
|
|
4801
4969
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
4970
|
+
const ctx = useLabels();
|
|
4971
|
+
const labels = resolveLabels(defaultSidebarLabels, ctx.sidebar, labelsProp);
|
|
4972
|
+
const resolvedMobileTitle = mobileTitle != null ? mobileTitle : labels.mobileTitle;
|
|
4973
|
+
const resolvedMobileDescription = mobileDescription != null ? mobileDescription : labels.mobileDescription;
|
|
4802
4974
|
if (collapsible === "none") {
|
|
4803
4975
|
return /* @__PURE__ */ jsx(
|
|
4804
4976
|
"div",
|
|
@@ -4828,8 +5000,8 @@ function Sidebar(_a) {
|
|
|
4828
5000
|
side,
|
|
4829
5001
|
children: [
|
|
4830
5002
|
/* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
|
|
4831
|
-
/* @__PURE__ */ jsx(SheetTitle, { children:
|
|
4832
|
-
/* @__PURE__ */ jsx(SheetDescription, { children:
|
|
5003
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: resolvedMobileTitle }),
|
|
5004
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: resolvedMobileDescription })
|
|
4833
5005
|
] }),
|
|
4834
5006
|
/* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
|
|
4835
5007
|
]
|
|
@@ -4887,13 +5059,20 @@ function SidebarTrigger(_a) {
|
|
|
4887
5059
|
var _b = _a, {
|
|
4888
5060
|
className,
|
|
4889
5061
|
onClick,
|
|
5062
|
+
label,
|
|
5063
|
+
labels: labelsProp,
|
|
4890
5064
|
ref
|
|
4891
5065
|
} = _b, props = __objRest(_b, [
|
|
4892
5066
|
"className",
|
|
4893
5067
|
"onClick",
|
|
5068
|
+
"label",
|
|
5069
|
+
"labels",
|
|
4894
5070
|
"ref"
|
|
4895
5071
|
]);
|
|
4896
5072
|
const { toggleSidebar } = useSidebar();
|
|
5073
|
+
const ctx = useLabels();
|
|
5074
|
+
const labels = resolveLabels(defaultSidebarLabels, ctx.sidebar, labelsProp);
|
|
5075
|
+
const resolvedLabel = label != null ? label : labels.toggleSidebar;
|
|
4897
5076
|
return /* @__PURE__ */ jsxs(
|
|
4898
5077
|
Button,
|
|
4899
5078
|
__spreadProps(__spreadValues({
|
|
@@ -4910,7 +5089,7 @@ function SidebarTrigger(_a) {
|
|
|
4910
5089
|
}, props), {
|
|
4911
5090
|
children: [
|
|
4912
5091
|
/* @__PURE__ */ jsx(PanelLeft, {}),
|
|
4913
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
5092
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: resolvedLabel })
|
|
4914
5093
|
]
|
|
4915
5094
|
})
|
|
4916
5095
|
);
|
|
@@ -4918,22 +5097,29 @@ function SidebarTrigger(_a) {
|
|
|
4918
5097
|
function SidebarRail(_a) {
|
|
4919
5098
|
var _b = _a, {
|
|
4920
5099
|
className,
|
|
5100
|
+
label,
|
|
5101
|
+
labels: labelsProp,
|
|
4921
5102
|
ref
|
|
4922
5103
|
} = _b, props = __objRest(_b, [
|
|
4923
5104
|
"className",
|
|
5105
|
+
"label",
|
|
5106
|
+
"labels",
|
|
4924
5107
|
"ref"
|
|
4925
5108
|
]);
|
|
4926
5109
|
const { toggleSidebar } = useSidebar();
|
|
5110
|
+
const ctx = useLabels();
|
|
5111
|
+
const labels = resolveLabels(defaultSidebarLabels, ctx.sidebar, labelsProp);
|
|
5112
|
+
const resolvedLabel = label != null ? label : labels.toggleSidebar;
|
|
4927
5113
|
return /* @__PURE__ */ jsx(
|
|
4928
5114
|
"button",
|
|
4929
5115
|
__spreadValues({
|
|
4930
5116
|
ref,
|
|
4931
5117
|
"data-slot": "sidebar-rail",
|
|
4932
5118
|
"data-sidebar": "rail",
|
|
4933
|
-
"aria-label":
|
|
5119
|
+
"aria-label": resolvedLabel,
|
|
4934
5120
|
tabIndex: -1,
|
|
4935
5121
|
onClick: toggleSidebar,
|
|
4936
|
-
title:
|
|
5122
|
+
title: resolvedLabel,
|
|
4937
5123
|
className: cn(
|
|
4938
5124
|
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-end-4 group-data-[side=right]:start-0 sm:flex",
|
|
4939
5125
|
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
@@ -5534,6 +5720,9 @@ function Spacer(_a) {
|
|
|
5534
5720
|
}, props)
|
|
5535
5721
|
);
|
|
5536
5722
|
}
|
|
5723
|
+
var defaultSpinnerLabels = {
|
|
5724
|
+
loading: "Loading\u2026"
|
|
5725
|
+
};
|
|
5537
5726
|
var spinnerVariants = cva(
|
|
5538
5727
|
"rounded-full border-2",
|
|
5539
5728
|
{
|
|
@@ -5552,11 +5741,15 @@ var spinnerVariants = cva(
|
|
|
5552
5741
|
function Spinner(_a) {
|
|
5553
5742
|
var _b = _a, {
|
|
5554
5743
|
className,
|
|
5555
|
-
size
|
|
5744
|
+
size,
|
|
5745
|
+
labels: labelsProp
|
|
5556
5746
|
} = _b, props = __objRest(_b, [
|
|
5557
5747
|
"className",
|
|
5558
|
-
"size"
|
|
5748
|
+
"size",
|
|
5749
|
+
"labels"
|
|
5559
5750
|
]);
|
|
5751
|
+
const ctx = useLabels();
|
|
5752
|
+
const labels = resolveLabels(defaultSpinnerLabels, ctx.spinner, labelsProp);
|
|
5560
5753
|
return /* @__PURE__ */ jsx(
|
|
5561
5754
|
"div",
|
|
5562
5755
|
__spreadProps(__spreadValues({
|
|
@@ -5564,7 +5757,7 @@ function Spinner(_a) {
|
|
|
5564
5757
|
role: "status",
|
|
5565
5758
|
className: cn(spinnerVariants({ size }), className)
|
|
5566
5759
|
}, props), {
|
|
5567
|
-
children: /* @__PURE__ */ jsx("span", { className: "sr-only", children:
|
|
5760
|
+
children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: labels.loading })
|
|
5568
5761
|
})
|
|
5569
5762
|
);
|
|
5570
5763
|
}
|
|
@@ -5861,6 +6054,6 @@ function Mono(_a) {
|
|
|
5861
6054
|
);
|
|
5862
6055
|
}
|
|
5863
6056
|
|
|
5864
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, Calendar, CalendarDayButton, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Cluster, Code, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DataTableColumnHeader, DataTablePagination, DataTableToolbar, DataTableViewOptions, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Divider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyAction, EmptyDescription, EmptyIcon, EmptyTitle, Field, FieldError, FieldHint, FieldLabel, Fieldset, Form, FormActions, FormActionsPrimary, FormActionsSecondary, FormSection, FormSectionContent, FormSectionDescription, FormSectionHeader, FormSectionTitle, Grid, H1, H2, H3, H4, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupPrefix, InputGroupSuffix, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item4 as Item, ItemIcon, ItemLabel, Kbd, Label3 as Label, Large, Lead, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Mono, Muted, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, P, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup4 as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, SearchField, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator6 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Small, Spacer, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, createSelectColumn, nativeSelectVariants, navigationMenuTriggerStyle, spinnerVariants, toggleVariants, useDirection, useFieldContext, useSidebar };
|
|
6057
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, Calendar, CalendarDayButton, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Cluster, Code, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DataTableColumnHeader, DataTablePagination, DataTableToolbar, DataTableViewOptions, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Divider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyAction, EmptyDescription, EmptyIcon, EmptyTitle, Field, FieldError, FieldHint, FieldLabel, Fieldset, Form, FormActions, FormActionsPrimary, FormActionsSecondary, FormSection, FormSectionContent, FormSectionDescription, FormSectionHeader, FormSectionTitle, Grid, H1, H2, H3, H4, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupPrefix, InputGroupSuffix, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item4 as Item, ItemIcon, ItemLabel, Kbd, Label3 as Label, Large, Lead, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Mono, Muted, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, P, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup4 as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, SearchField, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator6 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Small, Spacer, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, createSelectColumn, nativeSelectVariants, navigationMenuTriggerStyle, sidebarMenuButtonVariants, spinnerVariants, toggleVariants, useDirection, useFieldContext, useSidebar };
|
|
5865
6058
|
//# sourceMappingURL=index.js.map
|
|
5866
6059
|
//# sourceMappingURL=index.js.map
|