@transferwise/components 0.0.0-experimental-f29ed58 → 0.0.0-experimental-6371be6

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 CHANGED
@@ -1955,7 +1955,7 @@ function SelectOption({
1955
1955
  optionsTitle,
1956
1956
  options,
1957
1957
  onChange,
1958
- actionLabel = null,
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.jsxs(Section, {
1984
- className: classNames__default.default('np-select-option-list', {
1985
- 'p-a-2': !isMobileView
1986
- }),
1987
- children: [optionsTitle && /*#__PURE__*/jsxRuntime.jsx(Header, {
1988
- title: optionsTitle
1989
- }), /*#__PURE__*/jsxRuntime.jsx(NavigationOptionList, {
1990
- children: options.map(option => {
1991
- return (
1992
- /*#__PURE__*/
1993
- // eslint-disable-next-line react/jsx-key
1994
- jsxRuntime.jsx(NavigationOption, {
1995
- isContainerAligned: isMobileView,
1996
- showMediaCircle: true,
1997
- showMediaAtAllSizes: false,
1998
- media: option.media,
1999
- title: option.title,
2000
- content: option.content,
2001
- onClick: handleOnChange(option)
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: false,
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: actionLabel || intl.formatMessage(messages$b.actionLabel)
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, {