@pos-360/horizon 0.30.1 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { cn, Label, Tooltip, Text, mergeRefs } from './chunk-EZDGMHS7.mjs';
2
- import * as React10 from 'react';
1
+ import { cn, Label, Tooltip, Text, TextButton, mergeRefs } from './chunk-2GMOVXHC.mjs';
2
+ import * as React11 from 'react';
3
3
  import { useState, useEffect, useCallback } from 'react';
4
4
  import { Slot } from '@radix-ui/react-slot';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
8
- import { Check, X, ChevronRight, Circle, ChevronDown, ChevronUp, Search, Minus, PenLine, SlidersHorizontal, CalendarIcon, ChevronLeft, Clock } from 'lucide-react';
8
+ import { Check, X, ChevronRight, Circle, ChevronDown, ChevronUp, Search, Minus, PenLine, SlidersHorizontal, CalendarIcon, Clock, ChevronLeft } from 'lucide-react';
9
9
  import * as DialogPrimitive from '@radix-ui/react-dialog';
10
10
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
11
11
  import * as PopoverPrimitive from '@radix-ui/react-popover';
@@ -42,7 +42,7 @@ var buttonVariants = cva(
42
42
  }
43
43
  }
44
44
  );
45
- var Button = React10.forwardRef(
45
+ var Button = React11.forwardRef(
46
46
  ({
47
47
  className,
48
48
  variant,
@@ -82,7 +82,7 @@ var Button = React10.forwardRef(
82
82
  }
83
83
  );
84
84
  Button.displayName = "Button";
85
- var Card = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
85
+ var Card = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
86
86
  "div",
87
87
  {
88
88
  ref,
@@ -94,7 +94,7 @@ var Card = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
94
94
  }
95
95
  ));
96
96
  Card.displayName = "Card";
97
- var CardHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
97
+ var CardHeader = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
98
98
  "div",
99
99
  {
100
100
  ref,
@@ -103,7 +103,7 @@ var CardHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE
103
103
  }
104
104
  ));
105
105
  CardHeader.displayName = "CardHeader";
106
- var CardTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
106
+ var CardTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
107
107
  "div",
108
108
  {
109
109
  ref,
@@ -112,7 +112,7 @@ var CardTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE_
112
112
  }
113
113
  ));
114
114
  CardTitle.displayName = "CardTitle";
115
- var CardDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
115
+ var CardDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
116
116
  "div",
117
117
  {
118
118
  ref,
@@ -121,7 +121,7 @@ var CardDescription = React10.forwardRef(({ className, ...props }, ref) => /* @_
121
121
  }
122
122
  ));
123
123
  CardDescription.displayName = "CardDescription";
124
- var CardContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
124
+ var CardContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
125
125
  "div",
126
126
  {
127
127
  ref,
@@ -130,7 +130,7 @@ var CardContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
130
130
  }
131
131
  ));
132
132
  CardContent.displayName = "CardContent";
133
- var CardFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
133
+ var CardFooter = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
134
134
  "div",
135
135
  {
136
136
  ref,
@@ -139,7 +139,7 @@ var CardFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE
139
139
  }
140
140
  ));
141
141
  CardFooter.displayName = "CardFooter";
142
- var Checkbox = React10.forwardRef(({ className, indicatorIcon, ...props }, ref) => /* @__PURE__ */ jsx(
142
+ var Checkbox = React11.forwardRef(({ className, indicatorIcon, ...props }, ref) => /* @__PURE__ */ jsx(
143
143
  CheckboxPrimitive.Root,
144
144
  {
145
145
  ref,
@@ -162,7 +162,7 @@ var Dialog = DialogPrimitive.Root;
162
162
  var DialogTrigger = DialogPrimitive.Trigger;
163
163
  var DialogPortal = DialogPrimitive.Portal;
164
164
  var DialogClose = DialogPrimitive.Close;
165
- var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
165
+ var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
166
166
  DialogPrimitive.Overlay,
167
167
  {
168
168
  ref,
@@ -174,7 +174,7 @@ var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__P
174
174
  }
175
175
  ));
176
176
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
177
- var DialogContent = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
177
+ var DialogContent = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
178
178
  /* @__PURE__ */ jsx(DialogOverlay, {}),
179
179
  /* @__PURE__ */ jsxs(
180
180
  DialogPrimitive.Content,
@@ -224,7 +224,7 @@ var DialogFooter = ({
224
224
  }
225
225
  );
226
226
  DialogFooter.displayName = "DialogFooter";
227
- var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
227
+ var DialogTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
228
228
  DialogPrimitive.Title,
229
229
  {
230
230
  ref,
@@ -236,7 +236,7 @@ var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
236
236
  }
237
237
  ));
238
238
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
239
- var DialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
239
+ var DialogDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
240
240
  DialogPrimitive.Description,
241
241
  {
242
242
  ref,
@@ -251,7 +251,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
251
251
  var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
252
252
  var DropdownMenuSub = DropdownMenuPrimitive.Sub;
253
253
  var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
254
- var DropdownMenuSubTrigger = React10.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
254
+ var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
255
255
  DropdownMenuPrimitive.SubTrigger,
256
256
  {
257
257
  ref,
@@ -268,7 +268,7 @@ var DropdownMenuSubTrigger = React10.forwardRef(({ className, inset, children, .
268
268
  }
269
269
  ));
270
270
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
271
- var DropdownMenuSubContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
271
+ var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
272
272
  DropdownMenuPrimitive.SubContent,
273
273
  {
274
274
  ref,
@@ -280,7 +280,7 @@ var DropdownMenuSubContent = React10.forwardRef(({ className, ...props }, ref) =
280
280
  }
281
281
  ));
282
282
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
283
- var DropdownMenuContent = React10.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
283
+ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
284
284
  DropdownMenuPrimitive.Content,
285
285
  {
286
286
  ref,
@@ -294,7 +294,7 @@ var DropdownMenuContent = React10.forwardRef(({ className, sideOffset = 4, ...pr
294
294
  }
295
295
  ) }));
296
296
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
297
- var DropdownMenuItem = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
297
+ var DropdownMenuItem = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
298
298
  DropdownMenuPrimitive.Item,
299
299
  {
300
300
  ref,
@@ -307,7 +307,7 @@ var DropdownMenuItem = React10.forwardRef(({ className, inset, ...props }, ref)
307
307
  }
308
308
  ));
309
309
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
310
- var DropdownMenuCheckboxItem = React10.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
310
+ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
311
311
  DropdownMenuPrimitive.CheckboxItem,
312
312
  {
313
313
  ref,
@@ -324,7 +324,7 @@ var DropdownMenuCheckboxItem = React10.forwardRef(({ className, children, checke
324
324
  }
325
325
  ));
326
326
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
327
- var DropdownMenuRadioItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
327
+ var DropdownMenuRadioItem = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
328
328
  DropdownMenuPrimitive.RadioItem,
329
329
  {
330
330
  ref,
@@ -340,7 +340,7 @@ var DropdownMenuRadioItem = React10.forwardRef(({ className, children, ...props
340
340
  }
341
341
  ));
342
342
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
343
- var DropdownMenuLabel = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
343
+ var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
344
344
  DropdownMenuPrimitive.Label,
345
345
  {
346
346
  ref,
@@ -353,7 +353,7 @@ var DropdownMenuLabel = React10.forwardRef(({ className, inset, ...props }, ref)
353
353
  }
354
354
  ));
355
355
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
356
- var DropdownMenuSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
356
+ var DropdownMenuSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
357
357
  DropdownMenuPrimitive.Separator,
358
358
  {
359
359
  ref,
@@ -375,19 +375,19 @@ var DropdownMenuShortcut = ({
375
375
  );
376
376
  };
377
377
  DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
378
- var FormContext = React10.createContext(null);
378
+ var FormContext = React11.createContext(null);
379
379
  function useFormContext() {
380
- const context = React10.useContext(FormContext);
380
+ const context = React11.useContext(FormContext);
381
381
  if (!context) {
382
382
  throw new Error("useFormContext must be used within a Form component");
383
383
  }
384
384
  return context;
385
385
  }
386
- var FormFieldContext = React10.createContext(
386
+ var FormFieldContext = React11.createContext(
387
387
  null
388
388
  );
389
389
  function useFormFieldContext() {
390
- const context = React10.useContext(FormFieldContext);
390
+ const context = React11.useContext(FormFieldContext);
391
391
  if (!context) {
392
392
  throw new Error(
393
393
  "useFormFieldContext must be used within a FormField component"
@@ -395,24 +395,24 @@ function useFormFieldContext() {
395
395
  }
396
396
  return context;
397
397
  }
398
- var Form = React10.forwardRef(
398
+ var Form = React11.forwardRef(
399
399
  ({ className, children, onFormSubmit, ...props }, ref) => {
400
- const [errors, setErrors] = React10.useState({});
401
- const [isSubmitting, setIsSubmitting] = React10.useState(false);
402
- const setError = React10.useCallback(
400
+ const [errors, setErrors] = React11.useState({});
401
+ const [isSubmitting, setIsSubmitting] = React11.useState(false);
402
+ const setError = React11.useCallback(
403
403
  (name, message) => {
404
404
  setErrors((prev) => ({ ...prev, [name]: message }));
405
405
  },
406
406
  []
407
407
  );
408
- const clearError = React10.useCallback((name) => {
408
+ const clearError = React11.useCallback((name) => {
409
409
  setErrors((prev) => {
410
410
  const next = { ...prev };
411
411
  delete next[name];
412
412
  return next;
413
413
  });
414
414
  }, []);
415
- const clearAllErrors = React10.useCallback(() => {
415
+ const clearAllErrors = React11.useCallback(() => {
416
416
  setErrors({});
417
417
  }, []);
418
418
  const isValid = Object.keys(errors).length === 0;
@@ -431,7 +431,7 @@ var Form = React10.forwardRef(
431
431
  }
432
432
  }
433
433
  };
434
- const contextValue = React10.useMemo(
434
+ const contextValue = React11.useMemo(
435
435
  () => ({
436
436
  errors,
437
437
  setError,
@@ -455,12 +455,12 @@ var Form = React10.forwardRef(
455
455
  }
456
456
  );
457
457
  Form.displayName = "Form";
458
- var FormField = React10.forwardRef(
458
+ var FormField = React11.forwardRef(
459
459
  ({ className, name, children, ...props }, ref) => {
460
460
  const { errors } = useFormContext();
461
- const id = React10.useId();
461
+ const id = React11.useId();
462
462
  const error = errors[name];
463
- const contextValue = React10.useMemo(
463
+ const contextValue = React11.useMemo(
464
464
  () => ({ name, error, id }),
465
465
  [name, error, id]
466
466
  );
@@ -468,7 +468,7 @@ var FormField = React10.forwardRef(
468
468
  }
469
469
  );
470
470
  FormField.displayName = "FormField";
471
- var FormLabel = React10.forwardRef(({ className, ...props }, ref) => {
471
+ var FormLabel = React11.forwardRef(({ className, ...props }, ref) => {
472
472
  const { id, error } = useFormFieldContext();
473
473
  return /* @__PURE__ */ jsx(
474
474
  Label,
@@ -481,10 +481,10 @@ var FormLabel = React10.forwardRef(({ className, ...props }, ref) => {
481
481
  );
482
482
  });
483
483
  FormLabel.displayName = "FormLabel";
484
- var FormControl = React10.forwardRef(
484
+ var FormControl = React11.forwardRef(
485
485
  ({ children, ...props }, ref) => {
486
486
  const { id, error, name } = useFormFieldContext();
487
- const child = React10.cloneElement(children, {
487
+ const child = React11.cloneElement(children, {
488
488
  id,
489
489
  name,
490
490
  "aria-invalid": !!error,
@@ -495,7 +495,7 @@ var FormControl = React10.forwardRef(
495
495
  }
496
496
  );
497
497
  FormControl.displayName = "FormControl";
498
- var FormDescription = React10.forwardRef(
498
+ var FormDescription = React11.forwardRef(
499
499
  ({ className, ...props }, ref) => {
500
500
  return /* @__PURE__ */ jsx(
501
501
  "span",
@@ -511,9 +511,9 @@ var FormDescription = React10.forwardRef(
511
511
  }
512
512
  );
513
513
  FormDescription.displayName = "FormDescription";
514
- var FormMessage = React10.forwardRef(
514
+ var FormMessage = React11.forwardRef(
515
515
  ({ className, children, error: errorProp, ...props }, ref) => {
516
- const fieldContext = React10.useContext(FormFieldContext);
516
+ const fieldContext = React11.useContext(FormFieldContext);
517
517
  const error = errorProp ?? fieldContext?.error;
518
518
  const id = fieldContext?.id;
519
519
  if (!error && !children) {
@@ -537,14 +537,14 @@ var FormMessage = React10.forwardRef(
537
537
  }
538
538
  );
539
539
  FormMessage.displayName = "FormMessage";
540
- var PopoverContext = React10.createContext({ open: false });
540
+ var PopoverContext = React11.createContext({ open: false });
541
541
  var Popover = ({
542
542
  children,
543
543
  open: controlledOpen,
544
544
  onOpenChange,
545
545
  ...props
546
546
  }) => {
547
- const [uncontrolledOpen, setUncontrolledOpen] = React10.useState(false);
547
+ const [uncontrolledOpen, setUncontrolledOpen] = React11.useState(false);
548
548
  const isControlled = controlledOpen !== void 0;
549
549
  const open = isControlled ? controlledOpen : uncontrolledOpen;
550
550
  const handleOpenChange = (newOpen) => {
@@ -565,8 +565,8 @@ var Popover = ({
565
565
  };
566
566
  var PopoverTrigger = PopoverPrimitive.Trigger;
567
567
  var PopoverAnchor = PopoverPrimitive.Anchor;
568
- var PopoverContent = React10.forwardRef(({ className, align = "center", sideOffset = 4, children, ...props }, ref) => {
569
- const { open } = React10.useContext(PopoverContext);
568
+ var PopoverContent = React11.forwardRef(({ className, align = "center", sideOffset = 4, children, ...props }, ref) => {
569
+ const { open } = React11.useContext(PopoverContext);
570
570
  const {
571
571
  onOpenAutoFocus,
572
572
  onCloseAutoFocus,
@@ -626,15 +626,15 @@ var PopoverContent = React10.forwardRef(({ className, align = "center", sideOffs
626
626
  ) }) });
627
627
  });
628
628
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
629
- var SelectContext = React10.createContext({ open: false });
630
- var SelectSearchContext = React10.createContext("");
629
+ var SelectContext = React11.createContext({ open: false });
630
+ var SelectSearchContext = React11.createContext("");
631
631
  var Select = ({
632
632
  children,
633
633
  open: controlledOpen,
634
634
  onOpenChange,
635
635
  ...props
636
636
  }) => {
637
- const [uncontrolledOpen, setUncontrolledOpen] = React10.useState(false);
637
+ const [uncontrolledOpen, setUncontrolledOpen] = React11.useState(false);
638
638
  const isControlled = controlledOpen !== void 0;
639
639
  const open = isControlled ? controlledOpen : uncontrolledOpen;
640
640
  const handleOpenChange = (newOpen) => {
@@ -654,9 +654,9 @@ var Select = ({
654
654
  ) });
655
655
  };
656
656
  var SelectGroup = SelectPrimitive.Group;
657
- var SelectValue = React10.forwardRef(({ children, placeholder, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Value, { ref, placeholder, ...props, children }));
657
+ var SelectValue = React11.forwardRef(({ children, placeholder, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Value, { ref, placeholder, ...props, children }));
658
658
  SelectValue.displayName = SelectPrimitive.Value.displayName;
659
- var SelectTrigger = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
659
+ var SelectTrigger = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
660
660
  SelectPrimitive.Trigger,
661
661
  {
662
662
  ref,
@@ -672,7 +672,7 @@ var SelectTrigger = React10.forwardRef(({ className, children, ...props }, ref)
672
672
  }
673
673
  ));
674
674
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
675
- var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
675
+ var SelectScrollUpButton = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
676
676
  SelectPrimitive.ScrollUpButton,
677
677
  {
678
678
  ref,
@@ -685,7 +685,7 @@ var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) =>
685
685
  }
686
686
  ));
687
687
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
688
- var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
688
+ var SelectScrollDownButton = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
689
689
  SelectPrimitive.ScrollDownButton,
690
690
  {
691
691
  ref,
@@ -698,11 +698,11 @@ var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) =
698
698
  }
699
699
  ));
700
700
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
701
- var SelectContent = React10.forwardRef(({ className, children, position = "popper", searchable = false, searchPlaceholder = "Search...", ...props }, ref) => {
702
- const { open } = React10.useContext(SelectContext);
703
- const [search, setSearch] = React10.useState("");
704
- const searchInputRef = React10.useRef(null);
705
- React10.useEffect(() => {
701
+ var SelectContent = React11.forwardRef(({ className, children, position = "popper", searchable = false, searchPlaceholder = "Search...", ...props }, ref) => {
702
+ const { open } = React11.useContext(SelectContext);
703
+ const [search, setSearch] = React11.useState("");
704
+ const searchInputRef = React11.useRef(null);
705
+ React11.useEffect(() => {
706
706
  if (open && searchable) {
707
707
  const frame = requestAnimationFrame(() => {
708
708
  searchInputRef.current?.focus();
@@ -728,7 +728,7 @@ var SelectContent = React10.forwardRef(({ className, children, position = "poppe
728
728
  } = props;
729
729
  const ForceMountPortal = SelectPrimitive.Portal;
730
730
  const ForceMountContent = SelectPrimitive.Content;
731
- const AnimatedContent = React10.useMemo(() => React10.forwardRef(({ forceMount: _, ...props2 }, ref2) => /* @__PURE__ */ jsx(motion.div, { ref: ref2, ...props2 })), []);
731
+ const AnimatedContent = React11.useMemo(() => React11.forwardRef(({ forceMount: _, ...props2 }, ref2) => /* @__PURE__ */ jsx(motion.div, { ref: ref2, ...props2 })), []);
732
732
  return /* @__PURE__ */ jsx(ForceMountPortal, { forceMount: true, children: /* @__PURE__ */ jsx(
733
733
  ForceMountContent,
734
734
  {
@@ -801,7 +801,7 @@ var SelectContent = React10.forwardRef(({ className, children, position = "poppe
801
801
  ) });
802
802
  });
803
803
  SelectContent.displayName = SelectPrimitive.Content.displayName;
804
- var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
804
+ var SelectLabel = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
805
805
  SelectPrimitive.Label,
806
806
  {
807
807
  ref,
@@ -810,8 +810,8 @@ var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
810
810
  }
811
811
  ));
812
812
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
813
- var SelectItem = React10.forwardRef(({ className, children, textValue, ...props }, ref) => {
814
- const search = React10.useContext(SelectSearchContext);
813
+ var SelectItem = React11.forwardRef(({ className, children, textValue, ...props }, ref) => {
814
+ const search = React11.useContext(SelectSearchContext);
815
815
  const itemText = textValue ?? (typeof children === "string" ? children : "");
816
816
  if (search && itemText && !itemText.toLowerCase().includes(search.toLowerCase())) {
817
817
  return null;
@@ -834,7 +834,7 @@ var SelectItem = React10.forwardRef(({ className, children, textValue, ...props
834
834
  );
835
835
  });
836
836
  SelectItem.displayName = SelectPrimitive.Item.displayName;
837
- var SelectSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
837
+ var SelectSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
838
838
  SelectPrimitive.Separator,
839
839
  {
840
840
  ref,
@@ -843,6 +843,307 @@ var SelectSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @_
843
843
  }
844
844
  ));
845
845
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
846
+ var SelectBar = React11.forwardRef(({
847
+ options,
848
+ value,
849
+ onChange,
850
+ multiple = false,
851
+ multiValue,
852
+ onMultiChange,
853
+ manualApply = false,
854
+ searchable = false,
855
+ searchPlaceholder = "Search...",
856
+ placeholder = "Select\u2026",
857
+ label,
858
+ disabled = false,
859
+ className,
860
+ maxVisibleChips = 2
861
+ }, ref) => {
862
+ const [open, setOpen] = React11.useState(false);
863
+ const [search, setSearch] = React11.useState("");
864
+ const searchRef = React11.useRef(null);
865
+ const [internalValue, setInternalValue] = React11.useState(
866
+ void 0
867
+ );
868
+ const [internalMultiValue, setInternalMultiValue] = React11.useState(
869
+ []
870
+ );
871
+ const [draftValue, setDraftValue] = React11.useState(
872
+ void 0
873
+ );
874
+ const [draftMultiValue, setDraftMultiValue] = React11.useState([]);
875
+ const committedSingle = value !== void 0 ? value : internalValue;
876
+ const committedMulti = multiValue !== void 0 ? multiValue : internalMultiValue;
877
+ const activeSingle = manualApply ? draftValue : committedSingle;
878
+ const activeMulti = manualApply ? draftMultiValue : committedMulti;
879
+ const commitSingle = React11.useCallback(
880
+ (v) => {
881
+ if (value === void 0) setInternalValue(v);
882
+ onChange?.(v);
883
+ },
884
+ [value, onChange]
885
+ );
886
+ const commitMulti = React11.useCallback(
887
+ (v) => {
888
+ if (multiValue === void 0) setInternalMultiValue(v);
889
+ onMultiChange?.(v);
890
+ },
891
+ [multiValue, onMultiChange]
892
+ );
893
+ const handleOpenChange = (newOpen) => {
894
+ if (newOpen) {
895
+ setDraftValue(committedSingle);
896
+ setDraftMultiValue(committedMulti);
897
+ setSearch("");
898
+ if (searchable) {
899
+ requestAnimationFrame(() => searchRef.current?.focus());
900
+ }
901
+ }
902
+ setOpen(newOpen);
903
+ };
904
+ const filtered = React11.useMemo(
905
+ () => search ? options.filter(
906
+ (o) => o.label.toLowerCase().includes(search.toLowerCase())
907
+ ) : options,
908
+ [options, search]
909
+ );
910
+ const handleSingleSelect = (optionValue) => {
911
+ if (manualApply) {
912
+ setDraftValue(optionValue);
913
+ } else {
914
+ commitSingle(optionValue);
915
+ setOpen(false);
916
+ }
917
+ };
918
+ const handleMultiToggle = (optionValue) => {
919
+ const current = manualApply ? draftMultiValue : committedMulti;
920
+ const next = current.includes(optionValue) ? current.filter((v) => v !== optionValue) : [...current, optionValue];
921
+ if (manualApply) {
922
+ setDraftMultiValue(next);
923
+ } else {
924
+ commitMulti(next);
925
+ }
926
+ };
927
+ const handleApply = () => {
928
+ if (multiple) {
929
+ commitMulti(draftMultiValue);
930
+ } else {
931
+ commitSingle(draftValue);
932
+ }
933
+ setOpen(false);
934
+ };
935
+ const handleClear = () => {
936
+ if (manualApply) {
937
+ if (multiple) {
938
+ setDraftMultiValue([]);
939
+ } else {
940
+ setDraftValue(void 0);
941
+ }
942
+ } else {
943
+ if (multiple) {
944
+ commitMulti([]);
945
+ } else {
946
+ commitSingle(void 0);
947
+ }
948
+ setOpen(false);
949
+ }
950
+ };
951
+ const handleChipRemove = (e, chipValue) => {
952
+ e.stopPropagation();
953
+ const next = committedMulti.filter((v) => v !== chipValue);
954
+ commitMulti(next);
955
+ };
956
+ const canApply = (() => {
957
+ if (!manualApply) return false;
958
+ if (multiple) {
959
+ const a = [...draftMultiValue].sort();
960
+ const b = [...committedMulti].sort();
961
+ return JSON.stringify(a) !== JSON.stringify(b);
962
+ }
963
+ return draftValue !== committedSingle;
964
+ })();
965
+ const canClear = (() => {
966
+ if (manualApply) {
967
+ return multiple ? draftMultiValue.length > 0 : draftValue !== void 0;
968
+ }
969
+ return multiple ? committedMulti.length > 0 : committedSingle !== void 0;
970
+ })();
971
+ const labelFor = (v) => options.find((o) => o.value === v)?.label ?? v;
972
+ const renderTriggerContent = () => {
973
+ if (multiple) {
974
+ if (committedMulti.length === 0) {
975
+ return /* @__PURE__ */ jsx("span", { className: "text-gray-400 dark:text-gray-500 truncate", children: placeholder });
976
+ }
977
+ const visible = committedMulti.slice(0, maxVisibleChips);
978
+ const overflow = committedMulti.length - maxVisibleChips;
979
+ return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 min-w-0 flex-wrap", children: [
980
+ visible.map((v) => /* @__PURE__ */ jsxs(
981
+ "span",
982
+ {
983
+ className: "inline-flex items-center gap-1 bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-950/50 dark:text-blue-400 dark:border-blue-800/50 rounded-md px-2 py-0.5 text-xs font-medium max-w-[120px]",
984
+ children: [
985
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: labelFor(v) }),
986
+ /* @__PURE__ */ jsx(
987
+ "button",
988
+ {
989
+ type: "button",
990
+ className: "shrink-0 hover:text-blue-900 dark:hover:text-blue-200",
991
+ onClick: (e) => handleChipRemove(e, v),
992
+ "aria-label": `Remove ${labelFor(v)}`,
993
+ children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
994
+ }
995
+ )
996
+ ]
997
+ },
998
+ v
999
+ )),
1000
+ overflow > 0 && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-950/50 dark:text-blue-400 dark:border-blue-800/50 rounded-md px-2 py-0.5 text-xs font-medium", children: [
1001
+ "+",
1002
+ overflow,
1003
+ " more"
1004
+ ] })
1005
+ ] });
1006
+ }
1007
+ if (committedSingle !== void 0) {
1008
+ return /* @__PURE__ */ jsx("span", { className: "truncate text-gray-900 dark:text-gray-100", children: labelFor(committedSingle) });
1009
+ }
1010
+ return /* @__PURE__ */ jsx("span", { className: "text-gray-400 dark:text-gray-500 truncate", children: placeholder });
1011
+ };
1012
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-1.5", className), children: [
1013
+ label && /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: label }),
1014
+ /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
1015
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1016
+ "button",
1017
+ {
1018
+ ref,
1019
+ type: "button",
1020
+ disabled,
1021
+ className: cn(
1022
+ "flex h-[42px] min-h-[42px] w-full items-center justify-between gap-2 rounded-hz-md border border-gray-300 bg-white px-3 text-sm shadow-sm transition-colors",
1023
+ "hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
1024
+ "dark:border-neutral-600 dark:bg-neutral-800 dark:hover:bg-neutral-700",
1025
+ "disabled:pointer-events-none disabled:opacity-50"
1026
+ ),
1027
+ children: [
1028
+ /* @__PURE__ */ jsx("span", { className: "flex-1 min-w-0 flex items-center", children: renderTriggerContent() }),
1029
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 opacity-50" })
1030
+ ]
1031
+ }
1032
+ ) }),
1033
+ /* @__PURE__ */ jsxs(
1034
+ PopoverContent,
1035
+ {
1036
+ align: "start",
1037
+ className: "w-[var(--radix-popover-trigger-width)] min-w-[200px] p-0 overflow-hidden",
1038
+ children: [
1039
+ searchable && /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b border-neutral-200/50 dark:border-neutral-700/50", children: [
1040
+ /* @__PURE__ */ jsx(Search, { className: "mr-2 h-6 w-6 shrink-0 opacity-50 pl-2" }),
1041
+ /* @__PURE__ */ jsx(
1042
+ "input",
1043
+ {
1044
+ ref: searchRef,
1045
+ value: search,
1046
+ onChange: (e) => setSearch(e.target.value),
1047
+ placeholder: searchPlaceholder,
1048
+ onKeyDown: (e) => e.stopPropagation(),
1049
+ className: "flex h-10 w-full py-2 bg-transparent text-sm placeholder:text-neutral-400 dark:placeholder:text-neutral-500 px-2 focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none"
1050
+ }
1051
+ )
1052
+ ] }),
1053
+ /* @__PURE__ */ jsx("div", { className: "p-1 max-h-[240px] overflow-y-auto", children: filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-2 py-4 text-center text-sm text-gray-400 dark:text-gray-500", children: "No results found." }) : filtered.map((option) => {
1054
+ if (multiple) {
1055
+ const checked = activeMulti.includes(option.value);
1056
+ return /* @__PURE__ */ jsxs(
1057
+ "button",
1058
+ {
1059
+ type: "button",
1060
+ disabled: option.disabled,
1061
+ onClick: () => handleMultiToggle(option.value),
1062
+ className: cn(
1063
+ "relative flex w-full cursor-default select-none items-center gap-2 rounded-hz-md py-1.5 px-2 text-sm outline-none transition-colors",
1064
+ "hover:bg-black/5 dark:hover:bg-white/10",
1065
+ option.disabled && "pointer-events-none opacity-50"
1066
+ ),
1067
+ children: [
1068
+ /* @__PURE__ */ jsx(
1069
+ CheckboxPrimitive.Root,
1070
+ {
1071
+ checked,
1072
+ tabIndex: -1,
1073
+ className: cn(
1074
+ "peer h-4 w-4 shrink-0 rounded-hz-sm border border-gray-300 bg-transparent shadow focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600 data-[state=checked]:text-white dark:border-neutral-600 dark:data-[state=checked]:bg-blue-600"
1075
+ ),
1076
+ style: { pointerEvents: "none" },
1077
+ children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx(
1078
+ Check,
1079
+ {
1080
+ className: "h-3.5 w-3.5",
1081
+ strokeWidth: 3
1082
+ }
1083
+ ) })
1084
+ }
1085
+ ),
1086
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: option.label })
1087
+ ]
1088
+ },
1089
+ option.value
1090
+ );
1091
+ }
1092
+ const selected = activeSingle === option.value;
1093
+ return /* @__PURE__ */ jsxs(
1094
+ "button",
1095
+ {
1096
+ type: "button",
1097
+ disabled: option.disabled,
1098
+ onClick: () => handleSingleSelect(option.value),
1099
+ className: cn(
1100
+ "relative flex w-full cursor-default select-none items-center rounded-hz-md py-1.5 pl-2 pr-8 text-sm outline-none transition-colors",
1101
+ "hover:bg-black/5 dark:hover:bg-white/10",
1102
+ option.disabled && "pointer-events-none opacity-50"
1103
+ ),
1104
+ children: [
1105
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: option.label }),
1106
+ selected && /* @__PURE__ */ jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) })
1107
+ ]
1108
+ },
1109
+ option.value
1110
+ );
1111
+ }) }),
1112
+ manualApply && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2 px-2 py-3 border-t border-gray-100 dark:border-neutral-700", children: [
1113
+ /* @__PURE__ */ jsx(
1114
+ "button",
1115
+ {
1116
+ type: "button",
1117
+ onClick: handleClear,
1118
+ disabled: !canClear,
1119
+ className: cn(
1120
+ "px-3 py-1.5 rounded-md text-sm transition-colors",
1121
+ canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
1122
+ ),
1123
+ children: "Clear"
1124
+ }
1125
+ ),
1126
+ /* @__PURE__ */ jsx(
1127
+ "button",
1128
+ {
1129
+ type: "button",
1130
+ onClick: handleApply,
1131
+ disabled: !canApply,
1132
+ className: cn(
1133
+ "px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
1134
+ canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
1135
+ ),
1136
+ children: "Apply"
1137
+ }
1138
+ )
1139
+ ] })
1140
+ ]
1141
+ }
1142
+ )
1143
+ ] })
1144
+ ] });
1145
+ });
1146
+ SelectBar.displayName = "SelectBar";
846
1147
  var separatorVariants = cva("shrink-0 bg-gray-200 dark:bg-neutral-700", {
847
1148
  variants: {
848
1149
  orientation: {
@@ -1023,8 +1324,8 @@ function SegmentedControl({
1023
1324
  );
1024
1325
  }
1025
1326
  function BulkEditPopover({ column, onApply }) {
1026
- const [value, setValue] = React10.useState("");
1027
- const [open, setOpen] = React10.useState(false);
1327
+ const [value, setValue] = React11.useState("");
1328
+ const [open, setOpen] = React11.useState(false);
1028
1329
  const { bulkEdit } = column;
1029
1330
  if (!bulkEdit) return null;
1030
1331
  const isValid = bulkEdit.kind === "input" ? !!value.trim() : !!value;
@@ -1098,12 +1399,12 @@ function BulkEditPopover({ column, onApply }) {
1098
1399
  ] })
1099
1400
  ] }) }) });
1100
1401
  }
1101
- var TableContext = React10.createContext(null);
1402
+ var TableContext = React11.createContext(null);
1102
1403
  var useTableContext = () => {
1103
- const context = React10.useContext(TableContext);
1404
+ const context = React11.useContext(TableContext);
1104
1405
  return context;
1105
1406
  };
1106
- var TableInner = React10.forwardRef(
1407
+ var TableInner = React11.forwardRef(
1107
1408
  ({
1108
1409
  className,
1109
1410
  selectionMode = "multiple",
@@ -1129,23 +1430,23 @@ var TableInner = React10.forwardRef(
1129
1430
  }, ref) => {
1130
1431
  const effectiveActionColumns = actionColumns ?? [];
1131
1432
  const effectiveSelectable = effectiveActionColumns.includes("checkbox");
1132
- const [internalSelectedRows, setInternalSelectedRows] = React10.useState(/* @__PURE__ */ new Set());
1133
- const [registeredRowIds, setRegisteredRowIds] = React10.useState(/* @__PURE__ */ new Set());
1134
- const wrapperRef = React10.useRef(null);
1433
+ const [internalSelectedRows, setInternalSelectedRows] = React11.useState(/* @__PURE__ */ new Set());
1434
+ const [registeredRowIds, setRegisteredRowIds] = React11.useState(/* @__PURE__ */ new Set());
1435
+ const wrapperRef = React11.useRef(null);
1135
1436
  const isControlled = controlledSelectedRows !== void 0;
1136
1437
  const selectedRowsSet = isControlled ? new Set(controlledSelectedRows) : internalSelectedRows;
1137
- const defaultGetRowId = React10.useCallback((row) => {
1438
+ const defaultGetRowId = React11.useCallback((row) => {
1138
1439
  if (typeof row === "string") return row;
1139
1440
  if (typeof row === "object" && row?.id) return String(row.id);
1140
1441
  return String(row);
1141
1442
  }, []);
1142
1443
  const finalGetRowId = getRowId || defaultGetRowId;
1143
- const allRowIds = React10.useMemo(() => {
1444
+ const allRowIds = React11.useMemo(() => {
1144
1445
  if (rows) return new Set(rows.map(finalGetRowId));
1145
1446
  if (data) return new Set(data.map(finalGetRowId));
1146
1447
  return registeredRowIds;
1147
1448
  }, [rows, data, finalGetRowId, registeredRowIds]);
1148
- const registerRowId = React10.useCallback((rowId) => {
1449
+ const registerRowId = React11.useCallback((rowId) => {
1149
1450
  if (rowId) {
1150
1451
  setRegisteredRowIds((prev) => {
1151
1452
  if (prev.has(rowId)) return prev;
@@ -1153,7 +1454,7 @@ var TableInner = React10.forwardRef(
1153
1454
  });
1154
1455
  }
1155
1456
  }, []);
1156
- const unregisterRowId = React10.useCallback((rowId) => {
1457
+ const unregisterRowId = React11.useCallback((rowId) => {
1157
1458
  if (rowId) {
1158
1459
  setRegisteredRowIds((prev) => {
1159
1460
  if (!prev.has(rowId)) return prev;
@@ -1163,7 +1464,7 @@ var TableInner = React10.forwardRef(
1163
1464
  });
1164
1465
  }
1165
1466
  }, []);
1166
- const toggleRow = React10.useCallback(
1467
+ const toggleRow = React11.useCallback(
1167
1468
  (rowId) => {
1168
1469
  if (!effectiveSelectable) return;
1169
1470
  const next = new Set(selectedRowsSet);
@@ -1188,7 +1489,7 @@ var TableInner = React10.forwardRef(
1188
1489
  },
1189
1490
  [effectiveSelectable, selectionMode, selectedRowsSet, isControlled, onSelectionChange]
1190
1491
  );
1191
- const selectAll = React10.useCallback(() => {
1492
+ const selectAll = React11.useCallback(() => {
1192
1493
  if (!effectiveSelectable || selectionMode !== "multiple" || allRowIds.size === 0) return;
1193
1494
  const next = new Set(allRowIds);
1194
1495
  if (isControlled) {
@@ -1198,7 +1499,7 @@ var TableInner = React10.forwardRef(
1198
1499
  onSelectionChange?.(Array.from(next));
1199
1500
  }
1200
1501
  }, [effectiveSelectable, selectionMode, allRowIds, isControlled, onSelectionChange]);
1201
- const deselectAll = React10.useCallback(() => {
1502
+ const deselectAll = React11.useCallback(() => {
1202
1503
  if (!effectiveSelectable) return;
1203
1504
  const next = /* @__PURE__ */ new Set();
1204
1505
  if (isControlled) {
@@ -1208,19 +1509,19 @@ var TableInner = React10.forwardRef(
1208
1509
  onSelectionChange?.(Array.from(next));
1209
1510
  }
1210
1511
  }, [effectiveSelectable, isControlled, onSelectionChange]);
1211
- const isRowSelected = React10.useCallback(
1512
+ const isRowSelected = React11.useCallback(
1212
1513
  (rowId) => selectedRowsSet.has(rowId),
1213
1514
  [selectedRowsSet]
1214
1515
  );
1215
- const isAllSelected = React10.useMemo(() => {
1516
+ const isAllSelected = React11.useMemo(() => {
1216
1517
  if (!effectiveSelectable || allRowIds.size === 0) return false;
1217
1518
  return allRowIds.size > 0 && Array.from(allRowIds).every((id) => selectedRowsSet.has(id));
1218
1519
  }, [effectiveSelectable, allRowIds, selectedRowsSet]);
1219
- const isSomeSelected = React10.useMemo(() => {
1520
+ const isSomeSelected = React11.useMemo(() => {
1220
1521
  if (!effectiveSelectable) return false;
1221
1522
  return selectedRowsSet.size > 0 && !isAllSelected;
1222
1523
  }, [effectiveSelectable, selectedRowsSet.size, isAllSelected]);
1223
- const contextValue = React10.useMemo(() => ({
1524
+ const contextValue = React11.useMemo(() => ({
1224
1525
  selectable: effectiveSelectable,
1225
1526
  selectionMode,
1226
1527
  selectedRows: selectedRowsSet,
@@ -1249,7 +1550,7 @@ var TableInner = React10.forwardRef(
1249
1550
  unregisterRowId,
1250
1551
  stickyYHeader
1251
1552
  ]);
1252
- React10.useEffect(() => {
1553
+ React11.useEffect(() => {
1253
1554
  const wrapper = wrapperRef.current;
1254
1555
  if (!wrapper || highlightMode === "none") return;
1255
1556
  let prevCell = null;
@@ -1436,7 +1737,7 @@ var TableInner = React10.forwardRef(
1436
1737
  );
1437
1738
  TableInner.displayName = "Table";
1438
1739
  var Table = TableInner;
1439
- var TableHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1740
+ var TableHeader = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1440
1741
  "thead",
1441
1742
  {
1442
1743
  ref,
@@ -1445,7 +1746,7 @@ var TableHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
1445
1746
  }
1446
1747
  ));
1447
1748
  TableHeader.displayName = "TableHeader";
1448
- var TableBody = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1749
+ var TableBody = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1449
1750
  "tbody",
1450
1751
  {
1451
1752
  ref,
@@ -1454,7 +1755,7 @@ var TableBody = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE_
1454
1755
  }
1455
1756
  ));
1456
1757
  TableBody.displayName = "TableBody";
1457
- var TableFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1758
+ var TableFooter = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1458
1759
  "tfoot",
1459
1760
  {
1460
1761
  ref,
@@ -1466,19 +1767,19 @@ var TableFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
1466
1767
  }
1467
1768
  ));
1468
1769
  TableFooter.displayName = "TableFooter";
1469
- var TableRow = React10.forwardRef(
1770
+ var TableRow = React11.forwardRef(
1470
1771
  ({ className, rowId, rowData, onClick, ...props }, ref) => {
1471
1772
  const context = useTableContext();
1472
1773
  const getRowId = context?.getRowId;
1473
1774
  const selectable = context?.selectable;
1474
1775
  const registerRowId = context?.registerRowId;
1475
1776
  const unregisterRowId = context?.unregisterRowId;
1476
- const finalRowId = React10.useMemo(() => {
1777
+ const finalRowId = React11.useMemo(() => {
1477
1778
  if (rowId) return rowId;
1478
1779
  if (rowData && getRowId) return getRowId(rowData);
1479
1780
  return props.id || void 0;
1480
1781
  }, [rowId, rowData, getRowId, props.id]);
1481
- React10.useEffect(() => {
1782
+ React11.useEffect(() => {
1482
1783
  if (finalRowId && selectable) {
1483
1784
  registerRowId?.(finalRowId);
1484
1785
  return () => {
@@ -1487,7 +1788,7 @@ var TableRow = React10.forwardRef(
1487
1788
  }
1488
1789
  }, [finalRowId, selectable, registerRowId, unregisterRowId]);
1489
1790
  const isSelected = finalRowId ? context?.isRowSelected(finalRowId) : false;
1490
- const handleClick = React10.useCallback(
1791
+ const handleClick = React11.useCallback(
1491
1792
  (e) => {
1492
1793
  onClick?.(e);
1493
1794
  },
@@ -1510,7 +1811,7 @@ var TableRow = React10.forwardRef(
1510
1811
  }
1511
1812
  );
1512
1813
  TableRow.displayName = "TableRow";
1513
- var TableHead = React10.forwardRef(({ className, style, ...props }, ref) => {
1814
+ var TableHead = React11.forwardRef(({ className, style, ...props }, ref) => {
1514
1815
  const context = useTableContext();
1515
1816
  const isDark = typeof document !== "undefined" && document.documentElement.classList.contains("dark");
1516
1817
  const yShadow = `inset 0 -1px 0 0 ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"}`;
@@ -1529,7 +1830,7 @@ var TableHead = React10.forwardRef(({ className, style, ...props }, ref) => {
1529
1830
  );
1530
1831
  });
1531
1832
  TableHead.displayName = "TableHead";
1532
- var TableCell = React10.forwardRef(
1833
+ var TableCell = React11.forwardRef(
1533
1834
  ({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
1534
1835
  "td",
1535
1836
  {
@@ -1544,7 +1845,7 @@ var TableCell = React10.forwardRef(
1544
1845
  )
1545
1846
  );
1546
1847
  TableCell.displayName = "TableCell";
1547
- var TableCaption = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1848
+ var TableCaption = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1548
1849
  "caption",
1549
1850
  {
1550
1851
  ref,
@@ -1553,7 +1854,7 @@ var TableCaption = React10.forwardRef(({ className, ...props }, ref) => /* @__PU
1553
1854
  }
1554
1855
  ));
1555
1856
  TableCaption.displayName = "TableCaption";
1556
- var TableSelectAll = React10.forwardRef(({ className, ...props }, ref) => {
1857
+ var TableSelectAll = React11.forwardRef(({ className, ...props }, ref) => {
1557
1858
  const context = useTableContext();
1558
1859
  if (!context?.selectable || context.selectionMode !== "multiple") {
1559
1860
  return null;
@@ -1577,13 +1878,13 @@ var TableSelectAll = React10.forwardRef(({ className, ...props }, ref) => {
1577
1878
  ) });
1578
1879
  });
1579
1880
  TableSelectAll.displayName = "TableSelectAll";
1580
- var TableRowCheckbox = React10.forwardRef(({ rowId, rowData, className, ...props }, ref) => {
1881
+ var TableRowCheckbox = React11.forwardRef(({ rowId, rowData, className, ...props }, ref) => {
1581
1882
  const context = useTableContext();
1582
1883
  const getRowId = context?.getRowId;
1583
1884
  if (!context?.selectable) {
1584
1885
  return null;
1585
1886
  }
1586
- const finalRowId = React10.useMemo(() => {
1887
+ const finalRowId = React11.useMemo(() => {
1587
1888
  if (rowId) return rowId;
1588
1889
  if (rowData && getRowId) return getRowId(rowData);
1589
1890
  return void 0;
@@ -1668,7 +1969,7 @@ function ColumnSelection({
1668
1969
  triggerLabel = "Manage Columns",
1669
1970
  trigger
1670
1971
  }) {
1671
- const handleToggle = React10.useCallback((key, checked) => {
1972
+ const handleToggle = React11.useCallback((key, checked) => {
1672
1973
  if (checked) {
1673
1974
  if (!visibleColumns.includes(key)) {
1674
1975
  onVisibleColumnsChange([...visibleColumns, key]);
@@ -1715,33 +2016,33 @@ function ColumnSelection({
1715
2016
  ] })
1716
2017
  ] });
1717
2018
  }
1718
- var TabsContext = React10.createContext(null);
2019
+ var TabsContext = React11.createContext(null);
1719
2020
  var useTabsContext = () => {
1720
- const context = React10.useContext(TabsContext);
2021
+ const context = React11.useContext(TabsContext);
1721
2022
  if (!context) {
1722
2023
  throw new Error("Tabs components must be used within a Tabs provider");
1723
2024
  }
1724
2025
  return context;
1725
2026
  };
1726
- var TabsListContext = React10.createContext({ variant: "pill" });
1727
- var useTabsListContext = () => React10.useContext(TabsListContext);
1728
- var Tabs = React10.forwardRef(({ defaultValue, value, onValueChange, children, ...props }, ref) => {
1729
- const [activeTab, setActiveTabState] = React10.useState(value ?? defaultValue);
1730
- const tabRefs = React10.useRef(/* @__PURE__ */ new Map()).current;
1731
- const listRef = React10.useRef(null);
1732
- const setActiveTab = React10.useCallback(
2027
+ var TabsListContext = React11.createContext({ variant: "pill" });
2028
+ var useTabsListContext = () => React11.useContext(TabsListContext);
2029
+ var Tabs = React11.forwardRef(({ defaultValue, value, onValueChange, children, ...props }, ref) => {
2030
+ const [activeTab, setActiveTabState] = React11.useState(value ?? defaultValue);
2031
+ const tabRefs = React11.useRef(/* @__PURE__ */ new Map()).current;
2032
+ const listRef = React11.useRef(null);
2033
+ const setActiveTab = React11.useCallback(
1733
2034
  (newValue) => {
1734
2035
  setActiveTabState(newValue);
1735
2036
  onValueChange?.(newValue);
1736
2037
  },
1737
2038
  [onValueChange]
1738
2039
  );
1739
- React10.useEffect(() => {
2040
+ React11.useEffect(() => {
1740
2041
  if (value !== void 0) {
1741
2042
  setActiveTabState(value);
1742
2043
  }
1743
2044
  }, [value]);
1744
- const registerTab = React10.useCallback(
2045
+ const registerTab = React11.useCallback(
1745
2046
  (tabValue, element) => {
1746
2047
  tabRefs.set(tabValue, element);
1747
2048
  },
@@ -1766,10 +2067,10 @@ var Tabs = React10.forwardRef(({ defaultValue, value, onValueChange, children, .
1766
2067
  );
1767
2068
  });
1768
2069
  Tabs.displayName = "Tabs";
1769
- var TabsList = React10.forwardRef(({ className, children, variant = "pill", ...props }, ref) => {
2070
+ var TabsList = React11.forwardRef(({ className, children, variant = "pill", ...props }, ref) => {
1770
2071
  const { activeTab, tabRefs, listRef } = useTabsContext();
1771
- const [indicatorStyle, setIndicatorStyle] = React10.useState(null);
1772
- React10.useEffect(() => {
2072
+ const [indicatorStyle, setIndicatorStyle] = React11.useState(null);
2073
+ React11.useEffect(() => {
1773
2074
  if (variant !== "pill") return;
1774
2075
  const updateIndicator = () => {
1775
2076
  if (!activeTab || !listRef.current) return;
@@ -1822,11 +2123,11 @@ var TabsList = React10.forwardRef(({ className, children, variant = "pill", ...p
1822
2123
  ) });
1823
2124
  });
1824
2125
  TabsList.displayName = TabsPrimitive.List.displayName;
1825
- var TabsTrigger = React10.forwardRef(({ className, value, icon, children, ...props }, ref) => {
2126
+ var TabsTrigger = React11.forwardRef(({ className, value, icon, children, ...props }, ref) => {
1826
2127
  const { registerTab, activeTab } = useTabsContext();
1827
2128
  const { variant } = useTabsListContext();
1828
- const triggerRef = React10.useRef(null);
1829
- React10.useEffect(() => {
2129
+ const triggerRef = React11.useRef(null);
2130
+ React11.useEffect(() => {
1830
2131
  registerTab(value, triggerRef.current);
1831
2132
  return () => registerTab(value, null);
1832
2133
  }, [value, registerTab]);
@@ -1860,7 +2161,7 @@ var TabsTrigger = React10.forwardRef(({ className, value, icon, children, ...pro
1860
2161
  );
1861
2162
  });
1862
2163
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
1863
- var TabsContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2164
+ var TabsContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1864
2165
  TabsPrimitive.Content,
1865
2166
  {
1866
2167
  ref,
@@ -1872,7 +2173,7 @@ var TabsContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
1872
2173
  }
1873
2174
  ));
1874
2175
  TabsContent.displayName = TabsPrimitive.Content.displayName;
1875
- var Textarea = React10.forwardRef(
2176
+ var Textarea = React11.forwardRef(
1876
2177
  ({ className, ...props }, ref) => {
1877
2178
  return /* @__PURE__ */ jsx(
1878
2179
  "textarea",
@@ -2029,8 +2330,8 @@ var switchLabelVariants = cva("select-none", {
2029
2330
  size: "default"
2030
2331
  }
2031
2332
  });
2032
- var Switch = React10.forwardRef(({ className, size, label, labelPosition = "right", ...props }, ref) => {
2033
- const generatedId = React10.useId();
2333
+ var Switch = React11.forwardRef(({ className, size, label, labelPosition = "right", ...props }, ref) => {
2334
+ const generatedId = React11.useId();
2034
2335
  const switchId = props.id ?? generatedId;
2035
2336
  const switchEl = /* @__PURE__ */ jsx(
2036
2337
  SwitchPrimitive.Root,
@@ -2108,39 +2409,59 @@ function TimeInput({
2108
2409
  max,
2109
2410
  onChange,
2110
2411
  onComplete,
2412
+ onDirty,
2111
2413
  inputRef,
2112
2414
  disabled = false,
2113
2415
  "aria-label": ariaLabel
2114
2416
  }) {
2115
- const [editValue, setEditValue] = React10.useState(null);
2116
- const internalRef = React10.useRef(null);
2117
- const committedRef = React10.useRef(false);
2118
- const setRefs = React10.useCallback(mergeRefs(internalRef, inputRef), [inputRef]);
2119
- const handleChange = (e) => {
2120
- const raw = e.target.value.replace(/\D/g, "").slice(0, 2);
2121
- if (raw === "") {
2122
- setEditValue(raw);
2123
- return;
2124
- }
2125
- if (raw.length === 1) {
2126
- setEditValue(raw);
2127
- return;
2128
- }
2417
+ const [editValue, setEditValue] = React11.useState(null);
2418
+ const internalRef = React11.useRef(null);
2419
+ const committedRef = React11.useRef(false);
2420
+ const pendingDigitRef = React11.useRef(null);
2421
+ const setRefs = React11.useCallback(mergeRefs(internalRef, inputRef), [inputRef]);
2422
+ const commitTwoDigits = (raw) => {
2129
2423
  const parsed = parseInt(raw, 10);
2130
2424
  const clamped = clamp(parsed, min2, max);
2425
+ pendingDigitRef.current = null;
2131
2426
  committedRef.current = true;
2132
2427
  onChange(clamped);
2133
2428
  setEditValue(null);
2134
2429
  onComplete?.();
2135
2430
  };
2431
+ const handleChange = (e) => {
2432
+ const allDigits = e.target.value.replace(/\D/g, "");
2433
+ if (allDigits === "") {
2434
+ setEditValue("");
2435
+ pendingDigitRef.current = null;
2436
+ return;
2437
+ }
2438
+ if (pendingDigitRef.current !== null) {
2439
+ if (allDigits.length > 2) {
2440
+ commitTwoDigits(pendingDigitRef.current + allDigits[allDigits.length - 1]);
2441
+ return;
2442
+ }
2443
+ pendingDigitRef.current = null;
2444
+ setEditValue("");
2445
+ return;
2446
+ }
2447
+ if (allDigits.length === 1) {
2448
+ pendingDigitRef.current = allDigits;
2449
+ setEditValue("0" + allDigits);
2450
+ onDirty?.();
2451
+ return;
2452
+ }
2453
+ commitTwoDigits(allDigits.slice(0, 2));
2454
+ };
2136
2455
  const commit = () => {
2137
2456
  if (committedRef.current) {
2138
2457
  committedRef.current = false;
2458
+ pendingDigitRef.current = null;
2139
2459
  setEditValue(null);
2140
2460
  return;
2141
2461
  }
2142
2462
  if (editValue === null) return;
2143
2463
  if (editValue === "") {
2464
+ pendingDigitRef.current = null;
2144
2465
  setEditValue(null);
2145
2466
  return;
2146
2467
  }
@@ -2148,6 +2469,7 @@ function TimeInput({
2148
2469
  if (!isNaN(parsed)) {
2149
2470
  onChange(clamp(parsed, min2, max));
2150
2471
  }
2472
+ pendingDigitRef.current = null;
2151
2473
  setEditValue(null);
2152
2474
  };
2153
2475
  const handleKeyDown = (e) => {
@@ -2155,16 +2477,19 @@ function TimeInput({
2155
2477
  commit();
2156
2478
  internalRef.current?.blur();
2157
2479
  } else if (e.key === "Escape") {
2480
+ pendingDigitRef.current = null;
2158
2481
  setEditValue(null);
2159
2482
  internalRef.current?.blur();
2160
2483
  } else if (e.key === "ArrowUp") {
2161
2484
  e.preventDefault();
2485
+ pendingDigitRef.current = null;
2162
2486
  const curr = value ?? min2;
2163
2487
  const next = curr >= max ? min2 : curr + 1;
2164
2488
  onChange(next);
2165
2489
  setEditValue(pad(next));
2166
2490
  } else if (e.key === "ArrowDown") {
2167
2491
  e.preventDefault();
2492
+ pendingDigitRef.current = null;
2168
2493
  const curr = value ?? max;
2169
2494
  const next = curr <= min2 ? max : curr - 1;
2170
2495
  onChange(next);
@@ -2182,6 +2507,7 @@ function TimeInput({
2182
2507
  value: editValue ?? (value === null ? "--" : pad(value)),
2183
2508
  onChange: handleChange,
2184
2509
  onFocus: (e) => {
2510
+ pendingDigitRef.current = null;
2185
2511
  setEditValue("");
2186
2512
  requestAnimationFrame(() => e.target.select());
2187
2513
  },
@@ -2232,11 +2558,12 @@ function TimeField({
2232
2558
  hourRef,
2233
2559
  minuteRef,
2234
2560
  onMinuteComplete,
2561
+ onDirty,
2235
2562
  disabled = false
2236
2563
  }) {
2237
2564
  const { hour12, period } = to12Hour(value.hour);
2238
- const minuteInputRef = React10.useRef(null);
2239
- const mergedMinuteRef = React10.useCallback(mergeRefs(minuteInputRef, minuteRef), [minuteRef]);
2565
+ const minuteInputRef = React11.useRef(null);
2566
+ const mergedMinuteRef = React11.useCallback(mergeRefs(minuteInputRef, minuteRef), [minuteRef]);
2240
2567
  const handleHourChange = (newHour12) => {
2241
2568
  onChange({ ...value, hour: to24Hour(newHour12, period) });
2242
2569
  };
@@ -2270,6 +2597,7 @@ function TimeField({
2270
2597
  max: 12,
2271
2598
  onChange: handleHourChange,
2272
2599
  onComplete: focusMinute,
2600
+ onDirty,
2273
2601
  inputRef: hourRef,
2274
2602
  disabled,
2275
2603
  "aria-label": `${label} hour`
@@ -2293,6 +2621,7 @@ function TimeField({
2293
2621
  max: 59,
2294
2622
  onChange: handleMinuteChange,
2295
2623
  onComplete: onMinuteComplete,
2624
+ onDirty,
2296
2625
  inputRef: mergedMinuteRef,
2297
2626
  disabled,
2298
2627
  "aria-label": `${label} minute`
@@ -2309,11 +2638,14 @@ function TimeField({
2309
2638
  ] })
2310
2639
  ] });
2311
2640
  }
2312
- function TimePickerColumn({ value, onChange, disabled = false }) {
2313
- const toHourRef = React10.useRef(null);
2641
+ function useTimeFieldState(value) {
2314
2642
  const fromSet = isTimeSet(value.from);
2315
2643
  const toSet = isTimeSet(value.to);
2316
2644
  const bothSet = fromSet && toSet;
2645
+ const orphanMinutes = value.from.hour === null && value.from.minute !== null || value.to.hour === null && value.to.minute !== null;
2646
+ const fromPartial = !fromSet && (value.from.hour !== null || value.from.minute !== null);
2647
+ const toPartial = !toSet && (value.to.hour !== null || value.to.minute !== null);
2648
+ const oneSideMissing = fromSet && !toSet && !toPartial || toSet && !fromSet && !fromPartial;
2317
2649
  const fromMinutes = (value.from.hour ?? 0) * 60 + (value.from.minute ?? 0);
2318
2650
  const toMinutes = (value.to.hour ?? 0) * 60 + (value.to.minute ?? 0);
2319
2651
  const bothEqual = fromMinutes === toMinutes;
@@ -2323,140 +2655,142 @@ function TimePickerColumn({ value, onChange, disabled = false }) {
2323
2655
  const durationRemaining = durationMinutes % 60;
2324
2656
  const showDuration = bothSet && !bothEqual;
2325
2657
  const durationLabel = durationRemaining > 0 ? `${durationHours}h ${durationRemaining}m window${isOvernight ? " (overnight)" : ""}` : `${durationHours}h window${isOvernight ? " (overnight)" : ""}`;
2326
- return /* @__PURE__ */ jsxs(
2327
- "div",
2328
- {
2329
- className: cn(
2330
- "flex flex-col px-2 pt-2 pb-2 gap-1",
2331
- "border-t border-gray-100 dark:border-neutral-700"
2658
+ const incompleteHint = orphanMinutes ? "Please set hours for the time to take effect" : fromPartial || toPartial ? "Please complete both hour and minute fields" : oneSideMissing ? `Please set the ${fromSet ? "to" : "from"} time` : null;
2659
+ return { showDuration, durationLabel, isOvernight, incompleteHint };
2660
+ }
2661
+ function TimePickerColumn({ value, onChange, disabled = false, onRemove, showRemove = false, onDirty }) {
2662
+ const toHourRef = React11.useRef(null);
2663
+ const { showDuration, durationLabel, isOvernight, incompleteHint } = useTimeFieldState(value);
2664
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-2 pt-2 pb-2 gap-1", children: [
2665
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2666
+ /* @__PURE__ */ jsx(
2667
+ Clock,
2668
+ {
2669
+ className: cn(
2670
+ "w-4 h-4 shrink-0",
2671
+ disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
2672
+ )
2673
+ }
2332
2674
  ),
2333
- children: [
2334
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2335
- /* @__PURE__ */ jsx(
2336
- Clock,
2337
- {
2338
- className: cn(
2339
- "w-4 h-4 shrink-0",
2340
- disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
2341
- )
2342
- }
2343
- ),
2344
- /* @__PURE__ */ jsx(
2345
- "span",
2346
- {
2347
- className: cn(
2348
- "text-xs font-semibold uppercase tracking-wider",
2349
- disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
2350
- ),
2351
- children: "Time"
2352
- }
2353
- ),
2354
- /* @__PURE__ */ jsx("span", { className: "text-[9px] font-medium text-gray-400 dark:text-gray-600 tracking-wide", children: "(Optional)" })
2355
- ] }),
2356
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pl-6", children: [
2357
- /* @__PURE__ */ jsx(
2358
- TimeField,
2359
- {
2360
- label: "From",
2361
- value: value.from,
2362
- onChange: (from) => onChange({ ...value, from }),
2363
- onMinuteComplete: () => toHourRef.current?.focus(),
2364
- disabled
2365
- }
2366
- ),
2367
- /* @__PURE__ */ jsx(
2368
- TimeField,
2369
- {
2370
- label: "To",
2371
- value: value.to,
2372
- onChange: (to) => onChange({ ...value, to }),
2373
- hourRef: toHourRef,
2374
- disabled
2375
- }
2675
+ /* @__PURE__ */ jsx(
2676
+ "span",
2677
+ {
2678
+ className: cn(
2679
+ "text-xs font-semibold uppercase tracking-wider",
2680
+ disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
2376
2681
  ),
2377
- showDuration && /* @__PURE__ */ jsx("span", { className: cn(
2378
- "text-[10px] font-medium",
2379
- isOvernight ? "text-amber-500 dark:text-amber-400" : "text-gray-400 dark:text-gray-500"
2380
- ), children: durationLabel })
2381
- ] })
2382
- ]
2383
- }
2384
- );
2682
+ children: "Time"
2683
+ }
2684
+ ),
2685
+ /* @__PURE__ */ jsx("span", { className: "text-[9px] font-medium text-gray-400 dark:text-gray-600 tracking-wide", children: "(Optional)" }),
2686
+ showRemove && onRemove && /* @__PURE__ */ jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsx(
2687
+ TextButton,
2688
+ {
2689
+ variant: "danger",
2690
+ onClick: onRemove,
2691
+ size: "sm",
2692
+ className: "!text-[0.625rem]",
2693
+ children: "Remove"
2694
+ }
2695
+ ) })
2696
+ ] }),
2697
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pl-6", children: [
2698
+ /* @__PURE__ */ jsx(
2699
+ TimeField,
2700
+ {
2701
+ label: "From",
2702
+ value: value.from,
2703
+ onChange: (from) => onChange({ ...value, from }),
2704
+ onMinuteComplete: () => toHourRef.current?.focus(),
2705
+ onDirty,
2706
+ disabled
2707
+ }
2708
+ ),
2709
+ /* @__PURE__ */ jsx(
2710
+ TimeField,
2711
+ {
2712
+ label: "To",
2713
+ value: value.to,
2714
+ onChange: (to) => onChange({ ...value, to }),
2715
+ hourRef: toHourRef,
2716
+ onDirty,
2717
+ disabled
2718
+ }
2719
+ ),
2720
+ showDuration && /* @__PURE__ */ jsx("span", { className: cn(
2721
+ "text-[10px] font-medium",
2722
+ isOvernight ? "text-amber-500 dark:text-amber-400" : "text-gray-400 dark:text-gray-500"
2723
+ ), children: durationLabel }),
2724
+ incompleteHint && /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-amber-500 dark:text-amber-400", children: incompleteHint })
2725
+ ] })
2726
+ ] });
2385
2727
  }
2386
- function TimePickerRow({ value, onChange, disabled = false }) {
2387
- const toHourRef = React10.useRef(null);
2388
- const fromSet = isTimeSet(value.from);
2389
- const toSet = isTimeSet(value.to);
2390
- const bothSet = fromSet && toSet;
2391
- const fromMinutes = (value.from.hour ?? 0) * 60 + (value.from.minute ?? 0);
2392
- const toMinutes = (value.to.hour ?? 0) * 60 + (value.to.minute ?? 0);
2393
- const bothEqual = fromMinutes === toMinutes;
2394
- const isOvernight = bothSet && toMinutes < fromMinutes;
2395
- const durationMinutes = bothSet && !bothEqual ? isOvernight ? 24 * 60 - fromMinutes + toMinutes : toMinutes - fromMinutes : 0;
2396
- const durationHours = Math.floor(durationMinutes / 60);
2397
- const durationRemaining = durationMinutes % 60;
2398
- const showDuration = bothSet && !bothEqual;
2399
- const durationLabel = durationRemaining > 0 ? `${durationHours}h ${durationRemaining}m window${isOvernight ? " (overnight)" : ""}` : `${durationHours}h window${isOvernight ? " (overnight)" : ""}`;
2400
- return /* @__PURE__ */ jsx(
2401
- "div",
2402
- {
2403
- className: cn(
2404
- "flex flex-col px-4 pt-2 pb-3 gap-1",
2405
- "border-t border-gray-100 dark:border-neutral-700"
2728
+ function TimePickerRow({ value, onChange, disabled = false, onRemove, showRemove = false, onDirty }) {
2729
+ const toHourRef = React11.useRef(null);
2730
+ const { showDuration, durationLabel, isOvernight, incompleteHint } = useTimeFieldState(value);
2731
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col px-4 pt-2 pb-3 gap-1", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
2732
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1", children: [
2733
+ /* @__PURE__ */ jsx(
2734
+ Clock,
2735
+ {
2736
+ className: cn(
2737
+ "w-4 h-4 shrink-0",
2738
+ disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
2739
+ )
2740
+ }
2406
2741
  ),
2407
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
2408
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1", children: [
2409
- /* @__PURE__ */ jsx(
2410
- Clock,
2411
- {
2412
- className: cn(
2413
- "w-4 h-4 shrink-0",
2414
- disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
2415
- )
2416
- }
2417
- ),
2418
- /* @__PURE__ */ jsx("span", { className: "text-[9px] font-medium text-gray-300 dark:text-gray-600 tracking-wide", children: "OPT" })
2419
- ] }),
2420
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 flex-1", children: [
2421
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-5", children: [
2422
- /* @__PURE__ */ jsx(
2423
- TimeField,
2424
- {
2425
- label: "From",
2426
- value: value.from,
2427
- onChange: (from) => onChange({ ...value, from }),
2428
- onMinuteComplete: () => toHourRef.current?.focus(),
2429
- disabled
2430
- }
2431
- ),
2432
- /* @__PURE__ */ jsx(
2433
- "div",
2434
- {
2435
- className: cn(
2436
- "w-4 h-px",
2437
- disabled ? "bg-gray-200 dark:bg-neutral-700" : "bg-gray-300 dark:bg-neutral-600"
2438
- )
2439
- }
2440
- ),
2441
- /* @__PURE__ */ jsx(
2442
- TimeField,
2443
- {
2444
- label: "To",
2445
- value: value.to,
2446
- onChange: (to) => onChange({ ...value, to }),
2447
- hourRef: toHourRef,
2448
- disabled
2449
- }
2742
+ /* @__PURE__ */ jsx("span", { className: "text-[9px] font-medium text-gray-300 dark:text-gray-600 tracking-wide", children: "OPT" })
2743
+ ] }),
2744
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 flex-1", children: [
2745
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2746
+ /* @__PURE__ */ jsx(
2747
+ TimeField,
2748
+ {
2749
+ label: "From",
2750
+ value: value.from,
2751
+ onChange: (from) => onChange({ ...value, from }),
2752
+ onMinuteComplete: () => toHourRef.current?.focus(),
2753
+ onDirty,
2754
+ disabled
2755
+ }
2756
+ ),
2757
+ /* @__PURE__ */ jsx(
2758
+ "div",
2759
+ {
2760
+ className: cn(
2761
+ "w-4 h-px",
2762
+ disabled ? "bg-gray-200 dark:bg-neutral-700" : "bg-gray-300 dark:bg-neutral-600"
2450
2763
  )
2451
- ] }),
2452
- showDuration && /* @__PURE__ */ jsx("span", { className: cn(
2453
- "text-[10px] font-medium pl-0.5",
2454
- isOvernight ? "text-amber-500 dark:text-amber-400" : "text-gray-400 dark:text-gray-500"
2455
- ), children: durationLabel })
2456
- ] })
2457
- ] })
2458
- }
2459
- );
2764
+ }
2765
+ ),
2766
+ /* @__PURE__ */ jsx(
2767
+ TimeField,
2768
+ {
2769
+ label: "To",
2770
+ value: value.to,
2771
+ onChange: (to) => onChange({ ...value, to }),
2772
+ hourRef: toHourRef,
2773
+ onDirty,
2774
+ disabled
2775
+ }
2776
+ ),
2777
+ showRemove && onRemove && /* @__PURE__ */ jsx(
2778
+ Button,
2779
+ {
2780
+ variant: "outline",
2781
+ onClick: onRemove,
2782
+ className: "text-[0.625rem] border border-red-100 dark:border-red-700 rounded-md px-2 py-1 h-8 text-red-500 hover:text-red-600 dark:text-red-400 dark:hover:text-red-300 transition-colors",
2783
+ children: "Remove"
2784
+ }
2785
+ )
2786
+ ] }),
2787
+ showDuration && /* @__PURE__ */ jsx("span", { className: cn(
2788
+ "text-[10px] font-medium pl-0.5",
2789
+ isOvernight ? "text-amber-500 dark:text-amber-400" : "text-gray-400 dark:text-gray-500"
2790
+ ), children: durationLabel }),
2791
+ incompleteHint && /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium pl-0.5 text-amber-500 dark:text-amber-400", children: incompleteHint })
2792
+ ] })
2793
+ ] }) });
2460
2794
  }
2461
2795
  var WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
2462
2796
  function getCalendarDays(month) {
@@ -2584,6 +2918,167 @@ function CalendarMonth({
2584
2918
  )
2585
2919
  ] });
2586
2920
  }
2921
+ function useDateRangePicker({
2922
+ value,
2923
+ onChange,
2924
+ showTimePicker = false,
2925
+ timeValue,
2926
+ onTimeChange
2927
+ }) {
2928
+ const [open, setOpen] = React11.useState(false);
2929
+ const [internalRange, setInternalRange] = React11.useState({
2930
+ from: void 0,
2931
+ to: void 0
2932
+ });
2933
+ const [draft, setDraft] = React11.useState({
2934
+ from: void 0,
2935
+ to: void 0
2936
+ });
2937
+ const [hoverDate, setHoverDate] = React11.useState();
2938
+ const [viewMonth, setViewMonth] = React11.useState(
2939
+ () => startOfMonth(value?.from ?? /* @__PURE__ */ new Date())
2940
+ );
2941
+ const [activePreset, setActivePreset] = React11.useState();
2942
+ const [committedInternalTime, setCommittedInternalTime] = React11.useState(DEFAULT_TIME_RANGE);
2943
+ const [draftTime, setDraftTime] = React11.useState(DEFAULT_TIME_RANGE);
2944
+ const [timeExpanded, setTimeExpanded] = React11.useState(false);
2945
+ const [timeDirty, setTimeDirty] = React11.useState(false);
2946
+ const committedRange = value ?? internalRange;
2947
+ const committedTime = timeValue ?? committedInternalTime;
2948
+ const timeVisible = !!(draft.from && draft.to);
2949
+ const hasAnyTimeInput = timeDirty || draftTime.from.hour !== null || draftTime.from.minute !== null || draftTime.to.hour !== null || draftTime.to.minute !== null;
2950
+ const isTimeComplete2 = draftTime.from.hour !== null && draftTime.from.minute !== null && draftTime.to.hour !== null && draftTime.to.minute !== null;
2951
+ const hasPartialTime = showTimePicker && timeExpanded && !isTimeComplete2;
2952
+ const canClear = !!(draft.from || committedRange.from);
2953
+ const canApply = !(draft.from && !draft.to) && !!(draft.from || committedRange.from) && !hasPartialTime;
2954
+ const resetTime = React11.useCallback(() => {
2955
+ setDraftTime(DEFAULT_TIME_RANGE);
2956
+ setTimeExpanded(false);
2957
+ setTimeDirty(false);
2958
+ }, []);
2959
+ const handleTimeChange = React11.useCallback((newTime) => {
2960
+ setDraftTime(newTime);
2961
+ }, []);
2962
+ const handleOpenChange = React11.useCallback(
2963
+ (newOpen) => {
2964
+ if (newOpen) {
2965
+ setDraft(committedRange);
2966
+ if (committedRange.from)
2967
+ setViewMonth(startOfMonth(committedRange.from));
2968
+ setDraftTime(committedTime);
2969
+ const hasExistingTime = committedTime.from.hour !== null || committedTime.from.minute !== null || committedTime.to.hour !== null || committedTime.to.minute !== null;
2970
+ setTimeExpanded(hasExistingTime);
2971
+ setTimeDirty(false);
2972
+ }
2973
+ setOpen(newOpen);
2974
+ },
2975
+ [committedRange, committedTime]
2976
+ );
2977
+ const handleDayClick = React11.useCallback(
2978
+ (date) => {
2979
+ const { from, to } = draft;
2980
+ if (!from || from && to) {
2981
+ setDraft({ from: date, to: void 0 });
2982
+ setActivePreset(void 0);
2983
+ if (showTimePicker && timeExpanded) {
2984
+ resetTime();
2985
+ }
2986
+ return;
2987
+ }
2988
+ const [start, end] = isBefore(from, date) ? [from, date] : [date, from];
2989
+ setDraft({ from: start, to: end });
2990
+ setHoverDate(void 0);
2991
+ },
2992
+ [draft, showTimePicker, timeExpanded, resetTime]
2993
+ );
2994
+ const handlePreset = React11.useCallback(
2995
+ (preset) => {
2996
+ const newRange = preset.getRange();
2997
+ setDraft(newRange);
2998
+ setActivePreset(preset.label);
2999
+ if (newRange.from) setViewMonth(startOfMonth(newRange.from));
3000
+ if (showTimePicker) resetTime();
3001
+ },
3002
+ [showTimePicker, resetTime]
3003
+ );
3004
+ const handleApply = React11.useCallback(() => {
3005
+ if (draft.from && !draft.to) return;
3006
+ const newRange = draft.from && draft.to ? draft : void 0;
3007
+ const rangeChanged = newRange?.from?.getTime() !== committedRange.from?.getTime() || newRange?.to?.getTime() !== committedRange.to?.getTime();
3008
+ const timeChanged = draftTime.from.hour !== committedTime.from.hour || draftTime.from.minute !== committedTime.from.minute || draftTime.to.hour !== committedTime.to.hour || draftTime.to.minute !== committedTime.to.minute;
3009
+ if (rangeChanged) {
3010
+ if (onChange) onChange(newRange);
3011
+ else setInternalRange(newRange ?? { from: void 0, to: void 0 });
3012
+ }
3013
+ if (timeChanged) {
3014
+ if (onTimeChange) onTimeChange(draftTime);
3015
+ else setCommittedInternalTime(draftTime);
3016
+ }
3017
+ setOpen(false);
3018
+ }, [draft, onChange, committedRange, draftTime, committedTime, onTimeChange]);
3019
+ const handleClear = React11.useCallback(() => {
3020
+ setDraft({ from: void 0, to: void 0 });
3021
+ setActivePreset(void 0);
3022
+ if (showTimePicker) resetTime();
3023
+ }, [showTimePicker, resetTime]);
3024
+ const expandTime = React11.useCallback(() => {
3025
+ setTimeExpanded(true);
3026
+ }, []);
3027
+ const markTimeDirty = React11.useCallback(() => {
3028
+ setTimeDirty(true);
3029
+ }, []);
3030
+ return {
3031
+ open,
3032
+ draft,
3033
+ hoverDate,
3034
+ viewMonth,
3035
+ activePreset,
3036
+ committedRange,
3037
+ committedTime,
3038
+ draftTime,
3039
+ timeExpanded,
3040
+ timeVisible,
3041
+ hasAnyTimeInput,
3042
+ canClear,
3043
+ canApply,
3044
+ showTimePicker,
3045
+ setHoverDate,
3046
+ setViewMonth,
3047
+ handleTimeChange,
3048
+ handleOpenChange,
3049
+ handleDayClick,
3050
+ handlePreset,
3051
+ handleApply,
3052
+ handleClear,
3053
+ resetTime,
3054
+ expandTime,
3055
+ markTimeDirty
3056
+ };
3057
+ }
3058
+ function formatTime(hour, minute) {
3059
+ const period = hour >= 12 ? "PM" : "AM";
3060
+ const h = hour % 12 || 12;
3061
+ const m = minute.toString().padStart(2, "0");
3062
+ return `${h}:${m} ${period}`;
3063
+ }
3064
+ function isTimeComplete(time) {
3065
+ return time.from.hour !== null && time.from.minute !== null && time.to.hour !== null && time.to.minute !== null;
3066
+ }
3067
+ function formatDateRange(range, placeholder, time) {
3068
+ if (!range?.from) return placeholder;
3069
+ const hasTime = time && isTimeComplete(time);
3070
+ if (!range.to || isSameDay(range.from, range.to)) {
3071
+ const dateStr = format(range.from, "MMM d, yyyy");
3072
+ return hasTime ? `${dateStr} ${formatTime(time.from.hour, time.from.minute)} \u2013 ${formatTime(time.to.hour, time.to.minute)}` : dateStr;
3073
+ }
3074
+ const sameYear = range.from.getFullYear() === range.to.getFullYear();
3075
+ const fromDate = format(range.from, sameYear ? "MMM d" : "MMM d, yyyy");
3076
+ const toDate = format(range.to, "MMM d, yyyy");
3077
+ if (hasTime) {
3078
+ return `${fromDate} ${formatTime(time.from.hour, time.from.minute)} \u2013 ${toDate} ${formatTime(time.to.hour, time.to.minute)}`;
3079
+ }
3080
+ return `${fromDate} \u2013 ${toDate}`;
3081
+ }
2587
3082
  var DEFAULT_PRESETS = [
2588
3083
  {
2589
3084
  label: "Today",
@@ -2631,26 +3126,6 @@ var DEFAULT_PRESETS = [
2631
3126
  }
2632
3127
  }
2633
3128
  ];
2634
- function formatTime(tv) {
2635
- if (tv.hour === null || tv.minute === null) return "--:--";
2636
- const period = tv.hour >= 12 ? "PM" : "AM";
2637
- const h = tv.hour % 12 || 12;
2638
- const m = tv.minute.toString().padStart(2, "0");
2639
- return `${h}:${m} ${period}`;
2640
- }
2641
- function formatDateRange(range, placeholder, time) {
2642
- if (!range?.from) return placeholder;
2643
- const timeActive = time && time.from.hour !== null && time.to.hour !== null;
2644
- const timeSuffix = timeActive ? ` ${formatTime(time.from)} \u2013 ${formatTime(time.to)}` : "";
2645
- if (!range.to || isSameDay(range.from, range.to)) {
2646
- return format(range.from, "MMM d, yyyy") + timeSuffix;
2647
- }
2648
- const sameYear = range.from.getFullYear() === range.to.getFullYear();
2649
- if (sameYear) {
2650
- return `${format(range.from, "MMM d")} \u2013 ${format(range.to, "MMM d, yyyy")}${timeSuffix}`;
2651
- }
2652
- return `${format(range.from, "MMM d, yyyy")} \u2013 ${format(range.to, "MMM d, yyyy")}${timeSuffix}`;
2653
- }
2654
3129
  function DateRangePicker({
2655
3130
  value,
2656
3131
  onChange,
@@ -2664,69 +3139,15 @@ function DateRangePicker({
2664
3139
  timeValue,
2665
3140
  onTimeChange
2666
3141
  }) {
2667
- const [open, setOpen] = React10.useState(false);
2668
- const [internalRange, setInternalRange] = React10.useState({
2669
- from: void 0,
2670
- to: void 0
2671
- });
2672
- const [draft, setDraft] = React10.useState({
2673
- from: void 0,
2674
- to: void 0
3142
+ const picker = useDateRangePicker({
3143
+ value,
3144
+ onChange,
3145
+ showTimePicker,
3146
+ timeValue,
3147
+ onTimeChange
2675
3148
  });
2676
- const [hoverDate, setHoverDate] = React10.useState();
2677
- const [leftMonth, setLeftMonth] = React10.useState(
2678
- () => startOfMonth(value?.from ?? /* @__PURE__ */ new Date())
2679
- );
2680
- const [activePreset, setActivePreset] = React10.useState();
2681
- const [internalTime, setInternalTime] = React10.useState(DEFAULT_TIME_RANGE);
2682
- const committedRange = value ?? internalRange;
2683
- const currentTime = timeValue ?? internalTime;
2684
- const handleTimeChange = (newTime) => {
2685
- if (onTimeChange) onTimeChange(newTime);
2686
- else setInternalTime(newTime);
2687
- };
2688
- const timeVisible = !!(draft.from && draft.to);
2689
- const handleOpenChange = (newOpen) => {
2690
- if (newOpen) {
2691
- setDraft(committedRange);
2692
- if (committedRange.from) setLeftMonth(startOfMonth(committedRange.from));
2693
- if (!onTimeChange) setInternalTime(currentTime);
2694
- }
2695
- setOpen(newOpen);
2696
- };
2697
- const handleDayClick = (date) => {
2698
- const { from, to } = draft;
2699
- if (!from || from && to) {
2700
- setDraft({ from: date, to: void 0 });
2701
- setActivePreset(void 0);
2702
- return;
2703
- }
2704
- const [start, end] = isBefore(from, date) ? [from, date] : [date, from];
2705
- setDraft({ from: start, to: end });
2706
- setHoverDate(void 0);
2707
- };
2708
- const handlePreset = (preset) => {
2709
- const newRange = preset.getRange();
2710
- setDraft(newRange);
2711
- setActivePreset(preset.label);
2712
- if (newRange.from) setLeftMonth(startOfMonth(newRange.from));
2713
- };
2714
- const handleApply = () => {
2715
- if (draft.from && !draft.to) return;
2716
- const newRange = draft.from && draft.to ? draft : void 0;
2717
- if (onChange) onChange(newRange);
2718
- else setInternalRange(newRange ?? { from: void 0, to: void 0 });
2719
- setOpen(false);
2720
- };
2721
- const handleClear = () => {
2722
- setDraft({ from: void 0, to: void 0 });
2723
- setActivePreset(void 0);
2724
- if (showTimePicker) handleTimeChange(DEFAULT_TIME_RANGE);
2725
- };
2726
- const canClear = !!(draft.from || committedRange.from);
2727
- const canApply = !(draft.from && !draft.to) && !!(draft.from || committedRange.from);
2728
- const rightMonth = addMonths(leftMonth, 1);
2729
- return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
3149
+ const rightMonth = addMonths(picker.viewMonth, 1);
3150
+ return /* @__PURE__ */ jsxs(Popover, { open: picker.open, onOpenChange: picker.handleOpenChange, children: [
2730
3151
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
2731
3152
  "button",
2732
3153
  {
@@ -2736,30 +3157,30 @@ function DateRangePicker({
2736
3157
  "hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
2737
3158
  "dark:border-neutral-600 dark:bg-neutral-800 dark:hover:bg-neutral-700",
2738
3159
  "disabled:pointer-events-none disabled:opacity-50",
2739
- committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500",
3160
+ picker.committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500",
2740
3161
  className
2741
3162
  ),
2742
3163
  children: [
2743
3164
  /* @__PURE__ */ jsx(CalendarIcon, { className: "w-4 h-4 shrink-0 text-gray-400 dark:text-gray-500" }),
2744
3165
  /* @__PURE__ */ jsx("span", { children: formatDateRange(
2745
- committedRange,
3166
+ picker.committedRange,
2746
3167
  placeholder,
2747
- showTimePicker ? currentTime : void 0
3168
+ showTimePicker ? picker.committedTime : void 0
2748
3169
  ) })
2749
3170
  ]
2750
3171
  }
2751
3172
  ) }),
2752
3173
  /* @__PURE__ */ jsx(PopoverContent, { align, className: "w-auto p-0 overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex divide-x divide-gray-100 dark:divide-neutral-700", children: [
2753
- /* @__PURE__ */ jsx("div", { className: "flex flex-col p-3 gap-0.5 min-w-[130px]", children: (presetSections ?? [{ title: "Presets", options: presets }]).map((section, si) => /* @__PURE__ */ jsxs(React10.Fragment, { children: [
3174
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col p-3 gap-0.5 min-w-[130px]", children: (presetSections ?? [{ title: "Presets", options: presets }]).map((section, si) => /* @__PURE__ */ jsxs(React11.Fragment, { children: [
2754
3175
  si > 0 && /* @__PURE__ */ jsx("div", { className: "my-2 border-t border-gray-100 dark:border-neutral-700" }),
2755
3176
  /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1 px-2", children: section.title }),
2756
3177
  section.options.map((preset) => /* @__PURE__ */ jsx(
2757
3178
  "button",
2758
3179
  {
2759
- onClick: () => handlePreset(preset),
3180
+ onClick: () => picker.handlePreset(preset),
2760
3181
  className: cn(
2761
3182
  "w-full text-left px-2 py-1.5 rounded-md text-sm transition-colors",
2762
- activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
3183
+ picker.activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
2763
3184
  ),
2764
3185
  children: preset.label
2765
3186
  },
@@ -2771,12 +3192,12 @@ function DateRangePicker({
2771
3192
  /* @__PURE__ */ jsx(
2772
3193
  CalendarMonth,
2773
3194
  {
2774
- month: leftMonth,
2775
- range: draft,
2776
- hoverDate,
2777
- onDayClick: handleDayClick,
2778
- onDayHover: setHoverDate,
2779
- onPrevMonth: () => setLeftMonth(subMonths(leftMonth, 1)),
3195
+ month: picker.viewMonth,
3196
+ range: picker.draft,
3197
+ hoverDate: picker.hoverDate,
3198
+ onDayClick: picker.handleDayClick,
3199
+ onDayHover: picker.setHoverDate,
3200
+ onPrevMonth: () => picker.setViewMonth(subMonths(picker.viewMonth, 1)),
2780
3201
  showPrevNav: true,
2781
3202
  showNextNav: false
2782
3203
  }
@@ -2786,46 +3207,72 @@ function DateRangePicker({
2786
3207
  CalendarMonth,
2787
3208
  {
2788
3209
  month: rightMonth,
2789
- range: draft,
2790
- hoverDate,
2791
- onDayClick: handleDayClick,
2792
- onDayHover: setHoverDate,
2793
- onNextMonth: () => setLeftMonth(addMonths(leftMonth, 1)),
3210
+ range: picker.draft,
3211
+ hoverDate: picker.hoverDate,
3212
+ onDayClick: picker.handleDayClick,
3213
+ onDayHover: picker.setHoverDate,
3214
+ onNextMonth: () => picker.setViewMonth(addMonths(picker.viewMonth, 1)),
2794
3215
  showPrevNav: false,
2795
3216
  showNextNav: true
2796
3217
  }
2797
3218
  )
2798
3219
  ] }),
2799
- showTimePicker && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: timeVisible && /* @__PURE__ */ jsx(
3220
+ showTimePicker && /* @__PURE__ */ jsx(
2800
3221
  motion.div,
2801
3222
  {
2802
- initial: { height: 0, opacity: 0 },
2803
- animate: { height: "auto", opacity: 1 },
2804
- exit: { height: 0, opacity: 0 },
2805
- transition: {
2806
- height: { type: "spring", stiffness: 400, damping: 30, mass: 0.8 },
2807
- opacity: { duration: 0.2 }
2808
- },
2809
- className: "overflow-hidden",
2810
- children: /* @__PURE__ */ jsx(
2811
- TimePickerRow,
3223
+ layout: true,
3224
+ transition: { layout: { duration: 0.2, ease: "easeInOut" } },
3225
+ className: "border-t border-gray-100 dark:border-neutral-700",
3226
+ children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: picker.timeVisible && !picker.timeExpanded ? /* @__PURE__ */ jsx(
3227
+ motion.div,
2812
3228
  {
2813
- value: currentTime,
2814
- onChange: handleTimeChange
2815
- }
2816
- )
2817
- },
2818
- "time-picker"
2819
- ) }),
3229
+ initial: { opacity: 0 },
3230
+ animate: { opacity: 1 },
3231
+ exit: { opacity: 0 },
3232
+ transition: { duration: 0.12 },
3233
+ children: /* @__PURE__ */ jsx("div", { className: "px-4 py-2 ", children: /* @__PURE__ */ jsx(
3234
+ Button,
3235
+ {
3236
+ variant: "outline",
3237
+ onClick: picker.expandTime,
3238
+ leadingDecorator: /* @__PURE__ */ jsx(Clock, { className: "w-3.5 h-3.5" }),
3239
+ className: "w-full rounded-md h-9",
3240
+ children: "Add time range"
3241
+ }
3242
+ ) })
3243
+ },
3244
+ "add-time-btn"
3245
+ ) : picker.timeVisible && picker.timeExpanded ? /* @__PURE__ */ jsx(
3246
+ motion.div,
3247
+ {
3248
+ initial: { opacity: 0 },
3249
+ animate: { opacity: 1 },
3250
+ exit: { opacity: 0 },
3251
+ transition: { duration: 0.12 },
3252
+ children: /* @__PURE__ */ jsx(
3253
+ TimePickerRow,
3254
+ {
3255
+ value: picker.draftTime,
3256
+ onChange: picker.handleTimeChange,
3257
+ onRemove: picker.resetTime,
3258
+ showRemove: picker.timeExpanded,
3259
+ onDirty: picker.markTimeDirty
3260
+ }
3261
+ )
3262
+ },
3263
+ "time-picker"
3264
+ ) : null })
3265
+ }
3266
+ ),
2820
3267
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-100 dark:border-neutral-700", children: [
2821
3268
  /* @__PURE__ */ jsx(
2822
3269
  "button",
2823
3270
  {
2824
- onClick: handleClear,
2825
- disabled: !canClear,
3271
+ onClick: picker.handleClear,
3272
+ disabled: !picker.canClear,
2826
3273
  className: cn(
2827
3274
  "px-3 py-1.5 rounded-md text-sm transition-colors",
2828
- canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
3275
+ picker.canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
2829
3276
  ),
2830
3277
  children: "Clear"
2831
3278
  }
@@ -2833,11 +3280,11 @@ function DateRangePicker({
2833
3280
  /* @__PURE__ */ jsx(
2834
3281
  "button",
2835
3282
  {
2836
- onClick: handleApply,
2837
- disabled: !canApply,
3283
+ onClick: picker.handleApply,
3284
+ disabled: !picker.canApply,
2838
3285
  className: cn(
2839
3286
  "px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
2840
- canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
3287
+ picker.canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
2841
3288
  ),
2842
3289
  children: "Apply"
2843
3290
  }
@@ -2847,30 +3294,6 @@ function DateRangePicker({
2847
3294
  ] }) })
2848
3295
  ] });
2849
3296
  }
2850
- function formatTime2(tv) {
2851
- if (tv.hour === null || tv.minute === null) return "";
2852
- const period = tv.hour >= 12 ? "PM" : "AM";
2853
- const h = tv.hour % 12 || 12;
2854
- const m = tv.minute.toString().padStart(2, "0");
2855
- return `${h}:${m} ${period}`;
2856
- }
2857
- function formatDateWithTime(date, dateFmt, time) {
2858
- const dateStr = format(date, dateFmt);
2859
- const timeStr = time ? formatTime2(time) : "";
2860
- return timeStr ? `${dateStr}, ${timeStr}` : dateStr;
2861
- }
2862
- function formatDateRange2(range, placeholder, time) {
2863
- if (!range?.from) return placeholder;
2864
- const hasTime = time && time.from.hour !== null && time.to.hour !== null;
2865
- if (!range.to || isSameDay(range.from, range.to)) {
2866
- return formatDateWithTime(range.from, "MMMM d, yyyy", hasTime ? time.from : void 0);
2867
- }
2868
- const sameYear = range.from.getFullYear() === range.to.getFullYear();
2869
- const fromFmt = sameYear ? "MMMM d" : "MMMM d, yyyy";
2870
- const fromStr = formatDateWithTime(range.from, fromFmt, hasTime ? time.from : void 0);
2871
- const toStr = formatDateWithTime(range.to, "MMMM d, yyyy", hasTime ? time.to : void 0);
2872
- return `${fromStr} \u2013 ${toStr}`;
2873
- }
2874
3297
  function DateRangePickerMobile({
2875
3298
  label,
2876
3299
  value,
@@ -2884,70 +3307,16 @@ function DateRangePickerMobile({
2884
3307
  timeValue,
2885
3308
  onTimeChange
2886
3309
  }) {
2887
- const [open, setOpen] = React10.useState(false);
2888
- const [internalRange, setInternalRange] = React10.useState({
2889
- from: void 0,
2890
- to: void 0
2891
- });
2892
- const [draft, setDraft] = React10.useState({
2893
- from: void 0,
2894
- to: void 0
3310
+ const picker = useDateRangePicker({
3311
+ value,
3312
+ onChange,
3313
+ showTimePicker,
3314
+ timeValue,
3315
+ onTimeChange
2895
3316
  });
2896
- const [hoverDate, setHoverDate] = React10.useState();
2897
- const [viewMonth, setViewMonth] = React10.useState(
2898
- () => startOfMonth(value?.from ?? /* @__PURE__ */ new Date())
2899
- );
2900
- const [activePreset, setActivePreset] = React10.useState();
2901
- const [internalTime, setInternalTime] = React10.useState(DEFAULT_TIME_RANGE);
2902
- const committedRange = value ?? internalRange;
2903
- const currentTime = timeValue ?? internalTime;
2904
- const handleTimeChange = (newTime) => {
2905
- if (onTimeChange) onTimeChange(newTime);
2906
- else setInternalTime(newTime);
2907
- };
2908
- const timeVisible = !!(draft.from && draft.to);
2909
- const handleOpenChange = (newOpen) => {
2910
- if (newOpen) {
2911
- setDraft(committedRange);
2912
- if (committedRange.from) setViewMonth(startOfMonth(committedRange.from));
2913
- if (!onTimeChange) setInternalTime(currentTime);
2914
- }
2915
- setOpen(newOpen);
2916
- };
2917
- const handleDayClick = (date) => {
2918
- const { from, to } = draft;
2919
- if (!from || from && to) {
2920
- setDraft({ from: date, to: void 0 });
2921
- setActivePreset(void 0);
2922
- return;
2923
- }
2924
- const [start, end] = isBefore(from, date) ? [from, date] : [date, from];
2925
- setDraft({ from: start, to: end });
2926
- setHoverDate(void 0);
2927
- };
2928
- const handlePreset = (preset) => {
2929
- const newRange = preset.getRange();
2930
- setDraft(newRange);
2931
- setActivePreset(preset.label);
2932
- if (newRange.from) setViewMonth(startOfMonth(newRange.from));
2933
- };
2934
- const handleApply = () => {
2935
- if (draft.from && !draft.to) return;
2936
- const newRange = draft.from && draft.to ? draft : void 0;
2937
- if (onChange) onChange(newRange);
2938
- else setInternalRange(newRange ?? { from: void 0, to: void 0 });
2939
- setOpen(false);
2940
- };
2941
- const handleClear = () => {
2942
- setDraft({ from: void 0, to: void 0 });
2943
- setActivePreset(void 0);
2944
- if (showTimePicker) handleTimeChange(DEFAULT_TIME_RANGE);
2945
- };
2946
- const canClear = !!(draft.from || committedRange.from);
2947
- const canApply = !(draft.from && !draft.to) && !!(draft.from || committedRange.from);
2948
3317
  return /* @__PURE__ */ jsxs("div", { className: cn("space-y-1.5", className), children: [
2949
3318
  label && /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: label }),
2950
- /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
3319
+ /* @__PURE__ */ jsxs(Popover, { open: picker.open, onOpenChange: picker.handleOpenChange, children: [
2951
3320
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
2952
3321
  "button",
2953
3322
  {
@@ -2957,30 +3326,30 @@ function DateRangePickerMobile({
2957
3326
  "hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
2958
3327
  "dark:border-neutral-600 dark:bg-neutral-800 dark:hover:bg-neutral-700",
2959
3328
  "disabled:pointer-events-none disabled:opacity-50",
2960
- committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500"
3329
+ picker.committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500"
2961
3330
  ),
2962
3331
  children: [
2963
3332
  /* @__PURE__ */ jsx(CalendarIcon, { className: "w-4 h-4 shrink-0 text-gray-400 dark:text-gray-500" }),
2964
- /* @__PURE__ */ jsx("span", { className: "truncate", children: formatDateRange2(
2965
- committedRange,
3333
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: formatDateRange(
3334
+ picker.committedRange,
2966
3335
  placeholder,
2967
- showTimePicker ? currentTime : void 0
3336
+ showTimePicker ? picker.committedTime : void 0
2968
3337
  ) })
2969
3338
  ]
2970
3339
  }
2971
3340
  ) }),
2972
3341
  /* @__PURE__ */ jsx(PopoverContent, { align: "center", className: "w-auto p-0 overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex divide-x divide-gray-100 dark:divide-neutral-700", children: [
2973
3342
  /* @__PURE__ */ jsx("div", { className: "flex flex-col p-2 gap-0.5 min-w-[110px] max-h-[360px] overflow-y-auto", children: (presetSections ?? [{ title: "Presets", options: presets }]).map(
2974
- (section, si) => /* @__PURE__ */ jsxs(React10.Fragment, { children: [
3343
+ (section, si) => /* @__PURE__ */ jsxs(React11.Fragment, { children: [
2975
3344
  si > 0 && /* @__PURE__ */ jsx("div", { className: "my-2 border-t border-gray-100 dark:border-neutral-700" }),
2976
3345
  /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1 px-2", children: section.title }),
2977
3346
  section.options.map((preset) => /* @__PURE__ */ jsx(
2978
3347
  "button",
2979
3348
  {
2980
- onClick: () => handlePreset(preset),
3349
+ onClick: () => picker.handlePreset(preset),
2981
3350
  className: cn(
2982
3351
  "w-full text-left px-2 py-1.5 rounded-md text-sm transition-colors",
2983
- activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
3352
+ picker.activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
2984
3353
  ),
2985
3354
  children: preset.label
2986
3355
  },
@@ -2992,52 +3361,73 @@ function DateRangePickerMobile({
2992
3361
  /* @__PURE__ */ jsx("div", { className: "p-2", children: /* @__PURE__ */ jsx(
2993
3362
  CalendarMonth,
2994
3363
  {
2995
- month: viewMonth,
2996
- range: draft,
2997
- hoverDate,
2998
- onDayClick: handleDayClick,
2999
- onDayHover: setHoverDate,
3000
- onPrevMonth: () => setViewMonth(subMonths(viewMonth, 1)),
3001
- onNextMonth: () => setViewMonth(addMonths(viewMonth, 1)),
3364
+ month: picker.viewMonth,
3365
+ range: picker.draft,
3366
+ hoverDate: picker.hoverDate,
3367
+ onDayClick: picker.handleDayClick,
3368
+ onDayHover: picker.setHoverDate,
3369
+ onPrevMonth: () => picker.setViewMonth(subMonths(picker.viewMonth, 1)),
3370
+ onNextMonth: () => picker.setViewMonth(addMonths(picker.viewMonth, 1)),
3002
3371
  showPrevNav: true,
3003
3372
  showNextNav: true
3004
3373
  }
3005
3374
  ) }),
3006
- showTimePicker && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: timeVisible && /* @__PURE__ */ jsx(
3375
+ showTimePicker && /* @__PURE__ */ jsx(
3007
3376
  motion.div,
3008
3377
  {
3009
- initial: { height: 0, opacity: 0 },
3010
- animate: { height: "auto", opacity: 1 },
3011
- exit: { height: 0, opacity: 0 },
3012
- transition: {
3013
- height: {
3014
- type: "spring",
3015
- stiffness: 400,
3016
- damping: 30,
3017
- mass: 0.8
3378
+ layout: true,
3379
+ transition: { layout: { duration: 0.2, ease: "easeInOut" } },
3380
+ className: "border-t border-gray-100 dark:border-neutral-700",
3381
+ children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: picker.timeVisible && !picker.timeExpanded ? /* @__PURE__ */ jsx(
3382
+ motion.div,
3383
+ {
3384
+ initial: { opacity: 0 },
3385
+ animate: { opacity: 1 },
3386
+ exit: { opacity: 0 },
3387
+ transition: { duration: 0.12 },
3388
+ children: /* @__PURE__ */ jsx("div", { className: "px-2 py-2", children: /* @__PURE__ */ jsx(
3389
+ Button,
3390
+ {
3391
+ variant: "outline",
3392
+ onClick: picker.expandTime,
3393
+ leadingDecorator: /* @__PURE__ */ jsx(Clock, { className: "w-3.5 h-3.5" }),
3394
+ className: "w-full rounded-md h-9",
3395
+ children: "Add time range"
3396
+ }
3397
+ ) })
3018
3398
  },
3019
- opacity: { duration: 0.2 }
3020
- },
3021
- className: "overflow-hidden",
3022
- children: /* @__PURE__ */ jsx(
3023
- TimePickerColumn,
3399
+ "add-time-btn"
3400
+ ) : picker.timeVisible && picker.timeExpanded ? /* @__PURE__ */ jsx(
3401
+ motion.div,
3024
3402
  {
3025
- value: currentTime,
3026
- onChange: handleTimeChange
3027
- }
3028
- )
3029
- },
3030
- "time-picker"
3031
- ) }),
3403
+ initial: { opacity: 0 },
3404
+ animate: { opacity: 1 },
3405
+ exit: { opacity: 0 },
3406
+ transition: { duration: 0.12 },
3407
+ children: /* @__PURE__ */ jsx(
3408
+ TimePickerColumn,
3409
+ {
3410
+ value: picker.draftTime,
3411
+ onChange: picker.handleTimeChange,
3412
+ onRemove: picker.resetTime,
3413
+ showRemove: picker.timeExpanded,
3414
+ onDirty: picker.markTimeDirty
3415
+ }
3416
+ )
3417
+ },
3418
+ "time-picker"
3419
+ ) : null })
3420
+ }
3421
+ ),
3032
3422
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2 px-2 py-3 border-t border-gray-100 dark:border-neutral-700", children: [
3033
3423
  /* @__PURE__ */ jsx(
3034
3424
  "button",
3035
3425
  {
3036
- onClick: handleClear,
3037
- disabled: !canClear,
3426
+ onClick: picker.handleClear,
3427
+ disabled: !picker.canClear,
3038
3428
  className: cn(
3039
3429
  "px-3 py-1.5 rounded-md text-sm transition-colors",
3040
- canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
3430
+ picker.canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
3041
3431
  ),
3042
3432
  children: "Clear"
3043
3433
  }
@@ -3045,11 +3435,11 @@ function DateRangePickerMobile({
3045
3435
  /* @__PURE__ */ jsx(
3046
3436
  "button",
3047
3437
  {
3048
- onClick: handleApply,
3049
- disabled: !canApply,
3438
+ onClick: picker.handleApply,
3439
+ disabled: !picker.canApply,
3050
3440
  className: cn(
3051
3441
  "px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
3052
- canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
3442
+ picker.canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
3053
3443
  ),
3054
3444
  children: "Apply"
3055
3445
  }
@@ -3308,6 +3698,6 @@ function PeriodComparisonSelector({
3308
3698
  ] });
3309
3699
  }
3310
3700
 
3311
- export { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColumnSelection, DEFAULT_COMPARISON_PERIODS, DEFAULT_PRESETS, DEFAULT_TIME_RANGE, DateRangePicker, DateRangePickerMobile, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormLabel, FormMessage, MobileDataCard, PeriodComparisonSelector, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonButton, SkeletonCard, SkeletonIcon, SkeletonInput, SkeletonSubtitle, SkeletonTableRow, SkeletonTableRows, SkeletonText, SkeletonTitle, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableRowCheckbox, TableSelectAll, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toggle, buttonVariants, segmentedControlItemVariants, segmentedControlVariants, separatorVariants, switchLabelVariants, switchThumbVariants, switchTrackVariants, toggleGroupVariants, toggleItemVariants, useColumnVisibility, useFormContext, useFormFieldContext, useTableSelection };
3312
- //# sourceMappingURL=chunk-RA7KTV62.mjs.map
3313
- //# sourceMappingURL=chunk-RA7KTV62.mjs.map
3701
+ export { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColumnSelection, DEFAULT_COMPARISON_PERIODS, DEFAULT_PRESETS, DEFAULT_TIME_RANGE, DateRangePicker, DateRangePickerMobile, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormLabel, FormMessage, MobileDataCard, PeriodComparisonSelector, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SegmentedControl, Select, SelectBar, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Skeleton, SkeletonAvatar, SkeletonBadge, SkeletonButton, SkeletonCard, SkeletonIcon, SkeletonInput, SkeletonSubtitle, SkeletonTableRow, SkeletonTableRows, SkeletonText, SkeletonTitle, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableRowCheckbox, TableSelectAll, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toggle, buttonVariants, segmentedControlItemVariants, segmentedControlVariants, separatorVariants, switchLabelVariants, switchThumbVariants, switchTrackVariants, toggleGroupVariants, toggleItemVariants, useColumnVisibility, useFormContext, useFormFieldContext, useTableSelection };
3702
+ //# sourceMappingURL=chunk-3CXBEGTO.mjs.map
3703
+ //# sourceMappingURL=chunk-3CXBEGTO.mjs.map