@transferwise/components 0.0.0-experimental-a9ab536 → 0.0.0-experimental-3df0347
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 +5 -12
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +4 -11
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +8 -16
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +6 -14
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/index.js +7 -14
- package/build/index.js.map +1 -1
- package/build/index.mjs +3 -10
- package/build/index.mjs.map +1 -1
- package/build/inputs/SelectInput.js +890 -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 +881 -0
- package/build/inputs/SelectInput.mjs.map +1 -0
- package/build/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.js → _BottomSheet.js} +7 -7
- package/build/inputs/_BottomSheet.js.map +1 -0
- package/build/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.mjs → _BottomSheet.mjs} +7 -7
- package/build/inputs/_BottomSheet.mjs.map +1 -0
- package/build/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.js → _ButtonInput.js} +5 -5
- package/build/inputs/_ButtonInput.js.map +1 -0
- package/build/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.mjs → _ButtonInput.mjs} +5 -5
- package/build/inputs/_ButtonInput.mjs.map +1 -0
- package/build/inputs/{SelectInput/Popover/SelectInputPopover.js → _Popover.js} +4 -4
- package/build/inputs/_Popover.js.map +1 -0
- package/build/inputs/{SelectInput/Popover/SelectInputPopover.mjs → _Popover.mjs} +4 -4
- package/build/inputs/_Popover.mjs.map +1 -0
- package/build/main.css +91 -91
- package/build/moneyInput/MoneyInput.js +2 -9
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -8
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +3 -10
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +2 -9
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/styles/main.css +91 -91
- package/build/styles/sentimentSurface/SentimentSurface.css +1 -1
- package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +38 -12
- package/build/types/inputs/SelectInput.d.ts.map +1 -0
- package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
- package/build/types/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.d.ts → _BottomSheet.d.ts} +3 -3
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -0
- package/build/types/inputs/_ButtonInput.d.ts +5 -0
- package/build/types/inputs/_ButtonInput.d.ts.map +1 -0
- package/build/types/inputs/{SelectInput/Popover/SelectInputPopover.d.ts → _Popover.d.ts} +3 -3
- package/build/types/inputs/_Popover.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/inputs/{SelectInput/_stories/SelectInput.docs.mdx → SelectInput.docs.mdx} +1 -0
- package/src/inputs/SelectInput.less +219 -0
- package/src/inputs/{SelectInput/_stories/SelectInput.story.tsx → SelectInput.story.tsx} +8 -11
- package/src/inputs/{SelectInput/_stories/SelectInput.test.story.tsx → SelectInput.test.story.tsx} +10 -5
- package/src/inputs/{SelectInput/SelectInput.test.tsx → SelectInput.test.tsx} +11 -9
- package/src/inputs/SelectInput.tsx +1269 -0
- package/src/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.tsx → _BottomSheet.tsx} +7 -7
- package/src/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.tsx → _ButtonInput.tsx} +5 -5
- package/src/inputs/{SelectInput/Popover/SelectInputPopover.tsx → _Popover.tsx} +4 -4
- package/src/main.css +91 -91
- package/src/main.less +1 -1
- package/src/sentimentSurface/SentimentSurface.css +1 -1
- package/src/sentimentSurface/SentimentSurface.less +1 -1
- package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +0 -1
- package/build/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +0 -1
- package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.js.map +0 -1
- package/build/inputs/SelectInput/ButtonInput/SelectInputButtonInput.mjs.map +0 -1
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js +0 -27
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.js.map +0 -1
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs +0 -25
- package/build/inputs/SelectInput/ClearButton/SelectInputClearButton.mjs.map +0 -1
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js +0 -59
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js.map +0 -1
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs +0 -56
- package/build/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs.map +0 -1
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js +0 -50
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js.map +0 -1
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs +0 -48
- package/build/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.js +0 -47
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.js.map +0 -1
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs +0 -45
- package/build/inputs/SelectInput/ItemView/SelectInputItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/Option/SelectInputOption.js +0 -42
- package/build/inputs/SelectInput/Option/SelectInputOption.js.map +0 -1
- package/build/inputs/SelectInput/Option/SelectInputOption.mjs +0 -40
- package/build/inputs/SelectInput/Option/SelectInputOption.mjs.map +0 -1
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js +0 -40
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +0 -1
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +0 -38
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +0 -1
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js +0 -48
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js.map +0 -1
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs +0 -46
- package/build/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs.map +0 -1
- package/build/inputs/SelectInput/Options/SelectInputOptions.js +0 -300
- package/build/inputs/SelectInput/Options/SelectInputOptions.js.map +0 -1
- package/build/inputs/SelectInput/Options/SelectInputOptions.mjs +0 -298
- package/build/inputs/SelectInput/Options/SelectInputOptions.mjs.map +0 -1
- package/build/inputs/SelectInput/Popover/SelectInputPopover.js.map +0 -1
- package/build/inputs/SelectInput/Popover/SelectInputPopover.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.contexts.js +0 -29
- package/build/inputs/SelectInput/SelectInput.contexts.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.contexts.mjs +0 -24
- package/build/inputs/SelectInput/SelectInput.contexts.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.js +0 -222
- 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 -216
- package/build/inputs/SelectInput/SelectInput.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.utils.js +0 -164
- package/build/inputs/SelectInput/SelectInput.utils.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.utils.mjs +0 -154
- package/build/inputs/SelectInput/SelectInput.utils.mjs.map +0 -1
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js +0 -43
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +0 -1
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs +0 -37
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +0 -1
- package/build/styles/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +0 -96
- package/build/styles/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +0 -16
- package/build/styles/inputs/SelectInput/ClearButton/SelectInputClearButton.css +0 -46
- package/build/styles/inputs/SelectInput/ItemView/SelectInputItemView.css +0 -16
- package/build/styles/inputs/SelectInput/Option/SelectInputOption.css +0 -33
- package/build/styles/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
- package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +0 -81
- package/build/styles/inputs/SelectInput/Popover/SelectInputPopover.css +0 -46
- package/build/types/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/BottomSheet/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/BottomSheet/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts +0 -5
- package/build/types/inputs/SelectInput/ButtonInput/SelectInputButtonInput.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ButtonInput/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/ButtonInput/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts +0 -7
- package/build/types/inputs/SelectInput/ClearButton/SelectInputClearButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ClearButton/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/ClearButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts +0 -16
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/DefaultRenderTrigger/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts +0 -12
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/ItemView/GroupItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts +0 -14
- package/build/types/inputs/SelectInput/ItemView/SelectInputItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/ItemView/index.d.ts +0 -4
- package/build/types/inputs/SelectInput/ItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts +0 -14
- package/build/types/inputs/SelectInput/Option/SelectInputOption.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Option/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/Option/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +0 -16
- package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/OptionContent/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/OptionContent/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts +0 -12
- package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts +0 -21
- package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/index.d.ts +0 -4
- package/build/types/inputs/SelectInput/Options/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Popover/SelectInputPopover.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Popover/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/Popover/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts +0 -33
- package/build/types/inputs/SelectInput/SelectInput.contexts.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.d.ts +0 -10
- package/build/types/inputs/SelectInput/SelectInput.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/SelectInput.utils.d.ts +0 -61
- package/build/types/inputs/SelectInput/SelectInput.utils.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts +0 -18
- package/build/types/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/TriggerButton/index.d.ts +0 -3
- package/build/types/inputs/SelectInput/TriggerButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/components.d.ts +0 -10
- package/build/types/inputs/SelectInput/components.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/index.d.ts +0 -12
- package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
- package/src/inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +0 -96
- package/src/inputs/SelectInput/BottomSheet/index.ts +0 -2
- package/src/inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +0 -16
- package/src/inputs/SelectInput/ButtonInput/index.ts +0 -2
- package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.css +0 -46
- package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.less +0 -40
- package/src/inputs/SelectInput/ClearButton/SelectInputClearButton.tsx +0 -29
- package/src/inputs/SelectInput/ClearButton/index.ts +0 -2
- package/src/inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.tsx +0 -74
- package/src/inputs/SelectInput/DefaultRenderTrigger/index.ts +0 -5
- package/src/inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.tsx +0 -64
- package/src/inputs/SelectInput/ItemView/GroupItemView/index.ts +0 -2
- package/src/inputs/SelectInput/ItemView/SelectInputItemView.css +0 -16
- package/src/inputs/SelectInput/ItemView/SelectInputItemView.less +0 -17
- package/src/inputs/SelectInput/ItemView/SelectInputItemView.tsx +0 -51
- package/src/inputs/SelectInput/ItemView/index.ts +0 -3
- package/src/inputs/SelectInput/Option/SelectInputOption.css +0 -33
- package/src/inputs/SelectInput/Option/SelectInputOption.less +0 -32
- package/src/inputs/SelectInput/Option/SelectInputOption.tsx +0 -60
- package/src/inputs/SelectInput/Option/index.ts +0 -2
- package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
- package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.less +0 -38
- package/src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +0 -75
- package/src/inputs/SelectInput/OptionContent/index.ts +0 -2
- package/src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx +0 -62
- package/src/inputs/SelectInput/Options/OptionsContainer/index.ts +0 -2
- package/src/inputs/SelectInput/Options/SelectInputOptions.css +0 -81
- package/src/inputs/SelectInput/Options/SelectInputOptions.less +0 -77
- package/src/inputs/SelectInput/Options/SelectInputOptions.tsx +0 -418
- package/src/inputs/SelectInput/Options/index.ts +0 -3
- package/src/inputs/SelectInput/Popover/SelectInputPopover.css +0 -46
- package/src/inputs/SelectInput/Popover/index.ts +0 -2
- package/src/inputs/SelectInput/SelectInput.contexts.tsx +0 -40
- package/src/inputs/SelectInput/SelectInput.less +0 -22
- package/src/inputs/SelectInput/SelectInput.tsx +0 -258
- package/src/inputs/SelectInput/SelectInput.types.ts +0 -113
- package/src/inputs/SelectInput/SelectInput.utils.ts +0 -206
- package/src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +0 -44
- package/src/inputs/SelectInput/TriggerButton/index.ts +0 -5
- package/src/inputs/SelectInput/components.ts +0 -10
- package/src/inputs/SelectInput/index.ts +0 -14
- 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 +90 -90
- package/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
- package/{build/styles/inputs/SelectInput → src/inputs}/SelectInput.css +90 -90
- /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
- /package/src/inputs/{SelectInput/BottomSheet/SelectInputBottomSheet.less → _BottomSheet.less} +0 -0
- /package/src/inputs/{SelectInput/ButtonInput/SelectInputButtonInput.less → _ButtonInput.less} +0 -0
- /package/src/inputs/{SelectInput/Popover/SelectInputPopover.less → _Popover.less} +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
|
|
6
|
+
.np-select-input-content {
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
text-overflow: ellipsis;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.np-select-input-placeholder {
|
|
13
|
+
color: var(--color-content-tertiary);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.np-select-input-options-container {
|
|
17
|
+
display: flex;
|
|
18
|
+
height: 100%;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
|
|
21
|
+
&:focus {
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (--screen-sm) {
|
|
26
|
+
& {
|
|
27
|
+
max-height: 28rem /* 448px */;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.np-select-input-options-status {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
column-gap: var(--size-8);
|
|
36
|
+
padding: var(--size-8) var(--size-24) 0px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.np-select-input-options-status-icon {
|
|
40
|
+
padding: 0 var(--size-4);
|
|
41
|
+
color: var(--color-content-tertiary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.np-select-input-query-container {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
padding: var(--size-8);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.np-select-input-listbox-container {
|
|
51
|
+
position: relative;
|
|
52
|
+
height: var(--initial-height);
|
|
53
|
+
scroll-padding-top: var(--size-8);
|
|
54
|
+
scroll-padding-bottom: var(--size-8);
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
|
|
57
|
+
@media (--screen-sm) {
|
|
58
|
+
& {
|
|
59
|
+
height: auto;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&--virtualized {
|
|
64
|
+
/* The wrapping element shrinks this as needed */
|
|
65
|
+
height: 100vh;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--has-group {
|
|
69
|
+
scroll-padding-top: var(--size-32);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.np-select-input-listbox {
|
|
74
|
+
border-radius: var(--radius-small);
|
|
75
|
+
padding: var(--size-8);
|
|
76
|
+
|
|
77
|
+
.focus-ring();
|
|
78
|
+
--ring-outline-offset: calc(-1 * var(--ring-outline-width));
|
|
79
|
+
|
|
80
|
+
.np-select-input-listbox-container--virtualized & {
|
|
81
|
+
/* Adopted from `VList` in virtua: https://github.com/inokawa/virtua/blob/7f6ed5b37df6b480d4ff350f3960067c5b3519d2/src/react/VList.tsx#L113-L116 */
|
|
82
|
+
overflow-y: auto;
|
|
83
|
+
contain: strict;
|
|
84
|
+
height: 100%;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.np-select-input-separator-item {
|
|
89
|
+
margin: var(--size-8);
|
|
90
|
+
border-top-width: 1px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.np-select-input-group-item {
|
|
94
|
+
&--without-needle:first-child {
|
|
95
|
+
margin-top: calc(-1 * var(--size-8));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.np-select-input-group-item-header {
|
|
100
|
+
position: sticky;
|
|
101
|
+
top: 0px;
|
|
102
|
+
z-index: 10;
|
|
103
|
+
background-color: var(--color-background-elevated);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.np-select-input-option-container {
|
|
107
|
+
display: flex;
|
|
108
|
+
cursor: default;
|
|
109
|
+
user-select: none;
|
|
110
|
+
align-items: center;
|
|
111
|
+
column-gap: var(--size-8);
|
|
112
|
+
border-radius: var(--radius-small);
|
|
113
|
+
padding: var(--size-12) var(--size-16);
|
|
114
|
+
color: var(--color-interactive-primary);
|
|
115
|
+
|
|
116
|
+
&:focus {
|
|
117
|
+
outline: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&--active {
|
|
121
|
+
box-shadow: inset 0 0 0 1px var(--color-interactive-secondary);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&--disabled {
|
|
125
|
+
opacity: 0.45;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.np-select-input-option-check {
|
|
130
|
+
&--not-selected {
|
|
131
|
+
visibility: hidden;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.np-select-input-option {
|
|
136
|
+
flex: 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.np-select-input-option-content-container {
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
column-gap: var(--size-8);
|
|
143
|
+
color: var(--color-content-primary);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.np-select-input-option-content-icon {
|
|
147
|
+
display: flex;
|
|
148
|
+
|
|
149
|
+
&--not-within-trigger {
|
|
150
|
+
align-self: flex-start;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.np-select-input-option-content-text {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex: 1;
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
overflow: hidden;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.np-select-input-option-content-text-secondary {
|
|
162
|
+
color: var(--color-content-secondary);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.np-select-input-option-content-text-within-trigger {
|
|
166
|
+
overflow: hidden;
|
|
167
|
+
text-overflow: ellipsis;
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.np-select-input-option-content-text-line-1 {
|
|
172
|
+
> :not([hidden]) ~ :not([hidden]) {
|
|
173
|
+
margin-right: var(--size-8);
|
|
174
|
+
margin-left: var(--size-8);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.np-select-input-footer {
|
|
179
|
+
padding: var(--size-4) var(--size-24) var(--size-16);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.np-select-input-addon-container {
|
|
183
|
+
pointer-events: none;
|
|
184
|
+
margin-inline-start: var(--size-4);
|
|
185
|
+
display: inline-flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
|
|
188
|
+
& > :not([hidden]) ~ :not([hidden]) {
|
|
189
|
+
margin-inline-start: var(--size-4);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.np-select-input-addon {
|
|
194
|
+
border-width: 0;
|
|
195
|
+
background: none;
|
|
196
|
+
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
height: var(--size-24);
|
|
199
|
+
width: var(--size-24);
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: center;
|
|
202
|
+
border-radius: 0.125rem /* 2px */; /* TODO: Tokenize */
|
|
203
|
+
|
|
204
|
+
&--interactive {
|
|
205
|
+
pointer-events: auto;
|
|
206
|
+
color: var(--color-interactive-secondary);
|
|
207
|
+
|
|
208
|
+
&:hover {
|
|
209
|
+
color: var(--color-interactive-secondary-hover);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.focus-ring();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.np-select-input-addon-separator {
|
|
217
|
+
height: var(--size-24);
|
|
218
|
+
border-inline-start: 1px solid var(--color-border-neutral);
|
|
219
|
+
}
|
|
@@ -5,19 +5,19 @@ import { Flag } from '@wise/art';
|
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import Button from '
|
|
9
|
-
import { getMonthNames } from '
|
|
10
|
-
import Drawer from '
|
|
11
|
-
import { Field } from '
|
|
12
|
-
import Modal from '
|
|
13
|
-
import { wait } from '
|
|
8
|
+
import Button from '../button';
|
|
9
|
+
import { getMonthNames } from '../common/dateUtils';
|
|
10
|
+
import Drawer from '../drawer';
|
|
11
|
+
import { Field } from '../field/Field';
|
|
12
|
+
import Modal from '../modal';
|
|
13
|
+
import { wait } from '../test-utils/wait';
|
|
14
14
|
import {
|
|
15
15
|
SelectInput,
|
|
16
16
|
type SelectInputItem,
|
|
17
17
|
SelectInputOptionContent,
|
|
18
18
|
type SelectInputProps,
|
|
19
19
|
SelectInputTriggerButton,
|
|
20
|
-
} from '
|
|
20
|
+
} from './SelectInput';
|
|
21
21
|
|
|
22
22
|
const meta = {
|
|
23
23
|
title: 'Forms/SelectInput',
|
|
@@ -35,10 +35,7 @@ const meta = {
|
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
-
parameters: {
|
|
39
|
-
docs: { toc: true },
|
|
40
|
-
actions: { argTypesRegex: '' },
|
|
41
|
-
},
|
|
38
|
+
parameters: { actions: { argTypesRegex: '' } },
|
|
42
39
|
} satisfies Meta<typeof SelectInput>;
|
|
43
40
|
export default meta;
|
|
44
41
|
|
package/src/inputs/{SelectInput/_stories/SelectInput.test.story.tsx → SelectInput.test.story.tsx}
RENAMED
|
@@ -2,11 +2,16 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import { fireEvent, fn, type Mock, screen, userEvent, within } from 'storybook/test';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
|
|
5
|
-
import { allModes } from '
|
|
6
|
-
import Body from '
|
|
7
|
-
import { Field } from '
|
|
8
|
-
import { lorem5, lorem500 } from '
|
|
9
|
-
import {
|
|
5
|
+
import { allModes } from '../../.storybook/modes';
|
|
6
|
+
import Body from '../body';
|
|
7
|
+
import { Field } from '../field/Field';
|
|
8
|
+
import { lorem5, lorem500 } from '../test-utils';
|
|
9
|
+
import {
|
|
10
|
+
SelectInput,
|
|
11
|
+
SelectInputOptionContent,
|
|
12
|
+
type SelectInputProps,
|
|
13
|
+
sortByRelevance,
|
|
14
|
+
} from './SelectInput';
|
|
10
15
|
|
|
11
16
|
const meta = {
|
|
12
17
|
title: 'Forms/SelectInput/Tests',
|
|
@@ -2,15 +2,15 @@ import { screen, waitFor, within } from '@testing-library/react';
|
|
|
2
2
|
import { userEvent } from '@testing-library/user-event';
|
|
3
3
|
import { mockAnimationsApi } from 'jsdom-testing-mocks';
|
|
4
4
|
|
|
5
|
-
import { render, mockMatchMedia, mockResizeObserver } from '
|
|
5
|
+
import { render, mockMatchMedia, mockResizeObserver } from '../test-utils';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
SelectInput,
|
|
9
9
|
SelectInputOptionContent,
|
|
10
10
|
type SelectInputOptionItem,
|
|
11
11
|
type SelectInputProps,
|
|
12
|
-
} from '
|
|
13
|
-
import { Field } from '
|
|
12
|
+
} from './SelectInput';
|
|
13
|
+
import { Field } from '../field/Field';
|
|
14
14
|
|
|
15
15
|
mockMatchMedia();
|
|
16
16
|
mockResizeObserver();
|
|
@@ -40,7 +40,7 @@ describe('SelectInput', () => {
|
|
|
40
40
|
]}
|
|
41
41
|
renderFooter={({ queryNormalized: normalizedQuery }) =>
|
|
42
42
|
normalizedQuery != null ? (
|
|
43
|
-
<>Showing results for
|
|
43
|
+
<>Showing results for ‘{normalizedQuery}’</>
|
|
44
44
|
) : (
|
|
45
45
|
<>All items shown</>
|
|
46
46
|
)
|
|
@@ -56,16 +56,16 @@ describe('SelectInput', () => {
|
|
|
56
56
|
expect(footer).toBeInTheDocument();
|
|
57
57
|
|
|
58
58
|
await userEvent.keyboard('u');
|
|
59
|
-
expect(footer).toHaveTextContent(
|
|
59
|
+
expect(footer).toHaveTextContent(/‘u’$/);
|
|
60
60
|
|
|
61
61
|
await userEvent.keyboard('r');
|
|
62
|
-
expect(footer).toHaveTextContent(
|
|
62
|
+
expect(footer).toHaveTextContent(/‘ur’$/);
|
|
63
63
|
|
|
64
64
|
await userEvent.keyboard('x');
|
|
65
|
-
expect(footer).toHaveTextContent(
|
|
65
|
+
expect(footer).toHaveTextContent(/‘urx’$/);
|
|
66
66
|
|
|
67
67
|
await userEvent.keyboard('{Backspace}');
|
|
68
|
-
expect(footer).toHaveTextContent(
|
|
68
|
+
expect(footer).toHaveTextContent(/‘ur’$/);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
it('allows navigating the listbox with cursors', async () => {
|
|
@@ -76,7 +76,9 @@ describe('SelectInput', () => {
|
|
|
76
76
|
{ type: 'option', value: 'EUR' },
|
|
77
77
|
{ type: 'option', value: 'USD' },
|
|
78
78
|
]}
|
|
79
|
-
renderFooter={() =>
|
|
79
|
+
renderFooter={({ queryNormalized: normalizedQuery }) => (
|
|
80
|
+
<button type="button">Footer button</button>
|
|
81
|
+
)}
|
|
80
82
|
filterable
|
|
81
83
|
/>,
|
|
82
84
|
);
|