@pega/cosmos-react-build 4.0.0-dev.3.1 → 4.0.0-dev.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +2 -2
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +109 -93
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/{AppHeader → AppShell/Header}/AppHeader.d.ts +0 -0
- package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -0
- package/lib/components/AppShell/Header/AppHeader.js +77 -0
- package/lib/components/AppShell/Header/AppHeader.js.map +1 -0
- package/lib/components/{AppHeader → AppShell/Header}/AppHeader.styles.d.ts +7 -6
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -0
- package/lib/components/AppShell/Header/AppHeader.styles.js +173 -0
- package/lib/components/AppShell/Header/AppHeader.styles.js.map +1 -0
- package/lib/components/{AppHeader → AppShell/Header}/AppHeader.types.d.ts +0 -0
- package/lib/components/AppShell/Header/AppHeader.types.d.ts.map +1 -0
- package/lib/components/{AppHeader → AppShell/Header}/AppHeader.types.js +0 -0
- package/lib/components/AppShell/Header/AppHeader.types.js.map +1 -0
- package/lib/components/{AppHeader → AppShell/Header}/BranchButton.d.ts +0 -0
- package/lib/components/AppShell/Header/BranchButton.d.ts.map +1 -0
- package/lib/components/{AppHeader → AppShell/Header}/BranchButton.js +4 -4
- package/lib/components/AppShell/Header/BranchButton.js.map +1 -0
- package/lib/components/AppShell/index.d.ts +2 -0
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/lib/components/AppHeader/AppHeader.d.ts.map +0 -1
- package/lib/components/AppHeader/AppHeader.js +0 -40
- package/lib/components/AppHeader/AppHeader.js.map +0 -1
- package/lib/components/AppHeader/AppHeader.styles.d.ts.map +0 -1
- package/lib/components/AppHeader/AppHeader.styles.js +0 -118
- package/lib/components/AppHeader/AppHeader.styles.js.map +0 -1
- package/lib/components/AppHeader/AppHeader.types.d.ts.map +0 -1
- package/lib/components/AppHeader/AppHeader.types.js.map +0 -1
- package/lib/components/AppHeader/BranchButton.d.ts.map +0 -1
- package/lib/components/AppHeader/BranchButton.js.map +0 -1
- package/lib/components/AppHeader/index.d.ts +0 -4
- package/lib/components/AppHeader/index.d.ts.map +0 -1
- package/lib/components/AppHeader/index.js +0 -3
- package/lib/components/AppHeader/index.js.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Avatar,
|
|
2
|
+
import { Avatar, Text, Tabs } from '@pega/cosmos-react-core';
|
|
3
3
|
export declare const StyledAppHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const StyledBrandContainer: typeof Flex;
|
|
4
|
+
export declare const StyledBrandContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
5
|
export declare const StyledBrandButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core/lib/components/Button/BareButton").BareButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledBrandImage: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ImageProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
export declare const StyledContext: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
7
8
|
export declare const StyledTabs: typeof Tabs;
|
|
8
|
-
export declare const StyledUtilsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
9
9
|
export declare const StyledAppHeaderSearch: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
-
export declare const StyledAppInfo: typeof Text;
|
|
11
|
-
export declare const StyledBranchContainer: typeof Flex;
|
|
12
10
|
export declare const StyledAppAvatar: typeof Avatar;
|
|
11
|
+
export declare const StyledUtilsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const StyledAppName: typeof Text;
|
|
13
|
+
export declare const StyledAppVersion: typeof Text;
|
|
13
14
|
//# sourceMappingURL=AppHeader.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.styles.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAoB,IAAI,EAAE,IAAI,EAAuB,MAAM,yBAAyB,CAAC;AAIpG,eAAO,MAAM,eAAe,4GA8B3B,CAAC;AAIF,eAAO,MAAM,oBAAoB,yGAkBhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,0QAgB5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,oOAgB5B,CAAC;AAEF,eAAO,MAAM,aAAa,0GAIzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,IA8B/B,CAAC;AAIF,eAAO,MAAM,qBAAqB,yGA0BjC,CAAC;AAIF,eAAO,MAAM,eAAe,EAAE,OAAO,MAGpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,yGA2BhC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,OAAO,IAUjC,CAAC;AAIH,eAAO,MAAM,gBAAgB,EAAE,OAAO,IAKpC,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { Avatar, defaultThemeProp, Text, Tabs, Image, StyledButton } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';
|
|
4
|
+
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
5
|
+
export const StyledAppHeader = styled.header(({ theme: { base: { palette, breakpoints, 'z-index': zIndex } } }) => {
|
|
6
|
+
return css `
|
|
7
|
+
height: 6rem;
|
|
8
|
+
border-bottom: 0.0625rem solid ${palette['border-line']};
|
|
9
|
+
background-color: ${palette['primary-background']};
|
|
10
|
+
position: sticky;
|
|
11
|
+
top: 0;
|
|
12
|
+
z-index: calc(${zIndex.drawer + 1});
|
|
13
|
+
& > div {
|
|
14
|
+
height: 50%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media (pointer: coarse) {
|
|
18
|
+
height: 8rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@media (min-width: ${breakpoints.md}) {
|
|
22
|
+
height: 3rem;
|
|
23
|
+
|
|
24
|
+
& > div {
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
});
|
|
30
|
+
StyledAppHeader.defaultProps = defaultThemeProp;
|
|
31
|
+
export const StyledBrandContainer = styled.div(({ theme: { base: { 'hit-area': hitArea, breakpoints, spacing } } }) => {
|
|
32
|
+
return css `
|
|
33
|
+
max-width: calc(100% - calc(3 * ${hitArea.mouse}));
|
|
34
|
+
|
|
35
|
+
@media (min-width: ${breakpoints.xs}) and (pointer: coarse) {
|
|
36
|
+
max-width: calc(100% - calc(3 * ${hitArea.mouse}) - calc(2 * ${spacing}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (min-width: ${breakpoints.md}) {
|
|
40
|
+
max-width: 30%;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
});
|
|
44
|
+
StyledBrandContainer.defaultProps = defaultThemeProp;
|
|
45
|
+
export const StyledBrandButton = styled(BareButton)(({ theme }) => {
|
|
46
|
+
return css `
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
|
|
50
|
+
& > div:last-child {
|
|
51
|
+
min-width: 0;
|
|
52
|
+
svg {
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:not([disabled]):focus {
|
|
58
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
});
|
|
62
|
+
StyledBrandButton.defaultProps = defaultThemeProp;
|
|
63
|
+
export const StyledBrandImage = styled(Image)(({ theme: { base: { breakpoints } } }) => {
|
|
64
|
+
return css `
|
|
65
|
+
height: 1.5rem;
|
|
66
|
+
max-width: 17ch;
|
|
67
|
+
display: none;
|
|
68
|
+
|
|
69
|
+
@media (min-width: ${breakpoints.sm}) {
|
|
70
|
+
display: unset;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
});
|
|
74
|
+
export const StyledContext = styled.span `
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
text-overflow: ellipsis;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
`;
|
|
79
|
+
export const StyledTabs = styled(Tabs)(({ theme: { base: { breakpoints, 'font-weight': fontWeight } } }) => {
|
|
80
|
+
return css `
|
|
81
|
+
display: none;
|
|
82
|
+
border: none;
|
|
83
|
+
min-height: 3rem;
|
|
84
|
+
[role='tab'] {
|
|
85
|
+
height: auto;
|
|
86
|
+
span:first-of-type {
|
|
87
|
+
text-transform: none;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
[role='tab'][aria-selected='false'] > span {
|
|
91
|
+
font-weight: ${fontWeight['semi-bold']};
|
|
92
|
+
}
|
|
93
|
+
[role='tab']:hover,
|
|
94
|
+
[role='tab']:focus,
|
|
95
|
+
[role='tab']:active {
|
|
96
|
+
box-shadow: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (min-width: ${breakpoints.md}) {
|
|
100
|
+
display: inherit;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
});
|
|
104
|
+
StyledTabs.defaultProps = defaultThemeProp;
|
|
105
|
+
export const StyledAppHeaderSearch = styled.div(({ theme: { base: { spacing, breakpoints, 'content-width': contentWidth } } }) => {
|
|
106
|
+
return css `
|
|
107
|
+
padding-block: ${spacing};
|
|
108
|
+
width: 100%;
|
|
109
|
+
${StyledAppHeaderSearchForm} {
|
|
110
|
+
margin-inline-start: 0;
|
|
111
|
+
max-width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@media (min-width: ${breakpoints.md}) {
|
|
115
|
+
${StyledAppHeaderSearchForm} {
|
|
116
|
+
margin-inline-start: auto;
|
|
117
|
+
max-width: ${contentWidth.lg};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
${StyledButton} {
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
});
|
|
126
|
+
StyledAppHeaderSearch.defaultProps = defaultThemeProp;
|
|
127
|
+
export const StyledAppAvatar = styled(Avatar) `
|
|
128
|
+
width: 1.5rem;
|
|
129
|
+
height: 1.5rem;
|
|
130
|
+
`;
|
|
131
|
+
export const StyledUtilsContainer = styled.div(({ theme: { base: { spacing, breakpoints } } }) => {
|
|
132
|
+
return css `
|
|
133
|
+
width: 100%;
|
|
134
|
+
& > div,
|
|
135
|
+
& > span,
|
|
136
|
+
& > button {
|
|
137
|
+
margin-inline-start: ${spacing};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
& > div:last-child {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@media (min-width: ${breakpoints.md}) {
|
|
145
|
+
width: auto;
|
|
146
|
+
|
|
147
|
+
& > div:last-child {
|
|
148
|
+
display: unset;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
152
|
+
});
|
|
153
|
+
StyledUtilsContainer.defaultProps = defaultThemeProp;
|
|
154
|
+
export const StyledAppName = styled(Text)(({ theme }) => {
|
|
155
|
+
return css `
|
|
156
|
+
max-width: ${theme.base['content-width'].sm};
|
|
157
|
+
text-overflow: ellipsis;
|
|
158
|
+
overflow: hidden;
|
|
159
|
+
white-space: nowrap;
|
|
160
|
+
color: ${theme.base.palette['foreground-color']};
|
|
161
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
162
|
+
margin-inline-start: 0;
|
|
163
|
+
`;
|
|
164
|
+
});
|
|
165
|
+
StyledAppName.defaultProps = defaultThemeProp;
|
|
166
|
+
export const StyledAppVersion = styled(Text)(({ theme }) => {
|
|
167
|
+
return css `
|
|
168
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
169
|
+
margin-inline-start: 0;
|
|
170
|
+
`;
|
|
171
|
+
});
|
|
172
|
+
StyledAppVersion.defaultProps = defaultThemeProp;
|
|
173
|
+
//# sourceMappingURL=AppHeader.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAC7G,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAC1C,CAAC,EACC,K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AAC;AACJ,CAAC,CACF,CAAC;AAEF,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,aAAa,GAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnE,OAAO,GAAG,CAAA;iBACK,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;;;aAIlC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;mBAChC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;GAEtD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtE,OAAO,GAAG,CAAA;mBACO,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;GAEtD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Avatar, defaultThemeProp, Text, Tabs, Image, StyledButton } from '@pega/cosmos-react-core';\nimport { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nexport const StyledAppHeader = styled.header(\n ({\n theme: {\n base: { palette, breakpoints, 'z-index': zIndex }\n }\n }) => {\n return css`\n height: 6rem;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n background-color: ${palette['primary-background']};\n position: sticky;\n top: 0;\n z-index: calc(${zIndex.drawer + 1});\n & > div {\n height: 50%;\n }\n\n @media (pointer: coarse) {\n height: 8rem;\n }\n\n @media (min-width: ${breakpoints.md}) {\n height: 3rem;\n\n & > div {\n height: 100%;\n }\n }\n `;\n }\n);\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n\nexport const StyledBrandContainer = styled.div(\n ({\n theme: {\n base: { 'hit-area': hitArea, breakpoints, spacing }\n }\n }) => {\n return css`\n max-width: calc(100% - calc(3 * ${hitArea.mouse}));\n\n @media (min-width: ${breakpoints.xs}) and (pointer: coarse) {\n max-width: calc(100% - calc(3 * ${hitArea.mouse}) - calc(2 * ${spacing}));\n }\n\n @media (min-width: ${breakpoints.md}) {\n max-width: 30%;\n }\n `;\n }\n);\n\nStyledBrandContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBrandButton = styled(BareButton)(({ theme }) => {\n return css`\n text-decoration: none;\n min-width: 0;\n\n & > div:last-child {\n min-width: 0;\n svg {\n flex-shrink: 0;\n }\n }\n\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledBrandButton.defaultProps = defaultThemeProp;\n\nexport const StyledBrandImage = styled(Image)(\n ({\n theme: {\n base: { breakpoints }\n }\n }) => {\n return css`\n height: 1.5rem;\n max-width: 17ch;\n display: none;\n\n @media (min-width: ${breakpoints.sm}) {\n display: unset;\n }\n `;\n }\n);\n\nexport const StyledContext = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const StyledTabs: typeof Tabs = styled(Tabs)(\n ({\n theme: {\n base: { breakpoints, 'font-weight': fontWeight }\n }\n }) => {\n return css`\n display: none;\n border: none;\n min-height: 3rem;\n [role='tab'] {\n height: auto;\n span:first-of-type {\n text-transform: none;\n }\n }\n [role='tab'][aria-selected='false'] > span {\n font-weight: ${fontWeight['semi-bold']};\n }\n [role='tab']:hover,\n [role='tab']:focus,\n [role='tab']:active {\n box-shadow: none;\n }\n\n @media (min-width: ${breakpoints.md}) {\n display: inherit;\n }\n `;\n }\n);\n\nStyledTabs.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSearch = styled.div(\n ({\n theme: {\n base: { spacing, breakpoints, 'content-width': contentWidth }\n }\n }) => {\n return css`\n padding-block: ${spacing};\n width: 100%;\n ${StyledAppHeaderSearchForm} {\n margin-inline-start: 0;\n max-width: 100%;\n }\n\n @media (min-width: ${breakpoints.md}) {\n ${StyledAppHeaderSearchForm} {\n margin-inline-start: auto;\n max-width: ${contentWidth.lg};\n }\n\n ${StyledButton} {\n display: none;\n }\n }\n `;\n }\n);\n\nStyledAppHeaderSearch.defaultProps = defaultThemeProp;\n\nexport const StyledAppAvatar: typeof Avatar = styled(Avatar)`\n width: 1.5rem;\n height: 1.5rem;\n`;\n\nexport const StyledUtilsContainer = styled.div(\n ({\n theme: {\n base: { spacing, breakpoints }\n }\n }) => {\n return css`\n width: 100%;\n & > div,\n & > span,\n & > button {\n margin-inline-start: ${spacing};\n }\n\n & > div:last-child {\n display: none;\n }\n\n @media (min-width: ${breakpoints.md}) {\n width: auto;\n\n & > div:last-child {\n display: unset;\n }\n }\n `;\n }\n);\n\nStyledUtilsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledAppName: typeof Text = styled(Text)(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].sm};\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${theme.base.palette['foreground-color']};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin-inline-start: 0;\n `;\n});\n\nStyledAppName.defaultProps = defaultThemeProp;\n\nexport const StyledAppVersion: typeof Text = styled(Text)(({ theme }) => {\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin-inline-start: 0;\n `;\n});\n\nStyledAppVersion.defaultProps = defaultThemeProp;\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHeader.types.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,MAAM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;QACR,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHeader.types.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/AppHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref, MouseEvent } from 'react';\n\nimport {\n Action,\n MenuItemProps,\n BaseProps,\n NoChildrenProp,\n MenuProps,\n Tab,\n AvatarProps,\n SearchInputProps\n} from '@pega/cosmos-react-core';\n\nimport { BranchButtonProps } from './BranchButton';\n\nexport interface ContextItem\n extends Pick<MenuItemProps, 'id' | 'primary' | 'visual' | 'href' | 'selected'> {}\n\nexport interface AppHeaderProps extends BaseProps, NoChildrenProp {\n contexts: ContextItem[];\n onContextClick?: MenuProps['onItemClick'];\n brand: {\n label: string;\n logo: string;\n href?: string;\n onClick?: (e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n };\n links?: LinkProps[];\n utils?: UtilsProps;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface LinkProps extends Tab {\n onClick?: (id: string, e?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n}\n\nexport interface UtilsProps {\n avatar: AvatarProps;\n search?: SearchInputProps;\n branch?: BranchButtonProps;\n action?: Pick<Action, 'id' | 'text' | 'onClick' | 'disabled' | 'icon'>;\n appInfo?: {\n name: string;\n version: string;\n };\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BranchButton.d.ts","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/BranchButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAInE,OAAO,EACL,MAAM,EACN,UAAU,EAGV,IAAI,EAGJ,SAAS,EAMT,WAAW,EAGZ,MAAM,yBAAyB,CAAC;AAQjC,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;IAChE,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,KAAK,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,iCAAiC;IACjC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAuDvC,CAAC;AAqBF,eAAO,MAAM,cAAc,EAAE,OAAO,IAIlC,CAAC;AAgBH,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAqEtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -54,7 +54,7 @@ export const StyledWarnIcon = styled(Icon)(({ theme }) => {
|
|
|
54
54
|
`;
|
|
55
55
|
});
|
|
56
56
|
StyledWarnIcon.defaultProps = defaultThemeProp;
|
|
57
|
-
const
|
|
57
|
+
const StyledEllipsizedText = styled.span(({ theme }) => {
|
|
58
58
|
return css `
|
|
59
59
|
max-width: ${theme.base['content-width'].xs};
|
|
60
60
|
white-space: nowrap;
|
|
@@ -63,7 +63,7 @@ const StyledEllipsisedText = styled.span(({ theme }) => {
|
|
|
63
63
|
line-height: 1.5;
|
|
64
64
|
`;
|
|
65
65
|
});
|
|
66
|
-
|
|
66
|
+
StyledEllipsizedText.defaultProps = defaultThemeProp;
|
|
67
67
|
const BranchButton = (props) => {
|
|
68
68
|
const { text, variant, count, compact = false, items = [] } = props;
|
|
69
69
|
const [open, setOpen] = useState(false);
|
|
@@ -82,10 +82,10 @@ const BranchButton = (props) => {
|
|
|
82
82
|
else if (variant === 'urgent') {
|
|
83
83
|
ariaLabel = t('branch_with_potential_conflicts', [text]);
|
|
84
84
|
}
|
|
85
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledBranchButton, { ref: setButtonEl, "aria-expanded": open, "aria-haspopup": 'menu', "aria-controls": 'branch-popover', "aria-label": ariaLabel, branchVariant: variant, label: !open ? text : undefined, onClick: () => setOpen(cur => !cur), onKeyDown: (e) => {
|
|
85
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledBranchButton, { ref: setButtonEl, "aria-expanded": open, "aria-haspopup": 'menu', "aria-controls": 'branch-popover', "aria-label": ariaLabel, branchVariant: variant, label: !open && compact ? text : undefined, onClick: () => setOpen(cur => !cur), onKeyDown: (e) => {
|
|
86
86
|
if (e.key === 'Escape')
|
|
87
87
|
setOpen(false);
|
|
88
|
-
}, children: _jsxs(Flex, { container: { alignItems: 'center', gap: compact ? 1 : 0.5 }, children: [_jsx(Icon, { name: 'nodes-down-solid' }), !compact && (_jsxs(_Fragment, { children: [_jsx(
|
|
88
|
+
}, children: _jsxs(Flex, { container: { alignItems: 'center', gap: compact ? 1 : 0.5 }, children: [_jsx(Icon, { name: 'nodes-down-solid' }), !compact && (_jsxs(_Fragment, { children: [_jsx(StyledEllipsizedText, { children: text }), variant === 'urgent' ? (_jsx(StyledWarnIcon, { name: 'warn-solid' })) : (count !== undefined && _jsx(Count, { children: count }))] })), _jsx(Icon, { name: 'caret-down' })] }) }), _jsx(StyledBranchButtonPopover, { placement: rtl ? 'bottom-end' : 'bottom-start', id: 'branch-popover', hideOnTargetHidden: true, show: open, target: buttonEl, ref: setPopoverRef, children: _jsx(Menu, { items: items, scrollAt: 20, onItemClick: () => setOpen(false), focusControlEl: buttonEl || undefined, focusElOnClose: false }) })] }));
|
|
89
89
|
};
|
|
90
90
|
export default BranchButton;
|
|
91
91
|
//# sourceMappingURL=BranchButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BranchButton.js","sourceRoot":"","sources":["../../../../src/components/AppShell/Header/BranchButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAoC,MAAM,O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AE,CAAC,OAAO,CAAC,KAAK,CAAC,EACjC,cAAc,EAAE,QAAQ,IAAI,SAAS,EACrC,cAAc,EAAE,KAAK,GACrB,GACwB,IAC3B,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { useState, FunctionComponent, KeyboardEvent } from 'react';\nimport styled, { css, DefaultTheme } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n CountProps,\n defaultThemeProp,\n Flex,\n Icon,\n Menu,\n Count,\n MenuProps,\n Popover,\n useDirection,\n useElement,\n registerIcon,\n useOuterEvent,\n StatusProps,\n useI18n,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport * as nodesDownSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/nodes-down-solid.icon';\nimport * as warnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';\n\nregisterIcon(nodesDownSolidIcon, warnSolidIcon, caretDownIcon);\n\nexport interface BranchButtonProps {\n /** The text for the BranchButton also used to set the aria-label. */\n text: string;\n /** Determines the variant for the BranchButton. */\n variant?: Extract<StatusProps['variant'], 'success' | 'urgent'>;\n /** Only display the branch and caret icon */\n compact?: boolean;\n /** The total count representing the number of unmerged changes. */\n count?: CountProps['children'];\n /** An array of MenuItemProps. */\n items: MenuProps['items'];\n}\n\nexport const StyledBranchButton: typeof Button = styled(Button)(\n ({\n theme,\n branchVariant\n }: {\n theme: DefaultTheme;\n branchVariant: BranchButtonProps['variant'];\n }) => {\n const {\n base: {\n colors,\n palette: { 'primary-background': primaryBackground },\n shadow: { focus },\n spacing\n },\n components: {\n badges: {\n status,\n count: {\n base: { background, foreground }\n }\n }\n }\n } = theme;\n\n const backgroundColor = branchVariant ? status[branchVariant].background : primaryBackground;\n const borderColor = !branchVariant ? colors.gray.medium : 'transparent';\n const countBgColor = branchVariant === 'success' ? colors.green.medium : background;\n const countColor = branchVariant === 'success' ? colors.white : foreground;\n const buttonColor = tryCatch(() => readableColor(backgroundColor));\n\n return css`\n flex-shrink: 0;\n background-color: ${backgroundColor};\n border-color: ${borderColor};\n color: ${buttonColor};\n padding-inline-start: ${spacing};\n padding-inline-end: ${spacing};\n\n &:hover {\n background-color: ${backgroundColor};\n box-shadow: ${focus};\n }\n\n svg {\n height: 1rem;\n width: 1rem;\n }\n\n ${StyledCount} {\n background-color: ${countBgColor};\n color: ${countColor};\n }\n `;\n }\n);\n\nStyledBranchButton.defaultProps = defaultThemeProp;\n\nconst StyledBranchButtonPopover = styled(Popover)(\n ({\n theme: {\n base: { spacing, 'content-width': contentWidth }\n }\n }) => {\n const minWidth = `calc(${contentWidth.xs} + (2 * ${spacing}))`;\n\n return css`\n min-width: ${minWidth};\n max-width: calc(${minWidth} + 5ch);\n `;\n }\n);\n\nStyledBranchButtonPopover.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon: typeof Icon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.colors.red.medium};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst StyledEllipsizedText = styled.span(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].xs};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.5;\n `;\n});\n\nStyledEllipsizedText.defaultProps = defaultThemeProp;\n\nconst BranchButton: FunctionComponent<BranchButtonProps> = (props: BranchButtonProps) => {\n const { text, variant, count, compact = false, items = [] } = props;\n\n const [open, setOpen] = useState(false);\n\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const { rtl } = useDirection();\n const t = useI18n();\n\n useOuterEvent('mousedown', [popoverEl, buttonEl], () => {\n if (open) setOpen(false);\n });\n\n let ariaLabel = t('branch_with_no_changes', [text]);\n if (variant === 'success') {\n ariaLabel = t('branch_with_no_potential_conflicts', [text, count ?? 0]);\n } else if (variant === 'urgent') {\n ariaLabel = t('branch_with_potential_conflicts', [text]);\n }\n\n return (\n <>\n <StyledBranchButton\n ref={setButtonEl}\n aria-expanded={open}\n aria-haspopup='menu'\n aria-controls='branch-popover'\n aria-label={ariaLabel}\n branchVariant={variant}\n label={!open && compact ? text : undefined}\n onClick={() => setOpen(cur => !cur)}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Escape') setOpen(false);\n }}\n >\n <Flex container={{ alignItems: 'center', gap: compact ? 1 : 0.5 }}>\n <Icon name='nodes-down-solid' />\n {!compact && (\n <>\n <StyledEllipsizedText>{text}</StyledEllipsizedText>\n {variant === 'urgent' ? (\n <StyledWarnIcon name='warn-solid' />\n ) : (\n count !== undefined && <Count>{count}</Count>\n )}\n </>\n )}\n <Icon name='caret-down' />\n </Flex>\n </StyledBranchButton>\n <StyledBranchButtonPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n id='branch-popover'\n hideOnTargetHidden\n show={open}\n target={buttonEl}\n ref={setPopoverRef}\n >\n <Menu\n items={items}\n scrollAt={20}\n onItemClick={() => setOpen(false)}\n focusControlEl={buttonEl || undefined}\n focusElOnClose={false}\n />\n </StyledBranchButtonPopover>\n </>\n );\n};\n\nexport default BranchButton;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default } from './AppShell';\nexport { AppShellProps } from './AppShell.types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default } from './AppShell';\nexport { AppShellProps } from './AppShell.types';\nexport { AppHeaderProps } from './Header/AppHeader.types';\nexport { BranchButtonProps } from './Header/BranchButton';\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { default as AppHeader } from './components/AppHeader';
|
|
2
|
-
export * from './components/AppHeader';
|
|
3
1
|
export { default as AppShell } from './components/AppShell';
|
|
4
2
|
export * from './components/AppShell';
|
|
5
3
|
export { default as DynamicContentEditor } from './components/DynamicContentEditor';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// This file is autogenerated. Any changes will be overwritten.
|
|
2
|
-
export { default as AppHeader } from './components/AppHeader';
|
|
3
|
-
export * from './components/AppHeader';
|
|
4
2
|
export { default as AppShell } from './components/AppShell';
|
|
5
3
|
export * from './components/AppShell';
|
|
6
4
|
export { default as DynamicContentEditor } from './components/DynamicContentEditor';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,cAAc,mCAAmC,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,SAAS,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\nexport { default as AppShell } from './components/AppShell';\nexport * from './components/AppShell';\nexport { default as DynamicContentEditor } from './components/DynamicContentEditor';\nexport * from './components/DynamicContentEditor';\nexport { default as ExpressionBuilder } from './components/ExpressionBuilder';\nexport * from './components/ExpressionBuilder';\nexport { default as FlowModeller } from './components/FlowModeller';\nexport * from './components/FlowModeller';\nexport * from './components/ItemLibrary';\nexport { default as LifeCycle } from './components/LifeCycle';\nexport * from './components/LifeCycle';\nexport * from './components/MobileBuildSummary';\nexport * from './components/ObjectPreview';\nexport { default as ObjectSelect } from './components/ObjectSelect';\nexport * from './components/ObjectSelect';\nexport * from './components/PageTemplates';\nexport * from './components/SummaryCard';\nexport { default as Workbench } from './components/Workbench';\nexport * from './utils';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-build",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.4.0",
|
|
4
4
|
"author": "Pegasystems",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "4.0.0-dev.
|
|
24
|
-
"@pega/cosmos-react-dnd": "4.0.0-dev.
|
|
23
|
+
"@pega/cosmos-react-core": "4.0.0-dev.4.0",
|
|
24
|
+
"@pega/cosmos-react-dnd": "4.0.0-dev.4.0",
|
|
25
25
|
"@types/codemirror": "^5.60.5",
|
|
26
26
|
"@types/dagre": "^0.7.46",
|
|
27
27
|
"@types/react": "^16.14.24 || ^17.0.38",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAGL,YAAY,EAQb,MAAM,yBAAyB,CAAC;AAcjC,OAAO,EAAE,cAAc,EAAc,MAAM,mBAAmB,CAAC;AA2E/D,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAkD/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import { Flex, SearchInput, useBreakpoint, Button, Icon, useI18n, MenuButton, Image } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';
|
|
5
|
-
import { StyledAppHeader, StyledTabs, StyledAppAvatar, StyledUtilsContainer, StyledBrandContainer, StyledBrandButton, StyledAppHeaderSearch, StyledAppInfo } from './AppHeader.styles';
|
|
6
|
-
import BranchButton from './BranchButton';
|
|
7
|
-
const Links = ({ links = [] }) => {
|
|
8
|
-
const [currentTabId, setCurrentTabId] = useState(links[0].id || '');
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
setCurrentTabId(links[0].id || '');
|
|
11
|
-
}, [links]);
|
|
12
|
-
const handleTabClick = useCallback((id, e) => {
|
|
13
|
-
const newActiveTab = links.find(item => item.id === id);
|
|
14
|
-
if (newActiveTab) {
|
|
15
|
-
newActiveTab.onClick?.(id, e);
|
|
16
|
-
setCurrentTabId(newActiveTab.id);
|
|
17
|
-
}
|
|
18
|
-
}, [links]);
|
|
19
|
-
return _jsx(StyledTabs, { tabs: links, currentTabId: currentTabId, onTabClick: handleTabClick });
|
|
20
|
-
};
|
|
21
|
-
const AppHeaderSearch = props => {
|
|
22
|
-
const isMediumOrAbove = useBreakpoint('md');
|
|
23
|
-
const t = useI18n();
|
|
24
|
-
return (_jsx(Flex, { as: StyledAppHeaderSearch, item: { basis: '40%', shrink: 1 }, children: _jsx(StyledAppHeaderSearchForm, { role: 'search', "aria-label": t('sitewide'), onSubmit: e => e.preventDefault(), isMediumOrAbove: isMediumOrAbove, children: _jsx(SearchInput, { ...props }) }) }));
|
|
25
|
-
};
|
|
26
|
-
const Utils = ({ avatar, branch, action, appInfo }) => {
|
|
27
|
-
const isMediumOrAbove = useBreakpoint('md');
|
|
28
|
-
return (_jsxs(Flex, { isMediumOrAbove: isMediumOrAbove, container: { justify: 'end', alignItems: 'center' }, item: { shrink: 0 }, as: StyledUtilsContainer, children: [appInfo && (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 0.5 }, children: [_jsx(StyledAppInfo, { children: appInfo.name }), _jsx(StyledAppInfo, { children: appInfo.version })] })), branch && _jsx(BranchButton, { ...branch }), action && (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 0.3 }, item: { shrink: 0 }, as: Button, variant: 'secondary', onClick: (e) => action.onClick?.(action.id, e), disabled: action.disabled, children: [action.icon && _jsx(Icon, { name: action.icon }), action.text] })), _jsx(StyledAppAvatar, { ...avatar })] }));
|
|
29
|
-
};
|
|
30
|
-
const AppHeader = forwardRef(({ contexts, onContextClick, brand, utils, links }, ref) => {
|
|
31
|
-
const t = useI18n();
|
|
32
|
-
const selectedContext = contexts.length > 1 ? contexts.find(ctx => ctx.selected) : contexts[0];
|
|
33
|
-
return (_jsxs(Flex, { as: StyledAppHeader, container: { justify: 'between', alignItems: 'center', gap: 2 }, ref: ref, children: [_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 2 }, item: { shrink: 0 }, children: [contexts.length > 1 && (_jsx(MenuButton, { text: t('switch_to'), variant: 'simple', icon: 'dot-9-solid', iconOnly: true, menu: {
|
|
34
|
-
mode: 'single-select',
|
|
35
|
-
items: contexts,
|
|
36
|
-
onItemClick: onContextClick
|
|
37
|
-
} })), _jsxs(StyledBrandContainer, { container: { alignItems: 'center', justify: 'between', gap: 2 }, onClick: brand.onClick, href: brand.href, forwardedAs: brand.onClick || brand.href ? StyledBrandButton : 'div', "aria-label": `${brand.label} - ${selectedContext.primary}`, children: [_jsx(Image, { src: brand.logo, alt: brand.label }), _jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 1 }, children: [selectedContext.visual, selectedContext.primary] })] }), links && links.length > 0 && _jsx(Links, { links: links })] }), utils?.search && _jsx(AppHeaderSearch, { ...utils.search }), utils && _jsx(Utils, { ...utils })] }));
|
|
38
|
-
});
|
|
39
|
-
export default AppHeader;
|
|
40
|
-
//# sourceMappingURL=AppHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAKV,WAAW,EACX,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,IAAI,EACJ,WAAW,EAGX,aAAa,EACb,MAAM,EACN,IAAI,EACJ,OAAO,EACP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AAC,QAAQ,EAChB,IAAI,EAAC,aAAa,EAClB,QAAQ,QACR,IAAI,EAAE;4BACJ,IAAI,EAAE,eAAe;4BACrB,KAAK,EAAE,QAAQ;4BACf,WAAW,EAAE,cAAc;yBAC5B,GACD,CACH,EACD,MAAC,oBAAoB,IACnB,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,EAC/D,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,gBACxD,GAAG,KAAK,CAAC,KAAK,MAAM,eAAe,CAAC,OAAO,EAAE,aAEzD,KAAC,KAAK,IAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,GAAI,EAE5C,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAClE,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,OAAO,IACnB,IACc,EACtB,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,GAAI,IAChD,EACN,KAAK,EAAE,MAAM,IAAI,KAAC,eAAe,OAAK,KAAK,CAAC,MAAM,GAAI,EACtD,KAAK,IAAI,KAAC,KAAK,OAAK,KAAK,GAAI,IACzB,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n MouseEvent,\n FC,\n PropsWithoutRef,\n useCallback,\n useEffect,\n useState\n} from 'react';\n\nimport {\n Flex,\n SearchInput,\n ForwardProps,\n SearchInputProps,\n useBreakpoint,\n Button,\n Icon,\n useI18n,\n MenuButton,\n Image\n} from '@pega/cosmos-react-core';\nimport { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\n\nimport {\n StyledAppHeader,\n StyledTabs,\n StyledAppAvatar,\n StyledUtilsContainer,\n StyledBrandContainer,\n StyledBrandButton,\n StyledAppHeaderSearch,\n StyledAppInfo\n} from './AppHeader.styles';\nimport BranchButton from './BranchButton';\nimport { AppHeaderProps, UtilsProps } from './AppHeader.types';\n\nconst Links: FC<{ links: AppHeaderProps['links'] }> = ({ links = [] }) => {\n const [currentTabId, setCurrentTabId] = useState(links[0].id || '');\n\n useEffect(() => {\n setCurrentTabId(links[0].id || '');\n }, [links]);\n\n const handleTabClick = useCallback(\n (id: string, e?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const newActiveTab = links.find(item => item.id === id);\n if (newActiveTab) {\n newActiveTab.onClick?.(id, e);\n setCurrentTabId(newActiveTab.id);\n }\n },\n [links]\n );\n\n return <StyledTabs tabs={links} currentTabId={currentTabId} onTabClick={handleTabClick} />;\n};\n\nconst AppHeaderSearch: FC<SearchInputProps> = props => {\n const isMediumOrAbove = useBreakpoint('md');\n const t = useI18n();\n\n return (\n <Flex as={StyledAppHeaderSearch} item={{ basis: '40%', shrink: 1 }}>\n <StyledAppHeaderSearchForm\n role='search'\n aria-label={t('sitewide')}\n onSubmit={e => e.preventDefault()}\n isMediumOrAbove={isMediumOrAbove}\n >\n <SearchInput {...props} />\n </StyledAppHeaderSearchForm>\n </Flex>\n );\n};\n\nconst Utils: FC<UtilsProps> = ({ avatar, branch, action, appInfo }) => {\n const isMediumOrAbove = useBreakpoint('md');\n return (\n <Flex\n isMediumOrAbove={isMediumOrAbove}\n container={{ justify: 'end', alignItems: 'center' }}\n item={{ shrink: 0 }}\n as={StyledUtilsContainer}\n >\n {appInfo && (\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 0.5 }}>\n <StyledAppInfo>{appInfo.name}</StyledAppInfo>\n <StyledAppInfo>{appInfo.version}</StyledAppInfo>\n </Flex>\n )}\n {branch && <BranchButton {...branch} />}\n {action && (\n <Flex\n container={{ justify: 'between', alignItems: 'center', gap: 0.3 }}\n item={{ shrink: 0 }}\n as={Button}\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick?.(action.id, e)}\n disabled={action.disabled}\n >\n {action.icon && <Icon name={action.icon} />}\n {action.text}\n </Flex>\n )}\n <StyledAppAvatar {...avatar} />\n </Flex>\n );\n};\n\nconst AppHeader: FunctionComponent<AppHeaderProps & ForwardProps> = forwardRef(\n (\n { contexts, onContextClick, brand, utils, links }: PropsWithoutRef<AppHeaderProps>,\n ref: AppHeaderProps['ref']\n ) => {\n const t = useI18n();\n\n const selectedContext = contexts.length > 1 ? contexts.find(ctx => ctx.selected)! : contexts[0];\n\n return (\n <Flex\n as={StyledAppHeader}\n container={{ justify: 'between', alignItems: 'center', gap: 2 }}\n ref={ref}\n >\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 2 }} item={{ shrink: 0 }}>\n {contexts.length > 1 && (\n <MenuButton\n text={t('switch_to')}\n variant='simple'\n icon='dot-9-solid'\n iconOnly\n menu={{\n mode: 'single-select',\n items: contexts,\n onItemClick: onContextClick\n }}\n />\n )}\n <StyledBrandContainer\n container={{ alignItems: 'center', justify: 'between', gap: 2 }}\n onClick={brand.onClick}\n href={brand.href}\n forwardedAs={brand.onClick || brand.href ? StyledBrandButton : 'div'}\n aria-label={`${brand.label} - ${selectedContext.primary}`}\n >\n <Image src={brand.logo} alt={brand.label} />\n\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 1 }}>\n {selectedContext.visual}\n {selectedContext.primary}\n </Flex>\n </StyledBrandContainer>\n {links && links.length > 0 && <Links links={links} />}\n </Flex>\n {utils?.search && <AppHeaderSearch {...utils.search} />}\n {utils && <Utils {...utils} />}\n </Flex>\n );\n }\n);\n\nexport default AppHeader;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.styles.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAoB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIrF,eAAO,MAAM,eAAe,4GAU1B,CAAC;AAIH,eAAO,MAAM,WAAW,EAAE,OAAO,IAU/B,CAAC;AAIH,eAAO,MAAM,oBAAoB,EAAE,OAAO,IAUxC,CAAC;AAIH,eAAO,MAAM,iBAAiB,0QAM5B,CAAC;AAIH,eAAO,MAAM,UAAU,EAAE,OAAO,IAqB9B,CAAC;AAIH,eAAO,MAAM,oBAAoB,yGAY/B,CAAC;AAIH,eAAO,MAAM,qBAAqB,yGAIjC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,OAAO,IAKjC,CAAC;AAIH,eAAO,MAAM,qBAAqB,EAAE,OAAO,IAYzC,CAAC;AAIH,eAAO,MAAM,eAAe,EAAE,OAAO,MAGpC,CAAC"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
import { Avatar, defaultThemeProp, Flex, Text, Tabs } from '@pega/cosmos-react-core';
|
|
3
|
-
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
4
|
-
import { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';
|
|
5
|
-
export const StyledAppHeader = styled.header(({ theme }) => {
|
|
6
|
-
return css `
|
|
7
|
-
height: 3rem;
|
|
8
|
-
padding: 0 calc(2 * ${theme.base.spacing});
|
|
9
|
-
border-bottom: 0.0625rem solid ${theme.base.colors.gray.light};
|
|
10
|
-
background-color: ${theme.base.palette['primary-background']};
|
|
11
|
-
position: sticky;
|
|
12
|
-
top: 0;
|
|
13
|
-
z-index: calc(${theme.base['z-index'].drawer + 1});
|
|
14
|
-
`;
|
|
15
|
-
});
|
|
16
|
-
StyledAppHeader.defaultProps = defaultThemeProp;
|
|
17
|
-
export const StyledTitle = styled(Text)(({ theme }) => {
|
|
18
|
-
return css `
|
|
19
|
-
max-width: ${theme.base['content-width'].sm};
|
|
20
|
-
text-overflow: ellipsis;
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
white-space: nowrap;
|
|
23
|
-
color: ${theme.base.palette['foreground-color']};
|
|
24
|
-
font-weight: ${theme.base['font-weight'].bold};
|
|
25
|
-
margin-inline-start: calc(0.75 * ${theme.base.spacing});
|
|
26
|
-
`;
|
|
27
|
-
});
|
|
28
|
-
StyledTitle.defaultProps = defaultThemeProp;
|
|
29
|
-
export const StyledBrandContainer = styled(Flex)(({ theme }) => {
|
|
30
|
-
return css `
|
|
31
|
-
padding-block: ${theme.base.spacing};
|
|
32
|
-
text-decoration: none;
|
|
33
|
-
max-height: 2.5rem;
|
|
34
|
-
|
|
35
|
-
> img {
|
|
36
|
-
min-width: ${theme.base['content-width'].xs};
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
});
|
|
40
|
-
StyledBrandContainer.defaultProps = defaultThemeProp;
|
|
41
|
-
export const StyledBrandButton = styled(BareButton)(({ theme }) => {
|
|
42
|
-
return css `
|
|
43
|
-
&:not([disabled]):focus {
|
|
44
|
-
box-shadow: ${theme.base.shadow.focus};
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
47
|
-
});
|
|
48
|
-
StyledBrandButton.defaultProps = defaultThemeProp;
|
|
49
|
-
export const StyledTabs = styled(Tabs)(({ theme }) => {
|
|
50
|
-
return css `
|
|
51
|
-
margin-inline-start: calc(2 * ${theme.base.spacing});
|
|
52
|
-
margin-inline-end: calc(2 * ${theme.base.spacing});
|
|
53
|
-
border: none;
|
|
54
|
-
min-height: 3rem;
|
|
55
|
-
[role='tab'] {
|
|
56
|
-
height: auto;
|
|
57
|
-
span:first-of-type {
|
|
58
|
-
text-transform: none;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
[role='tab'][aria-selected='false'] > span {
|
|
62
|
-
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
63
|
-
}
|
|
64
|
-
[role='tab']:hover,
|
|
65
|
-
[role='tab']:focus,
|
|
66
|
-
[role='tab']:active {
|
|
67
|
-
box-shadow: none;
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
});
|
|
71
|
-
StyledTabs.defaultProps = defaultThemeProp;
|
|
72
|
-
export const StyledUtilsContainer = styled.div(({ theme }) => {
|
|
73
|
-
return css `
|
|
74
|
-
padding-block: ${theme.base.spacing};
|
|
75
|
-
& > div,
|
|
76
|
-
& > span,
|
|
77
|
-
& > button {
|
|
78
|
-
margin-inline-start: ${theme.base.spacing};
|
|
79
|
-
}
|
|
80
|
-
& > div:last-child {
|
|
81
|
-
margin-inline: calc(2 * ${theme.base.spacing}) 0;
|
|
82
|
-
}
|
|
83
|
-
`;
|
|
84
|
-
});
|
|
85
|
-
StyledUtilsContainer.defaultProps = defaultThemeProp;
|
|
86
|
-
export const StyledAppHeaderSearch = styled.div `
|
|
87
|
-
${StyledAppHeaderSearchForm} {
|
|
88
|
-
max-width: 100%;
|
|
89
|
-
}
|
|
90
|
-
`;
|
|
91
|
-
StyledAppHeaderSearch.defaultProps = defaultThemeProp;
|
|
92
|
-
export const StyledAppInfo = styled(StyledTitle)(({ theme }) => {
|
|
93
|
-
return css `
|
|
94
|
-
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
95
|
-
margin-inline-start: 0;
|
|
96
|
-
`;
|
|
97
|
-
});
|
|
98
|
-
StyledAppInfo.defaultProps = defaultThemeProp;
|
|
99
|
-
export const StyledBranchContainer = styled(Flex)(({ theme }) => {
|
|
100
|
-
return css `
|
|
101
|
-
span {
|
|
102
|
-
white-space: nowrap;
|
|
103
|
-
max-width: 25ch;
|
|
104
|
-
overflow: hidden;
|
|
105
|
-
text-overflow: ellipsis;
|
|
106
|
-
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
107
|
-
margin-inline-start: calc(0.5 * ${theme.base.spacing});
|
|
108
|
-
margin-inline-end: calc(0.75 * ${theme.base.spacing});
|
|
109
|
-
}
|
|
110
|
-
`;
|
|
111
|
-
});
|
|
112
|
-
StyledBranchContainer.defaultProps = defaultThemeProp;
|
|
113
|
-
export const StyledAppAvatar = styled(Avatar) `
|
|
114
|
-
width: 1.5rem;
|
|
115
|
-
height: 1.5rem;
|
|
116
|
-
`;
|
|
117
|
-
StyledAppAvatar.defaultProps = defaultThemeProp;
|
|
118
|
-
//# sourceMappingURL=AppHeader.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAE7G,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzD,OAAO,GAAG,CAAA;;0BAEc,KAAK,CAAC,IAAI,CAAC,OAAO;qCACP,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;wBACzC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;;oBAG5C,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;GACjD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,WAAW,GAAgB,MAAM,CAAC,IAAI,CAA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CAAA;;;CAG3D,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Avatar, defaultThemeProp, Flex, Text, Tabs } from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\n\nexport const StyledAppHeader = styled.header(({ theme }) => {\n return css`\n height: 3rem;\n padding: 0 calc(2 * ${theme.base.spacing});\n border-bottom: 0.0625rem solid ${theme.base.colors.gray.light};\n background-color: ${theme.base.palette['primary-background']};\n position: sticky;\n top: 0;\n z-index: calc(${theme.base['z-index'].drawer + 1});\n `;\n});\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTitle: typeof Text = styled(Text)(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].sm};\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${theme.base.palette['foreground-color']};\n font-weight: ${theme.base['font-weight'].bold};\n margin-inline-start: calc(0.75 * ${theme.base.spacing});\n `;\n});\n\nStyledTitle.defaultProps = defaultThemeProp;\n\nexport const StyledBrandContainer: typeof Flex = styled(Flex)(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n text-decoration: none;\n max-height: 2.5rem;\n\n > img {\n min-width: ${theme.base['content-width'].xs};\n }\n `;\n});\n\nStyledBrandContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBrandButton = styled(BareButton)(({ theme }) => {\n return css`\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledBrandButton.defaultProps = defaultThemeProp;\n\nexport const StyledTabs: typeof Tabs = styled(Tabs)(({ theme }) => {\n return css`\n margin-inline-start: calc(2 * ${theme.base.spacing});\n margin-inline-end: calc(2 * ${theme.base.spacing});\n border: none;\n min-height: 3rem;\n [role='tab'] {\n height: auto;\n span:first-of-type {\n text-transform: none;\n }\n }\n [role='tab'][aria-selected='false'] > span {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n [role='tab']:hover,\n [role='tab']:focus,\n [role='tab']:active {\n box-shadow: none;\n }\n `;\n});\n\nStyledTabs.defaultProps = defaultThemeProp;\n\nexport const StyledUtilsContainer = styled.div(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n & > div,\n & > span,\n & > button {\n margin-inline-start: ${theme.base.spacing};\n }\n & > div:last-child {\n margin-inline: calc(2 * ${theme.base.spacing}) 0;\n }\n `;\n});\n\nStyledUtilsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSearch = styled.div`\n ${StyledAppHeaderSearchForm} {\n max-width: 100%;\n }\n`;\n\nStyledAppHeaderSearch.defaultProps = defaultThemeProp;\n\nexport const StyledAppInfo: typeof Text = styled(StyledTitle)(({ theme }) => {\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin-inline-start: 0;\n `;\n});\n\nStyledAppInfo.defaultProps = defaultThemeProp;\n\nexport const StyledBranchContainer: typeof Flex = styled(Flex)(({ theme }) => {\n return css`\n span {\n white-space: nowrap;\n max-width: 25ch;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: calc(0.75 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledBranchContainer.defaultProps = defaultThemeProp;\n\nexport const StyledAppAvatar: typeof Avatar = styled(Avatar)`\n width: 1.5rem;\n height: 1.5rem;\n`;\n\nStyledAppAvatar.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.types.d.ts","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,MAAM,EAC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R,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.types.js","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref, MouseEvent } from 'react';\n\nimport {\n Action,\n MenuItemProps,\n BaseProps,\n NoChildrenProp,\n MenuProps,\n Tab,\n AvatarProps,\n SearchInputProps\n} from '@pega/cosmos-react-core';\n\nimport { BranchButtonProps } from './BranchButton';\n\nexport interface ContextItem\n extends Pick<MenuItemProps, 'id' | 'primary' | 'visual' | 'href' | 'selected'> {}\n\nexport interface AppHeaderProps extends BaseProps, NoChildrenProp {\n contexts: ContextItem[];\n onContextClick?: MenuProps['onItemClick'];\n brand: {\n label: string;\n logo: string;\n href?: string;\n onClick?: (e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n };\n links?: LinkProps[];\n utils?: UtilsProps;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface LinkProps extends Tab {\n onClick?: (id: string, e?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n}\n\nexport interface UtilsProps {\n avatar: AvatarProps;\n search?: SearchInputProps;\n branch?: BranchButtonProps;\n action?: Pick<Action, 'id' | 'text' | 'onClick' | 'disabled' | 'icon'>;\n appInfo?: {\n name: string;\n version: string;\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BranchButton.d.ts","sourceRoot":"","sources":["../../../src/components/AppHeader/BranchButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAInE,OAAO,EACL,MAAM,EACN,UAAU,EAGV,IAAI,EAGJ,SAAS,EAMT,WAAW,EAGZ,MAAM,yBAAyB,CAAC;AAQjC,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;IAChE,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,KAAK,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,iCAAiC;IACjC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAuDvC,CAAC;AAqBF,eAAO,MAAM,cAAc,EAAE,OAAO,IAIlC,CAAC;AAgBH,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAqEtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|