@ikatec/nebula-react 1.4.1-beta.1 → 1.4.1-beta.3
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/ikatec-nebula-react-1.4.1-beta.3.tgz +0 -0
- package/dist/index.js +454 -317
- package/dist/index.mjs +310 -173
- package/package.json +1 -1
- package/dist/ikatec-nebula-react-1.4.1-beta.1.tgz +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React31 from 'react';
|
|
2
|
+
import React31__default, { createContext, forwardRef, useMemo, useState, useEffect, useCallback, useContext, useRef, useId } from 'react';
|
|
3
3
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
@@ -29,7 +29,7 @@ import { ptBR, enUS, es } from 'react-day-picker/locale';
|
|
|
29
29
|
import { useMask } from '@react-input/mask';
|
|
30
30
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
31
31
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
32
|
-
import { defaultDropAnimationSideEffects, MeasuringStrategy, useSensors, useSensor, PointerSensor, TouchSensor, KeyboardSensor, DndContext, DragOverlay
|
|
32
|
+
import { defaultDropAnimationSideEffects, MeasuringStrategy, useDndContext, useDroppable, useSensors, useSensor, PointerSensor, TouchSensor, KeyboardSensor, pointerWithin, rectIntersection, DndContext, DragOverlay } from '@dnd-kit/core';
|
|
33
33
|
import { SortableContext, verticalListSortingStrategy, useSortable, defaultAnimateLayoutChanges, sortableKeyboardCoordinates, arrayMove, horizontalListSortingStrategy } from '@dnd-kit/sortable';
|
|
34
34
|
import { CSS } from '@dnd-kit/utilities';
|
|
35
35
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
@@ -78,11 +78,11 @@ function cn(...inputs) {
|
|
|
78
78
|
return customTwMerge(nebulaClass, clsx(inputs));
|
|
79
79
|
}
|
|
80
80
|
var processChildren = (children) => {
|
|
81
|
-
return
|
|
81
|
+
return React31__default.Children.map(children, (child) => {
|
|
82
82
|
if (typeof child === "string") {
|
|
83
83
|
return /* @__PURE__ */ jsx("span", { className: "nebula-ds px-2", children: child });
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
85
|
+
if (React31__default.isValidElement(child) && child.type === React31__default.Fragment) {
|
|
86
86
|
return processChildren(child.props.children);
|
|
87
87
|
}
|
|
88
88
|
return child;
|
|
@@ -174,7 +174,7 @@ var buttonVariantsConfig = cva(
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
|
-
var Button =
|
|
177
|
+
var Button = React31.forwardRef(
|
|
178
178
|
({
|
|
179
179
|
className,
|
|
180
180
|
variant: variant3,
|
|
@@ -239,7 +239,7 @@ var badgeVariantsConfig = cva(
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
);
|
|
242
|
-
var Badge =
|
|
242
|
+
var Badge = React31.forwardRef(
|
|
243
243
|
({ className, variant: variant3, size: size4, ...props }, ref) => {
|
|
244
244
|
return /* @__PURE__ */ jsx(
|
|
245
245
|
"div",
|
|
@@ -323,7 +323,7 @@ var alertVariantsConfig = cva(
|
|
|
323
323
|
}
|
|
324
324
|
);
|
|
325
325
|
var alertVariants = extractVariants(variants);
|
|
326
|
-
var Alert =
|
|
326
|
+
var Alert = React31.forwardRef(
|
|
327
327
|
({ className, variant: variant3, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
328
328
|
"div",
|
|
329
329
|
{
|
|
@@ -335,7 +335,7 @@ var Alert = React35.forwardRef(
|
|
|
335
335
|
)
|
|
336
336
|
);
|
|
337
337
|
Alert.displayName = "Alert";
|
|
338
|
-
var AlertTitle =
|
|
338
|
+
var AlertTitle = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
339
339
|
"h5",
|
|
340
340
|
{
|
|
341
341
|
ref,
|
|
@@ -344,7 +344,7 @@ var AlertTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
344
344
|
}
|
|
345
345
|
));
|
|
346
346
|
AlertTitle.displayName = "AlertTitle";
|
|
347
|
-
var AlertDescription =
|
|
347
|
+
var AlertDescription = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
348
348
|
"div",
|
|
349
349
|
{
|
|
350
350
|
ref,
|
|
@@ -353,7 +353,7 @@ var AlertDescription = React35.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
353
353
|
}
|
|
354
354
|
));
|
|
355
355
|
AlertDescription.displayName = "AlertDescription";
|
|
356
|
-
var AlertButton =
|
|
356
|
+
var AlertButton = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
357
357
|
"button",
|
|
358
358
|
{
|
|
359
359
|
ref,
|
|
@@ -364,9 +364,9 @@ var AlertButton = React35.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
364
364
|
AlertButton.displayName = "AlertButton";
|
|
365
365
|
var Popover = PopoverPrimitive.Root;
|
|
366
366
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
367
|
-
var PopoverContent =
|
|
367
|
+
var PopoverContent = React31.forwardRef(
|
|
368
368
|
({ className, align = "center", sideOffset = 4, portal = false, ...props }, ref) => {
|
|
369
|
-
const Comp = portal ? PopoverPrimitive.Portal :
|
|
369
|
+
const Comp = portal ? PopoverPrimitive.Portal : React31.Fragment;
|
|
370
370
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsx(
|
|
371
371
|
PopoverPrimitive.Content,
|
|
372
372
|
{
|
|
@@ -394,7 +394,7 @@ var PopoverContent = React35.forwardRef(
|
|
|
394
394
|
}
|
|
395
395
|
);
|
|
396
396
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
397
|
-
var Label =
|
|
397
|
+
var Label = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
398
398
|
LabelPrimitive.Root,
|
|
399
399
|
{
|
|
400
400
|
ref,
|
|
@@ -406,7 +406,7 @@ var Label = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
406
406
|
}
|
|
407
407
|
));
|
|
408
408
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
409
|
-
var Table =
|
|
409
|
+
var Table = React31.forwardRef(({ className, noCardWrapper = false, ...props }, ref) => {
|
|
410
410
|
if (noCardWrapper) {
|
|
411
411
|
return /* @__PURE__ */ jsx(
|
|
412
412
|
"table",
|
|
@@ -427,9 +427,9 @@ var Table = React35.forwardRef(({ className, noCardWrapper = false, ...props },
|
|
|
427
427
|
) });
|
|
428
428
|
});
|
|
429
429
|
Table.displayName = "Table";
|
|
430
|
-
var TableHeader =
|
|
430
|
+
var TableHeader = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
431
431
|
TableHeader.displayName = "TableHeader";
|
|
432
|
-
var TableBody =
|
|
432
|
+
var TableBody = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
433
433
|
"tbody",
|
|
434
434
|
{
|
|
435
435
|
ref,
|
|
@@ -438,7 +438,7 @@ var TableBody = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
438
438
|
}
|
|
439
439
|
));
|
|
440
440
|
TableBody.displayName = "TableBody";
|
|
441
|
-
var TableFooter =
|
|
441
|
+
var TableFooter = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
442
442
|
"tfoot",
|
|
443
443
|
{
|
|
444
444
|
ref,
|
|
@@ -469,7 +469,7 @@ var tableRowVariantsConfig = cva(
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
);
|
|
472
|
-
var TableRow =
|
|
472
|
+
var TableRow = React31.forwardRef(
|
|
473
473
|
({ className, variant: variant3 = "first", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
474
474
|
"tr",
|
|
475
475
|
{
|
|
@@ -480,7 +480,7 @@ var TableRow = React35.forwardRef(
|
|
|
480
480
|
)
|
|
481
481
|
);
|
|
482
482
|
TableRow.displayName = "TableRow";
|
|
483
|
-
var TableHead =
|
|
483
|
+
var TableHead = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
484
484
|
"th",
|
|
485
485
|
{
|
|
486
486
|
ref,
|
|
@@ -492,7 +492,7 @@ var TableHead = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
492
492
|
}
|
|
493
493
|
));
|
|
494
494
|
TableHead.displayName = "TableHead";
|
|
495
|
-
var TableCell =
|
|
495
|
+
var TableCell = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
496
496
|
"td",
|
|
497
497
|
{
|
|
498
498
|
ref,
|
|
@@ -504,14 +504,14 @@ var TableCell = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
504
504
|
}
|
|
505
505
|
));
|
|
506
506
|
TableCell.displayName = "TableCell";
|
|
507
|
-
var TableCaption =
|
|
507
|
+
var TableCaption = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 text-sm", className), ...props }));
|
|
508
508
|
TableCaption.displayName = "TableCaption";
|
|
509
509
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
510
510
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
511
511
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
512
512
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
513
513
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
514
|
-
var DropdownMenuSubTrigger =
|
|
514
|
+
var DropdownMenuSubTrigger = React31.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
515
515
|
DropdownMenuPrimitive.SubTrigger,
|
|
516
516
|
{
|
|
517
517
|
ref,
|
|
@@ -543,8 +543,8 @@ var DropdownMenuSubTrigger = React35.forwardRef(({ className, inset, children, .
|
|
|
543
543
|
}
|
|
544
544
|
));
|
|
545
545
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
546
|
-
var DropdownMenuSubContent =
|
|
547
|
-
const Comp = portal ? DropdownMenuPrimitive.Portal :
|
|
546
|
+
var DropdownMenuSubContent = React31.forwardRef(({ className, portal = false, ...props }, ref) => {
|
|
547
|
+
const Comp = portal ? DropdownMenuPrimitive.Portal : React31.Fragment;
|
|
548
548
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsx(
|
|
549
549
|
DropdownMenuPrimitive.SubContent,
|
|
550
550
|
{
|
|
@@ -569,8 +569,8 @@ var DropdownMenuSubContent = React35.forwardRef(({ className, portal = false, ..
|
|
|
569
569
|
) });
|
|
570
570
|
});
|
|
571
571
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
572
|
-
var DropdownMenuContent =
|
|
573
|
-
const Comp = portal ? DropdownMenuPrimitive.Portal :
|
|
572
|
+
var DropdownMenuContent = React31.forwardRef(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
573
|
+
const Comp = portal ? DropdownMenuPrimitive.Portal : React31.Fragment;
|
|
574
574
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsx(
|
|
575
575
|
DropdownMenuPrimitive.Content,
|
|
576
576
|
{
|
|
@@ -598,7 +598,7 @@ var DropdownMenuContent = React35.forwardRef(({ className, sideOffset = 4, porta
|
|
|
598
598
|
) });
|
|
599
599
|
});
|
|
600
600
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
601
|
-
var DropdownMenuItem =
|
|
601
|
+
var DropdownMenuItem = React31.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
602
602
|
DropdownMenuPrimitive.Item,
|
|
603
603
|
{
|
|
604
604
|
ref,
|
|
@@ -631,7 +631,7 @@ var DropdownMenuItem = React35.forwardRef(({ className, inset, ...props }, ref)
|
|
|
631
631
|
}
|
|
632
632
|
));
|
|
633
633
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
634
|
-
var DropdownMenuCheckboxItem =
|
|
634
|
+
var DropdownMenuCheckboxItem = React31.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
635
635
|
DropdownMenuPrimitive.CheckboxItem,
|
|
636
636
|
{
|
|
637
637
|
ref,
|
|
@@ -669,7 +669,7 @@ var DropdownMenuCheckboxItem = React35.forwardRef(({ className, children, checke
|
|
|
669
669
|
}
|
|
670
670
|
));
|
|
671
671
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
672
|
-
var DropdownMenuRadioItem =
|
|
672
|
+
var DropdownMenuRadioItem = React31.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
673
673
|
DropdownMenuPrimitive.RadioItem,
|
|
674
674
|
{
|
|
675
675
|
ref,
|
|
@@ -705,7 +705,7 @@ var DropdownMenuRadioItem = React35.forwardRef(({ className, children, ...props
|
|
|
705
705
|
}
|
|
706
706
|
));
|
|
707
707
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
708
|
-
var DropdownMenuLabel =
|
|
708
|
+
var DropdownMenuLabel = React31.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
709
709
|
DropdownMenuPrimitive.Label,
|
|
710
710
|
{
|
|
711
711
|
ref,
|
|
@@ -725,7 +725,7 @@ var DropdownMenuLabel = React35.forwardRef(({ className, inset, ...props }, ref)
|
|
|
725
725
|
}
|
|
726
726
|
));
|
|
727
727
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
728
|
-
var DropdownMenuSeparator =
|
|
728
|
+
var DropdownMenuSeparator = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
729
729
|
DropdownMenuPrimitive.Separator,
|
|
730
730
|
{
|
|
731
731
|
ref,
|
|
@@ -775,7 +775,7 @@ var separatorVariantsConfig = cva("shrink-0 bg-separator-border-default", {
|
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
777
|
var separatorVariants = extractVariants(variants3);
|
|
778
|
-
var Separator2 =
|
|
778
|
+
var Separator2 = React31.forwardRef(
|
|
779
779
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
|
|
780
780
|
return /* @__PURE__ */ jsx(
|
|
781
781
|
SeparatorPrimitive.Root,
|
|
@@ -824,7 +824,7 @@ var spaceVariantsConfig = cva("flex items-start justify-start", {
|
|
|
824
824
|
direction: "row"
|
|
825
825
|
}
|
|
826
826
|
});
|
|
827
|
-
var Space =
|
|
827
|
+
var Space = React31__default.forwardRef(
|
|
828
828
|
({ size: size4, direction: direction2, className, children }, ref) => {
|
|
829
829
|
return /* @__PURE__ */ jsx(
|
|
830
830
|
"div",
|
|
@@ -2076,7 +2076,7 @@ var tagVariantsConfig = cva("w-2 h-2 block rounded-sm", {
|
|
|
2076
2076
|
color
|
|
2077
2077
|
}
|
|
2078
2078
|
});
|
|
2079
|
-
var Tag =
|
|
2079
|
+
var Tag = React31.forwardRef(
|
|
2080
2080
|
({ className, color: color2, children, onDelete, ...props }, ref) => {
|
|
2081
2081
|
return /* @__PURE__ */ jsxs(
|
|
2082
2082
|
"div",
|
|
@@ -2231,12 +2231,12 @@ var StyledAsyncCreatable = createStyledSelect(
|
|
|
2231
2231
|
AsyncCreatable,
|
|
2232
2232
|
"AsyncCreatable"
|
|
2233
2233
|
);
|
|
2234
|
-
var InputText =
|
|
2234
|
+
var InputText = React31.forwardRef(
|
|
2235
2235
|
({ className, isError = false, onClean, disabled, suffix, ...props }, ref) => {
|
|
2236
2236
|
const icon = "icon" in props ? props.icon : null;
|
|
2237
2237
|
const iconPlacement = "iconPlacement" in props || props.type !== "password" ? props.iconPlacement || "start" : null;
|
|
2238
2238
|
const initialInputType = props.type || "text";
|
|
2239
|
-
const [type, setType] =
|
|
2239
|
+
const [type, setType] = React31.useState(initialInputType);
|
|
2240
2240
|
const iconClass = {
|
|
2241
2241
|
"text-inputText-icon-danger": isError,
|
|
2242
2242
|
"text-inputText-icon-default focus:text-inputText-icon-focus": !isError && !props.value,
|
|
@@ -2344,7 +2344,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
2344
2344
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2345
2345
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2346
2346
|
var DialogClose = DialogPrimitive.Close;
|
|
2347
|
-
var DialogOverlay =
|
|
2347
|
+
var DialogOverlay = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2348
2348
|
DialogPrimitive.Overlay,
|
|
2349
2349
|
{
|
|
2350
2350
|
ref,
|
|
@@ -2363,9 +2363,9 @@ var DialogOverlay = React35.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2363
2363
|
}
|
|
2364
2364
|
));
|
|
2365
2365
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
2366
|
-
var DialogContent =
|
|
2366
|
+
var DialogContent = React31.forwardRef(
|
|
2367
2367
|
({ className, children, portal = false, showClose = true, ...props }, ref) => {
|
|
2368
|
-
const Comp = portal ? DialogPortal :
|
|
2368
|
+
const Comp = portal ? DialogPortal : React31.Fragment;
|
|
2369
2369
|
return /* @__PURE__ */ jsxs(Comp, { children: [
|
|
2370
2370
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
2371
2371
|
/* @__PURE__ */ jsxs(
|
|
@@ -2444,7 +2444,7 @@ var DialogFooter = ({
|
|
|
2444
2444
|
...props
|
|
2445
2445
|
}) => /* @__PURE__ */ jsx("div", { className: cn("flex gap-2", className), ...props });
|
|
2446
2446
|
DialogFooter.displayName = "DialogFooter";
|
|
2447
|
-
var DialogTitle =
|
|
2447
|
+
var DialogTitle = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2448
2448
|
DialogPrimitive.Title,
|
|
2449
2449
|
{
|
|
2450
2450
|
ref,
|
|
@@ -2456,7 +2456,7 @@ var DialogTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2456
2456
|
}
|
|
2457
2457
|
));
|
|
2458
2458
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2459
|
-
var DialogDescription =
|
|
2459
|
+
var DialogDescription = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2460
2460
|
DialogPrimitive.Description,
|
|
2461
2461
|
{
|
|
2462
2462
|
ref,
|
|
@@ -2468,7 +2468,7 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
2468
2468
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
2469
2469
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
2470
2470
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2471
|
-
var AlertDialogOverlay =
|
|
2471
|
+
var AlertDialogOverlay = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2472
2472
|
AlertDialogPrimitive.Overlay,
|
|
2473
2473
|
{
|
|
2474
2474
|
className: cn(
|
|
@@ -2480,8 +2480,8 @@ var AlertDialogOverlay = React35.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2480
2480
|
}
|
|
2481
2481
|
));
|
|
2482
2482
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
2483
|
-
var AlertDialogContent =
|
|
2484
|
-
const Comp = portal ? AlertDialogPortal :
|
|
2483
|
+
var AlertDialogContent = React31.forwardRef(({ className, portal = false, ...props }, ref) => {
|
|
2484
|
+
const Comp = portal ? AlertDialogPortal : React31.Fragment;
|
|
2485
2485
|
return /* @__PURE__ */ jsxs(Comp, { children: [
|
|
2486
2486
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
2487
2487
|
/* @__PURE__ */ jsx(
|
|
@@ -2517,7 +2517,7 @@ var AlertDialogFooter = ({
|
|
|
2517
2517
|
...props
|
|
2518
2518
|
}) => /* @__PURE__ */ jsx("div", { className: cn("flex gap-2", className), ...props });
|
|
2519
2519
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
2520
|
-
var AlertDialogTitle =
|
|
2520
|
+
var AlertDialogTitle = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2521
2521
|
AlertDialogPrimitive.Title,
|
|
2522
2522
|
{
|
|
2523
2523
|
ref,
|
|
@@ -2529,7 +2529,7 @@ var AlertDialogTitle = React35.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2529
2529
|
}
|
|
2530
2530
|
));
|
|
2531
2531
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
2532
|
-
var AlertDialogDescription =
|
|
2532
|
+
var AlertDialogDescription = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2533
2533
|
AlertDialogPrimitive.Description,
|
|
2534
2534
|
{
|
|
2535
2535
|
ref,
|
|
@@ -2538,7 +2538,7 @@ var AlertDialogDescription = React35.forwardRef(({ className, ...props }, ref) =
|
|
|
2538
2538
|
}
|
|
2539
2539
|
));
|
|
2540
2540
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
2541
|
-
var AlertDialogAction =
|
|
2541
|
+
var AlertDialogAction = React31.forwardRef(({ children, className, variant: variant3, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2542
2542
|
AlertDialogPrimitive.Action,
|
|
2543
2543
|
{
|
|
2544
2544
|
ref,
|
|
@@ -2548,7 +2548,7 @@ var AlertDialogAction = React35.forwardRef(({ children, className, variant: vari
|
|
|
2548
2548
|
}
|
|
2549
2549
|
));
|
|
2550
2550
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
2551
|
-
var AlertDialogCancel =
|
|
2551
|
+
var AlertDialogCancel = React31.forwardRef(({ children, className, variant: variant3 = "secondary", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2552
2552
|
AlertDialogPrimitive.Cancel,
|
|
2553
2553
|
{
|
|
2554
2554
|
ref,
|
|
@@ -2558,7 +2558,7 @@ var AlertDialogCancel = React35.forwardRef(({ children, className, variant: vari
|
|
|
2558
2558
|
}
|
|
2559
2559
|
));
|
|
2560
2560
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
2561
|
-
var Checkbox =
|
|
2561
|
+
var Checkbox = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "nebula-ds relative", children: /* @__PURE__ */ jsx("div", { className: "nebula-ds relative", children: /* @__PURE__ */ jsx(
|
|
2562
2562
|
CheckboxPrimitive.Root,
|
|
2563
2563
|
{
|
|
2564
2564
|
ref,
|
|
@@ -2613,7 +2613,7 @@ var Drawer = DialogPrimitive.Root;
|
|
|
2613
2613
|
var DrawerTrigger = DialogPrimitive.Trigger;
|
|
2614
2614
|
var DrawerClose = DialogPrimitive.Close;
|
|
2615
2615
|
var DrawerPortal = DialogPrimitive.Portal;
|
|
2616
|
-
var DrawerOverlay =
|
|
2616
|
+
var DrawerOverlay = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2617
2617
|
DialogPrimitive.Overlay,
|
|
2618
2618
|
{
|
|
2619
2619
|
className: cn(
|
|
@@ -2638,8 +2638,8 @@ var DrawerVariants = cva("fixed flex flex-col z-50 shadow-lg", {
|
|
|
2638
2638
|
side: "right"
|
|
2639
2639
|
}
|
|
2640
2640
|
});
|
|
2641
|
-
var DrawerContent =
|
|
2642
|
-
const Comp = portal ? DrawerPortal :
|
|
2641
|
+
var DrawerContent = React31.forwardRef(({ side = "right", className, portal = false, children, ...props }, ref) => {
|
|
2642
|
+
const Comp = portal ? DrawerPortal : React31.Fragment;
|
|
2643
2643
|
return /* @__PURE__ */ jsxs(Comp, { children: [
|
|
2644
2644
|
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
2645
2645
|
/* @__PURE__ */ jsx(
|
|
@@ -2705,7 +2705,7 @@ var DrawerFooter = ({
|
|
|
2705
2705
|
}
|
|
2706
2706
|
);
|
|
2707
2707
|
DrawerFooter.displayName = "DrawerFooter";
|
|
2708
|
-
var DrawerTitle =
|
|
2708
|
+
var DrawerTitle = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2709
2709
|
DialogPrimitive.Title,
|
|
2710
2710
|
{
|
|
2711
2711
|
ref,
|
|
@@ -2717,7 +2717,7 @@ var DrawerTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2717
2717
|
}
|
|
2718
2718
|
));
|
|
2719
2719
|
DrawerTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2720
|
-
var DrawerDescription =
|
|
2720
|
+
var DrawerDescription = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2721
2721
|
DialogPrimitive.Description,
|
|
2722
2722
|
{
|
|
2723
2723
|
ref,
|
|
@@ -2726,9 +2726,9 @@ var DrawerDescription = React35.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2726
2726
|
}
|
|
2727
2727
|
));
|
|
2728
2728
|
DrawerDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2729
|
-
var Breadcrumb =
|
|
2729
|
+
var Breadcrumb = React31.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
2730
2730
|
Breadcrumb.displayName = "Breadcrumb";
|
|
2731
|
-
var BreadcrumbList =
|
|
2731
|
+
var BreadcrumbList = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2732
2732
|
"ol",
|
|
2733
2733
|
{
|
|
2734
2734
|
ref,
|
|
@@ -2740,7 +2740,7 @@ var BreadcrumbList = React35.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
2740
2740
|
}
|
|
2741
2741
|
));
|
|
2742
2742
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
2743
|
-
var BreadcrumbItem =
|
|
2743
|
+
var BreadcrumbItem = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2744
2744
|
"li",
|
|
2745
2745
|
{
|
|
2746
2746
|
ref,
|
|
@@ -2752,7 +2752,7 @@ var BreadcrumbItem = React35.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
2752
2752
|
}
|
|
2753
2753
|
));
|
|
2754
2754
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
2755
|
-
var BreadcrumbLink =
|
|
2755
|
+
var BreadcrumbLink = React31.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
2756
2756
|
const Comp = asChild ? Slot : "a";
|
|
2757
2757
|
return /* @__PURE__ */ jsx(
|
|
2758
2758
|
Comp,
|
|
@@ -2767,7 +2767,7 @@ var BreadcrumbLink = React35.forwardRef(({ asChild, className, ...props }, ref)
|
|
|
2767
2767
|
);
|
|
2768
2768
|
});
|
|
2769
2769
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
2770
|
-
var BreadcrumbPage =
|
|
2770
|
+
var BreadcrumbPage = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2771
2771
|
"span",
|
|
2772
2772
|
{
|
|
2773
2773
|
ref,
|
|
@@ -2814,7 +2814,7 @@ var BreadcrumbEllipsis = ({
|
|
|
2814
2814
|
}
|
|
2815
2815
|
);
|
|
2816
2816
|
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
2817
|
-
var Switch =
|
|
2817
|
+
var Switch = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2818
2818
|
SwitchPrimitives.Root,
|
|
2819
2819
|
{
|
|
2820
2820
|
className: cn(
|
|
@@ -2873,7 +2873,7 @@ var Switch = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
2873
2873
|
}
|
|
2874
2874
|
));
|
|
2875
2875
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
2876
|
-
var Tooltip =
|
|
2876
|
+
var Tooltip = React31.forwardRef(
|
|
2877
2877
|
({
|
|
2878
2878
|
children,
|
|
2879
2879
|
content: content2,
|
|
@@ -2884,7 +2884,7 @@ var Tooltip = React35.forwardRef(
|
|
|
2884
2884
|
className,
|
|
2885
2885
|
...props
|
|
2886
2886
|
}, ref) => {
|
|
2887
|
-
const Comp = portal ? TooltipPrimitive.Portal :
|
|
2887
|
+
const Comp = portal ? TooltipPrimitive.Portal : React31.Fragment;
|
|
2888
2888
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { children: [
|
|
2889
2889
|
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { type: "button", children }),
|
|
2890
2890
|
/* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsxs(
|
|
@@ -3031,11 +3031,11 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
3031
3031
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
3032
3032
|
AccordionTitle.displayName = "AccordionTitle";
|
|
3033
3033
|
AccordionDescription.displayName = "AccordionDescription";
|
|
3034
|
-
var TabsContext =
|
|
3035
|
-
var Tabs =
|
|
3034
|
+
var TabsContext = React31.createContext({});
|
|
3035
|
+
var Tabs = React31.forwardRef(({ isFitted, children, ...props }, ref) => /* @__PURE__ */ jsx(TabsContext.Provider, { value: { isFitted }, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { ref, ...props, children }) }));
|
|
3036
3036
|
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
3037
|
-
var TabsList =
|
|
3038
|
-
const { isFitted } =
|
|
3037
|
+
var TabsList = React31.forwardRef(({ className, ...props }, ref) => {
|
|
3038
|
+
const { isFitted } = React31.useContext(TabsContext);
|
|
3039
3039
|
return /* @__PURE__ */ jsx(
|
|
3040
3040
|
TabsPrimitive.List,
|
|
3041
3041
|
{
|
|
@@ -3056,8 +3056,8 @@ var TabsList = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3056
3056
|
);
|
|
3057
3057
|
});
|
|
3058
3058
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
3059
|
-
var TabsTrigger =
|
|
3060
|
-
const { isFitted } =
|
|
3059
|
+
var TabsTrigger = React31.forwardRef(({ className, ...props }, ref) => {
|
|
3060
|
+
const { isFitted } = React31.useContext(TabsContext);
|
|
3061
3061
|
return /* @__PURE__ */ jsx(
|
|
3062
3062
|
TabsPrimitive.Trigger,
|
|
3063
3063
|
{
|
|
@@ -3096,7 +3096,7 @@ var TabsTrigger = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3096
3096
|
);
|
|
3097
3097
|
});
|
|
3098
3098
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
3099
|
-
var TabsContent =
|
|
3099
|
+
var TabsContent = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3100
3100
|
TabsPrimitive.Content,
|
|
3101
3101
|
{
|
|
3102
3102
|
ref,
|
|
@@ -3160,7 +3160,7 @@ function ToastComponent({
|
|
|
3160
3160
|
options,
|
|
3161
3161
|
t
|
|
3162
3162
|
}) {
|
|
3163
|
-
const CustomIcon =
|
|
3163
|
+
const CustomIcon = React31__default.isValidElement(options?.icon) ? React31__default.cloneElement(options.icon, {
|
|
3164
3164
|
className: cn("text-toast-icon-default", options.icon.props.className),
|
|
3165
3165
|
size: 20
|
|
3166
3166
|
}) : null;
|
|
@@ -3286,15 +3286,15 @@ var toast = {
|
|
|
3286
3286
|
custom,
|
|
3287
3287
|
promise
|
|
3288
3288
|
};
|
|
3289
|
-
var ActionBar =
|
|
3289
|
+
var ActionBar = React31.forwardRef(({ ...props }) => /* @__PURE__ */ jsx(DialogPrimitive.Root, { modal: false, ...props }));
|
|
3290
3290
|
ActionBar.displayName = "ActionBar";
|
|
3291
|
-
var ActionBarTrigger =
|
|
3291
|
+
var ActionBarTrigger = React31.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ref, ...props }));
|
|
3292
3292
|
ActionBarTrigger.displayName = "ActionBarTrigger";
|
|
3293
3293
|
var ActionBarPortal = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...props });
|
|
3294
3294
|
ActionBarPortal.displayName = "ActionBarPortal";
|
|
3295
|
-
var ActionBarClose =
|
|
3295
|
+
var ActionBarClose = React31.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Close, { ref, ...props }));
|
|
3296
3296
|
ActionBarClose.displayName = "ActionBarClose";
|
|
3297
|
-
var ActionBarButton =
|
|
3297
|
+
var ActionBarButton = React31.forwardRef(
|
|
3298
3298
|
({ className, ...props }, ref) => {
|
|
3299
3299
|
return /* @__PURE__ */ jsx(
|
|
3300
3300
|
Button,
|
|
@@ -3309,7 +3309,7 @@ var ActionBarButton = React35.forwardRef(
|
|
|
3309
3309
|
}
|
|
3310
3310
|
);
|
|
3311
3311
|
ActionBarButton.displayName = "ActionBarButton";
|
|
3312
|
-
var ActionBarDivider =
|
|
3312
|
+
var ActionBarDivider = React31.forwardRef(({ className, ...props }, ref) => {
|
|
3313
3313
|
return /* @__PURE__ */ jsx(
|
|
3314
3314
|
Separator2,
|
|
3315
3315
|
{
|
|
@@ -3321,8 +3321,8 @@ var ActionBarDivider = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3321
3321
|
);
|
|
3322
3322
|
});
|
|
3323
3323
|
ActionBarDivider.displayName = "ActionBarDivider";
|
|
3324
|
-
var ActionBarContent =
|
|
3325
|
-
const Comp = portal ? ActionBarPortal :
|
|
3324
|
+
var ActionBarContent = React31.forwardRef(({ className, children, portal = false, ...props }, ref) => {
|
|
3325
|
+
const Comp = portal ? ActionBarPortal : React31.Fragment;
|
|
3326
3326
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsxs(
|
|
3327
3327
|
DialogPrimitive.Content,
|
|
3328
3328
|
{
|
|
@@ -3370,7 +3370,7 @@ var Heading = forwardRef(
|
|
|
3370
3370
|
[level]
|
|
3371
3371
|
);
|
|
3372
3372
|
if (!element) return null;
|
|
3373
|
-
return
|
|
3373
|
+
return React31__default.createElement(element, {
|
|
3374
3374
|
...rest,
|
|
3375
3375
|
ref,
|
|
3376
3376
|
className: cn(headingStyles, className)
|
|
@@ -3470,7 +3470,7 @@ var FlagComponent = ({ country, countryName }) => {
|
|
|
3470
3470
|
const Flag = flags[country];
|
|
3471
3471
|
return /* @__PURE__ */ jsx("span", { className: "nebula-ds w-5 overflow-hidden rounded-sm", children: Flag ? /* @__PURE__ */ jsx(Flag, { title: countryName }) : /* @__PURE__ */ jsx(PhoneIcon, { size: 16, "aria-hidden": "true" }) });
|
|
3472
3472
|
};
|
|
3473
|
-
var PhoneInput =
|
|
3473
|
+
var PhoneInput = React31__default.forwardRef(({ className, ...props }, ref) => {
|
|
3474
3474
|
return /* @__PURE__ */ jsxs("div", { className: "nebula-ds flex items-center justify-center rounded-e-[20px] w-full", children: [
|
|
3475
3475
|
/* @__PURE__ */ jsx(Separator2, { orientation: "vertical", className: "nebula-ds w-[1px] h-5 z-10" }),
|
|
3476
3476
|
/* @__PURE__ */ jsx(
|
|
@@ -3561,7 +3561,7 @@ function InputPhone({
|
|
|
3561
3561
|
}
|
|
3562
3562
|
);
|
|
3563
3563
|
}
|
|
3564
|
-
var Skeleton =
|
|
3564
|
+
var Skeleton = React31__default.forwardRef(
|
|
3565
3565
|
({ className, ...rest }, ref) => {
|
|
3566
3566
|
return /* @__PURE__ */ jsx(
|
|
3567
3567
|
"div",
|
|
@@ -5053,7 +5053,7 @@ function FileUpload({
|
|
|
5053
5053
|
] });
|
|
5054
5054
|
}
|
|
5055
5055
|
FileUpload.displayName = "FileUpload";
|
|
5056
|
-
var TextArea =
|
|
5056
|
+
var TextArea = React31.forwardRef(
|
|
5057
5057
|
({
|
|
5058
5058
|
className,
|
|
5059
5059
|
isError = false,
|
|
@@ -5065,14 +5065,14 @@ var TextArea = React35.forwardRef(
|
|
|
5065
5065
|
asInput,
|
|
5066
5066
|
...props
|
|
5067
5067
|
}, ref) => {
|
|
5068
|
-
const innerRef =
|
|
5068
|
+
const innerRef = React31.useRef(
|
|
5069
5069
|
null
|
|
5070
5070
|
);
|
|
5071
|
-
const [count, setCount] =
|
|
5071
|
+
const [count, setCount] = React31.useState(String(props.value ?? "").length);
|
|
5072
5072
|
const countParts = [count, maxLength].filter(
|
|
5073
5073
|
(part) => typeof part === "number"
|
|
5074
5074
|
);
|
|
5075
|
-
|
|
5075
|
+
React31.useEffect(() => {
|
|
5076
5076
|
const textarea = innerRef.current;
|
|
5077
5077
|
if (!textarea || !autoResize) return;
|
|
5078
5078
|
const adjustHeight = () => {
|
|
@@ -5085,7 +5085,7 @@ var TextArea = React35.forwardRef(
|
|
|
5085
5085
|
textarea.removeEventListener("input", adjustHeight);
|
|
5086
5086
|
};
|
|
5087
5087
|
}, [asInput, autoResize, props.value]);
|
|
5088
|
-
|
|
5088
|
+
React31.useImperativeHandle(ref, () => innerRef.current);
|
|
5089
5089
|
return /* @__PURE__ */ jsxs("div", { className: "nebula-ds relative w-full", children: [
|
|
5090
5090
|
/* @__PURE__ */ jsx(
|
|
5091
5091
|
"div",
|
|
@@ -5850,10 +5850,10 @@ function Slider({
|
|
|
5850
5850
|
max = 100,
|
|
5851
5851
|
...props
|
|
5852
5852
|
}) {
|
|
5853
|
-
const [internalValues, setInternalValues] =
|
|
5853
|
+
const [internalValues, setInternalValues] = React31.useState(
|
|
5854
5854
|
Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]
|
|
5855
5855
|
);
|
|
5856
|
-
|
|
5856
|
+
React31.useEffect(() => {
|
|
5857
5857
|
if (value !== void 0) {
|
|
5858
5858
|
setInternalValues(Array.isArray(value) ? value : [value]);
|
|
5859
5859
|
}
|
|
@@ -5906,7 +5906,7 @@ function Slider({
|
|
|
5906
5906
|
)
|
|
5907
5907
|
}
|
|
5908
5908
|
),
|
|
5909
|
-
Array.from({ length: internalValues.length }, (_, index) => /* @__PURE__ */ jsx(
|
|
5909
|
+
Array.from({ length: internalValues.length }, (_, index) => /* @__PURE__ */ jsx(React31.Fragment, { children: renderThumb() }, index))
|
|
5910
5910
|
]
|
|
5911
5911
|
}
|
|
5912
5912
|
);
|
|
@@ -6440,8 +6440,8 @@ function Stepper({
|
|
|
6440
6440
|
className,
|
|
6441
6441
|
...props
|
|
6442
6442
|
}) {
|
|
6443
|
-
const [activeStep, setInternalStep] =
|
|
6444
|
-
const setActiveStep =
|
|
6443
|
+
const [activeStep, setInternalStep] = React31.useState(defaultValue);
|
|
6444
|
+
const setActiveStep = React31.useCallback(
|
|
6445
6445
|
(step) => {
|
|
6446
6446
|
if (value === void 0) {
|
|
6447
6447
|
setInternalStep(step);
|
|
@@ -6532,7 +6532,7 @@ function StepperTrigger({
|
|
|
6532
6532
|
}) {
|
|
6533
6533
|
const { setActiveStep } = useStepper();
|
|
6534
6534
|
const { step, isDisabled } = useStepItem();
|
|
6535
|
-
const handleClick =
|
|
6535
|
+
const handleClick = React31.useCallback(
|
|
6536
6536
|
(e) => {
|
|
6537
6537
|
if (isClickable) {
|
|
6538
6538
|
setActiveStep(step);
|
|
@@ -6907,18 +6907,45 @@ var DEFAULT_MEASURING = {
|
|
|
6907
6907
|
};
|
|
6908
6908
|
var DEFAULT_VIRTUAL_CARD_HEIGHT = 96;
|
|
6909
6909
|
var DEFAULT_LOAD_MORE_OFFSET = 120;
|
|
6910
|
-
var KanbanColumnContext =
|
|
6911
|
-
var KanbanColumn =
|
|
6910
|
+
var KanbanColumnContext = React31.createContext(null);
|
|
6911
|
+
var KanbanColumn = React31.forwardRef(
|
|
6912
6912
|
({ className, ...props }, ref) => {
|
|
6913
6913
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("min-h-[320px]", className), ...props });
|
|
6914
6914
|
}
|
|
6915
6915
|
);
|
|
6916
6916
|
KanbanColumn.displayName = "KanbanColumn";
|
|
6917
|
-
var KanbanColumnHeader =
|
|
6918
|
-
|
|
6917
|
+
var KanbanColumnHeader = React31.forwardRef(({ className, ...props }, ref) => {
|
|
6918
|
+
const context = React31.useContext(KanbanColumnContext);
|
|
6919
|
+
const reactId = React31.useId();
|
|
6920
|
+
const { active } = useDndContext();
|
|
6921
|
+
const droppableId = context ? `${context.columnId}-header-droppable` : `kanban-column-header-${reactId}`;
|
|
6922
|
+
const isCardDragActive = active?.data.current?.type === "card";
|
|
6923
|
+
const { setNodeRef } = useDroppable({
|
|
6924
|
+
id: droppableId,
|
|
6925
|
+
data: {
|
|
6926
|
+
type: "column-droppable",
|
|
6927
|
+
columnId: context?.columnId ?? droppableId,
|
|
6928
|
+
ordering: context?.ordering ?? "manual",
|
|
6929
|
+
allowDrop: context?.allowDrop ?? false,
|
|
6930
|
+
location: "header"
|
|
6931
|
+
},
|
|
6932
|
+
disabled: !context || context.allowDrop === false || !isCardDragActive
|
|
6933
|
+
});
|
|
6934
|
+
const mergedRef = React31.useCallback(
|
|
6935
|
+
(node) => {
|
|
6936
|
+
setNodeRef(node);
|
|
6937
|
+
if (typeof ref === "function") {
|
|
6938
|
+
ref(node);
|
|
6939
|
+
} else if (ref) {
|
|
6940
|
+
ref.current = node;
|
|
6941
|
+
}
|
|
6942
|
+
},
|
|
6943
|
+
[ref, setNodeRef]
|
|
6944
|
+
);
|
|
6945
|
+
return /* @__PURE__ */ jsx("div", { ref: mergedRef, className: cn("flex", className), ...props });
|
|
6919
6946
|
});
|
|
6920
6947
|
KanbanColumnHeader.displayName = "KanbanColumnHeader";
|
|
6921
|
-
var KanbanColumnTitle =
|
|
6948
|
+
var KanbanColumnTitle = React31.forwardRef(({ className, ...props }, ref) => {
|
|
6922
6949
|
return /* @__PURE__ */ jsx(
|
|
6923
6950
|
"h3",
|
|
6924
6951
|
{
|
|
@@ -6929,11 +6956,38 @@ var KanbanColumnTitle = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
6929
6956
|
);
|
|
6930
6957
|
});
|
|
6931
6958
|
KanbanColumnTitle.displayName = "KanbanColumnTitle";
|
|
6932
|
-
var KanbanColumnFooter =
|
|
6959
|
+
var KanbanColumnFooter = React31.forwardRef(({ className, ...props }, ref) => {
|
|
6960
|
+
const context = React31.useContext(KanbanColumnContext);
|
|
6961
|
+
const reactId = React31.useId();
|
|
6962
|
+
const { active } = useDndContext();
|
|
6963
|
+
const droppableId = context ? `${context.columnId}-footer-droppable` : `kanban-column-footer-${reactId}`;
|
|
6964
|
+
const isCardDragActive = active?.data.current?.type === "card";
|
|
6965
|
+
const { setNodeRef } = useDroppable({
|
|
6966
|
+
id: droppableId,
|
|
6967
|
+
data: {
|
|
6968
|
+
type: "column-droppable",
|
|
6969
|
+
columnId: context?.columnId ?? droppableId,
|
|
6970
|
+
ordering: context?.ordering ?? "manual",
|
|
6971
|
+
allowDrop: context?.allowDrop ?? false,
|
|
6972
|
+
location: "footer"
|
|
6973
|
+
},
|
|
6974
|
+
disabled: !context || context.allowDrop === false || !isCardDragActive
|
|
6975
|
+
});
|
|
6976
|
+
const mergedRef = React31.useCallback(
|
|
6977
|
+
(node) => {
|
|
6978
|
+
setNodeRef(node);
|
|
6979
|
+
if (typeof ref === "function") {
|
|
6980
|
+
ref(node);
|
|
6981
|
+
} else if (ref) {
|
|
6982
|
+
ref.current = node;
|
|
6983
|
+
}
|
|
6984
|
+
},
|
|
6985
|
+
[ref, setNodeRef]
|
|
6986
|
+
);
|
|
6933
6987
|
return /* @__PURE__ */ jsx(
|
|
6934
6988
|
"div",
|
|
6935
6989
|
{
|
|
6936
|
-
ref,
|
|
6990
|
+
ref: mergedRef,
|
|
6937
6991
|
className: cn(
|
|
6938
6992
|
"border-t border-box-border px-5 py-4 text-xs text-neutral-500",
|
|
6939
6993
|
className
|
|
@@ -6943,16 +6997,16 @@ var KanbanColumnFooter = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
6943
6997
|
);
|
|
6944
6998
|
});
|
|
6945
6999
|
KanbanColumnFooter.displayName = "KanbanColumnFooter";
|
|
6946
|
-
var KanbanCard =
|
|
7000
|
+
var KanbanCard = React31.forwardRef(
|
|
6947
7001
|
({ className, isDragging, isOverlay, ...props }, ref) => {
|
|
6948
7002
|
return /* @__PURE__ */ jsx(
|
|
6949
7003
|
"div",
|
|
6950
7004
|
{
|
|
6951
7005
|
ref,
|
|
6952
7006
|
className: cn(
|
|
6953
|
-
"group relative rounded-2xl border border-box-border/80 bg-box-background-primary px-5 py-4 text-left
|
|
6954
|
-
isDragging && "ring-2 ring-button-primary-border-focus
|
|
6955
|
-
isOverlay && "ring-4 ring-button-primary-border-focus/60
|
|
7007
|
+
"group relative rounded-2xl border border-box-border/80 bg-box-background-primary px-5 py-4 text-left transition-all duration-150 hover:-translate-y-[1px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-button-primary-border-focus",
|
|
7008
|
+
isDragging && "ring-2 ring-button-primary-border-focus",
|
|
7009
|
+
isOverlay && "ring-4 ring-button-primary-border-focus/60",
|
|
6956
7010
|
className
|
|
6957
7011
|
),
|
|
6958
7012
|
...props
|
|
@@ -6961,14 +7015,14 @@ var KanbanCard = React35.forwardRef(
|
|
|
6961
7015
|
}
|
|
6962
7016
|
);
|
|
6963
7017
|
KanbanCard.displayName = "KanbanCard";
|
|
6964
|
-
var KanbanColumnDragHandle =
|
|
6965
|
-
const context =
|
|
7018
|
+
var KanbanColumnDragHandle = React31.forwardRef(({ className, children, ...props }, ref) => {
|
|
7019
|
+
const context = React31.useContext(KanbanColumnContext);
|
|
6966
7020
|
if (!context) {
|
|
6967
7021
|
throw new Error(
|
|
6968
7022
|
"KanbanColumnDragHandle must be used inside a KanbanBoard column"
|
|
6969
7023
|
);
|
|
6970
7024
|
}
|
|
6971
|
-
const mergedRef =
|
|
7025
|
+
const mergedRef = React31.useCallback(
|
|
6972
7026
|
(node) => {
|
|
6973
7027
|
context.setActivatorNodeRef(node);
|
|
6974
7028
|
if (typeof ref === "function") {
|
|
@@ -7021,30 +7075,6 @@ function getCardSortDisabled(card, column) {
|
|
|
7021
7075
|
droppable: disableDroppable
|
|
7022
7076
|
};
|
|
7023
7077
|
}
|
|
7024
|
-
function calculateManualInsertionIndex({
|
|
7025
|
-
overData,
|
|
7026
|
-
fromColumnId,
|
|
7027
|
-
targetColumnId,
|
|
7028
|
-
columns
|
|
7029
|
-
}) {
|
|
7030
|
-
const targetColumn = columns.find((column) => column.id === targetColumnId);
|
|
7031
|
-
if (!targetColumn) {
|
|
7032
|
-
return null;
|
|
7033
|
-
}
|
|
7034
|
-
if (overData.type === "column-droppable") {
|
|
7035
|
-
const activeIsSameColumn2 = targetColumnId === fromColumnId;
|
|
7036
|
-
if (activeIsSameColumn2) {
|
|
7037
|
-
return targetColumn.cards.length - 1;
|
|
7038
|
-
}
|
|
7039
|
-
return targetColumn.cards.length;
|
|
7040
|
-
}
|
|
7041
|
-
const activeIsSameColumn = targetColumnId === fromColumnId;
|
|
7042
|
-
const overIndex = overData.index;
|
|
7043
|
-
if (activeIsSameColumn) {
|
|
7044
|
-
return clampInsertIndex(overIndex, targetColumn.cards.length - 1);
|
|
7045
|
-
}
|
|
7046
|
-
return clampInsertIndex(overIndex, targetColumn.cards.length);
|
|
7047
|
-
}
|
|
7048
7078
|
function moveCardBetweenColumns({
|
|
7049
7079
|
columns,
|
|
7050
7080
|
card,
|
|
@@ -7179,7 +7209,7 @@ function KanbanSortableCard({
|
|
|
7179
7209
|
transition,
|
|
7180
7210
|
isDragging
|
|
7181
7211
|
} = sortable;
|
|
7182
|
-
const composedRef =
|
|
7212
|
+
const composedRef = React31.useCallback(
|
|
7183
7213
|
(node) => {
|
|
7184
7214
|
setNodeRef(node);
|
|
7185
7215
|
if (virtualizationEnabled && node) {
|
|
@@ -7243,8 +7273,8 @@ var KanbanColumnBodyInner = ({
|
|
|
7243
7273
|
isManualOrdering,
|
|
7244
7274
|
isDropTarget
|
|
7245
7275
|
}, ref) => {
|
|
7246
|
-
const scrollRef =
|
|
7247
|
-
const combinedRef =
|
|
7276
|
+
const scrollRef = React31.useRef(null);
|
|
7277
|
+
const combinedRef = React31.useCallback(
|
|
7248
7278
|
(node) => {
|
|
7249
7279
|
scrollRef.current = node;
|
|
7250
7280
|
if (typeof ref === "function") {
|
|
@@ -7257,7 +7287,7 @@ var KanbanColumnBodyInner = ({
|
|
|
7257
7287
|
);
|
|
7258
7288
|
const virtualization = column.virtualization;
|
|
7259
7289
|
const virtualizationEnabled = Boolean(virtualization?.enabled);
|
|
7260
|
-
const cardIds =
|
|
7290
|
+
const cardIds = React31.useMemo(
|
|
7261
7291
|
() => column.cards.map((card) => getCardId(card)),
|
|
7262
7292
|
[column.cards, getCardId]
|
|
7263
7293
|
);
|
|
@@ -7269,7 +7299,7 @@ var KanbanColumnBodyInner = ({
|
|
|
7269
7299
|
enabled: virtualizationEnabled
|
|
7270
7300
|
});
|
|
7271
7301
|
const { onLoadMore, hasMore, isLoadingMore, loadMoreOffset } = column;
|
|
7272
|
-
|
|
7302
|
+
React31.useEffect(() => {
|
|
7273
7303
|
if (!onLoadMore || !hasMore || isLoadingMore) {
|
|
7274
7304
|
return;
|
|
7275
7305
|
}
|
|
@@ -7290,7 +7320,7 @@ var KanbanColumnBodyInner = ({
|
|
|
7290
7320
|
};
|
|
7291
7321
|
}, [hasMore, isLoadingMore, loadMoreOffset, onLoadMore]);
|
|
7292
7322
|
const columnBodyClasses = cn(
|
|
7293
|
-
"flex-1 overflow-y-auto px-
|
|
7323
|
+
"flex-1 overflow-y-auto px-2 pb-4 pt-2",
|
|
7294
7324
|
column.cards.length === 0 && "flex items-center justify-center"
|
|
7295
7325
|
);
|
|
7296
7326
|
const emptyState = renderEmptyState?.(columnContext) ?? column.emptyState ?? defaultRenderEmptyState();
|
|
@@ -7341,7 +7371,7 @@ var KanbanColumnBodyInner = ({
|
|
|
7341
7371
|
);
|
|
7342
7372
|
})
|
|
7343
7373
|
}
|
|
7344
|
-
) : /* @__PURE__ */ jsx("div", { className: "nebula-ds flex flex-col gap-
|
|
7374
|
+
) : /* @__PURE__ */ jsx("div", { className: "nebula-ds flex flex-col gap-2", children: column.cards.map((card, index) => /* @__PURE__ */ jsx(
|
|
7345
7375
|
KanbanSortableCard,
|
|
7346
7376
|
{
|
|
7347
7377
|
card,
|
|
@@ -7359,7 +7389,7 @@ var KanbanColumnBodyInner = ({
|
|
|
7359
7389
|
column.hasMore && column.isLoadingMore ? /* @__PURE__ */ jsx("div", { className: "nebula-ds mt-3 flex justify-center text-xs text-neutral-500", children: "..." }) : null
|
|
7360
7390
|
] }) });
|
|
7361
7391
|
};
|
|
7362
|
-
var KanbanColumnBodyBase =
|
|
7392
|
+
var KanbanColumnBodyBase = React31.forwardRef(KanbanColumnBodyInner);
|
|
7363
7393
|
KanbanColumnBodyBase.displayName = "KanbanColumnBody";
|
|
7364
7394
|
var KanbanColumnBody = KanbanColumnBodyBase;
|
|
7365
7395
|
var KANBAN_COLUMN_BASE_CLASSNAME = "flex h-full w-full min-w-[360px] max-w-[360px] flex-col rounded-2xl box-content border bg-table-background transition-[box-shadow,transform,background-color]";
|
|
@@ -7400,13 +7430,27 @@ function KanbanSortableColumn({
|
|
|
7400
7430
|
type: "column-droppable",
|
|
7401
7431
|
columnId: column.id,
|
|
7402
7432
|
ordering: column.ordering ?? "manual",
|
|
7403
|
-
allowDrop: column.allowDrop !== false
|
|
7433
|
+
allowDrop: column.allowDrop !== false,
|
|
7434
|
+
location: "body"
|
|
7404
7435
|
},
|
|
7405
7436
|
disabled: column.allowDrop === false
|
|
7406
7437
|
});
|
|
7407
|
-
const
|
|
7438
|
+
const { setNodeRef: setFooterDropzoneRef } = useDroppable({
|
|
7439
|
+
id: `${column.id}-footer-dropzone`,
|
|
7440
|
+
data: {
|
|
7441
|
+
type: "column-droppable",
|
|
7442
|
+
columnId: column.id,
|
|
7443
|
+
ordering: column.ordering ?? "manual",
|
|
7444
|
+
allowDrop: column.allowDrop !== false,
|
|
7445
|
+
location: "footer"
|
|
7446
|
+
},
|
|
7447
|
+
disabled: column.allowDrop === false
|
|
7448
|
+
});
|
|
7449
|
+
const columnContextValue = React31.useMemo(
|
|
7408
7450
|
() => ({
|
|
7409
7451
|
columnId: column.id,
|
|
7452
|
+
ordering: column.ordering ?? "manual",
|
|
7453
|
+
allowDrop: column.allowDrop !== false,
|
|
7410
7454
|
setActivatorNodeRef,
|
|
7411
7455
|
listeners,
|
|
7412
7456
|
attributes,
|
|
@@ -7415,8 +7459,10 @@ function KanbanSortableColumn({
|
|
|
7415
7459
|
}),
|
|
7416
7460
|
[
|
|
7417
7461
|
attributes,
|
|
7462
|
+
column.allowDrop,
|
|
7418
7463
|
column.canDrag,
|
|
7419
7464
|
column.id,
|
|
7465
|
+
column.ordering,
|
|
7420
7466
|
isDragging,
|
|
7421
7467
|
listeners,
|
|
7422
7468
|
setActivatorNodeRef
|
|
@@ -7460,7 +7506,7 @@ function KanbanSortableColumn({
|
|
|
7460
7506
|
isDropTarget: columnContext.isDropTarget
|
|
7461
7507
|
}
|
|
7462
7508
|
),
|
|
7463
|
-
column.footer || renderColumnFooter ? renderColumnFooter ? renderColumnFooter(columnContext) : /* @__PURE__ */ jsx(KanbanColumnFooter, { children: column.footer }) : null
|
|
7509
|
+
column.footer || renderColumnFooter ? renderColumnFooter ? /* @__PURE__ */ jsx("div", { ref: setFooterDropzoneRef, children: renderColumnFooter(columnContext) }) : /* @__PURE__ */ jsx(KanbanColumnFooter, { children: column.footer }) : null
|
|
7464
7510
|
]
|
|
7465
7511
|
}
|
|
7466
7512
|
) });
|
|
@@ -7507,6 +7553,8 @@ function renderColumnOverlay({
|
|
|
7507
7553
|
const computedColumnClassName = typeof columnClassName === "function" ? columnClassName(columnContext) : columnClassName;
|
|
7508
7554
|
const overlayColumnContext = {
|
|
7509
7555
|
columnId: activeColumn.id,
|
|
7556
|
+
ordering: "manual",
|
|
7557
|
+
allowDrop: false,
|
|
7510
7558
|
setActivatorNodeRef: () => {
|
|
7511
7559
|
},
|
|
7512
7560
|
listeners: void 0,
|
|
@@ -7551,7 +7599,23 @@ function KanbanBoard({
|
|
|
7551
7599
|
sensors: sensorsProp,
|
|
7552
7600
|
measuring
|
|
7553
7601
|
}) {
|
|
7554
|
-
const
|
|
7602
|
+
const resolveHeaderFooterDropzone = React31.useCallback(
|
|
7603
|
+
(event) => {
|
|
7604
|
+
const collisions = event.collisions;
|
|
7605
|
+
if (!collisions) {
|
|
7606
|
+
return null;
|
|
7607
|
+
}
|
|
7608
|
+
for (const collision of collisions) {
|
|
7609
|
+
const droppableData = collision.data?.droppableContainer?.data?.current;
|
|
7610
|
+
if (droppableData?.type === "column-droppable" && (droppableData.location === "header" || droppableData.location === "footer")) {
|
|
7611
|
+
return droppableData;
|
|
7612
|
+
}
|
|
7613
|
+
}
|
|
7614
|
+
return null;
|
|
7615
|
+
},
|
|
7616
|
+
[]
|
|
7617
|
+
);
|
|
7618
|
+
const getCardId = React31.useCallback(
|
|
7555
7619
|
(card) => getCardIdProp ? getCardIdProp(card) : card.id,
|
|
7556
7620
|
[getCardIdProp]
|
|
7557
7621
|
);
|
|
@@ -7573,22 +7637,22 @@ function KanbanBoard({
|
|
|
7573
7637
|
);
|
|
7574
7638
|
const sensors = sensorsProp ?? defaultSensors;
|
|
7575
7639
|
const measuringConfig = measuring ?? DEFAULT_MEASURING;
|
|
7576
|
-
const columnMap =
|
|
7640
|
+
const columnMap = React31.useMemo(
|
|
7577
7641
|
() => new Map(columns.map((column) => [column.id, column])),
|
|
7578
7642
|
[columns]
|
|
7579
7643
|
);
|
|
7580
|
-
const manualDropPosition =
|
|
7581
|
-
const [activeCard, setActiveCard] =
|
|
7582
|
-
const [activeColumn, setActiveColumn] =
|
|
7583
|
-
const [hoveredColumnId, setHoveredColumnId] =
|
|
7584
|
-
const [projectedColumns, setProjectedColumns] =
|
|
7644
|
+
const manualDropPosition = React31.useRef(null);
|
|
7645
|
+
const [activeCard, setActiveCard] = React31.useState(null);
|
|
7646
|
+
const [activeColumn, setActiveColumn] = React31.useState(null);
|
|
7647
|
+
const [hoveredColumnId, setHoveredColumnId] = React31.useState(null);
|
|
7648
|
+
const [projectedColumns, setProjectedColumns] = React31.useState(null);
|
|
7585
7649
|
const sanitizedColumns = projectedColumns ?? columns;
|
|
7586
|
-
|
|
7650
|
+
React31.useEffect(() => {
|
|
7587
7651
|
if (!activeCard && !activeColumn) {
|
|
7588
7652
|
setProjectedColumns(null);
|
|
7589
7653
|
}
|
|
7590
7654
|
}, [columns, activeCard, activeColumn]);
|
|
7591
|
-
const handleDragStart =
|
|
7655
|
+
const handleDragStart = React31.useCallback(
|
|
7592
7656
|
(event) => {
|
|
7593
7657
|
const data = event.active.data.current;
|
|
7594
7658
|
if (!data) {
|
|
@@ -7612,7 +7676,7 @@ function KanbanBoard({
|
|
|
7612
7676
|
},
|
|
7613
7677
|
[getCardId]
|
|
7614
7678
|
);
|
|
7615
|
-
const handleDragOver =
|
|
7679
|
+
const handleDragOver = React31.useCallback(
|
|
7616
7680
|
(event) => {
|
|
7617
7681
|
const { active, over } = event;
|
|
7618
7682
|
if (!over) {
|
|
@@ -7629,7 +7693,6 @@ function KanbanBoard({
|
|
|
7629
7693
|
return;
|
|
7630
7694
|
}
|
|
7631
7695
|
const fromColumnId = activeCard.columnId;
|
|
7632
|
-
const activeCardId = getCardId(activeData.card);
|
|
7633
7696
|
const baseColumns = projectedColumns ?? columns;
|
|
7634
7697
|
if (overData?.type === "card" || overData?.type === "column-droppable") {
|
|
7635
7698
|
const targetColumnId = overData.columnId;
|
|
@@ -7641,12 +7704,36 @@ function KanbanBoard({
|
|
|
7641
7704
|
const ordering = targetColumn.ordering ?? "manual";
|
|
7642
7705
|
setHoveredColumnId(targetColumnId);
|
|
7643
7706
|
if (ordering === "manual") {
|
|
7644
|
-
const
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7707
|
+
const originalTargetColumn = columns.find(
|
|
7708
|
+
(column) => column.id === targetColumnId
|
|
7709
|
+
);
|
|
7710
|
+
const projectedTargetColumn = baseColumns.find(
|
|
7711
|
+
(column) => column.id === targetColumnId
|
|
7712
|
+
);
|
|
7713
|
+
if (!originalTargetColumn) return;
|
|
7714
|
+
const originalLength = originalTargetColumn.cards.length;
|
|
7715
|
+
const activeCardId = getCardId(activeData.card);
|
|
7716
|
+
let nextIndex = null;
|
|
7717
|
+
if (overData.type === "column-droppable") {
|
|
7718
|
+
if (overData.location === "header") {
|
|
7719
|
+
nextIndex = 0;
|
|
7720
|
+
} else if (fromColumnId === targetColumnId) {
|
|
7721
|
+
nextIndex = originalLength - 1;
|
|
7722
|
+
} else {
|
|
7723
|
+
nextIndex = originalLength;
|
|
7724
|
+
}
|
|
7725
|
+
} else if (overData.type === "card") {
|
|
7726
|
+
if (fromColumnId === targetColumnId) {
|
|
7727
|
+
nextIndex = clampInsertIndex(overData.index, originalLength - 1);
|
|
7728
|
+
} else {
|
|
7729
|
+
const overCardId = getCardId(overData.card);
|
|
7730
|
+
const projectedOverIndex = projectedTargetColumn?.cards.findIndex(
|
|
7731
|
+
(card) => getCardId(card) === overCardId
|
|
7732
|
+
) ?? -1;
|
|
7733
|
+
const resolvedOverIndex = projectedOverIndex !== -1 ? projectedOverIndex : overData.index;
|
|
7734
|
+
nextIndex = clampInsertIndex(resolvedOverIndex, originalLength);
|
|
7735
|
+
}
|
|
7736
|
+
}
|
|
7650
7737
|
if (nextIndex === null) {
|
|
7651
7738
|
return;
|
|
7652
7739
|
}
|
|
@@ -7711,14 +7798,14 @@ function KanbanBoard({
|
|
|
7711
7798
|
},
|
|
7712
7799
|
[activeCard, activeColumn, columns, columnMap, getCardId, projectedColumns]
|
|
7713
7800
|
);
|
|
7714
|
-
const resetDragState =
|
|
7801
|
+
const resetDragState = React31.useCallback(() => {
|
|
7715
7802
|
setActiveCard(null);
|
|
7716
7803
|
setActiveColumn(null);
|
|
7717
7804
|
setHoveredColumnId(null);
|
|
7718
7805
|
setProjectedColumns(null);
|
|
7719
7806
|
manualDropPosition.current = null;
|
|
7720
7807
|
}, []);
|
|
7721
|
-
const handleDragEnd =
|
|
7808
|
+
const handleDragEnd = React31.useCallback(
|
|
7722
7809
|
(event) => {
|
|
7723
7810
|
const { active, over } = event;
|
|
7724
7811
|
const activeData = active.data.current;
|
|
@@ -7734,12 +7821,14 @@ function KanbanBoard({
|
|
|
7734
7821
|
resetDragState();
|
|
7735
7822
|
return;
|
|
7736
7823
|
}
|
|
7737
|
-
|
|
7824
|
+
const resolvedDropzone = resolveHeaderFooterDropzone(event);
|
|
7825
|
+
const resolvedOverData = resolvedDropzone ?? overData;
|
|
7826
|
+
if (resolvedOverData.type !== "card" && resolvedOverData.type !== "column-droppable") {
|
|
7738
7827
|
resetDragState();
|
|
7739
7828
|
return;
|
|
7740
7829
|
}
|
|
7741
7830
|
const fromColumnId = activeCard.columnId;
|
|
7742
|
-
const toColumnId =
|
|
7831
|
+
const toColumnId = pendingManualPosition?.columnId ?? resolvedOverData.columnId;
|
|
7743
7832
|
const ordering = columnMap.get(toColumnId)?.ordering ?? "manual";
|
|
7744
7833
|
const sourceColumn = columns.find(
|
|
7745
7834
|
(column) => column.id === fromColumnId
|
|
@@ -7749,23 +7838,49 @@ function KanbanBoard({
|
|
|
7749
7838
|
) ?? 0;
|
|
7750
7839
|
let toIndex = null;
|
|
7751
7840
|
if (ordering === "manual") {
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
} else {
|
|
7841
|
+
const isExplicitHeaderFooterDrop = resolvedOverData.type === "column-droppable" && (resolvedOverData.location === "header" || resolvedOverData.location === "footer");
|
|
7842
|
+
if (isExplicitHeaderFooterDrop) {
|
|
7755
7843
|
const targetColumn = columns.find(
|
|
7756
7844
|
(column) => column.id === toColumnId
|
|
7757
7845
|
);
|
|
7758
|
-
if (targetColumn
|
|
7759
|
-
toIndex =
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
} else if (
|
|
7846
|
+
if (!targetColumn) {
|
|
7847
|
+
toIndex = null;
|
|
7848
|
+
} else if (resolvedOverData.location === "header") {
|
|
7849
|
+
toIndex = 0;
|
|
7850
|
+
} else if (resolvedOverData.location === "footer") {
|
|
7763
7851
|
if (fromColumnId === toColumnId) {
|
|
7764
7852
|
toIndex = targetColumn.cards.length - 1;
|
|
7765
7853
|
} else {
|
|
7766
7854
|
toIndex = targetColumn.cards.length;
|
|
7767
7855
|
}
|
|
7768
7856
|
}
|
|
7857
|
+
} else {
|
|
7858
|
+
if (pendingManualPosition && pendingManualPosition.columnId === toColumnId) {
|
|
7859
|
+
toIndex = pendingManualPosition.index;
|
|
7860
|
+
} else {
|
|
7861
|
+
const targetColumn = columns.find(
|
|
7862
|
+
(column) => column.id === toColumnId
|
|
7863
|
+
);
|
|
7864
|
+
if (targetColumn && resolvedOverData.type === "card") {
|
|
7865
|
+
toIndex = targetColumn.cards.findIndex(
|
|
7866
|
+
(card) => getCardId(card) === getCardId(resolvedOverData.card)
|
|
7867
|
+
);
|
|
7868
|
+
} else if (targetColumn && resolvedOverData.type === "column-droppable") {
|
|
7869
|
+
if (resolvedOverData.location === "header") {
|
|
7870
|
+
toIndex = 0;
|
|
7871
|
+
} else if (resolvedOverData.location === "footer") {
|
|
7872
|
+
if (fromColumnId === toColumnId) {
|
|
7873
|
+
toIndex = targetColumn.cards.length - 1;
|
|
7874
|
+
} else {
|
|
7875
|
+
toIndex = targetColumn.cards.length;
|
|
7876
|
+
}
|
|
7877
|
+
} else if (fromColumnId === toColumnId) {
|
|
7878
|
+
toIndex = targetColumn.cards.length - 1;
|
|
7879
|
+
} else {
|
|
7880
|
+
toIndex = targetColumn.cards.length;
|
|
7881
|
+
}
|
|
7882
|
+
}
|
|
7883
|
+
}
|
|
7769
7884
|
}
|
|
7770
7885
|
}
|
|
7771
7886
|
if (ordering === "external") {
|
|
@@ -7836,13 +7951,35 @@ function KanbanBoard({
|
|
|
7836
7951
|
onCardDrop,
|
|
7837
7952
|
onColumnDrop,
|
|
7838
7953
|
projectedColumns,
|
|
7839
|
-
resetDragState
|
|
7954
|
+
resetDragState,
|
|
7955
|
+
resolveHeaderFooterDropzone
|
|
7840
7956
|
]
|
|
7841
7957
|
);
|
|
7958
|
+
const collisionDetectionStrategy = React31.useCallback(
|
|
7959
|
+
(args) => {
|
|
7960
|
+
const baseCollisionDetection = collisionDetection ?? rectIntersection;
|
|
7961
|
+
const pointerCollisions = pointerWithin(args);
|
|
7962
|
+
const preferredCollision = pointerCollisions.find((collision) => {
|
|
7963
|
+
const droppableData = collision.data?.droppableContainer?.data?.current;
|
|
7964
|
+
return droppableData?.type === "column-droppable" && (droppableData.location === "header" || droppableData.location === "footer");
|
|
7965
|
+
});
|
|
7966
|
+
const baseCollisions = baseCollisionDetection(args);
|
|
7967
|
+
if (!preferredCollision) {
|
|
7968
|
+
return baseCollisions;
|
|
7969
|
+
}
|
|
7970
|
+
return [
|
|
7971
|
+
preferredCollision,
|
|
7972
|
+
...baseCollisions.filter(
|
|
7973
|
+
(collision) => collision.id !== preferredCollision.id
|
|
7974
|
+
)
|
|
7975
|
+
];
|
|
7976
|
+
},
|
|
7977
|
+
[collisionDetection]
|
|
7978
|
+
);
|
|
7842
7979
|
return /* @__PURE__ */ jsxs(
|
|
7843
7980
|
DndContext,
|
|
7844
7981
|
{
|
|
7845
|
-
collisionDetection,
|
|
7982
|
+
collisionDetection: collisionDetectionStrategy,
|
|
7846
7983
|
modifiers,
|
|
7847
7984
|
sensors,
|
|
7848
7985
|
measuring: measuringConfig,
|
|
@@ -7860,7 +7997,7 @@ function KanbanBoard({
|
|
|
7860
7997
|
"div",
|
|
7861
7998
|
{
|
|
7862
7999
|
className: cn(
|
|
7863
|
-
"flex h-full w-full gap-4 overflow-x-auto p-1",
|
|
8000
|
+
"relative flex h-full w-full gap-4 overflow-x-auto p-1",
|
|
7864
8001
|
className
|
|
7865
8002
|
),
|
|
7866
8003
|
children: sanitizedColumns.map((column, index) => {
|