@transferwise/components 0.0.0-experimental-5598332 → 0.0.0-experimental-cbc00a7
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/ListItem/ListItem.js +2 -32
- package/build/ListItem/ListItem.js.map +1 -1
- package/build/ListItem/ListItem.mjs +3 -33
- package/build/ListItem/ListItem.mjs.map +1 -1
- package/build/Snackbar/Snackbar.js +107 -105
- package/build/Snackbar/Snackbar.js.map +1 -1
- package/build/Snackbar/Snackbar.mjs +109 -104
- package/build/Snackbar/Snackbar.mjs.map +1 -1
- package/build/Snackbar/SnackbarContext.js.map +1 -1
- package/build/Snackbar/SnackbarContext.mjs.map +1 -1
- package/build/Snackbar/SnackbarPortal.js +12 -0
- package/build/Snackbar/SnackbarPortal.js.map +1 -0
- package/build/Snackbar/SnackbarPortal.mjs +8 -0
- package/build/Snackbar/SnackbarPortal.mjs.map +1 -0
- package/build/Snackbar/SnackbarProvider.js +23 -27
- package/build/Snackbar/SnackbarProvider.js.map +1 -1
- package/build/Snackbar/SnackbarProvider.mjs +24 -28
- package/build/Snackbar/SnackbarProvider.mjs.map +1 -1
- package/build/Snackbar/constants.js +8 -0
- package/build/Snackbar/constants.js.map +1 -0
- package/build/Snackbar/constants.mjs +5 -0
- package/build/Snackbar/constants.mjs.map +1 -0
- package/build/Snackbar/useSnackbarManager.js +119 -0
- package/build/Snackbar/useSnackbarManager.js.map +1 -0
- package/build/Snackbar/useSnackbarManager.mjs +115 -0
- package/build/Snackbar/useSnackbarManager.mjs.map +1 -0
- package/build/i18n/th.json +1 -1
- package/build/i18n/th.json.js +1 -1
- package/build/i18n/th.json.mjs +1 -1
- package/build/i18n/zh-CN.json +0 -1
- package/build/i18n/zh-CN.json.js +0 -1
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +0 -1
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/main.css +113 -61
- package/build/styles/Snackbar/Snackbar.css +116 -64
- package/build/styles/main.css +113 -61
- package/build/types/Body/Body.d.ts +2 -2
- package/build/types/IconButton/IconButton.d.ts +1 -1
- package/build/types/ListItem/ListItem.d.ts +0 -2
- package/build/types/ListItem/ListItem.d.ts.map +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/Snackbar/Snackbar.d.ts +10 -8
- package/build/types/Snackbar/Snackbar.d.ts.map +1 -1
- package/build/types/Snackbar/Snackbar.types.d.ts +19 -0
- package/build/types/Snackbar/Snackbar.types.d.ts.map +1 -0
- package/build/types/Snackbar/SnackbarContext.d.ts +2 -2
- package/build/types/Snackbar/SnackbarContext.d.ts.map +1 -1
- package/build/types/Snackbar/SnackbarPortal.d.ts +4 -0
- package/build/types/Snackbar/SnackbarPortal.d.ts.map +1 -0
- package/build/types/Snackbar/SnackbarProvider.d.ts.map +1 -1
- package/build/types/Snackbar/constants.d.ts +3 -0
- package/build/types/Snackbar/constants.d.ts.map +1 -0
- package/build/types/Snackbar/useSnackbar.d.ts +1 -1
- package/build/types/Snackbar/useSnackbar.d.ts.map +1 -1
- package/build/types/Snackbar/useSnackbarManager.d.ts +16 -0
- package/build/types/Snackbar/useSnackbarManager.d.ts.map +1 -0
- package/build/types/Title/Title.d.ts +2 -2
- package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
- package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
- package/package.json +3 -3
- package/src/ListItem/ListItem.test.tsx +0 -42
- package/src/ListItem/ListItem.tsx +2 -23
- package/src/Snackbar/Snackbar.css +116 -64
- package/src/Snackbar/Snackbar.less +121 -60
- package/src/Snackbar/Snackbar.test.tsx +122 -133
- package/src/Snackbar/Snackbar.tsx +95 -96
- package/src/Snackbar/Snackbar.types.ts +21 -0
- package/src/Snackbar/SnackbarContext.ts +2 -2
- package/src/Snackbar/SnackbarPortal.tsx +8 -0
- package/src/Snackbar/SnackbarProvider.test.tsx +289 -0
- package/src/Snackbar/SnackbarProvider.tsx +19 -18
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +16 -6
- package/src/Snackbar/_stories/Snackbar.story.tsx +62 -1
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +26 -5
- package/src/Snackbar/constants.ts +2 -0
- package/src/Snackbar/useSnackbarManager.ts +122 -0
- package/src/i18n/th.json +1 -1
- package/src/i18n/zh-CN.json +0 -1
- package/src/main.css +113 -61
- package/src/ListItem/ListItem.ssr.test.tsx +0 -115
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-cbc00a7",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@testing-library/jest-dom": "^6.9.1",
|
|
60
60
|
"@testing-library/react": "^16.3.3",
|
|
61
61
|
"@testing-library/user-event": "^14.6.7",
|
|
62
|
-
"@transferwise/icons": "^4.
|
|
62
|
+
"@transferwise/icons": "^4.5.0",
|
|
63
63
|
"@transferwise/less-config": "3.2.0",
|
|
64
64
|
"@tsconfig/recommended": "^1.0.13",
|
|
65
65
|
"@types/babel__core": "^7.20.5",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/react-dom": "^18.3.7",
|
|
73
73
|
"@types/react-transition-group": "4.4.12",
|
|
74
74
|
"@monaco-editor/react": "^4.7.0",
|
|
75
|
-
"monaco-editor": "^0.
|
|
75
|
+
"monaco-editor": "^0.56.0",
|
|
76
76
|
"monaco-editor-webpack-plugin": "^7.1.1",
|
|
77
77
|
"@wise/art": "^2.32.0",
|
|
78
78
|
"@wise/components-theming": "1.10.3",
|
|
@@ -1480,48 +1480,6 @@ describe('ListItem', () => {
|
|
|
1480
1480
|
});
|
|
1481
1481
|
|
|
1482
1482
|
describe('spotlight', () => {
|
|
1483
|
-
it('updates spotlight when the control changes or is removed', () => {
|
|
1484
|
-
const { rerender } = render(
|
|
1485
|
-
<ListItem
|
|
1486
|
-
title="Test Title"
|
|
1487
|
-
spotlight="inactive"
|
|
1488
|
-
control={<ListItem.Button>Pay</ListItem.Button>}
|
|
1489
|
-
/>,
|
|
1490
|
-
);
|
|
1491
|
-
expect(screen.getByRole('listitem')).toHaveClass('wds-list-item-spotlight-inactive');
|
|
1492
|
-
|
|
1493
|
-
rerender(
|
|
1494
|
-
<ListItem
|
|
1495
|
-
title="Test Title"
|
|
1496
|
-
spotlight="inactive"
|
|
1497
|
-
control={<ListItem.Button partiallyInteractive>Pay</ListItem.Button>}
|
|
1498
|
-
/>,
|
|
1499
|
-
);
|
|
1500
|
-
expect(screen.getByRole('listitem')).not.toHaveClass('wds-list-item-spotlight');
|
|
1501
|
-
expect(screen.getByRole('listitem')).toHaveClass('wds-list-item-partially-interactive');
|
|
1502
|
-
|
|
1503
|
-
rerender(
|
|
1504
|
-
<ListItem
|
|
1505
|
-
title="Test Title"
|
|
1506
|
-
spotlight="active"
|
|
1507
|
-
control={<ListItem.Switch onClick={cb} />}
|
|
1508
|
-
/>,
|
|
1509
|
-
);
|
|
1510
|
-
expect(screen.getByRole('listitem')).toHaveClass('wds-list-item-spotlight-active');
|
|
1511
|
-
|
|
1512
|
-
rerender(<ListItem title="Test Title" spotlight="inactive" />);
|
|
1513
|
-
const listItem = screen.getByRole('listitem');
|
|
1514
|
-
expect(listItem).toHaveClass('wds-list-item-non-interactive');
|
|
1515
|
-
expect(listItem).not.toHaveClass('wds-list-item-spotlight');
|
|
1516
|
-
expect(listItem.querySelector('.wds-list-item-spotlight__border')).toBeNull();
|
|
1517
|
-
});
|
|
1518
|
-
|
|
1519
|
-
it('preserves client-side registration for wrapped controls', () => {
|
|
1520
|
-
const WrappedControl = () => <ListItem.Switch onClick={cb} />;
|
|
1521
|
-
render(<ListItem title="Test Title" spotlight="inactive" control={<WrappedControl />} />);
|
|
1522
|
-
expect(screen.getByRole('listitem')).toHaveClass('wds-list-item-spotlight-inactive');
|
|
1523
|
-
});
|
|
1524
|
-
|
|
1525
1483
|
it('only fully interactive variant can have spotlight:active', () => {
|
|
1526
1484
|
render(<ListItem title="Test Title" spotlight="active" control={<ListItem.Navigation />} />);
|
|
1527
1485
|
const listItem = screen.getByRole('listitem');
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isValidElement,
|
|
3
2
|
useContext,
|
|
4
3
|
useId,
|
|
5
4
|
useMemo,
|
|
@@ -39,15 +38,6 @@ export type ListItemControlProps =
|
|
|
39
38
|
| ListItemRadioProps
|
|
40
39
|
| ListItemSwitchProps;
|
|
41
40
|
|
|
42
|
-
const LIST_ITEM_CONTROLS = [
|
|
43
|
-
{ component: Navigation, type: 'navigation' },
|
|
44
|
-
{ component: Button, type: 'button' },
|
|
45
|
-
{ component: IconButton, type: 'icon-button' },
|
|
46
|
-
{ component: Checkbox, type: 'checkbox' },
|
|
47
|
-
{ component: Radio, type: 'radio' },
|
|
48
|
-
{ component: Switch, type: 'switch' },
|
|
49
|
-
] as const;
|
|
50
|
-
|
|
51
41
|
export type ListItemProps = {
|
|
52
42
|
/** @default 'li' */
|
|
53
43
|
as?: 'li' | 'div';
|
|
@@ -67,8 +57,6 @@ export type ListItemProps = {
|
|
|
67
57
|
disabledPromptMessage?: ReactNode;
|
|
68
58
|
/**
|
|
69
59
|
* Highlights the list item as an action to be taken or already taken. <br />
|
|
70
|
-
* Only applies to fully interactive items. Pass a supported ListItem control directly
|
|
71
|
-
* to include spotlight styles in server-rendered markup.
|
|
72
60
|
*/
|
|
73
61
|
spotlight?: 'active' | 'inactive';
|
|
74
62
|
/**
|
|
@@ -140,19 +128,10 @@ export const ListItem = ({
|
|
|
140
128
|
id,
|
|
141
129
|
}: ListItemProps) => {
|
|
142
130
|
const idPrefix = useId();
|
|
143
|
-
const [
|
|
144
|
-
const [
|
|
131
|
+
const [controlProps, setControlProps] = useState<ListItemControlProps>({});
|
|
132
|
+
const [controlType, setControlType] = useState<ListItemTypes>('non-interactive');
|
|
145
133
|
const [mediaSize, setMediaSize] = useState<ListItemMediaSize | undefined>();
|
|
146
134
|
|
|
147
|
-
// Resolve supported controls during SSR; retain registration for wrapped controls.
|
|
148
|
-
const controlElement = isValidElement<ListItemControlProps>(control) ? control : undefined;
|
|
149
|
-
const directControlType = LIST_ITEM_CONTROLS.find(
|
|
150
|
-
({ component }) => component === controlElement?.type,
|
|
151
|
-
)?.type;
|
|
152
|
-
const controlType = control ? (directControlType ?? registeredControlType) : 'non-interactive';
|
|
153
|
-
const controlProps =
|
|
154
|
-
directControlType && controlElement ? controlElement.props : registeredControlProps;
|
|
155
|
-
|
|
156
135
|
const ids: ListItemContextData['ids'] = {
|
|
157
136
|
title: `${idPrefix}_title`,
|
|
158
137
|
...(subtitle ? { subtitle: `${idPrefix}_subtitle` } : {}),
|
|
@@ -1,79 +1,131 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
1
|
+
.wds-Snackbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
padding-inline: 16px;
|
|
6
|
+
padding-inline: var(--size-16);
|
|
7
|
+
padding-block-end: calc(16px + env(safe-area-inset-bottom));
|
|
8
|
+
padding-block-end: calc(var(--size-16) + env(safe-area-inset-bottom));
|
|
3
9
|
position: fixed;
|
|
4
10
|
inset-block-end: 0;
|
|
5
|
-
inset-inline
|
|
6
|
-
inset-inline-end: 0;
|
|
11
|
+
inset-inline: 0;
|
|
7
12
|
z-index: 1060;
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
@media (min-width: 600px) {
|
|
15
|
+
.wds-Snackbar {
|
|
16
|
+
padding-block-end: 24px;
|
|
17
|
+
padding-block-end: var(--size-24);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.wds-Snackbar-container {
|
|
21
|
+
--Prompt-border-radius: var(--radius-medium);
|
|
22
|
+
--Prompt-gap: var(--size-8);
|
|
23
|
+
--Prompt-padding-x: var(--size-12);
|
|
24
|
+
--Prompt-padding-y: var(--size-12);
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
max-inline-size: 480px;
|
|
17
27
|
text-align: start;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
margin-inline: 16px;
|
|
22
|
-
margin-inline: var(--size-16);
|
|
23
|
-
padding-block: 8px;
|
|
24
|
-
padding-block: var(--size-8);
|
|
25
|
-
padding-inline: 16px;
|
|
26
|
-
padding-inline: var(--size-16);
|
|
27
|
-
inline-size: calc(100% - 32px);
|
|
28
|
-
inline-size: calc(100% - var(--size-32));
|
|
29
|
-
transition: 400ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
30
|
-
}
|
|
31
|
-
.np-theme-personal .snackbar__text {
|
|
32
|
-
box-shadow: 0 2px 4px 0 rgba(69, 71, 69, 0.35);
|
|
33
|
-
position: relative;
|
|
34
|
-
background: var(--color-contrast-theme);
|
|
35
|
-
border-radius: 10px;
|
|
36
|
-
border-radius: var(--radius-small);
|
|
37
|
-
color: var(--color-contrast-overlay);
|
|
38
|
-
}
|
|
39
|
-
.np-theme-personal .snackbar__text::after {
|
|
40
|
-
display: block;
|
|
41
|
-
border-radius: inherit;
|
|
42
|
-
block-size: 100%;
|
|
43
|
-
inline-size: 100%;
|
|
44
|
-
content: "";
|
|
45
|
-
position: absolute;
|
|
46
|
-
inset-inline-start: 0;
|
|
47
|
-
inset-block-start: 0;
|
|
48
|
-
z-index: -1;
|
|
49
|
-
background-color: rgba(134,167,189,0.10196);
|
|
50
|
-
background-color: var(--color-background-neutral);
|
|
51
|
-
}
|
|
52
|
-
.np-theme-personal--dark .snackbar__text,
|
|
53
|
-
.np-theme-personal--forest-green .snackbar__text {
|
|
54
|
-
box-shadow: none;
|
|
28
|
+
}
|
|
29
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
30
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
55
31
|
}
|
|
56
32
|
@media (min-width: 600px) {
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
max-inline-size: 600px;
|
|
33
|
+
.wds-Snackbar-container .wds-prompt__content-wrapper--with-dismiss {
|
|
34
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
60
35
|
}
|
|
61
36
|
}
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
37
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
min-block-size: max(32px, 1lh);
|
|
41
|
+
min-block-size: max(var(--size-32), 1lh);
|
|
42
|
+
padding-block-start: 0;
|
|
43
|
+
color: var(--color-sentiment-content-primary);
|
|
44
|
+
}
|
|
45
|
+
.wds-Snackbar-container .wds-prompt__media-wrapper:has(+ .wds-Snackbar__content .wds-Snackbar__action) {
|
|
46
|
+
min-block-size: max(32px, calc(1lh + 5px * 2));
|
|
47
|
+
min-block-size: max(var(--size-32), calc(1lh + var(--size-5) * 2));
|
|
48
|
+
}
|
|
49
|
+
.wds-Snackbar__media-asset {
|
|
50
|
+
display: flex;
|
|
66
51
|
}
|
|
67
|
-
.
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
.wds-Snackbar__media-asset svg {
|
|
53
|
+
inline-size: 24px;
|
|
54
|
+
inline-size: var(--size-24);
|
|
55
|
+
block-size: 24px;
|
|
56
|
+
block-size: var(--size-24);
|
|
70
57
|
}
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
59
|
+
display: none;
|
|
60
|
+
align-self: flex-start;
|
|
61
|
+
margin-block-start: calc(4px - 1px);
|
|
62
|
+
margin-block-start: calc(var(--size-4) - 1px);
|
|
74
63
|
}
|
|
75
64
|
@media (min-width: 600px) {
|
|
76
|
-
.
|
|
77
|
-
|
|
65
|
+
.wds-Snackbar-container .wds-prompt__dismiss {
|
|
66
|
+
display: flex;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
.wds-Snackbar__action {
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
}
|
|
72
|
+
.wds-Snackbar__content {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: flex-start;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
gap: var(--size-8);
|
|
77
|
+
flex: 1 0 0;
|
|
78
|
+
min-block-size: 32px;
|
|
79
|
+
min-block-size: var(--size-32);
|
|
80
|
+
min-inline-size: 0;
|
|
81
|
+
}
|
|
82
|
+
.wds-Snackbar__message {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
inline-size: auto;
|
|
87
|
+
flex: 1 0 0;
|
|
88
|
+
min-inline-size: 0;
|
|
89
|
+
align-self: stretch;
|
|
90
|
+
}
|
|
91
|
+
.wds-Snackbar__body {
|
|
92
|
+
display: block;
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
font-weight: var(--font-weight-medium);
|
|
95
|
+
}
|
|
96
|
+
.wds-Snackbar-container-appear,
|
|
97
|
+
.wds-Snackbar-container-enter {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transform: translateY(80px) scale(0.5);
|
|
100
|
+
}
|
|
101
|
+
.wds-Snackbar-container-appear-active,
|
|
102
|
+
.wds-Snackbar-container-enter-active {
|
|
103
|
+
opacity: 1;
|
|
104
|
+
transform: translateY(0) scale(1);
|
|
105
|
+
transition: opacity 150ms linear, transform var(--Snackbar-enter-duration) cubic-bezier(0, 0, 0, 1);
|
|
106
|
+
}
|
|
107
|
+
.wds-Snackbar-container-exit {
|
|
108
|
+
opacity: 1;
|
|
109
|
+
transform: translateY(0) scale(1);
|
|
110
|
+
}
|
|
111
|
+
.wds-Snackbar-container-exit-active {
|
|
112
|
+
opacity: 0;
|
|
113
|
+
transform: translateY(80px) scale(0.5);
|
|
114
|
+
transition: opacity 50ms linear 50ms, transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
115
|
+
}
|
|
116
|
+
@media (prefers-reduced-motion: reduce) {
|
|
117
|
+
.wds-Snackbar-container-appear,
|
|
118
|
+
.wds-Snackbar-container-appear-active,
|
|
119
|
+
.wds-Snackbar-container-enter,
|
|
120
|
+
.wds-Snackbar-container-enter-active,
|
|
121
|
+
.wds-Snackbar-container-exit {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
transform: none;
|
|
124
|
+
transition: none;
|
|
125
|
+
}
|
|
126
|
+
.wds-Snackbar-container-exit-active {
|
|
127
|
+
opacity: 0;
|
|
128
|
+
transform: none;
|
|
129
|
+
transition: none;
|
|
78
130
|
}
|
|
79
131
|
}
|
|
@@ -1,80 +1,141 @@
|
|
|
1
1
|
@import (reference) "./../styles/variables/zindex.less";
|
|
2
|
-
@import (reference) "./../styles/variables/neptune-tokens.less";
|
|
3
2
|
|
|
4
|
-
.
|
|
5
|
-
|
|
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));
|
|
6
9
|
position: fixed;
|
|
7
10
|
bottom: 0;
|
|
8
|
-
|
|
11
|
+
inset-inline: 0;
|
|
12
|
+
z-index: @zindex-mobile-nav;
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
@media (--screen-sm) {
|
|
15
|
+
padding-bottom: var(--size-24);
|
|
16
|
+
}
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
&-container {
|
|
19
|
+
--Prompt-border-radius: var(--radius-medium);
|
|
20
|
+
--Prompt-gap: var(--size-8);
|
|
21
|
+
--Prompt-padding-x: var(--size-12);
|
|
22
|
+
--Prompt-padding-y: var(--size-12);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
max-width: 480px;
|
|
25
|
+
text-align: start;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-container .wds-prompt__content-wrapper--with-dismiss {
|
|
29
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
30
|
+
|
|
31
|
+
@media (--screen-sm) {
|
|
32
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
13
35
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
color: @color-navy-content-primary;
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
border-radius: 2px;
|
|
19
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
|
|
36
|
+
&-container .wds-prompt__media-wrapper {
|
|
37
|
+
display: flex;
|
|
20
38
|
align-items: center;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
transition: 400ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
29
|
-
|
|
30
|
-
.np-theme-personal & {
|
|
31
|
-
box-shadow: 0 2px 4px 0 rgba(69, 71, 69, 0.35);
|
|
32
|
-
position: relative;
|
|
33
|
-
background: var(--color-contrast-theme);
|
|
34
|
-
border-radius: var(--radius-small);
|
|
35
|
-
color: var(--color-contrast-overlay);
|
|
36
|
-
|
|
37
|
-
&::after {
|
|
38
|
-
display: block;
|
|
39
|
-
border-radius: inherit;
|
|
40
|
-
height: 100%;
|
|
41
|
-
width: 100%;
|
|
42
|
-
content: "";
|
|
43
|
-
position: absolute;
|
|
44
|
-
left: 0;
|
|
45
|
-
top: 0;
|
|
46
|
-
z-index: -1;
|
|
47
|
-
background-color: var(--color-background-neutral);
|
|
48
|
-
}
|
|
39
|
+
min-height: max(var(--size-32), 1lh);
|
|
40
|
+
padding-top: 0;
|
|
41
|
+
color: var(--color-sentiment-content-primary);
|
|
42
|
+
|
|
43
|
+
// At 400% reflow spacing shrinks, but the text's line height does not.
|
|
44
|
+
&:has(+ .wds-Snackbar__content .wds-Snackbar__action) {
|
|
45
|
+
min-height: max(var(--size-32), calc(1lh + var(--size-5) * 2));
|
|
49
46
|
}
|
|
47
|
+
}
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
&__media-asset {
|
|
50
|
+
display: flex;
|
|
51
|
+
|
|
52
|
+
svg {
|
|
53
|
+
width: var(--size-24);
|
|
54
|
+
height: var(--size-24);
|
|
54
55
|
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&-container .wds-prompt__dismiss {
|
|
59
|
+
display: none;
|
|
60
|
+
align-self: flex-start;
|
|
61
|
+
margin-top: calc(var(--size-4) - 1px);
|
|
55
62
|
|
|
56
63
|
@media (--screen-sm) {
|
|
57
|
-
|
|
58
|
-
max-width: 600px;
|
|
64
|
+
display: flex;
|
|
59
65
|
}
|
|
66
|
+
}
|
|
60
67
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
68
|
+
&__action {
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
}
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
&__content {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: flex-start;
|
|
75
|
+
gap: var(--size-8);
|
|
76
|
+
flex: 1 0 0;
|
|
77
|
+
min-height: var(--size-32);
|
|
78
|
+
min-width: 0;
|
|
79
|
+
}
|
|
70
80
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
&__message {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
width: auto;
|
|
86
|
+
flex: 1 0 0;
|
|
87
|
+
min-width: 0;
|
|
88
|
+
align-self: stretch;
|
|
89
|
+
}
|
|
74
90
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
91
|
+
&__body {
|
|
92
|
+
display: block;
|
|
93
|
+
font-weight: var(--font-weight-medium);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.wds-Snackbar-container-appear,
|
|
98
|
+
.wds-Snackbar-container-enter {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
transform: translateY(80px) scale(0.5);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.wds-Snackbar-container-appear-active,
|
|
104
|
+
.wds-Snackbar-container-enter-active {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
transform: translateY(0) scale(1);
|
|
107
|
+
transition:
|
|
108
|
+
opacity 150ms linear,
|
|
109
|
+
transform var(--Snackbar-enter-duration) cubic-bezier(0, 0, 0, 1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.wds-Snackbar-container-exit {
|
|
113
|
+
opacity: 1;
|
|
114
|
+
transform: translateY(0) scale(1);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.wds-Snackbar-container-exit-active {
|
|
118
|
+
opacity: 0;
|
|
119
|
+
transform: translateY(80px) scale(0.5);
|
|
120
|
+
transition:
|
|
121
|
+
opacity 50ms linear 50ms,
|
|
122
|
+
transform var(--Snackbar-exit-duration) cubic-bezier(1, 0, 1, 1);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media (prefers-reduced-motion: reduce) {
|
|
126
|
+
.wds-Snackbar-container-appear,
|
|
127
|
+
.wds-Snackbar-container-appear-active,
|
|
128
|
+
.wds-Snackbar-container-enter,
|
|
129
|
+
.wds-Snackbar-container-enter-active,
|
|
130
|
+
.wds-Snackbar-container-exit {
|
|
131
|
+
opacity: 1;
|
|
132
|
+
transform: none;
|
|
133
|
+
transition: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.wds-Snackbar-container-exit-active {
|
|
137
|
+
opacity: 0;
|
|
138
|
+
transform: none;
|
|
139
|
+
transition: none;
|
|
79
140
|
}
|
|
80
141
|
}
|