@transferwise/components 0.0.0-experimental-bcfa03a → 0.0.0-experimental-5cd0315
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 +840 -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 +832 -0
- package/build/inputs/SelectInput.mjs.map +1 -0
- package/build/main.css +70 -65
- 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/inputs/{SelectInput/SelectInput.css → SelectInput.css} +70 -65
- package/build/styles/main.css +70 -65
- package/build/types/inputs/{SelectInput/SelectInput.types.d.ts → SelectInput.d.ts} +7 -10
- package/build/types/inputs/SelectInput.d.ts.map +1 -0
- package/build/types/inputs/SelectInput.messages.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/inputs/{SelectInput/SelectInput.css → SelectInput.css} +70 -65
- 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 +1209 -0
- package/src/main.css +70 -65
- package/src/main.less +1 -1
- package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.js +0 -26
- package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.js.map +0 -1
- package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.mjs +0 -24
- package/build/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.mjs.map +0 -1
- package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.js +0 -54
- package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.js.map +0 -1
- package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.mjs +0 -52
- package/build/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.mjs.map +0 -1
- package/build/inputs/SelectInput/OptionContent/SelectInputOptionContent.js +0 -41
- 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/GroupItemView/SelectInputGroupItemView.js +0 -50
- package/build/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.js.map +0 -1
- package/build/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.mjs +0 -48
- package/build/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.mjs.map +0 -1
- package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.js +0 -45
- package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.js.map +0 -1
- package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.mjs +0 -41
- package/build/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.mjs.map +0 -1
- package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.js +0 -50
- package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.js.map +0 -1
- package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.mjs +0 -48
- package/build/inputs/SelectInput/Options/ItemView/SelectInputItemView.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 -270
- package/build/inputs/SelectInput/Options/SelectInputOptions.js.map +0 -1
- package/build/inputs/SelectInput/Options/SelectInputOptions.mjs +0 -268
- package/build/inputs/SelectInput/Options/SelectInputOptions.mjs.map +0 -1
- package/build/inputs/SelectInput/SelectInput.constants.js +0 -6
- package/build/inputs/SelectInput/SelectInput.constants.js.map +0 -1
- package/build/inputs/SelectInput/SelectInput.constants.mjs +0 -4
- package/build/inputs/SelectInput/SelectInput.constants.mjs.map +0 -1
- 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/TriggerButton/SelectInputTriggerButton.js +0 -41
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +0 -1
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs +0 -34
- package/build/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +0 -1
- package/build/styles/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.css +0 -17
- package/build/styles/inputs/SelectInput/OptionContent/SelectInputOptionContent.css +0 -37
- package/build/styles/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.css +0 -33
- package/build/styles/inputs/SelectInput/Options/ItemView/SelectInputItemView.css +0 -44
- package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +0 -125
- package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.d.ts +0 -5
- package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/DefaultTrigger/ClearButton/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.d.ts +0 -9
- package/build/types/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/DefaultTrigger/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/DefaultTrigger/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/OptionContent/SelectInputOptionContent.d.ts +0 -9
- 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/GroupItemView/SelectInputGroupItemView.d.ts +0 -3
- package/build/types/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/GroupItemView/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/Options/GroupItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.d.ts +0 -10
- package/build/types/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/ItemView/Option/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/Options/ItemView/Option/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/ItemView/SelectInputItemView.d.ts +0 -3
- package/build/types/inputs/SelectInput/Options/ItemView/SelectInputItemView.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/ItemView/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/Options/ItemView/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts +0 -6
- package/build/types/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/Options/OptionsContainer/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts +0 -15
- package/build/types/inputs/SelectInput/Options/SelectInputOptions.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/Options/index.d.ts +0 -2
- package/build/types/inputs/SelectInput/Options/index.d.ts.map +0 -1
- package/build/types/inputs/SelectInput/SelectInput.constants.d.ts +0 -2
- package/build/types/inputs/SelectInput/SelectInput.constants.d.ts.map +0 -1
- 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/TriggerButton/SelectInputTriggerButton.d.ts +0 -15
- 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/index.d.ts +0 -5
- package/build/types/inputs/SelectInput/index.d.ts.map +0 -1
- package/src/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.tsx +0 -25
- package/src/inputs/SelectInput/DefaultTrigger/ClearButton/index.ts +0 -1
- package/src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.css +0 -17
- package/src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.less +0 -15
- package/src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.tsx +0 -56
- package/src/inputs/SelectInput/DefaultTrigger/index.ts +0 -1
- 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 -67
- package/src/inputs/SelectInput/OptionContent/index.ts +0 -5
- package/src/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.tsx +0 -53
- package/src/inputs/SelectInput/Options/GroupItemView/index.ts +0 -1
- package/src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.css +0 -33
- package/src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.less +0 -32
- package/src/inputs/SelectInput/Options/ItemView/Option/SelectInputOption.tsx +0 -51
- package/src/inputs/SelectInput/Options/ItemView/Option/index.ts +0 -5
- package/src/inputs/SelectInput/Options/ItemView/SelectInputItemView.css +0 -44
- package/src/inputs/SelectInput/Options/ItemView/SelectInputItemView.less +0 -14
- package/src/inputs/SelectInput/Options/ItemView/SelectInputItemView.tsx +0 -37
- package/src/inputs/SelectInput/Options/ItemView/index.ts +0 -1
- package/src/inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.tsx +0 -55
- package/src/inputs/SelectInput/Options/OptionsContainer/index.ts +0 -1
- package/src/inputs/SelectInput/Options/SelectInputOptions.css +0 -125
- package/src/inputs/SelectInput/Options/SelectInputOptions.less +0 -78
- package/src/inputs/SelectInput/Options/SelectInputOptions.tsx +0 -372
- package/src/inputs/SelectInput/Options/index.ts +0 -1
- package/src/inputs/SelectInput/SelectInput.constants.ts +0 -1
- package/src/inputs/SelectInput/SelectInput.helpers.ts +0 -152
- package/src/inputs/SelectInput/SelectInput.less +0 -40
- 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 -127
- package/src/inputs/SelectInput/TriggerButton/SelectInputTriggerButton.tsx +0 -39
- package/src/inputs/SelectInput/TriggerButton/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/build/types/inputs/{SelectInput/SelectInput.messages.d.ts → SelectInput.messages.d.ts} +0 -0
- /package/src/inputs/{SelectInput/SelectInput.messages.ts → SelectInput.messages.ts} +0 -0
package/src/main.css
CHANGED
|
@@ -3976,49 +3976,27 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3976
3976
|
color: #5d7079;
|
|
3977
3977
|
color: var(--color-content-secondary);
|
|
3978
3978
|
}
|
|
3979
|
-
.np-select-input-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
-
|
|
3983
|
-
-moz-user-select: none;
|
|
3984
|
-
user-select: none;
|
|
3985
|
-
align-items: center;
|
|
3986
|
-
-moz-column-gap: 8px;
|
|
3987
|
-
column-gap: 8px;
|
|
3988
|
-
-moz-column-gap: var(--size-8);
|
|
3989
|
-
column-gap: var(--size-8);
|
|
3990
|
-
border-radius: 10px;
|
|
3991
|
-
border-radius: var(--radius-small);
|
|
3992
|
-
padding: 12px 16px;
|
|
3993
|
-
padding: var(--size-12) var(--size-16);
|
|
3994
|
-
color: var(--color-interactive-primary);
|
|
3995
|
-
}
|
|
3996
|
-
.np-select-input-option-container:focus {
|
|
3997
|
-
outline: none;
|
|
3998
|
-
}
|
|
3999
|
-
.np-select-input-option-container--active {
|
|
4000
|
-
box-shadow: inset 0 0 0 1px #c9cbce;
|
|
4001
|
-
box-shadow: inset 0 0 0 1px var(--color-interactive-secondary);
|
|
4002
|
-
}
|
|
4003
|
-
.np-select-input-option-container--disabled {
|
|
4004
|
-
opacity: 0.45;
|
|
3979
|
+
.np-select-input-content {
|
|
3980
|
+
overflow: hidden;
|
|
3981
|
+
text-overflow: ellipsis;
|
|
3982
|
+
white-space: nowrap;
|
|
4005
3983
|
}
|
|
4006
|
-
.np-select-input-
|
|
4007
|
-
|
|
3984
|
+
.np-select-input-placeholder {
|
|
3985
|
+
color: #768e9c;
|
|
3986
|
+
color: var(--color-content-tertiary);
|
|
4008
3987
|
}
|
|
4009
|
-
.np-select-input-
|
|
4010
|
-
|
|
3988
|
+
.np-select-input-options-container {
|
|
3989
|
+
display: flex;
|
|
3990
|
+
height: 100%;
|
|
3991
|
+
flex-direction: column;
|
|
4011
3992
|
}
|
|
4012
|
-
.np-select-input-
|
|
4013
|
-
|
|
4014
|
-
margin-top: calc(-1 * var(--size-8));
|
|
3993
|
+
.np-select-input-options-container:focus {
|
|
3994
|
+
outline: none;
|
|
4015
3995
|
}
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
background-color: #ffffff;
|
|
4021
|
-
background-color: var(--color-background-elevated);
|
|
3996
|
+
@media (min-width: 576px) {
|
|
3997
|
+
.np-select-input-options-container {
|
|
3998
|
+
max-height: 28rem /* 448px */;
|
|
3999
|
+
}
|
|
4022
4000
|
}
|
|
4023
4001
|
.np-select-input-options-status {
|
|
4024
4002
|
display: flex;
|
|
@@ -4084,22 +4062,54 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
4084
4062
|
contain: strict;
|
|
4085
4063
|
height: 100%;
|
|
4086
4064
|
}
|
|
4087
|
-
.np-select-input-
|
|
4065
|
+
.np-select-input-separator-item {
|
|
4066
|
+
margin: 8px;
|
|
4067
|
+
margin: var(--size-8);
|
|
4068
|
+
border-top-width: 1px;
|
|
4069
|
+
}
|
|
4070
|
+
.np-select-input-group-item--without-needle:first-child {
|
|
4071
|
+
margin-top: calc(-1 * 8px);
|
|
4072
|
+
margin-top: calc(-1 * var(--size-8));
|
|
4073
|
+
}
|
|
4074
|
+
.np-select-input-group-item-header {
|
|
4075
|
+
position: sticky;
|
|
4076
|
+
top: 0px;
|
|
4077
|
+
z-index: 10;
|
|
4078
|
+
background-color: #ffffff;
|
|
4079
|
+
background-color: var(--color-background-elevated);
|
|
4080
|
+
}
|
|
4081
|
+
.np-select-input-option-container {
|
|
4088
4082
|
display: flex;
|
|
4089
|
-
|
|
4090
|
-
|
|
4083
|
+
cursor: default;
|
|
4084
|
+
-webkit-user-select: none;
|
|
4085
|
+
-moz-user-select: none;
|
|
4086
|
+
user-select: none;
|
|
4087
|
+
align-items: center;
|
|
4088
|
+
-moz-column-gap: 8px;
|
|
4089
|
+
column-gap: 8px;
|
|
4090
|
+
-moz-column-gap: var(--size-8);
|
|
4091
|
+
column-gap: var(--size-8);
|
|
4092
|
+
border-radius: 10px;
|
|
4093
|
+
border-radius: var(--radius-small);
|
|
4094
|
+
padding: 12px 16px;
|
|
4095
|
+
padding: var(--size-12) var(--size-16);
|
|
4096
|
+
color: var(--color-interactive-primary);
|
|
4091
4097
|
}
|
|
4092
|
-
.np-select-input-
|
|
4098
|
+
.np-select-input-option-container:focus {
|
|
4093
4099
|
outline: none;
|
|
4094
4100
|
}
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
}
|
|
4101
|
+
.np-select-input-option-container--active {
|
|
4102
|
+
box-shadow: inset 0 0 0 1px #c9cbce;
|
|
4103
|
+
box-shadow: inset 0 0 0 1px var(--color-interactive-secondary);
|
|
4099
4104
|
}
|
|
4100
|
-
.np-select-input-
|
|
4101
|
-
|
|
4102
|
-
|
|
4105
|
+
.np-select-input-option-container--disabled {
|
|
4106
|
+
opacity: 0.45;
|
|
4107
|
+
}
|
|
4108
|
+
.np-select-input-option-check--not-selected {
|
|
4109
|
+
visibility: hidden;
|
|
4110
|
+
}
|
|
4111
|
+
.np-select-input-option {
|
|
4112
|
+
flex: 1;
|
|
4103
4113
|
}
|
|
4104
4114
|
.np-select-input-option-content-container {
|
|
4105
4115
|
display: flex;
|
|
@@ -4138,6 +4148,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
4138
4148
|
margin-left: 8px;
|
|
4139
4149
|
margin-left: var(--size-8);
|
|
4140
4150
|
}
|
|
4151
|
+
.np-select-input-footer {
|
|
4152
|
+
padding: 4px 24px 16px;
|
|
4153
|
+
padding: var(--size-4) var(--size-24) var(--size-16);
|
|
4154
|
+
}
|
|
4141
4155
|
.np-select-input-addon-container {
|
|
4142
4156
|
pointer-events: none;
|
|
4143
4157
|
margin-inline-start: 4px;
|
|
@@ -4149,21 +4163,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
4149
4163
|
margin-inline-start: 4px;
|
|
4150
4164
|
margin-inline-start: var(--size-4);
|
|
4151
4165
|
}
|
|
4152
|
-
.np-select-input-addon-separator {
|
|
4153
|
-
height: 24px;
|
|
4154
|
-
height: var(--size-24);
|
|
4155
|
-
border-inline-start: 1px solid rgba(0,0,0,0.10196);
|
|
4156
|
-
border-inline-start: 1px solid var(--color-border-neutral);
|
|
4157
|
-
}
|
|
4158
|
-
.np-select-input-content {
|
|
4159
|
-
overflow: hidden;
|
|
4160
|
-
text-overflow: ellipsis;
|
|
4161
|
-
white-space: nowrap;
|
|
4162
|
-
}
|
|
4163
|
-
.np-select-input-placeholder {
|
|
4164
|
-
color: #768e9c;
|
|
4165
|
-
color: var(--color-content-tertiary);
|
|
4166
|
-
}
|
|
4167
4166
|
.np-select-input-addon {
|
|
4168
4167
|
border-width: 0;
|
|
4169
4168
|
background: none;
|
|
@@ -4193,6 +4192,12 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
4193
4192
|
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
4194
4193
|
outline-offset: var(--ring-outline-offset);
|
|
4195
4194
|
}
|
|
4195
|
+
.np-select-input-addon-separator {
|
|
4196
|
+
height: 24px;
|
|
4197
|
+
height: var(--size-24);
|
|
4198
|
+
border-inline-start: 1px solid rgba(0,0,0,0.10196);
|
|
4199
|
+
border-inline-start: 1px solid var(--color-border-neutral);
|
|
4200
|
+
}
|
|
4196
4201
|
.np-text-area {
|
|
4197
4202
|
min-height: 72px;
|
|
4198
4203
|
min-height: var(--size-72);
|
package/src/main.less
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
@import "./listItem/ListItem.less";
|
|
45
45
|
@import "./field/Field.less";
|
|
46
46
|
@import "./inputs/InputGroup.less";
|
|
47
|
-
@import "./inputs/SelectInput
|
|
47
|
+
@import "./inputs/SelectInput.less";
|
|
48
48
|
@import "./inputs/TextArea.less";
|
|
49
49
|
@import "./instructionsList/InstructionsList.less";
|
|
50
50
|
@import "./link/Link.less";
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var icons = require('@transferwise/icons');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var reactIntl = require('react-intl');
|
|
6
|
-
var DateTrigger_messages = require('../../../../dateLookup/dateTrigger/DateTrigger.messages.js');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
function SelectInputClearButton({
|
|
10
|
-
className,
|
|
11
|
-
onClick
|
|
12
|
-
}) {
|
|
13
|
-
const intl = reactIntl.useIntl();
|
|
14
|
-
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
15
|
-
type: "button",
|
|
16
|
-
"aria-label": intl.formatMessage(DateTrigger_messages.default.ariaLabel),
|
|
17
|
-
className: clsx.clsx(className, 'np-select-input-addon np-select-input-addon--interactive'),
|
|
18
|
-
onClick: onClick,
|
|
19
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {
|
|
20
|
-
size: 16
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
exports.SelectInputClearButton = SelectInputClearButton;
|
|
26
|
-
//# sourceMappingURL=SelectInputClearButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputClearButton.js","sources":["../../../../../src/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport dateTriggerMessages from '../../../../dateLookup/dateTrigger/DateTrigger.messages';\n\ninterface SelectInputClearButtonProps extends Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'className' | 'onClick'\n> {}\n\nexport function SelectInputClearButton({ className, onClick }: SelectInputClearButtonProps) {\n const intl = useIntl();\n\n return (\n <button\n type=\"button\"\n aria-label={intl.formatMessage(dateTriggerMessages.ariaLabel)}\n className={clsx(className, 'np-select-input-addon np-select-input-addon--interactive')}\n onClick={onClick}\n >\n <Cross size={16} />\n </button>\n );\n}\n"],"names":["SelectInputClearButton","className","onClick","intl","useIntl","_jsx","type","formatMessage","dateTriggerMessages","ariaLabel","clsx","children","Cross","size"],"mappings":";;;;;;;;SAWgBA,sBAAsBA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAO,CAA+B,EAAA;AACxF,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;AAEtB,EAAA,oBACEC,cAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,YAAA,EAAYH,IAAI,CAACI,aAAa,CAACC,4BAAmB,CAACC,SAAS,CAAE;AAC9DR,IAAAA,SAAS,EAAES,SAAI,CAACT,SAAS,EAAE,0DAA0D,CAAE;AACvFC,IAAAA,OAAO,EAAEA,OAAQ;IAAAS,QAAA,eAEjBN,cAAA,CAACO,WAAK,EAAA;AAACC,MAAAA,IAAI,EAAE;KAAG;AAClB,GAAQ,CAAC;AAEb;;;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Cross } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { useIntl } from 'react-intl';
|
|
4
|
-
import messages from '../../../../dateLookup/dateTrigger/DateTrigger.messages.mjs';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function SelectInputClearButton({
|
|
8
|
-
className,
|
|
9
|
-
onClick
|
|
10
|
-
}) {
|
|
11
|
-
const intl = useIntl();
|
|
12
|
-
return /*#__PURE__*/jsx("button", {
|
|
13
|
-
type: "button",
|
|
14
|
-
"aria-label": intl.formatMessage(messages.ariaLabel),
|
|
15
|
-
className: clsx(className, 'np-select-input-addon np-select-input-addon--interactive'),
|
|
16
|
-
onClick: onClick,
|
|
17
|
-
children: /*#__PURE__*/jsx(Cross, {
|
|
18
|
-
size: 16
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { SelectInputClearButton };
|
|
24
|
-
//# sourceMappingURL=SelectInputClearButton.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputClearButton.mjs","sources":["../../../../../src/inputs/SelectInput/DefaultTrigger/ClearButton/SelectInputClearButton.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport dateTriggerMessages from '../../../../dateLookup/dateTrigger/DateTrigger.messages';\n\ninterface SelectInputClearButtonProps extends Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'className' | 'onClick'\n> {}\n\nexport function SelectInputClearButton({ className, onClick }: SelectInputClearButtonProps) {\n const intl = useIntl();\n\n return (\n <button\n type=\"button\"\n aria-label={intl.formatMessage(dateTriggerMessages.ariaLabel)}\n className={clsx(className, 'np-select-input-addon np-select-input-addon--interactive')}\n onClick={onClick}\n >\n <Cross size={16} />\n </button>\n );\n}\n"],"names":["SelectInputClearButton","className","onClick","intl","useIntl","_jsx","type","formatMessage","dateTriggerMessages","ariaLabel","clsx","children","Cross","size"],"mappings":";;;;;;SAWgBA,sBAAsBA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAO,CAA+B,EAAA;AACxF,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtB,EAAA,oBACEC,GAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,YAAA,EAAYH,IAAI,CAACI,aAAa,CAACC,QAAmB,CAACC,SAAS,CAAE;AAC9DR,IAAAA,SAAS,EAAES,IAAI,CAACT,SAAS,EAAE,0DAA0D,CAAE;AACvFC,IAAAA,OAAO,EAAEA,OAAQ;IAAAS,QAAA,eAEjBN,GAAA,CAACO,KAAK,EAAA;AAACC,MAAAA,IAAI,EAAE;KAAG;AAClB,GAAQ,CAAC;AAEb;;;;"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var icons = require('@transferwise/icons');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var _ButtonInput = require('../../_ButtonInput.js');
|
|
6
|
-
var InputGroup = require('../../InputGroup.js');
|
|
7
|
-
var SelectInputTriggerButton = require('../TriggerButton/SelectInputTriggerButton.js');
|
|
8
|
-
var SelectInputClearButton = require('./ClearButton/SelectInputClearButton.js');
|
|
9
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
-
|
|
11
|
-
const SelectInputDefaultTrigger = ({
|
|
12
|
-
content,
|
|
13
|
-
placeholderShown,
|
|
14
|
-
clear,
|
|
15
|
-
disabled,
|
|
16
|
-
size,
|
|
17
|
-
className
|
|
18
|
-
}) => /*#__PURE__*/jsxRuntime.jsx(InputGroup.InputGroup, {
|
|
19
|
-
addonEnd: {
|
|
20
|
-
content: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
21
|
-
className: clsx.clsx('np-select-input-addon-container', disabled && 'disabled'),
|
|
22
|
-
children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
23
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(SelectInputClearButton.SelectInputClearButton, {
|
|
24
|
-
onClick: event => {
|
|
25
|
-
event.preventDefault();
|
|
26
|
-
clear();
|
|
27
|
-
}
|
|
28
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
29
|
-
className: "np-select-input-addon-separator"
|
|
30
|
-
})]
|
|
31
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
32
|
-
className: "np-select-input-addon",
|
|
33
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronDown, {
|
|
34
|
-
size: 16
|
|
35
|
-
})
|
|
36
|
-
})]
|
|
37
|
-
}),
|
|
38
|
-
initialContentWidth: 24 + 4,
|
|
39
|
-
padding: 'sm'
|
|
40
|
-
},
|
|
41
|
-
disabled: disabled,
|
|
42
|
-
className: className,
|
|
43
|
-
children: /*#__PURE__*/jsxRuntime.jsx(SelectInputTriggerButton.SelectInputTriggerButton, {
|
|
44
|
-
as: _ButtonInput.ButtonInput,
|
|
45
|
-
size: size,
|
|
46
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
47
|
-
className: clsx.clsx('np-select-input-content', placeholderShown && 'np-select-input-placeholder'),
|
|
48
|
-
children: content
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
exports.SelectInputDefaultTrigger = SelectInputDefaultTrigger;
|
|
54
|
-
//# sourceMappingURL=SelectInputDefaultTrigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputDefaultTrigger.js","sources":["../../../../src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { ButtonInput } from '../../_ButtonInput';\nimport { InputGroup } from '../../InputGroup';\nimport { SelectInputTriggerButton } from '../TriggerButton';\nimport type { SelectInputProps } from '../SelectInput.types';\nimport { SelectInputClearButton } from './ClearButton';\n\nexport const SelectInputDefaultTrigger = (({\n content,\n placeholderShown,\n clear,\n disabled,\n size,\n className,\n}) => (\n <InputGroup\n addonEnd={{\n content: (\n <span className={clsx('np-select-input-addon-container', disabled && 'disabled')}>\n {clear != null && !placeholderShown ? (\n <>\n <SelectInputClearButton\n onClick={(event) => {\n event.preventDefault();\n clear();\n }}\n />\n <span className=\"np-select-input-addon-separator\" />\n </>\n ) : null}\n\n <span className=\"np-select-input-addon\">\n <ChevronDown size={16} />\n </span>\n </span>\n ),\n initialContentWidth: 24 + 4,\n padding: 'sm',\n }}\n disabled={disabled}\n className={className}\n >\n <SelectInputTriggerButton as={ButtonInput} size={size}>\n <span\n className={clsx(\n 'np-select-input-content',\n placeholderShown && 'np-select-input-placeholder',\n )}\n >\n {content}\n </span>\n </SelectInputTriggerButton>\n </InputGroup>\n)) satisfies SelectInputProps['renderTrigger'];\n"],"names":["SelectInputDefaultTrigger","content","placeholderShown","clear","disabled","size","className","_jsx","InputGroup","addonEnd","_jsxs","clsx","children","_Fragment","SelectInputClearButton","onClick","event","preventDefault","ChevronDown","initialContentWidth","padding","SelectInputTriggerButton","as","ButtonInput"],"mappings":";;;;;;;;;;AASO,MAAMA,yBAAyB,GAAIA,CAAC;EACzCC,OAAO;EACPC,gBAAgB;EAChBC,KAAK;EACLC,QAAQ;EACRC,IAAI;AACJC,EAAAA;AAAS,CACV,kBACCC,cAAA,CAACC,qBAAU,EAAA;AACTC,EAAAA,QAAQ,EAAE;AACRR,IAAAA,OAAO,eACLS,eAAA,CAAA,MAAA,EAAA;MAAMJ,SAAS,EAAEK,SAAI,CAAC,iCAAiC,EAAEP,QAAQ,IAAI,UAAU,CAAE;MAAAQ,QAAA,EAAA,CAC9ET,KAAK,IAAI,IAAI,IAAI,CAACD,gBAAgB,gBACjCQ,eAAA,CAAAG,mBAAA,EAAA;QAAAD,QAAA,EAAA,cACEL,cAAA,CAACO,6CAAsB,EAAA;UACrBC,OAAO,EAAGC,KAAK,IAAI;YACjBA,KAAK,CAACC,cAAc,EAAE;AACtBd,YAAAA,KAAK,EAAE;AACT,UAAA;SAAE,CAEJ,eAAAI,cAAA,CAAA,MAAA,EAAA;AAAMD,UAAAA,SAAS,EAAC;AAAiC,SAAA,CACnD;AAAA,OAAA,CAAG,GACD,IAAI,eAERC,cAAA,CAAA,MAAA,EAAA;AAAMD,QAAAA,SAAS,EAAC,uBAAuB;QAAAM,QAAA,eACrCL,cAAA,CAACW,iBAAW,EAAA;AAACb,UAAAA,IAAI,EAAE;SAAG;AACxB,OAAM,CACR;AAAA,KAAM,CACP;IACDc,mBAAmB,EAAE,EAAE,GAAG,CAAC;AAC3BC,IAAAA,OAAO,EAAE;GACT;AACFhB,EAAAA,QAAQ,EAAEA,QAAS;AACnBE,EAAAA,SAAS,EAAEA,SAAU;EAAAM,QAAA,eAErBL,cAAA,CAACc,iDAAwB,EAAA;AAACC,IAAAA,EAAE,EAAEC,wBAAY;AAAClB,IAAAA,IAAI,EAAEA,IAAK;AAAAO,IAAAA,QAAA,eACpDL,cAAA,CAAA,MAAA,EAAA;MACED,SAAS,EAAEK,SAAI,CACb,yBAAyB,EACzBT,gBAAgB,IAAI,6BAA6B,CACjD;AAAAU,MAAAA,QAAA,EAEDX;KACG;GACkB;AAC5B,CAAY;;;;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ChevronDown } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { ButtonInput } from '../../_ButtonInput.mjs';
|
|
4
|
-
import { InputGroup } from '../../InputGroup.mjs';
|
|
5
|
-
import { SelectInputTriggerButton } from '../TriggerButton/SelectInputTriggerButton.mjs';
|
|
6
|
-
import { SelectInputClearButton } from './ClearButton/SelectInputClearButton.mjs';
|
|
7
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
const SelectInputDefaultTrigger = ({
|
|
10
|
-
content,
|
|
11
|
-
placeholderShown,
|
|
12
|
-
clear,
|
|
13
|
-
disabled,
|
|
14
|
-
size,
|
|
15
|
-
className
|
|
16
|
-
}) => /*#__PURE__*/jsx(InputGroup, {
|
|
17
|
-
addonEnd: {
|
|
18
|
-
content: /*#__PURE__*/jsxs("span", {
|
|
19
|
-
className: clsx('np-select-input-addon-container', disabled && 'disabled'),
|
|
20
|
-
children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxs(Fragment, {
|
|
21
|
-
children: [/*#__PURE__*/jsx(SelectInputClearButton, {
|
|
22
|
-
onClick: event => {
|
|
23
|
-
event.preventDefault();
|
|
24
|
-
clear();
|
|
25
|
-
}
|
|
26
|
-
}), /*#__PURE__*/jsx("span", {
|
|
27
|
-
className: "np-select-input-addon-separator"
|
|
28
|
-
})]
|
|
29
|
-
}) : null, /*#__PURE__*/jsx("span", {
|
|
30
|
-
className: "np-select-input-addon",
|
|
31
|
-
children: /*#__PURE__*/jsx(ChevronDown, {
|
|
32
|
-
size: 16
|
|
33
|
-
})
|
|
34
|
-
})]
|
|
35
|
-
}),
|
|
36
|
-
initialContentWidth: 24 + 4,
|
|
37
|
-
padding: 'sm'
|
|
38
|
-
},
|
|
39
|
-
disabled: disabled,
|
|
40
|
-
className: className,
|
|
41
|
-
children: /*#__PURE__*/jsx(SelectInputTriggerButton, {
|
|
42
|
-
as: ButtonInput,
|
|
43
|
-
size: size,
|
|
44
|
-
children: /*#__PURE__*/jsx("span", {
|
|
45
|
-
className: clsx('np-select-input-content', placeholderShown && 'np-select-input-placeholder'),
|
|
46
|
-
children: content
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export { SelectInputDefaultTrigger };
|
|
52
|
-
//# sourceMappingURL=SelectInputDefaultTrigger.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputDefaultTrigger.mjs","sources":["../../../../src/inputs/SelectInput/DefaultTrigger/SelectInputDefaultTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { ButtonInput } from '../../_ButtonInput';\nimport { InputGroup } from '../../InputGroup';\nimport { SelectInputTriggerButton } from '../TriggerButton';\nimport type { SelectInputProps } from '../SelectInput.types';\nimport { SelectInputClearButton } from './ClearButton';\n\nexport const SelectInputDefaultTrigger = (({\n content,\n placeholderShown,\n clear,\n disabled,\n size,\n className,\n}) => (\n <InputGroup\n addonEnd={{\n content: (\n <span className={clsx('np-select-input-addon-container', disabled && 'disabled')}>\n {clear != null && !placeholderShown ? (\n <>\n <SelectInputClearButton\n onClick={(event) => {\n event.preventDefault();\n clear();\n }}\n />\n <span className=\"np-select-input-addon-separator\" />\n </>\n ) : null}\n\n <span className=\"np-select-input-addon\">\n <ChevronDown size={16} />\n </span>\n </span>\n ),\n initialContentWidth: 24 + 4,\n padding: 'sm',\n }}\n disabled={disabled}\n className={className}\n >\n <SelectInputTriggerButton as={ButtonInput} size={size}>\n <span\n className={clsx(\n 'np-select-input-content',\n placeholderShown && 'np-select-input-placeholder',\n )}\n >\n {content}\n </span>\n </SelectInputTriggerButton>\n </InputGroup>\n)) satisfies SelectInputProps['renderTrigger'];\n"],"names":["SelectInputDefaultTrigger","content","placeholderShown","clear","disabled","size","className","_jsx","InputGroup","addonEnd","_jsxs","clsx","children","_Fragment","SelectInputClearButton","onClick","event","preventDefault","ChevronDown","initialContentWidth","padding","SelectInputTriggerButton","as","ButtonInput"],"mappings":";;;;;;;;AASO,MAAMA,yBAAyB,GAAIA,CAAC;EACzCC,OAAO;EACPC,gBAAgB;EAChBC,KAAK;EACLC,QAAQ;EACRC,IAAI;AACJC,EAAAA;AAAS,CACV,kBACCC,GAAA,CAACC,UAAU,EAAA;AACTC,EAAAA,QAAQ,EAAE;AACRR,IAAAA,OAAO,eACLS,IAAA,CAAA,MAAA,EAAA;MAAMJ,SAAS,EAAEK,IAAI,CAAC,iCAAiC,EAAEP,QAAQ,IAAI,UAAU,CAAE;MAAAQ,QAAA,EAAA,CAC9ET,KAAK,IAAI,IAAI,IAAI,CAACD,gBAAgB,gBACjCQ,IAAA,CAAAG,QAAA,EAAA;QAAAD,QAAA,EAAA,cACEL,GAAA,CAACO,sBAAsB,EAAA;UACrBC,OAAO,EAAGC,KAAK,IAAI;YACjBA,KAAK,CAACC,cAAc,EAAE;AACtBd,YAAAA,KAAK,EAAE;AACT,UAAA;SAAE,CAEJ,eAAAI,GAAA,CAAA,MAAA,EAAA;AAAMD,UAAAA,SAAS,EAAC;AAAiC,SAAA,CACnD;AAAA,OAAA,CAAG,GACD,IAAI,eAERC,GAAA,CAAA,MAAA,EAAA;AAAMD,QAAAA,SAAS,EAAC,uBAAuB;QAAAM,QAAA,eACrCL,GAAA,CAACW,WAAW,EAAA;AAACb,UAAAA,IAAI,EAAE;SAAG;AACxB,OAAM,CACR;AAAA,KAAM,CACP;IACDc,mBAAmB,EAAE,EAAE,GAAG,CAAC;AAC3BC,IAAAA,OAAO,EAAE;GACT;AACFhB,EAAAA,QAAQ,EAAEA,QAAS;AACnBE,EAAAA,SAAS,EAAEA,SAAU;EAAAM,QAAA,eAErBL,GAAA,CAACc,wBAAwB,EAAA;AAACC,IAAAA,EAAE,EAAEC,WAAY;AAAClB,IAAAA,IAAI,EAAEA,IAAK;AAAAO,IAAAA,QAAA,eACpDL,GAAA,CAAA,MAAA,EAAA;MACED,SAAS,EAAEK,IAAI,CACb,yBAAyB,EACzBT,gBAAgB,IAAI,6BAA6B,CACjD;AAAAU,MAAAA,QAAA,EAEDX;KACG;GACkB;AAC5B,CAAY;;;;"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var clsx = require('clsx');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
|
|
7
|
-
const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/React.createContext(false);
|
|
8
|
-
function SelectInputOptionContent({
|
|
9
|
-
title,
|
|
10
|
-
note,
|
|
11
|
-
description,
|
|
12
|
-
icon
|
|
13
|
-
}) {
|
|
14
|
-
const withinTrigger = React.useContext(SelectInputOptionContentWithinTriggerContext);
|
|
15
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
16
|
-
className: clsx.clsx('np-select-input-option-content-container', (note || description) && 'np-text-body-large'),
|
|
17
|
-
children: [icon ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
18
|
-
className: clsx.clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
19
|
-
children: icon
|
|
20
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
21
|
-
className: "np-select-input-option-content-text",
|
|
22
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
23
|
-
className: clsx.clsx('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
24
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
25
|
-
className: "d-inline",
|
|
26
|
-
children: title
|
|
27
|
-
}), note ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
28
|
-
className: "np-select-input-option-content-text-secondary np-text-body-default",
|
|
29
|
-
children: note
|
|
30
|
-
}) : null]
|
|
31
|
-
}), description ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32
|
-
className: clsx.clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
33
|
-
children: description
|
|
34
|
-
}) : null]
|
|
35
|
-
})]
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
exports.SelectInputOptionContent = SelectInputOptionContent;
|
|
40
|
-
exports.SelectInputOptionContentWithinTriggerContext = SelectInputOptionContentWithinTriggerContext;
|
|
41
|
-
//# sourceMappingURL=SelectInputOptionContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionContent.js","sources":["../../../../src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext, createContext } from 'react';\n\nexport const SelectInputOptionContentWithinTriggerContext = createContext(false);\n\nexport interface SelectInputOptionContentProps {\n title: string;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n}\n\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'np-text-body-large',\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary np-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary np-text-body-default',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContentWithinTriggerContext","createContext","SelectInputOptionContent","title","note","description","icon","withinTrigger","useContext","_jsxs","className","clsx","children","_jsx"],"mappings":";;;;;;MAGaA,4CAA4C,gBAAGC,mBAAa,CAAC,KAAK;AASzE,SAAUC,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAI,CAC0B,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,gBAAU,CAACR,4CAA4C,CAAC;AAE9E,EAAA,oBACES,eAAA,CAAA,KAAA,EAAA;IACEC,SAAS,EAAEC,SAAI,CACb,0CAA0C,EAC1C,CAACP,IAAI,IAAIC,WAAW,KAAK,oBAAoB,CAC7C;IAAAO,QAAA,EAAA,CAEDN,IAAI,gBACHO,cAAA,CAAA,KAAA,EAAA;MACEH,SAAS,EAAEC,SAAI,CACb,qCAAqC,EACrC,CAACJ,aAAa,IAAI,yDAAyD,CAC3E;AAAAK,MAAAA,QAAA,EAEDN;AAAI,KACF,CAAC,GACJ,IAAI,eAERG,eAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,qCAAqC;AAAAE,MAAAA,QAAA,gBAClDH,eAAA,CAAA,KAAA,EAAA;QACEC,SAAS,EAAEC,SAAI,CACb,4CAA4C,EAC5CJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,gBAEFC,cAAA,CAAA,KAAA,EAAA;AAAKH,UAAAA,SAAS,EAAC,UAAU;AAAAE,UAAAA,QAAA,EAAET;AAAK,SAAM,CACtC,EAACC,IAAI,gBACHS,cAAA,CAAA,MAAA,EAAA;AAAMH,UAAAA,SAAS,EAAC,oEAAoE;AAAAE,UAAAA,QAAA,EACjFR;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVQ,cAAA,CAAA,KAAA,EAAA;QACEH,SAAS,EAAEC,SAAI,CACb,oEAAoE,EACpEJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,EAEDP;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;;;;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/createContext(false);
|
|
6
|
-
function SelectInputOptionContent({
|
|
7
|
-
title,
|
|
8
|
-
note,
|
|
9
|
-
description,
|
|
10
|
-
icon
|
|
11
|
-
}) {
|
|
12
|
-
const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);
|
|
13
|
-
return /*#__PURE__*/jsxs("div", {
|
|
14
|
-
className: clsx('np-select-input-option-content-container', (note || description) && 'np-text-body-large'),
|
|
15
|
-
children: [icon ? /*#__PURE__*/jsx("div", {
|
|
16
|
-
className: clsx('np-select-input-option-content-icon', !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger'),
|
|
17
|
-
children: icon
|
|
18
|
-
}) : null, /*#__PURE__*/jsxs("div", {
|
|
19
|
-
className: "np-select-input-option-content-text",
|
|
20
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
21
|
-
className: clsx('np-select-input-option-content-text-line-1', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
22
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
23
|
-
className: "d-inline",
|
|
24
|
-
children: title
|
|
25
|
-
}), note ? /*#__PURE__*/jsx("span", {
|
|
26
|
-
className: "np-select-input-option-content-text-secondary np-text-body-default",
|
|
27
|
-
children: note
|
|
28
|
-
}) : null]
|
|
29
|
-
}), description ? /*#__PURE__*/jsx("div", {
|
|
30
|
-
className: clsx('np-select-input-option-content-text-secondary np-text-body-default', withinTrigger && 'np-select-input-option-content-text-within-trigger'),
|
|
31
|
-
children: description
|
|
32
|
-
}) : null]
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { SelectInputOptionContent, SelectInputOptionContentWithinTriggerContext };
|
|
38
|
-
//# sourceMappingURL=SelectInputOptionContent.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputOptionContent.mjs","sources":["../../../../src/inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useContext, createContext } from 'react';\n\nexport const SelectInputOptionContentWithinTriggerContext = createContext(false);\n\nexport interface SelectInputOptionContentProps {\n title: string;\n note?: string;\n description?: string;\n icon?: React.ReactNode;\n}\n\nexport function SelectInputOptionContent({\n title,\n note,\n description,\n icon,\n}: SelectInputOptionContentProps) {\n const withinTrigger = useContext(SelectInputOptionContentWithinTriggerContext);\n\n return (\n <div\n className={clsx(\n 'np-select-input-option-content-container',\n (note || description) && 'np-text-body-large',\n )}\n >\n {icon ? (\n <div\n className={clsx(\n 'np-select-input-option-content-icon',\n !withinTrigger && 'np-select-input-option-content-icon--not-within-trigger',\n )}\n >\n {icon}\n </div>\n ) : null}\n\n <div className=\"np-select-input-option-content-text\">\n <div\n className={clsx(\n 'np-select-input-option-content-text-line-1',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n <div className=\"d-inline\">{title}</div>\n {note ? (\n <span className=\"np-select-input-option-content-text-secondary np-text-body-default\">\n {note}\n </span>\n ) : null}\n </div>\n\n {description ? (\n <div\n className={clsx(\n 'np-select-input-option-content-text-secondary np-text-body-default',\n withinTrigger && 'np-select-input-option-content-text-within-trigger',\n )}\n >\n {description}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["SelectInputOptionContentWithinTriggerContext","createContext","SelectInputOptionContent","title","note","description","icon","withinTrigger","useContext","_jsxs","className","clsx","children","_jsx"],"mappings":";;;;MAGaA,4CAA4C,gBAAGC,aAAa,CAAC,KAAK;AASzE,SAAUC,wBAAwBA,CAAC;EACvCC,KAAK;EACLC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAI,CAC0B,EAAA;AAC9B,EAAA,MAAMC,aAAa,GAAGC,UAAU,CAACR,4CAA4C,CAAC;AAE9E,EAAA,oBACES,IAAA,CAAA,KAAA,EAAA;IACEC,SAAS,EAAEC,IAAI,CACb,0CAA0C,EAC1C,CAACP,IAAI,IAAIC,WAAW,KAAK,oBAAoB,CAC7C;IAAAO,QAAA,EAAA,CAEDN,IAAI,gBACHO,GAAA,CAAA,KAAA,EAAA;MACEH,SAAS,EAAEC,IAAI,CACb,qCAAqC,EACrC,CAACJ,aAAa,IAAI,yDAAyD,CAC3E;AAAAK,MAAAA,QAAA,EAEDN;AAAI,KACF,CAAC,GACJ,IAAI,eAERG,IAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,qCAAqC;AAAAE,MAAAA,QAAA,gBAClDH,IAAA,CAAA,KAAA,EAAA;QACEC,SAAS,EAAEC,IAAI,CACb,4CAA4C,EAC5CJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,gBAEFC,GAAA,CAAA,KAAA,EAAA;AAAKH,UAAAA,SAAS,EAAC,UAAU;AAAAE,UAAAA,QAAA,EAAET;AAAK,SAAM,CACtC,EAACC,IAAI,gBACHS,GAAA,CAAA,MAAA,EAAA;AAAMH,UAAAA,SAAS,EAAC,oEAAoE;AAAAE,UAAAA,QAAA,EACjFR;SACG,CAAC,GACL,IAAI;AAAA,OACL,CAEL,EAACC,WAAW,gBACVQ,GAAA,CAAA,KAAA,EAAA;QACEH,SAAS,EAAEC,IAAI,CACb,oEAAoE,EACpEJ,aAAa,IAAI,oDAAoD,CACrE;AAAAK,QAAAA,QAAA,EAEDP;OACE,CAAC,GACJ,IAAI;AAAA,KACL,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var clsx = require('clsx');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var Header = require('../../../../header/Header.js');
|
|
6
|
-
var Section = require('../../../../section/Section.js');
|
|
7
|
-
var SelectInputItemView = require('../ItemView/SelectInputItemView.js');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
function SelectInputGroupItemView({
|
|
11
|
-
item,
|
|
12
|
-
renderValue,
|
|
13
|
-
needle
|
|
14
|
-
}) {
|
|
15
|
-
const headerId = React.useId();
|
|
16
|
-
const header = /*#__PURE__*/jsxRuntime.jsx(Header.default, {
|
|
17
|
-
as: "header",
|
|
18
|
-
role: "none",
|
|
19
|
-
id: headerId,
|
|
20
|
-
title: item.label
|
|
21
|
-
// @ts-expect-error when we migrate ActionButton to new Button this should be sorted
|
|
22
|
-
,
|
|
23
|
-
action: item.action && {
|
|
24
|
-
text: item.action.label,
|
|
25
|
-
onClick: item.action.onClick
|
|
26
|
-
},
|
|
27
|
-
className: "np-select-input-group-item-header p-x-1"
|
|
28
|
-
});
|
|
29
|
-
return (
|
|
30
|
-
/*#__PURE__*/
|
|
31
|
-
// An empty container may be rendered when no options match `needle`
|
|
32
|
-
// However, pre-filtering would result in worse performance overall
|
|
33
|
-
jsxRuntime.jsxs(Section.default, {
|
|
34
|
-
as: "section",
|
|
35
|
-
role: "group",
|
|
36
|
-
"aria-labelledby": headerId,
|
|
37
|
-
className: clsx.clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle'),
|
|
38
|
-
children: [needle == null ? header : null, item.options.map((option, index) => /*#__PURE__*/jsxRuntime.jsx(SelectInputItemView.SelectInputItemView
|
|
39
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
40
|
-
, {
|
|
41
|
-
item: option,
|
|
42
|
-
renderValue: renderValue,
|
|
43
|
-
needle: needle
|
|
44
|
-
}, index))]
|
|
45
|
-
})
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
exports.SelectInputGroupItemView = SelectInputGroupItemView;
|
|
50
|
-
//# sourceMappingURL=SelectInputGroupItemView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputGroupItemView.js","sources":["../../../../../src/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\nimport Header from '../../../../header';\nimport Section from '../../../../section';\nimport type { SelectInputGroupItemViewProps } from '../../SelectInput.types';\nimport { SelectInputItemView } from '../ItemView';\n\nexport function SelectInputGroupItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputGroupItemViewProps<T>) {\n const headerId = useId();\n\n const header = (\n <Header\n as=\"header\"\n role=\"none\"\n id={headerId}\n title={item.label}\n // @ts-expect-error when we migrate ActionButton to new Button this should be sorted\n action={\n item.action && {\n text: item.action.label,\n onClick: item.action.onClick,\n }\n }\n className=\"np-select-input-group-item-header p-x-1\"\n />\n );\n\n return (\n // An empty container may be rendered when no options match `needle`\n // However, pre-filtering would result in worse performance overall\n <Section\n as=\"section\"\n role=\"group\"\n aria-labelledby={headerId}\n className={clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle')}\n >\n {needle == null ? header : null}\n {item.options.map((option, index) => (\n <SelectInputItemView\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n item={option}\n renderValue={renderValue}\n needle={needle}\n />\n ))}\n </Section>\n );\n}\n"],"names":["SelectInputGroupItemView","item","renderValue","needle","headerId","useId","header","_jsx","Header","as","role","id","title","label","action","text","onClick","className","_jsxs","Section","clsx","children","options","map","option","index","SelectInputItemView"],"mappings":";;;;;;;;;AAOM,SAAUA,wBAAwBA,CAAa;EACnDC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CAC2B,EAAA;AACjC,EAAA,MAAMC,QAAQ,GAAGC,WAAK,EAAE;AAExB,EAAA,MAAMC,MAAM,gBACVC,cAAA,CAACC,cAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,QAAQ;AACXC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,EAAE,EAAEP,QAAS;IACbQ,KAAK,EAAEX,IAAI,CAACY;AACZ;AAAA;AACAC,IAAAA,MAAM,EACJb,IAAI,CAACa,MAAM,IAAI;AACbC,MAAAA,IAAI,EAAEd,IAAI,CAACa,MAAM,CAACD,KAAK;AACvBG,MAAAA,OAAO,EAAEf,IAAI,CAACa,MAAM,CAACE;KAExB;AACDC,IAAAA,SAAS,EAAC;AAAyC,GAAA,CAEtD;AAED,EAAA;AAAA;AACE;AACA;AACAC,IAAAA,eAAA,CAACC,eAAO,EAAA;AACNV,MAAAA,EAAE,EAAC,SAAS;AACZC,MAAAA,IAAI,EAAC,OAAO;AACZ,MAAA,iBAAA,EAAiBN,QAAS;MAC1Ba,SAAS,EAAEG,SAAI,CAAC,OAAO,EAAEjB,MAAM,KAAK,IAAI,IAAI,4CAA4C,CAAE;MAAAkB,QAAA,EAAA,CAEzFlB,MAAM,IAAI,IAAI,GAAGG,MAAM,GAAG,IAAI,EAC9BL,IAAI,CAACqB,OAAO,CAACC,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,kBAC9BlB,cAAA,CAACmB;AACC;AAAA,QAAA;AAEAzB,QAAAA,IAAI,EAAEuB,MAAO;AACbtB,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,MAAM,EAAEA;OAAO,EAHVsB,KAGU,CAElB,CAAC;KACK;AAAC;AAEd;;;;"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { useId } from 'react';
|
|
3
|
-
import Header from '../../../../header/Header.mjs';
|
|
4
|
-
import Section from '../../../../section/Section.mjs';
|
|
5
|
-
import { SelectInputItemView } from '../ItemView/SelectInputItemView.mjs';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function SelectInputGroupItemView({
|
|
9
|
-
item,
|
|
10
|
-
renderValue,
|
|
11
|
-
needle
|
|
12
|
-
}) {
|
|
13
|
-
const headerId = useId();
|
|
14
|
-
const header = /*#__PURE__*/jsx(Header, {
|
|
15
|
-
as: "header",
|
|
16
|
-
role: "none",
|
|
17
|
-
id: headerId,
|
|
18
|
-
title: item.label
|
|
19
|
-
// @ts-expect-error when we migrate ActionButton to new Button this should be sorted
|
|
20
|
-
,
|
|
21
|
-
action: item.action && {
|
|
22
|
-
text: item.action.label,
|
|
23
|
-
onClick: item.action.onClick
|
|
24
|
-
},
|
|
25
|
-
className: "np-select-input-group-item-header p-x-1"
|
|
26
|
-
});
|
|
27
|
-
return (
|
|
28
|
-
/*#__PURE__*/
|
|
29
|
-
// An empty container may be rendered when no options match `needle`
|
|
30
|
-
// However, pre-filtering would result in worse performance overall
|
|
31
|
-
jsxs(Section, {
|
|
32
|
-
as: "section",
|
|
33
|
-
role: "group",
|
|
34
|
-
"aria-labelledby": headerId,
|
|
35
|
-
className: clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle'),
|
|
36
|
-
children: [needle == null ? header : null, item.options.map((option, index) => /*#__PURE__*/jsx(SelectInputItemView
|
|
37
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
38
|
-
, {
|
|
39
|
-
item: option,
|
|
40
|
-
renderValue: renderValue,
|
|
41
|
-
needle: needle
|
|
42
|
-
}, index))]
|
|
43
|
-
})
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { SelectInputGroupItemView };
|
|
48
|
-
//# sourceMappingURL=SelectInputGroupItemView.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInputGroupItemView.mjs","sources":["../../../../../src/inputs/SelectInput/Options/GroupItemView/SelectInputGroupItemView.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId } from 'react';\nimport Header from '../../../../header';\nimport Section from '../../../../section';\nimport type { SelectInputGroupItemViewProps } from '../../SelectInput.types';\nimport { SelectInputItemView } from '../ItemView';\n\nexport function SelectInputGroupItemView<T = string>({\n item,\n renderValue,\n needle,\n}: SelectInputGroupItemViewProps<T>) {\n const headerId = useId();\n\n const header = (\n <Header\n as=\"header\"\n role=\"none\"\n id={headerId}\n title={item.label}\n // @ts-expect-error when we migrate ActionButton to new Button this should be sorted\n action={\n item.action && {\n text: item.action.label,\n onClick: item.action.onClick,\n }\n }\n className=\"np-select-input-group-item-header p-x-1\"\n />\n );\n\n return (\n // An empty container may be rendered when no options match `needle`\n // However, pre-filtering would result in worse performance overall\n <Section\n as=\"section\"\n role=\"group\"\n aria-labelledby={headerId}\n className={clsx('m-y-0', needle === null && 'np-select-input-group-item--without-needle')}\n >\n {needle == null ? header : null}\n {item.options.map((option, index) => (\n <SelectInputItemView\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n item={option}\n renderValue={renderValue}\n needle={needle}\n />\n ))}\n </Section>\n );\n}\n"],"names":["SelectInputGroupItemView","item","renderValue","needle","headerId","useId","header","_jsx","Header","as","role","id","title","label","action","text","onClick","className","_jsxs","Section","clsx","children","options","map","option","index","SelectInputItemView"],"mappings":";;;;;;;AAOM,SAAUA,wBAAwBA,CAAa;EACnDC,IAAI;EACJC,WAAW;AACXC,EAAAA;AAAM,CAC2B,EAAA;AACjC,EAAA,MAAMC,QAAQ,GAAGC,KAAK,EAAE;AAExB,EAAA,MAAMC,MAAM,gBACVC,GAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,QAAQ;AACXC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,EAAE,EAAEP,QAAS;IACbQ,KAAK,EAAEX,IAAI,CAACY;AACZ;AAAA;AACAC,IAAAA,MAAM,EACJb,IAAI,CAACa,MAAM,IAAI;AACbC,MAAAA,IAAI,EAAEd,IAAI,CAACa,MAAM,CAACD,KAAK;AACvBG,MAAAA,OAAO,EAAEf,IAAI,CAACa,MAAM,CAACE;KAExB;AACDC,IAAAA,SAAS,EAAC;AAAyC,GAAA,CAEtD;AAED,EAAA;AAAA;AACE;AACA;AACAC,IAAAA,IAAA,CAACC,OAAO,EAAA;AACNV,MAAAA,EAAE,EAAC,SAAS;AACZC,MAAAA,IAAI,EAAC,OAAO;AACZ,MAAA,iBAAA,EAAiBN,QAAS;MAC1Ba,SAAS,EAAEG,IAAI,CAAC,OAAO,EAAEjB,MAAM,KAAK,IAAI,IAAI,4CAA4C,CAAE;MAAAkB,QAAA,EAAA,CAEzFlB,MAAM,IAAI,IAAI,GAAGG,MAAM,GAAG,IAAI,EAC9BL,IAAI,CAACqB,OAAO,CAACC,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,kBAC9BlB,GAAA,CAACmB;AACC;AAAA,QAAA;AAEAzB,QAAAA,IAAI,EAAEuB,MAAO;AACbtB,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,MAAM,EAAEA;OAAO,EAHVsB,KAGU,CAElB,CAAC;KACK;AAAC;AAEd;;;;"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var react = require('@headlessui/react');
|
|
5
|
-
var icons = require('@transferwise/icons');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
const SelectInputItemsCountContext = /*#__PURE__*/React.createContext(undefined);
|
|
10
|
-
const SelectInputItemPositionContext = /*#__PURE__*/React.createContext(undefined);
|
|
11
|
-
function SelectInputOption({
|
|
12
|
-
value,
|
|
13
|
-
disabled,
|
|
14
|
-
children
|
|
15
|
-
}) {
|
|
16
|
-
const itemsCount = React.useContext(SelectInputItemsCountContext);
|
|
17
|
-
const itemPosition = React.useContext(SelectInputItemPositionContext);
|
|
18
|
-
return /*#__PURE__*/jsxRuntime.jsx(react.ListboxOption, {
|
|
19
|
-
as: "div",
|
|
20
|
-
value: value,
|
|
21
|
-
"aria-setsize": itemsCount,
|
|
22
|
-
"aria-posinset": itemPosition,
|
|
23
|
-
disabled: disabled,
|
|
24
|
-
className: ({
|
|
25
|
-
active,
|
|
26
|
-
disabled: uiDisabled
|
|
27
|
-
}) => clsx.clsx('np-select-input-option-container np-text-body-large', active && 'np-select-input-option-container--active', uiDisabled && 'np-select-input-option-container--disabled'),
|
|
28
|
-
children: ({
|
|
29
|
-
selected
|
|
30
|
-
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
32
|
-
className: "np-select-input-option",
|
|
33
|
-
children: children
|
|
34
|
-
}), /*#__PURE__*/jsxRuntime.jsx(icons.Check, {
|
|
35
|
-
size: 16,
|
|
36
|
-
className: clsx.clsx('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
|
|
37
|
-
})]
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
exports.SelectInputItemPositionContext = SelectInputItemPositionContext;
|
|
43
|
-
exports.SelectInputItemsCountContext = SelectInputItemsCountContext;
|
|
44
|
-
exports.SelectInputOption = SelectInputOption;
|
|
45
|
-
//# sourceMappingURL=SelectInputOption.js.map
|