@pega/cosmos-react-build 4.0.0-dev.7.0 → 4.0.0-dev.8.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 +3 -2
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +41 -79
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +10 -15
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +153 -248
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +57 -30
- 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.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +3 -5
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts +6 -0
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
- package/lib/components/AppShell/NavigationList.js +91 -0
- package/lib/components/AppShell/NavigationList.js.map +1 -0
- package/lib/components/AppShell/index.d.ts +1 -1
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +5 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +10 -3
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.js +10 -28
- package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +0 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.js +5 -16
- package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts +2 -0
- package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,247 +1,122 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { lighten,
|
|
2
|
+
import { lighten, rgba } from 'polished';
|
|
3
3
|
import { useContext } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { StyledBareButton } from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
7
|
-
import { StyledNodeIcon, StyledNodeText, StyledNodeInteraction, StyledStandardTree } from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';
|
|
4
|
+
import { tryCatch, defaultThemeProp, Button, StyledIcon, useDirection, calculateFontSize } from '@pega/cosmos-react-core';
|
|
5
|
+
import { StyledToggleIcon, StyledNodeText, StyledNodeInteraction, StyledStandardTree } from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';
|
|
8
6
|
import AppShellContext from './AppShellContext';
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return css `
|
|
13
|
-
position: absolute;
|
|
14
|
-
z-index: 1;
|
|
15
|
-
inset-block-start: calc(2 * ${theme.base.spacing});
|
|
16
|
-
inset-inline-end: 0;
|
|
17
|
-
min-width: 1.5rem;
|
|
18
|
-
min-height: 1.5rem;
|
|
19
|
-
border: none;
|
|
20
|
-
color: ${theme.base.palette['foreground-color']};
|
|
21
|
-
box-shadow: ${theme.base.shadow.low};
|
|
22
|
-
border-radius: 50%;
|
|
23
|
-
transition-property: background-color;
|
|
24
|
-
transform: translateX(${ltr ? '50%' : '-50%'});
|
|
25
|
-
|
|
26
|
-
${StyledIcon} {
|
|
27
|
-
width: 1.5rem;
|
|
28
|
-
height: 1.5rem;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&[aria-expanded='${ltr ? 'true' : 'false'}'] {
|
|
32
|
-
${StyledIcon} {
|
|
33
|
-
transform: rotateY(180deg);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
});
|
|
38
|
-
StyledNavToggle.defaultProps = defaultThemeProp;
|
|
39
|
-
export const StyledHeader = styled.div(({ theme }) => {
|
|
40
|
-
const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
|
|
41
|
-
return css `
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: auto;
|
|
44
|
-
border-bottom: 0.0625rem solid ${borderColor};
|
|
45
|
-
transition: height ${theme.base.animation.speed} ${theme.base.animation.timing['ease-out']};
|
|
46
|
-
padding: calc(1.2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});
|
|
47
|
-
|
|
48
|
-
div {
|
|
49
|
-
min-width: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
li {
|
|
53
|
-
color: ${theme.base.palette.info};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
${StyledAvatar} {
|
|
57
|
-
flex-shrink: 0;
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
|
-
});
|
|
61
|
-
StyledHeader.defaultProps = defaultThemeProp;
|
|
62
|
-
export const StyledDrawerHeader = styled(StyledHeader)(({ theme }) => {
|
|
63
|
-
return css `
|
|
64
|
-
padding: calc(2 * ${theme.base.spacing});
|
|
65
|
-
padding-inline-start: ${theme.base.spacing};
|
|
66
|
-
`;
|
|
67
|
-
});
|
|
68
|
-
StyledDrawerHeader.defaultProps = defaultThemeProp;
|
|
69
|
-
export const StyledNavHeaderIcon = styled(Icon)(({ theme }) => {
|
|
70
|
-
return css `
|
|
71
|
-
color: ${theme.base.colors.white};
|
|
72
|
-
`;
|
|
73
|
-
});
|
|
74
|
-
StyledNavHeaderIcon.defaultProps = defaultThemeProp;
|
|
75
|
-
export const StyledNavTitle = styled(Text)(({ theme }) => {
|
|
76
|
-
return css `
|
|
77
|
-
color: ${theme.base.colors.white};
|
|
78
|
-
word-break: break-word;
|
|
79
|
-
`;
|
|
80
|
-
});
|
|
81
|
-
StyledNavTitle.defaultProps = defaultThemeProp;
|
|
82
|
-
export const StyledUtils = styled.div(({ theme, showDevMode }) => {
|
|
7
|
+
const navWidth = '3rem';
|
|
8
|
+
const navOpenWidth = '14rem';
|
|
9
|
+
export const StyledUtils = styled.div(({ theme }) => {
|
|
83
10
|
const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
|
|
84
11
|
return css `
|
|
85
|
-
padding-
|
|
86
|
-
border-
|
|
87
|
-
${StyledSwitch} {
|
|
88
|
-
&:hover {
|
|
89
|
-
background-color: ${hoverBg};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
${SwitchLabel} {
|
|
93
|
-
height: calc(2rem + 4 * ${theme.base.spacing});
|
|
94
|
-
padding: calc(2 * ${theme.base.spacing});
|
|
95
|
-
text-transform: capitalize;
|
|
96
|
-
color: ${theme.base.colors.gray.light};
|
|
97
|
-
font-weight: ${theme.base['font-weight'].bold};
|
|
98
|
-
|
|
99
|
-
&::before,
|
|
100
|
-
&::after {
|
|
101
|
-
margin-inline-end: calc(2 * ${theme.base.spacing});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
& > ul {
|
|
106
|
-
list-style: none;
|
|
107
|
-
}
|
|
12
|
+
padding-block: ${theme.base.spacing};
|
|
13
|
+
border-block-start: 0.0625rem solid ${borderColor};
|
|
108
14
|
`;
|
|
109
15
|
});
|
|
110
16
|
StyledUtils.defaultProps = defaultThemeProp;
|
|
111
|
-
export const
|
|
17
|
+
export const StyledAppShellToggleButton = styled(Button)(({ theme, open }) => {
|
|
112
18
|
return css `
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
& > ${StyledBareButton} {
|
|
117
|
-
color: ${theme.base.colors.blue.light};
|
|
118
|
-
}
|
|
119
|
-
}
|
|
19
|
+
background-color: ${theme.base.palette.dark};
|
|
20
|
+
color: ${theme.base.palette.light};
|
|
21
|
+
border: none;
|
|
120
22
|
|
|
121
|
-
${
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
height: 100%;
|
|
126
|
-
text-align: start;
|
|
127
|
-
padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});
|
|
23
|
+
${open &&
|
|
24
|
+
css `
|
|
25
|
+
padding-inline: 1rem;
|
|
26
|
+
`}
|
|
128
27
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
28
|
+
${StyledIcon} {
|
|
29
|
+
width: 1.25rem;
|
|
30
|
+
height: 1.25rem;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
}
|
|
132
33
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
34
|
+
&:enabled:focus,
|
|
35
|
+
:not([disabled]):focus {
|
|
36
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
136
37
|
}
|
|
137
38
|
`;
|
|
138
39
|
});
|
|
139
|
-
|
|
40
|
+
StyledAppShellToggleButton.defaultProps = defaultThemeProp;
|
|
140
41
|
export const StyledScrollWrap = styled.div(() => {
|
|
141
|
-
const { drawerOpen } = useContext(AppShellContext);
|
|
142
42
|
return css `
|
|
143
|
-
height:
|
|
43
|
+
height: 100%;
|
|
144
44
|
overflow-y: auto;
|
|
145
45
|
`;
|
|
146
46
|
});
|
|
147
47
|
StyledScrollWrap.defaultProps = defaultThemeProp;
|
|
148
|
-
export const
|
|
149
|
-
const { navState } = useContext(AppShellContext);
|
|
150
|
-
return css `
|
|
151
|
-
width: 14rem;
|
|
152
|
-
height: 100%;
|
|
153
|
-
opacity: 0;
|
|
154
|
-
transition: opacity ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
|
|
155
|
-
|
|
156
|
-
${navState === 'collapsed' &&
|
|
157
|
-
css `
|
|
158
|
-
display: none;
|
|
159
|
-
`}
|
|
160
|
-
|
|
161
|
-
${(navState === 'expanding' || navState === 'expanded') &&
|
|
162
|
-
css `
|
|
163
|
-
opacity: 1;
|
|
164
|
-
`}
|
|
165
|
-
`;
|
|
166
|
-
});
|
|
167
|
-
StyledNavContent.defaultProps = defaultThemeProp;
|
|
168
|
-
export const StyledMain = styled.main(({ theme: { base: { animation, breakpoints, palette } } }) => {
|
|
48
|
+
export const StyledMain = styled.main(({ navOpen, theme: { base: { animation, breakpoints, palette } } }) => {
|
|
169
49
|
return css `
|
|
170
50
|
position: relative;
|
|
171
51
|
min-height: calc(100vh - 6rem);
|
|
172
52
|
background-color: ${palette['app-background']};
|
|
173
|
-
|
|
53
|
+
margin-inline-start: ${navWidth};
|
|
54
|
+
transition: margin-inline-start ${`${animation.speed} ${animation.timing.ease}`};
|
|
174
55
|
|
|
175
56
|
@media (pointer: coarse) {
|
|
176
57
|
min-height: calc(100vh - 8rem);
|
|
177
58
|
}
|
|
178
59
|
|
|
179
60
|
@media (min-width: ${breakpoints.md}) {
|
|
180
|
-
|
|
61
|
+
height: calc(100vh - 3rem);
|
|
181
62
|
}
|
|
182
|
-
`;
|
|
183
|
-
});
|
|
184
|
-
StyledMain.defaultProps = defaultThemeProp;
|
|
185
|
-
export const StyledDrawerWrapper = styled.div(() => {
|
|
186
|
-
const { drawerOpen } = useContext(AppShellContext);
|
|
187
|
-
return css `
|
|
188
|
-
position: relative;
|
|
189
|
-
z-index: 1;
|
|
190
|
-
height: ${drawerOpen ? '100%' : 'auto'};
|
|
191
|
-
`;
|
|
192
|
-
});
|
|
193
|
-
StyledDrawerWrapper.defaultProps = defaultThemeProp;
|
|
194
|
-
export const StyledNavHeaderVisual = styled.div(({ theme, bgColor }) => {
|
|
195
|
-
return css `
|
|
196
|
-
min-width: 2rem;
|
|
197
|
-
min-height: 2rem;
|
|
198
|
-
border-radius: 0.4rem;
|
|
199
|
-
background-color: ${bgColor};
|
|
200
|
-
margin-inline-end: ${theme.base.spacing};
|
|
201
|
-
color: ${theme.base.colors.white};
|
|
202
|
-
& svg {
|
|
203
|
-
color: ${theme.base.colors.white};
|
|
204
|
-
}
|
|
205
|
-
`;
|
|
206
|
-
});
|
|
207
|
-
StyledNavHeaderVisual.defaultProps = defaultThemeProp;
|
|
208
|
-
export const StyledDrawerCloseButton = styled(Button)(({ theme }) => {
|
|
209
|
-
return css `
|
|
210
|
-
margin-inline-end: ${theme.base.spacing};
|
|
211
|
-
min-width: 1.5rem;
|
|
212
|
-
min-height: 1.5rem;
|
|
213
|
-
color: ${theme.base.colors.white};
|
|
214
63
|
|
|
215
|
-
|
|
216
|
-
width: 1em;
|
|
217
|
-
height: 1em;
|
|
218
|
-
}
|
|
219
|
-
`;
|
|
220
|
-
});
|
|
221
|
-
StyledDrawerCloseButton.defaultProps = defaultThemeProp;
|
|
222
|
-
export const StyledInnerNav = styled.div(() => {
|
|
223
|
-
const { navState } = useContext(AppShellContext);
|
|
224
|
-
return css `
|
|
225
|
-
height: 100%;
|
|
226
|
-
${(navState === 'collapsing' || navState === 'expanding') &&
|
|
64
|
+
${navOpen &&
|
|
227
65
|
css `
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
66
|
+
margin-inline-start: ${navOpenWidth};
|
|
67
|
+
`}
|
|
68
|
+
`;
|
|
231
69
|
});
|
|
232
|
-
|
|
233
|
-
export const StyledNav = styled.nav(({ theme: { base: { breakpoints, colors, animation, spacing, 'custom-scrollbar': customScrollbar, 'border-radius': borderRadius, 'font-
|
|
70
|
+
StyledMain.defaultProps = defaultThemeProp;
|
|
71
|
+
export const StyledNav = styled.nav(({ theme: { base: { breakpoints, colors, palette, animation, spacing, shadow, 'custom-scrollbar': customScrollbar, 'border-radius': borderRadius, 'font-size': fontSize, 'font-scale': fontScale }, components: { 'app-shell': appShell } } }) => {
|
|
234
72
|
const { navState } = useContext(AppShellContext);
|
|
73
|
+
const fontSizes = calculateFontSize(fontSize, fontScale);
|
|
235
74
|
return css `
|
|
236
75
|
position: fixed;
|
|
237
76
|
z-index: 1;
|
|
238
77
|
height: calc(100vh - 6rem);
|
|
239
78
|
background: ${appShell.nav['background-color']};
|
|
79
|
+
width: ${navState === 'opening' || navState === 'open' ? navOpenWidth : navWidth};
|
|
80
|
+
transition: width ${animation.speed} ${animation.timing.ease};
|
|
81
|
+
display: flex;
|
|
82
|
+
|
|
83
|
+
${StyledStandardTree} {
|
|
84
|
+
background-color: ${palette.dark};
|
|
85
|
+
|
|
86
|
+
${StyledNodeText}, ${StyledToggleIcon} {
|
|
87
|
+
color: rgba(255, 255, 255, 0.7);
|
|
88
|
+
font-size: ${fontSizes.xxs};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
${StyledNodeInteraction} {
|
|
92
|
+
padding-block-start: calc(0.5 * ${spacing});
|
|
93
|
+
padding-block-end: calc(0.5 * ${spacing});
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
background: rgba(255, 255, 255, 0.1);
|
|
97
|
+
|
|
98
|
+
${StyledNodeText} {
|
|
99
|
+
color: ${palette.light};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:focus {
|
|
104
|
+
box-shadow: ${shadow['focus-inset']};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&[aria-current='page'],
|
|
108
|
+
&[aria-current='true'] {
|
|
109
|
+
background: rgba(255, 255, 255, 0.05);
|
|
110
|
+
|
|
111
|
+
${StyledNodeText} {
|
|
112
|
+
color: ${colors.blue.light};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
240
116
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
transition: width ${animation.speed} ${animation.timing.ease};
|
|
117
|
+
&:has(:focus-visible) {
|
|
118
|
+
box-shadow: inset 0 0 0 0.125rem #71c1ff99;
|
|
119
|
+
}
|
|
245
120
|
}
|
|
246
121
|
|
|
247
122
|
${customScrollbar &&
|
|
@@ -296,65 +171,95 @@ export const StyledNav = styled.nav(({ theme: { base: { breakpoints, colors, ani
|
|
|
296
171
|
}
|
|
297
172
|
`}
|
|
298
173
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
${hideVisually}
|
|
302
|
-
}
|
|
174
|
+
@media (pointer: coarse) {
|
|
175
|
+
height: calc(100vh - 8rem);
|
|
303
176
|
}
|
|
304
177
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
* As the collpase button straddles the nav boundary, so maybe too should the hoverable area.
|
|
308
|
-
*/
|
|
309
|
-
&::after {
|
|
310
|
-
content: '';
|
|
311
|
-
display: block;
|
|
312
|
-
position: absolute;
|
|
313
|
-
inset-block-start: 0;
|
|
314
|
-
inset-inline-start: 100%;
|
|
315
|
-
width: calc(2 * ${spacing});
|
|
316
|
-
height: 100%;
|
|
178
|
+
@media (min-width: ${breakpoints.md}) {
|
|
179
|
+
height: calc(100vh - 3rem);
|
|
317
180
|
}
|
|
181
|
+
`;
|
|
182
|
+
});
|
|
183
|
+
StyledNav.defaultProps = defaultThemeProp;
|
|
184
|
+
export const StyledAppShellCaretIcon = styled.svg(({ nestedListCollapsed, theme }) => {
|
|
185
|
+
const { rtl } = useDirection();
|
|
186
|
+
return css `
|
|
187
|
+
transition-property: transform;
|
|
188
|
+
transition-duration: ${theme.base.animation.speed};
|
|
189
|
+
transition-timing-function: ${theme.base.animation.timing.ease};
|
|
318
190
|
|
|
319
|
-
${
|
|
320
|
-
|
|
191
|
+
${nestedListCollapsed === false &&
|
|
192
|
+
css `
|
|
193
|
+
transform: rotateZ(${rtl ? '-90deg' : '90deg'});
|
|
194
|
+
`}
|
|
195
|
+
`;
|
|
196
|
+
});
|
|
197
|
+
StyledAppShellCaretIcon.defaultProps = defaultThemeProp;
|
|
198
|
+
export const StyledNavListItem = styled.li(({ theme }) => {
|
|
199
|
+
const { navOpen } = useContext(AppShellContext);
|
|
200
|
+
const activeBackground = tryCatch(() => rgba('#000000', theme.base.transparency['transparent-4']));
|
|
201
|
+
return css `
|
|
202
|
+
display: block;
|
|
203
|
+
position: relative;
|
|
204
|
+
${StyledIcon} {
|
|
205
|
+
font-size: 1.25rem;
|
|
206
|
+
}
|
|
321
207
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
208
|
+
> :first-child {
|
|
209
|
+
position: relative;
|
|
210
|
+
display: flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
width: 100%;
|
|
213
|
+
padding: calc(1.25 * ${theme.base.spacing}) 0;
|
|
214
|
+
white-space: nowrap;
|
|
215
|
+
color: rgba(255, 255, 255, 0.7);
|
|
216
|
+
cursor: pointer;
|
|
217
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
218
|
+
text-decoration: none;
|
|
325
219
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
&[aria-current='true'] {
|
|
331
|
-
background-color: ${hoverBg};
|
|
332
|
-
}
|
|
220
|
+
span {
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
color: inherit;
|
|
223
|
+
}
|
|
333
224
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
225
|
+
&:hover,
|
|
226
|
+
&:focus {
|
|
227
|
+
color: ${theme.base.palette.light};
|
|
228
|
+
background: rgba(255, 255, 255, 0.05);
|
|
341
229
|
}
|
|
342
230
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
? '14rem'
|
|
347
|
-
: '1.5rem'};
|
|
231
|
+
&:focus {
|
|
232
|
+
outline: none;
|
|
233
|
+
box-shadow: ${theme.base.shadow['focus-inset']};
|
|
348
234
|
}
|
|
349
235
|
|
|
350
|
-
|
|
351
|
-
|
|
236
|
+
${StyledAppShellCaretIcon}:last-child {
|
|
237
|
+
position: absolute;
|
|
238
|
+
left: ${navOpen ? 'auto' : '100%'};
|
|
239
|
+
${navOpen &&
|
|
240
|
+
css `
|
|
241
|
+
inset-inline-end: 1rem;
|
|
242
|
+
`}
|
|
243
|
+
margin: 0;
|
|
244
|
+
opacity: ${navOpen ? '1' : '0'};
|
|
245
|
+
transition-property: opacity;
|
|
352
246
|
}
|
|
353
247
|
|
|
354
|
-
|
|
355
|
-
|
|
248
|
+
${StyledIcon}:first-child {
|
|
249
|
+
flex-shrink: 0;
|
|
250
|
+
margin: 0 calc((${navWidth} - 1.125rem) / 2);
|
|
356
251
|
}
|
|
357
|
-
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
&[aria-current='page'] > :first-child,
|
|
255
|
+
&[aria-current='true'] > :first-child,
|
|
256
|
+
&:has([aria-current='page']) > :first-child,
|
|
257
|
+
&:has([aria-current='true']) > :first-child {
|
|
258
|
+
color: ${theme.base.colors.blue.light};
|
|
259
|
+
background-color: ${activeBackground};
|
|
260
|
+
}
|
|
261
|
+
`;
|
|
358
262
|
});
|
|
359
|
-
|
|
263
|
+
StyledNavListItem.defaultProps = defaultThemeProp;
|
|
264
|
+
export const StyledNavList = styled.ul ``;
|
|
360
265
|
//# 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,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,UAAU,EAC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O,WAAW,CAAC,EAAE;;;KAGpC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, hideVisually } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n Icon,\n Text,\n tryCatch,\n defaultThemeProp,\n Button,\n useDirection,\n StyledIcon,\n StyledAvatar\n} from '@pega/cosmos-react-core';\nimport { StyledSwitch, SwitchLabel } from '@pega/cosmos-react-core/lib/components/Switch/Switch';\nimport { StyledBareButton } from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport {\n StyledNodeIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst hoverBg = 'rgba(0, 0, 0, 0.4)';\n\nexport const StyledNavToggle = styled(Button)(({ theme }) => {\n const { ltr } = useDirection();\n\n return css`\n position: absolute;\n z-index: 1;\n inset-block-start: calc(2 * ${theme.base.spacing});\n inset-inline-end: 0;\n min-width: 1.5rem;\n min-height: 1.5rem;\n border: none;\n color: ${theme.base.palette['foreground-color']};\n box-shadow: ${theme.base.shadow.low};\n border-radius: 50%;\n transition-property: background-color;\n transform: translateX(${ltr ? '50%' : '-50%'});\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n &[aria-expanded='${ltr ? 'true' : 'false'}'] {\n ${StyledIcon} {\n transform: rotateY(180deg);\n }\n }\n `;\n});\n\nStyledNavToggle.defaultProps = defaultThemeProp;\n\nexport const StyledHeader = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n width: 100%;\n height: auto;\n border-bottom: 0.0625rem solid ${borderColor};\n transition: height ${theme.base.animation.speed} ${theme.base.animation.timing['ease-out']};\n padding: calc(1.2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n\n div {\n min-width: 0;\n }\n\n li {\n color: ${theme.base.palette.info};\n }\n\n ${StyledAvatar} {\n flex-shrink: 0;\n }\n `;\n});\n\nStyledHeader.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerHeader = styled(StyledHeader)(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n padding-inline-start: ${theme.base.spacing};\n `;\n});\n\nStyledDrawerHeader.defaultProps = defaultThemeProp;\n\nexport const StyledNavHeaderIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.colors.white};\n `;\n});\n\nStyledNavHeaderIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavTitle = styled(Text)(({ theme }) => {\n return css`\n color: ${theme.base.colors.white};\n word-break: break-word;\n `;\n});\n\nStyledNavTitle.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div<{ showDevMode: boolean }>(({ theme, showDevMode }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-bottom: calc(${showDevMode ? 2 : 0} * ${theme.base.spacing});\n border-top: 0.0625rem solid ${borderColor};\n ${StyledSwitch} {\n &:hover {\n background-color: ${hoverBg};\n }\n\n ${SwitchLabel} {\n height: calc(2rem + 4 * ${theme.base.spacing});\n padding: calc(2 * ${theme.base.spacing});\n text-transform: capitalize;\n color: ${theme.base.colors.gray.light};\n font-weight: ${theme.base['font-weight'].bold};\n\n &::before,\n &::after {\n margin-inline-end: calc(2 * ${theme.base.spacing});\n }\n }\n }\n & > ul {\n list-style: none;\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledUtilItem = styled.li(({ theme }) => {\n return css`\n &[aria-current='true'] {\n background-color: rgba(0, 0, 0, 0.4);\n\n & > ${StyledBareButton} {\n color: ${theme.base.colors.blue.light};\n }\n }\n\n ${StyledBareButton} {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n color: ${theme.base.colors.white};\n width: 100%;\n height: 100%;\n text-align: start;\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n\n &:hover {\n background-color: rgba(0, 0, 0, 0.4);\n }\n\n &:focus {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n `;\n});\n\nStyledUtilItem.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n const { drawerOpen } = useContext(AppShellContext);\n\n return css`\n height: ${drawerOpen ? 'calc(100% - 4rem)' : '100%'};\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledNavContent = styled.div(({ theme }) => {\n const { navState } = useContext(AppShellContext);\n\n return css`\n width: 14rem;\n height: 100%;\n opacity: 0;\n transition: opacity ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n\n ${navState === 'collapsed' &&\n css`\n display: none;\n `}\n\n ${(navState === 'expanding' || navState === 'expanded') &&\n css`\n opacity: 1;\n `}\n `;\n});\n\nStyledNavContent.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main(\n ({\n theme: {\n base: { animation, breakpoints, palette }\n }\n }) => {\n return css`\n position: relative;\n min-height: calc(100vh - 6rem);\n background-color: ${palette['app-background']};\n transition: margin ${animation.speed} ${animation.timing.ease};\n\n @media (pointer: coarse) {\n min-height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n min-height: calc(100vh - 3rem);\n }\n `;\n }\n);\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerWrapper = styled.div(() => {\n const { drawerOpen } = useContext(AppShellContext);\n\n return css`\n position: relative;\n z-index: 1;\n height: ${drawerOpen ? '100%' : 'auto'};\n `;\n});\n\nStyledDrawerWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledNavHeaderVisual = styled.div<{ bgColor: string }>(({ theme, bgColor }) => {\n return css`\n min-width: 2rem;\n min-height: 2rem;\n border-radius: 0.4rem;\n background-color: ${bgColor};\n margin-inline-end: ${theme.base.spacing};\n color: ${theme.base.colors.white};\n & svg {\n color: ${theme.base.colors.white};\n }\n `;\n});\n\nStyledNavHeaderVisual.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerCloseButton = styled(Button)(({ theme }) => {\n return css`\n margin-inline-end: ${theme.base.spacing};\n min-width: 1.5rem;\n min-height: 1.5rem;\n color: ${theme.base.colors.white};\n\n ${StyledIcon} {\n width: 1em;\n height: 1em;\n }\n `;\n});\n\nStyledDrawerCloseButton.defaultProps = defaultThemeProp;\n\nexport const StyledInnerNav = styled.div(() => {\n const { navState } = useContext(AppShellContext);\n\n return css`\n height: 100%;\n ${(navState === 'collapsing' || navState === 'expanding') &&\n css`\n overflow: hidden;\n `}\n `;\n});\n\nStyledInnerNav.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(\n ({\n theme: {\n base: {\n breakpoints,\n colors,\n animation,\n spacing,\n 'custom-scrollbar': customScrollbar,\n 'border-radius': borderRadius,\n 'font-weight': fontWeight\n },\n components: { 'app-shell': appShell }\n }\n }) => {\n const { navState } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n z-index: 1;\n height: calc(100vh - 6rem);\n background: ${appShell.nav['background-color']};\n\n &,\n ${StyledInnerNav} {\n width: ${navState === 'expanding' || navState === 'expanded' ? '14' : '1.5'}rem;\n transition: width ${animation.speed} ${animation.timing.ease};\n }\n\n ${customScrollbar &&\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 * ${borderRadius});\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 &:not(:hover) {\n ${StyledNavToggle}[aria-expanded='true']:not(:focus) {\n ${hideVisually}\n }\n }\n\n /*\n * A hoverable area just outside the nav for easier mouse interaction with the collapse button.\n * As the collpase button straddles the nav boundary, so maybe too should the hoverable area.\n */\n &::after {\n content: '';\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 100%;\n width: calc(2 * ${spacing});\n height: 100%;\n }\n\n ${StyledStandardTree} {\n color: ${colors.white};\n\n ${StyledNodeText} {\n font-weight: ${fontWeight['semi-bold']};\n }\n\n ${StyledNodeInteraction} {\n padding-block-start: calc(0.5 * ${spacing});\n padding-block-end: calc(0.5 * ${spacing});\n &:hover,\n &[aria-current='true'] {\n background-color: ${hoverBg};\n }\n\n &[aria-current='true'] {\n ${StyledNodeIcon},\n ${StyledNodeText} {\n color: ${colors.blue.light};\n }\n }\n }\n }\n\n /* Style for main is here since nav(the \"&\") may be conditionally rendered. */\n & + ${StyledMain} {\n margin-inline-start: ${navState === 'expanding' || navState === 'expanded'\n ? '14rem'\n : '1.5rem'};\n }\n\n @media (pointer: coarse) {\n height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: calc(100vh - 3rem);\n }\n `;\n }\n);\n\nStyledNav.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../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AAC,OAAO;OAC9C;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvD,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,EAAE,CACrC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAC1D,CAAC;IAEF,OAAO,GAAG,CAAA;;;MAGN,UAAU;;;;;;;;;6BASa,KAAK,CAAC,IAAI,CAAC,OAAO;;;;qBAI1B,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;iBAU1C,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;;;;;;sBAMnB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;;;QAG9C,uBAAuB;;gBAEf,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;UAC/B,OAAO;QACT,GAAG,CAAA;;SAEF;;mBAEU,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;;;;QAI9B,UAAU;;0BAEQ,QAAQ;;;;;;;;eAQnB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;0BACjB,gBAAgB;;GAEvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, rgba } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n tryCatch,\n defaultThemeProp,\n Button,\n StyledIcon,\n useDirection,\n calculateFontSize\n} from '@pega/cosmos-react-core';\nimport {\n StyledToggleIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst navWidth = '3rem';\nconst navOpenWidth = '14rem';\n\nexport const StyledUtils = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-block: ${theme.base.spacing};\n border-block-start: 0.0625rem solid ${borderColor};\n `;\n});\n\nStyledUtils.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\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};\n }\n `;\n});\n\nStyledAppShellToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n return css`\n height: 100%;\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main<{\n navOpen: boolean;\n}>(\n ({\n navOpen,\n theme: {\n base: { animation, breakpoints, palette }\n }\n }) => {\n return css`\n position: relative;\n min-height: calc(100vh - 6rem);\n background-color: ${palette['app-background']};\n margin-inline-start: ${navWidth};\n transition: margin-inline-start ${`${animation.speed} ${animation.timing.ease}`};\n\n @media (pointer: coarse) {\n min-height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: calc(100vh - 3rem);\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n `;\n }\n);\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(\n ({\n theme: {\n base: {\n breakpoints,\n colors,\n palette,\n animation,\n spacing,\n shadow,\n 'custom-scrollbar': customScrollbar,\n 'border-radius': borderRadius,\n 'font-size': fontSize,\n 'font-scale': fontScale\n },\n components: { 'app-shell': appShell }\n }\n }) => {\n const { navState } = useContext(AppShellContext);\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n position: fixed;\n z-index: 1;\n height: calc(100vh - 6rem);\n background: ${appShell.nav['background-color']};\n width: ${navState === 'opening' || navState === 'open' ? navOpenWidth : navWidth};\n transition: width ${animation.speed} ${animation.timing.ease};\n display: flex;\n\n ${StyledStandardTree} {\n background-color: ${palette.dark};\n\n ${StyledNodeText}, ${StyledToggleIcon} {\n color: rgba(255, 255, 255, 0.7);\n font-size: ${fontSizes.xxs};\n }\n\n ${StyledNodeInteraction} {\n padding-block-start: calc(0.5 * ${spacing});\n padding-block-end: calc(0.5 * ${spacing});\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n\n ${StyledNodeText} {\n color: ${palette.light};\n }\n }\n\n &:focus {\n box-shadow: ${shadow['focus-inset']};\n }\n\n &[aria-current='page'],\n &[aria-current='true'] {\n background: rgba(255, 255, 255, 0.05);\n\n ${StyledNodeText} {\n color: ${colors.blue.light};\n }\n }\n }\n\n &:has(:focus-visible) {\n box-shadow: inset 0 0 0 0.125rem #71c1ff99;\n }\n }\n\n ${customScrollbar &&\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 * ${borderRadius});\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 @media (pointer: coarse) {\n height: calc(100vh - 8rem);\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: calc(100vh - 3rem);\n }\n `;\n }\n);\n\nStyledNav.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellCaretIcon = styled.svg<{ nestedListCollapsed?: boolean }>(\n ({ nestedListCollapsed, theme }) => {\n const { rtl } = useDirection();\n\n return css`\n transition-property: transform;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${nestedListCollapsed === false &&\n css`\n transform: rotateZ(${rtl ? '-90deg' : '90deg'});\n `}\n `;\n }\n);\n\nStyledAppShellCaretIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li(({ theme }) => {\n const { navOpen } = useContext(AppShellContext);\n const activeBackground = tryCatch(() =>\n rgba('#000000', theme.base.transparency['transparent-4'])\n );\n\n return css`\n display: block;\n position: relative;\n ${StyledIcon} {\n font-size: 1.25rem;\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 color: inherit;\n }\n\n &:hover,\n &:focus {\n color: ${theme.base.palette.light};\n background: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledAppShellCaretIcon}: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: opacity;\n }\n\n ${StyledIcon}:first-child {\n flex-shrink: 0;\n margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child,\n &[aria-current='true'] > :first-child,\n &:has([aria-current='page']) > :first-child,\n &:has([aria-current='true']) > :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"]}
|
|
@@ -1,40 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { AsProp, BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
+
import { openCloseStates } from '@pega/cosmos-react-core/lib/hooks/useTransitionState';
|
|
4
4
|
import { AppHeaderProps } from './Header/AppHeader.types';
|
|
5
|
-
export interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
export interface NestedNavItemProps {
|
|
6
|
+
/** Unique id for the nav item. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The display text of the nav item. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** URL or DOM id to navigate to. This will render the nav item as a link. */
|
|
11
|
+
href?: string;
|
|
12
|
+
/** Click handler for the nav item. */
|
|
13
|
+
onClick?: (id: string, e: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;
|
|
14
|
+
/** A set of nested nav items. */
|
|
15
|
+
items?: NestedNavItemProps[];
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
items
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
devMode?: boolean;
|
|
17
|
+
interface ParentNavItemProps {
|
|
18
|
+
/** A set of nested nav items. */
|
|
19
|
+
items?: NestedNavItemProps[];
|
|
20
|
+
href?: never;
|
|
21
|
+
onClick?: never;
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
interface NavLinkProps {
|
|
24
|
+
/** URL or DOM id to navigate to. This will render the nav item as a link. */
|
|
25
|
+
href?: string;
|
|
26
|
+
/** Click handler for the link. If no href if passed, this will render the nav item as a button. */
|
|
27
|
+
onClick?: (id: string, e: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;
|
|
28
|
+
items?: never;
|
|
29
|
+
}
|
|
30
|
+
export declare type NavItemProps = {
|
|
31
|
+
/** Unique id for the nav item. */
|
|
22
32
|
id: string;
|
|
33
|
+
/** The display text of the nav item. */
|
|
23
34
|
label: string;
|
|
35
|
+
/** The name of the Cosmos Icon to render as a visual. Only applies to top-level nav items. */
|
|
36
|
+
icon: string;
|
|
37
|
+
} & (ParentNavItemProps | NavLinkProps);
|
|
38
|
+
export interface NavProps {
|
|
39
|
+
/** A set of nav items that will render as a list in the App Shell. */
|
|
40
|
+
items: NavItemProps[];
|
|
41
|
+
/** The id of the active nav item. */
|
|
42
|
+
currentItemId?: NavItemProps['id'];
|
|
24
43
|
}
|
|
25
|
-
export interface
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
44
|
+
export interface AppShellProps extends NoChildrenProp {
|
|
45
|
+
/** The content of the application. */
|
|
46
|
+
main: ReactNode;
|
|
47
|
+
/** Props related to the App Shell header. */
|
|
48
|
+
appHeader: AppHeaderProps;
|
|
49
|
+
/** Props related to the App Shell side navigation. */
|
|
50
|
+
nav: NavProps;
|
|
29
51
|
}
|
|
30
52
|
export interface AppShellContextValue {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
navOpen: boolean;
|
|
54
|
+
navState: typeof openCloseStates[keyof typeof openCloseStates];
|
|
55
|
+
openNav: () => void;
|
|
56
|
+
}
|
|
57
|
+
export interface NavItemRenderProps extends AsProp, BaseProps, NoChildrenProp {
|
|
58
|
+
id: NavItemProps['id'];
|
|
59
|
+
label: NavItemProps['label'];
|
|
60
|
+
visual: ReactNode;
|
|
61
|
+
href?: NavLinkProps['href'];
|
|
62
|
+
onClick?: NavLinkProps['onClick'];
|
|
63
|
+
items?: NestedNavItemProps['items'];
|
|
64
|
+
currentItemId?: NavItemProps['id'];
|
|
39
65
|
}
|
|
66
|
+
export {};
|
|
40
67
|
//# sourceMappingURL=AppShell.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.types.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AppShell.types.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC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