@postxl/ui-components 1.3.6 → 1.3.7

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
@@ -2,6 +2,7 @@ import { clsx } from "clsx";
2
2
  import { twMerge } from "tailwind-merge";
3
3
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
4
4
  import { ArrowLeftIcon, ArrowRightIcon, CalendarIcon, CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, Cross1Icon, Cross2Icon, DotFilledIcon, DotsHorizontalIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, DragHandleDots2Icon, EnterFullScreenIcon, MagnifyingGlassIcon } from "@radix-ui/react-icons";
5
+ import * as React$49 from "react";
5
6
  import * as React$48 from "react";
6
7
  import * as React$47 from "react";
7
8
  import * as React$46 from "react";
@@ -59,7 +60,7 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar";
59
60
  import { DayPicker, getDefaultClassNames } from "react-day-picker";
60
61
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
61
62
  import useEmblaCarousel from "embla-carousel-react";
62
- import { BaselineIcon, CalendarIcon as CalendarIcon$1, CheckIcon as CheckIcon$1, CheckSquareIcon, ChevronDownIcon as ChevronDownIcon$1, ChevronUpIcon as ChevronUpIcon$1, CopyIcon, EraserIcon, EyeOffIcon, FilterX, GripHorizontalIcon, HashIcon, ListChecksIcon, ListIcon, PanelLeftIcon, PinIcon, PinOffIcon, PlusIcon, Settings2Icon, SquareIcon, TextInitialIcon, TrashIcon, XIcon } from "lucide-react";
63
+ import { BaselineIcon, CalendarIcon as CalendarIcon$1, CheckIcon as CheckIcon$1, CheckSquareIcon, ChevronDownIcon as ChevronDownIcon$1, ChevronRightIcon as ChevronRightIcon$1, ChevronUpIcon as ChevronUpIcon$1, CopyIcon, EraserIcon, EyeOffIcon, FilterX, GripHorizontalIcon, HashIcon, ListChecksIcon, ListIcon, ListTreeIcon, MinusIcon, PanelLeftIcon, PinIcon, PinOffIcon, PlusIcon, Settings2Icon, SquareIcon, TextInitialIcon, TrashIcon, XIcon } from "lucide-react";
63
64
  import * as CollapsePrimitive from "@radix-ui/react-collapsible";
64
65
  import { Command as Command$1 } from "cmdk";
65
66
  import * as DialogPrimitive from "@radix-ui/react-dialog";
@@ -110,13 +111,13 @@ function testId(baseId, suffix) {
110
111
  //#endregion
111
112
  //#region src/accordion/accordion.tsx
112
113
  const Accordion = AccordionPrimitive.Root;
113
- const AccordionItem = React$48.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
114
+ const AccordionItem = React$49.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
114
115
  ref,
115
116
  className: cn("border-b", className),
116
117
  ...props
117
118
  }));
118
119
  AccordionItem.displayName = "AccordionItem";
119
- const AccordionTrigger = React$48.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
120
+ const AccordionTrigger = React$49.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
120
121
  className: "flex",
121
122
  children: /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, {
122
123
  ref,
@@ -126,7 +127,7 @@ const AccordionTrigger = React$48.forwardRef(({ className, children,...props },
126
127
  })
127
128
  }));
128
129
  AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
129
- const AccordionContent = React$48.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
130
+ const AccordionContent = React$49.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
130
131
  ref,
131
132
  className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
132
133
  ...props,
@@ -146,21 +147,21 @@ const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm [
146
147
  } },
147
148
  defaultVariants: { variant: "default" }
148
149
  });
149
- const Alert = React$47.forwardRef(({ className, variant,...props }, ref) => /* @__PURE__ */ jsx("div", {
150
+ const Alert = React$48.forwardRef(({ className, variant,...props }, ref) => /* @__PURE__ */ jsx("div", {
150
151
  ref,
151
152
  role: "alert",
152
153
  className: cn(alertVariants({ variant }), className),
153
154
  ...props
154
155
  }));
155
156
  Alert.displayName = "Alert";
156
- const AlertTitle = React$47.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx("h5", {
157
+ const AlertTitle = React$48.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx("h5", {
157
158
  ref,
158
159
  className: cn("mb-1 font-medium leading-none tracking-tight", className),
159
160
  ...props,
160
161
  children
161
162
  }));
162
163
  AlertTitle.displayName = "AlertTitle";
163
- const AlertDescription = React$47.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
164
+ const AlertDescription = React$48.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
164
165
  ref,
165
166
  className: cn("text-sm [&_p]:leading-relaxed", className),
166
167
  ...props
@@ -219,13 +220,13 @@ function Button({ className, variant, size, asChild = false, __e2e_test_id__,...
219
220
  const AlertDialog = AlertDialogPrimitive.Root;
220
221
  const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
221
222
  const AlertDialogPortal = AlertDialogPrimitive.Portal;
222
- const AlertDialogOverlay = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Overlay, {
223
+ const AlertDialogOverlay = React$47.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Overlay, {
223
224
  className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className),
224
225
  ...props,
225
226
  ref
226
227
  }));
227
228
  AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
228
- const AlertDialogContent = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialogPrimitive.Content, {
229
+ const AlertDialogContent = React$47.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialogPrimitive.Content, {
229
230
  ref,
230
231
  className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className),
231
232
  ...props
@@ -241,25 +242,25 @@ const AlertDialogFooter = ({ className,...props }) => /* @__PURE__ */ jsx("div",
241
242
  ...props
242
243
  });
243
244
  AlertDialogFooter.displayName = "AlertDialogFooter";
244
- const AlertDialogTitle = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, {
245
+ const AlertDialogTitle = React$47.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, {
245
246
  ref,
246
247
  className: cn("text-lg font-semibold", className),
247
248
  ...props
248
249
  }));
249
250
  AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
250
- const AlertDialogDescription = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, {
251
+ const AlertDialogDescription = React$47.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, {
251
252
  ref,
252
253
  className: cn("text-sm text-muted-foreground", className),
253
254
  ...props
254
255
  }));
255
256
  AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
256
- const AlertDialogAction = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, {
257
+ const AlertDialogAction = React$47.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, {
257
258
  ref,
258
259
  className: cn(buttonVariants(), className),
259
260
  ...props
260
261
  }));
261
262
  AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
262
- const AlertDialogCancel = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Cancel, {
263
+ const AlertDialogCancel = React$47.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Cancel, {
263
264
  ref,
264
265
  className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className),
265
266
  ...props
@@ -268,19 +269,19 @@ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
268
269
 
269
270
  //#endregion
270
271
  //#region src/avatar/avatar.tsx
271
- const Avatar = React$45.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Root, {
272
+ const Avatar = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Root, {
272
273
  ref,
273
274
  className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
274
275
  ...props
275
276
  }));
276
277
  Avatar.displayName = AvatarPrimitive.Root.displayName;
277
- const AvatarImage = React$45.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Image, {
278
+ const AvatarImage = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Image, {
278
279
  ref,
279
280
  className: cn("aspect-square h-full w-full", className),
280
281
  ...props
281
282
  }));
282
283
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
283
- const AvatarFallback = React$45.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Fallback, {
284
+ const AvatarFallback = React$46.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Fallback, {
284
285
  ref,
285
286
  className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className),
286
287
  ...props
@@ -326,25 +327,25 @@ function Badge({ className, variant, size, asChild = false,...props }) {
326
327
 
327
328
  //#endregion
328
329
  //#region src/breadcrumb/breadcrumb.tsx
329
- const Breadcrumb = React$44.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", {
330
+ const Breadcrumb = React$45.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", {
330
331
  ref,
331
332
  "aria-label": "breadcrumb",
332
333
  ...props
333
334
  }));
334
335
  Breadcrumb.displayName = "Breadcrumb";
335
- const BreadcrumbList = React$44.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("ol", {
336
+ const BreadcrumbList = React$45.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("ol", {
336
337
  ref,
337
338
  className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className),
338
339
  ...props
339
340
  }));
340
341
  BreadcrumbList.displayName = "BreadcrumbList";
341
- const BreadcrumbItem = React$44.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("li", {
342
+ const BreadcrumbItem = React$45.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("li", {
342
343
  ref,
343
344
  className: cn("inline-flex items-center gap-1.5", className),
344
345
  ...props
345
346
  }));
346
347
  BreadcrumbItem.displayName = "BreadcrumbItem";
347
- const BreadcrumbLink = React$44.forwardRef(({ asChild, className,...props }, ref) => {
348
+ const BreadcrumbLink = React$45.forwardRef(({ asChild, className,...props }, ref) => {
348
349
  const Comp = asChild ? Slot : "a";
349
350
  return /* @__PURE__ */ jsx(Comp, {
350
351
  ref,
@@ -353,7 +354,7 @@ const BreadcrumbLink = React$44.forwardRef(({ asChild, className,...props }, ref
353
354
  });
354
355
  });
355
356
  BreadcrumbLink.displayName = "BreadcrumbLink";
356
- const BreadcrumbPage = React$44.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("span", {
357
+ const BreadcrumbPage = React$45.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("span", {
357
358
  ref,
358
359
  "aria-disabled": "true",
359
360
  "aria-current": "page",
@@ -383,8 +384,8 @@ BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
383
384
  //#region src/calendar/calendar.tsx
384
385
  function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", showYearNavigation = false, formatters, components, __e2e_test_id__,...props }) {
385
386
  const defaultClassNames = getDefaultClassNames();
386
- const [rangeSelectionStep, setRangeSelectionStep] = React$43.useState("from");
387
- const handleDayClick = React$43.useCallback((day, modifiers, e) => {
387
+ const [rangeSelectionStep, setRangeSelectionStep] = React$44.useState("from");
388
+ const handleDayClick = React$44.useCallback((day, modifiers, e) => {
388
389
  if (props.mode === "range") {
389
390
  const range = props.selected;
390
391
  if (rangeSelectionStep === "from") {
@@ -414,8 +415,8 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
414
415
  fromMonth = props.startMonth ?? new Date(nowYear - 100, 0);
415
416
  toMonth = props.endMonth ?? new Date(nowYear + 100, 11);
416
417
  }
417
- const [currentMonth, setCurrentMonth] = React$43.useState(props.defaultMonth ?? props.month ?? new Date());
418
- React$43.useEffect(() => {
418
+ const [currentMonth, setCurrentMonth] = React$44.useState(props.defaultMonth ?? props.month ?? new Date());
419
+ React$44.useEffect(() => {
419
420
  if (props.month) setCurrentMonth(props.month);
420
421
  }, [props.month]);
421
422
  const addMonths = (date, months) => {
@@ -559,8 +560,8 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
559
560
  }
560
561
  function CalendarDayButton({ className, day, modifiers,...props }) {
561
562
  const defaultClassNames = getDefaultClassNames();
562
- const ref = React$43.useRef(null);
563
- React$43.useEffect(() => {
563
+ const ref = React$44.useRef(null);
564
+ React$44.useEffect(() => {
564
565
  if (modifiers.focused) ref.current?.focus();
565
566
  }, [modifiers.focused]);
566
567
  return /* @__PURE__ */ jsx(Button, {
@@ -579,38 +580,38 @@ function CalendarDayButton({ className, day, modifiers,...props }) {
579
580
 
580
581
  //#endregion
581
582
  //#region src/card/card.tsx
582
- const Card = React$42.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
583
+ const Card = React$43.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
583
584
  ref,
584
585
  className: cn("rounded-xl border bg-card text-card-foreground shadow", className),
585
586
  ...props
586
587
  }));
587
588
  Card.displayName = "Card";
588
- const CardHeader = React$42.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
589
+ const CardHeader = React$43.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
589
590
  ref,
590
591
  className: cn("flex flex-col space-y-1.5 p-6", className),
591
592
  ...props
592
593
  }));
593
594
  CardHeader.displayName = "CardHeader";
594
- const CardTitle = React$42.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx("h3", {
595
+ const CardTitle = React$43.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsx("h3", {
595
596
  ref,
596
597
  className: cn("font-semibold leading-none tracking-tight", className),
597
598
  ...props,
598
599
  children
599
600
  }));
600
601
  CardTitle.displayName = "CardTitle";
601
- const CardDescription = React$42.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("p", {
602
+ const CardDescription = React$43.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("p", {
602
603
  ref,
603
604
  className: cn("text-sm text-muted-foreground", className),
604
605
  ...props
605
606
  }));
606
607
  CardDescription.displayName = "CardDescription";
607
- const CardContent = React$42.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
608
+ const CardContent = React$43.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
608
609
  ref,
609
610
  className: cn("p-6 pt-0", className),
610
611
  ...props
611
612
  }));
612
613
  CardContent.displayName = "CardContent";
613
- const CardFooter = React$42.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
614
+ const CardFooter = React$43.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx("div", {
614
615
  ref,
615
616
  className: cn("flex items-center p-6 pt-0", className),
616
617
  ...props
@@ -621,7 +622,7 @@ CardFooter.displayName = "CardFooter";
621
622
  //#region src/card-hover/card-hover.tsx
622
623
  const HoverCard = HoverCardPrimitive.Root;
623
624
  const HoverCardTrigger = HoverCardPrimitive.Trigger;
624
- const HoverCardContent = React$41.forwardRef(({ className, align = "center", sideOffset = 4,...props }, ref) => /* @__PURE__ */ jsx(HoverCardPrimitive.Content, {
625
+ const HoverCardContent = React$42.forwardRef(({ className, align = "center", sideOffset = 4,...props }, ref) => /* @__PURE__ */ jsx(HoverCardPrimitive.Content, {
625
626
  ref,
626
627
  align,
627
628
  sideOffset,
@@ -632,31 +633,31 @@ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
632
633
 
633
634
  //#endregion
634
635
  //#region src/carousel/carousel.tsx
635
- const CarouselContext = React$40.createContext(null);
636
+ const CarouselContext = React$41.createContext(null);
636
637
  function useCarousel() {
637
- const context = React$40.useContext(CarouselContext);
638
+ const context = React$41.useContext(CarouselContext);
638
639
  if (!context) throw new Error("useCarousel must be used within a <Carousel />");
639
640
  return context;
640
641
  }
641
- const Carousel = React$40.forwardRef(({ orientation = "horizontal", opts, setApi, plugins, className, children,...props }, ref) => {
642
+ const Carousel = React$41.forwardRef(({ orientation = "horizontal", opts, setApi, plugins, className, children,...props }, ref) => {
642
643
  const [carouselRef, api] = useEmblaCarousel({
643
644
  ...opts,
644
645
  axis: orientation === "horizontal" ? "x" : "y"
645
646
  }, plugins);
646
- const [canScrollPrev, setCanScrollPrev] = React$40.useState(false);
647
- const [canScrollNext, setCanScrollNext] = React$40.useState(false);
648
- const onSelect = React$40.useCallback(() => {
647
+ const [canScrollPrev, setCanScrollPrev] = React$41.useState(false);
648
+ const [canScrollNext, setCanScrollNext] = React$41.useState(false);
649
+ const onSelect = React$41.useCallback(() => {
649
650
  if (!api) return;
650
651
  setCanScrollPrev(api.canScrollPrev());
651
652
  setCanScrollNext(api.canScrollNext());
652
653
  }, [api]);
653
- const scrollPrev = React$40.useCallback(() => {
654
+ const scrollPrev = React$41.useCallback(() => {
654
655
  api?.scrollPrev();
655
656
  }, [api]);
656
- const scrollNext = React$40.useCallback(() => {
657
+ const scrollNext = React$41.useCallback(() => {
657
658
  api?.scrollNext();
658
659
  }, [api]);
659
- const handleKeyDown = React$40.useCallback((event) => {
660
+ const handleKeyDown = React$41.useCallback((event) => {
660
661
  if (event.key === "ArrowLeft") {
661
662
  event.preventDefault();
662
663
  scrollPrev();
@@ -665,11 +666,11 @@ const Carousel = React$40.forwardRef(({ orientation = "horizontal", opts, setApi
665
666
  scrollNext();
666
667
  }
667
668
  }, [scrollPrev, scrollNext]);
668
- React$40.useEffect(() => {
669
+ React$41.useEffect(() => {
669
670
  if (!api || !setApi) return;
670
671
  setApi(api);
671
672
  }, [api, setApi]);
672
- React$40.useEffect(() => {
673
+ React$41.useEffect(() => {
673
674
  if (!api) return;
674
675
  onSelect();
675
676
  api.on("reInit", onSelect);
@@ -710,7 +711,7 @@ const Carousel = React$40.forwardRef(({ orientation = "horizontal", opts, setApi
710
711
  });
711
712
  });
712
713
  Carousel.displayName = "Carousel";
713
- const CarouselContent = React$40.forwardRef(({ className,...props }, ref) => {
714
+ const CarouselContent = React$41.forwardRef(({ className,...props }, ref) => {
714
715
  const { carouselRef, orientation } = useCarousel();
715
716
  return /* @__PURE__ */ jsx("div", {
716
717
  ref: carouselRef,
@@ -723,7 +724,7 @@ const CarouselContent = React$40.forwardRef(({ className,...props }, ref) => {
723
724
  });
724
725
  });
725
726
  CarouselContent.displayName = "CarouselContent";
726
- const CarouselItem = React$40.forwardRef(({ className,...props }, ref) => {
727
+ const CarouselItem = React$41.forwardRef(({ className,...props }, ref) => {
727
728
  const { orientation } = useCarousel();
728
729
  return /* @__PURE__ */ jsx("div", {
729
730
  ref,
@@ -733,7 +734,7 @@ const CarouselItem = React$40.forwardRef(({ className,...props }, ref) => {
733
734
  });
734
735
  });
735
736
  CarouselItem.displayName = "CarouselItem";
736
- const CarouselPrevious = React$40.forwardRef(({ className, variant = "outline", size = "icon",...props }, ref) => {
737
+ const CarouselPrevious = React$41.forwardRef(({ className, variant = "outline", size = "icon",...props }, ref) => {
737
738
  const { orientation, scrollPrev, canScrollPrev } = useCarousel();
738
739
  return /* @__PURE__ */ jsxs(Button, {
739
740
  ref,
@@ -750,7 +751,7 @@ const CarouselPrevious = React$40.forwardRef(({ className, variant = "outline",
750
751
  });
751
752
  });
752
753
  CarouselPrevious.displayName = "CarouselPrevious";
753
- const CarouselNext = React$40.forwardRef(({ className, variant = "outline", size = "icon",...props }, ref) => {
754
+ const CarouselNext = React$41.forwardRef(({ className, variant = "outline", size = "icon",...props }, ref) => {
754
755
  const { orientation, scrollNext, canScrollNext } = useCarousel();
755
756
  return /* @__PURE__ */ jsxs(Button, {
756
757
  ref,
@@ -785,7 +786,8 @@ const checkboxVariants = cva("cursor-pointer peer appearance-none rounded-sm bor
785
786
  checkIcon: {
786
787
  default: "cross",
787
788
  check: "check",
788
- square: "square"
789
+ square: "square",
790
+ minus: "minus"
789
791
  },
790
792
  iconStyle: {
791
793
  default: "text-foreground",
@@ -808,6 +810,7 @@ function Checkbox({ label, className, variant, checkIcon, checkboxSize, iconStyl
808
810
  fill: "var(--muted-foreground)",
809
811
  className: "size-1/3"
810
812
  });
813
+ else if (checkIcon === "minus") icon = /* @__PURE__ */ jsx(MinusIcon, {});
811
814
  return /* @__PURE__ */ jsxs("div", {
812
815
  className: cn("relative flex gap-2 items-center", className),
813
816
  "data-test-id": __e2e_test_id__,
@@ -935,7 +938,7 @@ function DialogDescription({ className,...props }) {
935
938
 
936
939
  //#endregion
937
940
  //#region src/command-palette/command-palette.tsx
938
- const CommandPalette = React$39.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1, {
941
+ const CommandPalette = React$40.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1, {
939
942
  ref,
940
943
  className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className),
941
944
  ...props
@@ -953,7 +956,7 @@ const CommandPaletteDialog = ({ children,...props }) => {
953
956
  })
954
957
  });
955
958
  };
956
- const CommandPaletteInput = React$39.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsxs("div", {
959
+ const CommandPaletteInput = React$40.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsxs("div", {
957
960
  className: "flex items-center border-b px-3",
958
961
  "data-cmdk-input-wrapper": "",
959
962
  children: [/* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), /* @__PURE__ */ jsx(Command$1.Input, {
@@ -963,31 +966,31 @@ const CommandPaletteInput = React$39.forwardRef(({ className,...props }, ref) =>
963
966
  })]
964
967
  }));
965
968
  CommandPaletteInput.displayName = Command$1.Input.displayName;
966
- const CommandPaletteList = React$39.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.List, {
969
+ const CommandPaletteList = React$40.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.List, {
967
970
  ref,
968
971
  className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
969
972
  ...props
970
973
  }));
971
974
  CommandPaletteList.displayName = Command$1.List.displayName;
972
- const CommandPaletteEmpty = React$39.forwardRef((props, ref) => /* @__PURE__ */ jsx(Command$1.Empty, {
975
+ const CommandPaletteEmpty = React$40.forwardRef((props, ref) => /* @__PURE__ */ jsx(Command$1.Empty, {
973
976
  ref,
974
977
  className: "py-6 text-center text-sm",
975
978
  ...props
976
979
  }));
977
980
  CommandPaletteEmpty.displayName = Command$1.Empty.displayName;
978
- const CommandPaletteGroup = React$39.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.Group, {
981
+ const CommandPaletteGroup = React$40.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.Group, {
979
982
  ref,
980
983
  className: cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className),
981
984
  ...props
982
985
  }));
983
986
  CommandPaletteGroup.displayName = Command$1.Group.displayName;
984
- const CommandPaletteSeparator = React$39.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.Separator, {
987
+ const CommandPaletteSeparator = React$40.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.Separator, {
985
988
  ref,
986
989
  className: cn("-mx-1 h-px bg-border", className),
987
990
  ...props
988
991
  }));
989
992
  CommandPaletteSeparator.displayName = Command$1.Separator.displayName;
990
- const CommandPaletteItem = React$39.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.Item, {
993
+ const CommandPaletteItem = React$40.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(Command$1.Item, {
991
994
  ref,
992
995
  className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50", className),
993
996
  ...props
@@ -1063,8 +1066,8 @@ const frameworks = [
1063
1066
  }
1064
1067
  ];
1065
1068
  function ComboboxDemo() {
1066
- const [open, setOpen] = React$38.useState(false);
1067
- const [value, setValue] = React$38.useState("");
1069
+ const [open, setOpen] = React$39.useState(false);
1070
+ const [value, setValue] = React$39.useState("");
1068
1071
  return /* @__PURE__ */ jsxs(Popover, {
1069
1072
  open,
1070
1073
  onOpenChange: setOpen,
@@ -1304,32 +1307,32 @@ const ContextMenuGroup = ContextMenuPrimitive.Group;
1304
1307
  const ContextMenuPortal = ContextMenuPrimitive.Portal;
1305
1308
  const ContextMenuSub = ContextMenuPrimitive.Sub;
1306
1309
  const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
1307
- const ContextMenuSubTrigger = React$37.forwardRef(({ className, inset, children,...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.SubTrigger, {
1310
+ const ContextMenuSubTrigger = React$38.forwardRef(({ className, inset, children,...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.SubTrigger, {
1308
1311
  ref,
1309
1312
  className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className),
1310
1313
  ...props,
1311
1314
  children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })]
1312
1315
  }));
1313
1316
  ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
1314
- const ContextMenuSubContent = React$37.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.SubContent, {
1317
+ const ContextMenuSubContent = React$38.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.SubContent, {
1315
1318
  ref,
1316
1319
  className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
1317
1320
  ...props
1318
1321
  }));
1319
1322
  ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
1320
- const ContextMenuContent = React$37.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Content, {
1323
+ const ContextMenuContent = React$38.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Content, {
1321
1324
  ref,
1322
1325
  className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
1323
1326
  ...props
1324
1327
  }) }));
1325
1328
  ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
1326
- const ContextMenuItem = React$37.forwardRef(({ className, inset,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Item, {
1329
+ const ContextMenuItem = React$38.forwardRef(({ className, inset,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Item, {
1327
1330
  ref,
1328
1331
  className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className),
1329
1332
  ...props
1330
1333
  }));
1331
1334
  ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
1332
- const ContextMenuCheckboxItem = React$37.forwardRef(({ className, children, checked,...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.CheckboxItem, {
1335
+ const ContextMenuCheckboxItem = React$38.forwardRef(({ className, children, checked,...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.CheckboxItem, {
1333
1336
  ref,
1334
1337
  className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
1335
1338
  checked,
@@ -1340,7 +1343,7 @@ const ContextMenuCheckboxItem = React$37.forwardRef(({ className, children, chec
1340
1343
  }), children]
1341
1344
  }));
1342
1345
  ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
1343
- const ContextMenuRadioItem = React$37.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.RadioItem, {
1346
+ const ContextMenuRadioItem = React$38.forwardRef(({ className, children,...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.RadioItem, {
1344
1347
  ref,
1345
1348
  className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
1346
1349
  ...props,
@@ -1350,13 +1353,13 @@ const ContextMenuRadioItem = React$37.forwardRef(({ className, children,...props
1350
1353
  }), children]
1351
1354
  }));
1352
1355
  ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
1353
- const ContextMenuLabel = React$37.forwardRef(({ className, inset,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Label, {
1356
+ const ContextMenuLabel = React$38.forwardRef(({ className, inset,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Label, {
1354
1357
  ref,
1355
1358
  className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className),
1356
1359
  ...props
1357
1360
  }));
1358
1361
  ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
1359
- const ContextMenuSeparator = React$37.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Separator, {
1362
+ const ContextMenuSeparator = React$38.forwardRef(({ className,...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Separator, {
1360
1363
  ref,
1361
1364
  className: cn("-mx-1 my-1 h-px bg-border", className),
1362
1365
  ...props
@@ -1501,7 +1504,7 @@ function DropdownMenuSubContent({ className,...props }) {
1501
1504
  const TooltipProvider = TooltipPrimitive.Provider;
1502
1505
  const Tooltip = TooltipPrimitive.Root;
1503
1506
  const TooltipTrigger = TooltipPrimitive.Trigger;
1504
- const TooltipContent = React$36.forwardRef(({ className, sideOffset = 4,...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Content, {
1507
+ const TooltipContent = React$37.forwardRef(({ className, sideOffset = 4,...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Content, {
1505
1508
  ref,
1506
1509
  sideOffset,
1507
1510
  className: cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
@@ -1996,6 +1999,10 @@ function getColumnVariant(variant) {
1996
1999
  icon: ListChecksIcon,
1997
2000
  label: "Multi-select"
1998
2001
  };
2002
+ case "hierarchy": return {
2003
+ icon: ListTreeIcon,
2004
+ label: "Hierarchy"
2005
+ };
1999
2006
  case "checkbox": return {
2000
2007
  icon: CheckSquareIcon,
2001
2008
  label: "Checkbox"
@@ -2008,7 +2015,7 @@ function getColumnVariant(variant) {
2008
2015
  }
2009
2016
  }
2010
2017
  function DataGridColumnHeader({ header, table, className, onPointerDown,...props }) {
2011
- const [open, setOpen] = React$35.useState(false);
2018
+ const [open, setOpen] = React$36.useState(false);
2012
2019
  const column = header.column;
2013
2020
  const label = column.columnDef.meta?.label ? column.columnDef.meta.label : typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
2014
2021
  const isAnyColumnResizing = table.getState().columnSizingInfo.isResizingColumn;
@@ -2017,7 +2024,7 @@ function DataGridColumnHeader({ header, table, className, onPointerDown,...props
2017
2024
  const pinnedPosition = column.getIsPinned();
2018
2025
  const isPinnedLeft = pinnedPosition === "left";
2019
2026
  const isPinnedRight = pinnedPosition === "right";
2020
- const onSortingChange = React$35.useCallback((direction) => {
2027
+ const onSortingChange = React$36.useCallback((direction) => {
2021
2028
  table.setSorting((prev) => {
2022
2029
  const existingSortIndex = prev.findIndex((sort) => sort.id === column.id);
2023
2030
  const newSort = {
@@ -2031,19 +2038,19 @@ function DataGridColumnHeader({ header, table, className, onPointerDown,...props
2031
2038
  } else return [...prev, newSort];
2032
2039
  });
2033
2040
  }, [column.id, table]);
2034
- const onSortRemove = React$35.useCallback(() => {
2041
+ const onSortRemove = React$36.useCallback(() => {
2035
2042
  table.setSorting((prev) => prev.filter((sort) => sort.id !== column.id));
2036
2043
  }, [column.id, table]);
2037
- const onLeftPin = React$35.useCallback(() => {
2044
+ const onLeftPin = React$36.useCallback(() => {
2038
2045
  column.pin("left");
2039
2046
  }, [column]);
2040
- const onRightPin = React$35.useCallback(() => {
2047
+ const onRightPin = React$36.useCallback(() => {
2041
2048
  column.pin("right");
2042
2049
  }, [column]);
2043
- const onUnpin = React$35.useCallback(() => {
2050
+ const onUnpin = React$36.useCallback(() => {
2044
2051
  column.pin(false);
2045
2052
  }, [column]);
2046
- const onTriggerPointerDown = React$35.useCallback((event) => {
2053
+ const onTriggerPointerDown = React$36.useCallback((event) => {
2047
2054
  onPointerDown?.(event);
2048
2055
  if (event.defaultPrevented) return;
2049
2056
  if (event.button !== 0) return;
@@ -2155,7 +2162,7 @@ function DataGridColumnHeader({ header, table, className, onPointerDown,...props
2155
2162
  })
2156
2163
  ] });
2157
2164
  }
2158
- const DataGridColumnResizer = React$35.memo(DataGridColumnResizerImpl, (prev, next) => {
2165
+ const DataGridColumnResizer = React$36.memo(DataGridColumnResizerImpl, (prev, next) => {
2159
2166
  const prevColumn = prev.header.column;
2160
2167
  const nextColumn = next.header.column;
2161
2168
  if (prevColumn.getIsResizing() !== nextColumn.getIsResizing() || prevColumn.getSize() !== nextColumn.getSize()) return false;
@@ -2164,7 +2171,7 @@ const DataGridColumnResizer = React$35.memo(DataGridColumnResizerImpl, (prev, ne
2164
2171
  });
2165
2172
  function DataGridColumnResizerImpl({ header, table, label }) {
2166
2173
  const defaultColumnDef = table._getDefaultColumnDef();
2167
- const onDoubleClick = React$35.useCallback(() => {
2174
+ const onDoubleClick = React$36.useCallback(() => {
2168
2175
  header.column.resetSize();
2169
2176
  }, [header.column]);
2170
2177
  return /* @__PURE__ */ jsx("div", {
@@ -2273,7 +2280,7 @@ function DataGridContextMenu({ table }) {
2273
2280
  onRowsDelete
2274
2281
  });
2275
2282
  }
2276
- const ContextMenu$1 = React$34.memo(ContextMenuImpl, (prev, next) => {
2283
+ const ContextMenu$1 = React$35.memo(ContextMenuImpl, (prev, next) => {
2277
2284
  if (prev.contextMenu.open !== next.contextMenu.open) return false;
2278
2285
  if (!next.contextMenu.open) return true;
2279
2286
  if (prev.contextMenu.x !== next.contextMenu.x) return false;
@@ -2284,7 +2291,7 @@ const ContextMenu$1 = React$34.memo(ContextMenuImpl, (prev, next) => {
2284
2291
  return true;
2285
2292
  });
2286
2293
  function ContextMenuImpl({ table, dataGridRef, contextMenu, onContextMenuOpenChange, selectionState, onDataUpdate, onRowsDelete }) {
2287
- const triggerStyle = React$34.useMemo(() => ({
2294
+ const triggerStyle = React$35.useMemo(() => ({
2288
2295
  position: "fixed",
2289
2296
  left: `${contextMenu.x}px`,
2290
2297
  top: `${contextMenu.y}px`,
@@ -2297,11 +2304,11 @@ function ContextMenuImpl({ table, dataGridRef, contextMenu, onContextMenuOpenCha
2297
2304
  pointerEvents: "none",
2298
2305
  opacity: 0
2299
2306
  }), [contextMenu.x, contextMenu.y]);
2300
- const onCloseAutoFocus = React$34.useCallback((event) => {
2307
+ const onCloseAutoFocus = React$35.useCallback((event) => {
2301
2308
  event.preventDefault();
2302
2309
  dataGridRef?.current?.focus();
2303
2310
  }, [dataGridRef]);
2304
- const onCopy = React$34.useCallback(async () => {
2311
+ const onCopy = React$35.useCallback(async () => {
2305
2312
  if (!selectionState?.selectedCells || selectionState.selectedCells.size === 0) return;
2306
2313
  const rows = table.getRowModel().rows;
2307
2314
  const columnIds = [];
@@ -2340,7 +2347,7 @@ function ContextMenuImpl({ table, dataGridRef, contextMenu, onContextMenuOpenCha
2340
2347
  await navigator.clipboard.writeText(tsvData);
2341
2348
  toast$1.success(`${selectionState.selectedCells.size} cell${selectionState.selectedCells.size !== 1 ? "s" : ""} copied`);
2342
2349
  }, [table, selectionState]);
2343
- const canClear = React$34.useMemo(() => {
2350
+ const canClear = React$35.useMemo(() => {
2344
2351
  if (!selectionState?.selectedCells || selectionState.selectedCells.size === 0) return false;
2345
2352
  const visibleCols = table.getVisibleLeafColumns();
2346
2353
  const rows = table.getRowModel().rows;
@@ -2357,7 +2364,7 @@ function ContextMenuImpl({ table, dataGridRef, contextMenu, onContextMenuOpenCha
2357
2364
  }
2358
2365
  return true;
2359
2366
  }, [selectionState, table]);
2360
- const onClear = React$34.useCallback(() => {
2367
+ const onClear = React$35.useCallback(() => {
2361
2368
  if (!selectionState?.selectedCells || selectionState.selectedCells.size === 0) return;
2362
2369
  if (!canClear) return;
2363
2370
  const updates = [];
@@ -2376,7 +2383,7 @@ function ContextMenuImpl({ table, dataGridRef, contextMenu, onContextMenuOpenCha
2376
2383
  selectionState,
2377
2384
  canClear
2378
2385
  ]);
2379
- const onDelete = React$34.useCallback(async () => {
2386
+ const onDelete = React$35.useCallback(async () => {
2380
2387
  if (!selectionState?.selectedCells || selectionState.selectedCells.size === 0) return;
2381
2388
  const rowIndices = new Set();
2382
2389
  for (const cellKey of selectionState.selectedCells) {
@@ -2453,12 +2460,12 @@ function composeRefs(...refs) {
2453
2460
  * Accepts callback refs and RefObject(s)
2454
2461
  */
2455
2462
  function useComposedRefs(...refs) {
2456
- return React$33.useCallback(composeRefs(...refs), refs);
2463
+ return React$34.useCallback(composeRefs(...refs), refs);
2457
2464
  }
2458
2465
 
2459
2466
  //#endregion
2460
2467
  //#region src/data-grid/data-grid-row.tsx
2461
- const DataGridRow = React$32.memo(DataGridRowImpl, (prev, next) => {
2468
+ const DataGridRow = React$33.memo(DataGridRowImpl, (prev, next) => {
2462
2469
  if (prev.row.id !== next.row.id) return false;
2463
2470
  if (prev.row.original !== next.row.original) return false;
2464
2471
  const prevRowIndex = prev.virtualRowIndex;
@@ -2478,9 +2485,10 @@ const DataGridRow = React$32.memo(DataGridRowImpl, (prev, next) => {
2478
2485
  if (prev.selectionSize !== next.selectionSize) return false;
2479
2486
  if (prev.visibleColumnIds !== next.visibleColumnIds) return false;
2480
2487
  if (prev.isHighlighted !== next.isHighlighted) return false;
2488
+ if (prev.columnDefsVersion !== next.columnDefsVersion) return false;
2481
2489
  return true;
2482
2490
  });
2483
- function DataGridRowImpl({ row, virtualRowIndex, virtualStart, rowVirtualizer, rowMapRef, rowHeight, focusedCell, editingCell: _editingCell, selectionSize: _selectionSize, visibleColumnIds: _visibleColumnIds, isHighlighted = false, onRowClick, ref, className,...props }) {
2491
+ function DataGridRowImpl({ row, virtualRowIndex, virtualStart, rowVirtualizer, rowMapRef, rowHeight, focusedCell, editingCell: _editingCell, selectionSize: _selectionSize, visibleColumnIds: _visibleColumnIds, columnDefsVersion: _columnDefsVersion, isHighlighted = false, onRowClick, ref, className,...props }) {
2484
2492
  const rowRef = useComposedRefs(ref, (node) => {
2485
2493
  if (node && typeof virtualRowIndex !== "undefined") {
2486
2494
  rowVirtualizer.measureElement(node);
@@ -2488,7 +2496,7 @@ function DataGridRowImpl({ row, virtualRowIndex, virtualStart, rowVirtualizer, r
2488
2496
  }
2489
2497
  });
2490
2498
  const isRowSelected = row.getIsSelected();
2491
- const handleRowClick = React$32.useCallback((event) => {
2499
+ const handleRowClick = React$33.useCallback((event) => {
2492
2500
  const target = event.target;
2493
2501
  if (target.closest("input, button, [role=\"checkbox\"]")) return;
2494
2502
  if (event.detail === 1) onRowClick?.(virtualRowIndex);
@@ -2538,20 +2546,20 @@ function DataGridRowImpl({ row, virtualRowIndex, virtualStart, rowVirtualizer, r
2538
2546
  * prop or avoid re-executing effects when passed as a dependency
2539
2547
  */
2540
2548
  function useCallbackRef(callback) {
2541
- const callbackRef = React$31.useRef(callback);
2542
- React$31.useEffect(() => {
2549
+ const callbackRef = React$32.useRef(callback);
2550
+ React$32.useEffect(() => {
2543
2551
  callbackRef.current = callback;
2544
2552
  });
2545
- return React$31.useMemo(() => (...args) => callbackRef.current?.(...args), []);
2553
+ return React$32.useMemo(() => (...args) => callbackRef.current?.(...args), []);
2546
2554
  }
2547
2555
 
2548
2556
  //#endregion
2549
2557
  //#region src/hooks/use-debounced-callback.ts
2550
2558
  function useDebouncedCallback(callback, delay) {
2551
2559
  const handleCallback = useCallbackRef(callback);
2552
- const debounceTimerRef = React$30.useRef(0);
2553
- React$30.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
2554
- const setValue = React$30.useCallback((...args) => {
2560
+ const debounceTimerRef = React$31.useRef(0);
2561
+ React$31.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
2562
+ const setValue = React$31.useCallback((...args) => {
2555
2563
  window.clearTimeout(debounceTimerRef.current);
2556
2564
  debounceTimerRef.current = window.setTimeout(() => handleCallback(...args), delay);
2557
2565
  }, [handleCallback, delay]);
@@ -2572,7 +2580,7 @@ const inputVariants = cva("file:text-foreground placeholder:text-muted-foregroun
2572
2580
  } },
2573
2581
  defaultVariants: { variant: "default" }
2574
2582
  });
2575
- const Input = React$29.forwardRef(({ className, type, variant, __e2e_test_id__, onEnter, wrapperClassName,...props }, ref) => {
2583
+ const Input = React$30.forwardRef(({ className, type, variant, __e2e_test_id__, onEnter, wrapperClassName,...props }, ref) => {
2576
2584
  const input = /* @__PURE__ */ jsx("input", {
2577
2585
  type,
2578
2586
  "data-slot": "input",
@@ -2598,7 +2606,7 @@ Input.displayName = "Input";
2598
2606
 
2599
2607
  //#endregion
2600
2608
  //#region src/data-grid/data-grid-search.tsx
2601
- const DataGridSearch = React$28.memo(DataGridSearchImpl, (prev, next) => {
2609
+ const DataGridSearch = React$29.memo(DataGridSearchImpl, (prev, next) => {
2602
2610
  if (prev.searchOpen !== next.searchOpen) return false;
2603
2611
  if (!next.searchOpen) return true;
2604
2612
  if (prev.searchQuery !== next.searchQuery || prev.matchIndex !== next.matchIndex) return false;
@@ -2612,13 +2620,13 @@ const DataGridSearch = React$28.memo(DataGridSearchImpl, (prev, next) => {
2612
2620
  return true;
2613
2621
  });
2614
2622
  function DataGridSearchImpl({ searchMatches, matchIndex, searchOpen, onSearchOpenChange, searchQuery, onSearchQueryChange, onSearch, onNavigateToNextMatch, onNavigateToPrevMatch }) {
2615
- const inputRef = React$28.useRef(null);
2616
- React$28.useEffect(() => {
2623
+ const inputRef = React$29.useRef(null);
2624
+ React$29.useEffect(() => {
2617
2625
  if (searchOpen) requestAnimationFrame(() => {
2618
2626
  inputRef.current?.focus();
2619
2627
  });
2620
2628
  }, [searchOpen]);
2621
- React$28.useEffect(() => {
2629
+ React$29.useEffect(() => {
2622
2630
  if (!searchOpen) return;
2623
2631
  function onEscape(event) {
2624
2632
  if (event.key === "Escape") {
@@ -2629,7 +2637,7 @@ function DataGridSearchImpl({ searchMatches, matchIndex, searchOpen, onSearchOpe
2629
2637
  document.addEventListener("keydown", onEscape);
2630
2638
  return () => document.removeEventListener("keydown", onEscape);
2631
2639
  }, [searchOpen, onSearchOpenChange]);
2632
- const onKeyDown = React$28.useCallback((event) => {
2640
+ const onKeyDown = React$29.useCallback((event) => {
2633
2641
  event.stopPropagation();
2634
2642
  if (event.key === "Enter") {
2635
2643
  event.preventDefault();
@@ -2640,20 +2648,20 @@ function DataGridSearchImpl({ searchMatches, matchIndex, searchOpen, onSearchOpe
2640
2648
  const debouncedSearch = useDebouncedCallback((query) => {
2641
2649
  onSearch(query);
2642
2650
  }, 150);
2643
- const onChange = React$28.useCallback((event) => {
2651
+ const onChange = React$29.useCallback((event) => {
2644
2652
  const value = event.target.value;
2645
2653
  onSearchQueryChange(value);
2646
2654
  debouncedSearch(value);
2647
2655
  }, [onSearchQueryChange, debouncedSearch]);
2648
- const onTriggerPointerDown = React$28.useCallback((event) => {
2656
+ const onTriggerPointerDown = React$29.useCallback((event) => {
2649
2657
  const target = event.target;
2650
2658
  if (!(target instanceof HTMLElement)) return;
2651
2659
  if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);
2652
2660
  if (event.button === 0 && event.ctrlKey === false && event.pointerType === "mouse" && !(event.target instanceof HTMLInputElement)) event.preventDefault();
2653
2661
  }, []);
2654
- const onPrevMatchPointerDown = React$28.useCallback((event) => onTriggerPointerDown(event), [onTriggerPointerDown]);
2655
- const onNextMatchPointerDown = React$28.useCallback((event) => onTriggerPointerDown(event), [onTriggerPointerDown]);
2656
- const onClose = React$28.useCallback(() => {
2662
+ const onPrevMatchPointerDown = React$29.useCallback((event) => onTriggerPointerDown(event), [onTriggerPointerDown]);
2663
+ const onNextMatchPointerDown = React$29.useCallback((event) => onTriggerPointerDown(event), [onTriggerPointerDown]);
2664
+ const onClose = React$29.useCallback(() => {
2657
2665
  onSearchOpenChange(false);
2658
2666
  }, [onSearchOpenChange]);
2659
2667
  if (!searchOpen) return null;
@@ -2730,16 +2738,17 @@ function DataGrid({ dataGridRef, headerRef, rowMapRef, footerRef, table, rowVirt
2730
2738
  const selectionSize = meta?.selectionState?.selectedCells?.size ?? 0;
2731
2739
  const highlightedRowIndex = meta?.highlightedRowIndex ?? -1;
2732
2740
  const onRowClick = meta?.onRowClick;
2741
+ const columnDefsVersion = meta?.columnDefsVersion ?? 0;
2733
2742
  const visibleColumnIds = table.getVisibleLeafColumns().map((c) => c.id).join(",");
2734
- const prevVisibleColumnIdsRef = React$27.useRef(visibleColumnIds);
2743
+ const prevVisibleColumnIdsRef = React$28.useRef(visibleColumnIds);
2735
2744
  if (prevVisibleColumnIdsRef.current !== visibleColumnIds) {
2736
2745
  rowMapRef.current.clear();
2737
2746
  prevVisibleColumnIdsRef.current = visibleColumnIds;
2738
2747
  }
2739
- const onGridContextMenu = React$27.useCallback((event) => {
2748
+ const onGridContextMenu = React$28.useCallback((event) => {
2740
2749
  event.preventDefault();
2741
2750
  }, []);
2742
- const onAddRowKeyDown = React$27.useCallback(async (event) => {
2751
+ const onAddRowKeyDown = React$28.useCallback(async (event) => {
2743
2752
  if (!onRowAdd) return;
2744
2753
  if (event.key === "Enter" || event.key === "") {
2745
2754
  event.preventDefault();
@@ -2842,6 +2851,7 @@ function DataGrid({ dataGridRef, headerRef, rowMapRef, footerRef, table, rowVirt
2842
2851
  editingCell,
2843
2852
  selectionSize,
2844
2853
  visibleColumnIds,
2854
+ columnDefsVersion,
2845
2855
  isHighlighted: highlightedRowIndex === virtualItem.index,
2846
2856
  onRowClick
2847
2857
  }, row.id);
@@ -2891,20 +2901,20 @@ function DataGridCellWrapper({ cell, table, rowIndex, columnId, isEditing, isFoc
2891
2901
  const rowOriginal = cell?.row?.original ?? {};
2892
2902
  const colCellMeta = cell?.column?.columnDef?.meta;
2893
2903
  const align = colCellMeta?.align ?? "left";
2894
- const editableResolver = React$26.useMemo(() => {
2904
+ const editableResolver = React$27.useMemo(() => {
2895
2905
  const v = colCellMeta?.editable;
2896
2906
  if (v === void 0) return () => true;
2897
2907
  return typeof v === "function" ? v : () => Boolean(v);
2898
2908
  }, [colCellMeta?.editable]);
2899
2909
  const isEditable = editableResolver(rowOriginal);
2900
- const classNameResolver = React$26.useMemo(() => {
2910
+ const classNameResolver = React$27.useMemo(() => {
2901
2911
  const v = colCellMeta?.className;
2902
2912
  return typeof v === "function" ? v : () => v;
2903
2913
  }, [colCellMeta?.className]);
2904
2914
  const colCellClassName = classNameResolver(rowOriginal);
2905
2915
  const isSearchMatch = meta?.getIsSearchMatch?.(rowIndex, columnId) ?? false;
2906
2916
  const isActiveSearchMatch = meta?.getIsActiveSearchMatch?.(rowIndex, columnId) ?? false;
2907
- const onClick = React$26.useCallback((event) => {
2917
+ const onClick = React$27.useCallback((event) => {
2908
2918
  if (!isEditing) {
2909
2919
  event.preventDefault();
2910
2920
  onClickProp?.(event);
@@ -2917,7 +2927,7 @@ function DataGridCellWrapper({ cell, table, rowIndex, columnId, isEditing, isFoc
2917
2927
  isEditing,
2918
2928
  onClickProp
2919
2929
  ]);
2920
- const onContextMenu = React$26.useCallback((event) => {
2930
+ const onContextMenu = React$27.useCallback((event) => {
2921
2931
  if (!isEditing) meta?.onCellContextMenu?.(rowIndex, columnId, event);
2922
2932
  }, [
2923
2933
  meta,
@@ -2925,7 +2935,7 @@ function DataGridCellWrapper({ cell, table, rowIndex, columnId, isEditing, isFoc
2925
2935
  columnId,
2926
2936
  isEditing
2927
2937
  ]);
2928
- const onMouseDown = React$26.useCallback((event) => {
2938
+ const onMouseDown = React$27.useCallback((event) => {
2929
2939
  if (!isEditing) meta?.onCellMouseDown?.(rowIndex, columnId, event);
2930
2940
  }, [
2931
2941
  meta,
@@ -2933,7 +2943,7 @@ function DataGridCellWrapper({ cell, table, rowIndex, columnId, isEditing, isFoc
2933
2943
  columnId,
2934
2944
  isEditing
2935
2945
  ]);
2936
- const onMouseEnter = React$26.useCallback((event) => {
2946
+ const onMouseEnter = React$27.useCallback((event) => {
2937
2947
  if (!isEditing) meta?.onCellMouseEnter?.(rowIndex, columnId, event);
2938
2948
  }, [
2939
2949
  meta,
@@ -2941,10 +2951,10 @@ function DataGridCellWrapper({ cell, table, rowIndex, columnId, isEditing, isFoc
2941
2951
  columnId,
2942
2952
  isEditing
2943
2953
  ]);
2944
- const onMouseUp = React$26.useCallback(() => {
2954
+ const onMouseUp = React$27.useCallback(() => {
2945
2955
  if (!isEditing) meta?.onCellMouseUp?.();
2946
2956
  }, [meta, isEditing]);
2947
- const onDoubleClick = React$26.useCallback((event) => {
2957
+ const onDoubleClick = React$27.useCallback((event) => {
2948
2958
  if (!isEditing) {
2949
2959
  event.preventDefault();
2950
2960
  if (isEditable) meta?.onCellDoubleClick?.(rowIndex, columnId);
@@ -2956,7 +2966,7 @@ function DataGridCellWrapper({ cell, table, rowIndex, columnId, isEditing, isFoc
2956
2966
  isEditing,
2957
2967
  isEditable
2958
2968
  ]);
2959
- const onKeyDown = React$26.useCallback((event) => {
2969
+ const onKeyDown = React$27.useCallback((event) => {
2960
2970
  onKeyDownProp?.(event);
2961
2971
  if (event.defaultPrevented) return;
2962
2972
  if (event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End" || event.key === "PageUp" || event.key === "PageDown" || event.key === "Enter" || event.key === "Tab") return;
@@ -3030,17 +3040,17 @@ function DataGridCellWrapper({ cell, table, rowIndex, columnId, isEditing, isFoc
3030
3040
  //#region src/data-grid/cell-variants/checkbox-cell.tsx
3031
3041
  function CheckboxCell({ cell, table, rowIndex, columnId, isFocused, isSelected }) {
3032
3042
  const initialValue = cell.getValue();
3033
- const [value, setValue] = React$25.useState(Boolean(initialValue));
3034
- const containerRef = React$25.useRef(null);
3043
+ const [value, setValue] = React$26.useState(Boolean(initialValue));
3044
+ const containerRef = React$26.useRef(null);
3035
3045
  const meta = table.options.meta;
3036
3046
  const colMeta = cell.column.columnDef.meta;
3037
- const editableResolver = React$25.useMemo(() => {
3047
+ const editableResolver = React$26.useMemo(() => {
3038
3048
  const v = colMeta?.editable;
3039
3049
  if (v === void 0) return () => true;
3040
3050
  return typeof v === "function" ? v : () => Boolean(v);
3041
3051
  }, [colMeta?.editable]);
3042
3052
  const isEditable = editableResolver(cell.row.original);
3043
- const onCheckedChange = React$25.useCallback((checked) => {
3053
+ const onCheckedChange = React$26.useCallback((checked) => {
3044
3054
  setValue(checked);
3045
3055
  meta?.onDataUpdate?.({
3046
3056
  rowIndex,
@@ -3052,7 +3062,7 @@ function CheckboxCell({ cell, table, rowIndex, columnId, isFocused, isSelected }
3052
3062
  rowIndex,
3053
3063
  columnId
3054
3064
  ]);
3055
- const onWrapperKeyDown = React$25.useCallback((event) => {
3065
+ const onWrapperKeyDown = React$26.useCallback((event) => {
3056
3066
  if (!isEditable) return;
3057
3067
  if (isFocused && (event.key === "" || event.key === "Enter")) {
3058
3068
  event.preventDefault();
@@ -3065,17 +3075,17 @@ function CheckboxCell({ cell, table, rowIndex, columnId, isFocused, isSelected }
3065
3075
  onCheckedChange,
3066
3076
  isEditable
3067
3077
  ]);
3068
- React$25.useEffect(() => {
3078
+ React$26.useEffect(() => {
3069
3079
  setValue(Boolean(initialValue));
3070
3080
  }, [initialValue]);
3071
- React$25.useEffect(() => {
3081
+ React$26.useEffect(() => {
3072
3082
  if (isFocused && !meta?.searchOpen && !meta?.isScrolling && containerRef.current) containerRef.current.focus();
3073
3083
  }, [
3074
3084
  isFocused,
3075
3085
  meta?.searchOpen,
3076
3086
  meta?.isScrolling
3077
3087
  ]);
3078
- const onWrapperClick = React$25.useCallback((event) => {
3088
+ const onWrapperClick = React$26.useCallback((event) => {
3079
3089
  if (!isEditable) return;
3080
3090
  if (isFocused) {
3081
3091
  event.preventDefault();
@@ -3088,13 +3098,13 @@ function CheckboxCell({ cell, table, rowIndex, columnId, isFocused, isSelected }
3088
3098
  onCheckedChange,
3089
3099
  isEditable
3090
3100
  ]);
3091
- const onCheckboxClick = React$25.useCallback((event) => {
3101
+ const onCheckboxClick = React$26.useCallback((event) => {
3092
3102
  event.stopPropagation();
3093
3103
  }, []);
3094
- const onCheckboxMouseDown = React$25.useCallback((event) => {
3104
+ const onCheckboxMouseDown = React$26.useCallback((event) => {
3095
3105
  event.stopPropagation();
3096
3106
  }, []);
3097
- const onCheckboxDoubleClick = React$25.useCallback((event) => {
3107
+ const onCheckboxDoubleClick = React$26.useCallback((event) => {
3098
3108
  event.stopPropagation();
3099
3109
  }, []);
3100
3110
  return /* @__PURE__ */ jsx(DataGridCellWrapper, {
@@ -3149,20 +3159,20 @@ function formatDateToISOString(date) {
3149
3159
  }
3150
3160
  function DateCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSelected }) {
3151
3161
  const initialValue = cell.getValue();
3152
- const [value, setValue] = React$24.useState(parseToLocalDate(initialValue));
3153
- const [open, setOpen] = React$24.useState(false);
3154
- const containerRef = React$24.useRef(null);
3155
- const hasStoppedRef = React$24.useRef(false);
3162
+ const [value, setValue] = React$25.useState(parseToLocalDate(initialValue));
3163
+ const [open, setOpen] = React$25.useState(false);
3164
+ const containerRef = React$25.useRef(null);
3165
+ const hasStoppedRef = React$25.useRef(false);
3156
3166
  const meta = table.options.meta;
3157
- const prevInitialValueRef = React$24.useRef(initialValue);
3167
+ const prevInitialValueRef = React$25.useRef(initialValue);
3158
3168
  if (initialValue !== prevInitialValueRef.current) {
3159
3169
  prevInitialValueRef.current = initialValue;
3160
3170
  setValue(parseToLocalDate(initialValue));
3161
3171
  }
3162
- React$24.useEffect(() => {
3172
+ React$25.useEffect(() => {
3163
3173
  if (isEditing) hasStoppedRef.current = false;
3164
3174
  }, [isEditing]);
3165
- const onDateSelect = React$24.useCallback((date) => {
3175
+ const onDateSelect = React$25.useCallback((date) => {
3166
3176
  if (!date) return;
3167
3177
  setValue(date);
3168
3178
  meta?.onDataUpdate?.({
@@ -3178,14 +3188,14 @@ function DateCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSel
3178
3188
  rowIndex,
3179
3189
  columnId
3180
3190
  ]);
3181
- const onOpenChange = React$24.useCallback((isOpen) => {
3191
+ const onOpenChange = React$25.useCallback((isOpen) => {
3182
3192
  setOpen(isOpen);
3183
3193
  if (!isOpen && isEditing && !hasStoppedRef.current) {
3184
3194
  hasStoppedRef.current = true;
3185
3195
  meta?.onCellEditingStop?.();
3186
3196
  }
3187
3197
  }, [isEditing, meta]);
3188
- const onWrapperKeyDown = React$24.useCallback((event) => {
3198
+ const onWrapperKeyDown = React$25.useCallback((event) => {
3189
3199
  if (isEditing) {
3190
3200
  if (event.key === "Escape") {
3191
3201
  event.preventDefault();
@@ -3205,10 +3215,10 @@ function DateCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSel
3205
3215
  initialValue,
3206
3216
  meta
3207
3217
  ]);
3208
- React$24.useEffect(() => {
3218
+ React$25.useEffect(() => {
3209
3219
  setOpen(isEditing);
3210
3220
  }, [isEditing]);
3211
- React$24.useEffect(() => {
3221
+ React$25.useEffect(() => {
3212
3222
  if (isFocused && !isEditing && !meta?.searchOpen && !meta?.isScrolling && containerRef.current) containerRef.current.focus();
3213
3223
  }, [
3214
3224
  isFocused,
@@ -3260,7 +3270,7 @@ function DateCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSel
3260
3270
  //#region src/data-grid/cell-variants/gantt-cell.tsx
3261
3271
  function GanttCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSelected }) {
3262
3272
  const initialValue = cell.getValue();
3263
- const containerRef = React$23.useRef(null);
3273
+ const containerRef = React$24.useRef(null);
3264
3274
  const cellOpts = cell.column.columnDef.meta?.cell;
3265
3275
  const ts = cellOpts?.dateRangeFrom ?? cellOpts?.timelineStart;
3266
3276
  const te = cellOpts?.dateRangeTo ?? cellOpts?.timelineEnd;
@@ -3269,8 +3279,9 @@ function GanttCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSe
3269
3279
  if (!timelineStartMs || !timelineEndMs) return null;
3270
3280
  const timelineDurationMs = timelineEndMs - timelineStartMs;
3271
3281
  const hasValidDates = initialValue && initialValue.start instanceof Date && initialValue.end instanceof Date;
3272
- const msUntilStart = hasValidDates ? initialValue.start.getTime() - timelineStartMs : 0;
3273
3282
  const barWidthMs = hasValidDates ? Math.min(initialValue.end.getTime(), timelineEndMs) - Math.max(initialValue.start.getTime(), timelineStartMs) : 0;
3283
+ const hasVisibleBar = hasValidDates && barWidthMs > 0;
3284
+ const msUntilStart = hasVisibleBar ? Math.max(0, initialValue.start.getTime() - timelineStartMs) : 0;
3274
3285
  return /* @__PURE__ */ jsx(DataGridCellWrapper, {
3275
3286
  ref: containerRef,
3276
3287
  cell,
@@ -3283,9 +3294,9 @@ function GanttCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSe
3283
3294
  className: "px-1",
3284
3295
  children: /* @__PURE__ */ jsx("div", {
3285
3296
  className: "size-full flex overflow-hidden",
3286
- children: hasValidDates && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
3297
+ children: hasVisibleBar && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
3287
3298
  className: "shrink-0",
3288
- style: { width: `${Math.max(0, msUntilStart / timelineDurationMs * 100)}%` }
3299
+ style: { width: `${msUntilStart / timelineDurationMs * 100}%` }
3289
3300
  }), /* @__PURE__ */ jsx("div", {
3290
3301
  className: cn("shrink-0 h-full rounded-sm bg-primary", initialValue.barClassName),
3291
3302
  style: { width: `${barWidthMs / timelineDurationMs * 100}%` }
@@ -3294,6 +3305,292 @@ function GanttCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSe
3294
3305
  });
3295
3306
  }
3296
3307
 
3308
+ //#endregion
3309
+ //#region src/data-grid/cell-variants/hierarchy-cell.tsx
3310
+ /**
3311
+ * Collects all descendant IDs from a hierarchy option.
3312
+ */
3313
+ function getAllDescendantIds(option) {
3314
+ const ids = [];
3315
+ if (option.children) for (const child of option.children) {
3316
+ ids.push(child.id);
3317
+ ids.push(...getAllDescendantIds(child));
3318
+ }
3319
+ return ids;
3320
+ }
3321
+ /**
3322
+ * Collects all IDs in the hierarchy tree (including the option itself).
3323
+ */
3324
+ function getAllIds(option) {
3325
+ return [option.id, ...getAllDescendantIds(option)];
3326
+ }
3327
+ /**
3328
+ * Finds an option by ID in the hierarchy tree.
3329
+ */
3330
+ function findOptionById(options, id) {
3331
+ for (const opt of options) {
3332
+ if (opt.id === id) return opt;
3333
+ if (opt.children) {
3334
+ const found = findOptionById(opt.children, id);
3335
+ if (found) return found;
3336
+ }
3337
+ }
3338
+ return null;
3339
+ }
3340
+ /**
3341
+ * Gets the label path from root to the given ID.
3342
+ */
3343
+ function getLabelPath(options, id, path = []) {
3344
+ for (const opt of options) {
3345
+ if (opt.id === id) return {
3346
+ found: true,
3347
+ path: [...path, opt.label]
3348
+ };
3349
+ if (opt.children) {
3350
+ const result = getLabelPath(opt.children, id, [...path, opt.label]);
3351
+ if (result.found) return result;
3352
+ }
3353
+ }
3354
+ return {
3355
+ found: false,
3356
+ path
3357
+ };
3358
+ }
3359
+ /**
3360
+ * Gets the ancestor IDs (parent chain) from root to the given ID.
3361
+ * Returns the IDs of all ancestors, NOT including the target ID itself.
3362
+ */
3363
+ function getAncestorIds(options, targetId, currentPath = []) {
3364
+ for (const opt of options) {
3365
+ if (opt.id === targetId) return currentPath;
3366
+ if (opt.children) {
3367
+ const result = getAncestorIds(opt.children, targetId, [...currentPath, opt.id]);
3368
+ if (result !== null) return result;
3369
+ }
3370
+ }
3371
+ return null;
3372
+ }
3373
+ /**
3374
+ * Builds a flat lookup map from ID to label for O(1) display lookups.
3375
+ */
3376
+ function buildLabelMap(options, map = new Map()) {
3377
+ for (const opt of options) {
3378
+ map.set(opt.id, opt.label);
3379
+ if (opt.children) buildLabelMap(opt.children, map);
3380
+ }
3381
+ return map;
3382
+ }
3383
+ /**
3384
+ * Checks if an option or any of its descendants contain the search term.
3385
+ */
3386
+ function matchesSearch$1(option, searchTerm) {
3387
+ const term = searchTerm.toLowerCase();
3388
+ if (option.label.toLowerCase().includes(term)) return true;
3389
+ if (option.children) return option.children.some((child) => matchesSearch$1(child, term));
3390
+ return false;
3391
+ }
3392
+ /**
3393
+ * Computes the initial expanded IDs.
3394
+ * - If there's only one top-level option with children, expand it by default.
3395
+ * - If there's a selected value, expand all ancestors to show it.
3396
+ */
3397
+ function getInitialExpandedIds(options, selectedValue) {
3398
+ const expandedIds = new Set();
3399
+ const firstOption = options[0];
3400
+ if (options.length === 1 && firstOption?.children && firstOption.children.length > 0) expandedIds.add(firstOption.id);
3401
+ if (selectedValue) {
3402
+ const ancestors = getAncestorIds(options, selectedValue);
3403
+ if (ancestors) for (const id of ancestors) expandedIds.add(id);
3404
+ }
3405
+ return expandedIds;
3406
+ }
3407
+ /**
3408
+ * Renders a single hierarchy item with expand/collapse and selection capabilities.
3409
+ */
3410
+ function HierarchyItem({ option, selectedValue, expandedIds, onToggleExpand, onSelect, depth = 0, searchTerm = "", ancestorMatched = false }) {
3411
+ const hasChildren = option.children && option.children.length > 0;
3412
+ const isExpanded = expandedIds.has(option.id);
3413
+ const isSelected = option.id === selectedValue;
3414
+ const matchesSelf = searchTerm && option.label.toLowerCase().includes(searchTerm.toLowerCase());
3415
+ const childrenMatchSearch = searchTerm && hasChildren && option.children.some((c) => matchesSearch$1(c, searchTerm));
3416
+ if (searchTerm && !matchesSelf && !childrenMatchSearch && !ancestorMatched) return null;
3417
+ const shouldShowExpanded = isExpanded || searchTerm !== "" && childrenMatchSearch;
3418
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(CommandItem, {
3419
+ value: `${option.label}-${option.id}`,
3420
+ onSelect: () => onSelect(option),
3421
+ style: { paddingLeft: `${depth * 20 + 8}px` },
3422
+ children: [
3423
+ hasChildren ? /* @__PURE__ */ jsx(Button, {
3424
+ onClick: (e) => {
3425
+ e.stopPropagation();
3426
+ onToggleExpand(option.id);
3427
+ },
3428
+ variant: "extraGhost",
3429
+ size: "sm",
3430
+ className: "size-4",
3431
+ children: shouldShowExpanded ? /* @__PURE__ */ jsx(ChevronDownIcon$1, {}) : /* @__PURE__ */ jsx(ChevronRightIcon$1, {})
3432
+ }) : /* @__PURE__ */ jsx("span", { className: "size-4" }),
3433
+ /* @__PURE__ */ jsx("span", {
3434
+ className: "flex-1 truncate",
3435
+ children: option.label
3436
+ }),
3437
+ isSelected && /* @__PURE__ */ jsx(CheckIcon$1, { className: "ml-auto h-4 w-4" })
3438
+ ]
3439
+ }), hasChildren && shouldShowExpanded && /* @__PURE__ */ jsx(Fragment, { children: option.children.map((child) => /* @__PURE__ */ jsx(HierarchyItem, {
3440
+ option: child,
3441
+ selectedValue,
3442
+ expandedIds,
3443
+ onToggleExpand,
3444
+ onSelect,
3445
+ depth: depth + 1,
3446
+ searchTerm,
3447
+ ancestorMatched: ancestorMatched || !!matchesSelf
3448
+ }, child.id)) })] });
3449
+ }
3450
+ function HierarchyCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isSelected }) {
3451
+ const initialValue = cell.getValue();
3452
+ const [value, setValue] = React$23.useState(initialValue);
3453
+ const [open, setOpen] = React$23.useState(false);
3454
+ const [searchValue, setSearchValue] = React$23.useState("");
3455
+ const containerRef = React$23.useRef(null);
3456
+ const inputRef = React$23.useRef(null);
3457
+ const meta = table.options.meta;
3458
+ const cellOpts = cell.column.columnDef.meta?.cell;
3459
+ const sideOffset = -(containerRef.current?.clientHeight ?? 0);
3460
+ const options = cellOpts?.variant === "hierarchy" ? cellOpts.options : [];
3461
+ const [expandedIds, setExpandedIds] = React$23.useState(() => getInitialExpandedIds(options, initialValue));
3462
+ const labelMap = React$23.useMemo(() => buildLabelMap(options), [options]);
3463
+ const displayLabel = React$23.useMemo(() => {
3464
+ if (!value) return "";
3465
+ return labelMap.get(value) ?? value;
3466
+ }, [value, labelMap]);
3467
+ const toggleExpand = React$23.useCallback((id) => {
3468
+ setExpandedIds((prev) => {
3469
+ const next = new Set(prev);
3470
+ if (next.has(id)) next.delete(id);
3471
+ else next.add(id);
3472
+ return next;
3473
+ });
3474
+ }, []);
3475
+ const onOptionSelect = React$23.useCallback((option) => {
3476
+ const newValue = option.id;
3477
+ setValue(newValue);
3478
+ meta?.onDataUpdate?.({
3479
+ rowIndex,
3480
+ columnId,
3481
+ value: newValue
3482
+ });
3483
+ meta?.onCellEditingStop?.();
3484
+ setOpen(false);
3485
+ }, [
3486
+ meta,
3487
+ rowIndex,
3488
+ columnId
3489
+ ]);
3490
+ const onOpenChange = React$23.useCallback((isOpen) => {
3491
+ setOpen(isOpen);
3492
+ if (!isOpen) {
3493
+ setSearchValue("");
3494
+ meta?.onCellEditingStop?.();
3495
+ }
3496
+ }, [meta]);
3497
+ const onOpenAutoFocus = React$23.useCallback((event) => {
3498
+ event.preventDefault();
3499
+ inputRef.current?.focus();
3500
+ }, []);
3501
+ const onWrapperKeyDown = React$23.useCallback((event) => {
3502
+ if (isEditing) {
3503
+ if (event.key === "Escape") {
3504
+ event.preventDefault();
3505
+ setValue(initialValue);
3506
+ setOpen(false);
3507
+ setSearchValue("");
3508
+ meta?.onCellEditingStop?.();
3509
+ } else if (event.key === "Tab") {
3510
+ event.preventDefault();
3511
+ setOpen(false);
3512
+ setSearchValue("");
3513
+ meta?.onCellEditingStop?.({ direction: event.shiftKey ? "left" : "right" });
3514
+ }
3515
+ }
3516
+ }, [
3517
+ isEditing,
3518
+ initialValue,
3519
+ meta
3520
+ ]);
3521
+ React$23.useEffect(() => {
3522
+ setValue(initialValue);
3523
+ }, [initialValue]);
3524
+ React$23.useEffect(() => {
3525
+ if (value) {
3526
+ const ancestors = getAncestorIds(options, value);
3527
+ if (ancestors && ancestors.length > 0) setExpandedIds((prev) => {
3528
+ const next = new Set(prev);
3529
+ for (const id of ancestors) next.add(id);
3530
+ return next;
3531
+ });
3532
+ }
3533
+ }, [value, options]);
3534
+ React$23.useEffect(() => {
3535
+ if (isEditing && !open) setOpen(true);
3536
+ if (isFocused && !isEditing && !meta?.searchOpen && !meta?.isScrolling && containerRef.current) containerRef.current.focus();
3537
+ }, [
3538
+ isFocused,
3539
+ isEditing,
3540
+ open,
3541
+ meta?.searchOpen,
3542
+ meta?.isScrolling
3543
+ ]);
3544
+ return /* @__PURE__ */ jsx(DataGridCellWrapper, {
3545
+ ref: containerRef,
3546
+ cell,
3547
+ table,
3548
+ rowIndex,
3549
+ columnId,
3550
+ isEditing,
3551
+ isFocused,
3552
+ isSelected,
3553
+ onKeyDown: onWrapperKeyDown,
3554
+ children: isEditing ? /* @__PURE__ */ jsxs(Popover, {
3555
+ open,
3556
+ onOpenChange,
3557
+ children: [/* @__PURE__ */ jsx(PopoverTrigger, {
3558
+ asChild: true,
3559
+ children: /* @__PURE__ */ jsx("div", {
3560
+ className: "size-full items-start text-start border-none p-0 shadow-none focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden line-clamp-1",
3561
+ children: displayLabel
3562
+ })
3563
+ }), /* @__PURE__ */ jsx(PopoverContent, {
3564
+ "data-grid-cell-editor": "",
3565
+ align: "start",
3566
+ sideOffset,
3567
+ className: "max-w-[500px] w-full rounded-none p-0",
3568
+ onOpenAutoFocus,
3569
+ children: /* @__PURE__ */ jsxs(Command, {
3570
+ shouldFilter: false,
3571
+ children: [/* @__PURE__ */ jsx(CommandInput, {
3572
+ ref: inputRef,
3573
+ value: searchValue,
3574
+ onValueChange: setSearchValue,
3575
+ placeholder: "Search...",
3576
+ className: "h-auto flex-1 p-0 rounded-none"
3577
+ }), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No options found." }), /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsx(HierarchyItem, {
3578
+ option,
3579
+ selectedValue: value,
3580
+ expandedIds,
3581
+ onToggleExpand: toggleExpand,
3582
+ onSelect: onOptionSelect,
3583
+ searchTerm: searchValue
3584
+ }, option.id)) })] })]
3585
+ })
3586
+ })]
3587
+ }) : /* @__PURE__ */ jsx("span", {
3588
+ "data-slot": "grid-cell-content",
3589
+ children: displayLabel
3590
+ })
3591
+ });
3592
+ }
3593
+
3297
3594
  //#endregion
3298
3595
  //#region src/textarea/textarea.tsx
3299
3596
  const textareaVariants = cva("border-input placeholder:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50", {
@@ -3703,7 +4000,7 @@ function MultiSelectCell({ cell, table, rowIndex, columnId, isFocused, isEditing
3703
4000
  onValueChange: setSearchValue,
3704
4001
  onKeyDown: onInputKeyDown,
3705
4002
  placeholder: "Search...",
3706
- className: "h-auto flex-1 p-0"
4003
+ className: "h-auto flex-1 p-0 rounded-none"
3707
4004
  })]
3708
4005
  }), /* @__PURE__ */ jsxs(CommandList, {
3709
4006
  className: "max-h-full",
@@ -4046,7 +4343,7 @@ function SelectCell({ cell, table, rowIndex, columnId, isFocused, isEditing, isS
4046
4343
  hasSearch && /* @__PURE__ */ jsx(CommandInput, {
4047
4344
  ref: inputRef,
4048
4345
  placeholder: "Search...",
4049
- className: "h-auto flex-1 p-0"
4346
+ className: "h-auto flex-1 p-0 rounded-none"
4050
4347
  }),
4051
4348
  /* @__PURE__ */ jsx(CommandEmpty, { children: "No results found." }),
4052
4349
  /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(CommandItem, {
@@ -4284,6 +4581,15 @@ function DataGridCell({ cell, table }) {
4284
4581
  isFocused,
4285
4582
  isSelected
4286
4583
  });
4584
+ case "hierarchy": return /* @__PURE__ */ jsx(HierarchyCell, {
4585
+ cell,
4586
+ table,
4587
+ rowIndex,
4588
+ columnId,
4589
+ isEditing,
4590
+ isFocused,
4591
+ isSelected
4592
+ });
4287
4593
  case "checkbox": return /* @__PURE__ */ jsx(CheckboxCell, {
4288
4594
  cell,
4289
4595
  table,
@@ -4725,6 +5031,13 @@ function useDataGrid({ columns, data, onDataChange, onRowAdd: onRowAddProp, onRo
4725
5031
  return void 0;
4726
5032
  }).filter((id) => Boolean(id));
4727
5033
  }, [columns]);
5034
+ const columnDefsVersionRef = React$15.useRef(0);
5035
+ const prevColumnsRef = React$15.useRef(columns);
5036
+ if (prevColumnsRef.current !== columns) {
5037
+ prevColumnsRef.current = columns;
5038
+ columnDefsVersionRef.current += 1;
5039
+ }
5040
+ const columnDefsVersion = columnDefsVersionRef.current;
4728
5041
  const storageKey = React$15.useMemo(() => {
4729
5042
  if (typeof window === "undefined") return void 0;
4730
5043
  const path = globalThis.location?.pathname ?? "unknown";
@@ -5616,6 +5929,7 @@ function useDataGrid({ columns, data, onDataChange, onRowAdd: onRowAddProp, onRo
5616
5929
  rowHeight,
5617
5930
  isScrolling,
5618
5931
  highlightedRowIndex,
5932
+ columnDefsVersion,
5619
5933
  onRowClick: onRowClickProp,
5620
5934
  getIsCellSelected,
5621
5935
  getIsSearchMatch,
@@ -5653,6 +5967,7 @@ function useDataGrid({ columns, data, onDataChange, onRowAdd: onRowAddProp, onRo
5653
5967
  searchOpen,
5654
5968
  isScrolling,
5655
5969
  highlightedRowIndex,
5970
+ columnDefsVersion,
5656
5971
  onRowClickProp,
5657
5972
  getIsCellSelected,
5658
5973
  getIsSearchMatch,
@@ -7332,6 +7647,23 @@ function SidebarMenuSubButton({ asChild = false, size = "md", isActive = false,
7332
7647
 
7333
7648
  //#endregion
7334
7649
  //#region src/slicer/slicer.tsx
7650
+ /**
7651
+ * Collects all descendant values from a hierarchy option.
7652
+ */
7653
+ function getAllDescendantValues(option) {
7654
+ const values = [];
7655
+ if (option.children) for (const child of option.children) values.push(child.value, ...getAllDescendantValues(child));
7656
+ return values;
7657
+ }
7658
+ /**
7659
+ * Checks if an option or any of its descendants contain the search term.
7660
+ */
7661
+ function matchesSearch(option, searchTerm) {
7662
+ const term = searchTerm.toLowerCase();
7663
+ if (option.label.toLowerCase().includes(term)) return true;
7664
+ if (option.children) return option.children.some((child) => matchesSearch(child, term));
7665
+ return false;
7666
+ }
7335
7667
  function usePersistedState(storageKey, defaultValue) {
7336
7668
  const [state, setState] = useState(() => {
7337
7669
  if (!storageKey) return defaultValue;
@@ -7350,7 +7682,21 @@ function usePersistedState(storageKey, defaultValue) {
7350
7682
  }, [storageKey]);
7351
7683
  return [state, setPersistedState];
7352
7684
  }
7353
- function Slicer({ filterValues, selectedValues, onChange, title, isLoading = false, optionsHeight = 200, className, defaultCollapsed = false, storageKey, __e2e_test_id__ }) {
7685
+ function Slicer({ filterValues, selectedValues, onChange, title, isLoading = false, optionsHeight = 200, className, defaultCollapsed = false, storageKey, isHierarchy, __e2e_test_id__ }) {
7686
+ const isHierarchyMode = isHierarchy ?? filterValues.some((opt) => opt.children && opt.children.length > 0);
7687
+ const [expandedIds, setExpandedIds] = useState(() => {
7688
+ const firstOption = filterValues[0];
7689
+ if (filterValues.length === 1 && firstOption?.children?.length) return new Set([firstOption.value]);
7690
+ return new Set();
7691
+ });
7692
+ const toggleExpand = useCallback((value) => {
7693
+ setExpandedIds((prev) => {
7694
+ const next = new Set(prev);
7695
+ if (next.has(value)) next.delete(value);
7696
+ else next.add(value);
7697
+ return next;
7698
+ });
7699
+ }, []);
7354
7700
  const effectiveStorageKey = storageKey === null ? void 0 : storageKey ?? `slicer-collapsed-${title}`;
7355
7701
  const [isCollapsed, setIsCollapsed] = usePersistedState(effectiveStorageKey, defaultCollapsed);
7356
7702
  const [searchQuery, setSearchQuery] = useState("");
@@ -7376,12 +7722,12 @@ function Slicer({ filterValues, selectedValues, onChange, title, isLoading = fal
7376
7722
  else newVals = filterValues.map((o) => o.value);
7377
7723
  onChange(newVals);
7378
7724
  };
7379
- const handleOptionToggle = (optionValue, checked) => {
7725
+ const handleOptionToggle = useCallback((optionValue) => {
7380
7726
  const newSelected = new Set(selectedValues);
7381
- if (checked) newSelected.add(optionValue);
7382
- else newSelected.delete(optionValue);
7727
+ if (newSelected.has(optionValue)) newSelected.delete(optionValue);
7728
+ else newSelected.add(optionValue);
7383
7729
  onChange(Array.from(newSelected));
7384
- };
7730
+ }, [selectedValues, onChange]);
7385
7731
  return /* @__PURE__ */ jsxs(Card, {
7386
7732
  className: cn("flex flex-col overflow-hidden w-56 rounded shadow-sm shrink-0", className),
7387
7733
  "data-test-id": __e2e_test_id__,
@@ -7425,7 +7771,7 @@ function Slicer({ filterValues, selectedValues, onChange, title, isLoading = fal
7425
7771
  ]
7426
7772
  }), !isCollapsed && /* @__PURE__ */ jsxs(CardContent, {
7427
7773
  className: "p-1 flex flex-col",
7428
- children: [/* @__PURE__ */ jsx(Button, {
7774
+ children: [!isHierarchyMode && /* @__PURE__ */ jsx(Button, {
7429
7775
  variant: "ghost",
7430
7776
  size: "xs",
7431
7777
  className: "w-full justify-start px-2 py-1 rounded-sm text-sm font-normal",
@@ -7453,34 +7799,116 @@ function Slicer({ filterValues, selectedValues, onChange, title, isLoading = fal
7453
7799
  checkIcon: areAllSelected ? "check" : "square"
7454
7800
  })
7455
7801
  }), /* @__PURE__ */ jsx("div", {
7456
- className: `px-2 py-1 h-(--optionsHeight) shrink-0 overflow-auto`,
7802
+ className: cn("px-2 py-1 h-(--optionsHeight) shrink-0 overflow-auto", isHierarchyMode && "px-1"),
7457
7803
  style: { "--optionsHeight": `${optionsHeight}px` },
7458
- children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", {
7459
- className: "flex size-full items-center justify-center text-sm",
7460
- children: filterValues.length === 0 ? "No options available" : "No results found"
7461
- }) : /* @__PURE__ */ jsx(Fragment, { children: isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
7462
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-full" }),
7463
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-3/4" }),
7464
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-5/6" })
7465
- ] }) : /* @__PURE__ */ jsx(Fragment, { children: filteredOptions.map((option) => /* @__PURE__ */ jsx(SlicerItem, {
7466
- option,
7467
- isSelected: selectedValues.has(option.value),
7468
- onToggle: handleOptionToggle
7469
- }, option.value)) }) })
7804
+ children: /* @__PURE__ */ jsx(SlicerOptions, {
7805
+ isLoading,
7806
+ isHierarchyMode,
7807
+ filterValues,
7808
+ filteredOptions,
7809
+ selectedValues,
7810
+ expandedIds,
7811
+ onToggleExpand: toggleExpand,
7812
+ onOptionToggle: handleOptionToggle,
7813
+ searchQuery
7814
+ })
7470
7815
  })]
7471
7816
  })]
7472
7817
  });
7473
7818
  }
7819
+ const SlicerOptions = ({ isLoading, isHierarchyMode, filterValues, filteredOptions, selectedValues, expandedIds, onToggleExpand, onOptionToggle, searchQuery }) => {
7820
+ if (isLoading) return /* @__PURE__ */ jsxs(Fragment, { children: [
7821
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-full" }),
7822
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-3/4" }),
7823
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-5/6" })
7824
+ ] });
7825
+ if (filterValues.length === 0) return /* @__PURE__ */ jsx("div", {
7826
+ className: "flex size-full items-center justify-center text-sm",
7827
+ children: "No options available"
7828
+ });
7829
+ if (isHierarchyMode) return filterValues.map((option) => /* @__PURE__ */ jsx(SlicerHierarchyItem, {
7830
+ option,
7831
+ selectedValues,
7832
+ inheritedSelected: false,
7833
+ expandedIds,
7834
+ onToggleExpand,
7835
+ onSelect: onOptionToggle,
7836
+ searchTerm: searchQuery
7837
+ }, option.value));
7838
+ if (filteredOptions.length === 0) return /* @__PURE__ */ jsx("div", {
7839
+ className: "flex size-full items-center justify-center text-sm",
7840
+ children: "No results found"
7841
+ });
7842
+ return filteredOptions.map((option) => /* @__PURE__ */ jsx(SlicerItem, {
7843
+ option,
7844
+ isSelected: selectedValues.has(option.value),
7845
+ onToggle: onOptionToggle
7846
+ }, option.value));
7847
+ };
7474
7848
  const SlicerItem = ({ option, isSelected, onToggle }) => {
7849
+ const hasMatches = option.hasMatches ?? true;
7475
7850
  return /* @__PURE__ */ jsx(Checkbox, {
7476
7851
  checked: isSelected,
7477
- onChange: (e) => onToggle(option.value, e.target.checked),
7852
+ onChange: () => onToggle(option.value),
7478
7853
  checkIcon: "check",
7479
7854
  checkboxSize: "sm",
7480
- className: cn("whitespace-nowrap py-px text-sm", !option.hasMatches && "opacity-50", (option.value == "" || option.value == null || option.value == void 0) && "italic"),
7855
+ className: cn("whitespace-nowrap py-px text-sm", !hasMatches && "opacity-50", (option.value === "" || option.value == null) && "italic"),
7481
7856
  label: option.label
7482
7857
  }, option.value);
7483
7858
  };
7859
+ /**
7860
+ * Hierarchy item component for slicer - renders a single item in the hierarchy tree.
7861
+ * Can also be used directly for hierarchy filters in other components like TableFilter.
7862
+ */
7863
+ const SlicerHierarchyItem = ({ option, selectedValues, inheritedSelected, expandedIds, onToggleExpand, onSelect, depth = 0, searchTerm = "" }) => {
7864
+ const hasChildren = option.children && option.children.length > 0;
7865
+ const isExpanded = expandedIds.has(option.value);
7866
+ const isDirectlySelected = selectedValues.has(option.value);
7867
+ const isSelected = isDirectlySelected || inheritedSelected;
7868
+ const hasMatches = option.hasMatches ?? true;
7869
+ const hasSelectedDescendants = useMemo(() => {
7870
+ if (!hasChildren) return false;
7871
+ const descendantValues = getAllDescendantValues(option);
7872
+ return descendantValues.some((val) => selectedValues.has(val));
7873
+ }, [
7874
+ option,
7875
+ selectedValues,
7876
+ hasChildren
7877
+ ]);
7878
+ const isPartiallySelected = !isDirectlySelected && hasSelectedDescendants && !inheritedSelected;
7879
+ const matchesSelf = searchTerm && option.label.toLowerCase().includes(searchTerm.toLowerCase());
7880
+ const childrenMatchSearch = searchTerm && hasChildren && option.children.some((c) => matchesSearch(c, searchTerm));
7881
+ if (searchTerm && !matchesSelf && !childrenMatchSearch) return null;
7882
+ const shouldShowExpanded = isExpanded || searchTerm !== "" && childrenMatchSearch;
7883
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
7884
+ className: "flex items-center",
7885
+ style: { paddingLeft: `${depth * 12}px` },
7886
+ children: [hasChildren ? /* @__PURE__ */ jsx(Button, {
7887
+ onClick: () => onToggleExpand(option.value),
7888
+ variant: "extraGhost",
7889
+ size: "sm",
7890
+ className: "size-4",
7891
+ children: shouldShowExpanded ? /* @__PURE__ */ jsx(ChevronDownIcon$1, { className: "size-3.5" }) : /* @__PURE__ */ jsx(ChevronRightIcon$1, { className: "size-3.5" })
7892
+ }) : /* @__PURE__ */ jsx("span", { className: "size-4" }), /* @__PURE__ */ jsx(Checkbox, {
7893
+ checked: isSelected || isPartiallySelected,
7894
+ onChange: () => onSelect(option.value),
7895
+ iconStyle: isPartiallySelected || !isDirectlySelected ? "solo" : "default",
7896
+ checkIcon: isPartiallySelected ? "square" : !isDirectlySelected ? "minus" : "check",
7897
+ checkboxSize: "sm",
7898
+ className: cn("whitespace-nowrap py-px text-sm", !hasMatches && "opacity-50", inheritedSelected && !isDirectlySelected && "[&_svg]:opacity-50"),
7899
+ label: option.label
7900
+ })]
7901
+ }), hasChildren && shouldShowExpanded && /* @__PURE__ */ jsx(Fragment, { children: option.children.map((child) => /* @__PURE__ */ jsx(SlicerHierarchyItem, {
7902
+ option: child,
7903
+ selectedValues,
7904
+ inheritedSelected: isSelected,
7905
+ expandedIds,
7906
+ onToggleExpand,
7907
+ onSelect,
7908
+ depth: depth + 1,
7909
+ searchTerm
7910
+ }, child.value)) })] });
7911
+ };
7484
7912
 
7485
7913
  //#endregion
7486
7914
  //#region src/slider/slider.tsx
@@ -7706,5 +8134,5 @@ const ToggleGroupItem = React$1.forwardRef(({ className, children, variant, size
7706
8134
  ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
7707
8135
 
7708
8136
  //#endregion
7709
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, CheckboxCell, Collapse, CollapseContent, CollapseTrigger, ComboboxDemo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandPalette, CommandPaletteDialog, CommandPaletteEmpty, CommandPaletteGroup, CommandPaletteInput, CommandPaletteItem, CommandPaletteList, CommandPaletteSeparator, CommandPaletteShortcut, CommandSeparator, CommandShortcut, ContentFrame, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataGrid, DataGridCell, DataGridCellWrapper, DataGridColumnHeader, DataGridContextMenu, DataGridRow, DataGridSearch, DataGridViewMenu, DateCell, DatePickerDemo, DeferredInput, DeferredNumberInput, DeferredTextarea, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GanttCell, GanttTimeline, GanttTimerangePicker, HeaderComponents, HoverCard, HoverCardContent, HoverCardTrigger, InfoCard, Input, Label, Loader, LongTextCell, MarkValueRenderer, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, MultiSelectCell, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberCell, NumberInput, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ReactNodeCell, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectCell, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, ShortTextCell, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slicer, Slider, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, checkboxVariants, cn, commandInputVariants, createSelectColumn, getCellKey, getCommonPinningStyles, getLineCount, getRowHeightValue, inputVariants, isoToLocalDate, knobVariants, navigationMenuTriggerStyle, parseCellKey, sliderVariants, testId, toast, toggleVariants, useCallbackRef, useDataGrid, useDebouncedCallback, useIsMobile, useSidebar };
8137
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, CheckboxCell, Collapse, CollapseContent, CollapseTrigger, ComboboxDemo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandPalette, CommandPaletteDialog, CommandPaletteEmpty, CommandPaletteGroup, CommandPaletteInput, CommandPaletteItem, CommandPaletteList, CommandPaletteSeparator, CommandPaletteShortcut, CommandSeparator, CommandShortcut, ContentFrame, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataGrid, DataGridCell, DataGridCellWrapper, DataGridColumnHeader, DataGridContextMenu, DataGridRow, DataGridSearch, DataGridViewMenu, DateCell, DatePickerDemo, DeferredInput, DeferredNumberInput, DeferredTextarea, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GanttCell, GanttTimeline, GanttTimerangePicker, HeaderComponents, HierarchyCell, HoverCard, HoverCardContent, HoverCardTrigger, InfoCard, Input, Label, Loader, LongTextCell, MarkValueRenderer, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, MultiSelectCell, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberCell, NumberInput, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ReactNodeCell, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectCell, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, ShortTextCell, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slicer, SlicerHierarchyItem, Slider, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buildLabelMap, buttonVariants, checkboxVariants, cn, commandInputVariants, createSelectColumn, findOptionById, getAllDescendantIds, getAllDescendantValues, getAllIds, getAncestorIds, getCellKey, getCommonPinningStyles, getLabelPath, getLineCount, getRowHeightValue, inputVariants, isoToLocalDate, knobVariants, matchesSearch, navigationMenuTriggerStyle, parseCellKey, sliderVariants, testId, toast, toggleVariants, useCallbackRef, useDataGrid, useDebouncedCallback, useIsMobile, useSidebar };
7710
8138
  //# sourceMappingURL=index.js.map