@transferwise/components 45.21.1 → 45.21.2

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.
@@ -6637,13 +6637,6 @@ function inferSearchableStrings(value) {
6637
6637
  }
6638
6638
  return [];
6639
6639
  }
6640
- const SelectInputItemCheckPaddingContext = /*#__PURE__*/createContext(false);
6641
- function useSelectInputItemCheckPadding() {
6642
- const checkPadding = useContext(SelectInputItemCheckPaddingContext);
6643
- // Avoid layout shifts during transitions via caching
6644
- const [initialCheckPadding] = useState(checkPadding);
6645
- return initialCheckPadding;
6646
- }
6647
6640
  const SelectInputTriggerButtonPropsContext = /*#__PURE__*/createContext({});
6648
6641
  const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/createContext(false);
6649
6642
  function dedupeSelectInputOptionItem(item, existingValues) {
@@ -6788,54 +6781,51 @@ function SelectInput({
6788
6781
  children: ({
6789
6782
  disabled: uiDisabled,
6790
6783
  value
6791
- }) => /*#__PURE__*/jsx(SelectInputItemCheckPaddingContext.Provider, {
6792
- value: Boolean(filterable) || value != null,
6793
- children: /*#__PURE__*/jsx(OptionsOverlay, {
6794
- placement: "bottom-start",
6795
- open: open,
6796
- renderTrigger: ({
6797
- ref,
6798
- getInteractionProps
6799
- }) => /*#__PURE__*/jsx(SelectInputTriggerButtonPropsContext.Provider, {
6800
- // eslint-disable-next-line react/jsx-no-constructed-context-values
6801
- value: {
6802
- ref: mergeRefs([ref, triggerRef]),
6803
- ...mergeProps({
6804
- onClick: () => {
6805
- setOpen(prev => !prev);
6806
- }
6807
- }, getInteractionProps())
6808
- },
6809
- children: renderTrigger({
6810
- content: value != null ? /*#__PURE__*/jsx(SelectInputOptionContentWithinTriggerContext.Provider, {
6811
- value: true,
6812
- children: renderValue(value, true)
6813
- }) : placeholder,
6814
- placeholderShown: value == null,
6815
- clear: onClear != null ? () => {
6816
- onClear();
6817
- triggerRef.current?.focus({
6818
- preventScroll: true
6819
- });
6820
- } : undefined,
6821
- disabled: uiDisabled,
6822
- size,
6823
- className
6824
- })
6825
- }),
6826
- initialFocusRef: controllerRef,
6827
- padding: "none",
6828
- onClose: () => {
6829
- setOpen(false);
6784
+ }) => /*#__PURE__*/jsx(OptionsOverlay, {
6785
+ placement: "bottom-start",
6786
+ open: open,
6787
+ renderTrigger: ({
6788
+ ref,
6789
+ getInteractionProps
6790
+ }) => /*#__PURE__*/jsx(SelectInputTriggerButtonPropsContext.Provider, {
6791
+ // eslint-disable-next-line react/jsx-no-constructed-context-values
6792
+ value: {
6793
+ ref: mergeRefs([ref, triggerRef]),
6794
+ ...mergeProps({
6795
+ onClick: () => {
6796
+ setOpen(prev => !prev);
6797
+ }
6798
+ }, getInteractionProps())
6830
6799
  },
6831
- children: /*#__PURE__*/jsx(SelectInputOptions, {
6832
- items: items,
6833
- renderValue: renderValue,
6834
- filterable: filterable,
6835
- filterPlaceholder: filterPlaceholder,
6836
- searchInputRef: searchInputRef,
6837
- listboxRef: listboxRef
6800
+ children: renderTrigger({
6801
+ content: value != null ? /*#__PURE__*/jsx(SelectInputOptionContentWithinTriggerContext.Provider, {
6802
+ value: true,
6803
+ children: renderValue(value, true)
6804
+ }) : placeholder,
6805
+ placeholderShown: value == null,
6806
+ clear: onClear != null ? () => {
6807
+ onClear();
6808
+ triggerRef.current?.focus({
6809
+ preventScroll: true
6810
+ });
6811
+ } : undefined,
6812
+ disabled: uiDisabled,
6813
+ size,
6814
+ className
6838
6815
  })
6816
+ }),
6817
+ initialFocusRef: controllerRef,
6818
+ padding: "none",
6819
+ onClose: () => {
6820
+ setOpen(false);
6821
+ },
6822
+ children: /*#__PURE__*/jsx(SelectInputOptions, {
6823
+ items: items,
6824
+ renderValue: renderValue,
6825
+ filterable: filterable,
6826
+ filterPlaceholder: filterPlaceholder,
6827
+ searchInputRef: searchInputRef,
6828
+ listboxRef: listboxRef
6839
6829
  })
6840
6830
  })
6841
6831
  });
@@ -7025,7 +7015,6 @@ function SelectInputGroupItemView({
7025
7015
  needle
7026
7016
  }) {
7027
7017
  const headerId = useId();
7028
- const checkPadding = useSelectInputItemCheckPadding();
7029
7018
  return (
7030
7019
  /*#__PURE__*/
7031
7020
  // An empty container may be rendered when no options match `needle`
@@ -7034,13 +7023,11 @@ function SelectInputGroupItemView({
7034
7023
  role: "group",
7035
7024
  "aria-labelledby": headerId,
7036
7025
  className: classNames(needle === null && 'np-select-input-group-item--without-needle'),
7037
- children: [needle == null ? /*#__PURE__*/jsxs("header", {
7026
+ children: [needle == null ? /*#__PURE__*/jsx("header", {
7038
7027
  id: headerId,
7039
7028
  role: "presentation",
7040
7029
  className: "np-select-input-group-item-header np-text-title-group",
7041
- children: [checkPadding ? /*#__PURE__*/jsx("span", {
7042
- className: "np-select-input-option-check-placeholder"
7043
- }) : null, item.label]
7030
+ children: item.label
7044
7031
  }) : null, item.options.map((option, index) => /*#__PURE__*/jsx(SelectInputItemView
7045
7032
  // eslint-disable-next-line react/no-array-index-key
7046
7033
  , {
@@ -7056,7 +7043,6 @@ function SelectInputOption({
7056
7043
  disabled,
7057
7044
  children
7058
7045
  }) {
7059
- const checkPadding = useSelectInputItemCheckPadding();
7060
7046
  return /*#__PURE__*/jsx(Listbox.Option, {
7061
7047
  as: "div",
7062
7048
  value: value,
@@ -7068,12 +7054,12 @@ function SelectInputOption({
7068
7054
  children: ({
7069
7055
  selected
7070
7056
  }) => /*#__PURE__*/jsxs(Fragment, {
7071
- children: [checkPadding ? /*#__PURE__*/jsx(Check, {
7072
- size: 16,
7073
- className: classNames('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
7074
- }) : null, /*#__PURE__*/jsx("div", {
7057
+ children: [/*#__PURE__*/jsx("div", {
7075
7058
  className: "np-select-input-option",
7076
7059
  children: children
7060
+ }), /*#__PURE__*/jsx(Check, {
7061
+ size: 16,
7062
+ className: classNames('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
7077
7063
  })]
7078
7064
  })
7079
7065
  });