@zendeskgarden/react-notifications 9.0.0-next.6 → 9.0.0-next.8

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.
Files changed (46) hide show
  1. package/dist/esm/elements/Alert.js +56 -0
  2. package/dist/esm/elements/Notification.js +56 -0
  3. package/dist/esm/elements/Well.js +38 -0
  4. package/dist/esm/elements/content/Close.js +37 -0
  5. package/dist/esm/elements/content/Paragraph.js +28 -0
  6. package/dist/esm/elements/content/Title.js +28 -0
  7. package/dist/esm/elements/global-alert/GlobalAlert.js +64 -0
  8. package/dist/esm/elements/global-alert/GlobalAlertButton.js +46 -0
  9. package/dist/esm/elements/global-alert/GlobalAlertClose.js +41 -0
  10. package/dist/esm/elements/global-alert/GlobalAlertContent.js +30 -0
  11. package/dist/esm/elements/global-alert/GlobalAlertTitle.js +39 -0
  12. package/dist/esm/elements/global-alert/utility.js +14 -0
  13. package/dist/esm/elements/toaster/Toast.js +62 -0
  14. package/dist/esm/elements/toaster/ToastContext.js +11 -0
  15. package/dist/esm/elements/toaster/ToastProvider.js +51 -0
  16. package/dist/esm/elements/toaster/ToastSlot.js +82 -0
  17. package/dist/esm/elements/toaster/reducer.js +66 -0
  18. package/dist/esm/elements/toaster/styled.js +71 -0
  19. package/dist/esm/elements/toaster/useToast.js +70 -0
  20. package/dist/esm/index.js +15 -0
  21. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js +26 -0
  22. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +37 -0
  23. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +32 -0
  24. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +33 -0
  25. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/info-stroke.svg.js +37 -0
  26. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
  27. package/dist/esm/styled/StyledAlert.js +25 -0
  28. package/dist/esm/styled/StyledBase.js +54 -0
  29. package/dist/esm/styled/StyledIcon.js +25 -0
  30. package/dist/esm/styled/StyledNotification.js +62 -0
  31. package/dist/esm/styled/StyledWell.js +23 -0
  32. package/dist/esm/styled/content/StyledClose.js +25 -0
  33. package/dist/esm/styled/content/StyledParagraph.js +22 -0
  34. package/dist/esm/styled/content/StyledTitle.js +22 -0
  35. package/dist/esm/styled/global-alert/StyledGlobalAlert.js +85 -0
  36. package/dist/esm/styled/global-alert/StyledGlobalAlertButton.js +75 -0
  37. package/dist/esm/styled/global-alert/StyledGlobalAlertClose.js +74 -0
  38. package/dist/esm/styled/global-alert/StyledGlobalAlertContent.js +22 -0
  39. package/dist/esm/styled/global-alert/StyledGlobalAlertIcon.js +36 -0
  40. package/dist/esm/styled/global-alert/StyledGlobalAlertTitle.js +38 -0
  41. package/dist/esm/types/index.js +9 -0
  42. package/dist/esm/utils/icons.js +25 -0
  43. package/dist/esm/utils/useNotificationsContext.js +14 -0
  44. package/dist/index.cjs.js +42 -52
  45. package/package.json +6 -6
  46. package/dist/index.esm.js +0 -1134
package/dist/index.cjs.js CHANGED
@@ -1,10 +1,9 @@
1
1
  /**
2
- * Copyright Zendesk, Inc.
3
- *
4
- * Use of this source code is governed under the Apache License, Version 2.0
5
- * found at http://www.apache.org/licenses/LICENSE-2.0.
6
- */
7
-
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
8
7
  'use strict';
9
8
 
10
9
  var React = require('react');
@@ -40,27 +39,12 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
40
39
  var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
41
40
  var styled__default = /*#__PURE__*/_interopDefault(styled);
42
41
 
43
- function _extends$6() {
44
- _extends$6 = Object.assign ? Object.assign.bind() : function (target) {
45
- for (var i = 1; i < arguments.length; i++) {
46
- var source = arguments[i];
47
- for (var key in source) {
48
- if (Object.prototype.hasOwnProperty.call(source, key)) {
49
- target[key] = source[key];
50
- }
51
- }
52
- }
53
- return target;
54
- };
55
- return _extends$6.apply(this, arguments);
56
- }
57
-
58
42
  const TYPE = ['success', 'warning', 'error', 'info'];
59
43
 
60
44
  const COMPONENT_ID$b = 'notifications.close';
61
45
  const StyledClose = styled__default.default.button.attrs({
62
46
  'data-garden-id': COMPONENT_ID$b,
63
- 'data-garden-version': '9.0.0-next.6'
47
+ 'data-garden-version': '9.0.0-next.8'
64
48
  }).withConfig({
65
49
  displayName: "StyledClose",
66
50
  componentId: "sc-1mr9nx1-0"
@@ -75,7 +59,7 @@ StyledClose.defaultProps = {
75
59
  const COMPONENT_ID$a = 'notifications.paragraph';
76
60
  const StyledParagraph = styled__default.default.p.attrs({
77
61
  'data-garden-id': COMPONENT_ID$a,
78
- 'data-garden-version': '9.0.0-next.6'
62
+ 'data-garden-version': '9.0.0-next.8'
79
63
  }).withConfig({
80
64
  displayName: "StyledParagraph",
81
65
  componentId: "sc-12tmd6p-0"
@@ -87,7 +71,7 @@ StyledParagraph.defaultProps = {
87
71
  const COMPONENT_ID$9 = 'notifications.title';
88
72
  const StyledTitle = styled__default.default.div.attrs({
89
73
  'data-garden-id': COMPONENT_ID$9,
90
- 'data-garden-version': '9.0.0-next.6'
74
+ 'data-garden-version': '9.0.0-next.8'
91
75
  }).withConfig({
92
76
  displayName: "StyledTitle",
93
77
  componentId: "sc-xx4jsv-0"
@@ -144,7 +128,7 @@ const COMPONENT_ID$8 = 'notifications.alert';
144
128
  const colorStyles$5 = props => styled.css(["", "{color:", ";}"], StyledTitle, props.hue && reactTheming.getColorV8(props.hue, 800, props.theme));
145
129
  const StyledAlert = styled__default.default(StyledBase).attrs({
146
130
  'data-garden-id': COMPONENT_ID$8,
147
- 'data-garden-version': '9.0.0-next.6'
131
+ 'data-garden-version': '9.0.0-next.8'
148
132
  }).withConfig({
149
133
  displayName: "StyledAlert",
150
134
  componentId: "sc-fyn8jp-0"
@@ -189,7 +173,7 @@ const colorStyles$4 = props => {
189
173
  };
190
174
  const StyledNotification = styled__default.default(StyledBase).attrs({
191
175
  'data-garden-id': COMPONENT_ID$7,
192
- 'data-garden-version': '9.0.0-next.6'
176
+ 'data-garden-version': '9.0.0-next.8'
193
177
  }).withConfig({
194
178
  displayName: "StyledNotification",
195
179
  componentId: "sc-uf6jh-0"
@@ -204,7 +188,7 @@ StyledNotification.defaultProps = {
204
188
  const COMPONENT_ID$6 = 'notifications.well';
205
189
  const StyledWell = styled__default.default(StyledBase).attrs({
206
190
  'data-garden-id': COMPONENT_ID$6,
207
- 'data-garden-version': '9.0.0-next.6'
191
+ 'data-garden-version': '9.0.0-next.8'
208
192
  }).withConfig({
209
193
  displayName: "StyledWell",
210
194
  componentId: "sc-a5831c-0"
@@ -272,8 +256,10 @@ const colorStyles$3 = props => {
272
256
  const boxShadow = `0 ${props.theme.borderWidths.sm} ${props.theme.borderWidths.sm} ${borderColor}`;
273
257
  return styled.css(["box-shadow:", ";background-color:", ";color:", ";& a{color:inherit;", " &:hover{color:", ";}&:active{color:", ";}}"], boxShadow, backgroundColor, foregroundColor, reactTheming.focusStyles({
274
258
  theme: props.theme,
275
- hue: focusColor,
276
- shade: props.alertType === 'info' ? 600 : 800,
259
+ color: {
260
+ hue: focusColor,
261
+ shade: props.alertType === 'info' ? 600 : 800
262
+ },
277
263
  styles: {
278
264
  color: 'inherit'
279
265
  }
@@ -291,7 +277,7 @@ const sizeStyles$3 = props => {
291
277
  };
292
278
  const StyledGlobalAlert = styled__default.default.div.attrs({
293
279
  'data-garden-id': COMPONENT_ID$5,
294
- 'data-garden-version': '9.0.0-next.6'
280
+ 'data-garden-version': '9.0.0-next.8'
295
281
  }).withConfig({
296
282
  displayName: "StyledGlobalAlert",
297
283
  componentId: "sc-k6rimt-0"
@@ -339,8 +325,10 @@ const colorStyles$2 = props => {
339
325
  }
340
326
  return styled.css(["color:inherit;&:hover{background-color:", ";color:", ";}", " &:active{background-color:", ";color:", ";}"], hoverBackgroundColor, hoverForegroundColor, reactTheming.focusStyles({
341
327
  theme: props.theme,
342
- hue: focusColor,
343
- shade: props.alertType === 'info' ? 600 : 800
328
+ color: {
329
+ hue: focusColor,
330
+ shade: props.alertType === 'info' ? 600 : 800
331
+ }
344
332
  }), activeBackgroundColor, activeForegroundColor);
345
333
  };
346
334
  const sizeStyles$2 = props => {
@@ -351,7 +339,7 @@ const sizeStyles$2 = props => {
351
339
  };
352
340
  const StyledGlobalAlertClose = styled__default.default(reactButtons.IconButton).attrs({
353
341
  'data-garden-id': COMPONENT_ID$4,
354
- 'data-garden-version': '9.0.0-next.6',
342
+ 'data-garden-version': '9.0.0-next.8',
355
343
  size: 'small'
356
344
  }).withConfig({
357
345
  displayName: "StyledGlobalAlertClose",
@@ -395,8 +383,10 @@ function colorStyles$1(props) {
395
383
  }
396
384
  return styled.css(["background-color:", ";&:hover{background-color:", ";}", " &:active{background-color:", ";}"], backgroundColor, hoverBackgroundColor, reactTheming.focusStyles({
397
385
  theme: props.theme,
398
- hue: focusColor,
399
- shade: props.alertType === 'info' ? 600 : 800
386
+ color: {
387
+ hue: focusColor,
388
+ shade: props.alertType === 'info' ? 600 : 800
389
+ }
400
390
  }), activeBackgroundColor);
401
391
  }
402
392
  function sizeStyles$1(props) {
@@ -406,7 +396,7 @@ function sizeStyles$1(props) {
406
396
  }
407
397
  const StyledGlobalAlertButton = styled__default.default(reactButtons.Button).attrs({
408
398
  'data-garden-id': COMPONENT_ID$3,
409
- 'data-garden-version': '9.0.0-next.6',
399
+ 'data-garden-version': '9.0.0-next.8',
410
400
  focusInset: false,
411
401
  isDanger: false,
412
402
  isLink: false,
@@ -425,7 +415,7 @@ StyledGlobalAlertButton.defaultProps = {
425
415
  const COMPONENT_ID$2 = 'notifications.global-alert.content';
426
416
  const StyledGlobalAlertContent = styled__default.default.div.attrs({
427
417
  'data-garden-id': COMPONENT_ID$2,
428
- 'data-garden-version': '9.0.0-next.6'
418
+ 'data-garden-version': '9.0.0-next.8'
429
419
  }).withConfig({
430
420
  displayName: "StyledGlobalAlertContent",
431
421
  componentId: "sc-rept0u-0"
@@ -449,7 +439,7 @@ const StyledGlobalAlertIcon = styled__default.default(_ref => {
449
439
  return React__namespace.default.cloneElement(React.Children.only(children), props);
450
440
  }).attrs({
451
441
  'data-garden-id': COMPONENT_ID$1,
452
- 'data-garden-version': '9.0.0-next.6'
442
+ 'data-garden-version': '9.0.0-next.8'
453
443
  }).withConfig({
454
444
  displayName: "StyledGlobalAlertIcon",
455
445
  componentId: "sc-84ne9k-0"
@@ -477,7 +467,7 @@ const colorStyles = props => {
477
467
  };
478
468
  const StyledGlobalAlertTitle = styled__default.default.div.attrs({
479
469
  'data-garden-id': COMPONENT_ID,
480
- 'data-garden-version': '9.0.0-next.6'
470
+ 'data-garden-version': '9.0.0-next.8'
481
471
  }).withConfig({
482
472
  displayName: "StyledGlobalAlertTitle",
483
473
  componentId: "sc-10clqbo-0"
@@ -607,12 +597,12 @@ const useNotificationsContext = () => {
607
597
  return React.useContext(NotificationsContext);
608
598
  };
609
599
 
610
- const Title = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledTitle, _extends$6({
600
+ const Title = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledTitle, Object.assign({
611
601
  ref: ref
612
602
  }, props)));
613
603
  Title.displayName = 'Title';
614
604
 
615
- const Paragraph = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledParagraph, _extends$6({
605
+ const Paragraph = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledParagraph, Object.assign({
616
606
  ref: ref
617
607
  }, props)));
618
608
  Paragraph.displayName = 'Paragraph';
@@ -637,7 +627,7 @@ var SvgXStroke$1 = function SvgXStroke(props) {
637
627
  const Close = React__namespace.default.forwardRef((props, ref) => {
638
628
  const ariaLabel = reactTheming.useText(Close, props, 'aria-label', 'Close');
639
629
  const hue = useNotificationsContext();
640
- return React__namespace.default.createElement(StyledClose, _extends$6({
630
+ return React__namespace.default.createElement(StyledClose, Object.assign({
641
631
  ref: ref,
642
632
  hue: hue,
643
633
  "aria-label": ariaLabel
@@ -654,7 +644,7 @@ const AlertComponent = React__namespace.default.forwardRef((_ref, ref) => {
654
644
  const Icon = validationIcons[props.type];
655
645
  return React__namespace.default.createElement(NotificationsContext.Provider, {
656
646
  value: hue
657
- }, React__namespace.default.createElement(StyledAlert, _extends$6({
647
+ }, React__namespace.default.createElement(StyledAlert, Object.assign({
658
648
  ref: ref,
659
649
  hue: hue,
660
650
  role: role === undefined ? 'alert' : role
@@ -678,7 +668,7 @@ const NotificationComponent = React.forwardRef((_ref, ref) => {
678
668
  } = _ref;
679
669
  const Icon = props.type ? validationIcons[props.type] : SvgInfoStroke;
680
670
  const hue = props.type && validationHues[props.type];
681
- return React__namespace.default.createElement(StyledNotification, _extends$6({
671
+ return React__namespace.default.createElement(StyledNotification, Object.assign({
682
672
  ref: ref,
683
673
  type: props.type,
684
674
  isFloating: true
@@ -697,7 +687,7 @@ Notification.Close = Close;
697
687
  Notification.Paragraph = Paragraph;
698
688
  Notification.Title = Title;
699
689
 
700
- const WellComponent = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledWell, _extends$6({
690
+ const WellComponent = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledWell, Object.assign({
701
691
  ref: ref
702
692
  }, props)));
703
693
  WellComponent.displayName = 'Well';
@@ -981,7 +971,7 @@ const ToastSlot = _ref => {
981
971
  }
982
972
  return index >= limit;
983
973
  }, [limit, placement, toasts.length]);
984
- return React__namespace.default.createElement(StyledTransitionContainer, _extends$6({
974
+ return React__namespace.default.createElement(StyledTransitionContainer, Object.assign({
985
975
  key: placement,
986
976
  toastPlacement: placement,
987
977
  toastZIndex: zIndex,
@@ -1026,7 +1016,7 @@ const ToastProvider = _ref => {
1026
1016
  if (placement === 'bottom' || placement === 'bottom-start' || placement === 'bottom-end') {
1027
1017
  matchingToasts = matchingToasts.reverse();
1028
1018
  }
1029
- return React__namespace.default.createElement(ToastSlot, _extends$6({
1019
+ return React__namespace.default.createElement(ToastSlot, Object.assign({
1030
1020
  placement: placement,
1031
1021
  toasts: matchingToasts,
1032
1022
  zIndex: zIndex,
@@ -1060,7 +1050,7 @@ const GlobalAlertButton = React.forwardRef((_ref, ref) => {
1060
1050
  const {
1061
1051
  type
1062
1052
  } = useGlobalAlertContext();
1063
- return React__namespace.default.createElement(StyledGlobalAlertButton, _extends$6({
1053
+ return React__namespace.default.createElement(StyledGlobalAlertButton, Object.assign({
1064
1054
  ref: ref,
1065
1055
  alertType: type
1066
1056
  }, props, {
@@ -1095,7 +1085,7 @@ const GlobalAlertClose = React.forwardRef((props, ref) => {
1095
1085
  type
1096
1086
  } = useGlobalAlertContext();
1097
1087
  const label = reactTheming.useText(GlobalAlertClose, props, 'aria-label', 'Close');
1098
- return React__namespace.default.createElement(StyledGlobalAlertClose, _extends$6({
1088
+ return React__namespace.default.createElement(StyledGlobalAlertClose, Object.assign({
1099
1089
  ref: ref,
1100
1090
  alertType: type
1101
1091
  }, props), React__namespace.default.createElement(SvgXStroke, {
@@ -1106,7 +1096,7 @@ const GlobalAlertClose = React.forwardRef((props, ref) => {
1106
1096
  GlobalAlertClose.displayName = 'GlobalAlert.Close';
1107
1097
 
1108
1098
  const GlobalAlertContent = React.forwardRef((props, ref) => {
1109
- return React__namespace.default.createElement(StyledGlobalAlertContent, _extends$6({
1099
+ return React__namespace.default.createElement(StyledGlobalAlertContent, Object.assign({
1110
1100
  ref: ref
1111
1101
  }, props));
1112
1102
  });
@@ -1116,7 +1106,7 @@ const GlobalAlertTitle = React.forwardRef((props, ref) => {
1116
1106
  const {
1117
1107
  type
1118
1108
  } = useGlobalAlertContext();
1119
- return React__namespace.default.createElement(StyledGlobalAlertTitle, _extends$6({
1109
+ return React__namespace.default.createElement(StyledGlobalAlertTitle, Object.assign({
1120
1110
  alertType: type,
1121
1111
  ref: ref
1122
1112
  }, props));
@@ -1135,7 +1125,7 @@ const GlobalAlertComponent = React.forwardRef((_ref, ref) => {
1135
1125
  value: React.useMemo(() => ({
1136
1126
  type
1137
1127
  }), [type])
1138
- }, React__namespace.default.createElement(StyledGlobalAlert, _extends$6({
1128
+ }, React__namespace.default.createElement(StyledGlobalAlert, Object.assign({
1139
1129
  ref: ref,
1140
1130
  role: "status",
1141
1131
  alertType: type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-notifications",
3
- "version": "9.0.0-next.6",
3
+ "version": "9.0.0-next.8",
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>",
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/zendeskgarden/react-components/issues"
11
11
  },
12
12
  "main": "dist/index.cjs.js",
13
- "module": "dist/index.esm.js",
13
+ "module": "dist/esm/index.js",
14
14
  "files": [
15
15
  "dist"
16
16
  ],
@@ -21,21 +21,21 @@
21
21
  "sideEffects": false,
22
22
  "types": "dist/typings/index.d.ts",
23
23
  "dependencies": {
24
- "@zendeskgarden/react-buttons": "^9.0.0-next.6",
24
+ "@zendeskgarden/react-buttons": "^9.0.0-next.8",
25
25
  "polished": "^4.1.1",
26
26
  "prop-types": "^15.5.7",
27
27
  "react-transition-group": "^4.4.2",
28
28
  "react-uid": "^2.3.1"
29
29
  },
30
30
  "peerDependencies": {
31
- "@zendeskgarden/react-theming": "^8.67.0",
31
+ "@zendeskgarden/react-theming": ">=9.0.0-next",
32
32
  "react": ">=16.8.0",
33
33
  "react-dom": ">=16.8.0",
34
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.6",
38
+ "@zendeskgarden/react-theming": "^9.0.0-next.8",
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": "45c56ad1c73af40afba8e5415f529a2c9601c83f"
51
+ "gitHead": "a3d6534843d5a4f5cb60b52bc67264f3230f2da0"
52
52
  }