@pega/cosmos-react-core 9.0.0-build.11.6 → 9.0.0-build.12.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/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +1 -1
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +13 -3
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +2 -2
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +5 -0
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +116 -42
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js +2 -2
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/AppShell/ThemeSwitcher.d.ts +4 -2
- package/lib/components/AppShell/ThemeSwitcher.d.ts.map +1 -1
- package/lib/components/AppShell/ThemeSwitcher.js +3 -3
- package/lib/components/AppShell/ThemeSwitcher.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +4 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Card/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/CardHeader.js +5 -0
- package/lib/components/Card/CardHeader.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.js +1 -1
- package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +1 -1
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.js +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
- package/lib/components/Icon/icons/information-solid.icon.js +1 -1
- package/lib/components/Icon/icons/information-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/information.icon.js +1 -1
- package/lib/components/Icon/icons/information.icon.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +15 -3
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/Phone/PhoneInput.js +1 -1
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +16 -8
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/theme/theme.d.ts +6 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +4 -0
- package/lib/theme/themeOverrides.schema.json +3 -0
- package/lib/theme/themes/virgoTheme.json +2 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ export const navWidth = '4rem';
|
|
|
22
22
|
export const navOpenWidth = '18.75rem';
|
|
23
23
|
export const headerHeight = '3rem';
|
|
24
24
|
const iconWidth = '1.125rem';
|
|
25
|
+
const iconBoxSize = `calc((${navWidth} - ${iconWidth} - 2 * var(--nav-padding)) / 2)`;
|
|
25
26
|
export const StyledAppInfo = styled.a(({ theme }) => {
|
|
26
27
|
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
27
28
|
const { hoverBg, foreground } = navContrastColors(theme);
|
|
@@ -81,15 +82,12 @@ export const StyledScrollWrap = styled.div(({ theme }) => {
|
|
|
81
82
|
`;
|
|
82
83
|
});
|
|
83
84
|
StyledScrollWrap.defaultProps = defaultThemeProp;
|
|
84
|
-
export const StyledCountIcon = styled(Count)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
padding: 0 calc(0.5 * ${spacing});
|
|
91
|
-
`;
|
|
92
|
-
});
|
|
85
|
+
export const StyledCountIcon = styled(Count) `
|
|
86
|
+
position: absolute;
|
|
87
|
+
/* stylelint-disable-next-line unit-allowed-list */
|
|
88
|
+
inset-block-start: 0.25lh;
|
|
89
|
+
inset-inline-start: calc((${navWidth} / 2) - var(--nav-padding));
|
|
90
|
+
`;
|
|
93
91
|
StyledCountIcon.defaultProps = defaultThemeProp;
|
|
94
92
|
export const StyledSingleSelectIconBox = styled.span(({ theme }) => {
|
|
95
93
|
return css `
|
|
@@ -101,6 +99,20 @@ export const StyledSingleSelectIconBox = styled.span(({ theme }) => {
|
|
|
101
99
|
});
|
|
102
100
|
StyledSingleSelectIconBox.defaultProps = defaultThemeProp;
|
|
103
101
|
export const StyledNavListItemExpandCollapse = styled(Icon) ``;
|
|
102
|
+
export const StyledNavListItemGroupIndicator = styled(Icon)(({ theme: { components: { 'app-shell': { nav: { detached } } } } }) => {
|
|
103
|
+
return css `
|
|
104
|
+
position: absolute;
|
|
105
|
+
width: 0.75rem;
|
|
106
|
+
height: 0.75rem;
|
|
107
|
+
margin-block-start: calc(${iconWidth} / 8);
|
|
108
|
+
margin-inline-start: 2.5rem;
|
|
109
|
+
${detached &&
|
|
110
|
+
css `
|
|
111
|
+
margin-inline-start: calc(${navWidth} / 2 - ${iconWidth} / 6);
|
|
112
|
+
`}
|
|
113
|
+
`;
|
|
114
|
+
});
|
|
115
|
+
StyledNavListItemGroupIndicator.defaultProps = defaultThemeProp;
|
|
104
116
|
export const StyledUtilIconCount = styled.span `
|
|
105
117
|
flex-shrink: 0;
|
|
106
118
|
`;
|
|
@@ -108,7 +120,7 @@ export const StyledNavItemIconBox = styled.span(({ theme }) => {
|
|
|
108
120
|
return css `
|
|
109
121
|
flex-shrink: 0;
|
|
110
122
|
> ${StyledIcon}, ${StyledUtilIconCount} > ${StyledIcon} {
|
|
111
|
-
margin-inline:
|
|
123
|
+
margin-inline: ${iconBoxSize};
|
|
112
124
|
}
|
|
113
125
|
|
|
114
126
|
${StyledAvatar} {
|
|
@@ -149,7 +161,8 @@ export const StyledAppNav = styled.nav(({ appHeader, showEnv, theme }) => {
|
|
|
149
161
|
}
|
|
150
162
|
|
|
151
163
|
@media (height <= ${theme.base.breakpoints.sm}) {
|
|
152
|
-
overflow: auto;
|
|
164
|
+
overflow-y: auto;
|
|
165
|
+
overflow-x: clip;
|
|
153
166
|
}
|
|
154
167
|
|
|
155
168
|
/* App navigation can be focused with shortcut */
|
|
@@ -170,16 +183,6 @@ export const StyledCaseClose = styled.button ``;
|
|
|
170
183
|
export const StyledNavListItemVisualContainer = styled.div(({ theme: { base: { spacing }, components: { 'app-shell': { nav: { detached } } } }, isCurrent, navOpen }) => {
|
|
171
184
|
return css `
|
|
172
185
|
max-width: ${navWidth};
|
|
173
|
-
padding-block: calc(var(--nav-padding) / 8);
|
|
174
|
-
padding-inline: var(--nav-padding);
|
|
175
|
-
|
|
176
|
-
${!navOpen &&
|
|
177
|
-
detached &&
|
|
178
|
-
css `
|
|
179
|
-
padding-inline: 0;
|
|
180
|
-
width: calc(${navWidth} - 2 * var(--nav-padding));
|
|
181
|
-
margin: auto;
|
|
182
|
-
`}
|
|
183
186
|
|
|
184
187
|
& > ${StyledText} {
|
|
185
188
|
padding-inline: ${isCurrent
|
|
@@ -195,14 +198,24 @@ export const StyledNavListItemVisualContainer = styled.div(({ theme: { base: { s
|
|
|
195
198
|
`;
|
|
196
199
|
});
|
|
197
200
|
StyledNavListItemVisualContainer.defaultProps = defaultThemeProp;
|
|
201
|
+
export const StyledNavListExpandCollapse = styled(StyledNavListItemVisualContainer) `
|
|
202
|
+
display: flex;
|
|
203
|
+
justify-content: center;
|
|
204
|
+
min-width: ${navWidth};
|
|
205
|
+
`;
|
|
198
206
|
export const StyledNavListItem = styled.li(({ theme, nestedListCollapsed, singleSelect }) => {
|
|
199
207
|
const { base: { 'font-weight': { 'semi-bold': semiBold } }, components: { 'app-shell': { nav: { detached } } } } = theme;
|
|
200
208
|
const { navOpen } = useContext(AppShellContext);
|
|
201
|
-
const { foreground } = navContrastColors(theme);
|
|
209
|
+
const { foreground, nestedList } = navContrastColors(theme);
|
|
202
210
|
const { rtl } = useDirection();
|
|
211
|
+
const nestedListColor = theme.components['app-shell'].nav['nested-list-background'] === 'auto'
|
|
212
|
+
? nestedList
|
|
213
|
+
: theme.components['app-shell'].nav['nested-list-background'];
|
|
203
214
|
return css `
|
|
204
215
|
display: block;
|
|
205
216
|
position: relative;
|
|
217
|
+
padding-block: 0;
|
|
218
|
+
padding-inline: var(--nav-padding);
|
|
206
219
|
|
|
207
220
|
${StyledIcon} {
|
|
208
221
|
font-size: 1.25rem;
|
|
@@ -230,30 +243,44 @@ export const StyledNavListItem = styled.li(({ theme, nestedListCollapsed, single
|
|
|
230
243
|
}
|
|
231
244
|
`}
|
|
232
245
|
}
|
|
233
|
-
|
|
234
|
-
${
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
padding-inline: 0;
|
|
238
|
-
width: calc(${navWidth} - 2 * var(--nav-padding));
|
|
239
|
-
margin: auto;
|
|
240
|
-
`}
|
|
246
|
+
|
|
247
|
+
&:first-child ${StyledNavListItemGroupIndicator} {
|
|
248
|
+
display: none;
|
|
249
|
+
}
|
|
241
250
|
|
|
242
251
|
> :first-child {
|
|
243
252
|
position: relative;
|
|
244
253
|
display: flex;
|
|
245
254
|
align-items: center;
|
|
246
255
|
width: 100%;
|
|
247
|
-
padding:
|
|
256
|
+
padding-block: ${theme.base.spacing};
|
|
257
|
+
padding-inline: 0;
|
|
248
258
|
white-space: nowrap;
|
|
249
259
|
color: ${foreground};
|
|
250
260
|
cursor: pointer;
|
|
251
261
|
text-decoration: none;
|
|
252
262
|
border-block: ${pxToRem(1)} solid transparent;
|
|
263
|
+
|
|
264
|
+
${detached &&
|
|
265
|
+
css `
|
|
266
|
+
--item-height: 2.5rem;
|
|
267
|
+
padding: 0;
|
|
268
|
+
height: var(--item-height);
|
|
269
|
+
border: none;
|
|
270
|
+
border-radius: calc(var(--item-height) / 2);
|
|
271
|
+
transition: border-radius ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
|
|
272
|
+
`}
|
|
273
|
+
|
|
253
274
|
${detached &&
|
|
254
275
|
css `
|
|
255
|
-
|
|
276
|
+
&:not(:only-child) {
|
|
277
|
+
background: ${nestedListColor};
|
|
278
|
+
margin-block-end: 0.125rem;
|
|
279
|
+
border-end-start-radius: 0;
|
|
280
|
+
border-end-end-radius: 0;
|
|
281
|
+
}
|
|
256
282
|
`}
|
|
283
|
+
|
|
257
284
|
span:not(${StyledCountIcon}) {
|
|
258
285
|
overflow: hidden;
|
|
259
286
|
text-overflow: ellipsis;
|
|
@@ -310,12 +337,23 @@ export const StyledNavListItem = styled.li(({ theme, nestedListCollapsed, single
|
|
|
310
337
|
}
|
|
311
338
|
}
|
|
312
339
|
|
|
340
|
+
[aria-expanded='true'] {
|
|
341
|
+
${StyledNavListItemGroupIndicator} {
|
|
342
|
+
display: none;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
313
346
|
[aria-current='page'],
|
|
314
347
|
[aria-expanded='false']:has(+ ul [aria-current='page']) {
|
|
315
348
|
position: relative;
|
|
316
349
|
font-weight: ${semiBold};
|
|
317
350
|
border-block: ${pxToRem(1)} solid ${theme.components['app-shell'].nav['border-color']};
|
|
318
351
|
background: ${transparentize(0.85, foreground)};
|
|
352
|
+
${detached &&
|
|
353
|
+
css `
|
|
354
|
+
background: ${transparentize(0.9, foreground)};
|
|
355
|
+
`}
|
|
356
|
+
|
|
319
357
|
${!detached &&
|
|
320
358
|
css `
|
|
321
359
|
&::before {
|
|
@@ -332,9 +370,17 @@ export const StyledNavListItem = styled.li(({ theme, nestedListCollapsed, single
|
|
|
332
370
|
`;
|
|
333
371
|
});
|
|
334
372
|
StyledNavListItem.defaultProps = defaultThemeProp;
|
|
335
|
-
export const StyledNavList = styled.ul(({ theme: { base
|
|
373
|
+
export const StyledNavList = styled.ul(({ theme: { base, components: { 'app-shell': { nav: { detached } } } } }) => {
|
|
336
374
|
return css `
|
|
337
|
-
--nav-padding: ${detached ?
|
|
375
|
+
--nav-padding: ${detached ? '0.75rem' : '0px'};
|
|
376
|
+
min-width: ${navWidth};
|
|
377
|
+
|
|
378
|
+
& > ${StyledNavListItem} {
|
|
379
|
+
&:not(:last-child),
|
|
380
|
+
&:only-child {
|
|
381
|
+
margin-block-end: calc(${base.spacing} / 2);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
338
384
|
`;
|
|
339
385
|
});
|
|
340
386
|
StyledNavList.defaultProps = defaultThemeProp;
|
|
@@ -349,14 +395,30 @@ export const StyledNavCasesList = styled.div(({ theme }) => {
|
|
|
349
395
|
});
|
|
350
396
|
StyledNavCasesList.defaultProps = defaultThemeProp;
|
|
351
397
|
export const StyledNestedNavList = styled(StyledNavList)(({ theme }) => {
|
|
352
|
-
const { base: { 'border-radius': borderRadius }, components: { 'app-shell': { nav: { detached } } } } = theme;
|
|
398
|
+
const { base: { 'border-radius': borderRadius, spacing }, components: { 'app-shell': { nav: { detached } } } } = theme;
|
|
353
399
|
const { nestedList } = navContrastColors(theme);
|
|
400
|
+
const nestedListColor = theme.components['app-shell'].nav['nested-list-background'] === 'auto'
|
|
401
|
+
? nestedList
|
|
402
|
+
: theme.components['app-shell'].nav['nested-list-background'];
|
|
354
403
|
return css `
|
|
355
|
-
background: ${
|
|
404
|
+
background: ${nestedListColor};
|
|
356
405
|
border-radius: ${detached ? borderRadius : '0px'};
|
|
357
|
-
|
|
406
|
+
border-start-start-radius: 0;
|
|
407
|
+
border-start-end-radius: 0;
|
|
358
408
|
|
|
359
409
|
${StyledNavListItem} {
|
|
410
|
+
&:first-child {
|
|
411
|
+
border-block-start: ${spacing} solid transparent;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
&:last-child {
|
|
415
|
+
border-block-end: calc(0.5 * ${spacing}) solid transparent;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
&:not(:last-child) {
|
|
419
|
+
margin-block-end: calc(${spacing} / 2);
|
|
420
|
+
}
|
|
421
|
+
|
|
360
422
|
> :first-child {
|
|
361
423
|
&:has(${StyledIcon}) {
|
|
362
424
|
padding-inline-start: calc(
|
|
@@ -365,19 +427,21 @@ export const StyledNestedNavList = styled(StyledNavList)(({ theme }) => {
|
|
|
365
427
|
}
|
|
366
428
|
|
|
367
429
|
&:not(:has(${StyledIcon})) {
|
|
368
|
-
padding-inline-start: calc(
|
|
430
|
+
padding-inline-start: calc(
|
|
431
|
+
((${navWidth} - (3 * var(--nav-padding)) - ${iconWidth}) / 2) + ${iconBoxSize}
|
|
432
|
+
);
|
|
369
433
|
}
|
|
370
434
|
}
|
|
371
435
|
}
|
|
372
436
|
`;
|
|
373
437
|
});
|
|
374
438
|
StyledNestedNavList.defaultProps = defaultThemeProp;
|
|
375
|
-
export const StyledCaseTypes = styled.div(
|
|
376
|
-
const {
|
|
439
|
+
export const StyledCaseTypes = styled.div(({ theme }) => {
|
|
440
|
+
const { foreground } = navContrastColors(theme);
|
|
377
441
|
return css `
|
|
378
442
|
button {
|
|
379
443
|
${StyledNavItemIconBox} {
|
|
380
|
-
transition: transform ${speed} ${
|
|
444
|
+
transition: transform ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
|
|
381
445
|
}
|
|
382
446
|
|
|
383
447
|
&[aria-expanded='false'] ${StyledNavItemIconBox} {
|
|
@@ -388,12 +452,22 @@ export const StyledCaseTypes = styled.div(props => {
|
|
|
388
452
|
transform: rotateZ(45deg);
|
|
389
453
|
}
|
|
390
454
|
}
|
|
455
|
+
|
|
456
|
+
> ${StyledNavList} > ${StyledNavListItem} > ${StyledBareButton} {
|
|
457
|
+
background: ${theme.components['app-shell'].nav['create-button-background']};
|
|
458
|
+
|
|
459
|
+
&:hover,
|
|
460
|
+
&:focus {
|
|
461
|
+
background: ${transparentize(0.9, foreground)};
|
|
462
|
+
}
|
|
463
|
+
}
|
|
391
464
|
`;
|
|
392
465
|
});
|
|
393
466
|
StyledCaseTypes.defaultProps = defaultThemeProp;
|
|
394
467
|
export const StyledUtils = styled.div(({ theme }) => {
|
|
395
468
|
return css `
|
|
396
|
-
border-
|
|
469
|
+
border-block-start: 0.0625rem solid ${theme.components['app-shell'].nav['border-color']};
|
|
470
|
+
margin-block-start: calc(${theme.base.spacing} / 2);
|
|
397
471
|
|
|
398
472
|
${StyledBareButton} > ${StyledIcon}:first-child, ${StyledBareButton} > ${StyledUtilIconCount} {
|
|
399
473
|
margin: 0 calc((${navWidth} - ${iconWidth}) / 2);
|
|
@@ -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,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,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,EACL,iBAAiB,EACjB,wBAAwB,EACxB,mCAAmC,EACnC,aAAa,EACd,MA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CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;GAG1C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;IAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mCAAmC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACnF,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEtC,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC;QAC3C,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,GAAG,CAAA;kBACM,EAAE;aACP,UAAU;;2BAEI,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEvC,UAAU;;;;;;;;oBAQI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { darken, getContrast, lighten, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport { Count } from '../Badges';\nimport { StyledAvatar } from '../Avatar';\nimport { StyledIcon } from '../Icon';\nimport { StyledImage } from '../Image/Image';\nimport { defaultThemeProp } from '../../theme';\nimport {\n calculateFontSize,\n calculateForegroundColor,\n calculateBackgroundAndContrastColor,\n readableColor\n} 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';\nimport { StyledProgressBackdrop } from '../Progress';\nimport Icon from '../Icon/Icon';\nimport { StyledText } from '../Text';\nimport { resizeDrawerMaxWidth } from '../../styles/constants';\n\nimport AppShellContext from './AppShellContext';\nimport { navContrastColors, pxToRem } from './style-utils';\n\nexport const navWidth = '4rem';\nexport const navOpenWidth = '18.75rem';\nexport const headerHeight = '3rem';\nconst iconWidth = '1.125rem';\n\nexport const StyledAppInfo = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { hoverBg, foreground } = navContrastColors(theme);\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 vertical-align: middle;\n\n &:hover,\n button&:hover {\n background-color: ${hoverBg};\n text-decoration: none;\n }\n\n &:focus:not([disabled]) {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledImage} {\n display: inline-block;\n width: calc(${navWidth} / 2);\n margin-inline-end: calc(${theme.base.spacing} * 2);\n vertical-align: middle;\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: middle;\n }\n\n span:last-of-type {\n font-size: ${fontSize.xs};\n color: ${foreground};\n }\n\n span:first-of-type {\n font-size: ${fontSize.s};\n color: ${foreground};\n margin-inline-end: calc(${theme.base.spacing});\n vertical-align: middle;\n }\n `;\n});\n\nStyledAppInfo.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(({ theme }) => {\n return css`\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow: visible;\n flex-shrink: 0;\n }\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled(Count)(({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n}) => {\n const insetInlineStartOffsetMultiplier = detached ? 3 : 4;\n return css`\n position: absolute;\n inset-inline-start: calc(${insetInlineStartOffsetMultiplier} * ${spacing});\n top: calc(0.5 * ${spacing});\n padding: 0 calc(0.5 * ${spacing});\n `;\n});\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledSingleSelectIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n height: ${theme.base['hit-area']['mouse-min']};\n width: ${theme.base['hit-area']['mouse-min']};\n margin-inline-start: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledSingleSelectIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItemExpandCollapse = styled(Icon)``;\n\nexport const StyledUtilIconCount = styled.span`\n flex-shrink: 0;\n`;\n\nexport const StyledNavItemIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n > ${StyledIcon}, ${StyledUtilIconCount} > ${StyledIcon} {\n margin-inline: calc((${navWidth} - ${iconWidth} - 2 * var(--nav-padding)) / 2);\n }\n\n ${StyledAvatar} {\n margin-inline: calc(\n (${navWidth} - ${theme.base['hit-area']['mouse-min']} - 2 * var(--nav-padding)) / 2\n );\n margin-block: calc(0.5 * ${theme.base.spacing});\n font-weight: ${theme.base['font-weight'].normal};\n }\n `;\n});\n\nStyledNavItemIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledAppNav = styled.nav<{ appHeader: boolean; showEnv: boolean }>(\n ({ appHeader, showEnv, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n\n const foregroundColor = calculateForegroundColor(navBg, navFgColor);\n\n return css`\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 2);\n background: ${navBg};\n color: ${foregroundColor};\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 border-inline-end: ${pxToRem(1)} solid ${transparentize(0.9, '#000')};\n border-color: ${theme.components['app-shell'].nav['border-color']};\n ${!showEnv &&\n css`\n padding-block-start: ${theme.base.spacing};\n `}\n @media (pointer: coarse) {\n max-width: calc(100vw - ${theme.base['hit-area']['finger-min']});\n }\n\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow: auto;\n }\n\n /* App navigation can be focused with shortcut */\n :focus-visible {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-width: thin;\n }\n `}\n `;\n }\n);\n\nStyledAppNav.defaultProps = defaultThemeProp;\n\nexport const StyledCaseClose = styled.button``;\n\nexport const StyledNavListItemVisualContainer = styled.div<{\n isCurrent: boolean;\n navOpen: boolean;\n}>(\n ({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n },\n isCurrent,\n navOpen\n }) => {\n return css`\n max-width: ${navWidth};\n padding-block: calc(var(--nav-padding) / 8);\n padding-inline: var(--nav-padding);\n\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n width: calc(${navWidth} - 2 * var(--nav-padding));\n margin: auto;\n `}\n\n & > ${StyledText} {\n padding-inline: ${isCurrent\n ? `${spacing} calc(0.5 * ${spacing})`\n : `calc(0.5 * ${spacing})`};\n\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n `}\n }\n `;\n }\n);\n\nStyledNavListItemVisualContainer.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItem = styled.li<{\n nestedListCollapsed: boolean;\n singleSelect: boolean;\n}>(({ theme, nestedListCollapsed, singleSelect }) => {\n const {\n base: {\n 'font-weight': { 'semi-bold': semiBold }\n },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { navOpen } = useContext(AppShellContext);\n const { foreground } = navContrastColors(theme);\n const { rtl } = useDirection();\n\n return css`\n display: block;\n position: relative;\n\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n ${StyledCaseClose} {\n display: flex;\n position: absolute;\n opacity: 0;\n left: ${navOpen ? 'auto' : '100%'};\n top: 50%;\n bottom: 50%;\n margin: auto 0;\n color: ${foreground};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n `}\n }\n padding: calc(var(--nav-padding) / 8) var(--nav-padding);\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n width: calc(${navWidth} - 2 * var(--nav-padding));\n margin: auto;\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: ${foreground};\n cursor: pointer;\n text-decoration: none;\n border-block: ${pxToRem(1)} solid transparent;\n ${detached &&\n css`\n border-radius: ${theme.base['border-radius']};\n `}\n span:not(${StyledCountIcon}) {\n overflow: hidden;\n text-overflow: ellipsis;\n color: inherit;\n white-space: nowrap;\n }\n\n &:hover,\n &:focus {\n color: ${foreground};\n background: ${transparentize(0.9, foreground)};\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: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledNavListItemExpandCollapse} {\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 ${singleSelect &&\n css`\n ${StyledNavItemIconBox} > ${StyledIcon} {\n margin-inline: calc(${theme.base.spacing} - var(--nav-padding));\n }\n `}\n\n ${StyledSingleSelectIconBox} + span {\n margin-inline-start: ${theme.base.spacing};\n }\n }\n\n [aria-current='page'],\n [aria-expanded='false']:has(+ ul [aria-current='page']) {\n position: relative;\n font-weight: ${semiBold};\n border-block: ${pxToRem(1)} solid ${theme.components['app-shell'].nav['border-color']};\n background: ${transparentize(0.85, foreground)};\n ${!detached &&\n css`\n &::before {\n content: '';\n position: absolute;\n width: ${pxToRem(4)};\n inset-inline-start: 0;\n top: 0;\n bottom: 0;\n background-color: ${foreground};\n }\n `}\n }\n `;\n});\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul(\n ({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n }) => {\n return css`\n --nav-padding: ${detached ? spacing : '0px'};\n `;\n }\n);\nStyledNavList.defaultProps = defaultThemeProp;\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 {\n base: { 'border-radius': borderRadius },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { nestedList } = navContrastColors(theme);\n\n return css`\n background: ${nestedList};\n border-radius: ${detached ? borderRadius : '0px'};\n padding-block: var(--nav-padding);\n\n ${StyledNavListItem} {\n > :first-child {\n &:has(${StyledIcon}) {\n padding-inline-start: calc(\n ((${navWidth} - (3 * var(--nav-padding)) - ${iconWidth}) / 2) + ${iconWidth}\n );\n }\n\n &:not(:has(${StyledIcon})) {\n padding-inline-start: calc(${navWidth} - 3 * var(--nav-padding));\n }\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 ${StyledNavItemIconBox} {\n transition: transform ${speed} ${acceleration};\n }\n\n &[aria-expanded='false'] ${StyledNavItemIconBox} {\n transform: none;\n }\n\n &[aria-expanded='true'] ${StyledNavItemIconBox} {\n transform: rotateZ(45deg);\n }\n }\n `;\n});\n\nStyledCaseTypes.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div(({ theme }) => {\n return css`\n border-top: 0.0625rem solid ${theme.components['app-shell'].nav['border-color']};\n\n ${StyledBareButton} > ${StyledIcon}:first-child, ${StyledBareButton} > ${StyledUtilIconCount} {\n margin: 0 calc((${navWidth} - ${iconWidth}) / 2);\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled.header(({ theme }) => {\n const mobileNavColor = theme.components['app-shell'].nav.background;\n const { foreground } = navContrastColors(theme);\n\n return css`\n min-width: 100%;\n min-height: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer};\n background: ${mobileNavColor};\n color: ${foreground};\n padding-inline-start: ${theme.base.spacing};\n\n @media (pointer: coarse) {\n padding-inline-start: 0;\n }\n\n @media (height >= ${theme.base.breakpoints.sm}) {\n inset-block-start: 0;\n position: sticky;\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledLoading = styled.div`\n font-size: 2rem;\n`;\n\nexport const StyledAppMain = styled.main<{\n appHeader: boolean;\n mobileNav: boolean;\n navOpen: boolean;\n previewActive: boolean;\n headerOffset?: number;\n}>(({ appHeader, mobileNav, navOpen, previewActive, headerOffset = 0, theme }) => {\n const heightOffset = appHeader || mobileNav ? headerHeight : '0rem';\n const appBackground = theme.base.palette['app-background'];\n\n return css`\n --appshell-offset: ${headerOffset}px;\n /* stylelint-disable-next-line length-zero-no-unit */\n --appshell-horizontal-offset: 0rem;\n\n @media (min-width: ${theme.base.breakpoints.sm}) {\n --appshell-horizontal-offset: ${navOpen ? navOpenWidth : navWidth};\n }\n position: relative;\n margin-inline-start: ${mobileNav ? 0 : navWidth};\n min-height: calc(100vh - ${heightOffset});\n background: ${appBackground};\n\n :focus {\n outline: none;\n }\n\n ${navOpen &&\n !mobileNav &&\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 & > ${StyledProgressBackdrop} {\n max-height: calc(100vh - ${heightOffset});\n max-width: calc(100vw - ${navOpen ? navOpenWidth : navWidth});\n inset-block-start: ${heightOffset};\n inset-inline-start: ${navOpen ? navOpenWidth : navWidth};\n position: fixed;\n transition-property: opacity, max-height, max-width, inset-block-start, inset-inline-start;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n }\n\n @media (min-width: ${theme.base.breakpoints.xl}) {\n transition: margin-inline-end ${!mobileNav ? ', margin-inline-start' : ''};\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${previewActive &&\n css`\n transition: none;\n margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});\n `}\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 const bg = theme.components.tooltip['background-color'];\n const color = readableColor(bg);\n\n return css`\n background-color: ${bg};\n padding: 0;\n header {\n color: ${color};\n border-bottom: none;\n }\n ${StyledMenuItem} {\n background-color: ${bg};\n color: ${color};\n\n &:hover,\n &:focus {\n background-color: ${bg};\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n `;\n});\n\nStyledAppShellTooltip.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n const { backgroundColor } = calculateBackgroundAndContrastColor(navBg, navFgColor);\n let bg = darken(0.2, backgroundColor);\n\n if (getContrast(backgroundColor, bg) < 1.3) {\n bg = lighten(0.2, backgroundColor);\n }\n\n return css`\n background: ${bg};\n color: ${navFgColor};\n border: none;\n margin-top: calc(1 * ${theme.base.spacing});\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"]}
|
|
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,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,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,EACL,iBAAiB,EACjB,wBAAwB,EACxB,mCAAmC,EACnC,aAAa,EACd,MAAM,cAA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C;AAEtD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;IAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mCAAmC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACnF,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAEtC,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC;QAC3C,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,GAAG,CAAA;kBACM,EAAE;aACP,UAAU;;2BAEI,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEvC,UAAU;;;;;;;;oBAQI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { darken, getContrast, lighten, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport { Count } from '../Badges';\nimport { StyledAvatar } from '../Avatar';\nimport { StyledIcon } from '../Icon';\nimport { StyledImage } from '../Image/Image';\nimport { defaultThemeProp } from '../../theme';\nimport {\n calculateFontSize,\n calculateForegroundColor,\n calculateBackgroundAndContrastColor,\n readableColor\n} 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';\nimport { StyledProgressBackdrop } from '../Progress';\nimport Icon from '../Icon/Icon';\nimport { StyledText } from '../Text';\nimport { resizeDrawerMaxWidth } from '../../styles/constants';\n\nimport AppShellContext from './AppShellContext';\nimport { navContrastColors, pxToRem } from './style-utils';\n\nexport const navWidth = '4rem';\nexport const navOpenWidth = '18.75rem';\nexport const headerHeight = '3rem';\nconst iconWidth = '1.125rem';\nconst iconBoxSize = `calc((${navWidth} - ${iconWidth} - 2 * var(--nav-padding)) / 2)`;\n\nexport const StyledAppInfo = styled.a(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { hoverBg, foreground } = navContrastColors(theme);\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 vertical-align: middle;\n\n &:hover,\n button&:hover {\n background-color: ${hoverBg};\n text-decoration: none;\n }\n\n &:focus:not([disabled]) {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledImage} {\n display: inline-block;\n width: calc(${navWidth} / 2);\n margin-inline-end: calc(${theme.base.spacing} * 2);\n vertical-align: middle;\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: middle;\n }\n\n span:last-of-type {\n font-size: ${fontSize.xs};\n color: ${foreground};\n }\n\n span:first-of-type {\n font-size: ${fontSize.s};\n color: ${foreground};\n margin-inline-end: calc(${theme.base.spacing});\n vertical-align: middle;\n }\n `;\n});\n\nStyledAppInfo.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(({ theme }) => {\n return css`\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow: visible;\n flex-shrink: 0;\n }\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledCountIcon = styled(Count)`\n position: absolute;\n /* stylelint-disable-next-line unit-allowed-list */\n inset-block-start: 0.25lh;\n inset-inline-start: calc((${navWidth} / 2) - var(--nav-padding));\n`;\n\nStyledCountIcon.defaultProps = defaultThemeProp;\n\nexport const StyledSingleSelectIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n height: ${theme.base['hit-area']['mouse-min']};\n width: ${theme.base['hit-area']['mouse-min']};\n margin-inline-start: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledSingleSelectIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledNavListItemExpandCollapse = styled(Icon)``;\n\nexport const StyledNavListItemGroupIndicator = styled(Icon)(({\n theme: {\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n}) => {\n return css`\n position: absolute;\n width: 0.75rem;\n height: 0.75rem;\n margin-block-start: calc(${iconWidth} / 8);\n margin-inline-start: 2.5rem;\n ${detached &&\n css`\n margin-inline-start: calc(${navWidth} / 2 - ${iconWidth} / 6);\n `}\n `;\n});\n\nStyledNavListItemGroupIndicator.defaultProps = defaultThemeProp;\n\nexport const StyledUtilIconCount = styled.span`\n flex-shrink: 0;\n`;\n\nexport const StyledNavItemIconBox = styled.span(({ theme }) => {\n return css`\n flex-shrink: 0;\n > ${StyledIcon}, ${StyledUtilIconCount} > ${StyledIcon} {\n margin-inline: ${iconBoxSize};\n }\n\n ${StyledAvatar} {\n margin-inline: calc(\n (${navWidth} - ${theme.base['hit-area']['mouse-min']} - 2 * var(--nav-padding)) / 2\n );\n margin-block: calc(0.5 * ${theme.base.spacing});\n font-weight: ${theme.base['font-weight'].normal};\n }\n `;\n});\n\nStyledNavItemIconBox.defaultProps = defaultThemeProp;\n\nexport const StyledAppNav = styled.nav<{ appHeader: boolean; showEnv: boolean }>(\n ({ appHeader, showEnv, theme }) => {\n const { navOpen } = useContext(AppShellContext);\n\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n\n const foregroundColor = calculateForegroundColor(navBg, navFgColor);\n\n return css`\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 2);\n background: ${navBg};\n color: ${foregroundColor};\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 border-inline-end: ${pxToRem(1)} solid ${transparentize(0.9, '#000')};\n border-color: ${theme.components['app-shell'].nav['border-color']};\n ${!showEnv &&\n css`\n padding-block-start: ${theme.base.spacing};\n `}\n @media (pointer: coarse) {\n max-width: calc(100vw - ${theme.base['hit-area']['finger-min']});\n }\n\n @media (height <= ${theme.base.breakpoints.sm}) {\n overflow-y: auto;\n overflow-x: clip;\n }\n\n /* App navigation can be focused with shortcut */\n :focus-visible {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-width: thin;\n }\n `}\n `;\n }\n);\n\nStyledAppNav.defaultProps = defaultThemeProp;\n\nexport const StyledCaseClose = styled.button``;\n\nexport const StyledNavListItemVisualContainer = styled.div<{\n isCurrent: boolean;\n navOpen: boolean;\n}>(\n ({\n theme: {\n base: { spacing },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n },\n isCurrent,\n navOpen\n }) => {\n return css`\n max-width: ${navWidth};\n\n & > ${StyledText} {\n padding-inline: ${isCurrent\n ? `${spacing} calc(0.5 * ${spacing})`\n : `calc(0.5 * ${spacing})`};\n\n ${!navOpen &&\n detached &&\n css`\n padding-inline: 0;\n `}\n }\n `;\n }\n);\n\nStyledNavListItemVisualContainer.defaultProps = defaultThemeProp;\n\nexport const StyledNavListExpandCollapse = styled(StyledNavListItemVisualContainer)`\n display: flex;\n justify-content: center;\n min-width: ${navWidth};\n`;\n\nexport const StyledNavListItem = styled.li<{\n nestedListCollapsed: boolean;\n singleSelect: boolean;\n}>(({ theme, nestedListCollapsed, singleSelect }) => {\n const {\n base: {\n 'font-weight': { 'semi-bold': semiBold }\n },\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { navOpen } = useContext(AppShellContext);\n const { foreground, nestedList } = navContrastColors(theme);\n const { rtl } = useDirection();\n\n const nestedListColor =\n theme.components['app-shell'].nav['nested-list-background'] === 'auto'\n ? nestedList\n : theme.components['app-shell'].nav['nested-list-background'];\n\n return css`\n display: block;\n position: relative;\n padding-block: 0;\n padding-inline: var(--nav-padding);\n\n ${StyledIcon} {\n font-size: 1.25rem;\n }\n\n ${StyledCaseClose} {\n display: flex;\n position: absolute;\n opacity: 0;\n left: ${navOpen ? 'auto' : '100%'};\n top: 50%;\n bottom: 50%;\n margin: auto 0;\n color: ${foreground};\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n ${navOpen &&\n css`\n inset-inline-end: 1rem;\n\n &:hover,\n &:focus {\n opacity: 1;\n }\n `}\n }\n\n &:first-child ${StyledNavListItemGroupIndicator} {\n display: none;\n }\n\n > :first-child {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n padding-block: ${theme.base.spacing};\n padding-inline: 0;\n white-space: nowrap;\n color: ${foreground};\n cursor: pointer;\n text-decoration: none;\n border-block: ${pxToRem(1)} solid transparent;\n\n ${detached &&\n css`\n --item-height: 2.5rem;\n padding: 0;\n height: var(--item-height);\n border: none;\n border-radius: calc(var(--item-height) / 2);\n transition: border-radius ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n `}\n\n ${detached &&\n css`\n &:not(:only-child) {\n background: ${nestedListColor};\n margin-block-end: 0.125rem;\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n `}\n\n span:not(${StyledCountIcon}) {\n overflow: hidden;\n text-overflow: ellipsis;\n color: inherit;\n white-space: nowrap;\n }\n\n &:hover,\n &:focus {\n color: ${foreground};\n background: ${transparentize(0.9, foreground)};\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: ${theme.base.shadow['focus-inset']};\n }\n\n ${StyledNavListItemExpandCollapse} {\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 ${singleSelect &&\n css`\n ${StyledNavItemIconBox} > ${StyledIcon} {\n margin-inline: calc(${theme.base.spacing} - var(--nav-padding));\n }\n `}\n\n ${StyledSingleSelectIconBox} + span {\n margin-inline-start: ${theme.base.spacing};\n }\n }\n\n [aria-expanded='true'] {\n ${StyledNavListItemGroupIndicator} {\n display: none;\n }\n }\n\n [aria-current='page'],\n [aria-expanded='false']:has(+ ul [aria-current='page']) {\n position: relative;\n font-weight: ${semiBold};\n border-block: ${pxToRem(1)} solid ${theme.components['app-shell'].nav['border-color']};\n background: ${transparentize(0.85, foreground)};\n ${detached &&\n css`\n background: ${transparentize(0.9, foreground)};\n `}\n\n ${!detached &&\n css`\n &::before {\n content: '';\n position: absolute;\n width: ${pxToRem(4)};\n inset-inline-start: 0;\n top: 0;\n bottom: 0;\n background-color: ${foreground};\n }\n `}\n }\n `;\n});\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul(\n ({\n theme: {\n base,\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n }\n }) => {\n return css`\n --nav-padding: ${detached ? '0.75rem' : '0px'};\n min-width: ${navWidth};\n\n & > ${StyledNavListItem} {\n &:not(:last-child),\n &:only-child {\n margin-block-end: calc(${base.spacing} / 2);\n }\n }\n `;\n }\n);\nStyledNavList.defaultProps = defaultThemeProp;\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 {\n base: { 'border-radius': borderRadius, spacing },\n\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = theme;\n\n const { nestedList } = navContrastColors(theme);\n\n const nestedListColor =\n theme.components['app-shell'].nav['nested-list-background'] === 'auto'\n ? nestedList\n : theme.components['app-shell'].nav['nested-list-background'];\n\n return css`\n background: ${nestedListColor};\n border-radius: ${detached ? borderRadius : '0px'};\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n\n ${StyledNavListItem} {\n &:first-child {\n border-block-start: ${spacing} solid transparent;\n }\n\n &:last-child {\n border-block-end: calc(0.5 * ${spacing}) solid transparent;\n }\n\n &:not(:last-child) {\n margin-block-end: calc(${spacing} / 2);\n }\n\n > :first-child {\n &:has(${StyledIcon}) {\n padding-inline-start: calc(\n ((${navWidth} - (3 * var(--nav-padding)) - ${iconWidth}) / 2) + ${iconWidth}\n );\n }\n\n &:not(:has(${StyledIcon})) {\n padding-inline-start: calc(\n ((${navWidth} - (3 * var(--nav-padding)) - ${iconWidth}) / 2) + ${iconBoxSize}\n );\n }\n }\n }\n `;\n});\n\nStyledNestedNavList.defaultProps = defaultThemeProp;\n\nexport const StyledCaseTypes = styled.div(({ theme }) => {\n const { foreground } = navContrastColors(theme);\n\n return css`\n button {\n ${StyledNavItemIconBox} {\n transition: transform ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n }\n\n &[aria-expanded='false'] ${StyledNavItemIconBox} {\n transform: none;\n }\n\n &[aria-expanded='true'] ${StyledNavItemIconBox} {\n transform: rotateZ(45deg);\n }\n }\n\n > ${StyledNavList} > ${StyledNavListItem} > ${StyledBareButton} {\n background: ${theme.components['app-shell'].nav['create-button-background']};\n\n &:hover,\n &:focus {\n background: ${transparentize(0.9, foreground)};\n }\n }\n `;\n});\n\nStyledCaseTypes.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div(({ theme }) => {\n return css`\n border-block-start: 0.0625rem solid ${theme.components['app-shell'].nav['border-color']};\n margin-block-start: calc(${theme.base.spacing} / 2);\n\n ${StyledBareButton} > ${StyledIcon}:first-child, ${StyledBareButton} > ${StyledUtilIconCount} {\n margin: 0 calc((${navWidth} - ${iconWidth}) / 2);\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledMobileNav = styled.header(({ theme }) => {\n const mobileNavColor = theme.components['app-shell'].nav.background;\n const { foreground } = navContrastColors(theme);\n\n return css`\n min-width: 100%;\n min-height: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer};\n background: ${mobileNavColor};\n color: ${foreground};\n padding-inline-start: ${theme.base.spacing};\n\n @media (pointer: coarse) {\n padding-inline-start: 0;\n }\n\n @media (height >= ${theme.base.breakpoints.sm}) {\n inset-block-start: 0;\n position: sticky;\n }\n `;\n});\n\nStyledMobileNav.defaultProps = defaultThemeProp;\n\nexport const StyledLoading = styled.div`\n font-size: 2rem;\n`;\n\nexport const StyledAppMain = styled.main<{\n appHeader: boolean;\n mobileNav: boolean;\n navOpen: boolean;\n previewActive: boolean;\n headerOffset?: number;\n}>(({ appHeader, mobileNav, navOpen, previewActive, headerOffset = 0, theme }) => {\n const heightOffset = appHeader || mobileNav ? headerHeight : '0rem';\n const appBackground = theme.base.palette['app-background'];\n\n return css`\n --appshell-offset: ${headerOffset}px;\n /* stylelint-disable-next-line length-zero-no-unit */\n --appshell-horizontal-offset: 0rem;\n\n @media (min-width: ${theme.base.breakpoints.sm}) {\n --appshell-horizontal-offset: ${navOpen ? navOpenWidth : navWidth};\n }\n position: relative;\n margin-inline-start: ${mobileNav ? 0 : navWidth};\n min-height: calc(100vh - ${heightOffset});\n background: ${appBackground};\n\n :focus {\n outline: none;\n }\n\n ${navOpen &&\n !mobileNav &&\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 & > ${StyledProgressBackdrop} {\n max-height: calc(100vh - ${heightOffset});\n max-width: calc(100vw - ${navOpen ? navOpenWidth : navWidth});\n inset-block-start: ${heightOffset};\n inset-inline-start: ${navOpen ? navOpenWidth : navWidth};\n position: fixed;\n transition-property: opacity, max-height, max-width, inset-block-start, inset-inline-start;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n }\n\n @media (min-width: ${theme.base.breakpoints.xl}) {\n transition: margin-inline-end ${!mobileNav ? ', margin-inline-start' : ''};\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n\n ${previewActive &&\n css`\n transition: none;\n margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});\n `}\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 const bg = theme.components.tooltip['background-color'];\n const color = readableColor(bg);\n\n return css`\n background-color: ${bg};\n padding: 0;\n header {\n color: ${color};\n border-bottom: none;\n }\n ${StyledMenuItem} {\n background-color: ${bg};\n color: ${color};\n\n &:hover,\n &:focus {\n background-color: ${bg};\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n `;\n});\n\nStyledAppShellTooltip.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellToggleButton = styled(Button)(({ theme }) => {\n const navBg = theme.components['app-shell'].nav.background;\n const navFgColor = theme.components['app-shell'].nav['foreground-color'];\n const { backgroundColor } = calculateBackgroundAndContrastColor(navBg, navFgColor);\n let bg = darken(0.2, backgroundColor);\n\n if (getContrast(backgroundColor, bg) < 1.3) {\n bg = lighten(0.2, backgroundColor);\n }\n\n return css`\n background: ${bg};\n color: ${navFgColor};\n border: none;\n margin-top: calc(1 * ${theme.base.spacing});\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationList.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,EAAE,EAAiC,MAAM,OAAO,CAAC;AA2B5E,OAAO,KAAK,EACV,gBAAgB,EAEhB,YAAY,EAEb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigationList.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,EAAE,EAAiC,MAAM,OAAO,CAAC;AA2B5E,OAAO,KAAK,EACV,gBAAgB,EAEhB,YAAY,EAEb,MAAM,kBAAkB,CAAC;AA4F1B,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,gBAAgB,CAwKnD,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,CA4DpC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -15,7 +15,7 @@ import * as checkIcon from '../Icon/icons/check.icon';
|
|
|
15
15
|
import * as caretLeftIcon from '../Icon/icons/caret-left.icon';
|
|
16
16
|
import * as caretRightIcon from '../Icon/icons/caret-right.icon';
|
|
17
17
|
import NavigationListItemWrapper from './NavigationListItemWrapper';
|
|
18
|
-
import { StyledNavList, StyledNestedNavList, StyledNavItemIconBox, StyledNavListItem, StyledNavListItemExpandCollapse, StyledCaseClose, StyledSingleSelectIconBox, StyledNavListItemVisualContainer } from './AppShell.styles';
|
|
18
|
+
import { StyledNavList, StyledNestedNavList, StyledNavItemIconBox, StyledNavListItem, StyledNavListItemExpandCollapse, StyledCaseClose, StyledSingleSelectIconBox, StyledNavListItemVisualContainer, StyledNavListItemGroupIndicator } from './AppShell.styles';
|
|
19
19
|
import AppShellContext from './AppShellContext';
|
|
20
20
|
registerIcon(timesIcon, checkIcon, caretLeftIcon, caretRightIcon);
|
|
21
21
|
const NavigationMenu = props => {
|
|
@@ -91,7 +91,7 @@ export const NavigationListItem = ({ visual, primary, secondary, collapsedItemIn
|
|
|
91
91
|
_jsx(NavigationListItemWrapper, { tooltipLabel: secondary ? `${primary} ${secondary}` : primary, label: primary, childElementRef: listItemRef, items: actions || items || caseItems, onMenuToggle: setMenuState, children: _jsxs(Component, { ...compProps, ref: listItemRef, ...(navOpen && isMenuItem ? { tabIndex: -1, role: 'menuitem' } : {}), "aria-labelledby": `${primaryId} ${count ? `${primary}-count` : ''} ${ariaLabelledBy ?? ''}`, ...(shouldShowMenuAttributes && {
|
|
92
92
|
'aria-haspopup': 'menu',
|
|
93
93
|
'aria-expanded': menuState === 'open'
|
|
94
|
-
}), "aria-current": ariaCurrent, children: [singleSelect && (_jsx(Flex, { container: { justify: 'center', alignItems: 'center' }, as: StyledSingleSelectIconBox, children: selected && _jsx(Icon, { name: 'check' }) })), visual && (_jsxs(Flex, { container: { direction: 'column', gap: 0.5 }, as: StyledNavListItemVisualContainer, isCurrent: ariaCurrent === 'page', navOpen: navOpen, children: [_jsx(StyledNavItemIconBox, { children: visual }), !navOpen && collapsedItemInfo && (_jsx(Text, { variant: 'secondary', children: collapsedItemInfo }))] })), secondary ? (_jsxs(Flex, { container: { direction: 'column', alignItems: 'start' }, item: { shrink: !navOpen && detached ? 1 : 0 }, as: 'span', children: [_jsx("span", { id: primaryId, children: primary }), _jsx(Text, { variant: 'secondary', children: secondary })] })) : (_jsx("span", { id: primaryId, children: primary })), (hasItems || actions) && navState === 'open' && (_jsx(StyledNavListItemExpandCollapse, { name: `caret-${end}` }))] }) }),
|
|
94
|
+
}), "aria-current": ariaCurrent, children: [singleSelect && (_jsx(Flex, { container: { justify: 'center', alignItems: 'center' }, as: StyledSingleSelectIconBox, children: selected && _jsx(Icon, { name: 'check' }) })), visual && (_jsxs(Flex, { container: { direction: 'column', gap: 0.5 }, as: StyledNavListItemVisualContainer, isCurrent: ariaCurrent === 'page', navOpen: navOpen, children: [_jsx(StyledNavItemIconBox, { children: visual }), !navOpen && collapsedItemInfo && (_jsx(Text, { variant: 'secondary', children: collapsedItemInfo })), hasItems && navState === 'closed' && (_jsx(StyledNavListItemGroupIndicator, { name: `caret-${end}` }))] })), secondary ? (_jsxs(Flex, { container: { direction: 'column', alignItems: 'start' }, item: { shrink: !navOpen && detached ? 1 : 0 }, as: 'span', children: [_jsx("span", { id: primaryId, children: primary }), _jsx(Text, { variant: 'secondary', children: secondary })] })) : (_jsx("span", { id: primaryId, children: primary })), (hasItems || actions) && navState === 'open' && (_jsx(StyledNavListItemExpandCollapse, { name: `caret-${end}` }))] }) }),
|
|
95
95
|
onDismiss && navOpen && (_jsx(Button, { icon: true, variant: 'simple', as: StyledCaseClose, onClick: onDismiss, "aria-label": t('dismiss_case'), children: _jsx(Icon, { name: 'times' }) })),
|
|
96
96
|
hasItems && (
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationList.js","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAA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AAC,KAC9B,IAAI,IAJH,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAK5B,CACH,CAAC;QACJ,CAAC,CAAC,GACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport type { ElementType, FC, MouseEvent, MouseEventHandler } from 'react';\n\nimport {\n useTheme,\n useArrows,\n useConsolidatedRef,\n useDirection,\n useUID,\n useI18n,\n useEscape\n} from '../../hooks';\nimport { isValidElement } from '../../utils';\nimport ExpandCollapse from '../ExpandCollapse';\nimport BareButton from '../Button/BareButton';\nimport Flex from '../Flex';\nimport Icon, { registerIcon } from '../Icon';\nimport Text from '../Text';\nimport Button from '../Button';\nimport type { OmitStrict } from '../../types';\nimport type { PopoverProps } from '../Popover';\nimport Link from '../Link';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as checkIcon from '../Icon/icons/check.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\n\nimport NavigationListItemWrapper from './NavigationListItemWrapper';\nimport type {\n NavListItemProps,\n NavListItemWrapperProps,\n NavListProps,\n NavMenuProps\n} from './AppShell.types';\nimport {\n StyledNavList,\n StyledNestedNavList,\n StyledNavItemIconBox,\n StyledNavListItem,\n StyledNavListItemExpandCollapse,\n StyledCaseClose,\n StyledSingleSelectIconBox,\n StyledNavListItemVisualContainer\n} from './AppShell.styles';\nimport AppShellContext from './AppShellContext';\n\nregisterIcon(timesIcon, checkIcon, caretLeftIcon, caretRightIcon);\n\nconst NavigationMenu: FC<NavMenuProps> = props => {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n onDismiss,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const uid = useUID();\n\n const { navState } = useContext(AppShellContext);\n const [collapsed, setCollapsed] = useState(true);\n\n const toggleCollapsed = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n setCollapsed(state => !state);\n },\n [setCollapsed]\n );\n\n const itemRef = useConsolidatedRef(forwardedRef);\n\n const menuRef = useRef<HTMLLIElement>(null);\n\n useArrows(menuRef, { selector: '[role=\"menuitem\"]', cycle: true });\n\n useEscape(() => {\n setCollapsed(true);\n itemRef.current?.focus();\n }, menuRef);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem {...restProps} key={primary} nestedListCollapsed={collapsed} ref={menuRef}>\n <BareButton\n id={uid}\n ref={itemRef}\n aria-expanded={!collapsed}\n aria-controls={`${uid}-menu`}\n aria-label={primary}\n onClick={toggleCollapsed}\n >\n {visual && <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>}\n\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n\n {navState === 'open' && <StyledNavListItemExpandCollapse name={`caret-${end}`} />}\n </BareButton>\n\n {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}\n <NavigationList\n id={`${uid}-menu`}\n nestedList\n items={items}\n collapsed={!navOpen || collapsed}\n />\n </StyledNavListItem>\n );\n};\n\nexport const NavigationListItem: FC<NavListItemProps> = ({\n visual,\n primary,\n secondary,\n collapsedItemInfo,\n href,\n onClick,\n items,\n collapseItems = false,\n onDismiss,\n actions,\n forwardedRef,\n isMenuItem,\n count,\n singleSelect,\n selected,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-current': ariaCurrent,\n ...restProps\n}) => {\n const { navOpen, navState } = useContext(AppShellContext);\n const t = useI18n();\n const listItemRef = useConsolidatedRef(forwardedRef);\n const [menuState, setMenuState] = useState('');\n const {\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = useTheme();\n\n const hasItems =\n (Array.isArray(items) && items.length > 0) || (Array.isArray(actions) && actions.length > 0);\n const compProps: {\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n 'aria-label'?: string;\n } = {\n onClick: (e: MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>) => {\n e.stopPropagation();\n onClick?.(e);\n },\n href\n };\n\n let caseItems: NavListItemWrapperProps['items'] | undefined;\n if (onDismiss) {\n caseItems = [\n {\n primary: t('go_to_noun', [primary]),\n onClick\n },\n {\n primary: t('dismiss_case'),\n onClick: onDismiss\n }\n ];\n }\n\n let Component: ElementType;\n\n if (href) {\n Component = Link;\n } else {\n Component = BareButton;\n }\n\n const shouldShowMenuAttributes = hasItems || (onDismiss && !navOpen);\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n if (navOpen && isMenuItem && listItemRef.current?.parentElement?.matches(':first-child'))\n listItemRef.current?.focus();\n }, [navOpen]);\n\n const { end } = useDirection();\n const primaryId = useUID();\n\n return (\n <StyledNavListItem {...restProps} key={primary} singleSelect={singleSelect} nestedListCollapsed>\n <NavigationListItemWrapper\n tooltipLabel={secondary ? `${primary} ${secondary}` : primary}\n label={primary}\n childElementRef={listItemRef}\n items={actions || items || caseItems}\n onMenuToggle={setMenuState}\n >\n <Component\n {...compProps}\n ref={listItemRef}\n {...(navOpen && isMenuItem ? { tabIndex: -1, role: 'menuitem' } : {})}\n aria-labelledby={`${primaryId} ${count ? `${primary}-count` : ''} ${ariaLabelledBy ?? ''}`}\n {...(shouldShowMenuAttributes && {\n 'aria-haspopup': 'menu',\n 'aria-expanded': menuState === 'open'\n })}\n aria-current={ariaCurrent}\n >\n {singleSelect && (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledSingleSelectIconBox}\n >\n {selected && <Icon name='check' />}\n </Flex>\n )}\n {visual && (\n <Flex\n container={{ direction: 'column', gap: 0.5 }}\n as={StyledNavListItemVisualContainer}\n isCurrent={ariaCurrent === 'page'}\n navOpen={navOpen}\n >\n <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>\n {!navOpen && collapsedItemInfo && (\n <Text variant='secondary'>{collapsedItemInfo}</Text>\n )}\n </Flex>\n )}\n\n {secondary ? (\n <Flex\n container={{ direction: 'column', alignItems: 'start' }}\n item={{ shrink: !navOpen && detached ? 1 : 0 }}\n as='span'\n >\n <span id={primaryId}>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span id={primaryId}>{primary}</span>\n )}\n\n {(hasItems || actions) && navState === 'open' && (\n <StyledNavListItemExpandCollapse name={`caret-${end}`} />\n )}\n </Component>\n </NavigationListItemWrapper>\n\n {onDismiss && navOpen && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n\n {hasItems && (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <NavigationList nestedList items={actions || items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n};\n\nconst NavigationList: FC<NavListProps> = ({\n items = [],\n nestedList,\n id,\n collapsed,\n singleSelect\n}) => {\n let Component: ElementType = StyledNavList;\n let ItemComponent: ElementType;\n const { navOpen } = useContext(AppShellContext);\n\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...(nestedList ? { role: 'menu', id } : {})} {...fwdProps}>\n {items.map(item => {\n if (isValidElement(item)) return item;\n\n if (item.items && item.items.length > 0 && navOpen) {\n ItemComponent = NavigationMenu;\n } else {\n ItemComponent = NavigationListItem;\n }\n\n return (\n <ItemComponent\n key={item.id || item.primary}\n isMenuItem={nestedList}\n singleSelect={singleSelect}\n aria-current={item['aria-current']}\n {...item}\n />\n );\n })}\n </Component>\n );\n};\n\nexport default NavigationList;\n"]}
|
|
1
|
+
{"version":3,"file":"NavigationList.js","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAG/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAC;AAEjE,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAOpE,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,+B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M,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK;YACtF,GAAG,QAAQ;SACZ,CAAC;QAEF,SAAS,GAAG,mBAAmB,CAAC;IAClC,CAAC;IAED,OAAO,CACL,KAAC,SAAS,OAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAM,QAAQ,YAClE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChB,IAAI,cAAc,CAAC,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC;YAEtC,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC;gBACnD,aAAa,GAAG,cAAc,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,aAAa,GAAG,kBAAkB,CAAC;YACrC,CAAC;YAED,OAAO,CACL,KAAC,aAAa,IAEZ,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,kBACZ,IAAI,CAAC,cAAc,CAAC,KAC9B,IAAI,IAJH,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAK5B,CACH,CAAC;QACJ,CAAC,CAAC,GACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport type { ElementType, FC, MouseEvent, MouseEventHandler } from 'react';\n\nimport {\n useTheme,\n useArrows,\n useConsolidatedRef,\n useDirection,\n useUID,\n useI18n,\n useEscape\n} from '../../hooks';\nimport { isValidElement } from '../../utils';\nimport ExpandCollapse from '../ExpandCollapse';\nimport BareButton from '../Button/BareButton';\nimport Flex from '../Flex';\nimport Icon, { registerIcon } from '../Icon';\nimport Text from '../Text';\nimport Button from '../Button';\nimport type { OmitStrict } from '../../types';\nimport type { PopoverProps } from '../Popover';\nimport Link from '../Link';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as checkIcon from '../Icon/icons/check.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\n\nimport NavigationListItemWrapper from './NavigationListItemWrapper';\nimport type {\n NavListItemProps,\n NavListItemWrapperProps,\n NavListProps,\n NavMenuProps\n} from './AppShell.types';\nimport {\n StyledNavList,\n StyledNestedNavList,\n StyledNavItemIconBox,\n StyledNavListItem,\n StyledNavListItemExpandCollapse,\n StyledCaseClose,\n StyledSingleSelectIconBox,\n StyledNavListItemVisualContainer,\n StyledNavListItemGroupIndicator\n} from './AppShell.styles';\nimport AppShellContext from './AppShellContext';\n\nregisterIcon(timesIcon, checkIcon, caretLeftIcon, caretRightIcon);\n\nconst NavigationMenu: FC<NavMenuProps> = props => {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n onDismiss,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const uid = useUID();\n\n const { navState } = useContext(AppShellContext);\n const [collapsed, setCollapsed] = useState(true);\n\n const toggleCollapsed = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n setCollapsed(state => !state);\n },\n [setCollapsed]\n );\n\n const itemRef = useConsolidatedRef(forwardedRef);\n\n const menuRef = useRef<HTMLLIElement>(null);\n\n useArrows(menuRef, { selector: '[role=\"menuitem\"]', cycle: true });\n\n useEscape(() => {\n setCollapsed(true);\n itemRef.current?.focus();\n }, menuRef);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem {...restProps} key={primary} nestedListCollapsed={collapsed} ref={menuRef}>\n <BareButton\n id={uid}\n ref={itemRef}\n aria-expanded={!collapsed}\n aria-controls={`${uid}-menu`}\n aria-label={primary}\n onClick={toggleCollapsed}\n >\n {visual && <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>}\n\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n\n {navState === 'open' && <StyledNavListItemExpandCollapse name={`caret-${end}`} />}\n </BareButton>\n\n {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}\n <NavigationList\n id={`${uid}-menu`}\n nestedList\n items={items}\n collapsed={!navOpen || collapsed}\n />\n </StyledNavListItem>\n );\n};\n\nexport const NavigationListItem: FC<NavListItemProps> = ({\n visual,\n primary,\n secondary,\n collapsedItemInfo,\n href,\n onClick,\n items,\n collapseItems = false,\n onDismiss,\n actions,\n forwardedRef,\n isMenuItem,\n count,\n singleSelect,\n selected,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-current': ariaCurrent,\n ...restProps\n}) => {\n const { navOpen, navState } = useContext(AppShellContext);\n const t = useI18n();\n const listItemRef = useConsolidatedRef(forwardedRef);\n const [menuState, setMenuState] = useState('');\n const {\n components: {\n 'app-shell': {\n nav: { detached }\n }\n }\n } = useTheme();\n\n const hasItems =\n (Array.isArray(items) && items.length > 0) || (Array.isArray(actions) && actions.length > 0);\n const compProps: {\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n 'aria-label'?: string;\n } = {\n onClick: (e: MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>) => {\n e.stopPropagation();\n onClick?.(e);\n },\n href\n };\n\n let caseItems: NavListItemWrapperProps['items'] | undefined;\n if (onDismiss) {\n caseItems = [\n {\n primary: t('go_to_noun', [primary]),\n onClick\n },\n {\n primary: t('dismiss_case'),\n onClick: onDismiss\n }\n ];\n }\n\n let Component: ElementType;\n\n if (href) {\n Component = Link;\n } else {\n Component = BareButton;\n }\n\n const shouldShowMenuAttributes = hasItems || (onDismiss && !navOpen);\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n if (navOpen && isMenuItem && listItemRef.current?.parentElement?.matches(':first-child'))\n listItemRef.current?.focus();\n }, [navOpen]);\n\n const { end } = useDirection();\n const primaryId = useUID();\n\n return (\n <StyledNavListItem {...restProps} key={primary} singleSelect={singleSelect} nestedListCollapsed>\n <NavigationListItemWrapper\n tooltipLabel={secondary ? `${primary} ${secondary}` : primary}\n label={primary}\n childElementRef={listItemRef}\n items={actions || items || caseItems}\n onMenuToggle={setMenuState}\n >\n <Component\n {...compProps}\n ref={listItemRef}\n {...(navOpen && isMenuItem ? { tabIndex: -1, role: 'menuitem' } : {})}\n aria-labelledby={`${primaryId} ${count ? `${primary}-count` : ''} ${ariaLabelledBy ?? ''}`}\n {...(shouldShowMenuAttributes && {\n 'aria-haspopup': 'menu',\n 'aria-expanded': menuState === 'open'\n })}\n aria-current={ariaCurrent}\n >\n {singleSelect && (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledSingleSelectIconBox}\n >\n {selected && <Icon name='check' />}\n </Flex>\n )}\n {visual && (\n <Flex\n container={{ direction: 'column', gap: 0.5 }}\n as={StyledNavListItemVisualContainer}\n isCurrent={ariaCurrent === 'page'}\n navOpen={navOpen}\n >\n <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>\n {!navOpen && collapsedItemInfo && (\n <Text variant='secondary'>{collapsedItemInfo}</Text>\n )}\n {hasItems && navState === 'closed' && (\n <StyledNavListItemGroupIndicator name={`caret-${end}`} />\n )}\n </Flex>\n )}\n\n {secondary ? (\n <Flex\n container={{ direction: 'column', alignItems: 'start' }}\n item={{ shrink: !navOpen && detached ? 1 : 0 }}\n as='span'\n >\n <span id={primaryId}>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span id={primaryId}>{primary}</span>\n )}\n\n {(hasItems || actions) && navState === 'open' && (\n <StyledNavListItemExpandCollapse name={`caret-${end}`} />\n )}\n </Component>\n </NavigationListItemWrapper>\n\n {onDismiss && navOpen && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n\n {hasItems && (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <NavigationList nestedList items={actions || items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n};\n\nconst NavigationList: FC<NavListProps> = ({\n items = [],\n nestedList,\n id,\n collapsed,\n singleSelect\n}) => {\n let Component: ElementType = StyledNavList;\n let ItemComponent: ElementType;\n const { navOpen } = useContext(AppShellContext);\n\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...(nestedList ? { role: 'menu', id } : {})} {...fwdProps}>\n {items.map(item => {\n if (isValidElement(item)) return item;\n\n if (item.items && item.items.length > 0 && navOpen) {\n ItemComponent = NavigationMenu;\n } else {\n ItemComponent = NavigationListItem;\n }\n\n return (\n <ItemComponent\n key={item.id || item.primary}\n isMenuItem={nestedList}\n singleSelect={singleSelect}\n aria-current={item['aria-current']}\n {...item}\n />\n );\n })}\n </Component>\n );\n};\n\nexport default NavigationList;\n"]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { BaseProps,
|
|
1
|
+
import type { BaseProps, NoChildrenProp, TestIdProp } from '../../types';
|
|
2
2
|
import { type ConfigurationProps } from '../Configuration';
|
|
3
3
|
export interface ThemeSwitcherProps extends BaseProps, NoChildrenProp, TestIdProp {
|
|
4
4
|
themeMode: NonNullable<ConfigurationProps['themeMode']>;
|
|
5
5
|
onThemeModeChange: (mode: ThemeSwitcherProps['themeMode']) => void;
|
|
6
6
|
}
|
|
7
|
-
declare const ThemeSwitcher:
|
|
7
|
+
declare const ThemeSwitcher: (({ testId, themeMode, onThemeModeChange }: ThemeSwitcherProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
8
|
+
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("../../types").TestIdsRecord<readonly []>;
|
|
9
|
+
};
|
|
8
10
|
export default ThemeSwitcher;
|
|
9
11
|
//# sourceMappingURL=ThemeSwitcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSwitcher.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/ThemeSwitcher.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeSwitcher.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/ThemeSwitcher.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAa1E,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,cAAc,EAAE,UAAU;IAC/E,SAAS,EAAE,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;IACxD,iBAAiB,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACpE;AAED,QAAA,MAAM,aAAa,8CAIhB,kBAAkB;;CA2DM,CAAC;AAE5B,eAAe,aAAa,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useMemo } from 'react';
|
|
3
3
|
import { menuHelpers } from '../Menu';
|
|
4
4
|
import { useI18n, useTestIds } from '../../hooks';
|
|
5
5
|
import Flex from '../Flex';
|
|
@@ -13,7 +13,7 @@ const ThemeModeIconMap = {
|
|
|
13
13
|
dark: 'moon',
|
|
14
14
|
system: 'circle-mixed-left'
|
|
15
15
|
};
|
|
16
|
-
const ThemeSwitcher = withTestIds(
|
|
16
|
+
const ThemeSwitcher = withTestIds(function ThemeSwitcher({ testId, themeMode, onThemeModeChange }) {
|
|
17
17
|
const t = useI18n();
|
|
18
18
|
const testIds = useTestIds(testId, getThemeSwitcherTestIds);
|
|
19
19
|
const [items, setItems] = useState(() => [
|
|
@@ -53,6 +53,6 @@ const ThemeSwitcher = withTestIds(forwardRef(function ThemeSwitcher({ testId, th
|
|
|
53
53
|
items,
|
|
54
54
|
onItemClick: handleMenuItemClick
|
|
55
55
|
} }) }) }));
|
|
56
|
-
}
|
|
56
|
+
}, getThemeSwitcherTestIds);
|
|
57
57
|
export default ThemeSwitcher;
|
|
58
58
|
//# sourceMappingURL=ThemeSwitcher.js.map
|