lecom-ui 5.4.9 → 5.4.10
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/README.md +1 -1
- package/dist/components/CustomTagInput/CustomTagInput.js +172 -27
- package/dist/components/DataTable/DataTable.js +1 -3
- package/dist/components/Header/SearchInput.js +1 -4
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/MultiSelect/MultiSelect.js +5 -8
- package/dist/i18n/locales/en_us.js +1 -1
- package/dist/index.d.ts +9 -10
- package/dist/plugin/extend.js +79 -79
- package/dist/plugin/fontFaces.js +172 -172
- package/dist/plugin/general.js +12 -12
- package/dist/plugin/pluginDev.cjs +5 -5
- package/dist/plugin/pluginNext.cjs +5 -5
- package/dist/plugin/pluginNextTurbo.cjs +5 -5
- package/dist/plugin/pluginVite.cjs +5 -5
- package/dist/plugin/template.js +31 -31
- package/dist/plugin/typographies.js +152 -152
- package/dist/plugin/varsTheme.js +79 -79
- package/dist/style.min.css +1 -1
- package/package.json +134 -134
- package/dist/components/Collapse/Collapse.js +0 -94
- package/dist/components/CustomIcon/Icons/CadastroFacil.js +0 -23
- package/dist/components/CustomIcon/Icons/LogoLecom.js +0 -30
- package/dist/components/CustomIcon/Icons/LogoLecomBrand.js +0 -23
- package/dist/components/CustomIcon/Icons/ModoTeste.js +0 -23
- package/dist/components/CustomIcon/Icons/Rpa.js +0 -23
- package/dist/components/CustomIcon/Icons/SairModoTeste.js +0 -31
- package/dist/components/IconHandler/IconHandler.js +0 -99
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
lecom-ui
|
|
1
|
+
lecom-ui
|
|
@@ -17,7 +17,8 @@ const CustomTagItemComponent = React.memo(function CustomTagItemComponent2({
|
|
|
17
17
|
onDrag,
|
|
18
18
|
onDragEnd,
|
|
19
19
|
isDragging,
|
|
20
|
-
onMouseDown
|
|
20
|
+
onMouseDown,
|
|
21
|
+
isAllSelected = false
|
|
21
22
|
}) {
|
|
22
23
|
const [isEditing, setIsEditing] = React.useState(false);
|
|
23
24
|
const [editValue, setEditValue] = React.useState(item.label);
|
|
@@ -102,7 +103,8 @@ const CustomTagItemComponent = React.memo(function CustomTagItemComponent2({
|
|
|
102
103
|
className: cn(
|
|
103
104
|
"cursor-pointer group max-w-[15.625rem]",
|
|
104
105
|
isDragging && "opacity-30 scale-95 transition-all",
|
|
105
|
-
enableReorder && "cursor-grab active:cursor-grabbing"
|
|
106
|
+
enableReorder && "cursor-grab active:cursor-grabbing",
|
|
107
|
+
isAllSelected && "!bg-grey-100 [&>*]:!text-grey-400"
|
|
106
108
|
),
|
|
107
109
|
draggable: enableReorder && !readOnly,
|
|
108
110
|
onDragStart: handleDragStart,
|
|
@@ -114,7 +116,10 @@ const CustomTagItemComponent = React.memo(function CustomTagItemComponent2({
|
|
|
114
116
|
enableReorder && !readOnly && /* @__PURE__ */ React.createElement(
|
|
115
117
|
GripVertical,
|
|
116
118
|
{
|
|
117
|
-
className:
|
|
119
|
+
className: cn(
|
|
120
|
+
"w-4 h-4 opacity-100 transition-all cursor-grab flex-shrink-0 stroke-blue-600 fill-none hover:stroke-blue-800 hover:scale-110",
|
|
121
|
+
isAllSelected && "!stroke-grey-400"
|
|
122
|
+
),
|
|
118
123
|
onMouseDown: (e) => e.stopPropagation(),
|
|
119
124
|
strokeWidth: 2
|
|
120
125
|
}
|
|
@@ -132,7 +137,10 @@ const CustomTagItemComponent = React.memo(function CustomTagItemComponent2({
|
|
|
132
137
|
!readOnly && /* @__PURE__ */ React.createElement(
|
|
133
138
|
X,
|
|
134
139
|
{
|
|
135
|
-
className:
|
|
140
|
+
className: cn(
|
|
141
|
+
"w-4 h-4 cursor-pointer flex-shrink-0 stroke-blue-600 stroke-2 outline-none hover:stroke-blue-800 hover:scale-110 transition-all",
|
|
142
|
+
isAllSelected && "!stroke-grey-400"
|
|
143
|
+
),
|
|
136
144
|
onClick: handleRemove,
|
|
137
145
|
"aria-label": `Remover ${item.label}`,
|
|
138
146
|
tabIndex: 0
|
|
@@ -158,7 +166,8 @@ const TagItemWrapper = React.memo(function TagItemWrapper2({
|
|
|
158
166
|
onInlineAdd,
|
|
159
167
|
onInlineCancel,
|
|
160
168
|
onSpacerClick,
|
|
161
|
-
onMouseDown
|
|
169
|
+
onMouseDown,
|
|
170
|
+
isAllSelected = false
|
|
162
171
|
}) {
|
|
163
172
|
const showInlineInput = insertAtIndex === index;
|
|
164
173
|
const showDragIndicator = dragOverIndex === index && draggedIndex !== null && draggedIndex !== index;
|
|
@@ -184,7 +193,8 @@ const TagItemWrapper = React.memo(function TagItemWrapper2({
|
|
|
184
193
|
onDrag,
|
|
185
194
|
onDragEnd,
|
|
186
195
|
isDragging: draggedIndex === index,
|
|
187
|
-
onMouseDown
|
|
196
|
+
onMouseDown,
|
|
197
|
+
isAllSelected
|
|
188
198
|
}
|
|
189
199
|
), showDragIndicator && /* @__PURE__ */ React.createElement("div", { className: "w-1 h-6 bg-blue-500 rounded-full animate-pulse self-center" }), showSpacer && /* @__PURE__ */ React.createElement(
|
|
190
200
|
"div",
|
|
@@ -441,26 +451,92 @@ function useInlineInputHandlers(insertAtIndex, setInsertAtIndex, handleAddTag, r
|
|
|
441
451
|
);
|
|
442
452
|
return { handleInlineAdd, handleInlineCancel, handleSpacerClick };
|
|
443
453
|
}
|
|
444
|
-
|
|
454
|
+
const selectAllContent = (containerRef, inputRef) => {
|
|
455
|
+
if (!containerRef.current || !inputRef.current) return;
|
|
456
|
+
inputRef.current.focus();
|
|
457
|
+
const range = document.createRange();
|
|
458
|
+
const selection = window.getSelection();
|
|
459
|
+
range.selectNodeContents(containerRef.current);
|
|
460
|
+
selection?.removeAllRanges();
|
|
461
|
+
selection?.addRange(range);
|
|
462
|
+
if (inputRef.current.textContent) {
|
|
463
|
+
const inputRange = document.createRange();
|
|
464
|
+
inputRange.selectNodeContents(inputRef.current);
|
|
465
|
+
selection?.extend(inputRange.endContainer, inputRange.endOffset);
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
const clearAllTags = (onChange, setInputValue, setIsAllSelected, inputRef) => {
|
|
469
|
+
setIsAllSelected(false);
|
|
470
|
+
onChange([]);
|
|
471
|
+
if (inputRef.current) {
|
|
472
|
+
inputRef.current.textContent = "";
|
|
473
|
+
}
|
|
474
|
+
setInputValue("");
|
|
475
|
+
setTimeout(() => {
|
|
476
|
+
if (inputRef.current) {
|
|
477
|
+
inputRef.current.focus();
|
|
478
|
+
}
|
|
479
|
+
}, 0);
|
|
480
|
+
};
|
|
481
|
+
function useInputHandlers(inputValue, setInputValue, value, onChange, handleAddTag, handleAddMultipleTags, inputRef, containerRef, setIsAllSelected, isAllSelected) {
|
|
482
|
+
const handleSelectAll = React.useCallback((e) => {
|
|
483
|
+
e.preventDefault();
|
|
484
|
+
e.stopPropagation();
|
|
485
|
+
setIsAllSelected(true);
|
|
486
|
+
selectAllContent(containerRef, inputRef);
|
|
487
|
+
}, [containerRef, inputRef, setIsAllSelected]);
|
|
488
|
+
const handleSubmit = React.useCallback((e) => {
|
|
489
|
+
e.preventDefault();
|
|
490
|
+
const currentValue = e.target.textContent || "";
|
|
491
|
+
if (currentValue.trim()) {
|
|
492
|
+
handleAddTag(currentValue.trim());
|
|
493
|
+
if (inputRef.current) {
|
|
494
|
+
inputRef.current.textContent = "";
|
|
495
|
+
}
|
|
496
|
+
setInputValue("");
|
|
497
|
+
}
|
|
498
|
+
}, [handleAddTag, inputRef, setInputValue]);
|
|
499
|
+
const handleDelete = React.useCallback((e) => {
|
|
500
|
+
if (isAllSelected) {
|
|
501
|
+
e.preventDefault();
|
|
502
|
+
clearAllTags(onChange, setInputValue, setIsAllSelected, inputRef);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const selection = window.getSelection();
|
|
506
|
+
const hasSelection = selection && selection.toString().length > 0;
|
|
507
|
+
if (hasSelection && containerRef.current) {
|
|
508
|
+
const selectedText = selection.toString();
|
|
509
|
+
const hasTagsInSelection = value.some((item) => selectedText.includes(item.label));
|
|
510
|
+
if (hasTagsInSelection) {
|
|
511
|
+
e.preventDefault();
|
|
512
|
+
clearAllTags(onChange, setInputValue, setIsAllSelected, inputRef);
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
if (e.key === "Backspace" && !inputValue && value.length > 0 && !hasSelection) {
|
|
517
|
+
e.preventDefault();
|
|
518
|
+
onChange(value.slice(0, -1));
|
|
519
|
+
}
|
|
520
|
+
}, [isAllSelected, onChange, setInputValue, setIsAllSelected, inputRef, containerRef, value, inputValue]);
|
|
445
521
|
const handleKeyDown = React.useCallback(
|
|
446
522
|
(e) => {
|
|
447
523
|
const isSubmitKey = e.key === "Enter" || e.key === ";";
|
|
448
|
-
const isDeleteKey = e.key === "Backspace";
|
|
524
|
+
const isDeleteKey = e.key === "Backspace" || e.key === "Delete";
|
|
525
|
+
const isSelectAll = (e.ctrlKey || e.metaKey) && (e.key === "a" || e.key === "A");
|
|
526
|
+
if (isSelectAll) {
|
|
527
|
+
handleSelectAll(e);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
449
530
|
if (isSubmitKey) {
|
|
450
|
-
e
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
setInputValue("");
|
|
458
|
-
}
|
|
459
|
-
} else if (isDeleteKey && !inputValue && value.length > 0) {
|
|
460
|
-
onChange(value.slice(0, -1));
|
|
531
|
+
handleSubmit(e);
|
|
532
|
+
} else if (isDeleteKey) {
|
|
533
|
+
handleDelete(e);
|
|
534
|
+
}
|
|
535
|
+
if (!isSelectAll && isAllSelected) {
|
|
536
|
+
setIsAllSelected(false);
|
|
461
537
|
}
|
|
462
538
|
},
|
|
463
|
-
[
|
|
539
|
+
[handleSelectAll, handleSubmit, handleDelete, isAllSelected, setIsAllSelected]
|
|
464
540
|
);
|
|
465
541
|
const handlePaste = React.useCallback(
|
|
466
542
|
(e) => {
|
|
@@ -503,7 +579,7 @@ function useTagEditHandler(value, onChange, onTagEdit) {
|
|
|
503
579
|
);
|
|
504
580
|
return { handleEdit };
|
|
505
581
|
}
|
|
506
|
-
function useContainerClickHandler(disabled, inputRef) {
|
|
582
|
+
function useContainerClickHandler(disabled, inputRef, setIsAllSelected) {
|
|
507
583
|
const handleContainerClick = React.useCallback(
|
|
508
584
|
(e) => {
|
|
509
585
|
const target = e.target;
|
|
@@ -511,12 +587,58 @@ function useContainerClickHandler(disabled, inputRef) {
|
|
|
511
587
|
const isClickOnInlineInput = target.closest('[data-inline-input="true"]');
|
|
512
588
|
if (isClickOnTag || isClickOnInlineInput) return;
|
|
513
589
|
if (disabled || !inputRef.current) return;
|
|
590
|
+
setIsAllSelected(false);
|
|
514
591
|
inputRef.current.focus();
|
|
515
592
|
},
|
|
516
|
-
[disabled, inputRef]
|
|
593
|
+
[disabled, inputRef, setIsAllSelected]
|
|
517
594
|
);
|
|
518
595
|
return { handleContainerClick };
|
|
519
596
|
}
|
|
597
|
+
function useContainerKeyHandler(containerRef, value, onChange, inputRef, setInputValue, outerContainerRef, setIsAllSelected, isAllSelected) {
|
|
598
|
+
const handleContainerSelectAll = React.useCallback((e) => {
|
|
599
|
+
e.preventDefault();
|
|
600
|
+
e.stopPropagation();
|
|
601
|
+
setIsAllSelected(true);
|
|
602
|
+
selectAllContent(containerRef, inputRef);
|
|
603
|
+
}, [containerRef, inputRef, setIsAllSelected]);
|
|
604
|
+
const handleContainerDelete = React.useCallback((e) => {
|
|
605
|
+
if (isAllSelected) {
|
|
606
|
+
e.preventDefault();
|
|
607
|
+
e.stopPropagation();
|
|
608
|
+
clearAllTags(onChange, setInputValue, setIsAllSelected, inputRef);
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
const selection = window.getSelection();
|
|
612
|
+
const hasSelection = selection && selection.toString().length > 0;
|
|
613
|
+
if (hasSelection && containerRef.current) {
|
|
614
|
+
const selectedText = selection.toString();
|
|
615
|
+
const hasTagsInSelection = value.some((item) => selectedText.includes(item.label));
|
|
616
|
+
if (hasTagsInSelection) {
|
|
617
|
+
e.preventDefault();
|
|
618
|
+
e.stopPropagation();
|
|
619
|
+
clearAllTags(onChange, setInputValue, setIsAllSelected, inputRef);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}, [isAllSelected, onChange, setInputValue, setIsAllSelected, inputRef, containerRef, value]);
|
|
623
|
+
const handleContainerKeyDown = React.useCallback(
|
|
624
|
+
(e) => {
|
|
625
|
+
const isSelectAll = (e.ctrlKey || e.metaKey) && (e.key === "a" || e.key === "A");
|
|
626
|
+
const isDeleteKey = e.key === "Backspace" || e.key === "Delete";
|
|
627
|
+
if (isSelectAll) {
|
|
628
|
+
handleContainerSelectAll(e);
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
if (isDeleteKey) {
|
|
632
|
+
handleContainerDelete(e);
|
|
633
|
+
}
|
|
634
|
+
if (!isSelectAll && isAllSelected) {
|
|
635
|
+
setIsAllSelected(false);
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
[handleContainerSelectAll, handleContainerDelete, isAllSelected, setIsAllSelected]
|
|
639
|
+
);
|
|
640
|
+
return { handleContainerKeyDown };
|
|
641
|
+
}
|
|
520
642
|
function useContainerStyles(variant, radius, disabled, className, maxHeight) {
|
|
521
643
|
const textareaRadius = radius === "full" ? "large" : radius;
|
|
522
644
|
const containerClassNames = cn(
|
|
@@ -556,7 +678,9 @@ function CustomTagInputRenderer({
|
|
|
556
678
|
handleKeyDown,
|
|
557
679
|
handlePaste,
|
|
558
680
|
setInputValue,
|
|
559
|
-
handleMouseDown
|
|
681
|
+
handleMouseDown,
|
|
682
|
+
isAllSelected,
|
|
683
|
+
setIsAllSelected
|
|
560
684
|
}) {
|
|
561
685
|
const showFinalInlineInput = insertAtIndex === value.length;
|
|
562
686
|
const inputPlaceholder = value.length === 0 ? placeholder : "";
|
|
@@ -581,7 +705,8 @@ function CustomTagInputRenderer({
|
|
|
581
705
|
onInlineAdd: handleInlineAdd,
|
|
582
706
|
onInlineCancel: handleInlineCancel,
|
|
583
707
|
onSpacerClick: handleSpacerClick,
|
|
584
|
-
onMouseDown: handleMouseDown
|
|
708
|
+
onMouseDown: handleMouseDown,
|
|
709
|
+
isAllSelected
|
|
585
710
|
}
|
|
586
711
|
)), showFinalInlineInput && /* @__PURE__ */ React.createElement(
|
|
587
712
|
InlineInput,
|
|
@@ -602,6 +727,7 @@ function CustomTagInputRenderer({
|
|
|
602
727
|
},
|
|
603
728
|
onKeyDown: handleKeyDown,
|
|
604
729
|
onPaste: handlePaste,
|
|
730
|
+
onFocus: () => setIsAllSelected(false),
|
|
605
731
|
"data-placeholder": inputPlaceholder,
|
|
606
732
|
className: "bg-transparent border-none outline-none body-small-400 text-grey-800 min-h-[1.5rem] empty:before:content-[attr(data-placeholder)] empty:before:text-grey-400 leading-6",
|
|
607
733
|
style: { flex: "1 1 auto", minWidth: "3.75rem", wordBreak: "break-word" }
|
|
@@ -627,8 +753,10 @@ function CustomTagInput(props) {
|
|
|
627
753
|
} = props;
|
|
628
754
|
const [inputValue, setInputValue] = React.useState("");
|
|
629
755
|
const [insertAtIndex, setInsertAtIndex] = React.useState(null);
|
|
756
|
+
const [isAllSelected, setIsAllSelected] = React.useState(false);
|
|
630
757
|
const inputRef = React.useRef(null);
|
|
631
758
|
const containerRef = React.useRef(null);
|
|
759
|
+
const outerContainerRef = React.useRef(null);
|
|
632
760
|
const { handleAddTag, handleAddMultipleTags, handleRemove } = useTagManagement(
|
|
633
761
|
value,
|
|
634
762
|
onChange,
|
|
@@ -642,10 +770,23 @@ function CustomTagInput(props) {
|
|
|
642
770
|
onChange,
|
|
643
771
|
handleAddTag,
|
|
644
772
|
handleAddMultipleTags,
|
|
645
|
-
inputRef
|
|
773
|
+
inputRef,
|
|
774
|
+
containerRef,
|
|
775
|
+
setIsAllSelected,
|
|
776
|
+
isAllSelected
|
|
646
777
|
);
|
|
647
778
|
const { handleEdit } = useTagEditHandler(value, onChange, onTagEdit);
|
|
648
|
-
const { handleContainerClick } = useContainerClickHandler(disabled, inputRef);
|
|
779
|
+
const { handleContainerClick } = useContainerClickHandler(disabled, inputRef, setIsAllSelected);
|
|
780
|
+
const { handleContainerKeyDown } = useContainerKeyHandler(
|
|
781
|
+
containerRef,
|
|
782
|
+
value,
|
|
783
|
+
onChange,
|
|
784
|
+
inputRef,
|
|
785
|
+
setInputValue,
|
|
786
|
+
outerContainerRef,
|
|
787
|
+
setIsAllSelected,
|
|
788
|
+
isAllSelected
|
|
789
|
+
);
|
|
649
790
|
const { handleInlineAdd, handleInlineCancel, handleSpacerClick } = useInlineInputHandlers(
|
|
650
791
|
insertAtIndex,
|
|
651
792
|
setInsertAtIndex,
|
|
@@ -663,12 +804,14 @@ function CustomTagInput(props) {
|
|
|
663
804
|
return /* @__PURE__ */ React.createElement(
|
|
664
805
|
"div",
|
|
665
806
|
{
|
|
807
|
+
ref: outerContainerRef,
|
|
666
808
|
className: containerClassNames,
|
|
667
809
|
tabIndex: 0,
|
|
668
810
|
role: "textbox",
|
|
669
811
|
"aria-multiline": "true",
|
|
670
812
|
"aria-disabled": disabled,
|
|
671
813
|
"aria-readonly": readOnly,
|
|
814
|
+
onKeyDown: handleContainerKeyDown,
|
|
672
815
|
...restProps
|
|
673
816
|
},
|
|
674
817
|
/* @__PURE__ */ React.createElement(
|
|
@@ -704,7 +847,9 @@ function CustomTagInput(props) {
|
|
|
704
847
|
handleKeyDown,
|
|
705
848
|
handlePaste,
|
|
706
849
|
setInputValue,
|
|
707
|
-
handleMouseDown
|
|
850
|
+
handleMouseDown,
|
|
851
|
+
isAllSelected,
|
|
852
|
+
setIsAllSelected
|
|
708
853
|
}
|
|
709
854
|
)
|
|
710
855
|
)
|
|
@@ -101,15 +101,13 @@ function DataTable({
|
|
|
101
101
|
currentElem.style.position = "sticky";
|
|
102
102
|
currentElem.style.left = `${beforeElemWidth + beforeElemLeft}px`;
|
|
103
103
|
currentElem.style.boxShadow = boxShadow;
|
|
104
|
-
currentElem.style.backgroundColor = currentElemIsTh ? "#f9fafb" : "#ffffff";
|
|
105
|
-
currentElem.style.zIndex = "1";
|
|
106
104
|
if (lastColumnFixed) {
|
|
107
105
|
currentElem.setAttribute("data-separator-fixed", "true");
|
|
108
106
|
}
|
|
109
107
|
});
|
|
110
108
|
});
|
|
111
109
|
}
|
|
112
|
-
}, [isLoading
|
|
110
|
+
}, [isLoading]);
|
|
113
111
|
const throttle = React.useCallback(
|
|
114
112
|
(func, delay) => {
|
|
115
113
|
let timeoutId = null;
|
|
@@ -9,7 +9,6 @@ const SearchInput = ({
|
|
|
9
9
|
customStyles,
|
|
10
10
|
placeholder,
|
|
11
11
|
isActiveButton,
|
|
12
|
-
value,
|
|
13
12
|
onChangeValue,
|
|
14
13
|
onClickButton
|
|
15
14
|
}) => {
|
|
@@ -45,11 +44,9 @@ const SearchInput = ({
|
|
|
45
44
|
{
|
|
46
45
|
id: "header-search-input-lecom-ui",
|
|
47
46
|
placeholder,
|
|
48
|
-
size: "small",
|
|
49
47
|
radius: "full",
|
|
50
|
-
value,
|
|
51
48
|
prefixInset: /* @__PURE__ */ React.createElement(Search, { size: 20, color: mappedCustomStyles.color }),
|
|
52
|
-
className: "body-small-400 border-none
|
|
49
|
+
className: "body-small-400 border-none",
|
|
53
50
|
containerClassName: "grow",
|
|
54
51
|
onMouseOver: handleOver,
|
|
55
52
|
onMouseOut: handleOut,
|
|
@@ -3,7 +3,7 @@ import { cn } from '../../lib/utils.js';
|
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
const inputVariants = cva(
|
|
6
|
-
`flex w-full rounded-sm border border-grey-400 bg-background px-3 py-2
|
|
6
|
+
`flex h-8 w-full rounded-sm border border-grey-400 bg-background px-3 py-2
|
|
7
7
|
placeholder:text-grey-500 outline-none
|
|
8
8
|
hover:border-grey-500 focus:bg-background focus:border-grey-400 focus:ring-grey-600 focus:ring-opacity-15 focus:ring-4
|
|
9
9
|
disabled:cursor-not-allowed disabled:bg-grey-100 disabled:border-grey-400
|
|
@@ -16,7 +16,7 @@ const inputVariants = cva(
|
|
|
16
16
|
borderless: "border-none bg-transparent focus:bg-transparent focus:ring-0"
|
|
17
17
|
},
|
|
18
18
|
size: {
|
|
19
|
-
small: "h-8 body-small-400 px-
|
|
19
|
+
small: "h-8 body-small-400 px-3 py-0 placeholder:body-small-400",
|
|
20
20
|
default: "h-10 body-medium-400 px-3 py-2 placeholder:body-medium-400",
|
|
21
21
|
large: "h-12 body-large-400 px-3 py-2 placeholder:body-large-400"
|
|
22
22
|
},
|
|
@@ -56,8 +56,7 @@ const MultiSelect = React.forwardRef(
|
|
|
56
56
|
allowTypoDistance = 0,
|
|
57
57
|
groupedOptions,
|
|
58
58
|
classNameContent,
|
|
59
|
-
size = "medium"
|
|
60
|
-
disabled = false
|
|
59
|
+
size = "medium"
|
|
61
60
|
}, ref) => {
|
|
62
61
|
const { t } = useTranslation();
|
|
63
62
|
const [selectedValues, setSelectedValues] = React.useState(value);
|
|
@@ -515,11 +514,9 @@ const MultiSelect = React.forwardRef(
|
|
|
515
514
|
transition-all duration-300 outline-none
|
|
516
515
|
[&_svg]:pointer-events-auto`,
|
|
517
516
|
maxCount === void 0 && TRIGGER_HEIGHT_CLASSES[size],
|
|
518
|
-
disabled && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
519
517
|
className
|
|
520
518
|
),
|
|
521
|
-
"aria-expanded": isPopoverOpen
|
|
522
|
-
disabled
|
|
519
|
+
"aria-expanded": isPopoverOpen
|
|
523
520
|
},
|
|
524
521
|
selectedValues.length > 0 ? /* @__PURE__ */ React.createElement("div", { className: "flex justify-between items-center w-full" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap items-center gap-1" }, selectedValues.slice(0, dynamicMaxCount).map((value2) => {
|
|
525
522
|
const selectedOption = options.find((option) => option.value === value2);
|
|
@@ -540,7 +537,7 @@ const MultiSelect = React.forwardRef(
|
|
|
540
537
|
className: "truncate"
|
|
541
538
|
},
|
|
542
539
|
label
|
|
543
|
-
)),
|
|
540
|
+
)), /* @__PURE__ */ React.createElement(
|
|
544
541
|
X,
|
|
545
542
|
{
|
|
546
543
|
className: "h-4 w-4 cursor-pointer flex-shrink-0",
|
|
@@ -550,7 +547,7 @@ const MultiSelect = React.forwardRef(
|
|
|
550
547
|
}
|
|
551
548
|
}
|
|
552
549
|
));
|
|
553
|
-
}), selectedValues.length > dynamicMaxCount && /* @__PURE__ */ React.createElement(Tag, { color: "blue", className: "focus:ring-0" }, /* @__PURE__ */ React.createElement(Typography, { variant: getFontVariant(size), className: "text-blue-600" }, `+ ${selectedValues.length - dynamicMaxCount}`))), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" },
|
|
550
|
+
}), selectedValues.length > dynamicMaxCount && /* @__PURE__ */ React.createElement(Tag, { color: "blue", className: "focus:ring-0" }, /* @__PURE__ */ React.createElement(Typography, { variant: getFontVariant(size), className: "text-blue-600" }, `+ ${selectedValues.length - dynamicMaxCount}`))), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement(
|
|
554
551
|
X,
|
|
555
552
|
{
|
|
556
553
|
className: "h-4 w-4 cursor-pointer text-grey-800",
|
|
@@ -565,7 +562,7 @@ const MultiSelect = React.forwardRef(
|
|
|
565
562
|
orientation: "vertical",
|
|
566
563
|
className: "flex min-h-4 mx-1 h-full"
|
|
567
564
|
}
|
|
568
|
-
)
|
|
565
|
+
), isPopoverOpen ? /* @__PURE__ */ React.createElement(ChevronUp, { className: "h-4 w-4 cursor-pointer text-grey-800" }) : /* @__PURE__ */ React.createElement(ChevronDown, { className: "h-4 w-4 cursor-pointer text-grey-800" }))) : /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between w-full mx-auto" }, /* @__PURE__ */ React.createElement(
|
|
569
566
|
Typography,
|
|
570
567
|
{
|
|
571
568
|
variant: getFontVariant(size),
|
package/dist/index.d.ts
CHANGED
|
@@ -726,7 +726,6 @@ interface SearchInputProps {
|
|
|
726
726
|
customStyles: CustomStyles$2;
|
|
727
727
|
placeholder?: string;
|
|
728
728
|
isActiveButton?: boolean;
|
|
729
|
-
value?: string;
|
|
730
729
|
onChangeValue?: (value: string) => void;
|
|
731
730
|
onClickButton?: () => void;
|
|
732
731
|
}
|
|
@@ -784,9 +783,9 @@ interface HeaderProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<
|
|
|
784
783
|
}
|
|
785
784
|
|
|
786
785
|
declare const inputVariants: (props?: ({
|
|
787
|
-
variant?: "
|
|
788
|
-
size?: "
|
|
789
|
-
radius?: "
|
|
786
|
+
variant?: "filled" | "default" | "borderless" | null | undefined;
|
|
787
|
+
size?: "small" | "large" | "default" | null | undefined;
|
|
788
|
+
radius?: "small" | "large" | "default" | "full" | null | undefined;
|
|
790
789
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
791
790
|
interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'sufix' | 'prefix'>, VariantProps<typeof inputVariants> {
|
|
792
791
|
sufix?: React$1.ReactNode;
|
|
@@ -991,7 +990,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
|
|
|
991
990
|
declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
992
991
|
|
|
993
992
|
declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
|
|
994
|
-
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<
|
|
993
|
+
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLDivElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
|
|
995
994
|
className?: string;
|
|
996
995
|
collapsedSize?: number | undefined;
|
|
997
996
|
collapsible?: boolean | undefined;
|
|
@@ -1157,9 +1156,9 @@ declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.
|
|
|
1157
1156
|
declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1158
1157
|
|
|
1159
1158
|
declare const textareaVariants: (props?: ({
|
|
1160
|
-
variant?: "
|
|
1161
|
-
size?: "
|
|
1162
|
-
radius?: "
|
|
1159
|
+
variant?: "filled" | "default" | "borderless" | null | undefined;
|
|
1160
|
+
size?: "small" | "large" | "default" | null | undefined;
|
|
1161
|
+
radius?: "small" | "large" | "default" | "full" | null | undefined;
|
|
1163
1162
|
resize?: "default" | "both" | "horizontal" | "vertical" | "vertical-limited" | null | undefined;
|
|
1164
1163
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1165
1164
|
interface TextareaProps extends React$1.ComponentProps<'textarea'>, VariantProps<typeof textareaVariants> {
|
|
@@ -1299,7 +1298,7 @@ declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.Dial
|
|
|
1299
1298
|
declare const SheetPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
1300
1299
|
declare const SheetOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1301
1300
|
declare const sheetVariants: (props?: ({
|
|
1302
|
-
side?: "
|
|
1301
|
+
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
1303
1302
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1304
1303
|
interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
1305
1304
|
}
|
|
@@ -1343,7 +1342,7 @@ interface DateInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEleme
|
|
|
1343
1342
|
declare const DateInput: React$1.ForwardRefExoticComponent<DateInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1344
1343
|
|
|
1345
1344
|
declare const badgeVariants: (props?: ({
|
|
1346
|
-
variant?: "
|
|
1345
|
+
variant?: "destructive" | "default" | "outline" | "secondary" | null | undefined;
|
|
1347
1346
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1348
1347
|
interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
1349
1348
|
}
|