@umami/react-zen 1.0.1 → 1.0.3

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.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 React3 = require('react');
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 React3__namespace = /*#__PURE__*/_interopNamespace(React3);
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 = React3.useId();
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 = React3.useMemo(() => {
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
- function mapIdProperty(data) {
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-foreground",
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 (React3.isValidElement(render)) {
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 React3.cloneElement(render, { ...merged, children, className });
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 = React3.forwardRef(function Box2({
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/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
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 = React3.useRef(null);
3139
- const [input, setInput] = React3.useState("");
3140
- const [pending, setPending] = React3.useState(false);
3141
- const inputId = React3.useId();
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] = React3.useState(false);
3239
- const timeoutRef = React3.useRef(void 0);
3240
- React3.useEffect(() => {
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 = React3.useId();
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 Row({ reverse, children, ...props }) {
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
- children: rows.map((row, index) => {
3396
+ className: cn.cn("overflow-hidden bg-white text-sm dark:bg-black", 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(React3.Fragment, { children: [
3400
- /* @__PURE__ */ jsxRuntime.jsx(Row, { paddingY: "3", border: "bottom", paddingRight: "6", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { weight: "medium", children: row?.label }) }),
3401
- /* @__PURE__ */ jsxRuntime.jsx(Row, { paddingY: "3", border: "bottom", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { children: row?.value }) })
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,337 @@ function TableCaption({
3531
3553
  }
3532
3554
  );
3533
3555
  }
3534
- var SELECTION_COLUMN_WIDTH = "2rem";
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 [uncontrolledSelectedRows, setUncontrolledSelectedRows] = React3.useState(defaultSelectedRows);
3552
- const selectedRows = selectedRowsProp ?? uncontrolledSelectedRows;
3553
- const rows = mapIdProperty(data);
3554
- const rowIds = rows.map((row) => String(row.id));
3555
- const columns = React3.Children.toArray(children).filter(React3.isValidElement).map((child) => child.props);
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.jsx(Grid, { width: "100%", gap: "6", children: rows.map((row, index) => {
3559
- const items = visibleColumns.map(({ id, label, children: children2 }) => {
3560
- const value = typeof children2 === "function" ? children2(row, index) : children2 ?? row[id];
3561
- return { id, label, value };
3562
- });
3563
- return /* @__PURE__ */ jsxRuntime.jsx(DataCard, { data: items }, `${row.id}-${index}`);
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 setSelectedRows = (next) => {
3573
- if (selectedRowsProp === void 0) {
3574
- setUncontrolledSelectedRows(next);
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(
3767
+ "grid overflow-hidden rounded-lg border border-border bg-white dark:bg-black",
3768
+ className
3769
+ ),
3596
3770
  children: [
3597
- /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: "contents", children: /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { className: "grid hover:bg-transparent", style: rowStyle, children: [
3598
- isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "flex items-center", children: selectionMode === "multiple" && /* @__PURE__ */ jsxRuntime.jsx(
3599
- Checkbox,
3600
- {
3601
- "aria-label": "Select all rows",
3602
- checked: allSelected,
3603
- indeterminate: selectedCount > 0 && !allSelected,
3604
- onCheckedChange: (checked) => setSelectedRows(checked ? rowIds : [])
3605
- }
3606
- ) }),
3607
- visibleColumns.map(({ id, label, align }) => /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: cn.cn("flex items-center", align && alignClasses[align]), children: label }, id))
3608
- ] }) }),
3609
- /* @__PURE__ */ jsxRuntime.jsx(TableBody, { className: "contents", children: rows.map((row, index) => {
3610
- const rowId = String(row.id);
3611
- const isSelected = isSelectable && selectedRows.includes(rowId);
3771
+ /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { role: "rowgroup", className: "contents", children: /* @__PURE__ */ jsxRuntime.jsxs(
3772
+ TableRow,
3773
+ {
3774
+ role: "row",
3775
+ className: cn.cn(ROW_CLASS, "bg-muted/50 hover:bg-muted/50"),
3776
+ style: rowStyle,
3777
+ children: [
3778
+ isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableHead, { role: "columnheader", className: "flex items-center", children: selectionMode === "multiple" && /* @__PURE__ */ jsxRuntime.jsx(
3779
+ Checkbox,
3780
+ {
3781
+ "aria-label": "Select all rows",
3782
+ checked: allSelected,
3783
+ indeterminate: someSelected && !allSelected,
3784
+ onCheckedChange: (checked) => table.toggleAllRowsSelected(checked)
3785
+ }
3786
+ ) }),
3787
+ visibleColumns.map((column) => {
3788
+ const tableColumn = table.getColumn(column.id);
3789
+ const sorted = column.sortable ? tableColumn?.getIsSorted() : false;
3790
+ const SortIcon = sorted === "asc" ? icons_exports.ArrowUp : sorted === "desc" ? icons_exports.ArrowDown : icons_exports.ChevronsUpDown;
3791
+ return /* @__PURE__ */ jsxRuntime.jsx(
3792
+ TableHead,
3793
+ {
3794
+ role: "columnheader",
3795
+ "aria-sort": column.sortable ? sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : "none" : void 0,
3796
+ className: cn.cn("flex items-center", column.align && alignClasses[column.align]),
3797
+ children: column.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
3798
+ "button",
3799
+ {
3800
+ type: "button",
3801
+ "data-slot": "data-table-sort",
3802
+ onClick: tableColumn?.getToggleSortingHandler(),
3803
+ 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",
3804
+ children: [
3805
+ column.label,
3806
+ /* @__PURE__ */ jsxRuntime.jsx(
3807
+ SortIcon,
3808
+ {
3809
+ "aria-hidden": "true",
3810
+ className: cn.cn("size-3.5", !sorted && "text-muted-foreground")
3811
+ }
3812
+ )
3813
+ ]
3814
+ }
3815
+ ) : column.label
3816
+ },
3817
+ column.id
3818
+ );
3819
+ })
3820
+ ]
3821
+ }
3822
+ ) }),
3823
+ /* @__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) => {
3824
+ const isSelected = isSelectable && row.getIsSelected();
3612
3825
  return /* @__PURE__ */ jsxRuntime.jsxs(
3613
3826
  TableRow,
3614
3827
  {
3615
- "data-row-id": rowId,
3828
+ role: "row",
3829
+ "data-row-id": row.id,
3616
3830
  "data-state": isSelected ? "selected" : void 0,
3617
- className: "grid",
3831
+ className: ROW_CLASS,
3618
3832
  style: rowStyle,
3619
3833
  children: [
3620
- isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
3834
+ isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableCell, { role: "cell", className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
3621
3835
  Checkbox,
3622
3836
  {
3623
3837
  "aria-label": "Select row",
3624
3838
  checked: isSelected,
3625
- onCheckedChange: (checked) => setRowSelected(rowId, checked)
3839
+ onCheckedChange: (checked) => row.toggleSelected(checked)
3626
3840
  }
3627
3841
  ) }),
3628
- visibleColumns.map(
3629
- ({
3842
+ visibleColumns.map((column) => {
3843
+ const {
3630
3844
  id,
3631
3845
  label: _label,
3632
3846
  width: _width,
3633
3847
  hidden: _hidden,
3634
- as,
3848
+ as: _as,
3849
+ value: _value,
3850
+ sortable: _sortable,
3851
+ filterable: _filterable,
3635
3852
  align,
3636
3853
  className: cellClassName,
3637
- children: children2,
3854
+ children: _children,
3638
3855
  ...cellProps
3639
- }) => {
3640
- const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
3641
- return /* @__PURE__ */ React3.createElement(
3642
- TableCell,
3643
- {
3644
- ...cellProps,
3645
- key: id,
3646
- className: cn.cn(
3647
- "flex min-w-0 items-center whitespace-normal",
3648
- align && alignClasses[align],
3649
- cellClassName
3650
- )
3651
- },
3652
- as ? React3.createElement(as, {}, value) : value
3653
- );
3654
- }
3655
- )
3856
+ } = column;
3857
+ return /* @__PURE__ */ React4.createElement(
3858
+ TableCell,
3859
+ {
3860
+ ...cellProps,
3861
+ key: id,
3862
+ role: "cell",
3863
+ className: cn.cn(
3864
+ "flex min-w-0 items-center whitespace-normal wrap-anywhere",
3865
+ align && alignClasses[align],
3866
+ cellClassName
3867
+ )
3868
+ },
3869
+ renderCell(column, row.original, row.index)
3870
+ );
3871
+ })
3656
3872
  ]
3657
3873
  },
3658
- rowId
3874
+ row.id
3659
3875
  );
3660
3876
  }) })
3661
3877
  ]
3662
3878
  }
3663
3879
  );
3664
- }
3665
- function DataColumn(_props) {
3666
- return null;
3880
+ if (!pagination) {
3881
+ return tableElement;
3882
+ }
3883
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "data-table-wrapper", className: "flex w-full flex-col", children: [
3884
+ tableElement,
3885
+ pagination
3886
+ ] });
3667
3887
  }
3668
3888
  function Calendar({
3669
3889
  className,
@@ -3818,8 +4038,8 @@ function CalendarDayButton({
3818
4038
  ...props
3819
4039
  }) {
3820
4040
  const defaultClassNames = reactDayPicker.getDefaultClassNames();
3821
- const ref = React3__namespace.useRef(null);
3822
- React3__namespace.useEffect(() => {
4041
+ const ref = React4__namespace.useRef(null);
4042
+ React4__namespace.useEffect(() => {
3823
4043
  if (modifiers.focused) ref.current?.focus();
3824
4044
  }, [modifiers.focused]);
3825
4045
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -3931,8 +4151,8 @@ function DatePicker({
3931
4151
  className
3932
4152
  }) {
3933
4153
  const fieldId = useFieldId(id ?? triggerProps?.id);
3934
- const [uncontrolledOpen, setUncontrolledOpen] = React3.useState(defaultOpen ?? false);
3935
- const [uncontrolledValue, setUncontrolledValue] = React3.useState(defaultValue);
4154
+ const [uncontrolledOpen, setUncontrolledOpen] = React4.useState(defaultOpen ?? false);
4155
+ const [uncontrolledValue, setUncontrolledValue] = React4.useState(defaultValue);
3936
4156
  const date = value ?? uncontrolledValue;
3937
4157
  const open = openProp ?? uncontrolledOpen;
3938
4158
  const isDisabled = disabled ?? triggerProps?.disabled;
@@ -4013,6 +4233,9 @@ function DatePicker({
4013
4233
  picker
4014
4234
  ] });
4015
4235
  }
4236
+ function Row({ reverse, children, ...props }) {
4237
+ return /* @__PURE__ */ jsxRuntime.jsx(Flexbox, { ...props, direction: reverse ? "row-reverse" : "row", children });
4238
+ }
4016
4239
  var sizeMap = {
4017
4240
  sm: "w-1.5 h-1.5",
4018
4241
  md: "w-2 h-2",
@@ -4042,9 +4265,9 @@ function FloatingTooltip({
4042
4265
  open = true,
4043
4266
  ...props
4044
4267
  }) {
4045
- const ref = React3.useRef(null);
4046
- const [position, setPosition] = React3.useState({ x: -1e3, y: -1e3 });
4047
- React3.useEffect(() => {
4268
+ const ref = React4.useRef(null);
4269
+ const [position, setPosition] = React4.useState({ x: -1e3, y: -1e3 });
4270
+ React4.useEffect(() => {
4048
4271
  if (!open || typeof window === "undefined") {
4049
4272
  return;
4050
4273
  }
@@ -4209,8 +4432,8 @@ function Form({
4209
4432
  });
4210
4433
  const { handleSubmit } = formValues;
4211
4434
  const onKeyDown = !onSubmit || preventSubmit ? (e) => e.key === "Enter" && e.preventDefault() : void 0;
4212
- const lastValues = React3.useRef(void 0);
4213
- React3.useEffect(() => {
4435
+ const lastValues = React4.useRef(void 0);
4436
+ React4.useEffect(() => {
4214
4437
  if (values === void 0) {
4215
4438
  return;
4216
4439
  }
@@ -4221,7 +4444,7 @@ function Form({
4221
4444
  lastValues.current = serialized;
4222
4445
  formValues.reset(values);
4223
4446
  }, [formValues, values]);
4224
- React3.useEffect(() => {
4447
+ React4.useEffect(() => {
4225
4448
  if (formValues.formState.isSubmitted) {
4226
4449
  formValues.reset(void 0, { keepDirty: true, keepValues: true });
4227
4450
  }
@@ -4254,7 +4477,7 @@ function FormButtons({ className, ...props }) {
4254
4477
  function FormController({ children, ...props }) {
4255
4478
  return /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props, render: children });
4256
4479
  }
4257
- var PasswordField = React3.forwardRef(
4480
+ var PasswordField = React4.forwardRef(
4258
4481
  function PasswordField2({
4259
4482
  label,
4260
4483
  className,
@@ -4268,7 +4491,7 @@ var PasswordField = React3.forwardRef(
4268
4491
  ...props
4269
4492
  }, ref) {
4270
4493
  const fieldId = useFieldId(id);
4271
- const [uncontrolledRevealed, setUncontrolledRevealed] = React3.useState(defaultRevealed);
4494
+ const [uncontrolledRevealed, setUncontrolledRevealed] = React4.useState(defaultRevealed);
4272
4495
  const revealed = revealedProp ?? uncontrolledRevealed;
4273
4496
  const isLabelled = Boolean(label || props["aria-label"] || props["aria-labelledby"]);
4274
4497
  const toggleRevealed = () => {
@@ -4324,7 +4547,7 @@ var PasswordField = React3.forwardRef(
4324
4547
  ] });
4325
4548
  }
4326
4549
  );
4327
- var SearchField = React3.forwardRef(function SearchField2({
4550
+ var SearchField = React4.forwardRef(function SearchField2({
4328
4551
  label,
4329
4552
  value,
4330
4553
  defaultValue,
@@ -4338,13 +4561,13 @@ var SearchField = React3.forwardRef(function SearchField2({
4338
4561
  ...props
4339
4562
  }, forwardedRef) {
4340
4563
  const fieldId = useFieldId(id);
4341
- const inputRef = React3.useRef(null);
4342
- const [hasValue, setHasValue] = React3.useState(() => Boolean(value ?? defaultValue));
4343
- const onSearchRef = React3.useRef(onSearch);
4564
+ const inputRef = React4.useRef(null);
4565
+ const [hasValue, setHasValue] = React4.useState(() => Boolean(value ?? defaultValue));
4566
+ const onSearchRef = React4.useRef(onSearch);
4344
4567
  onSearchRef.current = onSearch;
4345
- const timerRef = React3.useRef(void 0);
4346
- const lastDispatched = React3.useRef(void 0);
4347
- const dispatchSearch = React3.useCallback((nextValue) => {
4568
+ const timerRef = React4.useRef(void 0);
4569
+ const lastDispatched = React4.useRef(void 0);
4570
+ const dispatchSearch = React4.useCallback((nextValue) => {
4348
4571
  clearTimeout(timerRef.current);
4349
4572
  if (lastDispatched.current === nextValue) {
4350
4573
  return;
@@ -4352,7 +4575,7 @@ var SearchField = React3.forwardRef(function SearchField2({
4352
4575
  lastDispatched.current = nextValue;
4353
4576
  onSearchRef.current?.(nextValue);
4354
4577
  }, []);
4355
- React3.useEffect(() => () => clearTimeout(timerRef.current), []);
4578
+ React4.useEffect(() => () => clearTimeout(timerRef.current), []);
4356
4579
  const handleValue = (nextValue, immediate = false) => {
4357
4580
  setHasValue(nextValue !== "");
4358
4581
  onValueChange?.(nextValue);
@@ -4449,7 +4672,7 @@ function setRef(ref, value) {
4449
4672
  ref.current = value;
4450
4673
  }
4451
4674
  }
4452
- var TextField = React3.forwardRef(function TextField2({
4675
+ var TextField = React4.forwardRef(function TextField2({
4453
4676
  label,
4454
4677
  description,
4455
4678
  error,
@@ -4466,14 +4689,14 @@ var TextField = React3.forwardRef(function TextField2({
4466
4689
  const fieldId = useFieldId(id);
4467
4690
  const descriptionId = `${fieldId}-description`;
4468
4691
  const errorId = `${fieldId}-error`;
4469
- const innerRef = React3.useRef(null);
4470
- const [hasValue, setHasValue] = React3.useState(() => {
4692
+ const innerRef = React4.useRef(null);
4693
+ const [hasValue, setHasValue] = React4.useState(() => {
4471
4694
  const initial = props.value ?? props.defaultValue;
4472
4695
  return initial !== void 0 && initial !== null && initial !== "";
4473
4696
  });
4474
- const [copied, setCopied] = React3.useState(false);
4475
- const copyTimer = React3.useRef(void 0);
4476
- React3.useEffect(() => () => clearTimeout(copyTimer.current), []);
4697
+ const [copied, setCopied] = React4.useState(false);
4698
+ const copyTimer = React4.useRef(void 0);
4699
+ React4.useEffect(() => () => clearTimeout(copyTimer.current), []);
4477
4700
  const handleRef = (element) => {
4478
4701
  innerRef.current = element;
4479
4702
  setRef(forwardedRef, element);
@@ -4688,9 +4911,9 @@ function FormField({
4688
4911
  let control;
4689
4912
  if (typeof children === "function") {
4690
4913
  control = children({ field, fieldState, context, controlProps });
4691
- } else if (React3.isValidElement(children)) {
4914
+ } else if (React4.isValidElement(children)) {
4692
4915
  const ownDescribedBy = children.props["aria-describedby"];
4693
- control = React3.cloneElement(children, {
4916
+ control = React4.cloneElement(children, {
4694
4917
  ...bindField(getBinding(children.type), field),
4695
4918
  ...controlProps,
4696
4919
  "aria-describedby": [ownDescribedBy, controlProps["aria-describedby"]].filter(Boolean).join(" ") || void 0
@@ -4732,7 +4955,7 @@ function FormFieldArray({
4732
4955
  children,
4733
4956
  ...props
4734
4957
  }) {
4735
- const labelId = React3.useId();
4958
+ const labelId = React4.useId();
4736
4959
  const context = reactHookForm.useFormContext();
4737
4960
  const { formState, control, register } = context;
4738
4961
  const fieldArray = reactHookForm.useFieldArray({
@@ -4765,8 +4988,22 @@ function FormResetButton({
4765
4988
  };
4766
4989
  return /* @__PURE__ */ jsxRuntime.jsx(Button, { ...props, type: "reset", variant, onClick: handleClick });
4767
4990
  }
4768
- function Spinner({ className, ...props }) {
4769
- return /* @__PURE__ */ jsxRuntime.jsx(lucide_react_star.Loader2Icon, { "data-slot": "spinner", role: "status", "aria-label": "Loading", className: cn.cn("size-4 animate-spin", className), ...props });
4991
+ function Spinner({ quiet, className, ...props }) {
4992
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4993
+ "svg",
4994
+ {
4995
+ viewBox: "25 25 50 50",
4996
+ "data-slot": "spinner",
4997
+ role: "status",
4998
+ "aria-label": "Loading",
4999
+ ...props,
5000
+ className: cn.cn("zen-spinner size-4", className),
5001
+ children: [
5002
+ !quiet && /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "zen-spinner-track", cx: "50", cy: "50", r: "20" }),
5003
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "zen-spinner-fill", cx: "50", cy: "50", r: "20" })
5004
+ ]
5005
+ }
5006
+ );
4770
5007
  }
4771
5008
  function FormSubmitButton({
4772
5009
  disabled,
@@ -4816,10 +5053,142 @@ function Heading({
4816
5053
  }
4817
5054
  );
4818
5055
  }
5056
+ var languages = {
5057
+ bash: () => import('shiki/langs/shellscript.mjs'),
5058
+ css: () => import('shiki/langs/css.mjs'),
5059
+ diff: () => import('shiki/langs/diff.mjs'),
5060
+ html: () => import('shiki/langs/html.mjs'),
5061
+ javascript: () => import('shiki/langs/javascript.mjs'),
5062
+ json: () => import('shiki/langs/json.mjs'),
5063
+ jsx: () => import('shiki/langs/jsx.mjs'),
5064
+ markdown: () => import('shiki/langs/markdown.mjs'),
5065
+ python: () => import('shiki/langs/python.mjs'),
5066
+ sql: () => import('shiki/langs/sql.mjs'),
5067
+ tsx: () => import('shiki/langs/tsx.mjs'),
5068
+ typescript: () => import('shiki/langs/typescript.mjs'),
5069
+ yaml: () => import('shiki/langs/yaml.mjs')
5070
+ };
5071
+ var aliases = {
5072
+ js: "javascript",
5073
+ md: "markdown",
5074
+ py: "python",
5075
+ sh: "bash",
5076
+ shell: "bash",
5077
+ shellscript: "bash",
5078
+ ts: "typescript",
5079
+ yml: "yaml",
5080
+ zsh: "bash"
5081
+ };
5082
+ var highlighter;
5083
+ function getHighlighter() {
5084
+ highlighter ??= core.createHighlighterCore({
5085
+ themes: [
5086
+ import('shiki/themes/github-light.mjs'),
5087
+ import('shiki/themes/github-dark.mjs')
5088
+ ],
5089
+ langs: [],
5090
+ engine: javascript.createJavaScriptRegexEngine({ forgiving: true })
5091
+ });
5092
+ return highlighter;
5093
+ }
5094
+ function getLanguage(language) {
5095
+ const name = language.toLowerCase();
5096
+ if (name === "ansi") {
5097
+ return name;
5098
+ }
5099
+ if (name in languages) {
5100
+ return name;
5101
+ }
5102
+ return aliases[name] ?? null;
5103
+ }
5104
+ async function loadHighlighter(language) {
5105
+ const lang = getLanguage(language);
5106
+ if (!lang) {
5107
+ return null;
5108
+ }
5109
+ const shiki = await getHighlighter();
5110
+ if (lang !== "ansi" && !shiki.getLoadedLanguages().includes(lang)) {
5111
+ await shiki.loadLanguage(languages[lang]);
5112
+ }
5113
+ return {
5114
+ // Returns one React node per line, and the grammar state after the last
5115
+ // line. Pass that state back to continue where the code left off.
5116
+ highlight(code, state) {
5117
+ const tokenize = (text) => shiki.codeToTokens(text, {
5118
+ lang,
5119
+ themes: { light: "github-light", dark: "github-dark" },
5120
+ defaultColor: false,
5121
+ grammarState: state
5122
+ }).tokens;
5123
+ const tokens = lang === "ansi" ? code.split("\n").flatMap((line) => tokenize(line)) : tokenize(code);
5124
+ return {
5125
+ lines: tokens.map(
5126
+ (line) => line.map((token, index) => /* @__PURE__ */ jsxRuntime.jsx(
5127
+ "span",
5128
+ {
5129
+ style: token.htmlStyle,
5130
+ className: "text-(--shiki-light) dark:text-(--shiki-dark)",
5131
+ children: token.content
5132
+ },
5133
+ index
5134
+ ))
5135
+ ),
5136
+ state: shiki.getLastGrammarState(tokens)
5137
+ };
5138
+ }
5139
+ };
5140
+ }
5141
+
5142
+ // src/components/hooks/use-highlighted-code.ts
5143
+ function useHighlightedCode(value, language) {
5144
+ const code = value.endsWith("\n") ? value.slice(0, -1) : value;
5145
+ const [loaded, setLoaded] = React4__namespace.useState(null);
5146
+ const highlighter2 = loaded?.language === language ? loaded.highlighter : null;
5147
+ React4__namespace.useEffect(() => {
5148
+ let cancelled = false;
5149
+ loadHighlighter(language).then((next2) => {
5150
+ if (!cancelled) {
5151
+ setLoaded({ language, highlighter: next2 });
5152
+ }
5153
+ }).catch(() => {
5154
+ });
5155
+ return () => {
5156
+ cancelled = true;
5157
+ };
5158
+ }, [language]);
5159
+ const [done, setDone] = React4__namespace.useState({ highlighter: null, text: "", lines: [] });
5160
+ let next = done;
5161
+ if (next.highlighter !== highlighter2 || !code.startsWith(next.text)) {
5162
+ next = { highlighter: highlighter2, text: "", lines: [] };
5163
+ }
5164
+ const end = code.lastIndexOf("\n") + 1;
5165
+ if (highlighter2 && end > next.text.length) {
5166
+ const result = highlighter2.highlight(
5167
+ code.slice(next.text.length, end - 1),
5168
+ next.state
5169
+ );
5170
+ next = {
5171
+ highlighter: highlighter2,
5172
+ text: code.slice(0, end),
5173
+ lines: [...next.lines, ...result.lines],
5174
+ state: result.state
5175
+ };
5176
+ }
5177
+ if (next !== done) {
5178
+ setDone(next);
5179
+ }
5180
+ const tail = code.slice(end);
5181
+ return React4__namespace.useMemo(() => {
5182
+ if (!highlighter2) {
5183
+ return code.split("\n");
5184
+ }
5185
+ return [...next.lines, highlighter2.highlight(tail, next.state).lines[0]];
5186
+ }, [code, highlighter2, next, tail]);
5187
+ }
4819
5188
  var MOBILE_BREAKPOINT = 768;
4820
5189
  function useIsMobile() {
4821
- const [isMobile, setIsMobile] = React3__namespace.useState(void 0);
4822
- React3__namespace.useEffect(() => {
5190
+ const [isMobile, setIsMobile] = React4__namespace.useState(void 0);
5191
+ React4__namespace.useEffect(() => {
4823
5192
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
4824
5193
  const onChange = () => {
4825
5194
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -4839,8 +5208,8 @@ var breakpoints = {
4839
5208
  };
4840
5209
  var DEBOUNCE_DELAY_MS = 150;
4841
5210
  function useBreakpoint() {
4842
- const [breakpoint, setBreakpoint] = React3.useState(null);
4843
- const calculateBreakpoint = React3.useCallback(() => {
5211
+ const [breakpoint, setBreakpoint] = React4.useState(null);
5212
+ const calculateBreakpoint = React4.useCallback(() => {
4844
5213
  if (typeof window === "undefined") {
4845
5214
  return;
4846
5215
  }
@@ -4853,7 +5222,7 @@ function useBreakpoint() {
4853
5222
  }
4854
5223
  setBreakpoint(currentBreakpoint);
4855
5224
  }, []);
4856
- React3.useEffect(() => {
5225
+ React4.useEffect(() => {
4857
5226
  calculateBreakpoint();
4858
5227
  const debouncedResize = debounce(calculateBreakpoint, DEBOUNCE_DELAY_MS);
4859
5228
  window.addEventListener("resize", debouncedResize);
@@ -4864,8 +5233,8 @@ function useBreakpoint() {
4864
5233
  return breakpoint;
4865
5234
  }
4866
5235
  function useDebounce(value, delay) {
4867
- const [debouncedValue, setValue] = React3.useState(value);
4868
- React3.useEffect(() => {
5236
+ const [debouncedValue, setValue] = React4.useState(value);
5237
+ React4.useEffect(() => {
4869
5238
  const timer = setTimeout(() => {
4870
5239
  setValue(value);
4871
5240
  }, delay);
@@ -4958,11 +5327,11 @@ function useInitTheme(preferred, colorScheme, preferredPalette) {
4958
5327
  const initTheme = useTheme((s) => s.initTheme);
4959
5328
  const initPalette = useTheme((s) => s.initPalette);
4960
5329
  const syncTheme = useTheme((s) => s.syncTheme);
4961
- React3.useLayoutEffect(() => {
5330
+ React4.useLayoutEffect(() => {
4962
5331
  initTheme(preferred, colorScheme);
4963
5332
  initPalette(preferredPalette);
4964
5333
  }, [preferred, colorScheme, preferredPalette, initTheme, initPalette]);
4965
- React3.useEffect(() => {
5334
+ React4.useEffect(() => {
4966
5335
  if (typeof window === "undefined") return;
4967
5336
  const observer = new MutationObserver((mutations) => {
4968
5337
  for (const mutation of mutations) {
@@ -5055,7 +5424,7 @@ var positionClasses = {
5055
5424
  };
5056
5425
  function Toaster({ duration = 0, position = "bottom-right" }) {
5057
5426
  const { toasts } = useToast();
5058
- const [hovered, setHovered] = React3.useState(false);
5427
+ const [hovered, setHovered] = React4.useState(false);
5059
5428
  const transitions = web.useTransition(toasts, {
5060
5429
  from: {
5061
5430
  opacity: 0,
@@ -5068,7 +5437,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
5068
5437
  },
5069
5438
  config: { duration: 100 }
5070
5439
  });
5071
- React3.useEffect(() => {
5440
+ React4.useEffect(() => {
5072
5441
  if (!duration || hovered || !toasts.length) {
5073
5442
  return;
5074
5443
  }
@@ -5100,7 +5469,7 @@ function Toaster({ duration = 0, position = "bottom-right" }) {
5100
5469
  }
5101
5470
  );
5102
5471
  }
5103
- var ToastContext = React3.createContext({});
5472
+ var ToastContext = React4.createContext({});
5104
5473
  function ToastProvider({ children, ...props }) {
5105
5474
  return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: props, children: [
5106
5475
  children,
@@ -5131,7 +5500,7 @@ function displayToast(message, { duration = TOAST_DURATION, ...options } = {}) {
5131
5500
  }
5132
5501
  function useToast() {
5133
5502
  const { toasts } = store();
5134
- const config = React3.useContext(ToastContext);
5503
+ const config = React4.useContext(ToastContext);
5135
5504
  const toast = (message, options) => {
5136
5505
  displayToast(message, { ...options, ...config });
5137
5506
  };
@@ -5187,7 +5556,7 @@ function Icon({
5187
5556
  if (fillColorStr) {
5188
5557
  svgProps.fill = getCssColorValue(fillColorStr);
5189
5558
  }
5190
- const clonedChild = React3.isValidElement(children) ? React3.cloneElement(children, svgProps) : children;
5559
+ const clonedChild = React4.isValidElement(children) ? React4.cloneElement(children, svgProps) : children;
5191
5560
  return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className: wrapperClasses, style: wrapperStyle, children: clonedChild });
5192
5561
  }
5193
5562
  var objectFitMap = {
@@ -5218,7 +5587,7 @@ function Image({
5218
5587
  );
5219
5588
  return /* @__PURE__ */ jsxRuntime.jsx("img", { ...props, className: classes, src, alt });
5220
5589
  }
5221
- var ListContext = React3.createContext({
5590
+ var ListContext = React4.createContext({
5222
5591
  selectionMode: "none",
5223
5592
  showCheckmark: true,
5224
5593
  selected: /* @__PURE__ */ new Set(),
@@ -5238,8 +5607,8 @@ function List({
5238
5607
  ...props
5239
5608
  }) {
5240
5609
  const listId = useFieldId(id);
5241
- const labelId = React3.useId();
5242
- const [uncontrolled, setUncontrolled] = React3.useState(() => defaultValue ?? []);
5610
+ const labelId = React4.useId();
5611
+ const [uncontrolled, setUncontrolled] = React4.useState(() => defaultValue ?? []);
5243
5612
  const selectedValues = value ?? uncontrolled;
5244
5613
  const selected = new Set(selectedValues);
5245
5614
  const toggle = (itemValue) => {
@@ -5317,7 +5686,7 @@ function ListItem({
5317
5686
  onKeyDown,
5318
5687
  ...props
5319
5688
  }) {
5320
- const { selectionMode, showCheckmark, selected, toggle } = React3.useContext(ListContext);
5689
+ const { selectionMode, showCheckmark, selected, toggle } = React4.useContext(ListContext);
5321
5690
  const itemValue = value ?? (typeof children === "string" ? children : "");
5322
5691
  const isSelected = selected.has(itemValue);
5323
5692
  const hasIndicator = showCheckmark && selectionMode !== "none";
@@ -5376,7 +5745,7 @@ function ListSeparator({ className, ...props }) {
5376
5745
  );
5377
5746
  }
5378
5747
  function ListSection({ title, className, children, ...props }) {
5379
- const titleId = React3.useId();
5748
+ const titleId = React4.useId();
5380
5749
  return /* @__PURE__ */ jsxRuntime.jsxs(
5381
5750
  "div",
5382
5751
  {
@@ -5492,8 +5861,8 @@ function Meter({ label, showValue, className, ...props }) {
5492
5861
  }
5493
5862
  );
5494
5863
  }
5495
- var NavbarContext = React3.createContext({ showArrow: true });
5496
- var NavbarContentContext = React3.createContext(false);
5864
+ var NavbarContext = React4.createContext({ showArrow: true });
5865
+ var NavbarContentContext = React4.createContext(false);
5497
5866
  var triggerClassName = cn.cn(
5498
5867
  "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
5868
  "hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50",
@@ -5573,7 +5942,7 @@ function NavbarItem({
5573
5942
  color: _color,
5574
5943
  ...props
5575
5944
  }) {
5576
- const { showArrow } = React3.useContext(NavbarContext);
5945
+ const { showArrow } = React4.useContext(NavbarContext);
5577
5946
  if (label) {
5578
5947
  return /* @__PURE__ */ jsxRuntime.jsxs(navigationMenu.NavigationMenu.Item, { "data-slot": "navbar-item", ...props, children: [
5579
5948
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -5601,7 +5970,7 @@ function NavbarItem({
5601
5970
  );
5602
5971
  }
5603
5972
  function NavbarLink({ className, ...props }) {
5604
- const inContent = React3.useContext(NavbarContentContext);
5973
+ const inContent = React4.useContext(NavbarContentContext);
5605
5974
  return /* @__PURE__ */ jsxRuntime.jsx(
5606
5975
  navigationMenu.NavigationMenu.Link,
5607
5976
  {
@@ -5618,7 +5987,7 @@ var stepperClassName = cn.cn(
5618
5987
  buttonVariants({ variant: "ghost", size: "icon-xs" }),
5619
5988
  "rounded-[calc(var(--radius)-5px)] text-muted-foreground"
5620
5989
  );
5621
- var NumberField = React3.forwardRef(function NumberField2({
5990
+ var NumberField = React4.forwardRef(function NumberField2({
5622
5991
  label,
5623
5992
  placeholder,
5624
5993
  decrementLabel = "Decrease",
@@ -5636,7 +6005,7 @@ var NumberField = React3.forwardRef(function NumberField2({
5636
6005
  id: fieldId,
5637
6006
  "data-slot": "number-field",
5638
6007
  className: cn.cn(
5639
- "group/field flex w-full flex-col gap-3 data-disabled:[&_[data-slot=field-label]]:opacity-50",
6008
+ "group/field flex w-full flex-col gap-2 data-disabled:[&_[data-slot=field-label]]:opacity-50",
5640
6009
  className
5641
6010
  ),
5642
6011
  children: [
@@ -5703,7 +6072,7 @@ function PageHeaderTitle({
5703
6072
  return /* @__PURE__ */ jsxRuntime.jsxs(Column, { gap: "1", ...props, children: [
5704
6073
  breadcrumb,
5705
6074
  /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xl", weight: "semibold", children: title }),
5706
- description && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "muted-foreground", children: description }),
6075
+ description && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "muted", children: description }),
5707
6076
  children
5708
6077
  ] });
5709
6078
  }
@@ -5857,12 +6226,12 @@ function Badge({
5857
6226
  }
5858
6227
  });
5859
6228
  }
5860
- var TagContext = React3.createContext({
6229
+ var TagContext = React4.createContext({
5861
6230
  removable: false,
5862
6231
  remove: () => void 0
5863
6232
  });
5864
6233
  function TagGroup({ label, children, className, onRemove, ...props }) {
5865
- const labelId = React3.useId();
6234
+ const labelId = React4.useId();
5866
6235
  return /* @__PURE__ */ jsxRuntime.jsx(
5867
6236
  TagContext.Provider,
5868
6237
  {
@@ -5870,7 +6239,7 @@ function TagGroup({ label, children, className, onRemove, ...props }) {
5870
6239
  removable: !!onRemove,
5871
6240
  remove: (value) => onRemove?.(value)
5872
6241
  },
5873
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, "data-slot": "tag-group", className: cn.cn("flex flex-col gap-3", className), children: [
6242
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, "data-slot": "tag-group", className: cn.cn("flex flex-col gap-2", className), children: [
5874
6243
  label && /* @__PURE__ */ jsxRuntime.jsx(FieldTitle, { id: labelId, children: label }),
5875
6244
  /* @__PURE__ */ jsxRuntime.jsx(
5876
6245
  "ul",
@@ -5894,7 +6263,7 @@ function Tag({
5894
6263
  onKeyDown,
5895
6264
  ...props
5896
6265
  }) {
5897
- const { removable, remove } = React3.useContext(TagContext);
6266
+ const { removable, remove } = React4.useContext(TagContext);
5898
6267
  const tagValue = value ?? (typeof children === "string" ? children : "");
5899
6268
  const isRemovable = removable && !disabled;
5900
6269
  const handleKeyDown = (event) => {
@@ -5956,10 +6325,10 @@ function ThemeButton({
5956
6325
  ...props
5957
6326
  }) {
5958
6327
  const globalTheme = useTheme();
5959
- const [localTheme, setLocalTheme] = React3.useState(null);
5960
- const initializedRef = React3.useRef(false);
6328
+ const [localTheme, setLocalTheme] = React4.useState(null);
6329
+ const initializedRef = React4.useRef(false);
5961
6330
  const isLocal = !!target;
5962
- React3.useEffect(() => {
6331
+ React4.useEffect(() => {
5963
6332
  if (isLocal && target && !initializedRef.current) {
5964
6333
  const element = getElement(target);
5965
6334
  if (element) {
@@ -6026,14 +6395,14 @@ function getSystemTheme() {
6026
6395
  }
6027
6396
  function ThemeSwitcher({ className }) {
6028
6397
  const { setTheme } = useTheme();
6029
- const [mode, setMode] = React3.useState("system");
6030
- React3.useEffect(() => {
6398
+ const [mode, setMode] = React4.useState("system");
6399
+ React4.useEffect(() => {
6031
6400
  const stored = localStorage.getItem(STORAGE_KEY);
6032
6401
  if (stored && ["light", "dark", "system"].includes(stored)) {
6033
6402
  setMode(stored);
6034
6403
  }
6035
6404
  }, []);
6036
- React3.useEffect(() => {
6405
+ React4.useEffect(() => {
6037
6406
  if (mode === "system") {
6038
6407
  setTheme(getSystemTheme());
6039
6408
  } else {
@@ -6041,7 +6410,7 @@ function ThemeSwitcher({ className }) {
6041
6410
  }
6042
6411
  localStorage.setItem(STORAGE_KEY, mode);
6043
6412
  }, [mode, setTheme]);
6044
- React3.useEffect(() => {
6413
+ React4.useEffect(() => {
6045
6414
  if (mode !== "system") return;
6046
6415
  const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
6047
6416
  const handleChange = () => {
@@ -6595,9 +6964,9 @@ function CardFooter({ className, ...props }) {
6595
6964
  }
6596
6965
  );
6597
6966
  }
6598
- var CarouselContext = React3__namespace.createContext(null);
6967
+ var CarouselContext = React4__namespace.createContext(null);
6599
6968
  function useCarousel() {
6600
- const context = React3__namespace.useContext(CarouselContext);
6969
+ const context = React4__namespace.useContext(CarouselContext);
6601
6970
  if (!context) {
6602
6971
  throw new Error("useCarousel must be used within a <Carousel />");
6603
6972
  }
@@ -6619,20 +6988,20 @@ function Carousel({
6619
6988
  },
6620
6989
  plugins
6621
6990
  );
6622
- const [canScrollPrev, setCanScrollPrev] = React3__namespace.useState(false);
6623
- const [canScrollNext, setCanScrollNext] = React3__namespace.useState(false);
6624
- const onSelect = React3__namespace.useCallback((api2) => {
6991
+ const [canScrollPrev, setCanScrollPrev] = React4__namespace.useState(false);
6992
+ const [canScrollNext, setCanScrollNext] = React4__namespace.useState(false);
6993
+ const onSelect = React4__namespace.useCallback((api2) => {
6625
6994
  if (!api2) return;
6626
6995
  setCanScrollPrev(api2.canScrollPrev());
6627
6996
  setCanScrollNext(api2.canScrollNext());
6628
6997
  }, []);
6629
- const scrollPrev = React3__namespace.useCallback(() => {
6998
+ const scrollPrev = React4__namespace.useCallback(() => {
6630
6999
  api?.scrollPrev();
6631
7000
  }, [api]);
6632
- const scrollNext = React3__namespace.useCallback(() => {
7001
+ const scrollNext = React4__namespace.useCallback(() => {
6633
7002
  api?.scrollNext();
6634
7003
  }, [api]);
6635
- const handleKeyDown = React3__namespace.useCallback(
7004
+ const handleKeyDown = React4__namespace.useCallback(
6636
7005
  (event) => {
6637
7006
  if (event.key === "ArrowLeft") {
6638
7007
  event.preventDefault();
@@ -6644,11 +7013,11 @@ function Carousel({
6644
7013
  },
6645
7014
  [scrollPrev, scrollNext]
6646
7015
  );
6647
- React3__namespace.useEffect(() => {
7016
+ React4__namespace.useEffect(() => {
6648
7017
  if (!api || !setApi) return;
6649
7018
  setApi(api);
6650
7019
  }, [api, setApi]);
6651
- React3__namespace.useEffect(() => {
7020
+ React4__namespace.useEffect(() => {
6652
7021
  if (!api) return;
6653
7022
  onSelect(api);
6654
7023
  api.on("reInit", onSelect);
@@ -6780,6 +7149,204 @@ function CarouselNext({
6780
7149
  }
6781
7150
  );
6782
7151
  }
7152
+ var codeBlockVariants = classVarianceAuthority.cva(
7153
+ "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",
7154
+ {
7155
+ variants: {
7156
+ variant: {
7157
+ default: "border border-input text-foreground has-[>[data-slot=code-block-content]:focus-visible]:border-ring dark:bg-input/30",
7158
+ destructive: "border border-destructive/30 text-destructive dark:border-destructive/40"
7159
+ }
7160
+ },
7161
+ defaultVariants: {
7162
+ variant: "default"
7163
+ }
7164
+ }
7165
+ );
7166
+ function CodeBlock({
7167
+ className,
7168
+ variant = "default",
7169
+ size = "default",
7170
+ ...props
7171
+ }) {
7172
+ return /* @__PURE__ */ jsxRuntime.jsx(
7173
+ "div",
7174
+ {
7175
+ "data-slot": "code-block",
7176
+ "data-variant": variant,
7177
+ "data-size": size,
7178
+ className: cn.cn(codeBlockVariants({ variant }), className),
7179
+ ...props
7180
+ }
7181
+ );
7182
+ }
7183
+ function CodeBlockHeader({ className, ...props }) {
7184
+ return /* @__PURE__ */ jsxRuntime.jsx(
7185
+ "div",
7186
+ {
7187
+ "data-slot": "code-block-header",
7188
+ className: cn.cn(
7189
+ "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",
7190
+ className
7191
+ ),
7192
+ ...props
7193
+ }
7194
+ );
7195
+ }
7196
+ function CodeBlockTitle({ className, ...props }) {
7197
+ return /* @__PURE__ */ jsxRuntime.jsx(
7198
+ "div",
7199
+ {
7200
+ "data-slot": "code-block-title",
7201
+ className: cn.cn(
7202
+ "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",
7203
+ className
7204
+ ),
7205
+ ...props
7206
+ }
7207
+ );
7208
+ }
7209
+ function CodeBlockActions({
7210
+ className,
7211
+ ...props
7212
+ }) {
7213
+ return /* @__PURE__ */ jsxRuntime.jsx(
7214
+ "div",
7215
+ {
7216
+ "data-slot": "code-block-actions",
7217
+ className: cn.cn(
7218
+ "-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",
7219
+ className
7220
+ ),
7221
+ ...props
7222
+ }
7223
+ );
7224
+ }
7225
+ function CodeBlockCopyButton({
7226
+ value,
7227
+ variant = "ghost",
7228
+ size = "icon-xs",
7229
+ className,
7230
+ onClick,
7231
+ ...props
7232
+ }) {
7233
+ const [copied, setCopied] = React4__namespace.useState(false);
7234
+ React4__namespace.useEffect(() => {
7235
+ if (!copied) {
7236
+ return;
7237
+ }
7238
+ const timeout = setTimeout(() => setCopied(false), 2e3);
7239
+ return () => clearTimeout(timeout);
7240
+ }, [copied]);
7241
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7242
+ /* @__PURE__ */ jsxRuntime.jsx(
7243
+ Button,
7244
+ {
7245
+ "data-slot": "code-block-copy-button",
7246
+ "data-copied": copied || void 0,
7247
+ variant,
7248
+ size,
7249
+ "aria-label": copied ? "Copied" : "Copy",
7250
+ className: cn.cn(className),
7251
+ onClick: (event) => {
7252
+ onClick?.(event);
7253
+ navigator.clipboard.writeText(value).then(() => setCopied(true)).catch(() => {
7254
+ });
7255
+ },
7256
+ ...props,
7257
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(
7258
+ lucide_react_star.CheckIcon,
7259
+ {}
7260
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
7261
+ lucide_react_star.CopyIcon,
7262
+ {}
7263
+ )
7264
+ }
7265
+ ),
7266
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-live": "polite", className: "sr-only", children: copied ? "Copied" : "" })
7267
+ ] });
7268
+ }
7269
+ function CodeBlockContent({
7270
+ className,
7271
+ children,
7272
+ style,
7273
+ wrap = false,
7274
+ lineNumbers = false,
7275
+ startLine = 1,
7276
+ ...props
7277
+ }) {
7278
+ return /* @__PURE__ */ jsxRuntime.jsx(
7279
+ "pre",
7280
+ {
7281
+ "data-slot": "code-block-content",
7282
+ "data-wrap": wrap || void 0,
7283
+ "data-numbered": lineNumbers || void 0,
7284
+ dir: "ltr",
7285
+ tabIndex: 0,
7286
+ style: { counterReset: `line ${startLine - 1}`, ...style },
7287
+ className: cn.cn(
7288
+ "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",
7289
+ className
7290
+ ),
7291
+ ...props,
7292
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7293
+ "code",
7294
+ {
7295
+ "data-slot": "code-block-code",
7296
+ className: "grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",
7297
+ children: lineNumbers && typeof children === "string" ? children.replace(/\n$/, "").split("\n").map((line, index) => /* @__PURE__ */ jsxRuntime.jsx(CodeBlockLine, { children: line }, index)) : children
7298
+ }
7299
+ )
7300
+ }
7301
+ );
7302
+ }
7303
+ var codeBlockLineVariants = classVarianceAuthority.cva(
7304
+ "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)_/_'']",
7305
+ {
7306
+ variants: {
7307
+ variant: {
7308
+ default: "",
7309
+ added: "bg-muted after:content-['+']",
7310
+ removed: "bg-destructive/10 after:text-destructive after:content-['\u2212']",
7311
+ highlighted: "bg-muted"
7312
+ }
7313
+ },
7314
+ defaultVariants: {
7315
+ variant: "default"
7316
+ }
7317
+ }
7318
+ );
7319
+ function CodeBlockLine({
7320
+ className,
7321
+ variant = "default",
7322
+ children,
7323
+ ...props
7324
+ }) {
7325
+ const empty = children === void 0 || children === null || children === "" || Array.isArray(children) && children.length === 0;
7326
+ return /* @__PURE__ */ jsxRuntime.jsx(
7327
+ "span",
7328
+ {
7329
+ "data-slot": "code-block-line",
7330
+ "data-variant": variant,
7331
+ className: cn.cn(codeBlockLineVariants({ variant }), className),
7332
+ ...props,
7333
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-slot": "code-block-line-content", className: "min-w-0", children: empty ? "\n" : children })
7334
+ }
7335
+ );
7336
+ }
7337
+ function CodeBlockFooter({ className, ...props }) {
7338
+ return /* @__PURE__ */ jsxRuntime.jsx(
7339
+ "div",
7340
+ {
7341
+ "data-slot": "code-block-footer",
7342
+ className: cn.cn(
7343
+ "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",
7344
+ className
7345
+ ),
7346
+ ...props
7347
+ }
7348
+ );
7349
+ }
6783
7350
  function Collapsible({ ...props }) {
6784
7351
  return /* @__PURE__ */ jsxRuntime.jsx(collapsible.Collapsible.Root, { "data-slot": "collapsible", ...props });
6785
7352
  }
@@ -7038,7 +7605,7 @@ function ComboboxChipsInput({
7038
7605
  );
7039
7606
  }
7040
7607
  function useComboboxAnchor() {
7041
- return React3__namespace.useRef(null);
7608
+ return React4__namespace.useRef(null);
7042
7609
  }
7043
7610
  function Dialog({ ...props }) {
7044
7611
  return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { "data-slot": "dialog", ...props });
@@ -7061,7 +7628,7 @@ function DialogOverlay({
7061
7628
  {
7062
7629
  "data-slot": "dialog-overlay",
7063
7630
  className: cn.cn(
7064
- "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
7631
+ "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
7632
  className
7066
7633
  ),
7067
7634
  ...props
@@ -7071,7 +7638,7 @@ function DialogOverlay({
7071
7638
  function DialogContent({
7072
7639
  className,
7073
7640
  children,
7074
- showCloseButton = true,
7641
+ showCloseButton = false,
7075
7642
  ...props
7076
7643
  }) {
7077
7644
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
@@ -7547,9 +8114,9 @@ function ContextMenuShortcut({
7547
8114
  }
7548
8115
  );
7549
8116
  }
7550
- var DrawerContext = React3__namespace.createContext(null);
8117
+ var DrawerContext = React4__namespace.createContext(null);
7551
8118
  function useDrawer() {
7552
- const context = React3__namespace.useContext(DrawerContext);
8119
+ const context = React4__namespace.useContext(DrawerContext);
7553
8120
  if (!context) {
7554
8121
  throw new Error("useDrawer must be used within a Drawer.");
7555
8122
  }
@@ -7563,7 +8130,7 @@ function Drawer({
7563
8130
  ...props
7564
8131
  }) {
7565
8132
  const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
7566
- const contextValue = React3__namespace.useMemo(
8133
+ const contextValue = React4__namespace.useMemo(
7567
8134
  () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
7568
8135
  [hasSnapPoints, modal, showSwipeHandle, swipeDirection]
7569
8136
  );
@@ -8128,7 +8695,7 @@ function InputOTPSlot({
8128
8695
  className,
8129
8696
  ...props
8130
8697
  }) {
8131
- const inputOTPContext = React3__namespace.useContext(inputOtp.OTPInputContext);
8698
+ const inputOTPContext = React4__namespace.useContext(inputOtp.OTPInputContext);
8132
8699
  const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
8133
8700
  return /* @__PURE__ */ jsxRuntime.jsxs(
8134
8701
  "div",
@@ -9075,9 +9642,9 @@ var SIDEBAR_WIDTH = "16rem";
9075
9642
  var SIDEBAR_WIDTH_MOBILE = "18rem";
9076
9643
  var SIDEBAR_WIDTH_ICON = "3rem";
9077
9644
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
9078
- var SidebarContext = React3__namespace.createContext(null);
9645
+ var SidebarContext = React4__namespace.createContext(null);
9079
9646
  function useSidebar() {
9080
- const context = React3__namespace.useContext(SidebarContext);
9647
+ const context = React4__namespace.useContext(SidebarContext);
9081
9648
  if (!context) {
9082
9649
  throw new Error("useSidebar must be used within a SidebarProvider.");
9083
9650
  }
@@ -9093,10 +9660,10 @@ function SidebarProvider({
9093
9660
  ...props
9094
9661
  }) {
9095
9662
  const isMobile = useIsMobile();
9096
- const [openMobile, setOpenMobile] = React3__namespace.useState(false);
9097
- const [_open, _setOpen] = React3__namespace.useState(defaultOpen);
9663
+ const [openMobile, setOpenMobile] = React4__namespace.useState(false);
9664
+ const [_open, _setOpen] = React4__namespace.useState(defaultOpen);
9098
9665
  const open = openProp ?? _open;
9099
- const setOpen = React3__namespace.useCallback(
9666
+ const setOpen = React4__namespace.useCallback(
9100
9667
  (value) => {
9101
9668
  const openState = typeof value === "function" ? value(open) : value;
9102
9669
  if (setOpenProp) {
@@ -9108,10 +9675,10 @@ function SidebarProvider({
9108
9675
  },
9109
9676
  [setOpenProp, open]
9110
9677
  );
9111
- const toggleSidebar = React3__namespace.useCallback(() => {
9678
+ const toggleSidebar = React4__namespace.useCallback(() => {
9112
9679
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
9113
9680
  }, [isMobile, setOpen, setOpenMobile]);
9114
- React3__namespace.useEffect(() => {
9681
+ React4__namespace.useEffect(() => {
9115
9682
  const handleKeyDown = (event) => {
9116
9683
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
9117
9684
  event.preventDefault();
@@ -9122,7 +9689,7 @@ function SidebarProvider({
9122
9689
  return () => window.removeEventListener("keydown", handleKeyDown);
9123
9690
  }, [toggleSidebar]);
9124
9691
  const state = open ? "expanded" : "collapsed";
9125
- const contextValue = React3__namespace.useMemo(
9692
+ const contextValue = React4__namespace.useMemo(
9126
9693
  () => ({
9127
9694
  state,
9128
9695
  open,
@@ -9582,7 +10149,7 @@ function SidebarMenuSkeleton({
9582
10149
  showIcon = false,
9583
10150
  ...props
9584
10151
  }) {
9585
- const [width] = React3__namespace.useState(() => {
10152
+ const [width] = React4__namespace.useState(() => {
9586
10153
  return `${Math.floor(Math.random() * 40) + 50}%`;
9587
10154
  });
9588
10155
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -9789,7 +10356,7 @@ function TabsContent({ className, ...props }) {
9789
10356
  }
9790
10357
  );
9791
10358
  }
9792
- var ToggleGroupContext = React3__namespace.createContext({
10359
+ var ToggleGroupContext = React4__namespace.createContext({
9793
10360
  size: "default",
9794
10361
  variant: "default",
9795
10362
  spacing: 2,
@@ -9835,7 +10402,7 @@ function ToggleGroupItem({
9835
10402
  size = "default",
9836
10403
  ...props
9837
10404
  }) {
9838
- const context = React3__namespace.useContext(ToggleGroupContext);
10405
+ const context = React4__namespace.useContext(ToggleGroupContext);
9839
10406
  return /* @__PURE__ */ jsxRuntime.jsx(
9840
10407
  toggle.Toggle,
9841
10408
  {
@@ -9942,6 +10509,14 @@ exports.CarouselPrevious = CarouselPrevious;
9942
10509
  exports.Checkbox = Checkbox;
9943
10510
  exports.CheckboxGroup = CheckboxGroup;
9944
10511
  exports.Code = Code;
10512
+ exports.CodeBlock = CodeBlock;
10513
+ exports.CodeBlockActions = CodeBlockActions;
10514
+ exports.CodeBlockContent = CodeBlockContent;
10515
+ exports.CodeBlockCopyButton = CodeBlockCopyButton;
10516
+ exports.CodeBlockFooter = CodeBlockFooter;
10517
+ exports.CodeBlockHeader = CodeBlockHeader;
10518
+ exports.CodeBlockLine = CodeBlockLine;
10519
+ exports.CodeBlockTitle = CodeBlockTitle;
9945
10520
  exports.Collapsible = Collapsible;
9946
10521
  exports.CollapsibleContent = CollapsibleContent;
9947
10522
  exports.CollapsibleTrigger = CollapsibleTrigger;
@@ -10284,6 +10859,7 @@ exports.useBreakpoint = useBreakpoint;
10284
10859
  exports.useCarousel = useCarousel;
10285
10860
  exports.useComboboxAnchor = useComboboxAnchor;
10286
10861
  exports.useDebounce = useDebounce;
10862
+ exports.useHighlightedCode = useHighlightedCode;
10287
10863
  exports.useInitTheme = useInitTheme;
10288
10864
  exports.useIsMobile = useIsMobile;
10289
10865
  exports.useSidebar = useSidebar;