@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
|
@@ -5,13 +5,11 @@ import WithDisplayFormat from '.';
|
|
|
5
5
|
|
|
6
6
|
const user = userEvent;
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
render(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/>,
|
|
14
|
-
);
|
|
8
|
+
const renderInput = (props) => (
|
|
9
|
+
<WithDisplayFormat {...props} render={(renderProps) => <Input {...renderProps} name="input" />} />
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const setup = (props) => render(renderInput(props));
|
|
15
13
|
|
|
16
14
|
describe('InputWithTextFormat (React Testing Library)', () => {
|
|
17
15
|
const initialProps = {
|
|
@@ -26,6 +24,91 @@ describe('InputWithTextFormat (React Testing Library)', () => {
|
|
|
26
24
|
jest.clearAllMocks();
|
|
27
25
|
});
|
|
28
26
|
|
|
27
|
+
it('updates the displayed value when the value prop changes', () => {
|
|
28
|
+
const { rerender } = setup({ ...initialProps, value: '123' });
|
|
29
|
+
|
|
30
|
+
expect(screen.getByRole('textbox')).toHaveValue('12-3');
|
|
31
|
+
|
|
32
|
+
rerender(renderInput({ ...initialProps, value: '456' }));
|
|
33
|
+
|
|
34
|
+
expect(screen.getByRole('textbox')).toHaveValue('45-6');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('preserves the current value and resets undo history when the pattern changes', async () => {
|
|
38
|
+
const props = { ...initialProps, displayPattern: '**-**' };
|
|
39
|
+
const { rerender } = setup(props);
|
|
40
|
+
const input = screen.getByRole('textbox');
|
|
41
|
+
|
|
42
|
+
await user.type(input, '123');
|
|
43
|
+
rerender(renderInput({ ...props, displayPattern: '**/**' }));
|
|
44
|
+
|
|
45
|
+
expect(input).toHaveValue('12/3');
|
|
46
|
+
await user.keyboard('{Control>}z{/Control}');
|
|
47
|
+
expect(input).toHaveValue('12/3');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('uses the incoming value when the value and pattern change together', () => {
|
|
51
|
+
const props = { ...initialProps, value: '123', displayPattern: '**-**' };
|
|
52
|
+
const { rerender } = setup(props);
|
|
53
|
+
|
|
54
|
+
rerender(renderInput({ ...props, value: '4567', displayPattern: '**/**' }));
|
|
55
|
+
|
|
56
|
+
expect(screen.getByRole('textbox')).toHaveValue('45/67');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('resets undo history when the value prop changes externally', async () => {
|
|
60
|
+
const props = { ...initialProps, displayPattern: '**-**' };
|
|
61
|
+
const { rerender } = setup(props);
|
|
62
|
+
const input = screen.getByRole('textbox');
|
|
63
|
+
|
|
64
|
+
await user.type(input, '123');
|
|
65
|
+
rerender(renderInput({ ...props, value: '456' }));
|
|
66
|
+
|
|
67
|
+
expect(input).toHaveValue('45-6');
|
|
68
|
+
await user.keyboard('{Control>}z{/Control}');
|
|
69
|
+
expect(input).toHaveValue('45-6');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('preserves undo history when the parent echoes an onChange value', async () => {
|
|
73
|
+
const ControlledInput = () => {
|
|
74
|
+
const [value, setValue] = React.useState('');
|
|
75
|
+
return renderInput({ ...initialProps, value, displayPattern: '***', onChange: setValue });
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
render(<ControlledInput />);
|
|
79
|
+
const input = screen.getByRole('textbox');
|
|
80
|
+
|
|
81
|
+
await user.type(input, '123');
|
|
82
|
+
await user.keyboard('{Control>}z{/Control}');
|
|
83
|
+
|
|
84
|
+
expect(input).toHaveValue('12');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('reformats a pasted value when the parent removes spaces from the onChange value', async () => {
|
|
88
|
+
const ControlledInput = () => {
|
|
89
|
+
const [value, setValue] = React.useState('');
|
|
90
|
+
|
|
91
|
+
const handleChange = (nextValue) => {
|
|
92
|
+
setValue(nextValue.replaceAll(' ', ''));
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return renderInput({
|
|
96
|
+
...initialProps,
|
|
97
|
+
value,
|
|
98
|
+
displayPattern: '**-**-**',
|
|
99
|
+
onChange: handleChange,
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
render(<ControlledInput />);
|
|
104
|
+
const input = screen.getByRole('textbox');
|
|
105
|
+
|
|
106
|
+
await user.click(input);
|
|
107
|
+
await user.paste('00 00 00');
|
|
108
|
+
|
|
109
|
+
await waitFor(() => expect(input).toHaveValue('00-00-00'));
|
|
110
|
+
});
|
|
111
|
+
|
|
29
112
|
[
|
|
30
113
|
{ value: '123', expectedValue: '12-3', displayPattern: '**-**-**' },
|
|
31
114
|
{ value: '1234', expectedValue: '12-34', displayPattern: '**-**-**' },
|
|
@@ -20,6 +20,7 @@ export type EventType =
|
|
|
20
20
|
|
|
21
21
|
interface WithDisplayFormatState {
|
|
22
22
|
value: string;
|
|
23
|
+
prevValue: string;
|
|
23
24
|
historyNavigator: HistoryNavigator;
|
|
24
25
|
prevDisplayPattern: string;
|
|
25
26
|
triggerType: EventType;
|
|
@@ -76,6 +77,7 @@ class WithDisplayFormat<T extends TextElementProps> extends React.Component<
|
|
|
76
77
|
const unformattedValue = unformatWithPattern(props.value ?? '', props.displayPattern);
|
|
77
78
|
this.state = {
|
|
78
79
|
value: formatWithPattern(unformattedValue, props.displayPattern),
|
|
80
|
+
prevValue: props.value ?? '',
|
|
79
81
|
historyNavigator: new HistoryNavigator(),
|
|
80
82
|
prevDisplayPattern: props.displayPattern,
|
|
81
83
|
triggerType: 'Initial',
|
|
@@ -87,19 +89,38 @@ class WithDisplayFormat<T extends TextElementProps> extends React.Component<
|
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
static getDerivedStateFromProps(
|
|
90
|
-
{ displayPattern }: WithDisplayFormatProps,
|
|
91
|
-
{
|
|
92
|
+
{ displayPattern, value: propValue }: WithDisplayFormatProps,
|
|
93
|
+
{
|
|
94
|
+
prevDisplayPattern = displayPattern,
|
|
95
|
+
prevValue,
|
|
96
|
+
value,
|
|
97
|
+
historyNavigator,
|
|
98
|
+
}: WithDisplayFormatState,
|
|
92
99
|
) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
const nextValue = propValue ?? '';
|
|
101
|
+
const displayPatternChanged = prevDisplayPattern !== displayPattern;
|
|
102
|
+
const valueChanged = prevValue !== nextValue;
|
|
103
|
+
|
|
104
|
+
if (displayPatternChanged || valueChanged) {
|
|
105
|
+
const unformattedValue = valueChanged
|
|
106
|
+
? unformatWithPattern(nextValue, displayPattern)
|
|
107
|
+
: unformatWithPattern(value, prevDisplayPattern);
|
|
108
|
+
const isEchoOfCurrentValue =
|
|
109
|
+
valueChanged && unformattedValue === unformatWithPattern(value, displayPattern);
|
|
110
|
+
|
|
111
|
+
if (displayPatternChanged || (valueChanged && !isEchoOfCurrentValue)) {
|
|
112
|
+
historyNavigator.reset([unformattedValue]);
|
|
113
|
+
}
|
|
96
114
|
|
|
97
115
|
return {
|
|
98
116
|
prevDisplayPattern: displayPattern,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
117
|
+
prevValue: nextValue,
|
|
118
|
+
value: formatWithPattern(unformattedValue, displayPattern),
|
|
119
|
+
...(displayPatternChanged && {
|
|
120
|
+
triggerType: null,
|
|
121
|
+
triggerEvent: null,
|
|
122
|
+
pastedLength: 0,
|
|
123
|
+
}),
|
|
103
124
|
};
|
|
104
125
|
}
|
|
105
126
|
return null;
|
|
@@ -141,7 +141,7 @@ export interface SelectProps {
|
|
|
141
141
|
const defaultClassNames = {};
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* @deprecated Use `SelectInput` instead (https://
|
|
144
|
+
* @deprecated Use `SelectInput` instead (https://storybook.wise.design/?path=/docs/forms-selectinput--docs)
|
|
145
145
|
*/
|
|
146
146
|
export default function Select({
|
|
147
147
|
placeholder,
|
|
@@ -4,7 +4,7 @@ import { useState } from 'react';
|
|
|
4
4
|
import Select, { SelectItem, SelectOptionItem } from '..';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @deprecated Use **`SelectInput`** instead <br/> [https://
|
|
7
|
+
* @deprecated Use **`SelectInput`** instead <br/> [https://storybook.wise.design/?path=/docs/forms-selectinput--docs](https://storybook.wise.design/?path=/docs/forms-selectinput--docs)
|
|
8
8
|
*/
|
|
9
9
|
const meta: Meta<typeof Select> = {
|
|
10
10
|
component: Select,
|
|
@@ -36,9 +36,7 @@ export type BottomSheetProps = PropsWithChildren<
|
|
|
36
36
|
>;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* Neptune Web: https://transferwise.github.io/neptune-web/components/overlays/BottomSheet
|
|
39
|
+
* Design guidance: https://docs.wise.design/components/bottom-sheet/
|
|
42
40
|
*
|
|
43
41
|
*/
|
|
44
42
|
const BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {
|
package/src/i18n/cs.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Předčíslí",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Hledat...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "Nebyly nalezeny žádné výsledky",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Pro zavření stiskněte Esc.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Chyba:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Informace:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "Vyřizuje se:",
|
package/src/i18n/en.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Prefix",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Search...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "No results found",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Press Escape to dismiss.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Error:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Information:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "Pending:",
|
package/src/i18n/es.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Prefijo",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Pulsa Escape para cerrar.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Error:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Información:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "Pendiente:",
|
package/src/i18n/id.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Awalan",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Cari...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "Hasil tidak ditemukan",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Tekan Escape untuk menutup.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Kesalahan:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Informasi:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "Tertunda:",
|
package/src/i18n/ja.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "プレフィックス",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "検索する... ",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Escキーを押して閉じます。",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "エラー:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "情報:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "保留中:",
|
package/src/i18n/nl.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Voorvoegsel",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Zoeken...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "Geen resultaten gevonden",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Druk op Escape om te verwijderen.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Fout:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Informatie:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "In behandeling:",
|
package/src/i18n/pt.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Prefixo",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Pressione Esc para fechar.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Erro:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Informação:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "Pendente:",
|
package/src/i18n/ro.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Prefix",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Apasă pe Escape pentru a închide.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Eroare:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Informații:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "În așteptare:",
|
package/src/i18n/ru.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Код страны",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Нажмите Escape, чтобы закрыть.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Ошибка:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Информация:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "В ожидании:",
|
package/src/i18n/uk.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "Префікс",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "Пошук…",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "Нічого не знайдено",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "Натисніть Escape, щоб закрити.",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "Помилка:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "Інформація:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "Обробка:",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"neptune.PhoneNumberInput.phoneNumberPrefix": "前綴",
|
|
39
39
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
40
40
|
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
|
41
|
+
"neptune.Snackbar.escapeDismissHint": "按下Escape鍵以關閉。",
|
|
41
42
|
"neptune.StatusIcon.iconLabel.error": "錯誤:",
|
|
42
43
|
"neptune.StatusIcon.iconLabel.information": "資訊:",
|
|
43
44
|
"neptune.StatusIcon.iconLabel.pending": "處理中:",
|
package/src/index.ts
CHANGED
|
@@ -146,8 +146,8 @@ export type {
|
|
|
146
146
|
SelectProps,
|
|
147
147
|
} from './_deprecated/Select';
|
|
148
148
|
export type { SlidingPanelProps } from './SlidingPanel';
|
|
149
|
-
export type {
|
|
150
|
-
export type { SnackbarContextType } from './Snackbar/SnackbarContext';
|
|
149
|
+
export type { SnackbarCreationProps, SnackbarProviderProps } from './Prompt/Snackbar';
|
|
150
|
+
export type { SnackbarContextType } from './Prompt/Snackbar/SnackbarContext';
|
|
151
151
|
export type { StatusIconProps, StatusIconSentiment } from './StatusIcon';
|
|
152
152
|
export type { StickyProps } from './Sticky';
|
|
153
153
|
export type { SummaryProps } from './_deprecated/Summary';
|
|
@@ -295,8 +295,8 @@ export { default as SegmentedControl } from './SegmentedControl';
|
|
|
295
295
|
export { default as Select } from './_deprecated/Select';
|
|
296
296
|
export { default as SentimentSurface } from './SentimentSurface';
|
|
297
297
|
export { default as SlidingPanel } from './SlidingPanel';
|
|
298
|
-
export { SnackbarConsumer, SnackbarContext } from './Snackbar/SnackbarContext';
|
|
299
|
-
export { default as SnackbarProvider } from './Snackbar/SnackbarProvider';
|
|
298
|
+
export { SnackbarConsumer, SnackbarContext } from './Prompt/Snackbar/SnackbarContext';
|
|
299
|
+
export { default as SnackbarProvider } from './Prompt/Snackbar/SnackbarProvider';
|
|
300
300
|
export { default as StatusIcon } from './StatusIcon/StatusIcon';
|
|
301
301
|
export { default as Stepper } from './Stepper/Stepper';
|
|
302
302
|
export { default as Sticky } from './Sticky';
|
|
@@ -321,7 +321,7 @@ export { default as List } from './List';
|
|
|
321
321
|
*/
|
|
322
322
|
export { useDirection, useLayout } from './common/hooks';
|
|
323
323
|
export { useScreenSize } from './common/hooks/useScreenSize';
|
|
324
|
-
export { default as useSnackbar } from './Snackbar/useSnackbar';
|
|
324
|
+
export { default as useSnackbar } from './Prompt/Snackbar/useSnackbar';
|
|
325
325
|
|
|
326
326
|
/**
|
|
327
327
|
* Enums
|
package/src/main.css
CHANGED
|
@@ -26948,15 +26948,14 @@ a[data-toggle="tooltip"] {
|
|
|
26948
26948
|
color: var(--color-white);
|
|
26949
26949
|
}
|
|
26950
26950
|
.np-icon-button-minimal-default {
|
|
26951
|
-
color: var(--color-interactive-primary);
|
|
26952
|
-
background-color: var(--color-background-screen);
|
|
26951
|
+
color: var(--color-sentiment-content-primary, var(--color-interactive-primary));
|
|
26953
26952
|
background-color: transparent;
|
|
26954
26953
|
}
|
|
26955
26954
|
.np-icon-button-minimal-default:not(.disabled):not(:disabled):hover {
|
|
26956
|
-
background-color: var(--color-background-screen-hover);
|
|
26955
|
+
background-color: var(--color-sentiment-interactive-secondary-neutral-hover, var(--color-background-screen-hover));
|
|
26957
26956
|
}
|
|
26958
26957
|
.np-icon-button-minimal-default:not(.disabled):not(:disabled):active {
|
|
26959
|
-
background-color: var(--color-background-screen-active);
|
|
26958
|
+
background-color: var(--color-sentiment-interactive-secondary-neutral-active, var(--color-background-screen-active));
|
|
26960
26959
|
}
|
|
26961
26960
|
.np-icon-button-secondary-default {
|
|
26962
26961
|
color: var(--color-sentiment-content-primary, var(--color-interactive-primary));
|
|
@@ -29650,6 +29649,7 @@ button.np-option {
|
|
|
29650
29649
|
display: inline-grid;
|
|
29651
29650
|
inline-size: 100%;
|
|
29652
29651
|
grid-auto-columns: minmax(0, 1fr);
|
|
29652
|
+
isolation: isolate;
|
|
29653
29653
|
/* Prevent unwanted `group-hover/input` triggers */
|
|
29654
29654
|
border-radius: var(--radius-full);
|
|
29655
29655
|
}
|
|
@@ -31414,6 +31414,140 @@ button.np-link {
|
|
|
31414
31414
|
overflow: visible;
|
|
31415
31415
|
}
|
|
31416
31416
|
}
|
|
31417
|
+
.wds-Snackbar {
|
|
31418
|
+
display: flex;
|
|
31419
|
+
justify-content: center;
|
|
31420
|
+
box-sizing: border-box;
|
|
31421
|
+
padding-inline: var(--size-16);
|
|
31422
|
+
padding-block-end: calc(var(--size-16) + env(safe-area-inset-bottom));
|
|
31423
|
+
position: fixed;
|
|
31424
|
+
inset-block-end: 0;
|
|
31425
|
+
inset-inline: 0;
|
|
31426
|
+
z-index: 1060;
|
|
31427
|
+
}
|
|
31428
|
+
@media (min-width: 600px) {
|
|
31429
|
+
.wds-Snackbar {
|
|
31430
|
+
padding-block-end: var(--size-24);
|
|
31431
|
+
}
|
|
31432
|
+
}
|
|
31433
|
+
.wds-Snackbar--swipe-dismiss {
|
|
31434
|
+
transition: transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
31435
|
+
}
|
|
31436
|
+
.wds-Snackbar--swipe-settle {
|
|
31437
|
+
transition: transform var(--Snackbar-exit-duration) cubic-bezier(0, 0, 0, 1);
|
|
31438
|
+
}
|
|
31439
|
+
.wds-Snackbar-container {
|
|
31440
|
+
--Prompt-border-radius: var(--radius-medium);
|
|
31441
|
+
--Prompt-gap: var(--size-8);
|
|
31442
|
+
--Prompt-padding-x: var(--size-12);
|
|
31443
|
+
--Prompt-padding-y: var(--size-12);
|
|
31444
|
+
box-sizing: border-box;
|
|
31445
|
+
max-inline-size: 480px;
|
|
31446
|
+
text-align: start;
|
|
31447
|
+
cursor: grab;
|
|
31448
|
+
touch-action: pan-x pinch-zoom;
|
|
31449
|
+
}
|
|
31450
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
31451
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
31452
|
+
}
|
|
31453
|
+
@media (min-width: 600px) {
|
|
31454
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
31455
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
31456
|
+
}
|
|
31457
|
+
}
|
|
31458
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper {
|
|
31459
|
+
display: flex;
|
|
31460
|
+
align-items: center;
|
|
31461
|
+
min-block-size: max(var(--size-32), 1lh);
|
|
31462
|
+
padding-block-start: 0;
|
|
31463
|
+
color: var(--color-sentiment-content-primary);
|
|
31464
|
+
}
|
|
31465
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper:has(+ .wds-Snackbar__content .wds-Snackbar__action) {
|
|
31466
|
+
min-block-size: max(var(--size-32), calc(1lh + var(--size-5) * 2));
|
|
31467
|
+
}
|
|
31468
|
+
.wds-Snackbar__media-asset {
|
|
31469
|
+
display: flex;
|
|
31470
|
+
}
|
|
31471
|
+
.wds-Snackbar__media-asset svg {
|
|
31472
|
+
inline-size: var(--size-24);
|
|
31473
|
+
block-size: var(--size-24);
|
|
31474
|
+
}
|
|
31475
|
+
.wds-Snackbar__process-indicator .process-circle {
|
|
31476
|
+
stroke: currentColor;
|
|
31477
|
+
}
|
|
31478
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
31479
|
+
display: none;
|
|
31480
|
+
align-self: flex-start;
|
|
31481
|
+
margin-block-start: calc(var(--size-4) - 1px);
|
|
31482
|
+
}
|
|
31483
|
+
@media (min-width: 600px) {
|
|
31484
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
31485
|
+
display: flex;
|
|
31486
|
+
}
|
|
31487
|
+
}
|
|
31488
|
+
.wds-Snackbar__action {
|
|
31489
|
+
flex-shrink: 0;
|
|
31490
|
+
}
|
|
31491
|
+
.wds-Snackbar__content {
|
|
31492
|
+
display: flex;
|
|
31493
|
+
align-items: flex-start;
|
|
31494
|
+
gap: var(--size-8);
|
|
31495
|
+
flex: 1 0 0;
|
|
31496
|
+
min-block-size: var(--size-32);
|
|
31497
|
+
min-inline-size: 0;
|
|
31498
|
+
}
|
|
31499
|
+
.wds-Snackbar__message {
|
|
31500
|
+
display: flex;
|
|
31501
|
+
flex-direction: column;
|
|
31502
|
+
justify-content: center;
|
|
31503
|
+
inline-size: auto;
|
|
31504
|
+
flex: 1 0 0;
|
|
31505
|
+
min-inline-size: 0;
|
|
31506
|
+
align-self: stretch;
|
|
31507
|
+
}
|
|
31508
|
+
.wds-Snackbar__body {
|
|
31509
|
+
display: block;
|
|
31510
|
+
}
|
|
31511
|
+
.wds-Snackbar-container-appear,
|
|
31512
|
+
.wds-Snackbar-container-enter {
|
|
31513
|
+
opacity: 0;
|
|
31514
|
+
transform: translateY(80px) scale(0.5);
|
|
31515
|
+
}
|
|
31516
|
+
.wds-Snackbar-container-appear-active,
|
|
31517
|
+
.wds-Snackbar-container-enter-active {
|
|
31518
|
+
opacity: 1;
|
|
31519
|
+
transform: translateY(0) scale(1);
|
|
31520
|
+
transition: opacity 150ms linear, transform var(--Snackbar-enter-duration) cubic-bezier(0, 0, 0, 1);
|
|
31521
|
+
}
|
|
31522
|
+
.wds-Snackbar-container-exit {
|
|
31523
|
+
opacity: 1;
|
|
31524
|
+
transform: translateY(0) scale(1);
|
|
31525
|
+
}
|
|
31526
|
+
.wds-Snackbar-container-exit-active {
|
|
31527
|
+
opacity: 0;
|
|
31528
|
+
transform: translateY(80px) scale(0.5);
|
|
31529
|
+
transition: opacity 50ms linear 50ms, transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
31530
|
+
}
|
|
31531
|
+
@media (prefers-reduced-motion: reduce) {
|
|
31532
|
+
.wds-Snackbar--swipe-dismiss,
|
|
31533
|
+
.wds-Snackbar--swipe-settle {
|
|
31534
|
+
transition: none;
|
|
31535
|
+
}
|
|
31536
|
+
.wds-Snackbar-container-appear,
|
|
31537
|
+
.wds-Snackbar-container-appear-active,
|
|
31538
|
+
.wds-Snackbar-container-enter,
|
|
31539
|
+
.wds-Snackbar-container-enter-active,
|
|
31540
|
+
.wds-Snackbar-container-exit {
|
|
31541
|
+
opacity: 1;
|
|
31542
|
+
transform: none;
|
|
31543
|
+
transition: none;
|
|
31544
|
+
}
|
|
31545
|
+
.wds-Snackbar-container-exit-active {
|
|
31546
|
+
opacity: 0;
|
|
31547
|
+
transform: none;
|
|
31548
|
+
transition: none;
|
|
31549
|
+
}
|
|
31550
|
+
}
|
|
31417
31551
|
.wds-expander-toggle {
|
|
31418
31552
|
align-self: flex-start;
|
|
31419
31553
|
flex-shrink: 0;
|
|
@@ -31516,77 +31650,6 @@ button.np-link {
|
|
|
31516
31650
|
[dir="rtl"] .np-theme-personal .sliding-panel.sliding-panel--border-left {
|
|
31517
31651
|
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
31518
31652
|
}
|
|
31519
|
-
.snackbar {
|
|
31520
|
-
text-align: center;
|
|
31521
|
-
position: fixed;
|
|
31522
|
-
inset-block-end: 0;
|
|
31523
|
-
inset-inline-start: 0;
|
|
31524
|
-
inset-inline-end: 0;
|
|
31525
|
-
z-index: 1060;
|
|
31526
|
-
}
|
|
31527
|
-
.snackbar__text {
|
|
31528
|
-
background: #37517e;
|
|
31529
|
-
color: #ffffff;
|
|
31530
|
-
display: inline-flex;
|
|
31531
|
-
border-radius: 2px;
|
|
31532
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
|
|
31533
|
-
align-items: center;
|
|
31534
|
-
justify-content: space-between;
|
|
31535
|
-
text-align: start;
|
|
31536
|
-
font-size: var(--wds-font-size-body);
|
|
31537
|
-
margin-block: 0;
|
|
31538
|
-
margin-inline: var(--size-16);
|
|
31539
|
-
padding-block: var(--size-8);
|
|
31540
|
-
padding-inline: var(--size-16);
|
|
31541
|
-
inline-size: calc(100% - var(--size-32));
|
|
31542
|
-
transition: 400ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
31543
|
-
}
|
|
31544
|
-
.np-theme-personal .snackbar__text {
|
|
31545
|
-
box-shadow: 0 2px 4px 0 rgba(69, 71, 69, 0.35);
|
|
31546
|
-
position: relative;
|
|
31547
|
-
background: var(--color-contrast-theme);
|
|
31548
|
-
border-radius: var(--radius-small);
|
|
31549
|
-
color: var(--color-contrast-overlay);
|
|
31550
|
-
}
|
|
31551
|
-
.np-theme-personal .snackbar__text::after {
|
|
31552
|
-
display: block;
|
|
31553
|
-
border-radius: inherit;
|
|
31554
|
-
block-size: 100%;
|
|
31555
|
-
inline-size: 100%;
|
|
31556
|
-
content: "";
|
|
31557
|
-
position: absolute;
|
|
31558
|
-
inset-inline-start: 0;
|
|
31559
|
-
inset-block-start: 0;
|
|
31560
|
-
z-index: -1;
|
|
31561
|
-
background-color: var(--color-background-neutral);
|
|
31562
|
-
}
|
|
31563
|
-
.np-theme-personal--dark .snackbar__text,
|
|
31564
|
-
.np-theme-personal--forest-green .snackbar__text {
|
|
31565
|
-
box-shadow: none;
|
|
31566
|
-
}
|
|
31567
|
-
@media (min-width: 600px) {
|
|
31568
|
-
.snackbar__text {
|
|
31569
|
-
inline-size: auto;
|
|
31570
|
-
max-inline-size: 600px;
|
|
31571
|
-
}
|
|
31572
|
-
}
|
|
31573
|
-
.snackbar__text__action {
|
|
31574
|
-
flex-shrink: 0;
|
|
31575
|
-
margin-inline-start: var(--size-16);
|
|
31576
|
-
}
|
|
31577
|
-
.snackbar__text-container-enter,
|
|
31578
|
-
.snackbar__text-container-exit {
|
|
31579
|
-
transform: translateY(calc(100% + 10px));
|
|
31580
|
-
}
|
|
31581
|
-
.snackbar__text-container-enter-active {
|
|
31582
|
-
transform: translateY(-16px);
|
|
31583
|
-
transform: translateY(calc(-16px - env(safe-area-inset-bottom)));
|
|
31584
|
-
}
|
|
31585
|
-
@media (min-width: 600px) {
|
|
31586
|
-
.snackbar__text-container-enter-active {
|
|
31587
|
-
transform: translateY(-24px);
|
|
31588
|
-
}
|
|
31589
|
-
}
|
|
31590
31653
|
.status-circle.negative,
|
|
31591
31654
|
.status-circle.error {
|
|
31592
31655
|
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-negative));
|
package/src/main.less
CHANGED
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
@import "./Prompt/InfoPrompt/InfoPrompt.less";
|
|
75
75
|
@import "./Prompt/ActionPrompt/ActionPrompt.less";
|
|
76
76
|
@import "./Prompt/CriticalBanner/CriticalBanner.less";
|
|
77
|
+
@import "./Prompt/Snackbar/Snackbar.less";
|
|
77
78
|
@import "./Prompt/common/Expander/Expander.less";
|
|
78
79
|
@import "./RadioGroup/RadioGroup.less";
|
|
79
80
|
@import "./Section/Section.less";
|
|
80
81
|
@import "./SlidingPanel/SlidingPanel.less";
|
|
81
|
-
@import "./Snackbar/Snackbar.less";
|
|
82
82
|
@import "./StatusIcon/StatusIcon.less";
|
|
83
83
|
@import "./Stepper/Stepper.less";
|
|
84
84
|
@import "./Sticky/Sticky.less";
|
|
File without changes
|