@zendeskgarden/react-chrome 9.0.0-next.9 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/esm/elements/Chrome.js +9 -8
  2. package/dist/esm/elements/footer/FooterItem.js +1 -1
  3. package/dist/esm/elements/header/HeaderItem.js +1 -1
  4. package/dist/esm/elements/header/HeaderItemIcon.js +3 -18
  5. package/dist/esm/elements/header/HeaderItemText.js +1 -1
  6. package/dist/esm/elements/header/HeaderItemWrapper.js +1 -1
  7. package/dist/esm/elements/nav/Nav.js +13 -7
  8. package/dist/esm/elements/nav/NavItem.js +6 -12
  9. package/dist/esm/elements/nav/NavItemIcon.js +3 -18
  10. package/dist/esm/elements/nav/NavItemText.js +1 -1
  11. package/dist/esm/elements/nav/NavList.js +1 -1
  12. package/dist/esm/elements/sheet/Sheet.js +2 -1
  13. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/link-stroke.svg.js +1 -1
  14. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +1 -1
  15. package/dist/esm/styled/StyledChrome.js +2 -5
  16. package/dist/esm/styled/StyledSkipNav.js +36 -18
  17. package/dist/esm/styled/StyledSkipNavIcon.js +10 -7
  18. package/dist/esm/styled/body/StyledBody.js +6 -6
  19. package/dist/esm/styled/body/StyledContent.js +18 -9
  20. package/dist/esm/styled/body/StyledMain.js +6 -6
  21. package/dist/esm/styled/footer/StyledFooter.js +28 -10
  22. package/dist/esm/styled/footer/StyledFooterItem.js +2 -5
  23. package/dist/esm/styled/header/StyledBaseHeaderItem.js +25 -19
  24. package/dist/esm/styled/header/StyledHeader.js +39 -15
  25. package/dist/esm/styled/header/StyledHeaderItem.js +46 -17
  26. package/dist/esm/styled/header/StyledHeaderItemIcon.js +13 -8
  27. package/dist/esm/styled/header/StyledHeaderItemText.js +6 -9
  28. package/dist/esm/styled/header/StyledHeaderItemWrapper.js +2 -5
  29. package/dist/esm/styled/header/StyledLogoHeaderItem.js +33 -24
  30. package/dist/esm/styled/nav/StyledBaseNavItem.js +12 -15
  31. package/dist/esm/styled/nav/StyledBrandmarkNavItem.js +2 -6
  32. package/dist/esm/styled/nav/StyledLogoNavItem.js +15 -25
  33. package/dist/esm/styled/nav/StyledNav.js +33 -16
  34. package/dist/esm/styled/nav/StyledNavButton.js +64 -38
  35. package/dist/esm/styled/nav/StyledNavItemIcon.js +12 -8
  36. package/dist/esm/styled/nav/StyledNavItemText.js +19 -17
  37. package/dist/esm/styled/nav/StyledNavList.js +2 -5
  38. package/dist/esm/styled/nav/StyledNavListItem.js +2 -5
  39. package/dist/esm/styled/sheet/StyledSheet.js +32 -20
  40. package/dist/esm/styled/sheet/StyledSheetBody.js +3 -6
  41. package/dist/esm/styled/sheet/StyledSheetClose.js +13 -19
  42. package/dist/esm/styled/sheet/StyledSheetDescription.js +6 -6
  43. package/dist/esm/styled/sheet/StyledSheetFooter.js +23 -7
  44. package/dist/esm/styled/sheet/StyledSheetFooterItem.js +2 -5
  45. package/dist/esm/styled/sheet/StyledSheetHeader.js +27 -8
  46. package/dist/esm/styled/sheet/StyledSheetTitle.js +6 -6
  47. package/dist/esm/styled/sheet/StyledSheetWrapper.js +22 -22
  48. package/dist/esm/styled/utils.js +20 -0
  49. package/dist/index.cjs.js +632 -483
  50. package/dist/typings/elements/footer/Footer.d.ts +1 -1
  51. package/dist/typings/elements/header/Header.d.ts +1 -1
  52. package/dist/typings/elements/header/HeaderItemIcon.d.ts +4 -1
  53. package/dist/typings/elements/nav/Nav.d.ts +1 -1
  54. package/dist/typings/elements/nav/NavItemIcon.d.ts +4 -1
  55. package/dist/typings/elements/sheet/Sheet.d.ts +3 -1
  56. package/dist/typings/styled/StyledSkipNav.d.ts +0 -3
  57. package/dist/typings/styled/StyledSkipNavIcon.d.ts +2 -2
  58. package/dist/typings/styled/body/StyledContent.d.ts +2 -1
  59. package/dist/typings/styled/footer/StyledFooter.d.ts +1 -2
  60. package/dist/typings/styled/header/StyledBaseHeaderItem.d.ts +1 -6
  61. package/dist/typings/styled/header/StyledHeader.d.ts +1 -2
  62. package/dist/typings/styled/header/StyledHeaderItem.d.ts +0 -3
  63. package/dist/typings/styled/header/StyledHeaderItemIcon.d.ts +2 -4
  64. package/dist/typings/styled/header/StyledHeaderItemText.d.ts +0 -1
  65. package/dist/typings/styled/header/StyledLogoHeaderItem.d.ts +2 -4
  66. package/dist/typings/styled/nav/StyledBaseNavItem.d.ts +1 -2
  67. package/dist/typings/styled/nav/StyledBrandmarkNavItem.d.ts +0 -3
  68. package/dist/typings/styled/nav/StyledLogoNavItem.d.ts +3 -7
  69. package/dist/typings/styled/nav/StyledNav.d.ts +2 -6
  70. package/dist/typings/styled/nav/StyledNavButton.d.ts +2 -13
  71. package/dist/typings/styled/nav/StyledNavItemIcon.d.ts +2 -4
  72. package/dist/typings/styled/nav/StyledNavItemText.d.ts +2 -1
  73. package/dist/typings/styled/sheet/StyledSheet.d.ts +1 -0
  74. package/dist/typings/styled/sheet/StyledSheetClose.d.ts +3 -8
  75. package/dist/typings/styled/sheet/StyledSheetDescription.d.ts +2 -3
  76. package/dist/typings/styled/sheet/StyledSheetFooter.d.ts +2 -2
  77. package/dist/typings/styled/sheet/StyledSheetFooterItem.d.ts +2 -3
  78. package/dist/typings/styled/sheet/StyledSheetHeader.d.ts +2 -6
  79. package/dist/typings/styled/sheet/StyledSheetTitle.d.ts +2 -3
  80. package/dist/typings/styled/sheet/StyledSheetWrapper.d.ts +2 -2
  81. package/dist/typings/styled/utils.d.ts +15 -0
  82. package/dist/typings/utils/useChromeContext.d.ts +0 -1
  83. package/dist/typings/utils/useSheetContext.d.ts +0 -1
  84. package/package.json +8 -8
  85. package/LICENSE.md +0 -176
@@ -8,7 +8,7 @@ import React__default, { useContext, useMemo, useEffect } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { ThemeContext } from 'styled-components';
10
10
  import { readableColor } from 'polished';
11
- import { getColorV8, useDocument } from '@zendeskgarden/react-theming';
11
+ import { DEFAULT_THEME, getColor, useDocument } from '@zendeskgarden/react-theming';
12
12
  import { ChromeContext } from '../utils/useChromeContext.js';
13
13
  import { StyledChrome } from '../styled/StyledChrome.js';
14
14
  import '../styled/StyledSkipNav.js';
@@ -50,22 +50,23 @@ const Chrome = React__default.forwardRef((_ref, ref) => {
50
50
  isFluid,
51
51
  ...props
52
52
  } = _ref;
53
- const theme = useContext(ThemeContext);
53
+ const theme = useContext(ThemeContext) || DEFAULT_THEME;
54
54
  const isLightMemoized = useMemo(() => {
55
55
  if (hue) {
56
- const backgroundColor = getColorV8(hue, 600, theme);
56
+ const backgroundColor = getColor({
57
+ theme,
58
+ hue
59
+ });
57
60
  const LIGHT_COLOR = 'white';
58
61
  return readableColor(backgroundColor, LIGHT_COLOR, undefined, false ) === LIGHT_COLOR;
59
62
  }
60
63
  return false;
61
64
  }, [hue, theme]);
62
- const isLight = hue ? isLightMemoized : false;
63
- const isDark = hue ? !isLightMemoized : false;
65
+ const isLight = hue ? isLightMemoized : undefined;
64
66
  const chromeContextValue = useMemo(() => ({
65
67
  hue: hue || 'chromeHue',
66
- isLight,
67
- isDark
68
- }), [hue, isLight, isDark]);
68
+ isLight
69
+ }), [hue, isLight]);
69
70
  const environment = useDocument(theme);
70
71
  useEffect(() => {
71
72
  if (environment && !isFluid) {
@@ -42,6 +42,6 @@ import '../../styled/sheet/StyledSheetHeader.js';
42
42
  const FooterItem = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooterItem, Object.assign({
43
43
  ref: ref
44
44
  }, props)));
45
- FooterItem.displayName = 'FooterItem';
45
+ FooterItem.displayName = 'Footer.Item';
46
46
 
47
47
  export { FooterItem };
@@ -57,7 +57,7 @@ const HeaderItem = React__default.forwardRef((_ref, ref) => {
57
57
  ref: ref
58
58
  }, other));
59
59
  });
60
- HeaderItem.displayName = 'HeaderItem';
60
+ HeaderItem.displayName = 'Header.Item';
61
61
  HeaderItem.propTypes = {
62
62
  maxX: PropTypes.bool,
63
63
  maxY: PropTypes.bool,
@@ -4,7 +4,7 @@
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 React__default, { Children, isValidElement, cloneElement } from 'react';
7
+ import React__default from 'react';
8
8
  import '../../styled/StyledChrome.js';
9
9
  import '../../styled/StyledSkipNav.js';
10
10
  import '../../styled/StyledSkipNavIcon.js';
@@ -44,23 +44,8 @@ const HeaderItemIcon = _ref => {
44
44
  children,
45
45
  ...props
46
46
  } = _ref;
47
- const element = Children.only(children);
48
- if ( isValidElement(element)) {
49
- const Icon = _ref2 => {
50
- let {
51
- theme,
52
- ...iconProps
53
- } = _ref2;
54
- return cloneElement(element, {
55
- ...props,
56
- ...iconProps
57
- });
58
- };
59
- return React__default.createElement(StyledHeaderItemIcon, Object.assign({
60
- as: Icon
61
- }, props));
62
- }
63
- return null;
47
+ return React__default.createElement(StyledHeaderItemIcon, props, children);
64
48
  };
49
+ HeaderItemIcon.displayName = 'Header.ItemIcon';
65
50
 
66
51
  export { HeaderItemIcon };
@@ -43,7 +43,7 @@ import '../../styled/sheet/StyledSheetHeader.js';
43
43
  const HeaderItemText = React__default.forwardRef((props, ref) => React__default.createElement(StyledHeaderItemText, Object.assign({
44
44
  ref: ref
45
45
  }, props)));
46
- HeaderItemText.displayName = 'HeaderItemText';
46
+ HeaderItemText.displayName = 'Header.ItemText';
47
47
  HeaderItemText.propTypes = {
48
48
  isClipped: PropTypes.bool
49
49
  };
@@ -42,6 +42,6 @@ import '../../styled/sheet/StyledSheetHeader.js';
42
42
  const HeaderItemWrapper = React__default.forwardRef((props, ref) => React__default.createElement(StyledHeaderItemWrapper, Object.assign({
43
43
  ref: ref
44
44
  }, props)));
45
- HeaderItemWrapper.displayName = 'HeaderItemWrapper';
45
+ HeaderItemWrapper.displayName = 'Header.ItemWrapper';
46
46
 
47
47
  export { HeaderItemWrapper };
@@ -5,6 +5,7 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import React__default, { useMemo } from 'react';
8
+ import { ThemeProvider } from 'styled-components';
8
9
  import PropTypes from 'prop-types';
9
10
  import { useChromeContext } from '../../utils/useChromeContext.js';
10
11
  import { NavContext } from '../../utils/useNavContext.js';
@@ -49,21 +50,26 @@ import { NavList } from './NavList.js';
49
50
  const NavComponent = React__default.forwardRef((props, ref) => {
50
51
  const {
51
52
  hue,
52
- isLight,
53
- isDark
53
+ isLight
54
54
  } = useChromeContext();
55
55
  const navContextValue = useMemo(() => ({
56
56
  isExpanded: !!props.isExpanded
57
57
  }), [props.isExpanded]);
58
- return React__default.createElement(NavContext.Provider, {
58
+ return React__default.createElement(ThemeProvider, {
59
+ theme: parentTheme => ({
60
+ ...parentTheme,
61
+ colors: {
62
+ ...parentTheme.colors,
63
+ base: isLight ? 'light' : 'dark'
64
+ }
65
+ })
66
+ }, React__default.createElement(NavContext.Provider, {
59
67
  value: navContextValue
60
68
  }, React__default.createElement(StyledNav, Object.assign({
61
69
  ref: ref
62
70
  }, props, {
63
- hue: hue,
64
- isLight: isLight,
65
- isDark: isDark
66
- })));
71
+ hue: hue
72
+ }))));
67
73
  });
68
74
  NavComponent.displayName = 'Nav';
69
75
  NavComponent.propTypes = {
@@ -49,27 +49,23 @@ const NavItem = React__default.forwardRef((_ref, ref) => {
49
49
  hasLogo,
50
50
  hasBrandmark,
51
51
  product,
52
+ isCurrent,
52
53
  ...other
53
54
  } = _ref;
54
55
  const {
55
- hue,
56
- isLight,
57
- isDark
56
+ hue
58
57
  } = useChromeContext();
59
58
  const {
60
59
  isExpanded
61
60
  } = useNavContext();
62
61
  const navListContext = useNavListContext();
63
- const ariaCurrent = other.isCurrent || undefined;
64
62
  const hasList = navListContext?.hasList;
65
63
  let retVal;
66
64
  if (hasLogo) {
67
65
  retVal = React__default.createElement(StyledLogoNavItem, Object.assign({
68
66
  ref: ref,
69
- isDark: isDark,
70
- isLight: isLight,
71
- product: product,
72
- "aria-current": ariaCurrent
67
+ hue: hue,
68
+ product: product
73
69
  }, other));
74
70
  } else if (hasBrandmark) {
75
71
  retVal = React__default.createElement(StyledBrandmarkNavItem, Object.assign({
@@ -81,9 +77,7 @@ const NavItem = React__default.forwardRef((_ref, ref) => {
81
77
  ref: ref,
82
78
  isExpanded: isExpanded,
83
79
  hue: hue,
84
- isDark: isDark,
85
- isLight: isLight,
86
- "aria-current": ariaCurrent
80
+ "aria-current": isCurrent || undefined
87
81
  }, other));
88
82
  }
89
83
  if (hasList) {
@@ -91,7 +85,7 @@ const NavItem = React__default.forwardRef((_ref, ref) => {
91
85
  }
92
86
  return retVal;
93
87
  });
94
- NavItem.displayName = 'NavItem';
88
+ NavItem.displayName = 'Nav.Item';
95
89
  NavItem.propTypes = {
96
90
  product: PropTypes.oneOf(PRODUCTS),
97
91
  hasLogo: PropTypes.bool,
@@ -4,7 +4,7 @@
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 React__default, { Children, isValidElement, cloneElement } from 'react';
7
+ import React__default from 'react';
8
8
  import '../../styled/StyledChrome.js';
9
9
  import '../../styled/StyledSkipNav.js';
10
10
  import '../../styled/StyledSkipNavIcon.js';
@@ -44,23 +44,8 @@ const NavItemIcon = _ref => {
44
44
  children,
45
45
  ...props
46
46
  } = _ref;
47
- const element = Children.only(children);
48
- if ( isValidElement(element)) {
49
- const Icon = _ref2 => {
50
- let {
51
- theme,
52
- ...iconProps
53
- } = _ref2;
54
- return cloneElement(element, {
55
- ...props,
56
- ...iconProps
57
- });
58
- };
59
- return React__default.createElement(StyledNavItemIcon, Object.assign({
60
- as: Icon
61
- }, props));
62
- }
63
- return null;
47
+ return React__default.createElement(StyledNavItemIcon, props, children);
64
48
  };
49
+ NavItemIcon.displayName = 'Nav.ItemIcon';
65
50
 
66
51
  export { NavItemIcon };
@@ -50,7 +50,7 @@ const NavItemText = React__default.forwardRef((props, ref) => {
50
50
  isExpanded: isExpanded
51
51
  }, props));
52
52
  });
53
- NavItemText.displayName = 'NavItemText';
53
+ NavItemText.displayName = 'Nav.ItemText';
54
54
  NavItemText.propTypes = {
55
55
  isWrapped: PropTypes.bool
56
56
  };
@@ -50,6 +50,6 @@ const NavList = React__default.forwardRef((props, ref) => {
50
50
  ref: ref
51
51
  }, props)));
52
52
  });
53
- NavList.displayName = 'Nav';
53
+ NavList.displayName = 'Nav.List';
54
54
 
55
55
  export { NavList };
@@ -67,7 +67,7 @@ const SheetComponent = React__default.forwardRef((_ref, ref) => {
67
67
  const sheetRef = useRef(null);
68
68
  const seed = useUIDSeed();
69
69
  const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
70
- const idPrefix = useMemo(() => id || seed(`sheet_${'9.0.0-next.9'}`), [id, seed]);
70
+ const idPrefix = useMemo(() => id || seed(`sheet_${'9.0.0'}`), [id, seed]);
71
71
  const titleId = `${idPrefix}--title`;
72
72
  const descriptionId = `${idPrefix}--description`;
73
73
  const sheetContext = useMemo(() => ({
@@ -85,6 +85,7 @@ const SheetComponent = React__default.forwardRef((_ref, ref) => {
85
85
  return React__default.createElement(SheetContext.Provider, {
86
86
  value: sheetContext
87
87
  }, React__default.createElement(StyledSheet, Object.assign({
88
+ inert: isOpen ? undefined : '',
88
89
  isOpen: isOpen,
89
90
  isAnimated: isAnimated,
90
91
  placement: placement,
@@ -7,7 +7,7 @@
7
7
  import * as React from 'react';
8
8
 
9
9
  var _path;
10
- 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); }
10
+ 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); }
11
11
  var SvgLinkStroke = function SvgLinkStroke(props) {
12
12
  return /*#__PURE__*/React.createElement("svg", _extends({
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -7,7 +7,7 @@
7
7
  import * as React from 'react';
8
8
 
9
9
  var _path;
10
- 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); }
10
+ 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); }
11
11
  var SvgXStroke = function SvgXStroke(props) {
12
12
  return /*#__PURE__*/React.createElement("svg", _extends({
13
13
  xmlns: "http://www.w3.org/2000/svg",
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.chrome';
11
11
  const StyledChrome = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.0.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledChrome",
16
16
  componentId: "sc-1uqm6u6-0"
17
17
  })(["display:flex;position:relative;margin:0;height:100vh;overflow-y:hidden;font-family:", ";direction:", ";", ";"], props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledChrome.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledChrome };
@@ -6,41 +6,59 @@
6
6
  */
7
7
  import styled, { keyframes, css } from 'styled-components';
8
8
  import { math } from 'polished';
9
- import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
10
- import { getHeaderHeight } from './header/StyledHeader.js';
9
+ import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
10
+ import { getHeaderHeight } from './utils.js';
11
11
 
12
12
  const COMPONENT_ID = 'chrome.skipnav';
13
13
  const animationStyles = () => {
14
14
  const animationName = keyframes(["0%{transform:translate(-50%,-50%);}"]);
15
15
  return css(["transition:opacity 0.2s ease-out,clip 0s linear 0.2s;opacity:0;clip:rect(0,0,0,0);&:focus{transition:opacity 0.2s ease-in-out;animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";opacity:1;clip:rect(0,150vw,100vh,-50vw);}"], animationName);
16
16
  };
17
- const colorStyles = theme => {
18
- const color = getColorV8('primaryHue', 600, theme);
19
- const borderColor = getColorV8('neutralHue', 300, theme);
20
- const boxShadow = theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7}px`, getColorV8('chromeHue', 600, theme, 0.15));
21
- return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover,&:focus{color:", ";}", ""], borderColor, boxShadow, getColorV8('background', 600 , theme), color, color, focusStyles({
17
+ const colorStyles = _ref => {
18
+ let {
19
+ theme
20
+ } = _ref;
21
+ const backgroundColor = getColor({
22
+ theme,
23
+ variable: 'background.raised'
24
+ });
25
+ const borderColor = getColor({
26
+ theme,
27
+ variable: 'border.default'
28
+ });
29
+ const boxShadowColor = getColor({
30
+ variable: 'shadow.medium',
31
+ theme
32
+ });
33
+ const boxShadow = theme.shadows.lg(`${theme.space.base * 4}px`, `${theme.space.base * 6}px`, boxShadowColor);
34
+ const foregroundColor = getColor({
35
+ theme,
36
+ variable: 'foreground.primary'
37
+ });
38
+ return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover,&:focus{color:", ";}", ""], borderColor, boxShadow, backgroundColor, foregroundColor, foregroundColor, focusStyles({
22
39
  theme,
23
40
  inset: true,
24
41
  boxShadow
25
42
  }));
26
43
  };
27
- const sizeStyles = props => {
28
- const top = math(`${getHeaderHeight(props)} / 2`);
29
- const padding = `${props.theme.space.base * 5}px`;
30
- const paddingStart = `${props.theme.space.base * 4}px`;
31
- const fontSize = props.theme.fontSizes.md;
44
+ const sizeStyles = _ref2 => {
45
+ let {
46
+ theme
47
+ } = _ref2;
48
+ const top = math(`${getHeaderHeight(theme)} / 2`);
49
+ const border = theme.borders.sm;
50
+ const padding = `${theme.space.base * 5}px`;
51
+ const paddingStart = `${theme.space.base * 4}px`;
52
+ const fontSize = theme.fontSizes.md;
32
53
  const lineHeight = getLineHeight(padding, fontSize);
33
- return css(["top:", ";padding:", ";padding-", ":", ";line-height:", ";font-size:", ";"], top, padding, props.theme.rtl ? 'right' : 'left', paddingStart, lineHeight, fontSize);
54
+ return css(["top:", ";border:", ";padding:", ";padding-", ":", ";line-height:", ";font-size:", ";"], top, border, padding, theme.rtl ? 'right' : 'left', paddingStart, lineHeight, fontSize);
34
55
  };
35
56
  const StyledSkipNav = styled.a.attrs({
36
57
  'data-garden-id': COMPONENT_ID,
37
- 'data-garden-version': '9.0.0-next.9'
58
+ 'data-garden-version': '9.0.0'
38
59
  }).withConfig({
39
60
  displayName: "StyledSkipNav",
40
61
  componentId: "sc-1tsro34-0"
41
- })(["", ";display:inline-flex;position:absolute;left:50%;align-items:center;justify-content:center;transform:translateX(-50%);direction:", ";z-index:", ";border:", ";border-radius:", ";text-decoration:underline;white-space:nowrap;", ";", "{text-decoration:none;}&:hover{text-decoration:underline;}", ";", ";"], animationStyles(), props => props.theme.rtl && 'rtl', props => props.zIndex, props => props.theme.borders.sm, props => props.theme.borderRadii.md, props => sizeStyles(props), SELECTOR_FOCUS_VISIBLE, props => colorStyles(props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
42
- StyledSkipNav.defaultProps = {
43
- theme: DEFAULT_THEME
44
- };
62
+ })(["", ";display:inline-flex;position:absolute;left:50%;align-items:center;justify-content:center;transform:translateX(-50%);direction:", ";z-index:", ";border-radius:", ";text-decoration:underline;white-space:nowrap;", ";", "{text-decoration:none;}&:hover{text-decoration:underline;}", ";", ";"], animationStyles(), props => props.theme.rtl && 'rtl', props => props.zIndex, props => props.theme.borderRadii.md, sizeStyles, SELECTOR_FOCUS_VISIBLE, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
45
63
 
46
64
  export { StyledSkipNav };
@@ -6,23 +6,26 @@
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
8
  import SvgLinkStroke from '../node_modules/@zendeskgarden/svg-icons/src/16/link-stroke.svg.js';
9
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
10
10
 
11
11
  const COMPONENT_ID = 'chrome.skipnav_icon';
12
- const sizeStyles = theme => {
12
+ const sizeStyles = _ref => {
13
+ let {
14
+ theme
15
+ } = _ref;
13
16
  const margin = `${theme.space.base * 2}px`;
14
17
  const size = theme.iconSizes.md;
15
18
  return css(["margin-", ":", ";width:", ";height:", ";"], theme.rtl ? 'left' : 'right', margin, size, size);
16
19
  };
17
20
  const StyledSkipNavIcon = styled(SvgLinkStroke).attrs({
18
21
  'data-garden-id': COMPONENT_ID,
19
- 'data-garden-version': '9.0.0-next.9'
22
+ 'data-garden-version': '9.0.0'
20
23
  }).withConfig({
21
24
  displayName: "StyledSkipNavIcon",
22
25
  componentId: "sc-1ika5z4-0"
23
- })(["transform:", ";color:", ";", ";", ";"], props => props.theme.rtl && 'scaleX(-1)', props => getColorV8('neutralHue', 600, props.theme), props => sizeStyles(props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
24
- StyledSkipNavIcon.defaultProps = {
25
- theme: DEFAULT_THEME
26
- };
26
+ })(["transform:", ";color:", ";", ";", ";"], p => p.theme.rtl && 'scaleX(-1)', p => getColor({
27
+ theme: p.theme,
28
+ variable: 'foreground.subtle'
29
+ }), sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
27
30
 
28
31
  export { StyledSkipNavIcon };
@@ -5,18 +5,18 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.body';
11
11
  const StyledBody = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.0.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledBody",
16
16
  componentId: "sc-c7h9kv-0"
17
- })(["flex:1;order:1;background-color:", ";min-width:0;", ";"], props => getColorV8('neutralHue', 100, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledBody.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
17
+ })(["flex:1;order:1;background-color:", ";min-width:0;", ";"], props => getColor({
18
+ theme: props.theme,
19
+ variable: 'background.default'
20
+ }), props => retrieveComponentStyles(COMPONENT_ID, props));
21
21
 
22
22
  export { StyledBody };
@@ -4,22 +4,31 @@
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';
7
+ import styled, { css } from 'styled-components';
8
8
  import { math } from 'polished';
9
- import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
10
- import { getHeaderHeight } from '../header/StyledHeader.js';
11
- import { getFooterHeight } from '../footer/StyledFooter.js';
9
+ import { getColor, retrieveComponentStyles, getLineHeight } from '@zendeskgarden/react-theming';
10
+ import { getHeaderHeight, getFooterHeight } from '../utils.js';
12
11
 
13
12
  const COMPONENT_ID = 'chrome.content';
13
+ const sizeStyles = _ref => {
14
+ let {
15
+ theme,
16
+ hasFooter
17
+ } = _ref;
18
+ const fontSize = theme.fontSizes.md;
19
+ const height = hasFooter ? `calc(100% - ${math(`${getHeaderHeight(theme)} + ${getFooterHeight(theme)}`)})` : `calc(100% - ${getHeaderHeight(theme)})`;
20
+ const lineHeight = getLineHeight(theme.lineHeights.md, theme.fontSizes.md);
21
+ return css(["height:", ";line-height:", ";font-size:", ";"], height, lineHeight, fontSize);
22
+ };
14
23
  const StyledContent = styled.div.attrs({
15
24
  'data-garden-id': COMPONENT_ID,
16
- 'data-garden-version': '9.0.0-next.9'
25
+ 'data-garden-version': '9.0.0'
17
26
  }).withConfig({
18
27
  displayName: "StyledContent",
19
28
  componentId: "sc-qcuzxn-0"
20
- })(["display:flex;height:", ";line-height:", ";color:", ";font-size:", ";&:focus{outline:none;}", ";"], props => props.hasFooter ? `calc(100% - ${math(`${getHeaderHeight(props)} + ${getFooterHeight(props)}`)})` : `calc(100% - ${getHeaderHeight(props)})`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID, props));
21
- StyledContent.defaultProps = {
22
- theme: DEFAULT_THEME
23
- };
29
+ })(["display:flex;color-scheme:only ", ";color:", ";", ";&:focus{outline:none;}", ";"], p => p.theme.colors.base, props => getColor({
30
+ theme: props.theme,
31
+ variable: 'foreground.default'
32
+ }), sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
24
33
 
25
34
  export { StyledContent };
@@ -5,18 +5,18 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.main';
11
11
  const StyledMain = styled.main.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.0.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledMain",
16
16
  componentId: "sc-t61cre-0"
17
- })(["flex:1;order:1;background-color:", ";overflow:auto;:focus{outline:none;}", ";"], props => getColorV8('background', 600 , props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledMain.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
17
+ })(["flex:1;order:1;background-color:", ";overflow:auto;:focus{outline:none;}", ";"], props => getColor({
18
+ theme: props.theme,
19
+ variable: 'background.default'
20
+ }), props => retrieveComponentStyles(COMPONENT_ID, props));
21
21
 
22
22
  export { StyledMain };
@@ -4,22 +4,40 @@
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, getColor } from '@zendeskgarden/react-theming';
9
+ import { getFooterHeight } from '../utils.js';
9
10
 
10
11
  const COMPONENT_ID = 'chrome.footer';
11
- const getFooterHeight = props => {
12
- return `${props.theme.space.base * 20}px`;
12
+ const colorStyles = _ref => {
13
+ let {
14
+ theme
15
+ } = _ref;
16
+ const backgroundColor = getColor({
17
+ theme,
18
+ variable: 'background.default'
19
+ });
20
+ const borderColor = getColor({
21
+ theme,
22
+ variable: 'border.default'
23
+ });
24
+ return css(["border-top-color:", ";background-color:", ";"], borderColor, backgroundColor);
25
+ };
26
+ const sizeStyles = _ref2 => {
27
+ let {
28
+ theme
29
+ } = _ref2;
30
+ const border = theme.borders.sm;
31
+ const padding = `0 ${theme.space.base * 9}px`;
32
+ const height = getFooterHeight(theme);
33
+ return css(["box-sizing:border-box;border-top:", ";padding:", ";height:", ";"], border, padding, height);
13
34
  };
14
35
  const StyledFooter = styled.footer.attrs({
15
36
  'data-garden-id': COMPONENT_ID,
16
- 'data-garden-version': '9.0.0-next.9'
37
+ 'data-garden-version': '9.0.0'
17
38
  }).withConfig({
18
39
  displayName: "StyledFooter",
19
40
  componentId: "sc-v7lib2-0"
20
- })(["display:flex;align-items:center;justify-content:flex-end;box-sizing:border-box;border-top:", ";background-color:", ";padding:0 ", "px;height:", ";", ";"], props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 300, props.theme)}`, props => getColorV8('background', 600 , props.theme), props => props.theme.space.base * 9, getFooterHeight, props => retrieveComponentStyles(COMPONENT_ID, props));
21
- StyledFooter.defaultProps = {
22
- theme: DEFAULT_THEME
23
- };
41
+ })(["display:flex;align-items:center;justify-content:flex-end;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
24
42
 
25
- export { StyledFooter, getFooterHeight };
43
+ export { StyledFooter };
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.footer_item';
11
11
  const StyledFooterItem = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.0.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledFooterItem",
16
16
  componentId: "sc-1cktm85-0"
17
17
  })(["margin:", ";", ";"], props => `0 ${props.theme.space.base}px`, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledFooterItem.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledFooterItem };