@transferwise/components 46.14.0 → 46.15.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.esm.js +72 -180
- package/build/index.esm.js.map +1 -1
- package/build/index.js +74 -182
- package/build/index.js.map +1 -1
- package/build/types/actionButton/ActionButton.d.ts +1 -1
- package/build/types/common/Option/Option.d.ts.map +1 -1
- package/build/types/common/RadioButton/RadioButton.d.ts +10 -34
- package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
- package/build/types/common/RadioButton/index.d.ts +1 -1
- package/build/types/common/RadioButton/index.d.ts.map +1 -1
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/radio/Radio.d.ts +10 -21
- package/build/types/radio/Radio.d.ts.map +1 -1
- package/build/types/radio/index.d.ts +2 -2
- package/build/types/radio/index.d.ts.map +1 -1
- package/build/types/radioGroup/RadioGroup.d.ts +10 -26
- package/build/types/radioGroup/RadioGroup.d.ts.map +1 -1
- package/build/types/radioGroup/index.d.ts +2 -1
- package/build/types/radioGroup/index.d.ts.map +1 -1
- package/build/types/radioOption/RadioOption.d.ts +15 -23
- package/build/types/radioOption/RadioOption.d.ts.map +1 -1
- package/build/types/radioOption/index.d.ts +2 -1
- package/build/types/radioOption/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/Option/Option.tsx +0 -1
- package/src/common/RadioButton/RadioButton.tsx +43 -0
- package/src/index.ts +3 -0
- package/src/radio/{Radio.story.js → Radio.story.tsx} +0 -3
- package/src/radio/{Radio.js → Radio.tsx} +18 -28
- package/src/radio/index.ts +2 -0
- package/src/radioGroup/RadioGroup.spec.js +24 -26
- package/src/radioGroup/{RadioGroup.story.js → RadioGroup.story.tsx} +0 -3
- package/src/radioGroup/RadioGroup.tsx +39 -0
- package/src/radioGroup/index.ts +2 -0
- package/src/radioOption/RadioOption.spec.js +4 -4
- package/src/radioOption/{RadioOption.story.js → RadioOption.story.tsx} +4 -4
- package/src/radioOption/RadioOption.tsx +60 -0
- package/src/radioOption/index.ts +2 -0
- package/src/common/RadioButton/RadioButton.js +0 -41
- package/src/radio/index.js +0 -3
- package/src/radioGroup/RadioGroup.js +0 -66
- package/src/radioGroup/index.js +0 -1
- package/src/radioOption/RadioOption.js +0 -81
- package/src/radioOption/index.js +0 -1
- /package/src/common/RadioButton/{RadioButton.spec.js → RadioButton.spec.tsx} +0 -0
- /package/src/common/RadioButton/__snapshots__/{RadioButton.spec.js.snap → RadioButton.spec.tsx.snap} +0 -0
- /package/src/common/RadioButton/{index.js → index.ts} +0 -0
- /package/src/radio/{Radio.rtl.spec.js → Radio.rtl.spec.tsx} +0 -0
- /package/src/radio/__snapshots__/{Radio.rtl.spec.js.snap → Radio.rtl.spec.tsx.snap} +0 -0
package/build/index.js
CHANGED
|
@@ -9972,54 +9972,42 @@ Provider.defaultProps = {
|
|
|
9972
9972
|
};
|
|
9973
9973
|
var Provider$1 = Provider;
|
|
9974
9974
|
|
|
9975
|
-
|
|
9975
|
+
function RadioButton({
|
|
9976
9976
|
id,
|
|
9977
|
-
value,
|
|
9977
|
+
value = '',
|
|
9978
9978
|
name,
|
|
9979
9979
|
checked,
|
|
9980
9980
|
onChange,
|
|
9981
9981
|
disabled,
|
|
9982
9982
|
readOnly
|
|
9983
|
-
})
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
className:
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
})
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
value: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
10010
|
-
readOnly: PropTypes__default.default.bool
|
|
10011
|
-
};
|
|
10012
|
-
RadioButton.defaultProps = {
|
|
10013
|
-
checked: false,
|
|
10014
|
-
onChange: () => {},
|
|
10015
|
-
disabled: false,
|
|
10016
|
-
id: null,
|
|
10017
|
-
value: '',
|
|
10018
|
-
readOnly: false
|
|
10019
|
-
};
|
|
10020
|
-
var RadioButton$1 = RadioButton;
|
|
9983
|
+
}) {
|
|
9984
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9985
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("input", {
|
|
9986
|
+
type: "radio",
|
|
9987
|
+
className: "sr-only",
|
|
9988
|
+
id: id,
|
|
9989
|
+
value: value,
|
|
9990
|
+
name: name,
|
|
9991
|
+
checked: checked,
|
|
9992
|
+
disabled: disabled || readOnly,
|
|
9993
|
+
onChange: () => {
|
|
9994
|
+
if (!checked) {
|
|
9995
|
+
onChange?.(value);
|
|
9996
|
+
}
|
|
9997
|
+
}
|
|
9998
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
9999
|
+
className: classNames__default.default('tw-radio-button', {
|
|
10000
|
+
checked,
|
|
10001
|
+
disabled: disabled || readOnly
|
|
10002
|
+
}),
|
|
10003
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
10004
|
+
className: "tw-radio-check"
|
|
10005
|
+
})
|
|
10006
|
+
})]
|
|
10007
|
+
});
|
|
10008
|
+
}
|
|
10021
10009
|
|
|
10022
|
-
|
|
10010
|
+
function Radio({
|
|
10023
10011
|
label,
|
|
10024
10012
|
id,
|
|
10025
10013
|
disabled,
|
|
@@ -10027,7 +10015,7 @@ const Radio = ({
|
|
|
10027
10015
|
avatar,
|
|
10028
10016
|
secondary,
|
|
10029
10017
|
...otherProps
|
|
10030
|
-
})
|
|
10018
|
+
}) {
|
|
10031
10019
|
const {
|
|
10032
10020
|
isModern
|
|
10033
10021
|
} = componentsTheming.useTheme();
|
|
@@ -10043,7 +10031,7 @@ const Radio = ({
|
|
|
10043
10031
|
htmlFor: id,
|
|
10044
10032
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
10045
10033
|
className: classNames__default.default(isModern ? 'm-r-2' : 'p-r-2', 'np-radio-button'),
|
|
10046
|
-
children: /*#__PURE__*/jsxRuntime.jsx(RadioButton
|
|
10034
|
+
children: /*#__PURE__*/jsxRuntime.jsx(RadioButton, {
|
|
10047
10035
|
id: id,
|
|
10048
10036
|
disabled: disabled,
|
|
10049
10037
|
...otherProps
|
|
@@ -10065,100 +10053,36 @@ const Radio = ({
|
|
|
10065
10053
|
})]
|
|
10066
10054
|
})
|
|
10067
10055
|
});
|
|
10068
|
-
}
|
|
10069
|
-
Radio.propTypes = {
|
|
10070
|
-
avatar: PropTypes__default.default.element,
|
|
10071
|
-
checked: PropTypes__default.default.bool,
|
|
10072
|
-
disabled: PropTypes__default.default.bool,
|
|
10073
|
-
id: PropTypes__default.default.string,
|
|
10074
|
-
label: PropTypes__default.default.string.isRequired,
|
|
10075
|
-
name: PropTypes__default.default.string.isRequired,
|
|
10076
|
-
onChange: PropTypes__default.default.func.isRequired,
|
|
10077
|
-
secondary: PropTypes__default.default.string,
|
|
10078
|
-
value: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
10079
|
-
className: PropTypes__default.default.string
|
|
10080
|
-
};
|
|
10081
|
-
Radio.defaultProps = {
|
|
10082
|
-
avatar: undefined,
|
|
10083
|
-
checked: false,
|
|
10084
|
-
disabled: false,
|
|
10085
|
-
id: null,
|
|
10086
|
-
secondary: null,
|
|
10087
|
-
value: '',
|
|
10088
|
-
className: undefined
|
|
10089
|
-
};
|
|
10090
|
-
var Radio$1 = Radio;
|
|
10056
|
+
}
|
|
10091
10057
|
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
children: radios.map(({
|
|
10118
|
-
id,
|
|
10119
|
-
avatar,
|
|
10120
|
-
value,
|
|
10121
|
-
label,
|
|
10122
|
-
disabled,
|
|
10123
|
-
secondary,
|
|
10124
|
-
readOnly
|
|
10125
|
-
}, index) => /*#__PURE__*/jsxRuntime.jsx(Radio$1
|
|
10126
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
10127
|
-
, {
|
|
10128
|
-
id: id,
|
|
10129
|
-
value: value,
|
|
10130
|
-
label: label,
|
|
10131
|
-
name: name,
|
|
10132
|
-
disabled: disabled,
|
|
10133
|
-
checked: selectedValue === value,
|
|
10134
|
-
secondary: secondary,
|
|
10135
|
-
readOnly: readOnly,
|
|
10136
|
-
avatar: avatar,
|
|
10137
|
-
onChange: value_ => this.handleOnChange(value_)
|
|
10138
|
-
}, index))
|
|
10139
|
-
}) : null;
|
|
10140
|
-
}
|
|
10058
|
+
function RadioGroup({
|
|
10059
|
+
name,
|
|
10060
|
+
radios,
|
|
10061
|
+
selectedValue: controlledValue,
|
|
10062
|
+
onChange
|
|
10063
|
+
}) {
|
|
10064
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(controlledValue);
|
|
10065
|
+
return radios.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
10066
|
+
role: "radiogroup",
|
|
10067
|
+
children: radios.map(({
|
|
10068
|
+
value = '',
|
|
10069
|
+
...restProps
|
|
10070
|
+
}, index) => /*#__PURE__*/jsxRuntime.jsx(Radio
|
|
10071
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
10072
|
+
, {
|
|
10073
|
+
...restProps,
|
|
10074
|
+
name: name,
|
|
10075
|
+
value: value,
|
|
10076
|
+
checked: value === uncontrolledValue,
|
|
10077
|
+
onChange: nextValue => {
|
|
10078
|
+
setUncontrolledValue(nextValue);
|
|
10079
|
+
onChange(nextValue);
|
|
10080
|
+
}
|
|
10081
|
+
}, index))
|
|
10082
|
+
}) : null;
|
|
10141
10083
|
}
|
|
10142
|
-
RadioGroup.propTypes = {
|
|
10143
|
-
radios: PropTypes__default.default.arrayOf(PropTypes__default.default.shape({
|
|
10144
|
-
id: PropTypes__default.default.string,
|
|
10145
|
-
avatar: PropTypes__default.default.element,
|
|
10146
|
-
value: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
10147
|
-
secondary: PropTypes__default.default.string,
|
|
10148
|
-
label: PropTypes__default.default.string.isRequired,
|
|
10149
|
-
disabled: PropTypes__default.default.bool,
|
|
10150
|
-
readOnly: PropTypes__default.default.bool
|
|
10151
|
-
})).isRequired,
|
|
10152
|
-
onChange: PropTypes__default.default.func.isRequired,
|
|
10153
|
-
selectedValue: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
10154
|
-
name: PropTypes__default.default.string.isRequired
|
|
10155
|
-
};
|
|
10156
|
-
RadioGroup.defaultProps = {
|
|
10157
|
-
selectedValue: null
|
|
10158
|
-
};
|
|
10159
|
-
var RadioGroup$1 = RadioGroup;
|
|
10160
10084
|
|
|
10161
|
-
|
|
10085
|
+
function RadioOption({
|
|
10162
10086
|
'aria-label': ariaLabel,
|
|
10163
10087
|
media,
|
|
10164
10088
|
title,
|
|
@@ -10173,22 +10097,19 @@ const RadioOption = ({
|
|
|
10173
10097
|
showMediaCircle,
|
|
10174
10098
|
showMediaAtAllSizes,
|
|
10175
10099
|
isContainerAligned
|
|
10176
|
-
})
|
|
10177
|
-
const sharedProps = {
|
|
10178
|
-
'aria-label': ariaLabel,
|
|
10179
|
-
media,
|
|
10180
|
-
title,
|
|
10181
|
-
content,
|
|
10182
|
-
name,
|
|
10183
|
-
complex,
|
|
10184
|
-
disabled,
|
|
10185
|
-
showMediaCircle,
|
|
10186
|
-
showMediaAtAllSizes,
|
|
10187
|
-
isContainerAligned
|
|
10188
|
-
};
|
|
10100
|
+
}) {
|
|
10189
10101
|
return /*#__PURE__*/jsxRuntime.jsx(Option$2, {
|
|
10190
|
-
|
|
10191
|
-
|
|
10102
|
+
"aria-label": ariaLabel,
|
|
10103
|
+
media: media,
|
|
10104
|
+
title: title,
|
|
10105
|
+
content: content,
|
|
10106
|
+
name: name,
|
|
10107
|
+
complex: complex,
|
|
10108
|
+
disabled: disabled,
|
|
10109
|
+
showMediaCircle: showMediaCircle,
|
|
10110
|
+
showMediaAtAllSizes: showMediaAtAllSizes,
|
|
10111
|
+
isContainerAligned: isContainerAligned,
|
|
10112
|
+
button: /*#__PURE__*/jsxRuntime.jsx(RadioButton, {
|
|
10192
10113
|
id: id,
|
|
10193
10114
|
name: name,
|
|
10194
10115
|
checked: checked,
|
|
@@ -10197,36 +10118,7 @@ const RadioOption = ({
|
|
|
10197
10118
|
onChange: onChange
|
|
10198
10119
|
})
|
|
10199
10120
|
});
|
|
10200
|
-
}
|
|
10201
|
-
RadioOption.propTypes = {
|
|
10202
|
-
'aria-label': PropTypes__default.default.string,
|
|
10203
|
-
media: PropTypes__default.default.node,
|
|
10204
|
-
id: PropTypes__default.default.string.isRequired,
|
|
10205
|
-
name: PropTypes__default.default.string.isRequired,
|
|
10206
|
-
title: PropTypes__default.default.node.isRequired,
|
|
10207
|
-
content: PropTypes__default.default.node,
|
|
10208
|
-
checked: PropTypes__default.default.bool,
|
|
10209
|
-
onChange: PropTypes__default.default.func.isRequired,
|
|
10210
|
-
complex: PropTypes__default.default.bool,
|
|
10211
|
-
disabled: PropTypes__default.default.bool,
|
|
10212
|
-
value: PropTypes__default.default.string,
|
|
10213
|
-
showMediaCircle: PropTypes__default.default.bool,
|
|
10214
|
-
showMediaAtAllSizes: PropTypes__default.default.bool,
|
|
10215
|
-
isContainerAligned: PropTypes__default.default.bool
|
|
10216
|
-
};
|
|
10217
|
-
RadioOption.defaultProps = {
|
|
10218
|
-
'aria-label': undefined,
|
|
10219
|
-
media: null,
|
|
10220
|
-
content: null,
|
|
10221
|
-
checked: false,
|
|
10222
|
-
complex: false,
|
|
10223
|
-
disabled: false,
|
|
10224
|
-
showMediaCircle: true,
|
|
10225
|
-
showMediaAtAllSizes: false,
|
|
10226
|
-
isContainerAligned: false,
|
|
10227
|
-
value: ''
|
|
10228
|
-
};
|
|
10229
|
-
var RadioOption$1 = RadioOption;
|
|
10121
|
+
}
|
|
10230
10122
|
|
|
10231
10123
|
const Section = ({
|
|
10232
10124
|
children,
|
|
@@ -15355,9 +15247,9 @@ exports.PromoCard = PromoCard$1;
|
|
|
15355
15247
|
exports.PromoCardGroup = PromoCard$1;
|
|
15356
15248
|
exports.Provider = Provider$1;
|
|
15357
15249
|
exports.RTL_LANGUAGES = RTL_LANGUAGES;
|
|
15358
|
-
exports.Radio = Radio
|
|
15359
|
-
exports.RadioGroup = RadioGroup
|
|
15360
|
-
exports.RadioOption = RadioOption
|
|
15250
|
+
exports.Radio = Radio;
|
|
15251
|
+
exports.RadioGroup = RadioGroup;
|
|
15252
|
+
exports.RadioOption = RadioOption;
|
|
15361
15253
|
exports.SUPPORTED_LANGUAGES = SUPPORTED_LANGUAGES;
|
|
15362
15254
|
exports.SearchInput = SearchInput;
|
|
15363
15255
|
exports.Section = Section;
|