@zendeskgarden/react-notifications 9.0.0-next.14 → 9.0.0-next.15

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 (42) hide show
  1. package/dist/esm/elements/Alert.js +6 -6
  2. package/dist/esm/elements/Notification.js +4 -5
  3. package/dist/esm/elements/Well.js +12 -3
  4. package/dist/esm/elements/content/Close.js +7 -4
  5. package/dist/esm/elements/content/Title.js +10 -3
  6. package/dist/esm/elements/global-alert/GlobalAlert.js +23 -10
  7. package/dist/esm/elements/global-alert/GlobalAlertButton.js +3 -2
  8. package/dist/esm/elements/global-alert/GlobalAlertClose.js +5 -3
  9. package/dist/esm/elements/global-alert/GlobalAlertTitle.js +8 -3
  10. package/dist/esm/styled/StyledAlert.js +29 -3
  11. package/dist/esm/styled/StyledBase.js +72 -25
  12. package/dist/esm/styled/StyledIcon.js +47 -4
  13. package/dist/esm/styled/StyledNotification.js +19 -25
  14. package/dist/esm/styled/StyledWell.js +28 -4
  15. package/dist/esm/styled/content/StyledClose.js +53 -8
  16. package/dist/esm/styled/content/StyledParagraph.js +1 -1
  17. package/dist/esm/styled/content/StyledTitle.js +6 -3
  18. package/dist/esm/styled/global-alert/StyledGlobalAlert.js +113 -38
  19. package/dist/esm/styled/global-alert/StyledGlobalAlertButton.js +78 -33
  20. package/dist/esm/styled/global-alert/StyledGlobalAlertClose.js +62 -31
  21. package/dist/esm/styled/global-alert/StyledGlobalAlertContent.js +2 -2
  22. package/dist/esm/styled/global-alert/StyledGlobalAlertIcon.js +40 -4
  23. package/dist/esm/styled/global-alert/StyledGlobalAlertTitle.js +20 -9
  24. package/dist/esm/utils/icons.js +6 -6
  25. package/dist/index.cjs.js +765 -370
  26. package/dist/typings/styled/StyledAlert.d.ts +8 -3
  27. package/dist/typings/styled/StyledBase.d.ts +8 -6
  28. package/dist/typings/styled/StyledIcon.d.ts +10 -1
  29. package/dist/typings/styled/StyledNotification.d.ts +11 -3
  30. package/dist/typings/styled/StyledWell.d.ts +7 -2
  31. package/dist/typings/styled/content/StyledClose.d.ts +5 -3
  32. package/dist/typings/styled/content/StyledTitle.d.ts +1 -1
  33. package/dist/typings/styled/global-alert/StyledGlobalAlert.d.ts +1 -1
  34. package/dist/typings/styled/global-alert/StyledGlobalAlertButton.d.ts +3 -9
  35. package/dist/typings/styled/global-alert/StyledGlobalAlertClose.d.ts +3 -3
  36. package/dist/typings/styled/global-alert/StyledGlobalAlertTitle.d.ts +2 -2
  37. package/dist/typings/utils/icons.d.ts +1 -1
  38. package/dist/typings/{elements/global-alert/utility.d.ts → utils/useGlobalAlertContext.d.ts} +1 -1
  39. package/dist/typings/utils/useNotificationsContext.d.ts +2 -3
  40. package/package.json +4 -4
  41. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js +0 -26
  42. /package/dist/esm/{elements/global-alert/utility.js → utils/useGlobalAlertContext.js} +0 -0
@@ -21,7 +21,7 @@ import '../styled/global-alert/StyledGlobalAlertClose.js';
21
21
  import '../styled/global-alert/StyledGlobalAlertContent.js';
22
22
  import '../styled/global-alert/StyledGlobalAlertIcon.js';
23
23
  import '../styled/global-alert/StyledGlobalAlertTitle.js';
24
- import { validationHues, validationIcons } from '../utils/icons.js';
24
+ import { validationIcons } from '../utils/icons.js';
25
25
  import { NotificationsContext } from '../utils/useNotificationsContext.js';
26
26
  import { Title } from './content/Title.js';
27
27
  import { Paragraph } from './content/Paragraph.js';
@@ -30,18 +30,18 @@ import { Close } from './content/Close.js';
30
30
  const AlertComponent = React__default.forwardRef((_ref, ref) => {
31
31
  let {
32
32
  role,
33
+ type,
33
34
  ...props
34
35
  } = _ref;
35
- const hue = validationHues[props.type];
36
- const Icon = validationIcons[props.type];
36
+ const Icon = validationIcons[type];
37
37
  return React__default.createElement(NotificationsContext.Provider, {
38
- value: hue
38
+ value: type
39
39
  }, React__default.createElement(StyledAlert, Object.assign({
40
40
  ref: ref,
41
- hue: hue,
41
+ $type: type,
42
42
  role: role === undefined ? 'alert' : role
43
43
  }, props), React__default.createElement(StyledIcon, {
44
- $hue: hue
44
+ $type: type
45
45
  }, React__default.createElement(Icon, null)), props.children));
46
46
  });
47
47
  AlertComponent.displayName = 'Alert';
@@ -22,7 +22,7 @@ import '../styled/global-alert/StyledGlobalAlertClose.js';
22
22
  import '../styled/global-alert/StyledGlobalAlertContent.js';
23
23
  import '../styled/global-alert/StyledGlobalAlertIcon.js';
24
24
  import '../styled/global-alert/StyledGlobalAlertTitle.js';
25
- import { validationIcons, validationHues } from '../utils/icons.js';
25
+ import { validationIcons } from '../utils/icons.js';
26
26
  import { Title } from './content/Title.js';
27
27
  import { Paragraph } from './content/Paragraph.js';
28
28
  import { Close } from './content/Close.js';
@@ -34,14 +34,13 @@ const NotificationComponent = forwardRef((_ref, ref) => {
34
34
  ...props
35
35
  } = _ref;
36
36
  const Icon = type ? validationIcons[type] : SvgInfoStroke;
37
- const hue = type && validationHues[type];
38
37
  return React__default.createElement(StyledNotification, Object.assign({
39
38
  ref: ref,
40
- type: type,
41
- isFloating: true,
39
+ $type: type,
40
+ $isFloating: true,
42
41
  role: "alert"
43
42
  }, props), type && React__default.createElement(StyledIcon, {
44
- $hue: hue
43
+ $type: type
45
44
  }, React__default.createElement(Icon, null)), children);
46
45
  });
47
46
  NotificationComponent.displayName = 'Notification';
@@ -23,9 +23,18 @@ import '../styled/global-alert/StyledGlobalAlertTitle.js';
23
23
  import { Title } from './content/Title.js';
24
24
  import { Paragraph } from './content/Paragraph.js';
25
25
 
26
- const WellComponent = React__default.forwardRef((props, ref) => React__default.createElement(StyledWell, Object.assign({
27
- ref: ref
28
- }, props)));
26
+ const WellComponent = React__default.forwardRef((_ref, ref) => {
27
+ let {
28
+ isFloating,
29
+ isRecessed,
30
+ ...props
31
+ } = _ref;
32
+ return React__default.createElement(StyledWell, Object.assign({
33
+ ref: ref,
34
+ $isFloating: isFloating,
35
+ $isRecessed: isRecessed
36
+ }, props));
37
+ });
29
38
  WellComponent.displayName = 'Well';
30
39
  WellComponent.propTypes = {
31
40
  isRecessed: PropTypes.bool,
@@ -21,16 +21,19 @@ import '../../styled/global-alert/StyledGlobalAlertIcon.js';
21
21
  import '../../styled/global-alert/StyledGlobalAlertTitle.js';
22
22
  import { useNotificationsContext } from '../../utils/useNotificationsContext.js';
23
23
  import { useText } from '@zendeskgarden/react-theming';
24
- import SvgXStroke from '../../node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js';
24
+ import SvgXStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js';
25
25
 
26
26
  const Close = React__default.forwardRef((props, ref) => {
27
27
  const ariaLabel = useText(Close, props, 'aria-label', 'Close');
28
- const hue = useNotificationsContext();
28
+ const type = useNotificationsContext();
29
29
  return React__default.createElement(StyledClose, Object.assign({
30
30
  ref: ref,
31
- hue: hue,
31
+ $type: type,
32
32
  "aria-label": ariaLabel
33
- }, props), React__default.createElement(SvgXStroke, null));
33
+ }, props, {
34
+ focusInset: true,
35
+ size: "small"
36
+ }), React__default.createElement(SvgXStroke, null));
34
37
  });
35
38
  Close.displayName = 'Close';
36
39
 
@@ -20,9 +20,16 @@ import '../../styled/global-alert/StyledGlobalAlertContent.js';
20
20
  import '../../styled/global-alert/StyledGlobalAlertIcon.js';
21
21
  import '../../styled/global-alert/StyledGlobalAlertTitle.js';
22
22
 
23
- const Title = React__default.forwardRef((props, ref) => React__default.createElement(StyledTitle, Object.assign({
24
- ref: ref
25
- }, props)));
23
+ const Title = React__default.forwardRef((_ref, ref) => {
24
+ let {
25
+ isRegular,
26
+ ...props
27
+ } = _ref;
28
+ return React__default.createElement(StyledTitle, Object.assign({
29
+ ref: ref,
30
+ $isRegular: isRegular
31
+ }, props));
32
+ });
26
33
  Title.displayName = 'Title';
27
34
 
28
35
  export { Title };
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import React__default, { forwardRef, useMemo } from 'react';
8
8
  import PropTypes from 'prop-types';
9
+ import { ThemeProvider } from 'styled-components';
9
10
  import SvgInfoStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/info-stroke.svg.js';
10
11
  import SvgAlertErrorStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js';
11
12
  import SvgAlertWarningStroke from '../../node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js';
@@ -25,7 +26,7 @@ import '../../styled/global-alert/StyledGlobalAlertClose.js';
25
26
  import '../../styled/global-alert/StyledGlobalAlertContent.js';
26
27
  import { StyledGlobalAlertIcon } from '../../styled/global-alert/StyledGlobalAlertIcon.js';
27
28
  import '../../styled/global-alert/StyledGlobalAlertTitle.js';
28
- import { GlobalAlertContext } from './utility.js';
29
+ import { GlobalAlertContext } from '../../utils/useGlobalAlertContext.js';
29
30
  import { GlobalAlertButton } from './GlobalAlertButton.js';
30
31
  import { GlobalAlertClose } from './GlobalAlertClose.js';
31
32
  import { GlobalAlertContent } from './GlobalAlertContent.js';
@@ -42,15 +43,27 @@ const GlobalAlertComponent = forwardRef((_ref, ref) => {
42
43
  warning: React__default.createElement(SvgAlertWarningStroke, null),
43
44
  info: React__default.createElement(SvgInfoStroke, null)
44
45
  }[type];
45
- return React__default.createElement(GlobalAlertContext.Provider, {
46
- value: useMemo(() => ({
47
- type
48
- }), [type])
49
- }, React__default.createElement(StyledGlobalAlert, Object.assign({
50
- ref: ref,
51
- role: "status",
52
- alertType: type
53
- }, props), React__default.createElement(StyledGlobalAlertIcon, null, icon), props.children));
46
+ return (
47
+ React__default.createElement(ThemeProvider, {
48
+ theme: theme => ({
49
+ ...theme,
50
+ colors: {
51
+ ...theme.colors,
52
+ base: 'light'
53
+ }
54
+ })
55
+ }, React__default.createElement(GlobalAlertContext.Provider, {
56
+ value: useMemo(() => ({
57
+ type
58
+ }), [type])
59
+ }, React__default.createElement(StyledGlobalAlert, Object.assign({
60
+ ref: ref,
61
+ role: "status",
62
+ $alertType: type
63
+ }, props), React__default.createElement(StyledGlobalAlertIcon, {
64
+ $alertType: type
65
+ }, icon), props.children)))
66
+ );
54
67
  });
55
68
  GlobalAlertComponent.displayName = 'GlobalAlert';
56
69
  const GlobalAlert = GlobalAlertComponent;
@@ -20,7 +20,7 @@ import '../../styled/global-alert/StyledGlobalAlertClose.js';
20
20
  import '../../styled/global-alert/StyledGlobalAlertContent.js';
21
21
  import '../../styled/global-alert/StyledGlobalAlertIcon.js';
22
22
  import '../../styled/global-alert/StyledGlobalAlertTitle.js';
23
- import { useGlobalAlertContext } from './utility.js';
23
+ import { useGlobalAlertContext } from '../../utils/useGlobalAlertContext.js';
24
24
 
25
25
  const GlobalAlertButton = forwardRef((_ref, ref) => {
26
26
  let {
@@ -32,8 +32,9 @@ const GlobalAlertButton = forwardRef((_ref, ref) => {
32
32
  } = useGlobalAlertContext();
33
33
  return React__default.createElement(StyledGlobalAlertButton, Object.assign({
34
34
  ref: ref,
35
- alertType: type
35
+ $alertType: type
36
36
  }, props, {
37
+ size: "small",
37
38
  isPrimary: !isBasic,
38
39
  isBasic: isBasic
39
40
  }));
@@ -21,7 +21,7 @@ import { StyledGlobalAlertClose } from '../../styled/global-alert/StyledGlobalAl
21
21
  import '../../styled/global-alert/StyledGlobalAlertContent.js';
22
22
  import '../../styled/global-alert/StyledGlobalAlertIcon.js';
23
23
  import '../../styled/global-alert/StyledGlobalAlertTitle.js';
24
- import { useGlobalAlertContext } from './utility.js';
24
+ import { useGlobalAlertContext } from '../../utils/useGlobalAlertContext.js';
25
25
 
26
26
  const GlobalAlertClose = forwardRef((props, ref) => {
27
27
  const {
@@ -30,8 +30,10 @@ const GlobalAlertClose = forwardRef((props, ref) => {
30
30
  const label = useText(GlobalAlertClose, props, 'aria-label', 'Close');
31
31
  return React__default.createElement(StyledGlobalAlertClose, Object.assign({
32
32
  ref: ref,
33
- alertType: type
34
- }, props), React__default.createElement(SvgXStroke, {
33
+ $alertType: type
34
+ }, props, {
35
+ size: "small"
36
+ }), React__default.createElement(SvgXStroke, {
35
37
  role: "img",
36
38
  "aria-label": label
37
39
  }));
@@ -20,14 +20,19 @@ import '../../styled/global-alert/StyledGlobalAlertClose.js';
20
20
  import '../../styled/global-alert/StyledGlobalAlertContent.js';
21
21
  import '../../styled/global-alert/StyledGlobalAlertIcon.js';
22
22
  import { StyledGlobalAlertTitle } from '../../styled/global-alert/StyledGlobalAlertTitle.js';
23
- import { useGlobalAlertContext } from './utility.js';
23
+ import { useGlobalAlertContext } from '../../utils/useGlobalAlertContext.js';
24
24
 
25
- const GlobalAlertTitle = forwardRef((props, ref) => {
25
+ const GlobalAlertTitle = forwardRef((_ref, ref) => {
26
+ let {
27
+ isRegular,
28
+ ...props
29
+ } = _ref;
26
30
  const {
27
31
  type
28
32
  } = useGlobalAlertContext();
29
33
  return React__default.createElement(StyledGlobalAlertTitle, Object.assign({
30
- alertType: type,
34
+ $alertType: type,
35
+ $isRegular: isRegular,
31
36
  ref: ref
32
37
  }, props));
33
38
  });
@@ -5,15 +5,41 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
9
  import { StyledTitle } from './content/StyledTitle.js';
10
10
  import { StyledBase } from './StyledBase.js';
11
+ import { validationTypes } from '../utils/icons.js';
11
12
 
12
13
  const COMPONENT_ID = 'notifications.alert';
13
- const colorStyles = props => css(["", "{color:", ";}"], StyledTitle, props.hue && getColorV8(props.hue, 800, props.theme));
14
+ const colorStyles = props => {
15
+ const {
16
+ $type,
17
+ theme
18
+ } = props;
19
+ let variable;
20
+ switch ($type) {
21
+ case validationTypes.success:
22
+ variable = 'foreground.successEmphasis';
23
+ break;
24
+ case validationTypes.error:
25
+ variable = 'foreground.dangerEmphasis';
26
+ break;
27
+ case validationTypes.warning:
28
+ variable = 'foreground.warningEmphasis';
29
+ break;
30
+ case validationTypes.info:
31
+ variable = 'foreground.default';
32
+ break;
33
+ }
34
+ const color = variable ? getColor({
35
+ variable,
36
+ theme
37
+ }) : undefined;
38
+ return css(["", "{color:", ";}"], StyledTitle, color);
39
+ };
14
40
  const StyledAlert = styled(StyledBase).attrs({
15
41
  'data-garden-id': COMPONENT_ID,
16
- 'data-garden-version': '9.0.0-next.14'
42
+ 'data-garden-version': '9.0.0-next.15'
17
43
  }).withConfig({
18
44
  displayName: "StyledAlert",
19
45
  componentId: "sc-fyn8jp-0"
@@ -5,35 +5,79 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import { getLineHeight, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
8
+ import { getLineHeight, retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
+ import { validationTypes } from '../utils/icons.js';
9
10
 
10
- const boxShadow = props => {
11
- const {
12
- theme
13
- } = props;
11
+ const COMPONENT_ID = 'notifications.base_container';
12
+ const colorStyles = _ref => {
13
+ let {
14
+ theme,
15
+ $type,
16
+ $isFloating
17
+ } = _ref;
14
18
  const {
15
19
  space,
16
- shadows
20
+ shadows,
21
+ opacity
17
22
  } = theme;
18
- const offsetY = `${space.base * 5}px`;
19
- const blurRadius = `${space.base * 7}px`;
20
- const color = getColorV8('chromeHue', 600, theme, 0.15);
21
- return shadows.lg(offsetY, blurRadius, color);
22
- };
23
- const colorStyles = props => {
24
- let backgroundColor;
25
- let borderColor;
26
- let foregroundColor;
27
- if (props.hue) {
28
- backgroundColor = getColorV8(props.hue, 100, props.theme);
29
- borderColor = getColorV8(props.hue, 300, props.theme);
30
- foregroundColor = getColorV8(props.hue, props.type === 'info' ? 600 : 700, props.theme);
23
+ let bgVariable;
24
+ let borderVariable;
25
+ let fgVariable;
26
+ if (!$isFloating && $type && !!validationTypes[$type]) {
27
+ switch ($type) {
28
+ case validationTypes.success:
29
+ bgVariable = 'background.success';
30
+ borderVariable = 'border.success';
31
+ fgVariable = 'foreground.success';
32
+ break;
33
+ case validationTypes.error:
34
+ bgVariable = 'background.danger';
35
+ borderVariable = 'border.danger';
36
+ fgVariable = 'foreground.danger';
37
+ break;
38
+ case validationTypes.warning:
39
+ bgVariable = 'background.warning';
40
+ borderVariable = 'border.warning';
41
+ fgVariable = 'foreground.warning';
42
+ break;
43
+ case validationTypes.info:
44
+ bgVariable = 'background.subtle';
45
+ borderVariable = 'border.default';
46
+ fgVariable = 'foreground.subtle';
47
+ break;
48
+ }
31
49
  } else {
32
- backgroundColor = getColorV8('background', 600 , props.theme);
33
- borderColor = getColorV8('neutralHue', 300, props.theme);
34
- foregroundColor = getColorV8('neutralHue', 800, props.theme);
50
+ bgVariable = 'background.raised';
51
+ borderVariable = 'border.default';
52
+ fgVariable = 'foreground.default';
35
53
  }
36
- return css(["border-color:", ";background-color:", ";color:", ";"], borderColor, backgroundColor, foregroundColor);
54
+ const backgroundColor = getColor({
55
+ variable: bgVariable,
56
+ theme
57
+ });
58
+ const borderColor = getColor({
59
+ variable: borderVariable,
60
+ theme
61
+ });
62
+ const foregroundColor = getColor({
63
+ variable: fgVariable,
64
+ theme
65
+ });
66
+ const offsetY = `${space.base * 5}px`;
67
+ const blurRadius = `${space.base * 7}px`;
68
+ const color = getColor({
69
+ hue: 'neutralHue',
70
+ shade: 1200,
71
+ light: {
72
+ transparency: opacity[200]
73
+ },
74
+ dark: {
75
+ transparency: opacity[1000]
76
+ },
77
+ theme
78
+ });
79
+ const boxShadow = $isFloating ? shadows.lg(offsetY, blurRadius, color) : undefined;
80
+ return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";"], borderColor, boxShadow, backgroundColor, foregroundColor);
37
81
  };
38
82
  const padding = props => {
39
83
  const {
@@ -43,10 +87,13 @@ const padding = props => {
43
87
  const paddingHorizontal = `${space.base * 10}px`;
44
88
  return `${paddingVertical} ${paddingHorizontal}`;
45
89
  };
46
- const StyledBase = styled.div.withConfig({
90
+ const StyledBase = styled.div.attrs({
91
+ 'data-garden-id': COMPONENT_ID,
92
+ 'data-garden-version': '9.0.0-next.15'
93
+ }).withConfig({
47
94
  displayName: "StyledBase",
48
95
  componentId: "sc-14syaqw-0"
49
- })(["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 => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', colorStyles);
96
+ })(["position:relative;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";direction:", ";", ";", ""], props => props.theme.borders.sm, props => props.theme.borderRadii.md, padding, props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
50
97
  StyledBase.defaultProps = {
51
98
  theme: DEFAULT_THEME
52
99
  };
@@ -4,13 +4,56 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import styled from 'styled-components';
8
- import { StyledBaseIcon, getColorV8, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
+ import { validationTypes } from '../utils/icons.js';
9
10
 
10
- const StyledIcon = styled(StyledBaseIcon).withConfig({
11
+ const COMPONENT_ID = 'notifications.icon';
12
+ const sizeStyles = _ref => {
13
+ let {
14
+ theme: {
15
+ rtl,
16
+ space
17
+ }
18
+ } = _ref;
19
+ return css(["right:", ";left:", ";margin-top:", "px;"], rtl && `${space.base * 4}px`, !rtl && `${space.base * 4}px`, space.base / 2);
20
+ };
21
+ const colorStyles = _ref2 => {
22
+ let {
23
+ theme,
24
+ $type
25
+ } = _ref2;
26
+ let variable;
27
+ switch ($type) {
28
+ case validationTypes.success:
29
+ variable = 'foreground.success';
30
+ break;
31
+ case validationTypes.error:
32
+ variable = 'foreground.danger';
33
+ break;
34
+ case validationTypes.warning:
35
+ variable = 'foreground.warning';
36
+ break;
37
+ case validationTypes.info:
38
+ variable = 'foreground.subtle';
39
+ break;
40
+ default:
41
+ variable = 'foreground.default';
42
+ break;
43
+ }
44
+ const color = getColor({
45
+ variable,
46
+ theme
47
+ });
48
+ return css(["color:", ";"], color);
49
+ };
50
+ const StyledIcon = styled(StyledBaseIcon).attrs({
51
+ 'data-garden-id': COMPONENT_ID,
52
+ 'data-garden-version': '9.0.0-next.15'
53
+ }).withConfig({
11
54
  displayName: "StyledIcon",
12
55
  componentId: "sc-msklws-0"
13
- })(["position:absolute;right:", ";left:", ";margin-top:", "px;color:", ";"], props => props.theme.rtl && `${props.theme.space.base * 4}px`, props => !props.theme.rtl && `${props.theme.space.base * 4}px`, props => props.theme.space.base / 2, props => props.$hue && getColorV8(props.$hue, props.$hue === 'warningHue' ? 700 : 600, props.theme));
56
+ })(["position:absolute;", " ", " ", ""], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
14
57
  StyledIcon.defaultProps = {
15
58
  theme: DEFAULT_THEME
16
59
  };
@@ -6,54 +6,48 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import styled, { css } from 'styled-components';
9
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
9
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
10
10
  import { TYPE } from '../types/index.js';
11
11
  import { StyledTitle } from './content/StyledTitle.js';
12
12
  import { StyledBase } from './StyledBase.js';
13
+ import { validationTypes } from '../utils/icons.js';
13
14
 
14
15
  const COMPONENT_ID = 'notifications.notification';
15
16
  const colorStyles = props => {
16
17
  const {
17
- type,
18
+ $type,
18
19
  theme
19
20
  } = props;
20
- const {
21
- colors
22
- } = theme;
23
- const {
24
- successHue,
25
- dangerHue,
26
- warningHue
27
- } = colors;
28
- let color;
29
- switch (type) {
30
- case 'success':
31
- color = getColorV8(successHue, 600, theme);
21
+ let variable;
22
+ switch ($type) {
23
+ case validationTypes.success:
24
+ variable = 'foreground.success';
32
25
  break;
33
- case 'error':
34
- color = getColorV8(dangerHue, 600, theme);
26
+ case validationTypes.error:
27
+ variable = 'foreground.danger';
35
28
  break;
36
- case 'warning':
37
- color = getColorV8(warningHue, 700, theme);
29
+ case validationTypes.warning:
30
+ variable = 'foreground.warning';
38
31
  break;
39
- case 'info':
40
- color = getColorV8('foreground', 600 , theme);
41
- break;
42
- default:
43
- color = 'inherit';
32
+ case validationTypes.info:
33
+ variable = 'foreground.default';
44
34
  break;
45
35
  }
36
+ const color = variable ? getColor({
37
+ variable,
38
+ theme
39
+ }) : 'inherit';
46
40
  return css(["", "{color:", ";}"], StyledTitle, color);
47
41
  };
48
42
  const StyledNotification = styled(StyledBase).attrs({
49
43
  'data-garden-id': COMPONENT_ID,
50
- 'data-garden-version': '9.0.0-next.14'
44
+ 'data-garden-version': '9.0.0-next.15'
51
45
  }).withConfig({
52
46
  displayName: "StyledNotification",
53
47
  componentId: "sc-uf6jh-0"
54
48
  })(["", " ", ";"], colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
55
49
  StyledNotification.propTypes = {
56
- type: PropTypes.oneOf(TYPE)
50
+ $type: PropTypes.oneOf(TYPE)
57
51
  };
58
52
  StyledNotification.defaultProps = {
59
53
  theme: DEFAULT_THEME
@@ -4,18 +4,42 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import styled from 'styled-components';
8
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
9
  import { StyledBase } from './StyledBase.js';
10
10
 
11
11
  const COMPONENT_ID = 'notifications.well';
12
+ const colorStyles = _ref => {
13
+ let {
14
+ theme,
15
+ $isFloating,
16
+ $isRecessed
17
+ } = _ref;
18
+ let backgroundVariable;
19
+ if ($isRecessed) {
20
+ backgroundVariable = 'background.recessed';
21
+ } else if ($isFloating) {
22
+ backgroundVariable = 'background.raised';
23
+ } else {
24
+ backgroundVariable = 'background.default';
25
+ }
26
+ const foreground = getColor({
27
+ variable: 'foreground.subtle',
28
+ theme
29
+ });
30
+ const background = getColor({
31
+ variable: backgroundVariable,
32
+ theme
33
+ });
34
+ return css(["background-color:", ";color:", ";"], background, foreground);
35
+ };
12
36
  const StyledWell = styled(StyledBase).attrs({
13
37
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.14'
38
+ 'data-garden-version': '9.0.0-next.15'
15
39
  }).withConfig({
16
40
  displayName: "StyledWell",
17
41
  componentId: "sc-a5831c-0"
18
- })(["background-color:", ";color:", " ", ";"], props => props.isRecessed && getColorV8('neutralHue', 100, props.theme), props => getColorV8('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
42
+ })(["", " ", ";"], colorStyles, p => retrieveComponentStyles(COMPONENT_ID, p));
19
43
  StyledWell.defaultProps = {
20
44
  theme: DEFAULT_THEME
21
45
  };