@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.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { Autocomplete as Autocomplete$1 } from '@base-ui/react/autocomplete';
3
3
  import * as lucide_react_star from 'lucide-react';
4
- import { XIcon, EyeOffIcon, EyeIcon, SearchIcon, CheckIcon, CopyIcon, MinusIcon, PlusIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, CalendarIcon, Loader2Icon, ChevronUpIcon, MoreHorizontalIcon, PanelLeftIcon } from 'lucide-react';
5
- import * as React3 from 'react';
4
+ import { XIcon, EyeOffIcon, EyeIcon, SearchIcon, CheckIcon, CopyIcon, MinusIcon, PlusIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, CalendarIcon, ChevronUpIcon, MoreHorizontalIcon, PanelLeftIcon } from 'lucide-react';
5
+ import * as React4 from 'react';
6
6
  import { forwardRef, useState, useRef, useCallback, useEffect, createContext, useId, isValidElement, cloneElement, useMemo, Fragment as Fragment$1, Children, createElement, useLayoutEffect, useContext } from 'react';
7
7
  import { cva } from 'class-variance-authority';
8
8
  import { cn } from 'cn';
@@ -17,12 +17,15 @@ import { useRender } from '@base-ui/react/use-render';
17
17
  export { useRender } from '@base-ui/react/use-render';
18
18
  import { CheckboxGroup as CheckboxGroup$1 } from '@base-ui/react/checkbox-group';
19
19
  import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
20
+ import { tableFeatures, sortFn_text, sortFn_datetime, sortFn_basic, sortFn_alphanumeric, filterFn_includesString, rowSortingFeature, rowSelectionFeature, rowPaginationFeature, globalFilteringFeature, columnFilteringFeature, createSortedRowModel, createPaginatedRowModel, createFilteredRowModel, useTable } from '@tanstack/react-table';
20
21
  import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
21
22
  import { getDefaultClassNames, DayPicker } from 'react-day-picker';
22
23
  import { Popover as Popover$1 } from '@base-ui/react/popover';
23
24
  import { useForm, FormProvider, Controller, useFormContext, useController, useFieldArray } from 'react-hook-form';
24
25
  import { Switch as Switch$1 } from '@base-ui/react/switch';
25
26
  import { Toggle as Toggle$1 } from '@base-ui/react/toggle';
27
+ import { createHighlighterCore } from 'shiki/core';
28
+ import { createJavaScriptRegexEngine } from 'shiki/engine/javascript';
26
29
  import { create } from 'zustand';
27
30
  import { useTransition, animated } from '@react-spring/web';
28
31
  import { Meter as Meter$1 } from '@base-ui/react/meter';
@@ -510,9 +513,6 @@ function debounce(func, delay) {
510
513
  }, delay);
511
514
  };
512
515
  }
513
- function mapIdProperty(data) {
514
- return data.length && data?.[0]?.id === void 0 ? data.map((row, id) => ({ ...row, id })) : data;
515
- }
516
516
  var Autocomplete = forwardRef(
517
517
  ({
518
518
  id,
@@ -1394,9 +1394,12 @@ var shadowMap = {
1394
1394
  true: "shadow-md"
1395
1395
  };
1396
1396
  var statusColorTokens = ["destructive", "success", "warning", "info"];
1397
+ var textColorAliases = {
1398
+ muted: "muted-foreground"
1399
+ };
1397
1400
  var textColorTokens = /* @__PURE__ */ new Set([
1398
1401
  "foreground",
1399
- "muted-foreground",
1402
+ "muted",
1400
1403
  "primary",
1401
1404
  "primary-foreground",
1402
1405
  "secondary-foreground",
@@ -1408,6 +1411,7 @@ var textColorTokens = /* @__PURE__ */ new Set([
1408
1411
  ]);
1409
1412
  var backgroundColorTokens = /* @__PURE__ */ new Set([
1410
1413
  "background",
1414
+ "page",
1411
1415
  "card",
1412
1416
  "popover",
1413
1417
  "primary",
@@ -1805,19 +1809,19 @@ function mapHeadingSize(value) {
1805
1809
  function mapFontWeight(value) {
1806
1810
  return mapResponsive(value, (v) => fontWeightMap[v]);
1807
1811
  }
1808
- function mapColor(value, prefix, tokens) {
1812
+ function mapColor(value, prefix, tokens, aliases2 = {}) {
1809
1813
  if (!value) return "";
1810
1814
  if (value === "true") return `${prefix}-${defaultColorToken[prefix]}`;
1811
1815
  if (value === "transparent") return `${prefix}-transparent`;
1812
- if (tokens.has(value)) return `${prefix}-${value}`;
1816
+ if (tokens.has(value)) return `${prefix}-${aliases2[value] ?? value}`;
1813
1817
  if (isTailwindColor(value)) return getTailwindColorClass(value, prefix);
1814
1818
  return "";
1815
1819
  }
1816
1820
  function mapTextColor(value) {
1817
- return mapColor(value, "text", textColorTokens);
1821
+ return mapColor(value, "text", textColorTokens, textColorAliases);
1818
1822
  }
1819
1823
  function mapDecorationColor(value) {
1820
- return mapColor(value, "decoration", textColorTokens);
1824
+ return mapColor(value, "decoration", textColorTokens, textColorAliases);
1821
1825
  }
1822
1826
  function mapBackgroundColor(value) {
1823
1827
  return mapColor(value, "bg", backgroundColorTokens);
@@ -2189,7 +2193,7 @@ function getCssColorValue(value) {
2189
2193
  if (!value) return void 0;
2190
2194
  if (value === "true") return `var(--${defaultColorToken.text})`;
2191
2195
  if (value === "transparent") return "transparent";
2192
- if (textColorTokens.has(value)) return `var(--${value})`;
2196
+ if (textColorTokens.has(value)) return `var(--${textColorAliases[value] ?? value})`;
2193
2197
  const parts = value.split("-");
2194
2198
  if (parts.length === 2 && tailwindColors.has(parts[0])) {
2195
2199
  return tailwindColorHex[parts[0]]?.[parts[1]];
@@ -2960,7 +2964,7 @@ function AlertDialogOverlay({
2960
2964
  {
2961
2965
  "data-slot": "alert-dialog-overlay",
2962
2966
  className: cn(
2963
- "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",
2967
+ "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",
2964
2968
  className
2965
2969
  ),
2966
2970
  ...props
@@ -3357,26 +3361,44 @@ function Grid({
3357
3361
  /* @__PURE__ */ jsx(Box, { ...props, className: classes, style: hasInlineStyles ? inlineStyles : void 0, children })
3358
3362
  ] });
3359
3363
  }
3360
- function Row({ reverse, children, ...props }) {
3361
- return /* @__PURE__ */ jsx(Flexbox, { ...props, direction: reverse ? "row-reverse" : "row", children });
3362
- }
3363
- function DataCard({ data = [], labelWidth = "auto", ...props }) {
3364
- const rows = mapIdProperty(data);
3364
+ function DataCard({ data = [], labelWidth = "auto", className, ...props }) {
3365
3365
  return /* @__PURE__ */ jsx(
3366
3366
  Grid,
3367
3367
  {
3368
+ "data-slot": "data-card",
3368
3369
  width: "100%",
3369
3370
  columns: `${labelWidth} 1fr`,
3370
3371
  border: true,
3371
3372
  borderRadius: "lg",
3372
- padding: "6",
3373
3373
  ...props,
3374
- children: rows.map((row, index) => {
3374
+ className: cn("overflow-hidden bg-white text-sm dark:bg-black", className),
3375
+ children: data.map((row, index) => {
3376
+ const isLast = index === data.length - 1;
3375
3377
  return (
3376
3378
  // biome-ignore lint/suspicious/noArrayIndexKey: rows are static display data
3377
3379
  /* @__PURE__ */ jsxs(Fragment$1, { children: [
3378
- /* @__PURE__ */ jsx(Row, { paddingY: "3", border: "bottom", paddingRight: "6", children: /* @__PURE__ */ jsx(Text, { weight: "medium", children: row?.label }) }),
3379
- /* @__PURE__ */ jsx(Row, { paddingY: "3", border: "bottom", children: /* @__PURE__ */ jsx(Text, { children: row?.value }) })
3380
+ /* @__PURE__ */ jsx(
3381
+ "div",
3382
+ {
3383
+ "data-slot": "data-card-label",
3384
+ className: cn(
3385
+ "flex items-center border-r bg-muted/50 py-2 pr-6 pl-4 font-medium text-foreground",
3386
+ !isLast && "border-b"
3387
+ ),
3388
+ children: row?.label
3389
+ }
3390
+ ),
3391
+ /* @__PURE__ */ jsx(
3392
+ "div",
3393
+ {
3394
+ "data-slot": "data-card-value",
3395
+ className: cn(
3396
+ "flex min-w-0 items-center px-4 py-2 wrap-anywhere",
3397
+ !isLast && "border-b"
3398
+ ),
3399
+ children: row?.value
3400
+ }
3401
+ )
3380
3402
  ] }, index)
3381
3403
  );
3382
3404
  })
@@ -3509,139 +3531,337 @@ function TableCaption({
3509
3531
  }
3510
3532
  );
3511
3533
  }
3512
- var SELECTION_COLUMN_WIDTH = "2rem";
3534
+ var features = tableFeatures({
3535
+ columnFilteringFeature,
3536
+ // required by globalFilteringFeature
3537
+ globalFilteringFeature,
3538
+ rowPaginationFeature,
3539
+ rowSelectionFeature,
3540
+ rowSortingFeature,
3541
+ filteredRowModel: createFilteredRowModel(),
3542
+ paginatedRowModel: createPaginatedRowModel(),
3543
+ sortedRowModel: createSortedRowModel(),
3544
+ filterFns: { includesString: filterFn_includesString },
3545
+ sortFns: {
3546
+ alphanumeric: sortFn_alphanumeric,
3547
+ basic: sortFn_basic,
3548
+ datetime: sortFn_datetime,
3549
+ text: sortFn_text
3550
+ }
3551
+ });
3552
+ var SELECTION_COLUMN_WIDTH = "2.5rem";
3553
+ var ROW_CLASS = "grid [&>*:first-child]:pl-4";
3513
3554
  var alignClasses = {
3514
3555
  start: "justify-start text-left",
3515
3556
  center: "justify-center text-center",
3516
3557
  end: "justify-end text-right"
3517
3558
  };
3559
+ function DataColumn(_props) {
3560
+ return null;
3561
+ }
3562
+ function resolve(updater, old) {
3563
+ return typeof updater === "function" ? updater(old) : updater;
3564
+ }
3565
+ function useControllableState(value, defaultValue, onChange) {
3566
+ const [uncontrolled, setUncontrolled] = useState(defaultValue);
3567
+ const current = value === void 0 ? uncontrolled : value;
3568
+ const setValue = (next) => {
3569
+ if (value === void 0) {
3570
+ setUncontrolled(next);
3571
+ }
3572
+ onChange?.(next);
3573
+ };
3574
+ return [current, setValue];
3575
+ }
3576
+ function defaultGetRowId(row, index) {
3577
+ return row?.id !== void 0 && row?.id !== null ? String(row.id) : String(index);
3578
+ }
3579
+ function getColumnValue(column, row) {
3580
+ return column.value ? column.value(row) : row?.[column.id];
3581
+ }
3582
+ function renderCell(column, row, index) {
3583
+ const { children, as } = column;
3584
+ const content = typeof children === "function" ? children(row, index) : children !== void 0 && children !== null ? children : getColumnValue(column, row);
3585
+ return as ? createElement(as, {}, content) : content;
3586
+ }
3518
3587
  function DataTable({
3519
3588
  data = [],
3520
3589
  displayMode = "table",
3590
+ getRowId = defaultGetRowId,
3521
3591
  selectionMode = "none",
3522
3592
  selectedRows: selectedRowsProp,
3523
3593
  defaultSelectedRows = [],
3524
3594
  onSelectedRowsChange,
3595
+ sorting: sortingProp,
3596
+ defaultSorting = [],
3597
+ onSortingChange,
3598
+ filter = "",
3599
+ pageSize,
3600
+ pageIndex: pageIndexProp,
3601
+ defaultPageIndex = 0,
3602
+ onPageIndexChange,
3603
+ emptyState = "No results.",
3525
3604
  className,
3526
3605
  children,
3527
3606
  ...props
3528
3607
  }) {
3529
- const [uncontrolledSelectedRows, setUncontrolledSelectedRows] = useState(defaultSelectedRows);
3530
- const selectedRows = selectedRowsProp ?? uncontrolledSelectedRows;
3531
- const rows = mapIdProperty(data);
3532
- const rowIds = rows.map((row) => String(row.id));
3608
+ const [selectedRows, setSelectedRows] = useControllableState(
3609
+ selectedRowsProp,
3610
+ defaultSelectedRows,
3611
+ onSelectedRowsChange
3612
+ );
3613
+ const [sorting, setSorting] = useControllableState(sortingProp, defaultSorting, onSortingChange);
3614
+ const [pageIndex, setPageIndex] = useControllableState(
3615
+ pageIndexProp,
3616
+ defaultPageIndex,
3617
+ onPageIndexChange
3618
+ );
3533
3619
  const columns = Children.toArray(children).filter(isValidElement).map((child) => child.props);
3534
3620
  const visibleColumns = columns.filter(({ hidden }) => !hidden);
3621
+ const isSelectable = selectionMode !== "none";
3622
+ const isPaginated = pageSize !== void 0 && pageSize > 0;
3623
+ const rowSelection = Object.fromEntries(selectedRows.map((id) => [id, true]));
3624
+ const table = useTable({
3625
+ features,
3626
+ data,
3627
+ columns: visibleColumns.map((column) => ({
3628
+ id: column.id,
3629
+ accessorFn: (row) => getColumnValue(column, row),
3630
+ enableSorting: !!column.sortable,
3631
+ enableGlobalFilter: column.filterable !== false,
3632
+ sortUndefined: "last",
3633
+ // TanStack sorts numbers and dates descending first; always start ascending instead.
3634
+ sortDescFirst: false
3635
+ })),
3636
+ getRowId: (row, index) => getRowId(row, index),
3637
+ enableRowSelection: isSelectable,
3638
+ enableMultiRowSelection: selectionMode === "multiple",
3639
+ globalFilterFn: "includesString",
3640
+ state: {
3641
+ sorting,
3642
+ rowSelection,
3643
+ globalFilter: filter,
3644
+ pagination: { pageIndex, pageSize: pageSize ?? Math.max(data.length, 1) }
3645
+ },
3646
+ onSortingChange: (updater) => setSorting(resolve(updater, sorting)),
3647
+ onRowSelectionChange: (updater) => {
3648
+ const next = resolve(updater, rowSelection);
3649
+ setSelectedRows(Object.keys(next));
3650
+ },
3651
+ onPaginationChange: (updater) => {
3652
+ setPageIndex(resolve(updater, { pageIndex, pageSize: pageSize ?? 0 }).pageIndex);
3653
+ },
3654
+ onGlobalFilterChange: () => {
3655
+ }
3656
+ });
3657
+ const rows = (isPaginated ? table.getRowModel() : table.getPrePaginatedRowModel()).rows;
3658
+ const pageCount = isPaginated ? table.getPageCount() : 1;
3659
+ const pagination = isPaginated && pageCount > 1 && /* @__PURE__ */ jsxs(
3660
+ "div",
3661
+ {
3662
+ "data-slot": "data-table-pagination",
3663
+ className: "flex w-full items-center justify-between gap-4 py-3 text-sm text-muted-foreground",
3664
+ children: [
3665
+ /* @__PURE__ */ jsxs("span", { children: [
3666
+ "Page ",
3667
+ pageIndex + 1,
3668
+ " of ",
3669
+ pageCount
3670
+ ] }),
3671
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
3672
+ /* @__PURE__ */ jsx(
3673
+ Button,
3674
+ {
3675
+ variant: "outline",
3676
+ size: "sm",
3677
+ onClick: () => table.previousPage(),
3678
+ disabled: !table.getCanPreviousPage(),
3679
+ children: "Previous"
3680
+ }
3681
+ ),
3682
+ /* @__PURE__ */ jsx(
3683
+ Button,
3684
+ {
3685
+ variant: "outline",
3686
+ size: "sm",
3687
+ onClick: () => table.nextPage(),
3688
+ disabled: !table.getCanNextPage(),
3689
+ children: "Next"
3690
+ }
3691
+ )
3692
+ ] })
3693
+ ]
3694
+ }
3695
+ );
3696
+ const empty = /* @__PURE__ */ jsx("div", { "data-slot": "data-table-empty", className: "py-10 text-center text-sm text-muted-foreground", children: emptyState });
3535
3697
  if (displayMode === "cards") {
3536
- return /* @__PURE__ */ jsx(Grid, { width: "100%", gap: "6", children: rows.map((row, index) => {
3537
- const items = visibleColumns.map(({ id, label, children: children2 }) => {
3538
- const value = typeof children2 === "function" ? children2(row, index) : children2 ?? row[id];
3539
- return { id, label, value };
3540
- });
3541
- return /* @__PURE__ */ jsx(DataCard, { data: items }, `${row.id}-${index}`);
3542
- }) });
3698
+ return /* @__PURE__ */ jsxs(Grid, { width: "100%", gap: "6", "data-slot": "data-table", "data-display-mode": "cards", children: [
3699
+ rows.length === 0 ? empty : rows.map((row) => {
3700
+ const items = visibleColumns.map((column) => ({
3701
+ label: column.label,
3702
+ value: renderCell(column, row.original, row.index)
3703
+ }));
3704
+ if (isSelectable) {
3705
+ items.unshift({
3706
+ label: "",
3707
+ value: /* @__PURE__ */ jsx(
3708
+ Checkbox,
3709
+ {
3710
+ "aria-label": "Select row",
3711
+ checked: row.getIsSelected(),
3712
+ onCheckedChange: (checked) => row.toggleSelected(checked)
3713
+ }
3714
+ )
3715
+ });
3716
+ }
3717
+ return /* @__PURE__ */ jsx(
3718
+ DataCard,
3719
+ {
3720
+ "data-row-id": row.id,
3721
+ "data-state": row.getIsSelected() ? "selected" : void 0,
3722
+ data: items
3723
+ },
3724
+ row.id
3725
+ );
3726
+ }),
3727
+ pagination
3728
+ ] });
3543
3729
  }
3544
- const isSelectable = selectionMode !== "none";
3545
3730
  const gridTemplateColumns = [
3546
3731
  ...isSelectable ? [SELECTION_COLUMN_WIDTH] : [],
3547
3732
  ...visibleColumns.map(({ width }) => width || "1fr")
3548
3733
  ].join(" ");
3549
3734
  const rowStyle = { gridTemplateColumns };
3550
- const setSelectedRows = (next) => {
3551
- if (selectedRowsProp === void 0) {
3552
- setUncontrolledSelectedRows(next);
3553
- }
3554
- onSelectedRowsChange?.(next);
3555
- };
3556
- const setRowSelected = (rowId, checked) => {
3557
- if (selectionMode === "single") {
3558
- setSelectedRows(checked ? [rowId] : []);
3559
- return;
3560
- }
3561
- setSelectedRows(
3562
- checked ? [...selectedRows.filter((id) => id !== rowId), rowId] : selectedRows.filter((id) => id !== rowId)
3563
- );
3564
- };
3565
- const selectedCount = rowIds.filter((id) => selectedRows.includes(id)).length;
3566
- const allSelected = rowIds.length > 0 && selectedCount === rowIds.length;
3567
- return /* @__PURE__ */ jsxs(
3735
+ const allSelected = table.getIsAllRowsSelected();
3736
+ const someSelected = table.getIsSomeRowsSelected();
3737
+ const tableElement = /* @__PURE__ */ jsxs(
3568
3738
  Table,
3569
3739
  {
3570
3740
  ...props,
3741
+ role: "table",
3571
3742
  "data-slot": "data-table",
3572
3743
  "data-selection-mode": isSelectable ? selectionMode : void 0,
3573
- className: cn("grid", className),
3744
+ className: cn(
3745
+ "grid overflow-hidden rounded-lg border border-border bg-white dark:bg-black",
3746
+ className
3747
+ ),
3574
3748
  children: [
3575
- /* @__PURE__ */ jsx(TableHeader, { className: "contents", children: /* @__PURE__ */ jsxs(TableRow, { className: "grid hover:bg-transparent", style: rowStyle, children: [
3576
- isSelectable && /* @__PURE__ */ jsx(TableHead, { className: "flex items-center", children: selectionMode === "multiple" && /* @__PURE__ */ jsx(
3577
- Checkbox,
3578
- {
3579
- "aria-label": "Select all rows",
3580
- checked: allSelected,
3581
- indeterminate: selectedCount > 0 && !allSelected,
3582
- onCheckedChange: (checked) => setSelectedRows(checked ? rowIds : [])
3583
- }
3584
- ) }),
3585
- visibleColumns.map(({ id, label, align }) => /* @__PURE__ */ jsx(TableHead, { className: cn("flex items-center", align && alignClasses[align]), children: label }, id))
3586
- ] }) }),
3587
- /* @__PURE__ */ jsx(TableBody, { className: "contents", children: rows.map((row, index) => {
3588
- const rowId = String(row.id);
3589
- const isSelected = isSelectable && selectedRows.includes(rowId);
3749
+ /* @__PURE__ */ jsx(TableHeader, { role: "rowgroup", className: "contents", children: /* @__PURE__ */ jsxs(
3750
+ TableRow,
3751
+ {
3752
+ role: "row",
3753
+ className: cn(ROW_CLASS, "bg-muted/50 hover:bg-muted/50"),
3754
+ style: rowStyle,
3755
+ children: [
3756
+ isSelectable && /* @__PURE__ */ jsx(TableHead, { role: "columnheader", className: "flex items-center", children: selectionMode === "multiple" && /* @__PURE__ */ jsx(
3757
+ Checkbox,
3758
+ {
3759
+ "aria-label": "Select all rows",
3760
+ checked: allSelected,
3761
+ indeterminate: someSelected && !allSelected,
3762
+ onCheckedChange: (checked) => table.toggleAllRowsSelected(checked)
3763
+ }
3764
+ ) }),
3765
+ visibleColumns.map((column) => {
3766
+ const tableColumn = table.getColumn(column.id);
3767
+ const sorted = column.sortable ? tableColumn?.getIsSorted() : false;
3768
+ const SortIcon = sorted === "asc" ? icons_exports.ArrowUp : sorted === "desc" ? icons_exports.ArrowDown : icons_exports.ChevronsUpDown;
3769
+ return /* @__PURE__ */ jsx(
3770
+ TableHead,
3771
+ {
3772
+ role: "columnheader",
3773
+ "aria-sort": column.sortable ? sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : "none" : void 0,
3774
+ className: cn("flex items-center", column.align && alignClasses[column.align]),
3775
+ children: column.sortable ? /* @__PURE__ */ jsxs(
3776
+ "button",
3777
+ {
3778
+ type: "button",
3779
+ "data-slot": "data-table-sort",
3780
+ onClick: tableColumn?.getToggleSortingHandler(),
3781
+ 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",
3782
+ children: [
3783
+ column.label,
3784
+ /* @__PURE__ */ jsx(
3785
+ SortIcon,
3786
+ {
3787
+ "aria-hidden": "true",
3788
+ className: cn("size-3.5", !sorted && "text-muted-foreground")
3789
+ }
3790
+ )
3791
+ ]
3792
+ }
3793
+ ) : column.label
3794
+ },
3795
+ column.id
3796
+ );
3797
+ })
3798
+ ]
3799
+ }
3800
+ ) }),
3801
+ /* @__PURE__ */ jsx(TableBody, { role: "rowgroup", className: "contents", children: rows.length === 0 ? /* @__PURE__ */ jsx(TableRow, { role: "row", className: "grid hover:bg-transparent", style: rowStyle, children: /* @__PURE__ */ jsx(TableCell, { role: "cell", style: { gridColumn: "1 / -1" }, children: empty }) }) : rows.map((row) => {
3802
+ const isSelected = isSelectable && row.getIsSelected();
3590
3803
  return /* @__PURE__ */ jsxs(
3591
3804
  TableRow,
3592
3805
  {
3593
- "data-row-id": rowId,
3806
+ role: "row",
3807
+ "data-row-id": row.id,
3594
3808
  "data-state": isSelected ? "selected" : void 0,
3595
- className: "grid",
3809
+ className: ROW_CLASS,
3596
3810
  style: rowStyle,
3597
3811
  children: [
3598
- isSelectable && /* @__PURE__ */ jsx(TableCell, { className: "flex items-center", children: /* @__PURE__ */ jsx(
3812
+ isSelectable && /* @__PURE__ */ jsx(TableCell, { role: "cell", className: "flex items-center", children: /* @__PURE__ */ jsx(
3599
3813
  Checkbox,
3600
3814
  {
3601
3815
  "aria-label": "Select row",
3602
3816
  checked: isSelected,
3603
- onCheckedChange: (checked) => setRowSelected(rowId, checked)
3817
+ onCheckedChange: (checked) => row.toggleSelected(checked)
3604
3818
  }
3605
3819
  ) }),
3606
- visibleColumns.map(
3607
- ({
3820
+ visibleColumns.map((column) => {
3821
+ const {
3608
3822
  id,
3609
3823
  label: _label,
3610
3824
  width: _width,
3611
3825
  hidden: _hidden,
3612
- as,
3826
+ as: _as,
3827
+ value: _value,
3828
+ sortable: _sortable,
3829
+ filterable: _filterable,
3613
3830
  align,
3614
3831
  className: cellClassName,
3615
- children: children2,
3832
+ children: _children,
3616
3833
  ...cellProps
3617
- }) => {
3618
- const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
3619
- return /* @__PURE__ */ createElement(
3620
- TableCell,
3621
- {
3622
- ...cellProps,
3623
- key: id,
3624
- className: cn(
3625
- "flex min-w-0 items-center whitespace-normal",
3626
- align && alignClasses[align],
3627
- cellClassName
3628
- )
3629
- },
3630
- as ? createElement(as, {}, value) : value
3631
- );
3632
- }
3633
- )
3834
+ } = column;
3835
+ return /* @__PURE__ */ createElement(
3836
+ TableCell,
3837
+ {
3838
+ ...cellProps,
3839
+ key: id,
3840
+ role: "cell",
3841
+ className: cn(
3842
+ "flex min-w-0 items-center whitespace-normal wrap-anywhere",
3843
+ align && alignClasses[align],
3844
+ cellClassName
3845
+ )
3846
+ },
3847
+ renderCell(column, row.original, row.index)
3848
+ );
3849
+ })
3634
3850
  ]
3635
3851
  },
3636
- rowId
3852
+ row.id
3637
3853
  );
3638
3854
  }) })
3639
3855
  ]
3640
3856
  }
3641
3857
  );
3642
- }
3643
- function DataColumn(_props) {
3644
- return null;
3858
+ if (!pagination) {
3859
+ return tableElement;
3860
+ }
3861
+ return /* @__PURE__ */ jsxs("div", { "data-slot": "data-table-wrapper", className: "flex w-full flex-col", children: [
3862
+ tableElement,
3863
+ pagination
3864
+ ] });
3645
3865
  }
3646
3866
  function Calendar({
3647
3867
  className,
@@ -3796,8 +4016,8 @@ function CalendarDayButton({
3796
4016
  ...props
3797
4017
  }) {
3798
4018
  const defaultClassNames = getDefaultClassNames();
3799
- const ref = React3.useRef(null);
3800
- React3.useEffect(() => {
4019
+ const ref = React4.useRef(null);
4020
+ React4.useEffect(() => {
3801
4021
  if (modifiers.focused) ref.current?.focus();
3802
4022
  }, [modifiers.focused]);
3803
4023
  return /* @__PURE__ */ jsx(
@@ -3991,6 +4211,9 @@ function DatePicker({
3991
4211
  picker
3992
4212
  ] });
3993
4213
  }
4214
+ function Row({ reverse, children, ...props }) {
4215
+ return /* @__PURE__ */ jsx(Flexbox, { ...props, direction: reverse ? "row-reverse" : "row", children });
4216
+ }
3994
4217
  var sizeMap = {
3995
4218
  sm: "w-1.5 h-1.5",
3996
4219
  md: "w-2 h-2",
@@ -4743,8 +4966,22 @@ function FormResetButton({
4743
4966
  };
4744
4967
  return /* @__PURE__ */ jsx(Button, { ...props, type: "reset", variant, onClick: handleClick });
4745
4968
  }
4746
- function Spinner({ className, ...props }) {
4747
- return /* @__PURE__ */ jsx(Loader2Icon, { "data-slot": "spinner", role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props });
4969
+ function Spinner({ quiet, className, ...props }) {
4970
+ return /* @__PURE__ */ jsxs(
4971
+ "svg",
4972
+ {
4973
+ viewBox: "25 25 50 50",
4974
+ "data-slot": "spinner",
4975
+ role: "status",
4976
+ "aria-label": "Loading",
4977
+ ...props,
4978
+ className: cn("zen-spinner size-4", className),
4979
+ children: [
4980
+ !quiet && /* @__PURE__ */ jsx("circle", { className: "zen-spinner-track", cx: "50", cy: "50", r: "20" }),
4981
+ /* @__PURE__ */ jsx("circle", { className: "zen-spinner-fill", cx: "50", cy: "50", r: "20" })
4982
+ ]
4983
+ }
4984
+ );
4748
4985
  }
4749
4986
  function FormSubmitButton({
4750
4987
  disabled,
@@ -4794,10 +5031,142 @@ function Heading({
4794
5031
  }
4795
5032
  );
4796
5033
  }
5034
+ var languages = {
5035
+ bash: () => import('shiki/langs/shellscript.mjs'),
5036
+ css: () => import('shiki/langs/css.mjs'),
5037
+ diff: () => import('shiki/langs/diff.mjs'),
5038
+ html: () => import('shiki/langs/html.mjs'),
5039
+ javascript: () => import('shiki/langs/javascript.mjs'),
5040
+ json: () => import('shiki/langs/json.mjs'),
5041
+ jsx: () => import('shiki/langs/jsx.mjs'),
5042
+ markdown: () => import('shiki/langs/markdown.mjs'),
5043
+ python: () => import('shiki/langs/python.mjs'),
5044
+ sql: () => import('shiki/langs/sql.mjs'),
5045
+ tsx: () => import('shiki/langs/tsx.mjs'),
5046
+ typescript: () => import('shiki/langs/typescript.mjs'),
5047
+ yaml: () => import('shiki/langs/yaml.mjs')
5048
+ };
5049
+ var aliases = {
5050
+ js: "javascript",
5051
+ md: "markdown",
5052
+ py: "python",
5053
+ sh: "bash",
5054
+ shell: "bash",
5055
+ shellscript: "bash",
5056
+ ts: "typescript",
5057
+ yml: "yaml",
5058
+ zsh: "bash"
5059
+ };
5060
+ var highlighter;
5061
+ function getHighlighter() {
5062
+ highlighter ??= createHighlighterCore({
5063
+ themes: [
5064
+ import('shiki/themes/github-light.mjs'),
5065
+ import('shiki/themes/github-dark.mjs')
5066
+ ],
5067
+ langs: [],
5068
+ engine: createJavaScriptRegexEngine({ forgiving: true })
5069
+ });
5070
+ return highlighter;
5071
+ }
5072
+ function getLanguage(language) {
5073
+ const name = language.toLowerCase();
5074
+ if (name === "ansi") {
5075
+ return name;
5076
+ }
5077
+ if (name in languages) {
5078
+ return name;
5079
+ }
5080
+ return aliases[name] ?? null;
5081
+ }
5082
+ async function loadHighlighter(language) {
5083
+ const lang = getLanguage(language);
5084
+ if (!lang) {
5085
+ return null;
5086
+ }
5087
+ const shiki = await getHighlighter();
5088
+ if (lang !== "ansi" && !shiki.getLoadedLanguages().includes(lang)) {
5089
+ await shiki.loadLanguage(languages[lang]);
5090
+ }
5091
+ return {
5092
+ // Returns one React node per line, and the grammar state after the last
5093
+ // line. Pass that state back to continue where the code left off.
5094
+ highlight(code, state) {
5095
+ const tokenize = (text) => shiki.codeToTokens(text, {
5096
+ lang,
5097
+ themes: { light: "github-light", dark: "github-dark" },
5098
+ defaultColor: false,
5099
+ grammarState: state
5100
+ }).tokens;
5101
+ const tokens = lang === "ansi" ? code.split("\n").flatMap((line) => tokenize(line)) : tokenize(code);
5102
+ return {
5103
+ lines: tokens.map(
5104
+ (line) => line.map((token, index) => /* @__PURE__ */ jsx(
5105
+ "span",
5106
+ {
5107
+ style: token.htmlStyle,
5108
+ className: "text-(--shiki-light) dark:text-(--shiki-dark)",
5109
+ children: token.content
5110
+ },
5111
+ index
5112
+ ))
5113
+ ),
5114
+ state: shiki.getLastGrammarState(tokens)
5115
+ };
5116
+ }
5117
+ };
5118
+ }
5119
+
5120
+ // src/components/hooks/use-highlighted-code.ts
5121
+ function useHighlightedCode(value, language) {
5122
+ const code = value.endsWith("\n") ? value.slice(0, -1) : value;
5123
+ const [loaded, setLoaded] = React4.useState(null);
5124
+ const highlighter2 = loaded?.language === language ? loaded.highlighter : null;
5125
+ React4.useEffect(() => {
5126
+ let cancelled = false;
5127
+ loadHighlighter(language).then((next2) => {
5128
+ if (!cancelled) {
5129
+ setLoaded({ language, highlighter: next2 });
5130
+ }
5131
+ }).catch(() => {
5132
+ });
5133
+ return () => {
5134
+ cancelled = true;
5135
+ };
5136
+ }, [language]);
5137
+ const [done, setDone] = React4.useState({ highlighter: null, text: "", lines: [] });
5138
+ let next = done;
5139
+ if (next.highlighter !== highlighter2 || !code.startsWith(next.text)) {
5140
+ next = { highlighter: highlighter2, text: "", lines: [] };
5141
+ }
5142
+ const end = code.lastIndexOf("\n") + 1;
5143
+ if (highlighter2 && end > next.text.length) {
5144
+ const result = highlighter2.highlight(
5145
+ code.slice(next.text.length, end - 1),
5146
+ next.state
5147
+ );
5148
+ next = {
5149
+ highlighter: highlighter2,
5150
+ text: code.slice(0, end),
5151
+ lines: [...next.lines, ...result.lines],
5152
+ state: result.state
5153
+ };
5154
+ }
5155
+ if (next !== done) {
5156
+ setDone(next);
5157
+ }
5158
+ const tail = code.slice(end);
5159
+ return React4.useMemo(() => {
5160
+ if (!highlighter2) {
5161
+ return code.split("\n");
5162
+ }
5163
+ return [...next.lines, highlighter2.highlight(tail, next.state).lines[0]];
5164
+ }, [code, highlighter2, next, tail]);
5165
+ }
4797
5166
  var MOBILE_BREAKPOINT = 768;
4798
5167
  function useIsMobile() {
4799
- const [isMobile, setIsMobile] = React3.useState(void 0);
4800
- React3.useEffect(() => {
5168
+ const [isMobile, setIsMobile] = React4.useState(void 0);
5169
+ React4.useEffect(() => {
4801
5170
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
4802
5171
  const onChange = () => {
4803
5172
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -5614,7 +5983,7 @@ var NumberField = forwardRef(function NumberField2({
5614
5983
  id: fieldId,
5615
5984
  "data-slot": "number-field",
5616
5985
  className: cn(
5617
- "group/field flex w-full flex-col gap-3 data-disabled:[&_[data-slot=field-label]]:opacity-50",
5986
+ "group/field flex w-full flex-col gap-2 data-disabled:[&_[data-slot=field-label]]:opacity-50",
5618
5987
  className
5619
5988
  ),
5620
5989
  children: [
@@ -5681,7 +6050,7 @@ function PageHeaderTitle({
5681
6050
  return /* @__PURE__ */ jsxs(Column, { gap: "1", ...props, children: [
5682
6051
  breadcrumb,
5683
6052
  /* @__PURE__ */ jsx(Text, { size: "xl", weight: "semibold", children: title }),
5684
- description && /* @__PURE__ */ jsx(Text, { color: "muted-foreground", children: description }),
6053
+ description && /* @__PURE__ */ jsx(Text, { color: "muted", children: description }),
5685
6054
  children
5686
6055
  ] });
5687
6056
  }
@@ -5848,7 +6217,7 @@ function TagGroup({ label, children, className, onRemove, ...props }) {
5848
6217
  removable: !!onRemove,
5849
6218
  remove: (value) => onRemove?.(value)
5850
6219
  },
5851
- children: /* @__PURE__ */ jsxs("div", { ...props, "data-slot": "tag-group", className: cn("flex flex-col gap-3", className), children: [
6220
+ children: /* @__PURE__ */ jsxs("div", { ...props, "data-slot": "tag-group", className: cn("flex flex-col gap-2", className), children: [
5852
6221
  label && /* @__PURE__ */ jsx(FieldTitle, { id: labelId, children: label }),
5853
6222
  /* @__PURE__ */ jsx(
5854
6223
  "ul",
@@ -6573,9 +6942,9 @@ function CardFooter({ className, ...props }) {
6573
6942
  }
6574
6943
  );
6575
6944
  }
6576
- var CarouselContext = React3.createContext(null);
6945
+ var CarouselContext = React4.createContext(null);
6577
6946
  function useCarousel() {
6578
- const context = React3.useContext(CarouselContext);
6947
+ const context = React4.useContext(CarouselContext);
6579
6948
  if (!context) {
6580
6949
  throw new Error("useCarousel must be used within a <Carousel />");
6581
6950
  }
@@ -6597,20 +6966,20 @@ function Carousel({
6597
6966
  },
6598
6967
  plugins
6599
6968
  );
6600
- const [canScrollPrev, setCanScrollPrev] = React3.useState(false);
6601
- const [canScrollNext, setCanScrollNext] = React3.useState(false);
6602
- const onSelect = React3.useCallback((api2) => {
6969
+ const [canScrollPrev, setCanScrollPrev] = React4.useState(false);
6970
+ const [canScrollNext, setCanScrollNext] = React4.useState(false);
6971
+ const onSelect = React4.useCallback((api2) => {
6603
6972
  if (!api2) return;
6604
6973
  setCanScrollPrev(api2.canScrollPrev());
6605
6974
  setCanScrollNext(api2.canScrollNext());
6606
6975
  }, []);
6607
- const scrollPrev = React3.useCallback(() => {
6976
+ const scrollPrev = React4.useCallback(() => {
6608
6977
  api?.scrollPrev();
6609
6978
  }, [api]);
6610
- const scrollNext = React3.useCallback(() => {
6979
+ const scrollNext = React4.useCallback(() => {
6611
6980
  api?.scrollNext();
6612
6981
  }, [api]);
6613
- const handleKeyDown = React3.useCallback(
6982
+ const handleKeyDown = React4.useCallback(
6614
6983
  (event) => {
6615
6984
  if (event.key === "ArrowLeft") {
6616
6985
  event.preventDefault();
@@ -6622,11 +6991,11 @@ function Carousel({
6622
6991
  },
6623
6992
  [scrollPrev, scrollNext]
6624
6993
  );
6625
- React3.useEffect(() => {
6994
+ React4.useEffect(() => {
6626
6995
  if (!api || !setApi) return;
6627
6996
  setApi(api);
6628
6997
  }, [api, setApi]);
6629
- React3.useEffect(() => {
6998
+ React4.useEffect(() => {
6630
6999
  if (!api) return;
6631
7000
  onSelect(api);
6632
7001
  api.on("reInit", onSelect);
@@ -6758,6 +7127,204 @@ function CarouselNext({
6758
7127
  }
6759
7128
  );
6760
7129
  }
7130
+ var codeBlockVariants = cva(
7131
+ "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",
7132
+ {
7133
+ variants: {
7134
+ variant: {
7135
+ default: "border border-input text-foreground has-[>[data-slot=code-block-content]:focus-visible]:border-ring dark:bg-input/30",
7136
+ destructive: "border border-destructive/30 text-destructive dark:border-destructive/40"
7137
+ }
7138
+ },
7139
+ defaultVariants: {
7140
+ variant: "default"
7141
+ }
7142
+ }
7143
+ );
7144
+ function CodeBlock({
7145
+ className,
7146
+ variant = "default",
7147
+ size = "default",
7148
+ ...props
7149
+ }) {
7150
+ return /* @__PURE__ */ jsx(
7151
+ "div",
7152
+ {
7153
+ "data-slot": "code-block",
7154
+ "data-variant": variant,
7155
+ "data-size": size,
7156
+ className: cn(codeBlockVariants({ variant }), className),
7157
+ ...props
7158
+ }
7159
+ );
7160
+ }
7161
+ function CodeBlockHeader({ className, ...props }) {
7162
+ return /* @__PURE__ */ jsx(
7163
+ "div",
7164
+ {
7165
+ "data-slot": "code-block-header",
7166
+ className: cn(
7167
+ "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",
7168
+ className
7169
+ ),
7170
+ ...props
7171
+ }
7172
+ );
7173
+ }
7174
+ function CodeBlockTitle({ className, ...props }) {
7175
+ return /* @__PURE__ */ jsx(
7176
+ "div",
7177
+ {
7178
+ "data-slot": "code-block-title",
7179
+ className: cn(
7180
+ "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",
7181
+ className
7182
+ ),
7183
+ ...props
7184
+ }
7185
+ );
7186
+ }
7187
+ function CodeBlockActions({
7188
+ className,
7189
+ ...props
7190
+ }) {
7191
+ return /* @__PURE__ */ jsx(
7192
+ "div",
7193
+ {
7194
+ "data-slot": "code-block-actions",
7195
+ className: cn(
7196
+ "-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",
7197
+ className
7198
+ ),
7199
+ ...props
7200
+ }
7201
+ );
7202
+ }
7203
+ function CodeBlockCopyButton({
7204
+ value,
7205
+ variant = "ghost",
7206
+ size = "icon-xs",
7207
+ className,
7208
+ onClick,
7209
+ ...props
7210
+ }) {
7211
+ const [copied, setCopied] = React4.useState(false);
7212
+ React4.useEffect(() => {
7213
+ if (!copied) {
7214
+ return;
7215
+ }
7216
+ const timeout = setTimeout(() => setCopied(false), 2e3);
7217
+ return () => clearTimeout(timeout);
7218
+ }, [copied]);
7219
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
7220
+ /* @__PURE__ */ jsx(
7221
+ Button,
7222
+ {
7223
+ "data-slot": "code-block-copy-button",
7224
+ "data-copied": copied || void 0,
7225
+ variant,
7226
+ size,
7227
+ "aria-label": copied ? "Copied" : "Copy",
7228
+ className: cn(className),
7229
+ onClick: (event) => {
7230
+ onClick?.(event);
7231
+ navigator.clipboard.writeText(value).then(() => setCopied(true)).catch(() => {
7232
+ });
7233
+ },
7234
+ ...props,
7235
+ children: copied ? /* @__PURE__ */ jsx(
7236
+ CheckIcon,
7237
+ {}
7238
+ ) : /* @__PURE__ */ jsx(
7239
+ CopyIcon,
7240
+ {}
7241
+ )
7242
+ }
7243
+ ),
7244
+ /* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", children: copied ? "Copied" : "" })
7245
+ ] });
7246
+ }
7247
+ function CodeBlockContent({
7248
+ className,
7249
+ children,
7250
+ style,
7251
+ wrap = false,
7252
+ lineNumbers = false,
7253
+ startLine = 1,
7254
+ ...props
7255
+ }) {
7256
+ return /* @__PURE__ */ jsx(
7257
+ "pre",
7258
+ {
7259
+ "data-slot": "code-block-content",
7260
+ "data-wrap": wrap || void 0,
7261
+ "data-numbered": lineNumbers || void 0,
7262
+ dir: "ltr",
7263
+ tabIndex: 0,
7264
+ style: { counterReset: `line ${startLine - 1}`, ...style },
7265
+ className: cn(
7266
+ "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",
7267
+ className
7268
+ ),
7269
+ ...props,
7270
+ children: /* @__PURE__ */ jsx(
7271
+ "code",
7272
+ {
7273
+ "data-slot": "code-block-code",
7274
+ className: "grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",
7275
+ children: lineNumbers && typeof children === "string" ? children.replace(/\n$/, "").split("\n").map((line, index) => /* @__PURE__ */ jsx(CodeBlockLine, { children: line }, index)) : children
7276
+ }
7277
+ )
7278
+ }
7279
+ );
7280
+ }
7281
+ var codeBlockLineVariants = cva(
7282
+ "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)_/_'']",
7283
+ {
7284
+ variants: {
7285
+ variant: {
7286
+ default: "",
7287
+ added: "bg-muted after:content-['+']",
7288
+ removed: "bg-destructive/10 after:text-destructive after:content-['\u2212']",
7289
+ highlighted: "bg-muted"
7290
+ }
7291
+ },
7292
+ defaultVariants: {
7293
+ variant: "default"
7294
+ }
7295
+ }
7296
+ );
7297
+ function CodeBlockLine({
7298
+ className,
7299
+ variant = "default",
7300
+ children,
7301
+ ...props
7302
+ }) {
7303
+ const empty = children === void 0 || children === null || children === "" || Array.isArray(children) && children.length === 0;
7304
+ return /* @__PURE__ */ jsx(
7305
+ "span",
7306
+ {
7307
+ "data-slot": "code-block-line",
7308
+ "data-variant": variant,
7309
+ className: cn(codeBlockLineVariants({ variant }), className),
7310
+ ...props,
7311
+ children: /* @__PURE__ */ jsx("span", { "data-slot": "code-block-line-content", className: "min-w-0", children: empty ? "\n" : children })
7312
+ }
7313
+ );
7314
+ }
7315
+ function CodeBlockFooter({ className, ...props }) {
7316
+ return /* @__PURE__ */ jsx(
7317
+ "div",
7318
+ {
7319
+ "data-slot": "code-block-footer",
7320
+ className: cn(
7321
+ "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",
7322
+ className
7323
+ ),
7324
+ ...props
7325
+ }
7326
+ );
7327
+ }
6761
7328
  function Collapsible({ ...props }) {
6762
7329
  return /* @__PURE__ */ jsx(Collapsible$1.Root, { "data-slot": "collapsible", ...props });
6763
7330
  }
@@ -7016,7 +7583,7 @@ function ComboboxChipsInput({
7016
7583
  );
7017
7584
  }
7018
7585
  function useComboboxAnchor() {
7019
- return React3.useRef(null);
7586
+ return React4.useRef(null);
7020
7587
  }
7021
7588
  function Dialog({ ...props }) {
7022
7589
  return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "dialog", ...props });
@@ -7039,7 +7606,7 @@ function DialogOverlay({
7039
7606
  {
7040
7607
  "data-slot": "dialog-overlay",
7041
7608
  className: cn(
7042
- "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",
7609
+ "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",
7043
7610
  className
7044
7611
  ),
7045
7612
  ...props
@@ -7049,7 +7616,7 @@ function DialogOverlay({
7049
7616
  function DialogContent({
7050
7617
  className,
7051
7618
  children,
7052
- showCloseButton = true,
7619
+ showCloseButton = false,
7053
7620
  ...props
7054
7621
  }) {
7055
7622
  return /* @__PURE__ */ jsxs(DialogPortal, { children: [
@@ -7525,9 +8092,9 @@ function ContextMenuShortcut({
7525
8092
  }
7526
8093
  );
7527
8094
  }
7528
- var DrawerContext = React3.createContext(null);
8095
+ var DrawerContext = React4.createContext(null);
7529
8096
  function useDrawer() {
7530
- const context = React3.useContext(DrawerContext);
8097
+ const context = React4.useContext(DrawerContext);
7531
8098
  if (!context) {
7532
8099
  throw new Error("useDrawer must be used within a Drawer.");
7533
8100
  }
@@ -7541,7 +8108,7 @@ function Drawer({
7541
8108
  ...props
7542
8109
  }) {
7543
8110
  const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
7544
- const contextValue = React3.useMemo(
8111
+ const contextValue = React4.useMemo(
7545
8112
  () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
7546
8113
  [hasSnapPoints, modal, showSwipeHandle, swipeDirection]
7547
8114
  );
@@ -8106,7 +8673,7 @@ function InputOTPSlot({
8106
8673
  className,
8107
8674
  ...props
8108
8675
  }) {
8109
- const inputOTPContext = React3.useContext(OTPInputContext);
8676
+ const inputOTPContext = React4.useContext(OTPInputContext);
8110
8677
  const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
8111
8678
  return /* @__PURE__ */ jsxs(
8112
8679
  "div",
@@ -9053,9 +9620,9 @@ var SIDEBAR_WIDTH = "16rem";
9053
9620
  var SIDEBAR_WIDTH_MOBILE = "18rem";
9054
9621
  var SIDEBAR_WIDTH_ICON = "3rem";
9055
9622
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
9056
- var SidebarContext = React3.createContext(null);
9623
+ var SidebarContext = React4.createContext(null);
9057
9624
  function useSidebar() {
9058
- const context = React3.useContext(SidebarContext);
9625
+ const context = React4.useContext(SidebarContext);
9059
9626
  if (!context) {
9060
9627
  throw new Error("useSidebar must be used within a SidebarProvider.");
9061
9628
  }
@@ -9071,10 +9638,10 @@ function SidebarProvider({
9071
9638
  ...props
9072
9639
  }) {
9073
9640
  const isMobile = useIsMobile();
9074
- const [openMobile, setOpenMobile] = React3.useState(false);
9075
- const [_open, _setOpen] = React3.useState(defaultOpen);
9641
+ const [openMobile, setOpenMobile] = React4.useState(false);
9642
+ const [_open, _setOpen] = React4.useState(defaultOpen);
9076
9643
  const open = openProp ?? _open;
9077
- const setOpen = React3.useCallback(
9644
+ const setOpen = React4.useCallback(
9078
9645
  (value) => {
9079
9646
  const openState = typeof value === "function" ? value(open) : value;
9080
9647
  if (setOpenProp) {
@@ -9086,10 +9653,10 @@ function SidebarProvider({
9086
9653
  },
9087
9654
  [setOpenProp, open]
9088
9655
  );
9089
- const toggleSidebar = React3.useCallback(() => {
9656
+ const toggleSidebar = React4.useCallback(() => {
9090
9657
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
9091
9658
  }, [isMobile, setOpen, setOpenMobile]);
9092
- React3.useEffect(() => {
9659
+ React4.useEffect(() => {
9093
9660
  const handleKeyDown = (event) => {
9094
9661
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
9095
9662
  event.preventDefault();
@@ -9100,7 +9667,7 @@ function SidebarProvider({
9100
9667
  return () => window.removeEventListener("keydown", handleKeyDown);
9101
9668
  }, [toggleSidebar]);
9102
9669
  const state = open ? "expanded" : "collapsed";
9103
- const contextValue = React3.useMemo(
9670
+ const contextValue = React4.useMemo(
9104
9671
  () => ({
9105
9672
  state,
9106
9673
  open,
@@ -9560,7 +10127,7 @@ function SidebarMenuSkeleton({
9560
10127
  showIcon = false,
9561
10128
  ...props
9562
10129
  }) {
9563
- const [width] = React3.useState(() => {
10130
+ const [width] = React4.useState(() => {
9564
10131
  return `${Math.floor(Math.random() * 40) + 50}%`;
9565
10132
  });
9566
10133
  return /* @__PURE__ */ jsxs(
@@ -9767,7 +10334,7 @@ function TabsContent({ className, ...props }) {
9767
10334
  }
9768
10335
  );
9769
10336
  }
9770
- var ToggleGroupContext = React3.createContext({
10337
+ var ToggleGroupContext = React4.createContext({
9771
10338
  size: "default",
9772
10339
  variant: "default",
9773
10340
  spacing: 2,
@@ -9813,7 +10380,7 @@ function ToggleGroupItem({
9813
10380
  size = "default",
9814
10381
  ...props
9815
10382
  }) {
9816
- const context = React3.useContext(ToggleGroupContext);
10383
+ const context = React4.useContext(ToggleGroupContext);
9817
10384
  return /* @__PURE__ */ jsx(
9818
10385
  Toggle$1,
9819
10386
  {
@@ -9849,6 +10416,6 @@ function ZenProvider({
9849
10416
  return /* @__PURE__ */ jsx(TooltipProvider, { ...tooltip, children: /* @__PURE__ */ jsx(ToastProvider, { ...defaultToastConfig, ...toast, children }) });
9850
10417
  }
9851
10418
 
9852
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Autocomplete, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Blockquote, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, CheckboxGroup, Code, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationDialog, Container, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataCard, DataColumn, DataTable, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dots, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Flexbox, FloatingTooltip, Form, FormButtons, FormController, FormField, FormFieldArray, FormResetButton, FormSubmitButton, Grid, Heading, HoverCard, HoverCardContent, HoverCardTrigger, Icon, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, List, ListItem, ListSection, ListSeparator, Loading, LoadingButton, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Meter, Navbar, NavbarItem, NavbarLink, NumberField, PALETTES, PageHeader, PageHeaderActions, PageHeaderTitle, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordField, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressCircle, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Row, ScrollArea, ScrollBar, SearchField, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, StatusLight, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TagGroup, Text, TextField, Textarea, ThemeButton, ThemeSwitcher, Toast, ToastContext, ToastProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, ToolbarGroup, ToolbarLink, ToolbarSeparator, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, ZenProvider, badgeVariants, buttonGroupVariants, buttonVariants, getCssColorValue, isHeightPreset, isMaxHeightPreset, isMaxWidthPreset, isMinHeightPreset, isMinWidthPreset, isWidthPreset, mapAlignContent, mapAlignItems, mapAlignSelf, mapBackgroundColor, mapBorder, mapBorderColor, mapBorderRadius, mapBorderWidth, mapCursor, mapDecorationColor, mapDisplay, mapFlexDirection, mapFlexWrap, mapFontSize, mapFontWeight, mapGap, mapGridAutoFlow, mapGridColumns, mapGridRows, mapHeadingSize, mapHeight, mapJustifyContent, mapJustifyItems, mapLetterSpacing, mapLineHeight, mapMargin, mapMaxHeight, mapMaxWidth, mapMinHeight, mapMinWidth, mapOpacity, mapOverflow, mapPadding, mapPointerEvents, mapPosition, mapShadow, mapSpace, mapStateStyles, mapTextAlign, mapTextColor, mapTextDecorationStyle, mapTextIndent, mapTextTransform, mapTextWrap, mapVerticalAlign, mapWhitespace, mapWidth, mapWordBreak, removeToast, resolveRender, tabsListVariants, toggleVariants, useBreakpoint, useCarousel, useComboboxAnchor, useDebounce, useInitTheme, useIsMobile, useSidebar, useTheme, useToast };
10419
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Autocomplete, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Blockquote, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, CheckboxGroup, Code, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationDialog, Container, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataCard, DataColumn, DataTable, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dots, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Flexbox, FloatingTooltip, Form, FormButtons, FormController, FormField, FormFieldArray, FormResetButton, FormSubmitButton, Grid, Heading, HoverCard, HoverCardContent, HoverCardTrigger, Icon, Image, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, List, ListItem, ListSection, ListSeparator, Loading, LoadingButton, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Meter, Navbar, NavbarItem, NavbarLink, NumberField, PALETTES, PageHeader, PageHeaderActions, PageHeaderTitle, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordField, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressCircle, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Row, ScrollArea, ScrollBar, SearchField, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, StatusLight, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TagGroup, Text, TextField, Textarea, ThemeButton, ThemeSwitcher, Toast, ToastContext, ToastProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, ToolbarGroup, ToolbarLink, ToolbarSeparator, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, ZenProvider, badgeVariants, buttonGroupVariants, buttonVariants, getCssColorValue, isHeightPreset, isMaxHeightPreset, isMaxWidthPreset, isMinHeightPreset, isMinWidthPreset, isWidthPreset, mapAlignContent, mapAlignItems, mapAlignSelf, mapBackgroundColor, mapBorder, mapBorderColor, mapBorderRadius, mapBorderWidth, mapCursor, mapDecorationColor, mapDisplay, mapFlexDirection, mapFlexWrap, mapFontSize, mapFontWeight, mapGap, mapGridAutoFlow, mapGridColumns, mapGridRows, mapHeadingSize, mapHeight, mapJustifyContent, mapJustifyItems, mapLetterSpacing, mapLineHeight, mapMargin, mapMaxHeight, mapMaxWidth, mapMinHeight, mapMinWidth, mapOpacity, mapOverflow, mapPadding, mapPointerEvents, mapPosition, mapShadow, mapSpace, mapStateStyles, mapTextAlign, mapTextColor, mapTextDecorationStyle, mapTextIndent, mapTextTransform, mapTextWrap, mapVerticalAlign, mapWhitespace, mapWidth, mapWordBreak, removeToast, resolveRender, tabsListVariants, toggleVariants, useBreakpoint, useCarousel, useComboboxAnchor, useDebounce, useHighlightedCode, useInitTheme, useIsMobile, useSidebar, useTheme, useToast };
9853
10420
  //# sourceMappingURL=index.mjs.map
9854
10421
  //# sourceMappingURL=index.mjs.map