@transferwise/components 46.43.0 → 46.44.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.js +54 -49
- package/build/index.js.map +1 -1
- package/build/index.mjs +54 -49
- package/build/index.mjs.map +1 -1
- package/build/main.css +9 -2
- package/build/styles/carousel/Carousel.css +9 -2
- package/build/styles/main.css +9 -2
- package/build/types/carousel/Carousel.d.ts +1 -0
- package/build/types/carousel/Carousel.d.ts.map +1 -1
- package/build/types/checkboxButton/CheckboxButton.d.ts.map +1 -1
- package/build/types/field/Field.d.ts +2 -1
- package/build/types/field/Field.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/carousel/Carousel.css +9 -2
- package/src/carousel/Carousel.less +10 -1
- package/src/carousel/Carousel.story.tsx +1 -0
- package/src/carousel/Carousel.tsx +2 -0
- package/src/checkbox/Checkbox.spec.tsx +13 -0
- package/src/checkbox/Checkbox.story.tsx +13 -0
- package/src/checkboxButton/CheckboxButton.tsx +12 -4
- package/src/field/Field.tsx +11 -5
- package/src/main.css +9 -2
package/build/index.mjs
CHANGED
|
@@ -2145,6 +2145,7 @@ const Carousel = ({
|
|
|
2145
2145
|
}
|
|
2146
2146
|
},
|
|
2147
2147
|
href: card.href,
|
|
2148
|
+
target: card.hrefTarget,
|
|
2148
2149
|
rel: "noreferrer",
|
|
2149
2150
|
onKeyDown: event => handleOnKeyDown(event, index),
|
|
2150
2151
|
children: cardContent
|
|
@@ -2227,28 +2228,62 @@ const Card = /*#__PURE__*/forwardRef(function Card({
|
|
|
2227
2228
|
});
|
|
2228
2229
|
});
|
|
2229
2230
|
|
|
2230
|
-
const
|
|
2231
|
+
const FieldLabelIdContext = /*#__PURE__*/createContext(undefined);
|
|
2232
|
+
const FieldLabelIdContextProvider = FieldLabelIdContext.Provider;
|
|
2233
|
+
const InputIdContext = /*#__PURE__*/createContext(undefined);
|
|
2234
|
+
const InputIdContextProvider = InputIdContext.Provider;
|
|
2235
|
+
const InputDescribedByContext = /*#__PURE__*/createContext(undefined);
|
|
2236
|
+
const InputDescribedByProvider = InputDescribedByContext.Provider;
|
|
2237
|
+
const InputInvalidContext = /*#__PURE__*/createContext(undefined);
|
|
2238
|
+
const InputInvalidProvider = InputInvalidContext.Provider;
|
|
2239
|
+
function useInputAttributes({
|
|
2240
|
+
nonLabelable
|
|
2241
|
+
} = {}) {
|
|
2242
|
+
const labelId = useContext(FieldLabelIdContext);
|
|
2243
|
+
return {
|
|
2244
|
+
id: useContext(InputIdContext),
|
|
2245
|
+
'aria-labelledby': nonLabelable ? labelId : undefined,
|
|
2246
|
+
'aria-describedby': useContext(InputDescribedByContext),
|
|
2247
|
+
'aria-invalid': useContext(InputInvalidContext)
|
|
2248
|
+
};
|
|
2249
|
+
}
|
|
2250
|
+
function withInputAttributes(Component, args) {
|
|
2251
|
+
function ComponentWithInputAttributes(props) {
|
|
2252
|
+
return /*#__PURE__*/jsx(Component, {
|
|
2253
|
+
inputAttributes: useInputAttributes(args),
|
|
2254
|
+
...props
|
|
2255
|
+
});
|
|
2256
|
+
}
|
|
2257
|
+
ComponentWithInputAttributes.displayName = `withInputAttributes(${Component.displayName || Component.name || 'Component'})`;
|
|
2258
|
+
return ComponentWithInputAttributes;
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
const CheckboxButton = /*#__PURE__*/forwardRef(function CheckboxButton({
|
|
2231
2262
|
checked,
|
|
2232
2263
|
className,
|
|
2233
2264
|
disabled,
|
|
2234
2265
|
onChange,
|
|
2235
2266
|
...rest
|
|
2236
|
-
}, reference)
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2267
|
+
}, reference) {
|
|
2268
|
+
const inputAttributes = useInputAttributes();
|
|
2269
|
+
return /*#__PURE__*/jsxs("span", {
|
|
2270
|
+
className: classNames('np-checkbox-button', className, disabled && 'disabled'),
|
|
2271
|
+
children: [/*#__PURE__*/jsx("input", {
|
|
2272
|
+
...inputAttributes,
|
|
2273
|
+
...rest,
|
|
2274
|
+
ref: reference,
|
|
2275
|
+
type: "checkbox",
|
|
2276
|
+
disabled: disabled,
|
|
2277
|
+
checked: checked,
|
|
2278
|
+
onChange: onChange
|
|
2279
|
+
}), /*#__PURE__*/jsx("span", {
|
|
2280
|
+
className: "tw-checkbox-button",
|
|
2281
|
+
children: /*#__PURE__*/jsx("span", {
|
|
2282
|
+
className: "tw-checkbox-check"
|
|
2283
|
+
})
|
|
2284
|
+
})]
|
|
2285
|
+
});
|
|
2286
|
+
});
|
|
2252
2287
|
|
|
2253
2288
|
function Checkbox({
|
|
2254
2289
|
id,
|
|
@@ -3049,36 +3084,6 @@ const isMonthAndYearFormat = dateString => validDateString(dateString) && dateSt
|
|
|
3049
3084
|
const MDY = new Set(['en-US']);
|
|
3050
3085
|
const YMD = new Set(['hu', 'hu-HU', 'zh-HK', 'zh-CN', 'ja', 'ja-JP']);
|
|
3051
3086
|
|
|
3052
|
-
const FieldLabelIdContext = /*#__PURE__*/createContext(undefined);
|
|
3053
|
-
const FieldLabelIdContextProvider = FieldLabelIdContext.Provider;
|
|
3054
|
-
const InputIdContext = /*#__PURE__*/createContext(undefined);
|
|
3055
|
-
const InputIdContextProvider = InputIdContext.Provider;
|
|
3056
|
-
const InputDescribedByContext = /*#__PURE__*/createContext(undefined);
|
|
3057
|
-
const InputDescribedByProvider = InputDescribedByContext.Provider;
|
|
3058
|
-
const InputInvalidContext = /*#__PURE__*/createContext(undefined);
|
|
3059
|
-
const InputInvalidProvider = InputInvalidContext.Provider;
|
|
3060
|
-
function useInputAttributes({
|
|
3061
|
-
nonLabelable
|
|
3062
|
-
} = {}) {
|
|
3063
|
-
const labelId = useContext(FieldLabelIdContext);
|
|
3064
|
-
return {
|
|
3065
|
-
id: useContext(InputIdContext),
|
|
3066
|
-
'aria-labelledby': nonLabelable ? labelId : undefined,
|
|
3067
|
-
'aria-describedby': useContext(InputDescribedByContext),
|
|
3068
|
-
'aria-invalid': useContext(InputInvalidContext)
|
|
3069
|
-
};
|
|
3070
|
-
}
|
|
3071
|
-
function withInputAttributes(Component, args) {
|
|
3072
|
-
function ComponentWithInputAttributes(props) {
|
|
3073
|
-
return /*#__PURE__*/jsx(Component, {
|
|
3074
|
-
inputAttributes: useInputAttributes(args),
|
|
3075
|
-
...props
|
|
3076
|
-
});
|
|
3077
|
-
}
|
|
3078
|
-
ComponentWithInputAttributes.displayName = `withInputAttributes(${Component.displayName || Component.name || 'Component'})`;
|
|
3079
|
-
return ComponentWithInputAttributes;
|
|
3080
|
-
}
|
|
3081
|
-
|
|
3082
3087
|
var messages$9 = defineMessages({
|
|
3083
3088
|
monthLabel: {
|
|
3084
3089
|
id: "neptune.DateInput.month.label"
|
|
@@ -4896,11 +4901,11 @@ const Field = ({
|
|
|
4896
4901
|
'has-error': hasError,
|
|
4897
4902
|
'has-info': sentiment === Sentiment.NEUTRAL
|
|
4898
4903
|
}, className),
|
|
4899
|
-
children: [/*#__PURE__*/jsxs(Label, {
|
|
4904
|
+
children: [label != null ? /*#__PURE__*/jsxs(Label, {
|
|
4900
4905
|
id: labelId,
|
|
4901
4906
|
htmlFor: inputId,
|
|
4902
4907
|
children: [label, children]
|
|
4903
|
-
}), message && /*#__PURE__*/jsx(InlineAlert, {
|
|
4908
|
+
}) : children, message && /*#__PURE__*/jsx(InlineAlert, {
|
|
4904
4909
|
type: sentiment,
|
|
4905
4910
|
id: descriptionId,
|
|
4906
4911
|
children: message
|