@transferwise/components 0.0.0-experimental-f29ed58 → 0.0.0-experimental-d729abf
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/index.js +29 -26
- package/build/index.js.map +1 -1
- package/build/index.mjs +29 -26
- package/build/index.mjs.map +1 -1
- package/build/main.css +3 -2
- package/build/styles/main.css +3 -2
- package/build/styles/selectOption/SelectOption.css +3 -2
- package/build/types/selectOption/SelectOption.d.ts +11 -4
- package/build/types/selectOption/SelectOption.d.ts.map +1 -1
- package/build/types/selectOption/index.d.ts +1 -1
- package/build/types/selectOption/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/main.css +3 -2
- package/src/selectOption/SelectOption.css +3 -2
- package/src/selectOption/SelectOption.less +5 -2
- package/src/selectOption/SelectOption.story.tsx +33 -18
- package/src/selectOption/SelectOption.tsx +34 -25
- package/src/selectOption/index.ts +1 -1
package/build/index.js
CHANGED
|
@@ -1955,7 +1955,7 @@ function SelectOption({
|
|
|
1955
1955
|
optionsTitle,
|
|
1956
1956
|
options,
|
|
1957
1957
|
onChange,
|
|
1958
|
-
|
|
1958
|
+
action,
|
|
1959
1959
|
...props
|
|
1960
1960
|
}) {
|
|
1961
1961
|
const intl = reactIntl.useIntl();
|
|
@@ -1980,29 +1980,32 @@ function SelectOption({
|
|
|
1980
1980
|
isMobile
|
|
1981
1981
|
} = useLayout();
|
|
1982
1982
|
function getOptionsContent(isMobileView = false) {
|
|
1983
|
-
return /*#__PURE__*/jsxRuntime.
|
|
1984
|
-
className: classNames__default.default('np-select-option-list',
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
1983
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1984
|
+
className: classNames__default.default('np-select-option-list'),
|
|
1985
|
+
children: options.map(optionsGroup =>
|
|
1986
|
+
/*#__PURE__*/
|
|
1987
|
+
// eslint-disable-next-line react/jsx-key
|
|
1988
|
+
jsxRuntime.jsxs(Section, {
|
|
1989
|
+
className: classNames__default.default('np-select-option-group', {
|
|
1990
|
+
'p-a-2': !isMobileView
|
|
1991
|
+
}),
|
|
1992
|
+
children: [optionsGroup.title && /*#__PURE__*/jsxRuntime.jsx(Header, {
|
|
1993
|
+
title: optionsGroup.title
|
|
1994
|
+
}), /*#__PURE__*/jsxRuntime.jsx(NavigationOptionList, {
|
|
1995
|
+
children: optionsGroup.options.map(option =>
|
|
1996
|
+
/*#__PURE__*/
|
|
1997
|
+
// eslint-disable-next-line react/jsx-key
|
|
1998
|
+
jsxRuntime.jsx(NavigationOption, {
|
|
1999
|
+
isContainerAligned: isMobileView,
|
|
2000
|
+
showMediaCircle: true,
|
|
2001
|
+
showMediaAtAllSizes: true,
|
|
2002
|
+
media: option.media,
|
|
2003
|
+
title: option.title,
|
|
2004
|
+
content: option.content,
|
|
2005
|
+
onClick: handleOnChange(option)
|
|
2006
|
+
}))
|
|
2007
|
+
})]
|
|
2008
|
+
}))
|
|
2006
2009
|
});
|
|
2007
2010
|
}
|
|
2008
2011
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -2010,7 +2013,7 @@ function SelectOption({
|
|
|
2010
2013
|
ref: rootRef,
|
|
2011
2014
|
...props,
|
|
2012
2015
|
...inputAttributes,
|
|
2013
|
-
showMediaAtAllSizes:
|
|
2016
|
+
showMediaAtAllSizes: true,
|
|
2014
2017
|
media: (isSelected ? selected : props).media,
|
|
2015
2018
|
title: (isSelected ? selected : props).title,
|
|
2016
2019
|
content: (isSelected ? selected : props).content,
|
|
@@ -2020,7 +2023,7 @@ function SelectOption({
|
|
|
2020
2023
|
button: isSelected ? /*#__PURE__*/jsxRuntime.jsx(Chevron, {}) : /*#__PURE__*/jsxRuntime.jsx(ActionButton, {
|
|
2021
2024
|
disabled: props.disabled,
|
|
2022
2025
|
onClick: handleOnClick(true),
|
|
2023
|
-
children:
|
|
2026
|
+
children: action?.label || intl.formatMessage(messages$b.actionLabel)
|
|
2024
2027
|
}),
|
|
2025
2028
|
onClick: isSelected ? handleOnClick(true) : undefined
|
|
2026
2029
|
}), isMobile ? /*#__PURE__*/jsxRuntime.jsx(BottomSheet$1, {
|