@zendeskgarden/react-notifications 9.0.0-next.2 → 9.0.0-next.20

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 (68) hide show
  1. package/README.md +6 -4
  2. package/dist/esm/elements/Alert.js +56 -0
  3. package/dist/esm/elements/Notification.js +55 -0
  4. package/dist/esm/elements/Well.js +47 -0
  5. package/dist/esm/elements/content/Close.js +40 -0
  6. package/dist/esm/elements/content/Paragraph.js +28 -0
  7. package/dist/esm/elements/content/Title.js +35 -0
  8. package/dist/esm/elements/global-alert/GlobalAlert.js +78 -0
  9. package/dist/esm/elements/global-alert/GlobalAlertButton.js +47 -0
  10. package/dist/esm/elements/global-alert/GlobalAlertClose.js +43 -0
  11. package/dist/esm/elements/global-alert/GlobalAlertContent.js +30 -0
  12. package/dist/esm/elements/global-alert/GlobalAlertTitle.js +44 -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/16/alert-error-stroke.svg.js +37 -0
  22. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +32 -0
  23. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +33 -0
  24. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/info-stroke.svg.js +37 -0
  25. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
  26. package/dist/esm/styled/StyledAlert.js +51 -0
  27. package/dist/esm/styled/StyledBase.js +92 -0
  28. package/dist/esm/styled/StyledIcon.js +61 -0
  29. package/dist/esm/styled/StyledNotification.js +56 -0
  30. package/dist/esm/styled/StyledWell.js +47 -0
  31. package/dist/esm/styled/content/StyledClose.js +70 -0
  32. package/dist/esm/styled/content/StyledParagraph.js +22 -0
  33. package/dist/esm/styled/content/StyledTitle.js +25 -0
  34. package/dist/esm/styled/global-alert/StyledGlobalAlert.js +160 -0
  35. package/dist/esm/styled/global-alert/StyledGlobalAlertButton.js +118 -0
  36. package/dist/esm/styled/global-alert/StyledGlobalAlertClose.js +103 -0
  37. package/dist/esm/styled/global-alert/StyledGlobalAlertContent.js +22 -0
  38. package/dist/esm/styled/global-alert/StyledGlobalAlertIcon.js +65 -0
  39. package/dist/esm/styled/global-alert/StyledGlobalAlertTitle.js +49 -0
  40. package/dist/esm/types/index.js +9 -0
  41. package/dist/esm/utils/icons.js +25 -0
  42. package/dist/esm/utils/useGlobalAlertContext.js +14 -0
  43. package/dist/esm/utils/useNotificationsContext.js +14 -0
  44. package/dist/index.cjs.js +811 -440
  45. package/dist/typings/elements/Alert.d.ts +9 -1
  46. package/dist/typings/elements/Notification.d.ts +9 -1
  47. package/dist/typings/elements/Well.d.ts +7 -1
  48. package/dist/typings/elements/content/Close.d.ts +2 -0
  49. package/dist/typings/elements/content/Paragraph.d.ts +2 -0
  50. package/dist/typings/elements/content/Title.d.ts +2 -0
  51. package/dist/typings/index.d.ts +2 -6
  52. package/dist/typings/styled/StyledAlert.d.ts +8 -3
  53. package/dist/typings/styled/StyledBase.d.ts +8 -6
  54. package/dist/typings/styled/StyledIcon.d.ts +11 -2
  55. package/dist/typings/styled/StyledNotification.d.ts +11 -3
  56. package/dist/typings/styled/StyledWell.d.ts +7 -2
  57. package/dist/typings/styled/content/StyledClose.d.ts +5 -3
  58. package/dist/typings/styled/content/StyledTitle.d.ts +1 -1
  59. package/dist/typings/styled/global-alert/StyledGlobalAlert.d.ts +1 -1
  60. package/dist/typings/styled/global-alert/StyledGlobalAlertButton.d.ts +4 -11
  61. package/dist/typings/styled/global-alert/StyledGlobalAlertClose.d.ts +2 -3
  62. package/dist/typings/styled/global-alert/StyledGlobalAlertIcon.d.ts +2 -2
  63. package/dist/typings/styled/global-alert/StyledGlobalAlertTitle.d.ts +2 -2
  64. package/dist/typings/utils/icons.d.ts +1 -1
  65. package/dist/typings/{elements/global-alert/utility.d.ts → utils/useGlobalAlertContext.d.ts} +1 -1
  66. package/dist/typings/utils/useNotificationsContext.d.ts +2 -3
  67. package/package.json +9 -9
  68. package/dist/index.esm.js +0 -1124
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,89 +39,270 @@ 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
- const COMPONENT_ID$b = 'notifications.close';
61
- const StyledClose = styled__default.default.button.attrs({
62
- 'data-garden-id': COMPONENT_ID$b,
63
- 'data-garden-version': '9.0.0-next.2'
44
+ var _g$2, _circle$2;
45
+ function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
46
+ var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
47
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
48
+ xmlns: "http://www.w3.org/2000/svg",
49
+ width: 16,
50
+ height: 16,
51
+ focusable: "false",
52
+ viewBox: "0 0 16 16",
53
+ "aria-hidden": "true"
54
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
55
+ fill: "none",
56
+ stroke: "currentColor"
57
+ }, /*#__PURE__*/React__namespace.createElement("circle", {
58
+ cx: 7.5,
59
+ cy: 8.5,
60
+ r: 7
61
+ }), /*#__PURE__*/React__namespace.createElement("path", {
62
+ strokeLinecap: "round",
63
+ d: "M7.5 4.5V9"
64
+ }))), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
65
+ cx: 7.5,
66
+ cy: 12,
67
+ r: 1,
68
+ fill: "currentColor"
69
+ })));
70
+ };
71
+
72
+ var _g$1;
73
+ function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
74
+ var SvgCheckCircleStroke = function SvgCheckCircleStroke(props) {
75
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
76
+ xmlns: "http://www.w3.org/2000/svg",
77
+ width: 16,
78
+ height: 16,
79
+ focusable: "false",
80
+ viewBox: "0 0 16 16",
81
+ "aria-hidden": "true"
82
+ }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
83
+ fill: "none",
84
+ stroke: "currentColor"
85
+ }, /*#__PURE__*/React__namespace.createElement("path", {
86
+ strokeLinecap: "round",
87
+ strokeLinejoin: "round",
88
+ d: "M4 9l2.5 2.5 5-5"
89
+ }), /*#__PURE__*/React__namespace.createElement("circle", {
90
+ cx: 7.5,
91
+ cy: 8.5,
92
+ r: 7
93
+ }))));
94
+ };
95
+
96
+ var _path$1, _circle$1;
97
+ function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
98
+ var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
99
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
100
+ xmlns: "http://www.w3.org/2000/svg",
101
+ width: 16,
102
+ height: 16,
103
+ focusable: "false",
104
+ viewBox: "0 0 16 16",
105
+ "aria-hidden": "true"
106
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
107
+ fill: "none",
108
+ stroke: "currentColor",
109
+ strokeLinecap: "round",
110
+ d: "M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"
111
+ })), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
112
+ cx: 7.5,
113
+ cy: 12,
114
+ r: 1,
115
+ fill: "currentColor"
116
+ })));
117
+ };
118
+
119
+ var _g, _circle;
120
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
121
+ var SvgInfoStroke = function SvgInfoStroke(props) {
122
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
123
+ xmlns: "http://www.w3.org/2000/svg",
124
+ width: 16,
125
+ height: 16,
126
+ focusable: "false",
127
+ viewBox: "0 0 16 16",
128
+ "aria-hidden": "true"
129
+ }, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
130
+ stroke: "currentColor"
131
+ }, /*#__PURE__*/React__namespace.createElement("circle", {
132
+ cx: 7.5,
133
+ cy: 8.5,
134
+ r: 7,
135
+ fill: "none"
136
+ }), /*#__PURE__*/React__namespace.createElement("path", {
137
+ strokeLinecap: "round",
138
+ d: "M7.5 12.5V8"
139
+ }))), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
140
+ cx: 7.5,
141
+ cy: 5,
142
+ r: 1,
143
+ fill: "currentColor"
144
+ })));
145
+ };
146
+
147
+ const validationIcons = {
148
+ success: SvgCheckCircleStroke,
149
+ error: SvgAlertErrorStroke,
150
+ warning: SvgAlertWarningStroke,
151
+ info: SvgInfoStroke
152
+ };
153
+ const validationTypes = {
154
+ success: 'success',
155
+ error: 'error',
156
+ warning: 'warning',
157
+ info: 'info'
158
+ };
159
+
160
+ const COMPONENT_ID$d = 'notifications.close';
161
+ const colorStyles$a = _ref => {
162
+ let {
163
+ theme,
164
+ $type
165
+ } = _ref;
166
+ let variable;
167
+ switch ($type) {
168
+ case validationTypes.warning:
169
+ variable = 'foreground.warning';
170
+ break;
171
+ case validationTypes.error:
172
+ variable = 'foreground.danger';
173
+ break;
174
+ case validationTypes.success:
175
+ variable = 'foreground.success';
176
+ break;
177
+ default:
178
+ variable = 'foreground.subtle';
179
+ break;
180
+ }
181
+ const color = reactTheming.getColor({
182
+ variable,
183
+ theme
184
+ });
185
+ const hoverColor = reactTheming.getColor({
186
+ variable,
187
+ light: {
188
+ offset: 100
189
+ },
190
+ dark: {
191
+ offset: -100
192
+ },
193
+ theme
194
+ });
195
+ const activeColor = reactTheming.getColor({
196
+ variable,
197
+ light: {
198
+ offset: 200
199
+ },
200
+ dark: {
201
+ offset: -200
202
+ },
203
+ theme
204
+ });
205
+ return styled.css(["color:", ";&:hover{background-color:transparent;color:", ";}&:active{background-color:transparent;color:", ";}"], color, hoverColor, activeColor);
206
+ };
207
+ const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
208
+ 'data-garden-id': COMPONENT_ID$d,
209
+ 'data-garden-version': '9.0.0-next.20'
64
210
  }).withConfig({
65
211
  displayName: "StyledClose",
66
212
  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.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 => reactTheming.focusStyles({
68
- theme: props.theme,
69
- inset: true
70
- }), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
213
+ })(["position:absolute;top:", "px;right:", ";left:", ";", " ", ";"], props => props.theme.space.base, p => !p.theme.rtl && `${p.theme.space.base}px`, p => p.theme.rtl && `${p.theme.space.base}px`, colorStyles$a, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props));
71
214
  StyledClose.defaultProps = {
72
215
  theme: reactTheming.DEFAULT_THEME
73
216
  };
74
217
 
75
- const COMPONENT_ID$a = 'notifications.paragraph';
218
+ const COMPONENT_ID$c = 'notifications.paragraph';
76
219
  const StyledParagraph = styled__default.default.p.attrs({
77
- 'data-garden-id': COMPONENT_ID$a,
78
- 'data-garden-version': '9.0.0-next.2'
220
+ 'data-garden-id': COMPONENT_ID$c,
221
+ 'data-garden-version': '9.0.0-next.20'
79
222
  }).withConfig({
80
223
  displayName: "StyledParagraph",
81
224
  componentId: "sc-12tmd6p-0"
82
- })(["margin:", "px 0 0;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
225
+ })(["margin:", "px 0 0;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$c, props));
83
226
  StyledParagraph.defaultProps = {
84
227
  theme: reactTheming.DEFAULT_THEME
85
228
  };
86
229
 
87
- const COMPONENT_ID$9 = 'notifications.title';
230
+ const COMPONENT_ID$b = 'notifications.title';
88
231
  const StyledTitle = styled__default.default.div.attrs({
89
- 'data-garden-id': COMPONENT_ID$9,
90
- 'data-garden-version': '9.0.0-next.2'
232
+ 'data-garden-id': COMPONENT_ID$b,
233
+ 'data-garden-version': '9.0.0-next.20'
91
234
  }).withConfig({
92
235
  displayName: "StyledTitle",
93
236
  componentId: "sc-xx4jsv-0"
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));
237
+ })(["margin:0;color:", ";font-weight:", ";", ";"], p => reactTheming.getColor({
238
+ variable: 'foreground.default',
239
+ theme: p.theme
240
+ }), props => props.$isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
95
241
  StyledTitle.defaultProps = {
96
242
  theme: reactTheming.DEFAULT_THEME
97
243
  };
98
244
 
99
- const boxShadow = props => {
100
- const {
101
- theme
102
- } = props;
245
+ const COMPONENT_ID$a = 'notifications.base_container';
246
+ const colorStyles$9 = _ref => {
247
+ let {
248
+ theme,
249
+ $type,
250
+ $isFloating
251
+ } = _ref;
103
252
  const {
104
253
  space,
105
254
  shadows
106
255
  } = theme;
107
- const offsetY = `${space.base * 5}px`;
108
- const blurRadius = `${space.base * 7}px`;
109
- const color = reactTheming.getColor('chromeHue', 600, theme, 0.15);
110
- return shadows.lg(offsetY, blurRadius, color);
111
- };
112
- const colorStyles$6 = props => {
113
- let backgroundColor;
114
- let borderColor;
115
- let foregroundColor;
116
- if (props.hue) {
117
- backgroundColor = reactTheming.getColor(props.hue, 100, props.theme);
118
- borderColor = reactTheming.getColor(props.hue, 300, props.theme);
119
- foregroundColor = reactTheming.getColor(props.hue, props.type === 'info' ? 600 : 700, props.theme);
256
+ let bgVariable;
257
+ let borderVariable;
258
+ let fgVariable;
259
+ if (!$isFloating && $type && !!validationTypes[$type]) {
260
+ switch ($type) {
261
+ case validationTypes.success:
262
+ bgVariable = 'background.success';
263
+ borderVariable = 'border.success';
264
+ fgVariable = 'foreground.success';
265
+ break;
266
+ case validationTypes.error:
267
+ bgVariable = 'background.danger';
268
+ borderVariable = 'border.danger';
269
+ fgVariable = 'foreground.danger';
270
+ break;
271
+ case validationTypes.warning:
272
+ bgVariable = 'background.warning';
273
+ borderVariable = 'border.warning';
274
+ fgVariable = 'foreground.warning';
275
+ break;
276
+ case validationTypes.info:
277
+ bgVariable = 'background.subtle';
278
+ borderVariable = 'border.default';
279
+ fgVariable = 'foreground.subtle';
280
+ break;
281
+ }
120
282
  } else {
121
- backgroundColor = props.theme.colors.background;
122
- borderColor = reactTheming.getColor('neutralHue', 300, props.theme);
123
- foregroundColor = reactTheming.getColor('neutralHue', 800, props.theme);
283
+ bgVariable = 'background.raised';
284
+ borderVariable = 'border.default';
285
+ fgVariable = 'foreground.default';
124
286
  }
125
- return styled.css(["border-color:", ";background-color:", ";color:", ";"], borderColor, backgroundColor, foregroundColor);
287
+ const backgroundColor = reactTheming.getColor({
288
+ variable: bgVariable,
289
+ theme
290
+ });
291
+ const borderColor = reactTheming.getColor({
292
+ variable: borderVariable,
293
+ theme
294
+ });
295
+ const foregroundColor = reactTheming.getColor({
296
+ variable: fgVariable,
297
+ theme
298
+ });
299
+ const offsetY = `${space.base * 5}px`;
300
+ const blurRadius = `${space.base * 7}px`;
301
+ const boxShadow = $isFloating ? shadows.lg(offsetY, blurRadius, reactTheming.getColor({
302
+ variable: 'shadow.large',
303
+ theme
304
+ })) : undefined;
305
+ return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";"], borderColor, boxShadow, backgroundColor, foregroundColor);
126
306
  };
127
307
  const padding = props => {
128
308
  const {
@@ -132,149 +312,306 @@ const padding = props => {
132
312
  const paddingHorizontal = `${space.base * 10}px`;
133
313
  return `${paddingVertical} ${paddingHorizontal}`;
134
314
  };
135
- const StyledBase = styled__default.default.div.withConfig({
315
+ const StyledBase = styled__default.default.div.attrs({
316
+ 'data-garden-id': COMPONENT_ID$a,
317
+ 'data-garden-version': '9.0.0-next.20'
318
+ }).withConfig({
136
319
  displayName: "StyledBase",
137
320
  componentId: "sc-14syaqw-0"
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);
321
+ })(["position:relative;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";direction:", ";", ";", ""], props => props.theme.borders.sm, props => props.theme.borderRadii.md, padding, props => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', colorStyles$9, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
139
322
  StyledBase.defaultProps = {
140
323
  theme: reactTheming.DEFAULT_THEME
141
324
  };
142
325
 
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));
326
+ const COMPONENT_ID$9 = 'notifications.alert';
327
+ const colorStyles$8 = props => {
328
+ const {
329
+ $type,
330
+ theme
331
+ } = props;
332
+ let variable;
333
+ switch ($type) {
334
+ case validationTypes.success:
335
+ variable = 'foreground.successEmphasis';
336
+ break;
337
+ case validationTypes.error:
338
+ variable = 'foreground.dangerEmphasis';
339
+ break;
340
+ case validationTypes.warning:
341
+ variable = 'foreground.warningEmphasis';
342
+ break;
343
+ case validationTypes.info:
344
+ variable = 'foreground.default';
345
+ break;
346
+ }
347
+ const color = variable ? reactTheming.getColor({
348
+ variable,
349
+ theme
350
+ }) : undefined;
351
+ return styled.css(["", "{color:", ";}"], StyledTitle, color);
352
+ };
145
353
  const StyledAlert = styled__default.default(StyledBase).attrs({
146
- 'data-garden-id': COMPONENT_ID$8,
147
- 'data-garden-version': '9.0.0-next.2'
354
+ 'data-garden-id': COMPONENT_ID$9,
355
+ 'data-garden-version': '9.0.0-next.20'
148
356
  }).withConfig({
149
357
  displayName: "StyledAlert",
150
358
  componentId: "sc-fyn8jp-0"
151
- })(["", " ", ";"], colorStyles$5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
359
+ })(["", " ", ";"], colorStyles$8, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
152
360
  StyledAlert.defaultProps = {
153
361
  theme: reactTheming.DEFAULT_THEME
154
362
  };
155
363
 
156
- const COMPONENT_ID$7 = 'notifications.notification';
157
- const colorStyles$4 = props => {
364
+ const COMPONENT_ID$8 = 'notifications.notification';
365
+ const colorStyles$7 = props => {
158
366
  const {
159
- type,
367
+ $type,
160
368
  theme
161
369
  } = props;
162
- const {
163
- colors
164
- } = theme;
165
- const {
166
- successHue,
167
- dangerHue,
168
- warningHue,
169
- foreground
170
- } = colors;
171
- let color;
172
- switch (type) {
173
- case 'success':
174
- color = reactTheming.getColor(successHue, 600, theme);
370
+ let variable;
371
+ switch ($type) {
372
+ case validationTypes.success:
373
+ variable = 'foreground.success';
175
374
  break;
176
- case 'error':
177
- color = reactTheming.getColor(dangerHue, 600, theme);
178
- break;
179
- case 'warning':
180
- color = reactTheming.getColor(warningHue, 700, theme);
375
+ case validationTypes.error:
376
+ variable = 'foreground.danger';
181
377
  break;
182
- case 'info':
183
- color = foreground;
378
+ case validationTypes.warning:
379
+ variable = 'foreground.warning';
184
380
  break;
185
- default:
186
- color = 'inherit';
381
+ case validationTypes.info:
382
+ variable = 'foreground.default';
187
383
  break;
188
384
  }
385
+ const color = variable ? reactTheming.getColor({
386
+ variable,
387
+ theme
388
+ }) : 'inherit';
189
389
  return styled.css(["", "{color:", ";}"], StyledTitle, color);
190
390
  };
191
391
  const StyledNotification = styled__default.default(StyledBase).attrs({
192
- 'data-garden-id': COMPONENT_ID$7,
193
- 'data-garden-version': '9.0.0-next.2'
392
+ 'data-garden-id': COMPONENT_ID$8,
393
+ 'data-garden-version': '9.0.0-next.20'
194
394
  }).withConfig({
195
395
  displayName: "StyledNotification",
196
396
  componentId: "sc-uf6jh-0"
197
- })(["", " ", ";"], colorStyles$4, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
397
+ })(["", " ", ";"], colorStyles$7, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
198
398
  StyledNotification.propTypes = {
199
- type: PropTypes__default.default.oneOf(TYPE)
399
+ $type: PropTypes__default.default.oneOf(TYPE)
200
400
  };
201
401
  StyledNotification.defaultProps = {
202
402
  theme: reactTheming.DEFAULT_THEME
203
403
  };
204
404
 
205
- const COMPONENT_ID$6 = 'notifications.well';
405
+ const COMPONENT_ID$7 = 'notifications.well';
406
+ const colorStyles$6 = _ref => {
407
+ let {
408
+ theme,
409
+ $isFloating,
410
+ $isRecessed
411
+ } = _ref;
412
+ let backgroundVariable;
413
+ if ($isRecessed) {
414
+ backgroundVariable = 'background.recessed';
415
+ } else if ($isFloating) {
416
+ backgroundVariable = 'background.raised';
417
+ } else {
418
+ backgroundVariable = 'background.default';
419
+ }
420
+ const foreground = reactTheming.getColor({
421
+ variable: 'foreground.subtle',
422
+ theme
423
+ });
424
+ const background = reactTheming.getColor({
425
+ variable: backgroundVariable,
426
+ theme
427
+ });
428
+ return styled.css(["background-color:", ";color:", ";"], background, foreground);
429
+ };
206
430
  const StyledWell = styled__default.default(StyledBase).attrs({
207
- 'data-garden-id': COMPONENT_ID$6,
208
- 'data-garden-version': '9.0.0-next.2'
431
+ 'data-garden-id': COMPONENT_ID$7,
432
+ 'data-garden-version': '9.0.0-next.20'
209
433
  }).withConfig({
210
434
  displayName: "StyledWell",
211
435
  componentId: "sc-a5831c-0"
212
- })(["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));
436
+ })(["", " ", ";"], colorStyles$6, p => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, p));
213
437
  StyledWell.defaultProps = {
214
438
  theme: reactTheming.DEFAULT_THEME
215
439
  };
216
440
 
217
- const StyledIcon = styled__default.default(_ref => {
441
+ const COMPONENT_ID$6 = 'notifications.icon';
442
+ const sizeStyles$4 = _ref => {
218
443
  let {
219
- children,
220
- ...props
444
+ theme: {
445
+ rtl,
446
+ space
447
+ }
221
448
  } = _ref;
222
- return React__namespace.default.cloneElement(React.Children.only(children), props);
449
+ return styled.css(["right:", ";left:", ";margin-top:", "px;"], rtl && `${space.base * 4}px`, !rtl && `${space.base * 4}px`, space.base / 2);
450
+ };
451
+ const colorStyles$5 = _ref2 => {
452
+ let {
453
+ theme,
454
+ $type
455
+ } = _ref2;
456
+ let variable;
457
+ switch ($type) {
458
+ case validationTypes.success:
459
+ variable = 'foreground.success';
460
+ break;
461
+ case validationTypes.error:
462
+ variable = 'foreground.danger';
463
+ break;
464
+ case validationTypes.warning:
465
+ variable = 'foreground.warning';
466
+ break;
467
+ case validationTypes.info:
468
+ variable = 'foreground.subtle';
469
+ break;
470
+ default:
471
+ variable = 'foreground.default';
472
+ break;
473
+ }
474
+ const color = reactTheming.getColor({
475
+ variable,
476
+ theme
477
+ });
478
+ return styled.css(["color:", ";"], color);
479
+ };
480
+ const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
481
+ 'data-garden-id': COMPONENT_ID$6,
482
+ 'data-garden-version': '9.0.0-next.20'
223
483
  }).withConfig({
224
484
  displayName: "StyledIcon",
225
485
  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.getColor(props.hue, props.hue === 'warningHue' ? 700 : 600, props.theme));
486
+ })(["position:absolute;", " ", " ", ""], sizeStyles$4, colorStyles$5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
227
487
  StyledIcon.defaultProps = {
228
488
  theme: reactTheming.DEFAULT_THEME
229
489
  };
230
490
 
231
- const COMPONENT_ID$5 = 'notifications.global-alert';
232
- const colorStyles$3 = props => {
491
+ const COMPONENT_ID$5 = 'notifications.global_alert';
492
+ const colorStyles$4 = _ref => {
493
+ let {
494
+ theme,
495
+ $alertType
496
+ } = _ref;
233
497
  let borderColor;
234
498
  let backgroundColor;
235
499
  let foregroundColor;
236
500
  let anchorHoverColor;
237
501
  let anchorActiveColor;
238
- let focusColor;
239
- switch (props.alertType) {
502
+ let focusVariable;
503
+ switch ($alertType) {
240
504
  case 'success':
241
- borderColor = reactTheming.getColor('successHue', 700, props.theme);
242
- backgroundColor = reactTheming.getColor('successHue', 600, props.theme);
243
- foregroundColor = reactTheming.getColor('successHue', 100, props.theme);
244
- anchorHoverColor = props.theme.palette.white;
245
- anchorActiveColor = props.theme.palette.white;
246
- focusColor = 'successHue';
247
- break;
505
+ {
506
+ borderColor = reactTheming.getColor({
507
+ variable: 'border.successEmphasis',
508
+ offset: 100,
509
+ theme
510
+ });
511
+ backgroundColor = reactTheming.getColor({
512
+ variable: 'background.successEmphasis',
513
+ theme
514
+ });
515
+ foregroundColor = reactTheming.getColor({
516
+ variable: 'foreground.success',
517
+ offset: -600,
518
+ theme
519
+ });
520
+ anchorHoverColor = theme.palette.white;
521
+ anchorActiveColor = theme.palette.white;
522
+ focusVariable = 'foreground.successEmphasis';
523
+ break;
524
+ }
248
525
  case 'error':
249
- borderColor = reactTheming.getColor('dangerHue', 700, props.theme);
250
- backgroundColor = reactTheming.getColor('dangerHue', 600, props.theme);
251
- foregroundColor = reactTheming.getColor('dangerHue', 100, props.theme);
252
- anchorHoverColor = props.theme.palette.white;
253
- anchorActiveColor = props.theme.palette.white;
254
- focusColor = 'dangerHue';
255
- break;
526
+ {
527
+ borderColor = reactTheming.getColor({
528
+ variable: 'border.dangerEmphasis',
529
+ offset: 100,
530
+ theme
531
+ });
532
+ backgroundColor = reactTheming.getColor({
533
+ variable: 'background.dangerEmphasis',
534
+ theme
535
+ });
536
+ foregroundColor = reactTheming.getColor({
537
+ variable: 'foreground.danger',
538
+ offset: -600,
539
+ theme
540
+ });
541
+ anchorActiveColor = theme.palette.white;
542
+ anchorHoverColor = theme.palette.white;
543
+ focusVariable = 'foreground.dangerEmphasis';
544
+ break;
545
+ }
256
546
  case 'warning':
257
- borderColor = reactTheming.getColor('warningHue', 400, props.theme);
258
- backgroundColor = reactTheming.getColor('warningHue', 300, props.theme);
259
- foregroundColor = reactTheming.getColor('warningHue', 800, props.theme);
260
- anchorHoverColor = reactTheming.getColor('warningHue', 900, props.theme);
261
- anchorActiveColor = reactTheming.getColor('warningHue', 1000, props.theme);
262
- focusColor = 'warningHue';
263
- break;
547
+ {
548
+ borderColor = reactTheming.getColor({
549
+ variable: 'border.warningEmphasis',
550
+ offset: -300,
551
+ theme
552
+ });
553
+ backgroundColor = reactTheming.getColor({
554
+ variable: 'background.warningEmphasis',
555
+ offset: -400,
556
+ theme
557
+ });
558
+ const fgVariable = 'foreground.warning';
559
+ foregroundColor = reactTheming.getColor({
560
+ variable: fgVariable,
561
+ offset: 100,
562
+ theme
563
+ });
564
+ anchorHoverColor = reactTheming.getColor({
565
+ variable: fgVariable,
566
+ offset: 200,
567
+ theme
568
+ });
569
+ anchorActiveColor = reactTheming.getColor({
570
+ variable: fgVariable,
571
+ offset: 300,
572
+ theme
573
+ });
574
+ focusVariable = fgVariable;
575
+ break;
576
+ }
264
577
  case 'info':
265
- borderColor = reactTheming.getColor('primaryHue', 300, props.theme);
266
- backgroundColor = reactTheming.getColor('primaryHue', 200, props.theme);
267
- foregroundColor = reactTheming.getColor('primaryHue', 700, props.theme);
268
- anchorHoverColor = reactTheming.getColor('primaryHue', 800, props.theme);
269
- anchorActiveColor = reactTheming.getColor('primaryHue', 900, props.theme);
270
- focusColor = 'primaryHue';
271
- break;
578
+ {
579
+ borderColor = reactTheming.getColor({
580
+ variable: 'border.primaryEmphasis',
581
+ offset: -300,
582
+ theme
583
+ });
584
+ backgroundColor = reactTheming.getColor({
585
+ variable: 'background.primaryEmphasis',
586
+ offset: -400,
587
+ theme
588
+ });
589
+ const fgVariable = 'foreground.primary';
590
+ foregroundColor = reactTheming.getColor({
591
+ variable: fgVariable,
592
+ offset: 100,
593
+ theme
594
+ });
595
+ anchorHoverColor = reactTheming.getColor({
596
+ variable: fgVariable,
597
+ offset: 200,
598
+ theme
599
+ });
600
+ anchorActiveColor = reactTheming.getColor({
601
+ variable: fgVariable,
602
+ offset: 300,
603
+ theme
604
+ });
605
+ focusVariable = fgVariable;
606
+ break;
607
+ }
272
608
  }
273
- const boxShadow = `0 ${props.theme.borderWidths.sm} ${props.theme.borderWidths.sm} ${borderColor}`;
609
+ const boxShadow = `0 ${theme.borderWidths.sm} ${theme.borderWidths.sm} ${borderColor}`;
274
610
  return styled.css(["box-shadow:", ";background-color:", ";color:", ";& a{color:inherit;", " &:hover{color:", ";}&:active{color:", ";}}"], boxShadow, backgroundColor, foregroundColor, reactTheming.focusStyles({
275
- theme: props.theme,
276
- hue: focusColor,
277
- shade: props.alertType === 'info' ? 600 : 800,
611
+ theme,
612
+ color: {
613
+ variable: focusVariable
614
+ },
278
615
  styles: {
279
616
  color: 'inherit'
280
617
  }
@@ -292,56 +629,88 @@ const sizeStyles$3 = props => {
292
629
  };
293
630
  const StyledGlobalAlert = styled__default.default.div.attrs({
294
631
  'data-garden-id': COMPONENT_ID$5,
295
- 'data-garden-version': '9.0.0-next.2'
632
+ 'data-garden-version': '9.0.0-next.20'
296
633
  }).withConfig({
297
634
  displayName: "StyledGlobalAlert",
298
635
  componentId: "sc-k6rimt-0"
299
- })(["display:flex;flex-wrap:nowrap;overflow:auto;overflow-x:hidden;box-sizing:border-box;direction:", ";", " ", " && a{border-radius:", ";text-decoration:underline;}", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', sizeStyles$3, colorStyles$3, props => props.theme.borderRadii.sm, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
636
+ })(["display:flex;flex-wrap:nowrap;overflow:auto;overflow-x:hidden;box-sizing:border-box;direction:", ";", " ", " && a{border-radius:", ";text-decoration:underline;}", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', sizeStyles$3, colorStyles$4, props => props.theme.borderRadii.sm, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
300
637
  StyledGlobalAlert.defaultProps = {
301
638
  theme: reactTheming.DEFAULT_THEME
302
639
  };
303
640
 
304
- const COMPONENT_ID$4 = 'notifications.global-alert.close';
305
- const colorStyles$2 = props => {
641
+ const COMPONENT_ID$4 = 'notifications.global_alert.close';
642
+ const colorStyles$3 = props => {
643
+ const {
644
+ $alertType,
645
+ theme
646
+ } = props;
306
647
  let hoverBackgroundColor;
307
648
  let hoverForegroundColor;
308
649
  let activeBackgroundColor;
309
650
  let activeForegroundColor;
310
- let focusColor;
311
- switch (props.alertType) {
651
+ let focusVariable;
652
+ switch ($alertType) {
312
653
  case 'success':
313
- hoverBackgroundColor = reactTheming.getColor('successHue', 100, props.theme, 0.08);
314
- hoverForegroundColor = props.theme.palette.white;
315
- activeBackgroundColor = reactTheming.getColor('successHue', 100, props.theme, 0.2);
316
- activeForegroundColor = props.theme.palette.white;
317
- focusColor = 'successHue';
654
+ hoverBackgroundColor = reactTheming.getColor({
655
+ variable: 'background.success',
656
+ theme,
657
+ transparency: theme.opacity[100]
658
+ });
659
+ hoverForegroundColor = theme.palette.white;
660
+ activeBackgroundColor = reactTheming.getColor({
661
+ variable: 'background.success',
662
+ theme,
663
+ transparency: theme.opacity[200]
664
+ });
665
+ activeForegroundColor = theme.palette.white;
666
+ focusVariable = 'foreground.successEmphasis';
318
667
  break;
319
668
  case 'error':
320
- hoverBackgroundColor = reactTheming.getColor('dangerHue', 100, props.theme, 0.08);
321
- hoverForegroundColor = props.theme.palette.white;
322
- activeBackgroundColor = reactTheming.getColor('dangerHue', 100, props.theme, 0.2);
323
- activeForegroundColor = props.theme.palette.white;
324
- focusColor = 'dangerHue';
669
+ hoverBackgroundColor = reactTheming.getColor({
670
+ variable: 'background.danger',
671
+ theme,
672
+ transparency: theme.opacity[100]
673
+ });
674
+ hoverForegroundColor = theme.palette.white;
675
+ activeBackgroundColor = reactTheming.getColor({
676
+ variable: 'background.danger',
677
+ theme,
678
+ transparency: theme.opacity[200]
679
+ });
680
+ activeForegroundColor = theme.palette.white;
681
+ focusVariable = 'foreground.dangerEmphasis';
325
682
  break;
326
683
  case 'warning':
327
- hoverBackgroundColor = reactTheming.getColor('warningHue', 800, props.theme, 0.08);
328
- hoverForegroundColor = reactTheming.getColor('warningHue', 900, props.theme);
329
- activeBackgroundColor = reactTheming.getColor('warningHue', 800, props.theme, 0.2);
330
- activeForegroundColor = reactTheming.getColor('warningHue', 1000, props.theme);
331
- focusColor = 'warningHue';
332
- break;
333
- case 'info':
334
- hoverBackgroundColor = reactTheming.getColor('primaryHue', 700, props.theme, 0.08);
335
- hoverForegroundColor = reactTheming.getColor('primaryHue', 800, props.theme);
336
- activeBackgroundColor = reactTheming.getColor('primaryHue', 700, props.theme, 0.2);
337
- activeForegroundColor = reactTheming.getColor('primaryHue', 900, props.theme);
338
- focusColor = 'primaryHue';
684
+ hoverBackgroundColor = reactTheming.getColor({
685
+ variable: 'background.warningEmphasis',
686
+ transparency: theme.opacity[100],
687
+ theme
688
+ });
689
+ hoverForegroundColor = reactTheming.getColor({
690
+ variable: 'foreground.warningEmphasis',
691
+ offset: 200,
692
+ theme
693
+ });
694
+ activeBackgroundColor = reactTheming.getColor({
695
+ variable: 'background.warningEmphasis',
696
+ transparency: theme.opacity[200],
697
+ theme
698
+ });
699
+ activeForegroundColor = reactTheming.getColor({
700
+ variable: 'foreground.warningEmphasis',
701
+ offset: 300,
702
+ theme
703
+ });
704
+ focusVariable = 'foreground.warning';
339
705
  break;
706
+ default:
707
+ focusVariable = 'foreground.primary';
340
708
  }
341
709
  return styled.css(["color:inherit;&:hover{background-color:", ";color:", ";}", " &:active{background-color:", ";color:", ";}"], hoverBackgroundColor, hoverForegroundColor, reactTheming.focusStyles({
342
- theme: props.theme,
343
- hue: focusColor,
344
- shade: props.alertType === 'info' ? 600 : 800
710
+ theme,
711
+ color: {
712
+ variable: focusVariable
713
+ }
345
714
  }), activeBackgroundColor, activeForegroundColor);
346
715
  };
347
716
  const sizeStyles$2 = props => {
@@ -352,52 +721,103 @@ const sizeStyles$2 = props => {
352
721
  };
353
722
  const StyledGlobalAlertClose = styled__default.default(reactButtons.IconButton).attrs({
354
723
  'data-garden-id': COMPONENT_ID$4,
355
- 'data-garden-version': '9.0.0-next.2',
356
- size: 'small'
724
+ 'data-garden-version': '9.0.0-next.20'
357
725
  }).withConfig({
358
726
  displayName: "StyledGlobalAlertClose",
359
727
  componentId: "sc-1g5s93s-0"
360
- })(["", ";", ";", ";"], sizeStyles$2, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
728
+ })(["", ";", ";", ";"], sizeStyles$2, colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
361
729
  StyledGlobalAlertClose.defaultProps = {
362
730
  theme: reactTheming.DEFAULT_THEME
363
731
  };
364
732
 
365
- const COMPONENT_ID$3 = 'notifications.global-alert.button';
366
- function colorStyles$1(props) {
367
- if (props.isBasic) {
368
- return colorStyles$2(props);
733
+ const COMPONENT_ID$3 = 'notifications.global_alert.button';
734
+ function colorStyles$2(props) {
735
+ const {
736
+ $alertType,
737
+ isBasic,
738
+ theme
739
+ } = props;
740
+ if (isBasic) {
741
+ return colorStyles$3(props);
369
742
  }
370
- let backgroundColor;
371
- let hoverBackgroundColor;
372
- let activeBackgroundColor;
373
- let focusColor;
374
- switch (props.alertType) {
743
+ let bgVariable;
744
+ let offsetOptions;
745
+ let offsetHoverOptions;
746
+ let offsetActiveOptions;
747
+ let focusVariable;
748
+ switch ($alertType) {
375
749
  case 'success':
376
- backgroundColor = reactTheming.getColor('successHue', 800, props.theme);
377
- hoverBackgroundColor = reactTheming.getColor('successHue', 900, props.theme);
378
- activeBackgroundColor = reactTheming.getColor('successHue', 1000, props.theme);
379
- focusColor = 'successHue';
750
+ bgVariable = 'background.successEmphasis';
751
+ offsetOptions = {
752
+ offset: 200
753
+ };
754
+ offsetHoverOptions = {
755
+ offset: 300
756
+ };
757
+ offsetActiveOptions = {
758
+ offset: 400
759
+ };
760
+ focusVariable = 'foreground.successEmphasis';
380
761
  break;
381
762
  case 'error':
382
- backgroundColor = reactTheming.getColor('dangerHue', 800, props.theme);
383
- hoverBackgroundColor = reactTheming.getColor('dangerHue', 900, props.theme);
384
- activeBackgroundColor = reactTheming.getColor('dangerHue', 1000, props.theme);
385
- focusColor = 'dangerHue';
763
+ bgVariable = 'background.dangerEmphasis';
764
+ offsetOptions = {
765
+ offset: 200
766
+ };
767
+ offsetHoverOptions = {
768
+ offset: 300
769
+ };
770
+ offsetActiveOptions = {
771
+ offset: 400
772
+ };
773
+ focusVariable = 'foreground.dangerEmphasis';
386
774
  break;
387
775
  case 'warning':
388
- backgroundColor = reactTheming.getColor('warningHue', 800, props.theme);
389
- hoverBackgroundColor = reactTheming.getColor('warningHue', 900, props.theme);
390
- activeBackgroundColor = reactTheming.getColor('warningHue', 1000, props.theme);
391
- focusColor = 'warningHue';
776
+ bgVariable = 'background.warningEmphasis';
777
+ offsetOptions = {};
778
+ offsetHoverOptions = {
779
+ offset: 100
780
+ };
781
+ offsetActiveOptions = {
782
+ offset: 200
783
+ };
784
+ focusVariable = 'foreground.warning';
392
785
  break;
393
786
  case 'info':
394
- focusColor = 'primaryHue';
787
+ bgVariable = 'background.primaryEmphasis';
788
+ offsetOptions = {};
789
+ offsetHoverOptions = {
790
+ offset: 100
791
+ };
792
+ offsetActiveOptions = {
793
+ offset: 200
794
+ };
795
+ focusVariable = 'foreground.primary';
395
796
  break;
396
797
  }
397
- return styled.css(["background-color:", ";&:hover{background-color:", ";}", " &:active{background-color:", ";}"], backgroundColor, hoverBackgroundColor, reactTheming.focusStyles({
398
- theme: props.theme,
399
- hue: focusColor,
400
- shade: props.alertType === 'info' ? 600 : 800
798
+ const backgroundColor = reactTheming.getColor({
799
+ variable: bgVariable,
800
+ ...offsetOptions,
801
+ theme
802
+ });
803
+ const hoverBackgroundColor = reactTheming.getColor({
804
+ variable: bgVariable,
805
+ ...offsetHoverOptions,
806
+ theme
807
+ });
808
+ const activeBackgroundColor = reactTheming.getColor({
809
+ variable: bgVariable,
810
+ ...offsetActiveOptions,
811
+ theme
812
+ });
813
+ return styled.css(["background-color:", ";color:", ";&:hover{background-color:", ";}", " &:active{background-color:", ";}"], backgroundColor, reactTheming.getColor({
814
+ hue: 'white',
815
+ theme
816
+ }), hoverBackgroundColor, reactTheming.focusStyles({
817
+ theme,
818
+ color: {
819
+ variable: focusVariable
820
+ }
401
821
  }), activeBackgroundColor);
402
822
  }
403
823
  function sizeStyles$1(props) {
@@ -407,26 +827,19 @@ function sizeStyles$1(props) {
407
827
  }
408
828
  const StyledGlobalAlertButton = styled__default.default(reactButtons.Button).attrs({
409
829
  'data-garden-id': COMPONENT_ID$3,
410
- 'data-garden-version': '9.0.0-next.2',
411
- focusInset: false,
412
- isDanger: false,
413
- isLink: false,
414
- isNeutral: false,
415
- isPill: false,
416
- isStretched: false,
417
- size: 'small'
830
+ 'data-garden-version': '9.0.0-next.20'
418
831
  }).withConfig({
419
832
  displayName: "StyledGlobalAlertButton",
420
833
  componentId: "sc-1txe91a-0"
421
- })(["flex-shrink:0;", ";", ";", ";"], sizeStyles$1, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
834
+ })(["flex-shrink:0;", ";", ";", ";"], sizeStyles$1, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
422
835
  StyledGlobalAlertButton.defaultProps = {
423
836
  theme: reactTheming.DEFAULT_THEME
424
837
  };
425
838
 
426
- const COMPONENT_ID$2 = 'notifications.global-alert.content';
839
+ const COMPONENT_ID$2 = 'notifications.global_alert.content';
427
840
  const StyledGlobalAlertContent = styled__default.default.div.attrs({
428
841
  'data-garden-id': COMPONENT_ID$2,
429
- 'data-garden-version': '9.0.0-next.2'
842
+ 'data-garden-version': '9.0.0-next.20'
430
843
  }).withConfig({
431
844
  displayName: "StyledGlobalAlertContent",
432
845
  componentId: "sc-rept0u-0"
@@ -435,269 +848,223 @@ StyledGlobalAlertContent.defaultProps = {
435
848
  theme: reactTheming.DEFAULT_THEME
436
849
  };
437
850
 
438
- const COMPONENT_ID$1 = 'notifications.global-alert.icon';
851
+ const COMPONENT_ID$1 = 'notifications.global_alert.icon';
439
852
  const sizeStyles = props => {
440
853
  const size = props.theme.iconSizes.md;
441
854
  const marginTop = polished.math(`(${props.theme.space.base * 5} - ${size}) / 2`);
442
855
  const marginHorizontal = `${props.theme.space.base * 2}px`;
443
856
  return styled.css(["margin-top:", ";margin-", ":", ";width:", ";height:", ";"], marginTop, props.theme.rtl ? 'left' : 'right', marginHorizontal, size, size);
444
857
  };
445
- const StyledGlobalAlertIcon = styled__default.default(_ref => {
858
+ const colorStyles$1 = _ref => {
446
859
  let {
447
- children,
448
- ...props
860
+ theme,
861
+ $alertType
449
862
  } = _ref;
450
- return React__namespace.default.cloneElement(React.Children.only(children), props);
451
- }).attrs({
863
+ let color;
864
+ switch ($alertType) {
865
+ case 'success':
866
+ color = reactTheming.getColor({
867
+ variable: 'foreground.success',
868
+ offset: -400,
869
+ theme
870
+ });
871
+ break;
872
+ case 'error':
873
+ color = reactTheming.getColor({
874
+ variable: 'foreground.danger',
875
+ offset: -400,
876
+ theme
877
+ });
878
+ break;
879
+ case 'warning':
880
+ color = reactTheming.getColor({
881
+ variable: 'foreground.warning',
882
+ theme
883
+ });
884
+ break;
885
+ case 'info':
886
+ color = reactTheming.getColor({
887
+ variable: 'foreground.primary',
888
+ theme
889
+ });
890
+ break;
891
+ }
892
+ return styled.css(["color:", ";"], color);
893
+ };
894
+ const StyledGlobalAlertIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
452
895
  'data-garden-id': COMPONENT_ID$1,
453
- 'data-garden-version': '9.0.0-next.2'
896
+ 'data-garden-version': '9.0.0-next.20'
454
897
  }).withConfig({
455
898
  displayName: "StyledGlobalAlertIcon",
456
899
  componentId: "sc-84ne9k-0"
457
- })(["flex-shrink:0;", ";", ";"], sizeStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
900
+ })(["flex-shrink:0;", ";", ";", ";"], sizeStyles, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
458
901
  StyledGlobalAlertIcon.defaultProps = {
459
902
  theme: reactTheming.DEFAULT_THEME
460
903
  };
461
904
 
462
- const COMPONENT_ID = 'notifications.global-alert.title';
463
- const colorStyles = props => {
905
+ const COMPONENT_ID = 'notifications.global_alert.title';
906
+ const colorStyles = _ref => {
907
+ let {
908
+ theme,
909
+ $alertType
910
+ } = _ref;
464
911
  let color;
465
- switch (props.alertType) {
912
+ switch ($alertType) {
466
913
  case 'success':
467
914
  case 'error':
468
- color = props.theme.palette.white;
915
+ color = theme.palette.white;
469
916
  break;
470
917
  case 'warning':
471
- color = reactTheming.getColor('warningHue', 900, props.theme);
918
+ color = reactTheming.getColor({
919
+ variable: 'foreground.warningEmphasis',
920
+ theme
921
+ });
472
922
  break;
473
923
  case 'info':
474
- color = reactTheming.getColor('primaryHue', 800, props.theme);
924
+ color = reactTheming.getColor({
925
+ variable: 'foreground.primary',
926
+ offset: 200,
927
+ theme
928
+ });
475
929
  break;
476
930
  }
477
931
  return styled.css(["color:", ";"], color);
478
932
  };
479
933
  const StyledGlobalAlertTitle = styled__default.default.div.attrs({
480
934
  'data-garden-id': COMPONENT_ID,
481
- 'data-garden-version': '9.0.0-next.2'
935
+ 'data-garden-version': '9.0.0-next.20'
482
936
  }).withConfig({
483
937
  displayName: "StyledGlobalAlertTitle",
484
938
  componentId: "sc-10clqbo-0"
485
- })(["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));
939
+ })(["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));
486
940
  StyledGlobalAlertTitle.defaultProps = {
487
941
  theme: reactTheming.DEFAULT_THEME
488
942
  };
489
943
 
490
- var _g$2, _circle$2;
491
- 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); }
492
- var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
493
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
494
- xmlns: "http://www.w3.org/2000/svg",
495
- width: 16,
496
- height: 16,
497
- focusable: "false",
498
- viewBox: "0 0 16 16",
499
- "aria-hidden": "true"
500
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
501
- fill: "none",
502
- stroke: "currentColor"
503
- }, /*#__PURE__*/React__namespace.createElement("circle", {
504
- cx: 7.5,
505
- cy: 8.5,
506
- r: 7
507
- }), /*#__PURE__*/React__namespace.createElement("path", {
508
- strokeLinecap: "round",
509
- d: "M7.5 4.5V9"
510
- }))), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
511
- cx: 7.5,
512
- cy: 12,
513
- r: 1,
514
- fill: "currentColor"
515
- })));
944
+ const NotificationsContext = React.createContext(undefined);
945
+ const useNotificationsContext = () => {
946
+ return React.useContext(NotificationsContext);
516
947
  };
517
948
 
518
- var _g$1;
519
- 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); }
520
- var SvgCheckCircleStroke = function SvgCheckCircleStroke(props) {
521
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
522
- xmlns: "http://www.w3.org/2000/svg",
523
- width: 16,
524
- height: 16,
525
- focusable: "false",
526
- viewBox: "0 0 16 16",
527
- "aria-hidden": "true"
528
- }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
529
- fill: "none",
530
- stroke: "currentColor"
531
- }, /*#__PURE__*/React__namespace.createElement("path", {
532
- strokeLinecap: "round",
533
- strokeLinejoin: "round",
534
- d: "M4 9l2.5 2.5 5-5"
535
- }), /*#__PURE__*/React__namespace.createElement("circle", {
536
- cx: 7.5,
537
- cy: 8.5,
538
- r: 7
539
- }))));
540
- };
949
+ const Title = React__namespace.default.forwardRef((_ref, ref) => {
950
+ let {
951
+ isRegular,
952
+ ...props
953
+ } = _ref;
954
+ return React__namespace.default.createElement(StyledTitle, Object.assign({
955
+ ref: ref,
956
+ $isRegular: isRegular
957
+ }, props));
958
+ });
959
+ Title.displayName = 'Title';
541
960
 
542
- var _path$2, _circle$1;
543
- 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); }
544
- var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
545
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
546
- xmlns: "http://www.w3.org/2000/svg",
547
- width: 16,
548
- height: 16,
549
- focusable: "false",
550
- viewBox: "0 0 16 16",
551
- "aria-hidden": "true"
552
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
553
- fill: "none",
554
- stroke: "currentColor",
555
- strokeLinecap: "round",
556
- d: "M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"
557
- })), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
558
- cx: 7.5,
559
- cy: 12,
560
- r: 1,
561
- fill: "currentColor"
562
- })));
563
- };
961
+ const Paragraph = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledParagraph, Object.assign({
962
+ ref: ref
963
+ }, props)));
964
+ Paragraph.displayName = 'Paragraph';
564
965
 
565
- var _g, _circle;
566
- 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); }
567
- var SvgInfoStroke = function SvgInfoStroke(props) {
568
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
966
+ var _path;
967
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
968
+ var SvgXStroke = function SvgXStroke(props) {
969
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
569
970
  xmlns: "http://www.w3.org/2000/svg",
570
971
  width: 16,
571
972
  height: 16,
572
973
  focusable: "false",
573
974
  viewBox: "0 0 16 16",
574
975
  "aria-hidden": "true"
575
- }, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
576
- stroke: "currentColor"
577
- }, /*#__PURE__*/React__namespace.createElement("circle", {
578
- cx: 7.5,
579
- cy: 8.5,
580
- r: 7,
581
- fill: "none"
582
- }), /*#__PURE__*/React__namespace.createElement("path", {
976
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
977
+ stroke: "currentColor",
583
978
  strokeLinecap: "round",
584
- d: "M7.5 12.5V8"
585
- }))), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
586
- cx: 7.5,
587
- cy: 5,
588
- r: 1,
589
- fill: "currentColor"
979
+ d: "M3 13L13 3m0 10L3 3"
590
980
  })));
591
981
  };
592
982
 
593
- const validationIcons = {
594
- success: SvgCheckCircleStroke,
595
- error: SvgAlertErrorStroke,
596
- warning: SvgAlertWarningStroke,
597
- info: SvgInfoStroke
598
- };
599
- const validationHues = {
600
- success: 'successHue',
601
- error: 'dangerHue',
602
- warning: 'warningHue',
603
- info: 'neutralHue'
604
- };
605
-
606
- const NotificationsContext = React.createContext(undefined);
607
- const useNotificationsContext = () => {
608
- return React.useContext(NotificationsContext);
609
- };
983
+ const Close = React__namespace.default.forwardRef((props, ref) => {
984
+ const ariaLabel = reactTheming.useText(Close, props, 'aria-label', 'Close');
985
+ const type = useNotificationsContext();
986
+ return React__namespace.default.createElement(StyledClose, Object.assign({
987
+ ref: ref,
988
+ $type: type,
989
+ "aria-label": ariaLabel
990
+ }, props, {
991
+ focusInset: true,
992
+ size: "small"
993
+ }), React__namespace.default.createElement(SvgXStroke, null));
994
+ });
995
+ Close.displayName = 'Close';
610
996
 
611
- const Alert = React__namespace.default.forwardRef((_ref, ref) => {
997
+ const AlertComponent = React__namespace.default.forwardRef((_ref, ref) => {
612
998
  let {
613
999
  role,
1000
+ type,
614
1001
  ...props
615
1002
  } = _ref;
616
- const hue = validationHues[props.type];
617
- const Icon = validationIcons[props.type];
1003
+ const Icon = validationIcons[type];
618
1004
  return React__namespace.default.createElement(NotificationsContext.Provider, {
619
- value: hue
620
- }, React__namespace.default.createElement(StyledAlert, _extends$6({
1005
+ value: type
1006
+ }, React__namespace.default.createElement(StyledAlert, Object.assign({
621
1007
  ref: ref,
622
- hue: hue,
1008
+ $type: type,
623
1009
  role: role === undefined ? 'alert' : role
624
1010
  }, props), React__namespace.default.createElement(StyledIcon, {
625
- hue: hue
1011
+ $type: type
626
1012
  }, React__namespace.default.createElement(Icon, null)), props.children));
627
1013
  });
628
- Alert.displayName = 'Alert';
629
- Alert.propTypes = {
1014
+ AlertComponent.displayName = 'Alert';
1015
+ AlertComponent.propTypes = {
630
1016
  type: PropTypes__default.default.oneOf(TYPE).isRequired
631
1017
  };
1018
+ const Alert = AlertComponent;
1019
+ Alert.Close = Close;
1020
+ Alert.Paragraph = Paragraph;
1021
+ Alert.Title = Title;
632
1022
 
633
- const Notification = React.forwardRef((_ref, ref) => {
1023
+ const NotificationComponent = React.forwardRef((_ref, ref) => {
634
1024
  let {
635
- role,
1025
+ children,
1026
+ type,
636
1027
  ...props
637
1028
  } = _ref;
638
- const Icon = props.type ? validationIcons[props.type] : SvgInfoStroke;
639
- const hue = props.type && validationHues[props.type];
640
- return React__namespace.default.createElement(StyledNotification, _extends$6({
1029
+ const Icon = type ? validationIcons[type] : SvgInfoStroke;
1030
+ return React__namespace.default.createElement(StyledNotification, Object.assign({
641
1031
  ref: ref,
642
- type: props.type,
643
- isFloating: true
644
- }, props, {
645
- role: role === undefined ? 'status' : role
646
- }), props.type && React__namespace.default.createElement(StyledIcon, {
647
- hue: hue
648
- }, React__namespace.default.createElement(Icon, null)), props.children);
1032
+ $type: type,
1033
+ $isFloating: true,
1034
+ role: "alert"
1035
+ }, props), type && React__namespace.default.createElement(StyledIcon, {
1036
+ $type: type
1037
+ }, React__namespace.default.createElement(Icon, null)), children);
649
1038
  });
650
- Notification.displayName = 'Notification';
651
- Notification.propTypes = {
1039
+ NotificationComponent.displayName = 'Notification';
1040
+ NotificationComponent.propTypes = {
652
1041
  type: PropTypes__default.default.oneOf(TYPE)
653
1042
  };
1043
+ const Notification = NotificationComponent;
1044
+ Notification.Close = Close;
1045
+ Notification.Paragraph = Paragraph;
1046
+ Notification.Title = Title;
654
1047
 
655
- const Well = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledWell, _extends$6({
656
- ref: ref
657
- }, props)));
658
- Well.displayName = 'Well';
659
- Well.propTypes = {
1048
+ const WellComponent = React__namespace.default.forwardRef((_ref, ref) => {
1049
+ let {
1050
+ isFloating,
1051
+ isRecessed,
1052
+ ...props
1053
+ } = _ref;
1054
+ return React__namespace.default.createElement(StyledWell, Object.assign({
1055
+ ref: ref,
1056
+ $isFloating: isFloating,
1057
+ $isRecessed: isRecessed
1058
+ }, props));
1059
+ });
1060
+ WellComponent.displayName = 'Well';
1061
+ WellComponent.propTypes = {
660
1062
  isRecessed: PropTypes__default.default.bool,
661
1063
  isFloating: PropTypes__default.default.bool
662
1064
  };
663
-
664
- var _path$1;
665
- 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); }
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';
1065
+ const Well = WellComponent;
1066
+ Well.Paragraph = Paragraph;
1067
+ Well.Title = Title;
701
1068
 
702
1069
  const getInitialState = () => {
703
1070
  return {
@@ -971,7 +1338,7 @@ const ToastSlot = _ref => {
971
1338
  }
972
1339
  return index >= limit;
973
1340
  }, [limit, placement, toasts.length]);
974
- return React__namespace.default.createElement(StyledTransitionContainer, _extends$6({
1341
+ return React__namespace.default.createElement(StyledTransitionContainer, Object.assign({
975
1342
  key: placement,
976
1343
  toastPlacement: placement,
977
1344
  toastZIndex: zIndex,
@@ -1016,7 +1383,7 @@ const ToastProvider = _ref => {
1016
1383
  if (placement === 'bottom' || placement === 'bottom-start' || placement === 'bottom-end') {
1017
1384
  matchingToasts = matchingToasts.reverse();
1018
1385
  }
1019
- return React__namespace.default.createElement(ToastSlot, _extends$6({
1386
+ return React__namespace.default.createElement(ToastSlot, Object.assign({
1020
1387
  placement: placement,
1021
1388
  toasts: matchingToasts,
1022
1389
  zIndex: zIndex,
@@ -1050,10 +1417,11 @@ const GlobalAlertButton = React.forwardRef((_ref, ref) => {
1050
1417
  const {
1051
1418
  type
1052
1419
  } = useGlobalAlertContext();
1053
- return React__namespace.default.createElement(StyledGlobalAlertButton, _extends$6({
1420
+ return React__namespace.default.createElement(StyledGlobalAlertButton, Object.assign({
1054
1421
  ref: ref,
1055
- alertType: type
1422
+ $alertType: type
1056
1423
  }, props, {
1424
+ size: "small",
1057
1425
  isPrimary: !isBasic,
1058
1426
  isBasic: isBasic
1059
1427
  }));
@@ -1063,32 +1431,17 @@ GlobalAlertButton.propTypes = {
1063
1431
  isBasic: PropTypes__default.default.bool
1064
1432
  };
1065
1433
 
1066
- var _path;
1067
- 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); }
1068
- var SvgXStroke = function SvgXStroke(props) {
1069
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
1070
- xmlns: "http://www.w3.org/2000/svg",
1071
- width: 16,
1072
- height: 16,
1073
- focusable: "false",
1074
- viewBox: "0 0 16 16",
1075
- "aria-hidden": "true"
1076
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
1077
- stroke: "currentColor",
1078
- strokeLinecap: "round",
1079
- d: "M3 13L13 3m0 10L3 3"
1080
- })));
1081
- };
1082
-
1083
1434
  const GlobalAlertClose = React.forwardRef((props, ref) => {
1084
1435
  const {
1085
1436
  type
1086
1437
  } = useGlobalAlertContext();
1087
1438
  const label = reactTheming.useText(GlobalAlertClose, props, 'aria-label', 'Close');
1088
- return React__namespace.default.createElement(StyledGlobalAlertClose, _extends$6({
1439
+ return React__namespace.default.createElement(StyledGlobalAlertClose, Object.assign({
1089
1440
  ref: ref,
1090
- alertType: type
1091
- }, props), React__namespace.default.createElement(SvgXStroke, {
1441
+ $alertType: type
1442
+ }, props, {
1443
+ size: "small"
1444
+ }), React__namespace.default.createElement(SvgXStroke, {
1092
1445
  role: "img",
1093
1446
  "aria-label": label
1094
1447
  }));
@@ -1096,18 +1449,23 @@ const GlobalAlertClose = React.forwardRef((props, ref) => {
1096
1449
  GlobalAlertClose.displayName = 'GlobalAlert.Close';
1097
1450
 
1098
1451
  const GlobalAlertContent = React.forwardRef((props, ref) => {
1099
- return React__namespace.default.createElement(StyledGlobalAlertContent, _extends$6({
1452
+ return React__namespace.default.createElement(StyledGlobalAlertContent, Object.assign({
1100
1453
  ref: ref
1101
1454
  }, props));
1102
1455
  });
1103
1456
  GlobalAlertContent.displayName = 'GlobalAlert.Content';
1104
1457
 
1105
- const GlobalAlertTitle = React.forwardRef((props, ref) => {
1458
+ const GlobalAlertTitle = React.forwardRef((_ref, ref) => {
1459
+ let {
1460
+ isRegular,
1461
+ ...props
1462
+ } = _ref;
1106
1463
  const {
1107
1464
  type
1108
1465
  } = useGlobalAlertContext();
1109
- return React__namespace.default.createElement(StyledGlobalAlertTitle, _extends$6({
1110
- alertType: type,
1466
+ return React__namespace.default.createElement(StyledGlobalAlertTitle, Object.assign({
1467
+ $alertType: type,
1468
+ $isRegular: isRegular,
1111
1469
  ref: ref
1112
1470
  }, props));
1113
1471
  });
@@ -1121,20 +1479,33 @@ const GlobalAlertComponent = React.forwardRef((_ref, ref) => {
1121
1479
  type,
1122
1480
  ...props
1123
1481
  } = _ref;
1124
- return React__namespace.default.createElement(GlobalAlertContext.Provider, {
1125
- value: React.useMemo(() => ({
1126
- type
1127
- }), [type])
1128
- }, React__namespace.default.createElement(StyledGlobalAlert, _extends$6({
1129
- ref: ref,
1130
- role: "status",
1131
- alertType: type
1132
- }, props), {
1133
- success: React__namespace.default.createElement(StyledGlobalAlertIcon, null, React__namespace.default.createElement(SvgCheckCircleStroke, null)),
1134
- error: React__namespace.default.createElement(StyledGlobalAlertIcon, null, React__namespace.default.createElement(SvgAlertErrorStroke, null)),
1135
- warning: React__namespace.default.createElement(StyledGlobalAlertIcon, null, React__namespace.default.createElement(SvgAlertWarningStroke, null)),
1136
- info: React__namespace.default.createElement(StyledGlobalAlertIcon, null, React__namespace.default.createElement(SvgInfoStroke, null))
1137
- }[type], props.children));
1482
+ const icon = {
1483
+ success: React__namespace.default.createElement(SvgCheckCircleStroke, null),
1484
+ error: React__namespace.default.createElement(SvgAlertErrorStroke, null),
1485
+ warning: React__namespace.default.createElement(SvgAlertWarningStroke, null),
1486
+ info: React__namespace.default.createElement(SvgInfoStroke, null)
1487
+ }[type];
1488
+ return (
1489
+ React__namespace.default.createElement(styled.ThemeProvider, {
1490
+ theme: theme => ({
1491
+ ...theme,
1492
+ colors: {
1493
+ ...theme.colors,
1494
+ base: 'light'
1495
+ }
1496
+ })
1497
+ }, React__namespace.default.createElement(GlobalAlertContext.Provider, {
1498
+ value: React.useMemo(() => ({
1499
+ type
1500
+ }), [type])
1501
+ }, React__namespace.default.createElement(StyledGlobalAlert, Object.assign({
1502
+ ref: ref,
1503
+ role: "status",
1504
+ $alertType: type
1505
+ }, props), React__namespace.default.createElement(StyledGlobalAlertIcon, {
1506
+ $alertType: type
1507
+ }, icon), props.children)))
1508
+ );
1138
1509
  });
1139
1510
  GlobalAlertComponent.displayName = 'GlobalAlert';
1140
1511
  const GlobalAlert = GlobalAlertComponent;