@zendeskgarden/react-notifications 8.59.1 → 8.61.0

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/dist/index.cjs.js CHANGED
@@ -13,9 +13,10 @@ var React = require('react');
13
13
  var PropTypes = require('prop-types');
14
14
  var styled = require('styled-components');
15
15
  var reactTheming = require('@zendeskgarden/react-theming');
16
+ var reactButtons = require('@zendeskgarden/react-buttons');
17
+ var polished = require('polished');
16
18
  var reactTransitionGroup = require('react-transition-group');
17
19
  var reactUid = require('react-uid');
18
- var polished = require('polished');
19
20
 
20
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
21
22
 
@@ -42,8 +43,8 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
42
43
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
43
44
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
44
45
 
45
- function _extends$5() {
46
- _extends$5 = Object.assign ? Object.assign.bind() : function (target) {
46
+ function _extends$6() {
47
+ _extends$6 = Object.assign ? Object.assign.bind() : function (target) {
47
48
  for (var i = 1; i < arguments.length; i++) {
48
49
  var source = arguments[i];
49
50
  for (var key in source) {
@@ -54,43 +55,43 @@ function _extends$5() {
54
55
  }
55
56
  return target;
56
57
  };
57
- return _extends$5.apply(this, arguments);
58
+ return _extends$6.apply(this, arguments);
58
59
  }
59
60
 
60
61
  const TYPE = ['success', 'warning', 'error', 'info'];
61
62
 
62
- const COMPONENT_ID$5 = 'notifications.close';
63
+ const COMPONENT_ID$b = 'notifications.close';
63
64
  const StyledClose = styled__default["default"].button.attrs({
64
- 'data-garden-id': COMPONENT_ID$5,
65
- 'data-garden-version': '8.59.1'
65
+ 'data-garden-id': COMPONENT_ID$b,
66
+ 'data-garden-version': '8.61.0'
66
67
  }).withConfig({
67
68
  displayName: "StyledClose",
68
69
  componentId: "sc-1mr9nx1-0"
69
- })(["display:block;position:absolute;top:", "px;", ":", ";transition:background-color 0.1s ease-in-out,color 0.25s 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;&:hover{color:", ";}&:focus{outline:none;}&[data-garden-focus-visible]{background-color:", ";color:", ";&::-moz-focus-inner{border:0;}}", ";"], 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.getColor(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme) : reactTheming.getColor('neutralHue', 600, props.theme), props => props.hue ? reactTheming.getColor(props.hue, 800, props.theme) : reactTheming.getColor('neutralHue', 800, props.theme), props => props.hue ? reactTheming.getColor(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme, 0.15) : reactTheming.getColor('neutralHue', 600, props.theme, 0.15), props => props.hue ? reactTheming.getColor(props.hue, 800, props.theme) : reactTheming.getColor('neutralHue', 800, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
70
+ })(["display:block;position:absolute;top:", "px;", ":", ";transition:background-color 0.1s ease-in-out,color 0.25s 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;&:hover{color:", ";}&:focus{outline:none;}&[data-garden-focus-visible]{background-color:", ";color:", ";&::-moz-focus-inner{border:0;}}", ";"], 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.getColor(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme) : reactTheming.getColor('neutralHue', 600, props.theme), props => props.hue ? reactTheming.getColor(props.hue, 800, props.theme) : reactTheming.getColor('neutralHue', 800, props.theme), props => props.hue ? reactTheming.getColor(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme, 0.15) : reactTheming.getColor('neutralHue', 600, props.theme, 0.15), props => props.hue ? reactTheming.getColor(props.hue, 800, props.theme) : reactTheming.getColor('neutralHue', 800, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
70
71
  StyledClose.defaultProps = {
71
72
  theme: reactTheming.DEFAULT_THEME
72
73
  };
73
74
 
74
- const COMPONENT_ID$4 = 'notifications.paragraph';
75
+ const COMPONENT_ID$a = 'notifications.paragraph';
75
76
  const StyledParagraph = styled__default["default"].p.attrs({
76
- 'data-garden-id': COMPONENT_ID$4,
77
- 'data-garden-version': '8.59.1'
77
+ 'data-garden-id': COMPONENT_ID$a,
78
+ 'data-garden-version': '8.61.0'
78
79
  }).withConfig({
79
80
  displayName: "StyledParagraph",
80
81
  componentId: "sc-12tmd6p-0"
81
- })(["margin:", "px 0 0;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
82
+ })(["margin:", "px 0 0;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
82
83
  StyledParagraph.defaultProps = {
83
84
  theme: reactTheming.DEFAULT_THEME
84
85
  };
85
86
 
86
- const COMPONENT_ID$3 = 'notifications.title';
87
+ const COMPONENT_ID$9 = 'notifications.title';
87
88
  const StyledTitle = styled__default["default"].div.attrs({
88
- 'data-garden-id': COMPONENT_ID$3,
89
- 'data-garden-version': '8.59.1'
89
+ 'data-garden-id': COMPONENT_ID$9,
90
+ 'data-garden-version': '8.61.0'
90
91
  }).withConfig({
91
92
  displayName: "StyledTitle",
92
93
  componentId: "sc-xx4jsv-0"
93
- })(["margin:0;color:", ";font-weight:", ";", ";"], props => props.theme.colors.foreground, props => props.isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
94
+ })(["margin:0;color:", ";font-weight:", ";", ";"], props => props.theme.colors.foreground, props => props.isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
94
95
  StyledTitle.defaultProps = {
95
96
  theme: reactTheming.DEFAULT_THEME
96
97
  };
@@ -108,7 +109,7 @@ const boxShadow = props => {
108
109
  const color = reactTheming.getColor('chromeHue', 600, theme, 0.15);
109
110
  return shadows.lg(offsetY, blurRadius, color);
110
111
  };
111
- const colorStyles$2 = props => {
112
+ const colorStyles$6 = props => {
112
113
  let backgroundColor;
113
114
  let borderColor;
114
115
  let foregroundColor;
@@ -134,27 +135,27 @@ const padding = props => {
134
135
  const StyledBase = styled__default["default"].div.withConfig({
135
136
  displayName: "StyledBase",
136
137
  componentId: "sc-14syaqw-0"
137
- })(["position:relative;border:", ";border-radius:", ";box-shadow:", ";padding:", ";line-height:", ";font-size:", ";direction:", ";", ";"], props => props.theme.borders.sm, props => props.theme.borderRadii.md, props => props.isFloating && boxShadow, padding, props => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', colorStyles$2);
138
+ })(["position:relative;border:", ";border-radius:", ";box-shadow:", ";padding:", ";line-height:", ";font-size:", ";direction:", ";", ";"], props => props.theme.borders.sm, props => props.theme.borderRadii.md, props => props.isFloating && boxShadow, padding, props => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', colorStyles$6);
138
139
  StyledBase.defaultProps = {
139
140
  theme: reactTheming.DEFAULT_THEME
140
141
  };
141
142
 
142
- const COMPONENT_ID$2 = 'notifications.alert';
143
- const colorStyles$1 = props => styled.css(["", "{color:", ";}"], StyledTitle, props.hue && reactTheming.getColor(props.hue, 800, props.theme));
143
+ const COMPONENT_ID$8 = 'notifications.alert';
144
+ const colorStyles$5 = props => styled.css(["", "{color:", ";}"], StyledTitle, props.hue && reactTheming.getColor(props.hue, 800, props.theme));
144
145
  const StyledAlert = styled__default["default"](StyledBase).attrs(props => ({
145
- 'data-garden-id': COMPONENT_ID$2,
146
- 'data-garden-version': '8.59.1',
146
+ 'data-garden-id': COMPONENT_ID$8,
147
+ 'data-garden-version': '8.61.0',
147
148
  role: props.role === undefined ? 'alert' : props.role
148
149
  })).withConfig({
149
150
  displayName: "StyledAlert",
150
151
  componentId: "sc-fyn8jp-0"
151
- })(["", " ", ";"], colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
152
+ })(["", " ", ";"], colorStyles$5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
152
153
  StyledAlert.defaultProps = {
153
154
  theme: reactTheming.DEFAULT_THEME
154
155
  };
155
156
 
156
- const COMPONENT_ID$1 = 'notifications.notification';
157
- const colorStyles = props => {
157
+ const COMPONENT_ID$7 = 'notifications.notification';
158
+ const colorStyles$4 = props => {
158
159
  const {
159
160
  type,
160
161
  theme
@@ -189,13 +190,13 @@ const colorStyles = props => {
189
190
  return styled.css(["", "{color:", ";}"], StyledTitle, color);
190
191
  };
191
192
  const StyledNotification = styled__default["default"](StyledBase).attrs(props => ({
192
- 'data-garden-id': COMPONENT_ID$1,
193
- 'data-garden-version': '8.59.1',
193
+ 'data-garden-id': COMPONENT_ID$7,
194
+ 'data-garden-version': '8.61.0',
194
195
  role: props.role === undefined ? 'status' : props.role
195
196
  })).withConfig({
196
197
  displayName: "StyledNotification",
197
198
  componentId: "sc-uf6jh-0"
198
- })(["", " ", ";"], colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
199
+ })(["", " ", ";"], colorStyles$4, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
199
200
  StyledNotification.propTypes = {
200
201
  type: PropTypes__default["default"].oneOf(TYPE)
201
202
  };
@@ -203,14 +204,14 @@ StyledNotification.defaultProps = {
203
204
  theme: reactTheming.DEFAULT_THEME
204
205
  };
205
206
 
206
- const COMPONENT_ID = 'notifications.well';
207
+ const COMPONENT_ID$6 = 'notifications.well';
207
208
  const StyledWell = styled__default["default"](StyledBase).attrs({
208
- 'data-garden-id': COMPONENT_ID,
209
- 'data-garden-version': '8.59.1'
209
+ 'data-garden-id': COMPONENT_ID$6,
210
+ 'data-garden-version': '8.61.0'
210
211
  }).withConfig({
211
212
  displayName: "StyledWell",
212
213
  componentId: "sc-a5831c-0"
213
- })(["background-color:", ";color:", " ", ";"], props => props.isRecessed && reactTheming.getColor('neutralHue', 100, props.theme), props => reactTheming.getColor('neutralHue', 600, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
214
+ })(["background-color:", ";color:", " ", ";"], props => props.isRecessed && reactTheming.getColor('neutralHue', 100, props.theme), props => reactTheming.getColor('neutralHue', 600, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
214
215
  StyledWell.defaultProps = {
215
216
  theme: reactTheming.DEFAULT_THEME
216
217
  };
@@ -229,12 +230,256 @@ StyledIcon.defaultProps = {
229
230
  theme: reactTheming.DEFAULT_THEME
230
231
  };
231
232
 
233
+ const COMPONENT_ID$5 = 'notifications.global-alert';
234
+ const colorStyles$3 = props => {
235
+ let borderColor;
236
+ let backgroundColor;
237
+ let foregroundColor;
238
+ let anchorHoverColor;
239
+ let anchorActiveColor;
240
+ let anchorBoxShadowColor;
241
+ switch (props.alertType) {
242
+ case 'success':
243
+ borderColor = reactTheming.getColor('successHue', 700, props.theme);
244
+ backgroundColor = reactTheming.getColor('successHue', 600, props.theme);
245
+ foregroundColor = reactTheming.getColor('successHue', 100, props.theme);
246
+ anchorHoverColor = props.theme.palette.white;
247
+ anchorActiveColor = props.theme.palette.white;
248
+ anchorBoxShadowColor = reactTheming.getColor('successHue', 200, props.theme, 0.35);
249
+ break;
250
+ case 'error':
251
+ borderColor = reactTheming.getColor('dangerHue', 700, props.theme);
252
+ backgroundColor = reactTheming.getColor('dangerHue', 600, props.theme);
253
+ foregroundColor = reactTheming.getColor('dangerHue', 100, props.theme);
254
+ anchorHoverColor = props.theme.palette.white;
255
+ anchorActiveColor = props.theme.palette.white;
256
+ anchorBoxShadowColor = reactTheming.getColor('dangerHue', 100, props.theme, 0.35);
257
+ break;
258
+ case 'warning':
259
+ borderColor = reactTheming.getColor('warningHue', 400, props.theme);
260
+ backgroundColor = reactTheming.getColor('warningHue', 300, props.theme);
261
+ foregroundColor = reactTheming.getColor('warningHue', 800, props.theme);
262
+ anchorHoverColor = reactTheming.getColor('warningHue', 900, props.theme);
263
+ anchorActiveColor = reactTheming.getColor('warningHue', 1000, props.theme);
264
+ anchorBoxShadowColor = reactTheming.getColor('warningHue', 800, props.theme, 0.35);
265
+ break;
266
+ case 'info':
267
+ borderColor = reactTheming.getColor('primaryHue', 300, props.theme);
268
+ backgroundColor = reactTheming.getColor('primaryHue', 200, props.theme);
269
+ foregroundColor = reactTheming.getColor('primaryHue', 700, props.theme);
270
+ anchorHoverColor = reactTheming.getColor('primaryHue', 800, props.theme);
271
+ anchorActiveColor = reactTheming.getColor('primaryHue', 900, props.theme);
272
+ anchorBoxShadowColor = reactTheming.getColor('primaryHue', 700, props.theme, 0.35);
273
+ break;
274
+ }
275
+ const boxShadow = `0 ${props.theme.borderWidths.sm} ${props.theme.borderWidths.sm} ${borderColor}`;
276
+ return styled.css(["box-shadow:", ";background-color:", ";color:", ";& a{color:inherit;&:focus{color:inherit;}&:hover,[data-garden-focus-visible]{color:", ";}&[data-garden-focus-visible]{box-shadow:", ";}&:active{color:", ";}}"], boxShadow, backgroundColor, foregroundColor, anchorHoverColor, props.theme.shadows.sm(anchorBoxShadowColor), anchorActiveColor);
277
+ };
278
+ const sizeStyles$3 = props => {
279
+ const {
280
+ fontSizes,
281
+ space
282
+ } = props.theme;
283
+ const minHeight = space.base * 13;
284
+ const padding = space.base * 4;
285
+ const lineHeight = reactTheming.getLineHeight(space.base * 5, fontSizes.md);
286
+ return styled.css(["padding:", "px;min-height:", "px;line-height:", ";font-size:", ";"], padding, minHeight, lineHeight, fontSizes.md);
287
+ };
288
+ const StyledGlobalAlert = styled__default["default"].div.attrs({
289
+ 'data-garden-id': COMPONENT_ID$5,
290
+ 'data-garden-version': '8.61.0'
291
+ }).withConfig({
292
+ displayName: "StyledGlobalAlert",
293
+ componentId: "sc-k6rimt-0"
294
+ })(["display:flex;flex-wrap:nowrap;overflow:auto;overflow-x:hidden;box-sizing:border-box;&& a{border-radius:", ";text-decoration:underline;&:focus{text-decoration:underline;}}", " ", " ", ";"], props => props.theme.borderRadii.sm, sizeStyles$3, colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
295
+ StyledGlobalAlert.defaultProps = {
296
+ theme: reactTheming.DEFAULT_THEME
297
+ };
298
+
299
+ const COMPONENT_ID$4 = 'notifications.global-alert.close';
300
+ const colorStyles$2 = props => {
301
+ let hoverBackgroundColor;
302
+ let hoverForegroundColor;
303
+ let activeBackgroundColor;
304
+ let activeForegroundColor;
305
+ let boxShadowColor;
306
+ switch (props.alertType) {
307
+ case 'success':
308
+ hoverBackgroundColor = reactTheming.getColor('successHue', 100, props.theme, 0.08);
309
+ hoverForegroundColor = props.theme.palette.white;
310
+ activeBackgroundColor = reactTheming.getColor('successHue', 100, props.theme, 0.2);
311
+ activeForegroundColor = props.theme.palette.white;
312
+ boxShadowColor = reactTheming.getColor('successHue', 100, props.theme, 0.35);
313
+ break;
314
+ case 'error':
315
+ hoverBackgroundColor = reactTheming.getColor('dangerHue', 100, props.theme, 0.08);
316
+ hoverForegroundColor = props.theme.palette.white;
317
+ activeBackgroundColor = reactTheming.getColor('dangerHue', 100, props.theme, 0.2);
318
+ activeForegroundColor = props.theme.palette.white;
319
+ boxShadowColor = reactTheming.getColor('dangerHue', 100, props.theme, 0.35);
320
+ break;
321
+ case 'warning':
322
+ hoverBackgroundColor = reactTheming.getColor('warningHue', 800, props.theme, 0.08);
323
+ hoverForegroundColor = reactTheming.getColor('warningHue', 900, props.theme);
324
+ activeBackgroundColor = reactTheming.getColor('warningHue', 800, props.theme, 0.2);
325
+ activeForegroundColor = reactTheming.getColor('warningHue', 1000, props.theme);
326
+ boxShadowColor = reactTheming.getColor('warningHue', 800, props.theme, 0.35);
327
+ break;
328
+ case 'info':
329
+ hoverBackgroundColor = reactTheming.getColor('primaryHue', 700, props.theme, 0.08);
330
+ hoverForegroundColor = reactTheming.getColor('primaryHue', 800, props.theme);
331
+ activeBackgroundColor = reactTheming.getColor('primaryHue', 700, props.theme, 0.2);
332
+ activeForegroundColor = reactTheming.getColor('primaryHue', 900, props.theme);
333
+ boxShadowColor = reactTheming.getColor('primaryHue', 700, props.theme, 0.35);
334
+ break;
335
+ }
336
+ return styled.css(["color:inherit;&:hover{background-color:", ";color:", ";}&[data-garden-focus-visible]{box-shadow:", ";}&:active{background-color:", ";color:", ";}"], hoverBackgroundColor, hoverForegroundColor, props.theme.shadows.md(boxShadowColor), activeBackgroundColor, activeForegroundColor);
337
+ };
338
+ const sizeStyles$2 = props => {
339
+ const marginVertical = `-${props.theme.space.base * 1.5}px`;
340
+ const marginStart = `${props.theme.space.base * 2}px`;
341
+ const marginEnd = `-${props.theme.space.base * 2}px`;
342
+ return styled.css(["margin:", " ", " ", " ", ";"], marginVertical, props.theme.rtl ? marginStart : marginEnd, marginVertical, props.theme.rtl ? marginEnd : marginStart);
343
+ };
344
+ const StyledGlobalAlertClose = styled__default["default"](reactButtons.IconButton).attrs({
345
+ 'data-garden-id': COMPONENT_ID$4,
346
+ 'data-garden-version': '8.61.0',
347
+ size: 'small'
348
+ }).withConfig({
349
+ displayName: "StyledGlobalAlertClose",
350
+ componentId: "sc-1g5s93s-0"
351
+ })(["", ";", ";", ";"], sizeStyles$2, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
352
+ StyledGlobalAlertClose.defaultProps = {
353
+ theme: reactTheming.DEFAULT_THEME
354
+ };
355
+
356
+ const COMPONENT_ID$3 = 'notifications.global-alert.button';
357
+ function colorStyles$1(props) {
358
+ if (props.isBasic) {
359
+ return colorStyles$2(props);
360
+ }
361
+ let backgroundColor;
362
+ let hoverBackgroundColor;
363
+ let activeBackgroundColor;
364
+ let boxShadowColor;
365
+ switch (props.alertType) {
366
+ case 'success':
367
+ backgroundColor = reactTheming.getColor('successHue', 800, props.theme);
368
+ hoverBackgroundColor = reactTheming.getColor('successHue', 900, props.theme);
369
+ activeBackgroundColor = reactTheming.getColor('successHue', 1000, props.theme);
370
+ boxShadowColor = reactTheming.getColor('successHue', 200, props.theme, 0.35);
371
+ break;
372
+ case 'error':
373
+ backgroundColor = reactTheming.getColor('dangerHue', 800, props.theme);
374
+ hoverBackgroundColor = reactTheming.getColor('dangerHue', 900, props.theme);
375
+ activeBackgroundColor = reactTheming.getColor('dangerHue', 1000, props.theme);
376
+ boxShadowColor = reactTheming.getColor('dangerHue', 100, props.theme, 0.35);
377
+ break;
378
+ case 'warning':
379
+ backgroundColor = reactTheming.getColor('warningHue', 800, props.theme);
380
+ hoverBackgroundColor = reactTheming.getColor('warningHue', 900, props.theme);
381
+ activeBackgroundColor = reactTheming.getColor('warningHue', 1000, props.theme);
382
+ boxShadowColor = reactTheming.getColor('warningHue', 800, props.theme, 0.35);
383
+ break;
384
+ case 'info':
385
+ boxShadowColor = reactTheming.getColor('primaryHue', 700, props.theme, 0.35);
386
+ break;
387
+ }
388
+ return styled.css(["background-color:", ";&:hover{background-color:", ";}&[data-garden-focus-visible]{box-shadow:", ";}&:active{background-color:", ";}"], backgroundColor, hoverBackgroundColor, boxShadowColor && props.theme.shadows.md(boxShadowColor), activeBackgroundColor);
389
+ }
390
+ function sizeStyles$1(props) {
391
+ const marginVertical = `-${props.theme.space.base * 1.5}px`;
392
+ const marginStart = `${props.theme.space.base * 2}px`;
393
+ return styled.css(["margin:", " ", " ", " ", ";"], marginVertical, props.theme.rtl ? marginStart : 0, marginVertical, props.theme.rtl ? 0 : marginStart);
394
+ }
395
+ const StyledGlobalAlertButton = styled__default["default"](reactButtons.Button).attrs({
396
+ 'data-garden-id': COMPONENT_ID$3,
397
+ 'data-garden-version': '8.61.0',
398
+ focusInset: false,
399
+ isDanger: false,
400
+ isLink: false,
401
+ isNeutral: false,
402
+ isPill: false,
403
+ isStretched: false,
404
+ size: 'small'
405
+ }).withConfig({
406
+ displayName: "StyledGlobalAlertButton",
407
+ componentId: "sc-1txe91a-0"
408
+ })(["flex-shrink:0;", ";", ";", ";"], sizeStyles$1, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
409
+ StyledGlobalAlertButton.defaultProps = {
410
+ theme: reactTheming.DEFAULT_THEME
411
+ };
412
+
413
+ const COMPONENT_ID$2 = 'notifications.global-alert.content';
414
+ const StyledGlobalAlertContent = styled__default["default"].div.attrs({
415
+ 'data-garden-id': COMPONENT_ID$2,
416
+ 'data-garden-version': '8.61.0'
417
+ }).withConfig({
418
+ displayName: "StyledGlobalAlertContent",
419
+ componentId: "sc-rept0u-0"
420
+ })(["flex-grow:1;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
421
+ StyledGlobalAlertContent.defaultProps = {
422
+ theme: reactTheming.DEFAULT_THEME
423
+ };
424
+
425
+ const COMPONENT_ID$1 = 'notifications.global-alert.icon';
426
+ const sizeStyles = props => {
427
+ const size = props.theme.iconSizes.md;
428
+ const marginTop = polished.math(`(${props.theme.space.base * 5} - ${size}) / 2`);
429
+ const marginHorizontal = `${props.theme.space.base * 2}px`;
430
+ return styled.css(["margin-top:", ";margin-", ":", ";width:", ";height:", ";"], marginTop, props.theme.rtl ? 'left' : 'right', marginHorizontal, size, size);
431
+ };
432
+ const StyledGlobalAlertIcon = styled__default["default"](_ref => {
433
+ let {
434
+ children,
435
+ ...props
436
+ } = _ref;
437
+ return React__default["default"].cloneElement(React.Children.only(children), props);
438
+ }).attrs({
439
+ 'data-garden-id': COMPONENT_ID$1,
440
+ 'data-garden-version': '8.61.0'
441
+ }).withConfig({
442
+ displayName: "StyledGlobalAlertIcon",
443
+ componentId: "sc-84ne9k-0"
444
+ })(["flex-shrink:0;", ";", ";"], sizeStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
445
+ StyledGlobalAlertIcon.defaultProps = {
446
+ theme: reactTheming.DEFAULT_THEME
447
+ };
448
+
449
+ const COMPONENT_ID = 'notifications.global-alert.title';
450
+ const colorStyles = props => {
451
+ let color;
452
+ switch (props.alertType) {
453
+ case 'success':
454
+ case 'error':
455
+ color = props.theme.palette.white;
456
+ break;
457
+ case 'warning':
458
+ color = reactTheming.getColor('warningHue', 900, props.theme);
459
+ break;
460
+ case 'info':
461
+ color = reactTheming.getColor('primaryHue', 800, props.theme);
462
+ break;
463
+ }
464
+ return styled.css(["color:", ";"], color);
465
+ };
466
+ const StyledGlobalAlertTitle = styled__default["default"].div.attrs({
467
+ 'data-garden-id': COMPONENT_ID,
468
+ 'data-garden-version': '8.61.0'
469
+ }).withConfig({
470
+ displayName: "StyledGlobalAlertTitle",
471
+ componentId: "sc-10clqbo-0"
472
+ })(["display:inline;margin-", ":", "px;font-weight:", ";", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 2, props => props.isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
473
+ StyledGlobalAlertTitle.defaultProps = {
474
+ theme: reactTheming.DEFAULT_THEME
475
+ };
476
+
232
477
  var _g$2, _circle$2;
233
478
 
234
- function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
479
+ function _extends$5() { _extends$5 = 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$5.apply(this, arguments); }
235
480
 
236
481
  var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
237
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
482
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
238
483
  xmlns: "http://www.w3.org/2000/svg",
239
484
  width: 16,
240
485
  height: 16,
@@ -262,10 +507,10 @@ var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
262
507
 
263
508
  var _g$1;
264
509
 
265
- function _extends$3() { _extends$3 = 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$3.apply(this, arguments); }
510
+ function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
266
511
 
267
512
  var SvgCheckCircleStroke = function SvgCheckCircleStroke(props) {
268
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
513
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
269
514
  xmlns: "http://www.w3.org/2000/svg",
270
515
  width: 16,
271
516
  height: 16,
@@ -287,12 +532,12 @@ var SvgCheckCircleStroke = function SvgCheckCircleStroke(props) {
287
532
  }))));
288
533
  };
289
534
 
290
- var _path$1, _circle$1;
535
+ var _path$2, _circle$1;
291
536
 
292
- function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
537
+ function _extends$3() { _extends$3 = 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$3.apply(this, arguments); }
293
538
 
294
539
  var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
295
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
540
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
296
541
  xmlns: "http://www.w3.org/2000/svg",
297
542
  width: 16,
298
543
  height: 16,
@@ -300,7 +545,7 @@ var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
300
545
  viewBox: "0 0 16 16",
301
546
  "aria-hidden": "true",
302
547
  role: "img"
303
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
548
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
304
549
  fill: "none",
305
550
  stroke: "currentColor",
306
551
  strokeLinecap: "round",
@@ -315,10 +560,10 @@ var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
315
560
 
316
561
  var _g, _circle;
317
562
 
318
- 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); }
563
+ function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
319
564
 
320
565
  var SvgInfoStroke = function SvgInfoStroke(props) {
321
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
566
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
322
567
  xmlns: "http://www.w3.org/2000/svg",
323
568
  width: 16,
324
569
  height: 16,
@@ -367,7 +612,7 @@ const Alert = React__default["default"].forwardRef((props, ref) => {
367
612
  const Icon = validationIcons[props.type];
368
613
  return React__default["default"].createElement(NotificationsContext.Provider, {
369
614
  value: hue
370
- }, React__default["default"].createElement(StyledAlert, _extends$5({
615
+ }, React__default["default"].createElement(StyledAlert, _extends$6({
371
616
  ref: ref,
372
617
  hue: hue
373
618
  }, props), React__default["default"].createElement(StyledIcon, {
@@ -382,7 +627,7 @@ Alert.propTypes = {
382
627
  const Notification = React__default["default"].forwardRef((props, ref) => {
383
628
  const Icon = props.type ? validationIcons[props.type] : SvgInfoStroke;
384
629
  const hue = props.type && validationHues[props.type];
385
- return React__default["default"].createElement(StyledNotification, _extends$5({
630
+ return React__default["default"].createElement(StyledNotification, _extends$6({
386
631
  ref: ref,
387
632
  type: props.type,
388
633
  isFloating: true
@@ -395,7 +640,7 @@ Notification.propTypes = {
395
640
  type: PropTypes__default["default"].oneOf(TYPE)
396
641
  };
397
642
 
398
- const Well = React__default["default"].forwardRef((props, ref) => React__default["default"].createElement(StyledWell, _extends$5({
643
+ const Well = React__default["default"].forwardRef((props, ref) => React__default["default"].createElement(StyledWell, _extends$6({
399
644
  ref: ref
400
645
  }, props)));
401
646
  Well.displayName = 'Well';
@@ -404,12 +649,12 @@ Well.propTypes = {
404
649
  isFloating: PropTypes__default["default"].bool
405
650
  };
406
651
 
407
- var _path;
652
+ var _path$1;
408
653
 
409
- function _extends() { _extends = 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.apply(this, arguments); }
654
+ 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); }
410
655
 
411
- var SvgXStroke = function SvgXStroke(props) {
412
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
656
+ var SvgXStroke$1 = function SvgXStroke(props) {
657
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
413
658
  xmlns: "http://www.w3.org/2000/svg",
414
659
  width: 12,
415
660
  height: 12,
@@ -417,7 +662,7 @@ var SvgXStroke = function SvgXStroke(props) {
417
662
  viewBox: "0 0 12 12",
418
663
  "aria-hidden": "true",
419
664
  role: "img"
420
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
665
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
421
666
  stroke: "currentColor",
422
667
  strokeLinecap: "round",
423
668
  d: "M3 9l6-6m0 6L3 3"
@@ -426,19 +671,19 @@ var SvgXStroke = function SvgXStroke(props) {
426
671
 
427
672
  const Close = React__default["default"].forwardRef((props, ref) => {
428
673
  const hue = useNotificationsContext();
429
- return React__default["default"].createElement(StyledClose, _extends$5({
674
+ return React__default["default"].createElement(StyledClose, _extends$6({
430
675
  ref: ref,
431
676
  hue: hue
432
- }, props), React__default["default"].createElement(SvgXStroke, null));
677
+ }, props), React__default["default"].createElement(SvgXStroke$1, null));
433
678
  });
434
679
  Close.displayName = 'Close';
435
680
 
436
- const Paragraph = React__default["default"].forwardRef((props, ref) => React__default["default"].createElement(StyledParagraph, _extends$5({
681
+ const Paragraph = React__default["default"].forwardRef((props, ref) => React__default["default"].createElement(StyledParagraph, _extends$6({
437
682
  ref: ref
438
683
  }, props)));
439
684
  Paragraph.displayName = 'Paragraph';
440
685
 
441
- const Title = React__default["default"].forwardRef((props, ref) => React__default["default"].createElement(StyledTitle, _extends$5({
686
+ const Title = React__default["default"].forwardRef((props, ref) => React__default["default"].createElement(StyledTitle, _extends$6({
442
687
  ref: ref
443
688
  }, props)));
444
689
  Title.displayName = 'Title';
@@ -715,7 +960,7 @@ const ToastSlot = _ref => {
715
960
  }
716
961
  return index >= limit;
717
962
  }, [limit, placement, toasts.length]);
718
- return React__default["default"].createElement(StyledTransitionGroup, _extends$5({
963
+ return React__default["default"].createElement(StyledTransitionGroup, _extends$6({
719
964
  key: placement,
720
965
  $placement: placement,
721
966
  $zIndex: zIndex,
@@ -760,7 +1005,7 @@ const ToastProvider = _ref => {
760
1005
  if (placement === 'bottom' || placement === 'bottom-start' || placement === 'bottom-end') {
761
1006
  matchingToasts = matchingToasts.reverse();
762
1007
  }
763
- return React__default["default"].createElement(ToastSlot, _extends$5({
1008
+ return React__default["default"].createElement(ToastSlot, _extends$6({
764
1009
  placement: placement,
765
1010
  toasts: matchingToasts,
766
1011
  zIndex: zIndex,
@@ -781,8 +1026,121 @@ ToastProvider.propTypes = {
781
1026
  placementProps: PropTypes__default["default"].object
782
1027
  };
783
1028
 
1029
+ const GlobalAlertContext = React.createContext({
1030
+ type: 'info'
1031
+ });
1032
+ const useGlobalAlertContext = () => React.useContext(GlobalAlertContext);
1033
+
1034
+ const GlobalAlertButton = React.forwardRef((_ref, ref) => {
1035
+ let {
1036
+ isBasic,
1037
+ ...props
1038
+ } = _ref;
1039
+ const {
1040
+ type
1041
+ } = useGlobalAlertContext();
1042
+ return React__default["default"].createElement(StyledGlobalAlertButton, _extends$6({
1043
+ ref: ref,
1044
+ alertType: type
1045
+ }, props, {
1046
+ isPrimary: !isBasic,
1047
+ isBasic: isBasic
1048
+ }));
1049
+ });
1050
+ GlobalAlertButton.displayName = 'GlobalAlert.Button';
1051
+ GlobalAlertButton.propTypes = {
1052
+ isBasic: PropTypes__default["default"].bool
1053
+ };
1054
+
1055
+ var _path;
1056
+
1057
+ function _extends() { _extends = 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.apply(this, arguments); }
1058
+
1059
+ var SvgXStroke = function SvgXStroke(props) {
1060
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
1061
+ xmlns: "http://www.w3.org/2000/svg",
1062
+ width: 16,
1063
+ height: 16,
1064
+ focusable: "false",
1065
+ viewBox: "0 0 16 16",
1066
+ "aria-hidden": "true",
1067
+ role: "img"
1068
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
1069
+ stroke: "currentColor",
1070
+ strokeLinecap: "round",
1071
+ d: "M3 13L13 3m0 10L3 3"
1072
+ })));
1073
+ };
1074
+
1075
+ const GlobalAlertClose = React.forwardRef((props, ref) => {
1076
+ const {
1077
+ type
1078
+ } = useGlobalAlertContext();
1079
+ const label = reactTheming.useText(GlobalAlertClose, props, 'aria-label', 'Close');
1080
+ return React__default["default"].createElement(StyledGlobalAlertClose, _extends$6({
1081
+ ref: ref,
1082
+ alertType: type
1083
+ }, props), React__default["default"].createElement(SvgXStroke, {
1084
+ role: "img",
1085
+ "aria-label": label
1086
+ }));
1087
+ });
1088
+ GlobalAlertClose.displayName = 'GlobalAlert.Close';
1089
+
1090
+ const GlobalAlertContent = React.forwardRef((props, ref) => {
1091
+ return React__default["default"].createElement(StyledGlobalAlertContent, _extends$6({
1092
+ ref: ref
1093
+ }, props));
1094
+ });
1095
+ GlobalAlertContent.displayName = 'GlobalAlert.Content';
1096
+
1097
+ const GlobalAlertTitle = React.forwardRef((props, ref) => {
1098
+ const {
1099
+ type
1100
+ } = useGlobalAlertContext();
1101
+ return React__default["default"].createElement(StyledGlobalAlertTitle, _extends$6({
1102
+ alertType: type,
1103
+ ref: ref
1104
+ }, props));
1105
+ });
1106
+ GlobalAlertTitle.displayName = 'GlobalAlert.Title';
1107
+ GlobalAlertTitle.propTypes = {
1108
+ isRegular: PropTypes__default["default"].bool
1109
+ };
1110
+
1111
+ const GlobalAlertComponent = React.forwardRef((_ref, ref) => {
1112
+ let {
1113
+ type,
1114
+ ...props
1115
+ } = _ref;
1116
+ return React__default["default"].createElement(GlobalAlertContext.Provider, {
1117
+ value: React.useMemo(() => ({
1118
+ type
1119
+ }), [type])
1120
+ }, React__default["default"].createElement(StyledGlobalAlert, _extends$6({
1121
+ ref: ref,
1122
+ role: "status",
1123
+ alertType: type
1124
+ }, props), {
1125
+ success: React__default["default"].createElement(StyledGlobalAlertIcon, null, React__default["default"].createElement(SvgCheckCircleStroke, null)),
1126
+ error: React__default["default"].createElement(StyledGlobalAlertIcon, null, React__default["default"].createElement(SvgAlertErrorStroke, null)),
1127
+ warning: React__default["default"].createElement(StyledGlobalAlertIcon, null, React__default["default"].createElement(SvgAlertWarningStroke, null)),
1128
+ info: React__default["default"].createElement(StyledGlobalAlertIcon, null, React__default["default"].createElement(SvgInfoStroke, null))
1129
+ }[type], props.children));
1130
+ });
1131
+ GlobalAlertComponent.displayName = 'GlobalAlert';
1132
+ const GlobalAlert = GlobalAlertComponent;
1133
+ GlobalAlert.Button = GlobalAlertButton;
1134
+ GlobalAlert.Close = GlobalAlertClose;
1135
+ GlobalAlert.Content = GlobalAlertContent;
1136
+ GlobalAlert.Title = GlobalAlertTitle;
1137
+ GlobalAlert.propTypes = {
1138
+ type: PropTypes__default["default"].oneOf(TYPE).isRequired
1139
+ };
1140
+
784
1141
  exports.Alert = Alert;
785
1142
  exports.Close = Close;
1143
+ exports.GlobalAlert = GlobalAlert;
786
1144
  exports.Notification = Notification;
787
1145
  exports.Paragraph = Paragraph;
788
1146
  exports.Title = Title;