@transferwise/components 0.0.0-experimental-991400c → 0.0.0-experimental-b7a6b24
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 +0 -7
- package/build/index.esm.js.map +1 -1
- package/build/index.js +0 -7
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/alert/Alert.js +0 -8
- package/src/alert/Alert.spec.js +0 -9
- package/src/inputs/SelectInput.story.tsx +22 -0
- package/src/inputs/_BottomSheet.less +1 -1
- package/src/inputs/_Popover.less +1 -1
- package/src/main.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/alert/Alert.js"],"names":[],"mappings":";AA8BA,
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/alert/Alert.js"],"names":[],"mappings":";AA8BA,gEAyFC"}
|
package/package.json
CHANGED
package/src/alert/Alert.js
CHANGED
|
@@ -62,13 +62,6 @@ const Alert = (props) => {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function calculateAriaLive() {
|
|
66
|
-
if ([Sentiment.NEGATIVE, Sentiment.POSITIVE, Sentiment.WARNING].includes(mappedType)) {
|
|
67
|
-
return 'assertive';
|
|
68
|
-
}
|
|
69
|
-
return 'polite';
|
|
70
|
-
}
|
|
71
|
-
|
|
72
65
|
const handleTouchStart = () => setShouldFire(true);
|
|
73
66
|
const handleTouchMove = () => setShouldFire(false);
|
|
74
67
|
const handleTouchEnd = (event) => {
|
|
@@ -87,7 +80,6 @@ const Alert = (props) => {
|
|
|
87
80
|
return (
|
|
88
81
|
<div
|
|
89
82
|
role="alert"
|
|
90
|
-
aria-live={calculateAriaLive()}
|
|
91
83
|
className={classNames('alert d-flex', `alert-${mappedType}`, className)}
|
|
92
84
|
onTouchStart={handleTouchStart}
|
|
93
85
|
onTouchEnd={handleTouchEnd}
|
package/src/alert/Alert.spec.js
CHANGED
|
@@ -277,15 +277,6 @@ describe('Alert', () => {
|
|
|
277
277
|
expect(component).toHaveClass(classForType(Sentiment.WARNING));
|
|
278
278
|
expect(screen.getByTestId('warning-icon')).toBeInTheDocument();
|
|
279
279
|
});
|
|
280
|
-
|
|
281
|
-
it('renders warning alerts with aria-live assertive', () => {
|
|
282
|
-
component = getComponentWithType(Sentiment.WARNING);
|
|
283
|
-
expect(component).toHaveAttribute('aria-live', 'assertive');
|
|
284
|
-
});
|
|
285
|
-
it('renders neutral alerts with aria-live polite', () => {
|
|
286
|
-
component = getComponentWithType(Sentiment.NEUTRAL);
|
|
287
|
-
expect(component).toHaveAttribute('aria-live', 'polite');
|
|
288
|
-
});
|
|
289
280
|
});
|
|
290
281
|
|
|
291
282
|
describe('on touch devices', () => {
|
|
@@ -4,6 +4,8 @@ import { Flag } from '@wise/art';
|
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
|
|
6
6
|
import { getMonthNames } from '../common/dateUtils';
|
|
7
|
+
import Drawer from '../drawer';
|
|
8
|
+
import Modal from '../modal';
|
|
7
9
|
|
|
8
10
|
import { SelectInput, type SelectInputItem, SelectInputOptionContent } from './SelectInput';
|
|
9
11
|
|
|
@@ -262,3 +264,23 @@ export const Currencies: StoryObj<{
|
|
|
262
264
|
},
|
|
263
265
|
},
|
|
264
266
|
};
|
|
267
|
+
|
|
268
|
+
export const WithinDrawer: StoryObj<{
|
|
269
|
+
onChange: (value: Currency) => void;
|
|
270
|
+
}> = {
|
|
271
|
+
...Currencies,
|
|
272
|
+
decorators: [
|
|
273
|
+
(Story) => (
|
|
274
|
+
<Drawer open headerTitle="This is the title of the drawer">
|
|
275
|
+
<Story />
|
|
276
|
+
</Drawer>
|
|
277
|
+
),
|
|
278
|
+
],
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export const WithinModal: StoryObj<{
|
|
282
|
+
onChange: (value: Currency) => void;
|
|
283
|
+
}> = {
|
|
284
|
+
...Currencies,
|
|
285
|
+
decorators: [(Story) => <Modal open body={<Story />} onClose={() => {}} />],
|
|
286
|
+
};
|
package/src/inputs/_Popover.less
CHANGED