@umami/react-zen 1.0.0 → 1.0.2
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.d.mts +86 -15
- package/dist/index.d.ts +86 -15
- package/dist/index.js +783 -209
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +700 -135
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
- package/styles.css +253 -3
- package/styles.full.css +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var autocomplete = require('@base-ui/react/autocomplete');
|
|
5
5
|
var lucide_react_star = require('lucide-react');
|
|
6
|
-
var
|
|
6
|
+
var React4 = require('react');
|
|
7
7
|
var classVarianceAuthority = require('class-variance-authority');
|
|
8
8
|
var cn = require('cn');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -14,12 +14,15 @@ var mergeProps = require('@base-ui/react/merge-props');
|
|
|
14
14
|
var useRender = require('@base-ui/react/use-render');
|
|
15
15
|
var checkboxGroup = require('@base-ui/react/checkbox-group');
|
|
16
16
|
var alertDialog = require('@base-ui/react/alert-dialog');
|
|
17
|
+
var reactTable = require('@tanstack/react-table');
|
|
17
18
|
var checkbox = require('@base-ui/react/checkbox');
|
|
18
19
|
var reactDayPicker = require('react-day-picker');
|
|
19
20
|
var popover = require('@base-ui/react/popover');
|
|
20
21
|
var reactHookForm = require('react-hook-form');
|
|
21
22
|
var _switch = require('@base-ui/react/switch');
|
|
22
23
|
var toggle = require('@base-ui/react/toggle');
|
|
24
|
+
var core = require('shiki/core');
|
|
25
|
+
var javascript = require('shiki/engine/javascript');
|
|
23
26
|
var zustand = require('zustand');
|
|
24
27
|
var web = require('@react-spring/web');
|
|
25
28
|
var meter = require('@base-ui/react/meter');
|
|
@@ -71,7 +74,7 @@ function _interopNamespace(e) {
|
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
var lucide_react_star__namespace = /*#__PURE__*/_interopNamespace(lucide_react_star);
|
|
74
|
-
var
|
|
77
|
+
var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
|
|
75
78
|
var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
|
|
76
79
|
var ResizablePrimitive__namespace = /*#__PURE__*/_interopNamespace(ResizablePrimitive);
|
|
77
80
|
|
|
@@ -89,7 +92,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
89
92
|
};
|
|
90
93
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
|
|
91
94
|
function useFieldId(id) {
|
|
92
|
-
const generatedId =
|
|
95
|
+
const generatedId = React4.useId();
|
|
93
96
|
return id ?? generatedId;
|
|
94
97
|
}
|
|
95
98
|
function Label({ className, ...props }) {
|
|
@@ -291,7 +294,7 @@ function FieldError({
|
|
|
291
294
|
errors,
|
|
292
295
|
...props
|
|
293
296
|
}) {
|
|
294
|
-
const content =
|
|
297
|
+
const content = React4.useMemo(() => {
|
|
295
298
|
if (children) {
|
|
296
299
|
return children;
|
|
297
300
|
}
|
|
@@ -532,10 +535,7 @@ function debounce(func, delay) {
|
|
|
532
535
|
}, delay);
|
|
533
536
|
};
|
|
534
537
|
}
|
|
535
|
-
|
|
536
|
-
return data.length && data?.[0]?.id === void 0 ? data.map((row, id) => ({ ...row, id })) : data;
|
|
537
|
-
}
|
|
538
|
-
var Autocomplete = React3.forwardRef(
|
|
538
|
+
var Autocomplete = React4.forwardRef(
|
|
539
539
|
({
|
|
540
540
|
id,
|
|
541
541
|
items,
|
|
@@ -1416,9 +1416,12 @@ var shadowMap = {
|
|
|
1416
1416
|
true: "shadow-md"
|
|
1417
1417
|
};
|
|
1418
1418
|
var statusColorTokens = ["destructive", "success", "warning", "info"];
|
|
1419
|
+
var textColorAliases = {
|
|
1420
|
+
muted: "muted-foreground"
|
|
1421
|
+
};
|
|
1419
1422
|
var textColorTokens = /* @__PURE__ */ new Set([
|
|
1420
1423
|
"foreground",
|
|
1421
|
-
"muted
|
|
1424
|
+
"muted",
|
|
1422
1425
|
"primary",
|
|
1423
1426
|
"primary-foreground",
|
|
1424
1427
|
"secondary-foreground",
|
|
@@ -1430,6 +1433,7 @@ var textColorTokens = /* @__PURE__ */ new Set([
|
|
|
1430
1433
|
]);
|
|
1431
1434
|
var backgroundColorTokens = /* @__PURE__ */ new Set([
|
|
1432
1435
|
"background",
|
|
1436
|
+
"page",
|
|
1433
1437
|
"card",
|
|
1434
1438
|
"popover",
|
|
1435
1439
|
"primary",
|
|
@@ -1827,19 +1831,19 @@ function mapHeadingSize(value) {
|
|
|
1827
1831
|
function mapFontWeight(value) {
|
|
1828
1832
|
return mapResponsive(value, (v) => fontWeightMap[v]);
|
|
1829
1833
|
}
|
|
1830
|
-
function mapColor(value, prefix, tokens) {
|
|
1834
|
+
function mapColor(value, prefix, tokens, aliases2 = {}) {
|
|
1831
1835
|
if (!value) return "";
|
|
1832
1836
|
if (value === "true") return `${prefix}-${defaultColorToken[prefix]}`;
|
|
1833
1837
|
if (value === "transparent") return `${prefix}-transparent`;
|
|
1834
|
-
if (tokens.has(value)) return `${prefix}-${value}`;
|
|
1838
|
+
if (tokens.has(value)) return `${prefix}-${aliases2[value] ?? value}`;
|
|
1835
1839
|
if (isTailwindColor(value)) return getTailwindColorClass(value, prefix);
|
|
1836
1840
|
return "";
|
|
1837
1841
|
}
|
|
1838
1842
|
function mapTextColor(value) {
|
|
1839
|
-
return mapColor(value, "text", textColorTokens);
|
|
1843
|
+
return mapColor(value, "text", textColorTokens, textColorAliases);
|
|
1840
1844
|
}
|
|
1841
1845
|
function mapDecorationColor(value) {
|
|
1842
|
-
return mapColor(value, "decoration", textColorTokens);
|
|
1846
|
+
return mapColor(value, "decoration", textColorTokens, textColorAliases);
|
|
1843
1847
|
}
|
|
1844
1848
|
function mapBackgroundColor(value) {
|
|
1845
1849
|
return mapColor(value, "bg", backgroundColorTokens);
|
|
@@ -2211,7 +2215,7 @@ function getCssColorValue(value) {
|
|
|
2211
2215
|
if (!value) return void 0;
|
|
2212
2216
|
if (value === "true") return `var(--${defaultColorToken.text})`;
|
|
2213
2217
|
if (value === "transparent") return "transparent";
|
|
2214
|
-
if (textColorTokens.has(value)) return `var(--${value})`;
|
|
2218
|
+
if (textColorTokens.has(value)) return `var(--${textColorAliases[value] ?? value})`;
|
|
2215
2219
|
const parts = value.split("-");
|
|
2216
2220
|
if (parts.length === 2 && tailwindColors.has(parts[0])) {
|
|
2217
2221
|
return tailwindColorHex[parts[0]]?.[parts[1]];
|
|
@@ -2626,12 +2630,12 @@ function resolveRender(render, props, defaultElement, state) {
|
|
|
2626
2630
|
if (typeof render === "function") {
|
|
2627
2631
|
return render(props, state ?? {});
|
|
2628
2632
|
}
|
|
2629
|
-
if (
|
|
2633
|
+
if (React4.isValidElement(render)) {
|
|
2630
2634
|
const renderProps = render.props;
|
|
2631
2635
|
const merged = mergeProps.mergeProps(props, renderProps);
|
|
2632
2636
|
const children = renderProps.children !== void 0 ? renderProps.children : props.children;
|
|
2633
2637
|
const className = [props.className, renderProps.className].filter(Boolean).join(" ") || void 0;
|
|
2634
|
-
return
|
|
2638
|
+
return React4.cloneElement(render, { ...merged, children, className });
|
|
2635
2639
|
}
|
|
2636
2640
|
return defaultElement;
|
|
2637
2641
|
}
|
|
@@ -2708,7 +2712,7 @@ function toStringValue(value) {
|
|
|
2708
2712
|
if (typeof value === "boolean") return value ? "true" : void 0;
|
|
2709
2713
|
return String(value);
|
|
2710
2714
|
}
|
|
2711
|
-
var Box =
|
|
2715
|
+
var Box = React4.forwardRef(function Box2({
|
|
2712
2716
|
display,
|
|
2713
2717
|
color,
|
|
2714
2718
|
backgroundColor,
|
|
@@ -2982,7 +2986,7 @@ function AlertDialogOverlay({
|
|
|
2982
2986
|
{
|
|
2983
2987
|
"data-slot": "alert-dialog-overlay",
|
|
2984
2988
|
className: cn.cn(
|
|
2985
|
-
"fixed inset-0 isolate z-50 bg-black/
|
|
2989
|
+
"fixed inset-0 isolate z-50 bg-black/50 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
2986
2990
|
className
|
|
2987
2991
|
),
|
|
2988
2992
|
...props
|
|
@@ -3135,10 +3139,10 @@ function ConfirmationDialog({
|
|
|
3135
3139
|
children,
|
|
3136
3140
|
...props
|
|
3137
3141
|
}) {
|
|
3138
|
-
const actionsRef =
|
|
3139
|
-
const [input, setInput] =
|
|
3140
|
-
const [pending, setPending] =
|
|
3141
|
-
const inputId =
|
|
3142
|
+
const actionsRef = React4.useRef(null);
|
|
3143
|
+
const [input, setInput] = React4.useState("");
|
|
3144
|
+
const [pending, setPending] = React4.useState(false);
|
|
3145
|
+
const inputId = React4.useId();
|
|
3142
3146
|
const canConfirm = input === value && !pending;
|
|
3143
3147
|
const handleOpenChange = (open, details) => {
|
|
3144
3148
|
if (!open) {
|
|
@@ -3235,9 +3239,9 @@ function CopyButton({
|
|
|
3235
3239
|
onClick,
|
|
3236
3240
|
...props
|
|
3237
3241
|
}) {
|
|
3238
|
-
const [copied, setCopied] =
|
|
3239
|
-
const timeoutRef =
|
|
3240
|
-
|
|
3242
|
+
const [copied, setCopied] = React4.useState(false);
|
|
3243
|
+
const timeoutRef = React4.useRef(void 0);
|
|
3244
|
+
React4.useEffect(() => {
|
|
3241
3245
|
return () => {
|
|
3242
3246
|
clearTimeout(timeoutRef.current);
|
|
3243
3247
|
};
|
|
@@ -3345,7 +3349,7 @@ function Grid({
|
|
|
3345
3349
|
children,
|
|
3346
3350
|
...props
|
|
3347
3351
|
}) {
|
|
3348
|
-
const reactId =
|
|
3352
|
+
const reactId = React4.useId();
|
|
3349
3353
|
const id = `zen-grid-${reactId.replace(/:/g, "")}`;
|
|
3350
3354
|
const isCustomColumns = typeof columns === "string" && !isPresetValue(columns);
|
|
3351
3355
|
const isCustomRows = typeof rows === "string" && !isPresetValue(rows);
|
|
@@ -3379,26 +3383,44 @@ function Grid({
|
|
|
3379
3383
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { ...props, className: classes, style: hasInlineStyles ? inlineStyles : void 0, children })
|
|
3380
3384
|
] });
|
|
3381
3385
|
}
|
|
3382
|
-
function
|
|
3383
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Flexbox, { ...props, direction: reverse ? "row-reverse" : "row", children });
|
|
3384
|
-
}
|
|
3385
|
-
function DataCard({ data = [], labelWidth = "auto", ...props }) {
|
|
3386
|
-
const rows = mapIdProperty(data);
|
|
3386
|
+
function DataCard({ data = [], labelWidth = "auto", className, ...props }) {
|
|
3387
3387
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3388
3388
|
Grid,
|
|
3389
3389
|
{
|
|
3390
|
+
"data-slot": "data-card",
|
|
3390
3391
|
width: "100%",
|
|
3391
3392
|
columns: `${labelWidth} 1fr`,
|
|
3392
3393
|
border: true,
|
|
3393
3394
|
borderRadius: "lg",
|
|
3394
|
-
padding: "6",
|
|
3395
3395
|
...props,
|
|
3396
|
-
|
|
3396
|
+
className: cn.cn("overflow-hidden text-sm", className),
|
|
3397
|
+
children: data.map((row, index) => {
|
|
3398
|
+
const isLast = index === data.length - 1;
|
|
3397
3399
|
return (
|
|
3398
3400
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows are static display data
|
|
3399
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3400
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3401
|
-
|
|
3401
|
+
/* @__PURE__ */ jsxRuntime.jsxs(React4.Fragment, { children: [
|
|
3402
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3403
|
+
"div",
|
|
3404
|
+
{
|
|
3405
|
+
"data-slot": "data-card-label",
|
|
3406
|
+
className: cn.cn(
|
|
3407
|
+
"flex items-center border-r bg-muted/50 py-2 pr-6 pl-4 font-medium text-foreground",
|
|
3408
|
+
!isLast && "border-b"
|
|
3409
|
+
),
|
|
3410
|
+
children: row?.label
|
|
3411
|
+
}
|
|
3412
|
+
),
|
|
3413
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3414
|
+
"div",
|
|
3415
|
+
{
|
|
3416
|
+
"data-slot": "data-card-value",
|
|
3417
|
+
className: cn.cn(
|
|
3418
|
+
"flex min-w-0 items-center px-4 py-2 wrap-anywhere",
|
|
3419
|
+
!isLast && "border-b"
|
|
3420
|
+
),
|
|
3421
|
+
children: row?.value
|
|
3422
|
+
}
|
|
3423
|
+
)
|
|
3402
3424
|
] }, index)
|
|
3403
3425
|
);
|
|
3404
3426
|
})
|
|
@@ -3531,139 +3553,334 @@ function TableCaption({
|
|
|
3531
3553
|
}
|
|
3532
3554
|
);
|
|
3533
3555
|
}
|
|
3534
|
-
var
|
|
3556
|
+
var features = reactTable.tableFeatures({
|
|
3557
|
+
columnFilteringFeature: reactTable.columnFilteringFeature,
|
|
3558
|
+
// required by globalFilteringFeature
|
|
3559
|
+
globalFilteringFeature: reactTable.globalFilteringFeature,
|
|
3560
|
+
rowPaginationFeature: reactTable.rowPaginationFeature,
|
|
3561
|
+
rowSelectionFeature: reactTable.rowSelectionFeature,
|
|
3562
|
+
rowSortingFeature: reactTable.rowSortingFeature,
|
|
3563
|
+
filteredRowModel: reactTable.createFilteredRowModel(),
|
|
3564
|
+
paginatedRowModel: reactTable.createPaginatedRowModel(),
|
|
3565
|
+
sortedRowModel: reactTable.createSortedRowModel(),
|
|
3566
|
+
filterFns: { includesString: reactTable.filterFn_includesString },
|
|
3567
|
+
sortFns: {
|
|
3568
|
+
alphanumeric: reactTable.sortFn_alphanumeric,
|
|
3569
|
+
basic: reactTable.sortFn_basic,
|
|
3570
|
+
datetime: reactTable.sortFn_datetime,
|
|
3571
|
+
text: reactTable.sortFn_text
|
|
3572
|
+
}
|
|
3573
|
+
});
|
|
3574
|
+
var SELECTION_COLUMN_WIDTH = "2.5rem";
|
|
3575
|
+
var ROW_CLASS = "grid [&>*:first-child]:pl-4";
|
|
3535
3576
|
var alignClasses = {
|
|
3536
3577
|
start: "justify-start text-left",
|
|
3537
3578
|
center: "justify-center text-center",
|
|
3538
3579
|
end: "justify-end text-right"
|
|
3539
3580
|
};
|
|
3581
|
+
function DataColumn(_props) {
|
|
3582
|
+
return null;
|
|
3583
|
+
}
|
|
3584
|
+
function resolve(updater, old) {
|
|
3585
|
+
return typeof updater === "function" ? updater(old) : updater;
|
|
3586
|
+
}
|
|
3587
|
+
function useControllableState(value, defaultValue, onChange) {
|
|
3588
|
+
const [uncontrolled, setUncontrolled] = React4.useState(defaultValue);
|
|
3589
|
+
const current = value === void 0 ? uncontrolled : value;
|
|
3590
|
+
const setValue = (next) => {
|
|
3591
|
+
if (value === void 0) {
|
|
3592
|
+
setUncontrolled(next);
|
|
3593
|
+
}
|
|
3594
|
+
onChange?.(next);
|
|
3595
|
+
};
|
|
3596
|
+
return [current, setValue];
|
|
3597
|
+
}
|
|
3598
|
+
function defaultGetRowId(row, index) {
|
|
3599
|
+
return row?.id !== void 0 && row?.id !== null ? String(row.id) : String(index);
|
|
3600
|
+
}
|
|
3601
|
+
function getColumnValue(column, row) {
|
|
3602
|
+
return column.value ? column.value(row) : row?.[column.id];
|
|
3603
|
+
}
|
|
3604
|
+
function renderCell(column, row, index) {
|
|
3605
|
+
const { children, as } = column;
|
|
3606
|
+
const content = typeof children === "function" ? children(row, index) : children !== void 0 && children !== null ? children : getColumnValue(column, row);
|
|
3607
|
+
return as ? React4.createElement(as, {}, content) : content;
|
|
3608
|
+
}
|
|
3540
3609
|
function DataTable({
|
|
3541
3610
|
data = [],
|
|
3542
3611
|
displayMode = "table",
|
|
3612
|
+
getRowId = defaultGetRowId,
|
|
3543
3613
|
selectionMode = "none",
|
|
3544
3614
|
selectedRows: selectedRowsProp,
|
|
3545
3615
|
defaultSelectedRows = [],
|
|
3546
3616
|
onSelectedRowsChange,
|
|
3617
|
+
sorting: sortingProp,
|
|
3618
|
+
defaultSorting = [],
|
|
3619
|
+
onSortingChange,
|
|
3620
|
+
filter = "",
|
|
3621
|
+
pageSize,
|
|
3622
|
+
pageIndex: pageIndexProp,
|
|
3623
|
+
defaultPageIndex = 0,
|
|
3624
|
+
onPageIndexChange,
|
|
3625
|
+
emptyState = "No results.",
|
|
3547
3626
|
className,
|
|
3548
3627
|
children,
|
|
3549
3628
|
...props
|
|
3550
3629
|
}) {
|
|
3551
|
-
const [
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3630
|
+
const [selectedRows, setSelectedRows] = useControllableState(
|
|
3631
|
+
selectedRowsProp,
|
|
3632
|
+
defaultSelectedRows,
|
|
3633
|
+
onSelectedRowsChange
|
|
3634
|
+
);
|
|
3635
|
+
const [sorting, setSorting] = useControllableState(sortingProp, defaultSorting, onSortingChange);
|
|
3636
|
+
const [pageIndex, setPageIndex] = useControllableState(
|
|
3637
|
+
pageIndexProp,
|
|
3638
|
+
defaultPageIndex,
|
|
3639
|
+
onPageIndexChange
|
|
3640
|
+
);
|
|
3641
|
+
const columns = React4.Children.toArray(children).filter(React4.isValidElement).map((child) => child.props);
|
|
3556
3642
|
const visibleColumns = columns.filter(({ hidden }) => !hidden);
|
|
3643
|
+
const isSelectable = selectionMode !== "none";
|
|
3644
|
+
const isPaginated = pageSize !== void 0 && pageSize > 0;
|
|
3645
|
+
const rowSelection = Object.fromEntries(selectedRows.map((id) => [id, true]));
|
|
3646
|
+
const table = reactTable.useTable({
|
|
3647
|
+
features,
|
|
3648
|
+
data,
|
|
3649
|
+
columns: visibleColumns.map((column) => ({
|
|
3650
|
+
id: column.id,
|
|
3651
|
+
accessorFn: (row) => getColumnValue(column, row),
|
|
3652
|
+
enableSorting: !!column.sortable,
|
|
3653
|
+
enableGlobalFilter: column.filterable !== false,
|
|
3654
|
+
sortUndefined: "last",
|
|
3655
|
+
// TanStack sorts numbers and dates descending first; always start ascending instead.
|
|
3656
|
+
sortDescFirst: false
|
|
3657
|
+
})),
|
|
3658
|
+
getRowId: (row, index) => getRowId(row, index),
|
|
3659
|
+
enableRowSelection: isSelectable,
|
|
3660
|
+
enableMultiRowSelection: selectionMode === "multiple",
|
|
3661
|
+
globalFilterFn: "includesString",
|
|
3662
|
+
state: {
|
|
3663
|
+
sorting,
|
|
3664
|
+
rowSelection,
|
|
3665
|
+
globalFilter: filter,
|
|
3666
|
+
pagination: { pageIndex, pageSize: pageSize ?? Math.max(data.length, 1) }
|
|
3667
|
+
},
|
|
3668
|
+
onSortingChange: (updater) => setSorting(resolve(updater, sorting)),
|
|
3669
|
+
onRowSelectionChange: (updater) => {
|
|
3670
|
+
const next = resolve(updater, rowSelection);
|
|
3671
|
+
setSelectedRows(Object.keys(next));
|
|
3672
|
+
},
|
|
3673
|
+
onPaginationChange: (updater) => {
|
|
3674
|
+
setPageIndex(resolve(updater, { pageIndex, pageSize: pageSize ?? 0 }).pageIndex);
|
|
3675
|
+
},
|
|
3676
|
+
onGlobalFilterChange: () => {
|
|
3677
|
+
}
|
|
3678
|
+
});
|
|
3679
|
+
const rows = (isPaginated ? table.getRowModel() : table.getPrePaginatedRowModel()).rows;
|
|
3680
|
+
const pageCount = isPaginated ? table.getPageCount() : 1;
|
|
3681
|
+
const pagination = isPaginated && pageCount > 1 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3682
|
+
"div",
|
|
3683
|
+
{
|
|
3684
|
+
"data-slot": "data-table-pagination",
|
|
3685
|
+
className: "flex w-full items-center justify-between gap-4 py-3 text-sm text-muted-foreground",
|
|
3686
|
+
children: [
|
|
3687
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
3688
|
+
"Page ",
|
|
3689
|
+
pageIndex + 1,
|
|
3690
|
+
" of ",
|
|
3691
|
+
pageCount
|
|
3692
|
+
] }),
|
|
3693
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
3694
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3695
|
+
Button,
|
|
3696
|
+
{
|
|
3697
|
+
variant: "outline",
|
|
3698
|
+
size: "sm",
|
|
3699
|
+
onClick: () => table.previousPage(),
|
|
3700
|
+
disabled: !table.getCanPreviousPage(),
|
|
3701
|
+
children: "Previous"
|
|
3702
|
+
}
|
|
3703
|
+
),
|
|
3704
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3705
|
+
Button,
|
|
3706
|
+
{
|
|
3707
|
+
variant: "outline",
|
|
3708
|
+
size: "sm",
|
|
3709
|
+
onClick: () => table.nextPage(),
|
|
3710
|
+
disabled: !table.getCanNextPage(),
|
|
3711
|
+
children: "Next"
|
|
3712
|
+
}
|
|
3713
|
+
)
|
|
3714
|
+
] })
|
|
3715
|
+
]
|
|
3716
|
+
}
|
|
3717
|
+
);
|
|
3718
|
+
const empty = /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "data-table-empty", className: "py-10 text-center text-sm text-muted-foreground", children: emptyState });
|
|
3557
3719
|
if (displayMode === "cards") {
|
|
3558
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
3559
|
-
|
|
3560
|
-
const
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3720
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Grid, { width: "100%", gap: "6", "data-slot": "data-table", "data-display-mode": "cards", children: [
|
|
3721
|
+
rows.length === 0 ? empty : rows.map((row) => {
|
|
3722
|
+
const items = visibleColumns.map((column) => ({
|
|
3723
|
+
label: column.label,
|
|
3724
|
+
value: renderCell(column, row.original, row.index)
|
|
3725
|
+
}));
|
|
3726
|
+
if (isSelectable) {
|
|
3727
|
+
items.unshift({
|
|
3728
|
+
label: "",
|
|
3729
|
+
value: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3730
|
+
Checkbox,
|
|
3731
|
+
{
|
|
3732
|
+
"aria-label": "Select row",
|
|
3733
|
+
checked: row.getIsSelected(),
|
|
3734
|
+
onCheckedChange: (checked) => row.toggleSelected(checked)
|
|
3735
|
+
}
|
|
3736
|
+
)
|
|
3737
|
+
});
|
|
3738
|
+
}
|
|
3739
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3740
|
+
DataCard,
|
|
3741
|
+
{
|
|
3742
|
+
"data-row-id": row.id,
|
|
3743
|
+
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
3744
|
+
data: items
|
|
3745
|
+
},
|
|
3746
|
+
row.id
|
|
3747
|
+
);
|
|
3748
|
+
}),
|
|
3749
|
+
pagination
|
|
3750
|
+
] });
|
|
3565
3751
|
}
|
|
3566
|
-
const isSelectable = selectionMode !== "none";
|
|
3567
3752
|
const gridTemplateColumns = [
|
|
3568
3753
|
...isSelectable ? [SELECTION_COLUMN_WIDTH] : [],
|
|
3569
3754
|
...visibleColumns.map(({ width }) => width || "1fr")
|
|
3570
3755
|
].join(" ");
|
|
3571
3756
|
const rowStyle = { gridTemplateColumns };
|
|
3572
|
-
const
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
}
|
|
3576
|
-
onSelectedRowsChange?.(next);
|
|
3577
|
-
};
|
|
3578
|
-
const setRowSelected = (rowId, checked) => {
|
|
3579
|
-
if (selectionMode === "single") {
|
|
3580
|
-
setSelectedRows(checked ? [rowId] : []);
|
|
3581
|
-
return;
|
|
3582
|
-
}
|
|
3583
|
-
setSelectedRows(
|
|
3584
|
-
checked ? [...selectedRows.filter((id) => id !== rowId), rowId] : selectedRows.filter((id) => id !== rowId)
|
|
3585
|
-
);
|
|
3586
|
-
};
|
|
3587
|
-
const selectedCount = rowIds.filter((id) => selectedRows.includes(id)).length;
|
|
3588
|
-
const allSelected = rowIds.length > 0 && selectedCount === rowIds.length;
|
|
3589
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3757
|
+
const allSelected = table.getIsAllRowsSelected();
|
|
3758
|
+
const someSelected = table.getIsSomeRowsSelected();
|
|
3759
|
+
const tableElement = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3590
3760
|
Table,
|
|
3591
3761
|
{
|
|
3592
3762
|
...props,
|
|
3763
|
+
role: "table",
|
|
3593
3764
|
"data-slot": "data-table",
|
|
3594
3765
|
"data-selection-mode": isSelectable ? selectionMode : void 0,
|
|
3595
|
-
className: cn.cn("grid", className),
|
|
3766
|
+
className: cn.cn("grid overflow-hidden rounded-lg border border-border", className),
|
|
3596
3767
|
children: [
|
|
3597
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: "contents", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3768
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { role: "rowgroup", className: "contents", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3769
|
+
TableRow,
|
|
3770
|
+
{
|
|
3771
|
+
role: "row",
|
|
3772
|
+
className: cn.cn(ROW_CLASS, "bg-muted/50 hover:bg-muted/50"),
|
|
3773
|
+
style: rowStyle,
|
|
3774
|
+
children: [
|
|
3775
|
+
isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableHead, { role: "columnheader", className: "flex items-center", children: selectionMode === "multiple" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3776
|
+
Checkbox,
|
|
3777
|
+
{
|
|
3778
|
+
"aria-label": "Select all rows",
|
|
3779
|
+
checked: allSelected,
|
|
3780
|
+
indeterminate: someSelected && !allSelected,
|
|
3781
|
+
onCheckedChange: (checked) => table.toggleAllRowsSelected(checked)
|
|
3782
|
+
}
|
|
3783
|
+
) }),
|
|
3784
|
+
visibleColumns.map((column) => {
|
|
3785
|
+
const tableColumn = table.getColumn(column.id);
|
|
3786
|
+
const sorted = column.sortable ? tableColumn?.getIsSorted() : false;
|
|
3787
|
+
const SortIcon = sorted === "asc" ? icons_exports.ArrowUp : sorted === "desc" ? icons_exports.ArrowDown : icons_exports.ChevronsUpDown;
|
|
3788
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3789
|
+
TableHead,
|
|
3790
|
+
{
|
|
3791
|
+
role: "columnheader",
|
|
3792
|
+
"aria-sort": column.sortable ? sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : "none" : void 0,
|
|
3793
|
+
className: cn.cn("flex items-center", column.align && alignClasses[column.align]),
|
|
3794
|
+
children: column.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3795
|
+
"button",
|
|
3796
|
+
{
|
|
3797
|
+
type: "button",
|
|
3798
|
+
"data-slot": "data-table-sort",
|
|
3799
|
+
onClick: tableColumn?.getToggleSortingHandler(),
|
|
3800
|
+
className: "-mx-2 inline-flex h-7 cursor-pointer items-center gap-1 rounded-md px-2 font-medium outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
3801
|
+
children: [
|
|
3802
|
+
column.label,
|
|
3803
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3804
|
+
SortIcon,
|
|
3805
|
+
{
|
|
3806
|
+
"aria-hidden": "true",
|
|
3807
|
+
className: cn.cn("size-3.5", !sorted && "text-muted-foreground")
|
|
3808
|
+
}
|
|
3809
|
+
)
|
|
3810
|
+
]
|
|
3811
|
+
}
|
|
3812
|
+
) : column.label
|
|
3813
|
+
},
|
|
3814
|
+
column.id
|
|
3815
|
+
);
|
|
3816
|
+
})
|
|
3817
|
+
]
|
|
3818
|
+
}
|
|
3819
|
+
) }),
|
|
3820
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { role: "rowgroup", className: "contents", children: rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { role: "row", className: "grid hover:bg-transparent", style: rowStyle, children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { role: "cell", style: { gridColumn: "1 / -1" }, children: empty }) }) : rows.map((row) => {
|
|
3821
|
+
const isSelected = isSelectable && row.getIsSelected();
|
|
3612
3822
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3613
3823
|
TableRow,
|
|
3614
3824
|
{
|
|
3615
|
-
"
|
|
3825
|
+
role: "row",
|
|
3826
|
+
"data-row-id": row.id,
|
|
3616
3827
|
"data-state": isSelected ? "selected" : void 0,
|
|
3617
|
-
className:
|
|
3828
|
+
className: ROW_CLASS,
|
|
3618
3829
|
style: rowStyle,
|
|
3619
3830
|
children: [
|
|
3620
|
-
isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3831
|
+
isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableCell, { role: "cell", className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3621
3832
|
Checkbox,
|
|
3622
3833
|
{
|
|
3623
3834
|
"aria-label": "Select row",
|
|
3624
3835
|
checked: isSelected,
|
|
3625
|
-
onCheckedChange: (checked) =>
|
|
3836
|
+
onCheckedChange: (checked) => row.toggleSelected(checked)
|
|
3626
3837
|
}
|
|
3627
3838
|
) }),
|
|
3628
|
-
visibleColumns.map(
|
|
3629
|
-
|
|
3839
|
+
visibleColumns.map((column) => {
|
|
3840
|
+
const {
|
|
3630
3841
|
id,
|
|
3631
3842
|
label: _label,
|
|
3632
3843
|
width: _width,
|
|
3633
3844
|
hidden: _hidden,
|
|
3634
|
-
as,
|
|
3845
|
+
as: _as,
|
|
3846
|
+
value: _value,
|
|
3847
|
+
sortable: _sortable,
|
|
3848
|
+
filterable: _filterable,
|
|
3635
3849
|
align,
|
|
3636
3850
|
className: cellClassName,
|
|
3637
|
-
children:
|
|
3851
|
+
children: _children,
|
|
3638
3852
|
...cellProps
|
|
3639
|
-
}
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
)
|
|
3853
|
+
} = column;
|
|
3854
|
+
return /* @__PURE__ */ React4.createElement(
|
|
3855
|
+
TableCell,
|
|
3856
|
+
{
|
|
3857
|
+
...cellProps,
|
|
3858
|
+
key: id,
|
|
3859
|
+
role: "cell",
|
|
3860
|
+
className: cn.cn(
|
|
3861
|
+
"flex min-w-0 items-center whitespace-normal wrap-anywhere",
|
|
3862
|
+
align && alignClasses[align],
|
|
3863
|
+
cellClassName
|
|
3864
|
+
)
|
|
3865
|
+
},
|
|
3866
|
+
renderCell(column, row.original, row.index)
|
|
3867
|
+
);
|
|
3868
|
+
})
|
|
3656
3869
|
]
|
|
3657
3870
|
},
|
|
3658
|
-
|
|
3871
|
+
row.id
|
|
3659
3872
|
);
|
|
3660
3873
|
}) })
|
|
3661
3874
|
]
|
|
3662
3875
|
}
|
|
3663
3876
|
);
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3877
|
+
if (!pagination) {
|
|
3878
|
+
return tableElement;
|
|
3879
|
+
}
|
|
3880
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "data-table-wrapper", className: "flex w-full flex-col", children: [
|
|
3881
|
+
tableElement,
|
|
3882
|
+
pagination
|
|
3883
|
+
] });
|
|
3667
3884
|
}
|
|
3668
3885
|
function Calendar({
|
|
3669
3886
|
className,
|
|
@@ -3818,8 +4035,8 @@ function CalendarDayButton({
|
|
|
3818
4035
|
...props
|
|
3819
4036
|
}) {
|
|
3820
4037
|
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
3821
|
-
const ref =
|
|
3822
|
-
|
|
4038
|
+
const ref = React4__namespace.useRef(null);
|
|
4039
|
+
React4__namespace.useEffect(() => {
|
|
3823
4040
|
if (modifiers.focused) ref.current?.focus();
|
|
3824
4041
|
}, [modifiers.focused]);
|
|
3825
4042
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3931,8 +4148,8 @@ function DatePicker({
|
|
|
3931
4148
|
className
|
|
3932
4149
|
}) {
|
|
3933
4150
|
const fieldId = useFieldId(id ?? triggerProps?.id);
|
|
3934
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
3935
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
4151
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React4.useState(defaultOpen ?? false);
|
|
4152
|
+
const [uncontrolledValue, setUncontrolledValue] = React4.useState(defaultValue);
|
|
3936
4153
|
const date = value ?? uncontrolledValue;
|
|
3937
4154
|
const open = openProp ?? uncontrolledOpen;
|
|
3938
4155
|
const isDisabled = disabled ?? triggerProps?.disabled;
|
|
@@ -4013,6 +4230,9 @@ function DatePicker({
|
|
|
4013
4230
|
picker
|
|
4014
4231
|
] });
|
|
4015
4232
|
}
|
|
4233
|
+
function Row({ reverse, children, ...props }) {
|
|
4234
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Flexbox, { ...props, direction: reverse ? "row-reverse" : "row", children });
|
|
4235
|
+
}
|
|
4016
4236
|
var sizeMap = {
|
|
4017
4237
|
sm: "w-1.5 h-1.5",
|
|
4018
4238
|
md: "w-2 h-2",
|
|
@@ -4042,9 +4262,9 @@ function FloatingTooltip({
|
|
|
4042
4262
|
open = true,
|
|
4043
4263
|
...props
|
|
4044
4264
|
}) {
|
|
4045
|
-
const ref =
|
|
4046
|
-
const [position, setPosition] =
|
|
4047
|
-
|
|
4265
|
+
const ref = React4.useRef(null);
|
|
4266
|
+
const [position, setPosition] = React4.useState({ x: -1e3, y: -1e3 });
|
|
4267
|
+
React4.useEffect(() => {
|
|
4048
4268
|
if (!open || typeof window === "undefined") {
|
|
4049
4269
|
return;
|
|
4050
4270
|
}
|
|
@@ -4209,8 +4429,8 @@ function Form({
|
|
|
4209
4429
|
});
|
|
4210
4430
|
const { handleSubmit } = formValues;
|
|
4211
4431
|
const onKeyDown = !onSubmit || preventSubmit ? (e) => e.key === "Enter" && e.preventDefault() : void 0;
|
|
4212
|
-
const lastValues =
|
|
4213
|
-
|
|
4432
|
+
const lastValues = React4.useRef(void 0);
|
|
4433
|
+
React4.useEffect(() => {
|
|
4214
4434
|
if (values === void 0) {
|
|
4215
4435
|
return;
|
|
4216
4436
|
}
|
|
@@ -4221,7 +4441,7 @@ function Form({
|
|
|
4221
4441
|
lastValues.current = serialized;
|
|
4222
4442
|
formValues.reset(values);
|
|
4223
4443
|
}, [formValues, values]);
|
|
4224
|
-
|
|
4444
|
+
React4.useEffect(() => {
|
|
4225
4445
|
if (formValues.formState.isSubmitted) {
|
|
4226
4446
|
formValues.reset(void 0, { keepDirty: true, keepValues: true });
|
|
4227
4447
|
}
|
|
@@ -4254,7 +4474,7 @@ function FormButtons({ className, ...props }) {
|
|
|
4254
4474
|
function FormController({ children, ...props }) {
|
|
4255
4475
|
return /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props, render: children });
|
|
4256
4476
|
}
|
|
4257
|
-
var PasswordField =
|
|
4477
|
+
var PasswordField = React4.forwardRef(
|
|
4258
4478
|
function PasswordField2({
|
|
4259
4479
|
label,
|
|
4260
4480
|
className,
|
|
@@ -4268,7 +4488,7 @@ var PasswordField = React3.forwardRef(
|
|
|
4268
4488
|
...props
|
|
4269
4489
|
}, ref) {
|
|
4270
4490
|
const fieldId = useFieldId(id);
|
|
4271
|
-
const [uncontrolledRevealed, setUncontrolledRevealed] =
|
|
4491
|
+
const [uncontrolledRevealed, setUncontrolledRevealed] = React4.useState(defaultRevealed);
|
|
4272
4492
|
const revealed = revealedProp ?? uncontrolledRevealed;
|
|
4273
4493
|
const isLabelled = Boolean(label || props["aria-label"] || props["aria-labelledby"]);
|
|
4274
4494
|
const toggleRevealed = () => {
|
|
@@ -4324,7 +4544,7 @@ var PasswordField = React3.forwardRef(
|
|
|
4324
4544
|
] });
|
|
4325
4545
|
}
|
|
4326
4546
|
);
|
|
4327
|
-
var SearchField =
|
|
4547
|
+
var SearchField = React4.forwardRef(function SearchField2({
|
|
4328
4548
|
label,
|
|
4329
4549
|
value,
|
|
4330
4550
|
defaultValue,
|
|
@@ -4338,13 +4558,13 @@ var SearchField = React3.forwardRef(function SearchField2({
|
|
|
4338
4558
|
...props
|
|
4339
4559
|
}, forwardedRef) {
|
|
4340
4560
|
const fieldId = useFieldId(id);
|
|
4341
|
-
const inputRef =
|
|
4342
|
-
const [hasValue, setHasValue] =
|
|
4343
|
-
const onSearchRef =
|
|
4561
|
+
const inputRef = React4.useRef(null);
|
|
4562
|
+
const [hasValue, setHasValue] = React4.useState(() => Boolean(value ?? defaultValue));
|
|
4563
|
+
const onSearchRef = React4.useRef(onSearch);
|
|
4344
4564
|
onSearchRef.current = onSearch;
|
|
4345
|
-
const timerRef =
|
|
4346
|
-
const lastDispatched =
|
|
4347
|
-
const dispatchSearch =
|
|
4565
|
+
const timerRef = React4.useRef(void 0);
|
|
4566
|
+
const lastDispatched = React4.useRef(void 0);
|
|
4567
|
+
const dispatchSearch = React4.useCallback((nextValue) => {
|
|
4348
4568
|
clearTimeout(timerRef.current);
|
|
4349
4569
|
if (lastDispatched.current === nextValue) {
|
|
4350
4570
|
return;
|
|
@@ -4352,7 +4572,7 @@ var SearchField = React3.forwardRef(function SearchField2({
|
|
|
4352
4572
|
lastDispatched.current = nextValue;
|
|
4353
4573
|
onSearchRef.current?.(nextValue);
|
|
4354
4574
|
}, []);
|
|
4355
|
-
|
|
4575
|
+
React4.useEffect(() => () => clearTimeout(timerRef.current), []);
|
|
4356
4576
|
const handleValue = (nextValue, immediate = false) => {
|
|
4357
4577
|
setHasValue(nextValue !== "");
|
|
4358
4578
|
onValueChange?.(nextValue);
|
|
@@ -4449,7 +4669,7 @@ function setRef(ref, value) {
|
|
|
4449
4669
|
ref.current = value;
|
|
4450
4670
|
}
|
|
4451
4671
|
}
|
|
4452
|
-
var TextField =
|
|
4672
|
+
var TextField = React4.forwardRef(function TextField2({
|
|
4453
4673
|
label,
|
|
4454
4674
|
description,
|
|
4455
4675
|
error,
|
|
@@ -4466,14 +4686,14 @@ var TextField = React3.forwardRef(function TextField2({
|
|
|
4466
4686
|
const fieldId = useFieldId(id);
|
|
4467
4687
|
const descriptionId = `${fieldId}-description`;
|
|
4468
4688
|
const errorId = `${fieldId}-error`;
|
|
4469
|
-
const innerRef =
|
|
4470
|
-
const [hasValue, setHasValue] =
|
|
4689
|
+
const innerRef = React4.useRef(null);
|
|
4690
|
+
const [hasValue, setHasValue] = React4.useState(() => {
|
|
4471
4691
|
const initial = props.value ?? props.defaultValue;
|
|
4472
4692
|
return initial !== void 0 && initial !== null && initial !== "";
|
|
4473
4693
|
});
|
|
4474
|
-
const [copied, setCopied] =
|
|
4475
|
-
const copyTimer =
|
|
4476
|
-
|
|
4694
|
+
const [copied, setCopied] = React4.useState(false);
|
|
4695
|
+
const copyTimer = React4.useRef(void 0);
|
|
4696
|
+
React4.useEffect(() => () => clearTimeout(copyTimer.current), []);
|
|
4477
4697
|
const handleRef = (element) => {
|
|
4478
4698
|
innerRef.current = element;
|
|
4479
4699
|
setRef(forwardedRef, element);
|
|
@@ -4511,6 +4731,7 @@ var TextField = React3.forwardRef(function TextField2({
|
|
|
4511
4731
|
InputGroup,
|
|
4512
4732
|
{
|
|
4513
4733
|
"data-slot": "text-field",
|
|
4734
|
+
"data-variant": isQuiet ? "quiet" : void 0,
|
|
4514
4735
|
"data-disabled": props.disabled ? "true" : void 0,
|
|
4515
4736
|
className: cn.cn(
|
|
4516
4737
|
isQuiet && "h-auto rounded-none border-transparent shadow-none dark:bg-transparent has-[[data-slot=input-group-control]:focus-visible]:border-transparent has-[[data-slot=input-group-control]:focus-visible]:border-b-border has-[[data-slot=input-group-control]:focus-visible]:ring-0",
|
|
@@ -4687,9 +4908,9 @@ function FormField({
|
|
|
4687
4908
|
let control;
|
|
4688
4909
|
if (typeof children === "function") {
|
|
4689
4910
|
control = children({ field, fieldState, context, controlProps });
|
|
4690
|
-
} else if (
|
|
4911
|
+
} else if (React4.isValidElement(children)) {
|
|
4691
4912
|
const ownDescribedBy = children.props["aria-describedby"];
|
|
4692
|
-
control =
|
|
4913
|
+
control = React4.cloneElement(children, {
|
|
4693
4914
|
...bindField(getBinding(children.type), field),
|
|
4694
4915
|
...controlProps,
|
|
4695
4916
|
"aria-describedby": [ownDescribedBy, controlProps["aria-describedby"]].filter(Boolean).join(" ") || void 0
|
|
@@ -4731,7 +4952,7 @@ function FormFieldArray({
|
|
|
4731
4952
|
children,
|
|
4732
4953
|
...props
|
|
4733
4954
|
}) {
|
|
4734
|
-
const labelId =
|
|
4955
|
+
const labelId = React4.useId();
|
|
4735
4956
|
const context = reactHookForm.useFormContext();
|
|
4736
4957
|
const { formState, control, register } = context;
|
|
4737
4958
|
const fieldArray = reactHookForm.useFieldArray({
|
|
@@ -4764,8 +4985,22 @@ function FormResetButton({
|
|
|
4764
4985
|
};
|
|
4765
4986
|
return /* @__PURE__ */ jsxRuntime.jsx(Button, { ...props, type: "reset", variant, onClick: handleClick });
|
|
4766
4987
|
}
|
|
4767
|
-
function Spinner({ className, ...props }) {
|
|
4768
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
4988
|
+
function Spinner({ quiet, className, ...props }) {
|
|
4989
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4990
|
+
"svg",
|
|
4991
|
+
{
|
|
4992
|
+
viewBox: "25 25 50 50",
|
|
4993
|
+
"data-slot": "spinner",
|
|
4994
|
+
role: "status",
|
|
4995
|
+
"aria-label": "Loading",
|
|
4996
|
+
...props,
|
|
4997
|
+
className: cn.cn("zen-spinner size-4", className),
|
|
4998
|
+
children: [
|
|
4999
|
+
!quiet && /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "zen-spinner-track", cx: "50", cy: "50", r: "20" }),
|
|
5000
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { className: "zen-spinner-fill", cx: "50", cy: "50", r: "20" })
|
|
5001
|
+
]
|
|
5002
|
+
}
|
|
5003
|
+
);
|
|
4769
5004
|
}
|
|
4770
5005
|
function FormSubmitButton({
|
|
4771
5006
|
disabled,
|
|
@@ -4815,10 +5050,142 @@ function Heading({
|
|
|
4815
5050
|
}
|
|
4816
5051
|
);
|
|
4817
5052
|
}
|
|
5053
|
+
var languages = {
|
|
5054
|
+
bash: () => import('shiki/langs/shellscript.mjs'),
|
|
5055
|
+
css: () => import('shiki/langs/css.mjs'),
|
|
5056
|
+
diff: () => import('shiki/langs/diff.mjs'),
|
|
5057
|
+
html: () => import('shiki/langs/html.mjs'),
|
|
5058
|
+
javascript: () => import('shiki/langs/javascript.mjs'),
|
|
5059
|
+
json: () => import('shiki/langs/json.mjs'),
|
|
5060
|
+
jsx: () => import('shiki/langs/jsx.mjs'),
|
|
5061
|
+
markdown: () => import('shiki/langs/markdown.mjs'),
|
|
5062
|
+
python: () => import('shiki/langs/python.mjs'),
|
|
5063
|
+
sql: () => import('shiki/langs/sql.mjs'),
|
|
5064
|
+
tsx: () => import('shiki/langs/tsx.mjs'),
|
|
5065
|
+
typescript: () => import('shiki/langs/typescript.mjs'),
|
|
5066
|
+
yaml: () => import('shiki/langs/yaml.mjs')
|
|
5067
|
+
};
|
|
5068
|
+
var aliases = {
|
|
5069
|
+
js: "javascript",
|
|
5070
|
+
md: "markdown",
|
|
5071
|
+
py: "python",
|
|
5072
|
+
sh: "bash",
|
|
5073
|
+
shell: "bash",
|
|
5074
|
+
shellscript: "bash",
|
|
5075
|
+
ts: "typescript",
|
|
5076
|
+
yml: "yaml",
|
|
5077
|
+
zsh: "bash"
|
|
5078
|
+
};
|
|
5079
|
+
var highlighter;
|
|
5080
|
+
function getHighlighter() {
|
|
5081
|
+
highlighter ??= core.createHighlighterCore({
|
|
5082
|
+
themes: [
|
|
5083
|
+
import('shiki/themes/github-light.mjs'),
|
|
5084
|
+
import('shiki/themes/github-dark.mjs')
|
|
5085
|
+
],
|
|
5086
|
+
langs: [],
|
|
5087
|
+
engine: javascript.createJavaScriptRegexEngine({ forgiving: true })
|
|
5088
|
+
});
|
|
5089
|
+
return highlighter;
|
|
5090
|
+
}
|
|
5091
|
+
function getLanguage(language) {
|
|
5092
|
+
const name = language.toLowerCase();
|
|
5093
|
+
if (name === "ansi") {
|
|
5094
|
+
return name;
|
|
5095
|
+
}
|
|
5096
|
+
if (name in languages) {
|
|
5097
|
+
return name;
|
|
5098
|
+
}
|
|
5099
|
+
return aliases[name] ?? null;
|
|
5100
|
+
}
|
|
5101
|
+
async function loadHighlighter(language) {
|
|
5102
|
+
const lang = getLanguage(language);
|
|
5103
|
+
if (!lang) {
|
|
5104
|
+
return null;
|
|
5105
|
+
}
|
|
5106
|
+
const shiki = await getHighlighter();
|
|
5107
|
+
if (lang !== "ansi" && !shiki.getLoadedLanguages().includes(lang)) {
|
|
5108
|
+
await shiki.loadLanguage(languages[lang]);
|
|
5109
|
+
}
|
|
5110
|
+
return {
|
|
5111
|
+
// Returns one React node per line, and the grammar state after the last
|
|
5112
|
+
// line. Pass that state back to continue where the code left off.
|
|
5113
|
+
highlight(code, state) {
|
|
5114
|
+
const tokenize = (text) => shiki.codeToTokens(text, {
|
|
5115
|
+
lang,
|
|
5116
|
+
themes: { light: "github-light", dark: "github-dark" },
|
|
5117
|
+
defaultColor: false,
|
|
5118
|
+
grammarState: state
|
|
5119
|
+
}).tokens;
|
|
5120
|
+
const tokens = lang === "ansi" ? code.split("\n").flatMap((line) => tokenize(line)) : tokenize(code);
|
|
5121
|
+
return {
|
|
5122
|
+
lines: tokens.map(
|
|
5123
|
+
(line) => line.map((token, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5124
|
+
"span",
|
|
5125
|
+
{
|
|
5126
|
+
style: token.htmlStyle,
|
|
5127
|
+
className: "text-(--shiki-light) dark:text-(--shiki-dark)",
|
|
5128
|
+
children: token.content
|
|
5129
|
+
},
|
|
5130
|
+
index
|
|
5131
|
+
))
|
|
5132
|
+
),
|
|
5133
|
+
state: shiki.getLastGrammarState(tokens)
|
|
5134
|
+
};
|
|
5135
|
+
}
|
|
5136
|
+
};
|
|
5137
|
+
}
|
|
5138
|
+
|
|
5139
|
+
// src/components/hooks/use-highlighted-code.ts
|
|
5140
|
+
function useHighlightedCode(value, language) {
|
|
5141
|
+
const code = value.endsWith("\n") ? value.slice(0, -1) : value;
|
|
5142
|
+
const [loaded, setLoaded] = React4__namespace.useState(null);
|
|
5143
|
+
const highlighter2 = loaded?.language === language ? loaded.highlighter : null;
|
|
5144
|
+
React4__namespace.useEffect(() => {
|
|
5145
|
+
let cancelled = false;
|
|
5146
|
+
loadHighlighter(language).then((next2) => {
|
|
5147
|
+
if (!cancelled) {
|
|
5148
|
+
setLoaded({ language, highlighter: next2 });
|
|
5149
|
+
}
|
|
5150
|
+
}).catch(() => {
|
|
5151
|
+
});
|
|
5152
|
+
return () => {
|
|
5153
|
+
cancelled = true;
|
|
5154
|
+
};
|
|
5155
|
+
}, [language]);
|
|
5156
|
+
const [done, setDone] = React4__namespace.useState({ highlighter: null, text: "", lines: [] });
|
|
5157
|
+
let next = done;
|
|
5158
|
+
if (next.highlighter !== highlighter2 || !code.startsWith(next.text)) {
|
|
5159
|
+
next = { highlighter: highlighter2, text: "", lines: [] };
|
|
5160
|
+
}
|
|
5161
|
+
const end = code.lastIndexOf("\n") + 1;
|
|
5162
|
+
if (highlighter2 && end > next.text.length) {
|
|
5163
|
+
const result = highlighter2.highlight(
|
|
5164
|
+
code.slice(next.text.length, end - 1),
|
|
5165
|
+
next.state
|
|
5166
|
+
);
|
|
5167
|
+
next = {
|
|
5168
|
+
highlighter: highlighter2,
|
|
5169
|
+
text: code.slice(0, end),
|
|
5170
|
+
lines: [...next.lines, ...result.lines],
|
|
5171
|
+
state: result.state
|
|
5172
|
+
};
|
|
5173
|
+
}
|
|
5174
|
+
if (next !== done) {
|
|
5175
|
+
setDone(next);
|
|
5176
|
+
}
|
|
5177
|
+
const tail = code.slice(end);
|
|
5178
|
+
return React4__namespace.useMemo(() => {
|
|
5179
|
+
if (!highlighter2) {
|
|
5180
|
+
return code.split("\n");
|
|
5181
|
+
}
|
|
5182
|
+
return [...next.lines, highlighter2.highlight(tail, next.state).lines[0]];
|
|
5183
|
+
}, [code, highlighter2, next, tail]);
|
|
5184
|
+
}
|
|
4818
5185
|
var MOBILE_BREAKPOINT = 768;
|
|
4819
5186
|
function useIsMobile() {
|
|
4820
|
-
const [isMobile, setIsMobile] =
|
|
4821
|
-
|
|
5187
|
+
const [isMobile, setIsMobile] = React4__namespace.useState(void 0);
|
|
5188
|
+
React4__namespace.useEffect(() => {
|
|
4822
5189
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
4823
5190
|
const onChange = () => {
|
|
4824
5191
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -4838,8 +5205,8 @@ var breakpoints = {
|
|
|
4838
5205
|
};
|
|
4839
5206
|
var DEBOUNCE_DELAY_MS = 150;
|
|
4840
5207
|
function useBreakpoint() {
|
|
4841
|
-
const [breakpoint, setBreakpoint] =
|
|
4842
|
-
const calculateBreakpoint =
|
|
5208
|
+
const [breakpoint, setBreakpoint] = React4.useState(null);
|
|
5209
|
+
const calculateBreakpoint = React4.useCallback(() => {
|
|
4843
5210
|
if (typeof window === "undefined") {
|
|
4844
5211
|
return;
|
|
4845
5212
|
}
|
|
@@ -4852,7 +5219,7 @@ function useBreakpoint() {
|
|
|
4852
5219
|
}
|
|
4853
5220
|
setBreakpoint(currentBreakpoint);
|
|
4854
5221
|
}, []);
|
|
4855
|
-
|
|
5222
|
+
React4.useEffect(() => {
|
|
4856
5223
|
calculateBreakpoint();
|
|
4857
5224
|
const debouncedResize = debounce(calculateBreakpoint, DEBOUNCE_DELAY_MS);
|
|
4858
5225
|
window.addEventListener("resize", debouncedResize);
|
|
@@ -4863,8 +5230,8 @@ function useBreakpoint() {
|
|
|
4863
5230
|
return breakpoint;
|
|
4864
5231
|
}
|
|
4865
5232
|
function useDebounce(value, delay) {
|
|
4866
|
-
const [debouncedValue, setValue] =
|
|
4867
|
-
|
|
5233
|
+
const [debouncedValue, setValue] = React4.useState(value);
|
|
5234
|
+
React4.useEffect(() => {
|
|
4868
5235
|
const timer = setTimeout(() => {
|
|
4869
5236
|
setValue(value);
|
|
4870
5237
|
}, delay);
|
|
@@ -4957,11 +5324,11 @@ function useInitTheme(preferred, colorScheme, preferredPalette) {
|
|
|
4957
5324
|
const initTheme = useTheme((s) => s.initTheme);
|
|
4958
5325
|
const initPalette = useTheme((s) => s.initPalette);
|
|
4959
5326
|
const syncTheme = useTheme((s) => s.syncTheme);
|
|
4960
|
-
|
|
5327
|
+
React4.useLayoutEffect(() => {
|
|
4961
5328
|
initTheme(preferred, colorScheme);
|
|
4962
5329
|
initPalette(preferredPalette);
|
|
4963
5330
|
}, [preferred, colorScheme, preferredPalette, initTheme, initPalette]);
|
|
4964
|
-
|
|
5331
|
+
React4.useEffect(() => {
|
|
4965
5332
|
if (typeof window === "undefined") return;
|
|
4966
5333
|
const observer = new MutationObserver((mutations) => {
|
|
4967
5334
|
for (const mutation of mutations) {
|
|
@@ -5054,7 +5421,7 @@ var positionClasses = {
|
|
|
5054
5421
|
};
|
|
5055
5422
|
function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
5056
5423
|
const { toasts } = useToast();
|
|
5057
|
-
const [hovered, setHovered] =
|
|
5424
|
+
const [hovered, setHovered] = React4.useState(false);
|
|
5058
5425
|
const transitions = web.useTransition(toasts, {
|
|
5059
5426
|
from: {
|
|
5060
5427
|
opacity: 0,
|
|
@@ -5067,7 +5434,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
5067
5434
|
},
|
|
5068
5435
|
config: { duration: 100 }
|
|
5069
5436
|
});
|
|
5070
|
-
|
|
5437
|
+
React4.useEffect(() => {
|
|
5071
5438
|
if (!duration || hovered || !toasts.length) {
|
|
5072
5439
|
return;
|
|
5073
5440
|
}
|
|
@@ -5099,7 +5466,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
5099
5466
|
}
|
|
5100
5467
|
);
|
|
5101
5468
|
}
|
|
5102
|
-
var ToastContext =
|
|
5469
|
+
var ToastContext = React4.createContext({});
|
|
5103
5470
|
function ToastProvider({ children, ...props }) {
|
|
5104
5471
|
return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: props, children: [
|
|
5105
5472
|
children,
|
|
@@ -5130,7 +5497,7 @@ function displayToast(message, { duration = TOAST_DURATION, ...options } = {}) {
|
|
|
5130
5497
|
}
|
|
5131
5498
|
function useToast() {
|
|
5132
5499
|
const { toasts } = store();
|
|
5133
|
-
const config =
|
|
5500
|
+
const config = React4.useContext(ToastContext);
|
|
5134
5501
|
const toast = (message, options) => {
|
|
5135
5502
|
displayToast(message, { ...options, ...config });
|
|
5136
5503
|
};
|
|
@@ -5186,7 +5553,7 @@ function Icon({
|
|
|
5186
5553
|
if (fillColorStr) {
|
|
5187
5554
|
svgProps.fill = getCssColorValue(fillColorStr);
|
|
5188
5555
|
}
|
|
5189
|
-
const clonedChild =
|
|
5556
|
+
const clonedChild = React4.isValidElement(children) ? React4.cloneElement(children, svgProps) : children;
|
|
5190
5557
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className: wrapperClasses, style: wrapperStyle, children: clonedChild });
|
|
5191
5558
|
}
|
|
5192
5559
|
var objectFitMap = {
|
|
@@ -5217,7 +5584,7 @@ function Image({
|
|
|
5217
5584
|
);
|
|
5218
5585
|
return /* @__PURE__ */ jsxRuntime.jsx("img", { ...props, className: classes, src, alt });
|
|
5219
5586
|
}
|
|
5220
|
-
var ListContext =
|
|
5587
|
+
var ListContext = React4.createContext({
|
|
5221
5588
|
selectionMode: "none",
|
|
5222
5589
|
showCheckmark: true,
|
|
5223
5590
|
selected: /* @__PURE__ */ new Set(),
|
|
@@ -5237,8 +5604,8 @@ function List({
|
|
|
5237
5604
|
...props
|
|
5238
5605
|
}) {
|
|
5239
5606
|
const listId = useFieldId(id);
|
|
5240
|
-
const labelId =
|
|
5241
|
-
const [uncontrolled, setUncontrolled] =
|
|
5607
|
+
const labelId = React4.useId();
|
|
5608
|
+
const [uncontrolled, setUncontrolled] = React4.useState(() => defaultValue ?? []);
|
|
5242
5609
|
const selectedValues = value ?? uncontrolled;
|
|
5243
5610
|
const selected = new Set(selectedValues);
|
|
5244
5611
|
const toggle = (itemValue) => {
|
|
@@ -5316,7 +5683,7 @@ function ListItem({
|
|
|
5316
5683
|
onKeyDown,
|
|
5317
5684
|
...props
|
|
5318
5685
|
}) {
|
|
5319
|
-
const { selectionMode, showCheckmark, selected, toggle } =
|
|
5686
|
+
const { selectionMode, showCheckmark, selected, toggle } = React4.useContext(ListContext);
|
|
5320
5687
|
const itemValue = value ?? (typeof children === "string" ? children : "");
|
|
5321
5688
|
const isSelected = selected.has(itemValue);
|
|
5322
5689
|
const hasIndicator = showCheckmark && selectionMode !== "none";
|
|
@@ -5375,7 +5742,7 @@ function ListSeparator({ className, ...props }) {
|
|
|
5375
5742
|
);
|
|
5376
5743
|
}
|
|
5377
5744
|
function ListSection({ title, className, children, ...props }) {
|
|
5378
|
-
const titleId =
|
|
5745
|
+
const titleId = React4.useId();
|
|
5379
5746
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5380
5747
|
"div",
|
|
5381
5748
|
{
|
|
@@ -5491,8 +5858,8 @@ function Meter({ label, showValue, className, ...props }) {
|
|
|
5491
5858
|
}
|
|
5492
5859
|
);
|
|
5493
5860
|
}
|
|
5494
|
-
var NavbarContext =
|
|
5495
|
-
var NavbarContentContext =
|
|
5861
|
+
var NavbarContext = React4.createContext({ showArrow: true });
|
|
5862
|
+
var NavbarContentContext = React4.createContext(false);
|
|
5496
5863
|
var triggerClassName = cn.cn(
|
|
5497
5864
|
"inline-flex h-9 w-max items-center justify-center gap-1 rounded-md bg-background px-2.5 py-1.5 text-sm font-medium transition-all outline-none select-none",
|
|
5498
5865
|
"hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
@@ -5572,7 +5939,7 @@ function NavbarItem({
|
|
|
5572
5939
|
color: _color,
|
|
5573
5940
|
...props
|
|
5574
5941
|
}) {
|
|
5575
|
-
const { showArrow } =
|
|
5942
|
+
const { showArrow } = React4.useContext(NavbarContext);
|
|
5576
5943
|
if (label) {
|
|
5577
5944
|
return /* @__PURE__ */ jsxRuntime.jsxs(navigationMenu.NavigationMenu.Item, { "data-slot": "navbar-item", ...props, children: [
|
|
5578
5945
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5600,7 +5967,7 @@ function NavbarItem({
|
|
|
5600
5967
|
);
|
|
5601
5968
|
}
|
|
5602
5969
|
function NavbarLink({ className, ...props }) {
|
|
5603
|
-
const inContent =
|
|
5970
|
+
const inContent = React4.useContext(NavbarContentContext);
|
|
5604
5971
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5605
5972
|
navigationMenu.NavigationMenu.Link,
|
|
5606
5973
|
{
|
|
@@ -5617,7 +5984,7 @@ var stepperClassName = cn.cn(
|
|
|
5617
5984
|
buttonVariants({ variant: "ghost", size: "icon-xs" }),
|
|
5618
5985
|
"rounded-[calc(var(--radius)-5px)] text-muted-foreground"
|
|
5619
5986
|
);
|
|
5620
|
-
var NumberField =
|
|
5987
|
+
var NumberField = React4.forwardRef(function NumberField2({
|
|
5621
5988
|
label,
|
|
5622
5989
|
placeholder,
|
|
5623
5990
|
decrementLabel = "Decrease",
|
|
@@ -5635,7 +6002,7 @@ var NumberField = React3.forwardRef(function NumberField2({
|
|
|
5635
6002
|
id: fieldId,
|
|
5636
6003
|
"data-slot": "number-field",
|
|
5637
6004
|
className: cn.cn(
|
|
5638
|
-
"group/field flex w-full flex-col gap-
|
|
6005
|
+
"group/field flex w-full flex-col gap-2 data-disabled:[&_[data-slot=field-label]]:opacity-50",
|
|
5639
6006
|
className
|
|
5640
6007
|
),
|
|
5641
6008
|
children: [
|
|
@@ -5702,7 +6069,7 @@ function PageHeaderTitle({
|
|
|
5702
6069
|
return /* @__PURE__ */ jsxRuntime.jsxs(Column, { gap: "1", ...props, children: [
|
|
5703
6070
|
breadcrumb,
|
|
5704
6071
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xl", weight: "semibold", children: title }),
|
|
5705
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "muted
|
|
6072
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "muted", children: description }),
|
|
5706
6073
|
children
|
|
5707
6074
|
] });
|
|
5708
6075
|
}
|
|
@@ -5856,12 +6223,12 @@ function Badge({
|
|
|
5856
6223
|
}
|
|
5857
6224
|
});
|
|
5858
6225
|
}
|
|
5859
|
-
var TagContext =
|
|
6226
|
+
var TagContext = React4.createContext({
|
|
5860
6227
|
removable: false,
|
|
5861
6228
|
remove: () => void 0
|
|
5862
6229
|
});
|
|
5863
6230
|
function TagGroup({ label, children, className, onRemove, ...props }) {
|
|
5864
|
-
const labelId =
|
|
6231
|
+
const labelId = React4.useId();
|
|
5865
6232
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5866
6233
|
TagContext.Provider,
|
|
5867
6234
|
{
|
|
@@ -5869,7 +6236,7 @@ function TagGroup({ label, children, className, onRemove, ...props }) {
|
|
|
5869
6236
|
removable: !!onRemove,
|
|
5870
6237
|
remove: (value) => onRemove?.(value)
|
|
5871
6238
|
},
|
|
5872
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, "data-slot": "tag-group", className: cn.cn("flex flex-col gap-
|
|
6239
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, "data-slot": "tag-group", className: cn.cn("flex flex-col gap-2", className), children: [
|
|
5873
6240
|
label && /* @__PURE__ */ jsxRuntime.jsx(FieldTitle, { id: labelId, children: label }),
|
|
5874
6241
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5875
6242
|
"ul",
|
|
@@ -5893,7 +6260,7 @@ function Tag({
|
|
|
5893
6260
|
onKeyDown,
|
|
5894
6261
|
...props
|
|
5895
6262
|
}) {
|
|
5896
|
-
const { removable, remove } =
|
|
6263
|
+
const { removable, remove } = React4.useContext(TagContext);
|
|
5897
6264
|
const tagValue = value ?? (typeof children === "string" ? children : "");
|
|
5898
6265
|
const isRemovable = removable && !disabled;
|
|
5899
6266
|
const handleKeyDown = (event) => {
|
|
@@ -5955,10 +6322,10 @@ function ThemeButton({
|
|
|
5955
6322
|
...props
|
|
5956
6323
|
}) {
|
|
5957
6324
|
const globalTheme = useTheme();
|
|
5958
|
-
const [localTheme, setLocalTheme] =
|
|
5959
|
-
const initializedRef =
|
|
6325
|
+
const [localTheme, setLocalTheme] = React4.useState(null);
|
|
6326
|
+
const initializedRef = React4.useRef(false);
|
|
5960
6327
|
const isLocal = !!target;
|
|
5961
|
-
|
|
6328
|
+
React4.useEffect(() => {
|
|
5962
6329
|
if (isLocal && target && !initializedRef.current) {
|
|
5963
6330
|
const element = getElement(target);
|
|
5964
6331
|
if (element) {
|
|
@@ -6025,14 +6392,14 @@ function getSystemTheme() {
|
|
|
6025
6392
|
}
|
|
6026
6393
|
function ThemeSwitcher({ className }) {
|
|
6027
6394
|
const { setTheme } = useTheme();
|
|
6028
|
-
const [mode, setMode] =
|
|
6029
|
-
|
|
6395
|
+
const [mode, setMode] = React4.useState("system");
|
|
6396
|
+
React4.useEffect(() => {
|
|
6030
6397
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
6031
6398
|
if (stored && ["light", "dark", "system"].includes(stored)) {
|
|
6032
6399
|
setMode(stored);
|
|
6033
6400
|
}
|
|
6034
6401
|
}, []);
|
|
6035
|
-
|
|
6402
|
+
React4.useEffect(() => {
|
|
6036
6403
|
if (mode === "system") {
|
|
6037
6404
|
setTheme(getSystemTheme());
|
|
6038
6405
|
} else {
|
|
@@ -6040,7 +6407,7 @@ function ThemeSwitcher({ className }) {
|
|
|
6040
6407
|
}
|
|
6041
6408
|
localStorage.setItem(STORAGE_KEY, mode);
|
|
6042
6409
|
}, [mode, setTheme]);
|
|
6043
|
-
|
|
6410
|
+
React4.useEffect(() => {
|
|
6044
6411
|
if (mode !== "system") return;
|
|
6045
6412
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
6046
6413
|
const handleChange = () => {
|
|
@@ -6594,9 +6961,9 @@ function CardFooter({ className, ...props }) {
|
|
|
6594
6961
|
}
|
|
6595
6962
|
);
|
|
6596
6963
|
}
|
|
6597
|
-
var CarouselContext =
|
|
6964
|
+
var CarouselContext = React4__namespace.createContext(null);
|
|
6598
6965
|
function useCarousel() {
|
|
6599
|
-
const context =
|
|
6966
|
+
const context = React4__namespace.useContext(CarouselContext);
|
|
6600
6967
|
if (!context) {
|
|
6601
6968
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
6602
6969
|
}
|
|
@@ -6618,20 +6985,20 @@ function Carousel({
|
|
|
6618
6985
|
},
|
|
6619
6986
|
plugins
|
|
6620
6987
|
);
|
|
6621
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
6622
|
-
const [canScrollNext, setCanScrollNext] =
|
|
6623
|
-
const onSelect =
|
|
6988
|
+
const [canScrollPrev, setCanScrollPrev] = React4__namespace.useState(false);
|
|
6989
|
+
const [canScrollNext, setCanScrollNext] = React4__namespace.useState(false);
|
|
6990
|
+
const onSelect = React4__namespace.useCallback((api2) => {
|
|
6624
6991
|
if (!api2) return;
|
|
6625
6992
|
setCanScrollPrev(api2.canScrollPrev());
|
|
6626
6993
|
setCanScrollNext(api2.canScrollNext());
|
|
6627
6994
|
}, []);
|
|
6628
|
-
const scrollPrev =
|
|
6995
|
+
const scrollPrev = React4__namespace.useCallback(() => {
|
|
6629
6996
|
api?.scrollPrev();
|
|
6630
6997
|
}, [api]);
|
|
6631
|
-
const scrollNext =
|
|
6998
|
+
const scrollNext = React4__namespace.useCallback(() => {
|
|
6632
6999
|
api?.scrollNext();
|
|
6633
7000
|
}, [api]);
|
|
6634
|
-
const handleKeyDown =
|
|
7001
|
+
const handleKeyDown = React4__namespace.useCallback(
|
|
6635
7002
|
(event) => {
|
|
6636
7003
|
if (event.key === "ArrowLeft") {
|
|
6637
7004
|
event.preventDefault();
|
|
@@ -6643,11 +7010,11 @@ function Carousel({
|
|
|
6643
7010
|
},
|
|
6644
7011
|
[scrollPrev, scrollNext]
|
|
6645
7012
|
);
|
|
6646
|
-
|
|
7013
|
+
React4__namespace.useEffect(() => {
|
|
6647
7014
|
if (!api || !setApi) return;
|
|
6648
7015
|
setApi(api);
|
|
6649
7016
|
}, [api, setApi]);
|
|
6650
|
-
|
|
7017
|
+
React4__namespace.useEffect(() => {
|
|
6651
7018
|
if (!api) return;
|
|
6652
7019
|
onSelect(api);
|
|
6653
7020
|
api.on("reInit", onSelect);
|
|
@@ -6779,6 +7146,204 @@ function CarouselNext({
|
|
|
6779
7146
|
}
|
|
6780
7147
|
);
|
|
6781
7148
|
}
|
|
7149
|
+
var codeBlockVariants = classVarianceAuthority.cva(
|
|
7150
|
+
"group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-lg text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/50 data-[size=sm]:text-xs",
|
|
7151
|
+
{
|
|
7152
|
+
variants: {
|
|
7153
|
+
variant: {
|
|
7154
|
+
default: "border border-input text-foreground has-[>[data-slot=code-block-content]:focus-visible]:border-ring dark:bg-input/30",
|
|
7155
|
+
destructive: "border border-destructive/30 text-destructive dark:border-destructive/40"
|
|
7156
|
+
}
|
|
7157
|
+
},
|
|
7158
|
+
defaultVariants: {
|
|
7159
|
+
variant: "default"
|
|
7160
|
+
}
|
|
7161
|
+
}
|
|
7162
|
+
);
|
|
7163
|
+
function CodeBlock({
|
|
7164
|
+
className,
|
|
7165
|
+
variant = "default",
|
|
7166
|
+
size = "default",
|
|
7167
|
+
...props
|
|
7168
|
+
}) {
|
|
7169
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7170
|
+
"div",
|
|
7171
|
+
{
|
|
7172
|
+
"data-slot": "code-block",
|
|
7173
|
+
"data-variant": variant,
|
|
7174
|
+
"data-size": size,
|
|
7175
|
+
className: cn.cn(codeBlockVariants({ variant }), className),
|
|
7176
|
+
...props
|
|
7177
|
+
}
|
|
7178
|
+
);
|
|
7179
|
+
}
|
|
7180
|
+
function CodeBlockHeader({ className, ...props }) {
|
|
7181
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7182
|
+
"div",
|
|
7183
|
+
{
|
|
7184
|
+
"data-slot": "code-block-header",
|
|
7185
|
+
className: cn.cn(
|
|
7186
|
+
"flex min-w-0 shrink-0 items-center gap-2 px-4 pt-4 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pt-3 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0",
|
|
7187
|
+
className
|
|
7188
|
+
),
|
|
7189
|
+
...props
|
|
7190
|
+
}
|
|
7191
|
+
);
|
|
7192
|
+
}
|
|
7193
|
+
function CodeBlockTitle({ className, ...props }) {
|
|
7194
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7195
|
+
"div",
|
|
7196
|
+
{
|
|
7197
|
+
"data-slot": "code-block-title",
|
|
7198
|
+
className: cn.cn(
|
|
7199
|
+
"min-w-0 truncate font-sans text-sm font-medium text-foreground group-data-[size=sm]/code-block:text-xs group-data-[variant=destructive]/code-block:text-destructive [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-4 group-data-[size=sm]/code-block:[&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5",
|
|
7200
|
+
className
|
|
7201
|
+
),
|
|
7202
|
+
...props
|
|
7203
|
+
}
|
|
7204
|
+
);
|
|
7205
|
+
}
|
|
7206
|
+
function CodeBlockActions({
|
|
7207
|
+
className,
|
|
7208
|
+
...props
|
|
7209
|
+
}) {
|
|
7210
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7211
|
+
"div",
|
|
7212
|
+
{
|
|
7213
|
+
"data-slot": "code-block-actions",
|
|
7214
|
+
className: cn.cn(
|
|
7215
|
+
"-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-3 [[data-slot=code-block]>&]:top-3 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-2 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10",
|
|
7216
|
+
className
|
|
7217
|
+
),
|
|
7218
|
+
...props
|
|
7219
|
+
}
|
|
7220
|
+
);
|
|
7221
|
+
}
|
|
7222
|
+
function CodeBlockCopyButton({
|
|
7223
|
+
value,
|
|
7224
|
+
variant = "ghost",
|
|
7225
|
+
size = "icon-xs",
|
|
7226
|
+
className,
|
|
7227
|
+
onClick,
|
|
7228
|
+
...props
|
|
7229
|
+
}) {
|
|
7230
|
+
const [copied, setCopied] = React4__namespace.useState(false);
|
|
7231
|
+
React4__namespace.useEffect(() => {
|
|
7232
|
+
if (!copied) {
|
|
7233
|
+
return;
|
|
7234
|
+
}
|
|
7235
|
+
const timeout = setTimeout(() => setCopied(false), 2e3);
|
|
7236
|
+
return () => clearTimeout(timeout);
|
|
7237
|
+
}, [copied]);
|
|
7238
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7239
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7240
|
+
Button,
|
|
7241
|
+
{
|
|
7242
|
+
"data-slot": "code-block-copy-button",
|
|
7243
|
+
"data-copied": copied || void 0,
|
|
7244
|
+
variant,
|
|
7245
|
+
size,
|
|
7246
|
+
"aria-label": copied ? "Copied" : "Copy",
|
|
7247
|
+
className: cn.cn(className),
|
|
7248
|
+
onClick: (event) => {
|
|
7249
|
+
onClick?.(event);
|
|
7250
|
+
navigator.clipboard.writeText(value).then(() => setCopied(true)).catch(() => {
|
|
7251
|
+
});
|
|
7252
|
+
},
|
|
7253
|
+
...props,
|
|
7254
|
+
children: copied ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7255
|
+
lucide_react_star.CheckIcon,
|
|
7256
|
+
{}
|
|
7257
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
7258
|
+
lucide_react_star.CopyIcon,
|
|
7259
|
+
{}
|
|
7260
|
+
)
|
|
7261
|
+
}
|
|
7262
|
+
),
|
|
7263
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-live": "polite", className: "sr-only", children: copied ? "Copied" : "" })
|
|
7264
|
+
] });
|
|
7265
|
+
}
|
|
7266
|
+
function CodeBlockContent({
|
|
7267
|
+
className,
|
|
7268
|
+
children,
|
|
7269
|
+
style,
|
|
7270
|
+
wrap = false,
|
|
7271
|
+
lineNumbers = false,
|
|
7272
|
+
startLine = 1,
|
|
7273
|
+
...props
|
|
7274
|
+
}) {
|
|
7275
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7276
|
+
"pre",
|
|
7277
|
+
{
|
|
7278
|
+
"data-slot": "code-block-content",
|
|
7279
|
+
"data-wrap": wrap || void 0,
|
|
7280
|
+
"data-numbered": lineNumbers || void 0,
|
|
7281
|
+
dir: "ltr",
|
|
7282
|
+
tabIndex: 0,
|
|
7283
|
+
style: { counterReset: `line ${startLine - 1}`, ...style },
|
|
7284
|
+
className: cn.cn(
|
|
7285
|
+
"min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-4 py-4 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:py-3 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap",
|
|
7286
|
+
className
|
|
7287
|
+
),
|
|
7288
|
+
...props,
|
|
7289
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7290
|
+
"code",
|
|
7291
|
+
{
|
|
7292
|
+
"data-slot": "code-block-code",
|
|
7293
|
+
className: "grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",
|
|
7294
|
+
children: lineNumbers && typeof children === "string" ? children.replace(/\n$/, "").split("\n").map((line, index) => /* @__PURE__ */ jsxRuntime.jsx(CodeBlockLine, { children: line }, index)) : children
|
|
7295
|
+
}
|
|
7296
|
+
)
|
|
7297
|
+
}
|
|
7298
|
+
);
|
|
7299
|
+
}
|
|
7300
|
+
var codeBlockLineVariants = classVarianceAuthority.cva(
|
|
7301
|
+
"relative -mx-4 block min-h-lh px-4 group-data-[size=sm]/code-block:-mx-3 group-data-[size=sm]/code-block:px-3 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']",
|
|
7302
|
+
{
|
|
7303
|
+
variants: {
|
|
7304
|
+
variant: {
|
|
7305
|
+
default: "",
|
|
7306
|
+
added: "bg-muted after:content-['+']",
|
|
7307
|
+
removed: "bg-destructive/10 after:text-destructive after:content-['\u2212']",
|
|
7308
|
+
highlighted: "bg-muted"
|
|
7309
|
+
}
|
|
7310
|
+
},
|
|
7311
|
+
defaultVariants: {
|
|
7312
|
+
variant: "default"
|
|
7313
|
+
}
|
|
7314
|
+
}
|
|
7315
|
+
);
|
|
7316
|
+
function CodeBlockLine({
|
|
7317
|
+
className,
|
|
7318
|
+
variant = "default",
|
|
7319
|
+
children,
|
|
7320
|
+
...props
|
|
7321
|
+
}) {
|
|
7322
|
+
const empty = children === void 0 || children === null || children === "" || Array.isArray(children) && children.length === 0;
|
|
7323
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7324
|
+
"span",
|
|
7325
|
+
{
|
|
7326
|
+
"data-slot": "code-block-line",
|
|
7327
|
+
"data-variant": variant,
|
|
7328
|
+
className: cn.cn(codeBlockLineVariants({ variant }), className),
|
|
7329
|
+
...props,
|
|
7330
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-slot": "code-block-line-content", className: "min-w-0", children: empty ? "\n" : children })
|
|
7331
|
+
}
|
|
7332
|
+
);
|
|
7333
|
+
}
|
|
7334
|
+
function CodeBlockFooter({ className, ...props }) {
|
|
7335
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7336
|
+
"div",
|
|
7337
|
+
{
|
|
7338
|
+
"data-slot": "code-block-footer",
|
|
7339
|
+
className: cn.cn(
|
|
7340
|
+
"flex min-w-0 shrink-0 items-center gap-2 px-4 pb-4 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pb-3",
|
|
7341
|
+
className
|
|
7342
|
+
),
|
|
7343
|
+
...props
|
|
7344
|
+
}
|
|
7345
|
+
);
|
|
7346
|
+
}
|
|
6782
7347
|
function Collapsible({ ...props }) {
|
|
6783
7348
|
return /* @__PURE__ */ jsxRuntime.jsx(collapsible.Collapsible.Root, { "data-slot": "collapsible", ...props });
|
|
6784
7349
|
}
|
|
@@ -7037,7 +7602,7 @@ function ComboboxChipsInput({
|
|
|
7037
7602
|
);
|
|
7038
7603
|
}
|
|
7039
7604
|
function useComboboxAnchor() {
|
|
7040
|
-
return
|
|
7605
|
+
return React4__namespace.useRef(null);
|
|
7041
7606
|
}
|
|
7042
7607
|
function Dialog({ ...props }) {
|
|
7043
7608
|
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
@@ -7060,7 +7625,7 @@ function DialogOverlay({
|
|
|
7060
7625
|
{
|
|
7061
7626
|
"data-slot": "dialog-overlay",
|
|
7062
7627
|
className: cn.cn(
|
|
7063
|
-
"fixed inset-0 isolate z-50 bg-black/
|
|
7628
|
+
"fixed inset-0 isolate z-50 bg-black/50 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
7064
7629
|
className
|
|
7065
7630
|
),
|
|
7066
7631
|
...props
|
|
@@ -7070,7 +7635,7 @@ function DialogOverlay({
|
|
|
7070
7635
|
function DialogContent({
|
|
7071
7636
|
className,
|
|
7072
7637
|
children,
|
|
7073
|
-
showCloseButton =
|
|
7638
|
+
showCloseButton = false,
|
|
7074
7639
|
...props
|
|
7075
7640
|
}) {
|
|
7076
7641
|
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
@@ -7546,9 +8111,9 @@ function ContextMenuShortcut({
|
|
|
7546
8111
|
}
|
|
7547
8112
|
);
|
|
7548
8113
|
}
|
|
7549
|
-
var DrawerContext =
|
|
8114
|
+
var DrawerContext = React4__namespace.createContext(null);
|
|
7550
8115
|
function useDrawer() {
|
|
7551
|
-
const context =
|
|
8116
|
+
const context = React4__namespace.useContext(DrawerContext);
|
|
7552
8117
|
if (!context) {
|
|
7553
8118
|
throw new Error("useDrawer must be used within a Drawer.");
|
|
7554
8119
|
}
|
|
@@ -7562,7 +8127,7 @@ function Drawer({
|
|
|
7562
8127
|
...props
|
|
7563
8128
|
}) {
|
|
7564
8129
|
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
7565
|
-
const contextValue =
|
|
8130
|
+
const contextValue = React4__namespace.useMemo(
|
|
7566
8131
|
() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
|
|
7567
8132
|
[hasSnapPoints, modal, showSwipeHandle, swipeDirection]
|
|
7568
8133
|
);
|
|
@@ -8127,7 +8692,7 @@ function InputOTPSlot({
|
|
|
8127
8692
|
className,
|
|
8128
8693
|
...props
|
|
8129
8694
|
}) {
|
|
8130
|
-
const inputOTPContext =
|
|
8695
|
+
const inputOTPContext = React4__namespace.useContext(inputOtp.OTPInputContext);
|
|
8131
8696
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
8132
8697
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8133
8698
|
"div",
|
|
@@ -9074,9 +9639,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
9074
9639
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
9075
9640
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
9076
9641
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
9077
|
-
var SidebarContext =
|
|
9642
|
+
var SidebarContext = React4__namespace.createContext(null);
|
|
9078
9643
|
function useSidebar() {
|
|
9079
|
-
const context =
|
|
9644
|
+
const context = React4__namespace.useContext(SidebarContext);
|
|
9080
9645
|
if (!context) {
|
|
9081
9646
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
9082
9647
|
}
|
|
@@ -9092,10 +9657,10 @@ function SidebarProvider({
|
|
|
9092
9657
|
...props
|
|
9093
9658
|
}) {
|
|
9094
9659
|
const isMobile = useIsMobile();
|
|
9095
|
-
const [openMobile, setOpenMobile] =
|
|
9096
|
-
const [_open, _setOpen] =
|
|
9660
|
+
const [openMobile, setOpenMobile] = React4__namespace.useState(false);
|
|
9661
|
+
const [_open, _setOpen] = React4__namespace.useState(defaultOpen);
|
|
9097
9662
|
const open = openProp ?? _open;
|
|
9098
|
-
const setOpen =
|
|
9663
|
+
const setOpen = React4__namespace.useCallback(
|
|
9099
9664
|
(value) => {
|
|
9100
9665
|
const openState = typeof value === "function" ? value(open) : value;
|
|
9101
9666
|
if (setOpenProp) {
|
|
@@ -9107,10 +9672,10 @@ function SidebarProvider({
|
|
|
9107
9672
|
},
|
|
9108
9673
|
[setOpenProp, open]
|
|
9109
9674
|
);
|
|
9110
|
-
const toggleSidebar =
|
|
9675
|
+
const toggleSidebar = React4__namespace.useCallback(() => {
|
|
9111
9676
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
9112
9677
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
9113
|
-
|
|
9678
|
+
React4__namespace.useEffect(() => {
|
|
9114
9679
|
const handleKeyDown = (event) => {
|
|
9115
9680
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
9116
9681
|
event.preventDefault();
|
|
@@ -9121,7 +9686,7 @@ function SidebarProvider({
|
|
|
9121
9686
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
9122
9687
|
}, [toggleSidebar]);
|
|
9123
9688
|
const state = open ? "expanded" : "collapsed";
|
|
9124
|
-
const contextValue =
|
|
9689
|
+
const contextValue = React4__namespace.useMemo(
|
|
9125
9690
|
() => ({
|
|
9126
9691
|
state,
|
|
9127
9692
|
open,
|
|
@@ -9581,7 +10146,7 @@ function SidebarMenuSkeleton({
|
|
|
9581
10146
|
showIcon = false,
|
|
9582
10147
|
...props
|
|
9583
10148
|
}) {
|
|
9584
|
-
const [width] =
|
|
10149
|
+
const [width] = React4__namespace.useState(() => {
|
|
9585
10150
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
9586
10151
|
});
|
|
9587
10152
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -9788,7 +10353,7 @@ function TabsContent({ className, ...props }) {
|
|
|
9788
10353
|
}
|
|
9789
10354
|
);
|
|
9790
10355
|
}
|
|
9791
|
-
var ToggleGroupContext =
|
|
10356
|
+
var ToggleGroupContext = React4__namespace.createContext({
|
|
9792
10357
|
size: "default",
|
|
9793
10358
|
variant: "default",
|
|
9794
10359
|
spacing: 2,
|
|
@@ -9834,7 +10399,7 @@ function ToggleGroupItem({
|
|
|
9834
10399
|
size = "default",
|
|
9835
10400
|
...props
|
|
9836
10401
|
}) {
|
|
9837
|
-
const context =
|
|
10402
|
+
const context = React4__namespace.useContext(ToggleGroupContext);
|
|
9838
10403
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9839
10404
|
toggle.Toggle,
|
|
9840
10405
|
{
|
|
@@ -9941,6 +10506,14 @@ exports.CarouselPrevious = CarouselPrevious;
|
|
|
9941
10506
|
exports.Checkbox = Checkbox;
|
|
9942
10507
|
exports.CheckboxGroup = CheckboxGroup;
|
|
9943
10508
|
exports.Code = Code;
|
|
10509
|
+
exports.CodeBlock = CodeBlock;
|
|
10510
|
+
exports.CodeBlockActions = CodeBlockActions;
|
|
10511
|
+
exports.CodeBlockContent = CodeBlockContent;
|
|
10512
|
+
exports.CodeBlockCopyButton = CodeBlockCopyButton;
|
|
10513
|
+
exports.CodeBlockFooter = CodeBlockFooter;
|
|
10514
|
+
exports.CodeBlockHeader = CodeBlockHeader;
|
|
10515
|
+
exports.CodeBlockLine = CodeBlockLine;
|
|
10516
|
+
exports.CodeBlockTitle = CodeBlockTitle;
|
|
9944
10517
|
exports.Collapsible = Collapsible;
|
|
9945
10518
|
exports.CollapsibleContent = CollapsibleContent;
|
|
9946
10519
|
exports.CollapsibleTrigger = CollapsibleTrigger;
|
|
@@ -10283,6 +10856,7 @@ exports.useBreakpoint = useBreakpoint;
|
|
|
10283
10856
|
exports.useCarousel = useCarousel;
|
|
10284
10857
|
exports.useComboboxAnchor = useComboboxAnchor;
|
|
10285
10858
|
exports.useDebounce = useDebounce;
|
|
10859
|
+
exports.useHighlightedCode = useHighlightedCode;
|
|
10286
10860
|
exports.useInitTheme = useInitTheme;
|
|
10287
10861
|
exports.useIsMobile = useIsMobile;
|
|
10288
10862
|
exports.useSidebar = useSidebar;
|