svelte-5-select 1.0.0-beta.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.
@@ -0,0 +1,4 @@
1
+ import type { SelectProps } from './types';
2
+ declare const Select: import("svelte").Component<SelectProps, {}, "loading" | "value" | "hoverItemIndex" | "listOpen" | "filterText" | "items" | "focused" | "justValue">;
3
+ type Select = ReturnType<typeof Select>;
4
+ export default Select;
@@ -0,0 +1,19 @@
1
+ import type { SelectItem } from './types';
2
+ interface AriaHandlersConfig {
3
+ ariaValues: (values: string) => string;
4
+ ariaListOpen: (label: string, count: number) => string;
5
+ ariaFocused: () => string;
6
+ }
7
+ interface AriaHandlersContext {
8
+ value: string | SelectItem | SelectItem[] | null | undefined;
9
+ filteredItems: SelectItem[];
10
+ hoverItemIndex: number;
11
+ listOpen: boolean;
12
+ multiple: boolean;
13
+ label: string;
14
+ }
15
+ export declare function useAriaHandlers(config: AriaHandlersConfig): {
16
+ handleAriaSelection: (context: AriaHandlersContext) => string;
17
+ handleAriaContent: (context: AriaHandlersContext) => string;
18
+ };
19
+ export {};
@@ -0,0 +1,36 @@
1
+ export function useAriaHandlers(config) {
2
+ const { ariaValues, ariaListOpen, ariaFocused } = config;
3
+ function handleAriaSelection(context) {
4
+ const { value, multiple, label } = context;
5
+ if (!value)
6
+ return '';
7
+ let selected = undefined;
8
+ if (typeof value === 'string') {
9
+ selected = value;
10
+ }
11
+ else if (multiple && Array.isArray(value) && value.length > 0) {
12
+ selected = value.map((v) => v[label]).join(', ');
13
+ }
14
+ else if (!multiple && value) {
15
+ selected = value[label];
16
+ }
17
+ return ariaValues(selected || '');
18
+ }
19
+ function handleAriaContent(context) {
20
+ const { filteredItems, hoverItemIndex, listOpen, label } = context;
21
+ if (!filteredItems || filteredItems.length === 0)
22
+ return '';
23
+ const _item = filteredItems[hoverItemIndex];
24
+ if (listOpen && _item) {
25
+ const count = filteredItems.length;
26
+ return ariaListOpen(_item[label], count);
27
+ }
28
+ else {
29
+ return ariaFocused();
30
+ }
31
+ }
32
+ return {
33
+ handleAriaSelection,
34
+ handleAriaContent,
35
+ };
36
+ }
@@ -0,0 +1,2 @@
1
+ import type { FilterConfig, SelectItem } from './types';
2
+ export default function filter({ loadOptions, filterText, items, multiple, value, itemId, groupBy, filterSelectedItems, itemFilter, convertStringItemsToObjects, filterGroupedItems, label, }: FilterConfig): SelectItem[];
package/dist/filter.js ADDED
@@ -0,0 +1,30 @@
1
+ import { areItemsEqual, isStringArray } from './utils';
2
+ export default function filter({ loadOptions, filterText = '', items, multiple, value, itemId, groupBy, filterSelectedItems, itemFilter, convertStringItemsToObjects, filterGroupedItems, label, }) {
3
+ if (items && loadOptions) {
4
+ return items;
5
+ }
6
+ // If no items, return empty array
7
+ if (!items) {
8
+ return [];
9
+ }
10
+ let typedItems = items;
11
+ const aStringArray = isStringArray(typedItems);
12
+ if (aStringArray) {
13
+ typedItems = convertStringItemsToObjects(typedItems);
14
+ }
15
+ // Filter items based on filter text and selection
16
+ let filterResults = typedItems.filter((item) => {
17
+ let matchesFilter = itemFilter(item[label], filterText, item);
18
+ if (matchesFilter && multiple && Array.isArray(value) && value.length > 0) {
19
+ matchesFilter = !value.some((x) => {
20
+ return filterSelectedItems ? areItemsEqual(x, item, itemId) : false;
21
+ });
22
+ }
23
+ return matchesFilter;
24
+ });
25
+ // Apply grouping if groupBy function is provided
26
+ if (groupBy) {
27
+ filterResults = filterGroupedItems(filterResults);
28
+ }
29
+ return filterResults;
30
+ }
@@ -0,0 +1,8 @@
1
+ export { default as Select } from './Select.svelte';
2
+ export { default as ChevronIcon } from './ChevronIcon.svelte';
3
+ export { default as ClearIcon } from './ClearIcon.svelte';
4
+ export { default as LoadingIcon } from './LoadingIcon.svelte';
5
+ export { default as filter } from './filter';
6
+ export { useKeyboardNavigation } from './keyboard-navigation.svelte';
7
+ export { isStringArray, isCancelled, areItemsEqual } from './utils';
8
+ export type { SelectItem, SelectProps, FloatingConfig, FilterConfig, KeyboardNavigationContext, ErrorEvent, } from './types';
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // Main component exports
2
+ export { default as Select } from './Select.svelte';
3
+ // Icon components
4
+ export { default as ChevronIcon } from './ChevronIcon.svelte';
5
+ export { default as ClearIcon } from './ClearIcon.svelte';
6
+ export { default as LoadingIcon } from './LoadingIcon.svelte';
7
+ // Utility functions
8
+ export { default as filter } from './filter';
9
+ export { useKeyboardNavigation } from './keyboard-navigation.svelte';
10
+ export { isStringArray, isCancelled, areItemsEqual } from './utils';
@@ -0,0 +1,12 @@
1
+ import type { KeyboardNavigationContext } from './types';
2
+ export declare function useKeyboardNavigation(context: KeyboardNavigationContext): {
3
+ handleKeyDown: (e: KeyboardEvent) => void;
4
+ handleEscapeKey: (e: KeyboardEvent) => void;
5
+ handleEnterKey: (e: KeyboardEvent) => void;
6
+ handleArrowDownKey: (e: KeyboardEvent) => void;
7
+ handleArrowUpKey: (e: KeyboardEvent) => void;
8
+ handleTabKey: (e: KeyboardEvent) => void;
9
+ handleBackspaceKey: (e: KeyboardEvent) => void;
10
+ handleArrowLeftKey: (e: KeyboardEvent) => void;
11
+ handleArrowRightKey: (e: KeyboardEvent) => void;
12
+ };
@@ -0,0 +1,124 @@
1
+ import { areItemsEqual } from './utils';
2
+ export function useKeyboardNavigation(context) {
3
+ function handleKeyDown(e) {
4
+ e.stopPropagation();
5
+ const { focused } = context.getState();
6
+ if (!focused)
7
+ return;
8
+ const handlers = {
9
+ 'Escape': handleEscapeKey,
10
+ 'Enter': handleEnterKey,
11
+ 'ArrowDown': handleArrowDownKey,
12
+ 'ArrowUp': handleArrowUpKey,
13
+ 'Tab': handleTabKey,
14
+ 'Backspace': handleBackspaceKey,
15
+ 'ArrowLeft': handleArrowLeftKey,
16
+ 'ArrowRight': handleArrowRightKey,
17
+ };
18
+ const handler = handlers[e.key];
19
+ if (handler) {
20
+ handler(e);
21
+ }
22
+ }
23
+ function handleEscapeKey(e) {
24
+ e.preventDefault();
25
+ context.closeList();
26
+ }
27
+ function handleEnterKey(e) {
28
+ e.preventDefault();
29
+ const { listOpen, filteredItems, hoverItemIndex, value, multiple, itemId } = context.getState();
30
+ if (!listOpen)
31
+ return;
32
+ if (filteredItems.length === 0)
33
+ return;
34
+ const hoverItem = filteredItems[hoverItemIndex];
35
+ if (!multiple && areItemsEqual(value, hoverItem, itemId)) {
36
+ context.closeList();
37
+ }
38
+ else {
39
+ context.handleSelect(filteredItems[hoverItemIndex]);
40
+ }
41
+ }
42
+ function handleArrowDownKey(e) {
43
+ e.preventDefault();
44
+ const { listOpen } = context.getState();
45
+ if (listOpen) {
46
+ context.setHoverIndex(1);
47
+ }
48
+ else {
49
+ context.setListOpen(true);
50
+ context.setActiveValue(undefined);
51
+ }
52
+ }
53
+ function handleArrowUpKey(e) {
54
+ e.preventDefault();
55
+ const { listOpen } = context.getState();
56
+ if (listOpen) {
57
+ context.setHoverIndex(-1);
58
+ }
59
+ else {
60
+ context.setListOpen(true);
61
+ context.setActiveValue(undefined);
62
+ }
63
+ }
64
+ function handleTabKey(e) {
65
+ const { listOpen, focused, filteredItems, hoverItemIndex, value, itemId } = context.getState();
66
+ if (!listOpen || !focused)
67
+ return;
68
+ if (filteredItems.length === 0 || areItemsEqual(value, filteredItems[hoverItemIndex], itemId)) {
69
+ context.closeList();
70
+ return;
71
+ }
72
+ e.preventDefault();
73
+ context.handleSelect(filteredItems[hoverItemIndex]);
74
+ context.closeList();
75
+ }
76
+ function handleBackspaceKey(e) {
77
+ const { multiple, filterText, value, activeValue } = context.getState();
78
+ if (!multiple || filterText.length > 0)
79
+ return;
80
+ if (multiple && value && value.length > 0) {
81
+ const indexToRemove = activeValue !== undefined ? activeValue : value.length - 1;
82
+ context.handleMultiItemClear(indexToRemove);
83
+ if (activeValue === 0 || activeValue === undefined)
84
+ return;
85
+ const newActiveValue = value.length > activeValue ? activeValue - 1 : undefined;
86
+ context.setActiveValue(newActiveValue);
87
+ }
88
+ }
89
+ function handleArrowLeftKey(e) {
90
+ const { value, multiple, filterText, activeValue } = context.getState();
91
+ if (!value || !multiple || filterText.length > 0)
92
+ return;
93
+ if (Array.isArray(value)) {
94
+ if (activeValue === undefined) {
95
+ context.setActiveValue(value.length - 1);
96
+ }
97
+ else if (value.length > activeValue && activeValue !== 0) {
98
+ context.setActiveValue(activeValue - 1);
99
+ }
100
+ }
101
+ }
102
+ function handleArrowRightKey(e) {
103
+ const { value, multiple, filterText, activeValue } = context.getState();
104
+ if (!value || !multiple || filterText.length > 0 || activeValue === undefined)
105
+ return;
106
+ if (activeValue === value.length - 1) {
107
+ context.setActiveValue(undefined);
108
+ }
109
+ else if (activeValue < value.length - 1) {
110
+ context.setActiveValue(activeValue + 1);
111
+ }
112
+ }
113
+ return {
114
+ handleKeyDown,
115
+ handleEscapeKey,
116
+ handleEnterKey,
117
+ handleArrowDownKey,
118
+ handleArrowUpKey,
119
+ handleTabKey,
120
+ handleBackspaceKey,
121
+ handleArrowLeftKey,
122
+ handleArrowRightKey,
123
+ };
124
+ }
@@ -0,0 +1,387 @@
1
+ .svelte-select {
2
+ /* deprecating camelCase custom props in favour of kebab-case for v5 */
3
+ --borderRadius: var(--border-radius);
4
+ --clearSelectColor: var(--clear-select-color);
5
+ --clearSelectWidth: var(--clear-select-width);
6
+ --disabledBackground: var(--disabled-background);
7
+ --disabledBorderColor: var(--disabled-border-color);
8
+ --disabledColor: var(--disabled-color);
9
+ --disabledPlaceholderColor: var(--disabled-placeholder-color);
10
+ --disabledPlaceholderOpacity: var(--disabled-placeholder-opacity);
11
+ --errorBackground: var(--error-background);
12
+ --errorBorder: var(--error-border);
13
+ --groupItemPaddingLeft: var(--group-item-padding-left);
14
+ --groupTitleColor: var(--group-title-color);
15
+ --groupTitleFontSize: var(--group-title-font-size);
16
+ --groupTitleFontWeight: var(--group-title-font-weight);
17
+ --groupTitlePadding: var(--group-title-padding);
18
+ --groupTitleTextTransform: var(--group-title-text-transform);
19
+ --groupTitleBorderColor: var(--group-title-border-color);
20
+ --groupTitleBorderWidth: var(--group-title-border-width);
21
+ --groupTitleBorderStyle: var(--group-title-border-style);
22
+ --indicatorColor: var(--chevron-color);
23
+ --indicatorHeight: var(--chevron-height);
24
+ --indicatorWidth: var(--chevron-width);
25
+ --inputColor: var(--input-color);
26
+ --inputLeft: var(--input-left);
27
+ --inputLetterSpacing: var(--input-letter-spacing);
28
+ --inputMargin: var(--input-margin);
29
+ --inputPadding: var(--input-padding);
30
+ --itemActiveBackground: var(--item-active-background);
31
+ --itemColor: var(--item-color);
32
+ --itemFirstBorderRadius: var(--item-first-border-radius);
33
+ --itemHoverBG: var(--item-hover-bg);
34
+ --itemHoverColor: var(--item-hover-color);
35
+ --itemIsActiveBG: var(--item-is-active-bg);
36
+ --itemIsActiveColor: var(--item-is-active-color);
37
+ --itemIsNotSelectableColor: var(--item-is-not-selectable-color);
38
+ --itemPadding: var(--item-padding);
39
+ --listBackground: var(--list-background);
40
+ --listBorder: var(--list-border);
41
+ --listBorderRadius: var(--list-border-radius);
42
+ --listEmptyColor: var(--list-empty-color);
43
+ --listEmptyPadding: var(--list-empty-padding);
44
+ --listEmptyTextAlign: var(--list-empty-text-align);
45
+ --listMaxHeight: var(--list-max-height);
46
+ --listPosition: var(--list-position);
47
+ --listShadow: var(--list-shadow);
48
+ --listZIndex: var(--list-z-index);
49
+ --multiItemBG: var(--multi-item-bg);
50
+ --multiItemBorderRadius: var(--multi-item-border-radius);
51
+ --multiItemDisabledHoverBg: var(--multi-item-disabled-hover-bg);
52
+ --multiItemDisabledHoverColor: var(--multi-item-disabled-hover-color);
53
+ --multiItemHeight: var(--multi-item-height);
54
+ --multiItemMargin: var(--multi-item-margin);
55
+ --multiItemPadding: var(--multi-item-padding);
56
+ --multiSelectInputMargin: var(--multi-select-input-margin);
57
+ --multiSelectInputPadding: var(--multi-select-input-padding);
58
+ --multiSelectPadding: var(--multi-select-padding);
59
+ --placeholderColor: var(--placeholder-color);
60
+ --placeholderOpacity: var(--placeholder-opacity);
61
+ --selectedItemPadding: var(--selected-item-padding);
62
+ --spinnerColor: var(--spinner-color);
63
+ --spinnerHeight: var(--spinner-height);
64
+ --spinnerWidth: var(--spinner-width);
65
+
66
+ --internal-padding: 0 0 0 16px;
67
+
68
+ border: var(--border, 1px solid #d8dbdf);
69
+ border-radius: var(--border-radius, 6px);
70
+ min-height: var(--height, 42px);
71
+ position: relative;
72
+ display: flex;
73
+ align-items: stretch;
74
+ padding: var(--padding, var(--internal-padding));
75
+ background: var(--background, #fff);
76
+ margin: var(--margin, 0);
77
+ width: var(--width, 100%);
78
+ font-size: var(--font-size, 16px);
79
+ max-height: var(--max-height);
80
+ }
81
+
82
+ * {
83
+ box-sizing: var(--box-sizing, border-box);
84
+ }
85
+
86
+ .svelte-select:hover {
87
+ border: var(--border-hover, 1px solid #b2b8bf);
88
+ }
89
+
90
+ .value-container {
91
+ display: flex;
92
+ flex: 1 1 0%;
93
+ flex-wrap: wrap;
94
+ align-items: center;
95
+ gap: 5px 10px;
96
+ padding: var(--value-container-padding, 5px 0);
97
+ position: relative;
98
+ overflow: var(--value-container-overflow, hidden);
99
+ align-self: stretch;
100
+ }
101
+
102
+ .prepend,
103
+ .indicators {
104
+ display: flex;
105
+ flex-shrink: 0;
106
+ align-items: center;
107
+ }
108
+
109
+ .indicators {
110
+ position: var(--indicators-position);
111
+ top: var(--indicators-top);
112
+ right: var(--indicators-right);
113
+ bottom: var(--indicators-bottom);
114
+ }
115
+
116
+ input {
117
+ position: absolute;
118
+ cursor: default;
119
+ border: none;
120
+ color: var(--input-color, var(--item-color));
121
+ padding: var(--input-padding, 0);
122
+ letter-spacing: var(--input-letter-spacing, inherit);
123
+ margin: var(--input-margin, 0);
124
+ min-width: 10px;
125
+ top: 0;
126
+ right: 0;
127
+ bottom: 0;
128
+ left: 0;
129
+ background: transparent;
130
+ font-size: var(--font-size, 16px);
131
+ }
132
+
133
+ :not(.multi) > .value-container > input {
134
+ width: 100%;
135
+ height: 100%;
136
+ }
137
+
138
+ input::placeholder {
139
+ color: var(--placeholder-color, #78848f);
140
+ opacity: var(--placeholder-opacity, 1);
141
+ }
142
+
143
+ input:focus {
144
+ outline: none;
145
+ }
146
+
147
+ .svelte-select.focused {
148
+ border: var(--border-focused, 1px solid #006fe8);
149
+ border-radius: var(--border-radius-focused, var(--border-radius, 6px));
150
+ }
151
+
152
+ .disabled {
153
+ background: var(--disabled-background, #ebedef);
154
+ border-color: var(--disabled-border-color, #ebedef);
155
+ color: var(--disabled-color, #c1c6cc);
156
+ }
157
+
158
+ .disabled input::placeholder {
159
+ color: var(--disabled-placeholder-color, #c1c6cc);
160
+ opacity: var(--disabled-placeholder-opacity, 1);
161
+ }
162
+
163
+ .selected-item {
164
+ position: relative;
165
+ overflow: var(--selected-item-overflow, hidden);
166
+ padding: var(--selected-item-padding, 0 20px 0 0);
167
+ text-overflow: ellipsis;
168
+ white-space: nowrap;
169
+ color: var(--selected-item-color, inherit);
170
+ font-size: var(--font-size, 16px);
171
+ }
172
+
173
+ .multi .selected-item {
174
+ position: absolute;
175
+ line-height: var(--height, 42px);
176
+ height: var(--height, 42px);
177
+ }
178
+
179
+ .selected-item:focus {
180
+ outline: none;
181
+ }
182
+
183
+ .hide-selected-item {
184
+ opacity: 0;
185
+ }
186
+
187
+ .icon {
188
+ display: flex;
189
+ align-items: center;
190
+ justify-content: center;
191
+ }
192
+
193
+ .clear-select {
194
+ all: unset;
195
+ display: flex;
196
+ align-items: center;
197
+ justify-content: center;
198
+ width: var(--clear-select-width, 40px);
199
+ height: var(--clear-select-height, 100%);
200
+ color: var(--clear-select-color, var(--icons-color));
201
+ margin: var(--clear-select-margin, 0);
202
+ pointer-events: all;
203
+ flex-shrink: 0;
204
+ }
205
+
206
+ .clear-select:focus {
207
+ outline: var(--clear-select-focus-outline, 1px solid #006fe8);
208
+ }
209
+
210
+ .loading {
211
+ width: var(--loading-width, 40px);
212
+ height: var(--loading-height);
213
+ color: var(--loading-color, var(--icons-color));
214
+ margin: var(--loading--margin, 0);
215
+ flex-shrink: 0;
216
+ }
217
+
218
+ .chevron {
219
+ width: var(--chevron-width, 40px);
220
+ height: var(--chevron-height, 40px);
221
+ background: var(--chevron-background, transparent);
222
+ pointer-events: var(--chevron-pointer-events, none);
223
+ color: var(--chevron-color, var(--icons-color));
224
+ border: 0;
225
+ border-left: var(--chevron-border-left, 1px solid #d8dbdf);
226
+ flex-shrink: 0;
227
+ }
228
+
229
+ .multi {
230
+ padding: var(--multi-select-padding, var(--internal-padding));
231
+ }
232
+
233
+ .multi input {
234
+ padding: var(--multi-select-input-padding, 0);
235
+ position: relative;
236
+ margin: var(--multi-select-input-margin, 5px 0);
237
+ flex: 1 1 40px;
238
+ }
239
+
240
+ .svelte-select.error {
241
+ border: var(--error-border, 1px solid #ff2d55);
242
+ background: var(--error-background, #fff);
243
+ }
244
+
245
+ .a11y-text {
246
+ z-index: 9999;
247
+ border: 0px;
248
+ clip: rect(1px, 1px, 1px, 1px);
249
+ height: 1px;
250
+ width: 1px;
251
+ position: absolute;
252
+ overflow: hidden;
253
+ padding: 0px;
254
+ white-space: nowrap;
255
+ }
256
+
257
+ .multi-item {
258
+ background: var(--multi-item-bg, #ebedef);
259
+ margin: var(--multi-item-margin, 0);
260
+ outline: var(--multi-item-outline, 1px solid #ddd);
261
+ border-radius: var(--multi-item-border-radius, 4px);
262
+ height: var(--multi-item-height, 25px);
263
+ line-height: var(--multi-item-height, 25px);
264
+ display: flex;
265
+ cursor: default;
266
+ padding: var(--multi-item-padding, 0 5px);
267
+ overflow: hidden;
268
+ gap: var(--multi-item-gap, 4px);
269
+ outline-offset: -1px;
270
+ max-width: var(--multi-max-width, none);
271
+ color: var(--multi-item-color, var(--item-color));
272
+ }
273
+
274
+ .multi-item.disabled:hover {
275
+ background: var(--multi-item-disabled-hover-bg, #ebedef);
276
+ color: var(--multi-item-disabled-hover-color, #c1c6cc);
277
+ }
278
+
279
+ .multi-item-text {
280
+ overflow: hidden;
281
+ text-overflow: ellipsis;
282
+ white-space: nowrap;
283
+ }
284
+
285
+ .multi-item-clear {
286
+ display: flex;
287
+ align-items: center;
288
+ justify-content: center;
289
+ --clear-icon-color: var(--multi-item-clear-icon-color, #000);
290
+ }
291
+
292
+ .multi-item.active {
293
+ outline: var(--multi-item-active-outline, 1px solid #006fe8);
294
+ }
295
+
296
+ .svelte-select-list {
297
+ box-shadow: var(--list-shadow, 0 2px 3px 0 rgba(44, 62, 80, 0.24));
298
+ border-radius: var(--list-border-radius, 4px);
299
+ max-height: var(--list-max-height, 252px);
300
+ overflow-y: auto;
301
+ background: var(--list-background, #fff);
302
+ position: var(--list-position, absolute);
303
+ z-index: var(--list-z-index, 2);
304
+ border: var(--list-border);
305
+ }
306
+
307
+ .prefloat {
308
+ opacity: 0;
309
+ pointer-events: none;
310
+ }
311
+
312
+ .list-group-title {
313
+ color: var(--group-title-color, #000000);
314
+ cursor: default;
315
+ font-size: var(--group-title-font-size, 16px);
316
+ font-weight: var(--group-title-font-weight, 600);
317
+ height: var(--height, 42px);
318
+ line-height: var(--height, 42px);
319
+ padding: var(--group-title-padding, 0 20px);
320
+ text-overflow: ellipsis;
321
+ overflow-x: hidden;
322
+ white-space: nowrap;
323
+ text-transform: var(--group-title-text-transform, uppercase);
324
+ border-width: var(--group-title-border-width, medium);
325
+ border-style: var(--group-title-border-style, none);
326
+ border-color: var(--group-title-border-color, transparent);
327
+ }
328
+
329
+ .empty {
330
+ text-align: var(--list-empty-text-align, center);
331
+ padding: var(--list-empty-padding, 20px 0);
332
+ color: var(--list-empty-color, #78848f);
333
+ }
334
+
335
+ .item {
336
+ cursor: default;
337
+ height: var(--item-height, var(--height, 42px));
338
+ line-height: var(--item-line-height, var(--height, 42px));
339
+ padding: var(--item-padding, 0 20px);
340
+ color: var(--item-color, inherit);
341
+ text-overflow: ellipsis;
342
+ overflow: hidden;
343
+ white-space: nowrap;
344
+ transition: var(--item-transition, all 0.2s);
345
+ align-items: center;
346
+ width: 100%;
347
+ }
348
+
349
+ .item.group-item {
350
+ padding-left: var(--group-item-padding-left, 40px);
351
+ }
352
+
353
+ .item:active {
354
+ background: var(--item-active-background, #b9daff);
355
+ }
356
+
357
+ .item.active {
358
+ background: var(--item-is-active-bg, #007aff);
359
+ color: var(--item-is-active-color, #fff);
360
+ }
361
+
362
+ .item.first {
363
+ border-radius: var(--item-first-border-radius, 4px 4px 0 0);
364
+ }
365
+
366
+ .item.hover:not(.active) {
367
+ background: var(--item-hover-bg, #e7f2ff);
368
+ color: var(--item-hover-color, inherit);
369
+ }
370
+
371
+ .item.not-selectable,
372
+ .item.hover.item.not-selectable,
373
+ .item.active.item.not-selectable,
374
+ .item.not-selectable:active {
375
+ color: var(--item-is-not-selectable-color, #999);
376
+ background: transparent;
377
+ }
378
+
379
+ .required {
380
+ opacity: 0;
381
+ z-index: -1;
382
+ position: absolute;
383
+ top: 0;
384
+ left: 0;
385
+ bottom: 0;
386
+ right: 0;
387
+ }