@zendeskgarden/react-chrome 9.0.0-next.2 → 9.0.0-next.20
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/README.md +26 -27
- package/dist/esm/elements/Chrome.js +95 -0
- package/dist/esm/elements/SkipNav.js +65 -0
- package/dist/esm/elements/body/Body.js +57 -0
- package/dist/esm/elements/body/Content.js +54 -0
- package/dist/esm/elements/body/Main.js +47 -0
- package/dist/esm/elements/footer/Footer.js +67 -0
- package/dist/esm/elements/footer/FooterItem.js +47 -0
- package/dist/esm/elements/header/Header.js +60 -0
- package/dist/esm/elements/header/HeaderItem.js +69 -0
- package/dist/esm/elements/header/HeaderItemIcon.js +50 -0
- package/dist/esm/elements/header/HeaderItemText.js +51 -0
- package/dist/esm/elements/header/HeaderItemWrapper.js +47 -0
- package/dist/esm/elements/nav/Nav.js +84 -0
- package/dist/esm/elements/nav/NavItem.js +95 -0
- package/dist/esm/elements/nav/NavItemIcon.js +50 -0
- package/dist/esm/elements/nav/NavItemText.js +58 -0
- package/dist/esm/elements/nav/NavList.js +55 -0
- package/dist/esm/elements/sheet/Sheet.js +128 -0
- package/dist/esm/elements/sheet/components/Body.js +50 -0
- package/dist/esm/elements/sheet/components/Close.js +60 -0
- package/dist/esm/elements/sheet/components/Description.js +59 -0
- package/dist/esm/elements/sheet/components/Footer.js +50 -0
- package/dist/esm/elements/sheet/components/FooterItem.js +50 -0
- package/dist/esm/elements/sheet/components/Header.js +55 -0
- package/dist/esm/elements/sheet/components/Title.js +59 -0
- package/dist/esm/index.js +24 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/link-stroke.svg.js +25 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
- package/dist/esm/styled/StyledChrome.js +22 -0
- package/dist/esm/styled/StyledSkipNav.js +67 -0
- package/dist/esm/styled/StyledSkipNavIcon.js +34 -0
- package/dist/esm/styled/body/StyledBody.js +25 -0
- package/dist/esm/styled/body/StyledContent.js +37 -0
- package/dist/esm/styled/body/StyledMain.js +25 -0
- package/dist/esm/styled/footer/StyledFooter.js +46 -0
- package/dist/esm/styled/footer/StyledFooterItem.js +22 -0
- package/dist/esm/styled/header/StyledBaseHeaderItem.js +44 -0
- package/dist/esm/styled/header/StyledHeader.js +58 -0
- package/dist/esm/styled/header/StyledHeaderItem.js +69 -0
- package/dist/esm/styled/header/StyledHeaderItemIcon.js +30 -0
- package/dist/esm/styled/header/StyledHeaderItemText.js +23 -0
- package/dist/esm/styled/header/StyledHeaderItemWrapper.js +24 -0
- package/dist/esm/styled/header/StyledLogoHeaderItem.js +55 -0
- package/dist/esm/styled/nav/StyledBaseNavItem.js +33 -0
- package/dist/esm/styled/nav/StyledBrandmarkNavItem.js +23 -0
- package/dist/esm/styled/nav/StyledLogoNavItem.js +37 -0
- package/dist/esm/styled/nav/StyledNav.js +54 -0
- package/dist/esm/styled/nav/StyledNavButton.js +94 -0
- package/dist/esm/styled/nav/StyledNavItemIcon.js +29 -0
- package/dist/esm/styled/nav/StyledNavItemText.js +39 -0
- package/dist/esm/styled/nav/StyledNavList.js +22 -0
- package/dist/esm/styled/nav/StyledNavListItem.js +22 -0
- package/dist/esm/styled/sheet/StyledSheet.js +56 -0
- package/dist/esm/styled/sheet/StyledSheetBody.js +22 -0
- package/dist/esm/styled/sheet/StyledSheetClose.js +31 -0
- package/dist/esm/styled/sheet/StyledSheetDescription.js +25 -0
- package/dist/esm/styled/sheet/StyledSheetFooter.js +41 -0
- package/dist/esm/styled/sheet/StyledSheetFooterItem.js +22 -0
- package/dist/esm/styled/sheet/StyledSheetHeader.js +45 -0
- package/dist/esm/styled/sheet/StyledSheetTitle.js +25 -0
- package/dist/esm/styled/sheet/StyledSheetWrapper.js +40 -0
- package/dist/esm/styled/utils.js +20 -0
- package/dist/esm/types/index.js +10 -0
- package/dist/esm/utils/useBodyContext.js +14 -0
- package/dist/esm/utils/useChromeContext.js +16 -0
- package/dist/esm/utils/useFocusableMount.js +31 -0
- package/dist/esm/utils/useNavContext.js +16 -0
- package/dist/esm/utils/useNavListContext.js +14 -0
- package/dist/esm/utils/useSheetContext.js +16 -0
- package/dist/index.cjs.js +880 -881
- package/dist/typings/elements/body/Body.d.ts +1 -2
- package/dist/typings/elements/footer/Footer.d.ts +8 -1
- package/dist/typings/elements/footer/FooterItem.d.ts +2 -0
- package/dist/typings/elements/header/Header.d.ts +11 -1
- package/dist/typings/elements/header/HeaderItem.d.ts +2 -0
- package/dist/typings/elements/header/HeaderItemIcon.d.ts +5 -3
- package/dist/typings/elements/header/HeaderItemText.d.ts +2 -0
- package/dist/typings/elements/header/HeaderItemWrapper.d.ts +2 -0
- package/dist/typings/elements/nav/Nav.d.ts +11 -1
- package/dist/typings/elements/nav/NavItem.d.ts +2 -0
- package/dist/typings/elements/nav/NavItemIcon.d.ts +5 -3
- package/dist/typings/elements/nav/NavItemText.d.ts +2 -0
- package/dist/typings/elements/{body/Sidebar.d.ts → nav/NavList.d.ts} +2 -2
- package/dist/typings/index.d.ts +9 -16
- 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 +3 -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/index.d.ts +3 -8
- package/dist/typings/styled/nav/StyledBaseNavItem.d.ts +2 -7
- package/dist/typings/styled/nav/StyledBrandmarkNavItem.d.ts +1 -5
- package/dist/typings/styled/nav/StyledLogoNavItem.d.ts +4 -9
- package/dist/typings/styled/nav/StyledNav.d.ts +2 -6
- package/dist/typings/styled/nav/StyledNavButton.d.ts +17 -0
- package/dist/typings/styled/nav/StyledNavItemIcon.d.ts +3 -4
- package/dist/typings/styled/nav/StyledNavItemText.d.ts +2 -1
- package/dist/typings/styled/{body/StyledSidebar.d.ts → nav/StyledNavList.d.ts} +1 -1
- package/dist/typings/styled/nav/StyledNavListItem.d.ts +10 -0
- package/dist/typings/styled/sheet/StyledSheetClose.d.ts +4 -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/types/index.d.ts +3 -30
- package/dist/typings/utils/useBodyContext.d.ts +3 -2
- package/dist/typings/utils/useChromeContext.d.ts +0 -1
- package/dist/typings/utils/useNavListContext.d.ts +13 -0
- package/package.json +9 -10
- package/dist/index.esm.js +0 -1449
- package/dist/typings/elements/subnav/CollapsibleSubNavItem.d.ts +0 -12
- package/dist/typings/elements/subnav/SubNav.d.ts +0 -11
- package/dist/typings/elements/subnav/SubNavItem.d.ts +0 -12
- package/dist/typings/elements/subnav/SubNavItemText.d.ts +0 -12
- package/dist/typings/styled/nav/StyledNavItem.d.ts +0 -26
- package/dist/typings/styled/subnav/StyledSubNav.d.ts +0 -17
- package/dist/typings/styled/subnav/StyledSubNavItem.d.ts +0 -21
- package/dist/typings/styled/subnav/StyledSubNavItemHeader.d.ts +0 -14
- package/dist/typings/styled/subnav/StyledSubNavItemIcon.d.ts +0 -14
- package/dist/typings/styled/subnav/StyledSubNavItemText.d.ts +0 -11
- package/dist/typings/styled/subnav/StyledSubNavPanel.d.ts +0 -12
package/dist/index.cjs.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
*/
|
|
8
7
|
'use strict';
|
|
9
8
|
|
|
10
9
|
var React = require('react');
|
|
11
10
|
var PropTypes = require('prop-types');
|
|
12
11
|
var styled = require('styled-components');
|
|
13
|
-
var polished = require('polished');
|
|
14
12
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
15
|
-
var
|
|
16
|
-
var
|
|
13
|
+
var polished = require('polished');
|
|
14
|
+
var reactButtons = require('@zendeskgarden/react-buttons');
|
|
17
15
|
var reactUid = require('react-uid');
|
|
18
16
|
var reactMergeRefs = require('react-merge-refs');
|
|
19
17
|
var activeElement = require('dom-helpers/activeElement');
|
|
@@ -43,710 +41,768 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
43
41
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
44
42
|
var activeElement__default = /*#__PURE__*/_interopDefault(activeElement);
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
49
|
-
var source = arguments[i];
|
|
50
|
-
for (var key in source) {
|
|
51
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
52
|
-
target[key] = source[key];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return target;
|
|
57
|
-
};
|
|
58
|
-
return _extends$3.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const ChromeContext = React__namespace.default.createContext({
|
|
62
|
-
hue: 'chromeHue'
|
|
63
|
-
});
|
|
64
|
-
const useChromeContext = () => {
|
|
65
|
-
return React.useContext(ChromeContext);
|
|
66
|
-
};
|
|
44
|
+
const PLACEMENT = ['end', 'start'];
|
|
45
|
+
const PRODUCTS = ['chat', 'explore', 'guide', 'support', 'talk'];
|
|
67
46
|
|
|
68
|
-
const COMPONENT_ID$
|
|
47
|
+
const COMPONENT_ID$w = 'chrome.chrome';
|
|
69
48
|
const StyledChrome = styled__default.default.div.attrs({
|
|
70
|
-
'data-garden-id': COMPONENT_ID$
|
|
71
|
-
'data-garden-version': '9.0.0-next.
|
|
49
|
+
'data-garden-id': COMPONENT_ID$w,
|
|
50
|
+
'data-garden-version': '9.0.0-next.20'
|
|
72
51
|
}).withConfig({
|
|
73
52
|
displayName: "StyledChrome",
|
|
74
53
|
componentId: "sc-1uqm6u6-0"
|
|
75
|
-
})(["display:flex;position:relative;margin:0;height:100vh;overflow-y:hidden;font-family:", ";direction:", ";", ";"], props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
54
|
+
})(["display:flex;position:relative;margin:0;height:100vh;overflow-y:hidden;font-family:", ";direction:", ";", ";"], props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$w, props));
|
|
76
55
|
StyledChrome.defaultProps = {
|
|
77
56
|
theme: reactTheming.DEFAULT_THEME
|
|
78
57
|
};
|
|
79
58
|
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
theme: reactTheming.DEFAULT_THEME
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const COMPONENT_ID$y = 'chrome.base_header_item';
|
|
93
|
-
const getHeaderItemSize = props => `${props.theme.space.base * 7.5}px`;
|
|
94
|
-
const sizeStyles$4 = props => {
|
|
95
|
-
const size = props.theme.space.base * 7.5;
|
|
96
|
-
return styled.css(["padding:0 3px;min-width:", "px;height:", ";line-height:", ";"], size, props.maxY ? '100%' : `${size}px`, reactTheming.getLineHeight(size, props.theme.fontSizes.md));
|
|
97
|
-
};
|
|
98
|
-
const StyledBaseHeaderItem = styled__default.default.button.attrs({
|
|
99
|
-
'data-garden-id': COMPONENT_ID$y,
|
|
100
|
-
'data-garden-version': '9.0.0-next.2'
|
|
101
|
-
}).withConfig({
|
|
102
|
-
displayName: "StyledBaseHeaderItem",
|
|
103
|
-
componentId: "sc-1qua7h6-0"
|
|
104
|
-
})(["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;margin:", ";border:none;border-radius:", ";background:transparent;text-decoration:none;white-space:nowrap;color:inherit;font-size:inherit;", " ", ";"], props => props.maxX && '1', props => props.maxX ? 'start' : 'center', props => `0 ${props.theme.space.base * 3}px`, props => {
|
|
105
|
-
if (props.isRound) {
|
|
106
|
-
return '100%';
|
|
107
|
-
}
|
|
108
|
-
if (props.maxY) {
|
|
109
|
-
return '0';
|
|
110
|
-
}
|
|
111
|
-
return props.theme.borderRadii.md;
|
|
112
|
-
}, sizeStyles$4, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$y, props));
|
|
113
|
-
StyledBaseHeaderItem.defaultProps = {
|
|
114
|
-
theme: reactTheming.DEFAULT_THEME
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const COMPONENT_ID$x = 'chrome.header_item_text';
|
|
118
|
-
const clippedStyling = styled.css(["position:absolute;margin:0;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
|
|
119
|
-
const StyledHeaderItemText = styled__default.default.span.attrs({
|
|
120
|
-
'data-garden-id': COMPONENT_ID$x,
|
|
121
|
-
'data-garden-version': '9.0.0-next.2'
|
|
122
|
-
}).withConfig({
|
|
123
|
-
displayName: "StyledHeaderItemText",
|
|
124
|
-
componentId: "sc-goz7la-0"
|
|
125
|
-
})(["margin:0 3px;", " ", ";"], props => props.isClipped && clippedStyling, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$x, props));
|
|
126
|
-
StyledHeaderItemText.defaultProps = {
|
|
127
|
-
theme: reactTheming.DEFAULT_THEME
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const COMPONENT_ID$w = 'chrome.nav';
|
|
131
|
-
const colorStyles$6 = props => {
|
|
132
|
-
const shade = props.isDark || props.isLight ? 600 : 700;
|
|
133
|
-
const backgroundColor = reactTheming.getColor(props.hue, shade, props.theme);
|
|
134
|
-
const foregroundColor = props.isLight ? props.theme.palette.black : props.theme.palette.white;
|
|
135
|
-
return styled.css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
136
|
-
};
|
|
137
|
-
const getNavWidth = props => {
|
|
138
|
-
return `${props.theme.space.base * 15}px`;
|
|
139
|
-
};
|
|
140
|
-
const getExpandedNavWidth = () => {
|
|
141
|
-
return `200px`;
|
|
142
|
-
};
|
|
143
|
-
const StyledNav = styled__default.default.nav.attrs({
|
|
144
|
-
'data-garden-id': COMPONENT_ID$w,
|
|
145
|
-
'data-garden-version': '9.0.0-next.2'
|
|
146
|
-
}).withConfig({
|
|
147
|
-
displayName: "StyledNav",
|
|
148
|
-
componentId: "sc-6j462r-0"
|
|
149
|
-
})(["display:flex;position:relative;flex-direction:column;flex-shrink:0;order:-1;width:", ";font-size:", ";", ";", ";"], props => props.isExpanded ? getExpandedNavWidth : getNavWidth, props => props.theme.fontSizes.md, props => colorStyles$6(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$w, props));
|
|
150
|
-
StyledNav.defaultProps = {
|
|
151
|
-
theme: reactTheming.DEFAULT_THEME
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const COMPONENT_ID$v = 'chrome.header_item';
|
|
155
|
-
const retrieveProductColor$1 = props => {
|
|
156
|
-
switch (props.product) {
|
|
157
|
-
case 'chat':
|
|
158
|
-
return reactTheming.PALETTE.product.chat;
|
|
159
|
-
case 'connect':
|
|
160
|
-
return reactTheming.PALETTE.product.connect;
|
|
161
|
-
case 'explore':
|
|
162
|
-
return reactTheming.PALETTE.product.explore;
|
|
163
|
-
case 'guide':
|
|
164
|
-
return reactTheming.PALETTE.product.guide;
|
|
165
|
-
case 'message':
|
|
166
|
-
return reactTheming.PALETTE.product.message;
|
|
167
|
-
case 'support':
|
|
168
|
-
return reactTheming.PALETTE.product.support;
|
|
169
|
-
case 'talk':
|
|
170
|
-
return reactTheming.PALETTE.product.talk;
|
|
171
|
-
default:
|
|
172
|
-
return 'inherit';
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
const StyledLogoHeaderItem = styled__default.default(StyledBaseHeaderItem).attrs({
|
|
176
|
-
'data-garden-id': COMPONENT_ID$v,
|
|
177
|
-
'data-garden-version': '9.0.0-next.2',
|
|
178
|
-
as: 'div'
|
|
179
|
-
}).withConfig({
|
|
180
|
-
displayName: "StyledLogoHeaderItem",
|
|
181
|
-
componentId: "sc-1n1d1yv-0"
|
|
182
|
-
})(["display:none;order:0;margin-right:", ";margin-left:", ";border-", ":", ";border-radius:0;padding:0;width:", ";height:100%;overflow:hidden;fill:", ";text-decoration:none;color:", ";", "{", "}", "{margin:0;width:", ";height:", ";}", ";"], props => props.theme.rtl ? `-${props.theme.space.base}px` : 'auto', props => props.theme.rtl ? 'auto' : `-${props.theme.space.base}px`, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.borders.sm} ${reactTheming.getColor('neutralHue', 300, props.theme)}`, props => getNavWidth(props), props => reactTheming.getColor('chromeHue', 700, props.theme), props => retrieveProductColor$1(props), StyledHeaderItemText, clippedStyling, StyledHeaderItemIcon, props => props.theme.iconSizes.lg, props => props.theme.iconSizes.lg, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$v, props));
|
|
183
|
-
StyledLogoHeaderItem.defaultProps = {
|
|
184
|
-
theme: reactTheming.DEFAULT_THEME
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const COMPONENT_ID$u = 'chrome.base_nav_item';
|
|
188
|
-
const getNavItemHeight = props => {
|
|
189
|
-
return `${props.theme.space.base * 13}px`;
|
|
190
|
-
};
|
|
191
|
-
const sizeStyles$3 = props => {
|
|
192
|
-
const verticalPadding = polished.math(`(${getNavItemHeight(props)} - ${props.theme.iconSizes.lg}) / 2`);
|
|
193
|
-
const horizontalPadding = polished.math(`(${getNavWidth(props)} - ${props.theme.iconSizes.lg}) / 4`);
|
|
194
|
-
return styled.css(["padding:", " ", ";min-height:", ";"], verticalPadding, horizontalPadding, getNavItemHeight);
|
|
195
|
-
};
|
|
196
|
-
const StyledBaseNavItem = styled__default.default.button.attrs({
|
|
197
|
-
'data-garden-id': COMPONENT_ID$u,
|
|
198
|
-
'data-garden-version': '9.0.0-next.2'
|
|
199
|
-
}).withConfig({
|
|
200
|
-
displayName: "StyledBaseNavItem",
|
|
201
|
-
componentId: "sc-zvo43f-0"
|
|
202
|
-
})(["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;border:none;box-sizing:border-box;background:transparent;text-decoration:none;color:inherit;font-size:inherit;", ""], props => sizeStyles$3(props));
|
|
203
|
-
StyledBaseNavItem.defaultProps = {
|
|
204
|
-
theme: reactTheming.DEFAULT_THEME
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const COMPONENT_ID$t = 'chrome.header';
|
|
208
|
-
const getHeaderHeight = props => {
|
|
209
|
-
return getNavItemHeight(props);
|
|
210
|
-
};
|
|
211
|
-
const StyledHeader = styled__default.default.header.attrs({
|
|
212
|
-
'data-garden-id': COMPONENT_ID$t,
|
|
213
|
-
'data-garden-version': '9.0.0-next.2'
|
|
214
|
-
}).withConfig({
|
|
215
|
-
displayName: "StyledHeader",
|
|
216
|
-
componentId: "sc-1cexpz-0"
|
|
217
|
-
})(["display:flex;position:", ";align-items:center;justify-content:flex-end;box-sizing:border-box;border-bottom:", ";box-shadow:", ";background-color:", ";padding:0 ", "px;height:", ";color:", ";font-size:", ";", " ", ";"], props => props.isStandalone && 'relative', props => `${props.theme.borders.sm} ${reactTheming.getColor('neutralHue', 300, props.theme)}`, props => props.isStandalone && props.theme.shadows.lg('0', '10px', reactTheming.getColor('chromeHue', 600, props.theme, 0.15)), props => props.theme.colors.background, props => props.theme.space.base, getHeaderHeight, props => reactTheming.getColor('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => props.isStandalone && `
|
|
218
|
-
${StyledLogoHeaderItem} {
|
|
219
|
-
display: inline-flex;
|
|
220
|
-
}
|
|
221
|
-
`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$t, props));
|
|
222
|
-
StyledHeader.defaultProps = {
|
|
223
|
-
theme: reactTheming.DEFAULT_THEME
|
|
59
|
+
const getFooterHeight = theme => `${theme.space.base * 20}px`;
|
|
60
|
+
const getHeaderHeight = theme => `${theme.space.base * 13}px`;
|
|
61
|
+
const getHeaderItemSize = theme => `${theme.space.base * 7.5}px`;
|
|
62
|
+
const getNavItemHeight = theme => getHeaderHeight(theme);
|
|
63
|
+
const getNavWidth = theme => `${theme.space.base * 15}px`;
|
|
64
|
+
const getNavWidthExpanded = () => `200px`;
|
|
65
|
+
const getProductColor = function (product) {
|
|
66
|
+
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'inherit';
|
|
67
|
+
return product ? reactTheming.PALETTE.product[product] || fallback : fallback;
|
|
224
68
|
};
|
|
225
69
|
|
|
226
|
-
const COMPONENT_ID$
|
|
70
|
+
const COMPONENT_ID$v = 'chrome.skipnav';
|
|
227
71
|
const animationStyles = () => {
|
|
228
72
|
const animationName = styled.keyframes(["0%{transform:translate(-50%,-50%);}"]);
|
|
229
73
|
return styled.css(["transition:opacity 0.2s ease-out,clip 0s linear 0.2s;opacity:0;clip:rect(0,0,0,0);&:focus{transition:opacity 0.2s ease-in-out;animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";opacity:1;clip:rect(0,150vw,100vh,-50vw);}"], animationName);
|
|
230
74
|
};
|
|
231
|
-
const colorStyles$
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
75
|
+
const colorStyles$a = _ref => {
|
|
76
|
+
let {
|
|
77
|
+
theme
|
|
78
|
+
} = _ref;
|
|
79
|
+
const backgroundColor = reactTheming.getColor({
|
|
80
|
+
theme,
|
|
81
|
+
variable: 'background.raised'
|
|
82
|
+
});
|
|
83
|
+
const borderColor = reactTheming.getColor({
|
|
84
|
+
theme,
|
|
85
|
+
variable: 'border.default'
|
|
86
|
+
});
|
|
87
|
+
const boxShadowColor = reactTheming.getColor({
|
|
88
|
+
variable: 'shadow.medium',
|
|
89
|
+
theme
|
|
90
|
+
});
|
|
91
|
+
const boxShadow = theme.shadows.lg(`${theme.space.base * 4}px`, `${theme.space.base * 6}px`, boxShadowColor);
|
|
92
|
+
const foregroundColor = reactTheming.getColor({
|
|
93
|
+
theme,
|
|
94
|
+
variable: 'foreground.primary'
|
|
95
|
+
});
|
|
96
|
+
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover,&:focus{color:", ";}", ""], borderColor, boxShadow, backgroundColor, foregroundColor, foregroundColor, reactTheming.focusStyles({
|
|
236
97
|
theme,
|
|
237
98
|
inset: true,
|
|
238
99
|
boxShadow
|
|
239
100
|
}));
|
|
240
101
|
};
|
|
241
|
-
const sizeStyles$
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const
|
|
102
|
+
const sizeStyles$g = _ref2 => {
|
|
103
|
+
let {
|
|
104
|
+
theme
|
|
105
|
+
} = _ref2;
|
|
106
|
+
const top = polished.math(`${getHeaderHeight(theme)} / 2`);
|
|
107
|
+
const border = theme.borders.sm;
|
|
108
|
+
const padding = `${theme.space.base * 5}px`;
|
|
109
|
+
const paddingStart = `${theme.space.base * 4}px`;
|
|
110
|
+
const fontSize = theme.fontSizes.md;
|
|
246
111
|
const lineHeight = reactTheming.getLineHeight(padding, fontSize);
|
|
247
|
-
return styled.css(["top:", ";padding:", ";padding-", ":", ";line-height:", ";font-size:", ";"], top, padding,
|
|
112
|
+
return styled.css(["top:", ";border:", ";padding:", ";padding-", ":", ";line-height:", ";font-size:", ";"], top, border, padding, theme.rtl ? 'right' : 'left', paddingStart, lineHeight, fontSize);
|
|
248
113
|
};
|
|
249
114
|
const StyledSkipNav = styled__default.default.a.attrs({
|
|
250
|
-
'data-garden-id': COMPONENT_ID$
|
|
251
|
-
'data-garden-version': '9.0.0-next.
|
|
115
|
+
'data-garden-id': COMPONENT_ID$v,
|
|
116
|
+
'data-garden-version': '9.0.0-next.20'
|
|
252
117
|
}).withConfig({
|
|
253
118
|
displayName: "StyledSkipNav",
|
|
254
119
|
componentId: "sc-1tsro34-0"
|
|
255
|
-
})(["", ";display:inline-flex;position:absolute;left:50%;align-items:center;justify-content:center;transform:translateX(-50%);direction:", ";z-index:", ";border
|
|
120
|
+
})(["", ";display:inline-flex;position:absolute;left:50%;align-items:center;justify-content:center;transform:translateX(-50%);direction:", ";z-index:", ";border-radius:", ";text-decoration:underline;white-space:nowrap;", ";", "{text-decoration:none;}&:hover{text-decoration:underline;}", ";", ";"], animationStyles(), props => props.theme.rtl && 'rtl', props => props.zIndex, props => props.theme.borderRadii.md, sizeStyles$g, reactTheming.SELECTOR_FOCUS_VISIBLE, colorStyles$a, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$v, props));
|
|
256
121
|
StyledSkipNav.defaultProps = {
|
|
257
122
|
theme: reactTheming.DEFAULT_THEME
|
|
258
123
|
};
|
|
259
124
|
|
|
260
|
-
var _path$
|
|
261
|
-
function _extends$
|
|
125
|
+
var _path$1;
|
|
126
|
+
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
262
127
|
var SvgLinkStroke = function SvgLinkStroke(props) {
|
|
263
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
128
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
264
129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
265
130
|
width: 16,
|
|
266
131
|
height: 16,
|
|
267
132
|
focusable: "false",
|
|
268
133
|
viewBox: "0 0 16 16",
|
|
269
134
|
"aria-hidden": "true"
|
|
270
|
-
}, props), _path$
|
|
135
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
271
136
|
fill: "currentColor",
|
|
272
137
|
d: "M4.441 7.38l.095.083.939.939-.708.707-.939-.939-2 2-.132.142a2.829 2.829 0 003.99 3.99l.142-.132 2-2-.939-.939.707-.708.94.94a1 1 0 01.083 1.32l-.083.094-2 2A3.828 3.828 0 01.972 9.621l.15-.158 2-2A1 1 0 014.34 7.31l.101.07zm7.413-3.234a.5.5 0 01.057.638l-.057.07-7 7a.5.5 0 01-.765-.638l.057-.07 7-7a.5.5 0 01.708 0zm3.023-3.025a3.829 3.829 0 01.15 5.257l-.15.158-2 2a1 1 0 01-1.32.083l-.094-.083-.94-.94.708-.707.939.94 2-2 .132-.142a2.829 2.829 0 00-3.99-3.99l-.142.131-2 2 .939.939-.707.708-.94-.94a1 1 0 01-.082-1.32l.083-.094 2-2a3.828 3.828 0 015.414 0z"
|
|
273
138
|
})));
|
|
274
139
|
};
|
|
275
140
|
|
|
276
|
-
const COMPONENT_ID$
|
|
277
|
-
const sizeStyles$
|
|
141
|
+
const COMPONENT_ID$u = 'chrome.skipnav_icon';
|
|
142
|
+
const sizeStyles$f = _ref => {
|
|
143
|
+
let {
|
|
144
|
+
theme
|
|
145
|
+
} = _ref;
|
|
278
146
|
const margin = `${theme.space.base * 2}px`;
|
|
279
147
|
const size = theme.iconSizes.md;
|
|
280
148
|
return styled.css(["margin-", ":", ";width:", ";height:", ";"], theme.rtl ? 'left' : 'right', margin, size, size);
|
|
281
149
|
};
|
|
282
150
|
const StyledSkipNavIcon = styled__default.default(SvgLinkStroke).attrs({
|
|
283
|
-
'data-garden-id': COMPONENT_ID$
|
|
284
|
-
'data-garden-version': '9.0.0-next.
|
|
151
|
+
'data-garden-id': COMPONENT_ID$u,
|
|
152
|
+
'data-garden-version': '9.0.0-next.20'
|
|
285
153
|
}).withConfig({
|
|
286
154
|
displayName: "StyledSkipNavIcon",
|
|
287
155
|
componentId: "sc-1ika5z4-0"
|
|
288
|
-
})(["transform:", ";color:", ";", ";", ";"],
|
|
156
|
+
})(["transform:", ";color:", ";", ";", ";"], p => p.theme.rtl && 'scaleX(-1)', p => reactTheming.getColor({
|
|
157
|
+
theme: p.theme,
|
|
158
|
+
variable: 'foreground.subtle'
|
|
159
|
+
}), sizeStyles$f, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$u, props));
|
|
289
160
|
StyledSkipNavIcon.defaultProps = {
|
|
290
161
|
theme: reactTheming.DEFAULT_THEME
|
|
291
162
|
};
|
|
292
163
|
|
|
293
|
-
const COMPONENT_ID$
|
|
164
|
+
const COMPONENT_ID$t = 'chrome.body';
|
|
294
165
|
const StyledBody = styled__default.default.div.attrs({
|
|
295
|
-
'data-garden-id': COMPONENT_ID$
|
|
296
|
-
'data-garden-version': '9.0.0-next.
|
|
166
|
+
'data-garden-id': COMPONENT_ID$t,
|
|
167
|
+
'data-garden-version': '9.0.0-next.20'
|
|
297
168
|
}).withConfig({
|
|
298
169
|
displayName: "StyledBody",
|
|
299
170
|
componentId: "sc-c7h9kv-0"
|
|
300
|
-
})(["flex:1;order:1;background-color:", ";min-width:0;", ";"], props => reactTheming.getColor(
|
|
171
|
+
})(["flex:1;order:1;background-color:", ";min-width:0;", ";"], props => reactTheming.getColor({
|
|
172
|
+
theme: props.theme,
|
|
173
|
+
variable: 'background.default'
|
|
174
|
+
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$t, props));
|
|
301
175
|
StyledBody.defaultProps = {
|
|
302
176
|
theme: reactTheming.DEFAULT_THEME
|
|
303
177
|
};
|
|
304
178
|
|
|
305
|
-
const COMPONENT_ID$
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
})
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
})(["display:flex;align-items:center;justify-content:flex-end;box-sizing:border-box;border-top:", ";background-color:", ";padding:0 ", "px;height:", ";", ";"], props => `${props.theme.borders.sm} ${reactTheming.getColor('neutralHue', 300, props.theme)}`, props => props.theme.colors.background, props => props.theme.space.base * 9, getFooterHeight, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$p, props));
|
|
316
|
-
StyledFooter.defaultProps = {
|
|
317
|
-
theme: reactTheming.DEFAULT_THEME
|
|
179
|
+
const COMPONENT_ID$s = 'chrome.content';
|
|
180
|
+
const sizeStyles$e = _ref => {
|
|
181
|
+
let {
|
|
182
|
+
theme,
|
|
183
|
+
hasFooter
|
|
184
|
+
} = _ref;
|
|
185
|
+
const fontSize = theme.fontSizes.md;
|
|
186
|
+
const height = hasFooter ? `calc(100% - ${polished.math(`${getHeaderHeight(theme)} + ${getFooterHeight(theme)}`)})` : `calc(100% - ${getHeaderHeight(theme)})`;
|
|
187
|
+
const lineHeight = reactTheming.getLineHeight(theme.lineHeights.md, theme.fontSizes.md);
|
|
188
|
+
return styled.css(["height:", ";line-height:", ";font-size:", ";"], height, lineHeight, fontSize);
|
|
318
189
|
};
|
|
319
|
-
|
|
320
|
-
const COMPONENT_ID$o = 'chrome.content';
|
|
321
190
|
const StyledContent = styled__default.default.div.attrs({
|
|
322
|
-
'data-garden-id': COMPONENT_ID$
|
|
323
|
-
'data-garden-version': '9.0.0-next.
|
|
191
|
+
'data-garden-id': COMPONENT_ID$s,
|
|
192
|
+
'data-garden-version': '9.0.0-next.20'
|
|
324
193
|
}).withConfig({
|
|
325
194
|
displayName: "StyledContent",
|
|
326
195
|
componentId: "sc-qcuzxn-0"
|
|
327
|
-
})(["display:flex;
|
|
196
|
+
})(["display:flex;color-scheme:only ", ";color:", ";", ";&:focus{outline:none;}", ";"], p => p.theme.colors.base, props => reactTheming.getColor({
|
|
197
|
+
theme: props.theme,
|
|
198
|
+
variable: 'foreground.default'
|
|
199
|
+
}), sizeStyles$e, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$s, props));
|
|
328
200
|
StyledContent.defaultProps = {
|
|
329
201
|
theme: reactTheming.DEFAULT_THEME
|
|
330
202
|
};
|
|
331
203
|
|
|
332
|
-
const COMPONENT_ID$
|
|
204
|
+
const COMPONENT_ID$r = 'chrome.main';
|
|
333
205
|
const StyledMain = styled__default.default.main.attrs({
|
|
334
|
-
'data-garden-id': COMPONENT_ID$
|
|
335
|
-
'data-garden-version': '9.0.0-next.
|
|
206
|
+
'data-garden-id': COMPONENT_ID$r,
|
|
207
|
+
'data-garden-version': '9.0.0-next.20'
|
|
336
208
|
}).withConfig({
|
|
337
209
|
displayName: "StyledMain",
|
|
338
210
|
componentId: "sc-t61cre-0"
|
|
339
|
-
})(["flex:1;order:1;background-color:", ";overflow:auto;:focus{outline:none;}", ";"], props =>
|
|
211
|
+
})(["flex:1;order:1;background-color:", ";overflow:auto;:focus{outline:none;}", ";"], props => reactTheming.getColor({
|
|
212
|
+
theme: props.theme,
|
|
213
|
+
variable: 'background.default'
|
|
214
|
+
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$r, props));
|
|
340
215
|
StyledMain.defaultProps = {
|
|
341
216
|
theme: reactTheming.DEFAULT_THEME
|
|
342
217
|
};
|
|
343
218
|
|
|
344
|
-
const COMPONENT_ID$
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
219
|
+
const COMPONENT_ID$q = 'chrome.footer';
|
|
220
|
+
const colorStyles$9 = _ref => {
|
|
221
|
+
let {
|
|
222
|
+
theme
|
|
223
|
+
} = _ref;
|
|
224
|
+
const backgroundColor = reactTheming.getColor({
|
|
225
|
+
theme,
|
|
226
|
+
variable: 'background.default'
|
|
227
|
+
});
|
|
228
|
+
const borderColor = reactTheming.getColor({
|
|
229
|
+
theme,
|
|
230
|
+
variable: 'border.default'
|
|
231
|
+
});
|
|
232
|
+
return styled.css(["border-top-color:", ";background-color:", ";"], borderColor, backgroundColor);
|
|
233
|
+
};
|
|
234
|
+
const sizeStyles$d = _ref2 => {
|
|
235
|
+
let {
|
|
236
|
+
theme
|
|
237
|
+
} = _ref2;
|
|
238
|
+
const border = theme.borders.sm;
|
|
239
|
+
const padding = `0 ${theme.space.base * 9}px`;
|
|
240
|
+
const height = getFooterHeight(theme);
|
|
241
|
+
return styled.css(["box-sizing:border-box;border-top:", ";padding:", ";height:", ";"], border, padding, height);
|
|
242
|
+
};
|
|
243
|
+
const StyledFooter = styled__default.default.footer.attrs({
|
|
244
|
+
'data-garden-id': COMPONENT_ID$q,
|
|
245
|
+
'data-garden-version': '9.0.0-next.20'
|
|
348
246
|
}).withConfig({
|
|
349
|
-
displayName: "
|
|
350
|
-
componentId: "sc-
|
|
351
|
-
})(["flex-
|
|
352
|
-
|
|
247
|
+
displayName: "StyledFooter",
|
|
248
|
+
componentId: "sc-v7lib2-0"
|
|
249
|
+
})(["display:flex;align-items:center;justify-content:flex-end;", ";", ";", ";"], sizeStyles$d, colorStyles$9, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$q, props));
|
|
250
|
+
StyledFooter.defaultProps = {
|
|
353
251
|
theme: reactTheming.DEFAULT_THEME
|
|
354
252
|
};
|
|
355
253
|
|
|
356
|
-
const COMPONENT_ID$
|
|
254
|
+
const COMPONENT_ID$p = 'chrome.footer_item';
|
|
357
255
|
const StyledFooterItem = styled__default.default.div.attrs({
|
|
358
|
-
'data-garden-id': COMPONENT_ID$
|
|
359
|
-
'data-garden-version': '9.0.0-next.
|
|
256
|
+
'data-garden-id': COMPONENT_ID$p,
|
|
257
|
+
'data-garden-version': '9.0.0-next.20'
|
|
360
258
|
}).withConfig({
|
|
361
259
|
displayName: "StyledFooterItem",
|
|
362
260
|
componentId: "sc-1cktm85-0"
|
|
363
|
-
})(["margin:", ";", ";"], props => `0 ${props.theme.space.base}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
261
|
+
})(["margin:", ";", ";"], props => `0 ${props.theme.space.base}px`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$p, props));
|
|
364
262
|
StyledFooterItem.defaultProps = {
|
|
365
263
|
theme: reactTheming.DEFAULT_THEME
|
|
366
264
|
};
|
|
367
265
|
|
|
368
|
-
const COMPONENT_ID$
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
};
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}).withConfig({
|
|
377
|
-
displayName: "StyledHeaderItem",
|
|
378
|
-
componentId: "sc-14sft6n-0"
|
|
379
|
-
})(["&:hover,&:focus{text-decoration:none;color:inherit;}", " &:focus-visible:active,&[data-garden-focus-visible]:active{box-shadow:none;}&:hover ", ",&:hover ", ",&:active ", ",&:active ", "{color:", ";}", " ", " ", ";"], props => reactTheming.focusStyles({
|
|
380
|
-
theme: props.theme,
|
|
381
|
-
inset: props.maxY
|
|
382
|
-
}), StyledHeaderItemIcon, StyledHeaderItemText, StyledHeaderItemIcon, StyledHeaderItemText, props => reactTheming.getColor('chromeHue', 700, props.theme), imgStyles, props => props.isRound && `
|
|
383
|
-
${StyledHeaderItemIcon} {
|
|
384
|
-
border-radius: 100px;
|
|
385
|
-
}
|
|
386
|
-
`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$k, props));
|
|
387
|
-
StyledHeaderItem.defaultProps = {
|
|
388
|
-
theme: reactTheming.DEFAULT_THEME
|
|
266
|
+
const COMPONENT_ID$o = 'chrome.header_item_icon';
|
|
267
|
+
const sizeStyles$c = _ref => {
|
|
268
|
+
let {
|
|
269
|
+
theme
|
|
270
|
+
} = _ref;
|
|
271
|
+
const margin = `0 ${theme.space.base * 0.75}px`;
|
|
272
|
+
const size = theme.iconSizes.md;
|
|
273
|
+
return styled.css(["margin:", ";width:", ";min-width:", ";height:", ";"], margin, size, size, size);
|
|
389
274
|
};
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
'data-garden-id': COMPONENT_ID$j,
|
|
394
|
-
'data-garden-version': '9.0.0-next.2',
|
|
395
|
-
as: 'div'
|
|
275
|
+
const StyledHeaderItemIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
|
|
276
|
+
'data-garden-id': COMPONENT_ID$o,
|
|
277
|
+
'data-garden-version': '9.0.0-next.20'
|
|
396
278
|
}).withConfig({
|
|
397
|
-
displayName: "
|
|
398
|
-
componentId: "sc-
|
|
399
|
-
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
400
|
-
|
|
279
|
+
displayName: "StyledHeaderItemIcon",
|
|
280
|
+
componentId: "sc-1jhhp6z-0"
|
|
281
|
+
})(["transition:transform 0.25s ease-in-out;", ";", ";"], sizeStyles$c, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$o, props));
|
|
282
|
+
StyledHeaderItemIcon.defaultProps = {
|
|
401
283
|
theme: reactTheming.DEFAULT_THEME
|
|
402
284
|
};
|
|
403
285
|
|
|
404
|
-
const COMPONENT_ID$
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
286
|
+
const COMPONENT_ID$n = 'chrome.base_header_item';
|
|
287
|
+
const sizeStyles$b = _ref => {
|
|
288
|
+
let {
|
|
289
|
+
theme,
|
|
290
|
+
maxY,
|
|
291
|
+
isRound
|
|
292
|
+
} = _ref;
|
|
293
|
+
const margin = `0 ${theme.space.base * 3}px`;
|
|
294
|
+
const size = getHeaderItemSize(theme);
|
|
295
|
+
const height = maxY ? '100%' : size;
|
|
296
|
+
const lineHeight = reactTheming.getLineHeight(size, theme.fontSizes.md);
|
|
297
|
+
const padding = `0 ${theme.space.base * 0.75}px`;
|
|
298
|
+
let borderRadius;
|
|
299
|
+
if (isRound) {
|
|
300
|
+
borderRadius = '100%';
|
|
301
|
+
} else if (maxY) {
|
|
302
|
+
borderRadius = '0';
|
|
303
|
+
} else {
|
|
304
|
+
borderRadius = theme.borderRadii.md;
|
|
423
305
|
}
|
|
306
|
+
return styled.css(["margin:", ";border-radius:", ";padding:", ";min-width:", ";height:", ";line-height:", ";font-size:inherit;"], margin, borderRadius, padding, size, height, lineHeight);
|
|
424
307
|
};
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
return styled.css(["color:", ";fill:", ";"], color, fillColor);
|
|
429
|
-
};
|
|
430
|
-
const StyledLogoNavItem = styled__default.default(StyledBaseNavItem).attrs({
|
|
431
|
-
'data-garden-id': COMPONENT_ID$i,
|
|
432
|
-
'data-garden-version': '9.0.0-next.2',
|
|
433
|
-
as: 'div'
|
|
308
|
+
const StyledBaseHeaderItem = styled__default.default.button.attrs({
|
|
309
|
+
'data-garden-id': COMPONENT_ID$n,
|
|
310
|
+
'data-garden-version': '9.0.0-next.20'
|
|
434
311
|
}).withConfig({
|
|
435
|
-
displayName: "
|
|
436
|
-
componentId: "sc-
|
|
437
|
-
})(["order:0;
|
|
438
|
-
|
|
312
|
+
displayName: "StyledBaseHeaderItem",
|
|
313
|
+
componentId: "sc-1qua7h6-0"
|
|
314
|
+
})(["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$b, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$n, props));
|
|
315
|
+
StyledBaseHeaderItem.defaultProps = {
|
|
439
316
|
theme: reactTheming.DEFAULT_THEME
|
|
440
317
|
};
|
|
441
318
|
|
|
442
|
-
const COMPONENT_ID$
|
|
443
|
-
const
|
|
444
|
-
'data-garden-id': COMPONENT_ID$
|
|
445
|
-
'data-garden-version': '9.0.0-next.
|
|
446
|
-
as: 'div'
|
|
319
|
+
const COMPONENT_ID$m = 'chrome.header_item_text';
|
|
320
|
+
const StyledHeaderItemText = styled__default.default.span.attrs({
|
|
321
|
+
'data-garden-id': COMPONENT_ID$m,
|
|
322
|
+
'data-garden-version': '9.0.0-next.20'
|
|
447
323
|
}).withConfig({
|
|
448
|
-
displayName: "
|
|
449
|
-
componentId: "sc-
|
|
450
|
-
})(["
|
|
451
|
-
|
|
324
|
+
displayName: "StyledHeaderItemText",
|
|
325
|
+
componentId: "sc-goz7la-0"
|
|
326
|
+
})(["margin:", ";", " ", ";"], props => `0 ${props.theme.space.base * 0.75}px`, props => props.isClipped && polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$m, props));
|
|
327
|
+
StyledHeaderItemText.defaultProps = {
|
|
452
328
|
theme: reactTheming.DEFAULT_THEME
|
|
453
329
|
};
|
|
454
330
|
|
|
455
|
-
const COMPONENT_ID$
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
|
|
331
|
+
const COMPONENT_ID$l = 'chrome.header_item';
|
|
332
|
+
const colorStyles$8 = _ref => {
|
|
333
|
+
let {
|
|
334
|
+
theme,
|
|
335
|
+
product
|
|
336
|
+
} = _ref;
|
|
337
|
+
const borderColor = reactTheming.getColor({
|
|
338
|
+
theme,
|
|
339
|
+
variable: 'border.default'
|
|
340
|
+
});
|
|
341
|
+
const fill = reactTheming.getColor({
|
|
342
|
+
theme,
|
|
343
|
+
variable: 'foreground.default'
|
|
344
|
+
});
|
|
345
|
+
const color = getProductColor(product, fill );
|
|
346
|
+
return styled.css(["border-", "-color:", ";color:", ";fill:", ";"], theme.rtl ? 'left' : 'right', borderColor, color, fill);
|
|
347
|
+
};
|
|
348
|
+
const sizeStyles$a = _ref2 => {
|
|
349
|
+
let {
|
|
350
|
+
theme
|
|
351
|
+
} = _ref2;
|
|
352
|
+
const border = theme.borders.sm;
|
|
353
|
+
const iconSize = theme.iconSizes.lg;
|
|
354
|
+
const marginRight = theme.rtl ? `-${theme.space.base}px` : 'auto';
|
|
355
|
+
const marginLeft = theme.rtl ? 'auto' : `-${theme.space.base}px`;
|
|
356
|
+
const width = getNavWidth(theme);
|
|
357
|
+
return styled.css(["margin-right:", ";margin-left:", ";border-", ":", ";width:", ";height:100%;", "{margin:0;width:", ";height:", ";}"], marginRight, marginLeft, theme.rtl ? 'left' : 'right', border, width, StyledHeaderItemIcon, iconSize, iconSize);
|
|
358
|
+
};
|
|
359
|
+
const StyledLogoHeaderItem = styled__default.default(StyledBaseHeaderItem).attrs({
|
|
360
|
+
'data-garden-id': COMPONENT_ID$l,
|
|
361
|
+
'data-garden-version': '9.0.0-next.20',
|
|
362
|
+
as: 'div'
|
|
459
363
|
}).withConfig({
|
|
460
|
-
displayName: "
|
|
461
|
-
componentId: "sc-
|
|
462
|
-
})(["
|
|
463
|
-
|
|
364
|
+
displayName: "StyledLogoHeaderItem",
|
|
365
|
+
componentId: "sc-1n1d1yv-0"
|
|
366
|
+
})(["display:none;order:0;border-radius:0;padding:0;overflow:hidden;text-decoration:none;", ";", ";", "{", "}", ";"], sizeStyles$a, colorStyles$8, StyledHeaderItemText, polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$l, props));
|
|
367
|
+
StyledLogoHeaderItem.defaultProps = {
|
|
464
368
|
theme: reactTheming.DEFAULT_THEME
|
|
465
369
|
};
|
|
466
370
|
|
|
467
|
-
const COMPONENT_ID$
|
|
468
|
-
const colorStyles$
|
|
469
|
-
|
|
371
|
+
const COMPONENT_ID$k = 'chrome.header';
|
|
372
|
+
const colorStyles$7 = _ref => {
|
|
373
|
+
let {
|
|
470
374
|
theme,
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
isCurrent
|
|
475
|
-
} = props;
|
|
476
|
-
const DARK = theme.palette.black;
|
|
477
|
-
const LIGHT = theme.palette.white;
|
|
478
|
-
let currentColor;
|
|
479
|
-
let hoverColor;
|
|
480
|
-
if (isCurrent) {
|
|
481
|
-
if (isLight) {
|
|
482
|
-
currentColor = polished.rgba(DARK, 0.4);
|
|
483
|
-
} else if (isDark) {
|
|
484
|
-
currentColor = polished.rgba(LIGHT, 0.4);
|
|
485
|
-
} else {
|
|
486
|
-
currentColor = reactTheming.getColor(hue, 500, theme);
|
|
487
|
-
}
|
|
488
|
-
} else {
|
|
489
|
-
hoverColor = polished.rgba(isLight ? LIGHT : DARK, 0.1);
|
|
490
|
-
}
|
|
491
|
-
const activeColor = polished.rgba(isLight ? DARK : LIGHT, 0.1);
|
|
492
|
-
const focusColor = isLight ? DARK : LIGHT;
|
|
493
|
-
return styled.css(["opacity:", ";outline-color:transparent;background-color:", ";&:hover{opacity:1;background-color:", ";}", " &:active{background-color:", ";}"], isCurrent ? 1 : 0.6, currentColor, hoverColor, reactTheming.focusStyles({
|
|
375
|
+
isStandalone
|
|
376
|
+
} = _ref;
|
|
377
|
+
const backgroundColor = reactTheming.getColor({
|
|
494
378
|
theme,
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
})
|
|
379
|
+
variable: 'background.default'
|
|
380
|
+
});
|
|
381
|
+
const borderColor = reactTheming.getColor({
|
|
382
|
+
theme,
|
|
383
|
+
variable: 'border.default'
|
|
384
|
+
});
|
|
385
|
+
const boxShadowColor = reactTheming.getColor({
|
|
386
|
+
variable: 'shadow.small',
|
|
387
|
+
theme
|
|
388
|
+
});
|
|
389
|
+
const boxShadow = isStandalone ? theme.shadows.lg('0', `${theme.space.base * 2}px`, boxShadowColor) : undefined;
|
|
390
|
+
const foregroundColor = reactTheming.getColor({
|
|
391
|
+
theme,
|
|
392
|
+
variable: 'foreground.subtle'
|
|
393
|
+
});
|
|
394
|
+
return styled.css(["border-bottom-color:", ";box-shadow:", ";background-color:", ";color:", ";"], borderColor, boxShadow, backgroundColor, foregroundColor);
|
|
501
395
|
};
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
margin: 0 ${polished.math(`(${getNavWidth(props)} - ${props.theme.iconSizes.lg}) / 4`)};
|
|
512
|
-
}
|
|
513
|
-
`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$f, props));
|
|
514
|
-
StyledNavItem.defaultProps = {
|
|
515
|
-
theme: reactTheming.DEFAULT_THEME
|
|
396
|
+
const sizeStyles$9 = _ref2 => {
|
|
397
|
+
let {
|
|
398
|
+
theme
|
|
399
|
+
} = _ref2;
|
|
400
|
+
const border = theme.borders.sm;
|
|
401
|
+
const padding = `0 ${theme.space.base}px`;
|
|
402
|
+
const fontSize = theme.fontSizes.md;
|
|
403
|
+
const height = getHeaderHeight(theme);
|
|
404
|
+
return styled.css(["box-sizing:border-box;border-bottom:", ";padding:", ";height:", ";font-size:", ";"], border, padding, height, fontSize);
|
|
516
405
|
};
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
'data-garden-id': COMPONENT_ID$e,
|
|
521
|
-
'data-garden-version': '9.0.0-next.2'
|
|
406
|
+
const StyledHeader = styled__default.default.header.attrs({
|
|
407
|
+
'data-garden-id': COMPONENT_ID$k,
|
|
408
|
+
'data-garden-version': '9.0.0-next.20'
|
|
522
409
|
}).withConfig({
|
|
523
|
-
displayName: "
|
|
524
|
-
componentId: "sc-
|
|
525
|
-
})(["
|
|
526
|
-
|
|
527
|
-
position: static;
|
|
528
|
-
flex: 1;
|
|
529
|
-
clip: auto;
|
|
530
|
-
width: auto;
|
|
531
|
-
height: auto;
|
|
532
|
-
text-overflow: ellipsis;
|
|
533
|
-
}
|
|
534
|
-
`, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
535
|
-
StyledNavItemText.defaultProps = {
|
|
410
|
+
displayName: "StyledHeader",
|
|
411
|
+
componentId: "sc-1cexpz-0"
|
|
412
|
+
})(["display:flex;position:", ";align-items:center;justify-content:flex-end;", ";", ";", "{display:", ";}", ";"], props => props.isStandalone && 'relative', sizeStyles$9, colorStyles$7, StyledLogoHeaderItem, props => props.isStandalone && 'inline-flex', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$k, props));
|
|
413
|
+
StyledHeader.defaultProps = {
|
|
536
414
|
theme: reactTheming.DEFAULT_THEME
|
|
537
415
|
};
|
|
538
416
|
|
|
539
|
-
const COMPONENT_ID$
|
|
540
|
-
const colorStyles$
|
|
541
|
-
|
|
417
|
+
const COMPONENT_ID$j = 'chrome.header_item';
|
|
418
|
+
const colorStyles$6 = _ref => {
|
|
419
|
+
let {
|
|
542
420
|
theme,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
const DARK = theme.palette.black;
|
|
547
|
-
const LIGHT = theme.palette.white;
|
|
548
|
-
let currentColor;
|
|
549
|
-
let hoverColor;
|
|
550
|
-
if (isCurrent) {
|
|
551
|
-
if (isLight) {
|
|
552
|
-
currentColor = polished.rgba(DARK, 0.1);
|
|
553
|
-
} else {
|
|
554
|
-
currentColor = polished.rgba(LIGHT, 0.1);
|
|
555
|
-
}
|
|
556
|
-
} else {
|
|
557
|
-
hoverColor = polished.rgba(isLight ? LIGHT : DARK, 0.1);
|
|
558
|
-
}
|
|
559
|
-
const activeColor = polished.rgba(isLight ? DARK : LIGHT, 0.03);
|
|
560
|
-
return styled.css(["opacity:", ";background-color:", ";&:hover{opacity:1;background-color:", ";}", " &:not([data-garden-header='true']):active{background-color:", ";}"], isCurrent ? '1' : '0.6', currentColor, hoverColor, reactTheming.focusStyles({
|
|
421
|
+
maxY
|
|
422
|
+
} = _ref;
|
|
423
|
+
const options = {
|
|
561
424
|
theme,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
425
|
+
variable: 'foreground.subtle'
|
|
426
|
+
};
|
|
427
|
+
const hoverColor = reactTheming.getColor({
|
|
428
|
+
...options,
|
|
429
|
+
dark: {
|
|
430
|
+
offset: -100
|
|
431
|
+
},
|
|
432
|
+
light: {
|
|
433
|
+
offset: 100
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
const activeColor = reactTheming.getColor({
|
|
437
|
+
...options,
|
|
438
|
+
dark: {
|
|
439
|
+
offset: -200
|
|
440
|
+
},
|
|
441
|
+
light: {
|
|
442
|
+
offset: 200
|
|
566
443
|
}
|
|
567
|
-
})
|
|
444
|
+
});
|
|
445
|
+
return styled.css(["&:hover,&:focus{color:inherit;}", ";&:hover ", ",&:hover ", "{color:", ";}&:active ", ",&:active ", "{color:", ";}"], reactTheming.focusStyles({
|
|
446
|
+
theme,
|
|
447
|
+
inset: maxY
|
|
448
|
+
}), StyledHeaderItemIcon, StyledHeaderItemText, hoverColor, StyledHeaderItemIcon, StyledHeaderItemText, activeColor);
|
|
568
449
|
};
|
|
569
|
-
const
|
|
570
|
-
|
|
450
|
+
const sizeStyles$8 = _ref2 => {
|
|
451
|
+
let {
|
|
452
|
+
theme,
|
|
453
|
+
isRound
|
|
454
|
+
} = _ref2;
|
|
455
|
+
const iconBorderRadius = isRound ? '100px' : undefined;
|
|
456
|
+
const imageBorderRadius = polished.math(`${theme.borderRadii.md} - 1`);
|
|
457
|
+
const imageSize = polished.math(`${getHeaderItemSize(theme)} - ${theme.space.base * 2}`);
|
|
458
|
+
return styled.css(["img{margin:0;border-radius:", ";width:", ";height:", ";}", "{border-radius:", ";}"], imageBorderRadius, imageSize, imageSize, StyledHeaderItemIcon, iconBorderRadius);
|
|
571
459
|
};
|
|
572
|
-
const
|
|
573
|
-
'data-garden-id': COMPONENT_ID$
|
|
574
|
-
'data-garden-version': '9.0.0-next.
|
|
460
|
+
const StyledHeaderItem = styled__default.default(StyledBaseHeaderItem).attrs({
|
|
461
|
+
'data-garden-id': COMPONENT_ID$j,
|
|
462
|
+
'data-garden-version': '9.0.0-next.20'
|
|
463
|
+
}).withConfig({
|
|
464
|
+
displayName: "StyledHeaderItem",
|
|
465
|
+
componentId: "sc-14sft6n-0"
|
|
466
|
+
})(["cursor:pointer;&:hover,&:focus{text-decoration:none;}", ";", ";& ", ",& ", "{transition:box-shadow 0.1s ease-in-out,color 0.1s ease-in-out;}", ";"], sizeStyles$8, colorStyles$6, StyledHeaderItemIcon, StyledHeaderItemText, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$j, props));
|
|
467
|
+
StyledHeaderItem.defaultProps = {
|
|
468
|
+
theme: reactTheming.DEFAULT_THEME
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
const COMPONENT_ID$i = 'chrome.header_item_wrapper';
|
|
472
|
+
const StyledHeaderItemWrapper = styled__default.default(StyledBaseHeaderItem).attrs({
|
|
473
|
+
'data-garden-id': COMPONENT_ID$i,
|
|
474
|
+
'data-garden-version': '9.0.0-next.20',
|
|
475
|
+
as: 'div'
|
|
575
476
|
}).withConfig({
|
|
576
|
-
displayName: "
|
|
577
|
-
componentId: "sc-
|
|
578
|
-
})(["
|
|
579
|
-
|
|
477
|
+
displayName: "StyledHeaderItemWrapper",
|
|
478
|
+
componentId: "sc-1uieu55-0"
|
|
479
|
+
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$i, props));
|
|
480
|
+
StyledHeaderItemWrapper.defaultProps = {
|
|
580
481
|
theme: reactTheming.DEFAULT_THEME
|
|
581
482
|
};
|
|
582
483
|
|
|
583
|
-
const COMPONENT_ID$
|
|
584
|
-
const colorStyles$
|
|
585
|
-
let
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
484
|
+
const COMPONENT_ID$h = 'chrome.nav';
|
|
485
|
+
const colorStyles$5 = _ref => {
|
|
486
|
+
let {
|
|
487
|
+
theme,
|
|
488
|
+
hue
|
|
489
|
+
} = _ref;
|
|
490
|
+
const shade = hue === 'chromeHue' ? 900 : undefined;
|
|
491
|
+
const backgroundColor = reactTheming.getColor({
|
|
492
|
+
theme,
|
|
493
|
+
hue,
|
|
494
|
+
shade
|
|
495
|
+
});
|
|
496
|
+
const foregroundColor = reactTheming.getColor({
|
|
497
|
+
theme,
|
|
498
|
+
dark: {
|
|
499
|
+
hue: 'white'
|
|
500
|
+
},
|
|
501
|
+
light: {
|
|
502
|
+
hue: 'black'
|
|
503
|
+
}
|
|
504
|
+
});
|
|
593
505
|
return styled.css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
594
506
|
};
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
|
|
507
|
+
const sizeStyles$7 = _ref2 => {
|
|
508
|
+
let {
|
|
509
|
+
theme,
|
|
510
|
+
isExpanded
|
|
511
|
+
} = _ref2;
|
|
512
|
+
const fontSize = theme.fontSizes.md;
|
|
513
|
+
const width = isExpanded ? getNavWidthExpanded() : getNavWidth(theme);
|
|
514
|
+
return styled.css(["width:", ";font-size:", ";"], width, fontSize);
|
|
515
|
+
};
|
|
516
|
+
const StyledNav = styled__default.default.nav.attrs({
|
|
517
|
+
'data-garden-id': COMPONENT_ID$h,
|
|
518
|
+
'data-garden-version': '9.0.0-next.20'
|
|
598
519
|
}).withConfig({
|
|
599
|
-
displayName: "
|
|
600
|
-
componentId: "sc-
|
|
601
|
-
})(["flex-direction:column;
|
|
602
|
-
|
|
520
|
+
displayName: "StyledNav",
|
|
521
|
+
componentId: "sc-6j462r-0"
|
|
522
|
+
})(["display:flex;position:relative;flex-direction:column;flex-shrink:0;order:-1;", ";", ";", ";"], colorStyles$5, sizeStyles$7, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$h, props));
|
|
523
|
+
StyledNav.defaultProps = {
|
|
603
524
|
theme: reactTheming.DEFAULT_THEME
|
|
604
525
|
};
|
|
605
526
|
|
|
606
|
-
const COMPONENT_ID$
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const lineHeight = reactTheming.getLineHeight(baseLineHeight, props.theme.fontSizes.md);
|
|
611
|
-
return styled.css(["margin:", " 0;line-height:", ";"], verticalMargin, lineHeight);
|
|
612
|
-
};
|
|
613
|
-
const StyledSubNavItemText = styled__default.default.span.attrs({
|
|
614
|
-
'data-garden-id': COMPONENT_ID$b,
|
|
615
|
-
'data-garden-version': '9.0.0-next.2'
|
|
527
|
+
const COMPONENT_ID$g = 'chrome.nav_list';
|
|
528
|
+
const StyledNavList = styled__default.default.ul.attrs({
|
|
529
|
+
'data-garden-id': COMPONENT_ID$g,
|
|
530
|
+
'data-garden-version': '9.0.0-next.20'
|
|
616
531
|
}).withConfig({
|
|
617
|
-
displayName: "
|
|
618
|
-
componentId: "sc-
|
|
619
|
-
})(["
|
|
620
|
-
|
|
532
|
+
displayName: "StyledNavList",
|
|
533
|
+
componentId: "sc-1s0nkfb-0"
|
|
534
|
+
})(["display:flex;flex:1;flex-direction:column;order:0;margin:0;padding:0;list-style:none;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$g, props));
|
|
535
|
+
StyledNavList.defaultProps = {
|
|
621
536
|
theme: reactTheming.DEFAULT_THEME
|
|
622
537
|
};
|
|
623
538
|
|
|
624
|
-
const COMPONENT_ID$
|
|
625
|
-
const
|
|
626
|
-
'data-garden-id': COMPONENT_ID$
|
|
627
|
-
'data-garden-version': '9.0.0-next.
|
|
628
|
-
'data-garden-header': 'true'
|
|
539
|
+
const COMPONENT_ID$f = 'chrome.nav_list_item';
|
|
540
|
+
const StyledNavListItem = styled__default.default.li.attrs({
|
|
541
|
+
'data-garden-id': COMPONENT_ID$f,
|
|
542
|
+
'data-garden-version': '9.0.0-next.20'
|
|
629
543
|
}).withConfig({
|
|
630
|
-
displayName: "
|
|
631
|
-
componentId: "sc-
|
|
632
|
-
})(["
|
|
633
|
-
|
|
544
|
+
displayName: "StyledNavListItem",
|
|
545
|
+
componentId: "sc-18cj2v7-0"
|
|
546
|
+
})(["display:flex;order:1;margin:0;padding:0;list-style-type:none;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$f, props));
|
|
547
|
+
StyledNavListItem.defaultProps = {
|
|
634
548
|
theme: reactTheming.DEFAULT_THEME
|
|
635
549
|
};
|
|
636
550
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
551
|
+
const COMPONENT_ID$e = 'chrome.base_nav_item';
|
|
552
|
+
const sizeStyles$6 = _ref => {
|
|
553
|
+
let {
|
|
554
|
+
theme
|
|
555
|
+
} = _ref;
|
|
556
|
+
const minHeight = getNavItemHeight(theme);
|
|
557
|
+
const verticalPadding = polished.math(`(${minHeight} - ${theme.iconSizes.lg}) / 2`);
|
|
558
|
+
const horizontalPadding = polished.math(`(${getNavWidth(theme)} - ${theme.iconSizes.lg}) / 4`);
|
|
559
|
+
return styled.css(["padding:", " ", ";min-height:", ";"], verticalPadding, horizontalPadding, minHeight);
|
|
560
|
+
};
|
|
561
|
+
const StyledBaseNavItem = styled__default.default.div.attrs({
|
|
562
|
+
'data-garden-id': COMPONENT_ID$e,
|
|
563
|
+
'data-garden-version': '9.0.0-next.20'
|
|
564
|
+
}).withConfig({
|
|
565
|
+
displayName: "StyledBaseNavItem",
|
|
566
|
+
componentId: "sc-zvo43f-0"
|
|
567
|
+
})(["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$6);
|
|
568
|
+
StyledBaseNavItem.defaultProps = {
|
|
569
|
+
theme: reactTheming.DEFAULT_THEME
|
|
651
570
|
};
|
|
652
571
|
|
|
653
|
-
const COMPONENT_ID$
|
|
654
|
-
const
|
|
572
|
+
const COMPONENT_ID$d = 'chrome.logo_nav_list_item';
|
|
573
|
+
const colorStyles$4 = _ref => {
|
|
655
574
|
let {
|
|
656
575
|
theme,
|
|
657
|
-
|
|
658
|
-
|
|
576
|
+
hue,
|
|
577
|
+
product
|
|
659
578
|
} = _ref;
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
});
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
579
|
+
const fillColor = reactTheming.getColor({
|
|
580
|
+
theme,
|
|
581
|
+
variable: 'foreground.default'
|
|
582
|
+
});
|
|
583
|
+
const color = hue === 'chromeHue' ? getProductColor(product) : fillColor;
|
|
584
|
+
return styled.css(["color:", ";fill:", ";"], color, fillColor);
|
|
585
|
+
};
|
|
586
|
+
const StyledLogoNavItem = styled__default.default(StyledBaseNavItem).attrs({
|
|
587
|
+
'data-garden-id': COMPONENT_ID$d,
|
|
588
|
+
'data-garden-version': '9.0.0-next.20'
|
|
589
|
+
}).withConfig({
|
|
590
|
+
displayName: "StyledLogoNavItem",
|
|
591
|
+
componentId: "sc-saaydx-0"
|
|
592
|
+
})(["order:-1;opacity:1;cursor:default;min-height:0;", ";"], colorStyles$4);
|
|
593
|
+
StyledLogoNavItem.defaultProps = {
|
|
670
594
|
theme: reactTheming.DEFAULT_THEME
|
|
671
595
|
};
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
596
|
+
|
|
597
|
+
const COMPONENT_ID$c = 'chrome.brandmark_nav_list_item';
|
|
598
|
+
const StyledBrandmarkNavItem = styled__default.default(StyledBaseNavItem).attrs({
|
|
599
|
+
'data-garden-id': COMPONENT_ID$c,
|
|
600
|
+
'data-garden-version': '9.0.0-next.20'
|
|
601
|
+
}).withConfig({
|
|
602
|
+
displayName: "StyledBrandmarkNavItem",
|
|
603
|
+
componentId: "sc-8kynd4-0"
|
|
604
|
+
})(["order:1;opacity:", ";margin-top:auto;min-height:0;"], props => props.theme.opacity[400]);
|
|
605
|
+
StyledBrandmarkNavItem.defaultProps = {
|
|
606
|
+
theme: reactTheming.DEFAULT_THEME
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
const COMPONENT_ID$b = 'chrome.nav_item_icon';
|
|
610
|
+
const sizeStyles$5 = _ref => {
|
|
611
|
+
let {
|
|
612
|
+
theme
|
|
613
|
+
} = _ref;
|
|
614
|
+
const size = theme.iconSizes.lg;
|
|
615
|
+
return styled.css(["width:", ";height:", ";"], size, size);
|
|
616
|
+
};
|
|
617
|
+
const StyledNavItemIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
|
|
618
|
+
'data-garden-id': COMPONENT_ID$b,
|
|
619
|
+
'data-garden-version': '9.0.0-next.20'
|
|
620
|
+
}).withConfig({
|
|
621
|
+
displayName: "StyledNavItemIcon",
|
|
622
|
+
componentId: "sc-7w9rpt-0"
|
|
623
|
+
})(["align-self:flex-start;order:0;border-radius:", ";", ";", ";"], props => props.theme.borderRadii.md, sizeStyles$5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
624
|
+
StyledNavItemIcon.defaultProps = {
|
|
625
|
+
theme: reactTheming.DEFAULT_THEME
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
const COMPONENT_ID$a = 'chrome.nav_button';
|
|
629
|
+
const colorStyles$3 = _ref => {
|
|
630
|
+
let {
|
|
631
|
+
theme,
|
|
632
|
+
hue
|
|
633
|
+
} = _ref;
|
|
634
|
+
const activeBackgroundColor = reactTheming.getColor({
|
|
635
|
+
theme,
|
|
636
|
+
dark: {
|
|
637
|
+
hue: 'white'
|
|
638
|
+
},
|
|
639
|
+
light: {
|
|
640
|
+
hue: 'black'
|
|
641
|
+
},
|
|
642
|
+
transparency: theme.opacity[100]
|
|
643
|
+
});
|
|
644
|
+
const currentBackgroundColor = hue === 'chromeHue' ? reactTheming.getColor({
|
|
645
|
+
theme,
|
|
646
|
+
hue,
|
|
647
|
+
shade: 700
|
|
648
|
+
}) : reactTheming.getColor({
|
|
649
|
+
theme,
|
|
650
|
+
dark: {
|
|
651
|
+
hue: 'white'
|
|
652
|
+
},
|
|
653
|
+
light: {
|
|
654
|
+
hue: 'black'
|
|
655
|
+
},
|
|
656
|
+
transparency: theme.opacity[500]
|
|
657
|
+
});
|
|
658
|
+
const focusOutlineColor = reactTheming.getColor({
|
|
659
|
+
theme,
|
|
660
|
+
dark: {
|
|
661
|
+
hue: 'white'
|
|
662
|
+
},
|
|
663
|
+
light: {
|
|
664
|
+
hue: 'black'
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
const focusOutlineOffset = `-${theme.borderWidths.md}`;
|
|
668
|
+
const hoverBackgroundColor = reactTheming.getColor({
|
|
669
|
+
theme,
|
|
670
|
+
dark: {
|
|
671
|
+
hue: 'black'
|
|
672
|
+
},
|
|
673
|
+
light: {
|
|
674
|
+
hue: 'white'
|
|
675
|
+
},
|
|
676
|
+
transparency: theme.opacity[100]
|
|
677
|
+
});
|
|
678
|
+
return styled.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, reactTheming.focusStyles({
|
|
679
|
+
theme,
|
|
680
|
+
condition: false,
|
|
681
|
+
styles: {
|
|
682
|
+
opacity: 1,
|
|
683
|
+
outlineColor: focusOutlineColor,
|
|
684
|
+
outlineOffset: focusOutlineOffset
|
|
685
|
+
}
|
|
686
|
+
}), activeBackgroundColor, currentBackgroundColor);
|
|
687
|
+
};
|
|
688
|
+
const sizeStyles$4 = _ref2 => {
|
|
689
|
+
let {
|
|
690
|
+
theme,
|
|
691
|
+
isExpanded
|
|
692
|
+
} = _ref2;
|
|
693
|
+
const iconMargin = isExpanded ? `0 ${polished.math(`(${getNavWidth(theme)} - ${theme.iconSizes.lg}) / 4`)}` : undefined;
|
|
694
|
+
return styled.css(["margin:0;border:none;box-sizing:border-box;min-width:0;font-size:inherit;", "{margin:", ";}"], StyledNavItemIcon, iconMargin);
|
|
695
|
+
};
|
|
696
|
+
const StyledNavButton = styled__default.default(StyledBaseNavItem).attrs({
|
|
697
|
+
'data-garden-id': COMPONENT_ID$a,
|
|
698
|
+
'data-garden-version': '9.0.0-next.20',
|
|
699
|
+
as: 'button'
|
|
675
700
|
}).withConfig({
|
|
676
|
-
displayName: "
|
|
677
|
-
componentId: "sc-
|
|
678
|
-
})(["
|
|
679
|
-
|
|
701
|
+
displayName: "StyledNavButton",
|
|
702
|
+
componentId: "sc-f5ux3-0"
|
|
703
|
+
})(["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$4, colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
704
|
+
StyledNavButton.defaultProps = {
|
|
680
705
|
theme: reactTheming.DEFAULT_THEME
|
|
681
706
|
};
|
|
682
707
|
|
|
683
|
-
const
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
708
|
+
const COMPONENT_ID$9 = 'chrome.nav_item_text';
|
|
709
|
+
const sizeStyles$3 = _ref => {
|
|
710
|
+
let {
|
|
711
|
+
theme,
|
|
712
|
+
isExpanded,
|
|
713
|
+
isWrapped
|
|
714
|
+
} = _ref;
|
|
715
|
+
const clip = isExpanded ? 'auto' : undefined;
|
|
716
|
+
const lineHeight = reactTheming.getLineHeight(theme.space.base * 5, theme.fontSizes.md);
|
|
717
|
+
const margin = isExpanded ? `0 ${polished.math(`(${getNavWidth(theme)} - ${theme.iconSizes.lg}) / 4`)}` : undefined;
|
|
718
|
+
const width = isExpanded ? 'auto' : undefined;
|
|
719
|
+
const height = isExpanded ? 'auto' : undefined;
|
|
720
|
+
const whiteSpace = isWrapped ? undefined : 'nowrap';
|
|
721
|
+
return styled.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);
|
|
722
|
+
};
|
|
723
|
+
const StyledNavItemText = styled__default.default.span.attrs({
|
|
724
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
725
|
+
'data-garden-version': '9.0.0-next.20'
|
|
688
726
|
}).withConfig({
|
|
689
|
-
displayName: "
|
|
690
|
-
componentId: "sc-
|
|
691
|
-
})(["
|
|
692
|
-
|
|
727
|
+
displayName: "StyledNavItemText",
|
|
728
|
+
componentId: "sc-13m84xl-0"
|
|
729
|
+
})(["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$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
730
|
+
StyledNavItemText.defaultProps = {
|
|
693
731
|
theme: reactTheming.DEFAULT_THEME
|
|
694
732
|
};
|
|
695
733
|
|
|
696
734
|
const COMPONENT_ID$8 = 'chrome.sheet';
|
|
697
|
-
const
|
|
735
|
+
const colorStyles$2 = _ref => {
|
|
698
736
|
let {
|
|
699
737
|
theme,
|
|
700
|
-
placement,
|
|
701
738
|
isOpen
|
|
702
739
|
} = _ref;
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
740
|
+
const backgroundColor = reactTheming.getColor({
|
|
741
|
+
theme,
|
|
742
|
+
variable: 'background.default'
|
|
743
|
+
});
|
|
744
|
+
const borderColor = isOpen ? reactTheming.getColor({
|
|
745
|
+
theme,
|
|
746
|
+
variable: 'border.default'
|
|
747
|
+
}) : 'transparent';
|
|
748
|
+
return styled.css(["border-color:", ";background-color:", ";"], borderColor, backgroundColor);
|
|
749
|
+
};
|
|
750
|
+
const sizeStyles$2 = _ref2 => {
|
|
751
|
+
let {
|
|
752
|
+
theme,
|
|
753
|
+
isOpen,
|
|
754
|
+
placement,
|
|
755
|
+
size
|
|
756
|
+
} = _ref2;
|
|
757
|
+
const width = isOpen ? size : 0;
|
|
758
|
+
const fontSize = theme.fontSizes.md;
|
|
759
|
+
const lineHeight = reactTheming.getLineHeight(theme.space.base * 5, fontSize);
|
|
760
|
+
const border = isOpen ? theme.borders.sm : 'none';
|
|
761
|
+
let borderProperty;
|
|
762
|
+
if (placement === 'start') {
|
|
763
|
+
borderProperty = `border-${theme.rtl ? 'left' : 'right'}`;
|
|
764
|
+
} else {
|
|
765
|
+
borderProperty = `border-${theme.rtl ? 'right' : 'left'}`;
|
|
713
766
|
}
|
|
714
|
-
return
|
|
767
|
+
return styled.css(["box-sizing:border-box;width:", ";height:100%;", ":", ";line-height:", ";font-size:", ";"], width, borderProperty, border, lineHeight, fontSize);
|
|
715
768
|
};
|
|
716
769
|
const StyledSheet = styled__default.default.aside.attrs({
|
|
717
770
|
'data-garden-id': COMPONENT_ID$8,
|
|
718
|
-
'data-garden-version': '9.0.0-next.
|
|
771
|
+
'data-garden-version': '9.0.0-next.20'
|
|
719
772
|
}).withConfig({
|
|
720
773
|
displayName: "StyledSheet",
|
|
721
774
|
componentId: "sc-dx8ijk-0"
|
|
722
|
-
})(["display:flex;order:1;transition:", ";
|
|
775
|
+
})(["display:flex;order:1;transition:", ";overflow:hidden;", ";&:focus{outline:none;}", ";", ";"], props => props.isAnimated && 'width 250ms ease-in-out', sizeStyles$2, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
723
776
|
StyledSheet.defaultProps = {
|
|
724
777
|
theme: reactTheming.DEFAULT_THEME
|
|
725
778
|
};
|
|
726
779
|
|
|
727
780
|
const COMPONENT_ID$7 = 'chrome.sheet_wrapper';
|
|
781
|
+
const transformStyles = _ref => {
|
|
782
|
+
let {
|
|
783
|
+
theme,
|
|
784
|
+
isAnimated,
|
|
785
|
+
isOpen,
|
|
786
|
+
placement
|
|
787
|
+
} = _ref;
|
|
788
|
+
const transition = isAnimated ? 'transform 250ms ease-in-out' : undefined;
|
|
789
|
+
let transform;
|
|
790
|
+
if (isOpen) {
|
|
791
|
+
transform = 'translateX(0)';
|
|
792
|
+
} else if (placement === 'start') {
|
|
793
|
+
transform = `translateX(${theme.rtl ? 100 : -100}%)`;
|
|
794
|
+
} else {
|
|
795
|
+
transform = `translateX(${theme.rtl ? -100 : 100}%)`;
|
|
796
|
+
}
|
|
797
|
+
return styled.css(["transform:", ";transition:", ";"], transform, transition);
|
|
798
|
+
};
|
|
728
799
|
const StyledSheetWrapper = styled__default.default.div.attrs({
|
|
729
800
|
'data-garden-id': COMPONENT_ID$7,
|
|
730
|
-
'data-garden-version': '9.0.0-next.
|
|
801
|
+
'data-garden-version': '9.0.0-next.20'
|
|
731
802
|
}).withConfig({
|
|
732
803
|
displayName: "StyledSheetWrapper",
|
|
733
804
|
componentId: "sc-f6x9zb-0"
|
|
734
|
-
})(["display:flex;position:relative;flex-direction:column;
|
|
735
|
-
const translateValues = [-100, 100];
|
|
736
|
-
let translation = 'translateX(0%)';
|
|
737
|
-
if (props.isOpen) {
|
|
738
|
-
return translation;
|
|
739
|
-
}
|
|
740
|
-
if (props.theme.rtl) {
|
|
741
|
-
translateValues.reverse();
|
|
742
|
-
}
|
|
743
|
-
if (props.placement === 'end') {
|
|
744
|
-
translation = `translateX(${translateValues[1]}%)`;
|
|
745
|
-
} else if (props.placement === 'start') {
|
|
746
|
-
translation = `translateX(${translateValues[0]}%)`;
|
|
747
|
-
}
|
|
748
|
-
return translation;
|
|
749
|
-
}, props => props.isAnimated && 'transform 250ms ease-in-out', props => props.size, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
805
|
+
})(["display:flex;position:relative;flex-direction:column;min-width:", ";", ";", ";"], props => props.size, transformStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
750
806
|
StyledSheetWrapper.defaultProps = {
|
|
751
807
|
theme: reactTheming.DEFAULT_THEME
|
|
752
808
|
};
|
|
@@ -754,11 +810,14 @@ StyledSheetWrapper.defaultProps = {
|
|
|
754
810
|
const COMPONENT_ID$6 = 'chrome.sheet_title';
|
|
755
811
|
const StyledSheetTitle = styled__default.default.div.attrs({
|
|
756
812
|
'data-garden-id': COMPONENT_ID$6,
|
|
757
|
-
'data-garden-version': '9.0.0-next.
|
|
813
|
+
'data-garden-version': '9.0.0-next.20'
|
|
758
814
|
}).withConfig({
|
|
759
815
|
displayName: "StyledSheetTitle",
|
|
760
816
|
componentId: "sc-1gogk75-0"
|
|
761
|
-
})(["
|
|
817
|
+
})(["color:", ";font-weight:", ";", ";"], p => reactTheming.getColor({
|
|
818
|
+
theme: p.theme,
|
|
819
|
+
variable: 'foreground.default'
|
|
820
|
+
}), props => props.theme.fontWeights.semibold, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
762
821
|
StyledSheetTitle.defaultProps = {
|
|
763
822
|
theme: reactTheming.DEFAULT_THEME
|
|
764
823
|
};
|
|
@@ -766,11 +825,14 @@ StyledSheetTitle.defaultProps = {
|
|
|
766
825
|
const COMPONENT_ID$5 = 'chrome.sheet_description';
|
|
767
826
|
const StyledSheetDescription = styled__default.default.div.attrs({
|
|
768
827
|
'data-garden-id': COMPONENT_ID$5,
|
|
769
|
-
'data-garden-version': '9.0.0-next.
|
|
828
|
+
'data-garden-version': '9.0.0-next.20'
|
|
770
829
|
}).withConfig({
|
|
771
830
|
displayName: "StyledSheetDescription",
|
|
772
831
|
componentId: "sc-1puglb6-0"
|
|
773
|
-
})(["line-height:", ";color:", ";", ";"],
|
|
832
|
+
})(["line-height:", ";color:", ";", ";"], p => reactTheming.getLineHeight(p.theme.space.base * 4, p.theme.fontSizes.md), p => reactTheming.getColor({
|
|
833
|
+
theme: p.theme,
|
|
834
|
+
variable: 'foreground.subtle'
|
|
835
|
+
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
774
836
|
StyledSheetDescription.defaultProps = {
|
|
775
837
|
theme: reactTheming.DEFAULT_THEME
|
|
776
838
|
};
|
|
@@ -778,47 +840,62 @@ StyledSheetDescription.defaultProps = {
|
|
|
778
840
|
const COMPONENT_ID$4 = 'chrome.sheet_body';
|
|
779
841
|
const StyledSheetBody = styled__default.default.div.attrs({
|
|
780
842
|
'data-garden-id': COMPONENT_ID$4,
|
|
781
|
-
'data-garden-version': '9.0.0-next.
|
|
843
|
+
'data-garden-version': '9.0.0-next.20'
|
|
782
844
|
}).withConfig({
|
|
783
845
|
displayName: "StyledSheetBody",
|
|
784
846
|
componentId: "sc-bt4eoj-0"
|
|
785
|
-
})(["flex:1;overflow-y:auto;padding:", "px;", ";"], props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
847
|
+
})(["flex:1;overflow-y:auto;padding:", "px;color-scheme:only ", ";", ";"], props => props.theme.space.base * 5, p => p.theme.colors.base, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
786
848
|
StyledSheetBody.defaultProps = {
|
|
787
849
|
theme: reactTheming.DEFAULT_THEME
|
|
788
850
|
};
|
|
789
851
|
|
|
790
852
|
const COMPONENT_ID$3 = 'chrome.sheet_close';
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
}
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
theme: props.theme
|
|
801
|
-
}), reactTheming.getColor(backgroundColor, 600, props.theme, 0.2), reactTheming.getColor(foregroundColor, 800, props.theme));
|
|
802
|
-
};
|
|
803
|
-
const StyledSheetClose = styled__default.default.button.attrs({
|
|
853
|
+
const positionStyles = _ref => {
|
|
854
|
+
let {
|
|
855
|
+
theme
|
|
856
|
+
} = _ref;
|
|
857
|
+
const top = `${theme.space.base * 2.5}px`;
|
|
858
|
+
const position = `${theme.space.base * 2}px`;
|
|
859
|
+
return styled.css(["top:", ";", ":", ";"], top, theme.rtl ? 'left' : 'right', position);
|
|
860
|
+
};
|
|
861
|
+
const StyledSheetClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
804
862
|
'data-garden-id': COMPONENT_ID$3,
|
|
805
|
-
'data-garden-version': '9.0.0-next.
|
|
863
|
+
'data-garden-version': '9.0.0-next.20'
|
|
806
864
|
}).withConfig({
|
|
807
865
|
displayName: "StyledSheetClose",
|
|
808
866
|
componentId: "sc-1ab02oq-0"
|
|
809
|
-
})(["
|
|
867
|
+
})(["position:absolute;", ";", ";"], positionStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
810
868
|
StyledSheetClose.defaultProps = {
|
|
811
869
|
theme: reactTheming.DEFAULT_THEME
|
|
812
870
|
};
|
|
813
871
|
|
|
814
872
|
const COMPONENT_ID$2 = 'chrome.sheet_footer';
|
|
873
|
+
const colorStyles$1 = _ref => {
|
|
874
|
+
let {
|
|
875
|
+
theme
|
|
876
|
+
} = _ref;
|
|
877
|
+
const borderColor = reactTheming.getColor({
|
|
878
|
+
theme,
|
|
879
|
+
variable: 'border.subtle'
|
|
880
|
+
});
|
|
881
|
+
return styled.css(["border-top-color:", ";"], borderColor);
|
|
882
|
+
};
|
|
883
|
+
const sizeStyles$1 = _ref2 => {
|
|
884
|
+
let {
|
|
885
|
+
theme,
|
|
886
|
+
isCompact
|
|
887
|
+
} = _ref2;
|
|
888
|
+
const border = theme.borders.sm;
|
|
889
|
+
const padding = `${theme.space.base * (isCompact ? 2.5 : 5)}px`;
|
|
890
|
+
return styled.css(["border-top:", ";padding:", ";"], border, padding);
|
|
891
|
+
};
|
|
815
892
|
const StyledSheetFooter = styled__default.default.footer.attrs({
|
|
816
893
|
'data-garden-id': COMPONENT_ID$2,
|
|
817
|
-
'data-garden-version': '9.0.0-next.
|
|
894
|
+
'data-garden-version': '9.0.0-next.20'
|
|
818
895
|
}).withConfig({
|
|
819
896
|
displayName: "StyledSheetFooter",
|
|
820
897
|
componentId: "sc-2cktos-0"
|
|
821
|
-
})(["display:flex;flex-flow:row wrap;align-items:center;justify-content:", ";
|
|
898
|
+
})(["display:flex;flex-flow:row wrap;align-items:center;justify-content:", ";", ";", ";", ";"], props => props.isCompact ? 'center' : 'flex-end', sizeStyles$1, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
822
899
|
StyledSheetFooter.defaultProps = {
|
|
823
900
|
theme: reactTheming.DEFAULT_THEME
|
|
824
901
|
};
|
|
@@ -826,7 +903,7 @@ StyledSheetFooter.defaultProps = {
|
|
|
826
903
|
const COMPONENT_ID$1 = 'chrome.sheet_footer_item';
|
|
827
904
|
const StyledSheetFooterItem = styled__default.default.div.attrs({
|
|
828
905
|
'data-garden-id': COMPONENT_ID$1,
|
|
829
|
-
'data-garden-version': '9.0.0-next.
|
|
906
|
+
'data-garden-version': '9.0.0-next.20'
|
|
830
907
|
}).withConfig({
|
|
831
908
|
displayName: "StyledSheetFooterItem",
|
|
832
909
|
componentId: "sc-r9ixh-0"
|
|
@@ -836,144 +913,40 @@ StyledSheetFooterItem.defaultProps = {
|
|
|
836
913
|
};
|
|
837
914
|
|
|
838
915
|
const COMPONENT_ID = 'chrome.sheet_header';
|
|
916
|
+
const colorStyles = _ref => {
|
|
917
|
+
let {
|
|
918
|
+
theme
|
|
919
|
+
} = _ref;
|
|
920
|
+
const borderColor = reactTheming.getColor({
|
|
921
|
+
theme,
|
|
922
|
+
variable: 'border.subtle'
|
|
923
|
+
});
|
|
924
|
+
return styled.css(["border-bottom-color:", ";"], borderColor);
|
|
925
|
+
};
|
|
926
|
+
const sizeStyles = _ref2 => {
|
|
927
|
+
let {
|
|
928
|
+
theme,
|
|
929
|
+
isCloseButtonPresent
|
|
930
|
+
} = _ref2;
|
|
931
|
+
const border = theme.borders.sm;
|
|
932
|
+
let padding = `${theme.space.base * 5}px`;
|
|
933
|
+
if (isCloseButtonPresent) {
|
|
934
|
+
const paddingSide = `${theme.space.base * 14}px`;
|
|
935
|
+
padding = theme.rtl ? `${padding} ${padding} ${padding} ${paddingSide}` : `${padding} ${paddingSide} ${padding} ${padding}`;
|
|
936
|
+
}
|
|
937
|
+
return styled.css(["border-bottom:", ";padding:", ";"], border, padding);
|
|
938
|
+
};
|
|
839
939
|
const StyledSheetHeader = styled__default.default.header.attrs({
|
|
840
940
|
'data-garden-id': COMPONENT_ID,
|
|
841
|
-
'data-garden-version': '9.0.0-next.
|
|
941
|
+
'data-garden-version': '9.0.0-next.20'
|
|
842
942
|
}).withConfig({
|
|
843
943
|
displayName: "StyledSheetHeader",
|
|
844
944
|
componentId: "sc-o2ry8i-0"
|
|
845
|
-
})(["
|
|
945
|
+
})(["", ";", ";", ";"], sizeStyles, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
846
946
|
StyledSheetHeader.defaultProps = {
|
|
847
947
|
theme: reactTheming.DEFAULT_THEME
|
|
848
948
|
};
|
|
849
949
|
|
|
850
|
-
const Chrome = React__namespace.default.forwardRef((_ref, ref) => {
|
|
851
|
-
let {
|
|
852
|
-
hue,
|
|
853
|
-
isFluid,
|
|
854
|
-
...props
|
|
855
|
-
} = _ref;
|
|
856
|
-
const theme = React.useContext(styled.ThemeContext);
|
|
857
|
-
const isLightMemoized = React.useMemo(() => {
|
|
858
|
-
if (hue) {
|
|
859
|
-
const backgroundColor = reactTheming.getColor(hue, 600, theme);
|
|
860
|
-
const LIGHT_COLOR = 'white';
|
|
861
|
-
return polished.readableColor(backgroundColor, LIGHT_COLOR, undefined, false ) === LIGHT_COLOR;
|
|
862
|
-
}
|
|
863
|
-
return false;
|
|
864
|
-
}, [hue, theme]);
|
|
865
|
-
const isLight = hue ? isLightMemoized : false;
|
|
866
|
-
const isDark = hue ? !isLightMemoized : false;
|
|
867
|
-
const chromeContextValue = React.useMemo(() => ({
|
|
868
|
-
hue: hue || 'chromeHue',
|
|
869
|
-
isLight,
|
|
870
|
-
isDark
|
|
871
|
-
}), [hue, isLight, isDark]);
|
|
872
|
-
const environment = reactTheming.useDocument(theme);
|
|
873
|
-
React.useEffect(() => {
|
|
874
|
-
if (environment && !isFluid) {
|
|
875
|
-
const htmlElement = environment.querySelector('html');
|
|
876
|
-
if (htmlElement) {
|
|
877
|
-
const defaultHtmlPosition = htmlElement.style.position;
|
|
878
|
-
htmlElement.style.position = 'fixed';
|
|
879
|
-
return () => {
|
|
880
|
-
htmlElement.style.position = defaultHtmlPosition;
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
return undefined;
|
|
885
|
-
}, [environment, isFluid]);
|
|
886
|
-
return React__namespace.default.createElement(ChromeContext.Provider, {
|
|
887
|
-
value: chromeContextValue
|
|
888
|
-
}, React__namespace.default.createElement(StyledChrome, _extends$3({
|
|
889
|
-
ref: ref
|
|
890
|
-
}, props)));
|
|
891
|
-
});
|
|
892
|
-
Chrome.displayName = 'Chrome';
|
|
893
|
-
Chrome.propTypes = {
|
|
894
|
-
hue: PropTypes__default.default.string
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
const SkipNav = React__namespace.default.forwardRef((_ref, ref) => {
|
|
898
|
-
let {
|
|
899
|
-
targetId,
|
|
900
|
-
zIndex,
|
|
901
|
-
children,
|
|
902
|
-
...props
|
|
903
|
-
} = _ref;
|
|
904
|
-
return React__namespace.default.createElement(StyledSkipNav, _extends$3({
|
|
905
|
-
href: `#${targetId}`,
|
|
906
|
-
zIndex: zIndex,
|
|
907
|
-
ref: ref
|
|
908
|
-
}, props), React__namespace.default.createElement(StyledSkipNavIcon, null), children);
|
|
909
|
-
});
|
|
910
|
-
SkipNav.displayName = 'SkipNav';
|
|
911
|
-
SkipNav.propTypes = {
|
|
912
|
-
targetId: PropTypes__default.default.string.isRequired,
|
|
913
|
-
zIndex: PropTypes__default.default.number
|
|
914
|
-
};
|
|
915
|
-
SkipNav.defaultProps = {
|
|
916
|
-
zIndex: 1
|
|
917
|
-
};
|
|
918
|
-
|
|
919
|
-
const BodyContext = React__namespace.default.createContext({
|
|
920
|
-
hasFooter: true
|
|
921
|
-
});
|
|
922
|
-
const useBodyContext = () => {
|
|
923
|
-
return React.useContext(BodyContext);
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
const Body$1 = React__namespace.default.forwardRef((_ref, ref) => {
|
|
927
|
-
let {
|
|
928
|
-
hasFooter,
|
|
929
|
-
...props
|
|
930
|
-
} = _ref;
|
|
931
|
-
const bodyContextValue = React.useMemo(() => ({
|
|
932
|
-
hasFooter: !!hasFooter
|
|
933
|
-
}), [hasFooter]);
|
|
934
|
-
return React__namespace.default.createElement(BodyContext.Provider, {
|
|
935
|
-
value: bodyContextValue
|
|
936
|
-
}, React__namespace.default.createElement(StyledBody, _extends$3({
|
|
937
|
-
ref: ref
|
|
938
|
-
}, props)));
|
|
939
|
-
});
|
|
940
|
-
Body$1.displayName = 'Body';
|
|
941
|
-
Body$1.propTypes = {
|
|
942
|
-
hasFooter: PropTypes__default.default.bool
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
const Content = React__namespace.default.forwardRef((props, ref) => {
|
|
946
|
-
const {
|
|
947
|
-
hasFooter
|
|
948
|
-
} = useBodyContext();
|
|
949
|
-
return React__namespace.default.createElement(StyledContent, _extends$3({
|
|
950
|
-
ref: ref,
|
|
951
|
-
hasFooter: hasFooter
|
|
952
|
-
}, props));
|
|
953
|
-
});
|
|
954
|
-
Content.displayName = 'Content';
|
|
955
|
-
|
|
956
|
-
const Main = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledMain, _extends$3({
|
|
957
|
-
ref: ref
|
|
958
|
-
}, props)));
|
|
959
|
-
Main.displayName = 'Main';
|
|
960
|
-
|
|
961
|
-
const Sidebar = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledSidebar, _extends$3({
|
|
962
|
-
ref: ref
|
|
963
|
-
}, props)));
|
|
964
|
-
Sidebar.displayName = 'Sidebar';
|
|
965
|
-
|
|
966
|
-
const Header$1 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledHeader, _extends$3({
|
|
967
|
-
ref: ref
|
|
968
|
-
}, props)));
|
|
969
|
-
Header$1.displayName = 'Header';
|
|
970
|
-
Header$1.propTypes = {
|
|
971
|
-
isStandalone: PropTypes__default.default.bool
|
|
972
|
-
};
|
|
973
|
-
|
|
974
|
-
const PLACEMENT = ['end', 'start'];
|
|
975
|
-
const PRODUCT = ['chat', 'connect', 'explore', 'guide', 'message', 'support', 'talk'];
|
|
976
|
-
|
|
977
950
|
const HeaderItem = React__namespace.default.forwardRef((_ref, ref) => {
|
|
978
951
|
let {
|
|
979
952
|
hasLogo,
|
|
@@ -981,12 +954,12 @@ const HeaderItem = React__namespace.default.forwardRef((_ref, ref) => {
|
|
|
981
954
|
...other
|
|
982
955
|
} = _ref;
|
|
983
956
|
if (hasLogo) {
|
|
984
|
-
return React__namespace.default.createElement(StyledLogoHeaderItem,
|
|
957
|
+
return React__namespace.default.createElement(StyledLogoHeaderItem, Object.assign({
|
|
985
958
|
ref: ref,
|
|
986
959
|
product: product
|
|
987
960
|
}, other));
|
|
988
961
|
}
|
|
989
|
-
return React__namespace.default.createElement(StyledHeaderItem,
|
|
962
|
+
return React__namespace.default.createElement(StyledHeaderItem, Object.assign({
|
|
990
963
|
ref: ref
|
|
991
964
|
}, other));
|
|
992
965
|
});
|
|
@@ -995,7 +968,7 @@ HeaderItem.propTypes = {
|
|
|
995
968
|
maxX: PropTypes__default.default.bool,
|
|
996
969
|
maxY: PropTypes__default.default.bool,
|
|
997
970
|
isRound: PropTypes__default.default.bool,
|
|
998
|
-
product: PropTypes__default.default.oneOf(
|
|
971
|
+
product: PropTypes__default.default.oneOf(PRODUCTS),
|
|
999
972
|
hasLogo: PropTypes__default.default.bool
|
|
1000
973
|
};
|
|
1001
974
|
|
|
@@ -1004,26 +977,10 @@ const HeaderItemIcon = _ref => {
|
|
|
1004
977
|
children,
|
|
1005
978
|
...props
|
|
1006
979
|
} = _ref;
|
|
1007
|
-
|
|
1008
|
-
if ( React.isValidElement(element)) {
|
|
1009
|
-
const Icon = _ref2 => {
|
|
1010
|
-
let {
|
|
1011
|
-
theme,
|
|
1012
|
-
...iconProps
|
|
1013
|
-
} = _ref2;
|
|
1014
|
-
return React.cloneElement(element, {
|
|
1015
|
-
...props,
|
|
1016
|
-
...iconProps
|
|
1017
|
-
});
|
|
1018
|
-
};
|
|
1019
|
-
return React__namespace.default.createElement(StyledHeaderItemIcon, _extends$3({
|
|
1020
|
-
as: Icon
|
|
1021
|
-
}, props));
|
|
1022
|
-
}
|
|
1023
|
-
return null;
|
|
980
|
+
return React__namespace.default.createElement(StyledHeaderItemIcon, props, children);
|
|
1024
981
|
};
|
|
1025
982
|
|
|
1026
|
-
const HeaderItemText = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledHeaderItemText,
|
|
983
|
+
const HeaderItemText = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledHeaderItemText, Object.assign({
|
|
1027
984
|
ref: ref
|
|
1028
985
|
}, props)));
|
|
1029
986
|
HeaderItemText.displayName = 'HeaderItemText';
|
|
@@ -1031,17 +988,12 @@ HeaderItemText.propTypes = {
|
|
|
1031
988
|
isClipped: PropTypes__default.default.bool
|
|
1032
989
|
};
|
|
1033
990
|
|
|
1034
|
-
const HeaderItemWrapper = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledHeaderItemWrapper,
|
|
991
|
+
const HeaderItemWrapper = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledHeaderItemWrapper, Object.assign({
|
|
1035
992
|
ref: ref
|
|
1036
993
|
}, props)));
|
|
1037
994
|
HeaderItemWrapper.displayName = 'HeaderItemWrapper';
|
|
1038
995
|
|
|
1039
|
-
const
|
|
1040
|
-
ref: ref
|
|
1041
|
-
}, props)));
|
|
1042
|
-
Footer$1.displayName = 'Footer';
|
|
1043
|
-
|
|
1044
|
-
const FooterItem$1 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, _extends$3({
|
|
996
|
+
const FooterItem$1 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledFooterItem, Object.assign({
|
|
1045
997
|
ref: ref
|
|
1046
998
|
}, props)));
|
|
1047
999
|
FooterItem$1.displayName = 'FooterItem';
|
|
@@ -1053,28 +1005,16 @@ const useNavContext = () => {
|
|
|
1053
1005
|
return React.useContext(NavContext);
|
|
1054
1006
|
};
|
|
1055
1007
|
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
hue,
|
|
1059
|
-
isLight,
|
|
1060
|
-
isDark
|
|
1061
|
-
} = useChromeContext();
|
|
1062
|
-
const navContextValue = React.useMemo(() => ({
|
|
1063
|
-
isExpanded: !!props.isExpanded
|
|
1064
|
-
}), [props.isExpanded]);
|
|
1065
|
-
return React__namespace.default.createElement(NavContext.Provider, {
|
|
1066
|
-
value: navContextValue
|
|
1067
|
-
}, React__namespace.default.createElement(StyledNav, _extends$3({
|
|
1068
|
-
ref: ref
|
|
1069
|
-
}, props, {
|
|
1070
|
-
hue: hue,
|
|
1071
|
-
isLight: isLight,
|
|
1072
|
-
isDark: isDark
|
|
1073
|
-
})));
|
|
1008
|
+
const ChromeContext = React__namespace.default.createContext({
|
|
1009
|
+
hue: 'chromeHue'
|
|
1074
1010
|
});
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1011
|
+
const useChromeContext = () => {
|
|
1012
|
+
return React.useContext(ChromeContext);
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
const NavListContext = React__namespace.default.createContext(undefined);
|
|
1016
|
+
const useNavListContext = () => {
|
|
1017
|
+
return React.useContext(NavListContext);
|
|
1078
1018
|
};
|
|
1079
1019
|
|
|
1080
1020
|
const NavItem = React__namespace.default.forwardRef((_ref, ref) => {
|
|
@@ -1082,44 +1022,45 @@ const NavItem = React__namespace.default.forwardRef((_ref, ref) => {
|
|
|
1082
1022
|
hasLogo,
|
|
1083
1023
|
hasBrandmark,
|
|
1084
1024
|
product,
|
|
1025
|
+
isCurrent,
|
|
1085
1026
|
...other
|
|
1086
1027
|
} = _ref;
|
|
1087
1028
|
const {
|
|
1088
|
-
hue
|
|
1089
|
-
isLight,
|
|
1090
|
-
isDark
|
|
1029
|
+
hue
|
|
1091
1030
|
} = useChromeContext();
|
|
1092
1031
|
const {
|
|
1093
1032
|
isExpanded
|
|
1094
1033
|
} = useNavContext();
|
|
1095
|
-
const
|
|
1034
|
+
const navListContext = useNavListContext();
|
|
1035
|
+
const hasList = navListContext?.hasList;
|
|
1036
|
+
let retVal;
|
|
1096
1037
|
if (hasLogo) {
|
|
1097
|
-
|
|
1038
|
+
retVal = React__namespace.default.createElement(StyledLogoNavItem, Object.assign({
|
|
1098
1039
|
ref: ref,
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
product: product,
|
|
1102
|
-
"aria-current": ariaCurrent
|
|
1040
|
+
hue: hue,
|
|
1041
|
+
product: product
|
|
1103
1042
|
}, other));
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
return React__namespace.default.createElement(StyledBrandmarkNavItem, _extends$3({
|
|
1043
|
+
} else if (hasBrandmark) {
|
|
1044
|
+
retVal = React__namespace.default.createElement(StyledBrandmarkNavItem, Object.assign({
|
|
1107
1045
|
ref: ref
|
|
1108
1046
|
}, other));
|
|
1047
|
+
} else {
|
|
1048
|
+
retVal = React__namespace.default.createElement(StyledNavButton, Object.assign({
|
|
1049
|
+
tabIndex: 0,
|
|
1050
|
+
ref: ref,
|
|
1051
|
+
isExpanded: isExpanded,
|
|
1052
|
+
hue: hue,
|
|
1053
|
+
"aria-current": isCurrent || undefined
|
|
1054
|
+
}, other));
|
|
1109
1055
|
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
hue: hue,
|
|
1115
|
-
isDark: isDark,
|
|
1116
|
-
isLight: isLight,
|
|
1117
|
-
"aria-current": ariaCurrent
|
|
1118
|
-
}, other));
|
|
1056
|
+
if (hasList) {
|
|
1057
|
+
retVal = React__namespace.default.createElement(StyledNavListItem, null, retVal);
|
|
1058
|
+
}
|
|
1059
|
+
return retVal;
|
|
1119
1060
|
});
|
|
1120
1061
|
NavItem.displayName = 'NavItem';
|
|
1121
1062
|
NavItem.propTypes = {
|
|
1122
|
-
product: PropTypes__default.default.oneOf(
|
|
1063
|
+
product: PropTypes__default.default.oneOf(PRODUCTS),
|
|
1123
1064
|
hasLogo: PropTypes__default.default.bool,
|
|
1124
1065
|
hasBrandmark: PropTypes__default.default.bool
|
|
1125
1066
|
};
|
|
@@ -1129,30 +1070,14 @@ const NavItemIcon = _ref => {
|
|
|
1129
1070
|
children,
|
|
1130
1071
|
...props
|
|
1131
1072
|
} = _ref;
|
|
1132
|
-
|
|
1133
|
-
if ( React.isValidElement(element)) {
|
|
1134
|
-
const Icon = _ref2 => {
|
|
1135
|
-
let {
|
|
1136
|
-
theme,
|
|
1137
|
-
...iconProps
|
|
1138
|
-
} = _ref2;
|
|
1139
|
-
return React.cloneElement(element, {
|
|
1140
|
-
...props,
|
|
1141
|
-
...iconProps
|
|
1142
|
-
});
|
|
1143
|
-
};
|
|
1144
|
-
return React__namespace.default.createElement(StyledNavItemIcon, _extends$3({
|
|
1145
|
-
as: Icon
|
|
1146
|
-
}, props));
|
|
1147
|
-
}
|
|
1148
|
-
return null;
|
|
1073
|
+
return React__namespace.default.createElement(StyledNavItemIcon, props, children);
|
|
1149
1074
|
};
|
|
1150
1075
|
|
|
1151
1076
|
const NavItemText = React__namespace.default.forwardRef((props, ref) => {
|
|
1152
1077
|
const {
|
|
1153
1078
|
isExpanded
|
|
1154
1079
|
} = useNavContext();
|
|
1155
|
-
return React__namespace.default.createElement(StyledNavItemText,
|
|
1080
|
+
return React__namespace.default.createElement(StyledNavItemText, Object.assign({
|
|
1156
1081
|
ref: ref,
|
|
1157
1082
|
isExpanded: isExpanded
|
|
1158
1083
|
}, props));
|
|
@@ -1162,113 +1087,192 @@ NavItemText.propTypes = {
|
|
|
1162
1087
|
isWrapped: PropTypes__default.default.bool
|
|
1163
1088
|
};
|
|
1164
1089
|
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1090
|
+
const Chrome = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1091
|
+
let {
|
|
1167
1092
|
hue,
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
} =
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
hue
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1093
|
+
isFluid,
|
|
1094
|
+
...props
|
|
1095
|
+
} = _ref;
|
|
1096
|
+
const theme = React.useContext(styled.ThemeContext) || reactTheming.DEFAULT_THEME;
|
|
1097
|
+
const isLightMemoized = React.useMemo(() => {
|
|
1098
|
+
if (hue) {
|
|
1099
|
+
const backgroundColor = reactTheming.getColor({
|
|
1100
|
+
theme,
|
|
1101
|
+
hue
|
|
1102
|
+
});
|
|
1103
|
+
const LIGHT_COLOR = 'white';
|
|
1104
|
+
return polished.readableColor(backgroundColor, LIGHT_COLOR, undefined, false ) === LIGHT_COLOR;
|
|
1105
|
+
}
|
|
1106
|
+
return false;
|
|
1107
|
+
}, [hue, theme]);
|
|
1108
|
+
const isLight = hue ? isLightMemoized : undefined;
|
|
1109
|
+
const chromeContextValue = React.useMemo(() => ({
|
|
1110
|
+
hue: hue || 'chromeHue',
|
|
1111
|
+
isLight
|
|
1112
|
+
}), [hue, isLight]);
|
|
1113
|
+
const environment = reactTheming.useDocument(theme);
|
|
1114
|
+
React.useEffect(() => {
|
|
1115
|
+
if (environment && !isFluid) {
|
|
1116
|
+
const htmlElement = environment.querySelector('html');
|
|
1117
|
+
if (htmlElement) {
|
|
1118
|
+
const defaultHtmlPosition = htmlElement.style.position;
|
|
1119
|
+
htmlElement.style.position = 'fixed';
|
|
1120
|
+
return () => {
|
|
1121
|
+
htmlElement.style.position = defaultHtmlPosition;
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
return undefined;
|
|
1126
|
+
}, [environment, isFluid]);
|
|
1127
|
+
return React__namespace.default.createElement(ChromeContext.Provider, {
|
|
1128
|
+
value: chromeContextValue
|
|
1129
|
+
}, React__namespace.default.createElement(StyledChrome, Object.assign({
|
|
1130
|
+
ref: ref
|
|
1131
|
+
}, props)));
|
|
1132
|
+
});
|
|
1133
|
+
Chrome.displayName = 'Chrome';
|
|
1134
|
+
Chrome.propTypes = {
|
|
1135
|
+
hue: PropTypes__default.default.string
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
const SkipNav = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1139
|
+
let {
|
|
1140
|
+
targetId,
|
|
1141
|
+
zIndex,
|
|
1142
|
+
children,
|
|
1143
|
+
...props
|
|
1144
|
+
} = _ref;
|
|
1145
|
+
return React__namespace.default.createElement(StyledSkipNav, Object.assign({
|
|
1146
|
+
href: `#${targetId}`,
|
|
1147
|
+
zIndex: zIndex,
|
|
1148
|
+
ref: ref
|
|
1149
|
+
}, props), React__namespace.default.createElement(StyledSkipNavIcon, null), children);
|
|
1150
|
+
});
|
|
1151
|
+
SkipNav.displayName = 'SkipNav';
|
|
1152
|
+
SkipNav.propTypes = {
|
|
1153
|
+
targetId: PropTypes__default.default.string.isRequired,
|
|
1154
|
+
zIndex: PropTypes__default.default.number
|
|
1155
|
+
};
|
|
1156
|
+
SkipNav.defaultProps = {
|
|
1157
|
+
zIndex: 1
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
const BodyContext = React__namespace.default.createContext(undefined);
|
|
1161
|
+
const useBodyContext = () => {
|
|
1162
|
+
return React.useContext(BodyContext);
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
const Body$1 = React__namespace.default.forwardRef((props, ref) => {
|
|
1166
|
+
const [hasFooter, setHasFooter] = React.useState(false);
|
|
1167
|
+
const bodyContextValue = React.useMemo(() => ({
|
|
1168
|
+
hasFooter,
|
|
1169
|
+
setHasFooter
|
|
1170
|
+
}), [hasFooter, setHasFooter]);
|
|
1171
|
+
return React__namespace.default.createElement(BodyContext.Provider, {
|
|
1172
|
+
value: bodyContextValue
|
|
1173
|
+
}, React__namespace.default.createElement(StyledBody, Object.assign({
|
|
1174
|
+
ref: ref
|
|
1175
|
+
}, props)));
|
|
1177
1176
|
});
|
|
1178
|
-
|
|
1177
|
+
Body$1.displayName = 'Body';
|
|
1179
1178
|
|
|
1180
|
-
const
|
|
1179
|
+
const Content = React__namespace.default.forwardRef((props, ref) => {
|
|
1181
1180
|
const {
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
return React__namespace.default.createElement(StyledSubNavItem, _extends$3({
|
|
1181
|
+
hasFooter
|
|
1182
|
+
} = useBodyContext() || {};
|
|
1183
|
+
return React__namespace.default.createElement(StyledContent, Object.assign({
|
|
1186
1184
|
ref: ref,
|
|
1187
|
-
|
|
1188
|
-
isLight: isLight
|
|
1185
|
+
hasFooter: hasFooter
|
|
1189
1186
|
}, props));
|
|
1190
1187
|
});
|
|
1191
|
-
|
|
1192
|
-
SubNavItem.propTypes = {
|
|
1193
|
-
isCurrent: PropTypes__default.default.bool
|
|
1194
|
-
};
|
|
1188
|
+
Content.displayName = 'Content';
|
|
1195
1189
|
|
|
1196
|
-
const
|
|
1190
|
+
const Main = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledMain, Object.assign({
|
|
1197
1191
|
ref: ref
|
|
1198
1192
|
}, props)));
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1193
|
+
Main.displayName = 'Main';
|
|
1194
|
+
|
|
1195
|
+
const HeaderComponent = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledHeader, Object.assign({
|
|
1196
|
+
ref: ref
|
|
1197
|
+
}, props)));
|
|
1198
|
+
HeaderComponent.displayName = 'Header';
|
|
1199
|
+
HeaderComponent.propTypes = {
|
|
1200
|
+
isStandalone: PropTypes__default.default.bool
|
|
1202
1201
|
};
|
|
1202
|
+
const Header$1 = HeaderComponent;
|
|
1203
|
+
Header$1.Item = HeaderItem;
|
|
1204
|
+
Header$1.ItemIcon = HeaderItemIcon;
|
|
1205
|
+
Header$1.ItemText = HeaderItemText;
|
|
1206
|
+
Header$1.ItemWrapper = HeaderItemWrapper;
|
|
1203
1207
|
|
|
1204
|
-
const
|
|
1205
|
-
let {
|
|
1206
|
-
header,
|
|
1207
|
-
children,
|
|
1208
|
-
isExpanded: controlledExpanded,
|
|
1209
|
-
onChange,
|
|
1210
|
-
...other
|
|
1211
|
-
} = _ref;
|
|
1208
|
+
const FooterComponent = React__namespace.default.forwardRef((props, ref) => {
|
|
1212
1209
|
const {
|
|
1213
|
-
|
|
1210
|
+
hasFooter,
|
|
1211
|
+
setHasFooter
|
|
1212
|
+
} = useBodyContext() || {};
|
|
1213
|
+
React.useEffect(() => {
|
|
1214
|
+
if (!hasFooter && setHasFooter) {
|
|
1215
|
+
setHasFooter(true);
|
|
1216
|
+
}
|
|
1217
|
+
return () => {
|
|
1218
|
+
if (hasFooter && setHasFooter) {
|
|
1219
|
+
setHasFooter(false);
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
}, [hasFooter, setHasFooter]);
|
|
1223
|
+
return React__namespace.default.createElement(StyledFooter, Object.assign({
|
|
1224
|
+
ref: ref
|
|
1225
|
+
}, props));
|
|
1226
|
+
});
|
|
1227
|
+
FooterComponent.displayName = 'Footer';
|
|
1228
|
+
const Footer$1 = FooterComponent;
|
|
1229
|
+
Footer$1.Item = FooterItem$1;
|
|
1230
|
+
|
|
1231
|
+
const NavList = React__namespace.default.forwardRef((props, ref) => {
|
|
1232
|
+
const contextValue = React.useMemo(() => ({
|
|
1233
|
+
hasList: true
|
|
1234
|
+
}), []);
|
|
1235
|
+
return React__namespace.default.createElement(NavListContext.Provider, {
|
|
1236
|
+
value: contextValue
|
|
1237
|
+
}, React__namespace.default.createElement(StyledNavList, Object.assign({
|
|
1238
|
+
ref: ref
|
|
1239
|
+
}, props)));
|
|
1240
|
+
});
|
|
1241
|
+
NavList.displayName = 'Nav';
|
|
1242
|
+
|
|
1243
|
+
const NavComponent = React__namespace.default.forwardRef((props, ref) => {
|
|
1244
|
+
const {
|
|
1245
|
+
hue,
|
|
1214
1246
|
isLight
|
|
1215
1247
|
} = useChromeContext();
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
} = containerAccordion.useAccordion({
|
|
1226
|
-
sections: [value],
|
|
1227
|
-
expandedSections,
|
|
1228
|
-
onChange: () => {
|
|
1229
|
-
const isExpanded = expandedSections.length === 0;
|
|
1230
|
-
if (onChange) {
|
|
1231
|
-
onChange(isExpanded);
|
|
1232
|
-
} else {
|
|
1233
|
-
setInternalExpanded(isExpanded);
|
|
1248
|
+
const navContextValue = React.useMemo(() => ({
|
|
1249
|
+
isExpanded: !!props.isExpanded
|
|
1250
|
+
}), [props.isExpanded]);
|
|
1251
|
+
return React__namespace.default.createElement(styled.ThemeProvider, {
|
|
1252
|
+
theme: parentTheme => ({
|
|
1253
|
+
...parentTheme,
|
|
1254
|
+
colors: {
|
|
1255
|
+
...parentTheme.colors,
|
|
1256
|
+
base: isLight ? 'light' : 'dark'
|
|
1234
1257
|
}
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
panelRef.current.style.maxHeight = `${panelRef.current.scrollHeight}px`;
|
|
1240
|
-
}
|
|
1241
|
-
}, [expanded, children, panelRef]);
|
|
1242
|
-
return React__namespace.default.createElement("div", {
|
|
1258
|
+
})
|
|
1259
|
+
}, React__namespace.default.createElement(NavContext.Provider, {
|
|
1260
|
+
value: navContextValue
|
|
1261
|
+
}, React__namespace.default.createElement(StyledNav, Object.assign({
|
|
1243
1262
|
ref: ref
|
|
1244
|
-
},
|
|
1245
|
-
|
|
1246
|
-
})
|
|
1247
|
-
isDark: isDark,
|
|
1248
|
-
isLight: isLight,
|
|
1249
|
-
isExpanded: expanded
|
|
1250
|
-
}, getTriggerProps({
|
|
1251
|
-
...other,
|
|
1252
|
-
role: null,
|
|
1253
|
-
tabIndex: null,
|
|
1254
|
-
value
|
|
1255
|
-
}), {
|
|
1256
|
-
type: "button"
|
|
1257
|
-
}), React__namespace.default.createElement(React__namespace.default.Fragment, null, header, React__namespace.default.createElement(StyledSubNavItemIconWrapper, {
|
|
1258
|
-
isExpanded: expanded
|
|
1259
|
-
}, React__namespace.default.createElement(StyledSubNavItemIcon, null))))), React__namespace.default.createElement(StyledSubNavPanel, _extends$3({
|
|
1260
|
-
isHidden: !expanded
|
|
1261
|
-
}, getPanelProps({
|
|
1262
|
-
ref: panelRef,
|
|
1263
|
-
value
|
|
1264
|
-
})), children));
|
|
1263
|
+
}, props, {
|
|
1264
|
+
hue: hue
|
|
1265
|
+
}))));
|
|
1265
1266
|
});
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
isExpanded: PropTypes__default.default.bool
|
|
1269
|
-
onChange: PropTypes__default.default.func
|
|
1267
|
+
NavComponent.displayName = 'Nav';
|
|
1268
|
+
NavComponent.propTypes = {
|
|
1269
|
+
isExpanded: PropTypes__default.default.bool
|
|
1270
1270
|
};
|
|
1271
|
-
|
|
1271
|
+
const Nav = NavComponent;
|
|
1272
|
+
Nav.List = NavList;
|
|
1273
|
+
Nav.Item = NavItem;
|
|
1274
|
+
Nav.ItemIcon = NavItemIcon;
|
|
1275
|
+
Nav.ItemText = NavItemText;
|
|
1272
1276
|
|
|
1273
1277
|
const SheetContext = React.createContext({
|
|
1274
1278
|
setIsCloseButtonPresent() {}
|
|
@@ -1306,7 +1310,7 @@ const SheetTitle = React.forwardRef((_ref, ref) => {
|
|
|
1306
1310
|
const {
|
|
1307
1311
|
titleId
|
|
1308
1312
|
} = useSheetContext();
|
|
1309
|
-
return React__namespace.default.createElement(StyledSheetTitle,
|
|
1313
|
+
return React__namespace.default.createElement(StyledSheetTitle, Object.assign({
|
|
1310
1314
|
id: id || titleId,
|
|
1311
1315
|
ref: ref
|
|
1312
1316
|
}, props));
|
|
@@ -1322,7 +1326,7 @@ const SheetDescription = React.forwardRef((_ref, ref) => {
|
|
|
1322
1326
|
const {
|
|
1323
1327
|
descriptionId
|
|
1324
1328
|
} = useSheetContext();
|
|
1325
|
-
return React__namespace.default.createElement(StyledSheetDescription,
|
|
1329
|
+
return React__namespace.default.createElement(StyledSheetDescription, Object.assign({
|
|
1326
1330
|
id: id || descriptionId,
|
|
1327
1331
|
ref: ref
|
|
1328
1332
|
}, props));
|
|
@@ -1334,7 +1338,7 @@ const SheetHeader = React.forwardRef((props, ref) => {
|
|
|
1334
1338
|
const {
|
|
1335
1339
|
isCloseButtonPresent
|
|
1336
1340
|
} = useSheetContext();
|
|
1337
|
-
return React__namespace.default.createElement(StyledSheetHeader,
|
|
1341
|
+
return React__namespace.default.createElement(StyledSheetHeader, Object.assign({
|
|
1338
1342
|
ref: ref,
|
|
1339
1343
|
isCloseButtonPresent: isCloseButtonPresent
|
|
1340
1344
|
}, props));
|
|
@@ -1343,7 +1347,7 @@ SheetHeader.displayName = 'Sheet.Header';
|
|
|
1343
1347
|
const Header = SheetHeader;
|
|
1344
1348
|
|
|
1345
1349
|
const SheetBody = React.forwardRef((props, ref) => {
|
|
1346
|
-
return React__namespace.default.createElement(StyledSheetBody,
|
|
1350
|
+
return React__namespace.default.createElement(StyledSheetBody, Object.assign({
|
|
1347
1351
|
ref: ref
|
|
1348
1352
|
}, props));
|
|
1349
1353
|
});
|
|
@@ -1351,7 +1355,7 @@ SheetBody.displayName = 'Sheet.Body';
|
|
|
1351
1355
|
const Body = SheetBody;
|
|
1352
1356
|
|
|
1353
1357
|
const SheetFooter = React.forwardRef((props, ref) => {
|
|
1354
|
-
return React__namespace.default.createElement(StyledSheetFooter,
|
|
1358
|
+
return React__namespace.default.createElement(StyledSheetFooter, Object.assign({
|
|
1355
1359
|
ref: ref
|
|
1356
1360
|
}, props));
|
|
1357
1361
|
});
|
|
@@ -1359,7 +1363,7 @@ SheetFooter.displayName = 'Sheet.Footer';
|
|
|
1359
1363
|
const Footer = SheetFooter;
|
|
1360
1364
|
|
|
1361
1365
|
const SheetFooterItem = React.forwardRef((props, ref) => {
|
|
1362
|
-
return React__namespace.default.createElement(StyledSheetFooterItem,
|
|
1366
|
+
return React__namespace.default.createElement(StyledSheetFooterItem, Object.assign({
|
|
1363
1367
|
ref: ref
|
|
1364
1368
|
}, props));
|
|
1365
1369
|
});
|
|
@@ -1367,7 +1371,7 @@ SheetFooterItem.displayName = 'Sheet.FooterItem';
|
|
|
1367
1371
|
const FooterItem = SheetFooterItem;
|
|
1368
1372
|
|
|
1369
1373
|
var _path;
|
|
1370
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1374
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
1371
1375
|
var SvgXStroke = function SvgXStroke(props) {
|
|
1372
1376
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1373
1377
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1391,7 +1395,7 @@ const SheetClose = React.forwardRef((props, ref) => {
|
|
|
1391
1395
|
setIsCloseButtonPresent(true);
|
|
1392
1396
|
return () => setIsCloseButtonPresent(false);
|
|
1393
1397
|
}, [setIsCloseButtonPresent]);
|
|
1394
|
-
return React__namespace.default.createElement(StyledSheetClose,
|
|
1398
|
+
return React__namespace.default.createElement(StyledSheetClose, Object.assign({
|
|
1395
1399
|
"aria-label": "Close Sheet",
|
|
1396
1400
|
ref: ref
|
|
1397
1401
|
}, props), React__namespace.default.createElement(SvgXStroke, null));
|
|
@@ -1414,7 +1418,7 @@ const SheetComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
|
1414
1418
|
const sheetRef = React.useRef(null);
|
|
1415
1419
|
const seed = reactUid.useUIDSeed();
|
|
1416
1420
|
const [isCloseButtonPresent, setIsCloseButtonPresent] = React.useState(false);
|
|
1417
|
-
const idPrefix = React.useMemo(() => id || seed(`sheet_${'9.0.0-next.
|
|
1421
|
+
const idPrefix = React.useMemo(() => id || seed(`sheet_${'9.0.0-next.20'}`), [id, seed]);
|
|
1418
1422
|
const titleId = `${idPrefix}--title`;
|
|
1419
1423
|
const descriptionId = `${idPrefix}--description`;
|
|
1420
1424
|
const sheetContext = React.useMemo(() => ({
|
|
@@ -1431,7 +1435,7 @@ const SheetComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
|
1431
1435
|
});
|
|
1432
1436
|
return React__namespace.default.createElement(SheetContext.Provider, {
|
|
1433
1437
|
value: sheetContext
|
|
1434
|
-
}, React__namespace.default.createElement(StyledSheet,
|
|
1438
|
+
}, React__namespace.default.createElement(StyledSheet, Object.assign({
|
|
1435
1439
|
isOpen: isOpen,
|
|
1436
1440
|
isAnimated: isAnimated,
|
|
1437
1441
|
placement: placement,
|
|
@@ -1474,7 +1478,6 @@ Sheet.Title = Title;
|
|
|
1474
1478
|
|
|
1475
1479
|
exports.Body = Body$1;
|
|
1476
1480
|
exports.Chrome = Chrome;
|
|
1477
|
-
exports.CollapsibleSubNavItem = CollapsibleSubNavItem;
|
|
1478
1481
|
exports.Content = Content;
|
|
1479
1482
|
exports.Footer = Footer$1;
|
|
1480
1483
|
exports.FooterItem = FooterItem$1;
|
|
@@ -1488,10 +1491,6 @@ exports.Nav = Nav;
|
|
|
1488
1491
|
exports.NavItem = NavItem;
|
|
1489
1492
|
exports.NavItemIcon = NavItemIcon;
|
|
1490
1493
|
exports.NavItemText = NavItemText;
|
|
1491
|
-
exports.PRODUCTS =
|
|
1494
|
+
exports.PRODUCTS = PRODUCTS;
|
|
1492
1495
|
exports.Sheet = Sheet;
|
|
1493
|
-
exports.Sidebar = Sidebar;
|
|
1494
1496
|
exports.SkipNav = SkipNav;
|
|
1495
|
-
exports.SubNav = SubNav;
|
|
1496
|
-
exports.SubNavItem = SubNavItem;
|
|
1497
|
-
exports.SubNavItemText = SubNavItemText;
|