@transferwise/components 0.0.0-experimental-e9426b6 → 0.0.0-experimental-0397551
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/build/dateInput/DateInput.js +3 -6
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +2 -5
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +3 -5
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +1 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/index.js +3 -5
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -3
- package/build/index.mjs.map +1 -1
- package/build/inputs/SelectInput.js +821 -0
- package/build/inputs/SelectInput.js.map +1 -0
- package/build/inputs/SelectInput.messages.js.map +1 -0
- package/build/inputs/SelectInput.messages.mjs.map +1 -0
- package/build/inputs/SelectInput.mjs +813 -0
- package/build/inputs/SelectInput.mjs.map +1 -0
- package/build/main.css +47 -47
- package/build/moneyInput/MoneyInput.js +2 -5
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -4
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +2 -5
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -4
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/styles/main.css +47 -47
- package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +7 -4
- package/build/types/inputs/SelectInput.d.ts.map +1 -0
- package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/actionButton/ActionButton.story.tsx +3 -0
- package/src/checkbox/Checkbox.story.tsx +3 -0
- package/src/circularButton/CircularButton.story.tsx +3 -0
- package/src/common/bottomSheet/BottomSheet.story.tsx +12 -0
- package/src/common/circle/Circle.story.tsx +3 -0
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +3 -0
- package/src/dateInput/DateInput.test.story.tsx +6 -0
- package/src/dateLookup/DateLookup.story.tsx +3 -0
- package/src/info/Info.story.tsx +6 -0
- package/src/inputs/{SelectInput/SelectInput.docs.mdx → SelectInput.docs.mdx} +1 -0
- package/src/inputs/SelectInput.less +219 -0
- package/src/inputs/{SelectInput/SelectInput.story.tsx → SelectInput.story.tsx} +7 -7
- package/src/inputs/SelectInput.tsx +1190 -0
- package/src/main.css +47 -47
- package/src/main.less +1 -1
- package/src/modal/Modal.story.tsx +15 -0
- package/src/snackbar/Snackbar.test.story.tsx +9 -0
- package/build/inputs/SelectInput/SelectInput.helpers.js +0 -115
- package/build/inputs/SelectInput/SelectInput.helpers.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.helpers.mjs +0 -109
- package/build/inputs/SelectInput/SelectInput.helpers.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.js +0 -216
- package/build/inputs/SelectInput/SelectInput.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.messages.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.messages.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.mjs +0 -210
- package/build/inputs/SelectInput/SelectInput.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.js +0 -26
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.mjs +0 -24
- package/build/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.js +0 -54
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.mjs +0 -52
- package/build/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js +0 -50
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.mjs +0 -48
- package/build/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.js +0 -47
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.mjs +0 -45
- package/build/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.js +0 -45
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.mjs +0 -41
- package/build/inputs/SelectInput/components/SelectInputOption/SelectInputOption.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js +0 -41
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.mjs +0 -38
- package/build/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.js +0 -270
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.mjs +0 -268
- package/build/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.js +0 -48
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.mjs +0 -46
- package/build/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.mjs.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.js +0 -41
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.js.map +0 -1
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.mjs +0 -34
- package/build/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.mjs.map +0 -1
- package/build/styles/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.css +0 -17
- package/build/styles/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.css +0 -16
- package/build/styles/inputs/SelectInput/components/SelectInputOption/SelectInputOption.css +0 -33
- package/build/styles/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.css +0 -37
- package/build/types/inputs/SelectInput/SelectInput.d.ts +0 -3
- package/build/types/inputs/SelectInput/SelectInput.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts +0 -28
- package/build/types/inputs/SelectInput/SelectInput.helpers.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.messages.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.types.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.d.ts +0 -5
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputClearButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.d.ts +0 -9
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputDefaultTrigger/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.d.ts +0 -9
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputGroupItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.d.ts +0 -8
- package/build/types/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputItemView/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOption/SelectInputOption.d.ts +0 -10
- package/build/types/inputs/SelectInput/components/SelectInputOption/SelectInputOption.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOption/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputOption/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.d.ts +0 -9
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/components/SelectInputOptionContent/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.d.ts +0 -15
- package/build/types/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptions/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputOptions/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.d.ts +0 -6
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/components/SelectInputOptionsContainer/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.d.ts +0 -15
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/components/SelectInputTriggerButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/index.d.ts +0 -5
- package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
- package/src/inputs/SelectInput/SelectInput.helpers.ts +0 -152
- package/src/inputs/SelectInput/SelectInput.less +0 -42
- package/src/inputs/SelectInput/SelectInput.test.tsx +0 -606
- package/src/inputs/SelectInput/SelectInput.tsx +0 -247
- package/src/inputs/SelectInput/SelectInput.types.ts +0 -114
- package/src/inputs/SelectInput/components/SelectInputClearButton/SelectInputClearButton.tsx +0 -25
- package/src/inputs/SelectInput/components/SelectInputClearButton/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.css +0 -17
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.less +0 -15
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.tsx +0 -56
- package/src/inputs/SelectInput/components/SelectInputDefaultTrigger/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputGroupItemView/SelectInputGroupItemView.tsx +0 -64
- package/src/inputs/SelectInput/components/SelectInputGroupItemView/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.css +0 -16
- package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.less +0 -17
- package/src/inputs/SelectInput/components/SelectInputItemView/SelectInputItemView.tsx +0 -55
- package/src/inputs/SelectInput/components/SelectInputItemView/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.css +0 -33
- package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.less +0 -32
- package/src/inputs/SelectInput/components/SelectInputOption/SelectInputOption.tsx +0 -51
- package/src/inputs/SelectInput/components/SelectInputOption/index.ts +0 -5
- package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.css +0 -37
- package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.less +0 -38
- package/src/inputs/SelectInput/components/SelectInputOptionContent/SelectInputOptionContent.tsx +0 -67
- package/src/inputs/SelectInput/components/SelectInputOptionContent/index.ts +0 -5
- package/src/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.less +0 -75
- package/src/inputs/SelectInput/components/SelectInputOptions/SelectInputOptions.tsx +0 -369
- package/src/inputs/SelectInput/components/SelectInputOptions/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputOptionsContainer/SelectInputOptionsContainer.tsx +0 -56
- package/src/inputs/SelectInput/components/SelectInputOptionsContainer/index.ts +0 -1
- package/src/inputs/SelectInput/components/SelectInputTriggerButton/SelectInputTriggerButton.tsx +0 -39
- package/src/inputs/SelectInput/components/SelectInputTriggerButton/index.ts +0 -5
- package/src/inputs/SelectInput/index.ts +0 -13
- package/build/inputs/{SelectInput/SelectInput.messages.js → SelectInput.messages.js} +0 -0
- package/build/inputs/{SelectInput/SelectInput.messages.mjs → SelectInput.messages.mjs} +0 -0
- package/{src/inputs/SelectInput → build/styles/inputs}/SelectInput.css +47 -47
- package/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
- package/{build/styles/inputs/SelectInput → src/inputs}/SelectInput.css +47 -47
- /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import type { SelectInputOptionItem, SelectInputItem } from './SelectInput.types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Normalises a string for searching by trimming, normalising whitespace,
|
|
5
|
-
* removing diacritics, and converting to lowercase.
|
|
6
|
-
*/
|
|
7
|
-
export function searchableString(value: string) {
|
|
8
|
-
return (
|
|
9
|
-
value
|
|
10
|
-
.trim()
|
|
11
|
-
.replace(/\s+/gu, ' ')
|
|
12
|
-
// NFD converts an Å to A + ̊ (and other special characters)
|
|
13
|
-
.normalize('NFD')
|
|
14
|
-
// and then this replaces the ̊ with nothing (and other special characters)
|
|
15
|
-
.replace(/[\u0300-\u036f]/g, '')
|
|
16
|
-
.toLowerCase()
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Infers searchable strings from a value.
|
|
22
|
-
* Extracts string values from objects or returns the string itself.
|
|
23
|
-
*/
|
|
24
|
-
function inferSearchableStrings(value: unknown) {
|
|
25
|
-
if (typeof value === 'string') {
|
|
26
|
-
return [searchableString(value)];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (typeof value === 'object' && value != null) {
|
|
30
|
-
return Object.values(value)
|
|
31
|
-
.filter((innerValue) => typeof innerValue === 'string')
|
|
32
|
-
.map((innerValue) => searchableString(innerValue));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return [];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Checks if a select input option item matches the search needle.
|
|
40
|
-
*/
|
|
41
|
-
export function selectInputOptionItemIncludesNeedle<T>(
|
|
42
|
-
item: SelectInputOptionItem<T>,
|
|
43
|
-
needle: string,
|
|
44
|
-
) {
|
|
45
|
-
return inferSearchableStrings(item.filterMatchers ?? item.value).some((haystack) =>
|
|
46
|
-
haystack.includes(needle),
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Deduplicates a single option item by checking against existing values.
|
|
52
|
-
* Returns the item with value set to undefined if it's a duplicate.
|
|
53
|
-
*/
|
|
54
|
-
function dedupeSelectInputOptionItem<T>(
|
|
55
|
-
item: SelectInputOptionItem<T>,
|
|
56
|
-
existingValues: Set<T>,
|
|
57
|
-
compareValues?: (a: T, b: T) => boolean,
|
|
58
|
-
): SelectInputOptionItem<T | undefined> {
|
|
59
|
-
const isDuplicate = compareValues
|
|
60
|
-
? Array.from(existingValues).some((existingValue) => compareValues(item.value, existingValue))
|
|
61
|
-
: existingValues.has(item.value);
|
|
62
|
-
|
|
63
|
-
if (!isDuplicate) {
|
|
64
|
-
existingValues.add(item.value);
|
|
65
|
-
return item;
|
|
66
|
-
}
|
|
67
|
-
return { ...item, value: undefined };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Sets the `value` of duplicate option items to `undefined`, hiding them when
|
|
72
|
-
* rendered. Indexes are kept intact within groups to preserve the active item
|
|
73
|
-
* between filter changes when possible.
|
|
74
|
-
*/
|
|
75
|
-
export function dedupeSelectInputItems<T>(
|
|
76
|
-
items: readonly SelectInputItem<T>[],
|
|
77
|
-
compareValues?: (a: T, b: T) => boolean,
|
|
78
|
-
): SelectInputItem<T | undefined>[] {
|
|
79
|
-
const existingValues = new Set<T>();
|
|
80
|
-
|
|
81
|
-
return items.map((item) => {
|
|
82
|
-
switch (item.type) {
|
|
83
|
-
case 'option': {
|
|
84
|
-
return dedupeSelectInputOptionItem(item, existingValues, compareValues);
|
|
85
|
-
}
|
|
86
|
-
case 'group': {
|
|
87
|
-
return {
|
|
88
|
-
...item,
|
|
89
|
-
options: item.options.map((option) =>
|
|
90
|
-
dedupeSelectInputOptionItem(option, existingValues, compareValues),
|
|
91
|
-
),
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
default:
|
|
95
|
-
}
|
|
96
|
-
return item;
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Filters select input items based on a predicate function.
|
|
102
|
-
* Groups are included if at least one option matches the predicate.
|
|
103
|
-
*/
|
|
104
|
-
export function filterSelectInputItems<T>(
|
|
105
|
-
items: readonly SelectInputItem<T>[],
|
|
106
|
-
predicate: (item: SelectInputOptionItem<T>) => boolean,
|
|
107
|
-
) {
|
|
108
|
-
return items.filter((item) => {
|
|
109
|
-
switch (item.type) {
|
|
110
|
-
case 'option': {
|
|
111
|
-
return predicate(item);
|
|
112
|
-
}
|
|
113
|
-
case 'group': {
|
|
114
|
-
return item.options.some((option) => predicate(option));
|
|
115
|
-
}
|
|
116
|
-
default:
|
|
117
|
-
}
|
|
118
|
-
return false;
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Flattens and sorts filtered options using the provided comparator.
|
|
124
|
-
* Extracts all options from groups, filters out undefined values (deduplicated items),
|
|
125
|
-
* sorts them, and returns as a flat list of option items.
|
|
126
|
-
*/
|
|
127
|
-
export function sortSelectInputItems<T>(
|
|
128
|
-
items: readonly SelectInputItem<T | undefined>[],
|
|
129
|
-
compareFn: (
|
|
130
|
-
a: SelectInputOptionItem<NonNullable<T>>,
|
|
131
|
-
b: SelectInputOptionItem<NonNullable<T>>,
|
|
132
|
-
searchQuery: string,
|
|
133
|
-
) => number,
|
|
134
|
-
searchQuery: string,
|
|
135
|
-
): SelectInputItem<NonNullable<T>>[] {
|
|
136
|
-
const flattenedOption = items.flatMap((item) => {
|
|
137
|
-
if (item.type === 'option') {
|
|
138
|
-
return item.value !== undefined ? [item as SelectInputOptionItem<NonNullable<T>>] : [];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (item.type === 'group') {
|
|
142
|
-
return item.options.filter(
|
|
143
|
-
(option): option is SelectInputOptionItem<NonNullable<T>> => option.value !== undefined,
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return [];
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// eslint-disable-next-line functional/immutable-data
|
|
151
|
-
return flattenedOption.sort((a, b) => compareFn(a, b, searchQuery));
|
|
152
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
@import "../_BottomSheet.less";
|
|
2
|
-
@import "../_ButtonInput.less";
|
|
3
|
-
@import "../_Popover.less";
|
|
4
|
-
@import (reference) "../../../node_modules/@transferwise/neptune-css/src/less/ring.less";
|
|
5
|
-
@import "./components/SelectInputOptions/SelectInputOptions.less";
|
|
6
|
-
@import "./components/SelectInputOption/SelectInputOption.less";
|
|
7
|
-
@import "./components/SelectInputItemView/SelectInputItemView.less";
|
|
8
|
-
@import "./components/SelectInputOptionContent/SelectInputOptionContent.less";
|
|
9
|
-
@import "./components/SelectInputDefaultTrigger/SelectInputDefaultTrigger.less";
|
|
10
|
-
|
|
11
|
-
.np-select-input-content {
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
text-overflow: ellipsis;
|
|
14
|
-
white-space: nowrap;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.np-select-input-placeholder {
|
|
18
|
-
color: var(--color-content-tertiary);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.np-select-input-addon {
|
|
22
|
-
border-width: 0;
|
|
23
|
-
background: none;
|
|
24
|
-
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
height: var(--size-24);
|
|
27
|
-
width: var(--size-24);
|
|
28
|
-
align-items: center;
|
|
29
|
-
justify-content: center;
|
|
30
|
-
border-radius: 0.125rem /* 2px */; /* TODO: Tokenize */
|
|
31
|
-
|
|
32
|
-
&--interactive {
|
|
33
|
-
pointer-events: auto;
|
|
34
|
-
color: var(--color-interactive-secondary);
|
|
35
|
-
|
|
36
|
-
&:hover {
|
|
37
|
-
color: var(--color-interactive-secondary-hover);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.focus-ring();
|
|
41
|
-
}
|
|
42
|
-
}
|