@transferwise/components 0.0.0-experimental-395b171 → 0.0.0-experimental-467c6d5

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
@@ -2174,6 +2174,7 @@ const Carousel = ({
2174
2174
  }
2175
2175
  },
2176
2176
  href: card.href,
2177
+ target: card.hrefTarget,
2177
2178
  rel: "noreferrer",
2178
2179
  onKeyDown: event => handleOnKeyDown(event, index),
2179
2180
  children: cardContent
@@ -2256,62 +2257,28 @@ const Card = /*#__PURE__*/React.forwardRef(function Card({
2256
2257
  });
2257
2258
  });
2258
2259
 
2259
- const FieldLabelIdContext = /*#__PURE__*/React.createContext(undefined);
2260
- const FieldLabelIdContextProvider = FieldLabelIdContext.Provider;
2261
- const InputIdContext = /*#__PURE__*/React.createContext(undefined);
2262
- const InputIdContextProvider = InputIdContext.Provider;
2263
- const InputDescribedByContext = /*#__PURE__*/React.createContext(undefined);
2264
- const InputDescribedByProvider = InputDescribedByContext.Provider;
2265
- const InputInvalidContext = /*#__PURE__*/React.createContext(undefined);
2266
- const InputInvalidProvider = InputInvalidContext.Provider;
2267
- function useInputAttributes({
2268
- nonLabelable
2269
- } = {}) {
2270
- const labelId = React.useContext(FieldLabelIdContext);
2271
- return {
2272
- id: React.useContext(InputIdContext),
2273
- 'aria-labelledby': nonLabelable ? labelId : undefined,
2274
- 'aria-describedby': React.useContext(InputDescribedByContext),
2275
- 'aria-invalid': React.useContext(InputInvalidContext)
2276
- };
2277
- }
2278
- function withInputAttributes(Component, args) {
2279
- function ComponentWithInputAttributes(props) {
2280
- return /*#__PURE__*/jsxRuntime.jsx(Component, {
2281
- inputAttributes: useInputAttributes(args),
2282
- ...props
2283
- });
2284
- }
2285
- ComponentWithInputAttributes.displayName = `withInputAttributes(${Component.displayName || Component.name || 'Component'})`;
2286
- return ComponentWithInputAttributes;
2287
- }
2288
-
2289
- const CheckboxButton = /*#__PURE__*/React.forwardRef(function CheckboxButton({
2260
+ const CheckboxButton = /*#__PURE__*/React.forwardRef(({
2290
2261
  checked,
2291
2262
  className,
2292
2263
  disabled,
2293
2264
  onChange,
2294
2265
  ...rest
2295
- }, reference) {
2296
- const inputAttributes = useInputAttributes();
2297
- return /*#__PURE__*/jsxRuntime.jsxs("span", {
2298
- className: classNames__default.default('np-checkbox-button', className, disabled && 'disabled'),
2299
- children: [/*#__PURE__*/jsxRuntime.jsx("input", {
2300
- ...inputAttributes,
2301
- ...rest,
2302
- ref: reference,
2303
- type: "checkbox",
2304
- disabled: disabled,
2305
- checked: checked,
2306
- onChange: onChange
2307
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
2308
- className: "tw-checkbox-button",
2309
- children: /*#__PURE__*/jsxRuntime.jsx("span", {
2310
- className: "tw-checkbox-check"
2311
- })
2312
- })]
2313
- });
2314
- });
2266
+ }, reference) => /*#__PURE__*/jsxRuntime.jsxs("span", {
2267
+ className: classNames__default.default('np-checkbox-button', className, disabled && 'disabled'),
2268
+ children: [/*#__PURE__*/jsxRuntime.jsx("input", {
2269
+ ...rest,
2270
+ ref: reference,
2271
+ type: "checkbox",
2272
+ disabled: disabled,
2273
+ checked: checked,
2274
+ onChange: onChange
2275
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
2276
+ className: "tw-checkbox-button",
2277
+ children: /*#__PURE__*/jsxRuntime.jsx("span", {
2278
+ className: "tw-checkbox-check"
2279
+ })
2280
+ })]
2281
+ }));
2315
2282
 
2316
2283
  function Checkbox({
2317
2284
  id,
@@ -3112,6 +3079,36 @@ const isMonthAndYearFormat = dateString => validDateString(dateString) && dateSt
3112
3079
  const MDY = new Set(['en-US']);
3113
3080
  const YMD = new Set(['hu', 'hu-HU', 'zh-HK', 'zh-CN', 'ja', 'ja-JP']);
3114
3081
 
3082
+ const FieldLabelIdContext = /*#__PURE__*/React.createContext(undefined);
3083
+ const FieldLabelIdContextProvider = FieldLabelIdContext.Provider;
3084
+ const InputIdContext = /*#__PURE__*/React.createContext(undefined);
3085
+ const InputIdContextProvider = InputIdContext.Provider;
3086
+ const InputDescribedByContext = /*#__PURE__*/React.createContext(undefined);
3087
+ const InputDescribedByProvider = InputDescribedByContext.Provider;
3088
+ const InputInvalidContext = /*#__PURE__*/React.createContext(undefined);
3089
+ const InputInvalidProvider = InputInvalidContext.Provider;
3090
+ function useInputAttributes({
3091
+ nonLabelable
3092
+ } = {}) {
3093
+ const labelId = React.useContext(FieldLabelIdContext);
3094
+ return {
3095
+ id: React.useContext(InputIdContext),
3096
+ 'aria-labelledby': nonLabelable ? labelId : undefined,
3097
+ 'aria-describedby': React.useContext(InputDescribedByContext),
3098
+ 'aria-invalid': React.useContext(InputInvalidContext)
3099
+ };
3100
+ }
3101
+ function withInputAttributes(Component, args) {
3102
+ function ComponentWithInputAttributes(props) {
3103
+ return /*#__PURE__*/jsxRuntime.jsx(Component, {
3104
+ inputAttributes: useInputAttributes(args),
3105
+ ...props
3106
+ });
3107
+ }
3108
+ ComponentWithInputAttributes.displayName = `withInputAttributes(${Component.displayName || Component.name || 'Component'})`;
3109
+ return ComponentWithInputAttributes;
3110
+ }
3111
+
3115
3112
  var messages$9 = reactIntl.defineMessages({
3116
3113
  monthLabel: {
3117
3114
  id: "neptune.DateInput.month.label"
@@ -4929,11 +4926,11 @@ const Field = ({
4929
4926
  'has-error': hasError,
4930
4927
  'has-info': sentiment === exports.Sentiment.NEUTRAL
4931
4928
  }, className),
4932
- children: [label != null ? /*#__PURE__*/jsxRuntime.jsxs(Label, {
4929
+ children: [/*#__PURE__*/jsxRuntime.jsxs(Label, {
4933
4930
  id: labelId,
4934
4931
  htmlFor: inputId,
4935
4932
  children: [label, children]
4936
- }) : children, message && /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
4933
+ }), message && /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
4937
4934
  type: sentiment,
4938
4935
  id: descriptionId,
4939
4936
  children: message