@zendeskgarden/react-chrome 9.0.0-next.3 → 9.0.0-next.5
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 +15 -19
- package/dist/index.cjs.js +248 -233
- package/dist/index.esm.js +249 -234
- 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 +2 -0
- 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 +9 -1
- package/dist/typings/elements/nav/NavItem.d.ts +2 -0
- package/dist/typings/elements/nav/NavItemIcon.d.ts +2 -0
- package/dist/typings/elements/nav/NavItemText.d.ts +2 -0
- package/dist/typings/elements/subnav/CollapsibleSubNavItem.d.ts +2 -0
- package/dist/typings/elements/subnav/SubNav.d.ts +9 -1
- package/dist/typings/elements/subnav/SubNavItem.d.ts +2 -0
- package/dist/typings/elements/subnav/SubNavItemText.d.ts +2 -0
- package/dist/typings/index.d.ts +10 -10
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, {
|
|
9
|
+
import React__default, { Children, isValidElement, cloneElement, useContext, createRef, useState, useEffect, useMemo, createContext, useRef, forwardRef } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import styled, { css, keyframes, ThemeContext } from 'styled-components';
|
|
12
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColorV8, PALETTE, SELECTOR_FOCUS_VISIBLE, focusStyles, useDocument } from '@zendeskgarden/react-theming';
|
|
12
13
|
import { math, rgba, readableColor } from 'polished';
|
|
13
|
-
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor, PALETTE, SELECTOR_FOCUS_VISIBLE, focusStyles, useDocument } from '@zendeskgarden/react-theming';
|
|
14
14
|
import { useAccordion } from '@zendeskgarden/container-accordion';
|
|
15
15
|
import { getControlledValue } from '@zendeskgarden/container-utilities';
|
|
16
16
|
import { useUIDSeed } from 'react-uid';
|
|
@@ -32,17 +32,13 @@ function _extends$3() {
|
|
|
32
32
|
return _extends$3.apply(this, arguments);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
const useChromeContext = () => {
|
|
39
|
-
return useContext(ChromeContext);
|
|
40
|
-
};
|
|
35
|
+
const PLACEMENT = ['end', 'start'];
|
|
36
|
+
const PRODUCTS = ['chat', 'connect', 'explore', 'guide', 'message', 'support', 'talk'];
|
|
41
37
|
|
|
42
38
|
const COMPONENT_ID$A = 'chrome.chrome';
|
|
43
39
|
const StyledChrome = styled.div.attrs({
|
|
44
40
|
'data-garden-id': COMPONENT_ID$A,
|
|
45
|
-
'data-garden-version': '9.0.0-next.
|
|
41
|
+
'data-garden-version': '9.0.0-next.5'
|
|
46
42
|
}).withConfig({
|
|
47
43
|
displayName: "StyledChrome",
|
|
48
44
|
componentId: "sc-1uqm6u6-0"
|
|
@@ -54,7 +50,7 @@ StyledChrome.defaultProps = {
|
|
|
54
50
|
const COMPONENT_ID$z = 'chrome.header_item_icon';
|
|
55
51
|
const StyledHeaderItemIcon = styled.div.attrs({
|
|
56
52
|
'data-garden-id': COMPONENT_ID$z,
|
|
57
|
-
'data-garden-version': '9.0.0-next.
|
|
53
|
+
'data-garden-version': '9.0.0-next.5'
|
|
58
54
|
}).withConfig({
|
|
59
55
|
displayName: "StyledHeaderItemIcon",
|
|
60
56
|
componentId: "sc-1jhhp6z-0"
|
|
@@ -71,7 +67,7 @@ const sizeStyles$4 = props => {
|
|
|
71
67
|
};
|
|
72
68
|
const StyledBaseHeaderItem = styled.button.attrs({
|
|
73
69
|
'data-garden-id': COMPONENT_ID$y,
|
|
74
|
-
'data-garden-version': '9.0.0-next.
|
|
70
|
+
'data-garden-version': '9.0.0-next.5'
|
|
75
71
|
}).withConfig({
|
|
76
72
|
displayName: "StyledBaseHeaderItem",
|
|
77
73
|
componentId: "sc-1qua7h6-0"
|
|
@@ -92,7 +88,7 @@ const COMPONENT_ID$x = 'chrome.header_item_text';
|
|
|
92
88
|
const clippedStyling = css(["position:absolute;margin:0;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
|
|
93
89
|
const StyledHeaderItemText = styled.span.attrs({
|
|
94
90
|
'data-garden-id': COMPONENT_ID$x,
|
|
95
|
-
'data-garden-version': '9.0.0-next.
|
|
91
|
+
'data-garden-version': '9.0.0-next.5'
|
|
96
92
|
}).withConfig({
|
|
97
93
|
displayName: "StyledHeaderItemText",
|
|
98
94
|
componentId: "sc-goz7la-0"
|
|
@@ -104,7 +100,7 @@ StyledHeaderItemText.defaultProps = {
|
|
|
104
100
|
const COMPONENT_ID$w = 'chrome.nav';
|
|
105
101
|
const colorStyles$6 = props => {
|
|
106
102
|
const shade = props.isDark || props.isLight ? 600 : 700;
|
|
107
|
-
const backgroundColor =
|
|
103
|
+
const backgroundColor = getColorV8(props.hue, shade, props.theme);
|
|
108
104
|
const foregroundColor = props.isLight ? props.theme.palette.black : props.theme.palette.white;
|
|
109
105
|
return css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
110
106
|
};
|
|
@@ -116,7 +112,7 @@ const getExpandedNavWidth = () => {
|
|
|
116
112
|
};
|
|
117
113
|
const StyledNav = styled.nav.attrs({
|
|
118
114
|
'data-garden-id': COMPONENT_ID$w,
|
|
119
|
-
'data-garden-version': '9.0.0-next.
|
|
115
|
+
'data-garden-version': '9.0.0-next.5'
|
|
120
116
|
}).withConfig({
|
|
121
117
|
displayName: "StyledNav",
|
|
122
118
|
componentId: "sc-6j462r-0"
|
|
@@ -148,12 +144,12 @@ const retrieveProductColor$1 = props => {
|
|
|
148
144
|
};
|
|
149
145
|
const StyledLogoHeaderItem = styled(StyledBaseHeaderItem).attrs({
|
|
150
146
|
'data-garden-id': COMPONENT_ID$v,
|
|
151
|
-
'data-garden-version': '9.0.0-next.
|
|
147
|
+
'data-garden-version': '9.0.0-next.5',
|
|
152
148
|
as: 'div'
|
|
153
149
|
}).withConfig({
|
|
154
150
|
displayName: "StyledLogoHeaderItem",
|
|
155
151
|
componentId: "sc-1n1d1yv-0"
|
|
156
|
-
})(["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} ${
|
|
152
|
+
})(["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} ${getColorV8('neutralHue', 300, props.theme)}`, props => getNavWidth(props), props => getColorV8('chromeHue', 700, props.theme), props => retrieveProductColor$1(props), StyledHeaderItemText, clippedStyling, StyledHeaderItemIcon, props => props.theme.iconSizes.lg, props => props.theme.iconSizes.lg, props => retrieveComponentStyles(COMPONENT_ID$v, props));
|
|
157
153
|
StyledLogoHeaderItem.defaultProps = {
|
|
158
154
|
theme: DEFAULT_THEME
|
|
159
155
|
};
|
|
@@ -169,7 +165,7 @@ const sizeStyles$3 = props => {
|
|
|
169
165
|
};
|
|
170
166
|
const StyledBaseNavItem = styled.button.attrs({
|
|
171
167
|
'data-garden-id': COMPONENT_ID$u,
|
|
172
|
-
'data-garden-version': '9.0.0-next.
|
|
168
|
+
'data-garden-version': '9.0.0-next.5'
|
|
173
169
|
}).withConfig({
|
|
174
170
|
displayName: "StyledBaseNavItem",
|
|
175
171
|
componentId: "sc-zvo43f-0"
|
|
@@ -184,11 +180,11 @@ const getHeaderHeight = props => {
|
|
|
184
180
|
};
|
|
185
181
|
const StyledHeader = styled.header.attrs({
|
|
186
182
|
'data-garden-id': COMPONENT_ID$t,
|
|
187
|
-
'data-garden-version': '9.0.0-next.
|
|
183
|
+
'data-garden-version': '9.0.0-next.5'
|
|
188
184
|
}).withConfig({
|
|
189
185
|
displayName: "StyledHeader",
|
|
190
186
|
componentId: "sc-1cexpz-0"
|
|
191
|
-
})(["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} ${
|
|
187
|
+
})(["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} ${getColorV8('neutralHue', 300, props.theme)}`, props => props.isStandalone && props.theme.shadows.lg('0', '10px', getColorV8('chromeHue', 600, props.theme, 0.15)), props => props.theme.colors.background, props => props.theme.space.base, getHeaderHeight, props => getColorV8('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => props.isStandalone && `
|
|
192
188
|
${StyledLogoHeaderItem} {
|
|
193
189
|
display: inline-flex;
|
|
194
190
|
}
|
|
@@ -203,9 +199,9 @@ const animationStyles = () => {
|
|
|
203
199
|
return css(["transition:opacity 0.2s ease-out,clip 0s linear 0.2s;opacity:0;clip:rect(0,0,0,0);&:focus{transition:opacity 0.2s ease-in-out;animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";opacity:1;clip:rect(0,150vw,100vh,-50vw);}"], animationName);
|
|
204
200
|
};
|
|
205
201
|
const colorStyles$5 = theme => {
|
|
206
|
-
const color =
|
|
207
|
-
const borderColor =
|
|
208
|
-
const boxShadow = theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7}px`,
|
|
202
|
+
const color = getColorV8('primaryHue', 600, theme);
|
|
203
|
+
const borderColor = getColorV8('neutralHue', 300, theme);
|
|
204
|
+
const boxShadow = theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7}px`, getColorV8('chromeHue', 600, theme, 0.15));
|
|
209
205
|
return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover,&:focus{color:", ";}", ""], borderColor, boxShadow, theme.colors.background, color, color, focusStyles({
|
|
210
206
|
theme,
|
|
211
207
|
inset: true,
|
|
@@ -222,7 +218,7 @@ const sizeStyles$2 = props => {
|
|
|
222
218
|
};
|
|
223
219
|
const StyledSkipNav = styled.a.attrs({
|
|
224
220
|
'data-garden-id': COMPONENT_ID$s,
|
|
225
|
-
'data-garden-version': '9.0.0-next.
|
|
221
|
+
'data-garden-version': '9.0.0-next.5'
|
|
226
222
|
}).withConfig({
|
|
227
223
|
displayName: "StyledSkipNav",
|
|
228
224
|
componentId: "sc-1tsro34-0"
|
|
@@ -255,11 +251,11 @@ const sizeStyles$1 = theme => {
|
|
|
255
251
|
};
|
|
256
252
|
const StyledSkipNavIcon = styled(SvgLinkStroke).attrs({
|
|
257
253
|
'data-garden-id': COMPONENT_ID$r,
|
|
258
|
-
'data-garden-version': '9.0.0-next.
|
|
254
|
+
'data-garden-version': '9.0.0-next.5'
|
|
259
255
|
}).withConfig({
|
|
260
256
|
displayName: "StyledSkipNavIcon",
|
|
261
257
|
componentId: "sc-1ika5z4-0"
|
|
262
|
-
})(["transform:", ";color:", ";", ";", ";"], props => props.theme.rtl && 'scaleX(-1)', props =>
|
|
258
|
+
})(["transform:", ";color:", ";", ";", ";"], props => props.theme.rtl && 'scaleX(-1)', props => getColorV8('neutralHue', 600, props.theme), props => sizeStyles$1(props.theme), props => retrieveComponentStyles(COMPONENT_ID$r, props));
|
|
263
259
|
StyledSkipNavIcon.defaultProps = {
|
|
264
260
|
theme: DEFAULT_THEME
|
|
265
261
|
};
|
|
@@ -267,11 +263,11 @@ StyledSkipNavIcon.defaultProps = {
|
|
|
267
263
|
const COMPONENT_ID$q = 'chrome.body';
|
|
268
264
|
const StyledBody = styled.div.attrs({
|
|
269
265
|
'data-garden-id': COMPONENT_ID$q,
|
|
270
|
-
'data-garden-version': '9.0.0-next.
|
|
266
|
+
'data-garden-version': '9.0.0-next.5'
|
|
271
267
|
}).withConfig({
|
|
272
268
|
displayName: "StyledBody",
|
|
273
269
|
componentId: "sc-c7h9kv-0"
|
|
274
|
-
})(["flex:1;order:1;background-color:", ";min-width:0;", ";"], props =>
|
|
270
|
+
})(["flex:1;order:1;background-color:", ";min-width:0;", ";"], props => getColorV8('neutralHue', 100, props.theme), props => retrieveComponentStyles(COMPONENT_ID$q, props));
|
|
275
271
|
StyledBody.defaultProps = {
|
|
276
272
|
theme: DEFAULT_THEME
|
|
277
273
|
};
|
|
@@ -282,11 +278,11 @@ const getFooterHeight = props => {
|
|
|
282
278
|
};
|
|
283
279
|
const StyledFooter = styled.footer.attrs({
|
|
284
280
|
'data-garden-id': COMPONENT_ID$p,
|
|
285
|
-
'data-garden-version': '9.0.0-next.
|
|
281
|
+
'data-garden-version': '9.0.0-next.5'
|
|
286
282
|
}).withConfig({
|
|
287
283
|
displayName: "StyledFooter",
|
|
288
284
|
componentId: "sc-v7lib2-0"
|
|
289
|
-
})(["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} ${
|
|
285
|
+
})(["display:flex;align-items:center;justify-content:flex-end;box-sizing:border-box;border-top:", ";background-color:", ";padding:0 ", "px;height:", ";", ";"], props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 300, props.theme)}`, props => props.theme.colors.background, props => props.theme.space.base * 9, getFooterHeight, props => retrieveComponentStyles(COMPONENT_ID$p, props));
|
|
290
286
|
StyledFooter.defaultProps = {
|
|
291
287
|
theme: DEFAULT_THEME
|
|
292
288
|
};
|
|
@@ -294,7 +290,7 @@ StyledFooter.defaultProps = {
|
|
|
294
290
|
const COMPONENT_ID$o = 'chrome.content';
|
|
295
291
|
const StyledContent = styled.div.attrs({
|
|
296
292
|
'data-garden-id': COMPONENT_ID$o,
|
|
297
|
-
'data-garden-version': '9.0.0-next.
|
|
293
|
+
'data-garden-version': '9.0.0-next.5'
|
|
298
294
|
}).withConfig({
|
|
299
295
|
displayName: "StyledContent",
|
|
300
296
|
componentId: "sc-qcuzxn-0"
|
|
@@ -306,7 +302,7 @@ StyledContent.defaultProps = {
|
|
|
306
302
|
const COMPONENT_ID$n = 'chrome.main';
|
|
307
303
|
const StyledMain = styled.main.attrs({
|
|
308
304
|
'data-garden-id': COMPONENT_ID$n,
|
|
309
|
-
'data-garden-version': '9.0.0-next.
|
|
305
|
+
'data-garden-version': '9.0.0-next.5'
|
|
310
306
|
}).withConfig({
|
|
311
307
|
displayName: "StyledMain",
|
|
312
308
|
componentId: "sc-t61cre-0"
|
|
@@ -318,11 +314,11 @@ StyledMain.defaultProps = {
|
|
|
318
314
|
const COMPONENT_ID$m = 'chrome.sidebar';
|
|
319
315
|
const StyledSidebar = styled.aside.attrs({
|
|
320
316
|
'data-garden-id': COMPONENT_ID$m,
|
|
321
|
-
'data-garden-version': '9.0.0-next.
|
|
317
|
+
'data-garden-version': '9.0.0-next.5'
|
|
322
318
|
}).withConfig({
|
|
323
319
|
displayName: "StyledSidebar",
|
|
324
320
|
componentId: "sc-1q77fuw-0"
|
|
325
|
-
})(["flex-shrink:0;order:0;box-sizing:border-box;border-", ":", ";width:330px;overflow:auto;&:focus{outline:none;}", ";"], props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.borders.sm} ${
|
|
321
|
+
})(["flex-shrink:0;order:0;box-sizing:border-box;border-", ":", ";width:330px;overflow:auto;&:focus{outline:none;}", ";"], props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 300, props.theme)}`, props => retrieveComponentStyles(COMPONENT_ID$m, props));
|
|
326
322
|
StyledSidebar.defaultProps = {
|
|
327
323
|
theme: DEFAULT_THEME
|
|
328
324
|
};
|
|
@@ -330,7 +326,7 @@ StyledSidebar.defaultProps = {
|
|
|
330
326
|
const COMPONENT_ID$l = 'chrome.footer_item';
|
|
331
327
|
const StyledFooterItem = styled.div.attrs({
|
|
332
328
|
'data-garden-id': COMPONENT_ID$l,
|
|
333
|
-
'data-garden-version': '9.0.0-next.
|
|
329
|
+
'data-garden-version': '9.0.0-next.5'
|
|
334
330
|
}).withConfig({
|
|
335
331
|
displayName: "StyledFooterItem",
|
|
336
332
|
componentId: "sc-1cktm85-0"
|
|
@@ -346,14 +342,14 @@ const imgStyles = props => {
|
|
|
346
342
|
};
|
|
347
343
|
const StyledHeaderItem = styled(StyledBaseHeaderItem).attrs({
|
|
348
344
|
'data-garden-id': COMPONENT_ID$k,
|
|
349
|
-
'data-garden-version': '9.0.0-next.
|
|
345
|
+
'data-garden-version': '9.0.0-next.5'
|
|
350
346
|
}).withConfig({
|
|
351
347
|
displayName: "StyledHeaderItem",
|
|
352
348
|
componentId: "sc-14sft6n-0"
|
|
353
349
|
})(["&:hover,&:focus{text-decoration:none;color:inherit;}", " &:focus-visible:active,&[data-garden-focus-visible]:active{box-shadow:none;}&:hover ", ",&:hover ", ",&:active ", ",&:active ", "{color:", ";}", " ", " ", ";"], props => focusStyles({
|
|
354
350
|
theme: props.theme,
|
|
355
351
|
inset: props.maxY
|
|
356
|
-
}), StyledHeaderItemIcon, StyledHeaderItemText, StyledHeaderItemIcon, StyledHeaderItemText, props =>
|
|
352
|
+
}), StyledHeaderItemIcon, StyledHeaderItemText, StyledHeaderItemIcon, StyledHeaderItemText, props => getColorV8('chromeHue', 700, props.theme), imgStyles, props => props.isRound && `
|
|
357
353
|
${StyledHeaderItemIcon} {
|
|
358
354
|
border-radius: 100px;
|
|
359
355
|
}
|
|
@@ -365,7 +361,7 @@ StyledHeaderItem.defaultProps = {
|
|
|
365
361
|
const COMPONENT_ID$j = 'chrome.header_item_wrapper';
|
|
366
362
|
const StyledHeaderItemWrapper = styled(StyledBaseHeaderItem).attrs({
|
|
367
363
|
'data-garden-id': COMPONENT_ID$j,
|
|
368
|
-
'data-garden-version': '9.0.0-next.
|
|
364
|
+
'data-garden-version': '9.0.0-next.5',
|
|
369
365
|
as: 'div'
|
|
370
366
|
}).withConfig({
|
|
371
367
|
displayName: "StyledHeaderItemWrapper",
|
|
@@ -403,7 +399,7 @@ const colorStyles$4 = props => {
|
|
|
403
399
|
};
|
|
404
400
|
const StyledLogoNavItem = styled(StyledBaseNavItem).attrs({
|
|
405
401
|
'data-garden-id': COMPONENT_ID$i,
|
|
406
|
-
'data-garden-version': '9.0.0-next.
|
|
402
|
+
'data-garden-version': '9.0.0-next.5',
|
|
407
403
|
as: 'div'
|
|
408
404
|
}).withConfig({
|
|
409
405
|
displayName: "StyledLogoNavItem",
|
|
@@ -416,7 +412,7 @@ StyledLogoNavItem.defaultProps = {
|
|
|
416
412
|
const COMPONENT_ID$h = 'chrome.brandmark_nav_item';
|
|
417
413
|
const StyledBrandmarkNavItem = styled(StyledBaseNavItem).attrs({
|
|
418
414
|
'data-garden-id': COMPONENT_ID$h,
|
|
419
|
-
'data-garden-version': '9.0.0-next.
|
|
415
|
+
'data-garden-version': '9.0.0-next.5',
|
|
420
416
|
as: 'div'
|
|
421
417
|
}).withConfig({
|
|
422
418
|
displayName: "StyledBrandmarkNavItem",
|
|
@@ -429,7 +425,7 @@ StyledBrandmarkNavItem.defaultProps = {
|
|
|
429
425
|
const COMPONENT_ID$g = 'chrome.nav_item_icon';
|
|
430
426
|
const StyledNavItemIcon = styled.div.attrs({
|
|
431
427
|
'data-garden-id': COMPONENT_ID$g,
|
|
432
|
-
'data-garden-version': '9.0.0-next.
|
|
428
|
+
'data-garden-version': '9.0.0-next.5'
|
|
433
429
|
}).withConfig({
|
|
434
430
|
displayName: "StyledNavItemIcon",
|
|
435
431
|
componentId: "sc-7w9rpt-0"
|
|
@@ -457,7 +453,7 @@ const colorStyles$3 = props => {
|
|
|
457
453
|
} else if (isDark) {
|
|
458
454
|
currentColor = rgba(LIGHT, 0.4);
|
|
459
455
|
} else {
|
|
460
|
-
currentColor =
|
|
456
|
+
currentColor = getColorV8(hue, 500, theme);
|
|
461
457
|
}
|
|
462
458
|
} else {
|
|
463
459
|
hoverColor = rgba(isLight ? LIGHT : DARK, 0.1);
|
|
@@ -475,7 +471,7 @@ const colorStyles$3 = props => {
|
|
|
475
471
|
};
|
|
476
472
|
const StyledNavItem = styled(StyledBaseNavItem).attrs({
|
|
477
473
|
'data-garden-id': COMPONENT_ID$f,
|
|
478
|
-
'data-garden-version': '9.0.0-next.
|
|
474
|
+
'data-garden-version': '9.0.0-next.5',
|
|
479
475
|
as: 'button'
|
|
480
476
|
}).withConfig({
|
|
481
477
|
displayName: "StyledNavItem",
|
|
@@ -492,7 +488,7 @@ StyledNavItem.defaultProps = {
|
|
|
492
488
|
const COMPONENT_ID$e = 'chrome.nav_item_text';
|
|
493
489
|
const StyledNavItemText = styled.span.attrs({
|
|
494
490
|
'data-garden-id': COMPONENT_ID$e,
|
|
495
|
-
'data-garden-version': '9.0.0-next.
|
|
491
|
+
'data-garden-version': '9.0.0-next.5'
|
|
496
492
|
}).withConfig({
|
|
497
493
|
displayName: "StyledNavItemText",
|
|
498
494
|
componentId: "sc-13m84xl-0"
|
|
@@ -545,7 +541,7 @@ const getSubNavItemHeight = props => {
|
|
|
545
541
|
};
|
|
546
542
|
const StyledSubNavItem = styled.button.attrs({
|
|
547
543
|
'data-garden-id': COMPONENT_ID$d,
|
|
548
|
-
'data-garden-version': '9.0.0-next.
|
|
544
|
+
'data-garden-version': '9.0.0-next.5'
|
|
549
545
|
}).withConfig({
|
|
550
546
|
displayName: "StyledSubNavItem",
|
|
551
547
|
componentId: "sc-1yg9dpx-0"
|
|
@@ -562,13 +558,13 @@ const colorStyles$1 = props => {
|
|
|
562
558
|
} else {
|
|
563
559
|
shade = props.isDark ? 700 : 800;
|
|
564
560
|
}
|
|
565
|
-
const backgroundColor =
|
|
561
|
+
const backgroundColor = getColorV8(props.hue, shade, props.theme);
|
|
566
562
|
const foregroundColor = props.isLight ? props.theme.palette.grey[800] : props.theme.palette.white;
|
|
567
563
|
return css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
|
|
568
564
|
};
|
|
569
565
|
const StyledSubNav = styled.nav.attrs({
|
|
570
566
|
'data-garden-id': COMPONENT_ID$c,
|
|
571
|
-
'data-garden-version': '9.0.0-next.
|
|
567
|
+
'data-garden-version': '9.0.0-next.5'
|
|
572
568
|
}).withConfig({
|
|
573
569
|
displayName: "StyledSubNav",
|
|
574
570
|
componentId: "sc-19hjou6-0"
|
|
@@ -586,7 +582,7 @@ const sizeStyles = props => {
|
|
|
586
582
|
};
|
|
587
583
|
const StyledSubNavItemText = styled.span.attrs({
|
|
588
584
|
'data-garden-id': COMPONENT_ID$b,
|
|
589
|
-
'data-garden-version': '9.0.0-next.
|
|
585
|
+
'data-garden-version': '9.0.0-next.5'
|
|
590
586
|
}).withConfig({
|
|
591
587
|
displayName: "StyledSubNavItemText",
|
|
592
588
|
componentId: "sc-1hy0pn7-0"
|
|
@@ -598,7 +594,7 @@ StyledSubNavItemText.defaultProps = {
|
|
|
598
594
|
const COMPONENT_ID$a = 'chrome.collapsible_sub_nav_item';
|
|
599
595
|
const StyledSubNavItemHeader = styled(StyledSubNavItem).attrs({
|
|
600
596
|
'data-garden-id': COMPONENT_ID$a,
|
|
601
|
-
'data-garden-version': '9.0.0-next.
|
|
597
|
+
'data-garden-version': '9.0.0-next.5',
|
|
602
598
|
'data-garden-header': 'true'
|
|
603
599
|
}).withConfig({
|
|
604
600
|
displayName: "StyledSubNavItemHeader",
|
|
@@ -645,7 +641,7 @@ StyledSubNavItemIcon.defaultProps = {
|
|
|
645
641
|
};
|
|
646
642
|
const StyledSubNavItemIconWrapper = styled.div.attrs({
|
|
647
643
|
'data-garden-id': COMPONENT_ID$9,
|
|
648
|
-
'data-garden-version': '9.0.0-next.
|
|
644
|
+
'data-garden-version': '9.0.0-next.5'
|
|
649
645
|
}).withConfig({
|
|
650
646
|
displayName: "StyledSubNavItemIcon__StyledSubNavItemIconWrapper",
|
|
651
647
|
componentId: "sc-1d02hho-1"
|
|
@@ -658,7 +654,7 @@ const PANEL_COMPONENT_ID = 'chrome.collapsible_sub_nav_item_panel';
|
|
|
658
654
|
const hiddenStyling = css(["visibility:hidden;max-height:0 !important;overflow:hidden;"]);
|
|
659
655
|
const StyledSubNavPanel = styled.div.attrs({
|
|
660
656
|
'data-garden-id': PANEL_COMPONENT_ID,
|
|
661
|
-
'data-garden-version': '9.0.0-next.
|
|
657
|
+
'data-garden-version': '9.0.0-next.5'
|
|
662
658
|
}).withConfig({
|
|
663
659
|
displayName: "StyledSubNavPanel",
|
|
664
660
|
componentId: "sc-1jv3rpv-0"
|
|
@@ -674,7 +670,7 @@ const borderStyle = _ref => {
|
|
|
674
670
|
placement,
|
|
675
671
|
isOpen
|
|
676
672
|
} = _ref;
|
|
677
|
-
const borderColor = isOpen ?
|
|
673
|
+
const borderColor = isOpen ? getColorV8('neutralHue', 300, theme) : 'transparent';
|
|
678
674
|
const borderSides = ['-left', '-right'];
|
|
679
675
|
let borderSide = '';
|
|
680
676
|
if (theme.rtl) {
|
|
@@ -689,7 +685,7 @@ const borderStyle = _ref => {
|
|
|
689
685
|
};
|
|
690
686
|
const StyledSheet = styled.aside.attrs({
|
|
691
687
|
'data-garden-id': COMPONENT_ID$8,
|
|
692
|
-
'data-garden-version': '9.0.0-next.
|
|
688
|
+
'data-garden-version': '9.0.0-next.5'
|
|
693
689
|
}).withConfig({
|
|
694
690
|
displayName: "StyledSheet",
|
|
695
691
|
componentId: "sc-dx8ijk-0"
|
|
@@ -701,7 +697,7 @@ StyledSheet.defaultProps = {
|
|
|
701
697
|
const COMPONENT_ID$7 = 'chrome.sheet_wrapper';
|
|
702
698
|
const StyledSheetWrapper = styled.div.attrs({
|
|
703
699
|
'data-garden-id': COMPONENT_ID$7,
|
|
704
|
-
'data-garden-version': '9.0.0-next.
|
|
700
|
+
'data-garden-version': '9.0.0-next.5'
|
|
705
701
|
}).withConfig({
|
|
706
702
|
displayName: "StyledSheetWrapper",
|
|
707
703
|
componentId: "sc-f6x9zb-0"
|
|
@@ -728,7 +724,7 @@ StyledSheetWrapper.defaultProps = {
|
|
|
728
724
|
const COMPONENT_ID$6 = 'chrome.sheet_title';
|
|
729
725
|
const StyledSheetTitle = styled.div.attrs({
|
|
730
726
|
'data-garden-id': COMPONENT_ID$6,
|
|
731
|
-
'data-garden-version': '9.0.0-next.
|
|
727
|
+
'data-garden-version': '9.0.0-next.5'
|
|
732
728
|
}).withConfig({
|
|
733
729
|
displayName: "StyledSheetTitle",
|
|
734
730
|
componentId: "sc-1gogk75-0"
|
|
@@ -740,11 +736,11 @@ StyledSheetTitle.defaultProps = {
|
|
|
740
736
|
const COMPONENT_ID$5 = 'chrome.sheet_description';
|
|
741
737
|
const StyledSheetDescription = styled.div.attrs({
|
|
742
738
|
'data-garden-id': COMPONENT_ID$5,
|
|
743
|
-
'data-garden-version': '9.0.0-next.
|
|
739
|
+
'data-garden-version': '9.0.0-next.5'
|
|
744
740
|
}).withConfig({
|
|
745
741
|
displayName: "StyledSheetDescription",
|
|
746
742
|
componentId: "sc-1puglb6-0"
|
|
747
|
-
})(["line-height:", ";color:", ";", ";"], props => getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.md), props =>
|
|
743
|
+
})(["line-height:", ";color:", ";", ";"], props => getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.md), props => getColorV8('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
748
744
|
StyledSheetDescription.defaultProps = {
|
|
749
745
|
theme: DEFAULT_THEME
|
|
750
746
|
};
|
|
@@ -752,7 +748,7 @@ StyledSheetDescription.defaultProps = {
|
|
|
752
748
|
const COMPONENT_ID$4 = 'chrome.sheet_body';
|
|
753
749
|
const StyledSheetBody = styled.div.attrs({
|
|
754
750
|
'data-garden-id': COMPONENT_ID$4,
|
|
755
|
-
'data-garden-version': '9.0.0-next.
|
|
751
|
+
'data-garden-version': '9.0.0-next.5'
|
|
756
752
|
}).withConfig({
|
|
757
753
|
displayName: "StyledSheetBody",
|
|
758
754
|
componentId: "sc-bt4eoj-0"
|
|
@@ -770,13 +766,13 @@ const BASE_MULTIPLIERS = {
|
|
|
770
766
|
const colorStyles = props => {
|
|
771
767
|
const backgroundColor = 'primaryHue';
|
|
772
768
|
const foregroundColor = 'neutralHue';
|
|
773
|
-
return css(["background-color:transparent;color:", ";&:hover{background-color:", ";color:", ";}", " &:active{transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;background-color:", ";color:", ";}"],
|
|
769
|
+
return css(["background-color:transparent;color:", ";&:hover{background-color:", ";color:", ";}", " &:active{transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;background-color:", ";color:", ";}"], getColorV8(foregroundColor, 600, props.theme), getColorV8(backgroundColor, 600, props.theme, 0.08), getColorV8(foregroundColor, 700, props.theme), focusStyles({
|
|
774
770
|
theme: props.theme
|
|
775
|
-
}),
|
|
771
|
+
}), getColorV8(backgroundColor, 600, props.theme, 0.2), getColorV8(foregroundColor, 800, props.theme));
|
|
776
772
|
};
|
|
777
773
|
const StyledSheetClose = styled.button.attrs({
|
|
778
774
|
'data-garden-id': COMPONENT_ID$3,
|
|
779
|
-
'data-garden-version': '9.0.0-next.
|
|
775
|
+
'data-garden-version': '9.0.0-next.5'
|
|
780
776
|
}).withConfig({
|
|
781
777
|
displayName: "StyledSheetClose",
|
|
782
778
|
componentId: "sc-1ab02oq-0"
|
|
@@ -788,11 +784,11 @@ StyledSheetClose.defaultProps = {
|
|
|
788
784
|
const COMPONENT_ID$2 = 'chrome.sheet_footer';
|
|
789
785
|
const StyledSheetFooter = styled.footer.attrs({
|
|
790
786
|
'data-garden-id': COMPONENT_ID$2,
|
|
791
|
-
'data-garden-version': '9.0.0-next.
|
|
787
|
+
'data-garden-version': '9.0.0-next.5'
|
|
792
788
|
}).withConfig({
|
|
793
789
|
displayName: "StyledSheetFooter",
|
|
794
790
|
componentId: "sc-2cktos-0"
|
|
795
|
-
})(["display:flex;flex-flow:row wrap;align-items:center;justify-content:", ";border-top:", ";padding:", "px;", ";"], props => props.isCompact ? 'center' : 'flex-end', props => `${props.theme.borders.sm} ${
|
|
791
|
+
})(["display:flex;flex-flow:row wrap;align-items:center;justify-content:", ";border-top:", ";padding:", "px;", ";"], props => props.isCompact ? 'center' : 'flex-end', props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 300, props.theme)}}`, props => props.theme.space.base * (props.isCompact ? 2.5 : 5), props => retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
796
792
|
StyledSheetFooter.defaultProps = {
|
|
797
793
|
theme: DEFAULT_THEME
|
|
798
794
|
};
|
|
@@ -800,7 +796,7 @@ StyledSheetFooter.defaultProps = {
|
|
|
800
796
|
const COMPONENT_ID$1 = 'chrome.sheet_footer_item';
|
|
801
797
|
const StyledSheetFooterItem = styled.div.attrs({
|
|
802
798
|
'data-garden-id': COMPONENT_ID$1,
|
|
803
|
-
'data-garden-version': '9.0.0-next.
|
|
799
|
+
'data-garden-version': '9.0.0-next.5'
|
|
804
800
|
}).withConfig({
|
|
805
801
|
displayName: "StyledSheetFooterItem",
|
|
806
802
|
componentId: "sc-r9ixh-0"
|
|
@@ -812,142 +808,15 @@ StyledSheetFooterItem.defaultProps = {
|
|
|
812
808
|
const COMPONENT_ID = 'chrome.sheet_header';
|
|
813
809
|
const StyledSheetHeader = styled.header.attrs({
|
|
814
810
|
'data-garden-id': COMPONENT_ID,
|
|
815
|
-
'data-garden-version': '9.0.0-next.
|
|
811
|
+
'data-garden-version': '9.0.0-next.5'
|
|
816
812
|
}).withConfig({
|
|
817
813
|
displayName: "StyledSheetHeader",
|
|
818
814
|
componentId: "sc-o2ry8i-0"
|
|
819
|
-
})(["border-bottom:", ";padding:", "px;", " ", ";"], props => `${props.theme.borders.sm} ${
|
|
815
|
+
})(["border-bottom:", ";padding:", "px;", " ", ";"], props => `${props.theme.borders.sm} ${getColorV8('neutralHue', 300, props.theme)}}`, props => props.theme.space.base * 5, props => props.isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS.size + BASE_MULTIPLIERS.side + 2)}px;`, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
820
816
|
StyledSheetHeader.defaultProps = {
|
|
821
817
|
theme: DEFAULT_THEME
|
|
822
818
|
};
|
|
823
819
|
|
|
824
|
-
const Chrome = React__default.forwardRef((_ref, ref) => {
|
|
825
|
-
let {
|
|
826
|
-
hue,
|
|
827
|
-
isFluid,
|
|
828
|
-
...props
|
|
829
|
-
} = _ref;
|
|
830
|
-
const theme = useContext(ThemeContext);
|
|
831
|
-
const isLightMemoized = useMemo(() => {
|
|
832
|
-
if (hue) {
|
|
833
|
-
const backgroundColor = getColor(hue, 600, theme);
|
|
834
|
-
const LIGHT_COLOR = 'white';
|
|
835
|
-
return readableColor(backgroundColor, LIGHT_COLOR, undefined, false ) === LIGHT_COLOR;
|
|
836
|
-
}
|
|
837
|
-
return false;
|
|
838
|
-
}, [hue, theme]);
|
|
839
|
-
const isLight = hue ? isLightMemoized : false;
|
|
840
|
-
const isDark = hue ? !isLightMemoized : false;
|
|
841
|
-
const chromeContextValue = useMemo(() => ({
|
|
842
|
-
hue: hue || 'chromeHue',
|
|
843
|
-
isLight,
|
|
844
|
-
isDark
|
|
845
|
-
}), [hue, isLight, isDark]);
|
|
846
|
-
const environment = useDocument(theme);
|
|
847
|
-
useEffect(() => {
|
|
848
|
-
if (environment && !isFluid) {
|
|
849
|
-
const htmlElement = environment.querySelector('html');
|
|
850
|
-
if (htmlElement) {
|
|
851
|
-
const defaultHtmlPosition = htmlElement.style.position;
|
|
852
|
-
htmlElement.style.position = 'fixed';
|
|
853
|
-
return () => {
|
|
854
|
-
htmlElement.style.position = defaultHtmlPosition;
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
return undefined;
|
|
859
|
-
}, [environment, isFluid]);
|
|
860
|
-
return React__default.createElement(ChromeContext.Provider, {
|
|
861
|
-
value: chromeContextValue
|
|
862
|
-
}, React__default.createElement(StyledChrome, _extends$3({
|
|
863
|
-
ref: ref
|
|
864
|
-
}, props)));
|
|
865
|
-
});
|
|
866
|
-
Chrome.displayName = 'Chrome';
|
|
867
|
-
Chrome.propTypes = {
|
|
868
|
-
hue: PropTypes.string
|
|
869
|
-
};
|
|
870
|
-
|
|
871
|
-
const SkipNav = React__default.forwardRef((_ref, ref) => {
|
|
872
|
-
let {
|
|
873
|
-
targetId,
|
|
874
|
-
zIndex,
|
|
875
|
-
children,
|
|
876
|
-
...props
|
|
877
|
-
} = _ref;
|
|
878
|
-
return React__default.createElement(StyledSkipNav, _extends$3({
|
|
879
|
-
href: `#${targetId}`,
|
|
880
|
-
zIndex: zIndex,
|
|
881
|
-
ref: ref
|
|
882
|
-
}, props), React__default.createElement(StyledSkipNavIcon, null), children);
|
|
883
|
-
});
|
|
884
|
-
SkipNav.displayName = 'SkipNav';
|
|
885
|
-
SkipNav.propTypes = {
|
|
886
|
-
targetId: PropTypes.string.isRequired,
|
|
887
|
-
zIndex: PropTypes.number
|
|
888
|
-
};
|
|
889
|
-
SkipNav.defaultProps = {
|
|
890
|
-
zIndex: 1
|
|
891
|
-
};
|
|
892
|
-
|
|
893
|
-
const BodyContext = React__default.createContext({
|
|
894
|
-
hasFooter: true
|
|
895
|
-
});
|
|
896
|
-
const useBodyContext = () => {
|
|
897
|
-
return useContext(BodyContext);
|
|
898
|
-
};
|
|
899
|
-
|
|
900
|
-
const Body$1 = React__default.forwardRef((_ref, ref) => {
|
|
901
|
-
let {
|
|
902
|
-
hasFooter,
|
|
903
|
-
...props
|
|
904
|
-
} = _ref;
|
|
905
|
-
const bodyContextValue = useMemo(() => ({
|
|
906
|
-
hasFooter: !!hasFooter
|
|
907
|
-
}), [hasFooter]);
|
|
908
|
-
return React__default.createElement(BodyContext.Provider, {
|
|
909
|
-
value: bodyContextValue
|
|
910
|
-
}, React__default.createElement(StyledBody, _extends$3({
|
|
911
|
-
ref: ref
|
|
912
|
-
}, props)));
|
|
913
|
-
});
|
|
914
|
-
Body$1.displayName = 'Body';
|
|
915
|
-
Body$1.propTypes = {
|
|
916
|
-
hasFooter: PropTypes.bool
|
|
917
|
-
};
|
|
918
|
-
|
|
919
|
-
const Content = React__default.forwardRef((props, ref) => {
|
|
920
|
-
const {
|
|
921
|
-
hasFooter
|
|
922
|
-
} = useBodyContext();
|
|
923
|
-
return React__default.createElement(StyledContent, _extends$3({
|
|
924
|
-
ref: ref,
|
|
925
|
-
hasFooter: hasFooter
|
|
926
|
-
}, props));
|
|
927
|
-
});
|
|
928
|
-
Content.displayName = 'Content';
|
|
929
|
-
|
|
930
|
-
const Main = React__default.forwardRef((props, ref) => React__default.createElement(StyledMain, _extends$3({
|
|
931
|
-
ref: ref
|
|
932
|
-
}, props)));
|
|
933
|
-
Main.displayName = 'Main';
|
|
934
|
-
|
|
935
|
-
const Sidebar = React__default.forwardRef((props, ref) => React__default.createElement(StyledSidebar, _extends$3({
|
|
936
|
-
ref: ref
|
|
937
|
-
}, props)));
|
|
938
|
-
Sidebar.displayName = 'Sidebar';
|
|
939
|
-
|
|
940
|
-
const Header$1 = React__default.forwardRef((props, ref) => React__default.createElement(StyledHeader, _extends$3({
|
|
941
|
-
ref: ref
|
|
942
|
-
}, props)));
|
|
943
|
-
Header$1.displayName = 'Header';
|
|
944
|
-
Header$1.propTypes = {
|
|
945
|
-
isStandalone: PropTypes.bool
|
|
946
|
-
};
|
|
947
|
-
|
|
948
|
-
const PLACEMENT = ['end', 'start'];
|
|
949
|
-
const PRODUCTS = ['chat', 'connect', 'explore', 'guide', 'message', 'support', 'talk'];
|
|
950
|
-
|
|
951
820
|
const HeaderItem = React__default.forwardRef((_ref, ref) => {
|
|
952
821
|
let {
|
|
953
822
|
hasLogo,
|
|
@@ -1010,11 +879,6 @@ const HeaderItemWrapper = React__default.forwardRef((props, ref) => React__defau
|
|
|
1010
879
|
}, props)));
|
|
1011
880
|
HeaderItemWrapper.displayName = 'HeaderItemWrapper';
|
|
1012
881
|
|
|
1013
|
-
const Footer$1 = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooter, _extends$3({
|
|
1014
|
-
ref: ref
|
|
1015
|
-
}, props)));
|
|
1016
|
-
Footer$1.displayName = 'Footer';
|
|
1017
|
-
|
|
1018
882
|
const FooterItem$1 = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooterItem, _extends$3({
|
|
1019
883
|
ref: ref
|
|
1020
884
|
}, props)));
|
|
@@ -1027,28 +891,11 @@ const useNavContext = () => {
|
|
|
1027
891
|
return useContext(NavContext);
|
|
1028
892
|
};
|
|
1029
893
|
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
hue,
|
|
1033
|
-
isLight,
|
|
1034
|
-
isDark
|
|
1035
|
-
} = useChromeContext();
|
|
1036
|
-
const navContextValue = useMemo(() => ({
|
|
1037
|
-
isExpanded: !!props.isExpanded
|
|
1038
|
-
}), [props.isExpanded]);
|
|
1039
|
-
return React__default.createElement(NavContext.Provider, {
|
|
1040
|
-
value: navContextValue
|
|
1041
|
-
}, React__default.createElement(StyledNav, _extends$3({
|
|
1042
|
-
ref: ref
|
|
1043
|
-
}, props, {
|
|
1044
|
-
hue: hue,
|
|
1045
|
-
isLight: isLight,
|
|
1046
|
-
isDark: isDark
|
|
1047
|
-
})));
|
|
894
|
+
const ChromeContext = React__default.createContext({
|
|
895
|
+
hue: 'chromeHue'
|
|
1048
896
|
});
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
isExpanded: PropTypes.bool
|
|
897
|
+
const useChromeContext = () => {
|
|
898
|
+
return useContext(ChromeContext);
|
|
1052
899
|
};
|
|
1053
900
|
|
|
1054
901
|
const NavItem = React__default.forwardRef((_ref, ref) => {
|
|
@@ -1136,21 +983,6 @@ NavItemText.propTypes = {
|
|
|
1136
983
|
isWrapped: PropTypes.bool
|
|
1137
984
|
};
|
|
1138
985
|
|
|
1139
|
-
const SubNav = React__default.forwardRef((props, ref) => {
|
|
1140
|
-
const {
|
|
1141
|
-
hue,
|
|
1142
|
-
isLight,
|
|
1143
|
-
isDark
|
|
1144
|
-
} = useChromeContext();
|
|
1145
|
-
return React__default.createElement(StyledSubNav, _extends$3({
|
|
1146
|
-
ref: ref,
|
|
1147
|
-
hue: hue,
|
|
1148
|
-
isLight: isLight,
|
|
1149
|
-
isDark: isDark
|
|
1150
|
-
}, props));
|
|
1151
|
-
});
|
|
1152
|
-
SubNav.displayName = 'SubNav';
|
|
1153
|
-
|
|
1154
986
|
const SubNavItem = React__default.forwardRef((props, ref) => {
|
|
1155
987
|
const {
|
|
1156
988
|
isDark,
|
|
@@ -1244,6 +1076,189 @@ CollapsibleSubNavItem.propTypes = {
|
|
|
1244
1076
|
};
|
|
1245
1077
|
CollapsibleSubNavItem.displayName = 'CollapsibleSubNavItem';
|
|
1246
1078
|
|
|
1079
|
+
const Chrome = React__default.forwardRef((_ref, ref) => {
|
|
1080
|
+
let {
|
|
1081
|
+
hue,
|
|
1082
|
+
isFluid,
|
|
1083
|
+
...props
|
|
1084
|
+
} = _ref;
|
|
1085
|
+
const theme = useContext(ThemeContext);
|
|
1086
|
+
const isLightMemoized = useMemo(() => {
|
|
1087
|
+
if (hue) {
|
|
1088
|
+
const backgroundColor = getColorV8(hue, 600, theme);
|
|
1089
|
+
const LIGHT_COLOR = 'white';
|
|
1090
|
+
return readableColor(backgroundColor, LIGHT_COLOR, undefined, false ) === LIGHT_COLOR;
|
|
1091
|
+
}
|
|
1092
|
+
return false;
|
|
1093
|
+
}, [hue, theme]);
|
|
1094
|
+
const isLight = hue ? isLightMemoized : false;
|
|
1095
|
+
const isDark = hue ? !isLightMemoized : false;
|
|
1096
|
+
const chromeContextValue = useMemo(() => ({
|
|
1097
|
+
hue: hue || 'chromeHue',
|
|
1098
|
+
isLight,
|
|
1099
|
+
isDark
|
|
1100
|
+
}), [hue, isLight, isDark]);
|
|
1101
|
+
const environment = useDocument(theme);
|
|
1102
|
+
useEffect(() => {
|
|
1103
|
+
if (environment && !isFluid) {
|
|
1104
|
+
const htmlElement = environment.querySelector('html');
|
|
1105
|
+
if (htmlElement) {
|
|
1106
|
+
const defaultHtmlPosition = htmlElement.style.position;
|
|
1107
|
+
htmlElement.style.position = 'fixed';
|
|
1108
|
+
return () => {
|
|
1109
|
+
htmlElement.style.position = defaultHtmlPosition;
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
return undefined;
|
|
1114
|
+
}, [environment, isFluid]);
|
|
1115
|
+
return React__default.createElement(ChromeContext.Provider, {
|
|
1116
|
+
value: chromeContextValue
|
|
1117
|
+
}, React__default.createElement(StyledChrome, _extends$3({
|
|
1118
|
+
ref: ref
|
|
1119
|
+
}, props)));
|
|
1120
|
+
});
|
|
1121
|
+
Chrome.displayName = 'Chrome';
|
|
1122
|
+
Chrome.propTypes = {
|
|
1123
|
+
hue: PropTypes.string
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
const SkipNav = React__default.forwardRef((_ref, ref) => {
|
|
1127
|
+
let {
|
|
1128
|
+
targetId,
|
|
1129
|
+
zIndex,
|
|
1130
|
+
children,
|
|
1131
|
+
...props
|
|
1132
|
+
} = _ref;
|
|
1133
|
+
return React__default.createElement(StyledSkipNav, _extends$3({
|
|
1134
|
+
href: `#${targetId}`,
|
|
1135
|
+
zIndex: zIndex,
|
|
1136
|
+
ref: ref
|
|
1137
|
+
}, props), React__default.createElement(StyledSkipNavIcon, null), children);
|
|
1138
|
+
});
|
|
1139
|
+
SkipNav.displayName = 'SkipNav';
|
|
1140
|
+
SkipNav.propTypes = {
|
|
1141
|
+
targetId: PropTypes.string.isRequired,
|
|
1142
|
+
zIndex: PropTypes.number
|
|
1143
|
+
};
|
|
1144
|
+
SkipNav.defaultProps = {
|
|
1145
|
+
zIndex: 1
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1148
|
+
const BodyContext = React__default.createContext({
|
|
1149
|
+
hasFooter: true
|
|
1150
|
+
});
|
|
1151
|
+
const useBodyContext = () => {
|
|
1152
|
+
return useContext(BodyContext);
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
const Body$1 = React__default.forwardRef((_ref, ref) => {
|
|
1156
|
+
let {
|
|
1157
|
+
hasFooter,
|
|
1158
|
+
...props
|
|
1159
|
+
} = _ref;
|
|
1160
|
+
const bodyContextValue = useMemo(() => ({
|
|
1161
|
+
hasFooter: !!hasFooter
|
|
1162
|
+
}), [hasFooter]);
|
|
1163
|
+
return React__default.createElement(BodyContext.Provider, {
|
|
1164
|
+
value: bodyContextValue
|
|
1165
|
+
}, React__default.createElement(StyledBody, _extends$3({
|
|
1166
|
+
ref: ref
|
|
1167
|
+
}, props)));
|
|
1168
|
+
});
|
|
1169
|
+
Body$1.displayName = 'Body';
|
|
1170
|
+
Body$1.propTypes = {
|
|
1171
|
+
hasFooter: PropTypes.bool
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
const Content = React__default.forwardRef((props, ref) => {
|
|
1175
|
+
const {
|
|
1176
|
+
hasFooter
|
|
1177
|
+
} = useBodyContext();
|
|
1178
|
+
return React__default.createElement(StyledContent, _extends$3({
|
|
1179
|
+
ref: ref,
|
|
1180
|
+
hasFooter: hasFooter
|
|
1181
|
+
}, props));
|
|
1182
|
+
});
|
|
1183
|
+
Content.displayName = 'Content';
|
|
1184
|
+
|
|
1185
|
+
const Main = React__default.forwardRef((props, ref) => React__default.createElement(StyledMain, _extends$3({
|
|
1186
|
+
ref: ref
|
|
1187
|
+
}, props)));
|
|
1188
|
+
Main.displayName = 'Main';
|
|
1189
|
+
|
|
1190
|
+
const Sidebar = React__default.forwardRef((props, ref) => React__default.createElement(StyledSidebar, _extends$3({
|
|
1191
|
+
ref: ref
|
|
1192
|
+
}, props)));
|
|
1193
|
+
Sidebar.displayName = 'Sidebar';
|
|
1194
|
+
|
|
1195
|
+
const HeaderComponent = React__default.forwardRef((props, ref) => React__default.createElement(StyledHeader, _extends$3({
|
|
1196
|
+
ref: ref
|
|
1197
|
+
}, props)));
|
|
1198
|
+
HeaderComponent.displayName = 'Header';
|
|
1199
|
+
HeaderComponent.propTypes = {
|
|
1200
|
+
isStandalone: PropTypes.bool
|
|
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;
|
|
1207
|
+
|
|
1208
|
+
const FooterComponent = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooter, _extends$3({
|
|
1209
|
+
ref: ref
|
|
1210
|
+
}, props)));
|
|
1211
|
+
FooterComponent.displayName = 'Footer';
|
|
1212
|
+
const Footer$1 = FooterComponent;
|
|
1213
|
+
Footer$1.Item = FooterItem$1;
|
|
1214
|
+
|
|
1215
|
+
const NavComponent = React__default.forwardRef((props, ref) => {
|
|
1216
|
+
const {
|
|
1217
|
+
hue,
|
|
1218
|
+
isLight,
|
|
1219
|
+
isDark
|
|
1220
|
+
} = useChromeContext();
|
|
1221
|
+
const navContextValue = useMemo(() => ({
|
|
1222
|
+
isExpanded: !!props.isExpanded
|
|
1223
|
+
}), [props.isExpanded]);
|
|
1224
|
+
return React__default.createElement(NavContext.Provider, {
|
|
1225
|
+
value: navContextValue
|
|
1226
|
+
}, React__default.createElement(StyledNav, _extends$3({
|
|
1227
|
+
ref: ref
|
|
1228
|
+
}, props, {
|
|
1229
|
+
hue: hue,
|
|
1230
|
+
isLight: isLight,
|
|
1231
|
+
isDark: isDark
|
|
1232
|
+
})));
|
|
1233
|
+
});
|
|
1234
|
+
NavComponent.displayName = 'Nav';
|
|
1235
|
+
NavComponent.propTypes = {
|
|
1236
|
+
isExpanded: PropTypes.bool
|
|
1237
|
+
};
|
|
1238
|
+
const Nav = NavComponent;
|
|
1239
|
+
Nav.Item = NavItem;
|
|
1240
|
+
Nav.ItemIcon = NavItemIcon;
|
|
1241
|
+
Nav.ItemText = NavItemText;
|
|
1242
|
+
|
|
1243
|
+
const SubNavComponent = React__default.forwardRef((props, ref) => {
|
|
1244
|
+
const {
|
|
1245
|
+
hue,
|
|
1246
|
+
isLight,
|
|
1247
|
+
isDark
|
|
1248
|
+
} = useChromeContext();
|
|
1249
|
+
return React__default.createElement(StyledSubNav, _extends$3({
|
|
1250
|
+
ref: ref,
|
|
1251
|
+
hue: hue,
|
|
1252
|
+
isLight: isLight,
|
|
1253
|
+
isDark: isDark
|
|
1254
|
+
}, props));
|
|
1255
|
+
});
|
|
1256
|
+
SubNavComponent.displayName = 'SubNav';
|
|
1257
|
+
const SubNav = SubNavComponent;
|
|
1258
|
+
SubNav.Item = SubNavItem;
|
|
1259
|
+
SubNav.ItemText = SubNavItemText;
|
|
1260
|
+
SubNav.CollapsibleItem = CollapsibleSubNavItem;
|
|
1261
|
+
|
|
1247
1262
|
const SheetContext = createContext({
|
|
1248
1263
|
setIsCloseButtonPresent() {}
|
|
1249
1264
|
});
|
|
@@ -1388,7 +1403,7 @@ const SheetComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
1388
1403
|
const sheetRef = useRef(null);
|
|
1389
1404
|
const seed = useUIDSeed();
|
|
1390
1405
|
const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
|
|
1391
|
-
const idPrefix = useMemo(() => id || seed(`sheet_${'9.0.0-next.
|
|
1406
|
+
const idPrefix = useMemo(() => id || seed(`sheet_${'9.0.0-next.5'}`), [id, seed]);
|
|
1392
1407
|
const titleId = `${idPrefix}--title`;
|
|
1393
1408
|
const descriptionId = `${idPrefix}--description`;
|
|
1394
1409
|
const sheetContext = useMemo(() => ({
|