@zendeskgarden/react-chrome 9.0.0-next.0 → 9.0.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +26 -27
  2. package/dist/esm/elements/Chrome.js +94 -0
  3. package/dist/esm/elements/SkipNav.js +65 -0
  4. package/dist/esm/elements/body/Body.js +57 -0
  5. package/dist/esm/elements/body/Content.js +54 -0
  6. package/dist/esm/elements/body/Main.js +47 -0
  7. package/dist/esm/elements/footer/Footer.js +67 -0
  8. package/dist/esm/elements/footer/FooterItem.js +47 -0
  9. package/dist/esm/elements/header/Header.js +60 -0
  10. package/dist/esm/elements/header/HeaderItem.js +69 -0
  11. package/dist/esm/elements/header/HeaderItemIcon.js +66 -0
  12. package/dist/esm/elements/header/HeaderItemText.js +51 -0
  13. package/dist/esm/elements/header/HeaderItemWrapper.js +47 -0
  14. package/dist/esm/elements/nav/Nav.js +78 -0
  15. package/dist/esm/elements/nav/NavItem.js +101 -0
  16. package/dist/esm/elements/nav/NavItemIcon.js +66 -0
  17. package/dist/esm/elements/nav/NavItemText.js +58 -0
  18. package/dist/esm/elements/nav/NavList.js +55 -0
  19. package/dist/esm/elements/sheet/Sheet.js +128 -0
  20. package/dist/esm/elements/sheet/components/Body.js +50 -0
  21. package/dist/esm/elements/sheet/components/Close.js +60 -0
  22. package/dist/esm/elements/sheet/components/Description.js +59 -0
  23. package/dist/esm/elements/sheet/components/Footer.js +50 -0
  24. package/dist/esm/elements/sheet/components/FooterItem.js +50 -0
  25. package/dist/esm/elements/sheet/components/Header.js +55 -0
  26. package/dist/esm/elements/sheet/components/Title.js +59 -0
  27. package/dist/esm/index.js +24 -0
  28. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/link-stroke.svg.js +25 -0
  29. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
  30. package/dist/esm/styled/StyledChrome.js +22 -0
  31. package/dist/esm/styled/StyledSkipNav.js +46 -0
  32. package/dist/esm/styled/StyledSkipNavIcon.js +28 -0
  33. package/dist/esm/styled/body/StyledBody.js +22 -0
  34. package/dist/esm/styled/body/StyledContent.js +25 -0
  35. package/dist/esm/styled/body/StyledMain.js +22 -0
  36. package/dist/esm/styled/footer/StyledFooter.js +25 -0
  37. package/dist/esm/styled/footer/StyledFooterItem.js +22 -0
  38. package/dist/esm/styled/header/StyledBaseHeaderItem.js +35 -0
  39. package/dist/esm/styled/header/StyledHeader.js +31 -0
  40. package/dist/esm/styled/header/StyledHeaderItem.js +37 -0
  41. package/dist/esm/styled/header/StyledHeaderItemIcon.js +22 -0
  42. package/dist/esm/styled/header/StyledHeaderItemText.js +23 -0
  43. package/dist/esm/styled/header/StyledHeaderItemWrapper.js +24 -0
  44. package/dist/esm/styled/header/StyledLogoHeaderItem.js +43 -0
  45. package/dist/esm/styled/nav/StyledBaseNavItem.js +32 -0
  46. package/dist/esm/styled/nav/StyledBrandmarkNavItem.js +23 -0
  47. package/dist/esm/styled/nav/StyledLogoNavItem.js +44 -0
  48. package/dist/esm/styled/nav/StyledNav.js +34 -0
  49. package/dist/esm/styled/nav/StyledNavButton.js +65 -0
  50. package/dist/esm/styled/nav/StyledNavItemIcon.js +22 -0
  51. package/dist/esm/styled/nav/StyledNavItemText.js +34 -0
  52. package/dist/esm/styled/nav/StyledNavList.js +22 -0
  53. package/dist/esm/styled/nav/StyledNavListItem.js +22 -0
  54. package/dist/esm/styled/sheet/StyledSheet.js +41 -0
  55. package/dist/esm/styled/sheet/StyledSheetBody.js +22 -0
  56. package/dist/esm/styled/sheet/StyledSheetClose.js +34 -0
  57. package/dist/esm/styled/sheet/StyledSheetDescription.js +22 -0
  58. package/dist/esm/styled/sheet/StyledSheetFooter.js +22 -0
  59. package/dist/esm/styled/sheet/StyledSheetFooterItem.js +22 -0
  60. package/dist/esm/styled/sheet/StyledSheetHeader.js +23 -0
  61. package/dist/esm/styled/sheet/StyledSheetTitle.js +22 -0
  62. package/dist/esm/styled/sheet/StyledSheetWrapper.js +37 -0
  63. package/dist/esm/types/index.js +10 -0
  64. package/dist/esm/utils/useBodyContext.js +14 -0
  65. package/dist/esm/utils/useChromeContext.js +16 -0
  66. package/dist/esm/utils/useFocusableMount.js +31 -0
  67. package/dist/esm/utils/useNavContext.js +16 -0
  68. package/dist/esm/utils/useNavListContext.js +14 -0
  69. package/dist/esm/utils/useSheetContext.js +16 -0
  70. package/dist/index.cjs.js +373 -619
  71. package/dist/typings/elements/body/Body.d.ts +1 -2
  72. package/dist/typings/elements/footer/Footer.d.ts +8 -1
  73. package/dist/typings/elements/footer/FooterItem.d.ts +2 -0
  74. package/dist/typings/elements/header/Header.d.ts +11 -1
  75. package/dist/typings/elements/header/HeaderItem.d.ts +2 -0
  76. package/dist/typings/elements/header/HeaderItemIcon.d.ts +5 -3
  77. package/dist/typings/elements/header/HeaderItemText.d.ts +2 -0
  78. package/dist/typings/elements/header/HeaderItemWrapper.d.ts +2 -0
  79. package/dist/typings/elements/nav/Nav.d.ts +11 -1
  80. package/dist/typings/elements/nav/NavItem.d.ts +2 -0
  81. package/dist/typings/elements/nav/NavItemIcon.d.ts +5 -3
  82. package/dist/typings/elements/nav/NavItemText.d.ts +2 -0
  83. package/dist/typings/elements/{body/Sidebar.d.ts → nav/NavList.d.ts} +2 -2
  84. package/dist/typings/index.d.ts +9 -16
  85. package/dist/typings/styled/index.d.ts +3 -8
  86. package/dist/typings/styled/nav/StyledBaseNavItem.d.ts +1 -5
  87. package/dist/typings/styled/nav/StyledBrandmarkNavItem.d.ts +4 -5
  88. package/dist/typings/styled/nav/StyledLogoNavItem.d.ts +4 -5
  89. package/dist/typings/styled/nav/{StyledNavItem.d.ts → StyledNavButton.d.ts} +3 -1
  90. package/dist/typings/styled/{body/StyledSidebar.d.ts → nav/StyledNavList.d.ts} +1 -1
  91. package/dist/typings/styled/nav/StyledNavListItem.d.ts +10 -0
  92. package/dist/typings/types/index.d.ts +3 -30
  93. package/dist/typings/utils/useBodyContext.d.ts +3 -2
  94. package/dist/typings/utils/useNavListContext.d.ts +13 -0
  95. package/package.json +6 -8
  96. package/dist/index.esm.js +0 -1449
  97. package/dist/typings/elements/subnav/CollapsibleSubNavItem.d.ts +0 -12
  98. package/dist/typings/elements/subnav/SubNav.d.ts +0 -11
  99. package/dist/typings/elements/subnav/SubNavItem.d.ts +0 -12
  100. package/dist/typings/elements/subnav/SubNavItemText.d.ts +0 -12
  101. package/dist/typings/styled/subnav/StyledSubNav.d.ts +0 -17
  102. package/dist/typings/styled/subnav/StyledSubNavItem.d.ts +0 -21
  103. package/dist/typings/styled/subnav/StyledSubNavItemHeader.d.ts +0 -14
  104. package/dist/typings/styled/subnav/StyledSubNavItemIcon.d.ts +0 -14
  105. package/dist/typings/styled/subnav/StyledSubNavItemText.d.ts +0 -11
  106. package/dist/typings/styled/subnav/StyledSubNavPanel.d.ts +0 -12
package/dist/index.esm.js DELETED
@@ -1,1449 +0,0 @@
1
- /**
2
- * Copyright Zendesk, Inc.
3
- *
4
- * Use of this source code is governed under the Apache License, Version 2.0
5
- * found at http://www.apache.org/licenses/LICENSE-2.0.
6
- */
7
-
8
- import * as React from 'react';
9
- import React__default, { useContext, useMemo, useEffect, Children, isValidElement, cloneElement, createRef, useState, createContext, useRef, forwardRef } from 'react';
10
- import PropTypes from 'prop-types';
11
- import styled, { css, keyframes, ThemeContext } from 'styled-components';
12
- import { math, rgba, readableColor } from 'polished';
13
- import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor, PALETTE, SELECTOR_FOCUS_VISIBLE, focusStyles, useDocument } from '@zendeskgarden/react-theming';
14
- import { useAccordion } from '@zendeskgarden/container-accordion';
15
- import { getControlledValue } from '@zendeskgarden/container-utilities';
16
- import { useUIDSeed } from 'react-uid';
17
- import { mergeRefs } from 'react-merge-refs';
18
- import activeElement from 'dom-helpers/activeElement';
19
-
20
- function _extends$3() {
21
- _extends$3 = Object.assign ? Object.assign.bind() : function (target) {
22
- for (var i = 1; i < arguments.length; i++) {
23
- var source = arguments[i];
24
- for (var key in source) {
25
- if (Object.prototype.hasOwnProperty.call(source, key)) {
26
- target[key] = source[key];
27
- }
28
- }
29
- }
30
- return target;
31
- };
32
- return _extends$3.apply(this, arguments);
33
- }
34
-
35
- const ChromeContext = React__default.createContext({
36
- hue: 'chromeHue'
37
- });
38
- const useChromeContext = () => {
39
- return useContext(ChromeContext);
40
- };
41
-
42
- const COMPONENT_ID$A = 'chrome.chrome';
43
- const StyledChrome = styled.div.attrs({
44
- 'data-garden-id': COMPONENT_ID$A,
45
- 'data-garden-version': '9.0.0-next.0'
46
- }).withConfig({
47
- displayName: "StyledChrome",
48
- componentId: "sc-1uqm6u6-0"
49
- })(["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 => retrieveComponentStyles(COMPONENT_ID$A, props));
50
- StyledChrome.defaultProps = {
51
- theme: DEFAULT_THEME
52
- };
53
-
54
- const COMPONENT_ID$z = 'chrome.header_item_icon';
55
- const StyledHeaderItemIcon = styled.div.attrs({
56
- 'data-garden-id': COMPONENT_ID$z,
57
- 'data-garden-version': '9.0.0-next.0'
58
- }).withConfig({
59
- displayName: "StyledHeaderItemIcon",
60
- componentId: "sc-1jhhp6z-0"
61
- })(["transition:transform 0.25s ease-in-out;margin:0 3px;width:", ";min-width:", ";height:", ";", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => retrieveComponentStyles(COMPONENT_ID$z, props));
62
- StyledHeaderItemIcon.defaultProps = {
63
- theme: DEFAULT_THEME
64
- };
65
-
66
- const COMPONENT_ID$y = 'chrome.base_header_item';
67
- const getHeaderItemSize = props => `${props.theme.space.base * 7.5}px`;
68
- const sizeStyles$4 = props => {
69
- const size = props.theme.space.base * 7.5;
70
- return css(["padding:0 3px;min-width:", "px;height:", ";line-height:", ";"], size, props.maxY ? '100%' : `${size}px`, getLineHeight(size, props.theme.fontSizes.md));
71
- };
72
- const StyledBaseHeaderItem = styled.button.attrs({
73
- 'data-garden-id': COMPONENT_ID$y,
74
- 'data-garden-version': '9.0.0-next.0'
75
- }).withConfig({
76
- displayName: "StyledBaseHeaderItem",
77
- componentId: "sc-1qua7h6-0"
78
- })(["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 => {
79
- if (props.isRound) {
80
- return '100%';
81
- }
82
- if (props.maxY) {
83
- return '0';
84
- }
85
- return props.theme.borderRadii.md;
86
- }, sizeStyles$4, props => retrieveComponentStyles(COMPONENT_ID$y, props));
87
- StyledBaseHeaderItem.defaultProps = {
88
- theme: DEFAULT_THEME
89
- };
90
-
91
- const COMPONENT_ID$x = 'chrome.header_item_text';
92
- const clippedStyling = css(["position:absolute;margin:0;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
93
- const StyledHeaderItemText = styled.span.attrs({
94
- 'data-garden-id': COMPONENT_ID$x,
95
- 'data-garden-version': '9.0.0-next.0'
96
- }).withConfig({
97
- displayName: "StyledHeaderItemText",
98
- componentId: "sc-goz7la-0"
99
- })(["margin:0 3px;", " ", ";"], props => props.isClipped && clippedStyling, props => retrieveComponentStyles(COMPONENT_ID$x, props));
100
- StyledHeaderItemText.defaultProps = {
101
- theme: DEFAULT_THEME
102
- };
103
-
104
- const COMPONENT_ID$w = 'chrome.nav';
105
- const colorStyles$6 = props => {
106
- const shade = props.isDark || props.isLight ? 600 : 700;
107
- const backgroundColor = getColor(props.hue, shade, props.theme);
108
- const foregroundColor = props.isLight ? props.theme.palette.black : props.theme.palette.white;
109
- return css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
110
- };
111
- const getNavWidth = props => {
112
- return `${props.theme.space.base * 15}px`;
113
- };
114
- const getExpandedNavWidth = () => {
115
- return `200px`;
116
- };
117
- const StyledNav = styled.nav.attrs({
118
- 'data-garden-id': COMPONENT_ID$w,
119
- 'data-garden-version': '9.0.0-next.0'
120
- }).withConfig({
121
- displayName: "StyledNav",
122
- componentId: "sc-6j462r-0"
123
- })(["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 => retrieveComponentStyles(COMPONENT_ID$w, props));
124
- StyledNav.defaultProps = {
125
- theme: DEFAULT_THEME
126
- };
127
-
128
- const COMPONENT_ID$v = 'chrome.header_item';
129
- const retrieveProductColor$1 = props => {
130
- switch (props.product) {
131
- case 'chat':
132
- return PALETTE.product.chat;
133
- case 'connect':
134
- return PALETTE.product.connect;
135
- case 'explore':
136
- return PALETTE.product.explore;
137
- case 'guide':
138
- return PALETTE.product.guide;
139
- case 'message':
140
- return PALETTE.product.message;
141
- case 'support':
142
- return PALETTE.product.support;
143
- case 'talk':
144
- return PALETTE.product.talk;
145
- default:
146
- return 'inherit';
147
- }
148
- };
149
- const StyledLogoHeaderItem = styled(StyledBaseHeaderItem).attrs({
150
- 'data-garden-id': COMPONENT_ID$v,
151
- 'data-garden-version': '9.0.0-next.0',
152
- as: 'div'
153
- }).withConfig({
154
- displayName: "StyledLogoHeaderItem",
155
- 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} ${getColor('neutralHue', 300, props.theme)}`, props => getNavWidth(props), props => getColor('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
- StyledLogoHeaderItem.defaultProps = {
158
- theme: DEFAULT_THEME
159
- };
160
-
161
- const COMPONENT_ID$u = 'chrome.base_nav_item';
162
- const getNavItemHeight = props => {
163
- return `${props.theme.space.base * 13}px`;
164
- };
165
- const sizeStyles$3 = props => {
166
- const verticalPadding = math(`(${getNavItemHeight(props)} - ${props.theme.iconSizes.lg}) / 2`);
167
- const horizontalPadding = math(`(${getNavWidth(props)} - ${props.theme.iconSizes.lg}) / 4`);
168
- return css(["padding:", " ", ";min-height:", ";"], verticalPadding, horizontalPadding, getNavItemHeight);
169
- };
170
- const StyledBaseNavItem = styled.button.attrs({
171
- 'data-garden-id': COMPONENT_ID$u,
172
- 'data-garden-version': '9.0.0-next.0'
173
- }).withConfig({
174
- displayName: "StyledBaseNavItem",
175
- componentId: "sc-zvo43f-0"
176
- })(["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));
177
- StyledBaseNavItem.defaultProps = {
178
- theme: DEFAULT_THEME
179
- };
180
-
181
- const COMPONENT_ID$t = 'chrome.header';
182
- const getHeaderHeight = props => {
183
- return getNavItemHeight(props);
184
- };
185
- const StyledHeader = styled.header.attrs({
186
- 'data-garden-id': COMPONENT_ID$t,
187
- 'data-garden-version': '9.0.0-next.0'
188
- }).withConfig({
189
- displayName: "StyledHeader",
190
- 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} ${getColor('neutralHue', 300, props.theme)}`, props => props.isStandalone && props.theme.shadows.lg('0', '10px', getColor('chromeHue', 600, props.theme, 0.15)), props => props.theme.colors.background, props => props.theme.space.base, getHeaderHeight, props => getColor('neutralHue', 600, props.theme), props => props.theme.fontSizes.md, props => props.isStandalone && `
192
- ${StyledLogoHeaderItem} {
193
- display: inline-flex;
194
- }
195
- `, props => retrieveComponentStyles(COMPONENT_ID$t, props));
196
- StyledHeader.defaultProps = {
197
- theme: DEFAULT_THEME
198
- };
199
-
200
- const COMPONENT_ID$s = 'chrome.skipnav';
201
- const animationStyles = () => {
202
- const animationName = keyframes(["0%{transform:translate(-50%,-50%);}"]);
203
- 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
- };
205
- const colorStyles$5 = theme => {
206
- const color = getColor('primaryHue', 600, theme);
207
- const borderColor = getColor('neutralHue', 300, theme);
208
- const boxShadow = theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7}px`, getColor('chromeHue', 600, theme, 0.15));
209
- return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover,&:focus{color:", ";}", ""], borderColor, boxShadow, theme.colors.background, color, color, focusStyles({
210
- theme,
211
- inset: true,
212
- boxShadow
213
- }));
214
- };
215
- const sizeStyles$2 = props => {
216
- const top = math(`${getHeaderHeight(props)} / 2`);
217
- const padding = `${props.theme.space.base * 5}px`;
218
- const paddingStart = `${props.theme.space.base * 4}px`;
219
- const fontSize = props.theme.fontSizes.md;
220
- const lineHeight = getLineHeight(padding, fontSize);
221
- return css(["top:", ";padding:", ";padding-", ":", ";line-height:", ";font-size:", ";"], top, padding, props.theme.rtl ? 'right' : 'left', paddingStart, lineHeight, fontSize);
222
- };
223
- const StyledSkipNav = styled.a.attrs({
224
- 'data-garden-id': COMPONENT_ID$s,
225
- 'data-garden-version': '9.0.0-next.0'
226
- }).withConfig({
227
- displayName: "StyledSkipNav",
228
- componentId: "sc-1tsro34-0"
229
- })(["", ";display:inline-flex;position:absolute;left:50%;align-items:center;justify-content:center;transform:translateX(-50%);direction:", ";z-index:", ";border:", ";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.borders.sm, props => props.theme.borderRadii.md, props => sizeStyles$2(props), SELECTOR_FOCUS_VISIBLE, props => colorStyles$5(props.theme), props => retrieveComponentStyles(COMPONENT_ID$s, props));
230
- StyledSkipNav.defaultProps = {
231
- theme: DEFAULT_THEME
232
- };
233
-
234
- var _path$2;
235
- function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
236
- var SvgLinkStroke = function SvgLinkStroke(props) {
237
- return /*#__PURE__*/React.createElement("svg", _extends$2({
238
- xmlns: "http://www.w3.org/2000/svg",
239
- width: 16,
240
- height: 16,
241
- focusable: "false",
242
- viewBox: "0 0 16 16",
243
- "aria-hidden": "true"
244
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
245
- fill: "currentColor",
246
- 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"
247
- })));
248
- };
249
-
250
- const COMPONENT_ID$r = 'chrome.skipnav_icon';
251
- const sizeStyles$1 = theme => {
252
- const margin = `${theme.space.base * 2}px`;
253
- const size = theme.iconSizes.md;
254
- return css(["margin-", ":", ";width:", ";height:", ";"], theme.rtl ? 'left' : 'right', margin, size, size);
255
- };
256
- const StyledSkipNavIcon = styled(SvgLinkStroke).attrs({
257
- 'data-garden-id': COMPONENT_ID$r,
258
- 'data-garden-version': '9.0.0-next.0'
259
- }).withConfig({
260
- displayName: "StyledSkipNavIcon",
261
- componentId: "sc-1ika5z4-0"
262
- })(["transform:", ";color:", ";", ";", ";"], props => props.theme.rtl && 'scaleX(-1)', props => getColor('neutralHue', 600, props.theme), props => sizeStyles$1(props.theme), props => retrieveComponentStyles(COMPONENT_ID$r, props));
263
- StyledSkipNavIcon.defaultProps = {
264
- theme: DEFAULT_THEME
265
- };
266
-
267
- const COMPONENT_ID$q = 'chrome.body';
268
- const StyledBody = styled.div.attrs({
269
- 'data-garden-id': COMPONENT_ID$q,
270
- 'data-garden-version': '9.0.0-next.0'
271
- }).withConfig({
272
- displayName: "StyledBody",
273
- componentId: "sc-c7h9kv-0"
274
- })(["flex:1;order:1;background-color:", ";min-width:0;", ";"], props => getColor('neutralHue', 100, props.theme), props => retrieveComponentStyles(COMPONENT_ID$q, props));
275
- StyledBody.defaultProps = {
276
- theme: DEFAULT_THEME
277
- };
278
-
279
- const COMPONENT_ID$p = 'chrome.footer';
280
- const getFooterHeight = props => {
281
- return `${props.theme.space.base * 20}px`;
282
- };
283
- const StyledFooter = styled.footer.attrs({
284
- 'data-garden-id': COMPONENT_ID$p,
285
- 'data-garden-version': '9.0.0-next.0'
286
- }).withConfig({
287
- displayName: "StyledFooter",
288
- 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} ${getColor('neutralHue', 300, props.theme)}`, props => props.theme.colors.background, props => props.theme.space.base * 9, getFooterHeight, props => retrieveComponentStyles(COMPONENT_ID$p, props));
290
- StyledFooter.defaultProps = {
291
- theme: DEFAULT_THEME
292
- };
293
-
294
- const COMPONENT_ID$o = 'chrome.content';
295
- const StyledContent = styled.div.attrs({
296
- 'data-garden-id': COMPONENT_ID$o,
297
- 'data-garden-version': '9.0.0-next.0'
298
- }).withConfig({
299
- displayName: "StyledContent",
300
- componentId: "sc-qcuzxn-0"
301
- })(["display:flex;height:", ";line-height:", ";color:", ";font-size:", ";&:focus{outline:none;}", ";"], props => props.hasFooter ? `calc(100% - ${math(`${getHeaderHeight(props)} + ${getFooterHeight(props)}`)})` : `calc(100% - ${getHeaderHeight(props)})`, props => getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => retrieveComponentStyles(COMPONENT_ID$o, props));
302
- StyledContent.defaultProps = {
303
- theme: DEFAULT_THEME
304
- };
305
-
306
- const COMPONENT_ID$n = 'chrome.main';
307
- const StyledMain = styled.main.attrs({
308
- 'data-garden-id': COMPONENT_ID$n,
309
- 'data-garden-version': '9.0.0-next.0'
310
- }).withConfig({
311
- displayName: "StyledMain",
312
- componentId: "sc-t61cre-0"
313
- })(["flex:1;order:1;background-color:", ";overflow:auto;:focus{outline:none;}", ";"], props => props.theme.colors.background, props => retrieveComponentStyles(COMPONENT_ID$n, props));
314
- StyledMain.defaultProps = {
315
- theme: DEFAULT_THEME
316
- };
317
-
318
- const COMPONENT_ID$m = 'chrome.sidebar';
319
- const StyledSidebar = styled.aside.attrs({
320
- 'data-garden-id': COMPONENT_ID$m,
321
- 'data-garden-version': '9.0.0-next.0'
322
- }).withConfig({
323
- displayName: "StyledSidebar",
324
- 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} ${getColor('neutralHue', 300, props.theme)}`, props => retrieveComponentStyles(COMPONENT_ID$m, props));
326
- StyledSidebar.defaultProps = {
327
- theme: DEFAULT_THEME
328
- };
329
-
330
- const COMPONENT_ID$l = 'chrome.footer_item';
331
- const StyledFooterItem = styled.div.attrs({
332
- 'data-garden-id': COMPONENT_ID$l,
333
- 'data-garden-version': '9.0.0-next.0'
334
- }).withConfig({
335
- displayName: "StyledFooterItem",
336
- componentId: "sc-1cktm85-0"
337
- })(["margin:", ";", ";"], props => `0 ${props.theme.space.base}px`, props => retrieveComponentStyles(COMPONENT_ID$l, props));
338
- StyledFooterItem.defaultProps = {
339
- theme: DEFAULT_THEME
340
- };
341
-
342
- const COMPONENT_ID$k = 'chrome.header_item';
343
- const imgStyles = props => {
344
- const size = math(`${getHeaderItemSize(props)} - ${props.theme.space.base * 2}`);
345
- return css(["img{margin:0;border-radius:", ";width:", ";height:", ";}"], math(`${props.theme.borderRadii.md} - 1`), size, size);
346
- };
347
- const StyledHeaderItem = styled(StyledBaseHeaderItem).attrs({
348
- 'data-garden-id': COMPONENT_ID$k,
349
- 'data-garden-version': '9.0.0-next.0'
350
- }).withConfig({
351
- displayName: "StyledHeaderItem",
352
- componentId: "sc-14sft6n-0"
353
- })(["&: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
- theme: props.theme,
355
- inset: props.maxY
356
- }), StyledHeaderItemIcon, StyledHeaderItemText, StyledHeaderItemIcon, StyledHeaderItemText, props => getColor('chromeHue', 700, props.theme), imgStyles, props => props.isRound && `
357
- ${StyledHeaderItemIcon} {
358
- border-radius: 100px;
359
- }
360
- `, props => retrieveComponentStyles(COMPONENT_ID$k, props));
361
- StyledHeaderItem.defaultProps = {
362
- theme: DEFAULT_THEME
363
- };
364
-
365
- const COMPONENT_ID$j = 'chrome.header_item_wrapper';
366
- const StyledHeaderItemWrapper = styled(StyledBaseHeaderItem).attrs({
367
- 'data-garden-id': COMPONENT_ID$j,
368
- 'data-garden-version': '9.0.0-next.0',
369
- as: 'div'
370
- }).withConfig({
371
- displayName: "StyledHeaderItemWrapper",
372
- componentId: "sc-1uieu55-0"
373
- })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$j, props));
374
- StyledHeaderItemWrapper.defaultProps = {
375
- theme: DEFAULT_THEME
376
- };
377
-
378
- const COMPONENT_ID$i = 'chrome.logo_nav_item';
379
- const retrieveProductColor = product => {
380
- switch (product) {
381
- case 'chat':
382
- return PALETTE.product.chat;
383
- case 'connect':
384
- return PALETTE.product.connect;
385
- case 'explore':
386
- return PALETTE.product.explore;
387
- case 'guide':
388
- return PALETTE.product.guide;
389
- case 'message':
390
- return PALETTE.product.message;
391
- case 'support':
392
- return PALETTE.product.support;
393
- case 'talk':
394
- return PALETTE.product.talk;
395
- default:
396
- return 'inherit';
397
- }
398
- };
399
- const colorStyles$4 = props => {
400
- const fillColor = props.isLight ? props.theme.palette.grey[800] : props.theme.palette.white;
401
- const color = props.isLight || props.isDark ? fillColor : retrieveProductColor(props.product);
402
- return css(["color:", ";fill:", ";"], color, fillColor);
403
- };
404
- const StyledLogoNavItem = styled(StyledBaseNavItem).attrs({
405
- 'data-garden-id': COMPONENT_ID$i,
406
- 'data-garden-version': '9.0.0-next.0',
407
- as: 'div'
408
- }).withConfig({
409
- displayName: "StyledLogoNavItem",
410
- componentId: "sc-saaydx-0"
411
- })(["order:0;opacity:1;cursor:default;", ";"], props => colorStyles$4(props));
412
- StyledLogoNavItem.defaultProps = {
413
- theme: DEFAULT_THEME
414
- };
415
-
416
- const COMPONENT_ID$h = 'chrome.brandmark_nav_item';
417
- const StyledBrandmarkNavItem = styled(StyledBaseNavItem).attrs({
418
- 'data-garden-id': COMPONENT_ID$h,
419
- 'data-garden-version': '9.0.0-next.0',
420
- as: 'div'
421
- }).withConfig({
422
- displayName: "StyledBrandmarkNavItem",
423
- componentId: "sc-8kynd4-0"
424
- })(["order:1;opacity:0.3;margin-top:auto;"]);
425
- StyledBrandmarkNavItem.defaultProps = {
426
- theme: DEFAULT_THEME
427
- };
428
-
429
- const COMPONENT_ID$g = 'chrome.nav_item_icon';
430
- const StyledNavItemIcon = styled.div.attrs({
431
- 'data-garden-id': COMPONENT_ID$g,
432
- 'data-garden-version': '9.0.0-next.0'
433
- }).withConfig({
434
- displayName: "StyledNavItemIcon",
435
- componentId: "sc-7w9rpt-0"
436
- })(["align-self:flex-start;order:0;border-radius:", ";width:", ";height:", ";", ";"], props => props.theme.borderRadii.md, props => props.theme.iconSizes.lg, props => props.theme.iconSizes.lg, props => retrieveComponentStyles(COMPONENT_ID$g, props));
437
- StyledNavItemIcon.defaultProps = {
438
- theme: DEFAULT_THEME
439
- };
440
-
441
- const COMPONENT_ID$f = 'chrome.nav_item';
442
- const colorStyles$3 = props => {
443
- const {
444
- theme,
445
- hue,
446
- isLight,
447
- isDark,
448
- isCurrent
449
- } = props;
450
- const DARK = theme.palette.black;
451
- const LIGHT = theme.palette.white;
452
- let currentColor;
453
- let hoverColor;
454
- if (isCurrent) {
455
- if (isLight) {
456
- currentColor = rgba(DARK, 0.4);
457
- } else if (isDark) {
458
- currentColor = rgba(LIGHT, 0.4);
459
- } else {
460
- currentColor = getColor(hue, 500, theme);
461
- }
462
- } else {
463
- hoverColor = rgba(isLight ? LIGHT : DARK, 0.1);
464
- }
465
- const activeColor = rgba(isLight ? DARK : LIGHT, 0.1);
466
- const focusColor = isLight ? DARK : LIGHT;
467
- return css(["opacity:", ";outline-color:transparent;background-color:", ";&:hover{opacity:1;background-color:", ";}", " &:active{background-color:", ";}"], isCurrent ? 1 : 0.6, currentColor, hoverColor, focusStyles({
468
- theme,
469
- condition: false ,
470
- styles: {
471
- opacity: 1,
472
- outlineColor: focusColor
473
- }
474
- }), activeColor);
475
- };
476
- const StyledNavItem = styled(StyledBaseNavItem).attrs({
477
- 'data-garden-id': COMPONENT_ID$f,
478
- 'data-garden-version': '9.0.0-next.0',
479
- as: 'button'
480
- }).withConfig({
481
- displayName: "StyledNavItem",
482
- componentId: "sc-gs8mjz-0"
483
- })(["justify-content:", ";order:1;margin:0;cursor:", ";text-align:", ";&:hover,&:focus{text-decoration:none;color:inherit;}", ";&:focus-visible:hover,&:focus-visible:active,", "{outline:", " solid;outline-offset:-", ";}", " ", ";"], props => props.isExpanded && 'start', props => props.isCurrent ? 'default' : 'pointer', props => props.isExpanded && 'inherit', colorStyles$3, SELECTOR_FOCUS_VISIBLE, props => math(`${props.theme.borderWidths.md} - 1`), props => props.theme.borderWidths.md, props => props.isExpanded && `
484
- ${StyledNavItemIcon} {
485
- margin: 0 ${math(`(${getNavWidth(props)} - ${props.theme.iconSizes.lg}) / 4`)};
486
- }
487
- `, props => retrieveComponentStyles(COMPONENT_ID$f, props));
488
- StyledNavItem.defaultProps = {
489
- theme: DEFAULT_THEME
490
- };
491
-
492
- const COMPONENT_ID$e = 'chrome.nav_item_text';
493
- const StyledNavItemText = styled.span.attrs({
494
- 'data-garden-id': COMPONENT_ID$e,
495
- 'data-garden-version': '9.0.0-next.0'
496
- }).withConfig({
497
- displayName: "StyledNavItemText",
498
- componentId: "sc-13m84xl-0"
499
- })(["position:absolute;order:1;clip:rect(1px,1px,1px,1px);margin:", ";width:1px;height:1px;overflow:hidden;line-height:", ";white-space:", ";", " ", ";"], props => props.isExpanded && `0 ${math(`(${getNavWidth(props)} - ${props.theme.iconSizes.lg}) / 4`)}`, props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.isWrapped ? 'normal' : 'nowrap', props => props.isExpanded && `
500
- ${StyledNavItem} > && {
501
- position: static;
502
- flex: 1;
503
- clip: auto;
504
- width: auto;
505
- height: auto;
506
- text-overflow: ellipsis;
507
- }
508
- `, props => retrieveComponentStyles(COMPONENT_ID$e, props));
509
- StyledNavItemText.defaultProps = {
510
- theme: DEFAULT_THEME
511
- };
512
-
513
- const COMPONENT_ID$d = 'chrome.subnav_item';
514
- const colorStyles$2 = props => {
515
- const {
516
- theme,
517
- isLight,
518
- isCurrent
519
- } = props;
520
- const DARK = theme.palette.black;
521
- const LIGHT = theme.palette.white;
522
- let currentColor;
523
- let hoverColor;
524
- if (isCurrent) {
525
- if (isLight) {
526
- currentColor = rgba(DARK, 0.1);
527
- } else {
528
- currentColor = rgba(LIGHT, 0.1);
529
- }
530
- } else {
531
- hoverColor = rgba(isLight ? LIGHT : DARK, 0.1);
532
- }
533
- const activeColor = rgba(isLight ? DARK : LIGHT, 0.03);
534
- return css(["opacity:", ";background-color:", ";&:hover{opacity:1;background-color:", ";}", " &:not([data-garden-header='true']):active{background-color:", ";}"], isCurrent ? '1' : '0.6', currentColor, hoverColor, focusStyles({
535
- theme,
536
- hue: isLight ? DARK : LIGHT,
537
- spacerWidth: null,
538
- styles: {
539
- opacity: 1
540
- }
541
- }), activeColor);
542
- };
543
- const getSubNavItemHeight = props => {
544
- return `${props.theme.space.base * 7.5}px`;
545
- };
546
- const StyledSubNavItem = styled.button.attrs({
547
- 'data-garden-id': COMPONENT_ID$d,
548
- 'data-garden-version': '9.0.0-next.0'
549
- }).withConfig({
550
- displayName: "StyledSubNavItem",
551
- componentId: "sc-1yg9dpx-0"
552
- })(["display:flex;align-items:center;transition:box-shadow 0.1s ease-in-out,background-color 0.1s ease-in-out,opacity 0.1s ease-in-out;margin:", "px 0 0;border:none;border-radius:", ";box-sizing:border-box;background:transparent;cursor:", ";padding:", ";width:100%;min-height:", ";text-align:inherit;font-size:inherit;&,&:hover,&:focus{text-decoration:none;color:inherit;}", ";", ";"], props => props.theme.space.base * 2, props => props.theme.borderRadii.md, props => props.isCurrent ? 'default' : 'pointer', props => `0 ${props.theme.space.base * 2}px`, getSubNavItemHeight, props => colorStyles$2(props), props => retrieveComponentStyles(COMPONENT_ID$d, props));
553
- StyledSubNavItem.defaultProps = {
554
- theme: DEFAULT_THEME
555
- };
556
-
557
- const COMPONENT_ID$c = 'chrome.subnav';
558
- const colorStyles$1 = props => {
559
- let shade;
560
- if (props.isLight) {
561
- shade = 500;
562
- } else {
563
- shade = props.isDark ? 700 : 800;
564
- }
565
- const backgroundColor = getColor(props.hue, shade, props.theme);
566
- const foregroundColor = props.isLight ? props.theme.palette.grey[800] : props.theme.palette.white;
567
- return css(["background-color:", ";color:", ";"], backgroundColor, foregroundColor);
568
- };
569
- const StyledSubNav = styled.nav.attrs({
570
- 'data-garden-id': COMPONENT_ID$c,
571
- 'data-garden-version': '9.0.0-next.0'
572
- }).withConfig({
573
- displayName: "StyledSubNav",
574
- componentId: "sc-19hjou6-0"
575
- })(["flex-direction:column;order:0;padding:", ";min-width:220px;overflow:auto;font-size:", ";", ";& > ", ":first-child{margin-top:0;}", ";"], props => `${props.theme.space.base * 6}px ${props.theme.space.base * 5}px`, props => props.theme.fontSizes.md, props => colorStyles$1(props), StyledSubNavItem, props => retrieveComponentStyles('chrome.subnav', props));
576
- StyledSubNav.defaultProps = {
577
- theme: DEFAULT_THEME
578
- };
579
-
580
- const COMPONENT_ID$b = 'chrome.subnav_item_text';
581
- const sizeStyles = props => {
582
- const baseLineHeight = props.theme.space.base * 5;
583
- const verticalMargin = math(`(${getSubNavItemHeight(props)} - ${baseLineHeight}) / 2`);
584
- const lineHeight = getLineHeight(baseLineHeight, props.theme.fontSizes.md);
585
- return css(["margin:", " 0;line-height:", ";"], verticalMargin, lineHeight);
586
- };
587
- const StyledSubNavItemText = styled.span.attrs({
588
- 'data-garden-id': COMPONENT_ID$b,
589
- 'data-garden-version': '9.0.0-next.0'
590
- }).withConfig({
591
- displayName: "StyledSubNavItemText",
592
- componentId: "sc-1hy0pn7-0"
593
- })(["overflow:hidden;text-overflow:ellipsis;white-space:", ";", " ", ";"], props => props.isWrapped ? 'normal' : 'nowrap', props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID$b, props));
594
- StyledSubNavItemText.defaultProps = {
595
- theme: DEFAULT_THEME
596
- };
597
-
598
- const COMPONENT_ID$a = 'chrome.collapsible_sub_nav_item';
599
- const StyledSubNavItemHeader = styled(StyledSubNavItem).attrs({
600
- 'data-garden-id': COMPONENT_ID$a,
601
- 'data-garden-version': '9.0.0-next.0',
602
- 'data-garden-header': 'true'
603
- }).withConfig({
604
- displayName: "StyledSubNavItemHeader",
605
- componentId: "sc-1vniter-0"
606
- })(["position:relative;padding-", ":", "px;", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 7, props => retrieveComponentStyles(COMPONENT_ID$a, props));
607
- StyledSubNavItemHeader.defaultProps = {
608
- theme: DEFAULT_THEME
609
- };
610
-
611
- var _path$1;
612
- function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
613
- var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
614
- return /*#__PURE__*/React.createElement("svg", _extends$1({
615
- xmlns: "http://www.w3.org/2000/svg",
616
- width: 12,
617
- height: 12,
618
- focusable: "false",
619
- viewBox: "0 0 12 12",
620
- "aria-hidden": "true"
621
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
622
- fill: "currentColor",
623
- d: "M1.646 3.646a.5.5 0 01.638-.057l.07.057L6 7.293l3.646-3.647a.5.5 0 01.638-.057l.07.057a.5.5 0 01.057.638l-.057.07-4 4a.5.5 0 01-.638.057l-.07-.057-4-4a.5.5 0 010-.708z"
624
- })));
625
- };
626
-
627
- const COMPONENT_ID$9 = 'chrome.collapsible_sub_nav_item_icon';
628
- const FilteredChevronDownStrokeIcon = React__default.forwardRef((_ref, ref) => {
629
- let {
630
- theme,
631
- isExpanded,
632
- ...validProps
633
- } = _ref;
634
- return React__default.createElement(SvgChevronDownStroke, _extends$3({
635
- ref: ref
636
- }, validProps));
637
- });
638
- FilteredChevronDownStrokeIcon.displayName = 'FilteredChevronDownStrokeIcon';
639
- const StyledSubNavItemIcon = styled(FilteredChevronDownStrokeIcon).withConfig({
640
- displayName: "StyledSubNavItemIcon",
641
- componentId: "sc-1d02hho-0"
642
- })(["width:", ";height:", ";"], props => props.theme.iconSizes.sm, props => props.theme.iconSizes.sm);
643
- StyledSubNavItemIcon.defaultProps = {
644
- theme: DEFAULT_THEME
645
- };
646
- const StyledSubNavItemIconWrapper = styled.div.attrs({
647
- 'data-garden-id': COMPONENT_ID$9,
648
- 'data-garden-version': '9.0.0-next.0'
649
- }).withConfig({
650
- displayName: "StyledSubNavItemIcon__StyledSubNavItemIconWrapper",
651
- componentId: "sc-1d02hho-1"
652
- })(["display:flex;position:absolute;top:0;right:", ";left:", ";align-items:center;justify-content:center;width:", "px;height:", ";", "{transform:", ";transition:transform 0.25s ease-in-out;}", ";"], props => props.theme.rtl ? 'auto' : 0, props => props.theme.rtl && 0, props => props.theme.space.base * 7, getSubNavItemHeight, StyledSubNavItemIcon, props => props.isExpanded && `rotate(${props.theme.rtl ? '-' : ''}180deg)`, props => retrieveComponentStyles(COMPONENT_ID$9, props));
653
- StyledSubNavItemIconWrapper.defaultProps = {
654
- theme: DEFAULT_THEME
655
- };
656
-
657
- const PANEL_COMPONENT_ID = 'chrome.collapsible_sub_nav_item_panel';
658
- const hiddenStyling = css(["visibility:hidden;max-height:0 !important;overflow:hidden;"]);
659
- const StyledSubNavPanel = styled.div.attrs({
660
- 'data-garden-id': PANEL_COMPONENT_ID,
661
- 'data-garden-version': '9.0.0-next.0'
662
- }).withConfig({
663
- displayName: "StyledSubNavPanel",
664
- componentId: "sc-1jv3rpv-0"
665
- })(["transition:max-height 0.25s cubic-bezier(0.15,0.85,0.35,1.2),0.25s visibility 0s linear;height:auto;max-height:100%;", " ", "{padding-", ":", ";}", ";"], props => props.isHidden && hiddenStyling, StyledSubNavItem, props => props.theme.rtl ? 'right' : 'left', props => `${props.theme.space.base * 5}px`, props => retrieveComponentStyles(PANEL_COMPONENT_ID, props));
666
- StyledSubNavPanel.defaultProps = {
667
- theme: DEFAULT_THEME
668
- };
669
-
670
- const COMPONENT_ID$8 = 'chrome.sheet';
671
- const borderStyle = _ref => {
672
- let {
673
- theme,
674
- placement,
675
- isOpen
676
- } = _ref;
677
- const borderColor = isOpen ? getColor('neutralHue', 300, theme) : 'transparent';
678
- const borderSides = ['-left', '-right'];
679
- let borderSide = '';
680
- if (theme.rtl) {
681
- borderSides.reverse();
682
- }
683
- if (placement === 'end') {
684
- borderSide = borderSides[0];
685
- } else if (placement === 'start') {
686
- borderSide = borderSides[1];
687
- }
688
- return `border${borderSide}: ${theme.borders.sm} ${borderColor};`;
689
- };
690
- const StyledSheet = styled.aside.attrs({
691
- 'data-garden-id': COMPONENT_ID$8,
692
- 'data-garden-version': '9.0.0-next.0'
693
- }).withConfig({
694
- displayName: "StyledSheet",
695
- componentId: "sc-dx8ijk-0"
696
- })(["display:flex;order:1;transition:", ";background-color:", ";width:", ";height:100%;overflow:hidden;font-size:", ";&:focus{outline:none;}", ";", ";"], props => props.isAnimated && 'width 250ms ease-in-out', props => props.theme.colors.background, props => props.isOpen ? props.size : '0px', props => props.theme.fontSizes.md, props => borderStyle(props), props => retrieveComponentStyles(COMPONENT_ID$8, props));
697
- StyledSheet.defaultProps = {
698
- theme: DEFAULT_THEME
699
- };
700
-
701
- const COMPONENT_ID$7 = 'chrome.sheet_wrapper';
702
- const StyledSheetWrapper = styled.div.attrs({
703
- 'data-garden-id': COMPONENT_ID$7,
704
- 'data-garden-version': '9.0.0-next.0'
705
- }).withConfig({
706
- displayName: "StyledSheetWrapper",
707
- componentId: "sc-f6x9zb-0"
708
- })(["display:flex;position:relative;flex-direction:column;transform:", ";transition:", ";min-width:", ";", ";"], props => {
709
- const translateValues = [-100, 100];
710
- let translation = 'translateX(0%)';
711
- if (props.isOpen) {
712
- return translation;
713
- }
714
- if (props.theme.rtl) {
715
- translateValues.reverse();
716
- }
717
- if (props.placement === 'end') {
718
- translation = `translateX(${translateValues[1]}%)`;
719
- } else if (props.placement === 'start') {
720
- translation = `translateX(${translateValues[0]}%)`;
721
- }
722
- return translation;
723
- }, props => props.isAnimated && 'transform 250ms ease-in-out', props => props.size, props => retrieveComponentStyles(COMPONENT_ID$7, props));
724
- StyledSheetWrapper.defaultProps = {
725
- theme: DEFAULT_THEME
726
- };
727
-
728
- const COMPONENT_ID$6 = 'chrome.sheet_title';
729
- const StyledSheetTitle = styled.div.attrs({
730
- 'data-garden-id': COMPONENT_ID$6,
731
- 'data-garden-version': '9.0.0-next.0'
732
- }).withConfig({
733
- displayName: "StyledSheetTitle",
734
- componentId: "sc-1gogk75-0"
735
- })(["line-height:", ";color:", ";font-weight:", ";", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.colors.foreground, props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID$6, props));
736
- StyledSheetTitle.defaultProps = {
737
- theme: DEFAULT_THEME
738
- };
739
-
740
- const COMPONENT_ID$5 = 'chrome.sheet_description';
741
- const StyledSheetDescription = styled.div.attrs({
742
- 'data-garden-id': COMPONENT_ID$5,
743
- 'data-garden-version': '9.0.0-next.0'
744
- }).withConfig({
745
- displayName: "StyledSheetDescription",
746
- componentId: "sc-1puglb6-0"
747
- })(["line-height:", ";color:", ";", ";"], props => getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.md), props => getColor('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$5, props));
748
- StyledSheetDescription.defaultProps = {
749
- theme: DEFAULT_THEME
750
- };
751
-
752
- const COMPONENT_ID$4 = 'chrome.sheet_body';
753
- const StyledSheetBody = styled.div.attrs({
754
- 'data-garden-id': COMPONENT_ID$4,
755
- 'data-garden-version': '9.0.0-next.0'
756
- }).withConfig({
757
- displayName: "StyledSheetBody",
758
- componentId: "sc-bt4eoj-0"
759
- })(["flex:1;overflow-y:auto;padding:", "px;", ";"], props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID$4, props));
760
- StyledSheetBody.defaultProps = {
761
- theme: DEFAULT_THEME
762
- };
763
-
764
- const COMPONENT_ID$3 = 'chrome.sheet_close';
765
- const BASE_MULTIPLIERS = {
766
- top: 2.5,
767
- side: 2,
768
- size: 10
769
- };
770
- const colorStyles = props => {
771
- const backgroundColor = 'primaryHue';
772
- 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:", ";}"], getColor(foregroundColor, 600, props.theme), getColor(backgroundColor, 600, props.theme, 0.08), getColor(foregroundColor, 700, props.theme), focusStyles({
774
- theme: props.theme
775
- }), getColor(backgroundColor, 600, props.theme, 0.2), getColor(foregroundColor, 800, props.theme));
776
- };
777
- const StyledSheetClose = styled.button.attrs({
778
- 'data-garden-id': COMPONENT_ID$3,
779
- 'data-garden-version': '9.0.0-next.0'
780
- }).withConfig({
781
- displayName: "StyledSheetClose",
782
- componentId: "sc-1ab02oq-0"
783
- })(["display:flex;position:absolute;top:", "px;", ":", ";align-items:center;justify-content:center;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:none;border-radius:50%;cursor:pointer;padding:0;width:", "px;height:", "px;overflow:hidden;text-decoration:none;font-size:0;user-select:none;&::-moz-focus-inner{border:0;}", ";& > svg{vertical-align:middle;}", ";"], props => props.theme.space.base * BASE_MULTIPLIERS.top, props => props.theme.rtl ? 'left' : 'right', props => `${props.theme.space.base * BASE_MULTIPLIERS.side}px`, props => props.theme.space.base * BASE_MULTIPLIERS.size, props => props.theme.space.base * BASE_MULTIPLIERS.size, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$3, props));
784
- StyledSheetClose.defaultProps = {
785
- theme: DEFAULT_THEME
786
- };
787
-
788
- const COMPONENT_ID$2 = 'chrome.sheet_footer';
789
- const StyledSheetFooter = styled.footer.attrs({
790
- 'data-garden-id': COMPONENT_ID$2,
791
- 'data-garden-version': '9.0.0-next.0'
792
- }).withConfig({
793
- displayName: "StyledSheetFooter",
794
- 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} ${getColor('neutralHue', 300, props.theme)}}`, props => props.theme.space.base * (props.isCompact ? 2.5 : 5), props => retrieveComponentStyles(COMPONENT_ID$2, props));
796
- StyledSheetFooter.defaultProps = {
797
- theme: DEFAULT_THEME
798
- };
799
-
800
- const COMPONENT_ID$1 = 'chrome.sheet_footer_item';
801
- const StyledSheetFooterItem = styled.div.attrs({
802
- 'data-garden-id': COMPONENT_ID$1,
803
- 'data-garden-version': '9.0.0-next.0'
804
- }).withConfig({
805
- displayName: "StyledSheetFooterItem",
806
- componentId: "sc-r9ixh-0"
807
- })(["", " ", ";"], props => `margin-${props.theme.rtl ? 'right' : 'left'}: ${props.theme.space.base * 5}px;`, props => retrieveComponentStyles(COMPONENT_ID$1, props));
808
- StyledSheetFooterItem.defaultProps = {
809
- theme: DEFAULT_THEME
810
- };
811
-
812
- const COMPONENT_ID = 'chrome.sheet_header';
813
- const StyledSheetHeader = styled.header.attrs({
814
- 'data-garden-id': COMPONENT_ID,
815
- 'data-garden-version': '9.0.0-next.0'
816
- }).withConfig({
817
- displayName: "StyledSheetHeader",
818
- componentId: "sc-o2ry8i-0"
819
- })(["border-bottom:", ";padding:", "px;", " ", ";"], props => `${props.theme.borders.sm} ${getColor('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
- StyledSheetHeader.defaultProps = {
821
- theme: DEFAULT_THEME
822
- };
823
-
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 PRODUCT = ['chat', 'connect', 'explore', 'guide', 'message', 'support', 'talk'];
950
-
951
- const HeaderItem = React__default.forwardRef((_ref, ref) => {
952
- let {
953
- hasLogo,
954
- product,
955
- ...other
956
- } = _ref;
957
- if (hasLogo) {
958
- return React__default.createElement(StyledLogoHeaderItem, _extends$3({
959
- ref: ref,
960
- product: product
961
- }, other));
962
- }
963
- return React__default.createElement(StyledHeaderItem, _extends$3({
964
- ref: ref
965
- }, other));
966
- });
967
- HeaderItem.displayName = 'HeaderItem';
968
- HeaderItem.propTypes = {
969
- maxX: PropTypes.bool,
970
- maxY: PropTypes.bool,
971
- isRound: PropTypes.bool,
972
- product: PropTypes.oneOf(PRODUCT),
973
- hasLogo: PropTypes.bool
974
- };
975
-
976
- const HeaderItemIcon = _ref => {
977
- let {
978
- children,
979
- ...props
980
- } = _ref;
981
- const element = Children.only(children);
982
- if ( isValidElement(element)) {
983
- const Icon = _ref2 => {
984
- let {
985
- theme,
986
- ...iconProps
987
- } = _ref2;
988
- return cloneElement(element, {
989
- ...props,
990
- ...iconProps
991
- });
992
- };
993
- return React__default.createElement(StyledHeaderItemIcon, _extends$3({
994
- as: Icon
995
- }, props));
996
- }
997
- return null;
998
- };
999
-
1000
- const HeaderItemText = React__default.forwardRef((props, ref) => React__default.createElement(StyledHeaderItemText, _extends$3({
1001
- ref: ref
1002
- }, props)));
1003
- HeaderItemText.displayName = 'HeaderItemText';
1004
- HeaderItemText.propTypes = {
1005
- isClipped: PropTypes.bool
1006
- };
1007
-
1008
- const HeaderItemWrapper = React__default.forwardRef((props, ref) => React__default.createElement(StyledHeaderItemWrapper, _extends$3({
1009
- ref: ref
1010
- }, props)));
1011
- HeaderItemWrapper.displayName = 'HeaderItemWrapper';
1012
-
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
- const FooterItem$1 = React__default.forwardRef((props, ref) => React__default.createElement(StyledFooterItem, _extends$3({
1019
- ref: ref
1020
- }, props)));
1021
- FooterItem$1.displayName = 'FooterItem';
1022
-
1023
- const NavContext = React__default.createContext({
1024
- isExpanded: false
1025
- });
1026
- const useNavContext = () => {
1027
- return useContext(NavContext);
1028
- };
1029
-
1030
- const Nav = React__default.forwardRef((props, ref) => {
1031
- const {
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
- })));
1048
- });
1049
- Nav.displayName = 'Nav';
1050
- Nav.propTypes = {
1051
- isExpanded: PropTypes.bool
1052
- };
1053
-
1054
- const NavItem = React__default.forwardRef((_ref, ref) => {
1055
- let {
1056
- hasLogo,
1057
- hasBrandmark,
1058
- product,
1059
- ...other
1060
- } = _ref;
1061
- const {
1062
- hue,
1063
- isLight,
1064
- isDark
1065
- } = useChromeContext();
1066
- const {
1067
- isExpanded
1068
- } = useNavContext();
1069
- const ariaCurrent = other.isCurrent || undefined;
1070
- if (hasLogo) {
1071
- return React__default.createElement(StyledLogoNavItem, _extends$3({
1072
- ref: ref,
1073
- isDark: isDark,
1074
- isLight: isLight,
1075
- product: product,
1076
- "aria-current": ariaCurrent
1077
- }, other));
1078
- }
1079
- if (hasBrandmark) {
1080
- return React__default.createElement(StyledBrandmarkNavItem, _extends$3({
1081
- ref: ref
1082
- }, other));
1083
- }
1084
- return React__default.createElement(StyledNavItem, _extends$3({
1085
- tabIndex: 0,
1086
- ref: ref,
1087
- isExpanded: isExpanded,
1088
- hue: hue,
1089
- isDark: isDark,
1090
- isLight: isLight,
1091
- "aria-current": ariaCurrent
1092
- }, other));
1093
- });
1094
- NavItem.displayName = 'NavItem';
1095
- NavItem.propTypes = {
1096
- product: PropTypes.oneOf(PRODUCT),
1097
- hasLogo: PropTypes.bool,
1098
- hasBrandmark: PropTypes.bool
1099
- };
1100
-
1101
- const NavItemIcon = _ref => {
1102
- let {
1103
- children,
1104
- ...props
1105
- } = _ref;
1106
- const element = Children.only(children);
1107
- if ( isValidElement(element)) {
1108
- const Icon = _ref2 => {
1109
- let {
1110
- theme,
1111
- ...iconProps
1112
- } = _ref2;
1113
- return cloneElement(element, {
1114
- ...props,
1115
- ...iconProps
1116
- });
1117
- };
1118
- return React__default.createElement(StyledNavItemIcon, _extends$3({
1119
- as: Icon
1120
- }, props));
1121
- }
1122
- return null;
1123
- };
1124
-
1125
- const NavItemText = React__default.forwardRef((props, ref) => {
1126
- const {
1127
- isExpanded
1128
- } = useNavContext();
1129
- return React__default.createElement(StyledNavItemText, _extends$3({
1130
- ref: ref,
1131
- isExpanded: isExpanded
1132
- }, props));
1133
- });
1134
- NavItemText.displayName = 'NavItemText';
1135
- NavItemText.propTypes = {
1136
- isWrapped: PropTypes.bool
1137
- };
1138
-
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
- const SubNavItem = React__default.forwardRef((props, ref) => {
1155
- const {
1156
- isDark,
1157
- isLight
1158
- } = useChromeContext();
1159
- return React__default.createElement(StyledSubNavItem, _extends$3({
1160
- ref: ref,
1161
- isDark: isDark,
1162
- isLight: isLight
1163
- }, props));
1164
- });
1165
- SubNavItem.displayName = 'SubNavItem';
1166
- SubNavItem.propTypes = {
1167
- isCurrent: PropTypes.bool
1168
- };
1169
-
1170
- const SubNavItemText = React__default.forwardRef((props, ref) => React__default.createElement(StyledSubNavItemText, _extends$3({
1171
- ref: ref
1172
- }, props)));
1173
- SubNavItemText.displayName = 'SubNavItemText';
1174
- SubNavItemText.propTypes = {
1175
- isWrapped: PropTypes.bool
1176
- };
1177
-
1178
- const CollapsibleSubNavItem = React__default.forwardRef((_ref, ref) => {
1179
- let {
1180
- header,
1181
- children,
1182
- isExpanded: controlledExpanded,
1183
- onChange,
1184
- ...other
1185
- } = _ref;
1186
- const {
1187
- isDark,
1188
- isLight
1189
- } = useChromeContext();
1190
- const panelRef = createRef();
1191
- const [internalExpanded, setInternalExpanded] = useState(controlledExpanded);
1192
- const expanded = getControlledValue(controlledExpanded, internalExpanded);
1193
- const value = 0;
1194
- const expandedSections = expanded ? [value] : [];
1195
- const {
1196
- getHeaderProps,
1197
- getTriggerProps,
1198
- getPanelProps
1199
- } = useAccordion({
1200
- sections: [value],
1201
- expandedSections,
1202
- onChange: () => {
1203
- const isExpanded = expandedSections.length === 0;
1204
- if (onChange) {
1205
- onChange(isExpanded);
1206
- } else {
1207
- setInternalExpanded(isExpanded);
1208
- }
1209
- }
1210
- });
1211
- useEffect(() => {
1212
- if (expanded && panelRef.current) {
1213
- panelRef.current.style.maxHeight = `${panelRef.current.scrollHeight}px`;
1214
- }
1215
- }, [expanded, children, panelRef]);
1216
- return React__default.createElement("div", {
1217
- ref: ref
1218
- }, React__default.createElement("div", getHeaderProps({
1219
- 'aria-level': 2
1220
- }), React__default.createElement(StyledSubNavItemHeader, _extends$3({
1221
- isDark: isDark,
1222
- isLight: isLight,
1223
- isExpanded: expanded
1224
- }, getTriggerProps({
1225
- ...other,
1226
- role: null,
1227
- tabIndex: null,
1228
- value
1229
- }), {
1230
- type: "button"
1231
- }), React__default.createElement(React__default.Fragment, null, header, React__default.createElement(StyledSubNavItemIconWrapper, {
1232
- isExpanded: expanded
1233
- }, React__default.createElement(StyledSubNavItemIcon, null))))), React__default.createElement(StyledSubNavPanel, _extends$3({
1234
- isHidden: !expanded
1235
- }, getPanelProps({
1236
- ref: panelRef,
1237
- value
1238
- })), children));
1239
- });
1240
- CollapsibleSubNavItem.propTypes = {
1241
- header: PropTypes.any,
1242
- isExpanded: PropTypes.bool,
1243
- onChange: PropTypes.func
1244
- };
1245
- CollapsibleSubNavItem.displayName = 'CollapsibleSubNavItem';
1246
-
1247
- const SheetContext = createContext({
1248
- setIsCloseButtonPresent() {}
1249
- });
1250
- const useSheetContext = () => {
1251
- return useContext(SheetContext);
1252
- };
1253
-
1254
- function useFocusableMount(_ref) {
1255
- let {
1256
- isMounted,
1257
- focusOnMount,
1258
- restoreFocus,
1259
- targetRef
1260
- } = _ref;
1261
- const triggerRef = useRef();
1262
- useEffect(() => {
1263
- if (isMounted && focusOnMount && targetRef.current) {
1264
- triggerRef.current = activeElement();
1265
- targetRef.current.focus();
1266
- }
1267
- }, [isMounted, focusOnMount, targetRef]);
1268
- useEffect(() => {
1269
- if (!isMounted && restoreFocus && triggerRef.current) {
1270
- triggerRef.current.focus();
1271
- }
1272
- }, [isMounted, restoreFocus, triggerRef]);
1273
- }
1274
-
1275
- const SheetTitle = forwardRef((_ref, ref) => {
1276
- let {
1277
- id,
1278
- ...props
1279
- } = _ref;
1280
- const {
1281
- titleId
1282
- } = useSheetContext();
1283
- return React__default.createElement(StyledSheetTitle, _extends$3({
1284
- id: id || titleId,
1285
- ref: ref
1286
- }, props));
1287
- });
1288
- SheetTitle.displayName = 'Sheet.Title';
1289
- const Title = SheetTitle;
1290
-
1291
- const SheetDescription = forwardRef((_ref, ref) => {
1292
- let {
1293
- id,
1294
- ...props
1295
- } = _ref;
1296
- const {
1297
- descriptionId
1298
- } = useSheetContext();
1299
- return React__default.createElement(StyledSheetDescription, _extends$3({
1300
- id: id || descriptionId,
1301
- ref: ref
1302
- }, props));
1303
- });
1304
- SheetDescription.displayName = 'Sheet.Description';
1305
- const Description = SheetDescription;
1306
-
1307
- const SheetHeader = forwardRef((props, ref) => {
1308
- const {
1309
- isCloseButtonPresent
1310
- } = useSheetContext();
1311
- return React__default.createElement(StyledSheetHeader, _extends$3({
1312
- ref: ref,
1313
- isCloseButtonPresent: isCloseButtonPresent
1314
- }, props));
1315
- });
1316
- SheetHeader.displayName = 'Sheet.Header';
1317
- const Header = SheetHeader;
1318
-
1319
- const SheetBody = forwardRef((props, ref) => {
1320
- return React__default.createElement(StyledSheetBody, _extends$3({
1321
- ref: ref
1322
- }, props));
1323
- });
1324
- SheetBody.displayName = 'Sheet.Body';
1325
- const Body = SheetBody;
1326
-
1327
- const SheetFooter = forwardRef((props, ref) => {
1328
- return React__default.createElement(StyledSheetFooter, _extends$3({
1329
- ref: ref
1330
- }, props));
1331
- });
1332
- SheetFooter.displayName = 'Sheet.Footer';
1333
- const Footer = SheetFooter;
1334
-
1335
- const SheetFooterItem = forwardRef((props, ref) => {
1336
- return React__default.createElement(StyledSheetFooterItem, _extends$3({
1337
- ref: ref
1338
- }, props));
1339
- });
1340
- SheetFooterItem.displayName = 'Sheet.FooterItem';
1341
- const FooterItem = SheetFooterItem;
1342
-
1343
- var _path;
1344
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1345
- var SvgXStroke = function SvgXStroke(props) {
1346
- return /*#__PURE__*/React.createElement("svg", _extends({
1347
- xmlns: "http://www.w3.org/2000/svg",
1348
- width: 16,
1349
- height: 16,
1350
- focusable: "false",
1351
- viewBox: "0 0 16 16",
1352
- "aria-hidden": "true"
1353
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
1354
- stroke: "currentColor",
1355
- strokeLinecap: "round",
1356
- d: "M3 13L13 3m0 10L3 3"
1357
- })));
1358
- };
1359
-
1360
- const SheetClose = forwardRef((props, ref) => {
1361
- const {
1362
- setIsCloseButtonPresent
1363
- } = useSheetContext();
1364
- useEffect(() => {
1365
- setIsCloseButtonPresent(true);
1366
- return () => setIsCloseButtonPresent(false);
1367
- }, [setIsCloseButtonPresent]);
1368
- return React__default.createElement(StyledSheetClose, _extends$3({
1369
- "aria-label": "Close Sheet",
1370
- ref: ref
1371
- }, props), React__default.createElement(SvgXStroke, null));
1372
- });
1373
- SheetClose.displayName = 'Sheet.Close';
1374
- const Close = SheetClose;
1375
-
1376
- const SheetComponent = React__default.forwardRef((_ref, ref) => {
1377
- let {
1378
- id,
1379
- isOpen,
1380
- isAnimated,
1381
- focusOnMount,
1382
- restoreFocus,
1383
- placement,
1384
- size,
1385
- children,
1386
- ...props
1387
- } = _ref;
1388
- const sheetRef = useRef(null);
1389
- const seed = useUIDSeed();
1390
- const [isCloseButtonPresent, setIsCloseButtonPresent] = useState(false);
1391
- const idPrefix = useMemo(() => id || seed(`sheet_${'9.0.0-next.0'}`), [id, seed]);
1392
- const titleId = `${idPrefix}--title`;
1393
- const descriptionId = `${idPrefix}--description`;
1394
- const sheetContext = useMemo(() => ({
1395
- titleId,
1396
- descriptionId,
1397
- isCloseButtonPresent,
1398
- setIsCloseButtonPresent
1399
- }), [titleId, descriptionId, isCloseButtonPresent]);
1400
- useFocusableMount({
1401
- targetRef: sheetRef,
1402
- isMounted: isOpen,
1403
- focusOnMount,
1404
- restoreFocus
1405
- });
1406
- return React__default.createElement(SheetContext.Provider, {
1407
- value: sheetContext
1408
- }, React__default.createElement(StyledSheet, _extends$3({
1409
- isOpen: isOpen,
1410
- isAnimated: isAnimated,
1411
- placement: placement,
1412
- size: size,
1413
- tabIndex: -1,
1414
- id: idPrefix,
1415
- "aria-labelledby": titleId,
1416
- "aria-describedby": descriptionId,
1417
- ref: mergeRefs([sheetRef, ref])
1418
- }, props), React__default.createElement(StyledSheetWrapper, {
1419
- isOpen: isOpen,
1420
- isAnimated: isAnimated,
1421
- placement: placement,
1422
- size: size
1423
- }, children)));
1424
- });
1425
- SheetComponent.displayName = 'Sheet';
1426
- SheetComponent.propTypes = {
1427
- id: PropTypes.string,
1428
- isOpen: PropTypes.bool,
1429
- isAnimated: PropTypes.bool,
1430
- focusOnMount: PropTypes.bool,
1431
- restoreFocus: PropTypes.bool,
1432
- placement: PropTypes.oneOf(PLACEMENT),
1433
- size: PropTypes.string
1434
- };
1435
- SheetComponent.defaultProps = {
1436
- isAnimated: true,
1437
- placement: 'end',
1438
- size: '380px'
1439
- };
1440
- const Sheet = SheetComponent;
1441
- Sheet.Body = Body;
1442
- Sheet.Close = Close;
1443
- Sheet.Description = Description;
1444
- Sheet.Footer = Footer;
1445
- Sheet.FooterItem = FooterItem;
1446
- Sheet.Header = Header;
1447
- Sheet.Title = Title;
1448
-
1449
- export { Body$1 as Body, Chrome, CollapsibleSubNavItem, Content, Footer$1 as Footer, FooterItem$1 as FooterItem, Header$1 as Header, HeaderItem, HeaderItemIcon, HeaderItemText, HeaderItemWrapper, Main, Nav, NavItem, NavItemIcon, NavItemText, PRODUCT as PRODUCTS, Sheet, Sidebar, SkipNav, SubNav, SubNavItem, SubNavItemText };