@lets-events/react 11.7.10 → 11.8.1
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/.eslintrc.json +2 -2
- package/.turbo/turbo-build.log +18 -20
- package/CHANGELOG.md +8 -2
- package/dist/index.css +171 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +122 -76
- package/dist/index.mjs +128 -82
- package/package.json +1 -1
- package/src/components/Alert.tsx +303 -303
- package/src/components/Avatar.tsx +55 -55
- package/src/components/Badge.tsx +125 -125
- package/src/components/Box.tsx +3 -3
- package/src/components/Button/index.tsx +16 -16
- package/src/components/Button/styledComponents.ts +287 -287
- package/src/components/ButtonGroup.tsx +484 -484
- package/src/components/Calendar/index.tsx +136 -136
- package/src/components/Calendar/styledComponents.ts +209 -209
- package/src/components/Card.tsx +48 -48
- package/src/components/CheckboxGroup.tsx +176 -176
- package/src/components/Container.tsx +39 -39
- package/src/components/Drawer/index.tsx +55 -55
- package/src/components/Drawer/styledComponents.ts +46 -46
- package/src/components/Dropdown.tsx +302 -302
- package/src/components/Filter.tsx +164 -164
- package/src/components/Flex.tsx +118 -118
- package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
- package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
- package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
- package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
- package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
- package/src/components/FormFields/BirthDateFormField.tsx +84 -84
- package/src/components/FormFields/CNPJFormField.tsx +87 -87
- package/src/components/FormFields/CPFFormField.tsx +78 -78
- package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
- package/src/components/FormFields/EmailFormField.tsx +27 -27
- package/src/components/FormFields/Form.tsx +39 -39
- package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +40 -40
- package/src/components/FormFields/MultiSelectFormField.tsx +55 -55
- package/src/components/FormFields/PhoneFormField.tsx +40 -40
- package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
- package/src/components/FormFields/SelectFormField.tsx +93 -93
- package/src/components/FormFields/TextAreaFormField.tsx +48 -48
- package/src/components/FormFields/TextFormField.tsx +112 -112
- package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
- package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
- package/src/components/FormFields/utils/validation.ts +23 -23
- package/src/components/Grid.tsx +137 -137
- package/src/components/Icon.tsx +47 -47
- package/src/components/MenuDropdown/index.tsx +38 -38
- package/src/components/MenuDropdown/styledComponents.ts +31 -31
- package/src/components/Modal.tsx +90 -90
- package/src/components/MultiSelect.tsx +267 -218
- package/src/components/RadioGroup.tsx +210 -210
- package/src/components/Section.tsx +33 -33
- package/src/components/Step.tsx +164 -164
- package/src/components/Switch.tsx +108 -108
- package/src/components/Text.tsx +38 -38
- package/src/components/TextField.tsx +365 -365
- package/src/components/TextareaField.tsx +128 -128
- package/src/components/TimePicker.tsx +298 -298
- package/src/components/Toast/components/ToastItem.tsx +41 -41
- package/src/components/Toast/components/ToastProvider.tsx +63 -63
- package/src/components/Toast/hooks/useToast.ts +12 -12
- package/src/components/Toast/index.tsx +5 -5
- package/src/components/Toast/styles/index.ts +135 -135
- package/src/components/Toast/types/index.ts +46 -46
- package/src/components/Tooltip/index.tsx +66 -66
- package/src/components/Tooltip/styles.ts +77 -77
- package/src/hooks/useCountries.ts +41 -41
- package/src/hooks/useOnClickOutside.tsx +20 -20
- package/src/index.tsx +54 -54
- package/src/styles/index.ts +38 -38
- package/src/types/typographyValues.ts +178 -178
- package/src/utils/getNestedValue.ts +3 -3
- package/src/utils/states.ts +29 -29
- package/tsconfig.json +3 -3
package/.eslintrc.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@lets-events/eslint-config"
|
|
1
|
+
{
|
|
2
|
+
"extends": "@lets-events/eslint-config"
|
|
3
3
|
}
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[
|
|
7
|
-
[34mCLI[39m
|
|
8
|
-
[34mCLI[39m
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[32mESM[39m [1mdist
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
-
[32mCJS[39m [1mdist
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
DTS dist/index.d.ts 374.51 KB
|
|
20
|
-
[1G[0K⠙[1G[0K
|
|
1
|
+
|
|
2
|
+
> @lets-events/react@11.8.1 build
|
|
3
|
+
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.tsx
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.4.0
|
|
8
|
+
[34mCLI[39m Target: es6
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[34mDTS[39m Build start
|
|
12
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m323.44 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 653ms
|
|
14
|
+
[32mCJS[39m [1mdist\index.js [22m[32m335.78 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 654ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4387ms
|
|
17
|
+
[32mDTS[39m [1mdist\index.d.mts [22m[32m374.64 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist\index.d.ts [22m[32m374.64 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.css
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* ../../node_modules/react-international-phone/dist/index.css */
|
|
2
|
+
.react-international-phone-country-selector {
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
.react-international-phone-country-selector-button {
|
|
6
|
+
display: flex;
|
|
7
|
+
height: var(--react-international-phone-height, 36px);
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
padding: 0;
|
|
12
|
+
border: 1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));
|
|
13
|
+
margin: 0;
|
|
14
|
+
appearance: button;
|
|
15
|
+
-webkit-appearance: button;
|
|
16
|
+
background-color: var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
text-transform: none;
|
|
19
|
+
user-select: none;
|
|
20
|
+
}
|
|
21
|
+
.react-international-phone-country-selector-button:hover {
|
|
22
|
+
background-color: var(--react-international-phone-country-selector-background-color-hover, whitesmoke);
|
|
23
|
+
}
|
|
24
|
+
.react-international-phone-country-selector-button--hide-dropdown {
|
|
25
|
+
cursor: auto;
|
|
26
|
+
}
|
|
27
|
+
.react-international-phone-country-selector-button--hide-dropdown:hover {
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
}
|
|
30
|
+
.react-international-phone-country-selector-button__button-content {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
}
|
|
35
|
+
.react-international-phone-country-selector-button__flag-emoji {
|
|
36
|
+
margin: 0 4px;
|
|
37
|
+
}
|
|
38
|
+
.react-international-phone-country-selector-button__flag-emoji--disabled {
|
|
39
|
+
opacity: .75;
|
|
40
|
+
}
|
|
41
|
+
.react-international-phone-country-selector-button__dropdown-arrow {
|
|
42
|
+
border-top: var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);
|
|
43
|
+
border-right: var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;
|
|
44
|
+
border-left: var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;
|
|
45
|
+
margin-right: 4px;
|
|
46
|
+
transition: all .1s ease-out;
|
|
47
|
+
}
|
|
48
|
+
.react-international-phone-country-selector-button__dropdown-arrow--active {
|
|
49
|
+
transform: rotateX(180deg);
|
|
50
|
+
}
|
|
51
|
+
.react-international-phone-country-selector-button__dropdown-arrow--disabled {
|
|
52
|
+
border-top-color: var(--react-international-phone-disabled-country-selector-arrow-color, #999);
|
|
53
|
+
}
|
|
54
|
+
.react-international-phone-country-selector-button--disabled {
|
|
55
|
+
background-color: var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));
|
|
56
|
+
cursor: auto;
|
|
57
|
+
}
|
|
58
|
+
.react-international-phone-country-selector-button--disabled:hover {
|
|
59
|
+
background-color: var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));
|
|
60
|
+
}
|
|
61
|
+
.react-international-phone-flag-emoji {
|
|
62
|
+
width: var(--react-international-phone-flag-width, 24px);
|
|
63
|
+
height: var(--react-international-phone-flag-height, 24px);
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
}
|
|
66
|
+
.react-international-phone-country-selector-dropdown {
|
|
67
|
+
position: absolute;
|
|
68
|
+
z-index: 1;
|
|
69
|
+
top: var(--react-international-phone-dropdown-top, 44px);
|
|
70
|
+
left: var(--react-international-phone-dropdown-left, 0);
|
|
71
|
+
display: flex;
|
|
72
|
+
width: 300px;
|
|
73
|
+
max-height: 200px;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
padding: 4px 0;
|
|
76
|
+
margin: 0;
|
|
77
|
+
background-color: var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));
|
|
78
|
+
box-shadow: var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));
|
|
79
|
+
color: var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));
|
|
80
|
+
list-style: none;
|
|
81
|
+
overflow-y: scroll;
|
|
82
|
+
}
|
|
83
|
+
.react-international-phone-country-selector-dropdown__preferred-list-divider {
|
|
84
|
+
height: 1px;
|
|
85
|
+
border: none;
|
|
86
|
+
margin: var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);
|
|
87
|
+
background: var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro));
|
|
88
|
+
}
|
|
89
|
+
.react-international-phone-country-selector-dropdown__list-item {
|
|
90
|
+
display: flex;
|
|
91
|
+
min-height: var(--react-international-phone-dropdown-item-height, 28px);
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
align-items: center;
|
|
94
|
+
padding: 2px 8px;
|
|
95
|
+
}
|
|
96
|
+
.react-international-phone-country-selector-dropdown__list-item-flag-emoji {
|
|
97
|
+
margin-right: 8px;
|
|
98
|
+
}
|
|
99
|
+
.react-international-phone-country-selector-dropdown__list-item-country-name {
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
margin-right: 8px;
|
|
102
|
+
font-size: var(--react-international-phone-dropdown-item-font-size, 14px);
|
|
103
|
+
text-overflow: ellipsis;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
.react-international-phone-country-selector-dropdown__list-item-dial-code {
|
|
107
|
+
color: var(--react-international-phone-dropdown-item-dial-code-color, gray);
|
|
108
|
+
font-size: var(--react-international-phone-dropdown-item-font-size, 14px);
|
|
109
|
+
}
|
|
110
|
+
.react-international-phone-country-selector-dropdown__list-item:hover {
|
|
111
|
+
background-color: var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
.react-international-phone-country-selector-dropdown__list-item--selected,
|
|
115
|
+
.react-international-phone-country-selector-dropdown__list-item--focused {
|
|
116
|
+
background-color: var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);
|
|
117
|
+
color: var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222));
|
|
118
|
+
}
|
|
119
|
+
.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,
|
|
120
|
+
.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code {
|
|
121
|
+
color: var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray));
|
|
122
|
+
}
|
|
123
|
+
.react-international-phone-country-selector-dropdown__list-item--focused {
|
|
124
|
+
background-color: var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));
|
|
125
|
+
}
|
|
126
|
+
.react-international-phone-dial-code-preview {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
padding: 0 8px;
|
|
131
|
+
border: 1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));
|
|
132
|
+
margin-right: -1px;
|
|
133
|
+
background-color: var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));
|
|
134
|
+
color: var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));
|
|
135
|
+
font-size: var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px));
|
|
136
|
+
}
|
|
137
|
+
.react-international-phone-dial-code-preview--disabled {
|
|
138
|
+
background-color: var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));
|
|
139
|
+
color: var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666));
|
|
140
|
+
}
|
|
141
|
+
.react-international-phone-input-container {
|
|
142
|
+
display: flex;
|
|
143
|
+
}
|
|
144
|
+
.react-international-phone-input-container .react-international-phone-country-selector-button {
|
|
145
|
+
border-radius: var(--react-international-phone-border-radius, 4px);
|
|
146
|
+
margin-right: -1px;
|
|
147
|
+
border-bottom-right-radius: 0;
|
|
148
|
+
border-top-right-radius: 0;
|
|
149
|
+
}
|
|
150
|
+
.react-international-phone-input-container .react-international-phone-input {
|
|
151
|
+
overflow: visible;
|
|
152
|
+
height: var(--react-international-phone-height, 36px);
|
|
153
|
+
box-sizing: border-box;
|
|
154
|
+
padding: 0 8px;
|
|
155
|
+
border: 1px solid var(--react-international-phone-border-color, gainsboro);
|
|
156
|
+
border-radius: var(--react-international-phone-border-radius, 4px);
|
|
157
|
+
margin: 0;
|
|
158
|
+
background-color: var(--react-international-phone-background-color, white);
|
|
159
|
+
border-bottom-left-radius: 0;
|
|
160
|
+
border-top-left-radius: 0;
|
|
161
|
+
color: var(--react-international-phone-text-color, #222);
|
|
162
|
+
font-family: inherit;
|
|
163
|
+
font-size: var(--react-international-phone-font-size, 13px);
|
|
164
|
+
}
|
|
165
|
+
.react-international-phone-input-container .react-international-phone-input:focus {
|
|
166
|
+
outline: none;
|
|
167
|
+
}
|
|
168
|
+
.react-international-phone-input-container .react-international-phone-input--disabled {
|
|
169
|
+
background-color: var(--react-international-phone-disabled-background-color, whitesmoke);
|
|
170
|
+
color: var(--react-international-phone-disabled-text-color, #666);
|
|
171
|
+
}
|
package/dist/index.d.mts
CHANGED
|
@@ -12215,6 +12215,7 @@ declare function Tooltip({ children, content, delayDuration, side, }: TooltipPro
|
|
|
12215
12215
|
|
|
12216
12216
|
declare const StyledTrigger: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
12217
12217
|
color?: "default" | "error" | undefined;
|
|
12218
|
+
disabled?: boolean | "true" | undefined;
|
|
12218
12219
|
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
12219
12220
|
colors: {
|
|
12220
12221
|
brand50: string;
|
|
@@ -12595,6 +12596,9 @@ type MultiSelectProps = ComponentProps<typeof StyledTrigger> & {
|
|
|
12595
12596
|
}>;
|
|
12596
12597
|
width?: string;
|
|
12597
12598
|
zIndex?: string;
|
|
12599
|
+
showSelectedValues?: boolean;
|
|
12600
|
+
singleSelect?: boolean;
|
|
12601
|
+
disabled?: boolean;
|
|
12598
12602
|
};
|
|
12599
12603
|
declare const MultiSelect: React__default.ForwardRefExoticComponent<Omit<MultiSelectProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
12600
12604
|
|
package/dist/index.d.ts
CHANGED
|
@@ -12215,6 +12215,7 @@ declare function Tooltip({ children, content, delayDuration, side, }: TooltipPro
|
|
|
12215
12215
|
|
|
12216
12216
|
declare const StyledTrigger: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
12217
12217
|
color?: "default" | "error" | undefined;
|
|
12218
|
+
disabled?: boolean | "true" | undefined;
|
|
12218
12219
|
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
12219
12220
|
colors: {
|
|
12220
12221
|
brand50: string;
|
|
@@ -12595,6 +12596,9 @@ type MultiSelectProps = ComponentProps<typeof StyledTrigger> & {
|
|
|
12595
12596
|
}>;
|
|
12596
12597
|
width?: string;
|
|
12597
12598
|
zIndex?: string;
|
|
12599
|
+
showSelectedValues?: boolean;
|
|
12600
|
+
singleSelect?: boolean;
|
|
12601
|
+
disabled?: boolean;
|
|
12598
12602
|
};
|
|
12599
12603
|
declare const MultiSelect: React__default.ForwardRefExoticComponent<Omit<MultiSelectProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
12600
12604
|
|
package/dist/index.js
CHANGED
|
@@ -262,7 +262,7 @@ var require_react_is_development = __commonJS({
|
|
|
262
262
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
263
263
|
var Element = REACT_ELEMENT_TYPE;
|
|
264
264
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
265
|
-
var
|
|
265
|
+
var Fragment5 = REACT_FRAGMENT_TYPE;
|
|
266
266
|
var Lazy = REACT_LAZY_TYPE;
|
|
267
267
|
var Memo = REACT_MEMO_TYPE;
|
|
268
268
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -321,7 +321,7 @@ var require_react_is_development = __commonJS({
|
|
|
321
321
|
exports2.ContextProvider = ContextProvider;
|
|
322
322
|
exports2.Element = Element;
|
|
323
323
|
exports2.ForwardRef = ForwardRef;
|
|
324
|
-
exports2.Fragment =
|
|
324
|
+
exports2.Fragment = Fragment5;
|
|
325
325
|
exports2.Lazy = Lazy;
|
|
326
326
|
exports2.Memo = Memo;
|
|
327
327
|
exports2.Portal = Portal;
|
|
@@ -9461,6 +9461,12 @@ var StyledTrigger = styled("div", {
|
|
|
9461
9461
|
error: {
|
|
9462
9462
|
border: "1px solid $error400"
|
|
9463
9463
|
}
|
|
9464
|
+
},
|
|
9465
|
+
disabled: {
|
|
9466
|
+
true: {
|
|
9467
|
+
cursor: "not-allowed",
|
|
9468
|
+
border: "1px solid $dark100"
|
|
9469
|
+
}
|
|
9464
9470
|
}
|
|
9465
9471
|
},
|
|
9466
9472
|
defaultVariants: {
|
|
@@ -9473,29 +9479,21 @@ var itemStyle = {
|
|
|
9473
9479
|
boxSizing: "border-box",
|
|
9474
9480
|
backgroundColor: "$dark50",
|
|
9475
9481
|
display: "block",
|
|
9482
|
+
cursor: "pointer",
|
|
9476
9483
|
"&:hover": {
|
|
9477
9484
|
backgroundColor: "$dark100"
|
|
9478
9485
|
}
|
|
9479
9486
|
};
|
|
9487
|
+
var StyledItem2 = styled("div", __spreadValues({}, itemStyle));
|
|
9480
9488
|
var BadgeWrapper = styled("div", {
|
|
9481
9489
|
flex: "1",
|
|
9482
9490
|
display: "flex",
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9491
|
+
gap: "4px",
|
|
9492
|
+
marginTop: "8px",
|
|
9493
|
+
flexDirection: "column"
|
|
9486
9494
|
});
|
|
9487
9495
|
var BadgeCloseBtn = styled("div", {
|
|
9488
|
-
|
|
9489
|
-
width: "16px",
|
|
9490
|
-
height: "16px",
|
|
9491
|
-
minWidth: "16px",
|
|
9492
|
-
minHeight: "16px",
|
|
9493
|
-
display: "flex",
|
|
9494
|
-
justifyContent: "center",
|
|
9495
|
-
alignItems: "center",
|
|
9496
|
-
"&:hover": {
|
|
9497
|
-
backgroundColor: "$dark600"
|
|
9498
|
-
}
|
|
9496
|
+
cursor: "pointer"
|
|
9499
9497
|
});
|
|
9500
9498
|
var MultiSelect = import_react17.default.forwardRef(
|
|
9501
9499
|
({
|
|
@@ -9505,7 +9503,10 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9505
9503
|
options,
|
|
9506
9504
|
color,
|
|
9507
9505
|
width = "100%",
|
|
9508
|
-
zIndex = "auto"
|
|
9506
|
+
zIndex = "auto",
|
|
9507
|
+
showSelectedValues = true,
|
|
9508
|
+
singleSelect = false,
|
|
9509
|
+
disabled = false
|
|
9509
9510
|
}, fowardedRef) => {
|
|
9510
9511
|
var _a;
|
|
9511
9512
|
const [isOpen, setIsOpen] = (0, import_react16.useState)(false);
|
|
@@ -9525,72 +9526,117 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9525
9526
|
[selectedValues, onValueChange]
|
|
9526
9527
|
);
|
|
9527
9528
|
const menuWidth = (_a = triggerRef.current) == null ? void 0 : _a.offsetWidth;
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9551
|
-
BadgeCloseBtn,
|
|
9552
|
-
{
|
|
9553
|
-
onClick: (e) => {
|
|
9554
|
-
e.stopPropagation();
|
|
9555
|
-
handleRemove(value);
|
|
9556
|
-
},
|
|
9557
|
-
role: "button",
|
|
9558
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons3.faX, size: "xs" })
|
|
9559
|
-
}
|
|
9560
|
-
)
|
|
9561
|
-
] }) }, value);
|
|
9562
|
-
}) }),
|
|
9563
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9564
|
-
import_react_fontawesome3.FontAwesomeIcon,
|
|
9529
|
+
const text = (0, import_react16.useMemo)(() => {
|
|
9530
|
+
if (selectedValues.length > 0 && singleSelect) {
|
|
9531
|
+
const value = selectedValues[0];
|
|
9532
|
+
return labelByValue[value];
|
|
9533
|
+
}
|
|
9534
|
+
return placeholder != null ? placeholder : "Selecione";
|
|
9535
|
+
}, [selectedValues, placeholder, singleSelect]);
|
|
9536
|
+
const handleItemClick = (v) => {
|
|
9537
|
+
onValueChange == null ? void 0 : onValueChange([v]);
|
|
9538
|
+
setIsOpen(false);
|
|
9539
|
+
};
|
|
9540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_themes18.Theme, { children: [
|
|
9541
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_themes18.DropdownMenu.Root, { open: isOpen, onOpenChange: () => setIsOpen(false), children: [
|
|
9542
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9543
|
+
import_themes18.DropdownMenu.Trigger,
|
|
9544
|
+
{
|
|
9545
|
+
onClick: () => {
|
|
9546
|
+
if (disabled) return;
|
|
9547
|
+
setIsOpen(true);
|
|
9548
|
+
},
|
|
9549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
9550
|
+
StyledTrigger,
|
|
9565
9551
|
{
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9552
|
+
css: {
|
|
9553
|
+
width
|
|
9554
|
+
},
|
|
9555
|
+
ref: (r) => {
|
|
9556
|
+
if (!r) return;
|
|
9557
|
+
triggerRef.current = r;
|
|
9558
|
+
if (fowardedRef) {
|
|
9559
|
+
if (typeof fowardedRef === "function") fowardedRef(r);
|
|
9560
|
+
else {
|
|
9561
|
+
fowardedRef.current = r;
|
|
9562
|
+
}
|
|
9563
|
+
}
|
|
9564
|
+
},
|
|
9565
|
+
color,
|
|
9566
|
+
disabled,
|
|
9567
|
+
children: [
|
|
9568
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9569
|
+
Text,
|
|
9570
|
+
{
|
|
9571
|
+
typography: "labelMedium",
|
|
9572
|
+
css: {
|
|
9573
|
+
flex: 1,
|
|
9574
|
+
overflow: "hidden",
|
|
9575
|
+
whiteSpace: "nowrap",
|
|
9576
|
+
textOverflow: "ellipsis"
|
|
9577
|
+
},
|
|
9578
|
+
color: disabled ? "dark400" : void 0,
|
|
9579
|
+
children: text
|
|
9580
|
+
}
|
|
9581
|
+
),
|
|
9582
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9583
|
+
import_react_fontawesome3.FontAwesomeIcon,
|
|
9584
|
+
{
|
|
9585
|
+
icon: isOpen ? import_free_solid_svg_icons3.faChevronUp : import_free_solid_svg_icons3.faChevronDown,
|
|
9586
|
+
size: "sm",
|
|
9587
|
+
color: disabled ? colors.dark400 : colors.dark600
|
|
9588
|
+
}
|
|
9589
|
+
)
|
|
9590
|
+
]
|
|
9569
9591
|
}
|
|
9570
9592
|
)
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9593
|
+
}
|
|
9594
|
+
),
|
|
9595
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9596
|
+
StyledContent,
|
|
9597
|
+
{
|
|
9598
|
+
css: {
|
|
9599
|
+
width: menuWidth ? menuWidth + "px" : width,
|
|
9600
|
+
zIndex
|
|
9601
|
+
},
|
|
9602
|
+
children: !singleSelect ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9603
|
+
CheckboxGroup,
|
|
9604
|
+
{
|
|
9605
|
+
value: selectedValues,
|
|
9606
|
+
onValueChange: (v) => {
|
|
9607
|
+
onValueChange == null ? void 0 : onValueChange(v);
|
|
9608
|
+
},
|
|
9609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Flex2, { direction: "column", gap: 8, children: options.map(({ value, label }, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "labelSmall", children: label }) }, i)) })
|
|
9610
|
+
}
|
|
9611
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Flex2, { direction: "column", gap: 8, children: options.map(({ value, label }, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StyledItem2, { onClick: () => handleItemClick(value), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "labelSmall", children: label }) }, i)) })
|
|
9612
|
+
}
|
|
9613
|
+
)
|
|
9614
|
+
] }),
|
|
9615
|
+
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BadgeWrapper, { children: selectedValues.map((value) => {
|
|
9616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Flex2, { gap: 4, children: [
|
|
9617
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9618
|
+
BadgeCloseBtn,
|
|
9583
9619
|
{
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9620
|
+
onClick: (e) => {
|
|
9621
|
+
e.stopPropagation();
|
|
9622
|
+
handleRemove(value);
|
|
9587
9623
|
},
|
|
9588
|
-
|
|
9624
|
+
role: "button",
|
|
9625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons3.faSquareXmark, size: "sm" })
|
|
9626
|
+
}
|
|
9627
|
+
),
|
|
9628
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9629
|
+
Text,
|
|
9630
|
+
{
|
|
9631
|
+
typography: "captionMedium",
|
|
9632
|
+
fontWeight: "regular",
|
|
9633
|
+
color: "dark600",
|
|
9634
|
+
children: labelByValue[value]
|
|
9589
9635
|
}
|
|
9590
9636
|
)
|
|
9591
|
-
}
|
|
9592
|
-
)
|
|
9593
|
-
] })
|
|
9637
|
+
] });
|
|
9638
|
+
}) }) })
|
|
9639
|
+
] });
|
|
9594
9640
|
}
|
|
9595
9641
|
);
|
|
9596
9642
|
|