@transferwise/components 46.42.1 → 46.43.0

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.mjs CHANGED
@@ -5737,25 +5737,45 @@ function InputGroup({
5737
5737
  className,
5738
5738
  children
5739
5739
  }) {
5740
+ const inputAttributes = useInputAttributes({
5741
+ nonLabelable: true
5742
+ });
5740
5743
  const [paddingStart, setPaddingStart] = useState(inputPaddingInitialState(addonStart));
5741
5744
  const [paddingEnd, setPaddingEnd] = useState(inputPaddingInitialState(addonEnd));
5742
- return /*#__PURE__*/jsx(InputPaddingStartContext.Provider, {
5743
- value: useMemo(() => [paddingStart, setPaddingStart], [paddingStart]),
5744
- children: /*#__PURE__*/jsx(InputPaddingEndContext.Provider, {
5745
- value: useMemo(() => [paddingEnd, setPaddingEnd], [paddingEnd]),
5746
- children: /*#__PURE__*/jsxs("fieldset", {
5747
- disabled: disabled,
5748
- className: classNames(className, 'np-input-group'),
5749
- children: [addonStart != null ? /*#__PURE__*/jsx(InputAddon, {
5750
- placement: "start",
5751
- ...addonStart
5752
- }) : null, children, addonEnd != null ? /*#__PURE__*/jsx(InputAddon, {
5753
- placement: "end",
5754
- ...addonEnd
5755
- }) : null]
5745
+ return (
5746
+ /*#__PURE__*/
5747
+ /* Prevent nested controls from being labeled redundantly */
5748
+ jsx(FieldLabelIdContextProvider, {
5749
+ value: undefined,
5750
+ children: /*#__PURE__*/jsx(InputIdContextProvider, {
5751
+ value: undefined,
5752
+ children: /*#__PURE__*/jsx(InputDescribedByProvider, {
5753
+ value: undefined,
5754
+ children: /*#__PURE__*/jsx(InputInvalidProvider, {
5755
+ value: undefined,
5756
+ children: /*#__PURE__*/jsx(InputPaddingStartContext.Provider, {
5757
+ value: useMemo(() => [paddingStart, setPaddingStart], [paddingStart]),
5758
+ children: /*#__PURE__*/jsx(InputPaddingEndContext.Provider, {
5759
+ value: useMemo(() => [paddingEnd, setPaddingEnd], [paddingEnd]),
5760
+ children: /*#__PURE__*/jsxs("fieldset", {
5761
+ ...inputAttributes,
5762
+ disabled: disabled,
5763
+ className: classNames(className, 'np-input-group'),
5764
+ children: [addonStart != null ? /*#__PURE__*/jsx(InputAddon, {
5765
+ placement: "start",
5766
+ ...addonStart
5767
+ }) : null, children, addonEnd != null ? /*#__PURE__*/jsx(InputAddon, {
5768
+ placement: "end",
5769
+ ...addonEnd
5770
+ }) : null]
5771
+ })
5772
+ })
5773
+ })
5774
+ })
5775
+ })
5756
5776
  })
5757
5777
  })
5758
- });
5778
+ );
5759
5779
  }
5760
5780
  const inputAddonContentWidthAddendByPadding = {
5761
5781
  none: 0,
@@ -6620,6 +6640,7 @@ function SelectInput({
6620
6640
  disabled,
6621
6641
  size = 'md',
6622
6642
  className,
6643
+ UNSAFE_triggerButtonProps,
6623
6644
  onFilterChange = noop,
6624
6645
  onChange,
6625
6646
  onClose,
@@ -6688,6 +6709,7 @@ function SelectInput({
6688
6709
  triggerRef.current = node;
6689
6710
  },
6690
6711
  ...inputAttributes,
6712
+ ...UNSAFE_triggerButtonProps,
6691
6713
  id,
6692
6714
  ...mergeProps({
6693
6715
  onClick: () => {