@umami/react-zen 1.0.1 → 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 +782 -209
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +699 -135
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
- package/styles.css +112 -10
- 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);
|
|
@@ -4688,9 +4908,9 @@ function FormField({
|
|
|
4688
4908
|
let control;
|
|
4689
4909
|
if (typeof children === "function") {
|
|
4690
4910
|
control = children({ field, fieldState, context, controlProps });
|
|
4691
|
-
} else if (
|
|
4911
|
+
} else if (React4.isValidElement(children)) {
|
|
4692
4912
|
const ownDescribedBy = children.props["aria-describedby"];
|
|
4693
|
-
control =
|
|
4913
|
+
control = React4.cloneElement(children, {
|
|
4694
4914
|
...bindField(getBinding(children.type), field),
|
|
4695
4915
|
...controlProps,
|
|
4696
4916
|
"aria-describedby": [ownDescribedBy, controlProps["aria-describedby"]].filter(Boolean).join(" ") || void 0
|
|
@@ -4732,7 +4952,7 @@ function FormFieldArray({
|
|
|
4732
4952
|
children,
|
|
4733
4953
|
...props
|
|
4734
4954
|
}) {
|
|
4735
|
-
const labelId =
|
|
4955
|
+
const labelId = React4.useId();
|
|
4736
4956
|
const context = reactHookForm.useFormContext();
|
|
4737
4957
|
const { formState, control, register } = context;
|
|
4738
4958
|
const fieldArray = reactHookForm.useFieldArray({
|
|
@@ -4765,8 +4985,22 @@ function FormResetButton({
|
|
|
4765
4985
|
};
|
|
4766
4986
|
return /* @__PURE__ */ jsxRuntime.jsx(Button, { ...props, type: "reset", variant, onClick: handleClick });
|
|
4767
4987
|
}
|
|
4768
|
-
function Spinner({ className, ...props }) {
|
|
4769
|
-
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
|
+
);
|
|
4770
5004
|
}
|
|
4771
5005
|
function FormSubmitButton({
|
|
4772
5006
|
disabled,
|
|
@@ -4816,10 +5050,142 @@ function Heading({
|
|
|
4816
5050
|
}
|
|
4817
5051
|
);
|
|
4818
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
|
+
}
|
|
4819
5185
|
var MOBILE_BREAKPOINT = 768;
|
|
4820
5186
|
function useIsMobile() {
|
|
4821
|
-
const [isMobile, setIsMobile] =
|
|
4822
|
-
|
|
5187
|
+
const [isMobile, setIsMobile] = React4__namespace.useState(void 0);
|
|
5188
|
+
React4__namespace.useEffect(() => {
|
|
4823
5189
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
4824
5190
|
const onChange = () => {
|
|
4825
5191
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -4839,8 +5205,8 @@ var breakpoints = {
|
|
|
4839
5205
|
};
|
|
4840
5206
|
var DEBOUNCE_DELAY_MS = 150;
|
|
4841
5207
|
function useBreakpoint() {
|
|
4842
|
-
const [breakpoint, setBreakpoint] =
|
|
4843
|
-
const calculateBreakpoint =
|
|
5208
|
+
const [breakpoint, setBreakpoint] = React4.useState(null);
|
|
5209
|
+
const calculateBreakpoint = React4.useCallback(() => {
|
|
4844
5210
|
if (typeof window === "undefined") {
|
|
4845
5211
|
return;
|
|
4846
5212
|
}
|
|
@@ -4853,7 +5219,7 @@ function useBreakpoint() {
|
|
|
4853
5219
|
}
|
|
4854
5220
|
setBreakpoint(currentBreakpoint);
|
|
4855
5221
|
}, []);
|
|
4856
|
-
|
|
5222
|
+
React4.useEffect(() => {
|
|
4857
5223
|
calculateBreakpoint();
|
|
4858
5224
|
const debouncedResize = debounce(calculateBreakpoint, DEBOUNCE_DELAY_MS);
|
|
4859
5225
|
window.addEventListener("resize", debouncedResize);
|
|
@@ -4864,8 +5230,8 @@ function useBreakpoint() {
|
|
|
4864
5230
|
return breakpoint;
|
|
4865
5231
|
}
|
|
4866
5232
|
function useDebounce(value, delay) {
|
|
4867
|
-
const [debouncedValue, setValue] =
|
|
4868
|
-
|
|
5233
|
+
const [debouncedValue, setValue] = React4.useState(value);
|
|
5234
|
+
React4.useEffect(() => {
|
|
4869
5235
|
const timer = setTimeout(() => {
|
|
4870
5236
|
setValue(value);
|
|
4871
5237
|
}, delay);
|
|
@@ -4958,11 +5324,11 @@ function useInitTheme(preferred, colorScheme, preferredPalette) {
|
|
|
4958
5324
|
const initTheme = useTheme((s) => s.initTheme);
|
|
4959
5325
|
const initPalette = useTheme((s) => s.initPalette);
|
|
4960
5326
|
const syncTheme = useTheme((s) => s.syncTheme);
|
|
4961
|
-
|
|
5327
|
+
React4.useLayoutEffect(() => {
|
|
4962
5328
|
initTheme(preferred, colorScheme);
|
|
4963
5329
|
initPalette(preferredPalette);
|
|
4964
5330
|
}, [preferred, colorScheme, preferredPalette, initTheme, initPalette]);
|
|
4965
|
-
|
|
5331
|
+
React4.useEffect(() => {
|
|
4966
5332
|
if (typeof window === "undefined") return;
|
|
4967
5333
|
const observer = new MutationObserver((mutations) => {
|
|
4968
5334
|
for (const mutation of mutations) {
|
|
@@ -5055,7 +5421,7 @@ var positionClasses = {
|
|
|
5055
5421
|
};
|
|
5056
5422
|
function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
5057
5423
|
const { toasts } = useToast();
|
|
5058
|
-
const [hovered, setHovered] =
|
|
5424
|
+
const [hovered, setHovered] = React4.useState(false);
|
|
5059
5425
|
const transitions = web.useTransition(toasts, {
|
|
5060
5426
|
from: {
|
|
5061
5427
|
opacity: 0,
|
|
@@ -5068,7 +5434,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
5068
5434
|
},
|
|
5069
5435
|
config: { duration: 100 }
|
|
5070
5436
|
});
|
|
5071
|
-
|
|
5437
|
+
React4.useEffect(() => {
|
|
5072
5438
|
if (!duration || hovered || !toasts.length) {
|
|
5073
5439
|
return;
|
|
5074
5440
|
}
|
|
@@ -5100,7 +5466,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
|
|
|
5100
5466
|
}
|
|
5101
5467
|
);
|
|
5102
5468
|
}
|
|
5103
|
-
var ToastContext =
|
|
5469
|
+
var ToastContext = React4.createContext({});
|
|
5104
5470
|
function ToastProvider({ children, ...props }) {
|
|
5105
5471
|
return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: props, children: [
|
|
5106
5472
|
children,
|
|
@@ -5131,7 +5497,7 @@ function displayToast(message, { duration = TOAST_DURATION, ...options } = {}) {
|
|
|
5131
5497
|
}
|
|
5132
5498
|
function useToast() {
|
|
5133
5499
|
const { toasts } = store();
|
|
5134
|
-
const config =
|
|
5500
|
+
const config = React4.useContext(ToastContext);
|
|
5135
5501
|
const toast = (message, options) => {
|
|
5136
5502
|
displayToast(message, { ...options, ...config });
|
|
5137
5503
|
};
|
|
@@ -5187,7 +5553,7 @@ function Icon({
|
|
|
5187
5553
|
if (fillColorStr) {
|
|
5188
5554
|
svgProps.fill = getCssColorValue(fillColorStr);
|
|
5189
5555
|
}
|
|
5190
|
-
const clonedChild =
|
|
5556
|
+
const clonedChild = React4.isValidElement(children) ? React4.cloneElement(children, svgProps) : children;
|
|
5191
5557
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className: wrapperClasses, style: wrapperStyle, children: clonedChild });
|
|
5192
5558
|
}
|
|
5193
5559
|
var objectFitMap = {
|
|
@@ -5218,7 +5584,7 @@ function Image({
|
|
|
5218
5584
|
);
|
|
5219
5585
|
return /* @__PURE__ */ jsxRuntime.jsx("img", { ...props, className: classes, src, alt });
|
|
5220
5586
|
}
|
|
5221
|
-
var ListContext =
|
|
5587
|
+
var ListContext = React4.createContext({
|
|
5222
5588
|
selectionMode: "none",
|
|
5223
5589
|
showCheckmark: true,
|
|
5224
5590
|
selected: /* @__PURE__ */ new Set(),
|
|
@@ -5238,8 +5604,8 @@ function List({
|
|
|
5238
5604
|
...props
|
|
5239
5605
|
}) {
|
|
5240
5606
|
const listId = useFieldId(id);
|
|
5241
|
-
const labelId =
|
|
5242
|
-
const [uncontrolled, setUncontrolled] =
|
|
5607
|
+
const labelId = React4.useId();
|
|
5608
|
+
const [uncontrolled, setUncontrolled] = React4.useState(() => defaultValue ?? []);
|
|
5243
5609
|
const selectedValues = value ?? uncontrolled;
|
|
5244
5610
|
const selected = new Set(selectedValues);
|
|
5245
5611
|
const toggle = (itemValue) => {
|
|
@@ -5317,7 +5683,7 @@ function ListItem({
|
|
|
5317
5683
|
onKeyDown,
|
|
5318
5684
|
...props
|
|
5319
5685
|
}) {
|
|
5320
|
-
const { selectionMode, showCheckmark, selected, toggle } =
|
|
5686
|
+
const { selectionMode, showCheckmark, selected, toggle } = React4.useContext(ListContext);
|
|
5321
5687
|
const itemValue = value ?? (typeof children === "string" ? children : "");
|
|
5322
5688
|
const isSelected = selected.has(itemValue);
|
|
5323
5689
|
const hasIndicator = showCheckmark && selectionMode !== "none";
|
|
@@ -5376,7 +5742,7 @@ function ListSeparator({ className, ...props }) {
|
|
|
5376
5742
|
);
|
|
5377
5743
|
}
|
|
5378
5744
|
function ListSection({ title, className, children, ...props }) {
|
|
5379
|
-
const titleId =
|
|
5745
|
+
const titleId = React4.useId();
|
|
5380
5746
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5381
5747
|
"div",
|
|
5382
5748
|
{
|
|
@@ -5492,8 +5858,8 @@ function Meter({ label, showValue, className, ...props }) {
|
|
|
5492
5858
|
}
|
|
5493
5859
|
);
|
|
5494
5860
|
}
|
|
5495
|
-
var NavbarContext =
|
|
5496
|
-
var NavbarContentContext =
|
|
5861
|
+
var NavbarContext = React4.createContext({ showArrow: true });
|
|
5862
|
+
var NavbarContentContext = React4.createContext(false);
|
|
5497
5863
|
var triggerClassName = cn.cn(
|
|
5498
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",
|
|
5499
5865
|
"hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
@@ -5573,7 +5939,7 @@ function NavbarItem({
|
|
|
5573
5939
|
color: _color,
|
|
5574
5940
|
...props
|
|
5575
5941
|
}) {
|
|
5576
|
-
const { showArrow } =
|
|
5942
|
+
const { showArrow } = React4.useContext(NavbarContext);
|
|
5577
5943
|
if (label) {
|
|
5578
5944
|
return /* @__PURE__ */ jsxRuntime.jsxs(navigationMenu.NavigationMenu.Item, { "data-slot": "navbar-item", ...props, children: [
|
|
5579
5945
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5601,7 +5967,7 @@ function NavbarItem({
|
|
|
5601
5967
|
);
|
|
5602
5968
|
}
|
|
5603
5969
|
function NavbarLink({ className, ...props }) {
|
|
5604
|
-
const inContent =
|
|
5970
|
+
const inContent = React4.useContext(NavbarContentContext);
|
|
5605
5971
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5606
5972
|
navigationMenu.NavigationMenu.Link,
|
|
5607
5973
|
{
|
|
@@ -5618,7 +5984,7 @@ var stepperClassName = cn.cn(
|
|
|
5618
5984
|
buttonVariants({ variant: "ghost", size: "icon-xs" }),
|
|
5619
5985
|
"rounded-[calc(var(--radius)-5px)] text-muted-foreground"
|
|
5620
5986
|
);
|
|
5621
|
-
var NumberField =
|
|
5987
|
+
var NumberField = React4.forwardRef(function NumberField2({
|
|
5622
5988
|
label,
|
|
5623
5989
|
placeholder,
|
|
5624
5990
|
decrementLabel = "Decrease",
|
|
@@ -5636,7 +6002,7 @@ var NumberField = React3.forwardRef(function NumberField2({
|
|
|
5636
6002
|
id: fieldId,
|
|
5637
6003
|
"data-slot": "number-field",
|
|
5638
6004
|
className: cn.cn(
|
|
5639
|
-
"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",
|
|
5640
6006
|
className
|
|
5641
6007
|
),
|
|
5642
6008
|
children: [
|
|
@@ -5703,7 +6069,7 @@ function PageHeaderTitle({
|
|
|
5703
6069
|
return /* @__PURE__ */ jsxRuntime.jsxs(Column, { gap: "1", ...props, children: [
|
|
5704
6070
|
breadcrumb,
|
|
5705
6071
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xl", weight: "semibold", children: title }),
|
|
5706
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "muted
|
|
6072
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "muted", children: description }),
|
|
5707
6073
|
children
|
|
5708
6074
|
] });
|
|
5709
6075
|
}
|
|
@@ -5857,12 +6223,12 @@ function Badge({
|
|
|
5857
6223
|
}
|
|
5858
6224
|
});
|
|
5859
6225
|
}
|
|
5860
|
-
var TagContext =
|
|
6226
|
+
var TagContext = React4.createContext({
|
|
5861
6227
|
removable: false,
|
|
5862
6228
|
remove: () => void 0
|
|
5863
6229
|
});
|
|
5864
6230
|
function TagGroup({ label, children, className, onRemove, ...props }) {
|
|
5865
|
-
const labelId =
|
|
6231
|
+
const labelId = React4.useId();
|
|
5866
6232
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5867
6233
|
TagContext.Provider,
|
|
5868
6234
|
{
|
|
@@ -5870,7 +6236,7 @@ function TagGroup({ label, children, className, onRemove, ...props }) {
|
|
|
5870
6236
|
removable: !!onRemove,
|
|
5871
6237
|
remove: (value) => onRemove?.(value)
|
|
5872
6238
|
},
|
|
5873
|
-
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: [
|
|
5874
6240
|
label && /* @__PURE__ */ jsxRuntime.jsx(FieldTitle, { id: labelId, children: label }),
|
|
5875
6241
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5876
6242
|
"ul",
|
|
@@ -5894,7 +6260,7 @@ function Tag({
|
|
|
5894
6260
|
onKeyDown,
|
|
5895
6261
|
...props
|
|
5896
6262
|
}) {
|
|
5897
|
-
const { removable, remove } =
|
|
6263
|
+
const { removable, remove } = React4.useContext(TagContext);
|
|
5898
6264
|
const tagValue = value ?? (typeof children === "string" ? children : "");
|
|
5899
6265
|
const isRemovable = removable && !disabled;
|
|
5900
6266
|
const handleKeyDown = (event) => {
|
|
@@ -5956,10 +6322,10 @@ function ThemeButton({
|
|
|
5956
6322
|
...props
|
|
5957
6323
|
}) {
|
|
5958
6324
|
const globalTheme = useTheme();
|
|
5959
|
-
const [localTheme, setLocalTheme] =
|
|
5960
|
-
const initializedRef =
|
|
6325
|
+
const [localTheme, setLocalTheme] = React4.useState(null);
|
|
6326
|
+
const initializedRef = React4.useRef(false);
|
|
5961
6327
|
const isLocal = !!target;
|
|
5962
|
-
|
|
6328
|
+
React4.useEffect(() => {
|
|
5963
6329
|
if (isLocal && target && !initializedRef.current) {
|
|
5964
6330
|
const element = getElement(target);
|
|
5965
6331
|
if (element) {
|
|
@@ -6026,14 +6392,14 @@ function getSystemTheme() {
|
|
|
6026
6392
|
}
|
|
6027
6393
|
function ThemeSwitcher({ className }) {
|
|
6028
6394
|
const { setTheme } = useTheme();
|
|
6029
|
-
const [mode, setMode] =
|
|
6030
|
-
|
|
6395
|
+
const [mode, setMode] = React4.useState("system");
|
|
6396
|
+
React4.useEffect(() => {
|
|
6031
6397
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
6032
6398
|
if (stored && ["light", "dark", "system"].includes(stored)) {
|
|
6033
6399
|
setMode(stored);
|
|
6034
6400
|
}
|
|
6035
6401
|
}, []);
|
|
6036
|
-
|
|
6402
|
+
React4.useEffect(() => {
|
|
6037
6403
|
if (mode === "system") {
|
|
6038
6404
|
setTheme(getSystemTheme());
|
|
6039
6405
|
} else {
|
|
@@ -6041,7 +6407,7 @@ function ThemeSwitcher({ className }) {
|
|
|
6041
6407
|
}
|
|
6042
6408
|
localStorage.setItem(STORAGE_KEY, mode);
|
|
6043
6409
|
}, [mode, setTheme]);
|
|
6044
|
-
|
|
6410
|
+
React4.useEffect(() => {
|
|
6045
6411
|
if (mode !== "system") return;
|
|
6046
6412
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
6047
6413
|
const handleChange = () => {
|
|
@@ -6595,9 +6961,9 @@ function CardFooter({ className, ...props }) {
|
|
|
6595
6961
|
}
|
|
6596
6962
|
);
|
|
6597
6963
|
}
|
|
6598
|
-
var CarouselContext =
|
|
6964
|
+
var CarouselContext = React4__namespace.createContext(null);
|
|
6599
6965
|
function useCarousel() {
|
|
6600
|
-
const context =
|
|
6966
|
+
const context = React4__namespace.useContext(CarouselContext);
|
|
6601
6967
|
if (!context) {
|
|
6602
6968
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
6603
6969
|
}
|
|
@@ -6619,20 +6985,20 @@ function Carousel({
|
|
|
6619
6985
|
},
|
|
6620
6986
|
plugins
|
|
6621
6987
|
);
|
|
6622
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
6623
|
-
const [canScrollNext, setCanScrollNext] =
|
|
6624
|
-
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) => {
|
|
6625
6991
|
if (!api2) return;
|
|
6626
6992
|
setCanScrollPrev(api2.canScrollPrev());
|
|
6627
6993
|
setCanScrollNext(api2.canScrollNext());
|
|
6628
6994
|
}, []);
|
|
6629
|
-
const scrollPrev =
|
|
6995
|
+
const scrollPrev = React4__namespace.useCallback(() => {
|
|
6630
6996
|
api?.scrollPrev();
|
|
6631
6997
|
}, [api]);
|
|
6632
|
-
const scrollNext =
|
|
6998
|
+
const scrollNext = React4__namespace.useCallback(() => {
|
|
6633
6999
|
api?.scrollNext();
|
|
6634
7000
|
}, [api]);
|
|
6635
|
-
const handleKeyDown =
|
|
7001
|
+
const handleKeyDown = React4__namespace.useCallback(
|
|
6636
7002
|
(event) => {
|
|
6637
7003
|
if (event.key === "ArrowLeft") {
|
|
6638
7004
|
event.preventDefault();
|
|
@@ -6644,11 +7010,11 @@ function Carousel({
|
|
|
6644
7010
|
},
|
|
6645
7011
|
[scrollPrev, scrollNext]
|
|
6646
7012
|
);
|
|
6647
|
-
|
|
7013
|
+
React4__namespace.useEffect(() => {
|
|
6648
7014
|
if (!api || !setApi) return;
|
|
6649
7015
|
setApi(api);
|
|
6650
7016
|
}, [api, setApi]);
|
|
6651
|
-
|
|
7017
|
+
React4__namespace.useEffect(() => {
|
|
6652
7018
|
if (!api) return;
|
|
6653
7019
|
onSelect(api);
|
|
6654
7020
|
api.on("reInit", onSelect);
|
|
@@ -6780,6 +7146,204 @@ function CarouselNext({
|
|
|
6780
7146
|
}
|
|
6781
7147
|
);
|
|
6782
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
|
+
}
|
|
6783
7347
|
function Collapsible({ ...props }) {
|
|
6784
7348
|
return /* @__PURE__ */ jsxRuntime.jsx(collapsible.Collapsible.Root, { "data-slot": "collapsible", ...props });
|
|
6785
7349
|
}
|
|
@@ -7038,7 +7602,7 @@ function ComboboxChipsInput({
|
|
|
7038
7602
|
);
|
|
7039
7603
|
}
|
|
7040
7604
|
function useComboboxAnchor() {
|
|
7041
|
-
return
|
|
7605
|
+
return React4__namespace.useRef(null);
|
|
7042
7606
|
}
|
|
7043
7607
|
function Dialog({ ...props }) {
|
|
7044
7608
|
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
@@ -7061,7 +7625,7 @@ function DialogOverlay({
|
|
|
7061
7625
|
{
|
|
7062
7626
|
"data-slot": "dialog-overlay",
|
|
7063
7627
|
className: cn.cn(
|
|
7064
|
-
"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",
|
|
7065
7629
|
className
|
|
7066
7630
|
),
|
|
7067
7631
|
...props
|
|
@@ -7071,7 +7635,7 @@ function DialogOverlay({
|
|
|
7071
7635
|
function DialogContent({
|
|
7072
7636
|
className,
|
|
7073
7637
|
children,
|
|
7074
|
-
showCloseButton =
|
|
7638
|
+
showCloseButton = false,
|
|
7075
7639
|
...props
|
|
7076
7640
|
}) {
|
|
7077
7641
|
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
@@ -7547,9 +8111,9 @@ function ContextMenuShortcut({
|
|
|
7547
8111
|
}
|
|
7548
8112
|
);
|
|
7549
8113
|
}
|
|
7550
|
-
var DrawerContext =
|
|
8114
|
+
var DrawerContext = React4__namespace.createContext(null);
|
|
7551
8115
|
function useDrawer() {
|
|
7552
|
-
const context =
|
|
8116
|
+
const context = React4__namespace.useContext(DrawerContext);
|
|
7553
8117
|
if (!context) {
|
|
7554
8118
|
throw new Error("useDrawer must be used within a Drawer.");
|
|
7555
8119
|
}
|
|
@@ -7563,7 +8127,7 @@ function Drawer({
|
|
|
7563
8127
|
...props
|
|
7564
8128
|
}) {
|
|
7565
8129
|
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
7566
|
-
const contextValue =
|
|
8130
|
+
const contextValue = React4__namespace.useMemo(
|
|
7567
8131
|
() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
|
|
7568
8132
|
[hasSnapPoints, modal, showSwipeHandle, swipeDirection]
|
|
7569
8133
|
);
|
|
@@ -8128,7 +8692,7 @@ function InputOTPSlot({
|
|
|
8128
8692
|
className,
|
|
8129
8693
|
...props
|
|
8130
8694
|
}) {
|
|
8131
|
-
const inputOTPContext =
|
|
8695
|
+
const inputOTPContext = React4__namespace.useContext(inputOtp.OTPInputContext);
|
|
8132
8696
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
8133
8697
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8134
8698
|
"div",
|
|
@@ -9075,9 +9639,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
9075
9639
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
9076
9640
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
9077
9641
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
9078
|
-
var SidebarContext =
|
|
9642
|
+
var SidebarContext = React4__namespace.createContext(null);
|
|
9079
9643
|
function useSidebar() {
|
|
9080
|
-
const context =
|
|
9644
|
+
const context = React4__namespace.useContext(SidebarContext);
|
|
9081
9645
|
if (!context) {
|
|
9082
9646
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
9083
9647
|
}
|
|
@@ -9093,10 +9657,10 @@ function SidebarProvider({
|
|
|
9093
9657
|
...props
|
|
9094
9658
|
}) {
|
|
9095
9659
|
const isMobile = useIsMobile();
|
|
9096
|
-
const [openMobile, setOpenMobile] =
|
|
9097
|
-
const [_open, _setOpen] =
|
|
9660
|
+
const [openMobile, setOpenMobile] = React4__namespace.useState(false);
|
|
9661
|
+
const [_open, _setOpen] = React4__namespace.useState(defaultOpen);
|
|
9098
9662
|
const open = openProp ?? _open;
|
|
9099
|
-
const setOpen =
|
|
9663
|
+
const setOpen = React4__namespace.useCallback(
|
|
9100
9664
|
(value) => {
|
|
9101
9665
|
const openState = typeof value === "function" ? value(open) : value;
|
|
9102
9666
|
if (setOpenProp) {
|
|
@@ -9108,10 +9672,10 @@ function SidebarProvider({
|
|
|
9108
9672
|
},
|
|
9109
9673
|
[setOpenProp, open]
|
|
9110
9674
|
);
|
|
9111
|
-
const toggleSidebar =
|
|
9675
|
+
const toggleSidebar = React4__namespace.useCallback(() => {
|
|
9112
9676
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
9113
9677
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
9114
|
-
|
|
9678
|
+
React4__namespace.useEffect(() => {
|
|
9115
9679
|
const handleKeyDown = (event) => {
|
|
9116
9680
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
9117
9681
|
event.preventDefault();
|
|
@@ -9122,7 +9686,7 @@ function SidebarProvider({
|
|
|
9122
9686
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
9123
9687
|
}, [toggleSidebar]);
|
|
9124
9688
|
const state = open ? "expanded" : "collapsed";
|
|
9125
|
-
const contextValue =
|
|
9689
|
+
const contextValue = React4__namespace.useMemo(
|
|
9126
9690
|
() => ({
|
|
9127
9691
|
state,
|
|
9128
9692
|
open,
|
|
@@ -9582,7 +10146,7 @@ function SidebarMenuSkeleton({
|
|
|
9582
10146
|
showIcon = false,
|
|
9583
10147
|
...props
|
|
9584
10148
|
}) {
|
|
9585
|
-
const [width] =
|
|
10149
|
+
const [width] = React4__namespace.useState(() => {
|
|
9586
10150
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
9587
10151
|
});
|
|
9588
10152
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -9789,7 +10353,7 @@ function TabsContent({ className, ...props }) {
|
|
|
9789
10353
|
}
|
|
9790
10354
|
);
|
|
9791
10355
|
}
|
|
9792
|
-
var ToggleGroupContext =
|
|
10356
|
+
var ToggleGroupContext = React4__namespace.createContext({
|
|
9793
10357
|
size: "default",
|
|
9794
10358
|
variant: "default",
|
|
9795
10359
|
spacing: 2,
|
|
@@ -9835,7 +10399,7 @@ function ToggleGroupItem({
|
|
|
9835
10399
|
size = "default",
|
|
9836
10400
|
...props
|
|
9837
10401
|
}) {
|
|
9838
|
-
const context =
|
|
10402
|
+
const context = React4__namespace.useContext(ToggleGroupContext);
|
|
9839
10403
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9840
10404
|
toggle.Toggle,
|
|
9841
10405
|
{
|
|
@@ -9942,6 +10506,14 @@ exports.CarouselPrevious = CarouselPrevious;
|
|
|
9942
10506
|
exports.Checkbox = Checkbox;
|
|
9943
10507
|
exports.CheckboxGroup = CheckboxGroup;
|
|
9944
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;
|
|
9945
10517
|
exports.Collapsible = Collapsible;
|
|
9946
10518
|
exports.CollapsibleContent = CollapsibleContent;
|
|
9947
10519
|
exports.CollapsibleTrigger = CollapsibleTrigger;
|
|
@@ -10284,6 +10856,7 @@ exports.useBreakpoint = useBreakpoint;
|
|
|
10284
10856
|
exports.useCarousel = useCarousel;
|
|
10285
10857
|
exports.useComboboxAnchor = useComboboxAnchor;
|
|
10286
10858
|
exports.useDebounce = useDebounce;
|
|
10859
|
+
exports.useHighlightedCode = useHighlightedCode;
|
|
10287
10860
|
exports.useInitTheme = useInitTheme;
|
|
10288
10861
|
exports.useIsMobile = useIsMobile;
|
|
10289
10862
|
exports.useSidebar = useSidebar;
|