@ultraviolet/ui 1.28.0 → 1.29.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/README.md +14 -7
- package/dist/index.d.ts +51 -2
- package/dist/src/components/ActionBar/index.js +22 -37
- package/dist/src/components/Alert/index.js +27 -41
- package/dist/src/components/Avatar/index.js +48 -69
- package/dist/src/components/Badge/index.js +29 -49
- package/dist/src/components/Banner/index.js +42 -62
- package/dist/src/components/BarChart/Tooltip.js +35 -50
- package/dist/src/components/BarChart/index.js +13 -14
- package/dist/src/components/BarStack/index.js +100 -191
- package/dist/src/components/Breadcrumbs/index.js +29 -39
- package/dist/src/components/Bullet/index.js +42 -55
- package/dist/src/components/Button/index.js +73 -99
- package/dist/src/components/Card/index.js +39 -57
- package/dist/src/components/Carousel/index.js +32 -60
- package/dist/src/components/Checkbox/index.js +153 -341
- package/dist/src/components/CheckboxGroup/index.js +25 -27
- package/dist/src/components/CopyButton/index.js +11 -12
- package/dist/src/components/DateInput/index.js +141 -268
- package/dist/src/components/EmptyState/index.js +68 -83
- package/dist/src/components/Expandable/index.js +13 -20
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
- package/dist/src/components/GlobalAlert/index.js +19 -32
- package/dist/src/components/LineChart/CustomLegend.js +80 -89
- package/dist/src/components/LineChart/Tooltip.js +32 -47
- package/dist/src/components/LineChart/helpers.js +15 -50
- package/dist/src/components/LineChart/index.js +23 -33
- package/dist/src/components/Link/index.js +46 -65
- package/dist/src/components/List/Body.js +9 -15
- package/dist/src/components/List/Cell.js +6 -7
- package/dist/src/components/List/HeaderCell.js +28 -56
- package/dist/src/components/List/HeaderRow.js +9 -16
- package/dist/src/components/List/ListContext.js +5 -6
- package/dist/src/components/List/Row.js +44 -90
- package/dist/src/components/List/SelectBar.js +9 -13
- package/dist/src/components/List/SkeletonRows.js +5 -6
- package/dist/src/components/List/index.js +15 -25
- package/dist/src/components/Loader/index.js +18 -25
- package/dist/src/components/Menu/Item.js +39 -49
- package/dist/src/components/Menu/index.js +31 -56
- package/dist/src/components/MenuV2/Item.js +39 -49
- package/dist/src/components/MenuV2/index.js +28 -47
- package/dist/src/components/Meter/index.js +25 -47
- package/dist/src/components/Modal/Dialog.js +33 -58
- package/dist/src/components/Modal/Disclosure.js +8 -9
- package/dist/src/components/Modal/index.js +26 -33
- package/dist/src/components/Notice/index.js +21 -27
- package/dist/src/components/NumberInput/index.js +73 -137
- package/dist/src/components/Pagination/getPageNumbers.js +1 -4
- package/dist/src/components/Pagination/index.js +17 -27
- package/dist/src/components/PasswordCheck/index.js +26 -32
- package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
- package/dist/src/components/PieChart/Legends.js +71 -107
- package/dist/src/components/PieChart/Tooltip.js +33 -36
- package/dist/src/components/PieChart/index.js +13 -17
- package/dist/src/components/Popover/index.js +58 -75
- package/dist/src/components/Popup/helpers.js +13 -15
- package/dist/src/components/Popup/index.js +55 -98
- package/dist/src/components/ProgressBar/index.js +31 -49
- package/dist/src/components/Radio/index.js +58 -113
- package/dist/src/components/RadioGroup/index.js +26 -28
- package/dist/src/components/Row/index.js +25 -31
- package/dist/src/components/SelectInput/index.js +357 -410
- package/dist/src/components/SelectableCard/index.js +73 -115
- package/dist/src/components/Separator/index.js +52 -73
- package/dist/src/components/Skeleton/Block.js +23 -41
- package/dist/src/components/Skeleton/Blocks.js +23 -41
- package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
- package/dist/src/components/Skeleton/Donut.js +3 -6
- package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
- package/dist/src/components/Skeleton/Line.js +5 -11
- package/dist/src/components/Skeleton/List.js +22 -31
- package/dist/src/components/Skeleton/Slider.js +25 -46
- package/dist/src/components/Skeleton/Square.js +3 -6
- package/dist/src/components/Skeleton/index.js +17 -33
- package/dist/src/components/Snippet/index.js +82 -137
- package/dist/src/components/Stack/index.js +11 -14
- package/dist/src/components/Status/index.js +48 -78
- package/dist/src/components/StepList/index.js +45 -63
- package/dist/src/components/Stepper/index.js +74 -129
- package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
- package/dist/src/components/SwitchButton/index.js +36 -62
- package/dist/src/components/Table/Body.js +5 -8
- package/dist/src/components/Table/Cell.js +14 -20
- package/dist/src/components/Table/Header.js +8 -14
- package/dist/src/components/Table/HeaderCell.js +40 -56
- package/dist/src/components/Table/HeaderRow.js +4 -5
- package/dist/src/components/Table/Row.js +10 -14
- package/dist/src/components/Table/SelectBar.js +9 -13
- package/dist/src/components/Table/SkeletonRows.js +5 -6
- package/dist/src/components/Table/TableContext.js +6 -7
- package/dist/src/components/Table/index.js +44 -50
- package/dist/src/components/Tabs/Tab.js +57 -118
- package/dist/src/components/Tabs/TabMenu.js +32 -38
- package/dist/src/components/Tabs/TabMenuItem.js +9 -13
- package/dist/src/components/Tabs/index.js +24 -43
- package/dist/src/components/Tag/index.js +57 -74
- package/dist/src/components/TagInput/index.js +63 -94
- package/dist/src/components/TagList/index.js +22 -35
- package/dist/src/components/Text/index.js +29 -31
- package/dist/src/components/TextArea/index.js +240 -0
- package/dist/src/components/TextInput/index.js +166 -260
- package/dist/src/components/TimeInput/index.js +10 -13
- package/dist/src/components/Toaster/index.js +51 -67
- package/dist/src/components/Toggle/index.js +62 -129
- package/dist/src/components/ToggleGroup/index.js +21 -23
- package/dist/src/components/Tooltip/index.js +28 -31
- package/dist/src/components/VerificationCode/index.js +55 -90
- package/dist/src/index.js +1 -0
- package/dist/src/utils/ids.js +1 -6
- package/package.json +3 -3
|
@@ -14,37 +14,31 @@ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
|
14
14
|
|
|
15
15
|
const StyledSeparator = /*#__PURE__*/_styled(Separator, {
|
|
16
16
|
target: "e11gt5pw5"
|
|
17
|
-
})("background-color:",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
state,
|
|
26
|
-
error,
|
|
27
|
-
theme
|
|
28
|
-
} = _ref2;
|
|
17
|
+
})("background-color:", ({
|
|
18
|
+
theme
|
|
19
|
+
}) => theme.colors.neutral.border, ";height:100%;");
|
|
20
|
+
const getControlColor = ({
|
|
21
|
+
state,
|
|
22
|
+
error,
|
|
23
|
+
theme
|
|
24
|
+
}) => {
|
|
29
25
|
if (state.isDisabled) return theme.colors.neutral.textDisabled;
|
|
30
26
|
if (error) return theme.colors.danger.text;
|
|
31
27
|
return theme.colors.neutral.text;
|
|
32
28
|
};
|
|
33
|
-
const getPlaceholderColor =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref3;
|
|
29
|
+
const getPlaceholderColor = ({
|
|
30
|
+
state,
|
|
31
|
+
error,
|
|
32
|
+
theme
|
|
33
|
+
}) => {
|
|
39
34
|
if (state.isDisabled) return theme.colors.neutral.textDisabled;
|
|
40
35
|
if (error) return theme.colors.danger.text;
|
|
41
36
|
return theme.colors.neutral.textWeak;
|
|
42
37
|
};
|
|
43
|
-
const getOptionColor =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} = _ref4;
|
|
38
|
+
const getOptionColor = ({
|
|
39
|
+
state,
|
|
40
|
+
theme
|
|
41
|
+
}) => {
|
|
48
42
|
let color = theme.colors.neutral.text;
|
|
49
43
|
let backgroundColor = theme.colors.neutral.backgroundWeakElevated;
|
|
50
44
|
if (state.isDisabled) {
|
|
@@ -61,197 +55,182 @@ const getOptionColor = _ref4 => {
|
|
|
61
55
|
color
|
|
62
56
|
};
|
|
63
57
|
};
|
|
64
|
-
const getSelectStyles =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
state,
|
|
85
|
-
theme
|
|
86
|
-
}),
|
|
87
|
-
fontSize: '16px',
|
|
88
|
-
fontWeight: 500,
|
|
89
|
-
lineHeight: '24px',
|
|
90
|
-
minHeight: '48px',
|
|
91
|
-
transition: 'border-color 200ms ease, box-shadow 200ms ease',
|
|
92
|
-
cursor: state.isDisabled ? 'not-allowed' : 'pointer',
|
|
93
|
-
...(!state.isDisabled && {
|
|
94
|
-
':focus-within': {
|
|
95
|
-
borderColor: error ? theme.colors.danger.border : theme.colors.primary.border,
|
|
96
|
-
boxShadow: error ? theme.shadows.focusDanger : theme.shadows.focusPrimary,
|
|
97
|
-
svg: {
|
|
98
|
-
fill: error ? theme.colors.danger.text : theme.colors.primary.text
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
':hover': {
|
|
102
|
-
borderColor: error ? theme.colors.danger.borderHover : theme.colors.primary.borderHover,
|
|
103
|
-
svg: {
|
|
104
|
-
fill: error ? theme.colors.danger.text : theme.colors.primary.text
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}),
|
|
108
|
-
...(customStyle(state)?.['control'] || {}),
|
|
109
|
-
animation: animation ? `${animationDuration}ms ${animations[animation]}` : 'none'
|
|
110
|
-
}),
|
|
111
|
-
indicatorsContainer: provided => ({
|
|
112
|
-
...provided,
|
|
113
|
-
maxHeight: '48px'
|
|
114
|
-
}),
|
|
115
|
-
indicatorSeparator: (provided, state) => ({
|
|
116
|
-
...provided,
|
|
117
|
-
backgroundColor: theme.colors.neutral.border,
|
|
118
|
-
display: 'none',
|
|
119
|
-
...(customStyle(state)?.['indicatorSeparator'] || {})
|
|
120
|
-
}),
|
|
121
|
-
input: provided => ({
|
|
122
|
-
...provided,
|
|
123
|
-
flexGrow: 1,
|
|
124
|
-
marginLeft: 0,
|
|
125
|
-
paddingTop: noTopLabel ? 0 : 11
|
|
126
|
-
}),
|
|
127
|
-
menu: (provided, state) => ({
|
|
128
|
-
...provided,
|
|
129
|
-
...(customStyle(state)?.['menu'] || {}),
|
|
130
|
-
boxShadow: theme.shadows.menu
|
|
131
|
-
}),
|
|
132
|
-
menuList: (provided, state) => ({
|
|
133
|
-
...provided,
|
|
134
|
-
backgroundColor: theme.colors.neutral.backgroundWeak,
|
|
135
|
-
maxHeight: '225px',
|
|
136
|
-
...(customStyle(state)?.['menuList'] || {})
|
|
137
|
-
}),
|
|
138
|
-
menuPortal: (provided, state) => ({
|
|
139
|
-
...provided,
|
|
140
|
-
zIndex: 10000,
|
|
141
|
-
...(customStyle(state)?.['menuPortal'] || {})
|
|
142
|
-
}),
|
|
143
|
-
multiValue: (provided, state) => ({
|
|
144
|
-
...provided,
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
backgroundColor: theme.colors.neutral.backgroundDisabled,
|
|
147
|
-
borderRadius: '4px',
|
|
148
|
-
color: theme.colors.neutral.text,
|
|
149
|
-
fontSize: '14px',
|
|
150
|
-
fontWeight: 500,
|
|
151
|
-
height: '24px',
|
|
152
|
-
justifyContent: 'center',
|
|
153
|
-
marginTop: theme.space[noTopLabel ? '0.5' : '2'],
|
|
154
|
-
textOverflow: 'ellipsis',
|
|
155
|
-
...(customStyle(state)?.['multiValue'] || {})
|
|
156
|
-
}),
|
|
157
|
-
multiValueLabel: (provided, state) => ({
|
|
158
|
-
...provided,
|
|
159
|
-
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text,
|
|
160
|
-
fontSize: '14px',
|
|
161
|
-
fontWeight: 'normal',
|
|
162
|
-
lineHeight: '20px',
|
|
163
|
-
...(customStyle(state)?.['multiValueLabel'] || {})
|
|
164
|
-
}),
|
|
165
|
-
multiValueRemove: (provided, state) => ({
|
|
166
|
-
...provided,
|
|
167
|
-
...(state.isDisabled ? {
|
|
168
|
-
color: theme.colors.neutral.textDisabled,
|
|
169
|
-
cursor: 'none',
|
|
170
|
-
pointerEvents: 'none'
|
|
171
|
-
} : {
|
|
172
|
-
color: theme.colors.primary.text
|
|
173
|
-
}),
|
|
174
|
-
':hover': {
|
|
175
|
-
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.primary.text,
|
|
176
|
-
cursor: state.isDisabled ? 'none' : 'pointer',
|
|
177
|
-
pointerEvents: state.isDisabled ? 'none' : 'fill'
|
|
178
|
-
},
|
|
179
|
-
...(customStyle(state)?.['multiValueRemove'] || {})
|
|
58
|
+
const getSelectStyles = ({
|
|
59
|
+
error,
|
|
60
|
+
customStyle,
|
|
61
|
+
animation,
|
|
62
|
+
animationDuration,
|
|
63
|
+
noTopLabel,
|
|
64
|
+
theme
|
|
65
|
+
}) => ({
|
|
66
|
+
control: (provided, state) => ({
|
|
67
|
+
...provided,
|
|
68
|
+
backgroundColor: state.isDisabled ? theme.colors.neutral.backgroundDisabled : theme.colors.neutral.background,
|
|
69
|
+
borderColor: error ? theme.colors.danger.border : theme.colors.neutral.border,
|
|
70
|
+
borderRadius: '4px',
|
|
71
|
+
borderStyle: 'solid',
|
|
72
|
+
borderWidth: '1px',
|
|
73
|
+
boxShadow: 'none',
|
|
74
|
+
color: getControlColor({
|
|
75
|
+
error,
|
|
76
|
+
state,
|
|
77
|
+
theme
|
|
180
78
|
}),
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
':
|
|
189
|
-
|
|
190
|
-
|
|
79
|
+
fontSize: '16px',
|
|
80
|
+
fontWeight: 500,
|
|
81
|
+
lineHeight: '24px',
|
|
82
|
+
minHeight: '48px',
|
|
83
|
+
transition: 'border-color 200ms ease, box-shadow 200ms ease',
|
|
84
|
+
cursor: state.isDisabled ? 'not-allowed' : 'pointer',
|
|
85
|
+
...(!state.isDisabled && {
|
|
86
|
+
':focus-within': {
|
|
87
|
+
borderColor: error ? theme.colors.danger.border : theme.colors.primary.border,
|
|
88
|
+
boxShadow: error ? theme.shadows.focusDanger : theme.shadows.focusPrimary,
|
|
89
|
+
svg: {
|
|
90
|
+
fill: error ? theme.colors.danger.text : theme.colors.primary.text
|
|
91
|
+
}
|
|
191
92
|
},
|
|
192
93
|
':hover': {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
94
|
+
borderColor: error ? theme.colors.danger.borderHover : theme.colors.primary.borderHover,
|
|
95
|
+
svg: {
|
|
96
|
+
fill: error ? theme.colors.danger.text : theme.colors.primary.text
|
|
97
|
+
}
|
|
98
|
+
}
|
|
197
99
|
}),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
100
|
+
...(customStyle(state)?.['control'] || {}),
|
|
101
|
+
animation: animation ? `${animationDuration}ms ${animations[animation]}` : 'none'
|
|
102
|
+
}),
|
|
103
|
+
indicatorsContainer: provided => ({
|
|
104
|
+
...provided,
|
|
105
|
+
maxHeight: '48px'
|
|
106
|
+
}),
|
|
107
|
+
indicatorSeparator: (provided, state) => ({
|
|
108
|
+
...provided,
|
|
109
|
+
backgroundColor: theme.colors.neutral.border,
|
|
110
|
+
display: 'none',
|
|
111
|
+
...(customStyle(state)?.['indicatorSeparator'] || {})
|
|
112
|
+
}),
|
|
113
|
+
input: provided => ({
|
|
114
|
+
...provided,
|
|
115
|
+
flexGrow: 1,
|
|
116
|
+
marginLeft: 0,
|
|
117
|
+
paddingTop: noTopLabel ? 0 : 11
|
|
118
|
+
}),
|
|
119
|
+
menu: (provided, state) => ({
|
|
120
|
+
...provided,
|
|
121
|
+
...(customStyle(state)?.['menu'] || {}),
|
|
122
|
+
boxShadow: theme.shadows.menu
|
|
123
|
+
}),
|
|
124
|
+
menuList: (provided, state) => ({
|
|
125
|
+
...provided,
|
|
126
|
+
backgroundColor: theme.colors.neutral.backgroundWeak,
|
|
127
|
+
maxHeight: '225px',
|
|
128
|
+
...(customStyle(state)?.['menuList'] || {})
|
|
129
|
+
}),
|
|
130
|
+
menuPortal: (provided, state) => ({
|
|
131
|
+
...provided,
|
|
132
|
+
zIndex: 10000,
|
|
133
|
+
...(customStyle(state)?.['menuPortal'] || {})
|
|
134
|
+
}),
|
|
135
|
+
multiValue: (provided, state) => ({
|
|
136
|
+
...provided,
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
backgroundColor: theme.colors.neutral.backgroundDisabled,
|
|
139
|
+
borderRadius: '4px',
|
|
140
|
+
color: theme.colors.neutral.text,
|
|
141
|
+
fontSize: '14px',
|
|
142
|
+
fontWeight: 500,
|
|
143
|
+
height: '24px',
|
|
144
|
+
justifyContent: 'center',
|
|
145
|
+
marginTop: theme.space[noTopLabel ? '0.5' : '2'],
|
|
146
|
+
textOverflow: 'ellipsis',
|
|
147
|
+
...(customStyle(state)?.['multiValue'] || {})
|
|
148
|
+
}),
|
|
149
|
+
multiValueLabel: (provided, state) => ({
|
|
150
|
+
...provided,
|
|
151
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text,
|
|
152
|
+
fontSize: '14px',
|
|
153
|
+
fontWeight: 'normal',
|
|
154
|
+
lineHeight: '20px',
|
|
155
|
+
...(customStyle(state)?.['multiValueLabel'] || {})
|
|
156
|
+
}),
|
|
157
|
+
multiValueRemove: (provided, state) => ({
|
|
158
|
+
...provided,
|
|
159
|
+
...(state.isDisabled ? {
|
|
160
|
+
color: theme.colors.neutral.textDisabled,
|
|
161
|
+
cursor: 'none',
|
|
162
|
+
pointerEvents: 'none'
|
|
163
|
+
} : {
|
|
164
|
+
color: theme.colors.primary.text
|
|
206
165
|
}),
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
166
|
+
':hover': {
|
|
167
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.primary.text,
|
|
168
|
+
cursor: state.isDisabled ? 'none' : 'pointer',
|
|
169
|
+
pointerEvents: state.isDisabled ? 'none' : 'fill'
|
|
170
|
+
},
|
|
171
|
+
...(customStyle(state)?.['multiValueRemove'] || {})
|
|
172
|
+
}),
|
|
173
|
+
option: (provided, state) => ({
|
|
174
|
+
...provided,
|
|
175
|
+
...getOptionColor({
|
|
176
|
+
state,
|
|
177
|
+
theme
|
|
215
178
|
}),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
})
|
|
226
|
-
}
|
|
227
|
-
|
|
179
|
+
cursor: state.isDisabled ? 'not-allowed' : 'pointer',
|
|
180
|
+
':active': {
|
|
181
|
+
backgroundColor: state.isDisabled ? theme.colors.neutral.backgroundDisabled : theme.colors.primary.background,
|
|
182
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.primary.text
|
|
183
|
+
},
|
|
184
|
+
':hover': {
|
|
185
|
+
backgroundColor: state.isDisabled ? theme.colors.neutral.backgroundDisabled : theme.colors.primary.background,
|
|
186
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text
|
|
187
|
+
},
|
|
188
|
+
...(customStyle(state)?.['option'] || {})
|
|
189
|
+
}),
|
|
190
|
+
placeholder: (provided, state) => ({
|
|
191
|
+
...provided,
|
|
192
|
+
color: getPlaceholderColor({
|
|
193
|
+
error,
|
|
194
|
+
state,
|
|
195
|
+
theme
|
|
196
|
+
}),
|
|
197
|
+
...(customStyle(state)?.['placeholder'] || {})
|
|
198
|
+
}),
|
|
199
|
+
singleValue: (provided, state) => ({
|
|
200
|
+
...provided,
|
|
201
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text,
|
|
202
|
+
marginLeft: state.hasValue ? 0 : undefined,
|
|
203
|
+
marginRight: state.hasValue ? 0 : undefined,
|
|
204
|
+
marginTop: !state.hasValue || noTopLabel ? 0 : '5px',
|
|
205
|
+
paddingLeft: state.hasValue ? 0 : undefined,
|
|
206
|
+
...(customStyle(state)?.['singleValue'] || {})
|
|
207
|
+
}),
|
|
208
|
+
valueContainer: (provided, state) => ({
|
|
209
|
+
...provided,
|
|
210
|
+
...(customStyle(state)?.['valueContainer'] || {}),
|
|
211
|
+
cursor: state.isDisabled ? 'not-allowed' : undefined,
|
|
212
|
+
height: '100%',
|
|
213
|
+
label: {
|
|
214
|
+
display: noTopLabel ? 'none' : 'initial'
|
|
215
|
+
},
|
|
216
|
+
paddingTop: 0
|
|
217
|
+
})
|
|
218
|
+
});
|
|
228
219
|
const StyledContainer = /*#__PURE__*/_styled('div', {
|
|
229
220
|
shouldForwardProp: prop => !['isDisabled', 'additionalStyles'].includes(prop),
|
|
230
221
|
target: "e11gt5pw4"
|
|
231
|
-
})("width:100%;",
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}, ";", _ref7 => {
|
|
237
|
-
let {
|
|
238
|
-
additionalStyles
|
|
239
|
-
} = _ref7;
|
|
240
|
-
return /*#__PURE__*/css(additionalStyles);
|
|
241
|
-
}, ";");
|
|
222
|
+
})("width:100%;", ({
|
|
223
|
+
isDisabled
|
|
224
|
+
}) => isDisabled && `pointer-events: initial;`, ";", ({
|
|
225
|
+
additionalStyles
|
|
226
|
+
}) => /*#__PURE__*/css(additionalStyles), ";");
|
|
242
227
|
const StyledError = /*#__PURE__*/_styled("div", {
|
|
243
228
|
target: "e11gt5pw3"
|
|
244
|
-
})("font-size:12px;color:",
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}, ";padding-top:", _ref9 => {
|
|
250
|
-
let {
|
|
251
|
-
theme
|
|
252
|
-
} = _ref9;
|
|
253
|
-
return theme.space['0.25'];
|
|
254
|
-
}, ";");
|
|
229
|
+
})("font-size:12px;color:", ({
|
|
230
|
+
theme
|
|
231
|
+
}) => theme.colors.danger.text, ";padding-top:", ({
|
|
232
|
+
theme
|
|
233
|
+
}) => theme.space['0.25'], ";");
|
|
255
234
|
const SelectContainer = props => {
|
|
256
235
|
const {
|
|
257
236
|
children,
|
|
@@ -284,179 +263,151 @@ const SelectContainer = props => {
|
|
|
284
263
|
const StyledPlaceholder = /*#__PURE__*/_styled('label', {
|
|
285
264
|
shouldForwardProp: prop => !['error', 'hasValue', 'isDisabled', 'isMulti'].includes(prop),
|
|
286
265
|
target: "e11gt5pw2"
|
|
287
|
-
})("position:absolute;left:0;font-weight:400;pointer-events:none;color:",
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}, ";white-space:nowrap;width:100%;height:100%;font-size:16px;transition:transform 250ms ease;opacity:0;", _ref11 => {
|
|
294
|
-
let {
|
|
295
|
-
hasValue
|
|
296
|
-
} = _ref11;
|
|
297
|
-
return hasValue && `
|
|
266
|
+
})("position:absolute;left:0;font-weight:400;pointer-events:none;color:", ({
|
|
267
|
+
theme,
|
|
268
|
+
error
|
|
269
|
+
}) => error ? theme.colors.danger.text : theme.colors.neutral.text, ";white-space:nowrap;width:100%;height:100%;font-size:16px;transition:transform 250ms ease;opacity:0;", ({
|
|
270
|
+
hasValue
|
|
271
|
+
}) => hasValue && `
|
|
298
272
|
transform: translate(0, -8px) scale(0.8);
|
|
299
273
|
transform-origin: left;
|
|
300
274
|
padding-left: 8px;
|
|
301
275
|
left: 0;
|
|
302
276
|
top: 2px;
|
|
303
277
|
opacity: 1;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
hasValue
|
|
309
|
-
} = _ref12;
|
|
310
|
-
return hasValue && isDisabled && 'opacity: 0.5';
|
|
311
|
-
}, ";");
|
|
278
|
+
`, " ", ({
|
|
279
|
+
isDisabled,
|
|
280
|
+
hasValue
|
|
281
|
+
}) => hasValue && isDisabled && 'opacity: 0.5', ";");
|
|
312
282
|
const StyledText = /*#__PURE__*/_styled(Text, {
|
|
313
283
|
target: "e11gt5pw1"
|
|
314
|
-
})("margin-left:",
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}, ";
|
|
320
|
-
let {
|
|
321
|
-
isSelectedAndNotFocused,
|
|
322
|
-
theme
|
|
323
|
-
} = _ref14;
|
|
324
|
-
return isSelectedAndNotFocused ? theme.colors.primary.textStrong : undefined;
|
|
325
|
-
}, ";");
|
|
284
|
+
})("margin-left:", ({
|
|
285
|
+
theme
|
|
286
|
+
}) => theme.space['1'], ";color:", ({
|
|
287
|
+
isSelectedAndNotFocused,
|
|
288
|
+
theme
|
|
289
|
+
}) => isSelectedAndNotFocused ? theme.colors.primary.textStrong : undefined, ";");
|
|
326
290
|
const MaxLineStyledText = /*#__PURE__*/_styled(StyledText, {
|
|
327
291
|
target: "e11gt5pw0"
|
|
328
|
-
})("-webkit-line-clamp:3;margin-top:",
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
selectProps
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
292
|
+
})("-webkit-line-clamp:3;margin-top:", ({
|
|
293
|
+
theme
|
|
294
|
+
}) => theme.space['2'], ";");
|
|
295
|
+
const ValueContainer = ({
|
|
296
|
+
isDisabled,
|
|
297
|
+
children,
|
|
298
|
+
selectProps: {
|
|
299
|
+
error,
|
|
300
|
+
labelId,
|
|
301
|
+
inputId,
|
|
302
|
+
...selectProps
|
|
303
|
+
},
|
|
304
|
+
isMulti,
|
|
305
|
+
hasValue,
|
|
306
|
+
clearValue,
|
|
307
|
+
getStyles,
|
|
308
|
+
getValue,
|
|
309
|
+
getClassNames,
|
|
310
|
+
isRtl,
|
|
311
|
+
cx,
|
|
312
|
+
options,
|
|
313
|
+
selectOption,
|
|
314
|
+
setValue,
|
|
315
|
+
theme,
|
|
316
|
+
className,
|
|
317
|
+
innerProps
|
|
318
|
+
}) => jsx(components.ValueContainer, {
|
|
319
|
+
clearValue: clearValue,
|
|
320
|
+
getStyles: getStyles,
|
|
321
|
+
getValue: getValue,
|
|
322
|
+
isRtl: isRtl,
|
|
323
|
+
cx: cx,
|
|
324
|
+
options: options,
|
|
325
|
+
selectOption: selectOption,
|
|
326
|
+
setValue: setValue,
|
|
327
|
+
theme: theme,
|
|
328
|
+
className: className,
|
|
329
|
+
innerProps: innerProps,
|
|
330
|
+
selectProps: selectProps,
|
|
331
|
+
isMulti: isMulti,
|
|
332
|
+
hasValue: hasValue,
|
|
333
|
+
isDisabled: isDisabled,
|
|
334
|
+
getClassNames: getClassNames,
|
|
335
|
+
children: jsxs(Fragment, {
|
|
336
|
+
children: [selectProps.placeholder ? jsx(StyledPlaceholder, {
|
|
337
|
+
as: "label",
|
|
338
|
+
id: labelId,
|
|
339
|
+
htmlFor: inputId,
|
|
340
|
+
"aria-live": "assertive",
|
|
341
|
+
error: error,
|
|
342
|
+
isMulti: isMulti,
|
|
343
|
+
isDisabled: isDisabled,
|
|
344
|
+
hasValue: hasValue,
|
|
345
|
+
children: selectProps.placeholder
|
|
346
|
+
}) : null, children]
|
|
347
|
+
})
|
|
348
|
+
});
|
|
349
|
+
const inputStyles = ({
|
|
350
|
+
isMulti
|
|
351
|
+
}) => /*#__PURE__*/css("margin-left:0px;", !isMulti && 'caret-color: transparent', ";");
|
|
352
|
+
const Input = ({
|
|
353
|
+
isMulti,
|
|
354
|
+
hasValue,
|
|
355
|
+
selectProps: {
|
|
356
|
+
inputId,
|
|
357
|
+
labelId,
|
|
358
|
+
placeholder,
|
|
359
|
+
...selectProps
|
|
360
|
+
},
|
|
361
|
+
clearValue,
|
|
362
|
+
getStyles,
|
|
363
|
+
getValue,
|
|
364
|
+
isRtl,
|
|
365
|
+
cx,
|
|
366
|
+
options,
|
|
367
|
+
selectOption,
|
|
368
|
+
setValue,
|
|
369
|
+
theme,
|
|
370
|
+
className,
|
|
371
|
+
isHidden,
|
|
372
|
+
...props
|
|
373
|
+
}) => jsx(components.Input, {
|
|
374
|
+
...props,
|
|
375
|
+
css: inputStyles({
|
|
393
376
|
isMulti
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
isMulti: isMulti,
|
|
429
|
-
clearValue: clearValue,
|
|
430
|
-
getStyles: getStyles,
|
|
431
|
-
getValue: getValue,
|
|
432
|
-
isRtl: isRtl,
|
|
433
|
-
cx: cx,
|
|
434
|
-
options: options,
|
|
435
|
-
selectOption: selectOption,
|
|
436
|
-
setValue: setValue,
|
|
437
|
-
theme: theme,
|
|
438
|
-
className: className,
|
|
439
|
-
isHidden: isHidden,
|
|
440
|
-
selectProps: {
|
|
441
|
-
...selectProps,
|
|
442
|
-
placeholder
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
};
|
|
446
|
-
const Option = _ref19 => {
|
|
447
|
-
let {
|
|
448
|
-
selectProps,
|
|
449
|
-
value,
|
|
450
|
-
label,
|
|
451
|
-
children,
|
|
452
|
-
data: {
|
|
453
|
-
inlineDescription,
|
|
454
|
-
description
|
|
455
|
-
},
|
|
456
|
-
isSelected,
|
|
457
|
-
data,
|
|
458
|
-
...props
|
|
459
|
-
} = _ref19;
|
|
377
|
+
}),
|
|
378
|
+
id: inputId,
|
|
379
|
+
"aria-controls": labelId,
|
|
380
|
+
hasValue: hasValue,
|
|
381
|
+
isMulti: isMulti,
|
|
382
|
+
clearValue: clearValue,
|
|
383
|
+
getStyles: getStyles,
|
|
384
|
+
getValue: getValue,
|
|
385
|
+
isRtl: isRtl,
|
|
386
|
+
cx: cx,
|
|
387
|
+
options: options,
|
|
388
|
+
selectOption: selectOption,
|
|
389
|
+
setValue: setValue,
|
|
390
|
+
theme: theme,
|
|
391
|
+
className: className,
|
|
392
|
+
isHidden: isHidden,
|
|
393
|
+
selectProps: {
|
|
394
|
+
...selectProps,
|
|
395
|
+
placeholder
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
const Option = ({
|
|
399
|
+
selectProps,
|
|
400
|
+
value,
|
|
401
|
+
label,
|
|
402
|
+
children,
|
|
403
|
+
data: {
|
|
404
|
+
inlineDescription,
|
|
405
|
+
description
|
|
406
|
+
},
|
|
407
|
+
isSelected,
|
|
408
|
+
data,
|
|
409
|
+
...props
|
|
410
|
+
}) => {
|
|
460
411
|
const [isFocused, setIsFocused] = useState(false);
|
|
461
412
|
return jsx("div", {
|
|
462
413
|
"data-testid": `option-${selectProps.name || ''}-${isJSONString(value) ? label : value}`,
|
|
@@ -547,39 +498,38 @@ const MultiValueRemove = props => jsx(components.MultiValueRemove, {
|
|
|
547
498
|
})
|
|
548
499
|
});
|
|
549
500
|
const defaultCustomStyle = () => ({});
|
|
550
|
-
const FwdSelectInput =
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
} = _ref20;
|
|
501
|
+
const FwdSelectInput = ({
|
|
502
|
+
animation = 'pulse',
|
|
503
|
+
animationDuration = 1000,
|
|
504
|
+
animationOnChange = false,
|
|
505
|
+
children,
|
|
506
|
+
className,
|
|
507
|
+
customComponents,
|
|
508
|
+
customStyle = defaultCustomStyle,
|
|
509
|
+
disabled = false,
|
|
510
|
+
error,
|
|
511
|
+
innerRef,
|
|
512
|
+
inputId: inputIdProp,
|
|
513
|
+
isClearable = false,
|
|
514
|
+
isMulti = false,
|
|
515
|
+
isSearchable = true,
|
|
516
|
+
menuPortalTarget,
|
|
517
|
+
noTopLabel = false,
|
|
518
|
+
onBlur,
|
|
519
|
+
onChange,
|
|
520
|
+
onFocus,
|
|
521
|
+
options,
|
|
522
|
+
placeholder,
|
|
523
|
+
readOnly = false,
|
|
524
|
+
value,
|
|
525
|
+
name,
|
|
526
|
+
id: idProp,
|
|
527
|
+
time,
|
|
528
|
+
isLoading,
|
|
529
|
+
required,
|
|
530
|
+
emptyState,
|
|
531
|
+
'data-testid': dataTestId
|
|
532
|
+
}) => {
|
|
583
533
|
const id = useId();
|
|
584
534
|
const inputId = inputIdProp ?? id;
|
|
585
535
|
const theme = useTheme();
|
|
@@ -587,18 +537,15 @@ const FwdSelectInput = _ref20 => {
|
|
|
587
537
|
const currentValue = value?.value;
|
|
588
538
|
|
|
589
539
|
// Options need to keep the same reference otherwise react-select doesn't focus the selected option
|
|
590
|
-
const selectOptions = useMemo(() => options || flattenChildren(children).map(
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
label
|
|
600
|
-
};
|
|
601
|
-
}), [options, children]);
|
|
540
|
+
const selectOptions = useMemo(() => options || flattenChildren(children).map(({
|
|
541
|
+
props: {
|
|
542
|
+
children: label,
|
|
543
|
+
...subProps
|
|
544
|
+
}
|
|
545
|
+
}) => ({
|
|
546
|
+
...subProps,
|
|
547
|
+
label
|
|
548
|
+
})), [options, children]);
|
|
602
549
|
useEffect(() => {
|
|
603
550
|
if (animationOnChange) {
|
|
604
551
|
setIsAnimated(true);
|