@transferwise/components 46.167.0 → 46.168.1
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/README.md +1 -1
- package/build/Link/Link.js.map +1 -1
- package/build/Link/Link.mjs.map +1 -1
- package/build/Loader/Loader.js.map +1 -1
- package/build/Loader/Loader.mjs.map +1 -1
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.js +2 -1
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.mjs +2 -1
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/Prompt/Snackbar/Snackbar.js +202 -0
- package/build/Prompt/Snackbar/Snackbar.js.map +1 -0
- package/build/Prompt/Snackbar/Snackbar.messages.js +14 -0
- package/build/Prompt/Snackbar/Snackbar.messages.js.map +1 -0
- package/build/Prompt/Snackbar/Snackbar.messages.mjs +10 -0
- package/build/Prompt/Snackbar/Snackbar.messages.mjs.map +1 -0
- package/build/Prompt/Snackbar/Snackbar.mjs +200 -0
- package/build/Prompt/Snackbar/Snackbar.mjs.map +1 -0
- package/build/Prompt/Snackbar/SnackbarContext.js.map +1 -0
- package/build/Prompt/Snackbar/SnackbarContext.mjs.map +1 -0
- package/build/Prompt/Snackbar/SnackbarPortal.js +12 -0
- package/build/Prompt/Snackbar/SnackbarPortal.js.map +1 -0
- package/build/Prompt/Snackbar/SnackbarPortal.mjs +8 -0
- package/build/Prompt/Snackbar/SnackbarPortal.mjs.map +1 -0
- package/build/Prompt/Snackbar/SnackbarProvider.js +42 -0
- package/build/Prompt/Snackbar/SnackbarProvider.js.map +1 -0
- package/build/Prompt/Snackbar/SnackbarProvider.mjs +38 -0
- package/build/Prompt/Snackbar/SnackbarProvider.mjs.map +1 -0
- package/build/Prompt/Snackbar/constants.js +17 -0
- package/build/Prompt/Snackbar/constants.js.map +1 -0
- package/build/Prompt/Snackbar/constants.mjs +11 -0
- package/build/Prompt/Snackbar/constants.mjs.map +1 -0
- package/build/Prompt/Snackbar/useSnackbar.js.map +1 -0
- package/build/Prompt/Snackbar/useSnackbar.mjs.map +1 -0
- package/build/Prompt/Snackbar/useSnackbarAutoDismiss.js +66 -0
- package/build/Prompt/Snackbar/useSnackbarAutoDismiss.js.map +1 -0
- package/build/Prompt/Snackbar/useSnackbarAutoDismiss.mjs +62 -0
- package/build/Prompt/Snackbar/useSnackbarAutoDismiss.mjs.map +1 -0
- package/build/Prompt/Snackbar/useSnackbarManager.js +153 -0
- package/build/Prompt/Snackbar/useSnackbarManager.js.map +1 -0
- package/build/Prompt/Snackbar/useSnackbarManager.mjs +149 -0
- package/build/Prompt/Snackbar/useSnackbarManager.mjs.map +1 -0
- package/build/Prompt/Snackbar/useSnackbarSwipeDismiss.js +122 -0
- package/build/Prompt/Snackbar/useSnackbarSwipeDismiss.js.map +1 -0
- package/build/Prompt/Snackbar/useSnackbarSwipeDismiss.mjs +118 -0
- package/build/Prompt/Snackbar/useSnackbarSwipeDismiss.mjs.map +1 -0
- package/build/Provider/Provider.js +1 -24
- package/build/Provider/Provider.js.map +1 -1
- package/build/Provider/Provider.mjs +1 -24
- package/build/Provider/Provider.mjs.map +1 -1
- package/build/Section/Section.js.map +1 -1
- package/build/Section/Section.mjs.map +1 -1
- package/build/WithDisplayFormat/WithDisplayFormat.js +20 -8
- package/build/WithDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/WithDisplayFormat/WithDisplayFormat.mjs +20 -8
- package/build/WithDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/build/_deprecated/Select/Select.js +1 -1
- package/build/_deprecated/Select/Select.js.map +1 -1
- package/build/_deprecated/Select/Select.mjs +1 -1
- package/build/_deprecated/Select/Select.mjs.map +1 -1
- package/build/common/BottomSheet/BottomSheet.js +1 -3
- package/build/common/BottomSheet/BottomSheet.js.map +1 -1
- package/build/common/BottomSheet/BottomSheet.mjs +1 -3
- package/build/common/BottomSheet/BottomSheet.mjs.map +1 -1
- package/build/i18n/cs.json +1 -0
- package/build/i18n/cs.json.js +1 -0
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +1 -0
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/en.json +1 -0
- package/build/i18n/en.json.js +1 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +1 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/es.json +1 -0
- package/build/i18n/es.json.js +1 -0
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +1 -0
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/id.json +1 -0
- package/build/i18n/id.json.js +1 -0
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +1 -0
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/ja.json +1 -0
- package/build/i18n/ja.json.js +1 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +1 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +1 -0
- package/build/i18n/nl.json.js +1 -0
- package/build/i18n/nl.json.js.map +1 -1
- package/build/i18n/nl.json.mjs +1 -0
- package/build/i18n/nl.json.mjs.map +1 -1
- package/build/i18n/pt.json +1 -0
- package/build/i18n/pt.json.js +1 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +1 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +1 -0
- package/build/i18n/ro.json.js +1 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +1 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +1 -0
- package/build/i18n/ru.json.js +1 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +1 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/uk.json +1 -0
- package/build/i18n/uk.json.js +1 -0
- package/build/i18n/uk.json.js.map +1 -1
- package/build/i18n/uk.json.mjs +1 -0
- package/build/i18n/uk.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +1 -0
- package/build/i18n/zh-HK.json.js +1 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +1 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/index.js +3 -3
- package/build/index.mjs +3 -3
- package/build/main.css +138 -75
- package/build/styles/IconButton/IconButton.css +3 -4
- package/build/styles/Inputs/InputGroup/InputGroup.css +1 -0
- package/build/styles/Prompt/Snackbar/Snackbar.css +134 -0
- package/build/styles/main.css +138 -75
- package/build/test-utils/assets/apple-pay-logo.svg +0 -0
- package/build/types/Link/Link.d.ts +1 -1
- package/build/types/Loader/Loader.d.ts +1 -1
- package/build/types/Prompt/PrimitivePrompt/PrimitivePrompt.d.ts +11 -0
- package/build/types/Prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/Prompt/Snackbar/Snackbar.d.ts +62 -0
- package/build/types/Prompt/Snackbar/Snackbar.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/Snackbar.messages.d.ts +9 -0
- package/build/types/Prompt/Snackbar/Snackbar.messages.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/Snackbar.types.d.ts +12 -0
- package/build/types/Prompt/Snackbar/Snackbar.types.d.ts.map +1 -0
- package/build/types/{Snackbar → Prompt/Snackbar}/SnackbarContext.d.ts +2 -2
- package/build/types/Prompt/Snackbar/SnackbarContext.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/SnackbarPortal.d.ts +4 -0
- package/build/types/Prompt/Snackbar/SnackbarPortal.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/SnackbarProvider.d.ts +13 -0
- package/build/types/Prompt/Snackbar/SnackbarProvider.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/constants.d.ts +9 -0
- package/build/types/Prompt/Snackbar/constants.d.ts.map +1 -0
- package/build/types/{Snackbar → Prompt/Snackbar}/index.d.ts +1 -1
- package/build/types/Prompt/Snackbar/index.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/useSnackbar.d.ts +3 -0
- package/build/types/Prompt/Snackbar/useSnackbar.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/useSnackbarAutoDismiss.d.ts +13 -0
- package/build/types/Prompt/Snackbar/useSnackbarAutoDismiss.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/useSnackbarManager.d.ts +20 -0
- package/build/types/Prompt/Snackbar/useSnackbarManager.d.ts.map +1 -0
- package/build/types/Prompt/Snackbar/useSnackbarSwipeDismiss.d.ts +20 -0
- package/build/types/Prompt/Snackbar/useSnackbarSwipeDismiss.d.ts.map +1 -0
- package/build/types/Section/Section.d.ts +1 -1
- package/build/types/WithDisplayFormat/WithDisplayFormat.d.ts +6 -4
- package/build/types/WithDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/types/_deprecated/Select/Select.d.ts +1 -1
- package/build/types/common/BottomSheet/BottomSheet.d.ts +1 -3
- package/build/types/common/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/index.d.ts +5 -5
- package/build/types/index.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +2 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/IconButton/IconButton.css +3 -4
- package/src/IconButton/IconButton.less +14 -1
- package/src/InputWithDisplayFormat/_stories/InputWithDisplayFormat.story.tsx +39 -0
- package/src/Inputs/InputGroup/InputGroup.css +1 -0
- package/src/Inputs/InputGroup/InputGroup.less +1 -0
- package/src/Inputs/InputGroup/_stories/InputGroup.test.story.tsx +16 -0
- package/src/Inputs/SearchInput/_stories/SearchInput.test.story.tsx +9 -0
- package/src/Inputs/SelectInput/_stories/SelectInput.test.story.tsx +12 -0
- package/src/Link/Link.tsx +1 -1
- package/src/ListItem/AdditionalInfo/_stories/ListItemAdditionalInfo.story.tsx +1 -1
- package/src/ListItem/AvatarView/_stories/ListItemAvatarView.story.tsx +3 -3
- package/src/ListItem/_stories/ListItem.disabled.story.tsx +1 -1
- package/src/ListItem/_stories/ListItem.scenarios.story.tsx +2 -2
- package/src/Loader/Loader.tsx +1 -1
- package/src/MoneyInput/_stories/MoneyInput.test.story.tsx +11 -0
- package/src/PhoneNumberInput/_stories/PhoneNumberInput.test.story.tsx +30 -0
- package/src/Prompt/PrimitivePrompt/PrimitivePrompt.test.tsx +24 -1
- package/src/Prompt/PrimitivePrompt/PrimitivePrompt.tsx +8 -2
- package/src/Prompt/Snackbar/Snackbar.css +134 -0
- package/src/Prompt/Snackbar/Snackbar.less +159 -0
- package/src/Prompt/Snackbar/Snackbar.messages.ts +9 -0
- package/src/Prompt/Snackbar/Snackbar.test.tsx +1011 -0
- package/src/Prompt/Snackbar/Snackbar.tsx +243 -0
- package/src/Prompt/Snackbar/Snackbar.types.ts +17 -0
- package/src/{Snackbar → Prompt/Snackbar}/SnackbarContext.ts +2 -2
- package/src/Prompt/Snackbar/SnackbarPortal.tsx +8 -0
- package/src/Prompt/Snackbar/SnackbarProvider.test.tsx +783 -0
- package/src/Prompt/Snackbar/SnackbarProvider.tsx +41 -0
- package/src/Prompt/Snackbar/_stories/Snackbar.accessibility.docs.mdx +58 -0
- package/src/{Snackbar → Prompt/Snackbar}/_stories/Snackbar.rtl.test.story.tsx +17 -9
- package/src/Prompt/Snackbar/_stories/Snackbar.story.tsx +416 -0
- package/src/Prompt/Snackbar/_stories/Snackbar.test.story.tsx +263 -0
- package/src/Prompt/Snackbar/constants.ts +10 -0
- package/src/{Snackbar → Prompt/Snackbar}/index.ts +1 -1
- package/src/Prompt/Snackbar/useSnackbarAutoDismiss.ts +74 -0
- package/src/Prompt/Snackbar/useSnackbarManager.ts +169 -0
- package/src/Prompt/Snackbar/useSnackbarSwipeDismiss.ts +154 -0
- package/src/Provider/Provider.tsx +1 -1
- package/src/Section/Section.tsx +1 -1
- package/src/WithDisplayFormat/WithDisplayFormat.test.js +90 -7
- package/src/WithDisplayFormat/WithDisplayFormat.tsx +30 -9
- package/src/_deprecated/Select/Select.tsx +1 -1
- package/src/_deprecated/Select/_stories/Select.story.tsx +1 -1
- package/src/common/BottomSheet/BottomSheet.tsx +1 -3
- package/src/i18n/cs.json +1 -0
- package/src/i18n/en.json +1 -0
- package/src/i18n/es.json +1 -0
- package/src/i18n/id.json +1 -0
- package/src/i18n/ja.json +1 -0
- package/src/i18n/nl.json +1 -0
- package/src/i18n/pt.json +1 -0
- package/src/i18n/ro.json +1 -0
- package/src/i18n/ru.json +1 -0
- package/src/i18n/uk.json +1 -0
- package/src/i18n/zh-HK.json +1 -0
- package/src/index.ts +5 -5
- package/src/main.css +138 -75
- package/src/main.less +1 -1
- package/src/test-utils/assets/apple-pay-logo.svg +0 -0
- package/build/Snackbar/Snackbar.js +0 -128
- package/build/Snackbar/Snackbar.js.map +0 -1
- package/build/Snackbar/Snackbar.mjs +0 -123
- package/build/Snackbar/Snackbar.mjs.map +0 -1
- package/build/Snackbar/SnackbarContext.js.map +0 -1
- package/build/Snackbar/SnackbarContext.mjs.map +0 -1
- package/build/Snackbar/SnackbarProvider.js +0 -46
- package/build/Snackbar/SnackbarProvider.js.map +0 -1
- package/build/Snackbar/SnackbarProvider.mjs +0 -42
- package/build/Snackbar/SnackbarProvider.mjs.map +0 -1
- package/build/Snackbar/useSnackbar.js.map +0 -1
- package/build/Snackbar/useSnackbar.mjs.map +0 -1
- package/build/styles/Snackbar/Snackbar.css +0 -71
- package/build/types/Snackbar/Snackbar.d.ts +0 -16
- package/build/types/Snackbar/Snackbar.d.ts.map +0 -1
- package/build/types/Snackbar/SnackbarContext.d.ts.map +0 -1
- package/build/types/Snackbar/SnackbarProvider.d.ts +0 -6
- package/build/types/Snackbar/SnackbarProvider.d.ts.map +0 -1
- package/build/types/Snackbar/index.d.ts.map +0 -1
- package/build/types/Snackbar/useSnackbar.d.ts +0 -3
- package/build/types/Snackbar/useSnackbar.d.ts.map +0 -1
- package/src/Snackbar/Snackbar.css +0 -71
- package/src/Snackbar/Snackbar.less +0 -80
- package/src/Snackbar/Snackbar.test.tsx +0 -206
- package/src/Snackbar/Snackbar.tsx +0 -129
- package/src/Snackbar/SnackbarProvider.tsx +0 -33
- package/src/Snackbar/_stories/Snackbar.story.tsx +0 -89
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +0 -139
- /package/build/{Snackbar → Prompt/Snackbar}/SnackbarContext.js +0 -0
- /package/build/{Snackbar → Prompt/Snackbar}/SnackbarContext.mjs +0 -0
- /package/build/{Snackbar → Prompt/Snackbar}/useSnackbar.js +0 -0
- /package/build/{Snackbar → Prompt/Snackbar}/useSnackbar.mjs +0 -0
- /package/src/{Snackbar → Prompt/Snackbar}/useSnackbar.ts +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
createSandboxStory,
|
|
3
5
|
globalScope,
|
|
@@ -86,3 +88,40 @@ export const SecurityPin: Story = {
|
|
|
86
88
|
displayPattern: '*-*-*-*-*-*',
|
|
87
89
|
},
|
|
88
90
|
};
|
|
91
|
+
|
|
92
|
+
export const PropUpdates: Story = {
|
|
93
|
+
render: () => {
|
|
94
|
+
const [value, setValue] = useState('123456');
|
|
95
|
+
const [displayPattern, setDisplayPattern] = useState('**-**-**');
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<>
|
|
99
|
+
<Field id="prop-updates" label="Value and display pattern">
|
|
100
|
+
<InputWithDisplayFormat
|
|
101
|
+
id="prop-updates"
|
|
102
|
+
value={value}
|
|
103
|
+
displayPattern={displayPattern}
|
|
104
|
+
onChange={setValue}
|
|
105
|
+
/>
|
|
106
|
+
</Field>
|
|
107
|
+
<div>
|
|
108
|
+
<button type="button" onClick={() => setValue('654321')}>
|
|
109
|
+
Change value
|
|
110
|
+
</button>{' '}
|
|
111
|
+
<button type="button" onClick={() => setDisplayPattern('**/**/**')}>
|
|
112
|
+
Change pattern
|
|
113
|
+
</button>{' '}
|
|
114
|
+
<button
|
|
115
|
+
type="button"
|
|
116
|
+
onClick={() => {
|
|
117
|
+
setValue('987654');
|
|
118
|
+
setDisplayPattern('** ** **');
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
Change both
|
|
122
|
+
</button>
|
|
123
|
+
</div>
|
|
124
|
+
</>
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
};
|
|
@@ -6,6 +6,7 @@ import { useRtlDiffI18n, withRTLDiff } from '../../../../.storybook/decorators/R
|
|
|
6
6
|
import Button from '../../../Button';
|
|
7
7
|
import { Input } from '../../Input/Input';
|
|
8
8
|
import { InputGroup } from '../InputGroup';
|
|
9
|
+
import { WithOverlaidAbsoluteElement } from '../../../../.storybook/components/WithOverlaidAbsoluteElement';
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
component: InputGroup,
|
|
@@ -88,3 +89,18 @@ export const RTLDiff: Story = {
|
|
|
88
89
|
},
|
|
89
90
|
}),
|
|
90
91
|
};
|
|
92
|
+
|
|
93
|
+
export const StackingContext: Story = {
|
|
94
|
+
render: () => (
|
|
95
|
+
<WithOverlaidAbsoluteElement>
|
|
96
|
+
<InputGroup
|
|
97
|
+
addonStart={{
|
|
98
|
+
content: <Search size={24} />,
|
|
99
|
+
initialContentWidth: 24,
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<Input placeholder="addonStart only" defaultValue="non-RTL value" />
|
|
103
|
+
</InputGroup>
|
|
104
|
+
</WithOverlaidAbsoluteElement>
|
|
105
|
+
),
|
|
106
|
+
};
|
|
@@ -3,6 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
3
3
|
import { useRtlDiffI18n, withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
4
|
import { Size } from '../../../common';
|
|
5
5
|
import { SearchInput } from '../SearchInput';
|
|
6
|
+
import { WithOverlaidAbsoluteElement } from '../../../../.storybook/components/WithOverlaidAbsoluteElement';
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
component: SearchInput,
|
|
@@ -38,3 +39,11 @@ export const RTLDiff: Story = {
|
|
|
38
39
|
},
|
|
39
40
|
}),
|
|
40
41
|
};
|
|
42
|
+
|
|
43
|
+
export const StackingContext: Story = {
|
|
44
|
+
render: () => (
|
|
45
|
+
<WithOverlaidAbsoluteElement>
|
|
46
|
+
<SearchInput placeholder="Search" defaultValue="Search value" />
|
|
47
|
+
</WithOverlaidAbsoluteElement>
|
|
48
|
+
),
|
|
49
|
+
};
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
SelectInputOptionContent,
|
|
25
25
|
type SelectInputProps,
|
|
26
26
|
} from '..';
|
|
27
|
+
import { WithOverlaidAbsoluteElement } from '../../../../.storybook/components/WithOverlaidAbsoluteElement';
|
|
27
28
|
|
|
28
29
|
const meta = {
|
|
29
30
|
title: 'Forms/SelectInput/Tests',
|
|
@@ -1967,3 +1968,14 @@ export const FlagClipping: Story<TestCurrency> = {
|
|
|
1967
1968
|
),
|
|
1968
1969
|
args: flagClippingArgs,
|
|
1969
1970
|
};
|
|
1971
|
+
|
|
1972
|
+
export const StackingContext: Story<TestCurrency> = {
|
|
1973
|
+
render: (args) => (
|
|
1974
|
+
<WithOverlaidAbsoluteElement>
|
|
1975
|
+
<Field label="Overlaid element">
|
|
1976
|
+
<SelectInput {...args} />
|
|
1977
|
+
</Field>
|
|
1978
|
+
</WithOverlaidAbsoluteElement>
|
|
1979
|
+
),
|
|
1980
|
+
args: flagClippingArgs,
|
|
1981
|
+
};
|
package/src/Link/Link.tsx
CHANGED
|
@@ -14,7 +14,7 @@ export type LinkProps = PrimitiveAnchorProps &
|
|
|
14
14
|
/**
|
|
15
15
|
* Standard Link component with navigate away icon
|
|
16
16
|
*
|
|
17
|
-
* Documentation: https://
|
|
17
|
+
* Documentation: https://storybook.wise.design/?path=/docs/typography-link--docs
|
|
18
18
|
*/
|
|
19
19
|
const Link = ({
|
|
20
20
|
className,
|
|
@@ -15,7 +15,7 @@ import { action } from 'storybook/actions';
|
|
|
15
15
|
/**
|
|
16
16
|
* Use additional information to add extra details that help make the information clearer for users. Use additional information only after you've used the subtitle.
|
|
17
17
|
*
|
|
18
|
-
* Refer to the [design documentation](https://docs.wise.design/components/list-item#
|
|
18
|
+
* Refer to the [design documentation](https://docs.wise.design/components/list-item#additional-information) for more details.
|
|
19
19
|
*/
|
|
20
20
|
export default {
|
|
21
21
|
component: ListItem.AdditionalInfo,
|
|
@@ -135,7 +135,7 @@ export const Playground: Story = {
|
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* AvatarView can display different types of content including icons, profile images, and initials. <br />
|
|
138
|
-
* Refer to the [design documentation](https://docs.wise.design/components/avatar
|
|
138
|
+
* Refer to the [design documentation](https://docs.wise.design/components/avatar#media) for details.
|
|
139
139
|
*/
|
|
140
140
|
export const ContentTypes: Story = {
|
|
141
141
|
args: {
|
|
@@ -209,7 +209,7 @@ export const ContentTypes: Story = {
|
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
211
|
* AvatarView supports 6 sizes to fit different list item contexts: `24`, `32`, `40`, `48`, `56`, `72`. If decorated with a Badge, those will be sized accordingly as well. <br />
|
|
212
|
-
* Please refer to the [design documentation](https://docs.wise.design/components/list-item#avatar
|
|
212
|
+
* Please refer to the [design documentation](https://docs.wise.design/components/list-item#avatar-sizes) for details on when to use which one.
|
|
213
213
|
*/
|
|
214
214
|
export const Sizes: Story = {
|
|
215
215
|
parameters: {
|
|
@@ -243,7 +243,7 @@ export const Sizes: Story = {
|
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
245
|
* AvatarView supports different types of badges for additional context and information. <br />
|
|
246
|
-
* Refer to the [design documentation](https://docs.wise.design/components/avatar
|
|
246
|
+
* Refer to the [design documentation](https://docs.wise.design/components/avatar#with-badge) for details.
|
|
247
247
|
*/
|
|
248
248
|
export const Badges: Story = {
|
|
249
249
|
args: {
|
|
@@ -42,7 +42,7 @@ const disabledPromptMessage = (
|
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Please refer to the [design documentation](https://docs.wise.design/components/list-item#
|
|
45
|
+
* Please refer to the [design documentation](https://docs.wise.design/components/list-item#disabled-states) for more details
|
|
46
46
|
*/
|
|
47
47
|
export default {
|
|
48
48
|
component: ListItem,
|
|
@@ -16,8 +16,8 @@ import Modal from '../../Modal';
|
|
|
16
16
|
import Link from '../../Link';
|
|
17
17
|
import List from '../../List';
|
|
18
18
|
import Popover from '../../Popover';
|
|
19
|
-
import { SnackbarConsumer, type SnackbarContextType } from '../../Snackbar/SnackbarContext';
|
|
20
|
-
import SnackbarProvider from '../../Snackbar/SnackbarProvider';
|
|
19
|
+
import { SnackbarConsumer, type SnackbarContextType } from '../../Prompt/Snackbar/SnackbarContext';
|
|
20
|
+
import SnackbarProvider from '../../Prompt/Snackbar/SnackbarProvider';
|
|
21
21
|
import Tooltip from '../../Tooltip';
|
|
22
22
|
import { Position } from '../../common';
|
|
23
23
|
import { ListItem, type ListItemProps } from '../ListItem';
|
package/src/Loader/Loader.tsx
CHANGED
|
@@ -32,7 +32,7 @@ export type LoaderProps = {
|
|
|
32
32
|
/**
|
|
33
33
|
* Loader component
|
|
34
34
|
*
|
|
35
|
-
* Docs link: https://
|
|
35
|
+
* Docs link: https://storybook.wise.design/?path=/docs/loading-loader--docs
|
|
36
36
|
*
|
|
37
37
|
* @param root0
|
|
38
38
|
* @param root0.small
|
|
@@ -6,6 +6,7 @@ import { lorem500 } from '../../test-utils';
|
|
|
6
6
|
import Field from '../../Field/Field';
|
|
7
7
|
import Body from '../../Body';
|
|
8
8
|
import MoneyInput from '../MoneyInput';
|
|
9
|
+
import { WithOverlaidAbsoluteElement } from '../../../.storybook/components/WithOverlaidAbsoluteElement';
|
|
9
10
|
|
|
10
11
|
const meta = {
|
|
11
12
|
title: 'Forms/MoneyInput/Tests',
|
|
@@ -243,3 +244,13 @@ export const DecimalsFormatParity: Story = {
|
|
|
243
244
|
},
|
|
244
245
|
},
|
|
245
246
|
};
|
|
247
|
+
|
|
248
|
+
export const StackingContext: Story = {
|
|
249
|
+
render: (args) => (
|
|
250
|
+
<WithOverlaidAbsoluteElement>
|
|
251
|
+
<Field label="Overlaid element">
|
|
252
|
+
<MoneyInput {...args} />
|
|
253
|
+
</Field>
|
|
254
|
+
</WithOverlaidAbsoluteElement>
|
|
255
|
+
),
|
|
256
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { WithOverlaidAbsoluteElement } from '../../../.storybook/components/WithOverlaidAbsoluteElement';
|
|
4
|
+
import Field from '../../Field/Field';
|
|
5
|
+
import PhoneNumberInput from '..';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
component: PhoneNumberInput,
|
|
9
|
+
title: 'Forms/PhoneNumberInput/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
args: {
|
|
12
|
+
onChange: () => {},
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof PhoneNumberInput>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const StackingContext: Story = {
|
|
21
|
+
render: (args) => {
|
|
22
|
+
return (
|
|
23
|
+
<WithOverlaidAbsoluteElement>
|
|
24
|
+
<Field label="Phone number">
|
|
25
|
+
<PhoneNumberInput {...args} />
|
|
26
|
+
</Field>
|
|
27
|
+
</WithOverlaidAbsoluteElement>
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -74,7 +74,30 @@ describe('PrimitivePrompt', () => {
|
|
|
74
74
|
const onDismiss = jest.fn();
|
|
75
75
|
render(<PrimitivePrompt {...defaultProps} onDismiss={onDismiss} />);
|
|
76
76
|
|
|
77
|
-
expect(screen.
|
|
77
|
+
expect(screen.getByRole('button', { name: 'Close' })).toHaveClass(
|
|
78
|
+
'np-icon-button-secondary-default',
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('supports a minimal dismiss button without changing its accessible name or handler', async () => {
|
|
83
|
+
const onDismiss = jest.fn();
|
|
84
|
+
const user = userEvent.setup();
|
|
85
|
+
render(
|
|
86
|
+
<PrimitivePrompt
|
|
87
|
+
{...defaultProps}
|
|
88
|
+
dismissButtonPriority="minimal"
|
|
89
|
+
data-testid="prompt"
|
|
90
|
+
onDismiss={onDismiss}
|
|
91
|
+
/>,
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const dismissButton = screen.getByRole('button', { name: 'Close' });
|
|
95
|
+
expect(dismissButton).toHaveClass('np-icon-button-minimal-default');
|
|
96
|
+
expect(screen.getByTestId('prompt')).not.toHaveAttribute('dismissButtonPriority');
|
|
97
|
+
|
|
98
|
+
await user.click(dismissButton);
|
|
99
|
+
|
|
100
|
+
expect(onDismiss).toHaveBeenCalledTimes(1);
|
|
78
101
|
});
|
|
79
102
|
|
|
80
103
|
it('calls onDismiss when dismiss button is clicked', async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Cross } from '@transferwise/icons';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import SentimentSurface, { Emphasis, Sentiment } from '../../SentimentSurface';
|
|
4
|
-
import IconButton from '../../IconButton';
|
|
4
|
+
import IconButton, { type IconButtonProps } from '../../IconButton';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import closeBtnMessages from '../../common/CloseButton/CloseButton.messages';
|
|
7
7
|
import { forwardRef, HTMLAttributes, ReactNode } from 'react';
|
|
@@ -29,6 +29,11 @@ export type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
29
29
|
* Handler called when the close button is clicked. If not provided, then the close button is hidden.
|
|
30
30
|
*/
|
|
31
31
|
onDismiss?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* The priority of the dismiss IconButton.
|
|
34
|
+
* @default 'secondary'
|
|
35
|
+
*/
|
|
36
|
+
dismissButtonPriority?: IconButtonProps['priority'];
|
|
32
37
|
/**
|
|
33
38
|
* Test ID for testing tools
|
|
34
39
|
*/
|
|
@@ -46,6 +51,7 @@ export const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(
|
|
|
46
51
|
media,
|
|
47
52
|
actions,
|
|
48
53
|
onDismiss,
|
|
54
|
+
dismissButtonPriority = 'secondary',
|
|
49
55
|
className,
|
|
50
56
|
children,
|
|
51
57
|
...restProps
|
|
@@ -73,7 +79,7 @@ export const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(
|
|
|
73
79
|
{onDismiss && (
|
|
74
80
|
<IconButton
|
|
75
81
|
size={24}
|
|
76
|
-
priority=
|
|
82
|
+
priority={dismissButtonPriority}
|
|
77
83
|
aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}
|
|
78
84
|
className="wds-prompt__dismiss"
|
|
79
85
|
onClick={onDismiss}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
.wds-Snackbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
padding-inline: var(--size-16);
|
|
6
|
+
padding-block-end: calc(var(--size-16) + env(safe-area-inset-bottom));
|
|
7
|
+
position: fixed;
|
|
8
|
+
inset-block-end: 0;
|
|
9
|
+
inset-inline: 0;
|
|
10
|
+
z-index: 1060;
|
|
11
|
+
}
|
|
12
|
+
@media (min-width: 600px) {
|
|
13
|
+
.wds-Snackbar {
|
|
14
|
+
padding-block-end: var(--size-24);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
.wds-Snackbar--swipe-dismiss {
|
|
18
|
+
transition: transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
19
|
+
}
|
|
20
|
+
.wds-Snackbar--swipe-settle {
|
|
21
|
+
transition: transform var(--Snackbar-exit-duration) cubic-bezier(0, 0, 0, 1);
|
|
22
|
+
}
|
|
23
|
+
.wds-Snackbar-container {
|
|
24
|
+
--Prompt-border-radius: var(--radius-medium);
|
|
25
|
+
--Prompt-gap: var(--size-8);
|
|
26
|
+
--Prompt-padding-x: var(--size-12);
|
|
27
|
+
--Prompt-padding-y: var(--size-12);
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
max-inline-size: 480px;
|
|
30
|
+
text-align: start;
|
|
31
|
+
cursor: grab;
|
|
32
|
+
touch-action: pan-x pinch-zoom;
|
|
33
|
+
}
|
|
34
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
35
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
36
|
+
}
|
|
37
|
+
@media (min-width: 600px) {
|
|
38
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
39
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
min-block-size: max(var(--size-32), 1lh);
|
|
46
|
+
padding-block-start: 0;
|
|
47
|
+
color: var(--color-sentiment-content-primary);
|
|
48
|
+
}
|
|
49
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper:has(+ .wds-Snackbar__content .wds-Snackbar__action) {
|
|
50
|
+
min-block-size: max(var(--size-32), calc(1lh + var(--size-5) * 2));
|
|
51
|
+
}
|
|
52
|
+
.wds-Snackbar__media-asset {
|
|
53
|
+
display: flex;
|
|
54
|
+
}
|
|
55
|
+
.wds-Snackbar__media-asset svg {
|
|
56
|
+
inline-size: var(--size-24);
|
|
57
|
+
block-size: var(--size-24);
|
|
58
|
+
}
|
|
59
|
+
.wds-Snackbar__process-indicator .process-circle {
|
|
60
|
+
stroke: currentColor;
|
|
61
|
+
}
|
|
62
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
63
|
+
display: none;
|
|
64
|
+
align-self: flex-start;
|
|
65
|
+
margin-block-start: calc(var(--size-4) - 1px);
|
|
66
|
+
}
|
|
67
|
+
@media (min-width: 600px) {
|
|
68
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
69
|
+
display: flex;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.wds-Snackbar__action {
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
}
|
|
75
|
+
.wds-Snackbar__content {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
gap: var(--size-8);
|
|
79
|
+
flex: 1 0 0;
|
|
80
|
+
min-block-size: var(--size-32);
|
|
81
|
+
min-inline-size: 0;
|
|
82
|
+
}
|
|
83
|
+
.wds-Snackbar__message {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
inline-size: auto;
|
|
88
|
+
flex: 1 0 0;
|
|
89
|
+
min-inline-size: 0;
|
|
90
|
+
align-self: stretch;
|
|
91
|
+
}
|
|
92
|
+
.wds-Snackbar__body {
|
|
93
|
+
display: block;
|
|
94
|
+
}
|
|
95
|
+
.wds-Snackbar-container-appear,
|
|
96
|
+
.wds-Snackbar-container-enter {
|
|
97
|
+
opacity: 0;
|
|
98
|
+
transform: translateY(80px) scale(0.5);
|
|
99
|
+
}
|
|
100
|
+
.wds-Snackbar-container-appear-active,
|
|
101
|
+
.wds-Snackbar-container-enter-active {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
transform: translateY(0) scale(1);
|
|
104
|
+
transition: opacity 150ms linear, transform var(--Snackbar-enter-duration) cubic-bezier(0, 0, 0, 1);
|
|
105
|
+
}
|
|
106
|
+
.wds-Snackbar-container-exit {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: translateY(0) scale(1);
|
|
109
|
+
}
|
|
110
|
+
.wds-Snackbar-container-exit-active {
|
|
111
|
+
opacity: 0;
|
|
112
|
+
transform: translateY(80px) scale(0.5);
|
|
113
|
+
transition: opacity 50ms linear 50ms, transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
114
|
+
}
|
|
115
|
+
@media (prefers-reduced-motion: reduce) {
|
|
116
|
+
.wds-Snackbar--swipe-dismiss,
|
|
117
|
+
.wds-Snackbar--swipe-settle {
|
|
118
|
+
transition: none;
|
|
119
|
+
}
|
|
120
|
+
.wds-Snackbar-container-appear,
|
|
121
|
+
.wds-Snackbar-container-appear-active,
|
|
122
|
+
.wds-Snackbar-container-enter,
|
|
123
|
+
.wds-Snackbar-container-enter-active,
|
|
124
|
+
.wds-Snackbar-container-exit {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
transform: none;
|
|
127
|
+
transition: none;
|
|
128
|
+
}
|
|
129
|
+
.wds-Snackbar-container-exit-active {
|
|
130
|
+
opacity: 0;
|
|
131
|
+
transform: none;
|
|
132
|
+
transition: none;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
@import (reference) "./../../styles/variables/zindex.less";
|
|
2
|
+
|
|
3
|
+
.wds-Snackbar {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
padding-inline: var(--size-16);
|
|
8
|
+
padding-bottom: calc(var(--size-16) + env(safe-area-inset-bottom));
|
|
9
|
+
position: fixed;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
inset-inline: 0;
|
|
12
|
+
z-index: @zindex-mobile-nav;
|
|
13
|
+
|
|
14
|
+
@media (--screen-sm) {
|
|
15
|
+
padding-bottom: var(--size-24);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--swipe-dismiss {
|
|
19
|
+
transition: transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--swipe-settle {
|
|
23
|
+
transition: transform var(--Snackbar-exit-duration) cubic-bezier(0, 0, 0, 1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-container {
|
|
27
|
+
--Prompt-border-radius: var(--radius-medium);
|
|
28
|
+
--Prompt-gap: var(--size-8);
|
|
29
|
+
--Prompt-padding-x: var(--size-12);
|
|
30
|
+
--Prompt-padding-y: var(--size-12);
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
max-width: 480px;
|
|
33
|
+
text-align: start;
|
|
34
|
+
cursor: grab;
|
|
35
|
+
touch-action: pan-x pinch-zoom;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-container .wds-prompt__content-wrapper--with-dismiss {
|
|
39
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
40
|
+
|
|
41
|
+
@media (--screen-sm) {
|
|
42
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-container .wds-prompt__media-wrapper {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
min-height: max(var(--size-32), 1lh);
|
|
50
|
+
padding-top: 0;
|
|
51
|
+
color: var(--color-sentiment-content-primary);
|
|
52
|
+
|
|
53
|
+
// At 400% reflow spacing shrinks, but the text's line height does not.
|
|
54
|
+
&:has(+ .wds-Snackbar__content .wds-Snackbar__action) {
|
|
55
|
+
min-height: max(var(--size-32), calc(1lh + var(--size-5) * 2));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&__media-asset {
|
|
60
|
+
display: flex;
|
|
61
|
+
|
|
62
|
+
svg {
|
|
63
|
+
width: var(--size-24);
|
|
64
|
+
height: var(--size-24);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__process-indicator .process-circle {
|
|
69
|
+
stroke: currentColor;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&-container .wds-prompt__dismiss {
|
|
73
|
+
display: none;
|
|
74
|
+
align-self: flex-start;
|
|
75
|
+
margin-top: calc(var(--size-4) - 1px);
|
|
76
|
+
|
|
77
|
+
@media (--screen-sm) {
|
|
78
|
+
display: flex;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&__action {
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__content {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: flex-start;
|
|
89
|
+
gap: var(--size-8);
|
|
90
|
+
flex: 1 0 0;
|
|
91
|
+
min-height: var(--size-32);
|
|
92
|
+
min-width: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__message {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
width: auto;
|
|
100
|
+
flex: 1 0 0;
|
|
101
|
+
min-width: 0;
|
|
102
|
+
align-self: stretch;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__body {
|
|
106
|
+
display: block;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.wds-Snackbar-container-appear,
|
|
111
|
+
.wds-Snackbar-container-enter {
|
|
112
|
+
opacity: 0;
|
|
113
|
+
transform: translateY(80px) scale(0.5);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.wds-Snackbar-container-appear-active,
|
|
117
|
+
.wds-Snackbar-container-enter-active {
|
|
118
|
+
opacity: 1;
|
|
119
|
+
transform: translateY(0) scale(1);
|
|
120
|
+
transition:
|
|
121
|
+
opacity 150ms linear,
|
|
122
|
+
transform var(--Snackbar-enter-duration) cubic-bezier(0, 0, 0, 1);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.wds-Snackbar-container-exit {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
transform: translateY(0) scale(1);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.wds-Snackbar-container-exit-active {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
transform: translateY(80px) scale(0.5);
|
|
133
|
+
transition:
|
|
134
|
+
opacity 50ms linear 50ms,
|
|
135
|
+
transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@media (prefers-reduced-motion: reduce) {
|
|
139
|
+
.wds-Snackbar--swipe-dismiss,
|
|
140
|
+
.wds-Snackbar--swipe-settle {
|
|
141
|
+
transition: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.wds-Snackbar-container-appear,
|
|
145
|
+
.wds-Snackbar-container-appear-active,
|
|
146
|
+
.wds-Snackbar-container-enter,
|
|
147
|
+
.wds-Snackbar-container-enter-active,
|
|
148
|
+
.wds-Snackbar-container-exit {
|
|
149
|
+
opacity: 1;
|
|
150
|
+
transform: none;
|
|
151
|
+
transition: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.wds-Snackbar-container-exit-active {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
transform: none;
|
|
157
|
+
transition: none;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
export default defineMessages({
|
|
4
|
+
escapeDismissHint: {
|
|
5
|
+
id: 'neptune.Snackbar.escapeDismissHint',
|
|
6
|
+
defaultMessage: 'Press Escape to dismiss.',
|
|
7
|
+
description: 'Screen-reader instruction for dismissing a Snackbar without moving focus',
|
|
8
|
+
},
|
|
9
|
+
});
|