@zendeskgarden/react-chrome 9.0.0-next.6 → 9.0.0-next.8
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 +13 -10
- package/dist/esm/elements/Chrome.js +94 -0
- package/dist/esm/elements/SkipNav.js +65 -0
- package/dist/esm/elements/body/Body.js +57 -0
- package/dist/esm/elements/body/Content.js +54 -0
- package/dist/esm/elements/body/Main.js +47 -0
- package/dist/esm/elements/footer/Footer.js +67 -0
- package/dist/esm/elements/footer/FooterItem.js +47 -0
- package/dist/esm/elements/header/Header.js +60 -0
- package/dist/esm/elements/header/HeaderItem.js +69 -0
- package/dist/esm/elements/header/HeaderItemIcon.js +66 -0
- package/dist/esm/elements/header/HeaderItemText.js +51 -0
- package/dist/esm/elements/header/HeaderItemWrapper.js +47 -0
- package/dist/esm/elements/nav/Nav.js +78 -0
- package/dist/esm/elements/nav/NavItem.js +101 -0
- package/dist/esm/elements/nav/NavItemIcon.js +66 -0
- package/dist/esm/elements/nav/NavItemText.js +58 -0
- package/dist/esm/elements/nav/NavList.js +55 -0
- package/dist/esm/elements/sheet/Sheet.js +128 -0
- package/dist/esm/elements/sheet/components/Body.js +50 -0
- package/dist/esm/elements/sheet/components/Close.js +60 -0
- package/dist/esm/elements/sheet/components/Description.js +59 -0
- package/dist/esm/elements/sheet/components/Footer.js +50 -0
- package/dist/esm/elements/sheet/components/FooterItem.js +50 -0
- package/dist/esm/elements/sheet/components/Header.js +55 -0
- package/dist/esm/elements/sheet/components/Title.js +59 -0
- package/dist/esm/index.js +24 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/link-stroke.svg.js +25 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
- package/dist/esm/styled/StyledChrome.js +22 -0
- package/dist/esm/styled/StyledSkipNav.js +46 -0
- package/dist/esm/styled/StyledSkipNavIcon.js +28 -0
- package/dist/esm/styled/body/StyledBody.js +22 -0
- package/dist/esm/styled/body/StyledContent.js +25 -0
- package/dist/esm/styled/body/StyledMain.js +22 -0
- package/dist/esm/styled/footer/StyledFooter.js +25 -0
- package/dist/esm/styled/footer/StyledFooterItem.js +22 -0
- package/dist/esm/styled/header/StyledBaseHeaderItem.js +35 -0
- package/dist/esm/styled/header/StyledHeader.js +31 -0
- package/dist/esm/styled/header/StyledHeaderItem.js +37 -0
- package/dist/esm/styled/header/StyledHeaderItemIcon.js +22 -0
- package/dist/esm/styled/header/StyledHeaderItemText.js +23 -0
- package/dist/esm/styled/header/StyledHeaderItemWrapper.js +24 -0
- package/dist/esm/styled/header/StyledLogoHeaderItem.js +47 -0
- package/dist/esm/styled/nav/StyledBaseNavItem.js +32 -0
- package/dist/esm/styled/nav/StyledBrandmarkNavItem.js +23 -0
- package/dist/esm/styled/nav/StyledLogoNavItem.js +48 -0
- package/dist/esm/styled/nav/StyledNav.js +34 -0
- package/dist/esm/styled/nav/StyledNavButton.js +65 -0
- package/dist/esm/styled/nav/StyledNavItemIcon.js +22 -0
- package/dist/esm/styled/nav/StyledNavItemText.js +34 -0
- package/dist/esm/styled/nav/StyledNavList.js +22 -0
- package/dist/esm/styled/nav/StyledNavListItem.js +22 -0
- package/dist/esm/styled/sheet/StyledSheet.js +41 -0
- package/dist/esm/styled/sheet/StyledSheetBody.js +22 -0
- package/dist/esm/styled/sheet/StyledSheetClose.js +34 -0
- package/dist/esm/styled/sheet/StyledSheetDescription.js +22 -0
- package/dist/esm/styled/sheet/StyledSheetFooter.js +22 -0
- package/dist/esm/styled/sheet/StyledSheetFooterItem.js +22 -0
- package/dist/esm/styled/sheet/StyledSheetHeader.js +23 -0
- package/dist/esm/styled/sheet/StyledSheetTitle.js +22 -0
- package/dist/esm/styled/sheet/StyledSheetWrapper.js +37 -0
- package/dist/esm/types/index.js +10 -0
- package/dist/esm/utils/useBodyContext.js +14 -0
- package/dist/esm/utils/useChromeContext.js +16 -0
- package/dist/esm/utils/useFocusableMount.js +31 -0
- package/dist/esm/utils/useNavContext.js +16 -0
- package/dist/esm/utils/useNavListContext.js +14 -0
- package/dist/esm/utils/useSheetContext.js +16 -0
- package/dist/index.cjs.js +209 -471
- package/dist/typings/elements/nav/Nav.d.ts +2 -0
- package/dist/typings/elements/{body/Sidebar.d.ts → nav/NavList.d.ts} +2 -2
- package/dist/typings/index.d.ts +1 -6
- package/dist/typings/styled/index.d.ts +3 -8
- package/dist/typings/styled/nav/StyledBaseNavItem.d.ts +1 -5
- package/dist/typings/styled/nav/StyledBrandmarkNavItem.d.ts +4 -5
- package/dist/typings/styled/nav/StyledLogoNavItem.d.ts +4 -5
- package/dist/typings/styled/nav/{StyledNavItem.d.ts → StyledNavButton.d.ts} +3 -1
- package/dist/typings/styled/{body/StyledSidebar.d.ts → nav/StyledNavList.d.ts} +1 -1
- package/dist/typings/styled/nav/StyledNavListItem.d.ts +10 -0
- package/dist/typings/types/index.d.ts +1 -24
- package/dist/typings/utils/useNavListContext.d.ts +13 -0
- package/package.json +5 -7
- package/dist/index.esm.js +0 -1473
- package/dist/typings/elements/subnav/CollapsibleSubNavItem.d.ts +0 -14
- package/dist/typings/elements/subnav/SubNav.d.ts +0 -19
- package/dist/typings/elements/subnav/SubNavItem.d.ts +0 -14
- package/dist/typings/elements/subnav/SubNavItemText.d.ts +0 -14
- package/dist/typings/styled/subnav/StyledSubNav.d.ts +0 -17
- package/dist/typings/styled/subnav/StyledSubNavItem.d.ts +0 -21
- package/dist/typings/styled/subnav/StyledSubNavItemHeader.d.ts +0 -14
- package/dist/typings/styled/subnav/StyledSubNavItemIcon.d.ts +0 -14
- package/dist/typings/styled/subnav/StyledSubNavItemText.d.ts +0 -11
- package/dist/typings/styled/subnav/StyledSubNavPanel.d.ts +0 -12
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColorV8, focusStyles } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'chrome.sheet_close';
|
|
11
|
+
const BASE_MULTIPLIERS = {
|
|
12
|
+
top: 2.5,
|
|
13
|
+
side: 2,
|
|
14
|
+
size: 10
|
|
15
|
+
};
|
|
16
|
+
const colorStyles = props => {
|
|
17
|
+
const backgroundColor = 'primaryHue';
|
|
18
|
+
const foregroundColor = 'neutralHue';
|
|
19
|
+
return css(["background-color:transparent;color:", ";&:hover{background-color:", ";color:", ";}", " &:active{transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;background-color:", ";color:", ";}"], getColorV8(foregroundColor, 600, props.theme), getColorV8(backgroundColor, 600, props.theme, 0.08), getColorV8(foregroundColor, 700, props.theme), focusStyles({
|
|
20
|
+
theme: props.theme
|
|
21
|
+
}), getColorV8(backgroundColor, 600, props.theme, 0.2), getColorV8(foregroundColor, 800, props.theme));
|
|
22
|
+
};
|
|
23
|
+
const StyledSheetClose = styled.button.attrs({
|
|
24
|
+
'data-garden-id': COMPONENT_ID,
|
|
25
|
+
'data-garden-version': '9.0.0-next.8'
|
|
26
|
+
}).withConfig({
|
|
27
|
+
displayName: "StyledSheetClose",
|
|
28
|
+
componentId: "sc-1ab02oq-0"
|
|
29
|
+
})(["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, props));
|
|
30
|
+
StyledSheetClose.defaultProps = {
|
|
31
|
+
theme: DEFAULT_THEME
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { BASE_MULTIPLIERS, StyledSheetClose };
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import styled from 'styled-components';
|
|
8
|
+
import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'chrome.sheet_description';
|
|
11
|
+
const StyledSheetDescription = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledSheetDescription",
|
|
16
|
+
componentId: "sc-1puglb6-0"
|
|
17
|
+
})(["line-height:", ";color:", ";", ";"], props => getLineHeight(props.theme.space.base * 4, props.theme.fontSizes.md), props => getColorV8('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledSheetDescription.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledSheetDescription };
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import styled from 'styled-components';
|
|
8
|
+
import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'chrome.sheet_footer';
|
|
11
|
+
const StyledSheetFooter = styled.footer.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledSheetFooter",
|
|
16
|
+
componentId: "sc-2cktos-0"
|
|
17
|
+
})(["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, props));
|
|
18
|
+
StyledSheetFooter.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledSheetFooter };
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'chrome.sheet_footer_item';
|
|
11
|
+
const StyledSheetFooterItem = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledSheetFooterItem",
|
|
16
|
+
componentId: "sc-r9ixh-0"
|
|
17
|
+
})(["", " ", ";"], props => `margin-${props.theme.rtl ? 'right' : 'left'}: ${props.theme.space.base * 5}px;`, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledSheetFooterItem.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledSheetFooterItem };
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import styled from 'styled-components';
|
|
8
|
+
import { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { BASE_MULTIPLIERS } from './StyledSheetClose.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'chrome.sheet_header';
|
|
12
|
+
const StyledSheetHeader = styled.header.attrs({
|
|
13
|
+
'data-garden-id': COMPONENT_ID,
|
|
14
|
+
'data-garden-version': '9.0.0-next.8'
|
|
15
|
+
}).withConfig({
|
|
16
|
+
displayName: "StyledSheetHeader",
|
|
17
|
+
componentId: "sc-o2ry8i-0"
|
|
18
|
+
})(["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));
|
|
19
|
+
StyledSheetHeader.defaultProps = {
|
|
20
|
+
theme: DEFAULT_THEME
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { StyledSheetHeader };
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import styled from 'styled-components';
|
|
8
|
+
import { getLineHeight, getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'chrome.sheet_title';
|
|
11
|
+
const StyledSheetTitle = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledSheetTitle",
|
|
16
|
+
componentId: "sc-1gogk75-0"
|
|
17
|
+
})(["line-height:", ";color:", ";font-weight:", ";", ";"], props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => getColorV8('foreground', 600 , props.theme), props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledSheetTitle.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledSheetTitle };
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'chrome.sheet_wrapper';
|
|
11
|
+
const StyledSheetWrapper = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.8'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledSheetWrapper",
|
|
16
|
+
componentId: "sc-f6x9zb-0"
|
|
17
|
+
})(["display:flex;position:relative;flex-direction:column;transform:", ";transition:", ";min-width:", ";", ";"], props => {
|
|
18
|
+
const translateValues = [-100, 100];
|
|
19
|
+
let translation = 'translateX(0%)';
|
|
20
|
+
if (props.isOpen) {
|
|
21
|
+
return translation;
|
|
22
|
+
}
|
|
23
|
+
if (props.theme.rtl) {
|
|
24
|
+
translateValues.reverse();
|
|
25
|
+
}
|
|
26
|
+
if (props.placement === 'end') {
|
|
27
|
+
translation = `translateX(${translateValues[1]}%)`;
|
|
28
|
+
} else if (props.placement === 'start') {
|
|
29
|
+
translation = `translateX(${translateValues[0]}%)`;
|
|
30
|
+
}
|
|
31
|
+
return translation;
|
|
32
|
+
}, props => props.isAnimated && 'transform 250ms ease-in-out', props => props.size, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
33
|
+
StyledSheetWrapper.defaultProps = {
|
|
34
|
+
theme: DEFAULT_THEME
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { StyledSheetWrapper };
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
const PLACEMENT = ['end', 'start'];
|
|
8
|
+
const PRODUCTS = ['chat', 'connect', 'explore', 'guide', 'message', 'support', 'talk'];
|
|
9
|
+
|
|
10
|
+
export { PLACEMENT, PRODUCTS };
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
import React__default, { useContext } from 'react';
|
|
8
|
+
|
|
9
|
+
const BodyContext = React__default.createContext(undefined);
|
|
10
|
+
const useBodyContext = () => {
|
|
11
|
+
return useContext(BodyContext);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { BodyContext, useBodyContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import React__default, { useContext } from 'react';
|
|
8
|
+
|
|
9
|
+
const ChromeContext = React__default.createContext({
|
|
10
|
+
hue: 'chromeHue'
|
|
11
|
+
});
|
|
12
|
+
const useChromeContext = () => {
|
|
13
|
+
return useContext(ChromeContext);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { ChromeContext, useChromeContext };
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
import { useRef, useEffect } from 'react';
|
|
8
|
+
import activeElement from 'dom-helpers/activeElement';
|
|
9
|
+
|
|
10
|
+
function useFocusableMount(_ref) {
|
|
11
|
+
let {
|
|
12
|
+
isMounted,
|
|
13
|
+
focusOnMount,
|
|
14
|
+
restoreFocus,
|
|
15
|
+
targetRef
|
|
16
|
+
} = _ref;
|
|
17
|
+
const triggerRef = useRef();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (isMounted && focusOnMount && targetRef.current) {
|
|
20
|
+
triggerRef.current = activeElement();
|
|
21
|
+
targetRef.current.focus();
|
|
22
|
+
}
|
|
23
|
+
}, [isMounted, focusOnMount, targetRef]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!isMounted && restoreFocus && triggerRef.current) {
|
|
26
|
+
triggerRef.current.focus();
|
|
27
|
+
}
|
|
28
|
+
}, [isMounted, restoreFocus, triggerRef]);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { useFocusableMount };
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import React__default, { useContext } from 'react';
|
|
8
|
+
|
|
9
|
+
const NavContext = React__default.createContext({
|
|
10
|
+
isExpanded: false
|
|
11
|
+
});
|
|
12
|
+
const useNavContext = () => {
|
|
13
|
+
return useContext(NavContext);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { NavContext, useNavContext };
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
import React__default, { useContext } from 'react';
|
|
8
|
+
|
|
9
|
+
const NavListContext = React__default.createContext(undefined);
|
|
10
|
+
const useNavListContext = () => {
|
|
11
|
+
return useContext(NavListContext);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { NavListContext, useNavListContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import { createContext, useContext } from 'react';
|
|
8
|
+
|
|
9
|
+
const SheetContext = createContext({
|
|
10
|
+
setIsCloseButtonPresent() {}
|
|
11
|
+
});
|
|
12
|
+
const useSheetContext = () => {
|
|
13
|
+
return useContext(SheetContext);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { SheetContext, useSheetContext };
|