@optilogic/core 1.0.0-beta.3 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +346 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +103 -7
- package/dist/index.d.ts +103 -7
- package/dist/index.js +291 -170
- package/dist/index.js.map +1 -1
- package/package.json +20 -20
- package/src/components/board.tsx +251 -0
- package/src/components/context-menu.tsx +1 -1
- package/src/components/data-grid/hooks/useKeyboardNavigation.ts +1 -1
- package/src/index.ts +13 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
import * as
|
|
3
|
+
import * as React34 from 'react';
|
|
4
4
|
import { useMemo, useState, useRef, useEffect, useCallback } from 'react';
|
|
5
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
@@ -53,7 +53,7 @@ var buttonVariants = cva(
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
|
-
var Button =
|
|
56
|
+
var Button = React34.forwardRef(
|
|
57
57
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
58
58
|
const Comp = asChild ? Slot : "button";
|
|
59
59
|
return /* @__PURE__ */ jsx(
|
|
@@ -67,7 +67,7 @@ var Button = React33.forwardRef(
|
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
Button.displayName = "Button";
|
|
70
|
-
var Input =
|
|
70
|
+
var Input = React34.forwardRef(
|
|
71
71
|
({ className, type, ...props }, ref) => {
|
|
72
72
|
return /* @__PURE__ */ jsx(
|
|
73
73
|
"input",
|
|
@@ -87,7 +87,7 @@ Input.displayName = "Input";
|
|
|
87
87
|
var labelVariants = cva(
|
|
88
88
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
89
89
|
);
|
|
90
|
-
var Label =
|
|
90
|
+
var Label = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
91
91
|
LabelPrimitive.Root,
|
|
92
92
|
{
|
|
93
93
|
ref,
|
|
@@ -96,7 +96,7 @@ var Label = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
96
96
|
}
|
|
97
97
|
));
|
|
98
98
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
99
|
-
var Textarea =
|
|
99
|
+
var Textarea = React34.forwardRef(
|
|
100
100
|
({ className, ...props }, ref) => {
|
|
101
101
|
return /* @__PURE__ */ jsx(
|
|
102
102
|
"textarea",
|
|
@@ -135,7 +135,7 @@ var badgeVariants = cva(
|
|
|
135
135
|
function Badge({ className, variant, ...props }) {
|
|
136
136
|
return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
137
137
|
}
|
|
138
|
-
var Checkbox =
|
|
138
|
+
var Checkbox = React34.forwardRef(({ className, showBorder = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
139
139
|
CheckboxPrimitive.Root,
|
|
140
140
|
{
|
|
141
141
|
ref,
|
|
@@ -179,7 +179,7 @@ var Checkbox = React33.forwardRef(({ className, showBorder = true, ...props }, r
|
|
|
179
179
|
}
|
|
180
180
|
));
|
|
181
181
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
182
|
-
var Switch =
|
|
182
|
+
var Switch = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
183
183
|
SwitchPrimitive.Root,
|
|
184
184
|
{
|
|
185
185
|
className: cn(
|
|
@@ -215,7 +215,7 @@ var Switch = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
215
215
|
}
|
|
216
216
|
));
|
|
217
217
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
218
|
-
var Progress =
|
|
218
|
+
var Progress = React34.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
219
219
|
ProgressPrimitive.Root,
|
|
220
220
|
{
|
|
221
221
|
ref,
|
|
@@ -234,7 +234,7 @@ var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @_
|
|
|
234
234
|
}
|
|
235
235
|
));
|
|
236
236
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
237
|
-
var Separator =
|
|
237
|
+
var Separator = React34.forwardRef(
|
|
238
238
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
239
239
|
SeparatorPrimitive.Root,
|
|
240
240
|
{
|
|
@@ -263,7 +263,7 @@ function Skeleton({ className, ...props }) {
|
|
|
263
263
|
var Select = SelectPrimitive.Root;
|
|
264
264
|
var SelectGroup = SelectPrimitive.Group;
|
|
265
265
|
var SelectValue = SelectPrimitive.Value;
|
|
266
|
-
var SelectTrigger =
|
|
266
|
+
var SelectTrigger = React34.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
267
267
|
SelectPrimitive.Trigger,
|
|
268
268
|
{
|
|
269
269
|
ref,
|
|
@@ -279,7 +279,7 @@ var SelectTrigger = React33.forwardRef(({ className, children, ...props }, ref)
|
|
|
279
279
|
}
|
|
280
280
|
));
|
|
281
281
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
282
|
-
var SelectScrollUpButton =
|
|
282
|
+
var SelectScrollUpButton = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
283
283
|
SelectPrimitive.ScrollUpButton,
|
|
284
284
|
{
|
|
285
285
|
ref,
|
|
@@ -292,7 +292,7 @@ var SelectScrollUpButton = React33.forwardRef(({ className, ...props }, ref) =>
|
|
|
292
292
|
}
|
|
293
293
|
));
|
|
294
294
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
295
|
-
var SelectScrollDownButton =
|
|
295
|
+
var SelectScrollDownButton = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
296
296
|
SelectPrimitive.ScrollDownButton,
|
|
297
297
|
{
|
|
298
298
|
ref,
|
|
@@ -305,7 +305,7 @@ var SelectScrollDownButton = React33.forwardRef(({ className, ...props }, ref) =
|
|
|
305
305
|
}
|
|
306
306
|
));
|
|
307
307
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
308
|
-
var SelectContent =
|
|
308
|
+
var SelectContent = React34.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
309
309
|
SelectPrimitive.Content,
|
|
310
310
|
{
|
|
311
311
|
ref,
|
|
@@ -333,7 +333,7 @@ var SelectContent = React33.forwardRef(({ className, children, position = "poppe
|
|
|
333
333
|
}
|
|
334
334
|
) }));
|
|
335
335
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
336
|
-
var SelectLabel =
|
|
336
|
+
var SelectLabel = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
337
337
|
SelectPrimitive.Label,
|
|
338
338
|
{
|
|
339
339
|
ref,
|
|
@@ -342,7 +342,7 @@ var SelectLabel = React33.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
342
342
|
}
|
|
343
343
|
));
|
|
344
344
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
345
|
-
var SelectItem =
|
|
345
|
+
var SelectItem = React34.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
346
346
|
SelectPrimitive.Item,
|
|
347
347
|
{
|
|
348
348
|
ref,
|
|
@@ -358,7 +358,7 @@ var SelectItem = React33.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
358
358
|
}
|
|
359
359
|
));
|
|
360
360
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
361
|
-
var SelectSeparator =
|
|
361
|
+
var SelectSeparator = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
362
362
|
SelectPrimitive.Separator,
|
|
363
363
|
{
|
|
364
364
|
ref,
|
|
@@ -368,7 +368,7 @@ var SelectSeparator = React33.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
368
368
|
));
|
|
369
369
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
370
370
|
var Tabs = TabsPrimitive.Root;
|
|
371
|
-
var TabsList =
|
|
371
|
+
var TabsList = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
372
372
|
TabsPrimitive.List,
|
|
373
373
|
{
|
|
374
374
|
ref,
|
|
@@ -382,7 +382,7 @@ var TabsList = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
382
382
|
}
|
|
383
383
|
));
|
|
384
384
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
385
|
-
var TabsTrigger =
|
|
385
|
+
var TabsTrigger = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
386
386
|
TabsPrimitive.Trigger,
|
|
387
387
|
{
|
|
388
388
|
ref,
|
|
@@ -409,7 +409,7 @@ var TabsTrigger = React33.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
409
409
|
}
|
|
410
410
|
));
|
|
411
411
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
412
|
-
var TabsContent =
|
|
412
|
+
var TabsContent = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
413
413
|
TabsPrimitive.Content,
|
|
414
414
|
{
|
|
415
415
|
ref,
|
|
@@ -492,7 +492,7 @@ var accordionContentInnerVariants = cva("pb-4 pt-0", {
|
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
494
|
var Accordion = AccordionPrimitive.Root;
|
|
495
|
-
var AccordionItem =
|
|
495
|
+
var AccordionItem = React34.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
496
496
|
AccordionPrimitive.Item,
|
|
497
497
|
{
|
|
498
498
|
ref,
|
|
@@ -502,7 +502,7 @@ var AccordionItem = React33.forwardRef(({ className, variant, ...props }, ref) =
|
|
|
502
502
|
}
|
|
503
503
|
));
|
|
504
504
|
AccordionItem.displayName = "AccordionItem";
|
|
505
|
-
var AccordionTrigger =
|
|
505
|
+
var AccordionTrigger = React34.forwardRef(({ className, children, variant, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
506
506
|
AccordionPrimitive.Trigger,
|
|
507
507
|
{
|
|
508
508
|
ref,
|
|
@@ -515,7 +515,7 @@ var AccordionTrigger = React33.forwardRef(({ className, children, variant, ...pr
|
|
|
515
515
|
}
|
|
516
516
|
) }));
|
|
517
517
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
518
|
-
var AccordionContent =
|
|
518
|
+
var AccordionContent = React34.forwardRef(({ className, children, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
519
519
|
AccordionPrimitive.Content,
|
|
520
520
|
{
|
|
521
521
|
ref,
|
|
@@ -529,7 +529,7 @@ var TooltipProvider = TooltipPrimitive.Provider;
|
|
|
529
529
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
530
530
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
531
531
|
var TooltipPortal = TooltipPrimitive.Portal;
|
|
532
|
-
var TooltipContent =
|
|
532
|
+
var TooltipContent = React34.forwardRef(({ className, sideOffset = 6, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
533
533
|
TooltipPrimitive.Content,
|
|
534
534
|
{
|
|
535
535
|
ref,
|
|
@@ -558,7 +558,7 @@ var TooltipContent = React33.forwardRef(({ className, sideOffset = 6, ...props }
|
|
|
558
558
|
}
|
|
559
559
|
) }));
|
|
560
560
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
561
|
-
var TooltipArrow =
|
|
561
|
+
var TooltipArrow = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
562
562
|
TooltipPrimitive.Arrow,
|
|
563
563
|
{
|
|
564
564
|
ref,
|
|
@@ -597,7 +597,7 @@ function Tooltip({
|
|
|
597
597
|
var Popover = PopoverPrimitive.Root;
|
|
598
598
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
599
599
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
600
|
-
var PopoverContent =
|
|
600
|
+
var PopoverContent = React34.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
601
601
|
PopoverPrimitive.Content,
|
|
602
602
|
{
|
|
603
603
|
ref,
|
|
@@ -623,7 +623,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
623
623
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
624
624
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
625
625
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
626
|
-
var DropdownMenuSubTrigger =
|
|
626
|
+
var DropdownMenuSubTrigger = React34.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
627
627
|
DropdownMenuPrimitive.SubTrigger,
|
|
628
628
|
{
|
|
629
629
|
ref,
|
|
@@ -642,7 +642,7 @@ var DropdownMenuSubTrigger = React33.forwardRef(({ className, inset, children, .
|
|
|
642
642
|
}
|
|
643
643
|
));
|
|
644
644
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
645
|
-
var DropdownMenuSubContent =
|
|
645
|
+
var DropdownMenuSubContent = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
646
646
|
DropdownMenuPrimitive.SubContent,
|
|
647
647
|
{
|
|
648
648
|
ref,
|
|
@@ -659,7 +659,7 @@ var DropdownMenuSubContent = React33.forwardRef(({ className, ...props }, ref) =
|
|
|
659
659
|
}
|
|
660
660
|
));
|
|
661
661
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
662
|
-
var DropdownMenuContent =
|
|
662
|
+
var DropdownMenuContent = React34.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
663
663
|
DropdownMenuPrimitive.Content,
|
|
664
664
|
{
|
|
665
665
|
ref,
|
|
@@ -677,7 +677,7 @@ var DropdownMenuContent = React33.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
677
677
|
}
|
|
678
678
|
) }));
|
|
679
679
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
680
|
-
var DropdownMenuItem =
|
|
680
|
+
var DropdownMenuItem = React34.forwardRef(({ className, inset, destructive, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
681
681
|
DropdownMenuPrimitive.Item,
|
|
682
682
|
{
|
|
683
683
|
ref,
|
|
@@ -693,7 +693,7 @@ var DropdownMenuItem = React33.forwardRef(({ className, inset, destructive, ...p
|
|
|
693
693
|
}
|
|
694
694
|
));
|
|
695
695
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
696
|
-
var DropdownMenuCheckboxItem =
|
|
696
|
+
var DropdownMenuCheckboxItem = React34.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
697
697
|
DropdownMenuPrimitive.CheckboxItem,
|
|
698
698
|
{
|
|
699
699
|
ref,
|
|
@@ -712,7 +712,7 @@ var DropdownMenuCheckboxItem = React33.forwardRef(({ className, children, checke
|
|
|
712
712
|
}
|
|
713
713
|
));
|
|
714
714
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
715
|
-
var DropdownMenuRadioItem =
|
|
715
|
+
var DropdownMenuRadioItem = React34.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
716
716
|
DropdownMenuPrimitive.RadioItem,
|
|
717
717
|
{
|
|
718
718
|
ref,
|
|
@@ -730,7 +730,7 @@ var DropdownMenuRadioItem = React33.forwardRef(({ className, children, ...props
|
|
|
730
730
|
}
|
|
731
731
|
));
|
|
732
732
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
733
|
-
var DropdownMenuLabel =
|
|
733
|
+
var DropdownMenuLabel = React34.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
734
734
|
DropdownMenuPrimitive.Label,
|
|
735
735
|
{
|
|
736
736
|
ref,
|
|
@@ -743,7 +743,7 @@ var DropdownMenuLabel = React33.forwardRef(({ className, inset, ...props }, ref)
|
|
|
743
743
|
}
|
|
744
744
|
));
|
|
745
745
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
746
|
-
var DropdownMenuSeparator =
|
|
746
|
+
var DropdownMenuSeparator = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
747
747
|
DropdownMenuPrimitive.Separator,
|
|
748
748
|
{
|
|
749
749
|
ref,
|
|
@@ -768,7 +768,7 @@ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
|
768
768
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
769
769
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
770
770
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
771
|
-
var AlertDialogOverlay =
|
|
771
|
+
var AlertDialogOverlay = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
772
772
|
AlertDialogPrimitive.Overlay,
|
|
773
773
|
{
|
|
774
774
|
className: cn(
|
|
@@ -782,7 +782,7 @@ var AlertDialogOverlay = React33.forwardRef(({ className, ...props }, ref) => /*
|
|
|
782
782
|
}
|
|
783
783
|
));
|
|
784
784
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
785
|
-
var AlertDialogContent =
|
|
785
|
+
var AlertDialogContent = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
786
786
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
787
787
|
/* @__PURE__ */ jsx(
|
|
788
788
|
AlertDialogPrimitive.Content,
|
|
@@ -825,7 +825,7 @@ var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
825
825
|
}
|
|
826
826
|
);
|
|
827
827
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
828
|
-
var AlertDialogTitle =
|
|
828
|
+
var AlertDialogTitle = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
829
829
|
AlertDialogPrimitive.Title,
|
|
830
830
|
{
|
|
831
831
|
ref,
|
|
@@ -834,7 +834,7 @@ var AlertDialogTitle = React33.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
834
834
|
}
|
|
835
835
|
));
|
|
836
836
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
837
|
-
var AlertDialogDescription =
|
|
837
|
+
var AlertDialogDescription = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
838
838
|
AlertDialogPrimitive.Description,
|
|
839
839
|
{
|
|
840
840
|
ref,
|
|
@@ -843,7 +843,7 @@ var AlertDialogDescription = React33.forwardRef(({ className, ...props }, ref) =
|
|
|
843
843
|
}
|
|
844
844
|
));
|
|
845
845
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
846
|
-
var AlertDialogAction =
|
|
846
|
+
var AlertDialogAction = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
847
847
|
AlertDialogPrimitive.Action,
|
|
848
848
|
{
|
|
849
849
|
ref,
|
|
@@ -852,7 +852,7 @@ var AlertDialogAction = React33.forwardRef(({ className, ...props }, ref) => /*
|
|
|
852
852
|
}
|
|
853
853
|
));
|
|
854
854
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
855
|
-
var AlertDialogCancel =
|
|
855
|
+
var AlertDialogCancel = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
856
856
|
AlertDialogPrimitive.Cancel,
|
|
857
857
|
{
|
|
858
858
|
ref,
|
|
@@ -915,7 +915,7 @@ var cardVariants = cva(
|
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
);
|
|
918
|
-
var Card =
|
|
918
|
+
var Card = React34.forwardRef(
|
|
919
919
|
({
|
|
920
920
|
className,
|
|
921
921
|
size,
|
|
@@ -929,7 +929,7 @@ var Card = React33.forwardRef(
|
|
|
929
929
|
...props
|
|
930
930
|
}, ref) => {
|
|
931
931
|
const isInteractive = interactive || asButton || !!onClick;
|
|
932
|
-
const handleKeyDown =
|
|
932
|
+
const handleKeyDown = React34.useCallback(
|
|
933
933
|
(e) => {
|
|
934
934
|
if (isInteractive && (e.key === "Enter" || e.key === " ")) {
|
|
935
935
|
e.preventDefault();
|
|
@@ -961,7 +961,7 @@ var Card = React33.forwardRef(
|
|
|
961
961
|
}
|
|
962
962
|
);
|
|
963
963
|
Card.displayName = "Card";
|
|
964
|
-
var CardHeader =
|
|
964
|
+
var CardHeader = React34.forwardRef(
|
|
965
965
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
966
966
|
"div",
|
|
967
967
|
{
|
|
@@ -972,7 +972,7 @@ var CardHeader = React33.forwardRef(
|
|
|
972
972
|
)
|
|
973
973
|
);
|
|
974
974
|
CardHeader.displayName = "CardHeader";
|
|
975
|
-
var CardTitle =
|
|
975
|
+
var CardTitle = React34.forwardRef(
|
|
976
976
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
977
977
|
"div",
|
|
978
978
|
{
|
|
@@ -983,7 +983,7 @@ var CardTitle = React33.forwardRef(
|
|
|
983
983
|
)
|
|
984
984
|
);
|
|
985
985
|
CardTitle.displayName = "CardTitle";
|
|
986
|
-
var CardDescription =
|
|
986
|
+
var CardDescription = React34.forwardRef(
|
|
987
987
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
988
988
|
"div",
|
|
989
989
|
{
|
|
@@ -994,11 +994,11 @@ var CardDescription = React33.forwardRef(
|
|
|
994
994
|
)
|
|
995
995
|
);
|
|
996
996
|
CardDescription.displayName = "CardDescription";
|
|
997
|
-
var CardContent =
|
|
997
|
+
var CardContent = React34.forwardRef(
|
|
998
998
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
999
999
|
);
|
|
1000
1000
|
CardContent.displayName = "CardContent";
|
|
1001
|
-
var CardFooter =
|
|
1001
|
+
var CardFooter = React34.forwardRef(
|
|
1002
1002
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1003
1003
|
"div",
|
|
1004
1004
|
{
|
|
@@ -1035,17 +1035,17 @@ var cardImageVariants = cva("w-full object-cover", {
|
|
|
1035
1035
|
position: "top"
|
|
1036
1036
|
}
|
|
1037
1037
|
});
|
|
1038
|
-
var CardImage =
|
|
1038
|
+
var CardImage = React34.forwardRef(
|
|
1039
1039
|
({ className, aspectRatio, position, fallback, alt, src, onError, ...props }, ref) => {
|
|
1040
|
-
const [hasError, setHasError] =
|
|
1041
|
-
const handleError =
|
|
1040
|
+
const [hasError, setHasError] = React34.useState(false);
|
|
1041
|
+
const handleError = React34.useCallback(
|
|
1042
1042
|
(e) => {
|
|
1043
1043
|
setHasError(true);
|
|
1044
1044
|
onError?.(e);
|
|
1045
1045
|
},
|
|
1046
1046
|
[onError]
|
|
1047
1047
|
);
|
|
1048
|
-
|
|
1048
|
+
React34.useEffect(() => {
|
|
1049
1049
|
setHasError(false);
|
|
1050
1050
|
}, [src]);
|
|
1051
1051
|
if (hasError && fallback) {
|
|
@@ -1116,7 +1116,7 @@ var cardActionsVariants = cva(
|
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|
|
1118
1118
|
);
|
|
1119
|
-
var CardActions =
|
|
1119
|
+
var CardActions = React34.forwardRef(
|
|
1120
1120
|
({ className, showOn, position, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1121
1121
|
"div",
|
|
1122
1122
|
{
|
|
@@ -1128,7 +1128,7 @@ var CardActions = React33.forwardRef(
|
|
|
1128
1128
|
)
|
|
1129
1129
|
);
|
|
1130
1130
|
CardActions.displayName = "CardActions";
|
|
1131
|
-
var SelectableCard =
|
|
1131
|
+
var SelectableCard = React34.forwardRef(
|
|
1132
1132
|
({
|
|
1133
1133
|
className,
|
|
1134
1134
|
selected: controlledSelected,
|
|
@@ -1142,10 +1142,10 @@ var SelectableCard = React33.forwardRef(
|
|
|
1142
1142
|
hover = "border",
|
|
1143
1143
|
...props
|
|
1144
1144
|
}, ref) => {
|
|
1145
|
-
const [uncontrolledSelected, setUncontrolledSelected] =
|
|
1145
|
+
const [uncontrolledSelected, setUncontrolledSelected] = React34.useState(defaultSelected);
|
|
1146
1146
|
const isControlled = controlledSelected !== void 0;
|
|
1147
1147
|
const isSelected = isControlled ? controlledSelected : uncontrolledSelected;
|
|
1148
|
-
const handleClick =
|
|
1148
|
+
const handleClick = React34.useCallback(
|
|
1149
1149
|
(e) => {
|
|
1150
1150
|
if (disabled) return;
|
|
1151
1151
|
const newSelected = !isSelected;
|
|
@@ -1157,7 +1157,7 @@ var SelectableCard = React33.forwardRef(
|
|
|
1157
1157
|
},
|
|
1158
1158
|
[disabled, isSelected, isControlled, onSelectedChange, onClick]
|
|
1159
1159
|
);
|
|
1160
|
-
const handleCheckboxChange =
|
|
1160
|
+
const handleCheckboxChange = React34.useCallback(
|
|
1161
1161
|
(checked) => {
|
|
1162
1162
|
if (disabled) return;
|
|
1163
1163
|
const newSelected = checked === true;
|
|
@@ -1257,7 +1257,7 @@ var cardGridVariants = cva("grid", {
|
|
|
1257
1257
|
gap: "md"
|
|
1258
1258
|
}
|
|
1259
1259
|
});
|
|
1260
|
-
var CardGrid =
|
|
1260
|
+
var CardGrid = React34.forwardRef(
|
|
1261
1261
|
({ className, columns, gap, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1262
1262
|
"div",
|
|
1263
1263
|
{
|
|
@@ -1292,7 +1292,7 @@ var cardListVariants = cva("flex flex-col", {
|
|
|
1292
1292
|
divided: false
|
|
1293
1293
|
}
|
|
1294
1294
|
});
|
|
1295
|
-
var CardList =
|
|
1295
|
+
var CardList = React34.forwardRef(
|
|
1296
1296
|
({ className, gap, divided, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1297
1297
|
"div",
|
|
1298
1298
|
{
|
|
@@ -1303,7 +1303,128 @@ var CardList = React33.forwardRef(
|
|
|
1303
1303
|
)
|
|
1304
1304
|
);
|
|
1305
1305
|
CardList.displayName = "CardList";
|
|
1306
|
-
var
|
|
1306
|
+
var boardVariants = cva("text-card-foreground", {
|
|
1307
|
+
variants: {
|
|
1308
|
+
/**
|
|
1309
|
+
* Elevation (shadow depth) - similar to MUI Paper
|
|
1310
|
+
*/
|
|
1311
|
+
elevation: {
|
|
1312
|
+
none: "",
|
|
1313
|
+
sm: "shadow-sm",
|
|
1314
|
+
md: "shadow",
|
|
1315
|
+
lg: "shadow-lg",
|
|
1316
|
+
xl: "shadow-xl"
|
|
1317
|
+
},
|
|
1318
|
+
/**
|
|
1319
|
+
* Border style
|
|
1320
|
+
*/
|
|
1321
|
+
border: {
|
|
1322
|
+
none: "",
|
|
1323
|
+
default: "border",
|
|
1324
|
+
muted: "border border-muted"
|
|
1325
|
+
},
|
|
1326
|
+
/**
|
|
1327
|
+
* Padding size
|
|
1328
|
+
*/
|
|
1329
|
+
padding: {
|
|
1330
|
+
none: "",
|
|
1331
|
+
sm: "p-2",
|
|
1332
|
+
md: "p-4",
|
|
1333
|
+
lg: "p-6",
|
|
1334
|
+
xl: "p-8"
|
|
1335
|
+
},
|
|
1336
|
+
/**
|
|
1337
|
+
* Border radius
|
|
1338
|
+
*/
|
|
1339
|
+
radius: {
|
|
1340
|
+
none: "rounded-none",
|
|
1341
|
+
sm: "rounded-sm",
|
|
1342
|
+
md: "rounded-md",
|
|
1343
|
+
lg: "rounded-lg",
|
|
1344
|
+
xl: "rounded-xl",
|
|
1345
|
+
full: "rounded-full"
|
|
1346
|
+
},
|
|
1347
|
+
/**
|
|
1348
|
+
* Background color
|
|
1349
|
+
*/
|
|
1350
|
+
background: {
|
|
1351
|
+
default: "bg-card",
|
|
1352
|
+
muted: "bg-muted",
|
|
1353
|
+
transparent: "bg-transparent"
|
|
1354
|
+
},
|
|
1355
|
+
/**
|
|
1356
|
+
* Hover effect styles
|
|
1357
|
+
*/
|
|
1358
|
+
hover: {
|
|
1359
|
+
none: "",
|
|
1360
|
+
border: "transition-colors duration-200 hover:border-accent",
|
|
1361
|
+
elevate: "transition-shadow duration-200 hover:shadow-lg",
|
|
1362
|
+
"border-success": "transition-colors duration-200 hover:border-success",
|
|
1363
|
+
"border-warning": "transition-colors duration-200 hover:border-warning",
|
|
1364
|
+
"border-destructive": "transition-colors duration-200 hover:border-destructive"
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
defaultVariants: {
|
|
1368
|
+
elevation: "none",
|
|
1369
|
+
border: "default",
|
|
1370
|
+
padding: "none",
|
|
1371
|
+
radius: "lg",
|
|
1372
|
+
background: "default",
|
|
1373
|
+
hover: "none"
|
|
1374
|
+
}
|
|
1375
|
+
});
|
|
1376
|
+
var Board = React34.forwardRef(
|
|
1377
|
+
({
|
|
1378
|
+
className,
|
|
1379
|
+
elevation,
|
|
1380
|
+
border,
|
|
1381
|
+
padding,
|
|
1382
|
+
radius,
|
|
1383
|
+
background,
|
|
1384
|
+
hover,
|
|
1385
|
+
hoverBorderClass,
|
|
1386
|
+
...props
|
|
1387
|
+
}, ref) => {
|
|
1388
|
+
return /* @__PURE__ */ jsx(
|
|
1389
|
+
"div",
|
|
1390
|
+
{
|
|
1391
|
+
ref,
|
|
1392
|
+
className: cn(
|
|
1393
|
+
boardVariants({
|
|
1394
|
+
elevation,
|
|
1395
|
+
border,
|
|
1396
|
+
padding,
|
|
1397
|
+
radius,
|
|
1398
|
+
background,
|
|
1399
|
+
hover
|
|
1400
|
+
}),
|
|
1401
|
+
// Custom hover border color overrides variant if provided
|
|
1402
|
+
hoverBorderClass && "transition-colors duration-200",
|
|
1403
|
+
hoverBorderClass,
|
|
1404
|
+
className
|
|
1405
|
+
),
|
|
1406
|
+
...props
|
|
1407
|
+
}
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1410
|
+
);
|
|
1411
|
+
Board.displayName = "Board";
|
|
1412
|
+
var BoardHeader = React34.forwardRef(
|
|
1413
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1414
|
+
"div",
|
|
1415
|
+
{
|
|
1416
|
+
ref,
|
|
1417
|
+
className: cn("flex items-center p-4 border-b", className),
|
|
1418
|
+
...props
|
|
1419
|
+
}
|
|
1420
|
+
)
|
|
1421
|
+
);
|
|
1422
|
+
BoardHeader.displayName = "BoardHeader";
|
|
1423
|
+
var BoardContent = React34.forwardRef(
|
|
1424
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-4", className), ...props })
|
|
1425
|
+
);
|
|
1426
|
+
BoardContent.displayName = "BoardContent";
|
|
1427
|
+
var Table = React34.forwardRef(
|
|
1307
1428
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
1308
1429
|
"table",
|
|
1309
1430
|
{
|
|
@@ -1314,11 +1435,11 @@ var Table = React33.forwardRef(
|
|
|
1314
1435
|
) })
|
|
1315
1436
|
);
|
|
1316
1437
|
Table.displayName = "Table";
|
|
1317
|
-
var TableHeader =
|
|
1438
|
+
var TableHeader = React34.forwardRef(
|
|
1318
1439
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
1319
1440
|
);
|
|
1320
1441
|
TableHeader.displayName = "TableHeader";
|
|
1321
|
-
var TableBody =
|
|
1442
|
+
var TableBody = React34.forwardRef(
|
|
1322
1443
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1323
1444
|
"tbody",
|
|
1324
1445
|
{
|
|
@@ -1329,7 +1450,7 @@ var TableBody = React33.forwardRef(
|
|
|
1329
1450
|
)
|
|
1330
1451
|
);
|
|
1331
1452
|
TableBody.displayName = "TableBody";
|
|
1332
|
-
var TableFooter =
|
|
1453
|
+
var TableFooter = React34.forwardRef(
|
|
1333
1454
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1334
1455
|
"tfoot",
|
|
1335
1456
|
{
|
|
@@ -1343,7 +1464,7 @@ var TableFooter = React33.forwardRef(
|
|
|
1343
1464
|
)
|
|
1344
1465
|
);
|
|
1345
1466
|
TableFooter.displayName = "TableFooter";
|
|
1346
|
-
var TableRow =
|
|
1467
|
+
var TableRow = React34.forwardRef(
|
|
1347
1468
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1348
1469
|
"tr",
|
|
1349
1470
|
{
|
|
@@ -1357,7 +1478,7 @@ var TableRow = React33.forwardRef(
|
|
|
1357
1478
|
)
|
|
1358
1479
|
);
|
|
1359
1480
|
TableRow.displayName = "TableRow";
|
|
1360
|
-
var TableHead =
|
|
1481
|
+
var TableHead = React34.forwardRef(
|
|
1361
1482
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1362
1483
|
"th",
|
|
1363
1484
|
{
|
|
@@ -1371,7 +1492,7 @@ var TableHead = React33.forwardRef(
|
|
|
1371
1492
|
)
|
|
1372
1493
|
);
|
|
1373
1494
|
TableHead.displayName = "TableHead";
|
|
1374
|
-
var TableCell =
|
|
1495
|
+
var TableCell = React34.forwardRef(
|
|
1375
1496
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1376
1497
|
"td",
|
|
1377
1498
|
{
|
|
@@ -1385,7 +1506,7 @@ var TableCell = React33.forwardRef(
|
|
|
1385
1506
|
)
|
|
1386
1507
|
);
|
|
1387
1508
|
TableCell.displayName = "TableCell";
|
|
1388
|
-
var TableCaption =
|
|
1509
|
+
var TableCaption = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1389
1510
|
"caption",
|
|
1390
1511
|
{
|
|
1391
1512
|
ref,
|
|
@@ -1404,7 +1525,7 @@ function Modal({
|
|
|
1404
1525
|
zIndex = 50,
|
|
1405
1526
|
className
|
|
1406
1527
|
}) {
|
|
1407
|
-
|
|
1528
|
+
React34.useEffect(() => {
|
|
1408
1529
|
if (!isOpen) return;
|
|
1409
1530
|
const handleEscape = (e) => {
|
|
1410
1531
|
if (e.key === "Escape") {
|
|
@@ -1414,7 +1535,7 @@ function Modal({
|
|
|
1414
1535
|
window.addEventListener("keydown", handleEscape);
|
|
1415
1536
|
return () => window.removeEventListener("keydown", handleEscape);
|
|
1416
1537
|
}, [isOpen, onClose]);
|
|
1417
|
-
|
|
1538
|
+
React34.useEffect(() => {
|
|
1418
1539
|
if (isOpen) {
|
|
1419
1540
|
document.body.style.overflow = "hidden";
|
|
1420
1541
|
} else {
|
|
@@ -1529,12 +1650,12 @@ function ConfirmationModal({
|
|
|
1529
1650
|
] }) });
|
|
1530
1651
|
}
|
|
1531
1652
|
function useConfirmation() {
|
|
1532
|
-
const [state, setState] =
|
|
1653
|
+
const [state, setState] = React34.useState({
|
|
1533
1654
|
open: false,
|
|
1534
1655
|
title: "",
|
|
1535
1656
|
description: ""
|
|
1536
1657
|
});
|
|
1537
|
-
const confirm =
|
|
1658
|
+
const confirm = React34.useCallback(
|
|
1538
1659
|
(options) => {
|
|
1539
1660
|
return new Promise((resolve) => {
|
|
1540
1661
|
setState({
|
|
@@ -1546,15 +1667,15 @@ function useConfirmation() {
|
|
|
1546
1667
|
},
|
|
1547
1668
|
[]
|
|
1548
1669
|
);
|
|
1549
|
-
const handleConfirm =
|
|
1670
|
+
const handleConfirm = React34.useCallback(() => {
|
|
1550
1671
|
state.resolve?.(true);
|
|
1551
1672
|
setState((prev) => ({ ...prev, open: false }));
|
|
1552
1673
|
}, [state.resolve]);
|
|
1553
|
-
const handleCancel =
|
|
1674
|
+
const handleCancel = React34.useCallback(() => {
|
|
1554
1675
|
state.resolve?.(false);
|
|
1555
1676
|
setState((prev) => ({ ...prev, open: false }));
|
|
1556
1677
|
}, [state.resolve]);
|
|
1557
|
-
const handleOpenChange =
|
|
1678
|
+
const handleOpenChange = React34.useCallback(
|
|
1558
1679
|
(open) => {
|
|
1559
1680
|
if (!open) {
|
|
1560
1681
|
state.resolve?.(false);
|
|
@@ -1590,11 +1711,11 @@ function ResizeHandle({
|
|
|
1590
1711
|
ariaLabel,
|
|
1591
1712
|
className
|
|
1592
1713
|
}) {
|
|
1593
|
-
const [isDragging, setIsDragging] =
|
|
1594
|
-
const [isFocused, setIsFocused] =
|
|
1595
|
-
const startXRef =
|
|
1596
|
-
const handleRef =
|
|
1597
|
-
const handleMouseDown =
|
|
1714
|
+
const [isDragging, setIsDragging] = React34.useState(false);
|
|
1715
|
+
const [isFocused, setIsFocused] = React34.useState(false);
|
|
1716
|
+
const startXRef = React34.useRef(0);
|
|
1717
|
+
const handleRef = React34.useRef(null);
|
|
1718
|
+
const handleMouseDown = React34.useCallback(
|
|
1598
1719
|
(e) => {
|
|
1599
1720
|
if (!resizable) return;
|
|
1600
1721
|
e.preventDefault();
|
|
@@ -1605,7 +1726,7 @@ function ResizeHandle({
|
|
|
1605
1726
|
},
|
|
1606
1727
|
[resizable, onDragStart]
|
|
1607
1728
|
);
|
|
1608
|
-
const handleMouseMove =
|
|
1729
|
+
const handleMouseMove = React34.useCallback(
|
|
1609
1730
|
(e) => {
|
|
1610
1731
|
if (!isDragging) return;
|
|
1611
1732
|
const deltaX = e.clientX - startXRef.current;
|
|
@@ -1614,13 +1735,13 @@ function ResizeHandle({
|
|
|
1614
1735
|
},
|
|
1615
1736
|
[isDragging, onDrag]
|
|
1616
1737
|
);
|
|
1617
|
-
const handleMouseUp =
|
|
1738
|
+
const handleMouseUp = React34.useCallback(() => {
|
|
1618
1739
|
if (!isDragging) return;
|
|
1619
1740
|
setIsDragging(false);
|
|
1620
1741
|
document.body.style.userSelect = "";
|
|
1621
1742
|
onDragEnd?.();
|
|
1622
1743
|
}, [isDragging, onDragEnd]);
|
|
1623
|
-
const handleKeyDown =
|
|
1744
|
+
const handleKeyDown = React34.useCallback(
|
|
1624
1745
|
(e) => {
|
|
1625
1746
|
if (!resizable || !onKeyboardResize) return;
|
|
1626
1747
|
let direction = null;
|
|
@@ -1639,7 +1760,7 @@ function ResizeHandle({
|
|
|
1639
1760
|
},
|
|
1640
1761
|
[resizable, onKeyboardResize, orientation]
|
|
1641
1762
|
);
|
|
1642
|
-
|
|
1763
|
+
React34.useEffect(() => {
|
|
1643
1764
|
if (isDragging) {
|
|
1644
1765
|
window.addEventListener("mousemove", handleMouseMove);
|
|
1645
1766
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -1709,12 +1830,12 @@ function ResizablePanel({
|
|
|
1709
1830
|
className,
|
|
1710
1831
|
dataAttributes = {}
|
|
1711
1832
|
}) {
|
|
1712
|
-
const panelRef =
|
|
1713
|
-
const [isDragging, setIsDragging] =
|
|
1714
|
-
const [localWidth, setLocalWidth] =
|
|
1715
|
-
const [localOuterWidth, setLocalOuterWidth] =
|
|
1833
|
+
const panelRef = React34.useRef(null);
|
|
1834
|
+
const [isDragging, setIsDragging] = React34.useState(false);
|
|
1835
|
+
const [localWidth, setLocalWidth] = React34.useState(null);
|
|
1836
|
+
const [localOuterWidth, setLocalOuterWidth] = React34.useState(null);
|
|
1716
1837
|
const currentWidthVW = isExpanded ? (isDragging && localWidth !== null ? localWidth : expandedWidthVW) || collapsedSizeVW : collapsedSizeVW;
|
|
1717
|
-
const clampWidth =
|
|
1838
|
+
const clampWidth = React34.useCallback(
|
|
1718
1839
|
(width) => {
|
|
1719
1840
|
let effectiveMinWidth = minWidthVW;
|
|
1720
1841
|
let effectiveMaxWidth = maxWidthVW;
|
|
@@ -1727,11 +1848,11 @@ function ResizablePanel({
|
|
|
1727
1848
|
},
|
|
1728
1849
|
[minWidthVW, maxWidthVW, orientation, leftWidthVW, isOverlay]
|
|
1729
1850
|
);
|
|
1730
|
-
const handleDragStart =
|
|
1851
|
+
const handleDragStart = React34.useCallback(() => {
|
|
1731
1852
|
setIsDragging(true);
|
|
1732
1853
|
setLocalWidth(currentWidthVW);
|
|
1733
1854
|
}, [currentWidthVW]);
|
|
1734
|
-
const handleDrag =
|
|
1855
|
+
const handleDrag = React34.useCallback(
|
|
1735
1856
|
(deltaX) => {
|
|
1736
1857
|
if (!isExpanded || isOverlay) return;
|
|
1737
1858
|
const viewportWidth = window.innerWidth;
|
|
@@ -1750,14 +1871,14 @@ function ResizablePanel({
|
|
|
1750
1871
|
clampWidth
|
|
1751
1872
|
]
|
|
1752
1873
|
);
|
|
1753
|
-
const handleDragEnd =
|
|
1874
|
+
const handleDragEnd = React34.useCallback(() => {
|
|
1754
1875
|
if (localWidth !== null && onResize) {
|
|
1755
1876
|
onResize(localWidth);
|
|
1756
1877
|
}
|
|
1757
1878
|
setIsDragging(false);
|
|
1758
1879
|
setLocalWidth(null);
|
|
1759
1880
|
}, [localWidth, onResize]);
|
|
1760
|
-
const handleKeyboardResize =
|
|
1881
|
+
const handleKeyboardResize = React34.useCallback(
|
|
1761
1882
|
(direction) => {
|
|
1762
1883
|
if (!isExpanded || isOverlay || !onResize) return;
|
|
1763
1884
|
const step = 1;
|
|
@@ -1766,13 +1887,13 @@ function ResizablePanel({
|
|
|
1766
1887
|
},
|
|
1767
1888
|
[isExpanded, isOverlay, onResize, currentWidthVW, clampWidth]
|
|
1768
1889
|
);
|
|
1769
|
-
const handleOverlayDragStart =
|
|
1890
|
+
const handleOverlayDragStart = React34.useCallback(() => {
|
|
1770
1891
|
if (outerWidthVW) {
|
|
1771
1892
|
setIsDragging(true);
|
|
1772
1893
|
setLocalOuterWidth(outerWidthVW);
|
|
1773
1894
|
}
|
|
1774
1895
|
}, [outerWidthVW]);
|
|
1775
|
-
const handleOverlayDrag =
|
|
1896
|
+
const handleOverlayDrag = React34.useCallback(
|
|
1776
1897
|
(deltaX) => {
|
|
1777
1898
|
if (!isOverlay) return;
|
|
1778
1899
|
const viewportWidth = window.innerWidth;
|
|
@@ -1783,14 +1904,14 @@ function ResizablePanel({
|
|
|
1783
1904
|
},
|
|
1784
1905
|
[isOverlay, localOuterWidth, outerWidthVW]
|
|
1785
1906
|
);
|
|
1786
|
-
const handleOverlayDragEnd =
|
|
1907
|
+
const handleOverlayDragEnd = React34.useCallback(() => {
|
|
1787
1908
|
if (localOuterWidth !== null && onResizeOverlay) {
|
|
1788
1909
|
onResizeOverlay(localOuterWidth);
|
|
1789
1910
|
}
|
|
1790
1911
|
setIsDragging(false);
|
|
1791
1912
|
setLocalOuterWidth(null);
|
|
1792
1913
|
}, [localOuterWidth, onResizeOverlay]);
|
|
1793
|
-
|
|
1914
|
+
React34.useEffect(() => {
|
|
1794
1915
|
if (isOverlay && panelRef.current) {
|
|
1795
1916
|
const focusableElement = panelRef.current.querySelector(
|
|
1796
1917
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
@@ -1798,7 +1919,7 @@ function ResizablePanel({
|
|
|
1798
1919
|
focusableElement?.focus();
|
|
1799
1920
|
}
|
|
1800
1921
|
}, [isOverlay]);
|
|
1801
|
-
|
|
1922
|
+
React34.useEffect(() => {
|
|
1802
1923
|
if (!isOverlay) return;
|
|
1803
1924
|
const handleEscape = (e) => {
|
|
1804
1925
|
if (e.key === "Escape") {
|
|
@@ -2014,10 +2135,10 @@ var loadingSpinnerVariants = cva("rounded-full animate-spin border-current", {
|
|
|
2014
2135
|
variant: "default"
|
|
2015
2136
|
}
|
|
2016
2137
|
});
|
|
2017
|
-
var LoadingSpinner =
|
|
2138
|
+
var LoadingSpinner = React34.forwardRef(
|
|
2018
2139
|
({ className, size, variant, label, showDots = false, ...props }, ref) => {
|
|
2019
|
-
const [dots, setDots] =
|
|
2020
|
-
|
|
2140
|
+
const [dots, setDots] = React34.useState("");
|
|
2141
|
+
React34.useEffect(() => {
|
|
2021
2142
|
if (!showDots || !label) return;
|
|
2022
2143
|
const interval = setInterval(() => {
|
|
2023
2144
|
setDots((prev) => prev.length >= 3 ? "" : prev + ".");
|
|
@@ -2114,12 +2235,12 @@ function Calendar({
|
|
|
2114
2235
|
const endMonth = props.endMonth ?? props.toDate;
|
|
2115
2236
|
const fromYear = startMonth?.getFullYear();
|
|
2116
2237
|
const toYear = endMonth?.getFullYear();
|
|
2117
|
-
const years =
|
|
2118
|
-
const [internalMonth, setInternalMonth] =
|
|
2238
|
+
const years = React34.useMemo(() => getYearRange(fromYear, toYear), [fromYear, toYear]);
|
|
2239
|
+
const [internalMonth, setInternalMonth] = React34.useState(
|
|
2119
2240
|
defaultMonth ?? /* @__PURE__ */ new Date()
|
|
2120
2241
|
);
|
|
2121
2242
|
const displayedMonth = controlledMonth ?? internalMonth;
|
|
2122
|
-
const handleMonthChange =
|
|
2243
|
+
const handleMonthChange = React34.useCallback(
|
|
2123
2244
|
(newMonth) => {
|
|
2124
2245
|
if (controlledMonth === void 0) {
|
|
2125
2246
|
setInternalMonth(newMonth);
|
|
@@ -2250,8 +2371,8 @@ function DatePicker({
|
|
|
2250
2371
|
matchTriggerWidth = false,
|
|
2251
2372
|
onOpenChange
|
|
2252
2373
|
}) {
|
|
2253
|
-
const [open, setOpen] =
|
|
2254
|
-
const [internalValue, setInternalValue] =
|
|
2374
|
+
const [open, setOpen] = React34.useState(false);
|
|
2375
|
+
const [internalValue, setInternalValue] = React34.useState(
|
|
2255
2376
|
defaultValue
|
|
2256
2377
|
);
|
|
2257
2378
|
const isControlled = value !== void 0;
|
|
@@ -2353,15 +2474,15 @@ function DatePickerInput({
|
|
|
2353
2474
|
onOpenChange,
|
|
2354
2475
|
size = "default"
|
|
2355
2476
|
}) {
|
|
2356
|
-
const [open, setOpen] =
|
|
2357
|
-
const [internalValue, setInternalValue] =
|
|
2477
|
+
const [open, setOpen] = React34.useState(false);
|
|
2478
|
+
const [internalValue, setInternalValue] = React34.useState(
|
|
2358
2479
|
defaultValue
|
|
2359
2480
|
);
|
|
2360
|
-
const [inputValue, setInputValue] =
|
|
2361
|
-
const inputRef =
|
|
2481
|
+
const [inputValue, setInputValue] = React34.useState("");
|
|
2482
|
+
const inputRef = React34.useRef(null);
|
|
2362
2483
|
const isControlled = value !== void 0;
|
|
2363
2484
|
const selectedDate = isControlled ? value : internalValue;
|
|
2364
|
-
|
|
2485
|
+
React34.useEffect(() => {
|
|
2365
2486
|
if (selectedDate) {
|
|
2366
2487
|
setInputValue(format(selectedDate, dateFormat));
|
|
2367
2488
|
} else {
|
|
@@ -2522,11 +2643,11 @@ function FilterPopover({
|
|
|
2522
2643
|
onFilterChange
|
|
2523
2644
|
}) {
|
|
2524
2645
|
const filterType = column.filterType || "text";
|
|
2525
|
-
const [operator, setOperator] =
|
|
2646
|
+
const [operator, setOperator] = React34.useState(
|
|
2526
2647
|
filter?.operator || getDefaultOperator(filterType)
|
|
2527
2648
|
);
|
|
2528
|
-
const [value, setValue] =
|
|
2529
|
-
const [valueTo, setValueTo] =
|
|
2649
|
+
const [value, setValue] = React34.useState(filter?.value ?? "");
|
|
2650
|
+
const [valueTo, setValueTo] = React34.useState(filter?.valueTo ?? "");
|
|
2530
2651
|
function getDefaultOperator(type) {
|
|
2531
2652
|
switch (type) {
|
|
2532
2653
|
case "text":
|
|
@@ -2669,7 +2790,7 @@ function FilterPopover({
|
|
|
2669
2790
|
] })
|
|
2670
2791
|
] });
|
|
2671
2792
|
const renderDateFilter = () => {
|
|
2672
|
-
const dateValue =
|
|
2793
|
+
const dateValue = React34.useMemo(() => {
|
|
2673
2794
|
if (!value) return void 0;
|
|
2674
2795
|
if (value instanceof Date) return value;
|
|
2675
2796
|
if (typeof value === "string") {
|
|
@@ -2678,7 +2799,7 @@ function FilterPopover({
|
|
|
2678
2799
|
}
|
|
2679
2800
|
return void 0;
|
|
2680
2801
|
}, [value]);
|
|
2681
|
-
const dateToValue =
|
|
2802
|
+
const dateToValue = React34.useMemo(() => {
|
|
2682
2803
|
if (!valueTo) return void 0;
|
|
2683
2804
|
if (valueTo instanceof Date) return valueTo;
|
|
2684
2805
|
if (typeof valueTo === "string") {
|
|
@@ -2813,7 +2934,7 @@ function HeaderCell({
|
|
|
2813
2934
|
onResizeDoubleClick,
|
|
2814
2935
|
isResizing
|
|
2815
2936
|
}) {
|
|
2816
|
-
const [filterOpen, setFilterOpen] =
|
|
2937
|
+
const [filterOpen, setFilterOpen] = React34.useState(false);
|
|
2817
2938
|
const isSorted = sorting?.field === column.key;
|
|
2818
2939
|
const isFiltered = !!filter;
|
|
2819
2940
|
const isSortable = column.sortable && onSort;
|
|
@@ -2971,15 +3092,15 @@ function CellEditor({
|
|
|
2971
3092
|
className
|
|
2972
3093
|
}) {
|
|
2973
3094
|
const editorType = column.editorType || "text";
|
|
2974
|
-
const [internalValue, setInternalValue] =
|
|
2975
|
-
const [validationError, setValidationError] =
|
|
3095
|
+
const [internalValue, setInternalValue] = React34.useState(value);
|
|
3096
|
+
const [validationError, setValidationError] = React34.useState(
|
|
2976
3097
|
null
|
|
2977
3098
|
);
|
|
2978
|
-
const inputRef =
|
|
2979
|
-
const selectRef =
|
|
3099
|
+
const inputRef = React34.useRef(null);
|
|
3100
|
+
const selectRef = React34.useRef(null);
|
|
2980
3101
|
const currentValue = onChange ? value : internalValue;
|
|
2981
3102
|
const setValue = onChange || setInternalValue;
|
|
2982
|
-
const validate =
|
|
3103
|
+
const validate = React34.useCallback(
|
|
2983
3104
|
(val) => {
|
|
2984
3105
|
if (!column.validator) return true;
|
|
2985
3106
|
const result = column.validator(val, row);
|
|
@@ -3027,7 +3148,7 @@ function CellEditor({
|
|
|
3027
3148
|
}
|
|
3028
3149
|
handleCommit();
|
|
3029
3150
|
};
|
|
3030
|
-
|
|
3151
|
+
React34.useEffect(() => {
|
|
3031
3152
|
const timer = setTimeout(() => {
|
|
3032
3153
|
if (editorType === "select") {
|
|
3033
3154
|
selectRef.current?.focus();
|
|
@@ -3074,7 +3195,7 @@ function CellEditor({
|
|
|
3074
3195
|
}
|
|
3075
3196
|
);
|
|
3076
3197
|
const renderDateEditor = () => {
|
|
3077
|
-
const dateValue =
|
|
3198
|
+
const dateValue = React34.useMemo(() => {
|
|
3078
3199
|
if (!currentValue) return void 0;
|
|
3079
3200
|
if (currentValue instanceof Date) return currentValue;
|
|
3080
3201
|
if (typeof currentValue === "string") {
|
|
@@ -4122,15 +4243,15 @@ function DataGrid({
|
|
|
4122
4243
|
hasMore = false,
|
|
4123
4244
|
loadingMore = false
|
|
4124
4245
|
}) {
|
|
4125
|
-
const parentRef =
|
|
4126
|
-
const headerRef =
|
|
4127
|
-
const [headerHeight, setHeaderHeight] =
|
|
4128
|
-
const [hoveredCell, setHoveredCell] =
|
|
4129
|
-
const visibleColumns =
|
|
4246
|
+
const parentRef = React34.useRef(null);
|
|
4247
|
+
const headerRef = React34.useRef(null);
|
|
4248
|
+
const [headerHeight, setHeaderHeight] = React34.useState(40);
|
|
4249
|
+
const [hoveredCell, setHoveredCell] = React34.useState(null);
|
|
4250
|
+
const visibleColumns = React34.useMemo(
|
|
4130
4251
|
() => columns.filter((col) => !col.hidden),
|
|
4131
4252
|
[columns]
|
|
4132
4253
|
);
|
|
4133
|
-
const getCellValue2 =
|
|
4254
|
+
const getCellValue2 = React34.useCallback(
|
|
4134
4255
|
(row, column) => {
|
|
4135
4256
|
if (column.accessor) {
|
|
4136
4257
|
return column.accessor(row);
|
|
@@ -4159,7 +4280,7 @@ function DataGrid({
|
|
|
4159
4280
|
data,
|
|
4160
4281
|
getCellValue: getCellValue2
|
|
4161
4282
|
});
|
|
4162
|
-
const processedData =
|
|
4283
|
+
const processedData = React34.useMemo(() => {
|
|
4163
4284
|
let result = data;
|
|
4164
4285
|
if (enableInternalFiltering && !isControlled.filters && state.filters.length > 0) {
|
|
4165
4286
|
result = applyFilters(result, state.filters, visibleColumns);
|
|
@@ -4187,7 +4308,7 @@ function DataGrid({
|
|
|
4187
4308
|
onColumnResizeEnd
|
|
4188
4309
|
});
|
|
4189
4310
|
const shouldVirtualize = virtualized ?? processedData.length > 100;
|
|
4190
|
-
|
|
4311
|
+
React34.useLayoutEffect(() => {
|
|
4191
4312
|
if (headerRef.current && shouldVirtualize) {
|
|
4192
4313
|
setHeaderHeight(headerRef.current.offsetHeight);
|
|
4193
4314
|
}
|
|
@@ -4199,13 +4320,13 @@ function DataGrid({
|
|
|
4199
4320
|
overscan: DEFAULT_OVERSCAN,
|
|
4200
4321
|
enabled: shouldVirtualize
|
|
4201
4322
|
});
|
|
4202
|
-
const tableWidth =
|
|
4323
|
+
const tableWidth = React34.useMemo(() => {
|
|
4203
4324
|
return visibleColumns.reduce((acc, col) => {
|
|
4204
4325
|
const width = state.columnWidths[col.key] || col.width || estimateColumnWidth(col);
|
|
4205
4326
|
return acc + width;
|
|
4206
4327
|
}, 0);
|
|
4207
4328
|
}, [visibleColumns, state.columnWidths]);
|
|
4208
|
-
const visibleRowCount =
|
|
4329
|
+
const visibleRowCount = React34.useMemo(() => {
|
|
4209
4330
|
if (!parentRef.current) return 10;
|
|
4210
4331
|
return Math.floor(parentRef.current.clientHeight / DEFAULT_ROW_HEIGHT);
|
|
4211
4332
|
}, []);
|
|
@@ -4224,7 +4345,7 @@ function DataGrid({
|
|
|
4224
4345
|
rowVirtualizer.scrollToIndex(rowIndex, { align: "auto" });
|
|
4225
4346
|
}
|
|
4226
4347
|
});
|
|
4227
|
-
const handleBlur =
|
|
4348
|
+
const handleBlur = React34.useCallback(
|
|
4228
4349
|
(event) => {
|
|
4229
4350
|
const target = event.target;
|
|
4230
4351
|
const relatedTarget = event.relatedTarget;
|
|
@@ -4282,7 +4403,7 @@ function DataGrid({
|
|
|
4282
4403
|
},
|
|
4283
4404
|
[state.editingCell, actions]
|
|
4284
4405
|
);
|
|
4285
|
-
|
|
4406
|
+
React34.useEffect(() => {
|
|
4286
4407
|
if (!infiniteScroll || !hasMore || loadingMore || !parentRef.current) return;
|
|
4287
4408
|
const observer = new IntersectionObserver(
|
|
4288
4409
|
(entries) => {
|
|
@@ -4726,7 +4847,7 @@ function DataGrid({
|
|
|
4726
4847
|
);
|
|
4727
4848
|
}
|
|
4728
4849
|
function PaginationFooter({ pagination }) {
|
|
4729
|
-
const [goToPage, setGoToPage] =
|
|
4850
|
+
const [goToPage, setGoToPage] = React34.useState("");
|
|
4730
4851
|
const handleGoToPage = () => {
|
|
4731
4852
|
const page = parseInt(goToPage, 10);
|
|
4732
4853
|
if (!isNaN(page) && page >= 1 && page <= pagination.totalPages) {
|
|
@@ -4844,21 +4965,21 @@ function Autocomplete({
|
|
|
4844
4965
|
className,
|
|
4845
4966
|
clearable = false
|
|
4846
4967
|
}) {
|
|
4847
|
-
const [open, setOpen] =
|
|
4848
|
-
const [search, setSearch] =
|
|
4849
|
-
const inputRef =
|
|
4850
|
-
const selectedOption =
|
|
4968
|
+
const [open, setOpen] = React34.useState(false);
|
|
4969
|
+
const [search, setSearch] = React34.useState("");
|
|
4970
|
+
const inputRef = React34.useRef(null);
|
|
4971
|
+
const selectedOption = React34.useMemo(
|
|
4851
4972
|
() => options.find((opt) => opt.value === value),
|
|
4852
4973
|
[options, value]
|
|
4853
4974
|
);
|
|
4854
|
-
const filteredOptions =
|
|
4975
|
+
const filteredOptions = React34.useMemo(() => {
|
|
4855
4976
|
if (!search.trim()) return options;
|
|
4856
4977
|
const searchLower = search.toLowerCase();
|
|
4857
4978
|
return options.filter(
|
|
4858
4979
|
(opt) => opt.label.toLowerCase().includes(searchLower) || opt.description?.toLowerCase().includes(searchLower)
|
|
4859
4980
|
);
|
|
4860
4981
|
}, [options, search]);
|
|
4861
|
-
const groupedOptions =
|
|
4982
|
+
const groupedOptions = React34.useMemo(() => {
|
|
4862
4983
|
const groups = {};
|
|
4863
4984
|
const ungrouped = [];
|
|
4864
4985
|
filteredOptions.forEach((opt) => {
|
|
@@ -4872,7 +4993,7 @@ function Autocomplete({
|
|
|
4872
4993
|
return { groups, ungrouped };
|
|
4873
4994
|
}, [filteredOptions]);
|
|
4874
4995
|
const hasGroups = Object.keys(groupedOptions.groups).length > 0;
|
|
4875
|
-
const handleSelect =
|
|
4996
|
+
const handleSelect = React34.useCallback(
|
|
4876
4997
|
(optionValue) => {
|
|
4877
4998
|
onChange?.(optionValue);
|
|
4878
4999
|
setOpen(false);
|
|
@@ -4880,7 +5001,7 @@ function Autocomplete({
|
|
|
4880
5001
|
},
|
|
4881
5002
|
[onChange]
|
|
4882
5003
|
);
|
|
4883
|
-
const handleClear =
|
|
5004
|
+
const handleClear = React34.useCallback(
|
|
4884
5005
|
(e) => {
|
|
4885
5006
|
e.stopPropagation();
|
|
4886
5007
|
onChange?.(void 0);
|
|
@@ -4888,7 +5009,7 @@ function Autocomplete({
|
|
|
4888
5009
|
},
|
|
4889
5010
|
[onChange]
|
|
4890
5011
|
);
|
|
4891
|
-
|
|
5012
|
+
React34.useEffect(() => {
|
|
4892
5013
|
if (open) {
|
|
4893
5014
|
const timeout = setTimeout(() => {
|
|
4894
5015
|
inputRef.current?.focus();
|
|
@@ -4898,7 +5019,7 @@ function Autocomplete({
|
|
|
4898
5019
|
setSearch("");
|
|
4899
5020
|
}
|
|
4900
5021
|
}, [open]);
|
|
4901
|
-
const handleKeyDown =
|
|
5022
|
+
const handleKeyDown = React34.useCallback((e) => {
|
|
4902
5023
|
if (e.key === "Escape") {
|
|
4903
5024
|
setOpen(false);
|
|
4904
5025
|
}
|
|
@@ -5074,7 +5195,7 @@ var iconButtonVariants = cva(
|
|
|
5074
5195
|
}
|
|
5075
5196
|
}
|
|
5076
5197
|
);
|
|
5077
|
-
var IconButton =
|
|
5198
|
+
var IconButton = React34.forwardRef(
|
|
5078
5199
|
({ className, variant, size, isActive = false, icon, children, ...props }, ref) => {
|
|
5079
5200
|
return /* @__PURE__ */ jsx(
|
|
5080
5201
|
"button",
|
|
@@ -5098,7 +5219,7 @@ var IconButton = React33.forwardRef(
|
|
|
5098
5219
|
);
|
|
5099
5220
|
IconButton.displayName = "IconButton";
|
|
5100
5221
|
function CopyButton({ content, className, size = "md" }) {
|
|
5101
|
-
const [copied, setCopied] =
|
|
5222
|
+
const [copied, setCopied] = React34.useState(false);
|
|
5102
5223
|
const handleCopy = async () => {
|
|
5103
5224
|
try {
|
|
5104
5225
|
await navigator.clipboard.writeText(content);
|
|
@@ -5871,11 +5992,11 @@ function ThemePicker({
|
|
|
5871
5992
|
align = "end",
|
|
5872
5993
|
side = "bottom"
|
|
5873
5994
|
}) {
|
|
5874
|
-
const [open, setOpen] =
|
|
5875
|
-
const [selectedTheme, setSelectedTheme] =
|
|
5995
|
+
const [open, setOpen] = React34.useState(false);
|
|
5996
|
+
const [selectedTheme, setSelectedTheme] = React34.useState(
|
|
5876
5997
|
value || themes[0]
|
|
5877
5998
|
);
|
|
5878
|
-
|
|
5999
|
+
React34.useEffect(() => {
|
|
5879
6000
|
if (value) {
|
|
5880
6001
|
setSelectedTheme(value);
|
|
5881
6002
|
}
|
|
@@ -5985,19 +6106,19 @@ function getSafePosition(x, y, menuWidth, menuHeight) {
|
|
|
5985
6106
|
return { x: safeX, y: safeY };
|
|
5986
6107
|
}
|
|
5987
6108
|
function MenuItem({ item, onClose, depth = 0 }) {
|
|
5988
|
-
const [isSubmenuOpen, setIsSubmenuOpen] =
|
|
5989
|
-
const [submenuPosition, setSubmenuPosition] =
|
|
5990
|
-
const itemRef =
|
|
5991
|
-
const hoverTimeoutRef =
|
|
6109
|
+
const [isSubmenuOpen, setIsSubmenuOpen] = React34.useState(false);
|
|
6110
|
+
const [submenuPosition, setSubmenuPosition] = React34.useState(null);
|
|
6111
|
+
const itemRef = React34.useRef(null);
|
|
6112
|
+
const hoverTimeoutRef = React34.useRef(null);
|
|
5992
6113
|
const hasSubmenu = item.submenu && item.submenu.length > 0;
|
|
5993
|
-
|
|
6114
|
+
React34.useEffect(() => {
|
|
5994
6115
|
return () => {
|
|
5995
6116
|
if (hoverTimeoutRef.current) {
|
|
5996
6117
|
clearTimeout(hoverTimeoutRef.current);
|
|
5997
6118
|
}
|
|
5998
6119
|
};
|
|
5999
6120
|
}, []);
|
|
6000
|
-
const handleMouseEnter =
|
|
6121
|
+
const handleMouseEnter = React34.useCallback(() => {
|
|
6001
6122
|
if (hoverTimeoutRef.current) {
|
|
6002
6123
|
clearTimeout(hoverTimeoutRef.current);
|
|
6003
6124
|
}
|
|
@@ -6017,22 +6138,22 @@ function MenuItem({ item, onClose, depth = 0 }) {
|
|
|
6017
6138
|
setIsSubmenuOpen(true);
|
|
6018
6139
|
}
|
|
6019
6140
|
}, [hasSubmenu, item.submenu?.length]);
|
|
6020
|
-
const handleMouseLeave =
|
|
6141
|
+
const handleMouseLeave = React34.useCallback(() => {
|
|
6021
6142
|
hoverTimeoutRef.current = setTimeout(() => {
|
|
6022
6143
|
setIsSubmenuOpen(false);
|
|
6023
6144
|
}, 100);
|
|
6024
6145
|
}, []);
|
|
6025
|
-
const handleSubmenuMouseEnter =
|
|
6146
|
+
const handleSubmenuMouseEnter = React34.useCallback(() => {
|
|
6026
6147
|
if (hoverTimeoutRef.current) {
|
|
6027
6148
|
clearTimeout(hoverTimeoutRef.current);
|
|
6028
6149
|
}
|
|
6029
6150
|
}, []);
|
|
6030
|
-
const handleSubmenuMouseLeave =
|
|
6151
|
+
const handleSubmenuMouseLeave = React34.useCallback(() => {
|
|
6031
6152
|
hoverTimeoutRef.current = setTimeout(() => {
|
|
6032
6153
|
setIsSubmenuOpen(false);
|
|
6033
6154
|
}, 100);
|
|
6034
6155
|
}, []);
|
|
6035
|
-
const handleClick =
|
|
6156
|
+
const handleClick = React34.useCallback(() => {
|
|
6036
6157
|
if (item.disabled) return;
|
|
6037
6158
|
if (!hasSubmenu && item.action) {
|
|
6038
6159
|
item.action();
|
|
@@ -6112,12 +6233,12 @@ function ContextMenu({
|
|
|
6112
6233
|
anchorEl,
|
|
6113
6234
|
className
|
|
6114
6235
|
}) {
|
|
6115
|
-
const menuRef =
|
|
6116
|
-
const [menuPosition, setMenuPosition] =
|
|
6236
|
+
const menuRef = React34.useRef(null);
|
|
6237
|
+
const [menuPosition, setMenuPosition] = React34.useState({
|
|
6117
6238
|
x: 0,
|
|
6118
6239
|
y: 0
|
|
6119
6240
|
});
|
|
6120
|
-
|
|
6241
|
+
React34.useEffect(() => {
|
|
6121
6242
|
if (!isOpen) return;
|
|
6122
6243
|
let x = position.x;
|
|
6123
6244
|
let y = position.y;
|
|
@@ -6136,7 +6257,7 @@ function ContextMenu({
|
|
|
6136
6257
|
}
|
|
6137
6258
|
});
|
|
6138
6259
|
}, [isOpen, position, anchorEl]);
|
|
6139
|
-
|
|
6260
|
+
React34.useEffect(() => {
|
|
6140
6261
|
if (!isOpen) return;
|
|
6141
6262
|
const handleClickOutside = (e) => {
|
|
6142
6263
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
@@ -6180,16 +6301,16 @@ function ContextMenu({
|
|
|
6180
6301
|
);
|
|
6181
6302
|
}
|
|
6182
6303
|
function useContextMenu() {
|
|
6183
|
-
const [isOpen, setIsOpen] =
|
|
6184
|
-
const [position, setPosition] =
|
|
6185
|
-
const [targetItem, setTargetItem] =
|
|
6186
|
-
const menuRef =
|
|
6187
|
-
const openMenu =
|
|
6304
|
+
const [isOpen, setIsOpen] = React34.useState(false);
|
|
6305
|
+
const [position, setPosition] = React34.useState({ x: 0, y: 0 });
|
|
6306
|
+
const [targetItem, setTargetItem] = React34.useState(null);
|
|
6307
|
+
const menuRef = React34.useRef(null);
|
|
6308
|
+
const openMenu = React34.useCallback((x, y, item) => {
|
|
6188
6309
|
setPosition({ x, y });
|
|
6189
6310
|
setTargetItem(item);
|
|
6190
6311
|
setIsOpen(true);
|
|
6191
6312
|
}, []);
|
|
6192
|
-
const closeMenu =
|
|
6313
|
+
const closeMenu = React34.useCallback(() => {
|
|
6193
6314
|
setIsOpen(false);
|
|
6194
6315
|
setTargetItem(null);
|
|
6195
6316
|
}, []);
|
|
@@ -6203,6 +6324,6 @@ function useContextMenu() {
|
|
|
6203
6324
|
};
|
|
6204
6325
|
}
|
|
6205
6326
|
|
|
6206
|
-
export { ALL_THEMES, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Autocomplete, Badge, Button, CYBERPUNK_THEME, Calendar, Card, CardActions, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardImage, CardList, CardTitle, CellEditor, Checkbox, Chip, ConfirmationModal, ContextMenu, CopyButton, DARK_ELEGANT_THEME, DataGrid, DatePicker, DatePickerInput, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FOREST_THEME, FUTURISTIC_THEME, FilterPopover, GREEN_THEME, HeaderCell, IconButton, Input, Label, LoadingSpinner, MINIMALIST_LIGHT_THEME, Modal, ModalButton, NATURE_THEME, OCEAN_THEME, OPTILOGIC_LEGACY_THEME, PRESET_THEMES, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ResizablePanel, ResizeHandle, SCIFI_THEME, SUNSET_THEME, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableCard, Separator, Skeleton, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemePicker, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, accordionContentVariants, accordionItemVariants, accordionTriggerVariants, applyFilterOperator, applyFilters, applySorting, applyTheme, areThemesEqual, badgeVariants, buttonVariants, cardActionsVariants, cardGridVariants, cardImageVariants, cardListVariants, cardVariants, cloneTheme, cn, exportTheme, getCellValue, getCurrentTheme, getDefaultTheme, getPresetTheme, hexToHsl, iconButtonVariants, importTheme, isPresetTheme, labelVariants, loadingSpinnerVariants, themeToHsl, useColumnResize, useColumnResizeManager, useConfirmation, useContextMenu, useDataGridState, useKeyboardNavigation, validateTheme };
|
|
6327
|
+
export { ALL_THEMES, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Autocomplete, Badge, Board, BoardContent, BoardHeader, Button, CYBERPUNK_THEME, Calendar, Card, CardActions, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardImage, CardList, CardTitle, CellEditor, Checkbox, Chip, ConfirmationModal, ContextMenu, CopyButton, DARK_ELEGANT_THEME, DataGrid, DatePicker, DatePickerInput, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FOREST_THEME, FUTURISTIC_THEME, FilterPopover, GREEN_THEME, HeaderCell, IconButton, Input, Label, LoadingSpinner, MINIMALIST_LIGHT_THEME, Modal, ModalButton, NATURE_THEME, OCEAN_THEME, OPTILOGIC_LEGACY_THEME, PRESET_THEMES, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ResizablePanel, ResizeHandle, SCIFI_THEME, SUNSET_THEME, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableCard, Separator, Skeleton, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemePicker, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, accordionContentVariants, accordionItemVariants, accordionTriggerVariants, applyFilterOperator, applyFilters, applySorting, applyTheme, areThemesEqual, badgeVariants, boardVariants, buttonVariants, cardActionsVariants, cardGridVariants, cardImageVariants, cardListVariants, cardVariants, cloneTheme, cn, exportTheme, getCellValue, getCurrentTheme, getDefaultTheme, getPresetTheme, hexToHsl, iconButtonVariants, importTheme, isPresetTheme, labelVariants, loadingSpinnerVariants, themeToHsl, useColumnResize, useColumnResizeManager, useConfirmation, useContextMenu, useDataGridState, useKeyboardNavigation, validateTheme };
|
|
6207
6328
|
//# sourceMappingURL=index.js.map
|
|
6208
6329
|
//# sourceMappingURL=index.js.map
|