@sustaina/shared-ui 1.9.6 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2,10 +2,10 @@ import * as AccordionPrimitive from '@radix-ui/react-accordion';
2
2
  import clsx2, { clsx } from 'clsx';
3
3
  import { twMerge } from 'tailwind-merge';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
- import * as React6 from 'react';
6
- import React6__default, { forwardRef, useRef, useMemo, useCallback, isValidElement, useState, useEffect, createElement } from 'react';
5
+ import * as React5 from 'react';
6
+ import React5__default, { forwardRef, useRef, useMemo, useCallback, isValidElement, useState, useEffect, createElement } from 'react';
7
7
  import { format, isValid, parseISO, isAfter, compareAsc, parse } from 'date-fns';
8
- import { CircleX, CircleHelp, Undo, Redo, Bold, Italic, Underline, Strikethrough, Code, Pilcrow, Heading1, Heading2, Heading3, List as List$1, ListOrdered, Quote, CodeSquare, Link, Link2Off, Image, AlignLeft, AlignCenter, AlignRight, XIcon, ChevronRight, CheckIcon, Triangle, CalendarIcon, X, Search, ChevronUp, ChevronDown, Plus, ChevronLeft, CircleUserRound, Bug, GripVertical, Info, CircleMinus, Minus } from 'lucide-react';
8
+ import { CircleX, CircleHelp, Undo, Redo, Bold, Italic, Underline, Strikethrough, Code, Pilcrow, Heading1, Heading2, Heading3, List as List$1, ListOrdered, Quote, CodeSquare, Link, Link2Off, Image, AlignLeft, AlignCenter, AlignRight, XIcon, ChevronRight, CheckIcon, Triangle, CalendarIcon, X, Search, ChevronUp, ChevronDown, Plus, ChevronLeft, CircleUserRound, PanelLeftIcon, Bug, GripVertical, Info, CircleMinus, Minus } from 'lucide-react';
9
9
  import { createPortal } from 'react-dom';
10
10
  import * as SelectPrimitive from '@radix-ui/react-select';
11
11
  import { useForm, FormProvider, Controller, useFormContext, useFormState, useFieldArray, useWatch } from 'react-hook-form';
@@ -14,8 +14,9 @@ import * as LabelPrimitive from '@radix-ui/react-label';
14
14
  import { cva } from 'class-variance-authority';
15
15
  import * as PopoverPrimitive from '@radix-ui/react-popover';
16
16
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
17
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
17
18
  import { reSplitAlphaNumeric, useReactTable, getCoreRowModel, getGroupedRowModel, getExpandedRowModel, getSortedRowModel, getFilteredRowModel, flexRender } from '@tanstack/react-table';
18
- import * as DialogPrimitive from '@radix-ui/react-dialog';
19
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
19
20
  import { zodResolver } from '@hookform/resolvers/zod';
20
21
  import { SortableContext, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable';
21
22
  import { CSS } from '@dnd-kit/utilities';
@@ -938,7 +939,7 @@ var OPERATOR_LABEL = {
938
939
  containsAll: "Contains all of"
939
940
  };
940
941
  var OperatorSelect = ({ row, operators, onChangeOperator, error }) => {
941
- React6__default.useEffect(() => {
942
+ React5__default.useEffect(() => {
942
943
  if (!operators.length) return;
943
944
  if (!operators.includes(row.operator)) {
944
945
  onChangeOperator(operators[0]);
@@ -965,7 +966,7 @@ function Label2({ className, ...props }) {
965
966
  {
966
967
  "data-slot": "label",
967
968
  className: cn(
968
- "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
969
+ "flex items-center gap-2 text-sm leading-none font-medium group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
969
970
  className
970
971
  ),
971
972
  ...props
@@ -973,15 +974,15 @@ function Label2({ className, ...props }) {
973
974
  );
974
975
  }
975
976
  var Form = FormProvider;
976
- var FormFieldContext = React6.createContext({});
977
+ var FormFieldContext = React5.createContext({});
977
978
  var FormField = ({
978
979
  ...props
979
980
  }) => {
980
981
  return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
981
982
  };
982
983
  var useFormField = () => {
983
- const fieldContext = React6.useContext(FormFieldContext);
984
- const itemContext = React6.useContext(FormItemContext);
984
+ const fieldContext = React5.useContext(FormFieldContext);
985
+ const itemContext = React5.useContext(FormItemContext);
985
986
  const { getFieldState } = useFormContext();
986
987
  const formState = useFormState({ name: fieldContext.name });
987
988
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -998,9 +999,9 @@ var useFormField = () => {
998
999
  ...fieldState
999
1000
  };
1000
1001
  };
1001
- var FormItemContext = React6.createContext({});
1002
+ var FormItemContext = React5.createContext({});
1002
1003
  function FormItem({ className, ...props }) {
1003
- const id = React6.useId();
1004
+ const id = React5.useId();
1004
1005
  return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
1005
1006
  }
1006
1007
  function FormLabel({ className, ...props }) {
@@ -1059,7 +1060,7 @@ function FormMessage({ className, ...props }) {
1059
1060
  }
1060
1061
  );
1061
1062
  }
1062
- var InputPrimitive = React6.forwardRef(
1063
+ var InputPrimitive = React5.forwardRef(
1063
1064
  ({ className, type = "text", ...props }, ref) => {
1064
1065
  return /* @__PURE__ */ jsx(
1065
1066
  "input",
@@ -1094,7 +1095,7 @@ var spinnerVariants = cva("relative inline-block aspect-square transform-gpu", {
1094
1095
  },
1095
1096
  defaultVariants: { variant: "primary", size: "default" }
1096
1097
  });
1097
- var Spinner = ({ className, variant, size = "default" }) => /* @__PURE__ */ jsxs(
1098
+ var Spinner = ({ className, variant, size = "default", ...props }) => /* @__PURE__ */ jsxs(
1098
1099
  "div",
1099
1100
  {
1100
1101
  role: "status",
@@ -1104,6 +1105,7 @@ var Spinner = ({ className, variant, size = "default" }) => /* @__PURE__ */ jsxs
1104
1105
  className
1105
1106
  ),
1106
1107
  style: typeof size === "number" ? { width: size, height: size } : void 0,
1108
+ ...props,
1107
1109
  children: [
1108
1110
  Array.from({ length: 12 }).map((_, i) => /* @__PURE__ */ jsx(
1109
1111
  "div",
@@ -1143,7 +1145,7 @@ var inputVariants = cva("", {
1143
1145
  appearance: "filled"
1144
1146
  }
1145
1147
  });
1146
- var Input = React6.forwardRef(
1148
+ var Input = React5.forwardRef(
1147
1149
  ({
1148
1150
  className,
1149
1151
  wrapperClassName,
@@ -1172,7 +1174,7 @@ var Input = React6.forwardRef(
1172
1174
  ...inputProps
1173
1175
  } = rest;
1174
1176
  const ariaInvalid = invalid ?? ariaInvalidProp;
1175
- const messageId = React6.useId();
1177
+ const messageId = React5.useId();
1176
1178
  const resolvedAriaInvalid = typeof ariaInvalid === "string" ? ariaInvalid : ariaInvalid ? true : void 0;
1177
1179
  const describedBy = validationMessage ? [ariaDescribedByProp, messageId].filter(Boolean).join(" ") : ariaDescribedByProp;
1178
1180
  const controlWrapperClassName = cn(
@@ -1356,7 +1358,7 @@ var buttonVariants = cva(
1356
1358
  secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
1357
1359
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
1358
1360
  link: "text-primary underline-offset-4 hover:underline",
1359
- cancel: "border bg-[#8B8B8B] text-black shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1361
+ cancel: "border bg-[#8B8B8B] text-accent-foreground shadow-xs hover:bg-accent hover:text-black dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1360
1362
  defaultSelect: "bg-primary text-primary-foreground shadow-xs hover:bg-sus-primary/90 py-2",
1361
1363
  defaultOutline: "border bg-background py-2 shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1362
1364
  warning: "border bg-[#f9d629] text-black shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-[#f9d629] dark:hover:bg-[#f9d629]/50"
@@ -1447,6 +1449,7 @@ var addMonths = (date, n) => {
1447
1449
  return d;
1448
1450
  };
1449
1451
  var daysInMonth = (year, monthIndex) => new Date(year, monthIndex + 1, 0).getDate();
1452
+ var DEFAULT_MONTH_FORMATTER = new Intl.DateTimeFormat("en-US", { month: "short" });
1450
1453
  function buildCalendarGrid(displayed, weekStartsOnMonday = true) {
1451
1454
  const year = displayed.getFullYear();
1452
1455
  const month = displayed.getMonth();
@@ -1487,22 +1490,20 @@ function DatePicker({
1487
1490
  className,
1488
1491
  ...props
1489
1492
  }) {
1490
- const today = React6.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
1491
- const [displayed, setDisplayed] = React6.useState(
1493
+ const today = React5.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
1494
+ const [displayed, setDisplayed] = React5.useState(
1492
1495
  selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date()
1493
1496
  );
1494
1497
  minDate = clampToDay(minDate);
1495
1498
  maxDate = clampToDay(maxDate);
1496
- const disabledSet = React6.useMemo(() => {
1499
+ const disabledSet = React5.useMemo(() => {
1497
1500
  const s = /* @__PURE__ */ new Set();
1498
1501
  disabledDates?.forEach((d) => s.add(startOfDay(d).toISOString()));
1499
1502
  return s;
1500
1503
  }, [disabledDates]);
1501
1504
  const displayYear = displayed.getFullYear();
1502
1505
  const displayMonth = displayed.getMonth();
1503
- const monthLabel = callbacks?.monthLabel?.(displayYear, displayMonth) ?? new Intl.DateTimeFormat("en-US", { month: "short" }).format(displayed);
1504
- const yearLabel = callbacks?.yearLabel?.(displayYear) ?? String(displayYear);
1505
- const weekdays = React6.useMemo(() => {
1506
+ const weekdays = React5.useMemo(() => {
1506
1507
  const labels = [];
1507
1508
  for (let i = 0; i < 7; i++) {
1508
1509
  const idx = i;
@@ -1511,7 +1512,7 @@ function DatePicker({
1511
1512
  }
1512
1513
  return labels;
1513
1514
  }, [callbacks]);
1514
- const grid = React6.useMemo(() => buildCalendarGrid(displayed, true), [displayed]);
1515
+ const grid = React5.useMemo(() => buildCalendarGrid(displayed, true), [displayed]);
1515
1516
  const isDateDisabled = (date) => {
1516
1517
  const d = startOfDay(date);
1517
1518
  if (minDate && d < minDate) return true;
@@ -1519,6 +1520,106 @@ function DatePicker({
1519
1520
  if (disabledSet.has(d.toISOString())) return true;
1520
1521
  return false;
1521
1522
  };
1523
+ const minYear = minDate?.getFullYear();
1524
+ const maxYear = maxDate?.getFullYear();
1525
+ const getMonthLabel = React5.useCallback(
1526
+ (year, monthIndex) => {
1527
+ const label = callbacks?.monthLabel?.(year, monthIndex);
1528
+ if (label === null || label === void 0) {
1529
+ return DEFAULT_MONTH_FORMATTER.format(new Date(year, monthIndex, 1));
1530
+ }
1531
+ return label;
1532
+ },
1533
+ [callbacks]
1534
+ );
1535
+ const getYearLabel = React5.useCallback(
1536
+ (year) => {
1537
+ const label = callbacks?.yearLabel?.(year);
1538
+ if (label === null || label === void 0) return String(year);
1539
+ return typeof label === "string" ? label : String(label);
1540
+ },
1541
+ [callbacks]
1542
+ );
1543
+ const clampMonthToBounds = React5.useCallback(
1544
+ (year, monthIndex) => {
1545
+ let output = monthIndex;
1546
+ if (typeof minYear === "number" && year === minYear && minDate) {
1547
+ const boundary = minDate.getMonth();
1548
+ if (output < boundary) output = boundary;
1549
+ }
1550
+ if (typeof maxYear === "number" && year === maxYear && maxDate) {
1551
+ const boundary = maxDate.getMonth();
1552
+ if (output > boundary) output = boundary;
1553
+ }
1554
+ return output;
1555
+ },
1556
+ [maxDate, minDate, maxYear, minYear]
1557
+ );
1558
+ const yearOptions = React5.useMemo(() => {
1559
+ const fallbackWindow = 50;
1560
+ const start = typeof minYear === "number" ? minYear : displayYear - fallbackWindow;
1561
+ const end = typeof maxYear === "number" ? maxYear : displayYear + fallbackWindow;
1562
+ const years = [];
1563
+ for (let year = start; year <= end; year++) {
1564
+ years.push(year);
1565
+ }
1566
+ if (!years.includes(displayYear)) {
1567
+ years.push(displayYear);
1568
+ years.sort((a, b) => a - b);
1569
+ }
1570
+ if (selectedDate) {
1571
+ const selectedYear = selectedDate.getFullYear();
1572
+ if (!years.includes(selectedYear)) {
1573
+ years.push(selectedYear);
1574
+ years.sort((a, b) => a - b);
1575
+ }
1576
+ }
1577
+ return years;
1578
+ }, [displayYear, maxYear, minYear, selectedDate]);
1579
+ const monthOptions = React5.useMemo(() => {
1580
+ const months = Array.from({ length: 12 }, (_, monthIndex) => {
1581
+ const disabled = typeof minYear === "number" && displayYear === minYear && minDate && monthIndex < minDate.getMonth() || typeof maxYear === "number" && displayYear === maxYear && maxDate && monthIndex > maxDate.getMonth();
1582
+ return {
1583
+ value: monthIndex,
1584
+ disabled,
1585
+ label: getMonthLabel(displayYear, monthIndex)
1586
+ };
1587
+ });
1588
+ const currentMonthExists = months.some((option) => option.value === displayMonth);
1589
+ if (!currentMonthExists) {
1590
+ months.push({
1591
+ value: displayMonth,
1592
+ disabled: false,
1593
+ label: getMonthLabel(displayYear, displayMonth)
1594
+ });
1595
+ }
1596
+ return months.sort((a, b) => a.value - b.value).filter((option, index, arr) => index === 0 || option.value !== arr[index - 1].value);
1597
+ }, [displayMonth, displayYear, getMonthLabel, maxDate, maxYear, minDate, minYear]);
1598
+ const handleMonthSelect = React5.useCallback((nextValue) => {
1599
+ const nextMonth = Number.parseInt(nextValue, 10);
1600
+ if (Number.isNaN(nextMonth)) return;
1601
+ setDisplayed((prev) => {
1602
+ const next = new Date(prev);
1603
+ next.setDate(1);
1604
+ next.setMonth(nextMonth);
1605
+ return next;
1606
+ });
1607
+ }, []);
1608
+ const handleYearSelect = React5.useCallback(
1609
+ (nextValue) => {
1610
+ const nextYear = Number.parseInt(nextValue, 10);
1611
+ if (Number.isNaN(nextYear)) return;
1612
+ setDisplayed((prev) => {
1613
+ const next = new Date(prev);
1614
+ next.setFullYear(nextYear);
1615
+ const adjustedMonth = clampMonthToBounds(nextYear, next.getMonth());
1616
+ next.setMonth(adjustedMonth);
1617
+ next.setDate(1);
1618
+ return next;
1619
+ });
1620
+ },
1621
+ [clampMonthToBounds]
1622
+ );
1522
1623
  return /* @__PURE__ */ jsxs("div", { className: cn("min-w-[260px] w-[300px] p-3", className), ...props, children: [
1523
1624
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1524
1625
  /* @__PURE__ */ jsx(
@@ -1536,10 +1637,46 @@ function DatePicker({
1536
1637
  children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4 opacity-70" })
1537
1638
  }
1538
1639
  ),
1539
- /* @__PURE__ */ jsxs("div", { className: "text-sm font-bold select-none", children: [
1540
- monthLabel,
1541
- " ",
1542
- yearLabel
1640
+ /* @__PURE__ */ jsxs(Select, { value: String(displayMonth), onValueChange: handleMonthSelect, children: [
1641
+ /* @__PURE__ */ jsx(
1642
+ SelectTrigger,
1643
+ {
1644
+ size: "sm",
1645
+ "aria-label": "Select month",
1646
+ className: "h-8 min-w-[110px] justify-between rounded-md border border-gray-200 bg-white px-3 text-sm font-medium text-gray-700 shadow-none focus-visible:ring-0",
1647
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder: getMonthLabel(displayYear, displayMonth) })
1648
+ }
1649
+ ),
1650
+ /* @__PURE__ */ jsx(SelectContent, { className: "max-h-64", children: monthOptions.map((option) => /* @__PURE__ */ jsx(
1651
+ SelectItem,
1652
+ {
1653
+ className: "text-center w-full",
1654
+ value: String(option.value),
1655
+ disabled: option.disabled,
1656
+ children: option.label
1657
+ },
1658
+ option.value
1659
+ )) })
1660
+ ] }),
1661
+ /* @__PURE__ */ jsxs(Select, { value: String(displayYear), onValueChange: handleYearSelect, children: [
1662
+ /* @__PURE__ */ jsx(
1663
+ SelectTrigger,
1664
+ {
1665
+ size: "sm",
1666
+ "aria-label": "Select year",
1667
+ className: "h-8 min-w-[90px] justify-between rounded-md border border-gray-200 bg-white px-3 text-sm font-medium text-gray-700 shadow-none focus-visible:ring-0",
1668
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder: getYearLabel(displayYear) })
1669
+ }
1670
+ ),
1671
+ /* @__PURE__ */ jsx(SelectContent, { className: "max-h-64", children: yearOptions.map((year) => /* @__PURE__ */ jsx(
1672
+ SelectItem,
1673
+ {
1674
+ value: String(year),
1675
+ disabled: typeof minYear === "number" && year < minYear || typeof maxYear === "number" && year > maxYear,
1676
+ children: getYearLabel(year)
1677
+ },
1678
+ year
1679
+ )) })
1543
1680
  ] }),
1544
1681
  /* @__PURE__ */ jsx(
1545
1682
  "button",
@@ -1616,14 +1753,14 @@ var DatePicker2 = ({
1616
1753
  ariaLabel,
1617
1754
  ...calendarProps
1618
1755
  }) => {
1619
- const [open, setOpen] = React6__default.useState(false);
1620
- const parser = React6__default.useMemo(() => valueParser ?? defaultValueParser, [valueParser]);
1621
- const outputFormatter = React6__default.useMemo(() => valueFormatter ?? defaultValueFormatter, [valueFormatter]);
1622
- const labelFormatter = React6__default.useMemo(
1756
+ const [open, setOpen] = React5__default.useState(false);
1757
+ const parser = React5__default.useMemo(() => valueParser ?? defaultValueParser, [valueParser]);
1758
+ const outputFormatter = React5__default.useMemo(() => valueFormatter ?? defaultValueFormatter, [valueFormatter]);
1759
+ const labelFormatter = React5__default.useMemo(
1623
1760
  () => displayFormatter ?? defaultDisplayFormatter,
1624
1761
  [displayFormatter]
1625
1762
  );
1626
- const parsedValue = React6__default.useMemo(() => {
1763
+ const parsedValue = React5__default.useMemo(() => {
1627
1764
  if (value === null || value === void 0) return void 0;
1628
1765
  if (value instanceof Date) return value;
1629
1766
  const parsed = parser(value);
@@ -1632,26 +1769,26 @@ var DatePicker2 = ({
1632
1769
  const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder3;
1633
1770
  const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change date, current selection ${labelFormatter(parsedValue)}` : "Open date picker");
1634
1771
  const shouldShowClear = allowClear && !disabled && !!parsedValue;
1635
- const handleClose = React6__default.useCallback(() => setOpen(false), []);
1636
- const emitChange = React6__default.useCallback(
1772
+ const handleClose = React5__default.useCallback(() => setOpen(false), []);
1773
+ const emitChange = React5__default.useCallback(
1637
1774
  (next) => {
1638
1775
  onChange?.(next);
1639
1776
  onValueChange?.(next ? outputFormatter(next) : void 0);
1640
1777
  },
1641
1778
  [onChange, onValueChange, outputFormatter]
1642
1779
  );
1643
- const handleSelect = React6__default.useCallback(
1780
+ const handleSelect = React5__default.useCallback(
1644
1781
  (next) => {
1645
1782
  emitChange(next);
1646
1783
  if (closeOnSelect && next) handleClose();
1647
1784
  },
1648
1785
  [closeOnSelect, emitChange, handleClose]
1649
1786
  );
1650
- const handleClear = React6__default.useCallback(() => {
1787
+ const handleClear = React5__default.useCallback(() => {
1651
1788
  emitChange(void 0);
1652
1789
  handleClose();
1653
1790
  }, [emitChange, handleClose]);
1654
- const handleOpenChange = React6__default.useCallback(
1791
+ const handleOpenChange = React5__default.useCallback(
1655
1792
  (nextOpen) => {
1656
1793
  if (disabled && nextOpen) return;
1657
1794
  setOpen(nextOpen);
@@ -1823,15 +1960,15 @@ function MonthCal({
1823
1960
  onYearBackward,
1824
1961
  onYearForward
1825
1962
  }) {
1826
- const today = React6.useMemo(() => {
1963
+ const today = React5.useMemo(() => {
1827
1964
  const now = /* @__PURE__ */ new Date();
1828
1965
  now.setDate(1);
1829
1966
  now.setHours(0, 0, 0, 0);
1830
1967
  return now;
1831
1968
  }, []);
1832
- const selectedMonthDate = React6.useMemo(() => normalizeMonth(selectedDate), [selectedDate]);
1833
- const min = React6.useMemo(() => normalizeMonth(minDate), [minDate]);
1834
- const max = React6.useMemo(() => normalizeMonth(maxDate), [maxDate]);
1969
+ const selectedMonthDate = React5.useMemo(() => normalizeMonth(selectedDate), [selectedDate]);
1970
+ const min = React5.useMemo(() => normalizeMonth(minDate), [minDate]);
1971
+ const max = React5.useMemo(() => normalizeMonth(maxDate), [maxDate]);
1835
1972
  let effectiveMin = min;
1836
1973
  if (min && max && min > max) {
1837
1974
  effectiveMin = max;
@@ -1840,10 +1977,10 @@ function MonthCal({
1840
1977
  const minMonth = effectiveMin?.getMonth();
1841
1978
  const maxYear = max?.getFullYear();
1842
1979
  const maxMonth = max?.getMonth();
1843
- const [menuYear, setMenuYear] = React6.useState(
1980
+ const [menuYear, setMenuYear] = React5.useState(
1844
1981
  () => selectedMonthDate?.getFullYear() ?? today.getFullYear()
1845
1982
  );
1846
- React6.useEffect(() => {
1983
+ React5.useEffect(() => {
1847
1984
  if (selectedMonthDate) {
1848
1985
  const year = selectedMonthDate.getFullYear();
1849
1986
  if (year !== menuYear) {
@@ -1851,7 +1988,7 @@ function MonthCal({
1851
1988
  }
1852
1989
  }
1853
1990
  }, [selectedMonthDate, menuYear]);
1854
- React6.useEffect(() => {
1991
+ React5.useEffect(() => {
1855
1992
  if (typeof minYear === "number" && menuYear < minYear) {
1856
1993
  setMenuYear(minYear);
1857
1994
  return;
@@ -1862,7 +1999,39 @@ function MonthCal({
1862
1999
  }, [minYear, maxYear, menuYear]);
1863
2000
  const disablePrevYear = typeof minYear === "number" ? menuYear <= minYear : false;
1864
2001
  const disableNextYear = typeof maxYear === "number" ? menuYear >= maxYear : false;
1865
- const disabledPairs = React6.useMemo(() => {
2002
+ const yearOptions = React5.useMemo(() => {
2003
+ const fallbackWindow = 50;
2004
+ const start = typeof minYear === "number" ? minYear : menuYear - fallbackWindow;
2005
+ const end = typeof maxYear === "number" ? maxYear : menuYear + fallbackWindow;
2006
+ const years = [];
2007
+ for (let year = start; year <= end; year++) {
2008
+ years.push(year);
2009
+ }
2010
+ if (!years.includes(menuYear)) {
2011
+ years.push(menuYear);
2012
+ years.sort((a, b) => a - b);
2013
+ }
2014
+ return years;
2015
+ }, [maxYear, menuYear, minYear]);
2016
+ const formatYearLabel = React5.useCallback(
2017
+ (year) => {
2018
+ const raw = callbacks?.yearLabel?.(year);
2019
+ if (raw === null || raw === void 0) return String(year);
2020
+ return typeof raw === "string" ? raw : String(raw);
2021
+ },
2022
+ [callbacks]
2023
+ );
2024
+ const handleYearSelect = React5.useCallback(
2025
+ (nextValue) => {
2026
+ const nextYear = Number.parseInt(nextValue, 10);
2027
+ if (Number.isNaN(nextYear)) return;
2028
+ if (typeof minYear === "number" && nextYear < minYear) return;
2029
+ if (typeof maxYear === "number" && nextYear > maxYear) return;
2030
+ setMenuYear(nextYear);
2031
+ },
2032
+ [maxYear, minYear]
2033
+ );
2034
+ const disabledPairs = React5.useMemo(() => {
1866
2035
  if (!disabledDates?.length) return [];
1867
2036
  const pairs = [];
1868
2037
  disabledDates.forEach((date) => {
@@ -1877,42 +2046,67 @@ function MonthCal({
1877
2046
  return pairs;
1878
2047
  }, [disabledDates]);
1879
2048
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1880
- /* @__PURE__ */ jsxs("div", { className: "flex justify-center pt-1 relative items-center", children: [
1881
- /* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: callbacks?.yearLabel ? callbacks.yearLabel(menuYear) : menuYear }),
1882
- /* @__PURE__ */ jsxs("div", { className: "space-x-1 flex items-center", children: [
1883
- /* @__PURE__ */ jsx(
1884
- "button",
1885
- {
1886
- onClick: () => {
1887
- if (disablePrevYear) return;
1888
- setMenuYear((prev) => prev - 1);
1889
- onYearBackward?.();
1890
- },
1891
- disabled: disablePrevYear,
1892
- className: cn(
1893
- buttonVariants({ variant: variant?.chevrons ?? "outline" }),
1894
- "inline-flex items-center justify-center h-7 w-7 p-0 absolute left-1"
1895
- ),
1896
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "opacity-50 h-4 w-4" })
1897
- }
1898
- ),
1899
- /* @__PURE__ */ jsx(
1900
- "button",
1901
- {
1902
- onClick: () => {
1903
- if (disableNextYear) return;
1904
- setMenuYear((prev) => prev + 1);
1905
- onYearForward?.();
1906
- },
1907
- disabled: disableNextYear,
1908
- className: cn(
1909
- buttonVariants({ variant: variant?.chevrons ?? "outline" }),
1910
- "inline-flex items-center justify-center h-7 w-7 p-0 absolute right-1"
2049
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2050
+ /* @__PURE__ */ jsx(
2051
+ "button",
2052
+ {
2053
+ onClick: () => {
2054
+ if (disablePrevYear) return;
2055
+ setMenuYear((prev) => prev - 1);
2056
+ onYearBackward?.();
2057
+ },
2058
+ disabled: disablePrevYear,
2059
+ className: cn(
2060
+ buttonVariants({ variant: variant?.chevrons ?? "outline" }),
2061
+ "inline-flex items-center justify-center h-7 w-7 p-0"
2062
+ ),
2063
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "opacity-50 h-4 w-4" })
2064
+ }
2065
+ ),
2066
+ /* @__PURE__ */ jsxs(
2067
+ Select,
2068
+ {
2069
+ value: String(menuYear),
2070
+ onValueChange: handleYearSelect,
2071
+ disabled: disablePrevYear && disableNextYear,
2072
+ children: [
2073
+ /* @__PURE__ */ jsx(
2074
+ SelectTrigger,
2075
+ {
2076
+ size: "sm",
2077
+ "aria-label": "Select year",
2078
+ className: "h-7 w-[100px] justify-center rounded-md border border-gray-200 bg-white px-2 text-sm font-medium text-gray-700 shadow-none focus-visible:ring-0",
2079
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder: formatYearLabel(menuYear) })
2080
+ }
1911
2081
  ),
1912
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "opacity-50 h-4 w-4" })
1913
- }
1914
- )
1915
- ] })
2082
+ /* @__PURE__ */ jsx(SelectContent, { className: "max-h-64", children: yearOptions.map((year) => /* @__PURE__ */ jsx(
2083
+ SelectItem,
2084
+ {
2085
+ value: String(year),
2086
+ disabled: typeof minYear === "number" && year < minYear || typeof maxYear === "number" && year > maxYear,
2087
+ children: formatYearLabel(year)
2088
+ },
2089
+ year
2090
+ )) })
2091
+ ]
2092
+ }
2093
+ ),
2094
+ /* @__PURE__ */ jsx(
2095
+ "button",
2096
+ {
2097
+ onClick: () => {
2098
+ if (disableNextYear) return;
2099
+ setMenuYear((prev) => prev + 1);
2100
+ onYearForward?.();
2101
+ },
2102
+ disabled: disableNextYear,
2103
+ className: cn(
2104
+ buttonVariants({ variant: variant?.chevrons ?? "outline" }),
2105
+ "inline-flex items-center justify-center h-7 w-7 p-0"
2106
+ ),
2107
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "opacity-50 h-4 w-4" })
2108
+ }
2109
+ )
1916
2110
  ] }),
1917
2111
  /* @__PURE__ */ jsx("table", { className: "w-full border-collapse space-y-1", children: /* @__PURE__ */ jsx("tbody", { children: MONTHS.map((row, rowIndex) => /* @__PURE__ */ jsx("tr", { className: "flex w-full mt-2 gap-2", children: row.map((m) => {
1918
2112
  const afterMax = maxMonth !== void 0 && maxYear !== void 0 ? menuYear > maxYear || menuYear === maxYear && m.number > maxMonth : false;
@@ -1982,14 +2176,14 @@ var MonthPicker2 = ({
1982
2176
  ariaLabel,
1983
2177
  ...calendarProps
1984
2178
  }) => {
1985
- const [open, setOpen] = React6__default.useState(false);
1986
- const parser = React6__default.useMemo(() => valueParser ?? defaultValueParser2, [valueParser]);
1987
- const outputFormatter = React6__default.useMemo(() => valueFormatter ?? defaultValueFormatter2, [valueFormatter]);
1988
- const labelFormatter = React6__default.useMemo(
2179
+ const [open, setOpen] = React5__default.useState(false);
2180
+ const parser = React5__default.useMemo(() => valueParser ?? defaultValueParser2, [valueParser]);
2181
+ const outputFormatter = React5__default.useMemo(() => valueFormatter ?? defaultValueFormatter2, [valueFormatter]);
2182
+ const labelFormatter = React5__default.useMemo(
1989
2183
  () => displayFormatter ?? defaultDisplayFormatter2,
1990
2184
  [displayFormatter]
1991
2185
  );
1992
- const parsedValue = React6__default.useMemo(() => {
2186
+ const parsedValue = React5__default.useMemo(() => {
1993
2187
  if (value === null || value === void 0) return void 0;
1994
2188
  if (value instanceof Date) return normalizeMonth2(value);
1995
2189
  if (typeof value === "string") {
@@ -2001,8 +2195,8 @@ var MonthPicker2 = ({
2001
2195
  const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder3;
2002
2196
  const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change month, current selection ${labelFormatter(parsedValue)}` : "Open month picker");
2003
2197
  const shouldShowClear = allowClear && !disabled && !!parsedValue;
2004
- const handleClose = React6__default.useCallback(() => setOpen(false), []);
2005
- const emitChange = React6__default.useCallback(
2198
+ const handleClose = React5__default.useCallback(() => setOpen(false), []);
2199
+ const emitChange = React5__default.useCallback(
2006
2200
  (next) => {
2007
2201
  const normalized = next ? normalizeMonth2(next) : void 0;
2008
2202
  onChange?.(normalized);
@@ -2010,18 +2204,18 @@ var MonthPicker2 = ({
2010
2204
  },
2011
2205
  [onChange, onValueChange, outputFormatter]
2012
2206
  );
2013
- const handleSelect = React6__default.useCallback(
2207
+ const handleSelect = React5__default.useCallback(
2014
2208
  (next) => {
2015
2209
  emitChange(next);
2016
2210
  if (closeOnSelect && next) handleClose();
2017
2211
  },
2018
2212
  [closeOnSelect, emitChange, handleClose]
2019
2213
  );
2020
- const handleClear = React6__default.useCallback(() => {
2214
+ const handleClear = React5__default.useCallback(() => {
2021
2215
  emitChange(void 0);
2022
2216
  handleClose();
2023
2217
  }, [emitChange, handleClose]);
2024
- const handleOpenChange = React6__default.useCallback(
2218
+ const handleOpenChange = React5__default.useCallback(
2025
2219
  (nextOpen) => {
2026
2220
  if (disabled && nextOpen) return;
2027
2221
  setOpen(nextOpen);
@@ -3081,7 +3275,7 @@ var AdvanceSearch = ({
3081
3275
  defaultValues: {}
3082
3276
  });
3083
3277
  const { handleSubmit, unregister, resetField, getValues, clearErrors, setError } = form;
3084
- const [operatorErrors, setOperatorErrors] = React6__default.useState({});
3278
+ const [operatorErrors, setOperatorErrors] = React5__default.useState({});
3085
3279
  const clearOperatorError = useCallback(
3086
3280
  (rowId) => {
3087
3281
  setOperatorErrors((prev) => {
@@ -3270,6 +3464,19 @@ function Checkbox({ className, ...props }) {
3270
3464
  }
3271
3465
  );
3272
3466
  }
3467
+ function Collapsible({ ...props }) {
3468
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
3469
+ }
3470
+ function CollapsibleTrigger2({
3471
+ ...props
3472
+ }) {
3473
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
3474
+ }
3475
+ function CollapsibleContent2({
3476
+ ...props
3477
+ }) {
3478
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props });
3479
+ }
3273
3480
  function compareAlphanumeric(aStr, bStr) {
3274
3481
  const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);
3275
3482
  const b = bStr.split(reSplitAlphaNumeric).filter(Boolean);
@@ -3659,7 +3866,7 @@ var ColumnSeparator = ({ show, className, ...props }) => {
3659
3866
  }
3660
3867
  );
3661
3868
  };
3662
- var ColumnSeparator_default = React6__default.memo(ColumnSeparator);
3869
+ var ColumnSeparator_default = React5__default.memo(ColumnSeparator);
3663
3870
  var StatusContentSlot = ({
3664
3871
  content,
3665
3872
  icon,
@@ -3678,7 +3885,7 @@ var StatusContentSlot = ({
3678
3885
  content
3679
3886
  ] });
3680
3887
  };
3681
- var StatusContentSlot_default = React6__default.memo(StatusContentSlot);
3888
+ var StatusContentSlot_default = React5__default.memo(StatusContentSlot);
3682
3889
  var stateOptions = [
3683
3890
  "columnFilters",
3684
3891
  "globalFilter",
@@ -4091,7 +4298,8 @@ var DataTable = ({
4091
4298
  icon: statusContent?.initialLoading?.icon,
4092
4299
  wrapperProps: statusContent?.initialLoading?.wrapperProps,
4093
4300
  defaultWrapperProps: {
4094
- className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2"
4301
+ className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2",
4302
+ ["data-testid"]: "status-content-initial-loading"
4095
4303
  },
4096
4304
  defaultIcon: /* @__PURE__ */ jsx(Spinner, { size: 48 })
4097
4305
  }
@@ -4102,7 +4310,8 @@ var DataTable = ({
4102
4310
  icon: statusContent?.emptyData?.icon,
4103
4311
  wrapperProps: statusContent?.emptyData?.wrapperProps,
4104
4312
  defaultWrapperProps: {
4105
- className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2"
4313
+ className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2",
4314
+ ["data-testid"]: "status-content-empty-data"
4106
4315
  },
4107
4316
  defaultIcon: /* @__PURE__ */ jsx(empty_data_default, { className: "text-[128px]" })
4108
4317
  }
@@ -4127,6 +4336,7 @@ var DataTable = ({
4127
4336
  return /* @__PURE__ */ jsxs(
4128
4337
  TableHead,
4129
4338
  {
4339
+ "data-testid": `table-head-${header.id}`,
4130
4340
  colSpan: header.colSpan,
4131
4341
  ...tableHeadCellProps,
4132
4342
  ...header.column.columnDef?.meta?.headerProps,
@@ -4160,13 +4370,14 @@ var DataTable = ({
4160
4370
  );
4161
4371
  }) }, headerGroup.id);
4162
4372
  }),
4163
- isSomeColumnsFilterable && /* @__PURE__ */ jsx(TableRow, { children: filterableColumns.map((column) => {
4373
+ isSomeColumnsFilterable && /* @__PURE__ */ jsx(TableRow, { "data-testid": "table-filter-row", children: filterableColumns.map((column) => {
4164
4374
  const { classes, style } = getColumnPinningStyles(column);
4165
4375
  const useColumnSizing = column.columnDef.meta?.useColumnSizing ?? columnResizing?.enabled ?? false;
4166
4376
  const tableFilterCellProps = typeof components?.tableFilterCellProps === "function" ? components?.tableFilterCellProps({ column, table }) : components?.tableFilterCellProps;
4167
4377
  return /* @__PURE__ */ jsx(
4168
4378
  TableCell,
4169
4379
  {
4380
+ "data-testid": `table-filter-cell-${column.id}`,
4170
4381
  ...tableFilterCellProps,
4171
4382
  ...column.columnDef?.meta?.filterCellProps,
4172
4383
  className: cn(
@@ -4199,6 +4410,7 @@ var DataTable = ({
4199
4410
  return /* @__PURE__ */ createElement(
4200
4411
  TableRow,
4201
4412
  {
4413
+ "data-testid": `table-data-row-${row.id}`,
4202
4414
  ...tableDataRowProps,
4203
4415
  key: row.id,
4204
4416
  className: cn("group", tableDataRowProps?.className),
@@ -4217,6 +4429,9 @@ var DataTable = ({
4217
4429
  return /* @__PURE__ */ jsx(
4218
4430
  TableCell,
4219
4431
  {
4432
+ "data-testid": `table-data-cell-${cell.id}`,
4433
+ "data-row-id": row.id,
4434
+ "data-column-id": cell.column.id,
4220
4435
  ...tableDataCellProps,
4221
4436
  ...cell.column.columnDef?.meta?.cellProps,
4222
4437
  className: cn(
@@ -4251,7 +4466,8 @@ var DataTable = ({
4251
4466
  icon: statusContent?.emptyFilteredData?.icon,
4252
4467
  wrapperProps: statusContent?.emptyFilteredData?.wrapperProps,
4253
4468
  defaultWrapperProps: {
4254
- className: "flex flex-col h-[calc(100%-76px)] items-center justify-center text-sm py-4 gap-2"
4469
+ className: "flex flex-col h-[calc(100%-76px)] items-center justify-center text-sm py-4 gap-2",
4470
+ ["data-testid"]: "status-content-empty-filtered-data"
4255
4471
  },
4256
4472
  defaultIcon: /* @__PURE__ */ jsx(empty_data_default, { className: "text-[128px]" })
4257
4473
  }
@@ -4262,7 +4478,8 @@ var DataTable = ({
4262
4478
  content: statusContent?.fetchingMore?.content ?? "Loading more...",
4263
4479
  wrapperProps: statusContent?.fetchingMore?.wrapperProps,
4264
4480
  defaultWrapperProps: {
4265
- className: "flex flex-col items-center justify-center text-sm py-4 gap-2"
4481
+ className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
4482
+ ["data-testid"]: "status-content-fetching-more"
4266
4483
  }
4267
4484
  }
4268
4485
  ),
@@ -4273,7 +4490,8 @@ var DataTable = ({
4273
4490
  icon: statusContent?.noMoreData?.icon,
4274
4491
  wrapperProps: statusContent?.noMoreData?.wrapperProps,
4275
4492
  defaultWrapperProps: {
4276
- className: "flex flex-col items-center justify-center text-sm py-4 gap-2"
4493
+ className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
4494
+ ["data-testid"]: "status-content-no-more-data"
4277
4495
  }
4278
4496
  }
4279
4497
  )
@@ -4285,17 +4503,17 @@ var DataTable = ({
4285
4503
  };
4286
4504
  var DataTable_default = DataTable;
4287
4505
  function Dialog(props) {
4288
- return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
4506
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "dialog", ...props });
4289
4507
  }
4290
4508
  function DialogTrigger(props) {
4291
- return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
4509
+ return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
4292
4510
  }
4293
4511
  function DialogPortal(props) {
4294
- return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
4512
+ return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
4295
4513
  }
4296
4514
  function DialogOverlay({ className, ...props }) {
4297
4515
  return /* @__PURE__ */ jsx(
4298
- DialogPrimitive.Overlay,
4516
+ SheetPrimitive.Overlay,
4299
4517
  {
4300
4518
  "data-slot": "dialog-overlay",
4301
4519
  className: cn(
@@ -4319,7 +4537,7 @@ function DialogHeader({ className, children, ...props }) {
4319
4537
  children: [
4320
4538
  /* @__PURE__ */ jsx("div", { className: "text-lg font-semibold", children }),
4321
4539
  /* @__PURE__ */ jsxs(
4322
- DialogPrimitive.Close,
4540
+ SheetPrimitive.Close,
4323
4541
  {
4324
4542
  "data-slot": "dialog-close",
4325
4543
  className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
@@ -4343,7 +4561,7 @@ function DialogContent({
4343
4561
  return /* @__PURE__ */ jsxs(DialogPortal, { children: [
4344
4562
  showOverlay && /* @__PURE__ */ jsx(DialogOverlay, {}),
4345
4563
  /* @__PURE__ */ jsxs(
4346
- DialogPrimitive.Content,
4564
+ SheetPrimitive.Content,
4347
4565
  {
4348
4566
  "data-slot": "dialog-content",
4349
4567
  className: cn(
@@ -4374,7 +4592,7 @@ function DialogFooter({ className, ...props }) {
4374
4592
  }
4375
4593
  function DialogTitle({ className, ...props }) {
4376
4594
  return /* @__PURE__ */ jsx(
4377
- DialogPrimitive.Title,
4595
+ SheetPrimitive.Title,
4378
4596
  {
4379
4597
  "data-slot": "dialog-title",
4380
4598
  className: cn("text-lg font-semibold leading-none", className),
@@ -4387,7 +4605,7 @@ function DialogDescription({
4387
4605
  ...props
4388
4606
  }) {
4389
4607
  return /* @__PURE__ */ jsx(
4390
- DialogPrimitive.Description,
4608
+ SheetPrimitive.Description,
4391
4609
  {
4392
4610
  "data-slot": "dialog-description",
4393
4611
  className: cn("text-sm text-muted-foreground", className),
@@ -4399,14 +4617,14 @@ function cn2(...inputs) {
4399
4617
  return twMerge(clsx(inputs));
4400
4618
  }
4401
4619
  function Dialog2({ ...props }) {
4402
- return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
4620
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "dialog", ...props });
4403
4621
  }
4404
4622
  function DialogPortal2({ ...props }) {
4405
- return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
4623
+ return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
4406
4624
  }
4407
4625
  function DialogOverlay2({ className, ...props }) {
4408
4626
  return /* @__PURE__ */ jsx(
4409
- DialogPrimitive.Overlay,
4627
+ SheetPrimitive.Overlay,
4410
4628
  {
4411
4629
  "data-slot": "dialog-overlay",
4412
4630
  className: cn2(
@@ -4426,7 +4644,7 @@ function DialogContent2({
4426
4644
  return /* @__PURE__ */ jsxs(DialogPortal2, { "data-slot": "dialog-portal", children: [
4427
4645
  /* @__PURE__ */ jsx(DialogOverlay2, {}),
4428
4646
  /* @__PURE__ */ jsxs(
4429
- DialogPrimitive.Content,
4647
+ SheetPrimitive.Content,
4430
4648
  {
4431
4649
  "data-slot": "dialog-content",
4432
4650
  className: cn2(
@@ -4437,7 +4655,7 @@ function DialogContent2({
4437
4655
  children: [
4438
4656
  children,
4439
4657
  showCloseButton && /* @__PURE__ */ jsxs(
4440
- DialogPrimitive.Close,
4658
+ SheetPrimitive.Close,
4441
4659
  {
4442
4660
  "data-slot": "dialog-close",
4443
4661
  className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
@@ -4464,7 +4682,7 @@ function DialogHeader2({ className, ...props }) {
4464
4682
  }
4465
4683
  function DialogTitle2({ className, ...props }) {
4466
4684
  return /* @__PURE__ */ jsx(
4467
- DialogPrimitive.Title,
4685
+ SheetPrimitive.Title,
4468
4686
  {
4469
4687
  "data-slot": "dialog-title",
4470
4688
  className: cn2("text-lg leading-none font-semibold", className),
@@ -4477,7 +4695,7 @@ function DialogDescription2({
4477
4695
  ...props
4478
4696
  }) {
4479
4697
  return /* @__PURE__ */ jsx(
4480
- DialogPrimitive.Description,
4698
+ SheetPrimitive.Description,
4481
4699
  {
4482
4700
  "data-slot": "dialog-description",
4483
4701
  className: cn2("text-muted-foreground text-sm", className),
@@ -4640,9 +4858,9 @@ function SortableRow({
4640
4858
  }) {
4641
4859
  const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
4642
4860
  id: value,
4643
- disabled: name == "columns.0.id"
4861
+ disabled: name === "columns.0.id"
4644
4862
  });
4645
- const style = React6.useMemo(
4863
+ const style = React5.useMemo(
4646
4864
  () => ({
4647
4865
  transform: CSS.Transform.toString(transform),
4648
4866
  transition
@@ -4650,7 +4868,10 @@ function SortableRow({
4650
4868
  [transform, transition]
4651
4869
  );
4652
4870
  const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
4653
- const currentFormColumns = useWatch({ control, name: "columns" });
4871
+ const currentFormColumns = useWatch({
4872
+ control,
4873
+ name: "columns"
4874
+ });
4654
4875
  return /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, className: "flex items-center rounded-md bg-white", children: /* @__PURE__ */ jsx(
4655
4876
  FormField,
4656
4877
  {
@@ -4667,7 +4888,7 @@ function SortableRow({
4667
4888
  ...listeners,
4668
4889
  className: cn(
4669
4890
  "h-5 w-5 text-[#B9B9B9] focus:outline-none cursor-grab",
4670
- name == "columns.0.id" && "opacity-0 pointer-events-none"
4891
+ name === "columns.0.id" && "opacity-0 pointer-events-none"
4671
4892
  )
4672
4893
  }
4673
4894
  ),
@@ -4676,27 +4897,26 @@ function SortableRow({
4676
4897
  {
4677
4898
  value: field.value,
4678
4899
  onValueChange: field.onChange,
4679
- disabled: name == "columns.0.id",
4900
+ disabled: name === "columns.0.id",
4680
4901
  children: [
4681
4902
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
4682
4903
  SelectTrigger,
4683
4904
  {
4684
4905
  className: cn(
4685
4906
  "w-full border-[#DDDDDD] data-[disabled]:opacity-100 aria-invalid:border-[#BB0B0E]",
4686
- name == "columns.0.id" ? "text-[#8B8B8B] bg-[#EAEAEA] cursor-not-allowed" : ""
4907
+ name === "columns.0.id" ? "text-[#8B8B8B] bg-[#EAEAEA] cursor-not-allowed" : "cursor-pointer"
4687
4908
  ),
4688
4909
  children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Choose column..." })
4689
4910
  }
4690
4911
  ) }),
4691
- /* @__PURE__ */ jsx(SelectContent, { children: options.sort(
4912
+ /* @__PURE__ */ jsx(SelectContent, { className: "cursor-pointer overflow-hidden rounded-md [&_[data-radix-select-viewport]]:m-0", children: options.sort(
4692
4913
  (a, b) => a.id === field.value ? -1 : b.id === field.value ? 1 : 0
4693
4914
  ).map((opt) => /* @__PURE__ */ jsx(
4694
4915
  SelectItem,
4695
4916
  {
4696
4917
  value: opt.id,
4697
- hideCheckIcon: true,
4698
4918
  className: cn(
4699
- "focus:bg-[#e8edea]",
4919
+ "cursor-pointer focus:bg-[#e8edea] first:rounded-t-md last:rounded-b-md hover:text-inherit",
4700
4920
  opt.id === field.value ? "font-bold bg-[#dae5de] focus:bg-[#dae5de]" : ""
4701
4921
  ),
4702
4922
  children: opt.label
@@ -4706,7 +4926,7 @@ function SortableRow({
4706
4926
  ]
4707
4927
  }
4708
4928
  ),
4709
- name == "columns.0.id" ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
4929
+ name === "columns.0.id" ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
4710
4930
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Info, { className: "h-5 w-5", stroke: "white", fill: "#8B8B8B" }) }),
4711
4931
  /* @__PURE__ */ jsx(
4712
4932
  TooltipContent,
@@ -4714,7 +4934,6 @@ function SortableRow({
4714
4934
  align: "start",
4715
4935
  alignOffset: 10,
4716
4936
  className: "bg-[#8B8B8B] rounded-none",
4717
- arrowClassName: "!hidden",
4718
4937
  children: /* @__PURE__ */ jsx("p", { children: "Column cannot be removed." })
4719
4938
  }
4720
4939
  )
@@ -4754,6 +4973,7 @@ var GridSettingsModal = ({
4754
4973
  onSaveColumns
4755
4974
  }) => {
4756
4975
  const [isDragging, setIsDragging] = useState(false);
4976
+ const scrollRef = useRef(null);
4757
4977
  const form = useForm({
4758
4978
  resolver: zodResolver(GridSettingsSchema),
4759
4979
  defaultValues: { columns: currentColumns },
@@ -4774,6 +4994,15 @@ var GridSettingsModal = ({
4774
4994
  const isValid5 = await trigger("columns");
4775
4995
  if (isValid5) {
4776
4996
  append({ id: "" });
4997
+ requestAnimationFrame(() => {
4998
+ const container = scrollRef.current;
4999
+ if (container) {
5000
+ container.scrollTo({
5001
+ top: container.scrollHeight,
5002
+ behavior: "smooth"
5003
+ });
5004
+ }
5005
+ });
4777
5006
  } else {
4778
5007
  return;
4779
5008
  }
@@ -4798,8 +5027,8 @@ var GridSettingsModal = ({
4798
5027
  move(oldIndex, newIndex);
4799
5028
  }
4800
5029
  }
4801
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-xl border-0 p-0 overflow-hidden", children: [
4802
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
5030
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsx(DialogContent, { className: "sm:max-w-xl border-0 p-0 rounded-lg", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-h-[500px] rounded-lg overflow-hidden", children: [
5031
+ /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0", children: [
4803
5032
  /* @__PURE__ */ jsxs(
4804
5033
  "div",
4805
5034
  {
@@ -4815,7 +5044,7 @@ var GridSettingsModal = ({
4815
5044
  type: "button",
4816
5045
  "aria-label": "Close",
4817
5046
  onClick: onClose,
4818
- className: "flex items-center justify-center rounded-md hover:bg-white/10 transition",
5047
+ className: "flex items-center justify-center rounded-md hover:bg-white/10 transition cursor-pointer",
4819
5048
  children: /* @__PURE__ */ jsx(X, { className: "h-6 w-6 text-white" })
4820
5049
  }
4821
5050
  )
@@ -4833,85 +5062,96 @@ var GridSettingsModal = ({
4833
5062
  }
4834
5063
  )
4835
5064
  ] }),
4836
- /* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "mt-6 flex flex-col justify-between", children: [
4837
- /* @__PURE__ */ jsx("div", { className: "px-16 my-10", children: /* @__PURE__ */ jsxs("div", { className: "space-y-3 max-h-60 pr-4", children: [
4838
- /* @__PURE__ */ jsx(
4839
- SortableRow,
4840
- {
4841
- value: fields[0]?.fieldId,
4842
- control,
4843
- name: `columns.0.id`,
4844
- isDragging,
4845
- availableColumns
4846
- },
4847
- fields[0]?.fieldId
4848
- ),
4849
- /* @__PURE__ */ jsx("div", { className: "space-y-3", children: /* @__PURE__ */ jsx(
4850
- DndContext,
4851
- {
4852
- sensors,
4853
- collisionDetection: closestCenter,
4854
- modifiers: [restrictToParentElement, restrictToVerticalAxis],
4855
- onDragStart: () => setIsDragging(true),
4856
- onDragEnd: (event) => {
4857
- setIsDragging(false);
4858
- handleDragEnd(event);
4859
- },
4860
- children: /* @__PURE__ */ jsx(
4861
- SortableContext,
5065
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col flex-1 px-12 my-10 overflow-hidden", children: /* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col flex-1", children: [
5066
+ /* @__PURE__ */ jsx(
5067
+ "div",
5068
+ {
5069
+ ref: scrollRef,
5070
+ className: "flex-1 overflow-y-auto overflow-x-hidden max-h-[35vh] [scrollbar-gutter:stable_both-edges]",
5071
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-3 px-6", children: [
5072
+ /* @__PURE__ */ jsx("div", { className: "[&_button:not([disabled])]:cursor-pointer", children: /* @__PURE__ */ jsx(
5073
+ SortableRow,
5074
+ {
5075
+ value: fields[0]?.fieldId,
5076
+ control,
5077
+ name: `columns.0.id`,
5078
+ isDragging,
5079
+ availableColumns
5080
+ },
5081
+ fields[0]?.fieldId
5082
+ ) }),
5083
+ /* @__PURE__ */ jsx("div", { className: "space-y-3 [&_button:not([disabled])]:cursor-pointer", children: /* @__PURE__ */ jsx(
5084
+ DndContext,
4862
5085
  {
4863
- items: fields?.slice(1).map((c) => c?.fieldId),
4864
- strategy: verticalListSortingStrategy,
4865
- children: fields?.slice(1).map((col, index) => /* @__PURE__ */ jsx(
4866
- SortableRow,
5086
+ sensors,
5087
+ collisionDetection: closestCenter,
5088
+ modifiers: [restrictToParentElement, restrictToVerticalAxis],
5089
+ onDragStart: () => setIsDragging(true),
5090
+ onDragEnd: (event) => {
5091
+ setIsDragging(false);
5092
+ handleDragEnd(event);
5093
+ },
5094
+ children: /* @__PURE__ */ jsx(
5095
+ SortableContext,
4867
5096
  {
4868
- value: col?.fieldId,
4869
- control,
4870
- name: `columns.${index + 1}.id`,
4871
- isDragging,
4872
- availableColumns,
4873
- onRemove: () => remove(index + 1)
4874
- },
4875
- col?.fieldId
4876
- ))
5097
+ items: fields?.slice(1).map((c) => c?.fieldId),
5098
+ strategy: verticalListSortingStrategy,
5099
+ children: fields?.slice(1).map((col, index) => /* @__PURE__ */ jsx(
5100
+ SortableRow,
5101
+ {
5102
+ value: col?.fieldId,
5103
+ control,
5104
+ name: `columns.${index + 1}.id`,
5105
+ isDragging,
5106
+ availableColumns,
5107
+ onRemove: () => remove(index + 1)
5108
+ },
5109
+ col?.fieldId
5110
+ ))
5111
+ }
5112
+ )
4877
5113
  }
4878
- )
4879
- }
4880
- ) }),
4881
- /* @__PURE__ */ jsx("div", { className: "px-6", children: /* @__PURE__ */ jsxs(
4882
- Button,
4883
- {
4884
- type: "button",
4885
- className: cn("bg-[#49865d] text-white w-full rounded-t-lg", addButtonClassname),
4886
- onClick: addColumn,
4887
- disabled: fields.length >= limit,
4888
- children: [
4889
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
4890
- " Add column"
4891
- ]
4892
- }
4893
- ) })
4894
- ] }) }),
4895
- /* @__PURE__ */ jsx(DialogFooter, { className: "-mx-6 mt-6 px-6", children: /* @__PURE__ */ jsxs("div", { className: "flex px-4 justify-between w-full", children: [
4896
- /* @__PURE__ */ jsx(
4897
- Button,
4898
- {
4899
- type: "button",
4900
- variant: "outline",
4901
- onClick: onClose,
4902
- className: "w-18 text-[#8B8B8B] border-[#B9B9B9]",
4903
- children: "Cancel"
4904
- }
4905
- ),
4906
- /* @__PURE__ */ jsx(
4907
- Button,
4908
- {
4909
- type: "submit",
4910
- className: cn("w-18 bg-[#379A2A] text-white", saveButtonClassname),
4911
- children: "Save"
4912
- }
4913
- )
4914
- ] }) })
5114
+ ) })
5115
+ ] })
5116
+ }
5117
+ ),
5118
+ /* @__PURE__ */ jsx("div", { className: "sticky bottom-0 z-20 flex justify-center bg-white pt-3", children: /* @__PURE__ */ jsxs(
5119
+ Button,
5120
+ {
5121
+ type: "button",
5122
+ className: cn(
5123
+ "bg-[#49865d] hover:bg-[#326446] text-white w-[350px] rounded-t-lg transition-colors",
5124
+ addButtonClassname
5125
+ ),
5126
+ onClick: addColumn,
5127
+ disabled: fields.length >= limit,
5128
+ children: [
5129
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
5130
+ " Add column"
5131
+ ]
5132
+ }
5133
+ ) })
5134
+ ] }) }) }),
5135
+ /* @__PURE__ */ jsx(DialogFooter, { className: "bottom-0 border-t bg-white", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2 px-4 justify-end w-full", children: [
5136
+ /* @__PURE__ */ jsx(
5137
+ Button,
5138
+ {
5139
+ type: "button",
5140
+ variant: "outline",
5141
+ onClick: onClose,
5142
+ className: "w-18 text-[#8B8B8B] border-[#B9B9B9]",
5143
+ children: "Cancel"
5144
+ }
5145
+ ),
5146
+ /* @__PURE__ */ jsx(
5147
+ Button,
5148
+ {
5149
+ type: "submit",
5150
+ className: cn("w-18 bg-[#379A2A] hover:bg-[#2f8524] text-white", saveButtonClassname),
5151
+ onClick: form.handleSubmit(onSubmit),
5152
+ children: "Save"
5153
+ }
5154
+ )
4915
5155
  ] }) })
4916
5156
  ] }) }) });
4917
5157
  };
@@ -4962,7 +5202,7 @@ var useGridSettingsStore = create(
4962
5202
  );
4963
5203
  var useGridSettingsStore_default = useGridSettingsStore;
4964
5204
  var ListTable = ({ onTableReady, children }) => {
4965
- React6.useEffect(() => {
5205
+ React5.useEffect(() => {
4966
5206
  if (onTableReady) {
4967
5207
  onTableReady({ ready: true });
4968
5208
  }
@@ -5085,7 +5325,7 @@ var InfoIcon = (props) => {
5085
5325
  }
5086
5326
  );
5087
5327
  };
5088
- var InfoIcon_default = React6__default.memo(InfoIcon);
5328
+ var InfoIcon_default = React5__default.memo(InfoIcon);
5089
5329
  var Navbar = ({
5090
5330
  className,
5091
5331
  title,
@@ -5216,7 +5456,100 @@ var Navbar = ({
5216
5456
  }
5217
5457
  );
5218
5458
  };
5219
- var navbar_default = React6__default.memo(Navbar);
5459
+ var navbar_default = React5__default.memo(Navbar);
5460
+ function Sheet({ ...props }) {
5461
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
5462
+ }
5463
+ function SheetTrigger({ ...props }) {
5464
+ return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
5465
+ }
5466
+ function SheetClose({ ...props }) {
5467
+ return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
5468
+ }
5469
+ function SheetPortal({ ...props }) {
5470
+ return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
5471
+ }
5472
+ function SheetOverlay({ className, ...props }) {
5473
+ return /* @__PURE__ */ jsx(
5474
+ SheetPrimitive.Overlay,
5475
+ {
5476
+ "data-slot": "sheet-overlay",
5477
+ className: cn(
5478
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
5479
+ className
5480
+ ),
5481
+ ...props
5482
+ }
5483
+ );
5484
+ }
5485
+ function SheetContent({
5486
+ className,
5487
+ children,
5488
+ side = "right",
5489
+ ...props
5490
+ }) {
5491
+ return /* @__PURE__ */ jsxs(SheetPortal, { children: [
5492
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
5493
+ /* @__PURE__ */ jsxs(
5494
+ SheetPrimitive.Content,
5495
+ {
5496
+ "data-slot": "sheet-content",
5497
+ className: cn(
5498
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
5499
+ side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
5500
+ side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
5501
+ side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
5502
+ side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
5503
+ className
5504
+ ),
5505
+ ...props,
5506
+ children: [
5507
+ children,
5508
+ /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
5509
+ /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
5510
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
5511
+ ] })
5512
+ ]
5513
+ }
5514
+ )
5515
+ ] });
5516
+ }
5517
+ function SheetHeader({ className, ...props }) {
5518
+ return /* @__PURE__ */ jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5 p-4", className), ...props });
5519
+ }
5520
+ function SheetFooter({ className, ...props }) {
5521
+ return /* @__PURE__ */ jsx(
5522
+ "div",
5523
+ {
5524
+ "data-slot": "sheet-footer",
5525
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
5526
+ ...props
5527
+ }
5528
+ );
5529
+ }
5530
+ function SheetTitle({ className, ...props }) {
5531
+ return /* @__PURE__ */ jsx(
5532
+ SheetPrimitive.Title,
5533
+ {
5534
+ "data-slot": "sheet-title",
5535
+ className: cn("text-foreground font-semibold", className),
5536
+ ...props
5537
+ }
5538
+ );
5539
+ }
5540
+ function SheetDescription({
5541
+ className,
5542
+ ...props
5543
+ }) {
5544
+ return /* @__PURE__ */ jsx(
5545
+ SheetPrimitive.Description,
5546
+ {
5547
+ "data-slot": "sheet-description",
5548
+ className: cn("text-muted-foreground text-sm", className),
5549
+ ...props
5550
+ }
5551
+ );
5552
+ }
5220
5553
  var usePreventPageLeaveStore = create((set) => ({
5221
5554
  isPreventing: false,
5222
5555
  setPreventing: (value) => set({ isPreventing: value })
@@ -5728,7 +6061,7 @@ function ToolbarPlugin({
5728
6061
  isLink: hasLink
5729
6062
  }));
5730
6063
  }, []);
5731
- React6.useEffect(() => {
6064
+ React5.useEffect(() => {
5732
6065
  return mergeRegister(
5733
6066
  editor.registerCommand(
5734
6067
  CAN_UNDO_COMMAND,
@@ -6314,7 +6647,7 @@ function ControlledValuePlugin({
6314
6647
  trackAppliedValue
6315
6648
  }) {
6316
6649
  const [editor] = useLexicalComposerContext();
6317
- React6.useEffect(() => {
6650
+ React5.useEffect(() => {
6318
6651
  if (value == null || trackAppliedValue.current === value) {
6319
6652
  return;
6320
6653
  }
@@ -6338,14 +6671,14 @@ function ControlledValuePlugin({
6338
6671
  }
6339
6672
  function EditableStatePlugin({ editable }) {
6340
6673
  const [editor] = useLexicalComposerContext();
6341
- React6.useEffect(() => {
6674
+ React5.useEffect(() => {
6342
6675
  editor.setEditable(editable);
6343
6676
  }, [editor, editable]);
6344
6677
  return null;
6345
6678
  }
6346
6679
  function ImagesPlugin() {
6347
6680
  const [editor] = useLexicalComposerContext();
6348
- React6.useEffect(() => {
6681
+ React5.useEffect(() => {
6349
6682
  return editor.registerCommand(
6350
6683
  INSERT_IMAGE_COMMAND,
6351
6684
  (payload) => {
@@ -6496,47 +6829,34 @@ function Separator2({
6496
6829
  }
6497
6830
  );
6498
6831
  }
6499
- function Switch({ className, ...props }) {
6832
+ function useIsMobile(breakpoint = 768) {
6833
+ const [isMobile, setIsMobile] = useState(() => {
6834
+ if (typeof window === "undefined") {
6835
+ return false;
6836
+ }
6837
+ return window.innerWidth < breakpoint;
6838
+ });
6839
+ useEffect(() => {
6840
+ function onResize() {
6841
+ setIsMobile(window.innerWidth < breakpoint);
6842
+ }
6843
+ window.addEventListener("resize", onResize);
6844
+ window.addEventListener("orientationchange", onResize);
6845
+ onResize();
6846
+ return () => {
6847
+ window.removeEventListener("resize", onResize);
6848
+ window.removeEventListener("orientationchange", onResize);
6849
+ };
6850
+ }, [breakpoint]);
6851
+ return isMobile;
6852
+ }
6853
+ function Skeleton({ className, ...props }) {
6500
6854
  return /* @__PURE__ */ jsx(
6501
- SwitchPrimitive.Root,
6855
+ "div",
6502
6856
  {
6503
- "data-slot": "switch",
6504
- className: cn(
6505
- "peer inline-flex h-[1.15rem] w-10 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px]",
6506
- "data-[state=checked]:bg-[#379A2A] data-[state=unchecked]:bg-[#EFEFEF]",
6507
- "dark:data-[state=unchecked]:bg-input/80",
6508
- "focus-visible:border-ring focus-visible:ring-ring/50",
6509
- "disabled:bg-gray-300 disabled:data-[state=checked]:bg-[#A5D6A7] disabled:data-[state=unchecked]:bg-[#E0E0E0]",
6510
- "disabled:cursor-not-allowed disabled:opacity-70",
6511
- "shadow-inner",
6512
- className
6513
- ),
6514
- ...props,
6515
- children: /* @__PURE__ */ jsx(
6516
- SwitchPrimitive.Thumb,
6517
- {
6518
- "data-slot": "switch-thumb",
6519
- className: cn(
6520
- "bg-white block size-3.5 rounded-full ring-0 transition-transform",
6521
- "data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5",
6522
- "disabled:bg-gray-100"
6523
- )
6524
- }
6525
- )
6526
- }
6527
- );
6528
- }
6529
- function Textarea({ className, autoResize = true, ...props }) {
6530
- return /* @__PURE__ */ jsx(
6531
- "textarea",
6532
- {
6533
- "data-slot": "textarea",
6534
- className: cn(
6535
- "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
6536
- autoResize ? "field-sizing-content min-h-16" : "field-sizing-fixed",
6537
- className
6538
- ),
6539
- ...props
6857
+ "data-slot": "skeleton",
6858
+ className: cn("bg-accent animate-pulse rounded-md", className),
6859
+ ...props
6540
6860
  }
6541
6861
  );
6542
6862
  }
@@ -6551,6 +6871,9 @@ __export(ui_exports, {
6551
6871
  Button: () => Button,
6552
6872
  Checkbox: () => Checkbox,
6553
6873
  ClearButton: () => ClearButton,
6874
+ Collapsible: () => Collapsible,
6875
+ CollapsibleContent: () => CollapsibleContent2,
6876
+ CollapsibleTrigger: () => CollapsibleTrigger2,
6554
6877
  DatePicker: () => DatePicker,
6555
6878
  Dialog: () => Dialog,
6556
6879
  DialogContent: () => DialogContent,
@@ -6588,6 +6911,39 @@ __export(ui_exports, {
6588
6911
  SelectTrigger: () => SelectTrigger,
6589
6912
  SelectValue: () => SelectValue,
6590
6913
  Separator: () => Separator2,
6914
+ Sheet: () => Sheet,
6915
+ SheetClose: () => SheetClose,
6916
+ SheetContent: () => SheetContent,
6917
+ SheetDescription: () => SheetDescription,
6918
+ SheetFooter: () => SheetFooter,
6919
+ SheetHeader: () => SheetHeader,
6920
+ SheetTitle: () => SheetTitle,
6921
+ SheetTrigger: () => SheetTrigger,
6922
+ Sidebar: () => Sidebar,
6923
+ SidebarContent: () => SidebarContent,
6924
+ SidebarFooter: () => SidebarFooter,
6925
+ SidebarGroup: () => SidebarGroup,
6926
+ SidebarGroupAction: () => SidebarGroupAction,
6927
+ SidebarGroupContent: () => SidebarGroupContent,
6928
+ SidebarGroupLabel: () => SidebarGroupLabel,
6929
+ SidebarHeader: () => SidebarHeader,
6930
+ SidebarInput: () => SidebarInput,
6931
+ SidebarInset: () => SidebarInset,
6932
+ SidebarLayout: () => SidebarLayout,
6933
+ SidebarMenu: () => SidebarMenu,
6934
+ SidebarMenuAction: () => SidebarMenuAction,
6935
+ SidebarMenuBadge: () => SidebarMenuBadge,
6936
+ SidebarMenuButton: () => SidebarMenuButton,
6937
+ SidebarMenuItem: () => SidebarMenuItem,
6938
+ SidebarMenuSkeleton: () => SidebarMenuSkeleton,
6939
+ SidebarMenuSub: () => SidebarMenuSub,
6940
+ SidebarMenuSubButton: () => SidebarMenuSubButton,
6941
+ SidebarMenuSubItem: () => SidebarMenuSubItem,
6942
+ SidebarProvider: () => SidebarProvider,
6943
+ SidebarRail: () => SidebarRail,
6944
+ SidebarSeparator: () => SidebarSeparator,
6945
+ SidebarTrigger: () => SidebarTrigger,
6946
+ Skeleton: () => Skeleton,
6591
6947
  Spinner: () => Spinner,
6592
6948
  Switch: () => Switch,
6593
6949
  Table: () => Table,
@@ -6606,8 +6962,53 @@ __export(ui_exports, {
6606
6962
  TooltipTrigger: () => TooltipTrigger2,
6607
6963
  buttonVariants: () => buttonVariants,
6608
6964
  spinnerVariants: () => spinnerVariants,
6609
- useFormField: () => useFormField
6965
+ useFormField: () => useFormField,
6966
+ useSidebar: () => useSidebar
6610
6967
  });
6968
+ function Switch({ className, ...props }) {
6969
+ return /* @__PURE__ */ jsx(
6970
+ SwitchPrimitive.Root,
6971
+ {
6972
+ "data-slot": "switch",
6973
+ className: cn(
6974
+ "peer inline-flex h-[1.15rem] w-10 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px]",
6975
+ "data-[state=checked]:bg-[#379A2A] data-[state=unchecked]:bg-[#EFEFEF]",
6976
+ "dark:data-[state=unchecked]:bg-input/80",
6977
+ "focus-visible:border-ring focus-visible:ring-ring/50",
6978
+ "disabled:bg-gray-300 disabled:data-[state=checked]:bg-[#A5D6A7] disabled:data-[state=unchecked]:bg-[#E0E0E0]",
6979
+ "disabled:cursor-not-allowed disabled:opacity-70",
6980
+ "shadow-inner",
6981
+ className
6982
+ ),
6983
+ ...props,
6984
+ children: /* @__PURE__ */ jsx(
6985
+ SwitchPrimitive.Thumb,
6986
+ {
6987
+ "data-slot": "switch-thumb",
6988
+ className: cn(
6989
+ "bg-white block size-3.5 rounded-full ring-0 transition-transform",
6990
+ "data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5",
6991
+ "disabled:bg-gray-100"
6992
+ )
6993
+ }
6994
+ )
6995
+ }
6996
+ );
6997
+ }
6998
+ function Textarea({ className, autoResize = true, ...props }) {
6999
+ return /* @__PURE__ */ jsx(
7000
+ "textarea",
7001
+ {
7002
+ "data-slot": "textarea",
7003
+ className: cn(
7004
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
7005
+ autoResize ? "field-sizing-content min-h-16" : "field-sizing-fixed",
7006
+ className
7007
+ ),
7008
+ ...props
7009
+ }
7010
+ );
7011
+ }
6611
7012
  function TooltipProvider2({
6612
7013
  delayDuration = 0,
6613
7014
  ...props
@@ -6652,7 +7053,595 @@ function TooltipContent2({
6652
7053
  }
6653
7054
  ) });
6654
7055
  }
7056
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
7057
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
7058
+ var SIDEBAR_WIDTH = "16rem";
7059
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
7060
+ var SIDEBAR_WIDTH_ICON = "3rem";
7061
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
7062
+ var SidebarContext = React5.createContext(null);
7063
+ function useSidebar() {
7064
+ const context = React5.useContext(SidebarContext);
7065
+ if (!context) {
7066
+ throw new Error("useSidebar must be used within a SidebarProvider.");
7067
+ }
7068
+ return context;
7069
+ }
7070
+ function SidebarProvider({
7071
+ defaultOpen = true,
7072
+ open: openProp,
7073
+ onOpenChange: setOpenProp,
7074
+ className,
7075
+ style,
7076
+ children,
7077
+ ...props
7078
+ }) {
7079
+ const isMobile = useIsMobile();
7080
+ const [openMobile, setOpenMobile] = React5.useState(false);
7081
+ const [_open, _setOpen] = React5.useState(defaultOpen);
7082
+ const open = openProp ?? _open;
7083
+ const setOpen = React5.useCallback(
7084
+ (value) => {
7085
+ const openState = typeof value === "function" ? value(open) : value;
7086
+ if (setOpenProp) {
7087
+ setOpenProp(openState);
7088
+ } else {
7089
+ _setOpen(openState);
7090
+ }
7091
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
7092
+ },
7093
+ [setOpenProp, open]
7094
+ );
7095
+ const toggleSidebar = React5.useCallback(() => {
7096
+ return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
7097
+ }, [isMobile, setOpen, setOpenMobile]);
7098
+ React5.useEffect(() => {
7099
+ const handleKeyDown = (event) => {
7100
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
7101
+ event.preventDefault();
7102
+ toggleSidebar();
7103
+ }
7104
+ };
7105
+ window.addEventListener("keydown", handleKeyDown);
7106
+ return () => window.removeEventListener("keydown", handleKeyDown);
7107
+ }, [toggleSidebar]);
7108
+ const state = open ? "expanded" : "collapsed";
7109
+ const contextValue = React5.useMemo(
7110
+ () => ({
7111
+ state,
7112
+ open,
7113
+ setOpen,
7114
+ isMobile,
7115
+ openMobile,
7116
+ setOpenMobile,
7117
+ toggleSidebar
7118
+ }),
7119
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
7120
+ );
7121
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider2, { delayDuration: 0, children: /* @__PURE__ */ jsx(
7122
+ "div",
7123
+ {
7124
+ "data-slot": "sidebar-wrapper",
7125
+ style: {
7126
+ "--sidebar-width": SIDEBAR_WIDTH,
7127
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
7128
+ ...style
7129
+ },
7130
+ className: cn(
7131
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
7132
+ className
7133
+ ),
7134
+ ...props,
7135
+ children
7136
+ }
7137
+ ) }) });
7138
+ }
7139
+ function Sidebar({
7140
+ side = "left",
7141
+ variant = "sidebar",
7142
+ collapsible = "offcanvas",
7143
+ className,
7144
+ children,
7145
+ ...props
7146
+ }) {
7147
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
7148
+ if (collapsible === "none") {
7149
+ return /* @__PURE__ */ jsx(
7150
+ "div",
7151
+ {
7152
+ "data-slot": "sidebar",
7153
+ className: cn(
7154
+ "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
7155
+ className
7156
+ ),
7157
+ ...props,
7158
+ children
7159
+ }
7160
+ );
7161
+ }
7162
+ if (isMobile) {
7163
+ return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
7164
+ SheetContent,
7165
+ {
7166
+ "data-sidebar": "sidebar",
7167
+ "data-slot": "sidebar",
7168
+ "data-mobile": "true",
7169
+ className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
7170
+ style: {
7171
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
7172
+ },
7173
+ side,
7174
+ children: [
7175
+ /* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
7176
+ /* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
7177
+ /* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
7178
+ ] }),
7179
+ /* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
7180
+ ]
7181
+ }
7182
+ ) });
7183
+ }
7184
+ return /* @__PURE__ */ jsxs(
7185
+ "div",
7186
+ {
7187
+ className: "group peer text-sidebar-foreground hidden md:block",
7188
+ "data-state": state,
7189
+ "data-collapsible": state === "collapsed" ? collapsible : "",
7190
+ "data-variant": variant,
7191
+ "data-side": side,
7192
+ "data-slot": "sidebar",
7193
+ children: [
7194
+ /* @__PURE__ */ jsx(
7195
+ "div",
7196
+ {
7197
+ "data-slot": "sidebar-gap",
7198
+ className: cn(
7199
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
7200
+ "group-data-[collapsible=offcanvas]:w-0",
7201
+ "group-data-[side=right]:rotate-180",
7202
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
7203
+ )
7204
+ }
7205
+ ),
7206
+ /* @__PURE__ */ jsx(
7207
+ "div",
7208
+ {
7209
+ "data-slot": "sidebar-container",
7210
+ className: cn(
7211
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
7212
+ side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
7213
+ // Adjust the padding for floating and inset variants.
7214
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
7215
+ className
7216
+ ),
7217
+ ...props,
7218
+ children: /* @__PURE__ */ jsx(
7219
+ "div",
7220
+ {
7221
+ "data-sidebar": "sidebar",
7222
+ "data-slot": "sidebar-inner",
7223
+ className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
7224
+ children
7225
+ }
7226
+ )
7227
+ }
7228
+ )
7229
+ ]
7230
+ }
7231
+ );
7232
+ }
7233
+ function SidebarTrigger({ className, onClick, ...props }) {
7234
+ const { toggleSidebar } = useSidebar();
7235
+ return /* @__PURE__ */ jsxs(
7236
+ Button,
7237
+ {
7238
+ "data-sidebar": "trigger",
7239
+ "data-slot": "sidebar-trigger",
7240
+ variant: "ghost",
7241
+ size: "icon",
7242
+ className: cn("size-7", className),
7243
+ onClick: (event) => {
7244
+ onClick?.(event);
7245
+ toggleSidebar();
7246
+ },
7247
+ ...props,
7248
+ children: [
7249
+ /* @__PURE__ */ jsx(PanelLeftIcon, {}),
7250
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
7251
+ ]
7252
+ }
7253
+ );
7254
+ }
7255
+ function SidebarRail({ className, ...props }) {
7256
+ const { toggleSidebar } = useSidebar();
7257
+ return /* @__PURE__ */ jsx(
7258
+ "button",
7259
+ {
7260
+ "data-sidebar": "rail",
7261
+ "data-slot": "sidebar-rail",
7262
+ "aria-label": "Toggle Sidebar",
7263
+ tabIndex: -1,
7264
+ onClick: toggleSidebar,
7265
+ title: "Toggle Sidebar",
7266
+ className: cn(
7267
+ "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
7268
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
7269
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
7270
+ "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
7271
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
7272
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
7273
+ className
7274
+ ),
7275
+ ...props
7276
+ }
7277
+ );
7278
+ }
7279
+ function SidebarInset({ className, ...props }) {
7280
+ return /* @__PURE__ */ jsx(
7281
+ "main",
7282
+ {
7283
+ "data-slot": "sidebar-inset",
7284
+ className: cn(
7285
+ "bg-background relative flex w-full flex-1 flex-col",
7286
+ "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
7287
+ className
7288
+ ),
7289
+ ...props
7290
+ }
7291
+ );
7292
+ }
7293
+ function SidebarInput({ className, ...props }) {
7294
+ return /* @__PURE__ */ jsx(
7295
+ InputPrimitive,
7296
+ {
7297
+ "data-slot": "sidebar-input",
7298
+ "data-sidebar": "input",
7299
+ className: cn("bg-background h-8 w-full shadow-none", className),
7300
+ ...props
7301
+ }
7302
+ );
7303
+ }
7304
+ function SidebarHeader({ className, ...props }) {
7305
+ return /* @__PURE__ */ jsx(
7306
+ "div",
7307
+ {
7308
+ "data-slot": "sidebar-header",
7309
+ "data-sidebar": "header",
7310
+ className: cn("flex flex-col gap-2 p-2", className),
7311
+ ...props
7312
+ }
7313
+ );
7314
+ }
7315
+ function SidebarFooter({ className, ...props }) {
7316
+ return /* @__PURE__ */ jsx(
7317
+ "div",
7318
+ {
7319
+ "data-slot": "sidebar-footer",
7320
+ "data-sidebar": "footer",
7321
+ className: cn("flex flex-col gap-2 p-2", className),
7322
+ ...props
7323
+ }
7324
+ );
7325
+ }
7326
+ function SidebarSeparator({ className, ...props }) {
7327
+ return /* @__PURE__ */ jsx(
7328
+ Separator2,
7329
+ {
7330
+ "data-slot": "sidebar-separator",
7331
+ "data-sidebar": "separator",
7332
+ className: cn("bg-sidebar-border mx-2 w-auto", className),
7333
+ ...props
7334
+ }
7335
+ );
7336
+ }
7337
+ function SidebarContent({ className, ...props }) {
7338
+ return /* @__PURE__ */ jsx(
7339
+ "div",
7340
+ {
7341
+ "data-slot": "sidebar-content",
7342
+ "data-sidebar": "content",
7343
+ className: cn(
7344
+ "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
7345
+ className
7346
+ ),
7347
+ ...props
7348
+ }
7349
+ );
7350
+ }
7351
+ function SidebarGroup({ className, ...props }) {
7352
+ return /* @__PURE__ */ jsx(
7353
+ "div",
7354
+ {
7355
+ "data-slot": "sidebar-group",
7356
+ "data-sidebar": "group",
7357
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
7358
+ ...props
7359
+ }
7360
+ );
7361
+ }
7362
+ function SidebarGroupLabel({
7363
+ className,
7364
+ asChild = false,
7365
+ ...props
7366
+ }) {
7367
+ const Comp = asChild ? Slot : "div";
7368
+ return /* @__PURE__ */ jsx(
7369
+ Comp,
7370
+ {
7371
+ "data-slot": "sidebar-group-label",
7372
+ "data-sidebar": "group-label",
7373
+ className: cn(
7374
+ "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
7375
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
7376
+ className
7377
+ ),
7378
+ ...props
7379
+ }
7380
+ );
7381
+ }
7382
+ function SidebarGroupAction({
7383
+ className,
7384
+ asChild = false,
7385
+ ...props
7386
+ }) {
7387
+ const Comp = asChild ? Slot : "button";
7388
+ return /* @__PURE__ */ jsx(
7389
+ Comp,
7390
+ {
7391
+ "data-slot": "sidebar-group-action",
7392
+ "data-sidebar": "group-action",
7393
+ className: cn(
7394
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
7395
+ // Increases the hit area of the button on mobile.
7396
+ "after:absolute after:-inset-2 md:after:hidden",
7397
+ "group-data-[collapsible=icon]:hidden",
7398
+ className
7399
+ ),
7400
+ ...props
7401
+ }
7402
+ );
7403
+ }
7404
+ function SidebarGroupContent({ className, ...props }) {
7405
+ return /* @__PURE__ */ jsx(
7406
+ "div",
7407
+ {
7408
+ "data-slot": "sidebar-group-content",
7409
+ "data-sidebar": "group-content",
7410
+ className: cn("w-full text-sm", className),
7411
+ ...props
7412
+ }
7413
+ );
7414
+ }
7415
+ function SidebarMenu({ className, ...props }) {
7416
+ return /* @__PURE__ */ jsx(
7417
+ "ul",
7418
+ {
7419
+ "data-slot": "sidebar-menu",
7420
+ "data-sidebar": "menu",
7421
+ className: cn("flex w-full min-w-0 flex-col gap-1", className),
7422
+ ...props
7423
+ }
7424
+ );
7425
+ }
7426
+ function SidebarMenuItem({ className, ...props }) {
7427
+ return /* @__PURE__ */ jsx(
7428
+ "li",
7429
+ {
7430
+ "data-slot": "sidebar-menu-item",
7431
+ "data-sidebar": "menu-item",
7432
+ className: cn("group/menu-item relative", className),
7433
+ ...props
7434
+ }
7435
+ );
7436
+ }
7437
+ var sidebarMenuButtonVariants = cva(
7438
+ "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
7439
+ {
7440
+ variants: {
7441
+ variant: {
7442
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
7443
+ outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
7444
+ },
7445
+ size: {
7446
+ default: "h-8 text-sm",
7447
+ sm: "h-7 text-xs",
7448
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
7449
+ }
7450
+ },
7451
+ defaultVariants: {
7452
+ variant: "default",
7453
+ size: "default"
7454
+ }
7455
+ }
7456
+ );
7457
+ function SidebarMenuButton({
7458
+ asChild = false,
7459
+ isActive = false,
7460
+ variant = "default",
7461
+ size = "default",
7462
+ tooltip,
7463
+ className,
7464
+ ...props
7465
+ }) {
7466
+ const Comp = asChild ? Slot : "button";
7467
+ const { isMobile, state } = useSidebar();
7468
+ const button = /* @__PURE__ */ jsx(
7469
+ Comp,
7470
+ {
7471
+ "data-slot": "sidebar-menu-button",
7472
+ "data-sidebar": "menu-button",
7473
+ "data-size": size,
7474
+ "data-active": isActive,
7475
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className),
7476
+ ...props
7477
+ }
7478
+ );
7479
+ if (!tooltip) {
7480
+ return button;
7481
+ }
7482
+ if (typeof tooltip === "string") {
7483
+ tooltip = {
7484
+ children: tooltip
7485
+ };
7486
+ }
7487
+ return /* @__PURE__ */ jsxs(Tooltip2, { children: [
7488
+ /* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: button }),
7489
+ /* @__PURE__ */ jsx(
7490
+ TooltipContent2,
7491
+ {
7492
+ side: "right",
7493
+ align: "center",
7494
+ hidden: state !== "collapsed" || isMobile,
7495
+ ...tooltip
7496
+ }
7497
+ )
7498
+ ] });
7499
+ }
7500
+ function SidebarMenuAction({
7501
+ className,
7502
+ asChild = false,
7503
+ showOnHover = false,
7504
+ ...props
7505
+ }) {
7506
+ const Comp = asChild ? Slot : "button";
7507
+ return /* @__PURE__ */ jsx(
7508
+ Comp,
7509
+ {
7510
+ "data-slot": "sidebar-menu-action",
7511
+ "data-sidebar": "menu-action",
7512
+ className: cn(
7513
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
7514
+ // Increases the hit area of the button on mobile.
7515
+ "after:absolute after:-inset-2 md:after:hidden",
7516
+ "peer-data-[size=sm]/menu-button:top-1",
7517
+ "peer-data-[size=default]/menu-button:top-1.5",
7518
+ "peer-data-[size=lg]/menu-button:top-2.5",
7519
+ "group-data-[collapsible=icon]:hidden",
7520
+ showOnHover && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
7521
+ className
7522
+ ),
7523
+ ...props
7524
+ }
7525
+ );
7526
+ }
7527
+ function SidebarMenuBadge({ className, ...props }) {
7528
+ return /* @__PURE__ */ jsx(
7529
+ "div",
7530
+ {
7531
+ "data-slot": "sidebar-menu-badge",
7532
+ "data-sidebar": "menu-badge",
7533
+ className: cn(
7534
+ "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
7535
+ "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
7536
+ "peer-data-[size=sm]/menu-button:top-1",
7537
+ "peer-data-[size=default]/menu-button:top-1.5",
7538
+ "peer-data-[size=lg]/menu-button:top-2.5",
7539
+ "group-data-[collapsible=icon]:hidden",
7540
+ className
7541
+ ),
7542
+ ...props
7543
+ }
7544
+ );
7545
+ }
7546
+ function SidebarMenuSkeleton({
7547
+ className,
7548
+ showIcon = false,
7549
+ ...props
7550
+ }) {
7551
+ const width = React5.useMemo(() => {
7552
+ return `${Math.floor(Math.random() * 40) + 50}%`;
7553
+ }, []);
7554
+ return /* @__PURE__ */ jsxs(
7555
+ "div",
7556
+ {
7557
+ "data-slot": "sidebar-menu-skeleton",
7558
+ "data-sidebar": "menu-skeleton",
7559
+ className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
7560
+ ...props,
7561
+ children: [
7562
+ showIcon && /* @__PURE__ */ jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" }),
7563
+ /* @__PURE__ */ jsx(
7564
+ Skeleton,
7565
+ {
7566
+ className: "h-4 max-w-(--skeleton-width) flex-1",
7567
+ "data-sidebar": "menu-skeleton-text",
7568
+ style: {
7569
+ "--skeleton-width": width
7570
+ }
7571
+ }
7572
+ )
7573
+ ]
7574
+ }
7575
+ );
7576
+ }
7577
+ function SidebarMenuSub({ className, ...props }) {
7578
+ return /* @__PURE__ */ jsx(
7579
+ "ul",
7580
+ {
7581
+ "data-slot": "sidebar-menu-sub",
7582
+ "data-sidebar": "menu-sub",
7583
+ className: cn(
7584
+ "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
7585
+ "group-data-[collapsible=icon]:hidden",
7586
+ className
7587
+ ),
7588
+ ...props
7589
+ }
7590
+ );
7591
+ }
7592
+ function SidebarMenuSubItem({ className, ...props }) {
7593
+ return /* @__PURE__ */ jsx(
7594
+ "li",
7595
+ {
7596
+ "data-slot": "sidebar-menu-sub-item",
7597
+ "data-sidebar": "menu-sub-item",
7598
+ className: cn("group/menu-sub-item relative", className),
7599
+ ...props
7600
+ }
7601
+ );
7602
+ }
7603
+ function SidebarMenuSubButton({
7604
+ asChild = false,
7605
+ size = "md",
7606
+ isActive = false,
7607
+ className,
7608
+ ...props
7609
+ }) {
7610
+ const Comp = asChild ? Slot : "a";
7611
+ return /* @__PURE__ */ jsx(
7612
+ Comp,
7613
+ {
7614
+ "data-slot": "sidebar-menu-sub-button",
7615
+ "data-sidebar": "menu-sub-button",
7616
+ "data-size": size,
7617
+ "data-active": isActive,
7618
+ className: cn(
7619
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
7620
+ "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
7621
+ size === "sm" && "text-xs",
7622
+ size === "md" && "text-sm",
7623
+ "group-data-[collapsible=icon]:hidden",
7624
+ className
7625
+ ),
7626
+ ...props
7627
+ }
7628
+ );
7629
+ }
7630
+ function SidebarLayout({
7631
+ sidebar,
7632
+ children,
7633
+ layoutProps,
7634
+ sidebarProps,
7635
+ insetProps,
7636
+ ...providerProps
7637
+ }) {
7638
+ const { className: layoutClassName, ...restLayoutProps } = layoutProps ?? {};
7639
+ return /* @__PURE__ */ jsx(SidebarProvider, { ...providerProps, children: /* @__PURE__ */ jsxs("div", { "data-slot": "sidebar-layout", ...restLayoutProps, className: cn("flex", layoutClassName), children: [
7640
+ /* @__PURE__ */ jsx(Sidebar, { ...sidebarProps, children: sidebar }),
7641
+ /* @__PURE__ */ jsx(SidebarInset, { ...insetProps, children })
7642
+ ] }) });
7643
+ }
6655
7644
 
6656
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, Button, Checkbox, DataTable_default as DataTable, DatePicker2 as DatePicker, Dialog, DialogAlert, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Input, List_default as List, container_default as ListContainer, header_default as ListHeader, table_default as ListTable, LookupSelect, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, calendar_default as SuiCalendarIcon, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, ui_exports as UI, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, stripNullishObject, throttle, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useScreenSize_default as useScreenSize, useTruncated_default as useTruncated };
7645
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, DataTable_default as DataTable, DatePicker2 as DatePicker, Dialog, DialogAlert, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Input, Label2 as Label, List_default as List, container_default as ListContainer, header_default as ListHeader, table_default as ListTable, LookupSelect, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, calendar_default as SuiCalendarIcon, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, ui_exports as UI, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, stripNullishObject, throttle, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated };
6657
7646
  //# sourceMappingURL=index.mjs.map
6658
7647
  //# sourceMappingURL=index.mjs.map