@pareto-engineering/design-system 4.0.0-alpha.73 → 4.0.0-alpha.74
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/dist/cjs/f/fields/SelectInput/SelectInput.js +33 -42
- package/dist/cjs/f/fields/SelectInput/common/Menu/Menu.js +83 -0
- package/dist/cjs/f/fields/SelectInput/common/Menu/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/Multiple/Multiple.js +244 -0
- package/dist/cjs/f/fields/SelectInput/common/Multiple/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/Single/Single.js +104 -0
- package/dist/cjs/f/fields/SelectInput/common/Single/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/index.js +26 -0
- package/dist/cjs/f/fields/SelectInput/styles.scss +149 -45
- package/dist/es/f/fields/SelectInput/SelectInput.js +31 -42
- package/dist/es/f/fields/SelectInput/common/Menu/Menu.js +73 -0
- package/dist/es/f/fields/SelectInput/common/Menu/index.js +2 -0
- package/dist/es/f/fields/SelectInput/common/Multiple/Multiple.js +235 -0
- package/dist/es/f/fields/SelectInput/common/Multiple/index.js +2 -0
- package/dist/es/f/fields/SelectInput/common/Single/Single.js +96 -0
- package/dist/es/f/fields/SelectInput/common/Single/index.js +2 -0
- package/dist/es/f/fields/SelectInput/common/index.js +3 -0
- package/dist/es/f/fields/SelectInput/styles.scss +149 -45
- package/package.json +2 -2
- package/src/stories/f/SelectInput.stories.jsx +15 -0
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +34 -47
- package/src/ui/f/fields/SelectInput/common/Menu/Menu.jsx +103 -0
- package/src/ui/f/fields/SelectInput/common/Menu/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/Multiple/Multiple.jsx +288 -0
- package/src/ui/f/fields/SelectInput/common/Multiple/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/Single/Single.jsx +125 -0
- package/src/ui/f/fields/SelectInput/common/Single/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/index.js +3 -0
- package/src/ui/f/fields/SelectInput/styles.scss +149 -45
- package/tests/__snapshots__/Storyshots.test.js.snap +523 -393
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
useState, useEffect, useMemo, useRef,
|
|
6
|
+
} from 'react'
|
|
7
|
+
|
|
8
|
+
import { useField } from 'formik'
|
|
9
|
+
|
|
10
|
+
import PropTypes from 'prop-types'
|
|
11
|
+
|
|
12
|
+
import { useCombobox, useMultipleSelection } from 'downshift'
|
|
13
|
+
|
|
14
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
15
|
+
|
|
16
|
+
import { Button } from 'ui/b'
|
|
17
|
+
|
|
18
|
+
import { Popover } from 'ui/a'
|
|
19
|
+
|
|
20
|
+
import { FormDescription, FormLabel } from 'ui/f'
|
|
21
|
+
|
|
22
|
+
import { Menu } from '../Menu'
|
|
23
|
+
|
|
24
|
+
// Local Definitions
|
|
25
|
+
|
|
26
|
+
const baseClassName = styleNames.base
|
|
27
|
+
|
|
28
|
+
const componentClassName = 'multiple'
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {Array[Object]} first - first array to check if it has an item not in the second array.
|
|
32
|
+
* @param {Array[Object]} second - second array to check against the first array.
|
|
33
|
+
*
|
|
34
|
+
* @returns {Boolean} - true if the first array has an item not in the second array.
|
|
35
|
+
*/
|
|
36
|
+
const testIfArraysAreUnique = (first, second) => first
|
|
37
|
+
.filter((objInFirstArray) => !second
|
|
38
|
+
.some((objInSecondArray) => objInFirstArray.value === objInSecondArray.value))
|
|
39
|
+
.length > 0
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* This is the component description.
|
|
43
|
+
*/
|
|
44
|
+
const Multiple = ({
|
|
45
|
+
id,
|
|
46
|
+
className:userClassName,
|
|
47
|
+
style,
|
|
48
|
+
name,
|
|
49
|
+
label,
|
|
50
|
+
labelColor,
|
|
51
|
+
color,
|
|
52
|
+
options,
|
|
53
|
+
validate,
|
|
54
|
+
optional,
|
|
55
|
+
description,
|
|
56
|
+
disabled,
|
|
57
|
+
autoComplete,
|
|
58
|
+
transformSearch,
|
|
59
|
+
getTagColor,
|
|
60
|
+
placeholder,
|
|
61
|
+
// ...otherProps
|
|
62
|
+
}) => {
|
|
63
|
+
const [, meta, helpers] = useField({ name, validate })
|
|
64
|
+
|
|
65
|
+
const { setValue } = helpers
|
|
66
|
+
|
|
67
|
+
const { value } = meta
|
|
68
|
+
|
|
69
|
+
const [searchInputValue, setSearchInputValue] = useState('')
|
|
70
|
+
|
|
71
|
+
const {
|
|
72
|
+
getSelectedItemProps,
|
|
73
|
+
getDropdownProps,
|
|
74
|
+
addSelectedItem,
|
|
75
|
+
removeSelectedItem,
|
|
76
|
+
setSelectedItems,
|
|
77
|
+
selectedItems,
|
|
78
|
+
} = useMultipleSelection({
|
|
79
|
+
initialSelectedItems:value || [],
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @returns {Boolean} - Unique items from the options array so that the combobox
|
|
84
|
+
* shows only the options that are not yet selected.
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
const items = useMemo(() => {
|
|
88
|
+
const lowerCasedInputValue = searchInputValue.toLowerCase()
|
|
89
|
+
|
|
90
|
+
return options.filter((option) => {
|
|
91
|
+
const lowerCasedOption = option.label.toLowerCase()
|
|
92
|
+
|
|
93
|
+
return lowerCasedOption.includes(lowerCasedInputValue)
|
|
94
|
+
&& !selectedItems.includes(option)
|
|
95
|
+
})
|
|
96
|
+
}, [searchInputValue, selectedItems])
|
|
97
|
+
|
|
98
|
+
const {
|
|
99
|
+
isOpen,
|
|
100
|
+
getLabelProps,
|
|
101
|
+
getMenuProps,
|
|
102
|
+
getInputProps,
|
|
103
|
+
getComboboxProps,
|
|
104
|
+
highlightedIndex,
|
|
105
|
+
getItemProps,
|
|
106
|
+
} = useCombobox({
|
|
107
|
+
inputValue :searchInputValue,
|
|
108
|
+
defaultHighlightedIndex:0, // after selection, highlight the first item.
|
|
109
|
+
selectedItem :null,
|
|
110
|
+
items,
|
|
111
|
+
circularNavigation :true,
|
|
112
|
+
stateReducer :(state, actionAndChanges) => {
|
|
113
|
+
const { changes, type } = actionAndChanges
|
|
114
|
+
switch (type) {
|
|
115
|
+
case useCombobox.stateChangeTypes.InputKeyDownEnter:
|
|
116
|
+
case useCombobox.stateChangeTypes.ItemClick:
|
|
117
|
+
return {
|
|
118
|
+
...changes,
|
|
119
|
+
isOpen:true, // keep the menu open after selection.
|
|
120
|
+
}
|
|
121
|
+
default:
|
|
122
|
+
break
|
|
123
|
+
}
|
|
124
|
+
return changes
|
|
125
|
+
},
|
|
126
|
+
onStateChange:({ inputValue:newSearchInputValue, type, selectedItem }) => {
|
|
127
|
+
switch (type) {
|
|
128
|
+
case useCombobox.stateChangeTypes.InputChange: {
|
|
129
|
+
const transformedInput = transformSearch(newSearchInputValue)
|
|
130
|
+
setSearchInputValue(transformedInput)
|
|
131
|
+
break
|
|
132
|
+
}
|
|
133
|
+
case useCombobox.stateChangeTypes.InputKeyDownEnter:
|
|
134
|
+
case useCombobox.stateChangeTypes.ItemClick:
|
|
135
|
+
case useCombobox.stateChangeTypes.InputBlur:
|
|
136
|
+
if (selectedItem) {
|
|
137
|
+
setSearchInputValue('')
|
|
138
|
+
addSelectedItem(selectedItem)
|
|
139
|
+
}
|
|
140
|
+
break
|
|
141
|
+
default:
|
|
142
|
+
break
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (selectedItems?.length > 0) {
|
|
149
|
+
setValue(selectedItems)
|
|
150
|
+
}
|
|
151
|
+
}, [selectedItems])
|
|
152
|
+
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
if (value?.length > 0 && (
|
|
155
|
+
testIfArraysAreUnique(value, selectedItems)
|
|
156
|
+
|| testIfArraysAreUnique(selectedItems, value)
|
|
157
|
+
)) {
|
|
158
|
+
setSelectedItems(value)
|
|
159
|
+
}
|
|
160
|
+
}, [value])
|
|
161
|
+
|
|
162
|
+
const parentRef = useRef(null)
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<div
|
|
166
|
+
id={id}
|
|
167
|
+
className={[
|
|
168
|
+
|
|
169
|
+
baseClassName,
|
|
170
|
+
|
|
171
|
+
componentClassName,
|
|
172
|
+
userClassName,
|
|
173
|
+
]
|
|
174
|
+
.filter((e) => e)
|
|
175
|
+
.join(' ')}
|
|
176
|
+
style={style}
|
|
177
|
+
ref={parentRef}
|
|
178
|
+
{...getComboboxProps()}
|
|
179
|
+
// {...otherProps}
|
|
180
|
+
>
|
|
181
|
+
<FormLabel
|
|
182
|
+
className={[
|
|
183
|
+
baseClassName,
|
|
184
|
+
componentClassName,
|
|
185
|
+
]
|
|
186
|
+
.filter((e) => e)
|
|
187
|
+
.join(' ')}
|
|
188
|
+
{...getLabelProps()}
|
|
189
|
+
name={name}
|
|
190
|
+
optional={optional}
|
|
191
|
+
color={labelColor}
|
|
192
|
+
>
|
|
193
|
+
{label}
|
|
194
|
+
</FormLabel>
|
|
195
|
+
|
|
196
|
+
{selectedItems?.length > 0 && (
|
|
197
|
+
<div className="selected-items">
|
|
198
|
+
{selectedItems.map((selectedItem, index) => (
|
|
199
|
+
<div
|
|
200
|
+
key={selectedItem.label}
|
|
201
|
+
{...getSelectedItemProps({ selectedItem, index })}
|
|
202
|
+
className="item"
|
|
203
|
+
>
|
|
204
|
+
<Button
|
|
205
|
+
onClick={(e) => {
|
|
206
|
+
e.stopPropagation()
|
|
207
|
+
removeSelectedItem(selectedItem)
|
|
208
|
+
}}
|
|
209
|
+
isCompact
|
|
210
|
+
color={getTagColor ? getTagColor(selectedItem) : color}
|
|
211
|
+
>
|
|
212
|
+
<span>{selectedItem.label}</span>
|
|
213
|
+
<span className="icon close">Y</span>
|
|
214
|
+
</Button>
|
|
215
|
+
</div>
|
|
216
|
+
))}
|
|
217
|
+
</div>
|
|
218
|
+
)}
|
|
219
|
+
<div className="input-container">
|
|
220
|
+
<input
|
|
221
|
+
{...getInputProps(
|
|
222
|
+
getDropdownProps({ preventKeyAction: isOpen }),
|
|
223
|
+
)}
|
|
224
|
+
className="input"
|
|
225
|
+
disabled={disabled}
|
|
226
|
+
placeholder={placeholder}
|
|
227
|
+
autoComplete={autoComplete}
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<FormDescription className="s-1" description={description} name={name} />
|
|
232
|
+
<Popover
|
|
233
|
+
isOpen={isOpen}
|
|
234
|
+
parentRef={parentRef}
|
|
235
|
+
>
|
|
236
|
+
<Menu
|
|
237
|
+
className={`y-${color}`}
|
|
238
|
+
isOpen={isOpen}
|
|
239
|
+
getItemProps={getItemProps}
|
|
240
|
+
highlightedIndex={highlightedIndex}
|
|
241
|
+
items={items}
|
|
242
|
+
{...getMenuProps()}
|
|
243
|
+
/>
|
|
244
|
+
</Popover>
|
|
245
|
+
|
|
246
|
+
</div>
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
Multiple.propTypes = {
|
|
251
|
+
/**
|
|
252
|
+
* The HTML id for this element
|
|
253
|
+
*/
|
|
254
|
+
id:PropTypes.string,
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The HTML class names for this element
|
|
258
|
+
*/
|
|
259
|
+
className:PropTypes.string,
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* The React-written, css properties for this element.
|
|
263
|
+
*/
|
|
264
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* A function that transforms the search input value
|
|
268
|
+
*/
|
|
269
|
+
transformSearch:PropTypes.func,
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The minimum length of the search input value
|
|
273
|
+
*/
|
|
274
|
+
minLength:PropTypes.number,
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The base color of the component
|
|
278
|
+
*/
|
|
279
|
+
color:PropTypes.string,
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
Multiple.defaultProps = {
|
|
283
|
+
transformSearch:(e) => e,
|
|
284
|
+
minLength :2,
|
|
285
|
+
color :'interactive',
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export default Multiple
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useField } from 'formik'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
|
+
|
|
10
|
+
import { LoadingCircle } from 'ui/a'
|
|
11
|
+
|
|
12
|
+
import { FormLabel, FormDescription } from '..'
|
|
13
|
+
|
|
14
|
+
// Local Definitions
|
|
15
|
+
|
|
16
|
+
const baseClassName = styleNames.base
|
|
17
|
+
|
|
18
|
+
const componentClassName = 'single'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This is the component description.
|
|
22
|
+
*/
|
|
23
|
+
const Single = ({
|
|
24
|
+
id,
|
|
25
|
+
className:userClassName,
|
|
26
|
+
style,
|
|
27
|
+
name,
|
|
28
|
+
label,
|
|
29
|
+
labelColor,
|
|
30
|
+
color,
|
|
31
|
+
options,
|
|
32
|
+
validate,
|
|
33
|
+
optional,
|
|
34
|
+
description,
|
|
35
|
+
disabled,
|
|
36
|
+
isLoading,
|
|
37
|
+
autoComplete,
|
|
38
|
+
// ...otherProps
|
|
39
|
+
}) => {
|
|
40
|
+
const [field] = useField({ name, validate })
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
id={id}
|
|
45
|
+
className={[
|
|
46
|
+
|
|
47
|
+
baseClassName,
|
|
48
|
+
|
|
49
|
+
componentClassName,
|
|
50
|
+
userClassName,
|
|
51
|
+
]
|
|
52
|
+
.filter((e) => e)
|
|
53
|
+
.join(' ')}
|
|
54
|
+
style={style}
|
|
55
|
+
>
|
|
56
|
+
<FormLabel
|
|
57
|
+
name={name}
|
|
58
|
+
color={labelColor}
|
|
59
|
+
optional={optional}
|
|
60
|
+
>
|
|
61
|
+
{label}
|
|
62
|
+
</FormLabel>
|
|
63
|
+
<div className={`select-wrapper${disabled ? ' disabled' : ''}`}>
|
|
64
|
+
<select
|
|
65
|
+
className={`input y-${color}`}
|
|
66
|
+
{...field}
|
|
67
|
+
value={field.value || ''}
|
|
68
|
+
id={name}
|
|
69
|
+
disabled={disabled}
|
|
70
|
+
autoComplete={autoComplete}
|
|
71
|
+
>
|
|
72
|
+
{
|
|
73
|
+
options.map((option) => {
|
|
74
|
+
// i.e if option is a string like "blah", return { value: "blah", label: "blah" }
|
|
75
|
+
const newOption = typeof option === 'string' ? { value: option, label: option } : option
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<option
|
|
79
|
+
key={newOption.value}
|
|
80
|
+
value={newOption.value}
|
|
81
|
+
disabled={newOption?.disabled || false}
|
|
82
|
+
>
|
|
83
|
+
{newOption.label}
|
|
84
|
+
</option>
|
|
85
|
+
)
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
</select>
|
|
89
|
+
{isLoading && (
|
|
90
|
+
<LoadingCircle className="x-main" />
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
<FormDescription className="s-1" description={description} name={name} />
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
Single.propTypes = {
|
|
99
|
+
/**
|
|
100
|
+
* The HTML id for this element
|
|
101
|
+
*/
|
|
102
|
+
id:PropTypes.string,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The HTML class names for this element
|
|
106
|
+
*/
|
|
107
|
+
className:PropTypes.string,
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The React-written, css properties for this element.
|
|
111
|
+
*/
|
|
112
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The base color of the component
|
|
116
|
+
*/
|
|
117
|
+
color:PropTypes.string,
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
Single.defaultProps = {
|
|
122
|
+
color:'paragraph',
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export default Single
|
|
@@ -14,72 +14,176 @@ $hover-border: var(--theme-hover-input-border);
|
|
|
14
14
|
$focus-border: var(--theme-focus-input-border);
|
|
15
15
|
$default-background: var(--background-inputs);
|
|
16
16
|
$disabled-background: var(--background-inputs-30);
|
|
17
|
+
$default-gap: var(--gap);
|
|
17
18
|
|
|
18
|
-
.#{bem.$base}.select-input {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
|
|
22
|
-
> .#{bem.$base}.form-label {
|
|
23
|
-
margin-bottom: var(--gap);
|
|
24
|
-
}
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
border: $default-border;
|
|
29
|
-
border-radius: $default-input-border-radius;
|
|
20
|
+
.#{bem.$base}.select-input {
|
|
21
|
+
> .#{bem.$base}.single {
|
|
30
22
|
display: flex;
|
|
31
23
|
flex-direction: column;
|
|
32
|
-
padding: $default-padding;
|
|
33
|
-
padding-right: 0;
|
|
34
|
-
position: relative;
|
|
35
24
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
> .#{bem.$base}.form-label {
|
|
26
|
+
margin-bottom: var(--gap);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.select-wrapper {
|
|
30
|
+
background-color: $default-background;
|
|
31
|
+
border: $default-border;
|
|
32
|
+
border-radius: $default-input-border-radius;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
padding: $default-padding;
|
|
36
|
+
padding-right: 0;
|
|
37
|
+
position: relative;
|
|
38
|
+
|
|
39
|
+
&:not(.disabled) {
|
|
40
|
+
&:hover,
|
|
41
|
+
&:active {
|
|
42
|
+
border: $hover-border;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus {
|
|
46
|
+
border: $focus-border;
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
&.disabled {
|
|
51
|
+
background: $disabled-background;
|
|
44
52
|
}
|
|
45
|
-
}
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
&::placeholder {
|
|
55
|
+
color: var(--metadata);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&::after {
|
|
59
|
+
border-radius: $default-input-border-radius;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
>.#{bem.$base}.loading-circle {
|
|
63
|
+
position: absolute;
|
|
64
|
+
right: $default-spacing-size;
|
|
65
|
+
top: 50%;
|
|
66
|
+
transform: translateY(-50%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
select {
|
|
70
|
+
appearance: none;
|
|
71
|
+
background-color: $default-background;
|
|
72
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAyMCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDEuNUwxMCAxMC41TDEgMS41IiBzdHJva2U9IiM0QzRENTMiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
|
|
73
|
+
background-position: calc(100% - $default-spacing-size);
|
|
74
|
+
background-repeat: no-repeat;
|
|
75
|
+
background-size: $default-spacing-size;
|
|
76
|
+
padding-right: $default-spacing-size;
|
|
77
|
+
|
|
78
|
+
&.input {
|
|
79
|
+
border: none;
|
|
80
|
+
color: var(--y);
|
|
81
|
+
outline: none;
|
|
82
|
+
width: 100%;
|
|
83
|
+
|
|
84
|
+
/* stylelint-disable-next-line max-nesting-depth -- required */
|
|
85
|
+
&:disabled {
|
|
86
|
+
opacity: 0%;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
49
90
|
}
|
|
91
|
+
}
|
|
50
92
|
|
|
51
|
-
|
|
52
|
-
|
|
93
|
+
> .#{bem.$base}.multiple {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
outline: none;
|
|
97
|
+
position: relative;
|
|
98
|
+
|
|
99
|
+
> .#{bem.$base}.form-label {
|
|
100
|
+
margin-bottom: var(--gap);
|
|
53
101
|
}
|
|
54
102
|
|
|
55
|
-
|
|
103
|
+
|
|
104
|
+
.#{bem.$base}.popover {
|
|
105
|
+
border: $default-border;
|
|
56
106
|
border-radius: $default-input-border-radius;
|
|
57
|
-
|
|
107
|
+
width: 100%;
|
|
108
|
+
|
|
109
|
+
>.menu {
|
|
110
|
+
list-style: none;
|
|
111
|
+
margin: 0;
|
|
112
|
+
outline: 0;
|
|
113
|
+
padding: 0;
|
|
114
|
+
|
|
115
|
+
/* stylelint-disable selector-max-compound-selectors -- required */
|
|
116
|
+
>.item {
|
|
117
|
+
border-radius: $default-input-border-radius;
|
|
118
|
+
padding: $default-padding;
|
|
119
|
+
|
|
120
|
+
/* stylelint-disable max-nesting-depth -- required */
|
|
121
|
+
> p {
|
|
122
|
+
margin: 0;
|
|
123
|
+
}
|
|
58
124
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
125
|
+
&.#{bem.$modifier-active} {
|
|
126
|
+
background-color: var(--y);
|
|
127
|
+
|
|
128
|
+
> p {
|
|
129
|
+
color: var(--on-y);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
64
134
|
}
|
|
65
135
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
&.input {
|
|
76
|
-
border: none;
|
|
77
|
-
color: var(--y);
|
|
136
|
+
|
|
137
|
+
> .input-container {
|
|
138
|
+
position: relative;
|
|
139
|
+
|
|
140
|
+
> .input {
|
|
141
|
+
background: $default-background;
|
|
142
|
+
border: $default-border;
|
|
143
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
144
|
+
color: var(--paragraph);
|
|
78
145
|
outline: none;
|
|
146
|
+
padding: $default-padding;
|
|
79
147
|
width: 100%;
|
|
80
148
|
|
|
149
|
+
&::placeholder {
|
|
150
|
+
color: var(--metadata);
|
|
151
|
+
}
|
|
152
|
+
|
|
81
153
|
&:disabled {
|
|
82
|
-
|
|
154
|
+
background-color: $disabled-background;
|
|
155
|
+
color: var(--paragraph);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:not(:disabled) {
|
|
159
|
+
&:hover,
|
|
160
|
+
&:active {
|
|
161
|
+
border: $hover-border;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:focus {
|
|
165
|
+
border: $focus-border;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
>.selected-items {
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-wrap: wrap;
|
|
175
|
+
gap: calc($default-gap / 2);
|
|
176
|
+
margin-bottom: calc($default-gap / 2);
|
|
177
|
+
|
|
178
|
+
>.item {
|
|
179
|
+
>.#{bem.$base}.button {
|
|
180
|
+
align-items: center;
|
|
181
|
+
display: flex;
|
|
182
|
+
gap: calc($default-gap / 2);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.close {
|
|
186
|
+
font-size: calc(var(--s-3) * 1em);
|
|
83
187
|
}
|
|
84
188
|
}
|
|
85
189
|
}
|