@ikatec/nebula-react 1.3.3-beta.1 → 1.4.0-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.0-beta.3.tgz +0 -0
- package/dist/index.d.mts +153 -6
- package/dist/index.d.ts +153 -6
- package/dist/index.js +1608 -251
- package/dist/index.mjs +1461 -115
- package/package.json +10 -3
- package/dist/ikatec-nebula-react-1.3.3-beta.1.tgz +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React35 from 'react';
|
|
2
|
+
import React35__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';
|
|
@@ -7,7 +7,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
7
7
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
8
8
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
9
9
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
10
|
-
import { ChevronRight, Check, Circle, CircleX, Eye, EyeOff, X, Minus, ClockIcon, ChevronsLeft, ChevronLeft, ChevronsRight, MoreHorizontal, ChevronDown, ChevronLeftIcon, ChevronDownIcon, ChevronRightIcon, CalendarIcon, ImageUpIcon, XIcon, MinusIcon, PlusIcon, UserIcon, LoaderCircleIcon, CheckIcon, PhoneIcon, FileTextIcon, FileAudioIcon, FileVideoIcon, Info, CircleCheckBig } from 'lucide-react';
|
|
10
|
+
import { ChevronRight, Check, Circle, CircleX, Eye, EyeOff, X, Minus, ClockIcon, ChevronsLeft, ChevronLeft, ChevronsRight, MoreHorizontal, ChevronDown, ChevronLeftIcon, ChevronDownIcon, ChevronRightIcon, CalendarIcon, ImageUpIcon, XIcon, MinusIcon, PlusIcon, UserIcon, LoaderCircleIcon, CheckIcon, PhoneIcon, FileTextIcon, FileAudioIcon, FileVideoIcon, Info, CircleCheckBig, InfoIcon, TriangleAlertIcon, CircleCheckBigIcon } from 'lucide-react';
|
|
11
11
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
12
12
|
import Select, { components } from 'react-select';
|
|
13
13
|
import Creatable from 'react-select/creatable';
|
|
@@ -29,6 +29,10 @@ 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, useDroppable } from '@dnd-kit/core';
|
|
33
|
+
import { SortableContext, verticalListSortingStrategy, useSortable, defaultAnimateLayoutChanges, sortableKeyboardCoordinates, arrayMove, horizontalListSortingStrategy } from '@dnd-kit/sortable';
|
|
34
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
35
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
32
36
|
|
|
33
37
|
// src/button.tsx
|
|
34
38
|
|
|
@@ -74,11 +78,11 @@ function cn(...inputs) {
|
|
|
74
78
|
return customTwMerge(nebulaClass, clsx(inputs));
|
|
75
79
|
}
|
|
76
80
|
var processChildren = (children) => {
|
|
77
|
-
return
|
|
81
|
+
return React35__default.Children.map(children, (child) => {
|
|
78
82
|
if (typeof child === "string") {
|
|
79
83
|
return /* @__PURE__ */ jsx("span", { className: "nebula-ds px-2", children: child });
|
|
80
84
|
}
|
|
81
|
-
if (
|
|
85
|
+
if (React35__default.isValidElement(child) && child.type === React35__default.Fragment) {
|
|
82
86
|
return processChildren(child.props.children);
|
|
83
87
|
}
|
|
84
88
|
return child;
|
|
@@ -170,7 +174,7 @@ var buttonVariantsConfig = cva(
|
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
176
|
);
|
|
173
|
-
var Button =
|
|
177
|
+
var Button = React35.forwardRef(
|
|
174
178
|
({
|
|
175
179
|
className,
|
|
176
180
|
variant: variant3,
|
|
@@ -235,7 +239,7 @@ var badgeVariantsConfig = cva(
|
|
|
235
239
|
}
|
|
236
240
|
}
|
|
237
241
|
);
|
|
238
|
-
var Badge =
|
|
242
|
+
var Badge = React35.forwardRef(
|
|
239
243
|
({ className, variant: variant3, size: size4, ...props }, ref) => {
|
|
240
244
|
return /* @__PURE__ */ jsx(
|
|
241
245
|
"div",
|
|
@@ -319,7 +323,7 @@ var alertVariantsConfig = cva(
|
|
|
319
323
|
}
|
|
320
324
|
);
|
|
321
325
|
var alertVariants = extractVariants(variants);
|
|
322
|
-
var Alert =
|
|
326
|
+
var Alert = React35.forwardRef(
|
|
323
327
|
({ className, variant: variant3, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
324
328
|
"div",
|
|
325
329
|
{
|
|
@@ -331,7 +335,7 @@ var Alert = React8.forwardRef(
|
|
|
331
335
|
)
|
|
332
336
|
);
|
|
333
337
|
Alert.displayName = "Alert";
|
|
334
|
-
var AlertTitle =
|
|
338
|
+
var AlertTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
335
339
|
"h5",
|
|
336
340
|
{
|
|
337
341
|
ref,
|
|
@@ -340,7 +344,7 @@ var AlertTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
340
344
|
}
|
|
341
345
|
));
|
|
342
346
|
AlertTitle.displayName = "AlertTitle";
|
|
343
|
-
var AlertDescription =
|
|
347
|
+
var AlertDescription = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
344
348
|
"div",
|
|
345
349
|
{
|
|
346
350
|
ref,
|
|
@@ -349,7 +353,7 @@ var AlertDescription = React8.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
349
353
|
}
|
|
350
354
|
));
|
|
351
355
|
AlertDescription.displayName = "AlertDescription";
|
|
352
|
-
var AlertButton =
|
|
356
|
+
var AlertButton = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
353
357
|
"button",
|
|
354
358
|
{
|
|
355
359
|
ref,
|
|
@@ -360,9 +364,9 @@ var AlertButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
360
364
|
AlertButton.displayName = "AlertButton";
|
|
361
365
|
var Popover = PopoverPrimitive.Root;
|
|
362
366
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
363
|
-
var PopoverContent =
|
|
367
|
+
var PopoverContent = React35.forwardRef(
|
|
364
368
|
({ className, align = "center", sideOffset = 4, portal = false, ...props }, ref) => {
|
|
365
|
-
const Comp = portal ? PopoverPrimitive.Portal :
|
|
369
|
+
const Comp = portal ? PopoverPrimitive.Portal : React35.Fragment;
|
|
366
370
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsx(
|
|
367
371
|
PopoverPrimitive.Content,
|
|
368
372
|
{
|
|
@@ -390,7 +394,7 @@ var PopoverContent = React8.forwardRef(
|
|
|
390
394
|
}
|
|
391
395
|
);
|
|
392
396
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
393
|
-
var Label =
|
|
397
|
+
var Label = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
394
398
|
LabelPrimitive.Root,
|
|
395
399
|
{
|
|
396
400
|
ref,
|
|
@@ -402,7 +406,7 @@ var Label = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
402
406
|
}
|
|
403
407
|
));
|
|
404
408
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
405
|
-
var Table =
|
|
409
|
+
var Table = React35.forwardRef(({ className, noCardWrapper = false, ...props }, ref) => {
|
|
406
410
|
if (noCardWrapper) {
|
|
407
411
|
return /* @__PURE__ */ jsx(
|
|
408
412
|
"table",
|
|
@@ -423,9 +427,9 @@ var Table = React8.forwardRef(({ className, noCardWrapper = false, ...props }, r
|
|
|
423
427
|
) });
|
|
424
428
|
});
|
|
425
429
|
Table.displayName = "Table";
|
|
426
|
-
var TableHeader =
|
|
430
|
+
var TableHeader = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
427
431
|
TableHeader.displayName = "TableHeader";
|
|
428
|
-
var TableBody =
|
|
432
|
+
var TableBody = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
429
433
|
"tbody",
|
|
430
434
|
{
|
|
431
435
|
ref,
|
|
@@ -434,7 +438,7 @@ var TableBody = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
434
438
|
}
|
|
435
439
|
));
|
|
436
440
|
TableBody.displayName = "TableBody";
|
|
437
|
-
var TableFooter =
|
|
441
|
+
var TableFooter = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
438
442
|
"tfoot",
|
|
439
443
|
{
|
|
440
444
|
ref,
|
|
@@ -465,7 +469,7 @@ var tableRowVariantsConfig = cva(
|
|
|
465
469
|
}
|
|
466
470
|
}
|
|
467
471
|
);
|
|
468
|
-
var TableRow =
|
|
472
|
+
var TableRow = React35.forwardRef(
|
|
469
473
|
({ className, variant: variant3 = "first", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
470
474
|
"tr",
|
|
471
475
|
{
|
|
@@ -476,7 +480,7 @@ var TableRow = React8.forwardRef(
|
|
|
476
480
|
)
|
|
477
481
|
);
|
|
478
482
|
TableRow.displayName = "TableRow";
|
|
479
|
-
var TableHead =
|
|
483
|
+
var TableHead = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
480
484
|
"th",
|
|
481
485
|
{
|
|
482
486
|
ref,
|
|
@@ -488,7 +492,7 @@ var TableHead = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
488
492
|
}
|
|
489
493
|
));
|
|
490
494
|
TableHead.displayName = "TableHead";
|
|
491
|
-
var TableCell =
|
|
495
|
+
var TableCell = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
492
496
|
"td",
|
|
493
497
|
{
|
|
494
498
|
ref,
|
|
@@ -500,14 +504,14 @@ var TableCell = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
500
504
|
}
|
|
501
505
|
));
|
|
502
506
|
TableCell.displayName = "TableCell";
|
|
503
|
-
var TableCaption =
|
|
507
|
+
var TableCaption = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 text-sm", className), ...props }));
|
|
504
508
|
TableCaption.displayName = "TableCaption";
|
|
505
509
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
506
510
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
507
511
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
508
512
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
509
513
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
510
|
-
var DropdownMenuSubTrigger =
|
|
514
|
+
var DropdownMenuSubTrigger = React35.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
511
515
|
DropdownMenuPrimitive.SubTrigger,
|
|
512
516
|
{
|
|
513
517
|
ref,
|
|
@@ -539,8 +543,8 @@ var DropdownMenuSubTrigger = React8.forwardRef(({ className, inset, children, ..
|
|
|
539
543
|
}
|
|
540
544
|
));
|
|
541
545
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
542
|
-
var DropdownMenuSubContent =
|
|
543
|
-
const Comp = portal ? DropdownMenuPrimitive.Portal :
|
|
546
|
+
var DropdownMenuSubContent = React35.forwardRef(({ className, portal = false, ...props }, ref) => {
|
|
547
|
+
const Comp = portal ? DropdownMenuPrimitive.Portal : React35.Fragment;
|
|
544
548
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsx(
|
|
545
549
|
DropdownMenuPrimitive.SubContent,
|
|
546
550
|
{
|
|
@@ -565,8 +569,8 @@ var DropdownMenuSubContent = React8.forwardRef(({ className, portal = false, ...
|
|
|
565
569
|
) });
|
|
566
570
|
});
|
|
567
571
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
568
|
-
var DropdownMenuContent =
|
|
569
|
-
const Comp = portal ? DropdownMenuPrimitive.Portal :
|
|
572
|
+
var DropdownMenuContent = React35.forwardRef(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
573
|
+
const Comp = portal ? DropdownMenuPrimitive.Portal : React35.Fragment;
|
|
570
574
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsx(
|
|
571
575
|
DropdownMenuPrimitive.Content,
|
|
572
576
|
{
|
|
@@ -594,7 +598,7 @@ var DropdownMenuContent = React8.forwardRef(({ className, sideOffset = 4, portal
|
|
|
594
598
|
) });
|
|
595
599
|
});
|
|
596
600
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
597
|
-
var DropdownMenuItem =
|
|
601
|
+
var DropdownMenuItem = React35.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
598
602
|
DropdownMenuPrimitive.Item,
|
|
599
603
|
{
|
|
600
604
|
ref,
|
|
@@ -627,7 +631,7 @@ var DropdownMenuItem = React8.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
627
631
|
}
|
|
628
632
|
));
|
|
629
633
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
630
|
-
var DropdownMenuCheckboxItem =
|
|
634
|
+
var DropdownMenuCheckboxItem = React35.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
631
635
|
DropdownMenuPrimitive.CheckboxItem,
|
|
632
636
|
{
|
|
633
637
|
ref,
|
|
@@ -665,7 +669,7 @@ var DropdownMenuCheckboxItem = React8.forwardRef(({ className, children, checked
|
|
|
665
669
|
}
|
|
666
670
|
));
|
|
667
671
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
668
|
-
var DropdownMenuRadioItem =
|
|
672
|
+
var DropdownMenuRadioItem = React35.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
669
673
|
DropdownMenuPrimitive.RadioItem,
|
|
670
674
|
{
|
|
671
675
|
ref,
|
|
@@ -701,7 +705,7 @@ var DropdownMenuRadioItem = React8.forwardRef(({ className, children, ...props }
|
|
|
701
705
|
}
|
|
702
706
|
));
|
|
703
707
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
704
|
-
var DropdownMenuLabel =
|
|
708
|
+
var DropdownMenuLabel = React35.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
705
709
|
DropdownMenuPrimitive.Label,
|
|
706
710
|
{
|
|
707
711
|
ref,
|
|
@@ -721,7 +725,7 @@ var DropdownMenuLabel = React8.forwardRef(({ className, inset, ...props }, ref)
|
|
|
721
725
|
}
|
|
722
726
|
));
|
|
723
727
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
724
|
-
var DropdownMenuSeparator =
|
|
728
|
+
var DropdownMenuSeparator = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
725
729
|
DropdownMenuPrimitive.Separator,
|
|
726
730
|
{
|
|
727
731
|
ref,
|
|
@@ -771,7 +775,7 @@ var separatorVariantsConfig = cva("shrink-0 bg-separator-border-default", {
|
|
|
771
775
|
}
|
|
772
776
|
});
|
|
773
777
|
var separatorVariants = extractVariants(variants3);
|
|
774
|
-
var Separator2 =
|
|
778
|
+
var Separator2 = React35.forwardRef(
|
|
775
779
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
|
|
776
780
|
return /* @__PURE__ */ jsx(
|
|
777
781
|
SeparatorPrimitive.Root,
|
|
@@ -820,7 +824,7 @@ var spaceVariantsConfig = cva("flex items-start justify-start", {
|
|
|
820
824
|
direction: "row"
|
|
821
825
|
}
|
|
822
826
|
});
|
|
823
|
-
var Space =
|
|
827
|
+
var Space = React35__default.forwardRef(
|
|
824
828
|
({ size: size4, direction: direction2, className, children }, ref) => {
|
|
825
829
|
return /* @__PURE__ */ jsx(
|
|
826
830
|
"div",
|
|
@@ -1765,9 +1769,9 @@ var setNebulaLanguage = (language) => {
|
|
|
1765
1769
|
var messages19 = /* @__PURE__ */ new Map([
|
|
1766
1770
|
[null, enMessages],
|
|
1767
1771
|
[void 0, enMessages],
|
|
1768
|
-
["en-US"
|
|
1769
|
-
["es"
|
|
1770
|
-
["pt-BR"
|
|
1772
|
+
["en-US" /* EN_US */, enMessages],
|
|
1773
|
+
["es" /* ES */, esMessages],
|
|
1774
|
+
["pt-BR" /* PT_BR */, ptBrMessages]
|
|
1771
1775
|
]);
|
|
1772
1776
|
var NebulaI18nContext = createContext(
|
|
1773
1777
|
null
|
|
@@ -1781,13 +1785,13 @@ var NebulaI18nProvider = ({
|
|
|
1781
1785
|
[customI18nStorageKey]
|
|
1782
1786
|
);
|
|
1783
1787
|
const [messages20, setMessages] = useState(
|
|
1784
|
-
messages19.get(getNebulaLanguage()) ?? messages19.get("en-US")
|
|
1788
|
+
messages19.get(getNebulaLanguage()) ?? messages19.get("en-US" /* EN_US */)
|
|
1785
1789
|
);
|
|
1786
1790
|
const handleStorageChange = useCallback(
|
|
1787
1791
|
({ detail }) => {
|
|
1788
1792
|
if (detail.key === storageKey) {
|
|
1789
1793
|
setMessages(
|
|
1790
|
-
messages19.get(detail.value) ?? messages19.get("en-US")
|
|
1794
|
+
messages19.get(detail.value) ?? messages19.get("en-US" /* EN_US */)
|
|
1791
1795
|
);
|
|
1792
1796
|
}
|
|
1793
1797
|
},
|
|
@@ -2072,7 +2076,7 @@ var tagVariantsConfig = cva("w-2 h-2 block rounded-sm", {
|
|
|
2072
2076
|
color
|
|
2073
2077
|
}
|
|
2074
2078
|
});
|
|
2075
|
-
var Tag =
|
|
2079
|
+
var Tag = React35.forwardRef(
|
|
2076
2080
|
({ className, color: color2, children, onDelete, ...props }, ref) => {
|
|
2077
2081
|
return /* @__PURE__ */ jsxs(
|
|
2078
2082
|
"div",
|
|
@@ -2227,12 +2231,12 @@ var StyledAsyncCreatable = createStyledSelect(
|
|
|
2227
2231
|
AsyncCreatable,
|
|
2228
2232
|
"AsyncCreatable"
|
|
2229
2233
|
);
|
|
2230
|
-
var InputText =
|
|
2234
|
+
var InputText = React35.forwardRef(
|
|
2231
2235
|
({ className, isError = false, onClean, disabled, suffix, ...props }, ref) => {
|
|
2232
2236
|
const icon = "icon" in props ? props.icon : null;
|
|
2233
2237
|
const iconPlacement = "iconPlacement" in props || props.type !== "password" ? props.iconPlacement || "start" : null;
|
|
2234
2238
|
const initialInputType = props.type || "text";
|
|
2235
|
-
const [type, setType] =
|
|
2239
|
+
const [type, setType] = React35.useState(initialInputType);
|
|
2236
2240
|
const iconClass = {
|
|
2237
2241
|
"text-inputText-icon-danger": isError,
|
|
2238
2242
|
"text-inputText-icon-default focus:text-inputText-icon-focus": !isError && !props.value,
|
|
@@ -2340,7 +2344,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
2340
2344
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2341
2345
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2342
2346
|
var DialogClose = DialogPrimitive.Close;
|
|
2343
|
-
var DialogOverlay =
|
|
2347
|
+
var DialogOverlay = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2344
2348
|
DialogPrimitive.Overlay,
|
|
2345
2349
|
{
|
|
2346
2350
|
ref,
|
|
@@ -2359,9 +2363,9 @@ var DialogOverlay = React8.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2359
2363
|
}
|
|
2360
2364
|
));
|
|
2361
2365
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
2362
|
-
var DialogContent =
|
|
2366
|
+
var DialogContent = React35.forwardRef(
|
|
2363
2367
|
({ className, children, portal = false, showClose = true, ...props }, ref) => {
|
|
2364
|
-
const Comp = portal ? DialogPortal :
|
|
2368
|
+
const Comp = portal ? DialogPortal : React35.Fragment;
|
|
2365
2369
|
return /* @__PURE__ */ jsxs(Comp, { children: [
|
|
2366
2370
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
2367
2371
|
/* @__PURE__ */ jsxs(
|
|
@@ -2440,7 +2444,7 @@ var DialogFooter = ({
|
|
|
2440
2444
|
...props
|
|
2441
2445
|
}) => /* @__PURE__ */ jsx("div", { className: cn("flex gap-2", className), ...props });
|
|
2442
2446
|
DialogFooter.displayName = "DialogFooter";
|
|
2443
|
-
var DialogTitle =
|
|
2447
|
+
var DialogTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2444
2448
|
DialogPrimitive.Title,
|
|
2445
2449
|
{
|
|
2446
2450
|
ref,
|
|
@@ -2452,7 +2456,7 @@ var DialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2452
2456
|
}
|
|
2453
2457
|
));
|
|
2454
2458
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2455
|
-
var DialogDescription =
|
|
2459
|
+
var DialogDescription = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2456
2460
|
DialogPrimitive.Description,
|
|
2457
2461
|
{
|
|
2458
2462
|
ref,
|
|
@@ -2464,7 +2468,7 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
2464
2468
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
2465
2469
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
2466
2470
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2467
|
-
var AlertDialogOverlay =
|
|
2471
|
+
var AlertDialogOverlay = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2468
2472
|
AlertDialogPrimitive.Overlay,
|
|
2469
2473
|
{
|
|
2470
2474
|
className: cn(
|
|
@@ -2476,8 +2480,8 @@ var AlertDialogOverlay = React8.forwardRef(({ className, ...props }, ref) => /*
|
|
|
2476
2480
|
}
|
|
2477
2481
|
));
|
|
2478
2482
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
2479
|
-
var AlertDialogContent =
|
|
2480
|
-
const Comp = portal ? AlertDialogPortal :
|
|
2483
|
+
var AlertDialogContent = React35.forwardRef(({ className, portal = false, ...props }, ref) => {
|
|
2484
|
+
const Comp = portal ? AlertDialogPortal : React35.Fragment;
|
|
2481
2485
|
return /* @__PURE__ */ jsxs(Comp, { children: [
|
|
2482
2486
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
2483
2487
|
/* @__PURE__ */ jsx(
|
|
@@ -2513,7 +2517,7 @@ var AlertDialogFooter = ({
|
|
|
2513
2517
|
...props
|
|
2514
2518
|
}) => /* @__PURE__ */ jsx("div", { className: cn("flex gap-2", className), ...props });
|
|
2515
2519
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
2516
|
-
var AlertDialogTitle =
|
|
2520
|
+
var AlertDialogTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2517
2521
|
AlertDialogPrimitive.Title,
|
|
2518
2522
|
{
|
|
2519
2523
|
ref,
|
|
@@ -2525,7 +2529,7 @@ var AlertDialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
2525
2529
|
}
|
|
2526
2530
|
));
|
|
2527
2531
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
2528
|
-
var AlertDialogDescription =
|
|
2532
|
+
var AlertDialogDescription = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2529
2533
|
AlertDialogPrimitive.Description,
|
|
2530
2534
|
{
|
|
2531
2535
|
ref,
|
|
@@ -2534,7 +2538,7 @@ var AlertDialogDescription = React8.forwardRef(({ className, ...props }, ref) =>
|
|
|
2534
2538
|
}
|
|
2535
2539
|
));
|
|
2536
2540
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
2537
|
-
var AlertDialogAction =
|
|
2541
|
+
var AlertDialogAction = React35.forwardRef(({ children, className, variant: variant3, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2538
2542
|
AlertDialogPrimitive.Action,
|
|
2539
2543
|
{
|
|
2540
2544
|
ref,
|
|
@@ -2544,7 +2548,7 @@ var AlertDialogAction = React8.forwardRef(({ children, className, variant: varia
|
|
|
2544
2548
|
}
|
|
2545
2549
|
));
|
|
2546
2550
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
2547
|
-
var AlertDialogCancel =
|
|
2551
|
+
var AlertDialogCancel = React35.forwardRef(({ children, className, variant: variant3 = "secondary", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2548
2552
|
AlertDialogPrimitive.Cancel,
|
|
2549
2553
|
{
|
|
2550
2554
|
ref,
|
|
@@ -2554,7 +2558,7 @@ var AlertDialogCancel = React8.forwardRef(({ children, className, variant: varia
|
|
|
2554
2558
|
}
|
|
2555
2559
|
));
|
|
2556
2560
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
2557
|
-
var Checkbox =
|
|
2561
|
+
var Checkbox = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2558
2562
|
CheckboxPrimitive.Root,
|
|
2559
2563
|
{
|
|
2560
2564
|
ref,
|
|
@@ -2609,7 +2613,7 @@ var Drawer = DialogPrimitive.Root;
|
|
|
2609
2613
|
var DrawerTrigger = DialogPrimitive.Trigger;
|
|
2610
2614
|
var DrawerClose = DialogPrimitive.Close;
|
|
2611
2615
|
var DrawerPortal = DialogPrimitive.Portal;
|
|
2612
|
-
var DrawerOverlay =
|
|
2616
|
+
var DrawerOverlay = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2613
2617
|
DialogPrimitive.Overlay,
|
|
2614
2618
|
{
|
|
2615
2619
|
className: cn(
|
|
@@ -2634,8 +2638,8 @@ var DrawerVariants = cva("fixed flex flex-col z-50 shadow-lg", {
|
|
|
2634
2638
|
side: "right"
|
|
2635
2639
|
}
|
|
2636
2640
|
});
|
|
2637
|
-
var DrawerContent =
|
|
2638
|
-
const Comp = portal ? DrawerPortal :
|
|
2641
|
+
var DrawerContent = React35.forwardRef(({ side = "right", className, portal = false, children, ...props }, ref) => {
|
|
2642
|
+
const Comp = portal ? DrawerPortal : React35.Fragment;
|
|
2639
2643
|
return /* @__PURE__ */ jsxs(Comp, { children: [
|
|
2640
2644
|
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
2641
2645
|
/* @__PURE__ */ jsx(
|
|
@@ -2701,7 +2705,7 @@ var DrawerFooter = ({
|
|
|
2701
2705
|
}
|
|
2702
2706
|
);
|
|
2703
2707
|
DrawerFooter.displayName = "DrawerFooter";
|
|
2704
|
-
var DrawerTitle =
|
|
2708
|
+
var DrawerTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2705
2709
|
DialogPrimitive.Title,
|
|
2706
2710
|
{
|
|
2707
2711
|
ref,
|
|
@@ -2713,7 +2717,7 @@ var DrawerTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2713
2717
|
}
|
|
2714
2718
|
));
|
|
2715
2719
|
DrawerTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2716
|
-
var DrawerDescription =
|
|
2720
|
+
var DrawerDescription = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2717
2721
|
DialogPrimitive.Description,
|
|
2718
2722
|
{
|
|
2719
2723
|
ref,
|
|
@@ -2722,9 +2726,9 @@ var DrawerDescription = React8.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2722
2726
|
}
|
|
2723
2727
|
));
|
|
2724
2728
|
DrawerDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2725
|
-
var Breadcrumb =
|
|
2729
|
+
var Breadcrumb = React35.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
2726
2730
|
Breadcrumb.displayName = "Breadcrumb";
|
|
2727
|
-
var BreadcrumbList =
|
|
2731
|
+
var BreadcrumbList = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2728
2732
|
"ol",
|
|
2729
2733
|
{
|
|
2730
2734
|
ref,
|
|
@@ -2736,7 +2740,7 @@ var BreadcrumbList = React8.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2736
2740
|
}
|
|
2737
2741
|
));
|
|
2738
2742
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
2739
|
-
var BreadcrumbItem =
|
|
2743
|
+
var BreadcrumbItem = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2740
2744
|
"li",
|
|
2741
2745
|
{
|
|
2742
2746
|
ref,
|
|
@@ -2748,7 +2752,7 @@ var BreadcrumbItem = React8.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2748
2752
|
}
|
|
2749
2753
|
));
|
|
2750
2754
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
2751
|
-
var BreadcrumbLink =
|
|
2755
|
+
var BreadcrumbLink = React35.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
2752
2756
|
const Comp = asChild ? Slot : "a";
|
|
2753
2757
|
return /* @__PURE__ */ jsx(
|
|
2754
2758
|
Comp,
|
|
@@ -2763,7 +2767,7 @@ var BreadcrumbLink = React8.forwardRef(({ asChild, className, ...props }, ref) =
|
|
|
2763
2767
|
);
|
|
2764
2768
|
});
|
|
2765
2769
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
2766
|
-
var BreadcrumbPage =
|
|
2770
|
+
var BreadcrumbPage = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2767
2771
|
"span",
|
|
2768
2772
|
{
|
|
2769
2773
|
ref,
|
|
@@ -2810,7 +2814,7 @@ var BreadcrumbEllipsis = ({
|
|
|
2810
2814
|
}
|
|
2811
2815
|
);
|
|
2812
2816
|
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
2813
|
-
var Switch =
|
|
2817
|
+
var Switch = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2814
2818
|
SwitchPrimitives.Root,
|
|
2815
2819
|
{
|
|
2816
2820
|
className: cn(
|
|
@@ -2869,7 +2873,7 @@ var Switch = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
2869
2873
|
}
|
|
2870
2874
|
));
|
|
2871
2875
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
2872
|
-
var Tooltip =
|
|
2876
|
+
var Tooltip = React35.forwardRef(
|
|
2873
2877
|
({
|
|
2874
2878
|
children,
|
|
2875
2879
|
content: content2,
|
|
@@ -2880,7 +2884,7 @@ var Tooltip = React8.forwardRef(
|
|
|
2880
2884
|
className,
|
|
2881
2885
|
...props
|
|
2882
2886
|
}, ref) => {
|
|
2883
|
-
const Comp = portal ? TooltipPrimitive.Portal :
|
|
2887
|
+
const Comp = portal ? TooltipPrimitive.Portal : React35.Fragment;
|
|
2884
2888
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { children: [
|
|
2885
2889
|
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { type: "button", children }),
|
|
2886
2890
|
/* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsxs(
|
|
@@ -3027,11 +3031,11 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
3027
3031
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
3028
3032
|
AccordionTitle.displayName = "AccordionTitle";
|
|
3029
3033
|
AccordionDescription.displayName = "AccordionDescription";
|
|
3030
|
-
var TabsContext =
|
|
3031
|
-
var Tabs =
|
|
3034
|
+
var TabsContext = React35.createContext({});
|
|
3035
|
+
var Tabs = React35.forwardRef(({ isFitted, children, ...props }, ref) => /* @__PURE__ */ jsx(TabsContext.Provider, { value: { isFitted }, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { ref, ...props, children }) }));
|
|
3032
3036
|
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
3033
|
-
var TabsList =
|
|
3034
|
-
const { isFitted } =
|
|
3037
|
+
var TabsList = React35.forwardRef(({ className, ...props }, ref) => {
|
|
3038
|
+
const { isFitted } = React35.useContext(TabsContext);
|
|
3035
3039
|
return /* @__PURE__ */ jsx(
|
|
3036
3040
|
TabsPrimitive.List,
|
|
3037
3041
|
{
|
|
@@ -3052,8 +3056,8 @@ var TabsList = React8.forwardRef(({ className, ...props }, ref) => {
|
|
|
3052
3056
|
);
|
|
3053
3057
|
});
|
|
3054
3058
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
3055
|
-
var TabsTrigger =
|
|
3056
|
-
const { isFitted } =
|
|
3059
|
+
var TabsTrigger = React35.forwardRef(({ className, ...props }, ref) => {
|
|
3060
|
+
const { isFitted } = React35.useContext(TabsContext);
|
|
3057
3061
|
return /* @__PURE__ */ jsx(
|
|
3058
3062
|
TabsPrimitive.Trigger,
|
|
3059
3063
|
{
|
|
@@ -3092,7 +3096,7 @@ var TabsTrigger = React8.forwardRef(({ className, ...props }, ref) => {
|
|
|
3092
3096
|
);
|
|
3093
3097
|
});
|
|
3094
3098
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
3095
|
-
var TabsContent =
|
|
3099
|
+
var TabsContent = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3096
3100
|
TabsPrimitive.Content,
|
|
3097
3101
|
{
|
|
3098
3102
|
ref,
|
|
@@ -3156,7 +3160,7 @@ function ToastComponent({
|
|
|
3156
3160
|
options,
|
|
3157
3161
|
t
|
|
3158
3162
|
}) {
|
|
3159
|
-
const CustomIcon =
|
|
3163
|
+
const CustomIcon = React35__default.isValidElement(options?.icon) ? React35__default.cloneElement(options.icon, {
|
|
3160
3164
|
className: cn("text-toast-icon-default", options.icon.props.className),
|
|
3161
3165
|
size: 20
|
|
3162
3166
|
}) : null;
|
|
@@ -3282,15 +3286,15 @@ var toast = {
|
|
|
3282
3286
|
custom,
|
|
3283
3287
|
promise
|
|
3284
3288
|
};
|
|
3285
|
-
var ActionBar =
|
|
3289
|
+
var ActionBar = React35.forwardRef(({ ...props }) => /* @__PURE__ */ jsx(DialogPrimitive.Root, { modal: false, ...props }));
|
|
3286
3290
|
ActionBar.displayName = "ActionBar";
|
|
3287
|
-
var ActionBarTrigger =
|
|
3291
|
+
var ActionBarTrigger = React35.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ref, ...props }));
|
|
3288
3292
|
ActionBarTrigger.displayName = "ActionBarTrigger";
|
|
3289
3293
|
var ActionBarPortal = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...props });
|
|
3290
3294
|
ActionBarPortal.displayName = "ActionBarPortal";
|
|
3291
|
-
var ActionBarClose =
|
|
3295
|
+
var ActionBarClose = React35.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Close, { ref, ...props }));
|
|
3292
3296
|
ActionBarClose.displayName = "ActionBarClose";
|
|
3293
|
-
var ActionBarButton =
|
|
3297
|
+
var ActionBarButton = React35.forwardRef(
|
|
3294
3298
|
({ className, ...props }, ref) => {
|
|
3295
3299
|
return /* @__PURE__ */ jsx(
|
|
3296
3300
|
Button,
|
|
@@ -3305,7 +3309,7 @@ var ActionBarButton = React8.forwardRef(
|
|
|
3305
3309
|
}
|
|
3306
3310
|
);
|
|
3307
3311
|
ActionBarButton.displayName = "ActionBarButton";
|
|
3308
|
-
var ActionBarDivider =
|
|
3312
|
+
var ActionBarDivider = React35.forwardRef(({ className, ...props }, ref) => {
|
|
3309
3313
|
return /* @__PURE__ */ jsx(
|
|
3310
3314
|
Separator2,
|
|
3311
3315
|
{
|
|
@@ -3317,8 +3321,8 @@ var ActionBarDivider = React8.forwardRef(({ className, ...props }, ref) => {
|
|
|
3317
3321
|
);
|
|
3318
3322
|
});
|
|
3319
3323
|
ActionBarDivider.displayName = "ActionBarDivider";
|
|
3320
|
-
var ActionBarContent =
|
|
3321
|
-
const Comp = portal ? ActionBarPortal :
|
|
3324
|
+
var ActionBarContent = React35.forwardRef(({ className, children, portal = false, ...props }, ref) => {
|
|
3325
|
+
const Comp = portal ? ActionBarPortal : React35.Fragment;
|
|
3322
3326
|
return /* @__PURE__ */ jsx(Comp, { children: /* @__PURE__ */ jsxs(
|
|
3323
3327
|
DialogPrimitive.Content,
|
|
3324
3328
|
{
|
|
@@ -3366,7 +3370,7 @@ var Heading = forwardRef(
|
|
|
3366
3370
|
[level]
|
|
3367
3371
|
);
|
|
3368
3372
|
if (!element) return null;
|
|
3369
|
-
return
|
|
3373
|
+
return React35__default.createElement(element, {
|
|
3370
3374
|
...rest,
|
|
3371
3375
|
ref,
|
|
3372
3376
|
className: cn(headingStyles, className)
|
|
@@ -3466,7 +3470,7 @@ var FlagComponent = ({ country, countryName }) => {
|
|
|
3466
3470
|
const Flag = flags[country];
|
|
3467
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" }) });
|
|
3468
3472
|
};
|
|
3469
|
-
var PhoneInput =
|
|
3473
|
+
var PhoneInput = React35__default.forwardRef(({ className, ...props }, ref) => {
|
|
3470
3474
|
return /* @__PURE__ */ jsxs("div", { className: "nebula-ds flex items-center justify-center rounded-e-[20px] w-full", children: [
|
|
3471
3475
|
/* @__PURE__ */ jsx(Separator2, { orientation: "vertical", className: "nebula-ds w-[1px] h-5 z-10" }),
|
|
3472
3476
|
/* @__PURE__ */ jsx(
|
|
@@ -3557,7 +3561,7 @@ function InputPhone({
|
|
|
3557
3561
|
}
|
|
3558
3562
|
);
|
|
3559
3563
|
}
|
|
3560
|
-
var Skeleton =
|
|
3564
|
+
var Skeleton = React35__default.forwardRef(
|
|
3561
3565
|
({ className, ...rest }, ref) => {
|
|
3562
3566
|
return /* @__PURE__ */ jsx(
|
|
3563
3567
|
"div",
|
|
@@ -3968,6 +3972,24 @@ var formatDateToSubmit = (dateStr, timeFallback = "23:59") => {
|
|
|
3968
3972
|
};
|
|
3969
3973
|
|
|
3970
3974
|
// src/utils/valid-date-format.ts
|
|
3975
|
+
function dateParts(dateSlice, locale, time) {
|
|
3976
|
+
const [day, month, year] = [
|
|
3977
|
+
locale !== "en-US" /* EN_US */ ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
|
|
3978
|
+
locale === "en-US" /* EN_US */ ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
|
|
3979
|
+
dateSlice.substring(6)
|
|
3980
|
+
];
|
|
3981
|
+
const [hour = 0, minute = 0] = time?.split(":") ?? [];
|
|
3982
|
+
return {
|
|
3983
|
+
date: new Date(
|
|
3984
|
+
Number(year),
|
|
3985
|
+
Number(month) - 1,
|
|
3986
|
+
Number(day),
|
|
3987
|
+
Number(Math.min(Math.max(Number(hour), 0), 23)),
|
|
3988
|
+
Number(Math.min(Math.max(Number(minute), 0), 59))
|
|
3989
|
+
),
|
|
3990
|
+
dateParts: [Number(day), Number(month), Number(year)]
|
|
3991
|
+
};
|
|
3992
|
+
}
|
|
3971
3993
|
function dateFormatIsValid(dateStr, locale) {
|
|
3972
3994
|
const regexBR = /^(?:(?:31\/(0[13578]|1[02]))\/(?:\d{4})|(?:29|30)\/(0[13-9]|1[0-2])\/(?:\d{4})|29\/02\/(?:\d\d(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)|(?:0[1-9]|1\d|2[0-8])\/(0[1-9]|1[0-2])\/(?:\d{4}))$/;
|
|
3973
3995
|
const regexUS = /^(?:(?:(0[13578]|1[02])\/31)\/(?:\d{4})|(?:(0[13-9]|1[0-2])\/(29|30))\/(?:\d{4})|(?:02\/29)\/(?:\d\d(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)|(?:(0[1-9]|1[0-2])\/(0[1-9]|1\d|2[0-8]))\/(?:\d{4}))$/;
|
|
@@ -4048,13 +4070,8 @@ var InputDatePickerSingle = ({
|
|
|
4048
4070
|
handleClearValue();
|
|
4049
4071
|
return;
|
|
4050
4072
|
}
|
|
4051
|
-
const
|
|
4052
|
-
|
|
4053
|
-
locale === "en-US" ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
|
|
4054
|
-
dateSlice.substring(6)
|
|
4055
|
-
];
|
|
4056
|
-
const date = new Date(Number(year), Number(month2) - 1, Number(day));
|
|
4057
|
-
if ([day, month2, year].some((value2) => !value2) || !dateFormatIsValid(dateSlice, locale) || !isValid(new Date(date)) || !dateIsAvailable(date, disabledDates)) {
|
|
4073
|
+
const { date } = dateParts(dateSlice, locale);
|
|
4074
|
+
if (!isValid(date) || !dateFormatIsValid(dateSlice, locale) || !dateIsAvailable(date, disabledDates)) {
|
|
4058
4075
|
onChange?.(text);
|
|
4059
4076
|
handleClearValue();
|
|
4060
4077
|
return;
|
|
@@ -4272,13 +4289,8 @@ var InputDateTimePickerSingle = ({
|
|
|
4272
4289
|
handleClearValue();
|
|
4273
4290
|
return;
|
|
4274
4291
|
}
|
|
4275
|
-
const
|
|
4276
|
-
|
|
4277
|
-
locale === "en-US" ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
|
|
4278
|
-
dateSlice.substring(6)
|
|
4279
|
-
];
|
|
4280
|
-
const date = new Date(Number(year), Number(month2) - 1, Number(day));
|
|
4281
|
-
if ([day, month2, year].some((value2) => !value2) || !dateFormatIsValid(dateSlice, locale) || !isValid(new Date(date)) || !dateIsAvailable(date, disabledDates)) {
|
|
4292
|
+
const date = dateParts(dateSlice, locale, hourSlice).date;
|
|
4293
|
+
if (!isValid(date) || !dateFormatIsValid(dateSlice, locale) || !dateIsAvailable(date, disabledDates)) {
|
|
4282
4294
|
onChange?.(text);
|
|
4283
4295
|
handleClearValue();
|
|
4284
4296
|
return;
|
|
@@ -4449,6 +4461,143 @@ var InputDateTimePickerSingle = ({
|
|
|
4449
4461
|
) })
|
|
4450
4462
|
] });
|
|
4451
4463
|
};
|
|
4464
|
+
var InputDateRangePicker = ({
|
|
4465
|
+
placeholder,
|
|
4466
|
+
className,
|
|
4467
|
+
value,
|
|
4468
|
+
onChange,
|
|
4469
|
+
numberOfMonths = 1,
|
|
4470
|
+
onClean,
|
|
4471
|
+
disabledDates,
|
|
4472
|
+
...rest
|
|
4473
|
+
}) => {
|
|
4474
|
+
const [month, setMonth] = useState(/* @__PURE__ */ new Date());
|
|
4475
|
+
const [innerValue, setInnerValue] = useState();
|
|
4476
|
+
const [popoverIsOpen, setPopoverIsOpen] = useState(false);
|
|
4477
|
+
const maskOptions = {
|
|
4478
|
+
mask: "__/__/____ - __/__/____",
|
|
4479
|
+
replacement: { _: /\d/ }
|
|
4480
|
+
};
|
|
4481
|
+
const inputRef = useMask(maskOptions);
|
|
4482
|
+
const { locale } = useNebulaI18n();
|
|
4483
|
+
const conteinerRef = useRef(null);
|
|
4484
|
+
const calendarRef = useRef(null);
|
|
4485
|
+
useClickOutside([conteinerRef, calendarRef], () => {
|
|
4486
|
+
setPopoverIsOpen(false);
|
|
4487
|
+
});
|
|
4488
|
+
useKeyPress("Escape", () => {
|
|
4489
|
+
setPopoverIsOpen(false);
|
|
4490
|
+
});
|
|
4491
|
+
const handleInnerInputChange = (value2) => {
|
|
4492
|
+
const [startDate, endDate] = value2.split(" - ");
|
|
4493
|
+
const dateStart = startDate && dateFormatIsValid(startDate, locale) ? dateParts(startDate, locale).date : void 0;
|
|
4494
|
+
const dateEnd = endDate && dateFormatIsValid(endDate, locale) ? dateParts(endDate, locale).date : void 0;
|
|
4495
|
+
onChange?.(value2, [dateStart, dateEnd]);
|
|
4496
|
+
};
|
|
4497
|
+
const handleChangeCalendarDate = useCallback(
|
|
4498
|
+
(date) => {
|
|
4499
|
+
setInnerValue(date);
|
|
4500
|
+
const [from, to] = date;
|
|
4501
|
+
const fromStr = from ? Intl.DateTimeFormat(locale ?? "en-US", {
|
|
4502
|
+
month: "2-digit",
|
|
4503
|
+
year: "numeric",
|
|
4504
|
+
day: "2-digit"
|
|
4505
|
+
}).format(from) : "";
|
|
4506
|
+
const toStr = to ? Intl.DateTimeFormat(locale ?? "en-US", {
|
|
4507
|
+
month: "2-digit",
|
|
4508
|
+
year: "numeric",
|
|
4509
|
+
day: "2-digit"
|
|
4510
|
+
}).format(to) : "";
|
|
4511
|
+
onChange?.(
|
|
4512
|
+
[fromStr, toStr !== fromStr ? toStr : void 0].filter(Boolean).join(" - "),
|
|
4513
|
+
date
|
|
4514
|
+
);
|
|
4515
|
+
setMonth(to ?? /* @__PURE__ */ new Date());
|
|
4516
|
+
},
|
|
4517
|
+
[locale, onChange]
|
|
4518
|
+
);
|
|
4519
|
+
useEffect(() => {
|
|
4520
|
+
if (value) {
|
|
4521
|
+
const [startDate, endDate] = value.split(" - ");
|
|
4522
|
+
const dateStart = startDate && dateFormatIsValid(startDate, locale) ? dateParts(startDate, locale).date : void 0;
|
|
4523
|
+
const dateEnd = endDate && dateFormatIsValid(endDate, locale) ? dateParts(endDate, locale).date : void 0;
|
|
4524
|
+
setInnerValue(
|
|
4525
|
+
[dateStart, dateEnd].filter(Boolean)
|
|
4526
|
+
);
|
|
4527
|
+
if (dateEnd instanceof Date) {
|
|
4528
|
+
setMonth(dateEnd);
|
|
4529
|
+
} else {
|
|
4530
|
+
setMonth(/* @__PURE__ */ new Date());
|
|
4531
|
+
}
|
|
4532
|
+
} else {
|
|
4533
|
+
setInnerValue([void 0, void 0]);
|
|
4534
|
+
setMonth(/* @__PURE__ */ new Date());
|
|
4535
|
+
}
|
|
4536
|
+
}, [value, locale]);
|
|
4537
|
+
return /* @__PURE__ */ jsxs("div", { className: "nebula-ds w-full", ref: conteinerRef, children: [
|
|
4538
|
+
/* @__PURE__ */ jsx(
|
|
4539
|
+
InputText,
|
|
4540
|
+
{
|
|
4541
|
+
ref: inputRef,
|
|
4542
|
+
placeholder,
|
|
4543
|
+
value,
|
|
4544
|
+
className,
|
|
4545
|
+
icon: /* @__PURE__ */ jsx(
|
|
4546
|
+
CalendarIcon,
|
|
4547
|
+
{
|
|
4548
|
+
tabIndex: 0,
|
|
4549
|
+
role: "button",
|
|
4550
|
+
onClick: () => setPopoverIsOpen((s) => !s),
|
|
4551
|
+
onKeyUp: (e) => {
|
|
4552
|
+
if (e.key === "Enter") {
|
|
4553
|
+
setPopoverIsOpen((s) => !s);
|
|
4554
|
+
}
|
|
4555
|
+
},
|
|
4556
|
+
className: "nebula-ds cursor-pointer"
|
|
4557
|
+
}
|
|
4558
|
+
),
|
|
4559
|
+
iconPlacement: "end",
|
|
4560
|
+
onKeyUp: (e) => {
|
|
4561
|
+
if (e.key === "ArrowDown") {
|
|
4562
|
+
setPopoverIsOpen(true);
|
|
4563
|
+
}
|
|
4564
|
+
},
|
|
4565
|
+
onClean: onClean ? () => {
|
|
4566
|
+
onClean();
|
|
4567
|
+
} : void 0,
|
|
4568
|
+
...rest,
|
|
4569
|
+
onChange: (e) => handleInnerInputChange(e.target.value)
|
|
4570
|
+
}
|
|
4571
|
+
),
|
|
4572
|
+
/* @__PURE__ */ jsx("div", { className: "nebula-ds relative", children: popoverIsOpen && /* @__PURE__ */ jsx(
|
|
4573
|
+
"div",
|
|
4574
|
+
{
|
|
4575
|
+
className: "nebula-ds absolute top-full left-0-0 z-40 pb-2 pt-1",
|
|
4576
|
+
ref: calendarRef,
|
|
4577
|
+
children: /* @__PURE__ */ jsx(
|
|
4578
|
+
Calendar,
|
|
4579
|
+
{
|
|
4580
|
+
required: false,
|
|
4581
|
+
mode: "range",
|
|
4582
|
+
numberOfMonths,
|
|
4583
|
+
disabled: disabledDates,
|
|
4584
|
+
month,
|
|
4585
|
+
onPrevClick: setMonth,
|
|
4586
|
+
onNextClick: setMonth,
|
|
4587
|
+
selected: {
|
|
4588
|
+
from: innerValue?.[0],
|
|
4589
|
+
to: innerValue?.[1]
|
|
4590
|
+
},
|
|
4591
|
+
onSelect: (date) => {
|
|
4592
|
+
handleChangeCalendarDate([date?.from, date?.to]);
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
)
|
|
4596
|
+
}
|
|
4597
|
+
) })
|
|
4598
|
+
] });
|
|
4599
|
+
};
|
|
4600
|
+
InputDateRangePicker.displayName = "InputDateRangePicker";
|
|
4452
4601
|
var FileUploadError = /* @__PURE__ */ ((FileUploadError4) => {
|
|
4453
4602
|
FileUploadError4["MAX_FILES_EXCEEDED"] = "MAX_FILES_EXCEEDED";
|
|
4454
4603
|
FileUploadError4["MAXIMUM_FILE_SIZE_EXCEEDED"] = "MAXIMUM_FILE_SIZE_EXCEEDED";
|
|
@@ -4798,7 +4947,7 @@ function FileUpload({
|
|
|
4798
4947
|
});
|
|
4799
4948
|
useEffect(() => {
|
|
4800
4949
|
onError?.(errors);
|
|
4801
|
-
}, [errors]);
|
|
4950
|
+
}, [errors, onError]);
|
|
4802
4951
|
const disabled = useMemo(() => {
|
|
4803
4952
|
if (rest.disabled) return true;
|
|
4804
4953
|
if (rest.multiple) {
|
|
@@ -4904,7 +5053,7 @@ function FileUpload({
|
|
|
4904
5053
|
] });
|
|
4905
5054
|
}
|
|
4906
5055
|
FileUpload.displayName = "FileUpload";
|
|
4907
|
-
var TextArea =
|
|
5056
|
+
var TextArea = React35.forwardRef(
|
|
4908
5057
|
({
|
|
4909
5058
|
className,
|
|
4910
5059
|
isError = false,
|
|
@@ -4916,14 +5065,14 @@ var TextArea = React8.forwardRef(
|
|
|
4916
5065
|
asInput,
|
|
4917
5066
|
...props
|
|
4918
5067
|
}, ref) => {
|
|
4919
|
-
const innerRef =
|
|
5068
|
+
const innerRef = React35.useRef(
|
|
4920
5069
|
null
|
|
4921
5070
|
);
|
|
4922
|
-
const [count, setCount] =
|
|
5071
|
+
const [count, setCount] = React35.useState(String(props.value ?? "").length);
|
|
4923
5072
|
const countParts = [count, maxLength].filter(
|
|
4924
5073
|
(part) => typeof part === "number"
|
|
4925
5074
|
);
|
|
4926
|
-
|
|
5075
|
+
React35.useEffect(() => {
|
|
4927
5076
|
const textarea = innerRef.current;
|
|
4928
5077
|
if (!textarea || !autoResize) return;
|
|
4929
5078
|
const adjustHeight = () => {
|
|
@@ -4936,7 +5085,7 @@ var TextArea = React8.forwardRef(
|
|
|
4936
5085
|
textarea.removeEventListener("input", adjustHeight);
|
|
4937
5086
|
};
|
|
4938
5087
|
}, [asInput, autoResize, props.value]);
|
|
4939
|
-
|
|
5088
|
+
React35.useImperativeHandle(ref, () => innerRef.current);
|
|
4940
5089
|
return /* @__PURE__ */ jsxs("div", { className: "nebula-ds relative w-full", children: [
|
|
4941
5090
|
/* @__PURE__ */ jsx(
|
|
4942
5091
|
"div",
|
|
@@ -5657,7 +5806,7 @@ var CropperImage = ({ className, ...restProps }) => {
|
|
|
5657
5806
|
const { image, getImageProps, getImageWrapperStyle } = useCropperContext();
|
|
5658
5807
|
if (!image) return null;
|
|
5659
5808
|
const imageProps = getImageProps();
|
|
5660
|
-
return /* @__PURE__ */ jsx("div", { style: getImageWrapperStyle(), children: /* @__PURE__ */ jsx("img", { ...imageProps, className, ...restProps }) });
|
|
5809
|
+
return /* @__PURE__ */ jsx("div", { style: getImageWrapperStyle(), children: /* @__PURE__ */ jsx("img", { ...imageProps, className, ...restProps, alt: "cropper" }) });
|
|
5661
5810
|
};
|
|
5662
5811
|
var CropperCropArea = ({
|
|
5663
5812
|
className,
|
|
@@ -5701,10 +5850,10 @@ function Slider({
|
|
|
5701
5850
|
max = 100,
|
|
5702
5851
|
...props
|
|
5703
5852
|
}) {
|
|
5704
|
-
const [internalValues, setInternalValues] =
|
|
5853
|
+
const [internalValues, setInternalValues] = React35.useState(
|
|
5705
5854
|
Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]
|
|
5706
5855
|
);
|
|
5707
|
-
|
|
5856
|
+
React35.useEffect(() => {
|
|
5708
5857
|
if (value !== void 0) {
|
|
5709
5858
|
setInternalValues(Array.isArray(value) ? value : [value]);
|
|
5710
5859
|
}
|
|
@@ -5757,7 +5906,7 @@ function Slider({
|
|
|
5757
5906
|
)
|
|
5758
5907
|
}
|
|
5759
5908
|
),
|
|
5760
|
-
Array.from({ length: internalValues.length }, (_, index) => /* @__PURE__ */ jsx(
|
|
5909
|
+
Array.from({ length: internalValues.length }, (_, index) => /* @__PURE__ */ jsx(React35.Fragment, { children: renderThumb() }, index))
|
|
5761
5910
|
]
|
|
5762
5911
|
}
|
|
5763
5912
|
);
|
|
@@ -6082,7 +6231,7 @@ var ProfileImage = ({
|
|
|
6082
6231
|
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
|
6083
6232
|
useEffect(() => {
|
|
6084
6233
|
onError?.(errors);
|
|
6085
|
-
}, [errors]);
|
|
6234
|
+
}, [errors, onError]);
|
|
6086
6235
|
const [file] = files;
|
|
6087
6236
|
const fileId = file?.id;
|
|
6088
6237
|
const previousFileIdRef = useRef(null);
|
|
@@ -6291,8 +6440,8 @@ function Stepper({
|
|
|
6291
6440
|
className,
|
|
6292
6441
|
...props
|
|
6293
6442
|
}) {
|
|
6294
|
-
const [activeStep, setInternalStep] =
|
|
6295
|
-
const setActiveStep =
|
|
6443
|
+
const [activeStep, setInternalStep] = React35.useState(defaultValue);
|
|
6444
|
+
const setActiveStep = React35.useCallback(
|
|
6296
6445
|
(step) => {
|
|
6297
6446
|
if (value === void 0) {
|
|
6298
6447
|
setInternalStep(step);
|
|
@@ -6378,10 +6527,22 @@ function StepperTrigger({
|
|
|
6378
6527
|
className,
|
|
6379
6528
|
children,
|
|
6380
6529
|
isClickable = true,
|
|
6530
|
+
onClick,
|
|
6381
6531
|
...props
|
|
6382
6532
|
}) {
|
|
6383
6533
|
const { setActiveStep } = useStepper();
|
|
6384
6534
|
const { step, isDisabled } = useStepItem();
|
|
6535
|
+
const handleClick = React35.useCallback(
|
|
6536
|
+
(e) => {
|
|
6537
|
+
if (isClickable) {
|
|
6538
|
+
setActiveStep(step);
|
|
6539
|
+
onClick?.(e);
|
|
6540
|
+
}
|
|
6541
|
+
e.preventDefault();
|
|
6542
|
+
e.stopPropagation();
|
|
6543
|
+
},
|
|
6544
|
+
[isClickable, step, onClick, setActiveStep]
|
|
6545
|
+
);
|
|
6385
6546
|
if (asChild) {
|
|
6386
6547
|
const Comp = asChild ? Slot : "span";
|
|
6387
6548
|
return /* @__PURE__ */ jsx(Comp, { "data-slot": "stepper-trigger", className, children });
|
|
@@ -6406,9 +6567,10 @@ function StepperTrigger({
|
|
|
6406
6567
|
`,
|
|
6407
6568
|
className
|
|
6408
6569
|
),
|
|
6409
|
-
onClick:
|
|
6570
|
+
onClick: handleClick,
|
|
6410
6571
|
disabled: isDisabled,
|
|
6411
6572
|
...props,
|
|
6573
|
+
type: "button",
|
|
6412
6574
|
children
|
|
6413
6575
|
}
|
|
6414
6576
|
);
|
|
@@ -6572,6 +6734,1190 @@ function StepperSeparator({
|
|
|
6572
6734
|
}
|
|
6573
6735
|
return line;
|
|
6574
6736
|
}
|
|
6737
|
+
var BannerVariant = /* @__PURE__ */ ((BannerVariant2) => {
|
|
6738
|
+
BannerVariant2["outline"] = "outline";
|
|
6739
|
+
BannerVariant2["filled"] = "filled";
|
|
6740
|
+
return BannerVariant2;
|
|
6741
|
+
})(BannerVariant || {});
|
|
6742
|
+
var BannerType = /* @__PURE__ */ ((BannerType2) => {
|
|
6743
|
+
BannerType2["info"] = "info";
|
|
6744
|
+
BannerType2["success"] = "success";
|
|
6745
|
+
BannerType2["warning"] = "warning";
|
|
6746
|
+
BannerType2["error"] = "error";
|
|
6747
|
+
return BannerType2;
|
|
6748
|
+
})(BannerType || {});
|
|
6749
|
+
var bannerAlertVariants = cva("rounded-bannerAlert w-full", {
|
|
6750
|
+
variants: {
|
|
6751
|
+
variant: {
|
|
6752
|
+
outline: "border border-box-border",
|
|
6753
|
+
filled: "border-none"
|
|
6754
|
+
},
|
|
6755
|
+
type: {
|
|
6756
|
+
info: "",
|
|
6757
|
+
success: "",
|
|
6758
|
+
warning: "",
|
|
6759
|
+
error: ""
|
|
6760
|
+
}
|
|
6761
|
+
},
|
|
6762
|
+
compoundVariants: [
|
|
6763
|
+
{
|
|
6764
|
+
variant: "outline",
|
|
6765
|
+
type: "info",
|
|
6766
|
+
class: "bg-bannerAlert-outline-info-background"
|
|
6767
|
+
},
|
|
6768
|
+
{
|
|
6769
|
+
variant: "outline",
|
|
6770
|
+
type: "success",
|
|
6771
|
+
class: "bg-bannerAlert-outline-success-background"
|
|
6772
|
+
},
|
|
6773
|
+
{
|
|
6774
|
+
variant: "outline",
|
|
6775
|
+
type: "warning",
|
|
6776
|
+
class: "bg-bannerAlert-outline-warning-background"
|
|
6777
|
+
},
|
|
6778
|
+
{
|
|
6779
|
+
variant: "outline",
|
|
6780
|
+
type: "error",
|
|
6781
|
+
class: "bg-bannerAlert-outline-error-background"
|
|
6782
|
+
},
|
|
6783
|
+
{
|
|
6784
|
+
variant: "filled",
|
|
6785
|
+
type: "info",
|
|
6786
|
+
class: "bg-bannerAlert-filled-info-background"
|
|
6787
|
+
},
|
|
6788
|
+
{
|
|
6789
|
+
variant: "filled",
|
|
6790
|
+
type: "success",
|
|
6791
|
+
class: "bg-bannerAlert-filled-success-background"
|
|
6792
|
+
},
|
|
6793
|
+
{
|
|
6794
|
+
variant: "filled",
|
|
6795
|
+
type: "warning",
|
|
6796
|
+
class: "bg-bannerAlert-filled-warning-background"
|
|
6797
|
+
},
|
|
6798
|
+
{
|
|
6799
|
+
variant: "filled",
|
|
6800
|
+
type: "error",
|
|
6801
|
+
class: "bg-bannerAlert-filled-error-background"
|
|
6802
|
+
}
|
|
6803
|
+
]
|
|
6804
|
+
});
|
|
6805
|
+
var bannerAlertIconVariants = cva("size-5", {
|
|
6806
|
+
variants: {
|
|
6807
|
+
variant: {
|
|
6808
|
+
outline: "",
|
|
6809
|
+
filled: ""
|
|
6810
|
+
},
|
|
6811
|
+
type: {
|
|
6812
|
+
info: "",
|
|
6813
|
+
success: "",
|
|
6814
|
+
warning: "",
|
|
6815
|
+
error: ""
|
|
6816
|
+
}
|
|
6817
|
+
},
|
|
6818
|
+
compoundVariants: [
|
|
6819
|
+
{
|
|
6820
|
+
variant: "outline",
|
|
6821
|
+
type: "info",
|
|
6822
|
+
class: "text-bannerAlert-outline-info-icon"
|
|
6823
|
+
},
|
|
6824
|
+
{
|
|
6825
|
+
variant: "outline",
|
|
6826
|
+
type: "success",
|
|
6827
|
+
class: "text-bannerAlert-outline-success-icon"
|
|
6828
|
+
},
|
|
6829
|
+
{
|
|
6830
|
+
variant: "outline",
|
|
6831
|
+
type: "warning",
|
|
6832
|
+
class: "text-bannerAlert-outline-warning-icon"
|
|
6833
|
+
},
|
|
6834
|
+
{
|
|
6835
|
+
variant: "outline",
|
|
6836
|
+
type: "error",
|
|
6837
|
+
class: "text-bannerAlert-outline-error-icon"
|
|
6838
|
+
},
|
|
6839
|
+
{
|
|
6840
|
+
variant: "filled",
|
|
6841
|
+
type: "info",
|
|
6842
|
+
class: "text-bannerAlert-filled-info-icon"
|
|
6843
|
+
},
|
|
6844
|
+
{
|
|
6845
|
+
variant: "filled",
|
|
6846
|
+
type: "success",
|
|
6847
|
+
class: "text-bannerAlert-filled-success-icon"
|
|
6848
|
+
},
|
|
6849
|
+
{
|
|
6850
|
+
variant: "filled",
|
|
6851
|
+
type: "warning",
|
|
6852
|
+
class: "text-bannerAlert-filled-warning-icon"
|
|
6853
|
+
},
|
|
6854
|
+
{
|
|
6855
|
+
variant: "filled",
|
|
6856
|
+
type: "error",
|
|
6857
|
+
class: "text-bannerAlert-filled-error-icon"
|
|
6858
|
+
}
|
|
6859
|
+
]
|
|
6860
|
+
});
|
|
6861
|
+
var BannerAlertIcon = ({
|
|
6862
|
+
variant: variant3,
|
|
6863
|
+
type
|
|
6864
|
+
}) => {
|
|
6865
|
+
const iconClass = bannerAlertIconVariants({ variant: variant3, type });
|
|
6866
|
+
const icons = {
|
|
6867
|
+
info: /* @__PURE__ */ jsx(InfoIcon, { className: iconClass }),
|
|
6868
|
+
success: /* @__PURE__ */ jsx(CircleCheckBigIcon, { className: iconClass }),
|
|
6869
|
+
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: iconClass }),
|
|
6870
|
+
error: /* @__PURE__ */ jsx(InfoIcon, { className: iconClass })
|
|
6871
|
+
};
|
|
6872
|
+
return icons[type];
|
|
6873
|
+
};
|
|
6874
|
+
var BannerAlert = ({
|
|
6875
|
+
variant: variant3,
|
|
6876
|
+
type,
|
|
6877
|
+
title,
|
|
6878
|
+
description,
|
|
6879
|
+
onClose,
|
|
6880
|
+
children
|
|
6881
|
+
}) => {
|
|
6882
|
+
return /* @__PURE__ */ jsx("div", { className: bannerAlertVariants({ variant: variant3, type }), children: /* @__PURE__ */ jsxs("div", { className: cn("relative py-4 ps-12 pe-4", !!onClose && "pe-12"), children: [
|
|
6883
|
+
/* @__PURE__ */ jsx("div", { className: "nebula-ds absolute top-4 left-4", children: /* @__PURE__ */ jsx(BannerAlertIcon, { variant: variant3, type }) }),
|
|
6884
|
+
/* @__PURE__ */ jsxs("div", { className: "nebula-ds flex-1 flex flex-col gap-3", children: [
|
|
6885
|
+
/* @__PURE__ */ jsxs("div", { className: "nebula-ds w-full flex flex-col gap-1", children: [
|
|
6886
|
+
title && /* @__PURE__ */ jsx("span", { className: "nebula-ds font-semibold leading-5 text-bannerAlert-title text-sm", children: title }),
|
|
6887
|
+
/* @__PURE__ */ jsx("span", { className: "nebula-ds leading-5 text-bannerAlert-description text-sm", children: description })
|
|
6888
|
+
] }),
|
|
6889
|
+
children
|
|
6890
|
+
] }),
|
|
6891
|
+
!!onClose && /* @__PURE__ */ jsx("div", { className: "nebula-ds absolute top-2 right-2", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, icon: true, children: /* @__PURE__ */ jsx(XIcon, {}) }) })
|
|
6892
|
+
] }) });
|
|
6893
|
+
};
|
|
6894
|
+
var dropAnimation = {
|
|
6895
|
+
sideEffects: defaultDropAnimationSideEffects({
|
|
6896
|
+
styles: {
|
|
6897
|
+
active: {
|
|
6898
|
+
opacity: "0.6"
|
|
6899
|
+
}
|
|
6900
|
+
}
|
|
6901
|
+
})
|
|
6902
|
+
};
|
|
6903
|
+
var DEFAULT_MEASURING = {
|
|
6904
|
+
droppable: {
|
|
6905
|
+
strategy: MeasuringStrategy.Always
|
|
6906
|
+
}
|
|
6907
|
+
};
|
|
6908
|
+
var DEFAULT_VIRTUAL_CARD_HEIGHT = 96;
|
|
6909
|
+
var DEFAULT_LOAD_MORE_OFFSET = 120;
|
|
6910
|
+
var KanbanColumnContext = React35.createContext(null);
|
|
6911
|
+
var KanbanColumn = React35.forwardRef(
|
|
6912
|
+
({ className, ...props }, ref) => {
|
|
6913
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("min-h-[320px]", className), ...props });
|
|
6914
|
+
}
|
|
6915
|
+
);
|
|
6916
|
+
KanbanColumn.displayName = "KanbanColumn";
|
|
6917
|
+
var KanbanColumnHeader = React35.forwardRef(({ className, ...props }, ref) => {
|
|
6918
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex", className), ...props });
|
|
6919
|
+
});
|
|
6920
|
+
KanbanColumnHeader.displayName = "KanbanColumnHeader";
|
|
6921
|
+
var KanbanColumnTitle = React35.forwardRef(({ className, ...props }, ref) => {
|
|
6922
|
+
return /* @__PURE__ */ jsx(
|
|
6923
|
+
"h3",
|
|
6924
|
+
{
|
|
6925
|
+
ref,
|
|
6926
|
+
className: cn("text-heading-6 font-semibold text-neutral-900", className),
|
|
6927
|
+
...props
|
|
6928
|
+
}
|
|
6929
|
+
);
|
|
6930
|
+
});
|
|
6931
|
+
KanbanColumnTitle.displayName = "KanbanColumnTitle";
|
|
6932
|
+
var KanbanColumnFooter = React35.forwardRef(({ className, ...props }, ref) => {
|
|
6933
|
+
return /* @__PURE__ */ jsx(
|
|
6934
|
+
"div",
|
|
6935
|
+
{
|
|
6936
|
+
ref,
|
|
6937
|
+
className: cn(
|
|
6938
|
+
"border-t border-box-border px-5 py-4 text-xs text-neutral-500",
|
|
6939
|
+
className
|
|
6940
|
+
),
|
|
6941
|
+
...props
|
|
6942
|
+
}
|
|
6943
|
+
);
|
|
6944
|
+
});
|
|
6945
|
+
KanbanColumnFooter.displayName = "KanbanColumnFooter";
|
|
6946
|
+
var KanbanCard = React35.forwardRef(
|
|
6947
|
+
({ className, isDragging, isOverlay, ...props }, ref) => {
|
|
6948
|
+
return /* @__PURE__ */ jsx(
|
|
6949
|
+
"div",
|
|
6950
|
+
{
|
|
6951
|
+
ref,
|
|
6952
|
+
className: cn(
|
|
6953
|
+
"group relative rounded-2xl border border-box-border/80 bg-box-background-primary px-5 py-4 text-left shadow-[0_12px_30px_-20px_rgba(16,24,40,0.28)] transition-all duration-150 hover:-translate-y-[1px] hover:shadow-[0_18px_42px_-22px_rgba(16,24,40,0.35)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-button-primary-border-focus",
|
|
6954
|
+
isDragging && "ring-2 ring-button-primary-border-focus shadow-[0_24px_52px_-22px_rgba(16,24,40,0.45)]",
|
|
6955
|
+
isOverlay && "ring-4 ring-button-primary-border-focus/60 shadow-[0_26px_56px_-20px_rgba(16,24,40,0.5)]",
|
|
6956
|
+
className
|
|
6957
|
+
),
|
|
6958
|
+
...props
|
|
6959
|
+
}
|
|
6960
|
+
);
|
|
6961
|
+
}
|
|
6962
|
+
);
|
|
6963
|
+
KanbanCard.displayName = "KanbanCard";
|
|
6964
|
+
var KanbanColumnDragHandle = React35.forwardRef(({ className, children, ...props }, ref) => {
|
|
6965
|
+
const context = React35.useContext(KanbanColumnContext);
|
|
6966
|
+
if (!context) {
|
|
6967
|
+
throw new Error(
|
|
6968
|
+
"KanbanColumnDragHandle must be used inside a KanbanBoard column"
|
|
6969
|
+
);
|
|
6970
|
+
}
|
|
6971
|
+
const mergedRef = React35.useCallback(
|
|
6972
|
+
(node) => {
|
|
6973
|
+
context.setActivatorNodeRef(node);
|
|
6974
|
+
if (typeof ref === "function") {
|
|
6975
|
+
ref(node);
|
|
6976
|
+
} else if (ref) {
|
|
6977
|
+
ref.current = node;
|
|
6978
|
+
}
|
|
6979
|
+
},
|
|
6980
|
+
[context, ref]
|
|
6981
|
+
);
|
|
6982
|
+
return /* @__PURE__ */ jsx(
|
|
6983
|
+
"button",
|
|
6984
|
+
{
|
|
6985
|
+
ref: mergedRef,
|
|
6986
|
+
type: "button",
|
|
6987
|
+
className: cn(
|
|
6988
|
+
"inline-flex size-6 items-center justify-center rounded-full border border-transparent bg-transparent text-neutral-500 transition-colors hover:text-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-button-primary-border-focus",
|
|
6989
|
+
className
|
|
6990
|
+
),
|
|
6991
|
+
"aria-label": "Reorder column",
|
|
6992
|
+
...context.attributes,
|
|
6993
|
+
...context.listeners,
|
|
6994
|
+
...props,
|
|
6995
|
+
children: children ?? /* @__PURE__ */ jsx("span", { className: "nebula-ds sr-only", children: "Mover coluna" })
|
|
6996
|
+
}
|
|
6997
|
+
);
|
|
6998
|
+
});
|
|
6999
|
+
KanbanColumnDragHandle.displayName = "KanbanColumnDragHandle";
|
|
7000
|
+
function defaultRenderColumnHeader(context) {
|
|
7001
|
+
const { column, cardCount } = context;
|
|
7002
|
+
return /* @__PURE__ */ jsx(KanbanColumnHeader, { children: /* @__PURE__ */ jsxs("div", { className: "nebula-ds space-y-2", children: [
|
|
7003
|
+
/* @__PURE__ */ jsx(KanbanColumnTitle, { className: "nebula-ds text-heading-6 font-semibold text-typography-heading-6", children: column.title }),
|
|
7004
|
+
/* @__PURE__ */ jsxs("div", { className: "nebula-ds space-y-1", children: [
|
|
7005
|
+
/* @__PURE__ */ jsx("span", { className: "nebula-ds inline-flex items-center rounded-full border border-button-secondary-border-default bg-button-secondary-background-default px-3 py-1 text-xs font-medium text-tag-text", children: cardCount }),
|
|
7006
|
+
column.description ? /* @__PURE__ */ jsx("p", { className: "nebula-ds text-xs text-neutral-500", children: column.description }) : null
|
|
7007
|
+
] })
|
|
7008
|
+
] }) });
|
|
7009
|
+
}
|
|
7010
|
+
function defaultRenderEmptyState() {
|
|
7011
|
+
return /* @__PURE__ */ jsx("div", { className: "nebula-ds w-full rounded-xl border border-dashed border-neutral-200 p-4 text-center text-sm text-neutral-500", children: "Empty column" });
|
|
7012
|
+
}
|
|
7013
|
+
function getCardSortDisabled(card, column) {
|
|
7014
|
+
const disableDroppable = column.allowDrop === false;
|
|
7015
|
+
const disableDraggable = card.isDraggable === false;
|
|
7016
|
+
if (!disableDroppable && !disableDraggable) {
|
|
7017
|
+
return false;
|
|
7018
|
+
}
|
|
7019
|
+
return {
|
|
7020
|
+
draggable: disableDraggable,
|
|
7021
|
+
droppable: disableDroppable
|
|
7022
|
+
};
|
|
7023
|
+
}
|
|
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
|
+
function moveCardBetweenColumns({
|
|
7049
|
+
columns,
|
|
7050
|
+
card,
|
|
7051
|
+
cardId,
|
|
7052
|
+
fromColumnId,
|
|
7053
|
+
toColumnId,
|
|
7054
|
+
toIndex,
|
|
7055
|
+
getCardId
|
|
7056
|
+
}) {
|
|
7057
|
+
if (fromColumnId === toColumnId) {
|
|
7058
|
+
return columns.map((column) => {
|
|
7059
|
+
if (column.id !== fromColumnId) {
|
|
7060
|
+
return column;
|
|
7061
|
+
}
|
|
7062
|
+
const currentIndex = column.cards.findIndex(
|
|
7063
|
+
(item) => getCardId(item) === cardId
|
|
7064
|
+
);
|
|
7065
|
+
if (currentIndex === -1) {
|
|
7066
|
+
return column;
|
|
7067
|
+
}
|
|
7068
|
+
const maxIndex = column.cards.length > 0 ? column.cards.length - 1 : 0;
|
|
7069
|
+
const clampedIndex = clampIndex(toIndex, maxIndex);
|
|
7070
|
+
if (currentIndex === clampedIndex) {
|
|
7071
|
+
return column;
|
|
7072
|
+
}
|
|
7073
|
+
return {
|
|
7074
|
+
...column,
|
|
7075
|
+
cards: arrayMove(column.cards, currentIndex, clampedIndex)
|
|
7076
|
+
};
|
|
7077
|
+
});
|
|
7078
|
+
}
|
|
7079
|
+
return columns.map((column) => {
|
|
7080
|
+
if (column.id === fromColumnId) {
|
|
7081
|
+
return {
|
|
7082
|
+
...column,
|
|
7083
|
+
cards: column.cards.filter((item) => getCardId(item) !== cardId)
|
|
7084
|
+
};
|
|
7085
|
+
}
|
|
7086
|
+
if (column.id === toColumnId) {
|
|
7087
|
+
const filteredCards = column.cards.filter(
|
|
7088
|
+
(item) => getCardId(item) !== cardId
|
|
7089
|
+
);
|
|
7090
|
+
const nextCards = [...filteredCards];
|
|
7091
|
+
const insertIndex = clampInsertIndex(toIndex, filteredCards.length);
|
|
7092
|
+
nextCards.splice(insertIndex, 0, card);
|
|
7093
|
+
return {
|
|
7094
|
+
...column,
|
|
7095
|
+
cards: nextCards
|
|
7096
|
+
};
|
|
7097
|
+
}
|
|
7098
|
+
return column;
|
|
7099
|
+
});
|
|
7100
|
+
}
|
|
7101
|
+
function clampIndex(value, max) {
|
|
7102
|
+
if (max < 0) {
|
|
7103
|
+
return 0;
|
|
7104
|
+
}
|
|
7105
|
+
return Math.min(Math.max(value, 0), max);
|
|
7106
|
+
}
|
|
7107
|
+
function clampInsertIndex(value, length) {
|
|
7108
|
+
if (length < 0) {
|
|
7109
|
+
return 0;
|
|
7110
|
+
}
|
|
7111
|
+
if (value < 0) {
|
|
7112
|
+
return 0;
|
|
7113
|
+
}
|
|
7114
|
+
if (value > length) {
|
|
7115
|
+
return length;
|
|
7116
|
+
}
|
|
7117
|
+
return value;
|
|
7118
|
+
}
|
|
7119
|
+
function columnMoveCrossesLockedColumns({
|
|
7120
|
+
columns,
|
|
7121
|
+
fromIndex,
|
|
7122
|
+
toIndex
|
|
7123
|
+
}) {
|
|
7124
|
+
if (fromIndex === toIndex) {
|
|
7125
|
+
return false;
|
|
7126
|
+
}
|
|
7127
|
+
const [start, end] = fromIndex < toIndex ? [fromIndex + 1, toIndex] : [toIndex, fromIndex - 1];
|
|
7128
|
+
for (let index = start; index <= end; index += 1) {
|
|
7129
|
+
const column = columns[index];
|
|
7130
|
+
if (column && column.canDrag === false) {
|
|
7131
|
+
return true;
|
|
7132
|
+
}
|
|
7133
|
+
}
|
|
7134
|
+
const targetColumn = columns[toIndex];
|
|
7135
|
+
if (targetColumn?.canDrag === false) {
|
|
7136
|
+
return true;
|
|
7137
|
+
}
|
|
7138
|
+
return false;
|
|
7139
|
+
}
|
|
7140
|
+
function KanbanSortableCard({
|
|
7141
|
+
card,
|
|
7142
|
+
cardIndex,
|
|
7143
|
+
column,
|
|
7144
|
+
columnIndex,
|
|
7145
|
+
renderCard,
|
|
7146
|
+
getCardId,
|
|
7147
|
+
activeCardId,
|
|
7148
|
+
virtualizer,
|
|
7149
|
+
virtualizationEnabled = false,
|
|
7150
|
+
cardId,
|
|
7151
|
+
isManualOrdering,
|
|
7152
|
+
isDropTarget
|
|
7153
|
+
}) {
|
|
7154
|
+
const sortable = useSortable({
|
|
7155
|
+
id: cardId ?? getCardId(card),
|
|
7156
|
+
data: {
|
|
7157
|
+
type: "card",
|
|
7158
|
+
card,
|
|
7159
|
+
columnId: column.id,
|
|
7160
|
+
index: cardIndex,
|
|
7161
|
+
ordering: column.ordering ?? "manual"
|
|
7162
|
+
},
|
|
7163
|
+
disabled: getCardSortDisabled(card, column),
|
|
7164
|
+
animateLayoutChanges: (args) => {
|
|
7165
|
+
if ((column.ordering ?? "manual") === "external") {
|
|
7166
|
+
return false;
|
|
7167
|
+
}
|
|
7168
|
+
return defaultAnimateLayoutChanges({
|
|
7169
|
+
...args,
|
|
7170
|
+
wasDragging: true
|
|
7171
|
+
});
|
|
7172
|
+
}
|
|
7173
|
+
});
|
|
7174
|
+
const {
|
|
7175
|
+
setNodeRef,
|
|
7176
|
+
attributes,
|
|
7177
|
+
listeners,
|
|
7178
|
+
transform,
|
|
7179
|
+
transition,
|
|
7180
|
+
isDragging
|
|
7181
|
+
} = sortable;
|
|
7182
|
+
const composedRef = React35.useCallback(
|
|
7183
|
+
(node) => {
|
|
7184
|
+
setNodeRef(node);
|
|
7185
|
+
if (virtualizationEnabled && node) {
|
|
7186
|
+
virtualizer?.measureElement(node);
|
|
7187
|
+
}
|
|
7188
|
+
},
|
|
7189
|
+
[setNodeRef, virtualizer, virtualizationEnabled]
|
|
7190
|
+
);
|
|
7191
|
+
const cardContent = renderCard({
|
|
7192
|
+
card,
|
|
7193
|
+
column,
|
|
7194
|
+
columnIndex,
|
|
7195
|
+
index: cardIndex,
|
|
7196
|
+
isDragging,
|
|
7197
|
+
isOverlay: false
|
|
7198
|
+
});
|
|
7199
|
+
const resolvedCardId = cardId ?? getCardId(card);
|
|
7200
|
+
const isActiveCard = activeCardId === resolvedCardId;
|
|
7201
|
+
const showManualPreview = isManualOrdering && isDropTarget && isActiveCard;
|
|
7202
|
+
const cardStyles = {
|
|
7203
|
+
transform: CSS.Translate.toString(transform),
|
|
7204
|
+
transition
|
|
7205
|
+
};
|
|
7206
|
+
return /* @__PURE__ */ jsxs(
|
|
7207
|
+
"div",
|
|
7208
|
+
{
|
|
7209
|
+
ref: composedRef,
|
|
7210
|
+
style: cardStyles,
|
|
7211
|
+
"data-card-id": resolvedCardId,
|
|
7212
|
+
className: cn(
|
|
7213
|
+
"relative touch-pan-y transition-transform duration-150",
|
|
7214
|
+
isDragging && "z-10"
|
|
7215
|
+
),
|
|
7216
|
+
...attributes,
|
|
7217
|
+
...listeners,
|
|
7218
|
+
children: [
|
|
7219
|
+
/* @__PURE__ */ jsx(
|
|
7220
|
+
"div",
|
|
7221
|
+
{
|
|
7222
|
+
className: cn(
|
|
7223
|
+
"transition-[opacity,transform] duration-150",
|
|
7224
|
+
isActiveCard ? "pointer-events-none opacity-0" : "opacity-100",
|
|
7225
|
+
isDragging && "scale-[0.99]"
|
|
7226
|
+
),
|
|
7227
|
+
children: cardContent
|
|
7228
|
+
}
|
|
7229
|
+
),
|
|
7230
|
+
showManualPreview ? /* @__PURE__ */ jsx("div", { className: "nebula-ds pointer-events-none absolute inset-0 rounded-2xl border-2 border-dashed border-button-primary-border-focus bg-button-primary-border-focus/10" }) : null
|
|
7231
|
+
]
|
|
7232
|
+
}
|
|
7233
|
+
);
|
|
7234
|
+
}
|
|
7235
|
+
var KanbanColumnBodyInner = ({
|
|
7236
|
+
column,
|
|
7237
|
+
columnIndex,
|
|
7238
|
+
renderCard,
|
|
7239
|
+
renderEmptyState,
|
|
7240
|
+
getCardId,
|
|
7241
|
+
activeCardId,
|
|
7242
|
+
columnContext,
|
|
7243
|
+
isManualOrdering,
|
|
7244
|
+
isDropTarget
|
|
7245
|
+
}, ref) => {
|
|
7246
|
+
const scrollRef = React35.useRef(null);
|
|
7247
|
+
const combinedRef = React35.useCallback(
|
|
7248
|
+
(node) => {
|
|
7249
|
+
scrollRef.current = node;
|
|
7250
|
+
if (typeof ref === "function") {
|
|
7251
|
+
ref(node);
|
|
7252
|
+
} else if (ref) {
|
|
7253
|
+
ref.current = node;
|
|
7254
|
+
}
|
|
7255
|
+
},
|
|
7256
|
+
[ref]
|
|
7257
|
+
);
|
|
7258
|
+
const virtualization = column.virtualization;
|
|
7259
|
+
const virtualizationEnabled = Boolean(virtualization?.enabled);
|
|
7260
|
+
const cardIds = React35.useMemo(
|
|
7261
|
+
() => column.cards.map((card) => getCardId(card)),
|
|
7262
|
+
[column.cards, getCardId]
|
|
7263
|
+
);
|
|
7264
|
+
const virtualizer = useVirtualizer({
|
|
7265
|
+
count: virtualizationEnabled ? column.cards.length : 0,
|
|
7266
|
+
getScrollElement: () => scrollRef.current,
|
|
7267
|
+
estimateSize: () => virtualization?.estimateCardHeight ?? DEFAULT_VIRTUAL_CARD_HEIGHT,
|
|
7268
|
+
overscan: virtualization?.overscan ?? 6,
|
|
7269
|
+
enabled: virtualizationEnabled
|
|
7270
|
+
});
|
|
7271
|
+
const { onLoadMore, hasMore, isLoadingMore, loadMoreOffset } = column;
|
|
7272
|
+
React35.useEffect(() => {
|
|
7273
|
+
if (!onLoadMore || !hasMore || isLoadingMore) {
|
|
7274
|
+
return;
|
|
7275
|
+
}
|
|
7276
|
+
const node = scrollRef.current;
|
|
7277
|
+
if (!node) {
|
|
7278
|
+
return;
|
|
7279
|
+
}
|
|
7280
|
+
const handleScroll = () => {
|
|
7281
|
+
const remaining = node.scrollHeight - node.scrollTop - node.clientHeight;
|
|
7282
|
+
const offset = loadMoreOffset ?? DEFAULT_LOAD_MORE_OFFSET;
|
|
7283
|
+
if (remaining <= offset) {
|
|
7284
|
+
onLoadMore?.();
|
|
7285
|
+
}
|
|
7286
|
+
};
|
|
7287
|
+
node.addEventListener("scroll", handleScroll);
|
|
7288
|
+
return () => {
|
|
7289
|
+
node.removeEventListener("scroll", handleScroll);
|
|
7290
|
+
};
|
|
7291
|
+
}, [hasMore, isLoadingMore, loadMoreOffset, onLoadMore]);
|
|
7292
|
+
const columnBodyClasses = cn(
|
|
7293
|
+
"flex-1 overflow-y-auto px-4 pb-4 pt-1",
|
|
7294
|
+
column.cards.length === 0 && "flex items-center justify-center"
|
|
7295
|
+
);
|
|
7296
|
+
const emptyState = renderEmptyState?.(columnContext) ?? column.emptyState ?? defaultRenderEmptyState();
|
|
7297
|
+
return /* @__PURE__ */ jsx("div", { ref: combinedRef, className: columnBodyClasses, children: /* @__PURE__ */ jsxs(SortableContext, { items: cardIds, strategy: verticalListSortingStrategy, children: [
|
|
7298
|
+
column.cards.length === 0 ? isManualOrdering && isDropTarget && activeCardId ? /* @__PURE__ */ jsx("div", { className: "nebula-ds flex h-24 items-center justify-center rounded-2xl border-2 border-dashed border-button-primary-border-focus bg-button-primary-border-focus/10" }) : emptyState : virtualizationEnabled ? /* @__PURE__ */ jsx(
|
|
7299
|
+
"div",
|
|
7300
|
+
{
|
|
7301
|
+
style: {
|
|
7302
|
+
height: virtualizer.getTotalSize(),
|
|
7303
|
+
position: "relative"
|
|
7304
|
+
},
|
|
7305
|
+
children: virtualizer.getVirtualItems().map((virtualRow) => {
|
|
7306
|
+
const card = column.cards[virtualRow.index];
|
|
7307
|
+
if (!card) {
|
|
7308
|
+
return null;
|
|
7309
|
+
}
|
|
7310
|
+
const cardId = getCardId(card);
|
|
7311
|
+
return /* @__PURE__ */ jsx(
|
|
7312
|
+
"div",
|
|
7313
|
+
{
|
|
7314
|
+
"data-index": virtualRow.index,
|
|
7315
|
+
style: {
|
|
7316
|
+
position: "absolute",
|
|
7317
|
+
top: 0,
|
|
7318
|
+
left: 0,
|
|
7319
|
+
width: "100%",
|
|
7320
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
7321
|
+
},
|
|
7322
|
+
children: /* @__PURE__ */ jsx(
|
|
7323
|
+
KanbanSortableCard,
|
|
7324
|
+
{
|
|
7325
|
+
card,
|
|
7326
|
+
cardIndex: virtualRow.index,
|
|
7327
|
+
column,
|
|
7328
|
+
columnIndex,
|
|
7329
|
+
renderCard,
|
|
7330
|
+
getCardId,
|
|
7331
|
+
activeCardId,
|
|
7332
|
+
virtualizer,
|
|
7333
|
+
virtualizationEnabled,
|
|
7334
|
+
cardId,
|
|
7335
|
+
isManualOrdering,
|
|
7336
|
+
isDropTarget
|
|
7337
|
+
}
|
|
7338
|
+
)
|
|
7339
|
+
},
|
|
7340
|
+
virtualRow.key
|
|
7341
|
+
);
|
|
7342
|
+
})
|
|
7343
|
+
}
|
|
7344
|
+
) : /* @__PURE__ */ jsx("div", { className: "nebula-ds flex flex-col gap-4", children: column.cards.map((card, index) => /* @__PURE__ */ jsx(
|
|
7345
|
+
KanbanSortableCard,
|
|
7346
|
+
{
|
|
7347
|
+
card,
|
|
7348
|
+
cardIndex: index,
|
|
7349
|
+
column,
|
|
7350
|
+
columnIndex,
|
|
7351
|
+
renderCard,
|
|
7352
|
+
getCardId,
|
|
7353
|
+
activeCardId,
|
|
7354
|
+
isManualOrdering,
|
|
7355
|
+
isDropTarget
|
|
7356
|
+
},
|
|
7357
|
+
getCardId(card)
|
|
7358
|
+
)) }),
|
|
7359
|
+
column.hasMore && column.isLoadingMore ? /* @__PURE__ */ jsx("div", { className: "nebula-ds mt-3 flex justify-center text-xs text-neutral-500", children: "..." }) : null
|
|
7360
|
+
] }) });
|
|
7361
|
+
};
|
|
7362
|
+
var KanbanColumnBodyBase = React35.forwardRef(KanbanColumnBodyInner);
|
|
7363
|
+
KanbanColumnBodyBase.displayName = "KanbanColumnBody";
|
|
7364
|
+
var KanbanColumnBody = KanbanColumnBodyBase;
|
|
7365
|
+
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]";
|
|
7366
|
+
function KanbanSortableColumn({
|
|
7367
|
+
column,
|
|
7368
|
+
columnIndex,
|
|
7369
|
+
className,
|
|
7370
|
+
renderCard,
|
|
7371
|
+
renderColumnHeader,
|
|
7372
|
+
renderColumnFooter,
|
|
7373
|
+
renderEmptyState,
|
|
7374
|
+
getCardId,
|
|
7375
|
+
isManualTarget,
|
|
7376
|
+
isExternalTarget,
|
|
7377
|
+
columnContext,
|
|
7378
|
+
activeCardId
|
|
7379
|
+
}) {
|
|
7380
|
+
const {
|
|
7381
|
+
setNodeRef,
|
|
7382
|
+
setActivatorNodeRef,
|
|
7383
|
+
listeners,
|
|
7384
|
+
attributes,
|
|
7385
|
+
transform,
|
|
7386
|
+
transition,
|
|
7387
|
+
isDragging
|
|
7388
|
+
} = useSortable({
|
|
7389
|
+
id: column.id,
|
|
7390
|
+
data: {
|
|
7391
|
+
type: "column",
|
|
7392
|
+
column,
|
|
7393
|
+
index: columnIndex
|
|
7394
|
+
},
|
|
7395
|
+
disabled: column.canDrag === false
|
|
7396
|
+
});
|
|
7397
|
+
const { setNodeRef: setDroppableRef } = useDroppable({
|
|
7398
|
+
id: `${column.id}-droppable`,
|
|
7399
|
+
data: {
|
|
7400
|
+
type: "column-droppable",
|
|
7401
|
+
columnId: column.id,
|
|
7402
|
+
ordering: column.ordering ?? "manual",
|
|
7403
|
+
allowDrop: column.allowDrop !== false
|
|
7404
|
+
},
|
|
7405
|
+
disabled: column.allowDrop === false
|
|
7406
|
+
});
|
|
7407
|
+
const columnContextValue = React35.useMemo(
|
|
7408
|
+
() => ({
|
|
7409
|
+
columnId: column.id,
|
|
7410
|
+
setActivatorNodeRef,
|
|
7411
|
+
listeners,
|
|
7412
|
+
attributes,
|
|
7413
|
+
isDragging,
|
|
7414
|
+
isDragDisabled: column.canDrag === false
|
|
7415
|
+
}),
|
|
7416
|
+
[
|
|
7417
|
+
attributes,
|
|
7418
|
+
column.canDrag,
|
|
7419
|
+
column.id,
|
|
7420
|
+
isDragging,
|
|
7421
|
+
listeners,
|
|
7422
|
+
setActivatorNodeRef
|
|
7423
|
+
]
|
|
7424
|
+
);
|
|
7425
|
+
const ordering = column.ordering ?? "manual";
|
|
7426
|
+
const isManualOrdering = ordering === "manual";
|
|
7427
|
+
const columnClassNames = cn(
|
|
7428
|
+
KANBAN_COLUMN_BASE_CLASSNAME,
|
|
7429
|
+
isDragging && "translate-y-[1px]",
|
|
7430
|
+
column.canDrag === false && "cursor-default",
|
|
7431
|
+
isManualTarget && isManualOrdering && "ring-2 ring-button-primary-border-focus ring-offset-2 ring-offset-transparent",
|
|
7432
|
+
isExternalTarget && !isManualOrdering && "ring-2 ring-button-primary-border-focus ring-offset-2 ring-offset-transparent",
|
|
7433
|
+
className
|
|
7434
|
+
);
|
|
7435
|
+
return /* @__PURE__ */ jsx(KanbanColumnContext.Provider, { value: columnContextValue, children: /* @__PURE__ */ jsxs(
|
|
7436
|
+
KanbanColumn,
|
|
7437
|
+
{
|
|
7438
|
+
ref: setNodeRef,
|
|
7439
|
+
className: columnClassNames,
|
|
7440
|
+
style: {
|
|
7441
|
+
transform: CSS.Translate.toString(transform),
|
|
7442
|
+
transition
|
|
7443
|
+
},
|
|
7444
|
+
"data-column-id": column.id,
|
|
7445
|
+
"data-ordering": column.ordering ?? "manual",
|
|
7446
|
+
children: [
|
|
7447
|
+
renderColumnHeader ? renderColumnHeader(columnContext) : defaultRenderColumnHeader(columnContext),
|
|
7448
|
+
/* @__PURE__ */ jsx(
|
|
7449
|
+
KanbanColumnBody,
|
|
7450
|
+
{
|
|
7451
|
+
ref: setDroppableRef,
|
|
7452
|
+
column,
|
|
7453
|
+
columnIndex,
|
|
7454
|
+
renderCard,
|
|
7455
|
+
renderEmptyState,
|
|
7456
|
+
getCardId,
|
|
7457
|
+
activeCardId,
|
|
7458
|
+
columnContext,
|
|
7459
|
+
isManualOrdering,
|
|
7460
|
+
isDropTarget: columnContext.isDropTarget
|
|
7461
|
+
}
|
|
7462
|
+
),
|
|
7463
|
+
column.footer || renderColumnFooter ? renderColumnFooter ? renderColumnFooter(columnContext) : /* @__PURE__ */ jsx(KanbanColumnFooter, { children: column.footer }) : null
|
|
7464
|
+
]
|
|
7465
|
+
}
|
|
7466
|
+
) });
|
|
7467
|
+
}
|
|
7468
|
+
function renderCardOverlay({
|
|
7469
|
+
activeCard,
|
|
7470
|
+
columns,
|
|
7471
|
+
renderCard
|
|
7472
|
+
}) {
|
|
7473
|
+
const column = columns.find((item) => item.id === activeCard.columnId);
|
|
7474
|
+
if (!column) {
|
|
7475
|
+
return null;
|
|
7476
|
+
}
|
|
7477
|
+
return renderCard({
|
|
7478
|
+
card: activeCard.card,
|
|
7479
|
+
column,
|
|
7480
|
+
columnIndex: columns.indexOf(column),
|
|
7481
|
+
index: column.cards.findIndex((card) => card.id === activeCard.card.id),
|
|
7482
|
+
isDragging: true,
|
|
7483
|
+
isOverlay: true
|
|
7484
|
+
});
|
|
7485
|
+
}
|
|
7486
|
+
function renderColumnOverlay({
|
|
7487
|
+
activeColumn,
|
|
7488
|
+
renderCard,
|
|
7489
|
+
renderColumnHeader,
|
|
7490
|
+
renderColumnFooter,
|
|
7491
|
+
renderEmptyState,
|
|
7492
|
+
columnClassName,
|
|
7493
|
+
sanitizedColumns
|
|
7494
|
+
}) {
|
|
7495
|
+
const column = sanitizedColumns.find((item) => item.id === activeColumn.id);
|
|
7496
|
+
if (!column) {
|
|
7497
|
+
return null;
|
|
7498
|
+
}
|
|
7499
|
+
const columnContext = {
|
|
7500
|
+
column,
|
|
7501
|
+
columnIndex: sanitizedColumns.indexOf(column),
|
|
7502
|
+
cardCount: column.cards.length,
|
|
7503
|
+
isDropTarget: false,
|
|
7504
|
+
isDropTargetExternal: false,
|
|
7505
|
+
isDragDisabled: column.canDrag === false
|
|
7506
|
+
};
|
|
7507
|
+
const computedColumnClassName = typeof columnClassName === "function" ? columnClassName(columnContext) : columnClassName;
|
|
7508
|
+
const overlayColumnContext = {
|
|
7509
|
+
columnId: activeColumn.id,
|
|
7510
|
+
setActivatorNodeRef: () => {
|
|
7511
|
+
},
|
|
7512
|
+
listeners: void 0,
|
|
7513
|
+
attributes: {},
|
|
7514
|
+
isDragging: false,
|
|
7515
|
+
isDragDisabled: true
|
|
7516
|
+
};
|
|
7517
|
+
return /* @__PURE__ */ jsx(KanbanColumnContext.Provider, { value: overlayColumnContext, children: /* @__PURE__ */ jsxs(
|
|
7518
|
+
KanbanColumn,
|
|
7519
|
+
{
|
|
7520
|
+
className: cn(KANBAN_COLUMN_BASE_CLASSNAME, computedColumnClassName),
|
|
7521
|
+
children: [
|
|
7522
|
+
renderColumnHeader ? renderColumnHeader(columnContext) : defaultRenderColumnHeader(columnContext),
|
|
7523
|
+
/* @__PURE__ */ jsx("div", { className: "nebula-ds flex flex-col gap-4 px-4 pb-4 pt-1", children: column.cards.length === 0 ? renderEmptyState?.(columnContext) ?? column.emptyState ?? defaultRenderEmptyState() : column.cards.map(
|
|
7524
|
+
(card, index) => renderCard({
|
|
7525
|
+
card,
|
|
7526
|
+
column,
|
|
7527
|
+
columnIndex: columnContext.columnIndex,
|
|
7528
|
+
index,
|
|
7529
|
+
isDragging: false,
|
|
7530
|
+
isOverlay: true
|
|
7531
|
+
})
|
|
7532
|
+
) }),
|
|
7533
|
+
column.footer || renderColumnFooter ? renderColumnFooter ? renderColumnFooter(columnContext) : /* @__PURE__ */ jsx(KanbanColumnFooter, { children: column.footer }) : null
|
|
7534
|
+
]
|
|
7535
|
+
}
|
|
7536
|
+
) });
|
|
7537
|
+
}
|
|
7538
|
+
function KanbanBoard({
|
|
7539
|
+
columns,
|
|
7540
|
+
renderCard,
|
|
7541
|
+
renderColumnHeader,
|
|
7542
|
+
renderColumnFooter,
|
|
7543
|
+
renderEmptyState,
|
|
7544
|
+
getCardId: getCardIdProp,
|
|
7545
|
+
onCardDrop,
|
|
7546
|
+
onColumnDrop,
|
|
7547
|
+
className,
|
|
7548
|
+
columnClassName,
|
|
7549
|
+
collisionDetection,
|
|
7550
|
+
modifiers,
|
|
7551
|
+
sensors: sensorsProp,
|
|
7552
|
+
measuring
|
|
7553
|
+
}) {
|
|
7554
|
+
const getCardId = React35.useCallback(
|
|
7555
|
+
(card) => getCardIdProp ? getCardIdProp(card) : card.id,
|
|
7556
|
+
[getCardIdProp]
|
|
7557
|
+
);
|
|
7558
|
+
const defaultSensors = useSensors(
|
|
7559
|
+
useSensor(PointerSensor, {
|
|
7560
|
+
activationConstraint: {
|
|
7561
|
+
distance: 6
|
|
7562
|
+
}
|
|
7563
|
+
}),
|
|
7564
|
+
useSensor(TouchSensor, {
|
|
7565
|
+
activationConstraint: {
|
|
7566
|
+
delay: 120,
|
|
7567
|
+
tolerance: 6
|
|
7568
|
+
}
|
|
7569
|
+
}),
|
|
7570
|
+
useSensor(KeyboardSensor, {
|
|
7571
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
7572
|
+
})
|
|
7573
|
+
);
|
|
7574
|
+
const sensors = sensorsProp ?? defaultSensors;
|
|
7575
|
+
const measuringConfig = measuring ?? DEFAULT_MEASURING;
|
|
7576
|
+
const columnMap = React35.useMemo(
|
|
7577
|
+
() => new Map(columns.map((column) => [column.id, column])),
|
|
7578
|
+
[columns]
|
|
7579
|
+
);
|
|
7580
|
+
const manualDropPosition = React35.useRef(null);
|
|
7581
|
+
const [activeCard, setActiveCard] = React35.useState(null);
|
|
7582
|
+
const [activeColumn, setActiveColumn] = React35.useState(null);
|
|
7583
|
+
const [hoveredColumnId, setHoveredColumnId] = React35.useState(null);
|
|
7584
|
+
const [projectedColumns, setProjectedColumns] = React35.useState(null);
|
|
7585
|
+
const sanitizedColumns = projectedColumns ?? columns;
|
|
7586
|
+
React35.useEffect(() => {
|
|
7587
|
+
if (!activeCard && !activeColumn) {
|
|
7588
|
+
setProjectedColumns(null);
|
|
7589
|
+
}
|
|
7590
|
+
}, [columns, activeCard, activeColumn]);
|
|
7591
|
+
const handleDragStart = React35.useCallback(
|
|
7592
|
+
(event) => {
|
|
7593
|
+
const data = event.active.data.current;
|
|
7594
|
+
if (!data) {
|
|
7595
|
+
return;
|
|
7596
|
+
}
|
|
7597
|
+
if (data.type === "card") {
|
|
7598
|
+
setActiveCard({
|
|
7599
|
+
id: getCardId(data.card),
|
|
7600
|
+
columnId: data.columnId,
|
|
7601
|
+
card: data.card
|
|
7602
|
+
});
|
|
7603
|
+
setHoveredColumnId(data.columnId);
|
|
7604
|
+
}
|
|
7605
|
+
if (data.type === "column") {
|
|
7606
|
+
setActiveColumn({
|
|
7607
|
+
id: data.column.id,
|
|
7608
|
+
column: data.column,
|
|
7609
|
+
index: data.index
|
|
7610
|
+
});
|
|
7611
|
+
}
|
|
7612
|
+
},
|
|
7613
|
+
[getCardId]
|
|
7614
|
+
);
|
|
7615
|
+
const handleDragOver = React35.useCallback(
|
|
7616
|
+
(event) => {
|
|
7617
|
+
const { active, over } = event;
|
|
7618
|
+
if (!over) {
|
|
7619
|
+
setHoveredColumnId(null);
|
|
7620
|
+
return;
|
|
7621
|
+
}
|
|
7622
|
+
const activeData = active.data.current;
|
|
7623
|
+
const overData = over.data.current;
|
|
7624
|
+
if (!activeData) {
|
|
7625
|
+
return;
|
|
7626
|
+
}
|
|
7627
|
+
if (activeData.type === "card") {
|
|
7628
|
+
if (!activeCard) {
|
|
7629
|
+
return;
|
|
7630
|
+
}
|
|
7631
|
+
const fromColumnId = activeCard.columnId;
|
|
7632
|
+
const activeCardId = getCardId(activeData.card);
|
|
7633
|
+
const baseColumns = projectedColumns ?? columns;
|
|
7634
|
+
if (overData?.type === "card" || overData?.type === "column-droppable") {
|
|
7635
|
+
const targetColumnId = overData.columnId;
|
|
7636
|
+
const targetColumn = columnMap.get(targetColumnId);
|
|
7637
|
+
if (!targetColumn || targetColumn.allowDrop === false) {
|
|
7638
|
+
setHoveredColumnId(null);
|
|
7639
|
+
return;
|
|
7640
|
+
}
|
|
7641
|
+
const ordering = targetColumn.ordering ?? "manual";
|
|
7642
|
+
setHoveredColumnId(targetColumnId);
|
|
7643
|
+
if (ordering === "manual") {
|
|
7644
|
+
const nextIndex = calculateManualInsertionIndex({
|
|
7645
|
+
overData,
|
|
7646
|
+
fromColumnId,
|
|
7647
|
+
targetColumnId,
|
|
7648
|
+
columns: baseColumns
|
|
7649
|
+
});
|
|
7650
|
+
if (nextIndex === null) {
|
|
7651
|
+
return;
|
|
7652
|
+
}
|
|
7653
|
+
const currentPosition = manualDropPosition.current;
|
|
7654
|
+
const positionChanged = !currentPosition || currentPosition.columnId !== targetColumnId || currentPosition.index !== nextIndex;
|
|
7655
|
+
if (positionChanged) {
|
|
7656
|
+
setProjectedColumns(() => {
|
|
7657
|
+
return moveCardBetweenColumns({
|
|
7658
|
+
columns,
|
|
7659
|
+
card: activeData.card,
|
|
7660
|
+
cardId: activeCardId,
|
|
7661
|
+
fromColumnId,
|
|
7662
|
+
toColumnId: targetColumnId,
|
|
7663
|
+
toIndex: nextIndex,
|
|
7664
|
+
getCardId
|
|
7665
|
+
});
|
|
7666
|
+
});
|
|
7667
|
+
manualDropPosition.current = {
|
|
7668
|
+
columnId: targetColumnId,
|
|
7669
|
+
index: nextIndex
|
|
7670
|
+
};
|
|
7671
|
+
}
|
|
7672
|
+
} else {
|
|
7673
|
+
setProjectedColumns(null);
|
|
7674
|
+
manualDropPosition.current = null;
|
|
7675
|
+
}
|
|
7676
|
+
} else {
|
|
7677
|
+
setHoveredColumnId(null);
|
|
7678
|
+
manualDropPosition.current = null;
|
|
7679
|
+
}
|
|
7680
|
+
}
|
|
7681
|
+
if (activeData.type === "column" && activeColumn) {
|
|
7682
|
+
if (!overData || overData.type !== "column" && overData.type !== "column-droppable") {
|
|
7683
|
+
setProjectedColumns(null);
|
|
7684
|
+
setHoveredColumnId(null);
|
|
7685
|
+
manualDropPosition.current = null;
|
|
7686
|
+
return;
|
|
7687
|
+
}
|
|
7688
|
+
setHoveredColumnId(null);
|
|
7689
|
+
manualDropPosition.current = null;
|
|
7690
|
+
const baseColumns = projectedColumns ?? columns;
|
|
7691
|
+
const fromIndex = baseColumns.findIndex(
|
|
7692
|
+
(column) => column.id === activeColumn.id
|
|
7693
|
+
);
|
|
7694
|
+
const targetColumnId = overData.type === "column" ? overData.column.id : overData.columnId;
|
|
7695
|
+
const targetIndex = baseColumns.findIndex(
|
|
7696
|
+
(column) => column.id === targetColumnId
|
|
7697
|
+
);
|
|
7698
|
+
if (targetIndex === -1 || targetIndex === fromIndex) {
|
|
7699
|
+
setProjectedColumns(baseColumns === columns ? null : baseColumns);
|
|
7700
|
+
return;
|
|
7701
|
+
}
|
|
7702
|
+
if (columnMoveCrossesLockedColumns({
|
|
7703
|
+
columns: baseColumns,
|
|
7704
|
+
fromIndex,
|
|
7705
|
+
toIndex: targetIndex
|
|
7706
|
+
})) {
|
|
7707
|
+
return;
|
|
7708
|
+
}
|
|
7709
|
+
setProjectedColumns(arrayMove(baseColumns, fromIndex, targetIndex));
|
|
7710
|
+
}
|
|
7711
|
+
},
|
|
7712
|
+
[activeCard, activeColumn, columns, columnMap, getCardId, projectedColumns]
|
|
7713
|
+
);
|
|
7714
|
+
const resetDragState = React35.useCallback(() => {
|
|
7715
|
+
setActiveCard(null);
|
|
7716
|
+
setActiveColumn(null);
|
|
7717
|
+
setHoveredColumnId(null);
|
|
7718
|
+
setProjectedColumns(null);
|
|
7719
|
+
manualDropPosition.current = null;
|
|
7720
|
+
}, []);
|
|
7721
|
+
const handleDragEnd = React35.useCallback(
|
|
7722
|
+
(event) => {
|
|
7723
|
+
const { active, over } = event;
|
|
7724
|
+
const activeData = active.data.current;
|
|
7725
|
+
const overData = over?.data.current;
|
|
7726
|
+
if (!activeData) {
|
|
7727
|
+
resetDragState();
|
|
7728
|
+
return;
|
|
7729
|
+
}
|
|
7730
|
+
const pendingManualPosition = manualDropPosition.current;
|
|
7731
|
+
manualDropPosition.current = null;
|
|
7732
|
+
if (activeData.type === "card" && activeCard) {
|
|
7733
|
+
if (!over || !overData) {
|
|
7734
|
+
resetDragState();
|
|
7735
|
+
return;
|
|
7736
|
+
}
|
|
7737
|
+
if (overData.type !== "card" && overData.type !== "column-droppable") {
|
|
7738
|
+
resetDragState();
|
|
7739
|
+
return;
|
|
7740
|
+
}
|
|
7741
|
+
const fromColumnId = activeCard.columnId;
|
|
7742
|
+
const toColumnId = overData.columnId;
|
|
7743
|
+
const ordering = columnMap.get(toColumnId)?.ordering ?? "manual";
|
|
7744
|
+
const sourceColumn = columns.find(
|
|
7745
|
+
(column) => column.id === fromColumnId
|
|
7746
|
+
);
|
|
7747
|
+
const fromIndex = sourceColumn?.cards.findIndex(
|
|
7748
|
+
(card) => getCardId(card) === activeCard.id
|
|
7749
|
+
) ?? 0;
|
|
7750
|
+
let toIndex = null;
|
|
7751
|
+
if (ordering === "manual") {
|
|
7752
|
+
if (pendingManualPosition && pendingManualPosition.columnId === toColumnId) {
|
|
7753
|
+
toIndex = pendingManualPosition.index;
|
|
7754
|
+
} else {
|
|
7755
|
+
const targetColumn = columns.find(
|
|
7756
|
+
(column) => column.id === toColumnId
|
|
7757
|
+
);
|
|
7758
|
+
if (targetColumn && overData.type === "card") {
|
|
7759
|
+
toIndex = targetColumn.cards.findIndex(
|
|
7760
|
+
(card) => getCardId(card) === getCardId(overData.card)
|
|
7761
|
+
);
|
|
7762
|
+
} else if (targetColumn && overData.type === "column-droppable") {
|
|
7763
|
+
if (fromColumnId === toColumnId) {
|
|
7764
|
+
toIndex = targetColumn.cards.length - 1;
|
|
7765
|
+
} else {
|
|
7766
|
+
toIndex = targetColumn.cards.length;
|
|
7767
|
+
}
|
|
7768
|
+
}
|
|
7769
|
+
}
|
|
7770
|
+
}
|
|
7771
|
+
if (ordering === "external") {
|
|
7772
|
+
toIndex = null;
|
|
7773
|
+
}
|
|
7774
|
+
if (toIndex === null && toColumnId === fromColumnId && ordering === "external") {
|
|
7775
|
+
resetDragState();
|
|
7776
|
+
return;
|
|
7777
|
+
}
|
|
7778
|
+
if (toColumnId === fromColumnId && toIndex !== null && toIndex === fromIndex) {
|
|
7779
|
+
resetDragState();
|
|
7780
|
+
return;
|
|
7781
|
+
}
|
|
7782
|
+
onCardDrop?.({
|
|
7783
|
+
event,
|
|
7784
|
+
card: activeCard.card,
|
|
7785
|
+
cardId: activeCard.id,
|
|
7786
|
+
fromColumnId,
|
|
7787
|
+
toColumnId,
|
|
7788
|
+
fromIndex,
|
|
7789
|
+
toIndex,
|
|
7790
|
+
ordering,
|
|
7791
|
+
isDifferentColumn: toColumnId !== fromColumnId
|
|
7792
|
+
});
|
|
7793
|
+
}
|
|
7794
|
+
if (activeData.type === "column" && activeColumn) {
|
|
7795
|
+
if (!over || !overData || overData.type !== "column" && overData.type !== "column-droppable") {
|
|
7796
|
+
resetDragState();
|
|
7797
|
+
return;
|
|
7798
|
+
}
|
|
7799
|
+
const finalColumns = projectedColumns ?? columns;
|
|
7800
|
+
const targetColumnId = overData.type === "column" ? overData.column.id : overData.columnId;
|
|
7801
|
+
const fromIndex = activeColumn.index;
|
|
7802
|
+
const targetIndex = finalColumns.findIndex(
|
|
7803
|
+
(column) => column.id === targetColumnId
|
|
7804
|
+
);
|
|
7805
|
+
const destinationIndex = finalColumns.findIndex(
|
|
7806
|
+
(column) => column.id === activeColumn.id
|
|
7807
|
+
);
|
|
7808
|
+
if (targetIndex === -1 || destinationIndex === -1 || destinationIndex === fromIndex) {
|
|
7809
|
+
resetDragState();
|
|
7810
|
+
return;
|
|
7811
|
+
}
|
|
7812
|
+
if (columnMoveCrossesLockedColumns({
|
|
7813
|
+
columns: finalColumns,
|
|
7814
|
+
fromIndex,
|
|
7815
|
+
toIndex: destinationIndex
|
|
7816
|
+
})) {
|
|
7817
|
+
resetDragState();
|
|
7818
|
+
return;
|
|
7819
|
+
}
|
|
7820
|
+
onColumnDrop?.({
|
|
7821
|
+
event,
|
|
7822
|
+
column: activeColumn.column,
|
|
7823
|
+
columnId: activeColumn.id,
|
|
7824
|
+
fromIndex,
|
|
7825
|
+
toIndex: destinationIndex
|
|
7826
|
+
});
|
|
7827
|
+
}
|
|
7828
|
+
resetDragState();
|
|
7829
|
+
},
|
|
7830
|
+
[
|
|
7831
|
+
activeCard,
|
|
7832
|
+
activeColumn,
|
|
7833
|
+
columnMap,
|
|
7834
|
+
columns,
|
|
7835
|
+
getCardId,
|
|
7836
|
+
onCardDrop,
|
|
7837
|
+
onColumnDrop,
|
|
7838
|
+
projectedColumns,
|
|
7839
|
+
resetDragState
|
|
7840
|
+
]
|
|
7841
|
+
);
|
|
7842
|
+
return /* @__PURE__ */ jsxs(
|
|
7843
|
+
DndContext,
|
|
7844
|
+
{
|
|
7845
|
+
collisionDetection,
|
|
7846
|
+
modifiers,
|
|
7847
|
+
sensors,
|
|
7848
|
+
measuring: measuringConfig,
|
|
7849
|
+
onDragStart: handleDragStart,
|
|
7850
|
+
onDragOver: handleDragOver,
|
|
7851
|
+
onDragEnd: handleDragEnd,
|
|
7852
|
+
onDragCancel: resetDragState,
|
|
7853
|
+
children: [
|
|
7854
|
+
/* @__PURE__ */ jsx(
|
|
7855
|
+
SortableContext,
|
|
7856
|
+
{
|
|
7857
|
+
items: sanitizedColumns.map((column) => column.id),
|
|
7858
|
+
strategy: horizontalListSortingStrategy,
|
|
7859
|
+
children: /* @__PURE__ */ jsx(
|
|
7860
|
+
"div",
|
|
7861
|
+
{
|
|
7862
|
+
className: cn(
|
|
7863
|
+
"flex h-full w-full gap-4 overflow-x-auto p-1",
|
|
7864
|
+
className
|
|
7865
|
+
),
|
|
7866
|
+
children: sanitizedColumns.map((column, index) => {
|
|
7867
|
+
const ordering = column.ordering ?? "manual";
|
|
7868
|
+
const isDropTarget = hoveredColumnId === column.id;
|
|
7869
|
+
const context = {
|
|
7870
|
+
column,
|
|
7871
|
+
columnIndex: index,
|
|
7872
|
+
cardCount: column.cards.length,
|
|
7873
|
+
isDropTarget,
|
|
7874
|
+
isDropTargetExternal: isDropTarget && ordering === "external",
|
|
7875
|
+
isDragDisabled: column.canDrag === false
|
|
7876
|
+
};
|
|
7877
|
+
const computedColumnClassName = typeof columnClassName === "function" ? columnClassName(context) : columnClassName;
|
|
7878
|
+
return /* @__PURE__ */ jsx(
|
|
7879
|
+
KanbanSortableColumn,
|
|
7880
|
+
{
|
|
7881
|
+
column,
|
|
7882
|
+
columnIndex: index,
|
|
7883
|
+
className: computedColumnClassName,
|
|
7884
|
+
renderCard,
|
|
7885
|
+
renderColumnHeader,
|
|
7886
|
+
renderColumnFooter,
|
|
7887
|
+
renderEmptyState,
|
|
7888
|
+
getCardId,
|
|
7889
|
+
isManualTarget: isDropTarget && ordering === "manual",
|
|
7890
|
+
isExternalTarget: isDropTarget && ordering === "external",
|
|
7891
|
+
columnContext: context,
|
|
7892
|
+
activeCardId: activeCard?.id ?? null
|
|
7893
|
+
},
|
|
7894
|
+
column.id
|
|
7895
|
+
);
|
|
7896
|
+
})
|
|
7897
|
+
}
|
|
7898
|
+
)
|
|
7899
|
+
}
|
|
7900
|
+
),
|
|
7901
|
+
/* @__PURE__ */ jsxs(DragOverlay, { dropAnimation, children: [
|
|
7902
|
+
activeCard && renderCardOverlay({
|
|
7903
|
+
activeCard,
|
|
7904
|
+
columns,
|
|
7905
|
+
renderCard
|
|
7906
|
+
}),
|
|
7907
|
+
!activeCard && activeColumn ? renderColumnOverlay({
|
|
7908
|
+
activeColumn,
|
|
7909
|
+
renderCard,
|
|
7910
|
+
renderColumnHeader,
|
|
7911
|
+
renderColumnFooter,
|
|
7912
|
+
renderEmptyState,
|
|
7913
|
+
columnClassName,
|
|
7914
|
+
sanitizedColumns
|
|
7915
|
+
}) : null
|
|
7916
|
+
] })
|
|
7917
|
+
]
|
|
7918
|
+
}
|
|
7919
|
+
);
|
|
7920
|
+
}
|
|
6575
7921
|
|
|
6576
7922
|
// src/tailwind.ts
|
|
6577
7923
|
function content({ base = "./" } = {}) {
|
|
@@ -6583,4 +7929,4 @@ var tailwind = {
|
|
|
6583
7929
|
// plugin: () => require("tailwindcss")("node_modules/@nebulareact/dist/tailwind.config.js"),
|
|
6584
7930
|
};
|
|
6585
7931
|
|
|
6586
|
-
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Badge, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Caption, Checkbox, StyledCreatable as Creatable, Cropper2 as Cropper, CropperCropArea2 as CropperCropArea, CropperDescription2 as CropperDescription, CropperImage2 as CropperImage, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, FileUploadError, Heading, InputDatePickerSingle, InputDateTimePickerSingle, InputPhone, InputText, InputTime, Label, Link, NebulaI18nProvider, Pagination, Paragraph, Popover, PopoverContent, PopoverTrigger, ProfileImage, RadioGroup2 as RadioGroup, RadioGroupItem, StyledSelect as Select, Separator2 as Separator, Skeleton, Slider, Space, SpaceDirectionEnum, SpaceSizeEnum, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TextArea, Toaster, Tooltip, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages19 as messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, useClickOutside, useFileUpload, useKeyPress, useNebulaI18n };
|
|
7932
|
+
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Badge, BannerAlert, BannerType, BannerVariant, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Caption, Checkbox, StyledCreatable as Creatable, Cropper2 as Cropper, CropperCropArea2 as CropperCropArea, CropperDescription2 as CropperDescription, CropperImage2 as CropperImage, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, FileUploadError, Heading, InputDatePickerSingle, InputDateRangePicker, InputDateTimePickerSingle, InputPhone, InputText, InputTime, KanbanBoard, KanbanCard, KanbanColumn, KanbanColumnDragHandle, KanbanColumnFooter, KanbanColumnHeader, KanbanColumnTitle, Label, Link, NebulaI18nProvider, Pagination, Paragraph, Popover, PopoverContent, PopoverTrigger, ProfileImage, RadioGroup2 as RadioGroup, RadioGroupItem, StyledSelect as Select, Separator2 as Separator, Skeleton, Slider, Space, SpaceDirectionEnum, SpaceSizeEnum, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TextArea, Toaster, Tooltip, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages19 as messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, useClickOutside, useFileUpload, useKeyPress, useNebulaI18n };
|