@pega/cosmos-react-core 10.0.0-build.9.11 → 10.0.0-build.9.13
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/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +46 -3
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppNavigationPanel.d.ts.map +1 -1
- package/lib/components/AppShell/AppNavigationPanel.js +12 -3
- package/lib/components/AppShell/AppNavigationPanel.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +40 -10
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +8 -0
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +53 -3
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +50 -0
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +2 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js +2 -1
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/AppTopNav.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppTopNav.styles.js +5 -1
- package/lib/components/AppShell/AppTopNav.styles.js.map +1 -1
- package/lib/components/AppShell/DocumentTabs.styles.d.ts.map +1 -1
- package/lib/components/AppShell/DocumentTabs.styles.js +4 -2
- package/lib/components/AppShell/DocumentTabs.styles.js.map +1 -1
- package/lib/components/AppShell/HeaderActionButton.d.ts +20 -0
- package/lib/components/AppShell/HeaderActionButton.d.ts.map +1 -0
- package/lib/components/AppShell/HeaderActionButton.js +78 -0
- package/lib/components/AppShell/HeaderActionButton.js.map +1 -0
- package/lib/components/AppShell/Panel/Panel.d.ts +15 -0
- package/lib/components/AppShell/Panel/Panel.d.ts.map +1 -0
- package/lib/components/AppShell/Panel/Panel.js +80 -0
- package/lib/components/AppShell/Panel/Panel.js.map +1 -0
- package/lib/components/AppShell/Panel/Panel.styles.d.ts +188 -0
- package/lib/components/AppShell/Panel/Panel.styles.d.ts.map +1 -0
- package/lib/components/AppShell/Panel/Panel.styles.js +85 -0
- package/lib/components/AppShell/Panel/Panel.styles.js.map +1 -0
- package/lib/components/AppShell/Panel/Panel.test-ids.d.ts +2 -0
- package/lib/components/AppShell/Panel/Panel.test-ids.d.ts.map +1 -0
- package/lib/components/AppShell/Panel/Panel.test-ids.js +3 -0
- package/lib/components/AppShell/Panel/Panel.test-ids.js.map +1 -0
- package/lib/components/AppShell/Panel/Panel.types.d.ts +33 -0
- package/lib/components/AppShell/Panel/Panel.types.d.ts.map +1 -0
- package/lib/components/AppShell/Panel/Panel.types.js +2 -0
- package/lib/components/AppShell/Panel/Panel.types.js.map +1 -0
- package/lib/components/AppShell/Panel/PanelHeaderActions.d.ts +8 -0
- package/lib/components/AppShell/Panel/PanelHeaderActions.d.ts.map +1 -0
- package/lib/components/AppShell/Panel/PanelHeaderActions.js +17 -0
- package/lib/components/AppShell/Panel/PanelHeaderActions.js.map +1 -0
- package/lib/components/AppShell/Panel/index.d.ts +4 -0
- package/lib/components/AppShell/Panel/index.d.ts.map +1 -0
- package/lib/components/AppShell/Panel/index.js +4 -0
- package/lib/components/AppShell/Panel/index.js.map +1 -0
- package/lib/components/AppShell/Panel/usePanel.d.ts +12 -0
- package/lib/components/AppShell/Panel/usePanel.d.ts.map +1 -0
- package/lib/components/AppShell/Panel/usePanel.js +30 -0
- package/lib/components/AppShell/Panel/usePanel.js.map +1 -0
- package/lib/components/AppShell/TopNavDrawerProvider.d.ts +5 -1
- package/lib/components/AppShell/TopNavDrawerProvider.d.ts.map +1 -1
- package/lib/components/AppShell/TopNavDrawerProvider.js +18 -3
- package/lib/components/AppShell/TopNavDrawerProvider.js.map +1 -1
- package/lib/components/AppShell/TouchAppShell.d.ts +1 -1
- package/lib/components/AppShell/TouchAppShell.d.ts.map +1 -1
- package/lib/components/AppShell/TouchAppShell.js +34 -7
- package/lib/components/AppShell/TouchAppShell.js.map +1 -1
- package/lib/components/AppShell/TouchAppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/TouchAppShell.styles.js +10 -0
- package/lib/components/AppShell/TouchAppShell.styles.js.map +1 -1
- package/lib/components/AppShell/headerActionUtils.d.ts +12 -0
- package/lib/components/AppShell/headerActionUtils.d.ts.map +1 -0
- package/lib/components/AppShell/headerActionUtils.js +69 -0
- package/lib/components/AppShell/headerActionUtils.js.map +1 -0
- package/lib/components/AppShell/index.d.ts +2 -1
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts +12 -1
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js +22 -23
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Drawer/ResizeHandle.d.ts +9 -2
- package/lib/components/Drawer/ResizeHandle.d.ts.map +1 -1
- package/lib/components/Drawer/ResizeHandle.js +41 -17
- package/lib/components/Drawer/ResizeHandle.js.map +1 -1
- package/lib/components/Link/Link.d.ts +2 -0
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +1 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Signature/Signature.d.ts +28 -0
- package/lib/components/Signature/Signature.d.ts.map +1 -0
- package/lib/components/Signature/Signature.js +397 -0
- package/lib/components/Signature/Signature.js.map +1 -0
- package/lib/components/Signature/Signature.styles.d.ts +197 -0
- package/lib/components/Signature/Signature.styles.d.ts.map +1 -0
- package/lib/components/Signature/Signature.styles.js +119 -0
- package/lib/components/Signature/Signature.styles.js.map +1 -0
- package/lib/components/Signature/Signature.test-ids.d.ts +2 -0
- package/lib/components/Signature/Signature.test-ids.d.ts.map +1 -0
- package/lib/components/Signature/Signature.test-ids.js +3 -0
- package/lib/components/Signature/Signature.test-ids.js.map +1 -0
- package/lib/components/Signature/index.d.ts +4 -0
- package/lib/components/Signature/index.d.ts.map +1 -0
- package/lib/components/Signature/index.js +3 -0
- package/lib/components/Signature/index.js.map +1 -0
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +3 -1
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +23 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +23 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +24 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +23 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import Flex from '../../Flex';
|
|
3
|
+
import { defaultThemeProp } from '../../../theme';
|
|
4
|
+
import { readableHue } from '../../../styles/utils';
|
|
5
|
+
import { calculateFontSize } from '../../../styles';
|
|
6
|
+
import { resizeDrawerMinWidth } from '../../../styles/constants';
|
|
7
|
+
import { startPanelMaxWidth } from '../AppShell.styles';
|
|
8
|
+
const getBorderColor = (theme) => readableHue(theme.base.palette['border-line'], theme.base.palette['primary-background'], {
|
|
9
|
+
mode: 'both',
|
|
10
|
+
level: 'AANonText'
|
|
11
|
+
});
|
|
12
|
+
/** Inline-start panel; its fixed width comes from the Drawer size. */
|
|
13
|
+
export const StyledStartPanel = styled.div(({ theme }) => {
|
|
14
|
+
return css `
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
background: ${theme.base.palette['primary-background']};
|
|
18
|
+
height: auto;
|
|
19
|
+
inset-inline-start: 0;
|
|
20
|
+
transition-property: transform, box-shadow, opacity, inset-inline-start;
|
|
21
|
+
|
|
22
|
+
/* On a phone the panel covers the page but leaves the bottom navigation reachable, like the util drawers. */
|
|
23
|
+
inset-block-end: var(--appshell-bottom-offset, 0);
|
|
24
|
+
inset-block-start: var(--appshell-panel-top-offset, 0);
|
|
25
|
+
z-index: ${theme.base['z-index'].modal};
|
|
26
|
+
|
|
27
|
+
@media (width >= ${theme.base.breakpoints.sm}) {
|
|
28
|
+
inset-inline-start: var(--appshell-nav-width, 4rem);
|
|
29
|
+
|
|
30
|
+
/* Keep the docked panel below the navigation on larger screens. */
|
|
31
|
+
z-index: calc(${theme.base['z-index'].backdrop} - 3);
|
|
32
|
+
max-width: ${startPanelMaxWidth};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media (width >= ${theme.base.breakpoints.sm}) and (width < ${theme.base.breakpoints.md}) {
|
|
36
|
+
inset-inline-start: 0;
|
|
37
|
+
min-width: ${resizeDrawerMinWidth};
|
|
38
|
+
z-index: calc(${theme.base['z-index'].backdrop} - 1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (width >= ${theme.base.breakpoints.md}) {
|
|
42
|
+
box-shadow: none;
|
|
43
|
+
border-inline-end: 0.0625rem solid ${getBorderColor(theme)};
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
});
|
|
47
|
+
StyledStartPanel.defaultProps = defaultThemeProp;
|
|
48
|
+
export const StyledPanelHeading = styled.header(({ theme }) => {
|
|
49
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
50
|
+
return css `
|
|
51
|
+
display: grid;
|
|
52
|
+
grid-template-columns: 1fr auto 1fr;
|
|
53
|
+
align-items: center;
|
|
54
|
+
column-gap: ${theme.base.spacing};
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
padding: calc(2 * ${theme.base.spacing});
|
|
57
|
+
border-block-end: 0.0625rem solid ${getBorderColor(theme)};
|
|
58
|
+
|
|
59
|
+
/* On a phone the heading matches the compact heading of the util drawers. */
|
|
60
|
+
@media (width < ${theme.base.breakpoints.sm}) {
|
|
61
|
+
padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});
|
|
62
|
+
|
|
63
|
+
h2 {
|
|
64
|
+
font-size: ${fontSize.s};
|
|
65
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
66
|
+
line-height: 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
});
|
|
71
|
+
StyledPanelHeading.defaultProps = defaultThemeProp;
|
|
72
|
+
export const StyledPanelContent = styled(Flex) `
|
|
73
|
+
position: relative;
|
|
74
|
+
flex: 1;
|
|
75
|
+
min-height: 0;
|
|
76
|
+
overflow-y: auto;
|
|
77
|
+
--content-height-in-view: calc(
|
|
78
|
+
100dvh - var(--appshell-total-offset) + var(--document-tabs-height, 0rem) - var(
|
|
79
|
+
--user-action-panel-header-height,
|
|
80
|
+
0rem
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
`;
|
|
84
|
+
StyledPanelContent.defaultProps = defaultThemeProp;
|
|
85
|
+
//# sourceMappingURL=Panel.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.styles.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/Panel.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,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CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,GAAG,CAAA;;;;kBAIM,KAAK,CAAC,IAAI,CAAC,OAAO;;wBAEZ,KAAK,CAAC,IAAI,CAAC,OAAO;wCACF,cAAc,CAAC,KAAK,CAAC;;;sBAGvC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;iBAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,aAAa,KAAK,CAAC,IAAI,CAAC,OAAO;;;qBAG7C,QAAQ,CAAC,CAAC;uBACR,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;;GAI1D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;;;;;;CAW7C,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\n\nimport Flex from '../../Flex';\nimport type { DrawerProps } from '../../Drawer';\nimport { defaultThemeProp } from '../../../theme';\nimport { readableHue } from '../../../styles/utils';\nimport { calculateFontSize } from '../../../styles';\nimport { resizeDrawerMinWidth } from '../../../styles/constants';\nimport { startPanelMaxWidth } from '../AppShell.styles';\n\nconst getBorderColor = (theme: DefaultTheme) =>\n readableHue(theme.base.palette['border-line'], theme.base.palette['primary-background'], {\n mode: 'both',\n level: 'AANonText'\n });\n\n/** Inline-start panel; its fixed width comes from the Drawer size. */\nexport const StyledStartPanel = styled.div<DrawerProps>(({ theme }) => {\n return css`\n display: flex;\n flex-direction: column;\n background: ${theme.base.palette['primary-background']};\n height: auto;\n inset-inline-start: 0;\n transition-property: transform, box-shadow, opacity, inset-inline-start;\n\n /* On a phone the panel covers the page but leaves the bottom navigation reachable, like the util drawers. */\n inset-block-end: var(--appshell-bottom-offset, 0);\n inset-block-start: var(--appshell-panel-top-offset, 0);\n z-index: ${theme.base['z-index'].modal};\n\n @media (width >= ${theme.base.breakpoints.sm}) {\n inset-inline-start: var(--appshell-nav-width, 4rem);\n\n /* Keep the docked panel below the navigation on larger screens. */\n z-index: calc(${theme.base['z-index'].backdrop} - 3);\n max-width: ${startPanelMaxWidth};\n }\n\n @media (width >= ${theme.base.breakpoints.sm}) and (width < ${theme.base.breakpoints.md}) {\n inset-inline-start: 0;\n min-width: ${resizeDrawerMinWidth};\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n }\n\n @media (width >= ${theme.base.breakpoints.md}) {\n box-shadow: none;\n border-inline-end: 0.0625rem solid ${getBorderColor(theme)};\n }\n `;\n});\n\nStyledStartPanel.defaultProps = defaultThemeProp;\n\nexport const StyledPanelHeading = styled.header(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: grid;\n grid-template-columns: 1fr auto 1fr;\n align-items: center;\n column-gap: ${theme.base.spacing};\n flex-shrink: 0;\n padding: calc(2 * ${theme.base.spacing});\n border-block-end: 0.0625rem solid ${getBorderColor(theme)};\n\n /* On a phone the heading matches the compact heading of the util drawers. */\n @media (width < ${theme.base.breakpoints.sm}) {\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n\n h2 {\n font-size: ${fontSize.s};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n line-height: 1;\n }\n }\n `;\n});\n\nStyledPanelHeading.defaultProps = defaultThemeProp;\n\nexport const StyledPanelContent = styled(Flex)`\n position: relative;\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n --content-height-in-view: calc(\n 100dvh - var(--appshell-total-offset) + var(--document-tabs-height, 0rem) - var(\n --user-action-panel-header-height,\n 0rem\n )\n );\n`;\n\nStyledPanelContent.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.test-ids.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/Panel.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,2HAAkE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.test-ids.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/Panel.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC,CAAC","sourcesContent":["import { createTestIds } from '../../../utils';\n\nexport const getPanelTestIds = createTestIds('app-shell-panel', ['close', 'content'] as const);\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TestIdProp, WithAttributes } from '../../../types';
|
|
3
|
+
import type { DrawerProps } from '../../Drawer';
|
|
4
|
+
export interface PanelActionProps {
|
|
5
|
+
/** The display name of the action. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The name of the Cosmos Icon to render. */
|
|
8
|
+
icon?: string;
|
|
9
|
+
/** Click handler for the action. */
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
}
|
|
12
|
+
export type PanelProps = WithAttributes<'div', {
|
|
13
|
+
/** The content of the panel. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/** The heading of the panel. */
|
|
16
|
+
heading: string;
|
|
17
|
+
/** Places the content of the panel into a loading state. */
|
|
18
|
+
progress?: boolean;
|
|
19
|
+
/** Width of the panel. The page content is offset by the same width. */
|
|
20
|
+
width?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the user can resize the panel. The page content follows the panel width.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
resizable?: boolean;
|
|
26
|
+
/** Called when the close button is clicked or Escape is pressed. On phones, where the panel is modal, the close button renders even without it. */
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
/** Header actions; the first renders inline and the rest go into an overflow menu. */
|
|
29
|
+
actions?: PanelActionProps[];
|
|
30
|
+
/** Id of the header action that opened the panel, used for `aria-expanded`. */
|
|
31
|
+
actionId?: string;
|
|
32
|
+
}> & TestIdProp & Pick<DrawerProps, 'onBeforeOpen' | 'onAfterOpen' | 'onBeforeClose' | 'onAfterClose'>;
|
|
33
|
+
//# sourceMappingURL=Panel.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.types.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/Panel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,CACrC,KAAK,EACL;IACE,gCAAgC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mJAAmJ;IACnJ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sFAAsF;IACtF,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CACF,GACC,UAAU,GACV,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.types.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/Panel.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TestIdProp, WithAttributes } from '../../../types';\nimport type { DrawerProps } from '../../Drawer';\n\nexport interface PanelActionProps {\n /** The display name of the action. */\n name: string;\n /** The name of the Cosmos Icon to render. */\n icon?: string;\n /** Click handler for the action. */\n onClick: () => void;\n}\n\nexport type PanelProps = WithAttributes<\n 'div',\n {\n /** The content of the panel. */\n children?: ReactNode;\n /** The heading of the panel. */\n heading: string;\n /** Places the content of the panel into a loading state. */\n progress?: boolean;\n /** Width of the panel. The page content is offset by the same width. */\n width?: string;\n /**\n * Whether the user can resize the panel. The page content follows the panel width.\n * @default true\n */\n resizable?: boolean;\n /** Called when the close button is clicked or Escape is pressed. On phones, where the panel is modal, the close button renders even without it. */\n onClose?: () => void;\n /** Header actions; the first renders inline and the rest go into an overflow menu. */\n actions?: PanelActionProps[];\n /** Id of the header action that opened the panel, used for `aria-expanded`. */\n actionId?: string;\n }\n> &\n TestIdProp &\n Pick<DrawerProps, 'onBeforeOpen' | 'onAfterOpen' | 'onBeforeClose' | 'onAfterClose'>;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PanelActionProps } from './Panel.types';
|
|
2
|
+
interface PanelHeaderActionsProps {
|
|
3
|
+
actions?: PanelActionProps[];
|
|
4
|
+
}
|
|
5
|
+
/** The first action renders inline; any further actions collapse into an overflow menu. */
|
|
6
|
+
declare const PanelHeaderActions: ({ actions }: PanelHeaderActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default PanelHeaderActions;
|
|
8
|
+
//# sourceMappingURL=PanelHeaderActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelHeaderActions.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/PanelHeaderActions.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AASD,2FAA2F;AAC3F,QAAA,MAAM,kBAAkB,GAAI,aAAa,uBAAuB,mDAW/D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Actions from '../../Actions';
|
|
3
|
+
const toAction = ({ name, icon, onClick }) => ({
|
|
4
|
+
id: name,
|
|
5
|
+
text: name,
|
|
6
|
+
icon,
|
|
7
|
+
onClick: () => onClick()
|
|
8
|
+
});
|
|
9
|
+
/** The first action renders inline; any further actions collapse into an overflow menu. */
|
|
10
|
+
const PanelHeaderActions = ({ actions }) => {
|
|
11
|
+
if (!actions?.length)
|
|
12
|
+
return null;
|
|
13
|
+
const [primary, ...overflow] = actions;
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsx(Actions, { items: [toAction(primary)], compact: true }), overflow.length > 0 && _jsx(Actions, { items: overflow.map(toAction), menuAt: 1, compact: true })] }));
|
|
15
|
+
};
|
|
16
|
+
export default PanelHeaderActions;
|
|
17
|
+
//# sourceMappingURL=PanelHeaderActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelHeaderActions.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/PanelHeaderActions.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AASpC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAoB,EAAU,EAAE,CAAC,CAAC;IACvE,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,IAAI;IACV,IAAI;IACJ,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC;AAEH,2FAA2F;AAC3F,MAAM,kBAAkB,GAAG,CAAC,EAAE,OAAO,EAA2B,EAAE,EAAE;IAClE,IAAI,CAAC,OAAO,EAAE,MAAM;QAAE,OAAO,IAAI,CAAC;IAElC,MAAM,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC;IAEvC,OAAO,CACL,8BACE,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,SAAG,EAC9C,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,SAAG,IACpF,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import Actions from '../../Actions';\nimport type { Action } from '../../../types';\n\nimport type { PanelActionProps } from './Panel.types';\n\ninterface PanelHeaderActionsProps {\n actions?: PanelActionProps[];\n}\n\nconst toAction = ({ name, icon, onClick }: PanelActionProps): Action => ({\n id: name,\n text: name,\n icon,\n onClick: () => onClick()\n});\n\n/** The first action renders inline; any further actions collapse into an overflow menu. */\nconst PanelHeaderActions = ({ actions }: PanelHeaderActionsProps) => {\n if (!actions?.length) return null;\n\n const [primary, ...overflow] = actions;\n\n return (\n <>\n <Actions items={[toAction(primary)]} compact />\n {overflow.length > 0 && <Actions items={overflow.map(toAction)} menuAt={1} compact />}\n </>\n );\n};\n\nexport default PanelHeaderActions;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './Panel';\nexport { default as usePanel, panel1Id } from './usePanel';\nexport { getPanelTestIds } from './Panel.test-ids';\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PanelProps } from './Panel.types';
|
|
2
|
+
/** DOM id of the `panel1` start panel, referenced by `aria-controls` on its header action. */
|
|
3
|
+
export declare const panel1Id = "panel1";
|
|
4
|
+
/** Hosts the `panel1` start panel driven by the AppShell `panel1` prop. */
|
|
5
|
+
declare const usePanel: (panelProps: PanelProps | undefined,
|
|
6
|
+
/** Where focus goes on close when the element that opened the panel is gone. */
|
|
7
|
+
getFallbackFocusTarget?: () => HTMLElement | null) => {
|
|
8
|
+
panel: import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
panelOpen: boolean;
|
|
10
|
+
};
|
|
11
|
+
export default usePanel;
|
|
12
|
+
//# sourceMappingURL=usePanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/usePanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,8FAA8F;AAC9F,eAAO,MAAM,QAAQ,WAAW,CAAC;AAEjC,2EAA2E;AAC3E,QAAA,MAAM,QAAQ,GACZ,YAAY,UAAU,GAAG,SAAS;AAClC,gFAAgF;AAChF,yBAAyB,MAAM,WAAW,GAAG,IAAI;;;CAmClD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import Panel from './Panel';
|
|
4
|
+
/** DOM id of the `panel1` start panel, referenced by `aria-controls` on its header action. */
|
|
5
|
+
export const panel1Id = 'panel1';
|
|
6
|
+
/** Hosts the `panel1` start panel driven by the AppShell `panel1` prop. */
|
|
7
|
+
const usePanel = (panelProps,
|
|
8
|
+
/** Where focus goes on close when the element that opened the panel is gone. */
|
|
9
|
+
getFallbackFocusTarget) => {
|
|
10
|
+
// Retain the last props so the content stays visible during the close transition.
|
|
11
|
+
const [retainedPanel, setRetainedPanel] = useState();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (panelProps)
|
|
14
|
+
setRetainedPanel(panelProps);
|
|
15
|
+
}, [panelProps]);
|
|
16
|
+
// Mounted closed first so the panel transitions in and moves focus when it opens.
|
|
17
|
+
const isOpen = !!panelProps;
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setOpen(isOpen);
|
|
21
|
+
}, [isOpen]);
|
|
22
|
+
const currentPanel = panelProps ?? retainedPanel;
|
|
23
|
+
const panel = useMemo(() => currentPanel ? (_jsx(Panel, { ...currentPanel, id: panel1Id, open: open, getFallbackFocusTarget: getFallbackFocusTarget, onAfterClose: () => {
|
|
24
|
+
currentPanel.onAfterClose?.();
|
|
25
|
+
setRetainedPanel(undefined);
|
|
26
|
+
} })) : null, [currentPanel, open, getFallbackFocusTarget]);
|
|
27
|
+
return { panel, panelOpen: isOpen };
|
|
28
|
+
};
|
|
29
|
+
export default usePanel;
|
|
30
|
+
//# sourceMappingURL=usePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePanel.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Panel/usePanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,8FAA8F;AAC9F,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAEjC,2EAA2E;AAC3E,MAAM,QAAQ,GAAG,CACf,UAAkC;AAClC,gFAAgF;AAChF,sBAAiD,EACjD,EAAE;IACF,kFAAkF;IAClF,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,EAAc,CAAC;IACjE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU;YAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,kFAAkF;IAClF,MAAM,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC;IAC5B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,YAAY,GAAG,UAAU,IAAI,aAAa,CAAC;IAEjD,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CACH,YAAY,CAAC,CAAC,CAAC,CACb,KAAC,KAAK,OACA,YAAY,EAChB,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,IAAI,EACV,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,GAAG,EAAE;YACjB,YAAY,CAAC,YAAY,EAAE,EAAE,CAAC;YAC9B,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC9B,CAAC,GACD,CACH,CAAC,CAAC,CAAC,IAAI,EACV,CAAC,YAAY,EAAE,IAAI,EAAE,sBAAsB,CAAC,CAC7C,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\nimport type { PanelProps } from './Panel.types';\nimport Panel from './Panel';\n\n/** DOM id of the `panel1` start panel, referenced by `aria-controls` on its header action. */\nexport const panel1Id = 'panel1';\n\n/** Hosts the `panel1` start panel driven by the AppShell `panel1` prop. */\nconst usePanel = (\n panelProps: PanelProps | undefined,\n /** Where focus goes on close when the element that opened the panel is gone. */\n getFallbackFocusTarget?: () => HTMLElement | null\n) => {\n // Retain the last props so the content stays visible during the close transition.\n const [retainedPanel, setRetainedPanel] = useState<PanelProps>();\n useEffect(() => {\n if (panelProps) setRetainedPanel(panelProps);\n }, [panelProps]);\n\n // Mounted closed first so the panel transitions in and moves focus when it opens.\n const isOpen = !!panelProps;\n const [open, setOpen] = useState(false);\n useEffect(() => {\n setOpen(isOpen);\n }, [isOpen]);\n\n const currentPanel = panelProps ?? retainedPanel;\n\n const panel = useMemo(\n () =>\n currentPanel ? (\n <Panel\n {...currentPanel}\n id={panel1Id}\n open={open}\n getFallbackFocusTarget={getFallbackFocusTarget}\n onAfterClose={() => {\n currentPanel.onAfterClose?.();\n setRetainedPanel(undefined);\n }}\n />\n ) : null,\n [currentPanel, open, getFallbackFocusTarget]\n );\n\n return { panel, panelOpen: isOpen };\n};\n\nexport default usePanel;\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
interface TopNavDrawerProviderProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
+
/** Closes the drawer when it turns true; used while `panel1` is open. */
|
|
5
|
+
forceClosed?: boolean;
|
|
6
|
+
/** Called when the drawer opens. */
|
|
7
|
+
onOpen?: () => void;
|
|
4
8
|
}
|
|
5
|
-
export default function TopNavDrawerProvider({ children }: TopNavDrawerProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function TopNavDrawerProvider({ children, forceClosed, onOpen }: TopNavDrawerProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
10
|
export {};
|
|
7
11
|
//# sourceMappingURL=TopNavDrawerProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavDrawerProvider.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/TopNavDrawerProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,UAAU,yBAAyB;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"TopNavDrawerProvider.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/TopNavDrawerProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,UAAU,yBAAyB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,QAAQ,EACR,WAAmB,EACnB,MAAM,EACP,EAAE,yBAAyB,2CAyD3B"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import AppShellDrawer from './Drawer';
|
|
4
4
|
import { AppShellDrawerContext } from './AppShellContext';
|
|
5
|
-
export default function TopNavDrawerProvider({ children }) {
|
|
5
|
+
export default function TopNavDrawerProvider({ children, forceClosed = false, onOpen }) {
|
|
6
6
|
const [item, setItem] = useState(undefined);
|
|
7
7
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
8
|
+
const onOpenRef = useRef(onOpen);
|
|
9
|
+
onOpenRef.current = onOpen;
|
|
10
|
+
// A refresh only replaces the content of the item; it must not reopen a drawer closed in the meantime.
|
|
11
|
+
const refreshingRef = useRef(false);
|
|
8
12
|
useEffect(() => {
|
|
9
|
-
|
|
13
|
+
const refreshing = refreshingRef.current;
|
|
14
|
+
refreshingRef.current = false;
|
|
15
|
+
if (item && !refreshing)
|
|
10
16
|
setDrawerOpen(true);
|
|
11
17
|
}, [item]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (forceClosed)
|
|
20
|
+
setDrawerOpen(false);
|
|
21
|
+
}, [forceClosed]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (drawerOpen)
|
|
24
|
+
onOpenRef.current?.();
|
|
25
|
+
}, [drawerOpen]);
|
|
12
26
|
const ctxValue = useMemo(() => ({
|
|
13
27
|
drawerOpen,
|
|
14
28
|
openItemName: item?.name,
|
|
@@ -17,6 +31,7 @@ export default function TopNavDrawerProvider({ children }) {
|
|
|
17
31
|
setItem({ ...next });
|
|
18
32
|
},
|
|
19
33
|
refreshDrawer: (next) => {
|
|
34
|
+
refreshingRef.current = true;
|
|
20
35
|
setItem({ ...next });
|
|
21
36
|
}
|
|
22
37
|
}), [drawerOpen, item?.name]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavDrawerProvider.js","sourceRoot":"","sources":["../../../src/components/AppShell/TopNavDrawerProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TopNavDrawerProvider.js","sourceRoot":"","sources":["../../../src/components/AppShell/TopNavDrawerProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,cAAc,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAW1D,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,QAAQ,EACR,WAAW,GAAG,KAAK,EACnB,MAAM,EACoB;IAC1B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAA4B,SAAS,CAAC,CAAC;IACvE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;IAE3B,uGAAuG;IACvG,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC;QACzC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QAC9B,IAAI,IAAI,IAAI,CAAC,UAAU;YAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW;YAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU;YAAE,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;IACxC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,CAAC;QACL,UAAU;QACV,YAAY,EAAE,IAAI,EAAE,IAAI;QACxB,WAAW,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC;QACvC,UAAU,EAAE,CAAC,IAAmB,EAAE,EAAE;YAClC,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;QACvB,CAAC;QACD,aAAa,EAAE,CAAC,IAAmB,EAAE,EAAE;YACrC,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;YAC7B,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;QACvB,CAAC;KACF,CAAC,EACF,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,CACL,MAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,aAC5C,QAAQ,EACR,IAAI,IAAI,CACP,KAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,IAAI,CAAC,UAAU,EACxB,MAAM,EAAE,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,IAAI,EACtC,aAAa,EAAE,GAAG,EAAE;oBAClB,OAAO,CAAC,SAAS,CAAC,CAAC;oBACnB,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;gBACzB,CAAC,EACD,YAAY,EAAE,IAAI,CAAC,YAAY,GAC/B,CACH,IAC8B,CAClC,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\n\nimport AppShellDrawer from './Drawer';\nimport { AppShellDrawerContext } from './AppShellContext';\nimport type { UtilItemProps } from './AppShell.types';\n\ninterface TopNavDrawerProviderProps {\n children: ReactNode;\n /** Closes the drawer when it turns true; used while `panel1` is open. */\n forceClosed?: boolean;\n /** Called when the drawer opens. */\n onOpen?: () => void;\n}\n\nexport default function TopNavDrawerProvider({\n children,\n forceClosed = false,\n onOpen\n}: TopNavDrawerProviderProps) {\n const [item, setItem] = useState<UtilItemProps | undefined>(undefined);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const onOpenRef = useRef(onOpen);\n onOpenRef.current = onOpen;\n\n // A refresh only replaces the content of the item; it must not reopen a drawer closed in the meantime.\n const refreshingRef = useRef(false);\n\n useEffect(() => {\n const refreshing = refreshingRef.current;\n refreshingRef.current = false;\n if (item && !refreshing) setDrawerOpen(true);\n }, [item]);\n\n useEffect(() => {\n if (forceClosed) setDrawerOpen(false);\n }, [forceClosed]);\n\n useEffect(() => {\n if (drawerOpen) onOpenRef.current?.();\n }, [drawerOpen]);\n\n const ctxValue = useMemo(\n () => ({\n drawerOpen,\n openItemName: item?.name,\n closeDrawer: () => setDrawerOpen(false),\n openDrawer: (next: UtilItemProps) => {\n setItem({ ...next });\n },\n refreshDrawer: (next: UtilItemProps) => {\n refreshingRef.current = true;\n setItem({ ...next });\n }\n }),\n [drawerOpen, item?.name]\n );\n\n return (\n <AppShellDrawerContext.Provider value={ctxValue}>\n {children}\n {item && (\n <AppShellDrawer\n drawerOpen={drawerOpen}\n setDrawerOpen={setDrawerOpen}\n content={item.drawerView}\n header={item.drawerHeader || item.name}\n onDrawerClose={() => {\n setItem(undefined);\n item.onDrawerClose?.();\n }}\n onDrawerOpen={item.onDrawerOpen}\n />\n )}\n </AppShellDrawerContext.Provider>\n );\n}\n"]}
|
|
@@ -7,7 +7,7 @@ export interface TouchAppShellProps extends AppShellProps {
|
|
|
7
7
|
content: ReactNode;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, searchInput, searchLabel, caseTypes, links, cases, agent, utils, utilsList, operator, notifications, headerUtils, helpMenu, shareApp, banners, progress, main, bottomTouchPanel, documentTabs, navId, restProps }: TouchAppShellProps & {
|
|
10
|
+
export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, searchInput, searchLabel, caseTypes, links, cases, agent, utils, utilsList, operator, notifications, headerUtils, helpMenu, shareApp, banners, progress, main, bottomTouchPanel, documentTabs, headerActions, panel1, popover, navId, restProps }: TouchAppShellProps & {
|
|
11
11
|
searchLabel: string;
|
|
12
12
|
utilsList: (UtilItemProps | ReactElement)[];
|
|
13
13
|
navId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchAppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TouchAppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAc,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAyCjE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIrE,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,SAAS,CAAC;KACpB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,OAAO,EACP,eAAe,EACf,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,EACV,EAAE,kBAAkB,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,aAAa,GAAG,YAAY,CAAC,EAAE,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,2CAgUA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { Alert } from '../Badges';
|
|
4
4
|
import Drawer from '../Drawer';
|
|
5
5
|
import Flex from '../Flex';
|
|
@@ -14,10 +14,11 @@ import AppTopNav from './AppTopNav';
|
|
|
14
14
|
import DocumentTabs, { getTabElementId, getTabPanelId } from './DocumentTabs';
|
|
15
15
|
import { StyledDocumentTabPanel } from './DocumentTabs.styles';
|
|
16
16
|
import TopNavDrawerProvider from './TopNavDrawerProvider';
|
|
17
|
+
import { usePanel } from './Panel';
|
|
17
18
|
import { menuButtonWidth, StyledAppMain, StyledBannerRegion, AppShellGlobalStyle } from './AppShell.styles';
|
|
18
19
|
import { TouchAppShellGlobalStyle, StyledMainTouchAppShell, StyledSplitViewPanel, StyledPortalTouchDialog, StyledMobileMoreMenuButton, StyledMobileMoreMenu, StyledMobileNav } from './TouchAppShell.styles';
|
|
19
20
|
import AppShellContext from './AppShellContext';
|
|
20
|
-
export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, searchInput, searchLabel, caseTypes, links, cases, agent, utils, utilsList, operator, notifications, headerUtils, helpMenu, shareApp, banners, progress, main, bottomTouchPanel, documentTabs, navId, restProps }) {
|
|
21
|
+
export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, searchInput, searchLabel, caseTypes, links, cases, agent, utils, utilsList, operator, notifications, headerUtils, helpMenu, shareApp, banners, progress, main, bottomTouchPanel, documentTabs, headerActions, panel1, popover, navId, restProps }) {
|
|
21
22
|
const t = useI18n();
|
|
22
23
|
const theme = useTheme();
|
|
23
24
|
const { previewActive, setPreviewActive } = usePreviewManager();
|
|
@@ -33,6 +34,27 @@ export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, se
|
|
|
33
34
|
const [headerEl, setHeaderEl] = useElement();
|
|
34
35
|
const focusedImperatively = useRef(false);
|
|
35
36
|
const [searchContainerEl, setSearchContainerEl] = useState(null);
|
|
37
|
+
const moreButtonRef = useRef(null);
|
|
38
|
+
// A panel opened from a util in the More menu has no trigger left once that menu closes.
|
|
39
|
+
const returnFocusToMore = useCallback(() => moreButtonRef.current, []);
|
|
40
|
+
const { panel: panel1Element, panelOpen: panel1Open } = usePanel(panel1, returnFocusToMore);
|
|
41
|
+
// Panel1 replaces the util drawer and the mobile navigation menu.
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!panel1Open)
|
|
44
|
+
return;
|
|
45
|
+
setDrawerOpen(false);
|
|
46
|
+
setMobileNavOpen(false);
|
|
47
|
+
}, [panel1Open]);
|
|
48
|
+
// Opening a util while panel1 is open makes the consumer close panel1.
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (drawerOpen && panel1Open)
|
|
51
|
+
panel1?.onClose?.();
|
|
52
|
+
}, [drawerOpen]);
|
|
53
|
+
// The phone navigation stays visible beside panel1, so opening its menu makes the consumer close panel1.
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (mobileNavOpen && panel1Open)
|
|
56
|
+
panel1?.onClose?.();
|
|
57
|
+
}, [mobileNavOpen]);
|
|
36
58
|
const mobileAppShellContext = useMemo(() => ({
|
|
37
59
|
...appShellContext,
|
|
38
60
|
navOpen: mobileNavOpen,
|
|
@@ -47,7 +69,8 @@ export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, se
|
|
|
47
69
|
isMobileNav,
|
|
48
70
|
isTopBar: isSmallOrAbove,
|
|
49
71
|
previewActive,
|
|
50
|
-
setPreviewActive
|
|
72
|
+
setPreviewActive,
|
|
73
|
+
startPanelOpen: panel1Open
|
|
51
74
|
}), [
|
|
52
75
|
appShellContext,
|
|
53
76
|
headerEl,
|
|
@@ -58,7 +81,8 @@ export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, se
|
|
|
58
81
|
isMobileNav,
|
|
59
82
|
previewActive,
|
|
60
83
|
setPreviewActive,
|
|
61
|
-
setSearchContainerEl
|
|
84
|
+
setSearchContainerEl,
|
|
85
|
+
panel1Open
|
|
62
86
|
]);
|
|
63
87
|
useEffect(() => {
|
|
64
88
|
if (!isSmallOrAbove && agent && agent.active === false) {
|
|
@@ -116,12 +140,15 @@ export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, se
|
|
|
116
140
|
resizeObserver.observe(document.documentElement);
|
|
117
141
|
return () => resizeObserver.disconnect();
|
|
118
142
|
}, [mobileHeaderEl, caseTypes?.length, theme]);
|
|
119
|
-
const touchNav = !isSmallOrAbove && (_jsxs(_Fragment, { children: [_jsxs(StyledMobileNav, { hasBottomTouchPanel: !isSmallOrAbove && !!agent && bottomPanelOpen, container: { alignItems: 'center', gap: 0.25 }, ref: setMobileHeaderEl, "data-app-region": true, onClick: () => setMobileNavOpen(false), children: [caseTypes && caseTypes.length > 0 && _jsx(CaseTypes, { caseTypes: caseTypes, mobileNavBar: true }), links && _jsx(Links, { links: links.slice(0, mobileNavLinksCount), mobileNavBar: true }), _jsxs(StyledMobileMoreMenuButton, { variant: 'simple', onClick: (e) => {
|
|
143
|
+
const touchNav = !isSmallOrAbove && (_jsxs(_Fragment, { children: [_jsxs(StyledMobileNav, { hasBottomTouchPanel: !isSmallOrAbove && !!agent && bottomPanelOpen, container: { alignItems: 'center', gap: 0.25 }, ref: setMobileHeaderEl, "data-app-region": true, onClick: () => setMobileNavOpen(false), children: [caseTypes && caseTypes.length > 0 && _jsx(CaseTypes, { caseTypes: caseTypes, mobileNavBar: true }), links && _jsx(Links, { links: links.slice(0, mobileNavLinksCount), mobileNavBar: true }), _jsxs(StyledMobileMoreMenuButton, { ref: moreButtonRef, variant: 'simple', onClick: (e) => {
|
|
120
144
|
setMobileNavOpen(prev => !prev);
|
|
121
145
|
e.stopPropagation();
|
|
122
146
|
}, label: t('app_shell_more'), icon: true, "aria-expanded": mobileNavOpen, "aria-controls": navId, children: [_jsx(Icon, { name: 'bars' }), !mobileNavOpen &&
|
|
123
147
|
utilsList.some(item => (isValidElement(item) ? false : !!item.count)) && (_jsx(Alert, { variant: 'urgent' })), _jsx("span", { children: t('app_shell_more') })] })] }), _jsx(Drawer, { open: mobileNavOpen, position: 'fixed', placement: 'bottom', size: '100dvh', nullWhenClosed: true, children: _jsx(Flex, { ...restProps, container: { direction: 'column', justify: 'between' }, id: navId, as: StyledMobileMoreMenu, "aria-label": t('app_shell_main_navigation_label'), children: _jsx(AppNavigationPanel, { appInfo: appInfo, navState: 'open', searchInput: searchInput, searchLabel: searchLabel, links: links?.slice(mobileNavLinksCount), cases: cases, utils: utilsList, agent: navigationAgent }) }) })] }));
|
|
124
|
-
return (_jsx(AppShellContext.Provider, { value: mobileAppShellContext, children: _jsxs(_Fragment, { children: [isSmallOrAbove && (_jsx(AppHeader, { ...appInfo, contextSwitcher: contextSwitcher, searchInput: searchInput, searchLabel: searchLabel, searchPage: searchPage, operator: operator, notifications: notifications, headerUtils: headerUtils, helpMenu: helpMenu, shareApp: shareApp,
|
|
148
|
+
return (_jsx(AppShellContext.Provider, { value: mobileAppShellContext, children: _jsxs(_Fragment, { children: [isSmallOrAbove && (_jsx(AppHeader, { ...appInfo, contextSwitcher: contextSwitcher, searchInput: searchInput, searchLabel: searchLabel, searchPage: searchPage, operator: operator, notifications: notifications, headerUtils: headerUtils, helpMenu: helpMenu, shareApp: shareApp, headerActions: headerActions, panel1: panel1, popover: popover, ref: setHeaderEl })), isSmallOrAbove ? (_jsx(TopNavDrawerProvider, { forceClosed: panel1Open, onOpen: () => {
|
|
149
|
+
if (panel1Open)
|
|
150
|
+
panel1?.onClose?.();
|
|
151
|
+
}, children: _jsx(AppTopNav, { appInfo: appInfo, caseTypes: caseTypes, links: links, cases: cases, agent: navigationAgent, utils: utils, searchInput: searchInput, searchPage: searchPage, searchLabel: searchLabel }) })) : (touchNav), documentTabs && _jsx(DocumentTabs, { ...documentTabs }), (() => {
|
|
125
152
|
const mainRegion = (_jsxs(StyledAppMain, { previewActive: previewActive, isTopBar: isSmallOrAbove, hasBottomTouchPanel: !isSmallOrAbove && !!agent && bottomPanelOpen, hasDocumentTabs: !!documentTabs, "aria-busy": !!progress, "data-app-region": true, children: [_jsx(Progress, { visible: !!progress, placement: 'local', message: typeof progress === 'string' ? progress : t('loading') }), banners && _jsx(StyledBannerRegion, { children: banners }), main] }));
|
|
126
153
|
const touchMainRegion = isMobileNav ? (_jsx(StyledMainTouchAppShell, { active: !!agent && bottomPanelOpen, children: mainRegion })) : (mainRegion);
|
|
127
154
|
if (!documentTabs)
|
|
@@ -129,6 +156,6 @@ export default function TouchAppShell({ appInfo, contextSwitcher, searchPage, se
|
|
|
129
156
|
return (_jsx(StyledDocumentTabPanel, { role: 'tabpanel', id: documentTabs.currentTabId ? getTabPanelId(documentTabs.currentTabId) : undefined, "aria-labelledby": documentTabs.currentTabId ? getTabElementId(documentTabs.currentTabId) : undefined, tabIndex: 0, children: touchMainRegion }));
|
|
130
157
|
})(), _jsx(StyledSplitViewPanel, { active: !isSmallOrAbove && !!agent && bottomPanelOpen, children: !isSmallOrAbove && bottomTouchPanel && (_jsx(StyledPortalTouchDialog, { open: bottomPanelOpen, heading: bottomTouchPanel.heading, outerClickAction: 'reset-size', onDismiss: () => {
|
|
131
158
|
setBottomPanelOpen(false);
|
|
132
|
-
}, size: 'full-compact', children: bottomTouchPanel.content })) }), _jsx(AppShellGlobalStyle, { isTopBar: isSmallOrAbove, showAppHeader: isSmallOrAbove, hasDocumentTabs: !!documentTabs, isTouchDevice: true, isExtraSmallScreen: !isSmallOrAbove, navOpen: mobileNavOpen }), _jsx(TouchAppShellGlobalStyle, { hasBottomTouchPanel: !isSmallOrAbove && !!agent && bottomPanelOpen, isMobileNav: isMobileNav })] }) }));
|
|
159
|
+
}, size: 'full-compact', children: bottomTouchPanel.content })) }), panel1Element, _jsx(AppShellGlobalStyle, { isTopBar: isSmallOrAbove, showAppHeader: isSmallOrAbove, hasDocumentTabs: !!documentTabs, isTouchDevice: true, isExtraSmallScreen: !isSmallOrAbove, navOpen: mobileNavOpen, startPanelOpen: panel1Open, startPanelWidth: panel1?.width }), _jsx(TouchAppShellGlobalStyle, { hasBottomTouchPanel: !isSmallOrAbove && !!agent && bottomPanelOpen, isMobileNav: isMobileNav })] }) }));
|
|
133
160
|
}
|
|
134
161
|
//# sourceMappingURL=TouchAppShell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchAppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1F,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,kBAAkB,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,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,EACvB,KAAC,mBAAmB,IAClB,QAAQ,EAAE,cAAc,EACxB,aAAa,EAAE,cAAc,EAC7B,eAAe,EAAE,CAAC,CAAC,YAAY,EAC/B,aAAa,QACb,kBAAkB,EAAE,CAAC,cAAc,EACnC,OAAO,EAAE,aAAa,GACtB,EACF,KAAC,wBAAwB,IACvB,mBAAmB,EAAE,CAAC,cAAc,IAAI,CAAC,CAAC,KAAK,IAAI,eAAe,EAClE,WAAW,EAAE,WAAW,GACxB,IACD,GACsB,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { MouseEvent, ReactElement, ReactNode } from 'react';\n\nimport { Alert } from '../Badges';\nimport Drawer from '../Drawer';\nimport Flex from '../Flex';\nimport Icon from '../Icon';\nimport {\n useBreakpoint,\n useElement,\n useEscape,\n useI18n,\n usePreviewManager,\n useScrollToggle,\n useTheme\n} from '../../hooks';\nimport { debounce, isValidElement } from '../../utils';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Progress from '../Progress';\n\nimport AppNavigationPanel, { CaseTypes, Links } from './AppNavigationPanel';\nimport AppHeader from './AppHeader';\nimport AppTopNav from './AppTopNav';\nimport DocumentTabs, { getTabElementId, getTabPanelId } from './DocumentTabs';\nimport { StyledDocumentTabPanel } from './DocumentTabs.styles';\nimport TopNavDrawerProvider from './TopNavDrawerProvider';\nimport {\n menuButtonWidth,\n StyledAppMain,\n StyledBannerRegion,\n AppShellGlobalStyle\n} from './AppShell.styles';\nimport {\n TouchAppShellGlobalStyle,\n StyledMainTouchAppShell,\n StyledSplitViewPanel,\n StyledPortalTouchDialog,\n StyledMobileMoreMenuButton,\n StyledMobileMoreMenu,\n StyledMobileNav\n} from './TouchAppShell.styles';\nimport type { AppShellProps, UtilItemProps } from './AppShell.types';\nimport AppShellContext from './AppShellContext';\nimport type { AppShellContextValue } from './AppShellContext';\n\nexport interface TouchAppShellProps extends AppShellProps {\n /** Optional bottom panel rendered by the touch app shell. */\n bottomTouchPanel?: {\n heading: string;\n content: ReactNode;\n };\n}\n\nexport default function TouchAppShell({\n appInfo,\n contextSwitcher,\n searchPage,\n searchInput,\n searchLabel,\n caseTypes,\n links,\n cases,\n agent,\n utils,\n utilsList,\n operator,\n notifications,\n headerUtils,\n helpMenu,\n shareApp,\n banners,\n progress,\n main,\n bottomTouchPanel,\n documentTabs,\n navId,\n restProps\n}: TouchAppShellProps & {\n searchLabel: string;\n utilsList: (UtilItemProps | ReactElement)[];\n navId: string;\n restProps: Record<string, unknown>;\n}) {\n const t = useI18n();\n const theme = useTheme();\n const { previewActive, setPreviewActive } = usePreviewManager();\n const { disableScroll, enableScroll } = useScrollToggle();\n const appShellContext = useContext(AppShellContext);\n const isSmallOrAbove = useBreakpoint('sm');\n const isMobileNav = !isSmallOrAbove;\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [bottomPanelOpen, setBottomPanelOpen] = useState(false);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [mobileNavLinksCount, setMobileNavLinksCount] = useState(0);\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const focusedImperatively = useRef(false);\n const [searchContainerEl, setSearchContainerEl] = useState<HTMLElement | null>(null);\n const mobileAppShellContext = useMemo<AppShellContextValue>(\n () => ({\n ...appShellContext,\n navOpen: mobileNavOpen,\n drawerOpen,\n setDrawerOpen,\n navState: openCloseStates.high,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl,\n appHeaderEl: headerEl || mobileHeaderEl,\n searchContainerEl,\n setSearchContainerEl,\n isMobileNav,\n isTopBar: isSmallOrAbove,\n previewActive,\n setPreviewActive\n }),\n [\n appShellContext,\n headerEl,\n mobileHeaderEl,\n mobileNavOpen,\n drawerOpen,\n searchContainerEl,\n isMobileNav,\n previewActive,\n setPreviewActive,\n setSearchContainerEl\n ]\n );\n\n useEffect(() => {\n if (!isSmallOrAbove && agent && agent.active === false) {\n setBottomPanelOpen(false);\n }\n }, [agent?.active, isSmallOrAbove]);\n\n useEffect(() => {\n const ac = new AbortController();\n window.navigation.addEventListener(\n 'navigate',\n () => {\n if (mobileNavOpen) {\n setMobileNavOpen(false);\n }\n },\n {\n signal: ac.signal\n }\n );\n\n return () => {\n ac.abort();\n };\n }, [mobileNavOpen]);\n\n const navigationAgent = agent\n ? {\n ...agent,\n active: bottomPanelOpen,\n onClick: (event: MouseEvent<HTMLElement>) => {\n setBottomPanelOpen(true);\n setMobileNavOpen(false);\n\n if (isSmallOrAbove || (!bottomPanelOpen && !agent.active)) {\n agent.onClick?.(event);\n }\n }\n }\n : undefined;\n useEffect(() => {\n if (mobileNavOpen) disableScroll();\n else enableScroll();\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n useEscape(() => setMobileNavOpen(false));\n\n useLayoutEffect(() => {\n if (!mobileHeaderEl) return;\n\n const resizeObserver = new ResizeObserver(\n debounce(() => {\n const screenWidth = document.documentElement.clientWidth;\n const regionsPaddingInlinePixels =\n 2 *\n Number.parseInt(\n window.getComputedStyle(mobileHeaderEl).getPropertyValue('padding-inline-start'),\n 10\n );\n const availableWidth = screenWidth * 0.9 - regionsPaddingInlinePixels;\n setMobileNavLinksCount(\n Math.max(\n Math.floor(availableWidth / menuButtonWidth(theme)) - (caseTypes?.length ? 2 : 1),\n 0\n )\n );\n }, 0)\n );\n\n resizeObserver.observe(document.documentElement);\n return () => resizeObserver.disconnect();\n }, [mobileHeaderEl, caseTypes?.length, theme]);\n\n const touchNav = !isSmallOrAbove && (\n <>\n <StyledMobileNav\n hasBottomTouchPanel={!isSmallOrAbove && !!agent && bottomPanelOpen}\n container={{ alignItems: 'center', gap: 0.25 }}\n ref={setMobileHeaderEl}\n data-app-region\n onClick={() => setMobileNavOpen(false)}\n >\n {caseTypes && caseTypes.length > 0 && <CaseTypes caseTypes={caseTypes} mobileNavBar />}\n {links && <Links links={links.slice(0, mobileNavLinksCount)} mobileNavBar />}\n <StyledMobileMoreMenuButton\n variant='simple'\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n setMobileNavOpen(prev => !prev);\n e.stopPropagation();\n }}\n label={t('app_shell_more')}\n icon\n aria-expanded={mobileNavOpen}\n aria-controls={navId}\n >\n <Icon name='bars' />\n {!mobileNavOpen &&\n utilsList.some(item => (isValidElement(item) ? false : !!item.count)) && (\n <Alert variant='urgent' />\n )}\n <span>{t('app_shell_more')}</span>\n </StyledMobileMoreMenuButton>\n </StyledMobileNav>\n <Drawer open={mobileNavOpen} position='fixed' placement='bottom' size='100dvh' nullWhenClosed>\n <Flex\n {...restProps}\n container={{ direction: 'column', justify: 'between' }}\n id={navId}\n as={StyledMobileMoreMenu}\n aria-label={t('app_shell_main_navigation_label')}\n >\n <AppNavigationPanel\n appInfo={appInfo}\n navState='open'\n searchInput={searchInput}\n searchLabel={searchLabel}\n links={links?.slice(mobileNavLinksCount)}\n cases={cases}\n utils={utilsList}\n agent={navigationAgent}\n />\n </Flex>\n </Drawer>\n </>\n );\n\n return (\n <AppShellContext.Provider value={mobileAppShellContext}>\n <>\n {isSmallOrAbove && (\n <AppHeader\n {...appInfo}\n contextSwitcher={contextSwitcher}\n searchInput={searchInput}\n searchLabel={searchLabel}\n searchPage={searchPage}\n operator={operator}\n notifications={notifications}\n headerUtils={headerUtils}\n helpMenu={helpMenu}\n shareApp={shareApp}\n ref={setHeaderEl}\n />\n )}\n {isSmallOrAbove ? (\n <TopNavDrawerProvider>\n <AppTopNav\n appInfo={appInfo}\n caseTypes={caseTypes}\n links={links}\n cases={cases}\n agent={navigationAgent}\n utils={utils}\n searchInput={searchInput}\n searchPage={searchPage}\n searchLabel={searchLabel}\n />\n </TopNavDrawerProvider>\n ) : (\n touchNav\n )}\n {documentTabs && <DocumentTabs {...documentTabs} />}\n {(() => {\n const mainRegion = (\n <StyledAppMain\n previewActive={previewActive}\n isTopBar={isSmallOrAbove}\n hasBottomTouchPanel={!isSmallOrAbove && !!agent && bottomPanelOpen}\n hasDocumentTabs={!!documentTabs}\n aria-busy={!!progress}\n data-app-region\n >\n <Progress\n visible={!!progress}\n placement='local'\n message={typeof progress === 'string' ? progress : t('loading')}\n />\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n );\n const touchMainRegion = isMobileNav ? (\n <StyledMainTouchAppShell active={!!agent && bottomPanelOpen}>\n {mainRegion}\n </StyledMainTouchAppShell>\n ) : (\n mainRegion\n );\n if (!documentTabs) return touchMainRegion;\n return (\n <StyledDocumentTabPanel\n role='tabpanel'\n id={documentTabs.currentTabId ? getTabPanelId(documentTabs.currentTabId) : undefined}\n aria-labelledby={\n documentTabs.currentTabId ? getTabElementId(documentTabs.currentTabId) : undefined\n }\n tabIndex={0}\n >\n {touchMainRegion}\n </StyledDocumentTabPanel>\n );\n })()}\n <StyledSplitViewPanel active={!isSmallOrAbove && !!agent && bottomPanelOpen}>\n {!isSmallOrAbove && bottomTouchPanel && (\n <StyledPortalTouchDialog\n open={bottomPanelOpen}\n heading={bottomTouchPanel.heading}\n outerClickAction='reset-size'\n onDismiss={() => {\n setBottomPanelOpen(false);\n }}\n size='full-compact'\n >\n {bottomTouchPanel.content}\n </StyledPortalTouchDialog>\n )}\n </StyledSplitViewPanel>\n <AppShellGlobalStyle\n isTopBar={isSmallOrAbove}\n showAppHeader={isSmallOrAbove}\n hasDocumentTabs={!!documentTabs}\n isTouchDevice\n isExtraSmallScreen={!isSmallOrAbove}\n navOpen={mobileNavOpen}\n />\n <TouchAppShellGlobalStyle\n hasBottomTouchPanel={!isSmallOrAbove && !!agent && bottomPanelOpen}\n isMobileNav={isMobileNav}\n />\n </>\n </AppShellContext.Provider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TouchAppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.tsx"],"names":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AAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,qBAElF,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,EAEpF,QAAQ,EAAE,CAAC,YAEV,eAAe,GACO,CAC1B,CAAC;gBACJ,CAAC,CAAC,EAAE,EACJ,KAAC,oBAAoB,IAAC,MAAM,EAAE,CAAC,cAAc,IAAI,CAAC,CAAC,KAAK,IAAI,eAAe,YACxE,CAAC,cAAc,IAAI,gBAAgB,IAAI,CACtC,KAAC,uBAAuB,IACtB,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,gBAAgB,CAAC,OAAO,EACjC,gBAAgB,EAAC,YAAY,EAC7B,SAAS,EAAE,GAAG,EAAE;4BACd,kBAAkB,CAAC,KAAK,CAAC,CAAC;wBAC5B,CAAC,EACD,IAAI,EAAC,cAAc,YAElB,gBAAgB,CAAC,OAAO,GACD,CAC3B,GACoB,EACtB,aAAa,EACd,KAAC,mBAAmB,IAClB,QAAQ,EAAE,cAAc,EACxB,aAAa,EAAE,cAAc,EAC7B,eAAe,EAAE,CAAC,CAAC,YAAY,EAC/B,aAAa,QACb,kBAAkB,EAAE,CAAC,cAAc,EACnC,OAAO,EAAE,aAAa,EACtB,cAAc,EAAE,UAAU,EAC1B,eAAe,EAAE,MAAM,EAAE,KAAK,GAC9B,EACF,KAAC,wBAAwB,IACvB,mBAAmB,EAAE,CAAC,cAAc,IAAI,CAAC,CAAC,KAAK,IAAI,eAAe,EAClE,WAAW,EAAE,WAAW,GACxB,IACD,GACsB,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["import {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport type { MouseEvent, ReactElement, ReactNode } from 'react';\n\nimport { Alert } from '../Badges';\nimport Drawer from '../Drawer';\nimport Flex from '../Flex';\nimport Icon from '../Icon';\nimport {\n useBreakpoint,\n useElement,\n useEscape,\n useI18n,\n usePreviewManager,\n useScrollToggle,\n useTheme\n} from '../../hooks';\nimport { debounce, isValidElement } from '../../utils';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Progress from '../Progress';\n\nimport AppNavigationPanel, { CaseTypes, Links } from './AppNavigationPanel';\nimport AppHeader from './AppHeader';\nimport AppTopNav from './AppTopNav';\nimport DocumentTabs, { getTabElementId, getTabPanelId } from './DocumentTabs';\nimport { StyledDocumentTabPanel } from './DocumentTabs.styles';\nimport TopNavDrawerProvider from './TopNavDrawerProvider';\nimport { usePanel } from './Panel';\nimport {\n menuButtonWidth,\n StyledAppMain,\n StyledBannerRegion,\n AppShellGlobalStyle\n} from './AppShell.styles';\nimport {\n TouchAppShellGlobalStyle,\n StyledMainTouchAppShell,\n StyledSplitViewPanel,\n StyledPortalTouchDialog,\n StyledMobileMoreMenuButton,\n StyledMobileMoreMenu,\n StyledMobileNav\n} from './TouchAppShell.styles';\nimport type { AppShellProps, UtilItemProps } from './AppShell.types';\nimport AppShellContext from './AppShellContext';\nimport type { AppShellContextValue } from './AppShellContext';\n\nexport interface TouchAppShellProps extends AppShellProps {\n /** Optional bottom panel rendered by the touch app shell. */\n bottomTouchPanel?: {\n heading: string;\n content: ReactNode;\n };\n}\n\nexport default function TouchAppShell({\n appInfo,\n contextSwitcher,\n searchPage,\n searchInput,\n searchLabel,\n caseTypes,\n links,\n cases,\n agent,\n utils,\n utilsList,\n operator,\n notifications,\n headerUtils,\n helpMenu,\n shareApp,\n banners,\n progress,\n main,\n bottomTouchPanel,\n documentTabs,\n headerActions,\n panel1,\n popover,\n navId,\n restProps\n}: TouchAppShellProps & {\n searchLabel: string;\n utilsList: (UtilItemProps | ReactElement)[];\n navId: string;\n restProps: Record<string, unknown>;\n}) {\n const t = useI18n();\n const theme = useTheme();\n const { previewActive, setPreviewActive } = usePreviewManager();\n const { disableScroll, enableScroll } = useScrollToggle();\n const appShellContext = useContext(AppShellContext);\n const isSmallOrAbove = useBreakpoint('sm');\n const isMobileNav = !isSmallOrAbove;\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [bottomPanelOpen, setBottomPanelOpen] = useState(false);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [mobileNavLinksCount, setMobileNavLinksCount] = useState(0);\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const focusedImperatively = useRef(false);\n const [searchContainerEl, setSearchContainerEl] = useState<HTMLElement | null>(null);\n const moreButtonRef = useRef<HTMLButtonElement>(null);\n // A panel opened from a util in the More menu has no trigger left once that menu closes.\n const returnFocusToMore = useCallback(() => moreButtonRef.current, []);\n const { panel: panel1Element, panelOpen: panel1Open } = usePanel(panel1, returnFocusToMore);\n\n // Panel1 replaces the util drawer and the mobile navigation menu.\n useEffect(() => {\n if (!panel1Open) return;\n setDrawerOpen(false);\n setMobileNavOpen(false);\n }, [panel1Open]);\n\n // Opening a util while panel1 is open makes the consumer close panel1.\n useEffect(() => {\n if (drawerOpen && panel1Open) panel1?.onClose?.();\n }, [drawerOpen]);\n\n // The phone navigation stays visible beside panel1, so opening its menu makes the consumer close panel1.\n useEffect(() => {\n if (mobileNavOpen && panel1Open) panel1?.onClose?.();\n }, [mobileNavOpen]);\n\n const mobileAppShellContext = useMemo<AppShellContextValue>(\n () => ({\n ...appShellContext,\n navOpen: mobileNavOpen,\n drawerOpen,\n setDrawerOpen,\n navState: openCloseStates.high,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl,\n appHeaderEl: headerEl || mobileHeaderEl,\n searchContainerEl,\n setSearchContainerEl,\n isMobileNav,\n isTopBar: isSmallOrAbove,\n previewActive,\n setPreviewActive,\n startPanelOpen: panel1Open\n }),\n [\n appShellContext,\n headerEl,\n mobileHeaderEl,\n mobileNavOpen,\n drawerOpen,\n searchContainerEl,\n isMobileNav,\n previewActive,\n setPreviewActive,\n setSearchContainerEl,\n panel1Open\n ]\n );\n\n useEffect(() => {\n if (!isSmallOrAbove && agent && agent.active === false) {\n setBottomPanelOpen(false);\n }\n }, [agent?.active, isSmallOrAbove]);\n\n useEffect(() => {\n const ac = new AbortController();\n window.navigation.addEventListener(\n 'navigate',\n () => {\n if (mobileNavOpen) {\n setMobileNavOpen(false);\n }\n },\n {\n signal: ac.signal\n }\n );\n\n return () => {\n ac.abort();\n };\n }, [mobileNavOpen]);\n\n const navigationAgent = agent\n ? {\n ...agent,\n active: bottomPanelOpen,\n onClick: (event: MouseEvent<HTMLElement>) => {\n setBottomPanelOpen(true);\n setMobileNavOpen(false);\n\n if (isSmallOrAbove || (!bottomPanelOpen && !agent.active)) {\n agent.onClick?.(event);\n }\n }\n }\n : undefined;\n useEffect(() => {\n if (mobileNavOpen) disableScroll();\n else enableScroll();\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n useEscape(() => setMobileNavOpen(false));\n\n useLayoutEffect(() => {\n if (!mobileHeaderEl) return;\n\n const resizeObserver = new ResizeObserver(\n debounce(() => {\n const screenWidth = document.documentElement.clientWidth;\n const regionsPaddingInlinePixels =\n 2 *\n Number.parseInt(\n window.getComputedStyle(mobileHeaderEl).getPropertyValue('padding-inline-start'),\n 10\n );\n const availableWidth = screenWidth * 0.9 - regionsPaddingInlinePixels;\n setMobileNavLinksCount(\n Math.max(\n Math.floor(availableWidth / menuButtonWidth(theme)) - (caseTypes?.length ? 2 : 1),\n 0\n )\n );\n }, 0)\n );\n\n resizeObserver.observe(document.documentElement);\n return () => resizeObserver.disconnect();\n }, [mobileHeaderEl, caseTypes?.length, theme]);\n\n const touchNav = !isSmallOrAbove && (\n <>\n <StyledMobileNav\n hasBottomTouchPanel={!isSmallOrAbove && !!agent && bottomPanelOpen}\n container={{ alignItems: 'center', gap: 0.25 }}\n ref={setMobileHeaderEl}\n data-app-region\n onClick={() => setMobileNavOpen(false)}\n >\n {caseTypes && caseTypes.length > 0 && <CaseTypes caseTypes={caseTypes} mobileNavBar />}\n {links && <Links links={links.slice(0, mobileNavLinksCount)} mobileNavBar />}\n <StyledMobileMoreMenuButton\n ref={moreButtonRef}\n variant='simple'\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n setMobileNavOpen(prev => !prev);\n e.stopPropagation();\n }}\n label={t('app_shell_more')}\n icon\n aria-expanded={mobileNavOpen}\n aria-controls={navId}\n >\n <Icon name='bars' />\n {!mobileNavOpen &&\n utilsList.some(item => (isValidElement(item) ? false : !!item.count)) && (\n <Alert variant='urgent' />\n )}\n <span>{t('app_shell_more')}</span>\n </StyledMobileMoreMenuButton>\n </StyledMobileNav>\n <Drawer open={mobileNavOpen} position='fixed' placement='bottom' size='100dvh' nullWhenClosed>\n <Flex\n {...restProps}\n container={{ direction: 'column', justify: 'between' }}\n id={navId}\n as={StyledMobileMoreMenu}\n aria-label={t('app_shell_main_navigation_label')}\n >\n <AppNavigationPanel\n appInfo={appInfo}\n navState='open'\n searchInput={searchInput}\n searchLabel={searchLabel}\n links={links?.slice(mobileNavLinksCount)}\n cases={cases}\n utils={utilsList}\n agent={navigationAgent}\n />\n </Flex>\n </Drawer>\n </>\n );\n\n return (\n <AppShellContext.Provider value={mobileAppShellContext}>\n <>\n {isSmallOrAbove && (\n <AppHeader\n {...appInfo}\n contextSwitcher={contextSwitcher}\n searchInput={searchInput}\n searchLabel={searchLabel}\n searchPage={searchPage}\n operator={operator}\n notifications={notifications}\n headerUtils={headerUtils}\n helpMenu={helpMenu}\n shareApp={shareApp}\n headerActions={headerActions}\n panel1={panel1}\n popover={popover}\n ref={setHeaderEl}\n />\n )}\n {isSmallOrAbove ? (\n <TopNavDrawerProvider\n forceClosed={panel1Open}\n onOpen={() => {\n if (panel1Open) panel1?.onClose?.();\n }}\n >\n <AppTopNav\n appInfo={appInfo}\n caseTypes={caseTypes}\n links={links}\n cases={cases}\n agent={navigationAgent}\n utils={utils}\n searchInput={searchInput}\n searchPage={searchPage}\n searchLabel={searchLabel}\n />\n </TopNavDrawerProvider>\n ) : (\n touchNav\n )}\n {documentTabs && <DocumentTabs {...documentTabs} />}\n {(() => {\n const mainRegion = (\n <StyledAppMain\n previewActive={previewActive}\n isTopBar={isSmallOrAbove}\n hasBottomTouchPanel={!isSmallOrAbove && !!agent && bottomPanelOpen}\n hasDocumentTabs={!!documentTabs}\n aria-busy={!!progress}\n data-app-region\n >\n <Progress\n visible={!!progress}\n placement='local'\n message={typeof progress === 'string' ? progress : t('loading')}\n />\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n );\n const touchMainRegion = isMobileNav ? (\n <StyledMainTouchAppShell active={!!agent && bottomPanelOpen}>\n {mainRegion}\n </StyledMainTouchAppShell>\n ) : (\n mainRegion\n );\n if (!documentTabs) return touchMainRegion;\n return (\n <StyledDocumentTabPanel\n role='tabpanel'\n id={documentTabs.currentTabId ? getTabPanelId(documentTabs.currentTabId) : undefined}\n aria-labelledby={\n documentTabs.currentTabId ? getTabElementId(documentTabs.currentTabId) : undefined\n }\n tabIndex={0}\n >\n {touchMainRegion}\n </StyledDocumentTabPanel>\n );\n })()}\n <StyledSplitViewPanel active={!isSmallOrAbove && !!agent && bottomPanelOpen}>\n {!isSmallOrAbove && bottomTouchPanel && (\n <StyledPortalTouchDialog\n open={bottomPanelOpen}\n heading={bottomTouchPanel.heading}\n outerClickAction='reset-size'\n onDismiss={() => {\n setBottomPanelOpen(false);\n }}\n size='full-compact'\n >\n {bottomTouchPanel.content}\n </StyledPortalTouchDialog>\n )}\n </StyledSplitViewPanel>\n {panel1Element}\n <AppShellGlobalStyle\n isTopBar={isSmallOrAbove}\n showAppHeader={isSmallOrAbove}\n hasDocumentTabs={!!documentTabs}\n isTouchDevice\n isExtraSmallScreen={!isSmallOrAbove}\n navOpen={mobileNavOpen}\n startPanelOpen={panel1Open}\n startPanelWidth={panel1?.width}\n />\n <TouchAppShellGlobalStyle\n hasBottomTouchPanel={!isSmallOrAbove && !!agent && bottomPanelOpen}\n isMobileNav={isMobileNav}\n />\n </>\n </AppShellContext.Provider>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchAppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAe,EAA0B,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA8BtF,eAAO,MAAM,wBAAwB;0BACb,OAAO;kBACf,OAAO;YACb,YAAY;EAarB,CAAC;AAEF,eAAO,MAAM,uBAAuB;aAAyB,OAAO;YAOnE,CAAC;AAIF,eAAO,MAAM,oBAAoB;aAAyB,OAAO;YAY/D,CAAC;AAIH,eAAO,MAAM,uBAAuB;;;;
|
|
1
|
+
{"version":3,"file":"TouchAppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/TouchAppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAe,EAA0B,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA8BtF,eAAO,MAAM,wBAAwB;0BACb,OAAO;kBACf,OAAO;YACb,YAAY;EAarB,CAAC;AAEF,eAAO,MAAM,uBAAuB;aAAyB,OAAO;YAOnE,CAAC;AAIF,eAAO,MAAM,oBAAoB;aAAyB,OAAO;YAY/D,CAAC;AAIH,eAAO,MAAM,uBAAuB;;;;6MAqBnC,CAAC;AAIF,eAAO,MAAM,oBAAoB;;mBAShC,CAAC;AAIF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAAwC,OAAO;gJAqFzE,CAAC;AAIH,eAAO,MAAM,0BAA0B;;2JAgDrC,CAAC"}
|