@sustaina/shared-ui 1.9.6 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ var AccordionPrimitive = require('@radix-ui/react-accordion');
4
4
  var clsx2 = require('clsx');
5
5
  var tailwindMerge = require('tailwind-merge');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
- var React6 = require('react');
7
+ var React5 = require('react');
8
8
  var dateFns = require('date-fns');
9
9
  var lucideReact = require('lucide-react');
10
10
  var reactDom = require('react-dom');
@@ -15,8 +15,9 @@ var LabelPrimitive = require('@radix-ui/react-label');
15
15
  var classVarianceAuthority = require('class-variance-authority');
16
16
  var PopoverPrimitive = require('@radix-ui/react-popover');
17
17
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
18
+ var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
18
19
  var reactTable = require('@tanstack/react-table');
19
- var DialogPrimitive = require('@radix-ui/react-dialog');
20
+ var SheetPrimitive = require('@radix-ui/react-dialog');
20
21
  var zod$1 = require('@hookform/resolvers/zod');
21
22
  var sortable = require('@dnd-kit/sortable');
22
23
  var utilities = require('@dnd-kit/utilities');
@@ -71,12 +72,13 @@ function _interopNamespace(e) {
71
72
 
72
73
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
73
74
  var clsx2__default = /*#__PURE__*/_interopDefault(clsx2);
74
- var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
75
+ var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
75
76
  var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
76
77
  var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
77
78
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
78
79
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
79
- var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
80
+ var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
81
+ var SheetPrimitive__namespace = /*#__PURE__*/_interopNamespace(SheetPrimitive);
80
82
  var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
81
83
  var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
82
84
  var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
@@ -579,7 +581,7 @@ function AccordionContent({
579
581
  );
580
582
  }
581
583
  var ExpandCollapse = ({ title, children, portalId }) => {
582
- const [isOpen, setIsOpen] = React6.useState(false);
584
+ const [isOpen, setIsOpen] = React5.useState(false);
583
585
  const Panel = /* @__PURE__ */ jsxRuntime.jsx(
584
586
  "div",
585
587
  {
@@ -673,31 +675,31 @@ function makeNewRow(field) {
673
675
  };
674
676
  }
675
677
  function useAdvanceSearch({ fields, limitRows }) {
676
- const [rows, setRows] = React6.useState([makeNewRow(fields[0])]);
677
- const updateRows = React6.useCallback((next) => {
678
+ const [rows, setRows] = React5.useState([makeNewRow(fields[0])]);
679
+ const updateRows = React5.useCallback((next) => {
678
680
  setRows(next);
679
681
  }, []);
680
- const operatorsForField = React6.useCallback(
682
+ const operatorsForField = React5.useCallback(
681
683
  (fieldName) => {
682
684
  const t = getFieldType(fields, fieldName);
683
685
  return OPERATOR_MAP[t];
684
686
  },
685
687
  [fields]
686
688
  );
687
- const addRow = React6.useCallback(() => {
689
+ const addRow = React5.useCallback(() => {
688
690
  if (limitRows && rows.length >= limitRows) return;
689
691
  const lastRow = rows[rows.length - 1];
690
692
  const lastField = fields.find((f) => f.name === lastRow?.fieldName) ?? fields[0];
691
693
  updateRows([...rows, makeNewRow(lastField)]);
692
694
  }, [rows, fields, updateRows, limitRows]);
693
- const removeRow = React6.useCallback(
695
+ const removeRow = React5.useCallback(
694
696
  (id) => {
695
697
  if (rows.length === 1) return;
696
698
  updateRows(rows.filter((r) => r.id !== id));
697
699
  },
698
700
  [rows, updateRows]
699
701
  );
700
- const clearRow = React6.useCallback(
702
+ const clearRow = React5.useCallback(
701
703
  (id) => {
702
704
  updateRows(
703
705
  rows.map((r) => {
@@ -726,10 +728,10 @@ function useAdvanceSearch({ fields, limitRows }) {
726
728
  },
727
729
  [rows, fields, updateRows]
728
730
  );
729
- const clearAllRow = React6.useCallback(() => {
731
+ const clearAllRow = React5.useCallback(() => {
730
732
  updateRows([makeNewRow(fields[0])]);
731
733
  }, [fields, updateRows]);
732
- const changeField = React6.useCallback(
734
+ const changeField = React5.useCallback(
733
735
  (id, fieldName) => {
734
736
  updateRows(
735
737
  rows.map((r) => {
@@ -741,7 +743,7 @@ function useAdvanceSearch({ fields, limitRows }) {
741
743
  },
742
744
  [rows, fields, updateRows]
743
745
  );
744
- const changeOperator = React6.useCallback(
746
+ const changeOperator = React5.useCallback(
745
747
  (id, operator) => {
746
748
  updateRows(
747
749
  rows.map((r) => {
@@ -772,7 +774,7 @@ function useAdvanceSearch({ fields, limitRows }) {
772
774
  },
773
775
  [rows, updateRows]
774
776
  );
775
- const changeValue = React6.useCallback(
777
+ const changeValue = React5.useCallback(
776
778
  (id, which, val) => {
777
779
  updateRows(
778
780
  rows.map((r) => {
@@ -784,7 +786,7 @@ function useAdvanceSearch({ fields, limitRows }) {
784
786
  },
785
787
  [rows, updateRows]
786
788
  );
787
- const fieldOptions = React6.useMemo(
789
+ const fieldOptions = React5.useMemo(
788
790
  () => fields.map((f) => ({
789
791
  value: f.name,
790
792
  label: f.label ?? f.name
@@ -972,7 +974,7 @@ var OPERATOR_LABEL = {
972
974
  containsAll: "Contains all of"
973
975
  };
974
976
  var OperatorSelect = ({ row, operators, onChangeOperator, error }) => {
975
- React6__namespace.default.useEffect(() => {
977
+ React5__namespace.default.useEffect(() => {
976
978
  if (!operators.length) return;
977
979
  if (!operators.includes(row.operator)) {
978
980
  onChangeOperator(operators[0]);
@@ -999,7 +1001,7 @@ function Label2({ className, ...props }) {
999
1001
  {
1000
1002
  "data-slot": "label",
1001
1003
  className: cn(
1002
- "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",
1004
+ "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",
1003
1005
  className
1004
1006
  ),
1005
1007
  ...props
@@ -1007,15 +1009,15 @@ function Label2({ className, ...props }) {
1007
1009
  );
1008
1010
  }
1009
1011
  var Form = reactHookForm.FormProvider;
1010
- var FormFieldContext = React6__namespace.createContext({});
1012
+ var FormFieldContext = React5__namespace.createContext({});
1011
1013
  var FormField = ({
1012
1014
  ...props
1013
1015
  }) => {
1014
1016
  return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
1015
1017
  };
1016
1018
  var useFormField = () => {
1017
- const fieldContext = React6__namespace.useContext(FormFieldContext);
1018
- const itemContext = React6__namespace.useContext(FormItemContext);
1019
+ const fieldContext = React5__namespace.useContext(FormFieldContext);
1020
+ const itemContext = React5__namespace.useContext(FormItemContext);
1019
1021
  const { getFieldState } = reactHookForm.useFormContext();
1020
1022
  const formState = reactHookForm.useFormState({ name: fieldContext.name });
1021
1023
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -1032,9 +1034,9 @@ var useFormField = () => {
1032
1034
  ...fieldState
1033
1035
  };
1034
1036
  };
1035
- var FormItemContext = React6__namespace.createContext({});
1037
+ var FormItemContext = React5__namespace.createContext({});
1036
1038
  function FormItem({ className, ...props }) {
1037
- const id = React6__namespace.useId();
1039
+ const id = React5__namespace.useId();
1038
1040
  return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
1039
1041
  }
1040
1042
  function FormLabel({ className, ...props }) {
@@ -1093,7 +1095,7 @@ function FormMessage({ className, ...props }) {
1093
1095
  }
1094
1096
  );
1095
1097
  }
1096
- var InputPrimitive = React6__namespace.forwardRef(
1098
+ var InputPrimitive = React5__namespace.forwardRef(
1097
1099
  ({ className, type = "text", ...props }, ref) => {
1098
1100
  return /* @__PURE__ */ jsxRuntime.jsx(
1099
1101
  "input",
@@ -1128,7 +1130,7 @@ var spinnerVariants = classVarianceAuthority.cva("relative inline-block aspect-s
1128
1130
  },
1129
1131
  defaultVariants: { variant: "primary", size: "default" }
1130
1132
  });
1131
- var Spinner = ({ className, variant, size = "default" }) => /* @__PURE__ */ jsxRuntime.jsxs(
1133
+ var Spinner = ({ className, variant, size = "default", ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(
1132
1134
  "div",
1133
1135
  {
1134
1136
  role: "status",
@@ -1138,6 +1140,7 @@ var Spinner = ({ className, variant, size = "default" }) => /* @__PURE__ */ jsxR
1138
1140
  className
1139
1141
  ),
1140
1142
  style: typeof size === "number" ? { width: size, height: size } : void 0,
1143
+ ...props,
1141
1144
  children: [
1142
1145
  Array.from({ length: 12 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
1143
1146
  "div",
@@ -1177,7 +1180,7 @@ var inputVariants = classVarianceAuthority.cva("", {
1177
1180
  appearance: "filled"
1178
1181
  }
1179
1182
  });
1180
- var Input = React6__namespace.forwardRef(
1183
+ var Input = React5__namespace.forwardRef(
1181
1184
  ({
1182
1185
  className,
1183
1186
  wrapperClassName,
@@ -1206,7 +1209,7 @@ var Input = React6__namespace.forwardRef(
1206
1209
  ...inputProps
1207
1210
  } = rest;
1208
1211
  const ariaInvalid = invalid ?? ariaInvalidProp;
1209
- const messageId = React6__namespace.useId();
1212
+ const messageId = React5__namespace.useId();
1210
1213
  const resolvedAriaInvalid = typeof ariaInvalid === "string" ? ariaInvalid : ariaInvalid ? true : void 0;
1211
1214
  const describedBy = validationMessage ? [ariaDescribedByProp, messageId].filter(Boolean).join(" ") : ariaDescribedByProp;
1212
1215
  const controlWrapperClassName = cn(
@@ -1390,7 +1393,7 @@ var buttonVariants = classVarianceAuthority.cva(
1390
1393
  secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
1391
1394
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
1392
1395
  link: "text-primary underline-offset-4 hover:underline",
1393
- 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",
1396
+ 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",
1394
1397
  defaultSelect: "bg-primary text-primary-foreground shadow-xs hover:bg-sus-primary/90 py-2",
1395
1398
  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",
1396
1399
  warning: "border bg-[#f9d629] text-black shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-[#f9d629] dark:hover:bg-[#f9d629]/50"
@@ -1481,6 +1484,7 @@ var addMonths = (date, n) => {
1481
1484
  return d;
1482
1485
  };
1483
1486
  var daysInMonth = (year, monthIndex) => new Date(year, monthIndex + 1, 0).getDate();
1487
+ var DEFAULT_MONTH_FORMATTER = new Intl.DateTimeFormat("en-US", { month: "short" });
1484
1488
  function buildCalendarGrid(displayed, weekStartsOnMonday = true) {
1485
1489
  const year = displayed.getFullYear();
1486
1490
  const month = displayed.getMonth();
@@ -1521,22 +1525,20 @@ function DatePicker({
1521
1525
  className,
1522
1526
  ...props
1523
1527
  }) {
1524
- const today = React6__namespace.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
1525
- const [displayed, setDisplayed] = React6__namespace.useState(
1528
+ const today = React5__namespace.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
1529
+ const [displayed, setDisplayed] = React5__namespace.useState(
1526
1530
  selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date()
1527
1531
  );
1528
1532
  minDate = clampToDay(minDate);
1529
1533
  maxDate = clampToDay(maxDate);
1530
- const disabledSet = React6__namespace.useMemo(() => {
1534
+ const disabledSet = React5__namespace.useMemo(() => {
1531
1535
  const s = /* @__PURE__ */ new Set();
1532
1536
  disabledDates?.forEach((d) => s.add(startOfDay(d).toISOString()));
1533
1537
  return s;
1534
1538
  }, [disabledDates]);
1535
1539
  const displayYear = displayed.getFullYear();
1536
1540
  const displayMonth = displayed.getMonth();
1537
- const monthLabel = callbacks?.monthLabel?.(displayYear, displayMonth) ?? new Intl.DateTimeFormat("en-US", { month: "short" }).format(displayed);
1538
- const yearLabel = callbacks?.yearLabel?.(displayYear) ?? String(displayYear);
1539
- const weekdays = React6__namespace.useMemo(() => {
1541
+ const weekdays = React5__namespace.useMemo(() => {
1540
1542
  const labels = [];
1541
1543
  for (let i = 0; i < 7; i++) {
1542
1544
  const idx = i;
@@ -1545,7 +1547,7 @@ function DatePicker({
1545
1547
  }
1546
1548
  return labels;
1547
1549
  }, [callbacks]);
1548
- const grid = React6__namespace.useMemo(() => buildCalendarGrid(displayed, true), [displayed]);
1550
+ const grid = React5__namespace.useMemo(() => buildCalendarGrid(displayed, true), [displayed]);
1549
1551
  const isDateDisabled = (date) => {
1550
1552
  const d = startOfDay(date);
1551
1553
  if (minDate && d < minDate) return true;
@@ -1553,6 +1555,106 @@ function DatePicker({
1553
1555
  if (disabledSet.has(d.toISOString())) return true;
1554
1556
  return false;
1555
1557
  };
1558
+ const minYear = minDate?.getFullYear();
1559
+ const maxYear = maxDate?.getFullYear();
1560
+ const getMonthLabel = React5__namespace.useCallback(
1561
+ (year, monthIndex) => {
1562
+ const label = callbacks?.monthLabel?.(year, monthIndex);
1563
+ if (label === null || label === void 0) {
1564
+ return DEFAULT_MONTH_FORMATTER.format(new Date(year, monthIndex, 1));
1565
+ }
1566
+ return label;
1567
+ },
1568
+ [callbacks]
1569
+ );
1570
+ const getYearLabel = React5__namespace.useCallback(
1571
+ (year) => {
1572
+ const label = callbacks?.yearLabel?.(year);
1573
+ if (label === null || label === void 0) return String(year);
1574
+ return typeof label === "string" ? label : String(label);
1575
+ },
1576
+ [callbacks]
1577
+ );
1578
+ const clampMonthToBounds = React5__namespace.useCallback(
1579
+ (year, monthIndex) => {
1580
+ let output = monthIndex;
1581
+ if (typeof minYear === "number" && year === minYear && minDate) {
1582
+ const boundary = minDate.getMonth();
1583
+ if (output < boundary) output = boundary;
1584
+ }
1585
+ if (typeof maxYear === "number" && year === maxYear && maxDate) {
1586
+ const boundary = maxDate.getMonth();
1587
+ if (output > boundary) output = boundary;
1588
+ }
1589
+ return output;
1590
+ },
1591
+ [maxDate, minDate, maxYear, minYear]
1592
+ );
1593
+ const yearOptions = React5__namespace.useMemo(() => {
1594
+ const fallbackWindow = 50;
1595
+ const start = typeof minYear === "number" ? minYear : displayYear - fallbackWindow;
1596
+ const end = typeof maxYear === "number" ? maxYear : displayYear + fallbackWindow;
1597
+ const years = [];
1598
+ for (let year = start; year <= end; year++) {
1599
+ years.push(year);
1600
+ }
1601
+ if (!years.includes(displayYear)) {
1602
+ years.push(displayYear);
1603
+ years.sort((a, b) => a - b);
1604
+ }
1605
+ if (selectedDate) {
1606
+ const selectedYear = selectedDate.getFullYear();
1607
+ if (!years.includes(selectedYear)) {
1608
+ years.push(selectedYear);
1609
+ years.sort((a, b) => a - b);
1610
+ }
1611
+ }
1612
+ return years;
1613
+ }, [displayYear, maxYear, minYear, selectedDate]);
1614
+ const monthOptions = React5__namespace.useMemo(() => {
1615
+ const months = Array.from({ length: 12 }, (_, monthIndex) => {
1616
+ const disabled = typeof minYear === "number" && displayYear === minYear && minDate && monthIndex < minDate.getMonth() || typeof maxYear === "number" && displayYear === maxYear && maxDate && monthIndex > maxDate.getMonth();
1617
+ return {
1618
+ value: monthIndex,
1619
+ disabled,
1620
+ label: getMonthLabel(displayYear, monthIndex)
1621
+ };
1622
+ });
1623
+ const currentMonthExists = months.some((option) => option.value === displayMonth);
1624
+ if (!currentMonthExists) {
1625
+ months.push({
1626
+ value: displayMonth,
1627
+ disabled: false,
1628
+ label: getMonthLabel(displayYear, displayMonth)
1629
+ });
1630
+ }
1631
+ return months.sort((a, b) => a.value - b.value).filter((option, index, arr) => index === 0 || option.value !== arr[index - 1].value);
1632
+ }, [displayMonth, displayYear, getMonthLabel, maxDate, maxYear, minDate, minYear]);
1633
+ const handleMonthSelect = React5__namespace.useCallback((nextValue) => {
1634
+ const nextMonth = Number.parseInt(nextValue, 10);
1635
+ if (Number.isNaN(nextMonth)) return;
1636
+ setDisplayed((prev) => {
1637
+ const next = new Date(prev);
1638
+ next.setDate(1);
1639
+ next.setMonth(nextMonth);
1640
+ return next;
1641
+ });
1642
+ }, []);
1643
+ const handleYearSelect = React5__namespace.useCallback(
1644
+ (nextValue) => {
1645
+ const nextYear = Number.parseInt(nextValue, 10);
1646
+ if (Number.isNaN(nextYear)) return;
1647
+ setDisplayed((prev) => {
1648
+ const next = new Date(prev);
1649
+ next.setFullYear(nextYear);
1650
+ const adjustedMonth = clampMonthToBounds(nextYear, next.getMonth());
1651
+ next.setMonth(adjustedMonth);
1652
+ next.setDate(1);
1653
+ return next;
1654
+ });
1655
+ },
1656
+ [clampMonthToBounds]
1657
+ );
1556
1658
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("min-w-[260px] w-[300px] p-3", className), ...props, children: [
1557
1659
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1558
1660
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1570,10 +1672,46 @@ function DatePicker({
1570
1672
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4 opacity-70" })
1571
1673
  }
1572
1674
  ),
1573
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm font-bold select-none", children: [
1574
- monthLabel,
1575
- " ",
1576
- yearLabel
1675
+ /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: String(displayMonth), onValueChange: handleMonthSelect, children: [
1676
+ /* @__PURE__ */ jsxRuntime.jsx(
1677
+ SelectTrigger,
1678
+ {
1679
+ size: "sm",
1680
+ "aria-label": "Select month",
1681
+ 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",
1682
+ children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: getMonthLabel(displayYear, displayMonth) })
1683
+ }
1684
+ ),
1685
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { className: "max-h-64", children: monthOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
1686
+ SelectItem,
1687
+ {
1688
+ className: "text-center w-full",
1689
+ value: String(option.value),
1690
+ disabled: option.disabled,
1691
+ children: option.label
1692
+ },
1693
+ option.value
1694
+ )) })
1695
+ ] }),
1696
+ /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: String(displayYear), onValueChange: handleYearSelect, children: [
1697
+ /* @__PURE__ */ jsxRuntime.jsx(
1698
+ SelectTrigger,
1699
+ {
1700
+ size: "sm",
1701
+ "aria-label": "Select year",
1702
+ 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",
1703
+ children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: getYearLabel(displayYear) })
1704
+ }
1705
+ ),
1706
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { className: "max-h-64", children: yearOptions.map((year) => /* @__PURE__ */ jsxRuntime.jsx(
1707
+ SelectItem,
1708
+ {
1709
+ value: String(year),
1710
+ disabled: typeof minYear === "number" && year < minYear || typeof maxYear === "number" && year > maxYear,
1711
+ children: getYearLabel(year)
1712
+ },
1713
+ year
1714
+ )) })
1577
1715
  ] }),
1578
1716
  /* @__PURE__ */ jsxRuntime.jsx(
1579
1717
  "button",
@@ -1650,14 +1788,14 @@ var DatePicker2 = ({
1650
1788
  ariaLabel,
1651
1789
  ...calendarProps
1652
1790
  }) => {
1653
- const [open, setOpen] = React6__namespace.default.useState(false);
1654
- const parser = React6__namespace.default.useMemo(() => valueParser ?? defaultValueParser, [valueParser]);
1655
- const outputFormatter = React6__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter, [valueFormatter]);
1656
- const labelFormatter = React6__namespace.default.useMemo(
1791
+ const [open, setOpen] = React5__namespace.default.useState(false);
1792
+ const parser = React5__namespace.default.useMemo(() => valueParser ?? defaultValueParser, [valueParser]);
1793
+ const outputFormatter = React5__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter, [valueFormatter]);
1794
+ const labelFormatter = React5__namespace.default.useMemo(
1657
1795
  () => displayFormatter ?? defaultDisplayFormatter,
1658
1796
  [displayFormatter]
1659
1797
  );
1660
- const parsedValue = React6__namespace.default.useMemo(() => {
1798
+ const parsedValue = React5__namespace.default.useMemo(() => {
1661
1799
  if (value === null || value === void 0) return void 0;
1662
1800
  if (value instanceof Date) return value;
1663
1801
  const parsed = parser(value);
@@ -1666,26 +1804,26 @@ var DatePicker2 = ({
1666
1804
  const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder3;
1667
1805
  const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change date, current selection ${labelFormatter(parsedValue)}` : "Open date picker");
1668
1806
  const shouldShowClear = allowClear && !disabled && !!parsedValue;
1669
- const handleClose = React6__namespace.default.useCallback(() => setOpen(false), []);
1670
- const emitChange = React6__namespace.default.useCallback(
1807
+ const handleClose = React5__namespace.default.useCallback(() => setOpen(false), []);
1808
+ const emitChange = React5__namespace.default.useCallback(
1671
1809
  (next) => {
1672
1810
  onChange?.(next);
1673
1811
  onValueChange?.(next ? outputFormatter(next) : void 0);
1674
1812
  },
1675
1813
  [onChange, onValueChange, outputFormatter]
1676
1814
  );
1677
- const handleSelect = React6__namespace.default.useCallback(
1815
+ const handleSelect = React5__namespace.default.useCallback(
1678
1816
  (next) => {
1679
1817
  emitChange(next);
1680
1818
  if (closeOnSelect && next) handleClose();
1681
1819
  },
1682
1820
  [closeOnSelect, emitChange, handleClose]
1683
1821
  );
1684
- const handleClear = React6__namespace.default.useCallback(() => {
1822
+ const handleClear = React5__namespace.default.useCallback(() => {
1685
1823
  emitChange(void 0);
1686
1824
  handleClose();
1687
1825
  }, [emitChange, handleClose]);
1688
- const handleOpenChange = React6__namespace.default.useCallback(
1826
+ const handleOpenChange = React5__namespace.default.useCallback(
1689
1827
  (nextOpen) => {
1690
1828
  if (disabled && nextOpen) return;
1691
1829
  setOpen(nextOpen);
@@ -1857,15 +1995,15 @@ function MonthCal({
1857
1995
  onYearBackward,
1858
1996
  onYearForward
1859
1997
  }) {
1860
- const today = React6__namespace.useMemo(() => {
1998
+ const today = React5__namespace.useMemo(() => {
1861
1999
  const now = /* @__PURE__ */ new Date();
1862
2000
  now.setDate(1);
1863
2001
  now.setHours(0, 0, 0, 0);
1864
2002
  return now;
1865
2003
  }, []);
1866
- const selectedMonthDate = React6__namespace.useMemo(() => normalizeMonth(selectedDate), [selectedDate]);
1867
- const min = React6__namespace.useMemo(() => normalizeMonth(minDate), [minDate]);
1868
- const max = React6__namespace.useMemo(() => normalizeMonth(maxDate), [maxDate]);
2004
+ const selectedMonthDate = React5__namespace.useMemo(() => normalizeMonth(selectedDate), [selectedDate]);
2005
+ const min = React5__namespace.useMemo(() => normalizeMonth(minDate), [minDate]);
2006
+ const max = React5__namespace.useMemo(() => normalizeMonth(maxDate), [maxDate]);
1869
2007
  let effectiveMin = min;
1870
2008
  if (min && max && min > max) {
1871
2009
  effectiveMin = max;
@@ -1874,10 +2012,10 @@ function MonthCal({
1874
2012
  const minMonth = effectiveMin?.getMonth();
1875
2013
  const maxYear = max?.getFullYear();
1876
2014
  const maxMonth = max?.getMonth();
1877
- const [menuYear, setMenuYear] = React6__namespace.useState(
2015
+ const [menuYear, setMenuYear] = React5__namespace.useState(
1878
2016
  () => selectedMonthDate?.getFullYear() ?? today.getFullYear()
1879
2017
  );
1880
- React6__namespace.useEffect(() => {
2018
+ React5__namespace.useEffect(() => {
1881
2019
  if (selectedMonthDate) {
1882
2020
  const year = selectedMonthDate.getFullYear();
1883
2021
  if (year !== menuYear) {
@@ -1885,7 +2023,7 @@ function MonthCal({
1885
2023
  }
1886
2024
  }
1887
2025
  }, [selectedMonthDate, menuYear]);
1888
- React6__namespace.useEffect(() => {
2026
+ React5__namespace.useEffect(() => {
1889
2027
  if (typeof minYear === "number" && menuYear < minYear) {
1890
2028
  setMenuYear(minYear);
1891
2029
  return;
@@ -1896,7 +2034,39 @@ function MonthCal({
1896
2034
  }, [minYear, maxYear, menuYear]);
1897
2035
  const disablePrevYear = typeof minYear === "number" ? menuYear <= minYear : false;
1898
2036
  const disableNextYear = typeof maxYear === "number" ? menuYear >= maxYear : false;
1899
- const disabledPairs = React6__namespace.useMemo(() => {
2037
+ const yearOptions = React5__namespace.useMemo(() => {
2038
+ const fallbackWindow = 50;
2039
+ const start = typeof minYear === "number" ? minYear : menuYear - fallbackWindow;
2040
+ const end = typeof maxYear === "number" ? maxYear : menuYear + fallbackWindow;
2041
+ const years = [];
2042
+ for (let year = start; year <= end; year++) {
2043
+ years.push(year);
2044
+ }
2045
+ if (!years.includes(menuYear)) {
2046
+ years.push(menuYear);
2047
+ years.sort((a, b) => a - b);
2048
+ }
2049
+ return years;
2050
+ }, [maxYear, menuYear, minYear]);
2051
+ const formatYearLabel = React5__namespace.useCallback(
2052
+ (year) => {
2053
+ const raw = callbacks?.yearLabel?.(year);
2054
+ if (raw === null || raw === void 0) return String(year);
2055
+ return typeof raw === "string" ? raw : String(raw);
2056
+ },
2057
+ [callbacks]
2058
+ );
2059
+ const handleYearSelect = React5__namespace.useCallback(
2060
+ (nextValue) => {
2061
+ const nextYear = Number.parseInt(nextValue, 10);
2062
+ if (Number.isNaN(nextYear)) return;
2063
+ if (typeof minYear === "number" && nextYear < minYear) return;
2064
+ if (typeof maxYear === "number" && nextYear > maxYear) return;
2065
+ setMenuYear(nextYear);
2066
+ },
2067
+ [maxYear, minYear]
2068
+ );
2069
+ const disabledPairs = React5__namespace.useMemo(() => {
1900
2070
  if (!disabledDates?.length) return [];
1901
2071
  const pairs = [];
1902
2072
  disabledDates.forEach((date) => {
@@ -1911,42 +2081,67 @@ function MonthCal({
1911
2081
  return pairs;
1912
2082
  }, [disabledDates]);
1913
2083
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1914
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-center pt-1 relative items-center", children: [
1915
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium", children: callbacks?.yearLabel ? callbacks.yearLabel(menuYear) : menuYear }),
1916
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-x-1 flex items-center", children: [
1917
- /* @__PURE__ */ jsxRuntime.jsx(
1918
- "button",
1919
- {
1920
- onClick: () => {
1921
- if (disablePrevYear) return;
1922
- setMenuYear((prev) => prev - 1);
1923
- onYearBackward?.();
1924
- },
1925
- disabled: disablePrevYear,
1926
- className: cn(
1927
- buttonVariants({ variant: variant?.chevrons ?? "outline" }),
1928
- "inline-flex items-center justify-center h-7 w-7 p-0 absolute left-1"
1929
- ),
1930
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "opacity-50 h-4 w-4" })
1931
- }
1932
- ),
1933
- /* @__PURE__ */ jsxRuntime.jsx(
1934
- "button",
1935
- {
1936
- onClick: () => {
1937
- if (disableNextYear) return;
1938
- setMenuYear((prev) => prev + 1);
1939
- onYearForward?.();
1940
- },
1941
- disabled: disableNextYear,
1942
- className: cn(
1943
- buttonVariants({ variant: variant?.chevrons ?? "outline" }),
1944
- "inline-flex items-center justify-center h-7 w-7 p-0 absolute right-1"
2084
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
2085
+ /* @__PURE__ */ jsxRuntime.jsx(
2086
+ "button",
2087
+ {
2088
+ onClick: () => {
2089
+ if (disablePrevYear) return;
2090
+ setMenuYear((prev) => prev - 1);
2091
+ onYearBackward?.();
2092
+ },
2093
+ disabled: disablePrevYear,
2094
+ className: cn(
2095
+ buttonVariants({ variant: variant?.chevrons ?? "outline" }),
2096
+ "inline-flex items-center justify-center h-7 w-7 p-0"
2097
+ ),
2098
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "opacity-50 h-4 w-4" })
2099
+ }
2100
+ ),
2101
+ /* @__PURE__ */ jsxRuntime.jsxs(
2102
+ Select,
2103
+ {
2104
+ value: String(menuYear),
2105
+ onValueChange: handleYearSelect,
2106
+ disabled: disablePrevYear && disableNextYear,
2107
+ children: [
2108
+ /* @__PURE__ */ jsxRuntime.jsx(
2109
+ SelectTrigger,
2110
+ {
2111
+ size: "sm",
2112
+ "aria-label": "Select year",
2113
+ 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",
2114
+ children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: formatYearLabel(menuYear) })
2115
+ }
1945
2116
  ),
1946
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "opacity-50 h-4 w-4" })
1947
- }
1948
- )
1949
- ] })
2117
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { className: "max-h-64", children: yearOptions.map((year) => /* @__PURE__ */ jsxRuntime.jsx(
2118
+ SelectItem,
2119
+ {
2120
+ value: String(year),
2121
+ disabled: typeof minYear === "number" && year < minYear || typeof maxYear === "number" && year > maxYear,
2122
+ children: formatYearLabel(year)
2123
+ },
2124
+ year
2125
+ )) })
2126
+ ]
2127
+ }
2128
+ ),
2129
+ /* @__PURE__ */ jsxRuntime.jsx(
2130
+ "button",
2131
+ {
2132
+ onClick: () => {
2133
+ if (disableNextYear) return;
2134
+ setMenuYear((prev) => prev + 1);
2135
+ onYearForward?.();
2136
+ },
2137
+ disabled: disableNextYear,
2138
+ className: cn(
2139
+ buttonVariants({ variant: variant?.chevrons ?? "outline" }),
2140
+ "inline-flex items-center justify-center h-7 w-7 p-0"
2141
+ ),
2142
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "opacity-50 h-4 w-4" })
2143
+ }
2144
+ )
1950
2145
  ] }),
1951
2146
  /* @__PURE__ */ jsxRuntime.jsx("table", { className: "w-full border-collapse space-y-1", children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: MONTHS.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "flex w-full mt-2 gap-2", children: row.map((m) => {
1952
2147
  const afterMax = maxMonth !== void 0 && maxYear !== void 0 ? menuYear > maxYear || menuYear === maxYear && m.number > maxMonth : false;
@@ -2016,14 +2211,14 @@ var MonthPicker2 = ({
2016
2211
  ariaLabel,
2017
2212
  ...calendarProps
2018
2213
  }) => {
2019
- const [open, setOpen] = React6__namespace.default.useState(false);
2020
- const parser = React6__namespace.default.useMemo(() => valueParser ?? defaultValueParser2, [valueParser]);
2021
- const outputFormatter = React6__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter2, [valueFormatter]);
2022
- const labelFormatter = React6__namespace.default.useMemo(
2214
+ const [open, setOpen] = React5__namespace.default.useState(false);
2215
+ const parser = React5__namespace.default.useMemo(() => valueParser ?? defaultValueParser2, [valueParser]);
2216
+ const outputFormatter = React5__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter2, [valueFormatter]);
2217
+ const labelFormatter = React5__namespace.default.useMemo(
2023
2218
  () => displayFormatter ?? defaultDisplayFormatter2,
2024
2219
  [displayFormatter]
2025
2220
  );
2026
- const parsedValue = React6__namespace.default.useMemo(() => {
2221
+ const parsedValue = React5__namespace.default.useMemo(() => {
2027
2222
  if (value === null || value === void 0) return void 0;
2028
2223
  if (value instanceof Date) return normalizeMonth2(value);
2029
2224
  if (typeof value === "string") {
@@ -2035,8 +2230,8 @@ var MonthPicker2 = ({
2035
2230
  const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder3;
2036
2231
  const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change month, current selection ${labelFormatter(parsedValue)}` : "Open month picker");
2037
2232
  const shouldShowClear = allowClear && !disabled && !!parsedValue;
2038
- const handleClose = React6__namespace.default.useCallback(() => setOpen(false), []);
2039
- const emitChange = React6__namespace.default.useCallback(
2233
+ const handleClose = React5__namespace.default.useCallback(() => setOpen(false), []);
2234
+ const emitChange = React5__namespace.default.useCallback(
2040
2235
  (next) => {
2041
2236
  const normalized = next ? normalizeMonth2(next) : void 0;
2042
2237
  onChange?.(normalized);
@@ -2044,18 +2239,18 @@ var MonthPicker2 = ({
2044
2239
  },
2045
2240
  [onChange, onValueChange, outputFormatter]
2046
2241
  );
2047
- const handleSelect = React6__namespace.default.useCallback(
2242
+ const handleSelect = React5__namespace.default.useCallback(
2048
2243
  (next) => {
2049
2244
  emitChange(next);
2050
2245
  if (closeOnSelect && next) handleClose();
2051
2246
  },
2052
2247
  [closeOnSelect, emitChange, handleClose]
2053
2248
  );
2054
- const handleClear = React6__namespace.default.useCallback(() => {
2249
+ const handleClear = React5__namespace.default.useCallback(() => {
2055
2250
  emitChange(void 0);
2056
2251
  handleClose();
2057
2252
  }, [emitChange, handleClose]);
2058
- const handleOpenChange = React6__namespace.default.useCallback(
2253
+ const handleOpenChange = React5__namespace.default.useCallback(
2059
2254
  (nextOpen) => {
2060
2255
  if (disabled && nextOpen) return;
2061
2256
  setOpen(nextOpen);
@@ -2261,21 +2456,21 @@ var LookupSelect = ({
2261
2456
  loadingMessage = "Loading...",
2262
2457
  dropdownPortalId
2263
2458
  }) => {
2264
- const [inputValue, setInputValue] = React6.useState("");
2265
- const [suggestions, setSuggestions] = React6.useState([]);
2266
- const [optionLabels, setOptionLabels] = React6.useState({});
2267
- const [loading, setLoading] = React6.useState(false);
2268
- const [fetchError, setFetchError] = React6.useState(null);
2269
- const [isDropdownOpen, setIsDropdownOpen] = React6.useState(false);
2270
- const containerRef = React6.useRef(null);
2271
- const fetchDelayRef = React6.useRef(null);
2272
- const requestIdRef = React6.useRef(0);
2273
- const [dropdownStyles, setDropdownStyles] = React6.useState();
2274
- const dropdownContentRef = React6.useRef(null);
2275
- const assignDropdownContentRef = React6.useCallback((node) => {
2459
+ const [inputValue, setInputValue] = React5.useState("");
2460
+ const [suggestions, setSuggestions] = React5.useState([]);
2461
+ const [optionLabels, setOptionLabels] = React5.useState({});
2462
+ const [loading, setLoading] = React5.useState(false);
2463
+ const [fetchError, setFetchError] = React5.useState(null);
2464
+ const [isDropdownOpen, setIsDropdownOpen] = React5.useState(false);
2465
+ const containerRef = React5.useRef(null);
2466
+ const fetchDelayRef = React5.useRef(null);
2467
+ const requestIdRef = React5.useRef(0);
2468
+ const [dropdownStyles, setDropdownStyles] = React5.useState();
2469
+ const dropdownContentRef = React5.useRef(null);
2470
+ const assignDropdownContentRef = React5.useCallback((node) => {
2276
2471
  dropdownContentRef.current = node;
2277
2472
  }, []);
2278
- const dropdownPortalElement = React6.useMemo(() => {
2473
+ const dropdownPortalElement = React5.useMemo(() => {
2279
2474
  if (typeof document === "undefined") return null;
2280
2475
  if (dropdownPortalId) {
2281
2476
  const element = document.getElementById(dropdownPortalId);
@@ -2284,7 +2479,7 @@ var LookupSelect = ({
2284
2479
  return document.body;
2285
2480
  }, [dropdownPortalId]);
2286
2481
  const limitReached = value.length >= maxTags;
2287
- const upsertOptionLabels = React6.useCallback((options) => {
2482
+ const upsertOptionLabels = React5.useCallback((options) => {
2288
2483
  setOptionLabels((prev) => {
2289
2484
  let next = null;
2290
2485
  options.forEach((opt) => {
@@ -2297,7 +2492,7 @@ var LookupSelect = ({
2297
2492
  return next ?? prev;
2298
2493
  });
2299
2494
  }, []);
2300
- const addTag = React6.useCallback(
2495
+ const addTag = React5.useCallback(
2301
2496
  (val) => {
2302
2497
  const trimmed = val.trim();
2303
2498
  if (!trimmed) return;
@@ -2310,7 +2505,7 @@ var LookupSelect = ({
2310
2505
  },
2311
2506
  [value, onChange, maxTags]
2312
2507
  );
2313
- const removeTag = React6.useCallback(
2508
+ const removeTag = React5.useCallback(
2314
2509
  (index) => {
2315
2510
  if (index < 0) return;
2316
2511
  const newTags = value.filter((_, i) => i !== index);
@@ -2318,7 +2513,7 @@ var LookupSelect = ({
2318
2513
  },
2319
2514
  [value, onChange]
2320
2515
  );
2321
- const handleKeyDown = React6.useCallback(
2516
+ const handleKeyDown = React5.useCallback(
2322
2517
  (e) => {
2323
2518
  if (e.key === "Enter" || e.key === ",") {
2324
2519
  e.preventDefault();
@@ -2329,21 +2524,21 @@ var LookupSelect = ({
2329
2524
  },
2330
2525
  [inputValue, removeTag, value.length]
2331
2526
  );
2332
- const handleClear = React6.useCallback(() => {
2527
+ const handleClear = React5.useCallback(() => {
2333
2528
  setInputValue("");
2334
2529
  setSuggestions([]);
2335
2530
  setIsDropdownOpen(false);
2336
2531
  setFetchError(null);
2337
2532
  if (onClear) onClear();
2338
2533
  }, [onClear]);
2339
- const handleSuggestionSelect = React6.useCallback(
2534
+ const handleSuggestionSelect = React5.useCallback(
2340
2535
  (option) => {
2341
2536
  upsertOptionLabels([option]);
2342
2537
  addTag(option.value);
2343
2538
  },
2344
2539
  [addTag, upsertOptionLabels]
2345
2540
  );
2346
- const updateDropdownPosition = React6.useCallback(() => {
2541
+ const updateDropdownPosition = React5.useCallback(() => {
2347
2542
  if (!dropdownPortalElement || !containerRef.current) return;
2348
2543
  const rect = containerRef.current.getBoundingClientRect();
2349
2544
  setDropdownStyles({
@@ -2354,7 +2549,7 @@ var LookupSelect = ({
2354
2549
  zIndex: 50
2355
2550
  });
2356
2551
  }, [dropdownPortalElement]);
2357
- React6.useEffect(() => {
2552
+ React5.useEffect(() => {
2358
2553
  if (!fetchSuggestions) return;
2359
2554
  if (fetchDelayRef.current) {
2360
2555
  clearTimeout(fetchDelayRef.current);
@@ -2394,7 +2589,7 @@ var LookupSelect = ({
2394
2589
  }
2395
2590
  };
2396
2591
  }, [inputValue, fetchSuggestions, suggestionDebounce, upsertOptionLabels]);
2397
- React6.useEffect(() => {
2592
+ React5.useEffect(() => {
2398
2593
  const handleDocumentClick = (event) => {
2399
2594
  const target = event.target;
2400
2595
  if (containerRef.current?.contains(target)) return;
@@ -2406,11 +2601,11 @@ var LookupSelect = ({
2406
2601
  document.removeEventListener("mousedown", handleDocumentClick);
2407
2602
  };
2408
2603
  }, []);
2409
- React6.useEffect(() => {
2604
+ React5.useEffect(() => {
2410
2605
  if (!limitReached) return;
2411
2606
  setIsDropdownOpen(false);
2412
2607
  }, [limitReached]);
2413
- React6.useEffect(() => {
2608
+ React5.useEffect(() => {
2414
2609
  if (!dropdownPortalElement) return;
2415
2610
  if (!isDropdownOpen) return;
2416
2611
  updateDropdownPosition();
@@ -3095,7 +3290,7 @@ var AdvanceSearch = ({
3095
3290
  onSearch,
3096
3291
  onClear
3097
3292
  }) => {
3098
- const fieldsData = React6.useMemo(() => {
3293
+ const fieldsData = React5.useMemo(() => {
3099
3294
  if (fields.length === 0) throw new Error("fields cannot be an empty array");
3100
3295
  return fields || [];
3101
3296
  }, [fields]);
@@ -3115,8 +3310,8 @@ var AdvanceSearch = ({
3115
3310
  defaultValues: {}
3116
3311
  });
3117
3312
  const { handleSubmit, unregister, resetField, getValues, clearErrors, setError } = form;
3118
- const [operatorErrors, setOperatorErrors] = React6__namespace.default.useState({});
3119
- const clearOperatorError = React6.useCallback(
3313
+ const [operatorErrors, setOperatorErrors] = React5__namespace.default.useState({});
3314
+ const clearOperatorError = React5.useCallback(
3120
3315
  (rowId) => {
3121
3316
  setOperatorErrors((prev) => {
3122
3317
  if (!(rowId in prev)) return prev;
@@ -3126,7 +3321,7 @@ var AdvanceSearch = ({
3126
3321
  },
3127
3322
  [setOperatorErrors]
3128
3323
  );
3129
- const clearValue = React6.useCallback(
3324
+ const clearValue = React5.useCallback(
3130
3325
  (rowId, which) => {
3131
3326
  const fieldName = `${which}_${rowId}`;
3132
3327
  resetField(fieldName, { defaultValue: void 0 });
@@ -3136,13 +3331,13 @@ var AdvanceSearch = ({
3136
3331
  },
3137
3332
  [resetField, clearErrors]
3138
3333
  );
3139
- const parseRangeValue = React6.useCallback((raw, fieldType) => {
3334
+ const parseRangeValue = React5.useCallback((raw, fieldType) => {
3140
3335
  if (!raw) return void 0;
3141
3336
  const normalized = fieldType === "datemonth" ? `${raw}-01` : raw;
3142
3337
  const parsed = dateFns.parseISO(normalized);
3143
3338
  return dateFns.isValid(parsed) ? parsed : void 0;
3144
3339
  }, []);
3145
- const onSubmit = React6.useCallback(() => {
3340
+ const onSubmit = React5.useCallback(() => {
3146
3341
  const operatorValidation = {};
3147
3342
  rows.forEach((r) => {
3148
3343
  const availableOperators = operatorsForField(r.fieldName);
@@ -3304,6 +3499,19 @@ function Checkbox({ className, ...props }) {
3304
3499
  }
3305
3500
  );
3306
3501
  }
3502
+ function Collapsible({ ...props }) {
3503
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Root, { "data-slot": "collapsible", ...props });
3504
+ }
3505
+ function CollapsibleTrigger2({
3506
+ ...props
3507
+ }) {
3508
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
3509
+ }
3510
+ function CollapsibleContent2({
3511
+ ...props
3512
+ }) {
3513
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.CollapsibleContent, { "data-slot": "collapsible-content", ...props });
3514
+ }
3307
3515
  function compareAlphanumeric(aStr, bStr) {
3308
3516
  const a = aStr.split(reactTable.reSplitAlphaNumeric).filter(Boolean);
3309
3517
  const b = bStr.split(reactTable.reSplitAlphaNumeric).filter(Boolean);
@@ -3347,11 +3555,11 @@ function selectValueToBoolean(value) {
3347
3555
  return void 0;
3348
3556
  }
3349
3557
  var useHover = () => {
3350
- const [hovering, setHovering] = React6.useState(false);
3351
- const prevRef = React6.useRef(null);
3352
- const onMouseEnter = React6.useCallback(() => setHovering(true), []);
3353
- const onMouseLeave = React6.useCallback(() => setHovering(false), []);
3354
- const nodeRefCallback = React6.useCallback(
3558
+ const [hovering, setHovering] = React5.useState(false);
3559
+ const prevRef = React5.useRef(null);
3560
+ const onMouseEnter = React5.useCallback(() => setHovering(true), []);
3561
+ const onMouseLeave = React5.useCallback(() => setHovering(false), []);
3562
+ const nodeRefCallback = React5.useCallback(
3355
3563
  (node) => {
3356
3564
  if (prevRef.current) {
3357
3565
  prevRef.current.removeEventListener("mouseenter", onMouseEnter);
@@ -3379,15 +3587,15 @@ var useIntersectionObserver = ({
3379
3587
  initialIsIntersecting = false,
3380
3588
  onChange
3381
3589
  } = {}) => {
3382
- const [ref, setRef] = React6.useState(null);
3383
- const [state, setState] = React6.useState(() => ({
3590
+ const [ref, setRef] = React5.useState(null);
3591
+ const [state, setState] = React5.useState(() => ({
3384
3592
  isIntersecting: initialIsIntersecting,
3385
3593
  entry: void 0
3386
3594
  }));
3387
- const callbackRef = React6.useRef(null);
3595
+ const callbackRef = React5.useRef(null);
3388
3596
  callbackRef.current = onChange;
3389
3597
  const frozen = state.entry?.isIntersecting && freezeOnceVisible;
3390
- React6.useEffect(() => {
3598
+ React5.useEffect(() => {
3391
3599
  if (!ref) return;
3392
3600
  if (!("IntersectionObserver" in window)) return;
3393
3601
  if (frozen) return;
@@ -3417,8 +3625,8 @@ var useIntersectionObserver = ({
3417
3625
  frozen,
3418
3626
  freezeOnceVisible
3419
3627
  ]);
3420
- const prevRef = React6.useRef(null);
3421
- React6.useEffect(() => {
3628
+ const prevRef = React5.useRef(null);
3629
+ React5.useEffect(() => {
3422
3630
  if (!ref && state.entry?.target && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {
3423
3631
  prevRef.current = state.entry.target;
3424
3632
  setState({ isIntersecting: initialIsIntersecting, entry: void 0 });
@@ -3435,8 +3643,8 @@ var isValidMediaQueryString = (query) => {
3435
3643
  return query !== "not all";
3436
3644
  };
3437
3645
  var useMediaQuery = ({ query }) => {
3438
- const [matches, setMatches] = React6.useState(false);
3439
- React6.useEffect(() => {
3646
+ const [matches, setMatches] = React5.useState(false);
3647
+ React5.useEffect(() => {
3440
3648
  if (typeof window === "undefined") {
3441
3649
  return;
3442
3650
  }
@@ -3472,8 +3680,8 @@ var useTruncated = ({
3472
3680
  onChange,
3473
3681
  resizeDetectDelay = 150
3474
3682
  }) => {
3475
- const [isTruncated, setIsTruncated] = React6.useState(false);
3476
- React6.useEffect(() => {
3683
+ const [isTruncated, setIsTruncated] = React5.useState(false);
3684
+ React5.useEffect(() => {
3477
3685
  const element = elementRef.current;
3478
3686
  if (!element) return;
3479
3687
  const checkTruncate = debounce(() => {
@@ -3693,7 +3901,7 @@ var ColumnSeparator = ({ show, className, ...props }) => {
3693
3901
  }
3694
3902
  );
3695
3903
  };
3696
- var ColumnSeparator_default = React6__namespace.default.memo(ColumnSeparator);
3904
+ var ColumnSeparator_default = React5__namespace.default.memo(ColumnSeparator);
3697
3905
  var StatusContentSlot = ({
3698
3906
  content,
3699
3907
  icon,
@@ -3712,7 +3920,7 @@ var StatusContentSlot = ({
3712
3920
  content
3713
3921
  ] });
3714
3922
  };
3715
- var StatusContentSlot_default = React6__namespace.default.memo(StatusContentSlot);
3923
+ var StatusContentSlot_default = React5__namespace.default.memo(StatusContentSlot);
3716
3924
  var stateOptions = [
3717
3925
  "columnFilters",
3718
3926
  "globalFilter",
@@ -3765,9 +3973,9 @@ var modelOptions = [
3765
3973
  "getCenterVisibleLeafColumns"
3766
3974
  ];
3767
3975
  var DataTableDevTool = ({ table }) => {
3768
- const [open, setOpen] = React6.useState(false);
3769
- const [visibleStates, setVisibleStates] = React6.useState([]);
3770
- const [visibleModels, setVisibleModels] = React6.useState([]);
3976
+ const [open, setOpen] = React5.useState(false);
3977
+ const [visibleStates, setVisibleStates] = React5.useState([]);
3978
+ const [visibleModels, setVisibleModels] = React5.useState([]);
3771
3979
  const tableState = table.getState();
3772
3980
  const toggleValue = (arr, value) => arr.includes(value) ? arr.filter((v) => v !== value) : [...arr, value];
3773
3981
  const getCircularReplacer = () => {
@@ -4027,14 +4235,14 @@ var DataTable = ({
4027
4235
  if (isDefined(tableRef) && !isDefined(tableRef?.current)) {
4028
4236
  tableRef.current = table;
4029
4237
  }
4030
- const tableContainerRef = React6.useRef(null);
4238
+ const tableContainerRef = React5.useRef(null);
4031
4239
  const isTableEmpty = table.getCoreRowModel().rows.length === 0;
4032
4240
  const isTableEmptyAfterFiltering = table.getRowModel().rows.length === 0;
4033
4241
  const isFiltering = table.getState().columnFilters.length > 0 || !!table.getState().globalFilter;
4034
4242
  const leftVisibleLeftColumns = table.getLeftVisibleLeafColumns();
4035
4243
  const centerVisibleLeafColumns = table.getCenterVisibleLeafColumns();
4036
4244
  const rightVisibleLeafColumns = table.getRightVisibleLeafColumns();
4037
- const { isSomeColumnsFilterable, filterableColumns } = React6.useMemo(() => {
4245
+ const { isSomeColumnsFilterable, filterableColumns } = React5.useMemo(() => {
4038
4246
  const mergedColumns = [
4039
4247
  ...leftVisibleLeftColumns,
4040
4248
  ...centerVisibleLeafColumns,
@@ -4045,7 +4253,7 @@ var DataTable = ({
4045
4253
  );
4046
4254
  return { isSomeColumnsFilterable: isSomeColumnsFilterable2, filterableColumns: mergedColumns };
4047
4255
  }, [centerVisibleLeafColumns, leftVisibleLeftColumns, rightVisibleLeafColumns]);
4048
- const autoStatusKey = React6.useMemo(() => {
4256
+ const autoStatusKey = React5.useMemo(() => {
4049
4257
  if (isInitialLoading) return "initialLoading";
4050
4258
  if (isTableEmpty) return "emptyData";
4051
4259
  if (isTableEmptyAfterFiltering) return "emptyFilteredData";
@@ -4063,14 +4271,14 @@ var DataTable = ({
4063
4271
  scrollFetch?.hasMore,
4064
4272
  scrollFetch?.isFetchingMore
4065
4273
  ]);
4066
- const activeStatusContentComputed = React6.useMemo(() => {
4274
+ const activeStatusContentComputed = React5.useMemo(() => {
4067
4275
  if (!activeStatusContent) return autoStatusKey;
4068
4276
  if (typeof activeStatusContent === "function") {
4069
4277
  return activeStatusContent({ defaultComputedValue: autoStatusKey });
4070
4278
  }
4071
4279
  return activeStatusContent;
4072
4280
  }, [activeStatusContent, autoStatusKey]);
4073
- const fetchMoreOnScrollReached = React6.useCallback(
4281
+ const fetchMoreOnScrollReached = React5.useCallback(
4074
4282
  (containerRefElement) => {
4075
4283
  if (!scrollFetch?.enabled || !containerRefElement || scrollFetch?.isFetchingMore || !scrollFetch?.hasMore || !scrollFetch?.fetchMore) {
4076
4284
  return;
@@ -4104,7 +4312,7 @@ var DataTable = ({
4104
4312
  // eslint-disable-next-line react-hooks/exhaustive-deps
4105
4313
  [scrollFetch?.enabled, scrollFetch?.isFetchingMore, scrollFetch?.hasMore, scrollFetch?.fetchMore]
4106
4314
  );
4107
- React6.useEffect(() => {
4315
+ React5.useEffect(() => {
4108
4316
  fetchMoreOnScrollReached(tableContainerRef.current);
4109
4317
  }, [fetchMoreOnScrollReached]);
4110
4318
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4125,7 +4333,8 @@ var DataTable = ({
4125
4333
  icon: statusContent?.initialLoading?.icon,
4126
4334
  wrapperProps: statusContent?.initialLoading?.wrapperProps,
4127
4335
  defaultWrapperProps: {
4128
- className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2"
4336
+ className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2",
4337
+ ["data-testid"]: "status-content-initial-loading"
4129
4338
  },
4130
4339
  defaultIcon: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 })
4131
4340
  }
@@ -4136,7 +4345,8 @@ var DataTable = ({
4136
4345
  icon: statusContent?.emptyData?.icon,
4137
4346
  wrapperProps: statusContent?.emptyData?.wrapperProps,
4138
4347
  defaultWrapperProps: {
4139
- className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2"
4348
+ className: "flex flex-col h-full items-center justify-center text-sm py-4 gap-2",
4349
+ ["data-testid"]: "status-content-empty-data"
4140
4350
  },
4141
4351
  defaultIcon: /* @__PURE__ */ jsxRuntime.jsx(empty_data_default, { className: "text-[128px]" })
4142
4352
  }
@@ -4161,6 +4371,7 @@ var DataTable = ({
4161
4371
  return /* @__PURE__ */ jsxRuntime.jsxs(
4162
4372
  TableHead,
4163
4373
  {
4374
+ "data-testid": `table-head-${header.id}`,
4164
4375
  colSpan: header.colSpan,
4165
4376
  ...tableHeadCellProps,
4166
4377
  ...header.column.columnDef?.meta?.headerProps,
@@ -4194,13 +4405,14 @@ var DataTable = ({
4194
4405
  );
4195
4406
  }) }, headerGroup.id);
4196
4407
  }),
4197
- isSomeColumnsFilterable && /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: filterableColumns.map((column) => {
4408
+ isSomeColumnsFilterable && /* @__PURE__ */ jsxRuntime.jsx(TableRow, { "data-testid": "table-filter-row", children: filterableColumns.map((column) => {
4198
4409
  const { classes, style } = getColumnPinningStyles(column);
4199
4410
  const useColumnSizing = column.columnDef.meta?.useColumnSizing ?? columnResizing?.enabled ?? false;
4200
4411
  const tableFilterCellProps = typeof components?.tableFilterCellProps === "function" ? components?.tableFilterCellProps({ column, table }) : components?.tableFilterCellProps;
4201
4412
  return /* @__PURE__ */ jsxRuntime.jsx(
4202
4413
  TableCell,
4203
4414
  {
4415
+ "data-testid": `table-filter-cell-${column.id}`,
4204
4416
  ...tableFilterCellProps,
4205
4417
  ...column.columnDef?.meta?.filterCellProps,
4206
4418
  className: cn(
@@ -4230,9 +4442,10 @@ var DataTable = ({
4230
4442
  ),
4231
4443
  /* @__PURE__ */ jsxRuntime.jsx(TableBody, { ...components?.tableBodyProps, children: table.getRowModel().rows.map((row) => {
4232
4444
  const tableDataRowProps = typeof components?.tableDataRowProps === "function" ? components.tableDataRowProps({ row, table }) || {} : components?.tableDataRowProps || {};
4233
- return /* @__PURE__ */ React6.createElement(
4445
+ return /* @__PURE__ */ React5.createElement(
4234
4446
  TableRow,
4235
4447
  {
4448
+ "data-testid": `table-data-row-${row.id}`,
4236
4449
  ...tableDataRowProps,
4237
4450
  key: row.id,
4238
4451
  className: cn("group", tableDataRowProps?.className),
@@ -4251,6 +4464,9 @@ var DataTable = ({
4251
4464
  return /* @__PURE__ */ jsxRuntime.jsx(
4252
4465
  TableCell,
4253
4466
  {
4467
+ "data-testid": `table-data-cell-${cell.id}`,
4468
+ "data-row-id": row.id,
4469
+ "data-column-id": cell.column.id,
4254
4470
  ...tableDataCellProps,
4255
4471
  ...cell.column.columnDef?.meta?.cellProps,
4256
4472
  className: cn(
@@ -4285,7 +4501,8 @@ var DataTable = ({
4285
4501
  icon: statusContent?.emptyFilteredData?.icon,
4286
4502
  wrapperProps: statusContent?.emptyFilteredData?.wrapperProps,
4287
4503
  defaultWrapperProps: {
4288
- className: "flex flex-col h-[calc(100%-76px)] items-center justify-center text-sm py-4 gap-2"
4504
+ className: "flex flex-col h-[calc(100%-76px)] items-center justify-center text-sm py-4 gap-2",
4505
+ ["data-testid"]: "status-content-empty-filtered-data"
4289
4506
  },
4290
4507
  defaultIcon: /* @__PURE__ */ jsxRuntime.jsx(empty_data_default, { className: "text-[128px]" })
4291
4508
  }
@@ -4296,7 +4513,8 @@ var DataTable = ({
4296
4513
  content: statusContent?.fetchingMore?.content ?? "Loading more...",
4297
4514
  wrapperProps: statusContent?.fetchingMore?.wrapperProps,
4298
4515
  defaultWrapperProps: {
4299
- className: "flex flex-col items-center justify-center text-sm py-4 gap-2"
4516
+ className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
4517
+ ["data-testid"]: "status-content-fetching-more"
4300
4518
  }
4301
4519
  }
4302
4520
  ),
@@ -4307,7 +4525,8 @@ var DataTable = ({
4307
4525
  icon: statusContent?.noMoreData?.icon,
4308
4526
  wrapperProps: statusContent?.noMoreData?.wrapperProps,
4309
4527
  defaultWrapperProps: {
4310
- className: "flex flex-col items-center justify-center text-sm py-4 gap-2"
4528
+ className: "flex flex-col items-center justify-center text-sm py-4 gap-2",
4529
+ ["data-testid"]: "status-content-no-more-data"
4311
4530
  }
4312
4531
  }
4313
4532
  )
@@ -4319,17 +4538,17 @@ var DataTable = ({
4319
4538
  };
4320
4539
  var DataTable_default = DataTable;
4321
4540
  function Dialog(props) {
4322
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
4541
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
4323
4542
  }
4324
4543
  function DialogTrigger(props) {
4325
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
4544
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
4326
4545
  }
4327
4546
  function DialogPortal(props) {
4328
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
4547
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
4329
4548
  }
4330
4549
  function DialogOverlay({ className, ...props }) {
4331
4550
  return /* @__PURE__ */ jsxRuntime.jsx(
4332
- DialogPrimitive__namespace.Overlay,
4551
+ SheetPrimitive__namespace.Overlay,
4333
4552
  {
4334
4553
  "data-slot": "dialog-overlay",
4335
4554
  className: cn(
@@ -4353,7 +4572,7 @@ function DialogHeader({ className, children, ...props }) {
4353
4572
  children: [
4354
4573
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-semibold", children }),
4355
4574
  /* @__PURE__ */ jsxRuntime.jsxs(
4356
- DialogPrimitive__namespace.Close,
4575
+ SheetPrimitive__namespace.Close,
4357
4576
  {
4358
4577
  "data-slot": "dialog-close",
4359
4578
  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",
@@ -4377,7 +4596,7 @@ function DialogContent({
4377
4596
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
4378
4597
  showOverlay && /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
4379
4598
  /* @__PURE__ */ jsxRuntime.jsxs(
4380
- DialogPrimitive__namespace.Content,
4599
+ SheetPrimitive__namespace.Content,
4381
4600
  {
4382
4601
  "data-slot": "dialog-content",
4383
4602
  className: cn(
@@ -4408,7 +4627,7 @@ function DialogFooter({ className, ...props }) {
4408
4627
  }
4409
4628
  function DialogTitle({ className, ...props }) {
4410
4629
  return /* @__PURE__ */ jsxRuntime.jsx(
4411
- DialogPrimitive__namespace.Title,
4630
+ SheetPrimitive__namespace.Title,
4412
4631
  {
4413
4632
  "data-slot": "dialog-title",
4414
4633
  className: cn("text-lg font-semibold leading-none", className),
@@ -4421,7 +4640,7 @@ function DialogDescription({
4421
4640
  ...props
4422
4641
  }) {
4423
4642
  return /* @__PURE__ */ jsxRuntime.jsx(
4424
- DialogPrimitive__namespace.Description,
4643
+ SheetPrimitive__namespace.Description,
4425
4644
  {
4426
4645
  "data-slot": "dialog-description",
4427
4646
  className: cn("text-sm text-muted-foreground", className),
@@ -4433,14 +4652,14 @@ function cn2(...inputs) {
4433
4652
  return tailwindMerge.twMerge(clsx2.clsx(inputs));
4434
4653
  }
4435
4654
  function Dialog2({ ...props }) {
4436
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
4655
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
4437
4656
  }
4438
4657
  function DialogPortal2({ ...props }) {
4439
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
4658
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
4440
4659
  }
4441
4660
  function DialogOverlay2({ className, ...props }) {
4442
4661
  return /* @__PURE__ */ jsxRuntime.jsx(
4443
- DialogPrimitive__namespace.Overlay,
4662
+ SheetPrimitive__namespace.Overlay,
4444
4663
  {
4445
4664
  "data-slot": "dialog-overlay",
4446
4665
  className: cn2(
@@ -4460,7 +4679,7 @@ function DialogContent2({
4460
4679
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal2, { "data-slot": "dialog-portal", children: [
4461
4680
  /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay2, {}),
4462
4681
  /* @__PURE__ */ jsxRuntime.jsxs(
4463
- DialogPrimitive__namespace.Content,
4682
+ SheetPrimitive__namespace.Content,
4464
4683
  {
4465
4684
  "data-slot": "dialog-content",
4466
4685
  className: cn2(
@@ -4471,7 +4690,7 @@ function DialogContent2({
4471
4690
  children: [
4472
4691
  children,
4473
4692
  showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
4474
- DialogPrimitive__namespace.Close,
4693
+ SheetPrimitive__namespace.Close,
4475
4694
  {
4476
4695
  "data-slot": "dialog-close",
4477
4696
  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",
@@ -4498,7 +4717,7 @@ function DialogHeader2({ className, ...props }) {
4498
4717
  }
4499
4718
  function DialogTitle2({ className, ...props }) {
4500
4719
  return /* @__PURE__ */ jsxRuntime.jsx(
4501
- DialogPrimitive__namespace.Title,
4720
+ SheetPrimitive__namespace.Title,
4502
4721
  {
4503
4722
  "data-slot": "dialog-title",
4504
4723
  className: cn2("text-lg leading-none font-semibold", className),
@@ -4511,7 +4730,7 @@ function DialogDescription2({
4511
4730
  ...props
4512
4731
  }) {
4513
4732
  return /* @__PURE__ */ jsxRuntime.jsx(
4514
- DialogPrimitive__namespace.Description,
4733
+ SheetPrimitive__namespace.Description,
4515
4734
  {
4516
4735
  "data-slot": "dialog-description",
4517
4736
  className: cn2("text-muted-foreground text-sm", className),
@@ -4586,11 +4805,11 @@ function DialogAlert({
4586
4805
  persistent = false
4587
4806
  }) {
4588
4807
  const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
4589
- const handleCancel = React6.useCallback(() => {
4808
+ const handleCancel = React5.useCallback(() => {
4590
4809
  onCancel?.();
4591
4810
  onOpenChange(false);
4592
4811
  }, [onCancel, onOpenChange]);
4593
- const handleConfirm = React6.useCallback(() => {
4812
+ const handleConfirm = React5.useCallback(() => {
4594
4813
  onConfirm?.();
4595
4814
  }, [onConfirm]);
4596
4815
  return /* @__PURE__ */ jsxRuntime.jsx(Dialog2, { open, onOpenChange: persistent ? () => {
@@ -4674,9 +4893,9 @@ function SortableRow({
4674
4893
  }) {
4675
4894
  const { attributes, listeners, setNodeRef, transform, transition } = sortable.useSortable({
4676
4895
  id: value,
4677
- disabled: name == "columns.0.id"
4896
+ disabled: name === "columns.0.id"
4678
4897
  });
4679
- const style = React6__namespace.useMemo(
4898
+ const style = React5__namespace.useMemo(
4680
4899
  () => ({
4681
4900
  transform: utilities.CSS.Transform.toString(transform),
4682
4901
  transition
@@ -4684,7 +4903,10 @@ function SortableRow({
4684
4903
  [transform, transition]
4685
4904
  );
4686
4905
  const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
4687
- const currentFormColumns = reactHookForm.useWatch({ control, name: "columns" });
4906
+ const currentFormColumns = reactHookForm.useWatch({
4907
+ control,
4908
+ name: "columns"
4909
+ });
4688
4910
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: setNodeRef, style, className: "flex items-center rounded-md bg-white", children: /* @__PURE__ */ jsxRuntime.jsx(
4689
4911
  FormField,
4690
4912
  {
@@ -4701,7 +4923,7 @@ function SortableRow({
4701
4923
  ...listeners,
4702
4924
  className: cn(
4703
4925
  "h-5 w-5 text-[#B9B9B9] focus:outline-none cursor-grab",
4704
- name == "columns.0.id" && "opacity-0 pointer-events-none"
4926
+ name === "columns.0.id" && "opacity-0 pointer-events-none"
4705
4927
  )
4706
4928
  }
4707
4929
  ),
@@ -4710,27 +4932,26 @@ function SortableRow({
4710
4932
  {
4711
4933
  value: field.value,
4712
4934
  onValueChange: field.onChange,
4713
- disabled: name == "columns.0.id",
4935
+ disabled: name === "columns.0.id",
4714
4936
  children: [
4715
4937
  /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
4716
4938
  SelectTrigger,
4717
4939
  {
4718
4940
  className: cn(
4719
4941
  "w-full border-[#DDDDDD] data-[disabled]:opacity-100 aria-invalid:border-[#BB0B0E]",
4720
- name == "columns.0.id" ? "text-[#8B8B8B] bg-[#EAEAEA] cursor-not-allowed" : ""
4942
+ name === "columns.0.id" ? "text-[#8B8B8B] bg-[#EAEAEA] cursor-not-allowed" : "cursor-pointer"
4721
4943
  ),
4722
4944
  children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: "Choose column..." })
4723
4945
  }
4724
4946
  ) }),
4725
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: options.sort(
4947
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { className: "cursor-pointer overflow-hidden rounded-md [&_[data-radix-select-viewport]]:m-0", children: options.sort(
4726
4948
  (a, b) => a.id === field.value ? -1 : b.id === field.value ? 1 : 0
4727
4949
  ).map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
4728
4950
  SelectItem,
4729
4951
  {
4730
4952
  value: opt.id,
4731
- hideCheckIcon: true,
4732
4953
  className: cn(
4733
- "focus:bg-[#e8edea]",
4954
+ "cursor-pointer focus:bg-[#e8edea] first:rounded-t-md last:rounded-b-md hover:text-inherit",
4734
4955
  opt.id === field.value ? "font-bold bg-[#dae5de] focus:bg-[#dae5de]" : ""
4735
4956
  ),
4736
4957
  children: opt.label
@@ -4740,7 +4961,7 @@ function SortableRow({
4740
4961
  ]
4741
4962
  }
4742
4963
  ),
4743
- name == "columns.0.id" ? /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
4964
+ name === "columns.0.id" ? /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
4744
4965
  /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, { className: "h-5 w-5", stroke: "white", fill: "#8B8B8B" }) }),
4745
4966
  /* @__PURE__ */ jsxRuntime.jsx(
4746
4967
  TooltipContent,
@@ -4748,7 +4969,6 @@ function SortableRow({
4748
4969
  align: "start",
4749
4970
  alignOffset: 10,
4750
4971
  className: "bg-[#8B8B8B] rounded-none",
4751
- arrowClassName: "!hidden",
4752
4972
  children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Column cannot be removed." })
4753
4973
  }
4754
4974
  )
@@ -4787,7 +5007,8 @@ var GridSettingsModal = ({
4787
5007
  onClose,
4788
5008
  onSaveColumns
4789
5009
  }) => {
4790
- const [isDragging, setIsDragging] = React6.useState(false);
5010
+ const [isDragging, setIsDragging] = React5.useState(false);
5011
+ const scrollRef = React5.useRef(null);
4791
5012
  const form = reactHookForm.useForm({
4792
5013
  resolver: zod$1.zodResolver(GridSettingsSchema),
4793
5014
  defaultValues: { columns: currentColumns },
@@ -4799,7 +5020,7 @@ var GridSettingsModal = ({
4799
5020
  name: "columns",
4800
5021
  keyName: "fieldId"
4801
5022
  });
4802
- React6.useEffect(() => {
5023
+ React5.useEffect(() => {
4803
5024
  if (isOpen) {
4804
5025
  form.reset({ columns: currentColumns });
4805
5026
  }
@@ -4808,6 +5029,15 @@ var GridSettingsModal = ({
4808
5029
  const isValid5 = await trigger("columns");
4809
5030
  if (isValid5) {
4810
5031
  append({ id: "" });
5032
+ requestAnimationFrame(() => {
5033
+ const container = scrollRef.current;
5034
+ if (container) {
5035
+ container.scrollTo({
5036
+ top: container.scrollHeight,
5037
+ behavior: "smooth"
5038
+ });
5039
+ }
5040
+ });
4811
5041
  } else {
4812
5042
  return;
4813
5043
  }
@@ -4832,8 +5062,8 @@ var GridSettingsModal = ({
4832
5062
  move(oldIndex, newIndex);
4833
5063
  }
4834
5064
  }
4835
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-xl border-0 p-0 overflow-hidden", children: [
4836
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
5065
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { className: "sm:max-w-xl border-0 p-0 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-h-[550px] rounded-lg overflow-hidden", children: [
5066
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0", children: [
4837
5067
  /* @__PURE__ */ jsxRuntime.jsxs(
4838
5068
  "div",
4839
5069
  {
@@ -4849,7 +5079,7 @@ var GridSettingsModal = ({
4849
5079
  type: "button",
4850
5080
  "aria-label": "Close",
4851
5081
  onClick: onClose,
4852
- className: "flex items-center justify-center rounded-md hover:bg-white/10 transition",
5082
+ className: "flex items-center justify-center rounded-md hover:bg-white/10 transition cursor-pointer",
4853
5083
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-6 w-6 text-white" })
4854
5084
  }
4855
5085
  )
@@ -4867,85 +5097,96 @@ var GridSettingsModal = ({
4867
5097
  }
4868
5098
  )
4869
5099
  ] }),
4870
- /* @__PURE__ */ jsxRuntime.jsx(Form, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "mt-6 flex flex-col justify-between", children: [
4871
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-16 my-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 max-h-60 pr-4", children: [
4872
- /* @__PURE__ */ jsxRuntime.jsx(
4873
- SortableRow,
4874
- {
4875
- value: fields[0]?.fieldId,
4876
- control,
4877
- name: `columns.0.id`,
4878
- isDragging,
4879
- availableColumns
4880
- },
4881
- fields[0]?.fieldId
4882
- ),
4883
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ jsxRuntime.jsx(
4884
- core.DndContext,
4885
- {
4886
- sensors,
4887
- collisionDetection: core.closestCenter,
4888
- modifiers: [modifiers.restrictToParentElement, modifiers.restrictToVerticalAxis],
4889
- onDragStart: () => setIsDragging(true),
4890
- onDragEnd: (event) => {
4891
- setIsDragging(false);
4892
- handleDragEnd(event);
4893
- },
4894
- children: /* @__PURE__ */ jsxRuntime.jsx(
4895
- sortable.SortableContext,
5100
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col flex-1 px-12 my-10 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(Form, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col flex-1", children: [
5101
+ /* @__PURE__ */ jsxRuntime.jsx(
5102
+ "div",
5103
+ {
5104
+ ref: scrollRef,
5105
+ className: "flex-1 overflow-y-auto overflow-x-hidden max-h-[35vh] [scrollbar-gutter:stable_both-edges]",
5106
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 px-6", children: [
5107
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "[&_button:not([disabled])]:cursor-pointer", children: /* @__PURE__ */ jsxRuntime.jsx(
5108
+ SortableRow,
5109
+ {
5110
+ value: fields[0]?.fieldId,
5111
+ control,
5112
+ name: `columns.0.id`,
5113
+ isDragging,
5114
+ availableColumns
5115
+ },
5116
+ fields[0]?.fieldId
5117
+ ) }),
5118
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3 [&_button:not([disabled])]:cursor-pointer", children: /* @__PURE__ */ jsxRuntime.jsx(
5119
+ core.DndContext,
4896
5120
  {
4897
- items: fields?.slice(1).map((c) => c?.fieldId),
4898
- strategy: sortable.verticalListSortingStrategy,
4899
- children: fields?.slice(1).map((col, index) => /* @__PURE__ */ jsxRuntime.jsx(
4900
- SortableRow,
5121
+ sensors,
5122
+ collisionDetection: core.closestCenter,
5123
+ modifiers: [modifiers.restrictToParentElement, modifiers.restrictToVerticalAxis],
5124
+ onDragStart: () => setIsDragging(true),
5125
+ onDragEnd: (event) => {
5126
+ setIsDragging(false);
5127
+ handleDragEnd(event);
5128
+ },
5129
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5130
+ sortable.SortableContext,
4901
5131
  {
4902
- value: col?.fieldId,
4903
- control,
4904
- name: `columns.${index + 1}.id`,
4905
- isDragging,
4906
- availableColumns,
4907
- onRemove: () => remove(index + 1)
4908
- },
4909
- col?.fieldId
4910
- ))
5132
+ items: fields?.slice(1).map((c) => c?.fieldId),
5133
+ strategy: sortable.verticalListSortingStrategy,
5134
+ children: fields?.slice(1).map((col, index) => /* @__PURE__ */ jsxRuntime.jsx(
5135
+ SortableRow,
5136
+ {
5137
+ value: col?.fieldId,
5138
+ control,
5139
+ name: `columns.${index + 1}.id`,
5140
+ isDragging,
5141
+ availableColumns,
5142
+ onRemove: () => remove(index + 1)
5143
+ },
5144
+ col?.fieldId
5145
+ ))
5146
+ }
5147
+ )
4911
5148
  }
4912
- )
4913
- }
4914
- ) }),
4915
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-6", children: /* @__PURE__ */ jsxRuntime.jsxs(
4916
- Button,
4917
- {
4918
- type: "button",
4919
- className: cn("bg-[#49865d] text-white w-full rounded-t-lg", addButtonClassname),
4920
- onClick: addColumn,
4921
- disabled: fields.length >= limit,
4922
- children: [
4923
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
4924
- " Add column"
4925
- ]
4926
- }
4927
- ) })
4928
- ] }) }),
4929
- /* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { className: "-mx-6 mt-6 px-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex px-4 justify-between w-full", children: [
4930
- /* @__PURE__ */ jsxRuntime.jsx(
4931
- Button,
4932
- {
4933
- type: "button",
4934
- variant: "outline",
4935
- onClick: onClose,
4936
- className: "w-18 text-[#8B8B8B] border-[#B9B9B9]",
4937
- children: "Cancel"
4938
- }
4939
- ),
4940
- /* @__PURE__ */ jsxRuntime.jsx(
4941
- Button,
4942
- {
4943
- type: "submit",
4944
- className: cn("w-18 bg-[#379A2A] text-white", saveButtonClassname),
4945
- children: "Save"
4946
- }
4947
- )
4948
- ] }) })
5149
+ ) })
5150
+ ] })
5151
+ }
5152
+ ),
5153
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky bottom-0 z-20 flex justify-center bg-white pt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(
5154
+ Button,
5155
+ {
5156
+ type: "button",
5157
+ className: cn(
5158
+ "bg-[#49865d] hover:bg-[#326446] text-white w-[350px] rounded-t-lg transition-colors",
5159
+ addButtonClassname
5160
+ ),
5161
+ onClick: addColumn,
5162
+ disabled: fields.length >= limit,
5163
+ children: [
5164
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
5165
+ " Add column"
5166
+ ]
5167
+ }
5168
+ ) })
5169
+ ] }) }) }),
5170
+ /* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { className: "bottom-0 border-t bg-white", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 px-4 justify-end w-full", children: [
5171
+ /* @__PURE__ */ jsxRuntime.jsx(
5172
+ Button,
5173
+ {
5174
+ type: "button",
5175
+ variant: "outline",
5176
+ onClick: onClose,
5177
+ className: "w-18 text-[#8B8B8B] border-[#B9B9B9]",
5178
+ children: "Cancel"
5179
+ }
5180
+ ),
5181
+ /* @__PURE__ */ jsxRuntime.jsx(
5182
+ Button,
5183
+ {
5184
+ type: "submit",
5185
+ className: cn("w-18 bg-[#379A2A] hover:bg-[#2f8524] text-white", saveButtonClassname),
5186
+ onClick: form.handleSubmit(onSubmit),
5187
+ children: "Save"
5188
+ }
5189
+ )
4949
5190
  ] }) })
4950
5191
  ] }) }) });
4951
5192
  };
@@ -4996,7 +5237,7 @@ var useGridSettingsStore = zustand.create(
4996
5237
  );
4997
5238
  var useGridSettingsStore_default = useGridSettingsStore;
4998
5239
  var ListTable = ({ onTableReady, children }) => {
4999
- React6__namespace.useEffect(() => {
5240
+ React5__namespace.useEffect(() => {
5000
5241
  if (onTableReady) {
5001
5242
  onTableReady({ ready: true });
5002
5243
  }
@@ -5119,7 +5360,7 @@ var InfoIcon = (props) => {
5119
5360
  }
5120
5361
  );
5121
5362
  };
5122
- var InfoIcon_default = React6__namespace.default.memo(InfoIcon);
5363
+ var InfoIcon_default = React5__namespace.default.memo(InfoIcon);
5123
5364
  var Navbar = ({
5124
5365
  className,
5125
5366
  title,
@@ -5144,7 +5385,7 @@ var Navbar = ({
5144
5385
  }) => {
5145
5386
  const { isMobile, isTablet, isDesktop } = useScreenSize_default();
5146
5387
  const Icon2 = lucideReact.CircleHelp;
5147
- const shouldShowSeparator = !separatorDisable && React6.isValidElement(searchButton);
5388
+ const shouldShowSeparator = !separatorDisable && React5.isValidElement(searchButton);
5148
5389
  return /* @__PURE__ */ jsxRuntime.jsxs(
5149
5390
  "nav",
5150
5391
  {
@@ -5155,8 +5396,8 @@ var Navbar = ({
5155
5396
  children: [
5156
5397
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
5157
5398
  headImageURL !== "" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: headImageURL, alt: "", className: cn("w-full h-full", headImageURLClassName) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
5158
- React6.isValidElement(title) ? title : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-xl font-bold", children: title }),
5159
- React6.isValidElement(subTitle) ? subTitle : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-sm font-semibold", children: subTitle })
5399
+ React5.isValidElement(title) ? title : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-xl font-bold", children: title }),
5400
+ React5.isValidElement(subTitle) ? subTitle : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-sm font-semibold", children: subTitle })
5160
5401
  ] }),
5161
5402
  tooltipTitle && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
5162
5403
  /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "text-white hover:opacity-80 ", children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon_default, { className: "w-4" }) }) }),
@@ -5187,10 +5428,10 @@ var Navbar = ({
5187
5428
  ),
5188
5429
  children: [
5189
5430
  tooltipTitle && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
5190
- React6.isValidElement(tooltipIcon) ? tooltipIcon : /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 32, "aria-hidden": "true" }),
5431
+ React5.isValidElement(tooltipIcon) ? tooltipIcon : /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 32, "aria-hidden": "true" }),
5191
5432
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold", children: tooltipTitle })
5192
5433
  ] }),
5193
- React6.isValidElement(tooltipdescription) && tooltipdescription
5434
+ React5.isValidElement(tooltipdescription) && tooltipdescription
5194
5435
  ]
5195
5436
  }
5196
5437
  ),
@@ -5244,13 +5485,106 @@ var Navbar = ({
5244
5485
  }
5245
5486
  ),
5246
5487
  shouldShowSeparator && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", className: "ml-1 w-[1px] h-10 bg-white" }),
5247
- React6.isValidElement(searchButton) ? searchButton : ""
5488
+ React5.isValidElement(searchButton) ? searchButton : ""
5248
5489
  ] })
5249
5490
  ]
5250
5491
  }
5251
5492
  );
5252
5493
  };
5253
- var navbar_default = React6__namespace.default.memo(Navbar);
5494
+ var navbar_default = React5__namespace.default.memo(Navbar);
5495
+ function Sheet({ ...props }) {
5496
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
5497
+ }
5498
+ function SheetTrigger({ ...props }) {
5499
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Trigger, { "data-slot": "sheet-trigger", ...props });
5500
+ }
5501
+ function SheetClose({ ...props }) {
5502
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Close, { "data-slot": "sheet-close", ...props });
5503
+ }
5504
+ function SheetPortal({ ...props }) {
5505
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
5506
+ }
5507
+ function SheetOverlay({ className, ...props }) {
5508
+ return /* @__PURE__ */ jsxRuntime.jsx(
5509
+ SheetPrimitive__namespace.Overlay,
5510
+ {
5511
+ "data-slot": "sheet-overlay",
5512
+ className: cn(
5513
+ "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",
5514
+ className
5515
+ ),
5516
+ ...props
5517
+ }
5518
+ );
5519
+ }
5520
+ function SheetContent({
5521
+ className,
5522
+ children,
5523
+ side = "right",
5524
+ ...props
5525
+ }) {
5526
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
5527
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
5528
+ /* @__PURE__ */ jsxRuntime.jsxs(
5529
+ SheetPrimitive__namespace.Content,
5530
+ {
5531
+ "data-slot": "sheet-content",
5532
+ className: cn(
5533
+ "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",
5534
+ 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",
5535
+ 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",
5536
+ 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",
5537
+ 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",
5538
+ className
5539
+ ),
5540
+ ...props,
5541
+ children: [
5542
+ children,
5543
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetPrimitive__namespace.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: [
5544
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
5545
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
5546
+ ] })
5547
+ ]
5548
+ }
5549
+ )
5550
+ ] });
5551
+ }
5552
+ function SheetHeader({ className, ...props }) {
5553
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5 p-4", className), ...props });
5554
+ }
5555
+ function SheetFooter({ className, ...props }) {
5556
+ return /* @__PURE__ */ jsxRuntime.jsx(
5557
+ "div",
5558
+ {
5559
+ "data-slot": "sheet-footer",
5560
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
5561
+ ...props
5562
+ }
5563
+ );
5564
+ }
5565
+ function SheetTitle({ className, ...props }) {
5566
+ return /* @__PURE__ */ jsxRuntime.jsx(
5567
+ SheetPrimitive__namespace.Title,
5568
+ {
5569
+ "data-slot": "sheet-title",
5570
+ className: cn("text-foreground font-semibold", className),
5571
+ ...props
5572
+ }
5573
+ );
5574
+ }
5575
+ function SheetDescription({
5576
+ className,
5577
+ ...props
5578
+ }) {
5579
+ return /* @__PURE__ */ jsxRuntime.jsx(
5580
+ SheetPrimitive__namespace.Description,
5581
+ {
5582
+ "data-slot": "sheet-description",
5583
+ className: cn("text-muted-foreground text-sm", className),
5584
+ ...props
5585
+ }
5586
+ );
5587
+ }
5254
5588
  var usePreventPageLeaveStore = zustand.create((set) => ({
5255
5589
  isPreventing: false,
5256
5590
  setPreventing: (value) => set({ isPreventing: value })
@@ -5260,7 +5594,7 @@ var usePreventPageLeaveStore_default = usePreventPageLeaveStore;
5260
5594
  // src/components/prevent-page-leave/PreventPageLeave.tsx
5261
5595
  var PreventPageLeave = ({ children }) => {
5262
5596
  const { isPreventing } = usePreventPageLeaveStore();
5263
- React6.useEffect(() => {
5597
+ React5.useEffect(() => {
5264
5598
  if (!isPreventing || typeof window === "undefined") {
5265
5599
  return;
5266
5600
  }
@@ -5278,7 +5612,7 @@ var PreventPageLeave = ({ children }) => {
5278
5612
  var PreventPageLeave_default = PreventPageLeave;
5279
5613
  var usePreventPageLeave = ({ isPrevening }) => {
5280
5614
  const setPreventing = usePreventPageLeaveStore_default((state) => state.setPreventing);
5281
- React6.useEffect(() => {
5615
+ React5.useEffect(() => {
5282
5616
  setPreventing(isPrevening);
5283
5617
  }, [isPrevening, setPreventing]);
5284
5618
  };
@@ -5557,21 +5891,21 @@ function ToolbarPlugin({
5557
5891
  acceptImageMimeTypes
5558
5892
  }) {
5559
5893
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
5560
- const [state, setState] = React6.useState(initialToolbarState);
5561
- const fileInputRef = React6.useRef(null);
5562
- const [isLinkDialogOpen, setLinkDialogOpen] = React6.useState(false);
5563
- const [editingExistingLink, setEditingExistingLink] = React6.useState(false);
5564
- const [linkNodeKey, setLinkNodeKey] = React6.useState(null);
5565
- const [isImageDialogOpen, setImageDialogOpen] = React6.useState(false);
5566
- const [editingExistingImage, setEditingExistingImage] = React6.useState(false);
5567
- const [imageNodeKey, setImageNodeKey] = React6.useState(null);
5894
+ const [state, setState] = React5.useState(initialToolbarState);
5895
+ const fileInputRef = React5.useRef(null);
5896
+ const [isLinkDialogOpen, setLinkDialogOpen] = React5.useState(false);
5897
+ const [editingExistingLink, setEditingExistingLink] = React5.useState(false);
5898
+ const [linkNodeKey, setLinkNodeKey] = React5.useState(null);
5899
+ const [isImageDialogOpen, setImageDialogOpen] = React5.useState(false);
5900
+ const [editingExistingImage, setEditingExistingImage] = React5.useState(false);
5901
+ const [imageNodeKey, setImageNodeKey] = React5.useState(null);
5568
5902
  const linkForm = reactHookForm.useForm({
5569
5903
  defaultValues: { url: "", label: "" }
5570
5904
  });
5571
5905
  const imageForm = reactHookForm.useForm({
5572
5906
  defaultValues: { url: "", alt: "", width: "", height: "" }
5573
5907
  });
5574
- const openImageDialog = React6.useCallback(() => {
5908
+ const openImageDialog = React5.useCallback(() => {
5575
5909
  if (disabled || !allowImageUrlInsert) {
5576
5910
  return;
5577
5911
  }
@@ -5605,7 +5939,7 @@ function ToolbarPlugin({
5605
5939
  setImageNodeKey(targetImage?.getKey() ?? null);
5606
5940
  setImageDialogOpen(true);
5607
5941
  }, [allowImageUrlInsert, disabled, editor, imageForm]);
5608
- const closeImageDialog = React6.useCallback(() => {
5942
+ const closeImageDialog = React5.useCallback(() => {
5609
5943
  setImageDialogOpen(false);
5610
5944
  setEditingExistingImage(false);
5611
5945
  setImageNodeKey(null);
@@ -5614,7 +5948,7 @@ function ToolbarPlugin({
5614
5948
  editor.focus();
5615
5949
  }, 0);
5616
5950
  }, [editor, imageForm]);
5617
- const openLinkDialog = React6.useCallback(() => {
5951
+ const openLinkDialog = React5.useCallback(() => {
5618
5952
  if (disabled) {
5619
5953
  return;
5620
5954
  }
@@ -5654,7 +5988,7 @@ function ToolbarPlugin({
5654
5988
  setLinkNodeKey(detectedLink?.getKey() ?? null);
5655
5989
  setLinkDialogOpen(true);
5656
5990
  }, [disabled, editor, linkForm]);
5657
- const closeLinkDialog = React6.useCallback(() => {
5991
+ const closeLinkDialog = React5.useCallback(() => {
5658
5992
  setLinkDialogOpen(false);
5659
5993
  setEditingExistingLink(false);
5660
5994
  setLinkNodeKey(null);
@@ -5695,7 +6029,7 @@ function ToolbarPlugin({
5695
6029
  });
5696
6030
  closeLinkDialog();
5697
6031
  });
5698
- const handleRemoveLink = React6.useCallback(() => {
6032
+ const handleRemoveLink = React5.useCallback(() => {
5699
6033
  editor.focus();
5700
6034
  editor.update(() => {
5701
6035
  if (linkNodeKey) {
@@ -5712,7 +6046,7 @@ function ToolbarPlugin({
5712
6046
  });
5713
6047
  closeLinkDialog();
5714
6048
  }, [closeLinkDialog, editor, linkNodeKey]);
5715
- const handleLinkDialogOpenChange = React6.useCallback(
6049
+ const handleLinkDialogOpenChange = React5.useCallback(
5716
6050
  (open) => {
5717
6051
  if (open) {
5718
6052
  setLinkDialogOpen(true);
@@ -5722,7 +6056,7 @@ function ToolbarPlugin({
5722
6056
  },
5723
6057
  [closeLinkDialog]
5724
6058
  );
5725
- const updateToolbar = React6.useCallback(() => {
6059
+ const updateToolbar = React5.useCallback(() => {
5726
6060
  const selection = lexical.$getSelection();
5727
6061
  if (!lexical.$isRangeSelection(selection)) {
5728
6062
  return;
@@ -5762,7 +6096,7 @@ function ToolbarPlugin({
5762
6096
  isLink: hasLink
5763
6097
  }));
5764
6098
  }, []);
5765
- React6__namespace.useEffect(() => {
6099
+ React5__namespace.useEffect(() => {
5766
6100
  return utils.mergeRegister(
5767
6101
  editor.registerCommand(
5768
6102
  lexical.CAN_UNDO_COMMAND,
@@ -5793,7 +6127,7 @@ function ToolbarPlugin({
5793
6127
  })
5794
6128
  );
5795
6129
  }, [editor, updateToolbar]);
5796
- const applyBlock = React6.useCallback(
6130
+ const applyBlock = React5.useCallback(
5797
6131
  (nextBlock) => {
5798
6132
  if (disabled) {
5799
6133
  return;
@@ -5855,7 +6189,7 @@ function ToolbarPlugin({
5855
6189
  },
5856
6190
  [disabled, editor, state.blockType]
5857
6191
  );
5858
- const toggleFormat = React6.useCallback(
6192
+ const toggleFormat = React5.useCallback(
5859
6193
  (format5) => {
5860
6194
  if (disabled) {
5861
6195
  return;
@@ -5864,10 +6198,10 @@ function ToolbarPlugin({
5864
6198
  },
5865
6199
  [disabled, editor]
5866
6200
  );
5867
- const toggleLink = React6.useCallback(() => {
6201
+ const toggleLink = React5.useCallback(() => {
5868
6202
  openLinkDialog();
5869
6203
  }, [openLinkDialog]);
5870
- const applyElementFormat = React6.useCallback(
6204
+ const applyElementFormat = React5.useCallback(
5871
6205
  (format5) => {
5872
6206
  if (disabled) {
5873
6207
  return;
@@ -5878,7 +6212,7 @@ function ToolbarPlugin({
5878
6212
  );
5879
6213
  const canInsertImage = allowImageUrlInsert || Boolean(onImageUpload);
5880
6214
  const imageAccept = acceptImageMimeTypes ?? DEFAULT_IMAGE_ACCEPT;
5881
- const handleInsertImage = React6.useCallback(() => {
6215
+ const handleInsertImage = React5.useCallback(() => {
5882
6216
  if (disabled || !canInsertImage) {
5883
6217
  return;
5884
6218
  }
@@ -5889,7 +6223,7 @@ function ToolbarPlugin({
5889
6223
  }
5890
6224
  openImageDialog();
5891
6225
  }, [canInsertImage, disabled, editor, onImageUpload, openImageDialog]);
5892
- const handleFileChange = React6.useCallback(
6226
+ const handleFileChange = React5.useCallback(
5893
6227
  async (event) => {
5894
6228
  if (!onImageUpload) {
5895
6229
  return;
@@ -5979,7 +6313,7 @@ function ToolbarPlugin({
5979
6313
  });
5980
6314
  closeImageDialog();
5981
6315
  });
5982
- const handleImageDialogOpenChange = React6.useCallback(
6316
+ const handleImageDialogOpenChange = React5.useCallback(
5983
6317
  (open) => {
5984
6318
  if (open) {
5985
6319
  setImageDialogOpen(true);
@@ -5989,7 +6323,7 @@ function ToolbarPlugin({
5989
6323
  },
5990
6324
  [closeImageDialog]
5991
6325
  );
5992
- const handleRemoveImage = React6.useCallback(() => {
6326
+ const handleRemoveImage = React5.useCallback(() => {
5993
6327
  if (!imageNodeKey) {
5994
6328
  closeImageDialog();
5995
6329
  return;
@@ -6348,7 +6682,7 @@ function ControlledValuePlugin({
6348
6682
  trackAppliedValue
6349
6683
  }) {
6350
6684
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
6351
- React6__namespace.useEffect(() => {
6685
+ React5__namespace.useEffect(() => {
6352
6686
  if (value == null || trackAppliedValue.current === value) {
6353
6687
  return;
6354
6688
  }
@@ -6372,14 +6706,14 @@ function ControlledValuePlugin({
6372
6706
  }
6373
6707
  function EditableStatePlugin({ editable }) {
6374
6708
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
6375
- React6__namespace.useEffect(() => {
6709
+ React5__namespace.useEffect(() => {
6376
6710
  editor.setEditable(editable);
6377
6711
  }, [editor, editable]);
6378
6712
  return null;
6379
6713
  }
6380
6714
  function ImagesPlugin() {
6381
6715
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
6382
- React6__namespace.useEffect(() => {
6716
+ React5__namespace.useEffect(() => {
6383
6717
  return editor.registerCommand(
6384
6718
  INSERT_IMAGE_COMMAND,
6385
6719
  (payload) => {
@@ -6398,7 +6732,7 @@ function ImagesPlugin() {
6398
6732
  }, [editor]);
6399
6733
  return null;
6400
6734
  }
6401
- var RichText = React6.forwardRef(function RichText2({
6735
+ var RichText = React5.forwardRef(function RichText2({
6402
6736
  value,
6403
6737
  defaultValue,
6404
6738
  onChange,
@@ -6417,11 +6751,11 @@ var RichText = React6.forwardRef(function RichText2({
6417
6751
  id,
6418
6752
  ...rest
6419
6753
  }, ref) {
6420
- const initialSerializedStateRef = React6.useRef(void 0);
6754
+ const initialSerializedStateRef = React5.useRef(void 0);
6421
6755
  if (initialSerializedStateRef.current === void 0) {
6422
6756
  initialSerializedStateRef.current = parseSerializedEditorState(value ?? defaultValue);
6423
6757
  }
6424
- const initialConfig = React6.useMemo(
6758
+ const initialConfig = React5.useMemo(
6425
6759
  () => ({
6426
6760
  namespace: "RichTextEditor",
6427
6761
  editable: !(readOnly || disabled),
@@ -6434,8 +6768,8 @@ var RichText = React6.forwardRef(function RichText2({
6434
6768
  }),
6435
6769
  [disabled, readOnly]
6436
6770
  );
6437
- const appliedValueRef = React6.useRef(value ?? defaultValue);
6438
- const handleChange = React6.useCallback(
6771
+ const appliedValueRef = React5.useRef(value ?? defaultValue);
6772
+ const handleChange = React5.useCallback(
6439
6773
  (editorState, editor) => {
6440
6774
  const serialized = JSON.stringify(editorState.toJSON());
6441
6775
  appliedValueRef.current = serialized;
@@ -6530,47 +6864,34 @@ function Separator2({
6530
6864
  }
6531
6865
  );
6532
6866
  }
6533
- function Switch({ className, ...props }) {
6867
+ function useIsMobile(breakpoint = 768) {
6868
+ const [isMobile, setIsMobile] = React5.useState(() => {
6869
+ if (typeof window === "undefined") {
6870
+ return false;
6871
+ }
6872
+ return window.innerWidth < breakpoint;
6873
+ });
6874
+ React5.useEffect(() => {
6875
+ function onResize() {
6876
+ setIsMobile(window.innerWidth < breakpoint);
6877
+ }
6878
+ window.addEventListener("resize", onResize);
6879
+ window.addEventListener("orientationchange", onResize);
6880
+ onResize();
6881
+ return () => {
6882
+ window.removeEventListener("resize", onResize);
6883
+ window.removeEventListener("orientationchange", onResize);
6884
+ };
6885
+ }, [breakpoint]);
6886
+ return isMobile;
6887
+ }
6888
+ function Skeleton({ className, ...props }) {
6534
6889
  return /* @__PURE__ */ jsxRuntime.jsx(
6535
- SwitchPrimitive__namespace.Root,
6890
+ "div",
6536
6891
  {
6537
- "data-slot": "switch",
6538
- className: cn(
6539
- "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]",
6540
- "data-[state=checked]:bg-[#379A2A] data-[state=unchecked]:bg-[#EFEFEF]",
6541
- "dark:data-[state=unchecked]:bg-input/80",
6542
- "focus-visible:border-ring focus-visible:ring-ring/50",
6543
- "disabled:bg-gray-300 disabled:data-[state=checked]:bg-[#A5D6A7] disabled:data-[state=unchecked]:bg-[#E0E0E0]",
6544
- "disabled:cursor-not-allowed disabled:opacity-70",
6545
- "shadow-inner",
6546
- className
6547
- ),
6548
- ...props,
6549
- children: /* @__PURE__ */ jsxRuntime.jsx(
6550
- SwitchPrimitive__namespace.Thumb,
6551
- {
6552
- "data-slot": "switch-thumb",
6553
- className: cn(
6554
- "bg-white block size-3.5 rounded-full ring-0 transition-transform",
6555
- "data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5",
6556
- "disabled:bg-gray-100"
6557
- )
6558
- }
6559
- )
6560
- }
6561
- );
6562
- }
6563
- function Textarea({ className, autoResize = true, ...props }) {
6564
- return /* @__PURE__ */ jsxRuntime.jsx(
6565
- "textarea",
6566
- {
6567
- "data-slot": "textarea",
6568
- className: cn(
6569
- "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",
6570
- autoResize ? "field-sizing-content min-h-16" : "field-sizing-fixed",
6571
- className
6572
- ),
6573
- ...props
6892
+ "data-slot": "skeleton",
6893
+ className: cn("bg-accent animate-pulse rounded-md", className),
6894
+ ...props
6574
6895
  }
6575
6896
  );
6576
6897
  }
@@ -6585,6 +6906,9 @@ __export(ui_exports, {
6585
6906
  Button: () => Button,
6586
6907
  Checkbox: () => Checkbox,
6587
6908
  ClearButton: () => ClearButton,
6909
+ Collapsible: () => Collapsible,
6910
+ CollapsibleContent: () => CollapsibleContent2,
6911
+ CollapsibleTrigger: () => CollapsibleTrigger2,
6588
6912
  DatePicker: () => DatePicker,
6589
6913
  Dialog: () => Dialog,
6590
6914
  DialogContent: () => DialogContent,
@@ -6622,6 +6946,39 @@ __export(ui_exports, {
6622
6946
  SelectTrigger: () => SelectTrigger,
6623
6947
  SelectValue: () => SelectValue,
6624
6948
  Separator: () => Separator2,
6949
+ Sheet: () => Sheet,
6950
+ SheetClose: () => SheetClose,
6951
+ SheetContent: () => SheetContent,
6952
+ SheetDescription: () => SheetDescription,
6953
+ SheetFooter: () => SheetFooter,
6954
+ SheetHeader: () => SheetHeader,
6955
+ SheetTitle: () => SheetTitle,
6956
+ SheetTrigger: () => SheetTrigger,
6957
+ Sidebar: () => Sidebar,
6958
+ SidebarContent: () => SidebarContent,
6959
+ SidebarFooter: () => SidebarFooter,
6960
+ SidebarGroup: () => SidebarGroup,
6961
+ SidebarGroupAction: () => SidebarGroupAction,
6962
+ SidebarGroupContent: () => SidebarGroupContent,
6963
+ SidebarGroupLabel: () => SidebarGroupLabel,
6964
+ SidebarHeader: () => SidebarHeader,
6965
+ SidebarInput: () => SidebarInput,
6966
+ SidebarInset: () => SidebarInset,
6967
+ SidebarLayout: () => SidebarLayout,
6968
+ SidebarMenu: () => SidebarMenu,
6969
+ SidebarMenuAction: () => SidebarMenuAction,
6970
+ SidebarMenuBadge: () => SidebarMenuBadge,
6971
+ SidebarMenuButton: () => SidebarMenuButton,
6972
+ SidebarMenuItem: () => SidebarMenuItem,
6973
+ SidebarMenuSkeleton: () => SidebarMenuSkeleton,
6974
+ SidebarMenuSub: () => SidebarMenuSub,
6975
+ SidebarMenuSubButton: () => SidebarMenuSubButton,
6976
+ SidebarMenuSubItem: () => SidebarMenuSubItem,
6977
+ SidebarProvider: () => SidebarProvider,
6978
+ SidebarRail: () => SidebarRail,
6979
+ SidebarSeparator: () => SidebarSeparator,
6980
+ SidebarTrigger: () => SidebarTrigger,
6981
+ Skeleton: () => Skeleton,
6625
6982
  Spinner: () => Spinner,
6626
6983
  Switch: () => Switch,
6627
6984
  Table: () => Table,
@@ -6640,8 +6997,53 @@ __export(ui_exports, {
6640
6997
  TooltipTrigger: () => TooltipTrigger2,
6641
6998
  buttonVariants: () => buttonVariants,
6642
6999
  spinnerVariants: () => spinnerVariants,
6643
- useFormField: () => useFormField
7000
+ useFormField: () => useFormField,
7001
+ useSidebar: () => useSidebar
6644
7002
  });
7003
+ function Switch({ className, ...props }) {
7004
+ return /* @__PURE__ */ jsxRuntime.jsx(
7005
+ SwitchPrimitive__namespace.Root,
7006
+ {
7007
+ "data-slot": "switch",
7008
+ className: cn(
7009
+ "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]",
7010
+ "data-[state=checked]:bg-[#379A2A] data-[state=unchecked]:bg-[#EFEFEF]",
7011
+ "dark:data-[state=unchecked]:bg-input/80",
7012
+ "focus-visible:border-ring focus-visible:ring-ring/50",
7013
+ "disabled:bg-gray-300 disabled:data-[state=checked]:bg-[#A5D6A7] disabled:data-[state=unchecked]:bg-[#E0E0E0]",
7014
+ "disabled:cursor-not-allowed disabled:opacity-70",
7015
+ "shadow-inner",
7016
+ className
7017
+ ),
7018
+ ...props,
7019
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7020
+ SwitchPrimitive__namespace.Thumb,
7021
+ {
7022
+ "data-slot": "switch-thumb",
7023
+ className: cn(
7024
+ "bg-white block size-3.5 rounded-full ring-0 transition-transform",
7025
+ "data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5",
7026
+ "disabled:bg-gray-100"
7027
+ )
7028
+ }
7029
+ )
7030
+ }
7031
+ );
7032
+ }
7033
+ function Textarea({ className, autoResize = true, ...props }) {
7034
+ return /* @__PURE__ */ jsxRuntime.jsx(
7035
+ "textarea",
7036
+ {
7037
+ "data-slot": "textarea",
7038
+ className: cn(
7039
+ "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",
7040
+ autoResize ? "field-sizing-content min-h-16" : "field-sizing-fixed",
7041
+ className
7042
+ ),
7043
+ ...props
7044
+ }
7045
+ );
7046
+ }
6645
7047
  function TooltipProvider2({
6646
7048
  delayDuration = 0,
6647
7049
  ...props
@@ -6686,6 +7088,594 @@ function TooltipContent2({
6686
7088
  }
6687
7089
  ) });
6688
7090
  }
7091
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
7092
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
7093
+ var SIDEBAR_WIDTH = "16rem";
7094
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
7095
+ var SIDEBAR_WIDTH_ICON = "3rem";
7096
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
7097
+ var SidebarContext = React5__namespace.createContext(null);
7098
+ function useSidebar() {
7099
+ const context = React5__namespace.useContext(SidebarContext);
7100
+ if (!context) {
7101
+ throw new Error("useSidebar must be used within a SidebarProvider.");
7102
+ }
7103
+ return context;
7104
+ }
7105
+ function SidebarProvider({
7106
+ defaultOpen = true,
7107
+ open: openProp,
7108
+ onOpenChange: setOpenProp,
7109
+ className,
7110
+ style,
7111
+ children,
7112
+ ...props
7113
+ }) {
7114
+ const isMobile = useIsMobile();
7115
+ const [openMobile, setOpenMobile] = React5__namespace.useState(false);
7116
+ const [_open, _setOpen] = React5__namespace.useState(defaultOpen);
7117
+ const open = openProp ?? _open;
7118
+ const setOpen = React5__namespace.useCallback(
7119
+ (value) => {
7120
+ const openState = typeof value === "function" ? value(open) : value;
7121
+ if (setOpenProp) {
7122
+ setOpenProp(openState);
7123
+ } else {
7124
+ _setOpen(openState);
7125
+ }
7126
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
7127
+ },
7128
+ [setOpenProp, open]
7129
+ );
7130
+ const toggleSidebar = React5__namespace.useCallback(() => {
7131
+ return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
7132
+ }, [isMobile, setOpen, setOpenMobile]);
7133
+ React5__namespace.useEffect(() => {
7134
+ const handleKeyDown = (event) => {
7135
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
7136
+ event.preventDefault();
7137
+ toggleSidebar();
7138
+ }
7139
+ };
7140
+ window.addEventListener("keydown", handleKeyDown);
7141
+ return () => window.removeEventListener("keydown", handleKeyDown);
7142
+ }, [toggleSidebar]);
7143
+ const state = open ? "expanded" : "collapsed";
7144
+ const contextValue = React5__namespace.useMemo(
7145
+ () => ({
7146
+ state,
7147
+ open,
7148
+ setOpen,
7149
+ isMobile,
7150
+ openMobile,
7151
+ setOpenMobile,
7152
+ toggleSidebar
7153
+ }),
7154
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
7155
+ );
7156
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider2, { delayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsx(
7157
+ "div",
7158
+ {
7159
+ "data-slot": "sidebar-wrapper",
7160
+ style: {
7161
+ "--sidebar-width": SIDEBAR_WIDTH,
7162
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
7163
+ ...style
7164
+ },
7165
+ className: cn(
7166
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
7167
+ className
7168
+ ),
7169
+ ...props,
7170
+ children
7171
+ }
7172
+ ) }) });
7173
+ }
7174
+ function Sidebar({
7175
+ side = "left",
7176
+ variant = "sidebar",
7177
+ collapsible = "offcanvas",
7178
+ className,
7179
+ children,
7180
+ ...props
7181
+ }) {
7182
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
7183
+ if (collapsible === "none") {
7184
+ return /* @__PURE__ */ jsxRuntime.jsx(
7185
+ "div",
7186
+ {
7187
+ "data-slot": "sidebar",
7188
+ className: cn(
7189
+ "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
7190
+ className
7191
+ ),
7192
+ ...props,
7193
+ children
7194
+ }
7195
+ );
7196
+ }
7197
+ if (isMobile) {
7198
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
7199
+ SheetContent,
7200
+ {
7201
+ "data-sidebar": "sidebar",
7202
+ "data-slot": "sidebar",
7203
+ "data-mobile": "true",
7204
+ className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
7205
+ style: {
7206
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
7207
+ },
7208
+ side,
7209
+ children: [
7210
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { className: "sr-only", children: [
7211
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Sidebar" }),
7212
+ /* @__PURE__ */ jsxRuntime.jsx(SheetDescription, { children: "Displays the mobile sidebar." })
7213
+ ] }),
7214
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full flex-col", children })
7215
+ ]
7216
+ }
7217
+ ) });
7218
+ }
7219
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7220
+ "div",
7221
+ {
7222
+ className: "group peer text-sidebar-foreground hidden md:block",
7223
+ "data-state": state,
7224
+ "data-collapsible": state === "collapsed" ? collapsible : "",
7225
+ "data-variant": variant,
7226
+ "data-side": side,
7227
+ "data-slot": "sidebar",
7228
+ children: [
7229
+ /* @__PURE__ */ jsxRuntime.jsx(
7230
+ "div",
7231
+ {
7232
+ "data-slot": "sidebar-gap",
7233
+ className: cn(
7234
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
7235
+ "group-data-[collapsible=offcanvas]:w-0",
7236
+ "group-data-[side=right]:rotate-180",
7237
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
7238
+ )
7239
+ }
7240
+ ),
7241
+ /* @__PURE__ */ jsxRuntime.jsx(
7242
+ "div",
7243
+ {
7244
+ "data-slot": "sidebar-container",
7245
+ className: cn(
7246
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
7247
+ 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)]",
7248
+ // Adjust the padding for floating and inset variants.
7249
+ 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",
7250
+ className
7251
+ ),
7252
+ ...props,
7253
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7254
+ "div",
7255
+ {
7256
+ "data-sidebar": "sidebar",
7257
+ "data-slot": "sidebar-inner",
7258
+ 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",
7259
+ children
7260
+ }
7261
+ )
7262
+ }
7263
+ )
7264
+ ]
7265
+ }
7266
+ );
7267
+ }
7268
+ function SidebarTrigger({ className, onClick, ...props }) {
7269
+ const { toggleSidebar } = useSidebar();
7270
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7271
+ Button,
7272
+ {
7273
+ "data-sidebar": "trigger",
7274
+ "data-slot": "sidebar-trigger",
7275
+ variant: "ghost",
7276
+ size: "icon",
7277
+ className: cn("size-7", className),
7278
+ onClick: (event) => {
7279
+ onClick?.(event);
7280
+ toggleSidebar();
7281
+ },
7282
+ ...props,
7283
+ children: [
7284
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftIcon, {}),
7285
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
7286
+ ]
7287
+ }
7288
+ );
7289
+ }
7290
+ function SidebarRail({ className, ...props }) {
7291
+ const { toggleSidebar } = useSidebar();
7292
+ return /* @__PURE__ */ jsxRuntime.jsx(
7293
+ "button",
7294
+ {
7295
+ "data-sidebar": "rail",
7296
+ "data-slot": "sidebar-rail",
7297
+ "aria-label": "Toggle Sidebar",
7298
+ tabIndex: -1,
7299
+ onClick: toggleSidebar,
7300
+ title: "Toggle Sidebar",
7301
+ className: cn(
7302
+ "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",
7303
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
7304
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
7305
+ "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
7306
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
7307
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
7308
+ className
7309
+ ),
7310
+ ...props
7311
+ }
7312
+ );
7313
+ }
7314
+ function SidebarInset({ className, ...props }) {
7315
+ return /* @__PURE__ */ jsxRuntime.jsx(
7316
+ "main",
7317
+ {
7318
+ "data-slot": "sidebar-inset",
7319
+ className: cn(
7320
+ "bg-background relative flex w-full flex-1 flex-col",
7321
+ "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",
7322
+ className
7323
+ ),
7324
+ ...props
7325
+ }
7326
+ );
7327
+ }
7328
+ function SidebarInput({ className, ...props }) {
7329
+ return /* @__PURE__ */ jsxRuntime.jsx(
7330
+ InputPrimitive,
7331
+ {
7332
+ "data-slot": "sidebar-input",
7333
+ "data-sidebar": "input",
7334
+ className: cn("bg-background h-8 w-full shadow-none", className),
7335
+ ...props
7336
+ }
7337
+ );
7338
+ }
7339
+ function SidebarHeader({ className, ...props }) {
7340
+ return /* @__PURE__ */ jsxRuntime.jsx(
7341
+ "div",
7342
+ {
7343
+ "data-slot": "sidebar-header",
7344
+ "data-sidebar": "header",
7345
+ className: cn("flex flex-col gap-2 p-2", className),
7346
+ ...props
7347
+ }
7348
+ );
7349
+ }
7350
+ function SidebarFooter({ className, ...props }) {
7351
+ return /* @__PURE__ */ jsxRuntime.jsx(
7352
+ "div",
7353
+ {
7354
+ "data-slot": "sidebar-footer",
7355
+ "data-sidebar": "footer",
7356
+ className: cn("flex flex-col gap-2 p-2", className),
7357
+ ...props
7358
+ }
7359
+ );
7360
+ }
7361
+ function SidebarSeparator({ className, ...props }) {
7362
+ return /* @__PURE__ */ jsxRuntime.jsx(
7363
+ Separator2,
7364
+ {
7365
+ "data-slot": "sidebar-separator",
7366
+ "data-sidebar": "separator",
7367
+ className: cn("bg-sidebar-border mx-2 w-auto", className),
7368
+ ...props
7369
+ }
7370
+ );
7371
+ }
7372
+ function SidebarContent({ className, ...props }) {
7373
+ return /* @__PURE__ */ jsxRuntime.jsx(
7374
+ "div",
7375
+ {
7376
+ "data-slot": "sidebar-content",
7377
+ "data-sidebar": "content",
7378
+ className: cn(
7379
+ "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
7380
+ className
7381
+ ),
7382
+ ...props
7383
+ }
7384
+ );
7385
+ }
7386
+ function SidebarGroup({ className, ...props }) {
7387
+ return /* @__PURE__ */ jsxRuntime.jsx(
7388
+ "div",
7389
+ {
7390
+ "data-slot": "sidebar-group",
7391
+ "data-sidebar": "group",
7392
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
7393
+ ...props
7394
+ }
7395
+ );
7396
+ }
7397
+ function SidebarGroupLabel({
7398
+ className,
7399
+ asChild = false,
7400
+ ...props
7401
+ }) {
7402
+ const Comp = asChild ? reactSlot.Slot : "div";
7403
+ return /* @__PURE__ */ jsxRuntime.jsx(
7404
+ Comp,
7405
+ {
7406
+ "data-slot": "sidebar-group-label",
7407
+ "data-sidebar": "group-label",
7408
+ className: cn(
7409
+ "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",
7410
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
7411
+ className
7412
+ ),
7413
+ ...props
7414
+ }
7415
+ );
7416
+ }
7417
+ function SidebarGroupAction({
7418
+ className,
7419
+ asChild = false,
7420
+ ...props
7421
+ }) {
7422
+ const Comp = asChild ? reactSlot.Slot : "button";
7423
+ return /* @__PURE__ */ jsxRuntime.jsx(
7424
+ Comp,
7425
+ {
7426
+ "data-slot": "sidebar-group-action",
7427
+ "data-sidebar": "group-action",
7428
+ className: cn(
7429
+ "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",
7430
+ // Increases the hit area of the button on mobile.
7431
+ "after:absolute after:-inset-2 md:after:hidden",
7432
+ "group-data-[collapsible=icon]:hidden",
7433
+ className
7434
+ ),
7435
+ ...props
7436
+ }
7437
+ );
7438
+ }
7439
+ function SidebarGroupContent({ className, ...props }) {
7440
+ return /* @__PURE__ */ jsxRuntime.jsx(
7441
+ "div",
7442
+ {
7443
+ "data-slot": "sidebar-group-content",
7444
+ "data-sidebar": "group-content",
7445
+ className: cn("w-full text-sm", className),
7446
+ ...props
7447
+ }
7448
+ );
7449
+ }
7450
+ function SidebarMenu({ className, ...props }) {
7451
+ return /* @__PURE__ */ jsxRuntime.jsx(
7452
+ "ul",
7453
+ {
7454
+ "data-slot": "sidebar-menu",
7455
+ "data-sidebar": "menu",
7456
+ className: cn("flex w-full min-w-0 flex-col gap-1", className),
7457
+ ...props
7458
+ }
7459
+ );
7460
+ }
7461
+ function SidebarMenuItem({ className, ...props }) {
7462
+ return /* @__PURE__ */ jsxRuntime.jsx(
7463
+ "li",
7464
+ {
7465
+ "data-slot": "sidebar-menu-item",
7466
+ "data-sidebar": "menu-item",
7467
+ className: cn("group/menu-item relative", className),
7468
+ ...props
7469
+ }
7470
+ );
7471
+ }
7472
+ var sidebarMenuButtonVariants = classVarianceAuthority.cva(
7473
+ "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",
7474
+ {
7475
+ variants: {
7476
+ variant: {
7477
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
7478
+ 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))]"
7479
+ },
7480
+ size: {
7481
+ default: "h-8 text-sm",
7482
+ sm: "h-7 text-xs",
7483
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
7484
+ }
7485
+ },
7486
+ defaultVariants: {
7487
+ variant: "default",
7488
+ size: "default"
7489
+ }
7490
+ }
7491
+ );
7492
+ function SidebarMenuButton({
7493
+ asChild = false,
7494
+ isActive = false,
7495
+ variant = "default",
7496
+ size = "default",
7497
+ tooltip,
7498
+ className,
7499
+ ...props
7500
+ }) {
7501
+ const Comp = asChild ? reactSlot.Slot : "button";
7502
+ const { isMobile, state } = useSidebar();
7503
+ const button = /* @__PURE__ */ jsxRuntime.jsx(
7504
+ Comp,
7505
+ {
7506
+ "data-slot": "sidebar-menu-button",
7507
+ "data-sidebar": "menu-button",
7508
+ "data-size": size,
7509
+ "data-active": isActive,
7510
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className),
7511
+ ...props
7512
+ }
7513
+ );
7514
+ if (!tooltip) {
7515
+ return button;
7516
+ }
7517
+ if (typeof tooltip === "string") {
7518
+ tooltip = {
7519
+ children: tooltip
7520
+ };
7521
+ }
7522
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip2, { children: [
7523
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger2, { asChild: true, children: button }),
7524
+ /* @__PURE__ */ jsxRuntime.jsx(
7525
+ TooltipContent2,
7526
+ {
7527
+ side: "right",
7528
+ align: "center",
7529
+ hidden: state !== "collapsed" || isMobile,
7530
+ ...tooltip
7531
+ }
7532
+ )
7533
+ ] });
7534
+ }
7535
+ function SidebarMenuAction({
7536
+ className,
7537
+ asChild = false,
7538
+ showOnHover = false,
7539
+ ...props
7540
+ }) {
7541
+ const Comp = asChild ? reactSlot.Slot : "button";
7542
+ return /* @__PURE__ */ jsxRuntime.jsx(
7543
+ Comp,
7544
+ {
7545
+ "data-slot": "sidebar-menu-action",
7546
+ "data-sidebar": "menu-action",
7547
+ className: cn(
7548
+ "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",
7549
+ // Increases the hit area of the button on mobile.
7550
+ "after:absolute after:-inset-2 md:after:hidden",
7551
+ "peer-data-[size=sm]/menu-button:top-1",
7552
+ "peer-data-[size=default]/menu-button:top-1.5",
7553
+ "peer-data-[size=lg]/menu-button:top-2.5",
7554
+ "group-data-[collapsible=icon]:hidden",
7555
+ 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",
7556
+ className
7557
+ ),
7558
+ ...props
7559
+ }
7560
+ );
7561
+ }
7562
+ function SidebarMenuBadge({ className, ...props }) {
7563
+ return /* @__PURE__ */ jsxRuntime.jsx(
7564
+ "div",
7565
+ {
7566
+ "data-slot": "sidebar-menu-badge",
7567
+ "data-sidebar": "menu-badge",
7568
+ className: cn(
7569
+ "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",
7570
+ "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
7571
+ "peer-data-[size=sm]/menu-button:top-1",
7572
+ "peer-data-[size=default]/menu-button:top-1.5",
7573
+ "peer-data-[size=lg]/menu-button:top-2.5",
7574
+ "group-data-[collapsible=icon]:hidden",
7575
+ className
7576
+ ),
7577
+ ...props
7578
+ }
7579
+ );
7580
+ }
7581
+ function SidebarMenuSkeleton({
7582
+ className,
7583
+ showIcon = false,
7584
+ ...props
7585
+ }) {
7586
+ const width = React5__namespace.useMemo(() => {
7587
+ return `${Math.floor(Math.random() * 40) + 50}%`;
7588
+ }, []);
7589
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7590
+ "div",
7591
+ {
7592
+ "data-slot": "sidebar-menu-skeleton",
7593
+ "data-sidebar": "menu-skeleton",
7594
+ className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
7595
+ ...props,
7596
+ children: [
7597
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" }),
7598
+ /* @__PURE__ */ jsxRuntime.jsx(
7599
+ Skeleton,
7600
+ {
7601
+ className: "h-4 max-w-(--skeleton-width) flex-1",
7602
+ "data-sidebar": "menu-skeleton-text",
7603
+ style: {
7604
+ "--skeleton-width": width
7605
+ }
7606
+ }
7607
+ )
7608
+ ]
7609
+ }
7610
+ );
7611
+ }
7612
+ function SidebarMenuSub({ className, ...props }) {
7613
+ return /* @__PURE__ */ jsxRuntime.jsx(
7614
+ "ul",
7615
+ {
7616
+ "data-slot": "sidebar-menu-sub",
7617
+ "data-sidebar": "menu-sub",
7618
+ className: cn(
7619
+ "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",
7620
+ "group-data-[collapsible=icon]:hidden",
7621
+ className
7622
+ ),
7623
+ ...props
7624
+ }
7625
+ );
7626
+ }
7627
+ function SidebarMenuSubItem({ className, ...props }) {
7628
+ return /* @__PURE__ */ jsxRuntime.jsx(
7629
+ "li",
7630
+ {
7631
+ "data-slot": "sidebar-menu-sub-item",
7632
+ "data-sidebar": "menu-sub-item",
7633
+ className: cn("group/menu-sub-item relative", className),
7634
+ ...props
7635
+ }
7636
+ );
7637
+ }
7638
+ function SidebarMenuSubButton({
7639
+ asChild = false,
7640
+ size = "md",
7641
+ isActive = false,
7642
+ className,
7643
+ ...props
7644
+ }) {
7645
+ const Comp = asChild ? reactSlot.Slot : "a";
7646
+ return /* @__PURE__ */ jsxRuntime.jsx(
7647
+ Comp,
7648
+ {
7649
+ "data-slot": "sidebar-menu-sub-button",
7650
+ "data-sidebar": "menu-sub-button",
7651
+ "data-size": size,
7652
+ "data-active": isActive,
7653
+ className: cn(
7654
+ "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",
7655
+ "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
7656
+ size === "sm" && "text-xs",
7657
+ size === "md" && "text-sm",
7658
+ "group-data-[collapsible=icon]:hidden",
7659
+ className
7660
+ ),
7661
+ ...props
7662
+ }
7663
+ );
7664
+ }
7665
+ function SidebarLayout({
7666
+ sidebar,
7667
+ children,
7668
+ layoutProps,
7669
+ sidebarProps,
7670
+ insetProps,
7671
+ ...providerProps
7672
+ }) {
7673
+ const { className: layoutClassName, ...restLayoutProps } = layoutProps ?? {};
7674
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarProvider, { ...providerProps, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "sidebar-layout", ...restLayoutProps, className: cn("flex", layoutClassName), children: [
7675
+ /* @__PURE__ */ jsxRuntime.jsx(Sidebar, { ...sidebarProps, children: sidebar }),
7676
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarInset, { ...insetProps, children })
7677
+ ] }) });
7678
+ }
6689
7679
 
6690
7680
  exports.Accordion = Accordion;
6691
7681
  exports.AccordionContent = AccordionContent;
@@ -6695,6 +7685,9 @@ exports.AdvanceSearch = AdvanceSearch_default;
6695
7685
  exports.ArrowIcon = arrow_default;
6696
7686
  exports.Button = Button;
6697
7687
  exports.Checkbox = Checkbox;
7688
+ exports.Collapsible = Collapsible;
7689
+ exports.CollapsibleContent = CollapsibleContent2;
7690
+ exports.CollapsibleTrigger = CollapsibleTrigger2;
6698
7691
  exports.DataTable = DataTable_default;
6699
7692
  exports.DatePicker = DatePicker2;
6700
7693
  exports.Dialog = Dialog;
@@ -6714,6 +7707,7 @@ exports.FormMessage = FormMessage;
6714
7707
  exports.GridSettingsModal = GridSettingsModal_default;
6715
7708
  exports.HeaderCell = HeaderCell_default;
6716
7709
  exports.Input = Input;
7710
+ exports.Label = Label2;
6717
7711
  exports.List = List_default;
6718
7712
  exports.ListContainer = container_default;
6719
7713
  exports.ListHeader = header_default;
@@ -6743,6 +7737,39 @@ exports.SelectSeparator = SelectSeparator;
6743
7737
  exports.SelectTrigger = SelectTrigger;
6744
7738
  exports.SelectValue = SelectValue;
6745
7739
  exports.Separator = Separator2;
7740
+ exports.Sheet = Sheet;
7741
+ exports.SheetClose = SheetClose;
7742
+ exports.SheetContent = SheetContent;
7743
+ exports.SheetDescription = SheetDescription;
7744
+ exports.SheetFooter = SheetFooter;
7745
+ exports.SheetHeader = SheetHeader;
7746
+ exports.SheetTitle = SheetTitle;
7747
+ exports.SheetTrigger = SheetTrigger;
7748
+ exports.Sidebar = Sidebar;
7749
+ exports.SidebarContent = SidebarContent;
7750
+ exports.SidebarFooter = SidebarFooter;
7751
+ exports.SidebarGroup = SidebarGroup;
7752
+ exports.SidebarGroupAction = SidebarGroupAction;
7753
+ exports.SidebarGroupContent = SidebarGroupContent;
7754
+ exports.SidebarGroupLabel = SidebarGroupLabel;
7755
+ exports.SidebarHeader = SidebarHeader;
7756
+ exports.SidebarInput = SidebarInput;
7757
+ exports.SidebarInset = SidebarInset;
7758
+ exports.SidebarLayout = SidebarLayout;
7759
+ exports.SidebarMenu = SidebarMenu;
7760
+ exports.SidebarMenuAction = SidebarMenuAction;
7761
+ exports.SidebarMenuBadge = SidebarMenuBadge;
7762
+ exports.SidebarMenuButton = SidebarMenuButton;
7763
+ exports.SidebarMenuItem = SidebarMenuItem;
7764
+ exports.SidebarMenuSkeleton = SidebarMenuSkeleton;
7765
+ exports.SidebarMenuSub = SidebarMenuSub;
7766
+ exports.SidebarMenuSubButton = SidebarMenuSubButton;
7767
+ exports.SidebarMenuSubItem = SidebarMenuSubItem;
7768
+ exports.SidebarProvider = SidebarProvider;
7769
+ exports.SidebarRail = SidebarRail;
7770
+ exports.SidebarSeparator = SidebarSeparator;
7771
+ exports.SidebarTrigger = SidebarTrigger;
7772
+ exports.Skeleton = Skeleton;
6746
7773
  exports.SuiCalendarIcon = calendar_default;
6747
7774
  exports.SuiCheckIcon = check_default;
6748
7775
  exports.SuiDotsVerticalIcon = dots_vertical_default;
@@ -6779,6 +7806,7 @@ exports.useMediaQuery = useMediaQuery_default;
6779
7806
  exports.usePreventPageLeave = usePreventPageLeave_default;
6780
7807
  exports.usePreventPageLeaveStore = usePreventPageLeaveStore_default;
6781
7808
  exports.useScreenSize = useScreenSize_default;
7809
+ exports.useSidebar = useSidebar;
6782
7810
  exports.useTruncated = useTruncated_default;
6783
7811
  //# sourceMappingURL=index.js.map
6784
7812
  //# sourceMappingURL=index.js.map