@pega/cosmos-react-core 3.0.0-dev.18.0 → 3.0.0-dev.19.0
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/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +44 -78
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +2 -2
- package/lib/components/AppShell/AppShell.styles.js +4 -4
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +8 -18
- 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 +7 -7
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +5 -6
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellSearch.d.ts +0 -1
- package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellSearch.js +9 -10
- package/lib/components/AppShell/AppShellSearch.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts +3 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +7 -8
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts +2 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js +16 -19
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.js +32 -41
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
- package/lib/components/AppShell/SkipNavigation.js +5 -3
- package/lib/components/AppShell/SkipNavigation.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +2 -2
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -1
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +2 -0
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -0
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +1 -1
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.styles.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.styles.js +2 -1
- package/lib/components/CompositeInput/CompositeInput.styles.js.map +1 -1
- package/lib/components/Currency/utils.d.ts +1 -1
- package/lib/components/Currency/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +6 -6
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +1 -0
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +1 -1
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +11 -6
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +8 -6
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/index.d.ts +2 -4
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.js +2 -4
- package/lib/components/FieldValueList/index.js.map +1 -1
- package/lib/components/List/List.d.ts +1 -1
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +2 -2
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +7 -7
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +3 -3
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/utils.d.ts +1 -1
- package/lib/components/Number/utils.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.d.ts +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts +3 -2
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +10 -13
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +5 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useLongPress.d.ts +1 -1
- package/lib/hooks/useLongPress.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.d.ts +1 -1
- package/lib/hooks/useScrollStick.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +5 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +5 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +6 -727
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/init.js +1 -1
- package/lib/init.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/theme/index.js +1 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/themes/wssTheme.json +6 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAEH,MAAM,OAAO,CAAC;AAaf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAEH,MAAM,OAAO,CAAC;AAaf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsChD,OAAO,EACL,aAAa,EAMb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsG1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CA4FhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAmT7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useState, useCallback, useEffect, useMemo, useContext, useRef } from 'react';
|
|
2
|
+
import { forwardRef, useState, useCallback, useEffect, useMemo, useContext, useRef, isValidElement } from 'react';
|
|
3
3
|
import Flex from '../Flex';
|
|
4
4
|
import Link from '../Link';
|
|
5
5
|
import Count from '../Badges/Count';
|
|
@@ -11,18 +11,18 @@ import * as barsIcon from '../Icon/icons/bars.icon';
|
|
|
11
11
|
import * as caretLeftIcon from '../Icon/icons/caret-left.icon';
|
|
12
12
|
import * as caretRightIcon from '../Icon/icons/caret-right.icon';
|
|
13
13
|
import Image from '../Image';
|
|
14
|
-
import { useI18n, useBreakpoint, useConsolidatedRef, useDirection, useTheme, useElement, useTransitionState
|
|
14
|
+
import { useI18n, useBreakpoint, useConsolidatedRef, useDirection, useTheme, useElement, useTransitionState } from '../../hooks';
|
|
15
15
|
import { openCloseStates } from '../../hooks/useTransitionState';
|
|
16
16
|
import Grid from '../Grid';
|
|
17
17
|
import Button from '../Button';
|
|
18
18
|
import Drawer from '../Drawer';
|
|
19
19
|
import Backdrop from '../Backdrop';
|
|
20
20
|
import Tooltip from '../Tooltip/Tooltip';
|
|
21
|
-
import AppShellContext from './AppShellContext';
|
|
21
|
+
import AppShellContext, { AppShellDrawerContext } from './AppShellContext';
|
|
22
22
|
import AppShellDrawer from './Drawer';
|
|
23
23
|
import AppHeader from './AppHeader';
|
|
24
24
|
import SkipNavigation from './SkipNavigation';
|
|
25
|
-
import { StyledAppNav, StyledAppInfo, StyledCaseTypes, StyledScrollWrap, StyledUtils, StyledAppMain, StyledAppShellNavIcon, StyledNavCasesList, StyledAppEnvironment, StyledBannerRegion, StyledCountIcon, StyledUtilIconCount, StyledMobileNav,
|
|
25
|
+
import { StyledAppNav, StyledAppInfo, StyledCaseTypes, StyledScrollWrap, StyledUtils, StyledAppMain, StyledAppShellNavIcon, StyledNavCasesList, StyledAppEnvironment, StyledBannerRegion, StyledCountIcon, StyledUtilIconCount, StyledMobileNav, StyledAppShellTooltip, StyledAppShellToggleButton } from './AppShell.styles';
|
|
26
26
|
import NavigationList from './NavigationList';
|
|
27
27
|
import { AppShellSearch } from './AppShellSearch';
|
|
28
28
|
registerIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);
|
|
@@ -83,18 +83,10 @@ const Cases = (props) => {
|
|
|
83
83
|
};
|
|
84
84
|
return (_jsx(StyledNavCasesList, { children: _jsx(NavigationList, { items: setupCases(cases) }) }));
|
|
85
85
|
};
|
|
86
|
-
// TODO: Need to add back re-focus support to drawer.
|
|
87
86
|
export const Utils = ({ operator, items, appHeader }) => {
|
|
88
|
-
const {
|
|
89
|
-
const [transformedLinks, setTransformedLinks] = useState([]);
|
|
87
|
+
const { navOpen, navState } = useContext(AppShellContext);
|
|
90
88
|
const [item, setItem] = useState();
|
|
91
|
-
const [
|
|
92
|
-
const returnFocusRef = useRef(null);
|
|
93
|
-
const { navOpen } = useContext(AppShellContext);
|
|
94
|
-
const [expanded, setExpanded] = useState(false);
|
|
95
|
-
const toggleExpanded = useCallback(() => {
|
|
96
|
-
setExpanded(state => !state);
|
|
97
|
-
}, []);
|
|
89
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
98
90
|
const operatorInfo = useMemo(() => appHeader
|
|
99
91
|
? []
|
|
100
92
|
: [
|
|
@@ -103,57 +95,45 @@ export const Utils = ({ operator, items, appHeader }) => {
|
|
|
103
95
|
visual: operator.avatar,
|
|
104
96
|
items: operator.actions
|
|
105
97
|
}
|
|
106
|
-
], [appHeader, operator.name, operator.avatar, operator.actions
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
...drawerItem,
|
|
120
|
-
primary: drawerItem.name,
|
|
121
|
-
visual: drawerItem.count ? (_jsxs(StyledUtilIconCount, { children: [drawerItem.visual, _jsx(Count, { as: StyledCountIcon, variant: 'urgent', children: drawerItem.count })] })) : (drawerItem.visual),
|
|
122
|
-
collapseItems: !expanded || !navOpen
|
|
123
|
-
};
|
|
124
|
-
});
|
|
98
|
+
], [appHeader, operator.name, operator.avatar, operator.actions]);
|
|
99
|
+
const transform = (utilItem) => {
|
|
100
|
+
return {
|
|
101
|
+
onClick: () => {
|
|
102
|
+
if (utilItem.drawerView) {
|
|
103
|
+
setItem(utilItem);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
...utilItem,
|
|
107
|
+
primary: utilItem.name,
|
|
108
|
+
visual: utilItem.count ? (_jsxs(StyledUtilIconCount, { children: [utilItem.visual, _jsx(Count, { as: StyledCountIcon, variant: 'urgent', children: utilItem.count })] })) : (utilItem.visual),
|
|
109
|
+
collapseItems: !navOpen
|
|
110
|
+
};
|
|
125
111
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
112
|
+
const utilItems = useMemo(() => {
|
|
113
|
+
return [
|
|
114
|
+
...(items ?? []).map(uItem => {
|
|
115
|
+
return isValidElement(uItem) ? uItem : transform(uItem);
|
|
116
|
+
}),
|
|
117
|
+
...operatorInfo
|
|
118
|
+
];
|
|
133
119
|
}, [items, operatorInfo]);
|
|
134
|
-
useEffect(() => {
|
|
135
|
-
items?.forEach(uItem => {
|
|
136
|
-
if (uItem.name === activeUtilItem) {
|
|
137
|
-
setItem(uItem);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}, [items]);
|
|
141
120
|
useEffect(() => {
|
|
142
121
|
if (item)
|
|
143
122
|
setDrawerOpen(true);
|
|
144
123
|
}, [item]);
|
|
145
|
-
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (navState === 'closed' || navState === 'closing')
|
|
126
|
+
setDrawerOpen(false);
|
|
127
|
+
}, [navState]);
|
|
128
|
+
return (_jsxs(AppShellDrawerContext.Provider, { value: useMemo(() => ({
|
|
129
|
+
drawerOpen,
|
|
130
|
+
closeDrawer: () => {
|
|
131
|
+
setDrawerOpen(false);
|
|
132
|
+
},
|
|
133
|
+
openDrawer: itemToOpen => {
|
|
134
|
+
setItem(itemToOpen);
|
|
135
|
+
}
|
|
136
|
+
}), [drawerOpen]), children: [_jsx(StyledUtils, { children: _jsx(NavigationList, { items: utilItems, collapsed: true }) }), item && (_jsx(AppShellDrawer, { drawerOpen: drawerOpen, setDrawerOpen: setDrawerOpen, content: item.drawerView, header: item.drawerHeader || item.name, onDrawerClose: () => {
|
|
157
137
|
setItem(undefined);
|
|
158
138
|
item.onDrawerClose?.();
|
|
159
139
|
}, onDrawerOpen: item.onDrawerOpen }))] }));
|
|
@@ -168,15 +148,11 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
168
148
|
else if (appInfoOnClick)
|
|
169
149
|
appInfoAs = Button;
|
|
170
150
|
const t = useI18n();
|
|
171
|
-
const { start } = useDirection();
|
|
172
|
-
const isMediumOrAbove = useBreakpoint('md');
|
|
151
|
+
const { start, end } = useDirection();
|
|
173
152
|
const theme = useTheme();
|
|
174
153
|
const navRef = useConsolidatedRef(ref);
|
|
175
|
-
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
176
|
-
const [menuOpen, setMenuOpen] = useState(false);
|
|
177
154
|
const [mobileNavOpen, setMobileNavOpen] = useState(false);
|
|
178
155
|
const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);
|
|
179
|
-
const [refocusEl, setRefocusEl] = useState(null);
|
|
180
156
|
const focusedImperatively = useRef(false);
|
|
181
157
|
const [headerEl, setHeaderEl] = useElement();
|
|
182
158
|
const [mobileHeaderEl, setMobileHeaderEl] = useElement();
|
|
@@ -216,10 +192,6 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
216
192
|
if (key === 'Escape')
|
|
217
193
|
setMobileNavOpen(false);
|
|
218
194
|
}, []);
|
|
219
|
-
useEffect(() => {
|
|
220
|
-
if (navState === 'closed' || navState === 'closing')
|
|
221
|
-
setDrawerOpen(false);
|
|
222
|
-
}, [navState]);
|
|
223
195
|
useEffect(() => {
|
|
224
196
|
if (mobileNavOpen) {
|
|
225
197
|
document.addEventListener('keydown', onKeydown);
|
|
@@ -240,7 +212,7 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
240
212
|
}, ref: navRef, as: StyledAppNav, appHeader: showAppHeader, navOpen: mobileNavOpen, showEnv: !!envName, onFocus: onFocus, children: [envName && (_jsx(StyledAppEnvironment, { item: { shrink: 0 }, color: envColor ?? theme.base.colors.red['extra-light'], children: envName })), !showAppHeader && (_jsxs(_Fragment, { children: [_jsxs(StyledAppInfo, { as: Grid, forwardedAs: appInfoAs, variant: 'link', href: appInfoHref, onClick: appInfoOnClick, "aria-label": `${appName}${portalName ? ` - ${portalName}` : ''}`, ...appInfoRestProps, container: {
|
|
241
213
|
alignItems: 'center',
|
|
242
214
|
areas: portalName ? '"logo app" "logo portal"' : '"logo app"'
|
|
243
|
-
}, ref: setAppInfoEl, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }), _jsx(Grid, { item: { area: 'app' }, as: 'span', children: appName }), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: 'span', children: portalName }))] }), navState === 'closed' && (_jsx(Tooltip, { target: appInfoEl, placement: 'right', as:
|
|
215
|
+
}, ref: setAppInfoEl, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }), _jsx(Grid, { item: { area: 'app' }, as: 'span', children: appName }), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: 'span', children: portalName }))] }), navState === 'closed' && (_jsx(Tooltip, { target: appInfoEl, placement: 'right', as: StyledAppShellTooltip, showDelay: 'none', hideDelay: 'none', children: appName }))] })), searchInput && !showAppHeader && (_jsx(AppShellSearch, { searchLabel: searchLabel, collapsed: !mobileNavOpen && ['closed', 'closing'].includes(navState), searchInput: searchInput })), _jsxs(StyledScrollWrap, { onClick: isSmallOrAbove
|
|
244
216
|
? () => {
|
|
245
217
|
if (['closing', 'closed'].includes(navState)) {
|
|
246
218
|
openNav(0);
|
|
@@ -249,24 +221,18 @@ const AppShell = forwardRef((props, ref) => {
|
|
|
249
221
|
closeNav(0);
|
|
250
222
|
}
|
|
251
223
|
}
|
|
252
|
-
: undefined, children: [caseTypes && caseTypes.length > 0 && _jsx(CaseTypes, { caseTypes: caseTypes }), links && _jsx(Links, { links: links }), cases && _jsx(Cases, { cases: cases })] }), _jsx(Utils, { appHeader: showAppHeader, operator: operator, items: utils }), _jsxs(Flex, { container: { justify: 'center' }, children: [_jsx(
|
|
224
|
+
: undefined, children: [caseTypes && caseTypes.length > 0 && _jsx(CaseTypes, { caseTypes: caseTypes }), links && _jsx(Links, { links: links }), cases && _jsx(Cases, { cases: cases })] }), _jsx(Utils, { appHeader: showAppHeader, operator: operator, items: utils }), !mobileNavOpen && (_jsxs(Flex, { container: { justify: 'center' }, children: [_jsx(StyledAppShellToggleButton, { icon: true, ref: setExpandCollapseEl, compact: true, variant: 'simple', onClick: () => {
|
|
253
225
|
setNavState(navState === 'closed' ? 'open' : 'closed');
|
|
254
|
-
}, open: ['open', 'opening'].includes(navState), "aria-label": navState === 'closed' ? t('expand') : t('collapse'), children: ['closed', 'closing'].includes(navState) ? (_jsx(Icon, { name:
|
|
226
|
+
}, open: ['open', 'opening'].includes(navState), "aria-label": navState === 'closed' ? t('expand') : t('collapse'), children: ['closed', 'closing'].includes(navState) ? (_jsx(Icon, { name: `arrow-micro-${end}` })) : (_jsx(Icon, { name: `arrow-micro-${start}` })) }), ['open', 'closed'].includes(navState) && (_jsx(Tooltip, { target: expandCollapseEl, placement: 'right', as: StyledAppShellTooltip, showDelay: 'none', hideDelay: 'none', children: navState === 'closed' ? t('expand') : t('collapse') }))] }))] }));
|
|
255
227
|
return (_jsxs(AppShellContext.Provider, { value: useMemo(() => ({
|
|
256
228
|
navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',
|
|
257
229
|
navState,
|
|
258
|
-
menuOpen,
|
|
259
|
-
setMenuOpen,
|
|
260
|
-
drawerOpen,
|
|
261
|
-
setDrawerOpen,
|
|
262
|
-
refocusEl,
|
|
263
|
-
setRefocusEl,
|
|
264
230
|
focusedImperatively,
|
|
265
231
|
headerEl: headerEl || mobileHeaderEl,
|
|
266
232
|
previewTriggerRef,
|
|
267
233
|
searchContainerEl,
|
|
268
234
|
setSearchContainerEl
|
|
269
|
-
}), [navState, mobileNavOpen,
|
|
235
|
+
}), [navState, mobileNavOpen, headerEl, mobileHeaderEl]), children: [_jsx(SkipNavigation, {}), showAppHeader && (_jsx(AppHeader, { ...appInfo, searchInput: searchInput, searchLabel: searchLabel, operator: operator, searchPage: searchPage, ref: setHeaderEl })), isSmallOrAbove ? (appShellJSX) : (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledMobileNav, container: { alignItems: 'center' }, ref: setMobileHeaderEl, children: _jsx(Button, { variant: 'simple', onClick: () => setMobileNavBackdrop(true), "aria-label": t('app_shell_open_nav'), icon: true, children: _jsx(Icon, { name: 'bars' }) }) }), _jsx(Backdrop, { open: mobileNavBackdrop, transitionSpeed: 'none', onAfterTransitionIn: () => setMobileNavOpen(true), onBeforeTransitionOut: () => setMobileNavOpen(false), onClick: e => {
|
|
270
236
|
if (e.currentTarget === e.target)
|
|
271
237
|
setMobileNavOpen(false);
|
|
272
238
|
}, children: _jsx(Drawer, { open: mobileNavOpen, onAfterClose: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAGV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EAEP,UAAU,EACV,MAAM,EAGP,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KA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AQ,EAAC,OAAO,EAChB,SAAS,EAAE,KAAK,EAChB,IAAI,EAAC,qCAAqC,EAC1C,cAAc,kBAEb,WAAW,GACL,GACA,IACV,CACJ,EACA,eAAe,IAAI,CAClB,MAAC,aAAa,IACZ,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,CAAC,cAAc,EAC1B,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,cAAc,EAAE,YAAY,EACpF,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAE9C,OAAO,IAAI,KAAC,kBAAkB,cAAE,OAAO,GAAsB,EAC7D,IAAI,IACS,CACjB,IACwB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useMemo,\n ElementType,\n useContext,\n useRef,\n FC,\n MutableRefObject\n} from 'react';\n\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as caseSolidIcon from '../Icon/icons/case-solid.icon';\nimport * as barsIcon from '../Icon/icons/bars.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Image from '../Image';\nimport type { ForwardProps } from '../../types';\nimport {\n useI18n,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useTheme,\n useElement,\n useTransitionState,\n useAfterInitialEffect\n} from '../../hooks';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Grid from '../Grid';\nimport Button from '../Button';\nimport Drawer from '../Drawer';\nimport Backdrop from '../Backdrop';\nimport Tooltip from '../Tooltip/Tooltip';\n\nimport AppShellContext from './AppShellContext';\nimport AppShellDrawer from './Drawer';\nimport AppHeader from './AppHeader';\nimport SkipNavigation from './SkipNavigation';\nimport {\n StyledAppNav,\n StyledAppInfo,\n StyledCaseTypes,\n StyledScrollWrap,\n StyledUtils,\n StyledAppMain,\n StyledAppShellNavIcon,\n StyledNavCasesList,\n StyledAppEnvironment,\n StyledBannerRegion,\n StyledCountIcon,\n StyledUtilIconCount,\n StyledMobileNav,\n StyledAppshellTooltip,\n StyledAppshellToggleButton\n} from './AppShell.styles';\nimport {\n AppShellProps,\n CaseProps,\n CaseTypeProps,\n LinkProps,\n NavListItemProps,\n UtilItemProps,\n UtilsProps\n} from './AppShell.types';\nimport NavigationList from './NavigationList';\nimport { AppShellSearch } from './AppShellSearch';\n\nregisterIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);\n\nconst CaseTypes: FunctionComponent<{ caseTypes: CaseTypeProps[] }> = ({\n caseTypes\n}: {\n caseTypes: CaseTypeProps[];\n}) => {\n const t = useI18n();\n\n const transformedCaseTypes = caseTypes.map(caseType => {\n return {\n ...caseType,\n primary: caseType.name\n };\n });\n\n return useMemo(\n () => (\n <StyledCaseTypes>\n <NavigationList\n items={[\n {\n primary: t('app_shell_create'),\n visual: <Icon name='plus' as={StyledAppShellNavIcon} />,\n items: transformedCaseTypes\n }\n ]}\n />\n </StyledCaseTypes>\n ),\n [caseTypes]\n );\n};\n\nconst Links: FunctionComponent<{ links: LinkProps[] }> = (props: { links: LinkProps[] }) => {\n const { links } = props;\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedNavLinks = (items: LinkProps[]): NavListItemProps[] => {\n return items.map((link: LinkProps) => {\n return {\n ...link,\n primary: link.name,\n 'aria-current': link.active ? 'page' : null,\n visual: link.icon ? <Icon name={link.icon} as={StyledAppShellNavIcon} /> : null,\n onClick: link.links ? undefined : link.onClick,\n items: link.links ? mergedNavLinks(link.links) : undefined\n };\n });\n };\n\n useEffect(() => {\n setTransformedLinks(mergedNavLinks(links));\n }, [links]);\n\n return (\n <div>\n <NavigationList items={transformedLinks} />\n </div>\n );\n};\n\nconst Cases: FunctionComponent<{ cases: CaseProps[] }> = (props: { cases: CaseProps[] }) => {\n const { cases } = props;\n\n const setupCases = (items: CaseProps[]): NavListItemProps[] => {\n return items.map((item: CaseProps) => {\n const {\n id,\n primary,\n secondary,\n visual = <Icon name='case-solid' as={StyledAppShellNavIcon} />,\n active,\n onClick,\n onDismiss\n } = item;\n return {\n id,\n 'aria-current': active ? 'page' : undefined,\n primary,\n secondary,\n active: !!active,\n dismissible: true,\n onClick,\n onDismiss,\n visual\n };\n });\n };\n\n return (\n <StyledNavCasesList>\n <NavigationList items={setupCases(cases)} />\n </StyledNavCasesList>\n );\n};\n\n// TODO: Need to add back re-focus support to drawer.\nexport const Utils: FC<UtilsProps> = ({ operator, items, appHeader }) => {\n const { drawerOpen, setDrawerOpen, focusedImperatively } = useContext(AppShellContext);\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n const [item, setItem] = useState<UtilItemProps>();\n const [activeUtilItem, setActiveUtilItem] = useState('');\n const returnFocusRef: MutableRefObject<\n HTMLAnchorElement | HTMLDivElement | HTMLButtonElement | null\n > = useRef(null);\n const { navOpen } = useContext(AppShellContext);\n const [expanded, setExpanded] = useState(false);\n\n const toggleExpanded = useCallback(() => {\n setExpanded(state => !state);\n }, []);\n\n const operatorInfo: NavListItemProps[] = useMemo(\n () =>\n appHeader\n ? []\n : [\n {\n primary: operator.name,\n visual: operator.avatar,\n items: operator.actions\n }\n ],\n [appHeader, operator.name, operator.avatar, operator.actions, expanded, navOpen]\n );\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedUtilItems = (drawerItems: UtilItemProps[]): NavListItemProps[] => {\n return drawerItems?.map((drawerItem: UtilItemProps) => {\n return {\n onClick: e => {\n returnFocusRef.current = e.currentTarget;\n if (drawerItem.drawerView) {\n setItem(drawerItem);\n setActiveUtilItem(drawerItem.name);\n }\n toggleExpanded();\n },\n ...drawerItem,\n primary: drawerItem.name,\n visual: drawerItem.count ? (\n <StyledUtilIconCount>\n {drawerItem.visual}\n <Count as={StyledCountIcon} variant='urgent'>\n {drawerItem.count}\n </Count>\n </StyledUtilIconCount>\n ) : (\n drawerItem.visual\n ),\n collapseItems: !expanded || !navOpen\n };\n });\n };\n\n useEffect(() => {\n if (items) {\n setTransformedLinks([...mergedUtilItems(items)!, ...operatorInfo]);\n } else {\n setTransformedLinks(operatorInfo);\n }\n }, [items, operatorInfo]);\n\n useEffect(() => {\n items?.forEach(uItem => {\n if (uItem.name === activeUtilItem) {\n setItem(uItem);\n }\n });\n }, [items]);\n\n useEffect(() => {\n if (item) setDrawerOpen(true);\n }, [item]);\n\n useAfterInitialEffect(() => {\n if (!drawerOpen) {\n setActiveUtilItem('');\n focusedImperatively.current = true;\n returnFocusRef?.current?.focus();\n }\n }, [drawerOpen]);\n\n return (\n <>\n <StyledUtils>\n <NavigationList\n // Pull onDrawerOpen and onDrawerClose off to avoid DOM passthrough warning.\n items={transformedLinks.map(({ onDrawerOpen, onDrawerClose, ...util }) => util)}\n collapsed\n />\n </StyledUtils>\n {item && (\n <AppShellDrawer\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 </>\n );\n};\n\nconst AppShell: FunctionComponent<AppShellProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<AppShellProps>, ref: Ref<HTMLDivElement>) => {\n const {\n appInfo,\n searchInput,\n appHeader,\n searchPage,\n searchLabel = 'Sitewide', // FIXME: TR\n caseTypes,\n links,\n banners,\n environment: { name: envName, color: envColor } = {},\n main,\n operator,\n utils,\n cases,\n defaultExpanded = false,\n ...restProps\n } = props;\n const {\n appName,\n portalName,\n href: appInfoHref,\n onClick: appInfoOnClick,\n imageSrc: logoSrc,\n ...appInfoRestProps\n } = appInfo;\n\n let appInfoAs: ElementType = 'div';\n if (appInfoHref) appInfoAs = Link;\n else if (appInfoOnClick) appInfoAs = Button;\n\n const t = useI18n();\n const { start } = useDirection();\n const isMediumOrAbove = useBreakpoint('md');\n const theme = useTheme();\n const navRef = useConsolidatedRef(ref);\n\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [menuOpen, setMenuOpen] = useState(false);\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);\n const [refocusEl, setRefocusEl] = useState<HTMLButtonElement | null>(null);\n\n const focusedImperatively = useRef(false);\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n const [appInfoEl, setAppInfoEl] = useElement<HTMLAnchorElement>();\n const [expandCollapseEl, setExpandCollapseEl] = useElement<HTMLButtonElement>();\n\n const isSmallOrAbove = useBreakpoint('sm');\n\n const showAppHeader = !!appHeader && isSmallOrAbove;\n const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;\n\n const openNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const closeNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const previewTriggerRef = useRef<HTMLElement>(null);\n\n const [searchContainerEl, setSearchContainerEl] = useState<HTMLElement | null>(null);\n\n const { state: navState, set: setNavState } = useTransitionState({\n ref: navRef,\n property: 'width',\n states: openCloseStates,\n defaultState: defaultExpanded ? 'open' : 'closed'\n });\n\n const openNav = useCallback((delay: number = 0) => {\n if (closeNavTimeoutId.current) clearTimeout(closeNavTimeoutId.current);\n openNavTimeoutId.current = setTimeout(() => {\n setNavState('open');\n }, delay);\n }, []);\n\n const closeNav = useCallback((delay: number = 0) => {\n if (openNavTimeoutId.current) clearTimeout(openNavTimeoutId.current);\n closeNavTimeoutId.current = setTimeout(() => {\n setNavState('closed');\n }, delay);\n }, []);\n\n const onFocus = useCallback(() => {\n focusedImperatively.current = false;\n }, [openNav, isSmallOrAbove]);\n\n const onKeydown = useCallback(({ key }: KeyboardEvent) => {\n if (key === 'Escape') setMobileNavOpen(false);\n }, []);\n\n useEffect(() => {\n if (navState === 'closed' || navState === 'closing') setDrawerOpen(false);\n }, [navState]);\n\n useEffect(() => {\n if (mobileNavOpen) {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavBackdrop(false);\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n const appShellJSX = (\n <Flex\n {...restProps}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n ref={navRef}\n as={StyledAppNav}\n appHeader={showAppHeader}\n navOpen={mobileNavOpen}\n showEnv={!!envName}\n onFocus={onFocus}\n >\n {envName && (\n <StyledAppEnvironment\n item={{ shrink: 0 }}\n color={envColor ?? theme.base.colors.red['extra-light']}\n >\n {envName}\n </StyledAppEnvironment>\n )}\n\n {!showAppHeader && (\n <>\n <StyledAppInfo\n as={Grid}\n forwardedAs={appInfoAs}\n variant='link'\n href={appInfoHref}\n onClick={appInfoOnClick}\n aria-label={`${appName}${portalName ? ` - ${portalName}` : ''}`}\n {...appInfoRestProps}\n container={{\n alignItems: 'center',\n areas: portalName ? '\"logo app\" \"logo portal\"' : '\"logo app\"'\n }}\n ref={setAppInfoEl}\n >\n <Grid item={{ area: 'logo' }} as={Image} src={logoSrc} alt={appName} />\n <Grid item={{ area: 'app' }} as='span'>\n {appName}\n </Grid>\n {portalName && (\n <Grid item={{ area: 'portal' }} as='span'>\n {portalName}\n </Grid>\n )}\n </StyledAppInfo>\n {navState === 'closed' && (\n <Tooltip\n target={appInfoEl}\n placement='right'\n as={StyledAppshellTooltip}\n showDelay='none'\n hideDelay='none'\n >\n {appName}\n </Tooltip>\n )}\n </>\n )}\n\n {searchInput && !showAppHeader && (\n <AppShellSearch\n searchLabel={searchLabel}\n collapsed={!mobileNavOpen && ['closed', 'closing'].includes(navState)}\n isMediumOrAbove={isMediumOrAbove}\n searchInput={searchInput}\n />\n )}\n\n <StyledScrollWrap\n onClick={\n isSmallOrAbove\n ? () => {\n if (['closing', 'closed'].includes(navState)) {\n openNav(0);\n } else {\n closeNav(0);\n }\n }\n : undefined\n }\n >\n {caseTypes && caseTypes.length > 0 && <CaseTypes caseTypes={caseTypes} />}\n {links && <Links links={links} />}\n {cases && <Cases cases={cases} />}\n </StyledScrollWrap>\n\n <Utils appHeader={showAppHeader} operator={operator} items={utils} />\n <Flex container={{ justify: 'center' }}>\n <StyledAppshellToggleButton\n icon\n ref={setExpandCollapseEl}\n compact\n variant='simple'\n onClick={() => {\n setNavState(navState === 'closed' ? 'open' : 'closed');\n }}\n open={['open', 'opening'].includes(navState)}\n aria-label={navState === 'closed' ? t('expand') : t('collapse')}\n >\n {['closed', 'closing'].includes(navState) ? (\n <Icon name='arrow-micro-right' />\n ) : (\n <Icon name='arrow-micro-left' />\n )}\n </StyledAppshellToggleButton>\n {['open', 'closed'].includes(navState) && (\n <Tooltip\n target={expandCollapseEl}\n placement='right'\n as={StyledAppshellTooltip}\n showDelay='none'\n hideDelay='none'\n >\n {navState === 'closed' ? t('expand') : t('collapse')}\n </Tooltip>\n )}\n </Flex>\n </Flex>\n );\n\n return (\n <AppShellContext.Provider\n value={useMemo(\n () => ({\n navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',\n navState,\n menuOpen,\n setMenuOpen,\n drawerOpen,\n setDrawerOpen,\n refocusEl,\n setRefocusEl,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl,\n previewTriggerRef,\n searchContainerEl,\n setSearchContainerEl\n }),\n [navState, mobileNavOpen, drawerOpen, refocusEl, headerEl, mobileHeaderEl]\n )}\n >\n <SkipNavigation />\n {showAppHeader && (\n <AppHeader\n {...appInfo}\n searchInput={searchInput}\n searchLabel={searchLabel}\n operator={operator}\n searchPage={searchPage}\n ref={setHeaderEl}\n />\n )}\n\n {isSmallOrAbove ? (\n appShellJSX\n ) : (\n <>\n <Flex as={StyledMobileNav} container={{ alignItems: 'center' }} ref={setMobileHeaderEl}>\n <Button\n variant='simple'\n onClick={() => setMobileNavBackdrop(true)}\n aria-label={t('app_shell_open_nav')}\n icon\n >\n <Icon name='bars' />\n </Button>\n </Flex>\n\n <Backdrop\n open={mobileNavBackdrop}\n transitionSpeed='none'\n onAfterTransitionIn={() => setMobileNavOpen(true)}\n onBeforeTransitionOut={() => setMobileNavOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setMobileNavOpen(false);\n }}\n >\n <Drawer\n open={mobileNavOpen}\n onAfterClose={() => {\n setMobileNavBackdrop(false);\n }}\n position='fixed'\n placement={start}\n size='min(18.75rem, calc(100vw - 3.5rem))'\n nullWhenClosed\n >\n {appShellJSX}\n </Drawer>\n </Backdrop>\n </>\n )}\n {showMainContent && (\n <StyledAppMain\n appHeader={showAppHeader}\n mobileNav={!isSmallOrAbove}\n headerOffset={isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight}\n navOpen={['open', 'opening'].includes(navState)}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n )}\n </AppShellContext.Provider>\n );\n }\n);\n\nexport default AppShell;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAGV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EAEP,UAAU,EACV,MAAM,EAEN,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,IAAI,EAAE,EAAE,YAAY,EAA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AAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;wBAC5D,CAAC,YAED,KAAC,MAAM,IACL,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,GAAG,EAAE;gCACjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;4BAC9B,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,KAAK,EAChB,IAAI,EAAC,qCAAqC,EAC1C,cAAc,kBAEb,WAAW,GACL,GACA,IACV,CACJ,EACA,eAAe,IAAI,CAClB,MAAC,aAAa,IACZ,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,CAAC,cAAc,EAC1B,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,cAAc,EAAE,YAAY,EACpF,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAE9C,OAAO,IAAI,KAAC,kBAAkB,cAAE,OAAO,GAAsB,EAC7D,IAAI,IACS,CACjB,IACwB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useMemo,\n ElementType,\n useContext,\n useRef,\n FC,\n isValidElement\n} from 'react';\n\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as plusIcon from '../Icon/icons/plus.icon';\nimport * as caseSolidIcon from '../Icon/icons/case-solid.icon';\nimport * as barsIcon from '../Icon/icons/bars.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Image from '../Image';\nimport type { ForwardProps } from '../../types';\nimport {\n useI18n,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useTheme,\n useElement,\n useTransitionState\n} from '../../hooks';\nimport { openCloseStates } from '../../hooks/useTransitionState';\nimport Grid from '../Grid';\nimport Button from '../Button';\nimport Drawer from '../Drawer';\nimport Backdrop from '../Backdrop';\nimport Tooltip from '../Tooltip/Tooltip';\n\nimport AppShellContext, { AppShellDrawerContext } from './AppShellContext';\nimport AppShellDrawer from './Drawer';\nimport AppHeader from './AppHeader';\nimport SkipNavigation from './SkipNavigation';\nimport {\n StyledAppNav,\n StyledAppInfo,\n StyledCaseTypes,\n StyledScrollWrap,\n StyledUtils,\n StyledAppMain,\n StyledAppShellNavIcon,\n StyledNavCasesList,\n StyledAppEnvironment,\n StyledBannerRegion,\n StyledCountIcon,\n StyledUtilIconCount,\n StyledMobileNav,\n StyledAppShellTooltip,\n StyledAppShellToggleButton\n} from './AppShell.styles';\nimport {\n AppShellProps,\n CaseProps,\n CaseTypeProps,\n LinkProps,\n NavListItemProps,\n UtilItemProps,\n UtilsProps\n} from './AppShell.types';\nimport NavigationList from './NavigationList';\nimport { AppShellSearch } from './AppShellSearch';\n\nregisterIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);\n\nconst CaseTypes: FunctionComponent<{ caseTypes: CaseTypeProps[] }> = ({\n caseTypes\n}: {\n caseTypes: CaseTypeProps[];\n}) => {\n const t = useI18n();\n\n const transformedCaseTypes = caseTypes.map(caseType => {\n return {\n ...caseType,\n primary: caseType.name\n };\n });\n\n return useMemo(\n () => (\n <StyledCaseTypes>\n <NavigationList\n items={[\n {\n primary: t('app_shell_create'),\n visual: <Icon name='plus' as={StyledAppShellNavIcon} />,\n items: transformedCaseTypes\n }\n ]}\n />\n </StyledCaseTypes>\n ),\n [caseTypes]\n );\n};\n\nconst Links: FunctionComponent<{ links: LinkProps[] }> = (props: { links: LinkProps[] }) => {\n const { links } = props;\n const [transformedLinks, setTransformedLinks] = useState<NavListItemProps[]>([]);\n\n // TODO: Can this be a memo instead of a state and an effect?\n const mergedNavLinks = (items: LinkProps[]): NavListItemProps[] => {\n return items.map((link: LinkProps) => {\n return {\n ...link,\n primary: link.name,\n 'aria-current': link.active ? 'page' : null,\n visual: link.icon ? <Icon name={link.icon} as={StyledAppShellNavIcon} /> : null,\n onClick: link.links ? undefined : link.onClick,\n items: link.links ? mergedNavLinks(link.links) : undefined\n };\n });\n };\n\n useEffect(() => {\n setTransformedLinks(mergedNavLinks(links));\n }, [links]);\n\n return (\n <div>\n <NavigationList items={transformedLinks} />\n </div>\n );\n};\n\nconst Cases: FunctionComponent<{ cases: CaseProps[] }> = (props: { cases: CaseProps[] }) => {\n const { cases } = props;\n\n const setupCases = (items: CaseProps[]): NavListItemProps[] => {\n return items.map((item: CaseProps) => {\n const {\n id,\n primary,\n secondary,\n visual = <Icon name='case-solid' as={StyledAppShellNavIcon} />,\n active,\n onClick,\n onDismiss\n } = item;\n return {\n id,\n 'aria-current': active ? 'page' : undefined,\n primary,\n secondary,\n active: !!active,\n dismissible: true,\n onClick,\n onDismiss,\n visual\n };\n });\n };\n\n return (\n <StyledNavCasesList>\n <NavigationList items={setupCases(cases)} />\n </StyledNavCasesList>\n );\n};\n\nexport const Utils: FC<UtilsProps> = ({ operator, items, appHeader }) => {\n const { navOpen, navState } = useContext(AppShellContext);\n const [item, setItem] = useState<UtilItemProps>();\n const [drawerOpen, setDrawerOpen] = useState(false);\n\n const operatorInfo: NavListItemProps[] = useMemo(\n () =>\n appHeader\n ? []\n : [\n {\n primary: operator.name,\n visual: operator.avatar,\n items: operator.actions\n }\n ],\n [appHeader, operator.name, operator.avatar, operator.actions]\n );\n\n const transform = (utilItem: UtilItemProps): NavListItemProps => {\n return {\n onClick: () => {\n if (utilItem.drawerView) {\n setItem(utilItem);\n }\n },\n ...utilItem,\n primary: utilItem.name,\n visual: utilItem.count ? (\n <StyledUtilIconCount>\n {utilItem.visual}\n <Count as={StyledCountIcon} variant='urgent'>\n {utilItem.count}\n </Count>\n </StyledUtilIconCount>\n ) : (\n utilItem.visual\n ),\n collapseItems: !navOpen\n };\n };\n\n const utilItems = useMemo(() => {\n return [\n ...(items ?? []).map(uItem => {\n return isValidElement(uItem) ? uItem : transform(uItem);\n }),\n ...operatorInfo\n ];\n }, [items, operatorInfo]);\n\n useEffect(() => {\n if (item) setDrawerOpen(true);\n }, [item]);\n\n useEffect(() => {\n if (navState === 'closed' || navState === 'closing') setDrawerOpen(false);\n }, [navState]);\n\n return (\n <AppShellDrawerContext.Provider\n value={useMemo(\n () => ({\n drawerOpen,\n closeDrawer: () => {\n setDrawerOpen(false);\n },\n openDrawer: itemToOpen => {\n setItem(itemToOpen);\n }\n }),\n [drawerOpen]\n )}\n >\n <StyledUtils>\n <NavigationList items={utilItems} collapsed />\n </StyledUtils>\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\nconst AppShell: FunctionComponent<AppShellProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<AppShellProps>, ref: Ref<HTMLDivElement>) => {\n const {\n appInfo,\n searchInput,\n appHeader,\n searchPage,\n searchLabel = 'Sitewide', // FIXME: TR\n caseTypes,\n links,\n banners,\n environment: { name: envName, color: envColor } = {},\n main,\n operator,\n utils,\n cases,\n defaultExpanded = false,\n ...restProps\n } = props;\n const {\n appName,\n portalName,\n href: appInfoHref,\n onClick: appInfoOnClick,\n imageSrc: logoSrc,\n ...appInfoRestProps\n } = appInfo;\n\n let appInfoAs: ElementType = 'div';\n if (appInfoHref) appInfoAs = Link;\n else if (appInfoOnClick) appInfoAs = Button;\n\n const t = useI18n();\n const { start, end } = useDirection();\n const theme = useTheme();\n const navRef = useConsolidatedRef(ref);\n\n const [mobileNavOpen, setMobileNavOpen] = useState(false);\n const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);\n\n const focusedImperatively = useRef(false);\n const [headerEl, setHeaderEl] = useElement<HTMLDivElement>();\n const [mobileHeaderEl, setMobileHeaderEl] = useElement<HTMLDivElement>();\n const [appInfoEl, setAppInfoEl] = useElement<HTMLAnchorElement>();\n const [expandCollapseEl, setExpandCollapseEl] = useElement<HTMLButtonElement>();\n\n const isSmallOrAbove = useBreakpoint('sm');\n\n const showAppHeader = !!appHeader && isSmallOrAbove;\n const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;\n\n const openNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const closeNavTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n const previewTriggerRef = useRef<HTMLElement>(null);\n\n const [searchContainerEl, setSearchContainerEl] = useState<HTMLElement | null>(null);\n\n const { state: navState, set: setNavState } = useTransitionState({\n ref: navRef,\n property: 'width',\n states: openCloseStates,\n defaultState: defaultExpanded ? 'open' : 'closed'\n });\n\n const openNav = useCallback((delay: number = 0) => {\n if (closeNavTimeoutId.current) clearTimeout(closeNavTimeoutId.current);\n openNavTimeoutId.current = setTimeout(() => {\n setNavState('open');\n }, delay);\n }, []);\n\n const closeNav = useCallback((delay: number = 0) => {\n if (openNavTimeoutId.current) clearTimeout(openNavTimeoutId.current);\n closeNavTimeoutId.current = setTimeout(() => {\n setNavState('closed');\n }, delay);\n }, []);\n\n const onFocus = useCallback(() => {\n focusedImperatively.current = false;\n }, [openNav, isSmallOrAbove]);\n\n const onKeydown = useCallback(({ key }: KeyboardEvent) => {\n if (key === 'Escape') setMobileNavOpen(false);\n }, []);\n\n useEffect(() => {\n if (mobileNavOpen) {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }\n }, [mobileNavOpen]);\n\n useEffect(() => {\n if (isSmallOrAbove && mobileNavOpen) {\n setMobileNavBackdrop(false);\n setMobileNavOpen(false);\n }\n }, [isSmallOrAbove, mobileNavOpen]);\n\n const appShellJSX = (\n <Flex\n {...restProps}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n ref={navRef}\n as={StyledAppNav}\n appHeader={showAppHeader}\n navOpen={mobileNavOpen}\n showEnv={!!envName}\n onFocus={onFocus}\n >\n {envName && (\n <StyledAppEnvironment\n item={{ shrink: 0 }}\n color={envColor ?? theme.base.colors.red['extra-light']}\n >\n {envName}\n </StyledAppEnvironment>\n )}\n\n {!showAppHeader && (\n <>\n <StyledAppInfo\n as={Grid}\n forwardedAs={appInfoAs}\n variant='link'\n href={appInfoHref}\n onClick={appInfoOnClick}\n aria-label={`${appName}${portalName ? ` - ${portalName}` : ''}`}\n {...appInfoRestProps}\n container={{\n alignItems: 'center',\n areas: portalName ? '\"logo app\" \"logo portal\"' : '\"logo app\"'\n }}\n ref={setAppInfoEl}\n >\n <Grid item={{ area: 'logo' }} as={Image} src={logoSrc} alt={appName} />\n <Grid item={{ area: 'app' }} as='span'>\n {appName}\n </Grid>\n {portalName && (\n <Grid item={{ area: 'portal' }} as='span'>\n {portalName}\n </Grid>\n )}\n </StyledAppInfo>\n {navState === 'closed' && (\n <Tooltip\n target={appInfoEl}\n placement='right'\n as={StyledAppShellTooltip}\n showDelay='none'\n hideDelay='none'\n >\n {appName}\n </Tooltip>\n )}\n </>\n )}\n\n {searchInput && !showAppHeader && (\n <AppShellSearch\n searchLabel={searchLabel}\n collapsed={!mobileNavOpen && ['closed', 'closing'].includes(navState)}\n searchInput={searchInput}\n />\n )}\n\n <StyledScrollWrap\n onClick={\n isSmallOrAbove\n ? () => {\n if (['closing', 'closed'].includes(navState)) {\n openNav(0);\n } else {\n closeNav(0);\n }\n }\n : undefined\n }\n >\n {caseTypes && caseTypes.length > 0 && <CaseTypes caseTypes={caseTypes} />}\n {links && <Links links={links} />}\n {cases && <Cases cases={cases} />}\n </StyledScrollWrap>\n\n <Utils appHeader={showAppHeader} operator={operator} items={utils} />\n {!mobileNavOpen && (\n <Flex container={{ justify: 'center' }}>\n <StyledAppShellToggleButton\n icon\n ref={setExpandCollapseEl}\n compact\n variant='simple'\n onClick={() => {\n setNavState(navState === 'closed' ? 'open' : 'closed');\n }}\n open={['open', 'opening'].includes(navState)}\n aria-label={navState === 'closed' ? t('expand') : t('collapse')}\n >\n {['closed', 'closing'].includes(navState) ? (\n <Icon name={`arrow-micro-${end}`} />\n ) : (\n <Icon name={`arrow-micro-${start}`} />\n )}\n </StyledAppShellToggleButton>\n {['open', 'closed'].includes(navState) && (\n <Tooltip\n target={expandCollapseEl}\n placement='right'\n as={StyledAppShellTooltip}\n showDelay='none'\n hideDelay='none'\n >\n {navState === 'closed' ? t('expand') : t('collapse')}\n </Tooltip>\n )}\n </Flex>\n )}\n </Flex>\n );\n\n return (\n <AppShellContext.Provider\n value={useMemo(\n () => ({\n navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',\n navState,\n focusedImperatively,\n headerEl: headerEl || mobileHeaderEl,\n previewTriggerRef,\n searchContainerEl,\n setSearchContainerEl\n }),\n [navState, mobileNavOpen, headerEl, mobileHeaderEl]\n )}\n >\n <SkipNavigation />\n {showAppHeader && (\n <AppHeader\n {...appInfo}\n searchInput={searchInput}\n searchLabel={searchLabel}\n operator={operator}\n searchPage={searchPage}\n ref={setHeaderEl}\n />\n )}\n\n {isSmallOrAbove ? (\n appShellJSX\n ) : (\n <>\n <Flex as={StyledMobileNav} container={{ alignItems: 'center' }} ref={setMobileHeaderEl}>\n <Button\n variant='simple'\n onClick={() => setMobileNavBackdrop(true)}\n aria-label={t('app_shell_open_nav')}\n icon\n >\n <Icon name='bars' />\n </Button>\n </Flex>\n\n <Backdrop\n open={mobileNavBackdrop}\n transitionSpeed='none'\n onAfterTransitionIn={() => setMobileNavOpen(true)}\n onBeforeTransitionOut={() => setMobileNavOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setMobileNavOpen(false);\n }}\n >\n <Drawer\n open={mobileNavOpen}\n onAfterClose={() => {\n setMobileNavBackdrop(false);\n }}\n position='fixed'\n placement={start}\n size='min(18.75rem, calc(100vw - 3.5rem))'\n nullWhenClosed\n >\n {appShellJSX}\n </Drawer>\n </Backdrop>\n </>\n )}\n {showMainContent && (\n <StyledAppMain\n appHeader={showAppHeader}\n mobileNav={!isSmallOrAbove}\n headerOffset={isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight}\n navOpen={['open', 'opening'].includes(navState)}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledAppMain>\n )}\n </AppShellContext.Provider>\n );\n }\n);\n\nexport default AppShell;\n"]}
|
|
@@ -31,8 +31,8 @@ export declare const StyledAppMain: import("styled-components").StyledComponent<
|
|
|
31
31
|
headerOffset?: number | undefined;
|
|
32
32
|
}, never>;
|
|
33
33
|
export declare const StyledBannerRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
34
|
-
export declare const
|
|
35
|
-
export declare const
|
|
34
|
+
export declare const StyledAppShellTooltip: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
35
|
+
export declare const StyledAppShellToggleButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button").ButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {
|
|
36
36
|
open: boolean;
|
|
37
37
|
}, never>;
|
|
38
38
|
//# sourceMappingURL=AppShell.styles.d.ts.map
|
|
@@ -398,7 +398,7 @@ export const StyledBannerRegion = styled.div(({ theme }) => {
|
|
|
398
398
|
`;
|
|
399
399
|
});
|
|
400
400
|
StyledBannerRegion.defaultProps = defaultThemeProp;
|
|
401
|
-
export const
|
|
401
|
+
export const StyledAppShellTooltip = styled(StyledTooltip)(({ theme }) => {
|
|
402
402
|
return css `
|
|
403
403
|
background-color: ${theme.components.tooltip['background-color']};
|
|
404
404
|
padding: 0;
|
|
@@ -417,8 +417,8 @@ export const StyledAppshellTooltip = styled(StyledTooltip)(({ theme }) => {
|
|
|
417
417
|
}
|
|
418
418
|
`;
|
|
419
419
|
});
|
|
420
|
-
|
|
421
|
-
export const
|
|
420
|
+
StyledAppShellTooltip.defaultProps = defaultThemeProp;
|
|
421
|
+
export const StyledAppShellToggleButton = styled(Button)(({ theme, open }) => {
|
|
422
422
|
return css `
|
|
423
423
|
background-color: ${theme.base.palette.dark};
|
|
424
424
|
color: ${theme.base.palette.light};
|
|
@@ -441,5 +441,5 @@ export const StyledAppshellToggleButton = styled(Button)(({ theme, open }) => {
|
|
|
441
441
|
}
|
|
442
442
|
`;
|
|
443
443
|
});
|
|
444
|
-
|
|
444
|
+
StyledAppShellToggleButton.defaultProps = defaultThemeProp;
|
|
445
445
|
//# sourceMappingURL=AppShell.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,MAAM,MAAM,WA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GACvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvE,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC;;;;;MAK9D,cAAc;0BACM,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC;eACvD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;;;;4BAIX,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC;sBAClD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;;;GAGtD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAC9F,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI;aAClC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;;2BAEV,KAAK,CAAC,IAAI,CAAC,OAAO;MACvC,IAAI;QACN,GAAG,CAAA;;KAEF;;MAEC,UAAU;;;;;;;;oBAQI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;;GAEpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, readableColor, rgba } from 'polished';\nimport { useContext } from 'react';\n\nimport { StyledAvatar } from '../Avatar';\nimport { StyledIcon } from '../Icon';\nimport { StyledImage } from '../Image/Image';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils/utils';\nimport Flex from '../Flex';\nimport { readableHue, calculateFontSize } from '../../styles';\nimport { StyledMenuItem } from '../Menu/Menu.styles';\nimport { useDirection } from '../../hooks';\nimport { StyledBareButton } from '../Button/BareButton';\nimport Button from '../Button';\nimport { StyledTooltip } from '../Tooltip';\n\nimport AppShellContext from './AppShellContext';\n\nexport const navWidth = '4rem';\nexport const navOpenWidth = '18.75rem';\nexport const headerHeight = '3rem';\n\n/* AppShell styles */\n\nexport const StyledAppEnvironment = styled(Flex)<{ color: string }>(\n ({\n color,\n theme: {\n base: {\n spacing,\n 'font-weight': { bold }\n },\n components: {\n 'app-shell': {\n nav: { 'background-color': navColor }\n }\n }\n }\n }) => {\n const foreground = tryCatch(\n () => readableHue(color, color),\n () => readableHue(navColor, navColor)\n );\n\n const shadow = tryCatch(() => rgba(foreground, 0.1));\n\n return css`\n background-color: ${color};\n color: ${foreground};\n box-shadow: inset 0 0 0 0.0625rem ${shadow};\n height: calc(${spacing} * 2.5);\n padding: 0 ${spacing};\n text-align: center;\n text-transform: uppercase;\n font-weight: ${bold};\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n }\n);\n\nStyledAppEnvironment.defaultProps = defaultThemeProp;\n\nexport const StyledAppInfo = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const hoverColor = tryCatch(() =>\n lighten(0.05, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding: ${theme.base.spacing} calc(${navWidth} / 4);\n grid-template-columns: calc(${navWidth} / 2) auto;\n column-gap: calc(${navWidth} / 4);\n\n a&:hover,\n button&:hover {\n background-color: ${hoverColor};\n text-decoration: none;\n }\n\n &:focus:not([disabled]) {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n\n ${StyledImage} {\n display: inline-block;\n width: calc(${navWidth} / 2);\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n span:last-of-type {\n font-size: ${fontSize.xs};\n color: rgba(255, 255, 255, 0.7);\n }\n\n span:first-of-type {\n font-size: ${fontSize.s};\n color: ${theme.base.colors.white};\n }\n `;\n});\n\nStyledAppInfo.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n const { navOpen } = useContext(AppShellContext);\n\n return css`\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: ${navOpen ? 'auto' : 'hidden'};\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled.span(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n position: absolute;\n inset-inline-start: calc(4 * ${spacing});\n top: calc(0.5 * ${spacing});\n padding: 0 calc(0.5 * ${spacing});\n `;\n }\n);\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellNavIcon = styled.svg``;\nexport const StyledUtilIconCount = styled.span`\n flex-shrink: 0;\n`;\n\nexport const StyledAppNav = styled.nav<{ appHeader: boolean; showEnv: boolean }>(\n ({ appHeader, showEnv, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n background: ${theme.components['app-shell'].nav['background-color']};\n max-width: calc(100vw - ${theme.base['hit-area']['mouse-min']});\n width: ${navOpen ? navOpenWidth : navWidth};\n height: calc(100vh - ${appHeader ? headerHeight : '0rem'});\n overflow: hidden;\n white-space: nowrap;\n transition: width ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n padding-block-end: ${theme.base.spacing};\n\n ${!showEnv &&\n css`\n padding-block-start: ${theme.base.spacing};\n `}\n\n @media (pointer: coarse) {\n max-width: calc(100vw - ${theme.base['hit-area']['finger-min']});\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${theme.base['border-radius']});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n `;\n }\n);\n\nStyledAppNav.defaultProps = defaultThemeProp;\n\nexport const StyledCaseClose = styled.button``;\n\nexport const StyledNavListItem = styled.li<{\n nestedListCollapsed: boolean;\n}>(({ theme, nestedListCollapsed }) => {\n const { navOpen } = useContext(AppShellContext);\n const activeBackground = tryCatch(() =>\n rgba('#000000', theme.base.transparency['transparent-4'])\n );\n\n const { rtl } = useDirection();\n\n return css`\n display: block;\n position: relative;\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n ${StyledCaseClose} {\n display: flex;\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n opacity: 0;\n &:hover,\n &:focus {\n ${navOpen &&\n css`\n opacity: 1;\n `}\n }\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n top: 50%;\n bottom: 50%;\n margin: auto 0;\n color: rgba(255, 255, 255, 0.7);\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n }\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: rgba(255, 255, 255, 0.7);\n cursor: pointer;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n text-decoration: none;\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n color: inherit;\n white-space: nowrap;\n }\n\n &:hover,\n &:focus {\n color: #ffffff;\n background: rgba(255, 255, 255, 0.05);\n }\n\n &:hover + ${StyledCaseClose}, &:focus + ${StyledCaseClose} {\n ${navOpen &&\n css`\n opacity: 1;\n `}\n }\n\n &:focus {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n\n ${StyledAppShellNavIcon}:last-child {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${!nestedListCollapsed &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n }\n\n ${StyledAppShellNavIcon}:first-child {\n flex-shrink: 0;\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child {\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n }\n `;\n});\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul``;\n\nexport const StyledNavCasesList = styled.div(({ theme }) => {\n return css`\n ${StyledNavListItem} {\n > :first-child {\n padding: ${theme.base.spacing} 0;\n }\n }\n `;\n});\n\nStyledNavCasesList.defaultProps = defaultThemeProp;\n\nexport const StyledNestedNavList = styled(StyledNavList)(({ theme }) => {\n const background = tryCatch(() => rgba('#000000', theme.base.transparency['transparent-4']));\n return css`\n background: ${background};\n\n ${StyledNavListItem} {\n > :first-child {\n padding-inline-start: ${navWidth};\n font-weight: ${theme.base['font-weight'].normal};\n }\n }\n `;\n});\n\nStyledNestedNavList.defaultProps = defaultThemeProp;\n\nexport const StyledCaseTypes = styled.div(props => {\n const {\n theme: {\n base: {\n animation: {\n speed,\n timing: { ease: acceleration }\n }\n }\n }\n } = props;\n\n return css`\n button {\n ${StyledIcon}:first-of-type {\n transition: transform ${speed} ${acceleration};\n }\n\n &[aria-expanded='false'] ${StyledIcon}:first-of-type {\n transform: none;\n }\n\n &[aria-expanded='true'] ${StyledIcon}:first-of-type {\n transform: rotateZ(45deg);\n }\n }\n `;\n});\n\nStyledCaseTypes.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n return css`\n border-top: 0.0625rem solid ${borderColor};\n li ${StyledAvatar} {\n flex-shrink: 0;\n margin: 0 calc((${navWidth} - ${theme.base['hit-area']['mouse-min']}) / 2);\n font-weight: ${theme.base['font-weight'].normal};\n }\n\n ${StyledBareButton} > ${StyledIcon}:first-child, ${StyledBareButton} > ${StyledUtilIconCount} {\n flex-shrink: 0;\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\n/* Mobile AppShell styles */\n\nexport const StyledMobileNav = styled.header(({ theme }) => {\n const mobileNavColor = theme.base.palette['brand-primary'];\n\n const contrastColor = tryCatch(() => readableColor(mobileNavColor));\n\n return css`\n min-width: 100%;\n min-height: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer};\n background-color: ${mobileNavColor};\n color: ${contrastColor};\n position: sticky;\n top: 0;\n padding-inline-start: ${theme.base.spacing};\n\n @media (pointer: coarse) {\n padding-inline-start: 0;\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledLoading = styled.div`\n font-size: 2rem;\n`;\n\n/* Main content region styles */\n\nexport const StyledAppMain = styled.main<{\n appHeader: boolean;\n mobileNav: boolean;\n navOpen: boolean;\n headerOffset?: number;\n}>(({ appHeader, mobileNav, navOpen, headerOffset = 0, theme }) => {\n const heightOffset = appHeader || mobileNav ? headerHeight : '0rem';\n\n return css`\n --appshell-offset: ${headerOffset}px;\n position: relative;\n margin-inline-start: ${mobileNav ? 0 : navWidth};\n min-height: calc(100vh - ${heightOffset});\n background-color: ${theme.base.palette['app-background']};\n\n :focus {\n outline: none;\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${!mobileNav &&\n css`\n transition: margin-inline-start\n ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n `}\n `;\n});\n\nStyledAppMain.defaultProps = defaultThemeProp;\n\nexport const StyledBannerRegion = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledBannerRegion.defaultProps = defaultThemeProp;\n\nexport const StyledAppshellTooltip = styled(StyledTooltip)(({ theme }) => {\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n padding: 0;\n header {\n border-bottom: none;\n }\n ${StyledMenuItem} {\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.base.palette.light};\n\n &:hover,\n &:focus {\n background-color: ${theme.components.tooltip['background-color']};\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n }\n `;\n});\n\nStyledAppshellTooltip.defaultProps = defaultThemeProp;\n\nexport const StyledAppshellToggleButton = styled(Button)<{ open: boolean }>(({ theme, open }) => {\n return css`\n background-color: ${theme.base.palette.dark};\n color: ${theme.base.palette.light};\n border: none;\n margin-top: calc(1 * ${theme.base.spacing});\n ${open &&\n css`\n padding-inline: 1rem;\n `}\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledAppshellToggleButton.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC/B,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AAEnC,qBAAqB;AAErB,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,CAC9C,CAAC,EACC,KAAK,EACL,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAA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;;;4BAIX,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC;sBAClD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;;;GAGtD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAC9F,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI;aAClC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;;2BAEV,KAAK,CAAC,IAAI,CAAC,OAAO;MACvC,IAAI;QACN,GAAG,CAAA;;KAEF;;MAEC,UAAU;;;;;;;;oBAQI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;;GAEpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, readableColor, rgba } from 'polished';\nimport { useContext } from 'react';\n\nimport { StyledAvatar } from '../Avatar';\nimport { StyledIcon } from '../Icon';\nimport { StyledImage } from '../Image/Image';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils/utils';\nimport Flex from '../Flex';\nimport { readableHue, calculateFontSize } from '../../styles';\nimport { StyledMenuItem } from '../Menu/Menu.styles';\nimport { useDirection } from '../../hooks';\nimport { StyledBareButton } from '../Button/BareButton';\nimport Button from '../Button';\nimport { StyledTooltip } from '../Tooltip';\n\nimport AppShellContext from './AppShellContext';\n\nexport const navWidth = '4rem';\nexport const navOpenWidth = '18.75rem';\nexport const headerHeight = '3rem';\n\n/* AppShell styles */\n\nexport const StyledAppEnvironment = styled(Flex)<{ color: string }>(\n ({\n color,\n theme: {\n base: {\n spacing,\n 'font-weight': { bold }\n },\n components: {\n 'app-shell': {\n nav: { 'background-color': navColor }\n }\n }\n }\n }) => {\n const foreground = tryCatch(\n () => readableHue(color, color),\n () => readableHue(navColor, navColor)\n );\n\n const shadow = tryCatch(() => rgba(foreground, 0.1));\n\n return css`\n background-color: ${color};\n color: ${foreground};\n box-shadow: inset 0 0 0 0.0625rem ${shadow};\n height: calc(${spacing} * 2.5);\n padding: 0 ${spacing};\n text-align: center;\n text-transform: uppercase;\n font-weight: ${bold};\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n }\n);\n\nStyledAppEnvironment.defaultProps = defaultThemeProp;\n\nexport const StyledAppInfo = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const hoverColor = tryCatch(() =>\n lighten(0.05, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding: ${theme.base.spacing} calc(${navWidth} / 4);\n grid-template-columns: calc(${navWidth} / 2) auto;\n column-gap: calc(${navWidth} / 4);\n\n a&:hover,\n button&:hover {\n background-color: ${hoverColor};\n text-decoration: none;\n }\n\n &:focus:not([disabled]) {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n\n ${StyledImage} {\n display: inline-block;\n width: calc(${navWidth} / 2);\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n span:last-of-type {\n font-size: ${fontSize.xs};\n color: rgba(255, 255, 255, 0.7);\n }\n\n span:first-of-type {\n font-size: ${fontSize.s};\n color: ${theme.base.colors.white};\n }\n `;\n});\n\nStyledAppInfo.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n const { navOpen } = useContext(AppShellContext);\n\n return css`\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: ${navOpen ? 'auto' : 'hidden'};\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled.span(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n position: absolute;\n inset-inline-start: calc(4 * ${spacing});\n top: calc(0.5 * ${spacing});\n padding: 0 calc(0.5 * ${spacing});\n `;\n }\n);\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellNavIcon = styled.svg``;\nexport const StyledUtilIconCount = styled.span`\n flex-shrink: 0;\n`;\n\nexport const StyledAppNav = styled.nav<{ appHeader: boolean; showEnv: boolean }>(\n ({ appHeader, showEnv, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n background: ${theme.components['app-shell'].nav['background-color']};\n max-width: calc(100vw - ${theme.base['hit-area']['mouse-min']});\n width: ${navOpen ? navOpenWidth : navWidth};\n height: calc(100vh - ${appHeader ? headerHeight : '0rem'});\n overflow: hidden;\n white-space: nowrap;\n transition: width ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n padding-block-end: ${theme.base.spacing};\n\n ${!showEnv &&\n css`\n padding-block-start: ${theme.base.spacing};\n `}\n\n @media (pointer: coarse) {\n max-width: calc(100vw - ${theme.base['hit-area']['finger-min']});\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${theme.base['border-radius']});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n `;\n }\n);\n\nStyledAppNav.defaultProps = defaultThemeProp;\n\nexport const StyledCaseClose = styled.button``;\n\nexport const StyledNavListItem = styled.li<{\n nestedListCollapsed: boolean;\n}>(({ theme, nestedListCollapsed }) => {\n const { navOpen } = useContext(AppShellContext);\n const activeBackground = tryCatch(() =>\n rgba('#000000', theme.base.transparency['transparent-4'])\n );\n\n const { rtl } = useDirection();\n\n return css`\n display: block;\n position: relative;\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n ${StyledCaseClose} {\n display: flex;\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n opacity: 0;\n &:hover,\n &:focus {\n ${navOpen &&\n css`\n opacity: 1;\n `}\n }\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n top: 50%;\n bottom: 50%;\n margin: auto 0;\n color: rgba(255, 255, 255, 0.7);\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n }\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding: calc(1.25 * ${theme.base.spacing}) 0;\n white-space: nowrap;\n color: rgba(255, 255, 255, 0.7);\n cursor: pointer;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n text-decoration: none;\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n color: inherit;\n white-space: nowrap;\n }\n\n &:hover,\n &:focus {\n color: #ffffff;\n background: rgba(255, 255, 255, 0.05);\n }\n\n &:hover + ${StyledCaseClose}, &:focus + ${StyledCaseClose} {\n ${navOpen &&\n css`\n opacity: 1;\n `}\n }\n\n &:focus {\n outline: none;\n box-shadow: inset ${theme.base.shadow['focus-inverted']};\n }\n\n ${StyledAppShellNavIcon}:last-child {\n position: absolute;\n left: ${navOpen ? 'auto' : '100%'};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n `}\n margin: 0;\n opacity: ${navOpen ? '1' : '0'};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${!nestedListCollapsed &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n }\n\n ${StyledAppShellNavIcon}:first-child {\n flex-shrink: 0;\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child {\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n }\n `;\n});\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul``;\n\nexport const StyledNavCasesList = styled.div(({ theme }) => {\n return css`\n ${StyledNavListItem} {\n > :first-child {\n padding: ${theme.base.spacing} 0;\n }\n }\n `;\n});\n\nStyledNavCasesList.defaultProps = defaultThemeProp;\n\nexport const StyledNestedNavList = styled(StyledNavList)(({ theme }) => {\n const background = tryCatch(() => rgba('#000000', theme.base.transparency['transparent-4']));\n return css`\n background: ${background};\n\n ${StyledNavListItem} {\n > :first-child {\n padding-inline-start: ${navWidth};\n font-weight: ${theme.base['font-weight'].normal};\n }\n }\n `;\n});\n\nStyledNestedNavList.defaultProps = defaultThemeProp;\n\nexport const StyledCaseTypes = styled.div(props => {\n const {\n theme: {\n base: {\n animation: {\n speed,\n timing: { ease: acceleration }\n }\n }\n }\n } = props;\n\n return css`\n button {\n ${StyledIcon}:first-of-type {\n transition: transform ${speed} ${acceleration};\n }\n\n &[aria-expanded='false'] ${StyledIcon}:first-of-type {\n transform: none;\n }\n\n &[aria-expanded='true'] ${StyledIcon}:first-of-type {\n transform: rotateZ(45deg);\n }\n }\n `;\n});\n\nStyledCaseTypes.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n return css`\n border-top: 0.0625rem solid ${borderColor};\n li ${StyledAvatar} {\n flex-shrink: 0;\n margin: 0 calc((${navWidth} - ${theme.base['hit-area']['mouse-min']}) / 2);\n font-weight: ${theme.base['font-weight'].normal};\n }\n\n ${StyledBareButton} > ${StyledIcon}:first-child, ${StyledBareButton} > ${StyledUtilIconCount} {\n flex-shrink: 0;\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\n/* Mobile AppShell styles */\n\nexport const StyledMobileNav = styled.header(({ theme }) => {\n const mobileNavColor = theme.base.palette['brand-primary'];\n\n const contrastColor = tryCatch(() => readableColor(mobileNavColor));\n\n return css`\n min-width: 100%;\n min-height: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer};\n background-color: ${mobileNavColor};\n color: ${contrastColor};\n position: sticky;\n top: 0;\n padding-inline-start: ${theme.base.spacing};\n\n @media (pointer: coarse) {\n padding-inline-start: 0;\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledLoading = styled.div`\n font-size: 2rem;\n`;\n\n/* Main content region styles */\n\nexport const StyledAppMain = styled.main<{\n appHeader: boolean;\n mobileNav: boolean;\n navOpen: boolean;\n headerOffset?: number;\n}>(({ appHeader, mobileNav, navOpen, headerOffset = 0, theme }) => {\n const heightOffset = appHeader || mobileNav ? headerHeight : '0rem';\n\n return css`\n --appshell-offset: ${headerOffset}px;\n position: relative;\n margin-inline-start: ${mobileNav ? 0 : navWidth};\n min-height: calc(100vh - ${heightOffset});\n background-color: ${theme.base.palette['app-background']};\n\n :focus {\n outline: none;\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${!mobileNav &&\n css`\n transition: margin-inline-start\n ${`${theme.base.animation.speed} ${theme.base.animation.timing.ease}`};\n `}\n `;\n});\n\nStyledAppMain.defaultProps = defaultThemeProp;\n\nexport const StyledBannerRegion = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledBannerRegion.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellTooltip = styled(StyledTooltip)(({ theme }) => {\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n padding: 0;\n header {\n border-bottom: none;\n }\n ${StyledMenuItem} {\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.base.palette.light};\n\n &:hover,\n &:focus {\n background-color: ${theme.components.tooltip['background-color']};\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n }\n `;\n});\n\nStyledAppShellTooltip.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)<{ open: boolean }>(({ theme, open }) => {\n return css`\n background-color: ${theme.base.palette.dark};\n color: ${theme.base.palette.light};\n border: none;\n margin-top: calc(1 * ${theme.base.spacing});\n ${open &&\n css`\n padding-inline: 1rem;\n `}\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n font-weight: bold;\n }\n\n &:enabled:focus,\n :not([disabled]):focus {\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyboardEvent, MouseEvent, MouseEventHandler, ReactNode, Ref } from 'react';
|
|
1
|
+
import { KeyboardEvent, MouseEvent, MouseEventHandler, ReactElement, ReactNode, Ref, RefObject } from 'react';
|
|
2
2
|
import { AsProp, BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
3
|
import { ImageProps } from '../Image';
|
|
4
4
|
import { SearchInputProps } from '../SearchInput';
|
|
@@ -19,7 +19,7 @@ export interface AppInfoProps {
|
|
|
19
19
|
/** Specifies where to open the link href. */
|
|
20
20
|
target?: string;
|
|
21
21
|
}
|
|
22
|
-
export interface AppShellProps extends BaseProps,
|
|
22
|
+
export interface AppShellProps extends BaseProps, NoChildrenProp {
|
|
23
23
|
/** Props related to the App Shell header. */
|
|
24
24
|
appInfo: AppInfoProps;
|
|
25
25
|
/** The content of the application. */
|
|
@@ -50,7 +50,7 @@ export interface AppShellProps extends BaseProps, AppShellDrawerProps, NoChildre
|
|
|
50
50
|
color?: string;
|
|
51
51
|
};
|
|
52
52
|
/** A set of app utilities like notifications, recents that renders at the bottom of AppShell */
|
|
53
|
-
utils?: UtilItemProps[];
|
|
53
|
+
utils?: (UtilItemProps | ReactElement)[];
|
|
54
54
|
/** Banners will render above the main content if they are provided. */
|
|
55
55
|
banners?: ReactNode;
|
|
56
56
|
defaultExpanded?: boolean;
|
|
@@ -118,11 +118,11 @@ export interface UtilsProps {
|
|
|
118
118
|
/** The active user of the application. */
|
|
119
119
|
operator: AppShellProps['operator'];
|
|
120
120
|
/** A set of app utilities like notifications, recents that renders at the bottom of AppShell */
|
|
121
|
-
items?: UtilItemProps[];
|
|
121
|
+
items?: (UtilItemProps | ReactElement)[];
|
|
122
122
|
appHeader?: boolean;
|
|
123
123
|
}
|
|
124
124
|
export interface NavListProps extends AsProp, BaseProps {
|
|
125
|
-
items?: NavListItemProps[];
|
|
125
|
+
items?: (NavListItemProps | ReactElement)[];
|
|
126
126
|
nestedList?: boolean;
|
|
127
127
|
collapsed?: boolean;
|
|
128
128
|
id?: string;
|
|
@@ -133,18 +133,16 @@ export interface NavListItemWrapperProps extends ForwardProps {
|
|
|
133
133
|
content?: ReactNode;
|
|
134
134
|
items?: NavListItemProps[];
|
|
135
135
|
onMenuToggle?: (state: 'open' | 'close') => void;
|
|
136
|
-
|
|
137
|
-
childrenElement: HTMLElement | null;
|
|
136
|
+
childElementRef: RefObject<HTMLElement>;
|
|
138
137
|
}
|
|
139
|
-
export interface NavListItemProps extends AsProp, BaseProps, ForwardProps {
|
|
138
|
+
export interface NavListItemProps extends AsProp, BaseProps, ForwardProps, NoChildrenProp {
|
|
140
139
|
id?: string;
|
|
141
140
|
visual?: ReactNode;
|
|
142
141
|
primary: string;
|
|
143
142
|
secondary?: string;
|
|
144
143
|
href?: string;
|
|
145
144
|
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;
|
|
146
|
-
|
|
147
|
-
items?: NavListProps['items'];
|
|
145
|
+
items?: NavListItemProps[];
|
|
148
146
|
collapseItems?: boolean;
|
|
149
147
|
actions?: OperatorProps['actions'];
|
|
150
148
|
dismissible?: boolean;
|
|
@@ -235,14 +233,6 @@ export interface PinsListProps {
|
|
|
235
233
|
/** Callback function that runs when an item is clicked on. */
|
|
236
234
|
onItemClick?: DrawerListProps['onItemClick'];
|
|
237
235
|
}
|
|
238
|
-
export interface AppShellDrawerProps {
|
|
239
|
-
/** A list of notifications and handler functions. */
|
|
240
|
-
notifications?: NotificationListProps;
|
|
241
|
-
/** A list of recently visited items and handler functions. */
|
|
242
|
-
recents?: RecentsListProps;
|
|
243
|
-
/** A list of pinned items to display above recent items and handler functions. */
|
|
244
|
-
pins?: PinsListProps;
|
|
245
|
-
}
|
|
246
236
|
export interface DrawerItemProps extends BaseProps {
|
|
247
237
|
/** An id representing the item. */
|
|
248
238
|
id: string;
|