@inf-monkeys-tech/monkeys-design 0.4.34 → 0.4.35
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/LICENSE +21 -21
- package/README.md +226 -226
- package/dist/components/base/index.d.mts +2 -2
- package/dist/components/base/index.d.ts +2 -2
- package/dist/components/base/index.js +2 -445
- package/dist/components/base/index.js.map +1 -1
- package/dist/components/base/index.mjs +3 -445
- package/dist/components/base/index.mjs.map +1 -1
- package/dist/components/data-explorer/index.js.map +1 -1
- package/dist/components/data-explorer/index.mjs.map +1 -1
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/login/index.js.map +1 -1
- package/dist/components/login/index.mjs.map +1 -1
- package/dist/components/toast/index.d.mts +75 -0
- package/dist/components/toast/index.d.ts +75 -0
- package/dist/components/toast/index.js +283 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/components/toast/index.mjs +273 -0
- package/dist/components/toast/index.mjs.map +1 -0
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/toolbar/index.mjs.map +1 -1
- package/dist/components/workbench/index.d.mts +1 -1
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/components/workbench/index.js +2 -444
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +2 -444
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/icons/oauth/index.js.map +1 -1
- package/dist/icons/oauth/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +286 -455
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +278 -455
- package/dist/index.mjs.map +1 -1
- package/dist/palette/index.js.map +1 -1
- package/dist/palette/index.mjs.map +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/index.mjs.map +1 -1
- package/dist/styles/artist-login.scss +374 -374
- package/dist/styles/global.scss +21 -21
- package/dist/styles/workflow-board.scss +440 -440
- package/dist/styles/workflow-nodes.css +340 -340
- package/dist/{theme-sIoU5-YC.d.ts → theme-CoG9vCPT.d.mts} +2 -4
- package/dist/{theme-Clm5dVb0.d.mts → theme-Cuy60thu.d.ts} +2 -4
- package/dist/theme-system/index.d.mts +1 -1
- package/dist/theme-system/index.d.ts +1 -1
- package/dist/theme-system/index.js +2 -444
- package/dist/theme-system/index.js.map +1 -1
- package/dist/theme-system/index.mjs +2 -444
- package/dist/theme-system/index.mjs.map +1 -1
- package/dist/themes/artist/index.js.map +1 -1
- package/dist/themes/artist/index.mjs.map +1 -1
- package/dist/themes/bsd/index.js.map +1 -1
- package/dist/themes/bsd/index.mjs.map +1 -1
- package/dist/themes/concept/index.js.map +1 -1
- package/dist/themes/concept/index.mjs.map +1 -1
- package/dist/themes/default/index.js.map +1 -1
- package/dist/themes/default/index.mjs.map +1 -1
- package/dist/{types-Bn6PEDsX.d.mts → types-CZALgtez.d.mts} +1 -43
- package/dist/{types-Bn6PEDsX.d.ts → types-CZALgtez.d.ts} +1 -43
- package/package.json +146 -139
|
@@ -3546,448 +3546,6 @@ function BaseLoadingState({
|
|
|
3546
3546
|
}
|
|
3547
3547
|
);
|
|
3548
3548
|
}
|
|
3549
|
-
function normalizeValues(values) {
|
|
3550
|
-
const nextValues = [];
|
|
3551
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3552
|
-
values?.forEach((value) => {
|
|
3553
|
-
if (seen.has(value)) return;
|
|
3554
|
-
seen.add(value);
|
|
3555
|
-
nextValues.push(value);
|
|
3556
|
-
});
|
|
3557
|
-
return nextValues;
|
|
3558
|
-
}
|
|
3559
|
-
function getNextEnabledIndex(options, currentIndex, direction) {
|
|
3560
|
-
if (!options.length) return -1;
|
|
3561
|
-
const startIndex = currentIndex >= 0 ? currentIndex : 0;
|
|
3562
|
-
for (let offset = 1; offset <= options.length; offset += 1) {
|
|
3563
|
-
const nextIndex = (startIndex + offset * direction + options.length) % options.length;
|
|
3564
|
-
if (!options[nextIndex]?.disabled) {
|
|
3565
|
-
return nextIndex;
|
|
3566
|
-
}
|
|
3567
|
-
}
|
|
3568
|
-
return -1;
|
|
3569
|
-
}
|
|
3570
|
-
function getFirstEnabledIndex(options) {
|
|
3571
|
-
return options.findIndex((option) => !option.disabled);
|
|
3572
|
-
}
|
|
3573
|
-
function getSafeTagCount(maxTagCount, total) {
|
|
3574
|
-
if (maxTagCount === void 0) return total;
|
|
3575
|
-
if (!Number.isFinite(maxTagCount)) return total;
|
|
3576
|
-
return Math.max(0, Math.min(total, Math.floor(maxTagCount)));
|
|
3577
|
-
}
|
|
3578
|
-
function getDefaultRemoveLabel(option) {
|
|
3579
|
-
return `Remove ${option.value}`;
|
|
3580
|
-
}
|
|
3581
|
-
var BaseMultiSelect = react.forwardRef(
|
|
3582
|
-
function BaseMultiSelect2({
|
|
3583
|
-
options,
|
|
3584
|
-
value,
|
|
3585
|
-
defaultValue,
|
|
3586
|
-
name,
|
|
3587
|
-
placeholder = "Select options",
|
|
3588
|
-
icon,
|
|
3589
|
-
invalid = false,
|
|
3590
|
-
disabled = false,
|
|
3591
|
-
required = false,
|
|
3592
|
-
openForPreview = false,
|
|
3593
|
-
maxTagCount,
|
|
3594
|
-
removeLabel = getDefaultRemoveLabel,
|
|
3595
|
-
emptyLabel = "No options",
|
|
3596
|
-
appearance,
|
|
3597
|
-
className,
|
|
3598
|
-
classNames,
|
|
3599
|
-
style,
|
|
3600
|
-
id,
|
|
3601
|
-
"aria-invalid": nativeAriaInvalid,
|
|
3602
|
-
"aria-label": nativeAriaLabel,
|
|
3603
|
-
"aria-labelledby": nativeAriaLabelledBy,
|
|
3604
|
-
onValueChange,
|
|
3605
|
-
...rootProps
|
|
3606
|
-
}, ref) {
|
|
3607
|
-
const theme = resolveBaseAppearance(appearance);
|
|
3608
|
-
const generatedId = react.useId();
|
|
3609
|
-
const multiSelectId = id ?? generatedId;
|
|
3610
|
-
const controlId = `${multiSelectId}-control`;
|
|
3611
|
-
const listboxId = `${multiSelectId}-listbox`;
|
|
3612
|
-
const rootRef = react.useRef(null);
|
|
3613
|
-
const optionList = options ?? [];
|
|
3614
|
-
const forceOpen = openForPreview;
|
|
3615
|
-
const [uncontrolledOpen, setUncontrolledOpen] = react.useState(false);
|
|
3616
|
-
const open = forceOpen || uncontrolledOpen;
|
|
3617
|
-
const [uncontrolledValue, setUncontrolledValue] = react.useState(
|
|
3618
|
-
() => normalizeValues(defaultValue)
|
|
3619
|
-
);
|
|
3620
|
-
const [activeIndex, setActiveIndex] = react.useState(
|
|
3621
|
-
() => getFirstEnabledIndex(optionList)
|
|
3622
|
-
);
|
|
3623
|
-
const isControlled = value !== void 0;
|
|
3624
|
-
const selectedValues = react.useMemo(
|
|
3625
|
-
() => normalizeValues(isControlled ? value : uncontrolledValue),
|
|
3626
|
-
[isControlled, uncontrolledValue, value]
|
|
3627
|
-
);
|
|
3628
|
-
const selectedValueSet = react.useMemo(
|
|
3629
|
-
() => new Set(selectedValues),
|
|
3630
|
-
[selectedValues]
|
|
3631
|
-
);
|
|
3632
|
-
const optionByValue = react.useMemo(() => {
|
|
3633
|
-
const map = /* @__PURE__ */ new Map();
|
|
3634
|
-
optionList.forEach((option) => {
|
|
3635
|
-
if (!map.has(option.value)) {
|
|
3636
|
-
map.set(option.value, option);
|
|
3637
|
-
}
|
|
3638
|
-
});
|
|
3639
|
-
return map;
|
|
3640
|
-
}, [optionList]);
|
|
3641
|
-
const selectedOptions = react.useMemo(
|
|
3642
|
-
() => selectedValues.map((selectedValue) => optionByValue.get(selectedValue)).filter(
|
|
3643
|
-
(option) => option !== void 0
|
|
3644
|
-
),
|
|
3645
|
-
[optionByValue, selectedValues]
|
|
3646
|
-
);
|
|
3647
|
-
const firstEnabledIndex = react.useMemo(
|
|
3648
|
-
() => getFirstEnabledIndex(optionList),
|
|
3649
|
-
[optionList]
|
|
3650
|
-
);
|
|
3651
|
-
const resolvedActiveIndex = activeIndex >= 0 && !optionList[activeIndex]?.disabled ? activeIndex : firstEnabledIndex;
|
|
3652
|
-
const visibleTagCount = getSafeTagCount(
|
|
3653
|
-
maxTagCount,
|
|
3654
|
-
selectedOptions.length
|
|
3655
|
-
);
|
|
3656
|
-
const visibleOptions = selectedOptions.slice(0, visibleTagCount);
|
|
3657
|
-
const overflowCount = selectedOptions.length - visibleOptions.length;
|
|
3658
|
-
const isPlaceholder = selectedOptions.length === 0;
|
|
3659
|
-
const setRootRef = (node) => {
|
|
3660
|
-
rootRef.current = node;
|
|
3661
|
-
if (typeof ref === "function") {
|
|
3662
|
-
ref(node);
|
|
3663
|
-
} else if (ref) {
|
|
3664
|
-
ref.current = node;
|
|
3665
|
-
}
|
|
3666
|
-
};
|
|
3667
|
-
const setOpen = (nextOpen) => {
|
|
3668
|
-
if (disabled || forceOpen) return;
|
|
3669
|
-
setUncontrolledOpen(nextOpen);
|
|
3670
|
-
if (nextOpen) {
|
|
3671
|
-
setActiveIndex(resolvedActiveIndex);
|
|
3672
|
-
}
|
|
3673
|
-
};
|
|
3674
|
-
react.useEffect(() => {
|
|
3675
|
-
if (!open || forceOpen) return void 0;
|
|
3676
|
-
const handlePointerDown = (event) => {
|
|
3677
|
-
if (!rootRef.current?.contains(event.target)) {
|
|
3678
|
-
setUncontrolledOpen(false);
|
|
3679
|
-
}
|
|
3680
|
-
};
|
|
3681
|
-
document.addEventListener("pointerdown", handlePointerDown);
|
|
3682
|
-
return () => {
|
|
3683
|
-
document.removeEventListener("pointerdown", handlePointerDown);
|
|
3684
|
-
};
|
|
3685
|
-
}, [forceOpen, open]);
|
|
3686
|
-
react.useEffect(() => {
|
|
3687
|
-
if (resolvedActiveIndex >= 0 && resolvedActiveIndex !== activeIndex) {
|
|
3688
|
-
setActiveIndex(resolvedActiveIndex);
|
|
3689
|
-
}
|
|
3690
|
-
}, [activeIndex, resolvedActiveIndex]);
|
|
3691
|
-
const commitValues = (nextValues) => {
|
|
3692
|
-
const normalizedValues = normalizeValues(nextValues);
|
|
3693
|
-
if (!isControlled) {
|
|
3694
|
-
setUncontrolledValue(normalizedValues);
|
|
3695
|
-
}
|
|
3696
|
-
onValueChange?.(normalizedValues);
|
|
3697
|
-
};
|
|
3698
|
-
const toggleOption = (option) => {
|
|
3699
|
-
if (!option || option.disabled || disabled) return;
|
|
3700
|
-
const nextValues = selectedValueSet.has(option.value) ? selectedValues.filter((selectedValue) => selectedValue !== option.value) : [...selectedValues, option.value];
|
|
3701
|
-
commitValues(nextValues);
|
|
3702
|
-
};
|
|
3703
|
-
const removeOption = (option) => {
|
|
3704
|
-
if (disabled) return;
|
|
3705
|
-
commitValues(
|
|
3706
|
-
selectedValues.filter((selectedValue) => selectedValue !== option.value)
|
|
3707
|
-
);
|
|
3708
|
-
};
|
|
3709
|
-
const focusOption = (direction) => {
|
|
3710
|
-
const nextIndex = getNextEnabledIndex(
|
|
3711
|
-
optionList,
|
|
3712
|
-
resolvedActiveIndex,
|
|
3713
|
-
direction
|
|
3714
|
-
);
|
|
3715
|
-
if (nextIndex >= 0) {
|
|
3716
|
-
setActiveIndex(nextIndex);
|
|
3717
|
-
}
|
|
3718
|
-
};
|
|
3719
|
-
const handleKeyDown = (event) => {
|
|
3720
|
-
if (disabled) return;
|
|
3721
|
-
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
3722
|
-
event.preventDefault();
|
|
3723
|
-
if (!open) {
|
|
3724
|
-
setOpen(true);
|
|
3725
|
-
setActiveIndex(firstEnabledIndex);
|
|
3726
|
-
return;
|
|
3727
|
-
}
|
|
3728
|
-
focusOption(event.key === "ArrowDown" ? 1 : -1);
|
|
3729
|
-
return;
|
|
3730
|
-
}
|
|
3731
|
-
if (event.key === "Home") {
|
|
3732
|
-
event.preventDefault();
|
|
3733
|
-
setOpen(true);
|
|
3734
|
-
setActiveIndex(firstEnabledIndex);
|
|
3735
|
-
return;
|
|
3736
|
-
}
|
|
3737
|
-
if (event.key === "End") {
|
|
3738
|
-
event.preventDefault();
|
|
3739
|
-
setOpen(true);
|
|
3740
|
-
for (let index = optionList.length - 1; index >= 0; index -= 1) {
|
|
3741
|
-
if (!optionList[index]?.disabled) {
|
|
3742
|
-
setActiveIndex(index);
|
|
3743
|
-
break;
|
|
3744
|
-
}
|
|
3745
|
-
}
|
|
3746
|
-
return;
|
|
3747
|
-
}
|
|
3748
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
3749
|
-
event.preventDefault();
|
|
3750
|
-
if (!open) {
|
|
3751
|
-
setOpen(true);
|
|
3752
|
-
return;
|
|
3753
|
-
}
|
|
3754
|
-
toggleOption(optionList[resolvedActiveIndex]);
|
|
3755
|
-
return;
|
|
3756
|
-
}
|
|
3757
|
-
if (event.key === "Escape") {
|
|
3758
|
-
setOpen(false);
|
|
3759
|
-
}
|
|
3760
|
-
};
|
|
3761
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3762
|
-
"div",
|
|
3763
|
-
{
|
|
3764
|
-
...rootProps,
|
|
3765
|
-
id,
|
|
3766
|
-
ref: setRootRef,
|
|
3767
|
-
className: cn(
|
|
3768
|
-
theme.slots.controlWrapper,
|
|
3769
|
-
"overflow-visible",
|
|
3770
|
-
open && "z-50",
|
|
3771
|
-
invalid && theme.slots.controlInvalid,
|
|
3772
|
-
disabled && theme.slots.controlDisabled,
|
|
3773
|
-
classNames?.root,
|
|
3774
|
-
className
|
|
3775
|
-
),
|
|
3776
|
-
style: {
|
|
3777
|
-
...theme.styles.control,
|
|
3778
|
-
...invalid ? theme.styles.controlInvalid : void 0,
|
|
3779
|
-
...disabled ? theme.styles.controlDisabled : void 0,
|
|
3780
|
-
...style
|
|
3781
|
-
},
|
|
3782
|
-
children: [
|
|
3783
|
-
hasRenderableNode(icon) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(theme.slots.controlIcon, classNames?.icon), children: icon }) : null,
|
|
3784
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3785
|
-
"div",
|
|
3786
|
-
{
|
|
3787
|
-
id: controlId,
|
|
3788
|
-
role: "combobox",
|
|
3789
|
-
tabIndex: disabled ? -1 : 0,
|
|
3790
|
-
"aria-haspopup": "listbox",
|
|
3791
|
-
"aria-expanded": open,
|
|
3792
|
-
"aria-controls": listboxId,
|
|
3793
|
-
"aria-disabled": disabled || void 0,
|
|
3794
|
-
"aria-required": required || void 0,
|
|
3795
|
-
"aria-invalid": nativeAriaInvalid ?? (invalid || void 0),
|
|
3796
|
-
"aria-label": nativeAriaLabel,
|
|
3797
|
-
"aria-labelledby": nativeAriaLabelledBy,
|
|
3798
|
-
className: cn(
|
|
3799
|
-
theme.slots.controlBase,
|
|
3800
|
-
"flex min-h-9 cursor-pointer flex-wrap items-center gap-1.5 py-1.5 pr-9 text-left",
|
|
3801
|
-
disabled && "!cursor-not-allowed",
|
|
3802
|
-
classNames?.control
|
|
3803
|
-
),
|
|
3804
|
-
onClick: () => setOpen(!open),
|
|
3805
|
-
onKeyDown: handleKeyDown,
|
|
3806
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3807
|
-
"span",
|
|
3808
|
-
{
|
|
3809
|
-
className: cn(
|
|
3810
|
-
"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",
|
|
3811
|
-
classNames?.tagList
|
|
3812
|
-
),
|
|
3813
|
-
children: [
|
|
3814
|
-
visibleOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3815
|
-
"span",
|
|
3816
|
-
{
|
|
3817
|
-
className: cn(
|
|
3818
|
-
"inline-flex max-w-full items-center gap-1 rounded-full border border-border/70 bg-muted/65 px-2 py-0.5 text-xs font-medium text-foreground",
|
|
3819
|
-
classNames?.tag
|
|
3820
|
-
),
|
|
3821
|
-
children: [
|
|
3822
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3823
|
-
"span",
|
|
3824
|
-
{
|
|
3825
|
-
className: cn(
|
|
3826
|
-
"max-w-40 truncate",
|
|
3827
|
-
classNames?.tagLabel
|
|
3828
|
-
),
|
|
3829
|
-
children: option.label
|
|
3830
|
-
}
|
|
3831
|
-
),
|
|
3832
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3833
|
-
"button",
|
|
3834
|
-
{
|
|
3835
|
-
type: "button",
|
|
3836
|
-
"aria-label": removeLabel(option),
|
|
3837
|
-
disabled,
|
|
3838
|
-
className: cn(
|
|
3839
|
-
"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-background/80 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed",
|
|
3840
|
-
classNames?.tagRemove
|
|
3841
|
-
),
|
|
3842
|
-
onClick: (event) => {
|
|
3843
|
-
event.preventDefault();
|
|
3844
|
-
event.stopPropagation();
|
|
3845
|
-
removeOption(option);
|
|
3846
|
-
},
|
|
3847
|
-
onMouseDown: (event) => {
|
|
3848
|
-
event.preventDefault();
|
|
3849
|
-
event.stopPropagation();
|
|
3850
|
-
},
|
|
3851
|
-
onKeyDown: (event) => event.stopPropagation(),
|
|
3852
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "x" })
|
|
3853
|
-
}
|
|
3854
|
-
)
|
|
3855
|
-
]
|
|
3856
|
-
},
|
|
3857
|
-
option.value
|
|
3858
|
-
)),
|
|
3859
|
-
overflowCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3860
|
-
"span",
|
|
3861
|
-
{
|
|
3862
|
-
className: cn(
|
|
3863
|
-
"inline-flex max-w-full items-center rounded-full border border-border/70 bg-muted/45 px-2 py-0.5 text-xs font-medium text-muted-foreground",
|
|
3864
|
-
classNames?.tag
|
|
3865
|
-
),
|
|
3866
|
-
children: [
|
|
3867
|
-
"+",
|
|
3868
|
-
overflowCount
|
|
3869
|
-
]
|
|
3870
|
-
}
|
|
3871
|
-
) : null,
|
|
3872
|
-
isPlaceholder ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3873
|
-
"span",
|
|
3874
|
-
{
|
|
3875
|
-
className: cn(
|
|
3876
|
-
"min-w-0 truncate",
|
|
3877
|
-
theme.slots.selectPlaceholder,
|
|
3878
|
-
classNames?.placeholder
|
|
3879
|
-
),
|
|
3880
|
-
children: placeholder
|
|
3881
|
-
}
|
|
3882
|
-
) : null
|
|
3883
|
-
]
|
|
3884
|
-
}
|
|
3885
|
-
)
|
|
3886
|
-
}
|
|
3887
|
-
),
|
|
3888
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3889
|
-
"span",
|
|
3890
|
-
{
|
|
3891
|
-
className: cn(
|
|
3892
|
-
theme.slots.selectChevron,
|
|
3893
|
-
open && "rotate-[225deg]",
|
|
3894
|
-
classNames?.chevron
|
|
3895
|
-
)
|
|
3896
|
-
}
|
|
3897
|
-
),
|
|
3898
|
-
name ? selectedValues.map((selectedValue) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3899
|
-
"input",
|
|
3900
|
-
{
|
|
3901
|
-
type: "hidden",
|
|
3902
|
-
name,
|
|
3903
|
-
value: selectedValue,
|
|
3904
|
-
className: classNames?.hiddenInput
|
|
3905
|
-
},
|
|
3906
|
-
selectedValue
|
|
3907
|
-
)) : null,
|
|
3908
|
-
open ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3909
|
-
"div",
|
|
3910
|
-
{
|
|
3911
|
-
id: listboxId,
|
|
3912
|
-
role: "listbox",
|
|
3913
|
-
"aria-multiselectable": "true",
|
|
3914
|
-
"aria-labelledby": controlId,
|
|
3915
|
-
className: cn(theme.slots.selectMenu, classNames?.menu),
|
|
3916
|
-
style: theme.styles.selectMenu,
|
|
3917
|
-
children: optionList.length > 0 ? optionList.map((option, index) => {
|
|
3918
|
-
const selected = selectedValueSet.has(option.value);
|
|
3919
|
-
const active = index === resolvedActiveIndex;
|
|
3920
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3921
|
-
"button",
|
|
3922
|
-
{
|
|
3923
|
-
type: "button",
|
|
3924
|
-
role: "option",
|
|
3925
|
-
"aria-selected": selected,
|
|
3926
|
-
disabled: option.disabled,
|
|
3927
|
-
className: cn(
|
|
3928
|
-
theme.slots.selectOption,
|
|
3929
|
-
"gap-2",
|
|
3930
|
-
active && theme.slots.selectOptionActive,
|
|
3931
|
-
selected && theme.slots.selectOptionSelected,
|
|
3932
|
-
option.disabled && theme.slots.selectOptionDisabled,
|
|
3933
|
-
classNames?.option
|
|
3934
|
-
),
|
|
3935
|
-
style: {
|
|
3936
|
-
...theme.styles.selectOption,
|
|
3937
|
-
...active ? theme.styles.selectOptionActive : void 0,
|
|
3938
|
-
...selected ? theme.styles.selectOptionSelected : void 0
|
|
3939
|
-
},
|
|
3940
|
-
onMouseEnter: () => {
|
|
3941
|
-
if (!option.disabled) {
|
|
3942
|
-
setActiveIndex(index);
|
|
3943
|
-
}
|
|
3944
|
-
},
|
|
3945
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
3946
|
-
onClick: () => toggleOption(option),
|
|
3947
|
-
children: [
|
|
3948
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3949
|
-
"span",
|
|
3950
|
-
{
|
|
3951
|
-
"aria-hidden": "true",
|
|
3952
|
-
className: cn(
|
|
3953
|
-
"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border/70 text-[10px]",
|
|
3954
|
-
selected && "border-primary/40 bg-primary text-primary-foreground",
|
|
3955
|
-
classNames?.optionIndicator
|
|
3956
|
-
),
|
|
3957
|
-
children: selected ? "\u2713" : null
|
|
3958
|
-
}
|
|
3959
|
-
),
|
|
3960
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3961
|
-
"span",
|
|
3962
|
-
{
|
|
3963
|
-
className: cn(
|
|
3964
|
-
"min-w-0 flex-1 truncate",
|
|
3965
|
-
classNames?.optionLabel
|
|
3966
|
-
),
|
|
3967
|
-
children: option.label
|
|
3968
|
-
}
|
|
3969
|
-
)
|
|
3970
|
-
]
|
|
3971
|
-
},
|
|
3972
|
-
option.value
|
|
3973
|
-
);
|
|
3974
|
-
}) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3975
|
-
"div",
|
|
3976
|
-
{
|
|
3977
|
-
className: cn(
|
|
3978
|
-
"px-2.5 py-2 text-sm text-muted-foreground",
|
|
3979
|
-
classNames?.empty
|
|
3980
|
-
),
|
|
3981
|
-
children: emptyLabel
|
|
3982
|
-
}
|
|
3983
|
-
)
|
|
3984
|
-
}
|
|
3985
|
-
) : null
|
|
3986
|
-
]
|
|
3987
|
-
}
|
|
3988
|
-
);
|
|
3989
|
-
}
|
|
3990
|
-
);
|
|
3991
3549
|
function BaseNotice({
|
|
3992
3550
|
tone,
|
|
3993
3551
|
icon,
|
|
@@ -4389,7 +3947,7 @@ function getInitialValue2(options, defaultValue) {
|
|
|
4389
3947
|
}
|
|
4390
3948
|
return "";
|
|
4391
3949
|
}
|
|
4392
|
-
function
|
|
3950
|
+
function getNextEnabledIndex(options, currentIndex, direction) {
|
|
4393
3951
|
if (!options.length) return -1;
|
|
4394
3952
|
for (let offset = 1; offset <= options.length; offset += 1) {
|
|
4395
3953
|
const nextIndex = (currentIndex + offset * direction + options.length) % options.length;
|
|
@@ -4491,7 +4049,7 @@ var BaseSelect = react.forwardRef(
|
|
|
4491
4049
|
};
|
|
4492
4050
|
const focusOption = (direction) => {
|
|
4493
4051
|
const currentIndex = activeIndex >= 0 ? activeIndex : 0;
|
|
4494
|
-
const nextIndex =
|
|
4052
|
+
const nextIndex = getNextEnabledIndex(optionList, currentIndex, direction);
|
|
4495
4053
|
if (nextIndex >= 0) {
|
|
4496
4054
|
commitValue(optionList[nextIndex].value, optionList[nextIndex].disabled);
|
|
4497
4055
|
}
|
|
@@ -5890,7 +5448,6 @@ exports.BaseLayoutPane = BaseLayoutPane;
|
|
|
5890
5448
|
exports.BaseLayoutResizeHandle = BaseLayoutResizeHandle;
|
|
5891
5449
|
exports.BaseLayoutSplit = BaseLayoutSplit;
|
|
5892
5450
|
exports.BaseLoadingState = BaseLoadingState;
|
|
5893
|
-
exports.BaseMultiSelect = BaseMultiSelect;
|
|
5894
5451
|
exports.BaseNotice = BaseNotice;
|
|
5895
5452
|
exports.BasePagination = BasePagination;
|
|
5896
5453
|
exports.BasePanel = BasePanel;
|