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