@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.esm.js
CHANGED
|
@@ -1134,6 +1134,9 @@ const Alert = props => {
|
|
|
1134
1134
|
});
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
|
+
function calculateRole() {
|
|
1138
|
+
return Sentiment.NEGATIVE === mappedType ? 'alert' : 'status';
|
|
1139
|
+
}
|
|
1137
1140
|
const handleTouchStart = () => setShouldFire(true);
|
|
1138
1141
|
const handleTouchMove = () => setShouldFire(false);
|
|
1139
1142
|
const handleTouchEnd = event => {
|
|
@@ -1150,8 +1153,8 @@ const Alert = props => {
|
|
|
1150
1153
|
setShouldFire(false);
|
|
1151
1154
|
};
|
|
1152
1155
|
return /*#__PURE__*/jsxs("div", {
|
|
1153
|
-
role: "alert",
|
|
1154
1156
|
className: classNames('alert d-flex', `alert-${mappedType}`, className),
|
|
1157
|
+
"data-testid": "alert",
|
|
1155
1158
|
onTouchStart: handleTouchStart,
|
|
1156
1159
|
onTouchEnd: handleTouchEnd,
|
|
1157
1160
|
onTouchMove: handleTouchMove,
|
|
@@ -1160,17 +1163,20 @@ const Alert = props => {
|
|
|
1160
1163
|
"data-testid": variant,
|
|
1161
1164
|
children: [generateIcon(), /*#__PURE__*/jsxs("div", {
|
|
1162
1165
|
className: "alert__message",
|
|
1163
|
-
children: [
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1166
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1167
|
+
role: calculateRole(),
|
|
1168
|
+
children: [title && /*#__PURE__*/jsx(Title, {
|
|
1169
|
+
className: "m-b-1",
|
|
1170
|
+
type: Typography.TITLE_BODY,
|
|
1171
|
+
children: title
|
|
1172
|
+
}), /*#__PURE__*/jsx(Body, {
|
|
1173
|
+
as: "span",
|
|
1174
|
+
className: "d-block",
|
|
1175
|
+
type: Typography.BODY_LARGE,
|
|
1176
|
+
children: children || /*#__PURE__*/jsx(InlineMarkdown$1, {
|
|
1177
|
+
children: message
|
|
1178
|
+
})
|
|
1179
|
+
})]
|
|
1174
1180
|
}), action && /*#__PURE__*/jsx(Link, {
|
|
1175
1181
|
href: action.href,
|
|
1176
1182
|
className: "m-t-1",
|