@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.
- package/build/index.esm.js +49 -63
- package/build/index.esm.js.map +1 -1
- package/build/index.js +49 -63
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/inputs/SelectInput.css +1 -1
- package/src/inputs/SelectInput.less +1 -13
- package/src/inputs/SelectInput.tsx +61 -80
- package/src/main.css +1 -1
package/build/index.js
CHANGED
|
@@ -6671,13 +6671,6 @@ function inferSearchableStrings(value) {
|
|
|
6671
6671
|
}
|
|
6672
6672
|
return [];
|
|
6673
6673
|
}
|
|
6674
|
-
const SelectInputItemCheckPaddingContext = /*#__PURE__*/React.createContext(false);
|
|
6675
|
-
function useSelectInputItemCheckPadding() {
|
|
6676
|
-
const checkPadding = React.useContext(SelectInputItemCheckPaddingContext);
|
|
6677
|
-
// Avoid layout shifts during transitions via caching
|
|
6678
|
-
const [initialCheckPadding] = React.useState(checkPadding);
|
|
6679
|
-
return initialCheckPadding;
|
|
6680
|
-
}
|
|
6681
6674
|
const SelectInputTriggerButtonPropsContext = /*#__PURE__*/React.createContext({});
|
|
6682
6675
|
const SelectInputOptionContentWithinTriggerContext = /*#__PURE__*/React.createContext(false);
|
|
6683
6676
|
function dedupeSelectInputOptionItem(item, existingValues) {
|
|
@@ -6822,54 +6815,51 @@ function SelectInput({
|
|
|
6822
6815
|
children: ({
|
|
6823
6816
|
disabled: uiDisabled,
|
|
6824
6817
|
value
|
|
6825
|
-
}) => /*#__PURE__*/jsxRuntime.jsx(
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
}
|
|
6841
|
-
}, getInteractionProps())
|
|
6842
|
-
},
|
|
6843
|
-
children: renderTrigger({
|
|
6844
|
-
content: value != null ? /*#__PURE__*/jsxRuntime.jsx(SelectInputOptionContentWithinTriggerContext.Provider, {
|
|
6845
|
-
value: true,
|
|
6846
|
-
children: renderValue(value, true)
|
|
6847
|
-
}) : placeholder,
|
|
6848
|
-
placeholderShown: value == null,
|
|
6849
|
-
clear: onClear != null ? () => {
|
|
6850
|
-
onClear();
|
|
6851
|
-
triggerRef.current?.focus({
|
|
6852
|
-
preventScroll: true
|
|
6853
|
-
});
|
|
6854
|
-
} : undefined,
|
|
6855
|
-
disabled: uiDisabled,
|
|
6856
|
-
size,
|
|
6857
|
-
className
|
|
6858
|
-
})
|
|
6859
|
-
}),
|
|
6860
|
-
initialFocusRef: controllerRef,
|
|
6861
|
-
padding: "none",
|
|
6862
|
-
onClose: () => {
|
|
6863
|
-
setOpen(false);
|
|
6818
|
+
}) => /*#__PURE__*/jsxRuntime.jsx(OptionsOverlay, {
|
|
6819
|
+
placement: "bottom-start",
|
|
6820
|
+
open: open,
|
|
6821
|
+
renderTrigger: ({
|
|
6822
|
+
ref,
|
|
6823
|
+
getInteractionProps
|
|
6824
|
+
}) => /*#__PURE__*/jsxRuntime.jsx(SelectInputTriggerButtonPropsContext.Provider, {
|
|
6825
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
6826
|
+
value: {
|
|
6827
|
+
ref: mergeRefs__default.default([ref, triggerRef]),
|
|
6828
|
+
...mergeProps__default.default({
|
|
6829
|
+
onClick: () => {
|
|
6830
|
+
setOpen(prev => !prev);
|
|
6831
|
+
}
|
|
6832
|
+
}, getInteractionProps())
|
|
6864
6833
|
},
|
|
6865
|
-
children:
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6834
|
+
children: renderTrigger({
|
|
6835
|
+
content: value != null ? /*#__PURE__*/jsxRuntime.jsx(SelectInputOptionContentWithinTriggerContext.Provider, {
|
|
6836
|
+
value: true,
|
|
6837
|
+
children: renderValue(value, true)
|
|
6838
|
+
}) : placeholder,
|
|
6839
|
+
placeholderShown: value == null,
|
|
6840
|
+
clear: onClear != null ? () => {
|
|
6841
|
+
onClear();
|
|
6842
|
+
triggerRef.current?.focus({
|
|
6843
|
+
preventScroll: true
|
|
6844
|
+
});
|
|
6845
|
+
} : undefined,
|
|
6846
|
+
disabled: uiDisabled,
|
|
6847
|
+
size,
|
|
6848
|
+
className
|
|
6872
6849
|
})
|
|
6850
|
+
}),
|
|
6851
|
+
initialFocusRef: controllerRef,
|
|
6852
|
+
padding: "none",
|
|
6853
|
+
onClose: () => {
|
|
6854
|
+
setOpen(false);
|
|
6855
|
+
},
|
|
6856
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SelectInputOptions, {
|
|
6857
|
+
items: items,
|
|
6858
|
+
renderValue: renderValue,
|
|
6859
|
+
filterable: filterable,
|
|
6860
|
+
filterPlaceholder: filterPlaceholder,
|
|
6861
|
+
searchInputRef: searchInputRef,
|
|
6862
|
+
listboxRef: listboxRef
|
|
6873
6863
|
})
|
|
6874
6864
|
})
|
|
6875
6865
|
});
|
|
@@ -7059,7 +7049,6 @@ function SelectInputGroupItemView({
|
|
|
7059
7049
|
needle
|
|
7060
7050
|
}) {
|
|
7061
7051
|
const headerId = reactId.useId();
|
|
7062
|
-
const checkPadding = useSelectInputItemCheckPadding();
|
|
7063
7052
|
return (
|
|
7064
7053
|
/*#__PURE__*/
|
|
7065
7054
|
// An empty container may be rendered when no options match `needle`
|
|
@@ -7068,13 +7057,11 @@ function SelectInputGroupItemView({
|
|
|
7068
7057
|
role: "group",
|
|
7069
7058
|
"aria-labelledby": headerId,
|
|
7070
7059
|
className: classNames__default.default(needle === null && 'np-select-input-group-item--without-needle'),
|
|
7071
|
-
children: [needle == null ? /*#__PURE__*/jsxRuntime.
|
|
7060
|
+
children: [needle == null ? /*#__PURE__*/jsxRuntime.jsx("header", {
|
|
7072
7061
|
id: headerId,
|
|
7073
7062
|
role: "presentation",
|
|
7074
7063
|
className: "np-select-input-group-item-header np-text-title-group",
|
|
7075
|
-
children:
|
|
7076
|
-
className: "np-select-input-option-check-placeholder"
|
|
7077
|
-
}) : null, item.label]
|
|
7064
|
+
children: item.label
|
|
7078
7065
|
}) : null, item.options.map((option, index) => /*#__PURE__*/jsxRuntime.jsx(SelectInputItemView
|
|
7079
7066
|
// eslint-disable-next-line react/no-array-index-key
|
|
7080
7067
|
, {
|
|
@@ -7090,7 +7077,6 @@ function SelectInputOption({
|
|
|
7090
7077
|
disabled,
|
|
7091
7078
|
children
|
|
7092
7079
|
}) {
|
|
7093
|
-
const checkPadding = useSelectInputItemCheckPadding();
|
|
7094
7080
|
return /*#__PURE__*/jsxRuntime.jsx(react$1.Listbox.Option, {
|
|
7095
7081
|
as: "div",
|
|
7096
7082
|
value: value,
|
|
@@ -7102,12 +7088,12 @@ function SelectInputOption({
|
|
|
7102
7088
|
children: ({
|
|
7103
7089
|
selected
|
|
7104
7090
|
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7105
|
-
children: [
|
|
7106
|
-
size: 16,
|
|
7107
|
-
className: classNames__default.default('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
|
|
7108
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7091
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7109
7092
|
className: "np-select-input-option",
|
|
7110
7093
|
children: children
|
|
7094
|
+
}), /*#__PURE__*/jsxRuntime.jsx(icons.Check, {
|
|
7095
|
+
size: 16,
|
|
7096
|
+
className: classNames__default.default('np-select-input-option-check', !selected && 'np-select-input-option-check--not-selected')
|
|
7111
7097
|
})]
|
|
7112
7098
|
})
|
|
7113
7099
|
});
|