@dafaz-ui/react 4.0.19 → 7.0.0
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +61 -0
- package/dist/index.d.mts +678 -42
- package/dist/index.d.ts +678 -42
- package/dist/index.js +782 -147
- package/dist/index.mjs +786 -149
- package/package.json +1 -1
- package/src/components/Box/styles.ts +64 -10
- package/src/components/Button/index.tsx +1 -1
- package/src/components/Button/styles.ts +14 -7
- package/src/components/CheckBox/index.tsx +10 -26
- package/src/components/CheckBox/styles.ts +3 -1
- package/src/components/Heading/index.tsx +1 -1
- package/src/components/Heading/styles.ts +29 -15
- package/src/components/MultiSelect/index.tsx +234 -0
- package/src/components/MultiSelect/styles.ts +146 -0
- package/src/components/Radio/RadioItem/index.tsx +6 -4
- package/src/components/Radio/RadioItem/styles.ts +4 -1
- package/src/components/Radio/index.tsx +38 -23
- package/src/components/Radio/styles.ts +2 -1
- package/src/components/Select/index.tsx +49 -35
- package/src/components/Select/styles.ts +79 -12
- package/src/components/Separator/index.tsx +7 -0
- package/src/components/Separator/styles.ts +51 -0
- package/src/components/Text/index.tsx +3 -2
- package/src/components/Text/styles.ts +24 -3
- package/src/components/TextArea/index.tsx +17 -9
- package/src/components/TextArea/styles.ts +7 -2
- package/src/components/TextInput/index.tsx +38 -4
- package/src/components/TextInput/styles.ts +60 -3
- package/src/index.tsx +2 -0
package/dist/index.mjs
CHANGED
@@ -34,6 +34,7 @@ var __objRest = (source, exclude) => {
|
|
34
34
|
var colors = {
|
35
35
|
white: "#FFF",
|
36
36
|
black: "#000",
|
37
|
+
red: "#ED0A0A",
|
37
38
|
gray100: "#D6D6D6",
|
38
39
|
gray200: "#666666",
|
39
40
|
gray400: "#444444",
|
@@ -76,7 +77,7 @@ var radii = {
|
|
76
77
|
var fonts = {
|
77
78
|
default: "Roboto, sans-serif",
|
78
79
|
app: "Poppins",
|
79
|
-
web: "League Spartan",
|
80
|
+
web: "League Spartan, League_Spartan",
|
80
81
|
offer: "KoHo",
|
81
82
|
code: "monospace"
|
82
83
|
};
|
@@ -87,7 +88,15 @@ var fontSizes = {
|
|
87
88
|
md: "0.875rem",
|
88
89
|
lg: "1.0rem",
|
89
90
|
xl: "1.25rem",
|
90
|
-
"2xl": "
|
91
|
+
"2xl": "1.5rem",
|
92
|
+
"3xl": "1.75rem",
|
93
|
+
"4xl": "2rem",
|
94
|
+
"5xl": "2.5rem",
|
95
|
+
"6xl": "3rem",
|
96
|
+
"7xl": "3.5rem",
|
97
|
+
"8xl": "4rem",
|
98
|
+
"9xl": "5rem",
|
99
|
+
"10xl": "6rem"
|
91
100
|
};
|
92
101
|
var fontWeights = {
|
93
102
|
regular: "400",
|
@@ -133,26 +142,77 @@ var {
|
|
133
142
|
var BoxUI = styled("div", {
|
134
143
|
padding: "$4",
|
135
144
|
variants: {
|
145
|
+
withShadow: {
|
146
|
+
true: {
|
147
|
+
boxShadow: "1px 1px 2px $colors$gray800"
|
148
|
+
}
|
149
|
+
},
|
136
150
|
stretch: {
|
137
151
|
true: {
|
138
|
-
width: "100%"
|
152
|
+
width: "100%",
|
153
|
+
"> div": {
|
154
|
+
paddingLeft: 0
|
155
|
+
}
|
139
156
|
},
|
140
157
|
false: {
|
141
|
-
width: "
|
158
|
+
width: "24.5rem",
|
159
|
+
"> div": {
|
160
|
+
paddingLeft: 0
|
161
|
+
}
|
142
162
|
}
|
143
163
|
},
|
144
|
-
|
145
|
-
|
164
|
+
color: {
|
165
|
+
dark: {
|
146
166
|
background: "$gray800"
|
147
167
|
},
|
148
|
-
|
168
|
+
primary: {
|
169
|
+
background: "$dafaz400"
|
170
|
+
},
|
171
|
+
secondary: {
|
172
|
+
background: "$dafaz800"
|
173
|
+
},
|
174
|
+
light: {
|
175
|
+
background: "$dafaz100"
|
176
|
+
},
|
177
|
+
transparent: {
|
149
178
|
background: "transparent"
|
150
179
|
}
|
180
|
+
},
|
181
|
+
rounded: {
|
182
|
+
px: {
|
183
|
+
borderRadius: "$px"
|
184
|
+
},
|
185
|
+
sm: {
|
186
|
+
borderRadius: "$sm"
|
187
|
+
},
|
188
|
+
md: {
|
189
|
+
borderRadius: "$md"
|
190
|
+
},
|
191
|
+
full: {
|
192
|
+
borderRadius: "$full"
|
193
|
+
}
|
194
|
+
},
|
195
|
+
direction: {
|
196
|
+
none: {},
|
197
|
+
row: {
|
198
|
+
display: "flex",
|
199
|
+
alignItems: "center",
|
200
|
+
justifyContent: "center"
|
201
|
+
},
|
202
|
+
column: {
|
203
|
+
display: "flex",
|
204
|
+
flexDirection: "column",
|
205
|
+
alignItems: "center",
|
206
|
+
justifyContent: "center"
|
207
|
+
}
|
151
208
|
}
|
152
209
|
},
|
153
210
|
defaultVariants: {
|
154
|
-
stretch:
|
155
|
-
|
211
|
+
stretch: true,
|
212
|
+
color: "dark",
|
213
|
+
rounded: "px",
|
214
|
+
withShadow: false,
|
215
|
+
direction: "row"
|
156
216
|
}
|
157
217
|
});
|
158
218
|
|
@@ -174,12 +234,14 @@ var ButtonUI = styled("button", {
|
|
174
234
|
textAlign: "center",
|
175
235
|
minWidth: 120,
|
176
236
|
boxSizing: "border-box",
|
237
|
+
boxShadow: "3px 3px 2px -2px $colors$gray400",
|
177
238
|
display: "flex",
|
178
239
|
alignItems: "center",
|
179
240
|
justifyContent: "center",
|
180
241
|
gap: "$2",
|
181
242
|
padding: "$2 $5",
|
182
243
|
cursor: "pointer",
|
244
|
+
transition: "background 0.2s linear",
|
183
245
|
"&:disabled": {
|
184
246
|
cursor: "not-allowed"
|
185
247
|
},
|
@@ -188,21 +250,21 @@ var ButtonUI = styled("button", {
|
|
188
250
|
primary: {
|
189
251
|
color: "$white",
|
190
252
|
background: "$dafaz600",
|
191
|
-
opacity: 0.8,
|
192
253
|
"&:not(:disabled):hover": {
|
193
|
-
|
254
|
+
background: "$dafaz400"
|
194
255
|
},
|
195
256
|
"&:disabled": {
|
196
257
|
background: "$gray200"
|
197
258
|
}
|
198
259
|
},
|
199
260
|
secondary: {
|
261
|
+
transition: "border, color 0.2s linear",
|
200
262
|
fontWeight: "$medium",
|
201
263
|
color: "$dafaz600",
|
202
264
|
border: "2px solid $dafaz600",
|
203
|
-
opacity: 0.8,
|
204
265
|
"&:not(:disabled):hover": {
|
205
|
-
|
266
|
+
color: "$dafaz400",
|
267
|
+
border: "2px solid $dafaz400"
|
206
268
|
},
|
207
269
|
"&:disabled": {
|
208
270
|
color: "$gray200",
|
@@ -210,10 +272,12 @@ var ButtonUI = styled("button", {
|
|
210
272
|
}
|
211
273
|
},
|
212
274
|
tertiary: {
|
275
|
+
transition: "color 0.2s linear",
|
276
|
+
boxShadow: "none",
|
213
277
|
fontWeight: "$medium",
|
214
|
-
color: "$
|
278
|
+
color: "$gray100",
|
215
279
|
"&:not(:disabled):hover": {
|
216
|
-
|
280
|
+
opacity: 0.9
|
217
281
|
},
|
218
282
|
"&:disabled": {
|
219
283
|
color: "$gray200"
|
@@ -275,7 +339,7 @@ function Button(_a) {
|
|
275
339
|
Button.displayName = "Button";
|
276
340
|
|
277
341
|
// src/components/CheckBox/index.tsx
|
278
|
-
import { forwardRef,
|
342
|
+
import { forwardRef, useId } from "react";
|
279
343
|
|
280
344
|
// src/components/CheckBox/styles.ts
|
281
345
|
import * as Checkbox from "@radix-ui/react-checkbox";
|
@@ -291,6 +355,7 @@ var CheckBoxUI = styled(Checkbox.Root, {
|
|
291
355
|
alignItems: "center",
|
292
356
|
transition: "border 0.2s linear",
|
293
357
|
border: "2px solid $gray400",
|
358
|
+
boxShadow: "1.3px 1.3px 4px -1px $colors$dafaz600",
|
294
359
|
'&:focus,&[data-state="checked"]': {
|
295
360
|
backgroundColor: "$dafaz600",
|
296
361
|
borderColor: "$dafaz600"
|
@@ -402,41 +467,26 @@ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
402
467
|
var CheckBox = forwardRef(
|
403
468
|
(_a, ref) => {
|
404
469
|
var _b = _a, {
|
405
|
-
id,
|
406
470
|
label,
|
407
471
|
size,
|
408
472
|
disabled = false,
|
409
|
-
|
410
|
-
onCheckedChange,
|
411
|
-
value
|
473
|
+
handleOnChange
|
412
474
|
} = _b, props = __objRest(_b, [
|
413
|
-
"id",
|
414
475
|
"label",
|
415
476
|
"size",
|
416
477
|
"disabled",
|
417
|
-
"
|
418
|
-
"onCheckedChange",
|
419
|
-
"value"
|
478
|
+
"handleOnChange"
|
420
479
|
]);
|
421
|
-
const
|
422
|
-
|
423
|
-
if (checked) {
|
424
|
-
setCheckValue(value);
|
425
|
-
} else {
|
426
|
-
setCheckValue(void 0);
|
427
|
-
}
|
428
|
-
}, [checked, value]);
|
429
|
-
return /* @__PURE__ */ jsxs(Label, { htmlFor: id, disabled, size, children: [
|
480
|
+
const htmlId = useId();
|
481
|
+
return /* @__PURE__ */ jsxs(Label, { htmlFor: htmlId, disabled, size, children: [
|
430
482
|
/* @__PURE__ */ jsx3(
|
431
483
|
CheckBoxUI,
|
432
484
|
__spreadProps(__spreadValues({
|
433
485
|
ref,
|
434
|
-
checked,
|
435
|
-
onCheckedChange,
|
436
486
|
disabled,
|
437
|
-
id,
|
487
|
+
id: htmlId,
|
438
488
|
size,
|
439
|
-
|
489
|
+
onCheckedChange: handleOnChange
|
440
490
|
}, props), {
|
441
491
|
children: /* @__PURE__ */ jsx3(CheckBoxIndicator, { asChild: true, size, children: /* @__PURE__ */ jsx3(Check, { weight: "bold" }) })
|
442
492
|
})
|
@@ -453,24 +503,37 @@ var HeadingUI = styled("h2", {
|
|
453
503
|
lineHeight: "$shorter",
|
454
504
|
margin: 0,
|
455
505
|
variants: {
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
},
|
506
|
+
size: {
|
507
|
+
sm: { fontSize: "$2xl" },
|
508
|
+
md: { fontSize: "$3xl" },
|
509
|
+
lg: { fontSize: "$4xl" },
|
510
|
+
xl: { fontSize: "$5xl" },
|
511
|
+
"2xl": { fontSize: "$6xl" },
|
512
|
+
"3xl": { fontSize: "$7xl" },
|
513
|
+
"4xl": { fontSize: "$8xl" },
|
514
|
+
"5xl": { fontSize: "$9xl" },
|
515
|
+
"6xl": { fontSize: "$10xl" }
|
516
|
+
},
|
517
|
+
color: {
|
460
518
|
white: {
|
461
519
|
color: "$white"
|
520
|
+
},
|
521
|
+
black: {
|
522
|
+
color: "black"
|
523
|
+
},
|
524
|
+
primary: {
|
525
|
+
color: "$dafaz400"
|
526
|
+
},
|
527
|
+
lightGray: {
|
528
|
+
color: "$gray400"
|
529
|
+
},
|
530
|
+
darkGray: {
|
531
|
+
color: "$gray800"
|
462
532
|
}
|
463
|
-
},
|
464
|
-
size: {
|
465
|
-
sm: { fontSize: "$lg" },
|
466
|
-
md: { fontSize: "$xl" },
|
467
|
-
lg: { fontSize: "$2xl" },
|
468
|
-
xl: { fontSize: "3rem" },
|
469
|
-
"2xl": { fontSize: "4rem" }
|
470
533
|
}
|
471
534
|
},
|
472
535
|
defaultVariants: {
|
473
|
-
|
536
|
+
color: "white",
|
474
537
|
size: "lg"
|
475
538
|
}
|
476
539
|
});
|
@@ -526,6 +589,7 @@ var RadioItemUI = styled(RadioGroup2.Item, {
|
|
526
589
|
display: "flex",
|
527
590
|
justifyContent: "center",
|
528
591
|
alignItems: "center",
|
592
|
+
boxShadow: "1.3px 1.3px 4px -1px $colors$dafaz600",
|
529
593
|
transition: "border 0.2s linear",
|
530
594
|
"&:disabled": {
|
531
595
|
cursor: "not-allowed"
|
@@ -632,57 +696,132 @@ var Label2 = styled("label", {
|
|
632
696
|
});
|
633
697
|
|
634
698
|
// src/components/Radio/RadioItem/index.tsx
|
699
|
+
import { useId as useId2 } from "react";
|
635
700
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
636
701
|
function RadioItem(_a) {
|
637
702
|
var _b = _a, {
|
638
703
|
label,
|
639
|
-
id,
|
640
704
|
size,
|
641
705
|
disabled = false
|
642
706
|
} = _b, props = __objRest(_b, [
|
643
707
|
"label",
|
644
|
-
"id",
|
645
708
|
"size",
|
646
709
|
"disabled"
|
647
710
|
]);
|
711
|
+
const htmlId = useId2();
|
648
712
|
return /* @__PURE__ */ jsxs2(RadioItemContainer, { children: [
|
649
|
-
/* @__PURE__ */ jsx5(RadioItemUI, __spreadProps(__spreadValues({ disabled, id }, props), { size, children: /* @__PURE__ */ jsx5(RadioIndicator, { asChild: true, size, children: /* @__PURE__ */ jsx5(Check2, { weight: "bold" }) }) })),
|
650
|
-
/* @__PURE__ */ jsx5(Label2, { disabled, htmlFor:
|
651
|
-
] }
|
713
|
+
/* @__PURE__ */ jsx5(RadioItemUI, __spreadProps(__spreadValues({ disabled, id: htmlId }, props), { size, children: /* @__PURE__ */ jsx5(RadioIndicator, { asChild: true, size, children: /* @__PURE__ */ jsx5(Check2, { weight: "bold" }) }) })),
|
714
|
+
/* @__PURE__ */ jsx5(Label2, { disabled, htmlFor: htmlId, size, children: label })
|
715
|
+
] });
|
652
716
|
}
|
653
717
|
RadioItem.displayName = "RadioItem";
|
654
718
|
|
655
719
|
// src/components/Radio/index.tsx
|
720
|
+
import { forwardRef as forwardRef2 } from "react";
|
656
721
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
722
|
+
var Radio = forwardRef2(
|
723
|
+
(_a, ref) => {
|
724
|
+
var _b = _a, {
|
725
|
+
items,
|
726
|
+
size,
|
727
|
+
disabled = false,
|
728
|
+
onValueChange,
|
729
|
+
value
|
730
|
+
} = _b, props = __objRest(_b, [
|
731
|
+
"items",
|
732
|
+
"size",
|
733
|
+
"disabled",
|
734
|
+
"onValueChange",
|
735
|
+
"value"
|
736
|
+
]);
|
668
737
|
return /* @__PURE__ */ jsx6(
|
669
|
-
|
670
|
-
{
|
671
|
-
|
672
|
-
label: item.label,
|
673
|
-
value: item.value,
|
674
|
-
size,
|
738
|
+
RadioUI,
|
739
|
+
__spreadProps(__spreadValues({
|
740
|
+
ref,
|
675
741
|
disabled
|
676
|
-
},
|
677
|
-
|
742
|
+
}, props), {
|
743
|
+
onValueChange,
|
744
|
+
value,
|
745
|
+
children: items.map((item) => {
|
746
|
+
return /* @__PURE__ */ jsx6(
|
747
|
+
RadioItem,
|
748
|
+
{
|
749
|
+
label: item.label,
|
750
|
+
value: item.value,
|
751
|
+
size,
|
752
|
+
disabled
|
753
|
+
},
|
754
|
+
item.id
|
755
|
+
);
|
756
|
+
})
|
757
|
+
})
|
678
758
|
);
|
679
|
-
}
|
680
|
-
|
759
|
+
}
|
760
|
+
);
|
681
761
|
Radio.displayName = "Radio";
|
682
762
|
|
763
|
+
// src/components/Select/index.tsx
|
764
|
+
import { CaretDown } from "@phosphor-icons/react";
|
765
|
+
|
683
766
|
// src/components/Select/styles.ts
|
767
|
+
var SelectContainer = styled("div", {
|
768
|
+
display: "flex",
|
769
|
+
alignItems: "center",
|
770
|
+
justifyContent: "space-between",
|
771
|
+
fontFamily: "$app",
|
772
|
+
color: "$white",
|
773
|
+
cursor: "pointer",
|
774
|
+
width: "100%",
|
775
|
+
maxWidth: "24.5rem",
|
776
|
+
boxSizing: "border-box",
|
777
|
+
borderRadius: "$md",
|
778
|
+
borderBottom: "2px solid $dafaz600",
|
779
|
+
boxShadow: "0 3px 2px -2px $colors$gray400",
|
780
|
+
transition: "border 0.2s linear",
|
781
|
+
"&:disabled": {
|
782
|
+
cursor: "not-allowed",
|
783
|
+
opacity: 0.5
|
784
|
+
},
|
785
|
+
"&:active": {
|
786
|
+
borderBottom: "2px solid $dafaz400"
|
787
|
+
},
|
788
|
+
"&:hover": {
|
789
|
+
borderBottom: "2px solid $dafaz400"
|
790
|
+
},
|
791
|
+
variants: {
|
792
|
+
size: {
|
793
|
+
lg: {
|
794
|
+
fontSize: "$xl",
|
795
|
+
svg: {
|
796
|
+
width: "$5",
|
797
|
+
height: "$5"
|
798
|
+
}
|
799
|
+
},
|
800
|
+
md: {
|
801
|
+
fontSize: "$lg",
|
802
|
+
svg: {
|
803
|
+
width: "$4",
|
804
|
+
height: "$4"
|
805
|
+
}
|
806
|
+
},
|
807
|
+
sm: {
|
808
|
+
fontSize: "$sm",
|
809
|
+
svg: {
|
810
|
+
width: "$3",
|
811
|
+
height: "$3"
|
812
|
+
}
|
813
|
+
}
|
814
|
+
}
|
815
|
+
},
|
816
|
+
defaultVariants: {
|
817
|
+
size: "lg"
|
818
|
+
}
|
819
|
+
});
|
684
820
|
var SelectUI = styled("select", {
|
685
|
-
|
821
|
+
zIndex: 1,
|
822
|
+
"-moz-appearance": "none",
|
823
|
+
"-webkit-appearance": "none",
|
824
|
+
appearance: "none",
|
686
825
|
overflow: "hidden",
|
687
826
|
background: "transparent",
|
688
827
|
border: "none",
|
@@ -690,20 +829,16 @@ var SelectUI = styled("select", {
|
|
690
829
|
color: "$white",
|
691
830
|
fontWeight: "$regular",
|
692
831
|
cursor: "pointer",
|
693
|
-
boxSizing: "border-box",
|
694
|
-
borderRadius: "$md",
|
695
|
-
borderBottom: "2px solid $dafaz600",
|
696
|
-
transition: "border 0.2s linear",
|
697
832
|
width: "100%",
|
833
|
+
maxWidth: "24.5rem",
|
698
834
|
margin: 0,
|
699
835
|
padding: "$1 $1",
|
700
|
-
"
|
701
|
-
outline: 0,
|
702
|
-
borderBottom: "2px solid $dafaz400"
|
703
|
-
},
|
836
|
+
marginLeft: "$1",
|
704
837
|
"&:disabled": {
|
705
|
-
opacity: 0.5
|
706
|
-
|
838
|
+
opacity: 0.5
|
839
|
+
},
|
840
|
+
"&:focus": {
|
841
|
+
outline: 0
|
707
842
|
},
|
708
843
|
variants: {
|
709
844
|
size: {
|
@@ -746,49 +881,110 @@ var OptionUI = styled("option", {
|
|
746
881
|
});
|
747
882
|
|
748
883
|
// src/components/Select/index.tsx
|
749
|
-
import {
|
884
|
+
import { forwardRef as forwardRef3, useState } from "react";
|
750
885
|
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
751
|
-
|
752
|
-
|
753
|
-
size,
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
items.map((item) => {
|
778
|
-
return /* @__PURE__ */ jsx7(OptionUI, { value: item.value, children: item.label }, item.id);
|
886
|
+
var Select = forwardRef3(
|
887
|
+
(_a, ref) => {
|
888
|
+
var _b = _a, { id, size, placeholder, items } = _b, props = __objRest(_b, ["id", "size", "placeholder", "items"]);
|
889
|
+
const [value, setValue] = useState("");
|
890
|
+
function handleSelect(event) {
|
891
|
+
setValue(() => {
|
892
|
+
return event.target.value;
|
893
|
+
});
|
894
|
+
}
|
895
|
+
return /* @__PURE__ */ jsxs3(SelectContainer, { size, children: [
|
896
|
+
/* @__PURE__ */ jsxs3(
|
897
|
+
SelectUI,
|
898
|
+
__spreadProps(__spreadValues({
|
899
|
+
id,
|
900
|
+
ref,
|
901
|
+
size
|
902
|
+
}, props), {
|
903
|
+
value,
|
904
|
+
onChange: handleSelect,
|
905
|
+
style: { opacity: value != "" ? 1 : 0.75 },
|
906
|
+
children: [
|
907
|
+
/* @__PURE__ */ jsx7(OptionUI, { className: "placeholder", value: "", children: placeholder }),
|
908
|
+
items.map((item) => {
|
909
|
+
return /* @__PURE__ */ jsx7(OptionUI, { value: item.value, children: item.label }, item.id);
|
910
|
+
})
|
911
|
+
]
|
779
912
|
})
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
913
|
+
),
|
914
|
+
/* @__PURE__ */ jsx7(
|
915
|
+
"span",
|
916
|
+
{
|
917
|
+
style: {
|
918
|
+
display: "flex",
|
919
|
+
alignItems: "center",
|
920
|
+
paddingLeft: "1rem",
|
921
|
+
marginRight: "0.7rem",
|
922
|
+
marginLeft: "-3rem"
|
923
|
+
},
|
924
|
+
children: /* @__PURE__ */ jsx7(CaretDown, { size: 24, weight: "bold" })
|
925
|
+
}
|
926
|
+
)
|
927
|
+
] });
|
928
|
+
}
|
929
|
+
);
|
784
930
|
Select.displayName = "Select";
|
785
931
|
|
932
|
+
// src/components/Separator/styles.ts
|
933
|
+
var SeparatorUI = styled("hr", {
|
934
|
+
width: "100%",
|
935
|
+
borderStyle: "solid",
|
936
|
+
variants: {
|
937
|
+
color: {
|
938
|
+
primary: {
|
939
|
+
borderColor: "$dafaz400"
|
940
|
+
},
|
941
|
+
lightGray: {
|
942
|
+
borderColor: "$gray100"
|
943
|
+
},
|
944
|
+
darkGray: {
|
945
|
+
borderColor: "$gray800"
|
946
|
+
},
|
947
|
+
white: {
|
948
|
+
borderColor: "$white"
|
949
|
+
},
|
950
|
+
black: {
|
951
|
+
borderColor: "$black"
|
952
|
+
}
|
953
|
+
},
|
954
|
+
size: {
|
955
|
+
lg: {
|
956
|
+
borderWidth: "2px"
|
957
|
+
},
|
958
|
+
md: {
|
959
|
+
borderWidth: "1px"
|
960
|
+
},
|
961
|
+
sm: {
|
962
|
+
borderWidth: "0.75px"
|
963
|
+
},
|
964
|
+
xs: {
|
965
|
+
borderWidth: "0.5px"
|
966
|
+
}
|
967
|
+
}
|
968
|
+
},
|
969
|
+
defaultVariants: {
|
970
|
+
color: "primary",
|
971
|
+
size: "lg"
|
972
|
+
}
|
973
|
+
});
|
974
|
+
|
975
|
+
// src/components/Separator/index.tsx
|
976
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
977
|
+
function Separator(_a) {
|
978
|
+
var _b = _a, { size, color, style } = _b, props = __objRest(_b, ["size", "color", "style"]);
|
979
|
+
return /* @__PURE__ */ jsx8(SeparatorUI, __spreadValues({ size, color, style }, props));
|
980
|
+
}
|
981
|
+
Separator.displayName = "Separator";
|
982
|
+
|
786
983
|
// src/components/Text/styles.ts
|
787
984
|
var TextUI = styled("p", {
|
788
985
|
fontFamily: "$web",
|
789
986
|
lineHeight: "$base",
|
790
987
|
margin: 0,
|
791
|
-
color: "$white",
|
792
988
|
variants: {
|
793
989
|
size: {
|
794
990
|
xxs: { fontSize: "$xxs" },
|
@@ -797,28 +993,53 @@ var TextUI = styled("p", {
|
|
797
993
|
md: { fontSize: "$md" },
|
798
994
|
lg: { fontSize: "$lg" },
|
799
995
|
xl: { fontSize: "$xl" },
|
800
|
-
"2xl": { fontSize: "$2xl" }
|
996
|
+
"2xl": { fontSize: "$2xl" },
|
997
|
+
"3xl": { fontSize: "$3xl" },
|
998
|
+
"4xl": { fontSize: "$4xl" }
|
999
|
+
},
|
1000
|
+
color: {
|
1001
|
+
white: {
|
1002
|
+
color: "$white"
|
1003
|
+
},
|
1004
|
+
black: {
|
1005
|
+
color: "black"
|
1006
|
+
},
|
1007
|
+
primary: {
|
1008
|
+
color: "$dafaz400"
|
1009
|
+
},
|
1010
|
+
lightGray: {
|
1011
|
+
color: "$gray400"
|
1012
|
+
},
|
1013
|
+
darkGray: {
|
1014
|
+
color: "$gray800"
|
1015
|
+
}
|
801
1016
|
}
|
802
1017
|
},
|
803
1018
|
defaultVariants: {
|
804
|
-
size: "md"
|
1019
|
+
size: "md",
|
1020
|
+
color: "white"
|
805
1021
|
}
|
806
1022
|
});
|
807
1023
|
|
808
1024
|
// src/components/Text/index.tsx
|
809
|
-
import { jsx as
|
1025
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
810
1026
|
function Text(_a) {
|
811
1027
|
var _b = _a, {
|
812
1028
|
children,
|
813
|
-
size
|
1029
|
+
size,
|
1030
|
+
color
|
814
1031
|
} = _b, props = __objRest(_b, [
|
815
1032
|
"children",
|
816
|
-
"size"
|
1033
|
+
"size",
|
1034
|
+
"color"
|
817
1035
|
]);
|
818
|
-
return /* @__PURE__ */
|
1036
|
+
return /* @__PURE__ */ jsx9(TextUI, __spreadProps(__spreadValues({ size, color }, props), { children }));
|
819
1037
|
}
|
820
1038
|
Text.displayName = "Text";
|
821
1039
|
|
1040
|
+
// src/components/TextArea/index.tsx
|
1041
|
+
import { forwardRef as forwardRef4 } from "react";
|
1042
|
+
|
822
1043
|
// src/components/TextArea/styles.ts
|
823
1044
|
var TextAreaUI = styled("textarea", {
|
824
1045
|
fontFamily: "$app",
|
@@ -826,6 +1047,7 @@ var TextAreaUI = styled("textarea", {
|
|
826
1047
|
color: "$white",
|
827
1048
|
fontWeight: "$regular",
|
828
1049
|
resize: "vertical",
|
1050
|
+
boxShadow: "0 3px 2px -2px $colors$gray400",
|
829
1051
|
border: "0.7px solid $gray400",
|
830
1052
|
margin: 0,
|
831
1053
|
backgroundColor: "transparent",
|
@@ -836,8 +1058,10 @@ var TextAreaUI = styled("textarea", {
|
|
836
1058
|
alignItems: "baseline",
|
837
1059
|
width: "100%",
|
838
1060
|
padding: "$1 $2",
|
1061
|
+
transition: "border 0.2s linear",
|
839
1062
|
"&:focus": {
|
840
|
-
outline: 0
|
1063
|
+
outline: 0,
|
1064
|
+
borderBottom: "2px solid $dafaz400"
|
841
1065
|
},
|
842
1066
|
"&:disabled": {
|
843
1067
|
opacity: 0.5,
|
@@ -852,21 +1076,28 @@ var TextAreaUI = styled("textarea", {
|
|
852
1076
|
});
|
853
1077
|
|
854
1078
|
// src/components/TextArea/index.tsx
|
855
|
-
import { jsx as
|
856
|
-
|
857
|
-
var _b = _a, {
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
1079
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
1080
|
+
var TextArea = forwardRef4((_a, ref) => {
|
1081
|
+
var _b = _a, { id, disabled, placeholder, children } = _b, props = __objRest(_b, ["id", "disabled", "placeholder", "children"]);
|
1082
|
+
return /* @__PURE__ */ jsx10(
|
1083
|
+
TextAreaUI,
|
1084
|
+
__spreadProps(__spreadValues({
|
1085
|
+
ref,
|
1086
|
+
rows: 3,
|
1087
|
+
id,
|
1088
|
+
placeholder,
|
1089
|
+
disabled
|
1090
|
+
}, props), {
|
1091
|
+
children
|
1092
|
+
})
|
1093
|
+
);
|
1094
|
+
});
|
864
1095
|
TextArea.displayName = "TextArea";
|
865
1096
|
|
866
1097
|
// src/components/TextInput/index.tsx
|
867
1098
|
import {
|
868
|
-
forwardRef as
|
869
|
-
useState as
|
1099
|
+
forwardRef as forwardRef5,
|
1100
|
+
useState as useState2
|
870
1101
|
} from "react";
|
871
1102
|
|
872
1103
|
// src/components/TextInput/styles.ts
|
@@ -877,8 +1108,8 @@ var InputContainer = styled("div", {
|
|
877
1108
|
borderRadius: "$md",
|
878
1109
|
boxSizing: "border-box",
|
879
1110
|
display: "flex",
|
880
|
-
alignItems: "baseline",
|
881
1111
|
width: "100%",
|
1112
|
+
boxShadow: "0 3px 2px -2px $colors$gray400",
|
882
1113
|
transition: "border 0.2s linear",
|
883
1114
|
"&:has(input:focus)": {
|
884
1115
|
borderBottom: "2px solid $dafaz400"
|
@@ -887,7 +1118,41 @@ var InputContainer = styled("div", {
|
|
887
1118
|
opacity: 0.5,
|
888
1119
|
cursor: "not-allowed"
|
889
1120
|
},
|
1121
|
+
button: {
|
1122
|
+
border: 0,
|
1123
|
+
background: "none",
|
1124
|
+
marginRight: "0.5rem",
|
1125
|
+
cursor: "pointer",
|
1126
|
+
svg: {
|
1127
|
+
opacity: 0.75,
|
1128
|
+
color: "$white",
|
1129
|
+
marginBottom: "-0.3rem"
|
1130
|
+
}
|
1131
|
+
},
|
890
1132
|
variants: {
|
1133
|
+
size: {
|
1134
|
+
lg: {
|
1135
|
+
fontSize: "$xl",
|
1136
|
+
svg: {
|
1137
|
+
width: "$5",
|
1138
|
+
height: "$5"
|
1139
|
+
}
|
1140
|
+
},
|
1141
|
+
md: {
|
1142
|
+
fontSize: "$lg",
|
1143
|
+
svg: {
|
1144
|
+
width: "$5",
|
1145
|
+
height: "$5"
|
1146
|
+
}
|
1147
|
+
},
|
1148
|
+
sm: {
|
1149
|
+
fontSize: "$md",
|
1150
|
+
svg: {
|
1151
|
+
width: "$4",
|
1152
|
+
height: "$4"
|
1153
|
+
}
|
1154
|
+
}
|
1155
|
+
},
|
891
1156
|
withShadow: {
|
892
1157
|
true: {
|
893
1158
|
boxShadow: "inset 0 3rem #444"
|
@@ -895,20 +1160,23 @@ var InputContainer = styled("div", {
|
|
895
1160
|
}
|
896
1161
|
},
|
897
1162
|
defaultVariants: {
|
1163
|
+
size: "lg",
|
898
1164
|
withShadow: false
|
899
1165
|
}
|
900
1166
|
});
|
901
1167
|
var InputUI = styled("input", {
|
902
1168
|
margin: 0,
|
903
1169
|
fontFamily: "$app",
|
904
|
-
fontSize: "$xl",
|
905
1170
|
color: "$white",
|
906
1171
|
backgroundColor: "transparent",
|
907
1172
|
border: "none",
|
908
1173
|
width: "100%",
|
909
1174
|
padding: "$1 $2",
|
910
1175
|
"&::-ms-reveal": {
|
911
|
-
|
1176
|
+
display: "none"
|
1177
|
+
},
|
1178
|
+
"&::-ms-clear": {
|
1179
|
+
display: "none"
|
912
1180
|
},
|
913
1181
|
"&::placeholder": {
|
914
1182
|
fontWeight: "$regular",
|
@@ -917,6 +1185,22 @@ var InputUI = styled("input", {
|
|
917
1185
|
},
|
918
1186
|
"&:focus": {
|
919
1187
|
outline: 0
|
1188
|
+
},
|
1189
|
+
variants: {
|
1190
|
+
size: {
|
1191
|
+
lg: {
|
1192
|
+
fontSize: "$xl"
|
1193
|
+
},
|
1194
|
+
md: {
|
1195
|
+
fontSize: "$lg"
|
1196
|
+
},
|
1197
|
+
sm: {
|
1198
|
+
fontSize: "$md"
|
1199
|
+
}
|
1200
|
+
}
|
1201
|
+
},
|
1202
|
+
defaultVariants: {
|
1203
|
+
size: "lg"
|
920
1204
|
}
|
921
1205
|
});
|
922
1206
|
var Sufix = styled("span", {
|
@@ -931,21 +1215,27 @@ var Sufix = styled("span", {
|
|
931
1215
|
});
|
932
1216
|
|
933
1217
|
// src/components/TextInput/index.tsx
|
934
|
-
import {
|
935
|
-
|
1218
|
+
import { Eye, EyeSlash } from "@phosphor-icons/react";
|
1219
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
1220
|
+
var TextInput = forwardRef5(
|
936
1221
|
(_a, ref) => {
|
937
1222
|
var _b = _a, {
|
938
1223
|
withShadow = false,
|
939
1224
|
required = true,
|
940
1225
|
requiredText = "Opcional",
|
941
|
-
id
|
1226
|
+
id,
|
1227
|
+
type = "text",
|
1228
|
+
size
|
942
1229
|
} = _b, props = __objRest(_b, [
|
943
1230
|
"withShadow",
|
944
1231
|
"required",
|
945
1232
|
"requiredText",
|
946
|
-
"id"
|
1233
|
+
"id",
|
1234
|
+
"type",
|
1235
|
+
"size"
|
947
1236
|
]);
|
948
|
-
const [hiddenOptional, setHiddenOptional] =
|
1237
|
+
const [hiddenOptional, setHiddenOptional] = useState2(required);
|
1238
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState2(false);
|
949
1239
|
function handleOnChange(event) {
|
950
1240
|
if (!required) {
|
951
1241
|
if (event.target.value === "") {
|
@@ -955,20 +1245,367 @@ var TextInput = forwardRef2(
|
|
955
1245
|
}
|
956
1246
|
}
|
957
1247
|
}
|
958
|
-
return /* @__PURE__ */ jsxs4(InputContainer, { withShadow, children: [
|
959
|
-
/* @__PURE__ */
|
960
|
-
|
1248
|
+
return /* @__PURE__ */ jsxs4(InputContainer, { size, withShadow, children: [
|
1249
|
+
/* @__PURE__ */ jsx11(
|
1250
|
+
InputUI,
|
1251
|
+
__spreadValues({
|
1252
|
+
id,
|
1253
|
+
ref,
|
1254
|
+
size,
|
1255
|
+
onChange: handleOnChange,
|
1256
|
+
type: !isPasswordVisible ? type : "text"
|
1257
|
+
}, props)
|
1258
|
+
),
|
1259
|
+
!hiddenOptional && /* @__PURE__ */ jsx11(Sufix, { style: { marginLeft: `-${requiredText.length / 2}rem` }, children: requiredText }),
|
1260
|
+
type === "password" && isPasswordVisible && /* @__PURE__ */ jsx11(
|
1261
|
+
"button",
|
1262
|
+
{
|
1263
|
+
type: "button",
|
1264
|
+
onClick: () => {
|
1265
|
+
setIsPasswordVisible(false);
|
1266
|
+
},
|
1267
|
+
children: /* @__PURE__ */ jsx11(EyeSlash, { size: 24 })
|
1268
|
+
}
|
1269
|
+
),
|
1270
|
+
type === "password" && !isPasswordVisible && /* @__PURE__ */ jsx11(
|
1271
|
+
"button",
|
1272
|
+
{
|
1273
|
+
type: "button",
|
1274
|
+
onClick: () => {
|
1275
|
+
setIsPasswordVisible(true);
|
1276
|
+
},
|
1277
|
+
children: /* @__PURE__ */ jsx11(Eye, { size: 24 })
|
1278
|
+
}
|
1279
|
+
)
|
961
1280
|
] });
|
962
1281
|
}
|
963
1282
|
);
|
964
1283
|
TextInput.displayName = "TextInput";
|
1284
|
+
|
1285
|
+
// src/components/MultiSelect/index.tsx
|
1286
|
+
import { CaretDown as CaretDown2, X } from "@phosphor-icons/react";
|
1287
|
+
|
1288
|
+
// src/components/MultiSelect/styles.ts
|
1289
|
+
var Button2 = styled("button", {
|
1290
|
+
backgroundColor: "transparent",
|
1291
|
+
border: "none",
|
1292
|
+
display: "flex",
|
1293
|
+
alignItems: "center",
|
1294
|
+
justifyContent: "center",
|
1295
|
+
color: "white",
|
1296
|
+
marginBottom: "-3px",
|
1297
|
+
cursor: "pointer",
|
1298
|
+
zIndex: 5,
|
1299
|
+
variants: {
|
1300
|
+
size: {
|
1301
|
+
lg: {
|
1302
|
+
height: "$10",
|
1303
|
+
width: "$10"
|
1304
|
+
},
|
1305
|
+
md: {
|
1306
|
+
height: "$8",
|
1307
|
+
width: "$8"
|
1308
|
+
},
|
1309
|
+
sm: {
|
1310
|
+
height: "$6",
|
1311
|
+
width: "$6"
|
1312
|
+
}
|
1313
|
+
}
|
1314
|
+
},
|
1315
|
+
defaultVariants: {
|
1316
|
+
size: "lg"
|
1317
|
+
}
|
1318
|
+
});
|
1319
|
+
var SelectUI2 = styled("div", {
|
1320
|
+
zIndex: 3,
|
1321
|
+
width: "100%",
|
1322
|
+
maxWidth: "24.5rem",
|
1323
|
+
position: "relative",
|
1324
|
+
display: "inline-block",
|
1325
|
+
fontFamily: "$app",
|
1326
|
+
color: "$white",
|
1327
|
+
fontWeight: "$regular",
|
1328
|
+
cursor: "pointer",
|
1329
|
+
margin: 0,
|
1330
|
+
backgroundColor: "transparent",
|
1331
|
+
borderBottom: "2px solid $dafaz600",
|
1332
|
+
borderRadius: "$md",
|
1333
|
+
boxSizing: "border-box",
|
1334
|
+
transition: "border 0.2s linear",
|
1335
|
+
boxShadow: "0 3px 2px -2px $colors$gray400",
|
1336
|
+
"&:hover": {
|
1337
|
+
borderBottom: "2px solid $dafaz400"
|
1338
|
+
},
|
1339
|
+
"&.clicked": {
|
1340
|
+
borderBottom: "2px solid $dafaz400"
|
1341
|
+
},
|
1342
|
+
variants: {
|
1343
|
+
disabled: {
|
1344
|
+
true: {
|
1345
|
+
opacity: 0.5,
|
1346
|
+
cursor: "not-allowed"
|
1347
|
+
}
|
1348
|
+
},
|
1349
|
+
size: {
|
1350
|
+
lg: {
|
1351
|
+
fontSize: "$xl",
|
1352
|
+
svg: {
|
1353
|
+
width: "$5",
|
1354
|
+
height: "$5"
|
1355
|
+
}
|
1356
|
+
},
|
1357
|
+
md: {
|
1358
|
+
fontSize: "$lg",
|
1359
|
+
svg: {
|
1360
|
+
width: "$4",
|
1361
|
+
height: "$4"
|
1362
|
+
}
|
1363
|
+
},
|
1364
|
+
sm: {
|
1365
|
+
fontSize: "$md",
|
1366
|
+
svg: {
|
1367
|
+
width: "$3",
|
1368
|
+
height: "$3"
|
1369
|
+
}
|
1370
|
+
}
|
1371
|
+
}
|
1372
|
+
},
|
1373
|
+
defaultVariants: {
|
1374
|
+
disabled: false,
|
1375
|
+
size: "lg"
|
1376
|
+
}
|
1377
|
+
});
|
1378
|
+
var SelectContainerUI = styled("div", {
|
1379
|
+
padding: "$3 $2",
|
1380
|
+
marginTop: "2px",
|
1381
|
+
border: "1px solid $gray400",
|
1382
|
+
boxSizing: "border-box",
|
1383
|
+
borderRadius: "$md",
|
1384
|
+
position: "absolute",
|
1385
|
+
zIndex: 2,
|
1386
|
+
minWidth: "100%",
|
1387
|
+
maxWidth: "24.5rem",
|
1388
|
+
background: "$gray800",
|
1389
|
+
fontFamily: "$app",
|
1390
|
+
color: "$white",
|
1391
|
+
fontWeight: "$regular",
|
1392
|
+
cursor: "pointer",
|
1393
|
+
"&.closed": {
|
1394
|
+
display: "none"
|
1395
|
+
},
|
1396
|
+
"&.opened": {
|
1397
|
+
display: "flex",
|
1398
|
+
flexDirection: "column",
|
1399
|
+
gap: "$3"
|
1400
|
+
}
|
1401
|
+
});
|
1402
|
+
|
1403
|
+
// src/components/MultiSelect/index.tsx
|
1404
|
+
import {
|
1405
|
+
forwardRef as forwardRef6,
|
1406
|
+
useEffect,
|
1407
|
+
useState as useState3
|
1408
|
+
} from "react";
|
1409
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
1410
|
+
var MultiSelect = forwardRef6(
|
1411
|
+
(_a, ref) => {
|
1412
|
+
var _b = _a, { id, size, items, placeholder, onChange } = _b, props = __objRest(_b, ["id", "size", "items", "placeholder", "onChange"]);
|
1413
|
+
const [values, setValues] = useState3([
|
1414
|
+
{ id: "", label: "", value: "", isChecked: false }
|
1415
|
+
]);
|
1416
|
+
const [selectedValue, setSelectedValue] = useState3([""]);
|
1417
|
+
const [clickClass, setClickClass] = useState3(false);
|
1418
|
+
const [isClose, setIsClosed] = useState3(true);
|
1419
|
+
useEffect(() => {
|
1420
|
+
items.map(
|
1421
|
+
(item) => setValues((state) => {
|
1422
|
+
const values2 = state.filter((item2) => item2.id !== "");
|
1423
|
+
return [
|
1424
|
+
...values2,
|
1425
|
+
{
|
1426
|
+
id: item.id,
|
1427
|
+
label: item.label,
|
1428
|
+
value: item.value,
|
1429
|
+
isChecked: false
|
1430
|
+
}
|
1431
|
+
].sort((a, b) => a.label > b.label ? 1 : -1);
|
1432
|
+
})
|
1433
|
+
);
|
1434
|
+
}, [items]);
|
1435
|
+
useEffect(() => {
|
1436
|
+
setClickClass(false);
|
1437
|
+
values.map((item) => {
|
1438
|
+
if (item.isChecked) {
|
1439
|
+
setSelectedValue((state) => {
|
1440
|
+
const alreadyChecked = state.find((obj) => obj === item.value);
|
1441
|
+
if (alreadyChecked) {
|
1442
|
+
return state;
|
1443
|
+
} else {
|
1444
|
+
return [...state, item.value];
|
1445
|
+
}
|
1446
|
+
});
|
1447
|
+
} else {
|
1448
|
+
setSelectedValue((state) => {
|
1449
|
+
const itemsChecked2 = state.filter((obj) => obj !== item.value);
|
1450
|
+
return itemsChecked2;
|
1451
|
+
});
|
1452
|
+
}
|
1453
|
+
});
|
1454
|
+
}, [values, items, setValues]);
|
1455
|
+
function handleOnValueChange(id2) {
|
1456
|
+
setValues((state) => {
|
1457
|
+
const items2 = state.filter((item2) => item2.id !== id2);
|
1458
|
+
const item = state.find((item2) => item2.id === id2);
|
1459
|
+
if (item) {
|
1460
|
+
return [
|
1461
|
+
{
|
1462
|
+
id: item.id,
|
1463
|
+
label: item.label,
|
1464
|
+
value: item.value,
|
1465
|
+
isChecked: !item.isChecked
|
1466
|
+
},
|
1467
|
+
...items2
|
1468
|
+
].sort((a, b) => a.label > b.label ? 1 : -1);
|
1469
|
+
}
|
1470
|
+
return state;
|
1471
|
+
});
|
1472
|
+
values.map((item) => {
|
1473
|
+
if (item.isChecked) {
|
1474
|
+
setSelectedValue((state) => {
|
1475
|
+
const alreadyChecked = state.find((obj) => obj === item.value);
|
1476
|
+
if (alreadyChecked) {
|
1477
|
+
return state;
|
1478
|
+
} else {
|
1479
|
+
return [...state, item.value];
|
1480
|
+
}
|
1481
|
+
});
|
1482
|
+
} else {
|
1483
|
+
setSelectedValue((state) => {
|
1484
|
+
const itemsChecked2 = state.filter((obj) => obj !== item.value);
|
1485
|
+
return itemsChecked2;
|
1486
|
+
});
|
1487
|
+
}
|
1488
|
+
});
|
1489
|
+
}
|
1490
|
+
function handleOnClick() {
|
1491
|
+
setClickClass((state) => !state);
|
1492
|
+
setIsClosed((state) => !state);
|
1493
|
+
}
|
1494
|
+
function handleRemoveItem(e, id2) {
|
1495
|
+
setIsClosed(true);
|
1496
|
+
handleOnValueChange(id2);
|
1497
|
+
}
|
1498
|
+
function updateSelectComponent(item) {
|
1499
|
+
const checkedItem = selectedValue.find((obj) => obj === item);
|
1500
|
+
if (checkedItem) {
|
1501
|
+
return selectedValue.filter((obj) => obj !== item);
|
1502
|
+
} else {
|
1503
|
+
return [...selectedValue.filter((obj) => obj !== ""), item].sort(
|
1504
|
+
(a, b) => a > b ? 1 : -1
|
1505
|
+
);
|
1506
|
+
}
|
1507
|
+
}
|
1508
|
+
const itemsChecked = values.filter((item) => item.isChecked === true).sort((a, b) => a.label > b.label ? 1 : -1);
|
1509
|
+
return /* @__PURE__ */ jsxs5(
|
1510
|
+
SelectUI2,
|
1511
|
+
__spreadProps(__spreadValues({
|
1512
|
+
ref,
|
1513
|
+
id,
|
1514
|
+
size,
|
1515
|
+
onClick: handleOnClick,
|
1516
|
+
value: selectedValue,
|
1517
|
+
onChange,
|
1518
|
+
className: clickClass ? "clicked" : ""
|
1519
|
+
}, props), {
|
1520
|
+
children: [
|
1521
|
+
isClose && itemsChecked.length > 0 && itemsChecked.map((item) => {
|
1522
|
+
return /* @__PURE__ */ jsx12("div", { children: /* @__PURE__ */ jsxs5(
|
1523
|
+
"div",
|
1524
|
+
{
|
1525
|
+
style: {
|
1526
|
+
display: "flex",
|
1527
|
+
alignItems: "center",
|
1528
|
+
justifyContent: "space-between"
|
1529
|
+
},
|
1530
|
+
children: [
|
1531
|
+
/* @__PURE__ */ jsx12("span", { style: { marginLeft: "0.5rem" }, children: item.label }),
|
1532
|
+
/* @__PURE__ */ jsx12(
|
1533
|
+
Button2,
|
1534
|
+
{
|
1535
|
+
type: "button",
|
1536
|
+
size,
|
1537
|
+
onClick: (e) => handleRemoveItem(e, item.id),
|
1538
|
+
children: /* @__PURE__ */ jsx12(X, { size: 24, weight: "bold" })
|
1539
|
+
}
|
1540
|
+
)
|
1541
|
+
]
|
1542
|
+
}
|
1543
|
+
) }, `opt:${item.id}`);
|
1544
|
+
}) || (itemsChecked.length === 0 || !isClose) && /* @__PURE__ */ jsx12("div", { children: /* @__PURE__ */ jsxs5(
|
1545
|
+
"div",
|
1546
|
+
{
|
1547
|
+
style: {
|
1548
|
+
display: "flex",
|
1549
|
+
justifyContent: "space-between",
|
1550
|
+
width: "100%",
|
1551
|
+
alignItems: "center"
|
1552
|
+
},
|
1553
|
+
children: [
|
1554
|
+
/* @__PURE__ */ jsx12("span", { style: { opacity: 0.75, marginLeft: "0.5rem" }, children: placeholder }),
|
1555
|
+
/* @__PURE__ */ jsx12(
|
1556
|
+
"span",
|
1557
|
+
{
|
1558
|
+
style: {
|
1559
|
+
display: "flex",
|
1560
|
+
alignItems: "center",
|
1561
|
+
marginRight: "0.7rem"
|
1562
|
+
},
|
1563
|
+
children: /* @__PURE__ */ jsx12(CaretDown2, { size: 24, weight: "bold" })
|
1564
|
+
}
|
1565
|
+
)
|
1566
|
+
]
|
1567
|
+
}
|
1568
|
+
) }),
|
1569
|
+
/* @__PURE__ */ jsx12(
|
1570
|
+
SelectContainerUI,
|
1571
|
+
{
|
1572
|
+
className: isClose ? "closed" : "opened",
|
1573
|
+
onMouseLeave: () => {
|
1574
|
+
setIsClosed(true);
|
1575
|
+
},
|
1576
|
+
children: values.map((item) => {
|
1577
|
+
return /* @__PURE__ */ jsx12(
|
1578
|
+
CheckBox,
|
1579
|
+
{
|
1580
|
+
name: `chk${item.id}`,
|
1581
|
+
size,
|
1582
|
+
label: item.label,
|
1583
|
+
checked: item.isChecked,
|
1584
|
+
value: updateSelectComponent(item.value),
|
1585
|
+
handleOnChange: () => {
|
1586
|
+
handleOnValueChange(item.id);
|
1587
|
+
}
|
1588
|
+
},
|
1589
|
+
item.id
|
1590
|
+
);
|
1591
|
+
})
|
1592
|
+
}
|
1593
|
+
)
|
1594
|
+
]
|
1595
|
+
})
|
1596
|
+
);
|
1597
|
+
}
|
1598
|
+
);
|
1599
|
+
MultiSelect.displayName = "MultiSelect";
|
965
1600
|
export {
|
966
1601
|
Box,
|
967
1602
|
Button,
|
968
1603
|
CheckBox,
|
969
1604
|
Heading,
|
1605
|
+
MultiSelect,
|
970
1606
|
Radio,
|
971
1607
|
Select,
|
1608
|
+
Separator,
|
972
1609
|
Text,
|
973
1610
|
TextArea,
|
974
1611
|
TextInput,
|