@zendeskgarden/react-notifications 9.0.0-next.3 → 9.0.0-next.5
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 +6 -4
- package/dist/index.cjs.js +122 -111
- package/dist/index.esm.js +123 -112
- package/dist/typings/elements/Alert.d.ts +9 -1
- package/dist/typings/elements/Notification.d.ts +9 -1
- package/dist/typings/elements/Well.d.ts +7 -1
- package/dist/typings/elements/content/Close.d.ts +2 -0
- package/dist/typings/elements/content/Paragraph.d.ts +2 -0
- package/dist/typings/elements/content/Title.d.ts +2 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -14,16 +14,18 @@ npm install react react-dom styled-components @zendeskgarden/react-theming
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
+
## Notifications
|
|
18
|
+
|
|
17
19
|
```jsx
|
|
18
20
|
import { ThemeProvider } from '@zendeskgarden/react-theming';
|
|
19
|
-
import { Notification
|
|
21
|
+
import { Notification } from '@zendeskgarden/react-notifications';
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* Place a `ThemeProvider` at the root of your React application
|
|
23
25
|
*/
|
|
24
26
|
<ThemeProvider>
|
|
25
27
|
<Notification>
|
|
26
|
-
<Title>Example Title</Title>
|
|
28
|
+
<Notification.Title>Example Title</Notification.Title>
|
|
27
29
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit...
|
|
28
30
|
</Notification>
|
|
29
31
|
</ThemeProvider>;
|
|
@@ -34,7 +36,7 @@ import { Notification, Title } from '@zendeskgarden/react-notifications';
|
|
|
34
36
|
```jsx
|
|
35
37
|
import { ThemeProvider } from '@zendeskgarden/react-theming';
|
|
36
38
|
import { Button } from '@zendeskgarden/react-buttons';
|
|
37
|
-
import { Notification,
|
|
39
|
+
import { Notification, ToastProvider, useToast } from '@zendeskgarden/react-notifications';
|
|
38
40
|
|
|
39
41
|
const ToastExample = () => {
|
|
40
42
|
const { addToast } = useToast();
|
|
@@ -45,7 +47,7 @@ const ToastExample = () => {
|
|
|
45
47
|
addToast(({ close }) => (
|
|
46
48
|
<Notification>
|
|
47
49
|
Example notification
|
|
48
|
-
<Close onClick={close} aria-label="Close" />
|
|
50
|
+
<Notification.Close onClick={close} aria-label="Close" />
|
|
49
51
|
</Notification>
|
|
50
52
|
))
|
|
51
53
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -60,11 +60,11 @@ const TYPE = ['success', 'warning', 'error', 'info'];
|
|
|
60
60
|
const COMPONENT_ID$b = 'notifications.close';
|
|
61
61
|
const StyledClose = styled__default.default.button.attrs({
|
|
62
62
|
'data-garden-id': COMPONENT_ID$b,
|
|
63
|
-
'data-garden-version': '9.0.0-next.
|
|
63
|
+
'data-garden-version': '9.0.0-next.5'
|
|
64
64
|
}).withConfig({
|
|
65
65
|
displayName: "StyledClose",
|
|
66
66
|
componentId: "sc-1mr9nx1-0"
|
|
67
|
-
})(["display:block;position:absolute;top:", "px;", ":", ";transition:background-color 0.1s ease-in-out,color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;color:", ";font-size:0;user-select:none;&::-moz-focus-inner{border:0;}&:hover{color:", ";}", " ", ";"], props => props.theme.space.base, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base}px`, props => props.theme.space.base * 7, props => props.theme.space.base * 7, props => props.hue ? reactTheming.
|
|
67
|
+
})(["display:block;position:absolute;top:", "px;", ":", ";transition:background-color 0.1s ease-in-out,color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;color:", ";font-size:0;user-select:none;&::-moz-focus-inner{border:0;}&:hover{color:", ";}", " ", ";"], props => props.theme.space.base, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base}px`, props => props.theme.space.base * 7, props => props.theme.space.base * 7, props => props.hue ? reactTheming.getColorV8(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme) : reactTheming.getColorV8('neutralHue', 600, props.theme), props => props.hue ? reactTheming.getColorV8(props.hue, 800, props.theme) : reactTheming.getColorV8('neutralHue', 800, props.theme), props => reactTheming.focusStyles({
|
|
68
68
|
theme: props.theme,
|
|
69
69
|
inset: true
|
|
70
70
|
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
@@ -75,7 +75,7 @@ StyledClose.defaultProps = {
|
|
|
75
75
|
const COMPONENT_ID$a = 'notifications.paragraph';
|
|
76
76
|
const StyledParagraph = styled__default.default.p.attrs({
|
|
77
77
|
'data-garden-id': COMPONENT_ID$a,
|
|
78
|
-
'data-garden-version': '9.0.0-next.
|
|
78
|
+
'data-garden-version': '9.0.0-next.5'
|
|
79
79
|
}).withConfig({
|
|
80
80
|
displayName: "StyledParagraph",
|
|
81
81
|
componentId: "sc-12tmd6p-0"
|
|
@@ -87,7 +87,7 @@ StyledParagraph.defaultProps = {
|
|
|
87
87
|
const COMPONENT_ID$9 = 'notifications.title';
|
|
88
88
|
const StyledTitle = styled__default.default.div.attrs({
|
|
89
89
|
'data-garden-id': COMPONENT_ID$9,
|
|
90
|
-
'data-garden-version': '9.0.0-next.
|
|
90
|
+
'data-garden-version': '9.0.0-next.5'
|
|
91
91
|
}).withConfig({
|
|
92
92
|
displayName: "StyledTitle",
|
|
93
93
|
componentId: "sc-xx4jsv-0"
|
|
@@ -106,7 +106,7 @@ const boxShadow = props => {
|
|
|
106
106
|
} = theme;
|
|
107
107
|
const offsetY = `${space.base * 5}px`;
|
|
108
108
|
const blurRadius = `${space.base * 7}px`;
|
|
109
|
-
const color = reactTheming.
|
|
109
|
+
const color = reactTheming.getColorV8('chromeHue', 600, theme, 0.15);
|
|
110
110
|
return shadows.lg(offsetY, blurRadius, color);
|
|
111
111
|
};
|
|
112
112
|
const colorStyles$6 = props => {
|
|
@@ -114,13 +114,13 @@ const colorStyles$6 = props => {
|
|
|
114
114
|
let borderColor;
|
|
115
115
|
let foregroundColor;
|
|
116
116
|
if (props.hue) {
|
|
117
|
-
backgroundColor = reactTheming.
|
|
118
|
-
borderColor = reactTheming.
|
|
119
|
-
foregroundColor = reactTheming.
|
|
117
|
+
backgroundColor = reactTheming.getColorV8(props.hue, 100, props.theme);
|
|
118
|
+
borderColor = reactTheming.getColorV8(props.hue, 300, props.theme);
|
|
119
|
+
foregroundColor = reactTheming.getColorV8(props.hue, props.type === 'info' ? 600 : 700, props.theme);
|
|
120
120
|
} else {
|
|
121
121
|
backgroundColor = props.theme.colors.background;
|
|
122
|
-
borderColor = reactTheming.
|
|
123
|
-
foregroundColor = reactTheming.
|
|
122
|
+
borderColor = reactTheming.getColorV8('neutralHue', 300, props.theme);
|
|
123
|
+
foregroundColor = reactTheming.getColorV8('neutralHue', 800, props.theme);
|
|
124
124
|
}
|
|
125
125
|
return styled.css(["border-color:", ";background-color:", ";color:", ";"], borderColor, backgroundColor, foregroundColor);
|
|
126
126
|
};
|
|
@@ -141,10 +141,10 @@ StyledBase.defaultProps = {
|
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
const COMPONENT_ID$8 = 'notifications.alert';
|
|
144
|
-
const colorStyles$5 = props => styled.css(["", "{color:", ";}"], StyledTitle, props.hue && reactTheming.
|
|
144
|
+
const colorStyles$5 = props => styled.css(["", "{color:", ";}"], StyledTitle, props.hue && reactTheming.getColorV8(props.hue, 800, props.theme));
|
|
145
145
|
const StyledAlert = styled__default.default(StyledBase).attrs({
|
|
146
146
|
'data-garden-id': COMPONENT_ID$8,
|
|
147
|
-
'data-garden-version': '9.0.0-next.
|
|
147
|
+
'data-garden-version': '9.0.0-next.5'
|
|
148
148
|
}).withConfig({
|
|
149
149
|
displayName: "StyledAlert",
|
|
150
150
|
componentId: "sc-fyn8jp-0"
|
|
@@ -171,13 +171,13 @@ const colorStyles$4 = props => {
|
|
|
171
171
|
let color;
|
|
172
172
|
switch (type) {
|
|
173
173
|
case 'success':
|
|
174
|
-
color = reactTheming.
|
|
174
|
+
color = reactTheming.getColorV8(successHue, 600, theme);
|
|
175
175
|
break;
|
|
176
176
|
case 'error':
|
|
177
|
-
color = reactTheming.
|
|
177
|
+
color = reactTheming.getColorV8(dangerHue, 600, theme);
|
|
178
178
|
break;
|
|
179
179
|
case 'warning':
|
|
180
|
-
color = reactTheming.
|
|
180
|
+
color = reactTheming.getColorV8(warningHue, 700, theme);
|
|
181
181
|
break;
|
|
182
182
|
case 'info':
|
|
183
183
|
color = foreground;
|
|
@@ -190,7 +190,7 @@ const colorStyles$4 = props => {
|
|
|
190
190
|
};
|
|
191
191
|
const StyledNotification = styled__default.default(StyledBase).attrs({
|
|
192
192
|
'data-garden-id': COMPONENT_ID$7,
|
|
193
|
-
'data-garden-version': '9.0.0-next.
|
|
193
|
+
'data-garden-version': '9.0.0-next.5'
|
|
194
194
|
}).withConfig({
|
|
195
195
|
displayName: "StyledNotification",
|
|
196
196
|
componentId: "sc-uf6jh-0"
|
|
@@ -205,11 +205,11 @@ StyledNotification.defaultProps = {
|
|
|
205
205
|
const COMPONENT_ID$6 = 'notifications.well';
|
|
206
206
|
const StyledWell = styled__default.default(StyledBase).attrs({
|
|
207
207
|
'data-garden-id': COMPONENT_ID$6,
|
|
208
|
-
'data-garden-version': '9.0.0-next.
|
|
208
|
+
'data-garden-version': '9.0.0-next.5'
|
|
209
209
|
}).withConfig({
|
|
210
210
|
displayName: "StyledWell",
|
|
211
211
|
componentId: "sc-a5831c-0"
|
|
212
|
-
})(["background-color:", ";color:", " ", ";"], props => props.isRecessed && reactTheming.
|
|
212
|
+
})(["background-color:", ";color:", " ", ";"], props => props.isRecessed && reactTheming.getColorV8('neutralHue', 100, props.theme), props => reactTheming.getColorV8('neutralHue', 600, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
213
213
|
StyledWell.defaultProps = {
|
|
214
214
|
theme: reactTheming.DEFAULT_THEME
|
|
215
215
|
};
|
|
@@ -223,7 +223,7 @@ const StyledIcon = styled__default.default(_ref => {
|
|
|
223
223
|
}).withConfig({
|
|
224
224
|
displayName: "StyledIcon",
|
|
225
225
|
componentId: "sc-msklws-0"
|
|
226
|
-
})(["position:absolute;right:", ";left:", ";margin-top:", "px;color:", ";"], props => props.theme.rtl && `${props.theme.space.base * 4}px`, props => !props.theme.rtl && `${props.theme.space.base * 4}px`, props => props.theme.space.base / 2, props => props.hue && reactTheming.
|
|
226
|
+
})(["position:absolute;right:", ";left:", ";margin-top:", "px;color:", ";"], props => props.theme.rtl && `${props.theme.space.base * 4}px`, props => !props.theme.rtl && `${props.theme.space.base * 4}px`, props => props.theme.space.base / 2, props => props.hue && reactTheming.getColorV8(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme));
|
|
227
227
|
StyledIcon.defaultProps = {
|
|
228
228
|
theme: reactTheming.DEFAULT_THEME
|
|
229
229
|
};
|
|
@@ -238,35 +238,35 @@ const colorStyles$3 = props => {
|
|
|
238
238
|
let focusColor;
|
|
239
239
|
switch (props.alertType) {
|
|
240
240
|
case 'success':
|
|
241
|
-
borderColor = reactTheming.
|
|
242
|
-
backgroundColor = reactTheming.
|
|
243
|
-
foregroundColor = reactTheming.
|
|
241
|
+
borderColor = reactTheming.getColorV8('successHue', 700, props.theme);
|
|
242
|
+
backgroundColor = reactTheming.getColorV8('successHue', 600, props.theme);
|
|
243
|
+
foregroundColor = reactTheming.getColorV8('successHue', 100, props.theme);
|
|
244
244
|
anchorHoverColor = props.theme.palette.white;
|
|
245
245
|
anchorActiveColor = props.theme.palette.white;
|
|
246
246
|
focusColor = 'successHue';
|
|
247
247
|
break;
|
|
248
248
|
case 'error':
|
|
249
|
-
borderColor = reactTheming.
|
|
250
|
-
backgroundColor = reactTheming.
|
|
251
|
-
foregroundColor = reactTheming.
|
|
249
|
+
borderColor = reactTheming.getColorV8('dangerHue', 700, props.theme);
|
|
250
|
+
backgroundColor = reactTheming.getColorV8('dangerHue', 600, props.theme);
|
|
251
|
+
foregroundColor = reactTheming.getColorV8('dangerHue', 100, props.theme);
|
|
252
252
|
anchorHoverColor = props.theme.palette.white;
|
|
253
253
|
anchorActiveColor = props.theme.palette.white;
|
|
254
254
|
focusColor = 'dangerHue';
|
|
255
255
|
break;
|
|
256
256
|
case 'warning':
|
|
257
|
-
borderColor = reactTheming.
|
|
258
|
-
backgroundColor = reactTheming.
|
|
259
|
-
foregroundColor = reactTheming.
|
|
260
|
-
anchorHoverColor = reactTheming.
|
|
261
|
-
anchorActiveColor = reactTheming.
|
|
257
|
+
borderColor = reactTheming.getColorV8('warningHue', 400, props.theme);
|
|
258
|
+
backgroundColor = reactTheming.getColorV8('warningHue', 300, props.theme);
|
|
259
|
+
foregroundColor = reactTheming.getColorV8('warningHue', 800, props.theme);
|
|
260
|
+
anchorHoverColor = reactTheming.getColorV8('warningHue', 900, props.theme);
|
|
261
|
+
anchorActiveColor = reactTheming.getColorV8('warningHue', 1000, props.theme);
|
|
262
262
|
focusColor = 'warningHue';
|
|
263
263
|
break;
|
|
264
264
|
case 'info':
|
|
265
|
-
borderColor = reactTheming.
|
|
266
|
-
backgroundColor = reactTheming.
|
|
267
|
-
foregroundColor = reactTheming.
|
|
268
|
-
anchorHoverColor = reactTheming.
|
|
269
|
-
anchorActiveColor = reactTheming.
|
|
265
|
+
borderColor = reactTheming.getColorV8('primaryHue', 300, props.theme);
|
|
266
|
+
backgroundColor = reactTheming.getColorV8('primaryHue', 200, props.theme);
|
|
267
|
+
foregroundColor = reactTheming.getColorV8('primaryHue', 700, props.theme);
|
|
268
|
+
anchorHoverColor = reactTheming.getColorV8('primaryHue', 800, props.theme);
|
|
269
|
+
anchorActiveColor = reactTheming.getColorV8('primaryHue', 900, props.theme);
|
|
270
270
|
focusColor = 'primaryHue';
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
@@ -292,7 +292,7 @@ const sizeStyles$3 = props => {
|
|
|
292
292
|
};
|
|
293
293
|
const StyledGlobalAlert = styled__default.default.div.attrs({
|
|
294
294
|
'data-garden-id': COMPONENT_ID$5,
|
|
295
|
-
'data-garden-version': '9.0.0-next.
|
|
295
|
+
'data-garden-version': '9.0.0-next.5'
|
|
296
296
|
}).withConfig({
|
|
297
297
|
displayName: "StyledGlobalAlert",
|
|
298
298
|
componentId: "sc-k6rimt-0"
|
|
@@ -310,31 +310,31 @@ const colorStyles$2 = props => {
|
|
|
310
310
|
let focusColor;
|
|
311
311
|
switch (props.alertType) {
|
|
312
312
|
case 'success':
|
|
313
|
-
hoverBackgroundColor = reactTheming.
|
|
313
|
+
hoverBackgroundColor = reactTheming.getColorV8('successHue', 100, props.theme, 0.08);
|
|
314
314
|
hoverForegroundColor = props.theme.palette.white;
|
|
315
|
-
activeBackgroundColor = reactTheming.
|
|
315
|
+
activeBackgroundColor = reactTheming.getColorV8('successHue', 100, props.theme, 0.2);
|
|
316
316
|
activeForegroundColor = props.theme.palette.white;
|
|
317
317
|
focusColor = 'successHue';
|
|
318
318
|
break;
|
|
319
319
|
case 'error':
|
|
320
|
-
hoverBackgroundColor = reactTheming.
|
|
320
|
+
hoverBackgroundColor = reactTheming.getColorV8('dangerHue', 100, props.theme, 0.08);
|
|
321
321
|
hoverForegroundColor = props.theme.palette.white;
|
|
322
|
-
activeBackgroundColor = reactTheming.
|
|
322
|
+
activeBackgroundColor = reactTheming.getColorV8('dangerHue', 100, props.theme, 0.2);
|
|
323
323
|
activeForegroundColor = props.theme.palette.white;
|
|
324
324
|
focusColor = 'dangerHue';
|
|
325
325
|
break;
|
|
326
326
|
case 'warning':
|
|
327
|
-
hoverBackgroundColor = reactTheming.
|
|
328
|
-
hoverForegroundColor = reactTheming.
|
|
329
|
-
activeBackgroundColor = reactTheming.
|
|
330
|
-
activeForegroundColor = reactTheming.
|
|
327
|
+
hoverBackgroundColor = reactTheming.getColorV8('warningHue', 800, props.theme, 0.08);
|
|
328
|
+
hoverForegroundColor = reactTheming.getColorV8('warningHue', 900, props.theme);
|
|
329
|
+
activeBackgroundColor = reactTheming.getColorV8('warningHue', 800, props.theme, 0.2);
|
|
330
|
+
activeForegroundColor = reactTheming.getColorV8('warningHue', 1000, props.theme);
|
|
331
331
|
focusColor = 'warningHue';
|
|
332
332
|
break;
|
|
333
333
|
case 'info':
|
|
334
|
-
hoverBackgroundColor = reactTheming.
|
|
335
|
-
hoverForegroundColor = reactTheming.
|
|
336
|
-
activeBackgroundColor = reactTheming.
|
|
337
|
-
activeForegroundColor = reactTheming.
|
|
334
|
+
hoverBackgroundColor = reactTheming.getColorV8('primaryHue', 700, props.theme, 0.08);
|
|
335
|
+
hoverForegroundColor = reactTheming.getColorV8('primaryHue', 800, props.theme);
|
|
336
|
+
activeBackgroundColor = reactTheming.getColorV8('primaryHue', 700, props.theme, 0.2);
|
|
337
|
+
activeForegroundColor = reactTheming.getColorV8('primaryHue', 900, props.theme);
|
|
338
338
|
focusColor = 'primaryHue';
|
|
339
339
|
break;
|
|
340
340
|
}
|
|
@@ -352,7 +352,7 @@ const sizeStyles$2 = props => {
|
|
|
352
352
|
};
|
|
353
353
|
const StyledGlobalAlertClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
354
354
|
'data-garden-id': COMPONENT_ID$4,
|
|
355
|
-
'data-garden-version': '9.0.0-next.
|
|
355
|
+
'data-garden-version': '9.0.0-next.5',
|
|
356
356
|
size: 'small'
|
|
357
357
|
}).withConfig({
|
|
358
358
|
displayName: "StyledGlobalAlertClose",
|
|
@@ -373,21 +373,21 @@ function colorStyles$1(props) {
|
|
|
373
373
|
let focusColor;
|
|
374
374
|
switch (props.alertType) {
|
|
375
375
|
case 'success':
|
|
376
|
-
backgroundColor = reactTheming.
|
|
377
|
-
hoverBackgroundColor = reactTheming.
|
|
378
|
-
activeBackgroundColor = reactTheming.
|
|
376
|
+
backgroundColor = reactTheming.getColorV8('successHue', 800, props.theme);
|
|
377
|
+
hoverBackgroundColor = reactTheming.getColorV8('successHue', 900, props.theme);
|
|
378
|
+
activeBackgroundColor = reactTheming.getColorV8('successHue', 1000, props.theme);
|
|
379
379
|
focusColor = 'successHue';
|
|
380
380
|
break;
|
|
381
381
|
case 'error':
|
|
382
|
-
backgroundColor = reactTheming.
|
|
383
|
-
hoverBackgroundColor = reactTheming.
|
|
384
|
-
activeBackgroundColor = reactTheming.
|
|
382
|
+
backgroundColor = reactTheming.getColorV8('dangerHue', 800, props.theme);
|
|
383
|
+
hoverBackgroundColor = reactTheming.getColorV8('dangerHue', 900, props.theme);
|
|
384
|
+
activeBackgroundColor = reactTheming.getColorV8('dangerHue', 1000, props.theme);
|
|
385
385
|
focusColor = 'dangerHue';
|
|
386
386
|
break;
|
|
387
387
|
case 'warning':
|
|
388
|
-
backgroundColor = reactTheming.
|
|
389
|
-
hoverBackgroundColor = reactTheming.
|
|
390
|
-
activeBackgroundColor = reactTheming.
|
|
388
|
+
backgroundColor = reactTheming.getColorV8('warningHue', 800, props.theme);
|
|
389
|
+
hoverBackgroundColor = reactTheming.getColorV8('warningHue', 900, props.theme);
|
|
390
|
+
activeBackgroundColor = reactTheming.getColorV8('warningHue', 1000, props.theme);
|
|
391
391
|
focusColor = 'warningHue';
|
|
392
392
|
break;
|
|
393
393
|
case 'info':
|
|
@@ -407,7 +407,7 @@ function sizeStyles$1(props) {
|
|
|
407
407
|
}
|
|
408
408
|
const StyledGlobalAlertButton = styled__default.default(reactButtons.Button).attrs({
|
|
409
409
|
'data-garden-id': COMPONENT_ID$3,
|
|
410
|
-
'data-garden-version': '9.0.0-next.
|
|
410
|
+
'data-garden-version': '9.0.0-next.5',
|
|
411
411
|
focusInset: false,
|
|
412
412
|
isDanger: false,
|
|
413
413
|
isLink: false,
|
|
@@ -426,7 +426,7 @@ StyledGlobalAlertButton.defaultProps = {
|
|
|
426
426
|
const COMPONENT_ID$2 = 'notifications.global-alert.content';
|
|
427
427
|
const StyledGlobalAlertContent = styled__default.default.div.attrs({
|
|
428
428
|
'data-garden-id': COMPONENT_ID$2,
|
|
429
|
-
'data-garden-version': '9.0.0-next.
|
|
429
|
+
'data-garden-version': '9.0.0-next.5'
|
|
430
430
|
}).withConfig({
|
|
431
431
|
displayName: "StyledGlobalAlertContent",
|
|
432
432
|
componentId: "sc-rept0u-0"
|
|
@@ -450,7 +450,7 @@ const StyledGlobalAlertIcon = styled__default.default(_ref => {
|
|
|
450
450
|
return React__namespace.default.cloneElement(React.Children.only(children), props);
|
|
451
451
|
}).attrs({
|
|
452
452
|
'data-garden-id': COMPONENT_ID$1,
|
|
453
|
-
'data-garden-version': '9.0.0-next.
|
|
453
|
+
'data-garden-version': '9.0.0-next.5'
|
|
454
454
|
}).withConfig({
|
|
455
455
|
displayName: "StyledGlobalAlertIcon",
|
|
456
456
|
componentId: "sc-84ne9k-0"
|
|
@@ -468,17 +468,17 @@ const colorStyles = props => {
|
|
|
468
468
|
color = props.theme.palette.white;
|
|
469
469
|
break;
|
|
470
470
|
case 'warning':
|
|
471
|
-
color = reactTheming.
|
|
471
|
+
color = reactTheming.getColorV8('warningHue', 900, props.theme);
|
|
472
472
|
break;
|
|
473
473
|
case 'info':
|
|
474
|
-
color = reactTheming.
|
|
474
|
+
color = reactTheming.getColorV8('primaryHue', 800, props.theme);
|
|
475
475
|
break;
|
|
476
476
|
}
|
|
477
477
|
return styled.css(["color:", ";"], color);
|
|
478
478
|
};
|
|
479
479
|
const StyledGlobalAlertTitle = styled__default.default.div.attrs({
|
|
480
480
|
'data-garden-id': COMPONENT_ID,
|
|
481
|
-
'data-garden-version': '9.0.0-next.
|
|
481
|
+
'data-garden-version': '9.0.0-next.5'
|
|
482
482
|
}).withConfig({
|
|
483
483
|
displayName: "StyledGlobalAlertTitle",
|
|
484
484
|
componentId: "sc-10clqbo-0"
|
|
@@ -608,7 +608,45 @@ const useNotificationsContext = () => {
|
|
|
608
608
|
return React.useContext(NotificationsContext);
|
|
609
609
|
};
|
|
610
610
|
|
|
611
|
-
const
|
|
611
|
+
const Title = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledTitle, _extends$6({
|
|
612
|
+
ref: ref
|
|
613
|
+
}, props)));
|
|
614
|
+
Title.displayName = 'Title';
|
|
615
|
+
|
|
616
|
+
const Paragraph = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledParagraph, _extends$6({
|
|
617
|
+
ref: ref
|
|
618
|
+
}, props)));
|
|
619
|
+
Paragraph.displayName = 'Paragraph';
|
|
620
|
+
|
|
621
|
+
var _path$1;
|
|
622
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
623
|
+
var SvgXStroke$1 = function SvgXStroke(props) {
|
|
624
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
625
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
626
|
+
width: 12,
|
|
627
|
+
height: 12,
|
|
628
|
+
focusable: "false",
|
|
629
|
+
viewBox: "0 0 12 12",
|
|
630
|
+
"aria-hidden": "true"
|
|
631
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
632
|
+
stroke: "currentColor",
|
|
633
|
+
strokeLinecap: "round",
|
|
634
|
+
d: "M3 9l6-6m0 6L3 3"
|
|
635
|
+
})));
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
const Close = React__namespace.default.forwardRef((props, ref) => {
|
|
639
|
+
const ariaLabel = reactTheming.useText(Close, props, 'aria-label', 'Close');
|
|
640
|
+
const hue = useNotificationsContext();
|
|
641
|
+
return React__namespace.default.createElement(StyledClose, _extends$6({
|
|
642
|
+
ref: ref,
|
|
643
|
+
hue: hue,
|
|
644
|
+
"aria-label": ariaLabel
|
|
645
|
+
}, props), React__namespace.default.createElement(SvgXStroke$1, null));
|
|
646
|
+
});
|
|
647
|
+
Close.displayName = 'Close';
|
|
648
|
+
|
|
649
|
+
const AlertComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
612
650
|
let {
|
|
613
651
|
role,
|
|
614
652
|
...props
|
|
@@ -625,12 +663,16 @@ const Alert = React__namespace.default.forwardRef((_ref, ref) => {
|
|
|
625
663
|
hue: hue
|
|
626
664
|
}, React__namespace.default.createElement(Icon, null)), props.children));
|
|
627
665
|
});
|
|
628
|
-
|
|
629
|
-
|
|
666
|
+
AlertComponent.displayName = 'Alert';
|
|
667
|
+
AlertComponent.propTypes = {
|
|
630
668
|
type: PropTypes__default.default.oneOf(TYPE).isRequired
|
|
631
669
|
};
|
|
670
|
+
const Alert = AlertComponent;
|
|
671
|
+
Alert.Close = Close;
|
|
672
|
+
Alert.Paragraph = Paragraph;
|
|
673
|
+
Alert.Title = Title;
|
|
632
674
|
|
|
633
|
-
const
|
|
675
|
+
const NotificationComponent = React.forwardRef((_ref, ref) => {
|
|
634
676
|
let {
|
|
635
677
|
role,
|
|
636
678
|
...props
|
|
@@ -647,57 +689,26 @@ const Notification = React.forwardRef((_ref, ref) => {
|
|
|
647
689
|
hue: hue
|
|
648
690
|
}, React__namespace.default.createElement(Icon, null)), props.children);
|
|
649
691
|
});
|
|
650
|
-
|
|
651
|
-
|
|
692
|
+
NotificationComponent.displayName = 'Notification';
|
|
693
|
+
NotificationComponent.propTypes = {
|
|
652
694
|
type: PropTypes__default.default.oneOf(TYPE)
|
|
653
695
|
};
|
|
696
|
+
const Notification = NotificationComponent;
|
|
697
|
+
Notification.Close = Close;
|
|
698
|
+
Notification.Paragraph = Paragraph;
|
|
699
|
+
Notification.Title = Title;
|
|
654
700
|
|
|
655
|
-
const
|
|
701
|
+
const WellComponent = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledWell, _extends$6({
|
|
656
702
|
ref: ref
|
|
657
703
|
}, props)));
|
|
658
|
-
|
|
659
|
-
|
|
704
|
+
WellComponent.displayName = 'Well';
|
|
705
|
+
WellComponent.propTypes = {
|
|
660
706
|
isRecessed: PropTypes__default.default.bool,
|
|
661
707
|
isFloating: PropTypes__default.default.bool
|
|
662
708
|
};
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
var SvgXStroke$1 = function SvgXStroke(props) {
|
|
667
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
668
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
669
|
-
width: 12,
|
|
670
|
-
height: 12,
|
|
671
|
-
focusable: "false",
|
|
672
|
-
viewBox: "0 0 12 12",
|
|
673
|
-
"aria-hidden": "true"
|
|
674
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
675
|
-
stroke: "currentColor",
|
|
676
|
-
strokeLinecap: "round",
|
|
677
|
-
d: "M3 9l6-6m0 6L3 3"
|
|
678
|
-
})));
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
const Close = React__namespace.default.forwardRef((props, ref) => {
|
|
682
|
-
const ariaLabel = reactTheming.useText(Close, props, 'aria-label', 'Close');
|
|
683
|
-
const hue = useNotificationsContext();
|
|
684
|
-
return React__namespace.default.createElement(StyledClose, _extends$6({
|
|
685
|
-
ref: ref,
|
|
686
|
-
hue: hue,
|
|
687
|
-
"aria-label": ariaLabel
|
|
688
|
-
}, props), React__namespace.default.createElement(SvgXStroke$1, null));
|
|
689
|
-
});
|
|
690
|
-
Close.displayName = 'Close';
|
|
691
|
-
|
|
692
|
-
const Paragraph = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledParagraph, _extends$6({
|
|
693
|
-
ref: ref
|
|
694
|
-
}, props)));
|
|
695
|
-
Paragraph.displayName = 'Paragraph';
|
|
696
|
-
|
|
697
|
-
const Title = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledTitle, _extends$6({
|
|
698
|
-
ref: ref
|
|
699
|
-
}, props)));
|
|
700
|
-
Title.displayName = 'Title';
|
|
709
|
+
const Well = WellComponent;
|
|
710
|
+
Well.Paragraph = Paragraph;
|
|
711
|
+
Well.Title = Title;
|
|
701
712
|
|
|
702
713
|
const getInitialState = () => {
|
|
703
714
|
return {
|
package/dist/index.esm.js
CHANGED
|
@@ -9,7 +9,7 @@ import * as React from 'react';
|
|
|
9
9
|
import React__default, { Children, createContext, useContext, forwardRef, useCallback, useState, useRef, useEffect, useReducer, useMemo } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import styled, { css, ThemeContext } from 'styled-components';
|
|
12
|
-
import {
|
|
12
|
+
import { getColorV8, focusStyles, retrieveComponentStyles, DEFAULT_THEME, getLineHeight, useText, useDocument } from '@zendeskgarden/react-theming';
|
|
13
13
|
import { IconButton, Button } from '@zendeskgarden/react-buttons';
|
|
14
14
|
import { math, hideVisually } from 'polished';
|
|
15
15
|
import { TransitionGroup, CSSTransition } from 'react-transition-group';
|
|
@@ -35,11 +35,11 @@ const TYPE = ['success', 'warning', 'error', 'info'];
|
|
|
35
35
|
const COMPONENT_ID$b = 'notifications.close';
|
|
36
36
|
const StyledClose = styled.button.attrs({
|
|
37
37
|
'data-garden-id': COMPONENT_ID$b,
|
|
38
|
-
'data-garden-version': '9.0.0-next.
|
|
38
|
+
'data-garden-version': '9.0.0-next.5'
|
|
39
39
|
}).withConfig({
|
|
40
40
|
displayName: "StyledClose",
|
|
41
41
|
componentId: "sc-1mr9nx1-0"
|
|
42
|
-
})(["display:block;position:absolute;top:", "px;", ":", ";transition:background-color 0.1s ease-in-out,color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;color:", ";font-size:0;user-select:none;&::-moz-focus-inner{border:0;}&:hover{color:", ";}", " ", ";"], props => props.theme.space.base, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base}px`, props => props.theme.space.base * 7, props => props.theme.space.base * 7, props => props.hue ?
|
|
42
|
+
})(["display:block;position:absolute;top:", "px;", ":", ";transition:background-color 0.1s ease-in-out,color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;color:", ";font-size:0;user-select:none;&::-moz-focus-inner{border:0;}&:hover{color:", ";}", " ", ";"], props => props.theme.space.base, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base}px`, props => props.theme.space.base * 7, props => props.theme.space.base * 7, props => props.hue ? getColorV8(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme) : getColorV8('neutralHue', 600, props.theme), props => props.hue ? getColorV8(props.hue, 800, props.theme) : getColorV8('neutralHue', 800, props.theme), props => focusStyles({
|
|
43
43
|
theme: props.theme,
|
|
44
44
|
inset: true
|
|
45
45
|
}), props => retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
@@ -50,7 +50,7 @@ StyledClose.defaultProps = {
|
|
|
50
50
|
const COMPONENT_ID$a = 'notifications.paragraph';
|
|
51
51
|
const StyledParagraph = styled.p.attrs({
|
|
52
52
|
'data-garden-id': COMPONENT_ID$a,
|
|
53
|
-
'data-garden-version': '9.0.0-next.
|
|
53
|
+
'data-garden-version': '9.0.0-next.5'
|
|
54
54
|
}).withConfig({
|
|
55
55
|
displayName: "StyledParagraph",
|
|
56
56
|
componentId: "sc-12tmd6p-0"
|
|
@@ -62,7 +62,7 @@ StyledParagraph.defaultProps = {
|
|
|
62
62
|
const COMPONENT_ID$9 = 'notifications.title';
|
|
63
63
|
const StyledTitle = styled.div.attrs({
|
|
64
64
|
'data-garden-id': COMPONENT_ID$9,
|
|
65
|
-
'data-garden-version': '9.0.0-next.
|
|
65
|
+
'data-garden-version': '9.0.0-next.5'
|
|
66
66
|
}).withConfig({
|
|
67
67
|
displayName: "StyledTitle",
|
|
68
68
|
componentId: "sc-xx4jsv-0"
|
|
@@ -81,7 +81,7 @@ const boxShadow = props => {
|
|
|
81
81
|
} = theme;
|
|
82
82
|
const offsetY = `${space.base * 5}px`;
|
|
83
83
|
const blurRadius = `${space.base * 7}px`;
|
|
84
|
-
const color =
|
|
84
|
+
const color = getColorV8('chromeHue', 600, theme, 0.15);
|
|
85
85
|
return shadows.lg(offsetY, blurRadius, color);
|
|
86
86
|
};
|
|
87
87
|
const colorStyles$6 = props => {
|
|
@@ -89,13 +89,13 @@ const colorStyles$6 = props => {
|
|
|
89
89
|
let borderColor;
|
|
90
90
|
let foregroundColor;
|
|
91
91
|
if (props.hue) {
|
|
92
|
-
backgroundColor =
|
|
93
|
-
borderColor =
|
|
94
|
-
foregroundColor =
|
|
92
|
+
backgroundColor = getColorV8(props.hue, 100, props.theme);
|
|
93
|
+
borderColor = getColorV8(props.hue, 300, props.theme);
|
|
94
|
+
foregroundColor = getColorV8(props.hue, props.type === 'info' ? 600 : 700, props.theme);
|
|
95
95
|
} else {
|
|
96
96
|
backgroundColor = props.theme.colors.background;
|
|
97
|
-
borderColor =
|
|
98
|
-
foregroundColor =
|
|
97
|
+
borderColor = getColorV8('neutralHue', 300, props.theme);
|
|
98
|
+
foregroundColor = getColorV8('neutralHue', 800, props.theme);
|
|
99
99
|
}
|
|
100
100
|
return css(["border-color:", ";background-color:", ";color:", ";"], borderColor, backgroundColor, foregroundColor);
|
|
101
101
|
};
|
|
@@ -116,10 +116,10 @@ StyledBase.defaultProps = {
|
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
const COMPONENT_ID$8 = 'notifications.alert';
|
|
119
|
-
const colorStyles$5 = props => css(["", "{color:", ";}"], StyledTitle, props.hue &&
|
|
119
|
+
const colorStyles$5 = props => css(["", "{color:", ";}"], StyledTitle, props.hue && getColorV8(props.hue, 800, props.theme));
|
|
120
120
|
const StyledAlert = styled(StyledBase).attrs({
|
|
121
121
|
'data-garden-id': COMPONENT_ID$8,
|
|
122
|
-
'data-garden-version': '9.0.0-next.
|
|
122
|
+
'data-garden-version': '9.0.0-next.5'
|
|
123
123
|
}).withConfig({
|
|
124
124
|
displayName: "StyledAlert",
|
|
125
125
|
componentId: "sc-fyn8jp-0"
|
|
@@ -146,13 +146,13 @@ const colorStyles$4 = props => {
|
|
|
146
146
|
let color;
|
|
147
147
|
switch (type) {
|
|
148
148
|
case 'success':
|
|
149
|
-
color =
|
|
149
|
+
color = getColorV8(successHue, 600, theme);
|
|
150
150
|
break;
|
|
151
151
|
case 'error':
|
|
152
|
-
color =
|
|
152
|
+
color = getColorV8(dangerHue, 600, theme);
|
|
153
153
|
break;
|
|
154
154
|
case 'warning':
|
|
155
|
-
color =
|
|
155
|
+
color = getColorV8(warningHue, 700, theme);
|
|
156
156
|
break;
|
|
157
157
|
case 'info':
|
|
158
158
|
color = foreground;
|
|
@@ -165,7 +165,7 @@ const colorStyles$4 = props => {
|
|
|
165
165
|
};
|
|
166
166
|
const StyledNotification = styled(StyledBase).attrs({
|
|
167
167
|
'data-garden-id': COMPONENT_ID$7,
|
|
168
|
-
'data-garden-version': '9.0.0-next.
|
|
168
|
+
'data-garden-version': '9.0.0-next.5'
|
|
169
169
|
}).withConfig({
|
|
170
170
|
displayName: "StyledNotification",
|
|
171
171
|
componentId: "sc-uf6jh-0"
|
|
@@ -180,11 +180,11 @@ StyledNotification.defaultProps = {
|
|
|
180
180
|
const COMPONENT_ID$6 = 'notifications.well';
|
|
181
181
|
const StyledWell = styled(StyledBase).attrs({
|
|
182
182
|
'data-garden-id': COMPONENT_ID$6,
|
|
183
|
-
'data-garden-version': '9.0.0-next.
|
|
183
|
+
'data-garden-version': '9.0.0-next.5'
|
|
184
184
|
}).withConfig({
|
|
185
185
|
displayName: "StyledWell",
|
|
186
186
|
componentId: "sc-a5831c-0"
|
|
187
|
-
})(["background-color:", ";color:", " ", ";"], props => props.isRecessed &&
|
|
187
|
+
})(["background-color:", ";color:", " ", ";"], props => props.isRecessed && getColorV8('neutralHue', 100, props.theme), props => getColorV8('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
188
188
|
StyledWell.defaultProps = {
|
|
189
189
|
theme: DEFAULT_THEME
|
|
190
190
|
};
|
|
@@ -198,7 +198,7 @@ const StyledIcon = styled(_ref => {
|
|
|
198
198
|
}).withConfig({
|
|
199
199
|
displayName: "StyledIcon",
|
|
200
200
|
componentId: "sc-msklws-0"
|
|
201
|
-
})(["position:absolute;right:", ";left:", ";margin-top:", "px;color:", ";"], props => props.theme.rtl && `${props.theme.space.base * 4}px`, props => !props.theme.rtl && `${props.theme.space.base * 4}px`, props => props.theme.space.base / 2, props => props.hue &&
|
|
201
|
+
})(["position:absolute;right:", ";left:", ";margin-top:", "px;color:", ";"], props => props.theme.rtl && `${props.theme.space.base * 4}px`, props => !props.theme.rtl && `${props.theme.space.base * 4}px`, props => props.theme.space.base / 2, props => props.hue && getColorV8(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme));
|
|
202
202
|
StyledIcon.defaultProps = {
|
|
203
203
|
theme: DEFAULT_THEME
|
|
204
204
|
};
|
|
@@ -213,35 +213,35 @@ const colorStyles$3 = props => {
|
|
|
213
213
|
let focusColor;
|
|
214
214
|
switch (props.alertType) {
|
|
215
215
|
case 'success':
|
|
216
|
-
borderColor =
|
|
217
|
-
backgroundColor =
|
|
218
|
-
foregroundColor =
|
|
216
|
+
borderColor = getColorV8('successHue', 700, props.theme);
|
|
217
|
+
backgroundColor = getColorV8('successHue', 600, props.theme);
|
|
218
|
+
foregroundColor = getColorV8('successHue', 100, props.theme);
|
|
219
219
|
anchorHoverColor = props.theme.palette.white;
|
|
220
220
|
anchorActiveColor = props.theme.palette.white;
|
|
221
221
|
focusColor = 'successHue';
|
|
222
222
|
break;
|
|
223
223
|
case 'error':
|
|
224
|
-
borderColor =
|
|
225
|
-
backgroundColor =
|
|
226
|
-
foregroundColor =
|
|
224
|
+
borderColor = getColorV8('dangerHue', 700, props.theme);
|
|
225
|
+
backgroundColor = getColorV8('dangerHue', 600, props.theme);
|
|
226
|
+
foregroundColor = getColorV8('dangerHue', 100, props.theme);
|
|
227
227
|
anchorHoverColor = props.theme.palette.white;
|
|
228
228
|
anchorActiveColor = props.theme.palette.white;
|
|
229
229
|
focusColor = 'dangerHue';
|
|
230
230
|
break;
|
|
231
231
|
case 'warning':
|
|
232
|
-
borderColor =
|
|
233
|
-
backgroundColor =
|
|
234
|
-
foregroundColor =
|
|
235
|
-
anchorHoverColor =
|
|
236
|
-
anchorActiveColor =
|
|
232
|
+
borderColor = getColorV8('warningHue', 400, props.theme);
|
|
233
|
+
backgroundColor = getColorV8('warningHue', 300, props.theme);
|
|
234
|
+
foregroundColor = getColorV8('warningHue', 800, props.theme);
|
|
235
|
+
anchorHoverColor = getColorV8('warningHue', 900, props.theme);
|
|
236
|
+
anchorActiveColor = getColorV8('warningHue', 1000, props.theme);
|
|
237
237
|
focusColor = 'warningHue';
|
|
238
238
|
break;
|
|
239
239
|
case 'info':
|
|
240
|
-
borderColor =
|
|
241
|
-
backgroundColor =
|
|
242
|
-
foregroundColor =
|
|
243
|
-
anchorHoverColor =
|
|
244
|
-
anchorActiveColor =
|
|
240
|
+
borderColor = getColorV8('primaryHue', 300, props.theme);
|
|
241
|
+
backgroundColor = getColorV8('primaryHue', 200, props.theme);
|
|
242
|
+
foregroundColor = getColorV8('primaryHue', 700, props.theme);
|
|
243
|
+
anchorHoverColor = getColorV8('primaryHue', 800, props.theme);
|
|
244
|
+
anchorActiveColor = getColorV8('primaryHue', 900, props.theme);
|
|
245
245
|
focusColor = 'primaryHue';
|
|
246
246
|
break;
|
|
247
247
|
}
|
|
@@ -267,7 +267,7 @@ const sizeStyles$3 = props => {
|
|
|
267
267
|
};
|
|
268
268
|
const StyledGlobalAlert = styled.div.attrs({
|
|
269
269
|
'data-garden-id': COMPONENT_ID$5,
|
|
270
|
-
'data-garden-version': '9.0.0-next.
|
|
270
|
+
'data-garden-version': '9.0.0-next.5'
|
|
271
271
|
}).withConfig({
|
|
272
272
|
displayName: "StyledGlobalAlert",
|
|
273
273
|
componentId: "sc-k6rimt-0"
|
|
@@ -285,31 +285,31 @@ const colorStyles$2 = props => {
|
|
|
285
285
|
let focusColor;
|
|
286
286
|
switch (props.alertType) {
|
|
287
287
|
case 'success':
|
|
288
|
-
hoverBackgroundColor =
|
|
288
|
+
hoverBackgroundColor = getColorV8('successHue', 100, props.theme, 0.08);
|
|
289
289
|
hoverForegroundColor = props.theme.palette.white;
|
|
290
|
-
activeBackgroundColor =
|
|
290
|
+
activeBackgroundColor = getColorV8('successHue', 100, props.theme, 0.2);
|
|
291
291
|
activeForegroundColor = props.theme.palette.white;
|
|
292
292
|
focusColor = 'successHue';
|
|
293
293
|
break;
|
|
294
294
|
case 'error':
|
|
295
|
-
hoverBackgroundColor =
|
|
295
|
+
hoverBackgroundColor = getColorV8('dangerHue', 100, props.theme, 0.08);
|
|
296
296
|
hoverForegroundColor = props.theme.palette.white;
|
|
297
|
-
activeBackgroundColor =
|
|
297
|
+
activeBackgroundColor = getColorV8('dangerHue', 100, props.theme, 0.2);
|
|
298
298
|
activeForegroundColor = props.theme.palette.white;
|
|
299
299
|
focusColor = 'dangerHue';
|
|
300
300
|
break;
|
|
301
301
|
case 'warning':
|
|
302
|
-
hoverBackgroundColor =
|
|
303
|
-
hoverForegroundColor =
|
|
304
|
-
activeBackgroundColor =
|
|
305
|
-
activeForegroundColor =
|
|
302
|
+
hoverBackgroundColor = getColorV8('warningHue', 800, props.theme, 0.08);
|
|
303
|
+
hoverForegroundColor = getColorV8('warningHue', 900, props.theme);
|
|
304
|
+
activeBackgroundColor = getColorV8('warningHue', 800, props.theme, 0.2);
|
|
305
|
+
activeForegroundColor = getColorV8('warningHue', 1000, props.theme);
|
|
306
306
|
focusColor = 'warningHue';
|
|
307
307
|
break;
|
|
308
308
|
case 'info':
|
|
309
|
-
hoverBackgroundColor =
|
|
310
|
-
hoverForegroundColor =
|
|
311
|
-
activeBackgroundColor =
|
|
312
|
-
activeForegroundColor =
|
|
309
|
+
hoverBackgroundColor = getColorV8('primaryHue', 700, props.theme, 0.08);
|
|
310
|
+
hoverForegroundColor = getColorV8('primaryHue', 800, props.theme);
|
|
311
|
+
activeBackgroundColor = getColorV8('primaryHue', 700, props.theme, 0.2);
|
|
312
|
+
activeForegroundColor = getColorV8('primaryHue', 900, props.theme);
|
|
313
313
|
focusColor = 'primaryHue';
|
|
314
314
|
break;
|
|
315
315
|
}
|
|
@@ -327,7 +327,7 @@ const sizeStyles$2 = props => {
|
|
|
327
327
|
};
|
|
328
328
|
const StyledGlobalAlertClose = styled(IconButton).attrs({
|
|
329
329
|
'data-garden-id': COMPONENT_ID$4,
|
|
330
|
-
'data-garden-version': '9.0.0-next.
|
|
330
|
+
'data-garden-version': '9.0.0-next.5',
|
|
331
331
|
size: 'small'
|
|
332
332
|
}).withConfig({
|
|
333
333
|
displayName: "StyledGlobalAlertClose",
|
|
@@ -348,21 +348,21 @@ function colorStyles$1(props) {
|
|
|
348
348
|
let focusColor;
|
|
349
349
|
switch (props.alertType) {
|
|
350
350
|
case 'success':
|
|
351
|
-
backgroundColor =
|
|
352
|
-
hoverBackgroundColor =
|
|
353
|
-
activeBackgroundColor =
|
|
351
|
+
backgroundColor = getColorV8('successHue', 800, props.theme);
|
|
352
|
+
hoverBackgroundColor = getColorV8('successHue', 900, props.theme);
|
|
353
|
+
activeBackgroundColor = getColorV8('successHue', 1000, props.theme);
|
|
354
354
|
focusColor = 'successHue';
|
|
355
355
|
break;
|
|
356
356
|
case 'error':
|
|
357
|
-
backgroundColor =
|
|
358
|
-
hoverBackgroundColor =
|
|
359
|
-
activeBackgroundColor =
|
|
357
|
+
backgroundColor = getColorV8('dangerHue', 800, props.theme);
|
|
358
|
+
hoverBackgroundColor = getColorV8('dangerHue', 900, props.theme);
|
|
359
|
+
activeBackgroundColor = getColorV8('dangerHue', 1000, props.theme);
|
|
360
360
|
focusColor = 'dangerHue';
|
|
361
361
|
break;
|
|
362
362
|
case 'warning':
|
|
363
|
-
backgroundColor =
|
|
364
|
-
hoverBackgroundColor =
|
|
365
|
-
activeBackgroundColor =
|
|
363
|
+
backgroundColor = getColorV8('warningHue', 800, props.theme);
|
|
364
|
+
hoverBackgroundColor = getColorV8('warningHue', 900, props.theme);
|
|
365
|
+
activeBackgroundColor = getColorV8('warningHue', 1000, props.theme);
|
|
366
366
|
focusColor = 'warningHue';
|
|
367
367
|
break;
|
|
368
368
|
case 'info':
|
|
@@ -382,7 +382,7 @@ function sizeStyles$1(props) {
|
|
|
382
382
|
}
|
|
383
383
|
const StyledGlobalAlertButton = styled(Button).attrs({
|
|
384
384
|
'data-garden-id': COMPONENT_ID$3,
|
|
385
|
-
'data-garden-version': '9.0.0-next.
|
|
385
|
+
'data-garden-version': '9.0.0-next.5',
|
|
386
386
|
focusInset: false,
|
|
387
387
|
isDanger: false,
|
|
388
388
|
isLink: false,
|
|
@@ -401,7 +401,7 @@ StyledGlobalAlertButton.defaultProps = {
|
|
|
401
401
|
const COMPONENT_ID$2 = 'notifications.global-alert.content';
|
|
402
402
|
const StyledGlobalAlertContent = styled.div.attrs({
|
|
403
403
|
'data-garden-id': COMPONENT_ID$2,
|
|
404
|
-
'data-garden-version': '9.0.0-next.
|
|
404
|
+
'data-garden-version': '9.0.0-next.5'
|
|
405
405
|
}).withConfig({
|
|
406
406
|
displayName: "StyledGlobalAlertContent",
|
|
407
407
|
componentId: "sc-rept0u-0"
|
|
@@ -425,7 +425,7 @@ const StyledGlobalAlertIcon = styled(_ref => {
|
|
|
425
425
|
return React__default.cloneElement(Children.only(children), props);
|
|
426
426
|
}).attrs({
|
|
427
427
|
'data-garden-id': COMPONENT_ID$1,
|
|
428
|
-
'data-garden-version': '9.0.0-next.
|
|
428
|
+
'data-garden-version': '9.0.0-next.5'
|
|
429
429
|
}).withConfig({
|
|
430
430
|
displayName: "StyledGlobalAlertIcon",
|
|
431
431
|
componentId: "sc-84ne9k-0"
|
|
@@ -443,17 +443,17 @@ const colorStyles = props => {
|
|
|
443
443
|
color = props.theme.palette.white;
|
|
444
444
|
break;
|
|
445
445
|
case 'warning':
|
|
446
|
-
color =
|
|
446
|
+
color = getColorV8('warningHue', 900, props.theme);
|
|
447
447
|
break;
|
|
448
448
|
case 'info':
|
|
449
|
-
color =
|
|
449
|
+
color = getColorV8('primaryHue', 800, props.theme);
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
452
|
return css(["color:", ";"], color);
|
|
453
453
|
};
|
|
454
454
|
const StyledGlobalAlertTitle = styled.div.attrs({
|
|
455
455
|
'data-garden-id': COMPONENT_ID,
|
|
456
|
-
'data-garden-version': '9.0.0-next.
|
|
456
|
+
'data-garden-version': '9.0.0-next.5'
|
|
457
457
|
}).withConfig({
|
|
458
458
|
displayName: "StyledGlobalAlertTitle",
|
|
459
459
|
componentId: "sc-10clqbo-0"
|
|
@@ -583,7 +583,45 @@ const useNotificationsContext = () => {
|
|
|
583
583
|
return useContext(NotificationsContext);
|
|
584
584
|
};
|
|
585
585
|
|
|
586
|
-
const
|
|
586
|
+
const Title = React__default.forwardRef((props, ref) => React__default.createElement(StyledTitle, _extends$6({
|
|
587
|
+
ref: ref
|
|
588
|
+
}, props)));
|
|
589
|
+
Title.displayName = 'Title';
|
|
590
|
+
|
|
591
|
+
const Paragraph = React__default.forwardRef((props, ref) => React__default.createElement(StyledParagraph, _extends$6({
|
|
592
|
+
ref: ref
|
|
593
|
+
}, props)));
|
|
594
|
+
Paragraph.displayName = 'Paragraph';
|
|
595
|
+
|
|
596
|
+
var _path$1;
|
|
597
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
598
|
+
var SvgXStroke$1 = function SvgXStroke(props) {
|
|
599
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
600
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
601
|
+
width: 12,
|
|
602
|
+
height: 12,
|
|
603
|
+
focusable: "false",
|
|
604
|
+
viewBox: "0 0 12 12",
|
|
605
|
+
"aria-hidden": "true"
|
|
606
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
607
|
+
stroke: "currentColor",
|
|
608
|
+
strokeLinecap: "round",
|
|
609
|
+
d: "M3 9l6-6m0 6L3 3"
|
|
610
|
+
})));
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const Close = React__default.forwardRef((props, ref) => {
|
|
614
|
+
const ariaLabel = useText(Close, props, 'aria-label', 'Close');
|
|
615
|
+
const hue = useNotificationsContext();
|
|
616
|
+
return React__default.createElement(StyledClose, _extends$6({
|
|
617
|
+
ref: ref,
|
|
618
|
+
hue: hue,
|
|
619
|
+
"aria-label": ariaLabel
|
|
620
|
+
}, props), React__default.createElement(SvgXStroke$1, null));
|
|
621
|
+
});
|
|
622
|
+
Close.displayName = 'Close';
|
|
623
|
+
|
|
624
|
+
const AlertComponent = React__default.forwardRef((_ref, ref) => {
|
|
587
625
|
let {
|
|
588
626
|
role,
|
|
589
627
|
...props
|
|
@@ -600,12 +638,16 @@ const Alert = React__default.forwardRef((_ref, ref) => {
|
|
|
600
638
|
hue: hue
|
|
601
639
|
}, React__default.createElement(Icon, null)), props.children));
|
|
602
640
|
});
|
|
603
|
-
|
|
604
|
-
|
|
641
|
+
AlertComponent.displayName = 'Alert';
|
|
642
|
+
AlertComponent.propTypes = {
|
|
605
643
|
type: PropTypes.oneOf(TYPE).isRequired
|
|
606
644
|
};
|
|
645
|
+
const Alert = AlertComponent;
|
|
646
|
+
Alert.Close = Close;
|
|
647
|
+
Alert.Paragraph = Paragraph;
|
|
648
|
+
Alert.Title = Title;
|
|
607
649
|
|
|
608
|
-
const
|
|
650
|
+
const NotificationComponent = forwardRef((_ref, ref) => {
|
|
609
651
|
let {
|
|
610
652
|
role,
|
|
611
653
|
...props
|
|
@@ -622,57 +664,26 @@ const Notification = forwardRef((_ref, ref) => {
|
|
|
622
664
|
hue: hue
|
|
623
665
|
}, React__default.createElement(Icon, null)), props.children);
|
|
624
666
|
});
|
|
625
|
-
|
|
626
|
-
|
|
667
|
+
NotificationComponent.displayName = 'Notification';
|
|
668
|
+
NotificationComponent.propTypes = {
|
|
627
669
|
type: PropTypes.oneOf(TYPE)
|
|
628
670
|
};
|
|
671
|
+
const Notification = NotificationComponent;
|
|
672
|
+
Notification.Close = Close;
|
|
673
|
+
Notification.Paragraph = Paragraph;
|
|
674
|
+
Notification.Title = Title;
|
|
629
675
|
|
|
630
|
-
const
|
|
676
|
+
const WellComponent = React__default.forwardRef((props, ref) => React__default.createElement(StyledWell, _extends$6({
|
|
631
677
|
ref: ref
|
|
632
678
|
}, props)));
|
|
633
|
-
|
|
634
|
-
|
|
679
|
+
WellComponent.displayName = 'Well';
|
|
680
|
+
WellComponent.propTypes = {
|
|
635
681
|
isRecessed: PropTypes.bool,
|
|
636
682
|
isFloating: PropTypes.bool
|
|
637
683
|
};
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
var SvgXStroke$1 = function SvgXStroke(props) {
|
|
642
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
643
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
644
|
-
width: 12,
|
|
645
|
-
height: 12,
|
|
646
|
-
focusable: "false",
|
|
647
|
-
viewBox: "0 0 12 12",
|
|
648
|
-
"aria-hidden": "true"
|
|
649
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
650
|
-
stroke: "currentColor",
|
|
651
|
-
strokeLinecap: "round",
|
|
652
|
-
d: "M3 9l6-6m0 6L3 3"
|
|
653
|
-
})));
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
const Close = React__default.forwardRef((props, ref) => {
|
|
657
|
-
const ariaLabel = useText(Close, props, 'aria-label', 'Close');
|
|
658
|
-
const hue = useNotificationsContext();
|
|
659
|
-
return React__default.createElement(StyledClose, _extends$6({
|
|
660
|
-
ref: ref,
|
|
661
|
-
hue: hue,
|
|
662
|
-
"aria-label": ariaLabel
|
|
663
|
-
}, props), React__default.createElement(SvgXStroke$1, null));
|
|
664
|
-
});
|
|
665
|
-
Close.displayName = 'Close';
|
|
666
|
-
|
|
667
|
-
const Paragraph = React__default.forwardRef((props, ref) => React__default.createElement(StyledParagraph, _extends$6({
|
|
668
|
-
ref: ref
|
|
669
|
-
}, props)));
|
|
670
|
-
Paragraph.displayName = 'Paragraph';
|
|
671
|
-
|
|
672
|
-
const Title = React__default.forwardRef((props, ref) => React__default.createElement(StyledTitle, _extends$6({
|
|
673
|
-
ref: ref
|
|
674
|
-
}, props)));
|
|
675
|
-
Title.displayName = 'Title';
|
|
684
|
+
const Well = WellComponent;
|
|
685
|
+
Well.Paragraph = Paragraph;
|
|
686
|
+
Well.Title = Title;
|
|
676
687
|
|
|
677
688
|
const getInitialState = () => {
|
|
678
689
|
return {
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { IAlertProps } from '../types';
|
|
9
|
+
import { Title } from './content/Title';
|
|
10
|
+
import { Paragraph } from './content/Paragraph';
|
|
11
|
+
import { Close } from './content/Close';
|
|
12
|
+
export declare const AlertComponent: React.ForwardRefExoticComponent<IAlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
13
|
/**
|
|
10
14
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
11
15
|
*/
|
|
12
|
-
export declare const Alert: React.ForwardRefExoticComponent<IAlertProps & React.RefAttributes<HTMLDivElement
|
|
16
|
+
export declare const Alert: React.ForwardRefExoticComponent<IAlertProps & React.RefAttributes<HTMLDivElement>> & {
|
|
17
|
+
Close: typeof Close;
|
|
18
|
+
Paragraph: typeof Paragraph;
|
|
19
|
+
Title: typeof Title;
|
|
20
|
+
};
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { INotificationProps } from '../types';
|
|
9
|
+
import { Title } from './content/Title';
|
|
10
|
+
import { Paragraph } from './content/Paragraph';
|
|
11
|
+
import { Close } from './content/Close';
|
|
12
|
+
export declare const NotificationComponent: React.ForwardRefExoticComponent<INotificationProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
13
|
/**
|
|
10
14
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
11
15
|
*/
|
|
12
|
-
export declare const Notification: React.ForwardRefExoticComponent<INotificationProps & React.RefAttributes<HTMLDivElement
|
|
16
|
+
export declare const Notification: React.ForwardRefExoticComponent<INotificationProps & React.RefAttributes<HTMLDivElement>> & {
|
|
17
|
+
Close: typeof Close;
|
|
18
|
+
Paragraph: typeof Paragraph;
|
|
19
|
+
Title: typeof Title;
|
|
20
|
+
};
|
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { IWellProps } from '../types';
|
|
9
|
+
import { Title } from './content/Title';
|
|
10
|
+
import { Paragraph } from './content/Paragraph';
|
|
11
|
+
export declare const WellComponent: React.ForwardRefExoticComponent<IWellProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
12
|
/**
|
|
10
13
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
11
14
|
*/
|
|
12
|
-
export declare const Well: React.ForwardRefExoticComponent<IWellProps & React.RefAttributes<HTMLDivElement
|
|
15
|
+
export declare const Well: React.ForwardRefExoticComponent<IWellProps & React.RefAttributes<HTMLDivElement>> & {
|
|
16
|
+
Paragraph: typeof Paragraph;
|
|
17
|
+
Title: typeof Title;
|
|
18
|
+
};
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
/**
|
|
9
|
+
* @deprecated use `Alert.Close` or `Notification.Close` instead
|
|
10
|
+
*
|
|
9
11
|
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
10
12
|
*/
|
|
11
13
|
export declare const Close: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
/**
|
|
9
|
+
* @deprecated use `Alert.Paragraph`, `Notification.Paragraph`, or `Well.Paragraph` instead
|
|
10
|
+
*
|
|
9
11
|
* @extends HTMLAttributes<HTMLParagraphElement>
|
|
10
12
|
*/
|
|
11
13
|
export declare const Paragraph: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ITitleProps } from '../../types';
|
|
9
9
|
/**
|
|
10
|
+
* @deprecated use `Alert.Title`, `Notification.Title`, or `Well.Title` instead
|
|
11
|
+
*
|
|
10
12
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
11
13
|
*/
|
|
12
14
|
export declare const Title: React.ForwardRefExoticComponent<ITitleProps & React.RefAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-notifications",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.5",
|
|
4
4
|
"description": "Notification and Well components within the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"types": "dist/typings/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@zendeskgarden/react-buttons": "^9.0.0-next.
|
|
24
|
+
"@zendeskgarden/react-buttons": "^9.0.0-next.5",
|
|
25
25
|
"polished": "^4.1.1",
|
|
26
26
|
"prop-types": "^15.5.7",
|
|
27
27
|
"react-transition-group": "^4.4.2",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"@zendeskgarden/react-theming": "^8.67.0",
|
|
32
32
|
"react": ">=16.8.0",
|
|
33
33
|
"react-dom": ">=16.8.0",
|
|
34
|
-
"styled-components": "^5.1
|
|
34
|
+
"styled-components": "^5.3.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react-transition-group": "4.4.10",
|
|
38
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
38
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.5",
|
|
39
39
|
"@zendeskgarden/svg-icons": "7.0.0"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"zendeskgarden:src": "src/index.ts",
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "806fa33feb06142c3f69b6a87b53628469117e4d"
|
|
52
52
|
}
|