@transferwise/components 0.0.0-experimental-0b6dfe0 → 0.0.0-experimental-c279974
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 +18 -12
- package/build/index.esm.js.map +1 -1
- package/build/index.js +18 -12
- package/build/index.js.map +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/alert/Alert.js +15 -9
- package/src/alert/Alert.spec.js +22 -13
- package/src/alert/withArrow/withArrow.spec.js +4 -4
package/build/index.js
CHANGED
|
@@ -1167,6 +1167,9 @@ const Alert = props => {
|
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
+
function calculateRole() {
|
|
1171
|
+
return exports.Sentiment.NEGATIVE === mappedType ? 'alert' : 'status';
|
|
1172
|
+
}
|
|
1170
1173
|
const handleTouchStart = () => setShouldFire(true);
|
|
1171
1174
|
const handleTouchMove = () => setShouldFire(false);
|
|
1172
1175
|
const handleTouchEnd = event => {
|
|
@@ -1183,8 +1186,8 @@ const Alert = props => {
|
|
|
1183
1186
|
setShouldFire(false);
|
|
1184
1187
|
};
|
|
1185
1188
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1186
|
-
role: "alert",
|
|
1187
1189
|
className: classNames__default.default('alert d-flex', `alert-${mappedType}`, className),
|
|
1190
|
+
"data-testid": "alert",
|
|
1188
1191
|
onTouchStart: handleTouchStart,
|
|
1189
1192
|
onTouchEnd: handleTouchEnd,
|
|
1190
1193
|
onTouchMove: handleTouchMove,
|
|
@@ -1193,17 +1196,20 @@ const Alert = props => {
|
|
|
1193
1196
|
"data-testid": variant,
|
|
1194
1197
|
children: [generateIcon(), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1195
1198
|
className: "alert__message",
|
|
1196
|
-
children: [
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1199
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1200
|
+
role: calculateRole(),
|
|
1201
|
+
children: [title && /*#__PURE__*/jsxRuntime.jsx(Title, {
|
|
1202
|
+
className: "m-b-1",
|
|
1203
|
+
type: exports.Typography.TITLE_BODY,
|
|
1204
|
+
children: title
|
|
1205
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
1206
|
+
as: "span",
|
|
1207
|
+
className: "d-block",
|
|
1208
|
+
type: exports.Typography.BODY_LARGE,
|
|
1209
|
+
children: children || /*#__PURE__*/jsxRuntime.jsx(InlineMarkdown$1, {
|
|
1210
|
+
children: message
|
|
1211
|
+
})
|
|
1212
|
+
})]
|
|
1207
1213
|
}), action && /*#__PURE__*/jsxRuntime.jsx(Link, {
|
|
1208
1214
|
href: action.href,
|
|
1209
1215
|
className: "m-t-1",
|