@pega/cosmos-react-build 4.0.0-dev.2.0 → 4.0.0-dev.20.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.
Files changed (179) hide show
  1. package/lib/components/AppShell/AppShell.d.ts +3 -2
  2. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppShell.js +42 -80
  4. package/lib/components/AppShell/AppShell.js.map +1 -1
  5. package/lib/components/AppShell/AppShell.styles.d.ts +12 -16
  6. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  7. package/lib/components/AppShell/AppShell.styles.js +208 -283
  8. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  9. package/lib/components/AppShell/AppShell.types.d.ts +63 -31
  10. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  11. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  12. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShellContext.js +3 -5
  14. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  15. package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -0
  16. package/lib/components/AppShell/Header/AppHeader.js +73 -0
  17. package/lib/components/AppShell/Header/AppHeader.js.map +1 -0
  18. package/lib/components/{AppHeader → AppShell/Header}/AppHeader.styles.d.ts +7 -7
  19. package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -0
  20. package/lib/components/AppShell/Header/AppHeader.styles.js +158 -0
  21. package/lib/components/AppShell/Header/AppHeader.styles.js.map +1 -0
  22. package/lib/components/{AppHeader → AppShell/Header}/AppHeader.types.d.ts +6 -5
  23. package/lib/components/AppShell/Header/AppHeader.types.d.ts.map +1 -0
  24. package/lib/components/AppShell/Header/AppHeader.types.js.map +1 -0
  25. package/lib/components/AppShell/Header/BranchButton.d.ts.map +1 -0
  26. package/lib/components/{AppHeader → AppShell/Header}/BranchButton.js +5 -5
  27. package/lib/components/AppShell/Header/BranchButton.js.map +1 -0
  28. package/lib/components/AppShell/NavigationList.d.ts +6 -0
  29. package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
  30. package/lib/components/AppShell/NavigationList.js +97 -0
  31. package/lib/components/AppShell/NavigationList.js.map +1 -0
  32. package/lib/components/AppShell/index.d.ts +3 -1
  33. package/lib/components/AppShell/index.d.ts.map +1 -1
  34. package/lib/components/AppShell/index.js.map +1 -1
  35. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  36. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +27 -27
  37. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  38. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +1 -1
  39. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  40. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts +41 -27
  41. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -1
  42. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  43. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +17 -33
  44. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  45. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +6 -6
  46. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  47. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +4 -3
  48. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
  49. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
  50. package/lib/components/ExpressionBuilder/index.d.ts +1 -1
  51. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  52. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  53. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  54. package/lib/components/FlowModeller/AddNode.js +3 -4
  55. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  56. package/lib/components/FlowModeller/Connector.d.ts +2 -2
  57. package/lib/components/FlowModeller/Connector.d.ts.map +1 -1
  58. package/lib/components/FlowModeller/Connector.js +2 -4
  59. package/lib/components/FlowModeller/Connector.js.map +1 -1
  60. package/lib/components/FlowModeller/DeletePopover.d.ts +3 -3
  61. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -1
  62. package/lib/components/FlowModeller/DeletePopover.js.map +1 -1
  63. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  64. package/lib/components/FlowModeller/FlowModeller.js +1 -3
  65. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  66. package/lib/components/FlowModeller/Node/Node.types.d.ts +5 -0
  67. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  68. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  69. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +5 -1
  70. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  71. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +10 -3
  72. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  73. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  74. package/lib/components/FlowModeller/Node/NodeTemplates.js +11 -29
  75. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  76. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  77. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +3 -3
  78. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  79. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  80. package/lib/components/ItemLibrary/ItemLibrary.js +2 -2
  81. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  82. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  83. package/lib/components/LifeCycle/Category.js +2 -2
  84. package/lib/components/LifeCycle/Category.js.map +1 -1
  85. package/lib/components/LifeCycle/LifeCycle.types.d.ts +22 -1
  86. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  87. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  88. package/lib/components/LifeCycle/LifeCycleList.d.ts +11 -0
  89. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  90. package/lib/components/LifeCycle/LifeCycleList.js +1 -1
  91. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  92. package/lib/components/LifeCycle/Stage.d.ts +2 -0
  93. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  94. package/lib/components/LifeCycle/Stage.js +4 -10
  95. package/lib/components/LifeCycle/Stage.js.map +1 -1
  96. package/lib/components/LifeCycle/Step.d.ts +6 -2
  97. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  98. package/lib/components/LifeCycle/Step.js +30 -24
  99. package/lib/components/LifeCycle/Step.js.map +1 -1
  100. package/lib/components/LifeCycle/Task.d.ts +1 -0
  101. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  102. package/lib/components/LifeCycle/Task.js +6 -12
  103. package/lib/components/LifeCycle/Task.js.map +1 -1
  104. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +0 -1
  105. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
  106. package/lib/components/MobileBuildSummary/MobileBuildSummary.js +5 -16
  107. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
  108. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts +5 -3
  109. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts.map +1 -1
  110. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js.map +1 -1
  111. package/lib/components/ObjectPreview/ObjectPreview.d.ts +2 -2
  112. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -1
  113. package/lib/components/ObjectPreview/ObjectPreview.js +1 -1
  114. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -1
  115. package/lib/components/ObjectSelect/ObjectSummary.d.ts +11 -3
  116. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
  117. package/lib/components/ObjectSelect/ObjectSummary.js +50 -14
  118. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
  119. package/lib/components/ObjectSelect/useCreateModal.d.ts +9 -11
  120. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -1
  121. package/lib/components/ObjectSelect/useCreateModal.js +5 -6
  122. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -1
  123. package/lib/components/PageBanner/PageBanner.d.ts +22 -0
  124. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -0
  125. package/lib/components/PageBanner/PageBanner.js +59 -0
  126. package/lib/components/PageBanner/PageBanner.js.map +1 -0
  127. package/lib/components/PageBanner/index.d.ts +3 -0
  128. package/lib/components/PageBanner/index.d.ts.map +1 -0
  129. package/lib/components/PageBanner/index.js +2 -0
  130. package/lib/components/PageBanner/index.js.map +1 -0
  131. package/lib/components/PageTemplates/GalleryPage.d.ts +10 -10
  132. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  133. package/lib/components/PageTemplates/GalleryPage.js +35 -11
  134. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  135. package/lib/components/PageTemplates/PageTemplates.d.ts +1 -1
  136. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  137. package/lib/components/PageTemplates/PageTemplates.js +8 -45
  138. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  139. package/lib/components/PageTemplates/ShowcasePage.d.ts +16 -0
  140. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -0
  141. package/lib/components/PageTemplates/ShowcasePage.js +29 -0
  142. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -0
  143. package/lib/components/PageTemplates/index.d.ts +3 -1
  144. package/lib/components/PageTemplates/index.d.ts.map +1 -1
  145. package/lib/components/PageTemplates/index.js +2 -1
  146. package/lib/components/PageTemplates/index.js.map +1 -1
  147. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  148. package/lib/components/SummaryCard/SummaryCard.js +4 -7
  149. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  150. package/lib/components/Workbench/Workbench.types.d.ts +2 -2
  151. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  152. package/lib/index.d.ts +3 -2
  153. package/lib/index.d.ts.map +1 -1
  154. package/lib/index.js +3 -2
  155. package/lib/index.js.map +1 -1
  156. package/lib/utils/utils.d.ts +1 -1
  157. package/lib/utils/utils.d.ts.map +1 -1
  158. package/package.json +16 -9
  159. package/lib/components/AppHeader/AppHeader.d.ts.map +0 -1
  160. package/lib/components/AppHeader/AppHeader.js +0 -40
  161. package/lib/components/AppHeader/AppHeader.js.map +0 -1
  162. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +0 -1
  163. package/lib/components/AppHeader/AppHeader.styles.js +0 -118
  164. package/lib/components/AppHeader/AppHeader.styles.js.map +0 -1
  165. package/lib/components/AppHeader/AppHeader.types.d.ts.map +0 -1
  166. package/lib/components/AppHeader/AppHeader.types.js.map +0 -1
  167. package/lib/components/AppHeader/BranchButton.d.ts.map +0 -1
  168. package/lib/components/AppHeader/BranchButton.js.map +0 -1
  169. package/lib/components/AppHeader/index.d.ts +0 -4
  170. package/lib/components/AppHeader/index.d.ts.map +0 -1
  171. package/lib/components/AppHeader/index.js +0 -3
  172. package/lib/components/AppHeader/index.js.map +0 -1
  173. package/lib/components/PageTemplates/GalleryPage.styles.d.ts +0 -9
  174. package/lib/components/PageTemplates/GalleryPage.styles.d.ts.map +0 -1
  175. package/lib/components/PageTemplates/GalleryPage.styles.js +0 -70
  176. package/lib/components/PageTemplates/GalleryPage.styles.js.map +0 -1
  177. /package/lib/components/{AppHeader → AppShell/Header}/AppHeader.d.ts +0 -0
  178. /package/lib/components/{AppHeader → AppShell/Header}/AppHeader.types.js +0 -0
  179. /package/lib/components/{AppHeader → AppShell/Header}/BranchButton.d.ts +0 -0
@@ -1,344 +1,269 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { lighten, hideVisually } from 'polished';
2
+ import { lighten, rgba } from 'polished';
3
3
  import { useContext } from 'react';
4
- import { Icon, Text, tryCatch, defaultThemeProp, Button, useDirection, StyledIcon, StyledAvatar } from '@pega/cosmos-react-core';
5
- import { StyledSwitch, SwitchLabel } from '@pega/cosmos-react-core/lib/components/Switch/Switch';
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 hoverBg = 'rgba(0, 0, 0, 0.4)';
10
- export const StyledNavToggle = styled(Button)(({ theme }) => {
11
- const { ltr } = useDirection();
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 }) => {
7
+ const navWidth = '3rem';
8
+ const navOpenWidth = '14rem';
9
+ export const StyledUtils = styled.div(({ theme }) => {
40
10
  const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
41
11
  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 }) => {
83
- const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
84
- return css `
85
- padding-bottom: calc(${showDevMode ? 2 : 0} * ${theme.base.spacing});
86
- border-top: 0.0625rem solid ${borderColor};
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 StyledUtilItem = styled.li(({ theme }) => {
17
+ export const StyledAppShellToggleButton = styled(Button)(({ theme }) => {
112
18
  return css `
113
- &[aria-current='true'] {
114
- background-color: rgba(0, 0, 0, 0.4);
19
+ background-color: ${theme.base.palette.dark};
20
+ color: ${theme.base.palette.light};
21
+ border: none;
115
22
 
116
- & > ${StyledBareButton} {
117
- color: ${theme.base.colors.blue.light};
118
- }
23
+ ${StyledIcon} {
24
+ width: 1.25rem;
25
+ height: 1.25rem;
26
+ font-weight: bold;
119
27
  }
120
28
 
121
- ${StyledBareButton} {
122
- font-weight: ${theme.base['font-weight']['semi-bold']};
123
- color: ${theme.base.colors.white};
124
- width: 100%;
125
- height: 100%;
126
- text-align: start;
127
- padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});
128
-
129
- &:hover {
130
- background-color: rgba(0, 0, 0, 0.4);
131
- }
132
-
133
- &:focus {
134
- box-shadow: ${theme.base.shadow['focus-inset']};
135
- }
29
+ &:enabled:focus,
30
+ :not([disabled]):focus {
31
+ box-shadow: ${theme.base.shadow.focus};
136
32
  }
137
33
  `;
138
34
  });
139
- StyledUtilItem.defaultProps = defaultThemeProp;
35
+ StyledAppShellToggleButton.defaultProps = defaultThemeProp;
140
36
  export const StyledScrollWrap = styled.div(() => {
141
- const { drawerOpen } = useContext(AppShellContext);
142
37
  return css `
143
- height: ${drawerOpen ? 'calc(100% - 4rem)' : '100%'};
38
+ height: 100%;
144
39
  overflow-y: auto;
145
40
  `;
146
41
  });
147
42
  StyledScrollWrap.defaultProps = defaultThemeProp;
148
- export const StyledNavContent = styled.div(({ theme }) => {
149
- const { navState } = useContext(AppShellContext);
43
+ export const StyledMain = styled.main(({ navOpen, hideNav, theme: { base: { animation, breakpoints, palette } } }) => {
150
44
  return css `
151
- width: 14rem;
152
- height: 100%;
153
- opacity: 0;
154
- transition: opacity ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
45
+ position: relative;
46
+ min-height: calc(100vh - 6rem);
47
+ background-color: ${palette['app-background']};
48
+ margin-inline-start: ${navWidth};
49
+ transition: margin-inline-start ${`${animation.speed} ${animation.timing.ease}`};
50
+
51
+ @media (pointer: coarse) {
52
+ min-height: calc(100vh - 8rem);
53
+ }
155
54
 
156
- ${navState === 'collapsed' &&
157
- css `
158
- display: none;
159
- `}
55
+ @media (min-width: ${breakpoints.md}) {
56
+ min-height: calc(100vh - 3rem);
57
+ }
160
58
 
161
- ${(navState === 'expanding' || navState === 'expanded') &&
59
+ ${navOpen &&
162
60
  css `
163
- opacity: 1;
164
- `}
165
- `;
166
- });
167
- StyledNavContent.defaultProps = defaultThemeProp;
168
- export const StyledMain = styled.main(({ theme }) => {
169
- return css `
170
- position: relative;
171
- min-height: calc(100vh - 3rem);
172
- background-color: ${theme.base.palette['app-background']};
173
- transition: margin ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
174
- `;
175
- });
176
- StyledMain.defaultProps = defaultThemeProp;
177
- export const StyledDrawerWrapper = styled.div(() => {
178
- const { drawerOpen } = useContext(AppShellContext);
179
- return css `
180
- position: relative;
181
- z-index: 1;
182
- height: ${drawerOpen ? '100%' : 'auto'};
183
- `;
184
- });
185
- StyledDrawerWrapper.defaultProps = defaultThemeProp;
186
- export const StyledNavHeaderVisual = styled.div(({ theme, bgColor }) => {
187
- return css `
188
- min-width: 2rem;
189
- min-height: 2rem;
190
- border-radius: 0.4rem;
191
- background-color: ${bgColor};
192
- margin-inline-end: ${theme.base.spacing};
193
- color: ${theme.base.colors.white};
194
- & svg {
195
- color: ${theme.base.colors.white};
196
- }
197
- `;
198
- });
199
- StyledNavHeaderVisual.defaultProps = defaultThemeProp;
200
- export const StyledDrawerCloseButton = styled(Button)(({ theme }) => {
201
- return css `
202
- margin-inline-end: ${theme.base.spacing};
203
- min-width: 1.5rem;
204
- min-height: 1.5rem;
205
- color: ${theme.base.colors.white};
61
+ margin-inline-start: ${navOpenWidth};
62
+ `}
206
63
 
207
- ${StyledIcon} {
208
- width: 1em;
209
- height: 1em;
210
- }
211
- `;
212
- });
213
- StyledDrawerCloseButton.defaultProps = defaultThemeProp;
214
- export const StyledInnerNav = styled.div(() => {
215
- const { navState } = useContext(AppShellContext);
216
- return css `
217
- height: 100%;
218
- ${(navState === 'collapsing' || navState === 'expanding') &&
64
+ ${hideNav &&
219
65
  css `
220
- overflow: hidden;
221
- `}
222
- `;
66
+ transition-duration: 0s;
67
+ margin-inline-start: 0;
68
+ `}
69
+ `;
223
70
  });
224
- StyledInnerNav.defaultProps = defaultThemeProp;
225
- export const StyledNav = styled.nav(({ theme }) => {
71
+ StyledMain.defaultProps = defaultThemeProp;
72
+ 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 } } }) => {
226
73
  const { navState } = useContext(AppShellContext);
74
+ const fontSizes = calculateFontSize(fontSize, fontScale);
227
75
  return css `
228
- position: fixed;
229
- z-index: 1;
230
- height: calc(100vh - 3rem);
231
- background: ${theme.components['app-shell'].nav['background-color']};
232
-
233
- &,
234
- ${StyledInnerNav} {
235
- width: ${navState === 'expanding' || navState === 'expanded' ? '14' : '1.5'}rem;
236
- transition: width ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
237
- }
76
+ position: fixed;
77
+ z-index: 1;
78
+ height: calc(100vh - 6rem);
79
+ background: ${appShell.nav['background-color']};
80
+ width: ${navState === 'opening' || navState === 'open' ? navOpenWidth : navWidth};
81
+ transition: width ${animation.speed} ${animation.timing.ease};
82
+ display: flex;
83
+
84
+ ${StyledStandardTree} {
85
+ background-color: ${palette.dark};
86
+
87
+ ${StyledNodeText}, ${StyledToggleIcon} {
88
+ color: rgba(255, 255, 255, 0.7);
89
+ font-size: ${fontSizes.s};
90
+ }
238
91
 
239
- ${theme.base['custom-scrollbar'] &&
240
- css `
241
- * {
242
- scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);
243
- scrollbar-width: thin;
244
- }
92
+ ${StyledNodeInteraction} {
93
+ padding-block-start: calc(0.5 * ${spacing});
94
+ padding-block-end: calc(0.5 * ${spacing});
245
95
 
246
- @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {
247
- /* stylelint-disable unit-allowed-list */
96
+ &:hover {
97
+ background: rgba(255, 255, 255, 0.1);
248
98
 
249
- *::-webkit-scrollbar {
250
- width: 12px;
251
- height: 12px;
252
- }
99
+ ${StyledNodeText} {
100
+ color: ${palette.light};
101
+ }
102
+ }
253
103
 
254
- *::-webkit-scrollbar-track {
255
- background-color: rgba(0, 0, 0, 0.2);
256
- }
104
+ &:focus {
105
+ box-shadow: ${shadow['focus-inset']};
106
+ }
257
107
 
258
- *::-webkit-scrollbar-corner {
259
- background-color: rgba(0, 0, 0, 0.2);
260
- border-bottom-right-radius: inherit;
261
- }
108
+ &[aria-current='page'],
109
+ &[aria-current='true'] {
110
+ background: rgba(255, 255, 255, 0.05);
262
111
 
263
- *::-webkit-scrollbar-thumb {
264
- background-color: transparent;
265
- border: 3px solid transparent;
266
- border-radius: calc(1.125 * ${theme.base['border-radius']});
267
- box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);
112
+ ${StyledNodeText} {
113
+ color: ${colors.blue.light};
114
+ }
115
+ }
268
116
  }
269
117
 
270
- *::-webkit-scrollbar-thumb:hover {
271
- box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);
118
+ &:has(:focus-visible) {
119
+ box-shadow: inset 0 0 0 0.125rem #71c1ff99;
272
120
  }
121
+ }
273
122
 
274
- *::-webkit-scrollbar-track:horizontal {
275
- border-bottom-left-radius: inherit;
123
+ ${customScrollbar &&
124
+ css `
125
+ * {
126
+ scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);
127
+ scrollbar-width: thin;
276
128
  }
277
129
 
278
- *::-webkit-scrollbar-track:vertical {
279
- border-top-right-radius: inherit;
280
- }
130
+ @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {
131
+ /* stylelint-disable unit-allowed-list */
132
+
133
+ *::-webkit-scrollbar {
134
+ width: 12px;
135
+ height: 12px;
136
+ }
137
+
138
+ *::-webkit-scrollbar-track {
139
+ background-color: rgba(0, 0, 0, 0.2);
140
+ }
141
+
142
+ *::-webkit-scrollbar-corner {
143
+ background-color: rgba(0, 0, 0, 0.2);
144
+ border-bottom-right-radius: inherit;
145
+ }
146
+
147
+ *::-webkit-scrollbar-thumb {
148
+ background-color: transparent;
149
+ border: 3px solid transparent;
150
+ border-radius: calc(1.125 * ${borderRadius});
151
+ box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);
152
+ }
153
+
154
+ *::-webkit-scrollbar-thumb:hover {
155
+ box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);
156
+ }
157
+
158
+ *::-webkit-scrollbar-track:horizontal {
159
+ border-bottom-left-radius: inherit;
160
+ }
161
+
162
+ *::-webkit-scrollbar-track:vertical {
163
+ border-top-right-radius: inherit;
164
+ }
165
+
166
+ /* stylelint-disable-next-line selector-pseudo-class-no-unknown */
167
+ *::-webkit-scrollbar-track:not(:corner-present) {
168
+ border-bottom-right-radius: inherit;
169
+ }
281
170
 
282
- /* stylelint-disable-next-line selector-pseudo-class-no-unknown */
283
- *::-webkit-scrollbar-track:not(:corner-present) {
284
- border-bottom-right-radius: inherit;
171
+ /* stylelint-enable unit-allowed-list */
285
172
  }
173
+ `}
286
174
 
287
- /* stylelint-enable unit-allowed-list */
175
+ @media (pointer: coarse) {
176
+ height: calc(100vh - 8rem);
288
177
  }
289
- `}
290
178
 
291
- &:not(:hover) {
292
- ${StyledNavToggle}[aria-expanded='true']:not(:focus) {
293
- ${hideVisually}
179
+ @media (min-width: ${breakpoints.md}) {
180
+ height: calc(100vh - 3rem);
294
181
  }
295
- }
182
+ `;
183
+ });
184
+ StyledNav.defaultProps = defaultThemeProp;
185
+ export const StyledAppShellCaretIcon = styled.svg(({ nestedListCollapsed, theme }) => {
186
+ const { rtl } = useDirection();
187
+ return css `
188
+ transition-property: transform;
189
+ transition-duration: ${theme.base.animation.speed};
190
+ transition-timing-function: ${theme.base.animation.timing.ease};
296
191
 
297
- /*
298
- * A hoverable area just outside the nav for easier mouse interaction with the collapse button.
299
- * As the collpase button straddles the nav boundary, so maybe too should the hoverable area.
300
- */
301
- &::after {
302
- content: '';
192
+ ${nestedListCollapsed === false &&
193
+ css `
194
+ transform: rotateZ(${rtl ? '-90deg' : '90deg'});
195
+ `}
196
+ `;
197
+ });
198
+ StyledAppShellCaretIcon.defaultProps = defaultThemeProp;
199
+ export const StyledNavListItem = styled.li(({ activeTreeRoot, theme }) => {
200
+ const { navOpen } = useContext(AppShellContext);
201
+ const activeBackground = tryCatch(() => rgba('#000000', theme.base.transparency['transparent-4']));
202
+ return css `
303
203
  display: block;
304
- position: absolute;
305
- inset-block-start: 0;
306
- inset-inline-start: 100%;
307
- width: calc(2 * ${theme.base.spacing});
308
- height: 100%;
309
- }
310
-
311
- ${StyledStandardTree} {
312
- color: ${theme.base.colors.white};
204
+ position: relative;
205
+ ${StyledIcon} {
206
+ font-size: 1.25rem;
207
+ }
313
208
 
314
- ${StyledNodeText} {
209
+ > :first-child {
210
+ position: relative;
211
+ display: flex;
212
+ align-items: center;
213
+ width: 100%;
214
+ padding: calc(1.25 * ${theme.base.spacing}) 0;
215
+ white-space: nowrap;
216
+ color: rgba(255, 255, 255, 0.7);
217
+ cursor: pointer;
315
218
  font-weight: ${theme.base['font-weight']['semi-bold']};
316
- }
219
+ text-decoration: none;
220
+
221
+ span {
222
+ overflow: hidden;
223
+ color: inherit;
224
+ }
317
225
 
318
- ${StyledNodeInteraction} {
319
- padding-block-start: calc(0.5 * ${theme.base.spacing});
320
- padding-block-end: calc(0.5 * ${theme.base.spacing});
321
226
  &:hover,
322
- &[aria-current='true'] {
323
- background-color: ${hoverBg};
227
+ &:focus {
228
+ color: ${theme.base.palette.light};
229
+ background: rgba(255, 255, 255, 0.05);
324
230
  }
325
231
 
326
- &[aria-current='true'] {
327
- ${StyledNodeIcon},
328
- ${StyledNodeText} {
329
- color: ${theme.base.colors.blue.light};
330
- }
232
+ &:focus {
233
+ outline: none;
234
+ box-shadow: ${theme.base.shadow['focus-inset']};
235
+ }
236
+
237
+ ${activeTreeRoot &&
238
+ css `
239
+ color: ${theme.base.colors.blue.light};
240
+ background-color: ${activeBackground};
241
+ `}
242
+
243
+ ${StyledAppShellCaretIcon}:last-child {
244
+ position: absolute;
245
+ left: ${navOpen ? 'auto' : '100%'};
246
+ ${navOpen &&
247
+ css `
248
+ inset-inline-end: 1rem;
249
+ `}
250
+ margin: 0;
251
+ opacity: ${navOpen ? '1' : '0'};
252
+ transition-property: opacity;
253
+ }
254
+
255
+ ${StyledIcon}:first-child {
256
+ margin: 0 calc((${navWidth} - 1.125rem) / 2);
331
257
  }
332
258
  }
333
- }
334
259
 
335
- /* Style for main is here since nav(the "&") may be conditionally rendered. */
336
- & + ${StyledMain} {
337
- margin-inline-start: ${navState === 'expanding' || navState === 'expanded'
338
- ? '14rem'
339
- : '1.5rem'};
340
- }
341
- `;
260
+ &[aria-current='page'] > :first-child,
261
+ &[aria-current='true'] > :first-child {
262
+ color: ${theme.base.colors.blue.light};
263
+ background-color: ${activeBackground};
264
+ }
265
+ `;
342
266
  });
343
- StyledNav.defaultProps = defaultThemeProp;
267
+ StyledNavListItem.defaultProps = defaultThemeProp;
268
+ export const StyledNavList = styled.ul ``;
344
269
  //# sourceMappingURL=AppShell.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../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IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;QAGrD,qBAAqB;0CACa,KAAK,CAAC,IAAI,CAAC,OAAO;wCACpB,KAAK,CAAC,IAAI,CAAC,OAAO;;;8BAG5B,OAAO;;;;YAIzB,cAAc;YACd,cAAc;qBACL,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;;;;;;;UAOvC,UAAU;6BACS,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,UAAU;QACxE,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,QAAQ;;GAEf,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,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(({ theme }) => {\n return css`\n position: relative;\n min-height: calc(100vh - 3rem);\n background-color: ${theme.base.palette['app-background']};\n transition: margin ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\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(({ theme }) => {\n const { navState } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n z-index: 1;\n height: calc(100vh - 3rem);\n background: ${theme.components['app-shell'].nav['background-color']};\n\n &,\n ${StyledInnerNav} {\n width: ${navState === 'expanding' || navState === 'expanded' ? '14' : '1.5'}rem;\n transition: width ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${theme.base['border-radius']});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n\n &: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 * ${theme.base.spacing});\n height: 100%;\n }\n\n ${StyledStandardTree} {\n color: ${theme.base.colors.white};\n\n ${StyledNodeText} {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n\n ${StyledNodeInteraction} {\n padding-block-start: calc(0.5 * ${theme.base.spacing});\n padding-block-end: calc(0.5 * ${theme.base.spacing});\n &:hover,\n &[aria-current='true'] {\n background-color: ${hoverBg};\n }\n\n &[aria-current='true'] {\n ${StyledNodeIcon},\n ${StyledNodeText} {\n color: ${theme.base.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});\n\nStyledNav.defaultProps = defaultTh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AG,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)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette.dark};\n color: ${theme.base.palette.light};\n border: none;\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 hideNav: boolean;\n}>(\n ({\n navOpen,\n hideNav,\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 min-height: calc(100vh - 3rem);\n }\n\n ${navOpen &&\n css`\n margin-inline-start: ${navOpenWidth};\n `}\n\n ${hideNav &&\n css`\n transition-duration: 0s;\n margin-inline-start: 0;\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.s};\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<{ activeTreeRoot?: boolean }>(\n ({ activeTreeRoot, 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 ${activeTreeRoot &&\n css`\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\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 margin: 0 calc((${navWidth} - 1.125rem) / 2);\n }\n }\n\n &[aria-current='page'] > :first-child,\n &[aria-current='true'] > :first-child {\n color: ${theme.base.colors.blue.light};\n background-color: ${activeBackground};\n }\n `;\n }\n);\n\nStyledNavListItem.defaultProps = defaultThemeProp;\n\nexport const StyledNavList = styled.ul``;\n"]}