@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
@@ -5,61 +5,87 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import { math, rgba } from 'polished';
9
- import { SELECTOR_FOCUS_VISIBLE, retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles } from '@zendeskgarden/react-theming';
8
+ import { math } from 'polished';
9
+ import { retrieveComponentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
10
10
  import { StyledBaseNavItem } from './StyledBaseNavItem.js';
11
11
  import { StyledNavItemIcon } from './StyledNavItemIcon.js';
12
- import { getNavWidth } from './StyledNav.js';
12
+ import { getNavWidth } from '../utils.js';
13
13
 
14
14
  const COMPONENT_ID = 'chrome.nav_button';
15
- const colorStyles = props => {
16
- const {
15
+ const colorStyles = _ref => {
16
+ let {
17
+ theme,
18
+ hue
19
+ } = _ref;
20
+ const activeBackgroundColor = getColor({
21
+ theme,
22
+ dark: {
23
+ hue: 'white'
24
+ },
25
+ light: {
26
+ hue: 'black'
27
+ },
28
+ transparency: theme.opacity[100]
29
+ });
30
+ const currentBackgroundColor = hue === 'chromeHue' ? getColor({
17
31
  theme,
18
32
  hue,
19
- isLight,
20
- isDark,
21
- isCurrent
22
- } = props;
23
- const DARK = theme.palette.black;
24
- const LIGHT = theme.palette.white;
25
- let currentColor;
26
- let hoverColor;
27
- if (isCurrent) {
28
- if (isLight) {
29
- currentColor = rgba(DARK, 0.4);
30
- } else if (isDark) {
31
- currentColor = rgba(LIGHT, 0.4);
32
- } else {
33
- currentColor = getColorV8(hue, 500, theme);
33
+ shade: 700
34
+ }) : getColor({
35
+ theme,
36
+ dark: {
37
+ hue: 'white'
38
+ },
39
+ light: {
40
+ hue: 'black'
41
+ },
42
+ transparency: theme.opacity[500]
43
+ });
44
+ const focusOutlineColor = getColor({
45
+ theme,
46
+ dark: {
47
+ hue: 'white'
48
+ },
49
+ light: {
50
+ hue: 'black'
34
51
  }
35
- } else {
36
- hoverColor = rgba(isLight ? LIGHT : DARK, 0.1);
37
- }
38
- const activeColor = rgba(isLight ? DARK : LIGHT, 0.1);
39
- const focusColor = isLight ? DARK : LIGHT;
40
- return css(["opacity:", ";outline-color:transparent;background-color:", ";&:hover{opacity:1;background-color:", ";}", " &:active{background-color:", ";}"], isCurrent ? 1 : 0.6, currentColor, hoverColor, focusStyles({
52
+ });
53
+ const focusOutlineOffset = `-${theme.borderWidths.md}`;
54
+ const hoverBackgroundColor = getColor({
55
+ theme,
56
+ dark: {
57
+ hue: 'black'
58
+ },
59
+ light: {
60
+ hue: 'white'
61
+ },
62
+ transparency: theme.opacity[100]
63
+ });
64
+ return css(["opacity:", ";outline-color:transparent;background-color:transparent;color:inherit;&:hover{opacity:1;background-color:", ";}&:hover,&:focus{color:inherit;}", " &:active{background-color:", ";}&[aria-current='true']{opacity:1;background-color:", ";}"], theme.opacity[700], hoverBackgroundColor, focusStyles({
41
65
  theme,
42
- condition: false ,
66
+ condition: false,
43
67
  styles: {
44
68
  opacity: 1,
45
- outlineColor: focusColor
69
+ outlineColor: focusOutlineColor,
70
+ outlineOffset: focusOutlineOffset
46
71
  }
47
- }), activeColor);
72
+ }), activeBackgroundColor, currentBackgroundColor);
73
+ };
74
+ const sizeStyles = _ref2 => {
75
+ let {
76
+ theme,
77
+ isExpanded
78
+ } = _ref2;
79
+ const iconMargin = isExpanded ? `0 ${math(`(${getNavWidth(theme)} - ${theme.iconSizes.lg}) / 4`)}` : undefined;
80
+ return css(["margin:0;border:none;box-sizing:border-box;min-width:0;font-size:inherit;", "{margin:", ";}"], StyledNavItemIcon, iconMargin);
48
81
  };
49
82
  const StyledNavButton = styled(StyledBaseNavItem).attrs({
50
83
  'data-garden-id': COMPONENT_ID,
51
- 'data-garden-version': '9.0.0-next.9',
84
+ 'data-garden-version': '9.0.0',
52
85
  as: 'button'
53
86
  }).withConfig({
54
87
  displayName: "StyledNavButton",
55
88
  componentId: "sc-f5ux3-0"
56
- })(["flex:1;justify-content:", ";margin:0;border:none;box-sizing:border-box;background:transparent;cursor:", ";min-width:0;text-align:", ";text-decoration:none;color:inherit;font-size:inherit;&:hover,&:focus{text-decoration:none;color:inherit;}", ";&:focus-visible:hover,&:focus-visible:active,", "{outline:", " solid;outline-offset:-", ";}", " ", ";"], props => props.isExpanded && 'start', props => props.isCurrent ? 'default' : 'pointer', props => props.isExpanded && 'inherit', colorStyles, SELECTOR_FOCUS_VISIBLE, props => math(`${props.theme.borderWidths.md} - 1`), props => props.theme.borderWidths.md, props => props.isExpanded && `
57
- ${StyledNavItemIcon} {
58
- margin: 0 ${math(`(${getNavWidth(props)} - ${props.theme.iconSizes.lg}) / 4`)};
59
- }
60
- `, props => retrieveComponentStyles(COMPONENT_ID, props));
61
- StyledNavButton.defaultProps = {
62
- theme: DEFAULT_THEME
63
- };
89
+ })(["flex:1;justify-content:", ";cursor:pointer;text-align:", ";text-decoration:none;", ";&:hover,&:focus{text-decoration:none;}&[aria-current='true']{cursor:default;}", ";", ";"], props => props.isExpanded && 'start', props => props.isExpanded && 'inherit', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
64
90
 
65
91
  export { StyledNavButton };
@@ -4,19 +4,23 @@
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 { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { StyledBaseIcon, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.nav_item_icon';
11
- const StyledNavItemIcon = styled.div.attrs({
11
+ const sizeStyles = _ref => {
12
+ let {
13
+ theme
14
+ } = _ref;
15
+ const size = theme.iconSizes.lg;
16
+ return css(["width:", ";height:", ";"], size, size);
17
+ };
18
+ const StyledNavItemIcon = styled(StyledBaseIcon).attrs({
12
19
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
20
+ 'data-garden-version': '9.0.0'
14
21
  }).withConfig({
15
22
  displayName: "StyledNavItemIcon",
16
23
  componentId: "sc-7w9rpt-0"
17
- })(["align-self:flex-start;order:0;border-radius:", ";width:", ";height:", ";", ";"], props => props.theme.borderRadii.md, props => props.theme.iconSizes.lg, props => props.theme.iconSizes.lg, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledNavItemIcon.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
24
+ })(["align-self:flex-start;order:0;border-radius:", ";", ";", ";"], props => props.theme.borderRadii.md, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
21
25
 
22
26
  export { StyledNavItemIcon };
@@ -4,31 +4,33 @@
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, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { retrieveComponentStyles, getLineHeight } from '@zendeskgarden/react-theming';
10
10
  import { StyledNavButton } from './StyledNavButton.js';
11
- import { getNavWidth } from './StyledNav.js';
11
+ import { getNavWidth } from '../utils.js';
12
12
 
13
13
  const COMPONENT_ID = 'chrome.nav_item_text';
14
+ const sizeStyles = _ref => {
15
+ let {
16
+ theme,
17
+ isExpanded,
18
+ isWrapped
19
+ } = _ref;
20
+ const clip = isExpanded ? 'auto' : undefined;
21
+ const lineHeight = getLineHeight(theme.space.base * 5, theme.fontSizes.md);
22
+ const margin = isExpanded ? `0 ${math(`(${getNavWidth(theme)} - ${theme.iconSizes.lg}) / 4`)}` : undefined;
23
+ const width = isExpanded ? 'auto' : undefined;
24
+ const height = isExpanded ? 'auto' : undefined;
25
+ const whiteSpace = isWrapped ? undefined : 'nowrap';
26
+ return css(["clip:rect(1px,1px,1px,1px);margin:", ";width:1px;height:1px;line-height:", ";white-space:", ";", " > &&{clip:", ";width:", ";height:", ";}"], margin, lineHeight, whiteSpace, StyledNavButton, clip, width, height);
27
+ };
14
28
  const StyledNavItemText = styled.span.attrs({
15
29
  'data-garden-id': COMPONENT_ID,
16
- 'data-garden-version': '9.0.0-next.9'
30
+ 'data-garden-version': '9.0.0'
17
31
  }).withConfig({
18
32
  displayName: "StyledNavItemText",
19
33
  componentId: "sc-13m84xl-0"
20
- })(["position:absolute;order:1;clip:rect(1px,1px,1px,1px);margin:", ";width:1px;height:1px;overflow:hidden;line-height:", ";white-space:", ";", " ", ";"], props => props.isExpanded && `0 ${math(`(${getNavWidth(props)} - ${props.theme.iconSizes.lg}) / 4`)}`, props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.isWrapped ? 'normal' : 'nowrap', props => props.isExpanded && `
21
- ${StyledNavButton} > && {
22
- position: static;
23
- flex: 1;
24
- clip: auto;
25
- width: auto;
26
- height: auto;
27
- text-overflow: ellipsis;
28
- }
29
- `, props => retrieveComponentStyles(COMPONENT_ID, props));
30
- StyledNavItemText.defaultProps = {
31
- theme: DEFAULT_THEME
32
- };
34
+ })(["position:absolute;order:1;overflow:hidden;", " > &&{position:", ";flex:", ";text-overflow:", ";}", ";", ";"], StyledNavButton, props => props.isExpanded ? 'static' : undefined, props => props.isExpanded ? 1 : undefined, props => props.isExpanded ? 'ellipsis' : undefined, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
33
35
 
34
36
  export { StyledNavItemText };
@@ -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.nav_list';
11
11
  const StyledNavList = styled.ul.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: "StyledNavList",
16
16
  componentId: "sc-1s0nkfb-0"
17
17
  })(["display:flex;flex:1;flex-direction:column;order:0;margin:0;padding:0;list-style:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledNavList.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledNavList };
@@ -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.nav_list_item';
11
11
  const StyledNavListItem = styled.li.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: "StyledNavListItem",
16
16
  componentId: "sc-18cj2v7-0"
17
17
  })(["display:flex;order:1;margin:0;padding:0;list-style-type:none;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledNavListItem.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledNavListItem };
@@ -4,38 +4,50 @@
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, getLineHeight } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.sheet';
11
- const borderStyle = _ref => {
11
+ const colorStyles = _ref => {
12
12
  let {
13
13
  theme,
14
- placement,
15
14
  isOpen
16
15
  } = _ref;
17
- const borderColor = isOpen ? getColorV8('neutralHue', 300, theme) : 'transparent';
18
- const borderSides = ['-left', '-right'];
19
- let borderSide = '';
20
- if (theme.rtl) {
21
- borderSides.reverse();
22
- }
23
- if (placement === 'end') {
24
- borderSide = borderSides[0];
25
- } else if (placement === 'start') {
26
- borderSide = borderSides[1];
16
+ const backgroundColor = getColor({
17
+ theme,
18
+ variable: 'background.default'
19
+ });
20
+ const borderColor = isOpen ? getColor({
21
+ theme,
22
+ variable: 'border.default'
23
+ }) : 'transparent';
24
+ return css(["border-color:", ";background-color:", ";"], borderColor, backgroundColor);
25
+ };
26
+ const sizeStyles = _ref2 => {
27
+ let {
28
+ theme,
29
+ isOpen,
30
+ placement,
31
+ size
32
+ } = _ref2;
33
+ const width = isOpen ? size : 0;
34
+ const fontSize = theme.fontSizes.md;
35
+ const lineHeight = getLineHeight(theme.space.base * 5, fontSize);
36
+ const border = isOpen ? theme.borders.sm : 'none';
37
+ let borderProperty;
38
+ if (placement === 'start') {
39
+ borderProperty = `border-${theme.rtl ? 'left' : 'right'}`;
40
+ } else {
41
+ borderProperty = `border-${theme.rtl ? 'right' : 'left'}`;
27
42
  }
28
- return `border${borderSide}: ${theme.borders.sm} ${borderColor};`;
43
+ return css(["box-sizing:border-box;width:", ";height:100%;", ":", ";line-height:", ";font-size:", ";"], width, borderProperty, border, lineHeight, fontSize);
29
44
  };
30
45
  const StyledSheet = styled.aside.attrs({
31
46
  'data-garden-id': COMPONENT_ID,
32
- 'data-garden-version': '9.0.0-next.9'
47
+ 'data-garden-version': '9.0.0'
33
48
  }).withConfig({
34
49
  displayName: "StyledSheet",
35
50
  componentId: "sc-dx8ijk-0"
36
- })(["display:flex;order:1;transition:", ";background-color:", ";width:", ";height:100%;overflow:hidden;font-size:", ";&:focus{outline:none;}", ";", ";"], props => props.isAnimated && 'width 250ms ease-in-out', props => getColorV8('background', 600 , props.theme), props => props.isOpen ? props.size : '0px', props => props.theme.fontSizes.md, props => borderStyle(props), props => retrieveComponentStyles(COMPONENT_ID, props));
37
- StyledSheet.defaultProps = {
38
- theme: DEFAULT_THEME
39
- };
51
+ })(["display:flex;order:1;transition:", ";overflow:hidden;", ";&:focus{outline:none;}", ";", ";"], props => props.isAnimated && 'width 250ms ease-in-out', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
40
52
 
41
53
  export { StyledSheet };
@@ -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.sheet_body';
11
11
  const StyledSheetBody = 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: "StyledSheetBody",
16
16
  componentId: "sc-bt4eoj-0"
17
- })(["flex:1;overflow-y:auto;padding:", "px;", ";"], props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledSheetBody.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
17
+ })(["flex:1;overflow-y:auto;padding:", "px;color-scheme:only ", ";", ";"], props => props.theme.space.base * 5, p => p.theme.colors.base, props => retrieveComponentStyles(COMPONENT_ID, props));
21
18
 
22
19
  export { StyledSheetBody };
@@ -5,30 +5,24 @@
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, focusStyles } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
+ import { IconButton } from '@zendeskgarden/react-buttons';
9
10
 
10
11
  const COMPONENT_ID = 'chrome.sheet_close';
11
- const BASE_MULTIPLIERS = {
12
- top: 2.5,
13
- side: 2,
14
- size: 10
12
+ const positionStyles = _ref => {
13
+ let {
14
+ theme
15
+ } = _ref;
16
+ const top = `${theme.space.base * 2.5}px`;
17
+ const position = `${theme.space.base * 2}px`;
18
+ return css(["top:", ";", ":", ";"], top, theme.rtl ? 'left' : 'right', position);
15
19
  };
16
- const colorStyles = props => {
17
- const backgroundColor = 'primaryHue';
18
- const foregroundColor = 'neutralHue';
19
- return css(["background-color:transparent;color:", ";&:hover{background-color:", ";color:", ";}", " &:active{transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;background-color:", ";color:", ";}"], getColorV8(foregroundColor, 600, props.theme), getColorV8(backgroundColor, 600, props.theme, 0.08), getColorV8(foregroundColor, 700, props.theme), focusStyles({
20
- theme: props.theme
21
- }), getColorV8(backgroundColor, 600, props.theme, 0.2), getColorV8(foregroundColor, 800, props.theme));
22
- };
23
- const StyledSheetClose = styled.button.attrs({
20
+ const StyledSheetClose = styled(IconButton).attrs({
24
21
  'data-garden-id': COMPONENT_ID,
25
- 'data-garden-version': '9.0.0-next.9'
22
+ 'data-garden-version': '9.0.0'
26
23
  }).withConfig({
27
24
  displayName: "StyledSheetClose",
28
25
  componentId: "sc-1ab02oq-0"
29
- })(["display:flex;position:absolute;top:", "px;", ":", ";align-items:center;justify-content:center;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:none;border-radius:50%;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;text-decoration:none;font-size:0;user-select:none;&::-moz-focus-inner{border:0;}", ";& > svg{vertical-align:middle;}", ";"], props => props.theme.space.base * BASE_MULTIPLIERS.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => props.theme.space.base * BASE_MULTIPLIERS.size, props => props.theme.space.base * BASE_MULTIPLIERS.size, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
30
- StyledSheetClose.defaultProps = {
31
- theme: DEFAULT_THEME
32
- };
26
+ })(["position:absolute;", ";", ";"], positionStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
33
27
 
34
- export { BASE_MULTIPLIERS, StyledSheetClose };
28
+ export { StyledSheetClose };
@@ -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 { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { getLineHeight, getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.sheet_description';
11
11
  const StyledSheetDescription = 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: "StyledSheetDescription",
16
16
  componentId: "sc-1puglb6-0"
17
- })(["line-height:", ";color:", ";", ";"], props => getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.md), props => getColorV8('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledSheetDescription.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
17
+ })(["line-height:", ";color:", ";", ";"], p => getLineHeight(p.theme.space.base * 4, p.theme.fontSizes.md), p => getColor({
18
+ theme: p.theme,
19
+ variable: 'foreground.subtle'
20
+ }), props => retrieveComponentStyles(COMPONENT_ID, props));
21
21
 
22
22
  export { StyledSheetDescription };
@@ -4,19 +4,35 @@
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
9
 
10
10
  const COMPONENT_ID = 'chrome.sheet_footer';
11
+ const colorStyles = _ref => {
12
+ let {
13
+ theme
14
+ } = _ref;
15
+ const borderColor = getColor({
16
+ theme,
17
+ variable: 'border.subtle'
18
+ });
19
+ return css(["border-top-color:", ";"], borderColor);
20
+ };
21
+ const sizeStyles = _ref2 => {
22
+ let {
23
+ theme,
24
+ isCompact
25
+ } = _ref2;
26
+ const border = theme.borders.sm;
27
+ const padding = `${theme.space.base * (isCompact ? 2.5 : 5)}px`;
28
+ return css(["border-top:", ";padding:", ";"], border, padding);
29
+ };
11
30
  const StyledSheetFooter = styled.footer.attrs({
12
31
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
32
+ 'data-garden-version': '9.0.0'
14
33
  }).withConfig({
15
34
  displayName: "StyledSheetFooter",
16
35
  componentId: "sc-2cktos-0"
17
- })(["display:flex;flex-flow:row wrap;align-items:center;justify-content:", ";border-top:", ";padding:", "px;", ";"], props => props.isCompact ? 'center' : 'flex-end', props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 300, props.theme)}}`, props => props.theme.space.base * (props.isCompact ? 2.5 : 5), props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledSheetFooter.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
36
+ })(["display:flex;flex-flow:row wrap;align-items:center;justify-content:", ";", ";", ";", ";"], props => props.isCompact ? 'center' : 'flex-end', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
21
37
 
22
38
  export { StyledSheetFooter };
@@ -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.sheet_footer_item';
11
11
  const StyledSheetFooterItem = 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: "StyledSheetFooterItem",
16
16
  componentId: "sc-r9ixh-0"
17
17
  })(["", " ", ";"], props => `margin-${props.theme.rtl ? 'right' : 'left'}: ${props.theme.space.base * 5}px;`, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledSheetFooterItem.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledSheetFooterItem };
@@ -4,20 +4,39 @@
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';
9
- import { BASE_MULTIPLIERS } from './StyledSheetClose.js';
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
10
9
 
11
10
  const COMPONENT_ID = 'chrome.sheet_header';
11
+ const colorStyles = _ref => {
12
+ let {
13
+ theme
14
+ } = _ref;
15
+ const borderColor = getColor({
16
+ theme,
17
+ variable: 'border.subtle'
18
+ });
19
+ return css(["border-bottom-color:", ";"], borderColor);
20
+ };
21
+ const sizeStyles = _ref2 => {
22
+ let {
23
+ theme,
24
+ isCloseButtonPresent
25
+ } = _ref2;
26
+ const border = theme.borders.sm;
27
+ let padding = `${theme.space.base * 5}px`;
28
+ if (isCloseButtonPresent) {
29
+ const paddingSide = `${theme.space.base * 14}px`;
30
+ padding = theme.rtl ? `${padding} ${padding} ${padding} ${paddingSide}` : `${padding} ${paddingSide} ${padding} ${padding}`;
31
+ }
32
+ return css(["border-bottom:", ";padding:", ";"], border, padding);
33
+ };
12
34
  const StyledSheetHeader = styled.header.attrs({
13
35
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9'
36
+ 'data-garden-version': '9.0.0'
15
37
  }).withConfig({
16
38
  displayName: "StyledSheetHeader",
17
39
  componentId: "sc-o2ry8i-0"
18
- })(["border-bottom:", ";padding:", "px;", " ", ";"], props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 300, props.theme)}}`, props => props.theme.space.base * 5, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS.size + BASE_MULTIPLIERS.side + 2)}px;`, props => retrieveComponentStyles(COMPONENT_ID, props));
19
- StyledSheetHeader.defaultProps = {
20
- theme: DEFAULT_THEME
21
- };
40
+ })(["", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
22
41
 
23
42
  export { StyledSheetHeader };
@@ -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 { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.sheet_title';
11
11
  const StyledSheetTitle = 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: "StyledSheetTitle",
16
16
  componentId: "sc-1gogk75-0"
17
- })(["line-height:", ";color:", ";font-weight:", ";", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledSheetTitle.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
17
+ })(["color:", ";font-weight:", ";", ";"], p => getColor({
18
+ theme: p.theme,
19
+ variable: 'foreground.default'
20
+ }), props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
21
21
 
22
22
  export { StyledSheetTitle };
@@ -4,34 +4,34 @@
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 { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
7
+ import styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'chrome.sheet_wrapper';
11
+ const transformStyles = _ref => {
12
+ let {
13
+ theme,
14
+ isAnimated,
15
+ isOpen,
16
+ placement
17
+ } = _ref;
18
+ const transition = isAnimated ? 'transform 250ms ease-in-out' : undefined;
19
+ let transform;
20
+ if (isOpen) {
21
+ transform = 'translateX(0)';
22
+ } else if (placement === 'start') {
23
+ transform = `translateX(${theme.rtl ? 100 : -100}%)`;
24
+ } else {
25
+ transform = `translateX(${theme.rtl ? -100 : 100}%)`;
26
+ }
27
+ return css(["transform:", ";transition:", ";"], transform, transition);
28
+ };
11
29
  const StyledSheetWrapper = styled.div.attrs({
12
30
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
31
+ 'data-garden-version': '9.0.0'
14
32
  }).withConfig({
15
33
  displayName: "StyledSheetWrapper",
16
34
  componentId: "sc-f6x9zb-0"
17
- })(["display:flex;position:relative;flex-direction:column;transform:", ";transition:", ";min-width:", ";", ";"], props => {
18
- const translateValues = [-100, 100];
19
- let translation = 'translateX(0%)';
20
- if (props.isOpen) {
21
- return translation;
22
- }
23
- if (props.theme.rtl) {
24
- translateValues.reverse();
25
- }
26
- if (props.placement === 'end') {
27
- translation = `translateX(${translateValues[1]}%)`;
28
- } else if (props.placement === 'start') {
29
- translation = `translateX(${translateValues[0]}%)`;
30
- }
31
- return translation;
32
- }, props => props.isAnimated && 'transform 250ms ease-in-out', props => props.size, props => retrieveComponentStyles(COMPONENT_ID, props));
33
- StyledSheetWrapper.defaultProps = {
34
- theme: DEFAULT_THEME
35
- };
35
+ })(["display:flex;position:relative;flex-direction:column;min-width:", ";", ";", ";"], props => props.size, transformStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
36
36
 
37
37
  export { StyledSheetWrapper };
@@ -0,0 +1,20 @@
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
+ import { PALETTE } from '@zendeskgarden/react-theming';
8
+
9
+ const getFooterHeight = theme => `${theme.space.base * 20}px`;
10
+ const getHeaderHeight = theme => `${theme.space.base * 13}px`;
11
+ const getHeaderItemSize = theme => `${theme.space.base * 7.5}px`;
12
+ const getNavItemHeight = theme => getHeaderHeight(theme);
13
+ const getNavWidth = theme => `${theme.space.base * 15}px`;
14
+ const getNavWidthExpanded = () => `200px`;
15
+ const getProductColor = function (product) {
16
+ let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'inherit';
17
+ return product ? PALETTE.product[product] || fallback : fallback;
18
+ };
19
+
20
+ export { getFooterHeight, getHeaderHeight, getHeaderItemSize, getNavItemHeight, getNavWidth, getNavWidthExpanded, getProductColor };