@transferwise/components 0.0.0-experimental-bcfa03a → 0.0.0-experimental-3cdcd93
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 +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/tabs/Tabs.js +14 -171
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +16 -173
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tabs/utils.js +0 -18
- package/build/tabs/utils.js.map +1 -1
- package/build/tabs/utils.mjs +1 -17
- package/build/tabs/utils.mjs.map +1 -1
- 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/build/types/tabs/Tabs.d.ts +2 -24
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/tabs/utils.d.ts +0 -2
- package/build/types/tabs/utils.d.ts.map +1 -1
- package/package.json +3 -4
- 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 +1190 -0
- package/src/main.css +70 -65
- package/src/main.less +1 -1
- package/src/tabs/Tabs.story.tsx +1 -45
- package/src/tabs/Tabs.test.tsx +0 -22
- package/src/tabs/Tabs.tsx +23 -240
- package/src/tabs/utils.test.ts +0 -58
- package/src/tabs/utils.ts +0 -20
- 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/build/styles/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/build/tabs/Tabs.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var web = require('@react-spring/web');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
6
|
var clamp = require('lodash.clamp');
|
|
8
7
|
var React = require('react');
|
|
@@ -40,17 +39,9 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
40
39
|
var clamp__default = /*#__PURE__*/_interopDefault(clamp);
|
|
41
40
|
|
|
42
41
|
const MIN_INDEX = 0;
|
|
43
|
-
const SpacerWidth = {
|
|
44
|
-
default: 0,
|
|
45
|
-
xs: 8,
|
|
46
|
-
sm: 16,
|
|
47
|
-
md: 24,
|
|
48
|
-
lg: 32
|
|
49
|
-
};
|
|
50
42
|
class Tabs extends React.Component {
|
|
51
43
|
static defaultProps = {
|
|
52
44
|
changeTabOnSwipe: true,
|
|
53
|
-
transitionSpacing: 'default',
|
|
54
45
|
headerWidth: width.Width.BLOCK
|
|
55
46
|
};
|
|
56
47
|
containerReference = /*#__PURE__*/React.createRef();
|
|
@@ -58,25 +49,15 @@ class Tabs extends React.Component {
|
|
|
58
49
|
super(props);
|
|
59
50
|
this.state = {
|
|
60
51
|
start: null,
|
|
61
|
-
translateX: 0,
|
|
62
|
-
translateFrom: 0,
|
|
63
|
-
translateTo: 0,
|
|
64
52
|
translateLineX: null,
|
|
65
|
-
isAnimating: false,
|
|
66
53
|
isSwiping: false,
|
|
67
54
|
isScrolling: false,
|
|
68
|
-
|
|
69
|
-
fullWidthTabs: props.headerWidth === width.Width.BLOCK,
|
|
70
|
-
currentSwipe: [],
|
|
71
|
-
selectedTabIndex: props.selected
|
|
55
|
+
fullWidthTabs: props.headerWidth === width.Width.BLOCK
|
|
72
56
|
};
|
|
73
57
|
}
|
|
74
58
|
container = null;
|
|
75
59
|
containerWidth = 0;
|
|
76
60
|
tabRefs = [];
|
|
77
|
-
get filteredTabsLength() {
|
|
78
|
-
return this.props.tabs.filter(tab => !tab.disabled).length;
|
|
79
|
-
}
|
|
80
61
|
get MAX_INDEX() {
|
|
81
62
|
return this.props.tabs.length - 1;
|
|
82
63
|
}
|
|
@@ -86,7 +67,7 @@ class Tabs extends React.Component {
|
|
|
86
67
|
} = this.props;
|
|
87
68
|
this.setTabWidth();
|
|
88
69
|
this.switchTab(clamp__default.default(selected, MIN_INDEX, this.MAX_INDEX));
|
|
89
|
-
this.
|
|
70
|
+
this.animateLine(clamp__default.default(selected, MIN_INDEX, this.MAX_INDEX));
|
|
90
71
|
document.body.addEventListener('touchmove', this.disableScroll, {
|
|
91
72
|
passive: false
|
|
92
73
|
});
|
|
@@ -95,7 +76,7 @@ class Tabs extends React.Component {
|
|
|
95
76
|
});
|
|
96
77
|
window.addEventListener('resize', this.handleResize);
|
|
97
78
|
}
|
|
98
|
-
componentDidUpdate(previousProps
|
|
79
|
+
componentDidUpdate(previousProps) {
|
|
99
80
|
const currentSelected = this.props.selected;
|
|
100
81
|
const previousSelected = previousProps.selected;
|
|
101
82
|
const currentSelectedTab = this.props.tabs[currentSelected];
|
|
@@ -108,15 +89,11 @@ class Tabs extends React.Component {
|
|
|
108
89
|
const previousDisabledTabsLength = previousProps.tabs.filter(tab => !tab.disabled).length;
|
|
109
90
|
const currentHeaderWidth = this.props.headerWidth;
|
|
110
91
|
const previousFullHeaderWidth = previousProps.headerWidth;
|
|
111
|
-
const {
|
|
112
|
-
animatePanelsOnClick
|
|
113
|
-
} = this.props;
|
|
114
|
-
const instantOnClick = !animatePanelsOnClick && !previousState.isSwiping;
|
|
115
92
|
if (currentHeaderWidth !== previousFullHeaderWidth || currentTabsLength !== previousTabsLength) {
|
|
116
93
|
this.setTabWidth();
|
|
117
94
|
}
|
|
118
95
|
if (currentSelected !== previousSelected || currentDisabledTabsLength !== previousDisabledTabsLength || currentSelectedTabIsDisabled !== previousSelectedTabIsDisabled) {
|
|
119
|
-
this.
|
|
96
|
+
this.animateLine(clamp__default.default(currentSelected, MIN_INDEX, this.MAX_INDEX));
|
|
120
97
|
}
|
|
121
98
|
}
|
|
122
99
|
componentWillUnmount() {
|
|
@@ -126,11 +103,6 @@ class Tabs extends React.Component {
|
|
|
126
103
|
}
|
|
127
104
|
handleResize = () => {
|
|
128
105
|
this.setContainerWidth(this.container);
|
|
129
|
-
this.setState(({
|
|
130
|
-
selectedTabIndex
|
|
131
|
-
}) => ({
|
|
132
|
-
translateTo: -(this.containerWidth * selectedTabIndex)
|
|
133
|
-
}));
|
|
134
106
|
};
|
|
135
107
|
setContainerRefAndWidth = node => {
|
|
136
108
|
this.container = node;
|
|
@@ -220,60 +192,17 @@ class Tabs extends React.Component {
|
|
|
220
192
|
return nextSelected;
|
|
221
193
|
};
|
|
222
194
|
swipedOverHalfOfContainer = difference => difference / this.containerWidth >= 0.5;
|
|
223
|
-
calculateApplicableDragDifference = ({
|
|
224
|
-
currentSelected,
|
|
225
|
-
nextSelected,
|
|
226
|
-
start,
|
|
227
|
-
end
|
|
228
|
-
}) => {
|
|
229
|
-
const difference = utils.getSwipeDifference(start, end);
|
|
230
|
-
const elasticDrag = utils.getElasticDragDifference(difference);
|
|
231
|
-
if (utils.swipedLeftToRight(start, end)) {
|
|
232
|
-
if (currentSelected > MIN_INDEX && currentSelected !== nextSelected) {
|
|
233
|
-
return Math.min(difference, this.containerWidth);
|
|
234
|
-
}
|
|
235
|
-
return elasticDrag;
|
|
236
|
-
}
|
|
237
|
-
if (utils.swipedRightToLeft(start, end)) {
|
|
238
|
-
if (currentSelected < this.MAX_INDEX && currentSelected !== nextSelected) {
|
|
239
|
-
return -Math.min(difference, this.containerWidth);
|
|
240
|
-
}
|
|
241
|
-
return -elasticDrag;
|
|
242
|
-
}
|
|
243
|
-
return false;
|
|
244
|
-
};
|
|
245
195
|
switchTab = index => {
|
|
246
196
|
const {
|
|
247
197
|
onTabSelect
|
|
248
198
|
} = this.props;
|
|
249
199
|
onTabSelect(index);
|
|
250
200
|
};
|
|
251
|
-
getTabIndexWithoutDisabledTabs(index) {
|
|
252
|
-
return index - this.props.tabs.slice(0, index).filter(tab => tab.disabled).length;
|
|
253
|
-
}
|
|
254
|
-
animateToTab = (index, instant) => {
|
|
255
|
-
this.animateLine(index);
|
|
256
|
-
this.animatePanel(this.getTabIndexWithoutDisabledTabs(index), instant);
|
|
257
|
-
};
|
|
258
201
|
animateLine = index => {
|
|
259
202
|
this.setState(previousState => ({
|
|
260
203
|
translateLineX: previousState.fullWidthTabs ? `${index * 100}%` : `${this.getDistanceToSelectedTab(index)}px`
|
|
261
204
|
}));
|
|
262
205
|
};
|
|
263
|
-
// Pass `instant` to set the `translateX` to the new panel with no transition
|
|
264
|
-
animatePanel = (index, instant = false) => {
|
|
265
|
-
const {
|
|
266
|
-
translateTo: currentTranslateTo
|
|
267
|
-
} = this.state;
|
|
268
|
-
const translateFrom = currentTranslateTo;
|
|
269
|
-
const translateTo = -(this.containerWidth * index);
|
|
270
|
-
this.setState({
|
|
271
|
-
selectedTabIndex: index,
|
|
272
|
-
isAnimating: !instant && translateFrom !== translateTo,
|
|
273
|
-
translateFrom,
|
|
274
|
-
translateTo
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
206
|
disableScroll = event => {
|
|
278
207
|
const {
|
|
279
208
|
isSwiping
|
|
@@ -297,10 +226,8 @@ class Tabs extends React.Component {
|
|
|
297
226
|
time: Date.now()
|
|
298
227
|
};
|
|
299
228
|
this.setState({
|
|
300
|
-
start
|
|
301
|
-
currentSwipe: [start]
|
|
229
|
+
start
|
|
302
230
|
});
|
|
303
|
-
event.persist();
|
|
304
231
|
};
|
|
305
232
|
handleTouchMove = event => {
|
|
306
233
|
const {
|
|
@@ -312,7 +239,6 @@ class Tabs extends React.Component {
|
|
|
312
239
|
const {
|
|
313
240
|
selected: currentSelectedFromProps
|
|
314
241
|
} = this.props;
|
|
315
|
-
const selected = this.getTabIndexWithoutDisabledTabs(currentSelectedFromProps);
|
|
316
242
|
const end = {
|
|
317
243
|
x: event.nativeEvent.changedTouches[0].clientX,
|
|
318
244
|
y: event.nativeEvent.changedTouches[0].clientY,
|
|
@@ -324,7 +250,6 @@ class Tabs extends React.Component {
|
|
|
324
250
|
isScrolling,
|
|
325
251
|
isSwiping
|
|
326
252
|
} = this.state;
|
|
327
|
-
event.persist();
|
|
328
253
|
if (!isScrolling && !isSwiping) {
|
|
329
254
|
if (difference > yAxisDifference) {
|
|
330
255
|
isSwiping = true;
|
|
@@ -339,18 +264,6 @@ class Tabs extends React.Component {
|
|
|
339
264
|
if (isSwiping) {
|
|
340
265
|
const nextSelected = this.getTabToSelect(currentSelectedFromProps, start, end);
|
|
341
266
|
this.animateLine(this.swipedOverHalfOfContainer(difference) ? nextSelected : currentSelectedFromProps);
|
|
342
|
-
const dragDifference = this.calculateApplicableDragDifference({
|
|
343
|
-
currentSelected: currentSelectedFromProps,
|
|
344
|
-
nextSelected,
|
|
345
|
-
start,
|
|
346
|
-
end
|
|
347
|
-
});
|
|
348
|
-
const translateX = dragDifference ? -(this.containerWidth * selected) + dragDifference : false;
|
|
349
|
-
this.setState(state => ({
|
|
350
|
-
currentSwipe: [...state.currentSwipe, end],
|
|
351
|
-
translateFrom: translateX || state.translateFrom,
|
|
352
|
-
translateTo: translateX || state.translateTo
|
|
353
|
-
}));
|
|
354
267
|
}
|
|
355
268
|
};
|
|
356
269
|
handleTouchEnd = event => {
|
|
@@ -370,23 +283,15 @@ class Tabs extends React.Component {
|
|
|
370
283
|
time: Date.now()
|
|
371
284
|
};
|
|
372
285
|
const difference = utils.getSwipeDifference(start, end);
|
|
373
|
-
const velocity = utils.getVelocity([...this.state.currentSwipe, end]);
|
|
374
|
-
this.setState({
|
|
375
|
-
currentSwipe: []
|
|
376
|
-
});
|
|
377
286
|
let nextSelected = selected;
|
|
378
|
-
event.persist();
|
|
379
287
|
if (isSwiping) {
|
|
380
288
|
if (utils.swipeShouldChangeTab(start, end) || this.swipedOverHalfOfContainer(difference)) {
|
|
381
289
|
nextSelected = this.getTabToSelect(nextSelected, start, end);
|
|
382
290
|
}
|
|
383
291
|
if (nextSelected !== selected) {
|
|
384
292
|
this.switchTab(nextSelected);
|
|
385
|
-
this.setState({
|
|
386
|
-
lastSwipeVelocity: velocity
|
|
387
|
-
});
|
|
388
293
|
} else {
|
|
389
|
-
this.
|
|
294
|
+
this.animateLine(nextSelected);
|
|
390
295
|
}
|
|
391
296
|
}
|
|
392
297
|
this.setState({
|
|
@@ -401,34 +306,13 @@ class Tabs extends React.Component {
|
|
|
401
306
|
name,
|
|
402
307
|
selected,
|
|
403
308
|
className,
|
|
404
|
-
transitionSpacing,
|
|
405
309
|
headerWidth
|
|
406
310
|
} = this.props;
|
|
407
311
|
const {
|
|
408
|
-
isSwiping,
|
|
409
312
|
translateLineX,
|
|
410
|
-
isAnimating,
|
|
411
|
-
translateFrom,
|
|
412
|
-
translateTo,
|
|
413
|
-
lastSwipeVelocity,
|
|
414
313
|
fullWidthTabs
|
|
415
314
|
} = this.state;
|
|
416
|
-
const
|
|
417
|
-
const tabsLength = this.filteredTabsLength;
|
|
418
|
-
const distanceSwiped = Math.abs(-translateFrom - this.containerWidth * selected);
|
|
419
|
-
const remainingContainerToTravel = isSwiping ? 1 - distanceSwiped / this.containerWidth : 1 - Math.abs(distanceSwiped / this.containerWidth - 1);
|
|
420
|
-
const restrictedVelocity = (Number.isNaN(remainingContainerToTravel) ? 0 : remainingContainerToTravel) * Math.min(10 * Math.E, lastSwipeVelocity * 10 * Math.E);
|
|
421
|
-
const hidePanelOverflow = isAnimating || isSwiping;
|
|
422
|
-
const sliderWidth = tabsLength * this.containerWidth + spacer * 2;
|
|
423
|
-
// Uses `props.panelTransitionSpacing` to add a spacer in-between the `TabPanel` you're transitioning to/from
|
|
424
|
-
const Spacer = ({
|
|
425
|
-
id
|
|
426
|
-
}) => spacer > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
427
|
-
style: {
|
|
428
|
-
width: spacer,
|
|
429
|
-
display: hidePanelOverflow ? 'block' : 'none'
|
|
430
|
-
}
|
|
431
|
-
}, id);
|
|
315
|
+
const selectedTab = tabs[selected];
|
|
432
316
|
return /*#__PURE__*/jsxRuntime.jsx(DirectionProvider.DirectionContext.Consumer, {
|
|
433
317
|
children: direction$1 => {
|
|
434
318
|
const isRTL = direction$1 === direction.Direction.RTL;
|
|
@@ -478,55 +362,14 @@ class Tabs extends React.Component {
|
|
|
478
362
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
479
363
|
ref: this.setContainerRefAndWidth,
|
|
480
364
|
className: "tabs__panel-container",
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
transform: `translateX(${translateFrom - spacer}px)`
|
|
487
|
-
},
|
|
488
|
-
to: {
|
|
489
|
-
transform: `translateX(${translateTo - spacer}px)`
|
|
490
|
-
},
|
|
491
|
-
config: {
|
|
492
|
-
precision: isSwiping ? 1 : 0.01,
|
|
493
|
-
velocity: !isSwiping ? restrictedVelocity : 0,
|
|
494
|
-
clamp: true
|
|
495
|
-
},
|
|
496
|
-
onRest: () => {
|
|
497
|
-
if (isAnimating) {
|
|
498
|
-
this.setState({
|
|
499
|
-
isAnimating: false,
|
|
500
|
-
lastSwipeVelocity: 0
|
|
501
|
-
});
|
|
502
|
-
}
|
|
365
|
+
children: selectedTab && !selectedTab.disabled ? /*#__PURE__*/jsxRuntime.jsx(TabPanel.default, {
|
|
366
|
+
tabId: `${name}-tab-${selected}`,
|
|
367
|
+
id: `${name}-panel-${selected}`,
|
|
368
|
+
style: {
|
|
369
|
+
width: '100%'
|
|
503
370
|
},
|
|
504
|
-
children:
|
|
505
|
-
|
|
506
|
-
style: {
|
|
507
|
-
width: hidePanelOverflow ? `${sliderWidth}px` : '100%',
|
|
508
|
-
transform: hidePanelOverflow ? props.transform : 'translateX(0px)'
|
|
509
|
-
},
|
|
510
|
-
children: tabs.map(({
|
|
511
|
-
content,
|
|
512
|
-
disabled
|
|
513
|
-
}, index) => !disabled ? /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
514
|
-
children: [index === selected && /*#__PURE__*/jsxRuntime.jsx(Spacer, {
|
|
515
|
-
id: "left-spacer"
|
|
516
|
-
}), /*#__PURE__*/jsxRuntime.jsx(TabPanel.default, {
|
|
517
|
-
tabId: `${name}-tab-${index}`,
|
|
518
|
-
id: `${name}-panel-${index}`,
|
|
519
|
-
style: {
|
|
520
|
-
width: hidePanelOverflow ? `${this.containerWidth}px` : '100%',
|
|
521
|
-
display: hidePanelOverflow || index === selected ? 'block' : 'none'
|
|
522
|
-
},
|
|
523
|
-
children: content
|
|
524
|
-
}, tabs[index].title), index === selected && /*#__PURE__*/jsxRuntime.jsx(Spacer, {
|
|
525
|
-
id: "right-spacer"
|
|
526
|
-
})]
|
|
527
|
-
}, `${tabs[index].title}-fragment`) : null)
|
|
528
|
-
})
|
|
529
|
-
})
|
|
371
|
+
children: selectedTab.content
|
|
372
|
+
}, selectedTab.title) : null
|
|
530
373
|
})]
|
|
531
374
|
});
|
|
532
375
|
}
|