@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.
- package/dist/esm/elements/Chrome.js +9 -8
- package/dist/esm/elements/footer/FooterItem.js +1 -1
- package/dist/esm/elements/header/HeaderItem.js +1 -1
- package/dist/esm/elements/header/HeaderItemIcon.js +3 -18
- package/dist/esm/elements/header/HeaderItemText.js +1 -1
- package/dist/esm/elements/header/HeaderItemWrapper.js +1 -1
- package/dist/esm/elements/nav/Nav.js +13 -7
- package/dist/esm/elements/nav/NavItem.js +6 -12
- package/dist/esm/elements/nav/NavItemIcon.js +3 -18
- package/dist/esm/elements/nav/NavItemText.js +1 -1
- package/dist/esm/elements/nav/NavList.js +1 -1
- package/dist/esm/elements/sheet/Sheet.js +2 -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 +64 -38
- 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 +32 -20
- 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 +632 -483
- 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 +0 -3
- package/dist/typings/styled/StyledSkipNavIcon.d.ts +2 -2
- package/dist/typings/styled/body/StyledContent.d.ts +2 -1
- package/dist/typings/styled/footer/StyledFooter.d.ts +1 -2
- package/dist/typings/styled/header/StyledBaseHeaderItem.d.ts +1 -6
- package/dist/typings/styled/header/StyledHeader.d.ts +1 -2
- 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 +0 -1
- package/dist/typings/styled/header/StyledLogoHeaderItem.d.ts +2 -4
- 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 +3 -7
- package/dist/typings/styled/nav/StyledNav.d.ts +2 -6
- package/dist/typings/styled/nav/StyledNavButton.d.ts +2 -13
- package/dist/typings/styled/nav/StyledNavItemIcon.d.ts +2 -4
- package/dist/typings/styled/nav/StyledNavItemText.d.ts +2 -1
- package/dist/typings/styled/sheet/StyledSheet.d.ts +1 -0
- 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 +2 -2
- package/dist/typings/styled/sheet/StyledSheetFooterItem.d.ts +2 -3
- package/dist/typings/styled/sheet/StyledSheetHeader.d.ts +2 -6
- package/dist/typings/styled/sheet/StyledSheetTitle.d.ts +2 -3
- package/dist/typings/styled/sheet/StyledSheetWrapper.d.ts +2 -2
- 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 -8
- package/LICENSE.md +0 -176
|
@@ -5,31 +5,37 @@
|
|
|
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, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { getHeaderItemSize } from '../utils.js';
|
|
9
10
|
|
|
10
11
|
const COMPONENT_ID = 'chrome.base_header_item';
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const sizeStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
maxY,
|
|
16
|
+
isRound
|
|
17
|
+
} = _ref;
|
|
18
|
+
const margin = `0 ${theme.space.base * 3}px`;
|
|
19
|
+
const size = getHeaderItemSize(theme);
|
|
20
|
+
const height = maxY ? '100%' : size;
|
|
21
|
+
const lineHeight = getLineHeight(size, theme.fontSizes.md);
|
|
22
|
+
const padding = `0 ${theme.space.base * 0.75}px`;
|
|
23
|
+
let borderRadius;
|
|
24
|
+
if (isRound) {
|
|
25
|
+
borderRadius = '100%';
|
|
26
|
+
} else if (maxY) {
|
|
27
|
+
borderRadius = '0';
|
|
28
|
+
} else {
|
|
29
|
+
borderRadius = theme.borderRadii.md;
|
|
30
|
+
}
|
|
31
|
+
return css(["margin:", ";border-radius:", ";padding:", ";min-width:", ";height:", ";line-height:", ";font-size:inherit;"], margin, borderRadius, padding, size, height, lineHeight);
|
|
15
32
|
};
|
|
16
33
|
const StyledBaseHeaderItem = styled.button.attrs({
|
|
17
34
|
'data-garden-id': COMPONENT_ID,
|
|
18
|
-
'data-garden-version': '9.0.0
|
|
35
|
+
'data-garden-version': '9.0.0'
|
|
19
36
|
}).withConfig({
|
|
20
37
|
displayName: "StyledBaseHeaderItem",
|
|
21
38
|
componentId: "sc-1qua7h6-0"
|
|
22
|
-
})(["display:inline-flex;position:relative;flex:", ";align-items:center;justify-content:", ";order:1;transition:box-shadow 0.1s ease-in-out,color 0.1s ease-in-out;z-index:0;
|
|
23
|
-
if (props.isRound) {
|
|
24
|
-
return '100%';
|
|
25
|
-
}
|
|
26
|
-
if (props.maxY) {
|
|
27
|
-
return '0';
|
|
28
|
-
}
|
|
29
|
-
return props.theme.borderRadii.md;
|
|
30
|
-
}, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
31
|
-
StyledBaseHeaderItem.defaultProps = {
|
|
32
|
-
theme: DEFAULT_THEME
|
|
33
|
-
};
|
|
39
|
+
})(["display:inline-flex;position:relative;flex:", ";align-items:center;justify-content:", ";order:1;transition:box-shadow 0.1s ease-in-out,color 0.1s ease-in-out;z-index:0;border:none;background:transparent;text-decoration:none;white-space:nowrap;color:inherit;", ";", ";"], props => props.maxX && '1', props => props.maxX ? 'start' : 'center', sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
34
40
|
|
|
35
|
-
export { StyledBaseHeaderItem
|
|
41
|
+
export { StyledBaseHeaderItem };
|
|
@@ -4,28 +4,52 @@
|
|
|
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
|
import { StyledLogoHeaderItem } from './StyledLogoHeaderItem.js';
|
|
10
|
-
import {
|
|
10
|
+
import { getHeaderHeight } from '../utils.js';
|
|
11
11
|
|
|
12
12
|
const COMPONENT_ID = 'chrome.header';
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const colorStyles = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
theme,
|
|
16
|
+
isStandalone
|
|
17
|
+
} = _ref;
|
|
18
|
+
const backgroundColor = getColor({
|
|
19
|
+
theme,
|
|
20
|
+
variable: 'background.default'
|
|
21
|
+
});
|
|
22
|
+
const borderColor = getColor({
|
|
23
|
+
theme,
|
|
24
|
+
variable: 'border.default'
|
|
25
|
+
});
|
|
26
|
+
const boxShadowColor = getColor({
|
|
27
|
+
variable: 'shadow.small',
|
|
28
|
+
theme
|
|
29
|
+
});
|
|
30
|
+
const boxShadow = isStandalone ? theme.shadows.lg('0', `${theme.space.base * 2}px`, boxShadowColor) : undefined;
|
|
31
|
+
const foregroundColor = getColor({
|
|
32
|
+
theme,
|
|
33
|
+
variable: 'foreground.subtle'
|
|
34
|
+
});
|
|
35
|
+
return css(["border-bottom-color:", ";box-shadow:", ";background-color:", ";color:", ";"], borderColor, boxShadow, backgroundColor, foregroundColor);
|
|
36
|
+
};
|
|
37
|
+
const sizeStyles = _ref2 => {
|
|
38
|
+
let {
|
|
39
|
+
theme
|
|
40
|
+
} = _ref2;
|
|
41
|
+
const border = theme.borders.sm;
|
|
42
|
+
const padding = `0 ${theme.space.base}px`;
|
|
43
|
+
const fontSize = theme.fontSizes.md;
|
|
44
|
+
const height = getHeaderHeight(theme);
|
|
45
|
+
return css(["box-sizing:border-box;border-bottom:", ";padding:", ";height:", ";font-size:", ";"], border, padding, height, fontSize);
|
|
15
46
|
};
|
|
16
47
|
const StyledHeader = styled.header.attrs({
|
|
17
48
|
'data-garden-id': COMPONENT_ID,
|
|
18
|
-
'data-garden-version': '9.0.0
|
|
49
|
+
'data-garden-version': '9.0.0'
|
|
19
50
|
}).withConfig({
|
|
20
51
|
displayName: "StyledHeader",
|
|
21
52
|
componentId: "sc-1cexpz-0"
|
|
22
|
-
})(["display:flex;position:", ";align-items:center;justify-content:flex-end;
|
|
23
|
-
${StyledLogoHeaderItem} {
|
|
24
|
-
display: inline-flex;
|
|
25
|
-
}
|
|
26
|
-
`, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
27
|
-
StyledHeader.defaultProps = {
|
|
28
|
-
theme: DEFAULT_THEME
|
|
29
|
-
};
|
|
53
|
+
})(["display:flex;position:", ";align-items:center;justify-content:flex-end;", ";", ";", "{display:", ";}", ";"], props => props.isStandalone && 'relative', sizeStyles, colorStyles, StyledLogoHeaderItem, props => props.isStandalone && 'inline-flex', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
30
54
|
|
|
31
|
-
export { StyledHeader
|
|
55
|
+
export { StyledHeader };
|
|
@@ -6,32 +6,61 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import {
|
|
9
|
+
import { retrieveComponentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { StyledHeaderItemIcon } from './StyledHeaderItemIcon.js';
|
|
11
|
-
import { StyledBaseHeaderItem
|
|
11
|
+
import { StyledBaseHeaderItem } from './StyledBaseHeaderItem.js';
|
|
12
12
|
import { StyledHeaderItemText } from './StyledHeaderItemText.js';
|
|
13
|
+
import { getHeaderItemSize } from '../utils.js';
|
|
13
14
|
|
|
14
15
|
const COMPONENT_ID = 'chrome.header_item';
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const colorStyles = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
theme,
|
|
19
|
+
maxY
|
|
20
|
+
} = _ref;
|
|
21
|
+
const options = {
|
|
22
|
+
theme,
|
|
23
|
+
variable: 'foreground.subtle'
|
|
24
|
+
};
|
|
25
|
+
const hoverColor = getColor({
|
|
26
|
+
...options,
|
|
27
|
+
dark: {
|
|
28
|
+
offset: -100
|
|
29
|
+
},
|
|
30
|
+
light: {
|
|
31
|
+
offset: 100
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const activeColor = getColor({
|
|
35
|
+
...options,
|
|
36
|
+
dark: {
|
|
37
|
+
offset: -200
|
|
38
|
+
},
|
|
39
|
+
light: {
|
|
40
|
+
offset: 200
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return css(["&:hover,&:focus{color:inherit;}", ";&:hover ", ",&:hover ", "{color:", ";}&:active ", ",&:active ", "{color:", ";}"], focusStyles({
|
|
44
|
+
theme,
|
|
45
|
+
inset: maxY
|
|
46
|
+
}), StyledHeaderItemIcon, StyledHeaderItemText, hoverColor, StyledHeaderItemIcon, StyledHeaderItemText, activeColor);
|
|
47
|
+
};
|
|
48
|
+
const sizeStyles = _ref2 => {
|
|
49
|
+
let {
|
|
50
|
+
theme,
|
|
51
|
+
isRound
|
|
52
|
+
} = _ref2;
|
|
53
|
+
const iconBorderRadius = isRound ? '100px' : undefined;
|
|
54
|
+
const imageBorderRadius = math(`${theme.borderRadii.md} - 1`);
|
|
55
|
+
const imageSize = math(`${getHeaderItemSize(theme)} - ${theme.space.base * 2}`);
|
|
56
|
+
return css(["img{margin:0;border-radius:", ";width:", ";height:", ";}", "{border-radius:", ";}"], imageBorderRadius, imageSize, imageSize, StyledHeaderItemIcon, iconBorderRadius);
|
|
18
57
|
};
|
|
19
58
|
const StyledHeaderItem = styled(StyledBaseHeaderItem).attrs({
|
|
20
59
|
'data-garden-id': COMPONENT_ID,
|
|
21
|
-
'data-garden-version': '9.0.0
|
|
60
|
+
'data-garden-version': '9.0.0'
|
|
22
61
|
}).withConfig({
|
|
23
62
|
displayName: "StyledHeaderItem",
|
|
24
63
|
componentId: "sc-14sft6n-0"
|
|
25
|
-
})(["
|
|
26
|
-
theme: props.theme,
|
|
27
|
-
inset: props.maxY
|
|
28
|
-
}), StyledHeaderItemIcon, StyledHeaderItemText, StyledHeaderItemIcon, StyledHeaderItemText, props => getColorV8('chromeHue', 700, props.theme), imgStyles, props => props.isRound && `
|
|
29
|
-
${StyledHeaderItemIcon} {
|
|
30
|
-
border-radius: 100px;
|
|
31
|
-
}
|
|
32
|
-
`, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
33
|
-
StyledHeaderItem.defaultProps = {
|
|
34
|
-
theme: DEFAULT_THEME
|
|
35
|
-
};
|
|
64
|
+
})(["cursor:pointer;&:hover,&:focus{text-decoration:none;}", ";", ";& ", ",& ", "{transition:box-shadow 0.1s ease-in-out,color 0.1s ease-in-out;}", ";"], sizeStyles, colorStyles, StyledHeaderItemIcon, StyledHeaderItemText, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
36
65
|
|
|
37
66
|
export { StyledHeaderItem };
|
|
@@ -4,19 +4,24 @@
|
|
|
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.header_item_icon';
|
|
11
|
-
const
|
|
11
|
+
const sizeStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme
|
|
14
|
+
} = _ref;
|
|
15
|
+
const margin = `0 ${theme.space.base * 0.75}px`;
|
|
16
|
+
const size = theme.iconSizes.md;
|
|
17
|
+
return css(["margin:", ";width:", ";min-width:", ";height:", ";"], margin, size, size, size);
|
|
18
|
+
};
|
|
19
|
+
const StyledHeaderItemIcon = styled(StyledBaseIcon).attrs({
|
|
12
20
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0
|
|
21
|
+
'data-garden-version': '9.0.0'
|
|
14
22
|
}).withConfig({
|
|
15
23
|
displayName: "StyledHeaderItemIcon",
|
|
16
24
|
componentId: "sc-1jhhp6z-0"
|
|
17
|
-
})(["transition:transform 0.25s ease-in-out;
|
|
18
|
-
StyledHeaderItemIcon.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
25
|
+
})(["transition:transform 0.25s ease-in-out;", ";", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
26
|
|
|
22
27
|
export { StyledHeaderItemIcon };
|
|
@@ -4,20 +4,17 @@
|
|
|
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
|
|
8
|
-
import {
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { hideVisually } from 'polished';
|
|
9
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
10
|
|
|
10
11
|
const COMPONENT_ID = 'chrome.header_item_text';
|
|
11
|
-
const clippedStyling = css(["position:absolute;margin:0;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
|
|
12
12
|
const StyledHeaderItemText = styled.span.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0
|
|
14
|
+
'data-garden-version': '9.0.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledHeaderItemText",
|
|
17
17
|
componentId: "sc-goz7la-0"
|
|
18
|
-
})(["margin:
|
|
19
|
-
StyledHeaderItemText.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
18
|
+
})(["margin:", ";", " ", ";"], props => `0 ${props.theme.space.base * 0.75}px`, props => props.isClipped && hideVisually(), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
19
|
|
|
23
|
-
export { StyledHeaderItemText
|
|
20
|
+
export { StyledHeaderItemText };
|
|
@@ -5,20 +5,17 @@
|
|
|
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
|
import { StyledBaseHeaderItem } from './StyledBaseHeaderItem.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'chrome.header_item_wrapper';
|
|
12
12
|
const StyledHeaderItemWrapper = styled(StyledBaseHeaderItem).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0
|
|
14
|
+
'data-garden-version': '9.0.0',
|
|
15
15
|
as: 'div'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledHeaderItemWrapper",
|
|
18
18
|
componentId: "sc-1uieu55-0"
|
|
19
19
|
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
20
|
-
StyledHeaderItemWrapper.defaultProps = {
|
|
21
|
-
theme: DEFAULT_THEME
|
|
22
|
-
};
|
|
23
20
|
|
|
24
21
|
export { StyledHeaderItemWrapper };
|
|
@@ -4,40 +4,49 @@
|
|
|
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 { hideVisually } from 'polished';
|
|
9
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
10
|
import { StyledHeaderItemIcon } from './StyledHeaderItemIcon.js';
|
|
10
11
|
import { StyledBaseHeaderItem } from './StyledBaseHeaderItem.js';
|
|
11
|
-
import { StyledHeaderItemText
|
|
12
|
-
import { getNavWidth } from '../
|
|
12
|
+
import { StyledHeaderItemText } from './StyledHeaderItemText.js';
|
|
13
|
+
import { getProductColor, getNavWidth } from '../utils.js';
|
|
13
14
|
|
|
14
15
|
const COMPONENT_ID = 'chrome.header_item';
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
const colorStyles = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
theme,
|
|
19
|
+
product
|
|
20
|
+
} = _ref;
|
|
21
|
+
const borderColor = getColor({
|
|
22
|
+
theme,
|
|
23
|
+
variable: 'border.default'
|
|
24
|
+
});
|
|
25
|
+
const fill = getColor({
|
|
26
|
+
theme,
|
|
27
|
+
variable: 'foreground.default'
|
|
28
|
+
});
|
|
29
|
+
const color = getProductColor(product, fill );
|
|
30
|
+
return css(["border-", "-color:", ";color:", ";fill:", ";"], theme.rtl ? 'left' : 'right', borderColor, color, fill);
|
|
31
|
+
};
|
|
32
|
+
const sizeStyles = _ref2 => {
|
|
33
|
+
let {
|
|
34
|
+
theme
|
|
35
|
+
} = _ref2;
|
|
36
|
+
const border = theme.borders.sm;
|
|
37
|
+
const iconSize = theme.iconSizes.lg;
|
|
38
|
+
const marginRight = theme.rtl ? `-${theme.space.base}px` : 'auto';
|
|
39
|
+
const marginLeft = theme.rtl ? 'auto' : `-${theme.space.base}px`;
|
|
40
|
+
const width = getNavWidth(theme);
|
|
41
|
+
return css(["margin-right:", ";margin-left:", ";border-", ":", ";width:", ";height:100%;", "{margin:0;width:", ";height:", ";}"], marginRight, marginLeft, theme.rtl ? 'left' : 'right', border, width, StyledHeaderItemIcon, iconSize, iconSize);
|
|
30
42
|
};
|
|
31
43
|
const StyledLogoHeaderItem = styled(StyledBaseHeaderItem).attrs({
|
|
32
44
|
'data-garden-id': COMPONENT_ID,
|
|
33
|
-
'data-garden-version': '9.0.0
|
|
45
|
+
'data-garden-version': '9.0.0',
|
|
34
46
|
as: 'div'
|
|
35
47
|
}).withConfig({
|
|
36
48
|
displayName: "StyledLogoHeaderItem",
|
|
37
49
|
componentId: "sc-1n1d1yv-0"
|
|
38
|
-
})(["display:none;order:0;
|
|
39
|
-
StyledLogoHeaderItem.defaultProps = {
|
|
40
|
-
theme: DEFAULT_THEME
|
|
41
|
-
};
|
|
50
|
+
})(["display:none;order:0;border-radius:0;padding:0;overflow:hidden;text-decoration:none;", ";", ";", "{", "}", ";"], sizeStyles, colorStyles, StyledHeaderItemText, hideVisually(), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
42
51
|
|
|
43
52
|
export { StyledLogoHeaderItem };
|
|
@@ -6,27 +6,24 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { math } from 'polished';
|
|
9
|
-
import {
|
|
10
|
-
import { getNavWidth } from './StyledNav.js';
|
|
9
|
+
import { getNavItemHeight, getNavWidth } from '../utils.js';
|
|
11
10
|
|
|
12
11
|
const COMPONENT_ID = 'chrome.base_nav_item';
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
12
|
+
const sizeStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
|
+
const minHeight = getNavItemHeight(theme);
|
|
17
|
+
const verticalPadding = math(`(${minHeight} - ${theme.iconSizes.lg}) / 2`);
|
|
18
|
+
const horizontalPadding = math(`(${getNavWidth(theme)} - ${theme.iconSizes.lg}) / 4`);
|
|
19
|
+
return css(["padding:", " ", ";min-height:", ";"], verticalPadding, horizontalPadding, minHeight);
|
|
20
20
|
};
|
|
21
21
|
const StyledBaseNavItem = styled.div.attrs({
|
|
22
22
|
'data-garden-id': COMPONENT_ID,
|
|
23
|
-
'data-garden-version': '9.0.0
|
|
23
|
+
'data-garden-version': '9.0.0'
|
|
24
24
|
}).withConfig({
|
|
25
25
|
displayName: "StyledBaseNavItem",
|
|
26
26
|
componentId: "sc-zvo43f-0"
|
|
27
|
-
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:outline-color 0.1s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.1s ease-in-out,opacity 0.1s ease-in-out;", ""],
|
|
28
|
-
StyledBaseNavItem.defaultProps = {
|
|
29
|
-
theme: DEFAULT_THEME
|
|
30
|
-
};
|
|
27
|
+
})(["display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:outline-color 0.1s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.1s ease-in-out,opacity 0.1s ease-in-out;", ";"], sizeStyles);
|
|
31
28
|
|
|
32
|
-
export { StyledBaseNavItem
|
|
29
|
+
export { StyledBaseNavItem };
|
|
@@ -5,19 +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 { DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
8
|
import { StyledBaseNavItem } from './StyledBaseNavItem.js';
|
|
10
9
|
|
|
11
10
|
const COMPONENT_ID = 'chrome.brandmark_nav_list_item';
|
|
12
11
|
const StyledBrandmarkNavItem = styled(StyledBaseNavItem).attrs({
|
|
13
12
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0
|
|
13
|
+
'data-garden-version': '9.0.0'
|
|
15
14
|
}).withConfig({
|
|
16
15
|
displayName: "StyledBrandmarkNavItem",
|
|
17
16
|
componentId: "sc-8kynd4-0"
|
|
18
|
-
})(["order:1;opacity:
|
|
19
|
-
StyledBrandmarkNavItem.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
17
|
+
})(["order:1;opacity:", ";margin-top:auto;min-height:0;"], props => props.theme.opacity[400]);
|
|
22
18
|
|
|
23
19
|
export { StyledBrandmarkNavItem };
|
|
@@ -5,40 +5,30 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { StyledBaseNavItem } from './StyledBaseNavItem.js';
|
|
10
|
+
import { getProductColor } from '../utils.js';
|
|
10
11
|
|
|
11
12
|
const COMPONENT_ID = 'chrome.logo_nav_list_item';
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return PALETTE.product.talk;
|
|
24
|
-
default:
|
|
25
|
-
return 'inherit';
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const colorStyles = props => {
|
|
29
|
-
const fillColor = props.isLight ? props.theme.palette.grey[800] : props.theme.palette.white;
|
|
30
|
-
const color = props.isLight || props.isDark ? fillColor : retrieveProductColor(props.product);
|
|
13
|
+
const colorStyles = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
theme,
|
|
16
|
+
hue,
|
|
17
|
+
product
|
|
18
|
+
} = _ref;
|
|
19
|
+
const fillColor = getColor({
|
|
20
|
+
theme,
|
|
21
|
+
variable: 'foreground.default'
|
|
22
|
+
});
|
|
23
|
+
const color = hue === 'chromeHue' ? getProductColor(product) : fillColor;
|
|
31
24
|
return css(["color:", ";fill:", ";"], color, fillColor);
|
|
32
25
|
};
|
|
33
26
|
const StyledLogoNavItem = styled(StyledBaseNavItem).attrs({
|
|
34
27
|
'data-garden-id': COMPONENT_ID,
|
|
35
|
-
'data-garden-version': '9.0.0
|
|
28
|
+
'data-garden-version': '9.0.0'
|
|
36
29
|
}).withConfig({
|
|
37
30
|
displayName: "StyledLogoNavItem",
|
|
38
31
|
componentId: "sc-saaydx-0"
|
|
39
|
-
})(["order:-1;opacity:1;cursor:default;min-height:0;", ";"],
|
|
40
|
-
StyledLogoNavItem.defaultProps = {
|
|
41
|
-
theme: DEFAULT_THEME
|
|
42
|
-
};
|
|
32
|
+
})(["order:-1;opacity:1;cursor:default;min-height:0;", ";"], colorStyles);
|
|
43
33
|
|
|
44
34
|
export { StyledLogoNavItem };
|
|
@@ -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,
|
|
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.0.0
|
|
45
|
+
'data-garden-version': '9.0.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 };
|