@zendeskgarden/react-chrome 9.0.0-next.9 → 9.1.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.
- package/dist/esm/elements/Chrome.js +9 -8
- package/dist/esm/elements/SkipNav.js +1 -1
- package/dist/esm/elements/body/Content.js +1 -1
- package/dist/esm/elements/footer/FooterItem.js +1 -1
- package/dist/esm/elements/header/Header.js +10 -3
- package/dist/esm/elements/header/HeaderItem.js +12 -3
- package/dist/esm/elements/header/HeaderItemIcon.js +3 -18
- package/dist/esm/elements/header/HeaderItemText.js +11 -4
- package/dist/esm/elements/header/HeaderItemWrapper.js +1 -1
- package/dist/esm/elements/nav/Nav.js +22 -12
- package/dist/esm/elements/nav/NavItem.js +8 -14
- package/dist/esm/elements/nav/NavItemIcon.js +3 -18
- package/dist/esm/elements/nav/NavItemText.js +9 -4
- package/dist/esm/elements/nav/NavList.js +1 -1
- package/dist/esm/elements/sheet/Sheet.js +10 -9
- package/dist/esm/elements/sheet/components/Footer.js +8 -3
- package/dist/esm/elements/sheet/components/Header.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/link-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +1 -1
- package/dist/esm/styled/StyledChrome.js +2 -5
- package/dist/esm/styled/StyledSkipNav.js +36 -18
- package/dist/esm/styled/StyledSkipNavIcon.js +10 -7
- package/dist/esm/styled/body/StyledBody.js +6 -6
- package/dist/esm/styled/body/StyledContent.js +18 -9
- package/dist/esm/styled/body/StyledMain.js +6 -6
- package/dist/esm/styled/footer/StyledFooter.js +28 -10
- package/dist/esm/styled/footer/StyledFooterItem.js +2 -5
- package/dist/esm/styled/header/StyledBaseHeaderItem.js +25 -19
- package/dist/esm/styled/header/StyledHeader.js +39 -15
- package/dist/esm/styled/header/StyledHeaderItem.js +46 -17
- package/dist/esm/styled/header/StyledHeaderItemIcon.js +13 -8
- package/dist/esm/styled/header/StyledHeaderItemText.js +6 -9
- package/dist/esm/styled/header/StyledHeaderItemWrapper.js +2 -5
- package/dist/esm/styled/header/StyledLogoHeaderItem.js +33 -24
- package/dist/esm/styled/nav/StyledBaseNavItem.js +12 -15
- package/dist/esm/styled/nav/StyledBrandmarkNavItem.js +2 -6
- package/dist/esm/styled/nav/StyledLogoNavItem.js +15 -25
- package/dist/esm/styled/nav/StyledNav.js +33 -16
- package/dist/esm/styled/nav/StyledNavButton.js +65 -39
- package/dist/esm/styled/nav/StyledNavItemIcon.js +12 -8
- package/dist/esm/styled/nav/StyledNavItemText.js +19 -17
- package/dist/esm/styled/nav/StyledNavList.js +2 -5
- package/dist/esm/styled/nav/StyledNavListItem.js +2 -5
- package/dist/esm/styled/sheet/StyledSheet.js +33 -21
- package/dist/esm/styled/sheet/StyledSheetBody.js +3 -6
- package/dist/esm/styled/sheet/StyledSheetClose.js +13 -19
- package/dist/esm/styled/sheet/StyledSheetDescription.js +6 -6
- package/dist/esm/styled/sheet/StyledSheetFooter.js +23 -7
- package/dist/esm/styled/sheet/StyledSheetFooterItem.js +2 -5
- package/dist/esm/styled/sheet/StyledSheetHeader.js +27 -8
- package/dist/esm/styled/sheet/StyledSheetTitle.js +6 -6
- package/dist/esm/styled/sheet/StyledSheetWrapper.js +22 -22
- package/dist/esm/styled/utils.js +20 -0
- package/dist/index.cjs.js +703 -517
- package/dist/typings/elements/footer/Footer.d.ts +1 -1
- package/dist/typings/elements/header/Header.d.ts +1 -1
- package/dist/typings/elements/header/HeaderItemIcon.d.ts +4 -1
- package/dist/typings/elements/nav/Nav.d.ts +1 -1
- package/dist/typings/elements/nav/NavItemIcon.d.ts +4 -1
- package/dist/typings/elements/sheet/Sheet.d.ts +3 -1
- package/dist/typings/styled/StyledSkipNav.d.ts +1 -4
- package/dist/typings/styled/StyledSkipNavIcon.d.ts +2 -2
- package/dist/typings/styled/body/StyledContent.d.ts +3 -2
- package/dist/typings/styled/footer/StyledFooter.d.ts +1 -2
- package/dist/typings/styled/header/StyledBaseHeaderItem.d.ts +4 -9
- package/dist/typings/styled/header/StyledHeader.d.ts +2 -3
- package/dist/typings/styled/header/StyledHeaderItem.d.ts +0 -3
- package/dist/typings/styled/header/StyledHeaderItemIcon.d.ts +2 -4
- package/dist/typings/styled/header/StyledHeaderItemText.d.ts +1 -2
- package/dist/typings/styled/header/StyledLogoHeaderItem.d.ts +3 -5
- package/dist/typings/styled/nav/StyledBaseNavItem.d.ts +1 -2
- package/dist/typings/styled/nav/StyledBrandmarkNavItem.d.ts +0 -3
- package/dist/typings/styled/nav/StyledLogoNavItem.d.ts +4 -8
- package/dist/typings/styled/nav/StyledNav.d.ts +4 -8
- package/dist/typings/styled/nav/StyledNavButton.d.ts +4 -15
- package/dist/typings/styled/nav/StyledNavItemIcon.d.ts +2 -4
- package/dist/typings/styled/nav/StyledNavItemText.d.ts +4 -3
- package/dist/typings/styled/sheet/StyledSheet.d.ts +5 -4
- package/dist/typings/styled/sheet/StyledSheetClose.d.ts +3 -8
- package/dist/typings/styled/sheet/StyledSheetDescription.d.ts +2 -3
- package/dist/typings/styled/sheet/StyledSheetFooter.d.ts +3 -3
- package/dist/typings/styled/sheet/StyledSheetFooterItem.d.ts +2 -3
- package/dist/typings/styled/sheet/StyledSheetHeader.d.ts +3 -7
- package/dist/typings/styled/sheet/StyledSheetTitle.d.ts +2 -3
- package/dist/typings/styled/sheet/StyledSheetWrapper.d.ts +6 -6
- package/dist/typings/styled/utils.d.ts +15 -0
- package/dist/typings/utils/useChromeContext.d.ts +0 -1
- package/dist/typings/utils/useSheetContext.d.ts +0 -1
- package/package.json +8 -7
|
@@ -5,30 +5,47 @@
|
|
|
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,
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { getNavWidthExpanded, getNavWidth } from '../utils.js';
|
|
9
10
|
|
|
10
11
|
const COMPONENT_ID = 'chrome.nav';
|
|
11
|
-
const colorStyles =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
$hue
|
|
16
|
+
} = _ref;
|
|
17
|
+
const shade = $hue === 'chromeHue' ? 900 : undefined;
|
|
18
|
+
const backgroundColor = getColor({
|
|
19
|
+
theme,
|
|
20
|
+
hue: $hue,
|
|
21
|
+
shade
|
|
22
|
+
});
|
|
23
|
+
const foregroundColor = getColor({
|
|
24
|
+
theme,
|
|
25
|
+
dark: {
|
|
26
|
+
hue: 'white'
|
|
27
|
+
},
|
|
28
|
+
light: {
|
|
29
|
+
hue: 'black'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
15
32
|
return css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
16
33
|
};
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
const sizeStyles = _ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
theme,
|
|
37
|
+
$isExpanded
|
|
38
|
+
} = _ref2;
|
|
39
|
+
const fontSize = theme.fontSizes.md;
|
|
40
|
+
const width = $isExpanded ? getNavWidthExpanded() : getNavWidth(theme);
|
|
41
|
+
return css(["width:", ";font-size:", ";"], width, fontSize);
|
|
22
42
|
};
|
|
23
43
|
const StyledNav = styled.nav.attrs({
|
|
24
44
|
'data-garden-id': COMPONENT_ID,
|
|
25
|
-
'data-garden-version': '9.
|
|
45
|
+
'data-garden-version': '9.1.0'
|
|
26
46
|
}).withConfig({
|
|
27
47
|
displayName: "StyledNav",
|
|
28
48
|
componentId: "sc-6j462r-0"
|
|
29
|
-
})(["display:flex;position:relative;flex-direction:column;flex-shrink:0;order:-1;
|
|
30
|
-
StyledNav.defaultProps = {
|
|
31
|
-
theme: DEFAULT_THEME
|
|
32
|
-
};
|
|
49
|
+
})(["display:flex;position:relative;flex-direction:column;flex-shrink:0;order:-1;", ";", ";", ";"], colorStyles, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
33
50
|
|
|
34
|
-
export { StyledNav
|
|
51
|
+
export { StyledNav };
|
|
@@ -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
|
|
9
|
-
import {
|
|
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 '
|
|
12
|
+
import { getNavWidth } from '../utils.js';
|
|
13
13
|
|
|
14
14
|
const COMPONENT_ID = 'chrome.nav_button';
|
|
15
|
-
const colorStyles =
|
|
16
|
-
|
|
15
|
+
const colorStyles = _ref => {
|
|
16
|
+
let {
|
|
17
17
|
theme,
|
|
18
|
-
hue
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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({
|
|
31
|
+
theme,
|
|
32
|
+
hue: $hue,
|
|
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
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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:
|
|
69
|
+
outlineColor: focusOutlineColor,
|
|
70
|
+
outlineOffset: focusOutlineOffset
|
|
46
71
|
}
|
|
47
|
-
}),
|
|
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.
|
|
84
|
+
'data-garden-version': '9.1.0',
|
|
52
85
|
as: 'button'
|
|
53
86
|
}).withConfig({
|
|
54
87
|
displayName: "StyledNavButton",
|
|
55
88
|
componentId: "sc-f5ux3-0"
|
|
56
|
-
})(["flex:1;justify-content:", ";
|
|
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 {
|
|
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
|
|
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.
|
|
20
|
+
'data-garden-version': '9.1.0'
|
|
14
21
|
}).withConfig({
|
|
15
22
|
displayName: "StyledNavItemIcon",
|
|
16
23
|
componentId: "sc-7w9rpt-0"
|
|
17
|
-
})(["align-self:flex-start;order:0;border-radius:", ";
|
|
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 {
|
|
9
|
+
import { retrieveComponentStyles, getLineHeight } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { StyledNavButton } from './StyledNavButton.js';
|
|
11
|
-
import { getNavWidth } from '
|
|
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.
|
|
30
|
+
'data-garden-version': '9.1.0'
|
|
17
31
|
}).withConfig({
|
|
18
32
|
displayName: "StyledNavItemText",
|
|
19
33
|
componentId: "sc-13m84xl-0"
|
|
20
|
-
})(["position:absolute;order:1;
|
|
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
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.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
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.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 {
|
|
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
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
12
|
let {
|
|
13
13
|
theme,
|
|
14
|
-
|
|
15
|
-
isOpen
|
|
14
|
+
$isOpen
|
|
16
15
|
} = _ref;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
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.
|
|
47
|
+
'data-garden-version': '9.1.0'
|
|
33
48
|
}).withConfig({
|
|
34
49
|
displayName: "StyledSheet",
|
|
35
50
|
componentId: "sc-dx8ijk-0"
|
|
36
|
-
})(["display:flex;order:1;transition:", ";
|
|
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
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.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
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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.
|
|
22
|
+
'data-garden-version': '9.1.0'
|
|
26
23
|
}).withConfig({
|
|
27
24
|
displayName: "StyledSheetClose",
|
|
28
25
|
componentId: "sc-1ab02oq-0"
|
|
29
|
-
})(["
|
|
30
|
-
StyledSheetClose.defaultProps = {
|
|
31
|
-
theme: DEFAULT_THEME
|
|
32
|
-
};
|
|
26
|
+
})(["position:absolute;", ";", ";"], positionStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
33
27
|
|
|
34
|
-
export {
|
|
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,
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledSheetDescription",
|
|
16
16
|
componentId: "sc-1puglb6-0"
|
|
17
|
-
})(["line-height:", ";color:", ";", ";"],
|
|
18
|
-
|
|
19
|
-
|
|
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 {
|
|
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.
|
|
32
|
+
'data-garden-version': '9.1.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:", ";
|
|
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
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.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 {
|
|
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.
|
|
36
|
+
'data-garden-version': '9.1.0'
|
|
15
37
|
}).withConfig({
|
|
16
38
|
displayName: "StyledSheetHeader",
|
|
17
39
|
componentId: "sc-o2ry8i-0"
|
|
18
|
-
})(["
|
|
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 {
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledSheetTitle",
|
|
16
16
|
componentId: "sc-1gogk75-0"
|
|
17
|
-
})(["
|
|
18
|
-
|
|
19
|
-
|
|
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 };
|