@pega/cosmos-react-wss 9.0.0-build.9.8 → 9.0.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 (54) hide show
  1. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppShell.js +13 -5
  3. package/lib/components/AppShell/AppShell.js.map +1 -1
  4. package/lib/components/AppShell/AppShell.styles.d.ts +49 -29
  5. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  6. package/lib/components/AppShell/AppShell.styles.js +150 -36
  7. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.types.d.ts +11 -2
  9. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  10. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  11. package/lib/components/AppShell/MobileHeaderContent.d.ts.map +1 -1
  12. package/lib/components/AppShell/MobileHeaderContent.js +2 -2
  13. package/lib/components/AppShell/MobileHeaderContent.js.map +1 -1
  14. package/lib/components/AppShell/NavLinks.d.ts +1 -0
  15. package/lib/components/AppShell/NavLinks.d.ts.map +1 -1
  16. package/lib/components/AppShell/NavLinks.js +2 -2
  17. package/lib/components/AppShell/NavLinks.js.map +1 -1
  18. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  19. package/lib/components/CaseView/CaseView.js +7 -5
  20. package/lib/components/CaseView/CaseView.js.map +1 -1
  21. package/lib/components/CaseView/CaseView.styles.d.ts +6 -6
  22. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  23. package/lib/components/CaseView/CaseView.types.d.ts +10 -0
  24. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  25. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  26. package/lib/components/Footer/Footer.d.ts +4 -0
  27. package/lib/components/Footer/Footer.d.ts.map +1 -0
  28. package/lib/components/Footer/Footer.js +10 -0
  29. package/lib/components/Footer/Footer.js.map +1 -0
  30. package/lib/components/Footer/Footer.styles.d.ts +9 -0
  31. package/lib/components/Footer/Footer.styles.d.ts.map +1 -0
  32. package/lib/components/Footer/Footer.styles.js +38 -0
  33. package/lib/components/Footer/Footer.styles.js.map +1 -0
  34. package/lib/components/Footer/Footer.types.d.ts +13 -0
  35. package/lib/components/Footer/Footer.types.d.ts.map +1 -0
  36. package/lib/components/Footer/Footer.types.js +2 -0
  37. package/lib/components/Footer/Footer.types.js.map +1 -0
  38. package/lib/components/Footer/index.d.ts +3 -0
  39. package/lib/components/Footer/index.d.ts.map +1 -0
  40. package/lib/components/Footer/index.js +3 -0
  41. package/lib/components/Footer/index.js.map +1 -0
  42. package/lib/components/PageTemplates/BannerPage.d.ts +25 -4
  43. package/lib/components/PageTemplates/BannerPage.d.ts.map +1 -1
  44. package/lib/components/PageTemplates/BannerPage.js +45 -17
  45. package/lib/components/PageTemplates/BannerPage.js.map +1 -1
  46. package/lib/components/QuickCreate/QuickCreate.d.ts +192 -2
  47. package/lib/components/QuickCreate/QuickCreate.d.ts.map +1 -1
  48. package/lib/components/QuickCreate/QuickCreate.js +69 -16
  49. package/lib/components/QuickCreate/QuickCreate.js.map +1 -1
  50. package/lib/index.d.ts +2 -0
  51. package/lib/index.d.ts.map +1 -1
  52. package/lib/index.js +2 -0
  53. package/lib/index.js.map +1 -1
  54. package/package.json +5 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Footer.styles.js","sourceRoot":"","sources":["../../../src/components/Footer/Footer.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEpF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,OAAO,GAAG,CAAA;;;;eAIG,KAAK,CAAC,IAAI,CAAC,SA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AgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Link, calculateFontSize, defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledFooter = styled.footer(({ theme }) => {\n return css`\n position: sticky;\n inset-block-end: 0;\n min-height: 2.25rem;\n z-index: ${theme.base['z-index'].popover};\n border-top: 0.0625rem solid ${theme.base.palette['border-line']};\n background-color: ${theme.base.palette['primary-background']};\n `;\n});\n\nStyledFooter.defaultProps = defaultThemeProp;\n\nexport const StyledFooterLink = styled(Link)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.s};\n color: ${theme.base.palette['foreground-color']};\n `;\n});\n\nStyledFooterLink.defaultProps = defaultThemeProp;\n\nexport const StyledFooterText = styled.span(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.s};\n color: ${theme.base.palette['foreground-color']};\n opacity: ${theme.base.transparency['transparent-3']};\n `;\n});\n\nStyledFooterText.defaultProps = defaultThemeProp;\n\nexport const StyledFooterImage = styled.img`\n display: inline-block;\n height: 2.25rem;\n width: auto;\n vertical-align: middle;\n`;\n\nStyledFooterImage.defaultProps = defaultThemeProp;\n"]}
@@ -0,0 +1,13 @@
1
+ export interface FooterLink {
2
+ /** Display text for the footer link. */
3
+ text: string;
4
+ /** URL the link navigates to. */
5
+ url?: string;
6
+ /** Optional image URL displayed before the text. */
7
+ imageLink?: string;
8
+ }
9
+ export interface FooterProps {
10
+ /** Footer links rendered at the bottom of the page. */
11
+ links: FooterLink[];
12
+ }
13
+ //# sourceMappingURL=Footer.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Footer.types.d.ts","sourceRoot":"","sources":["../../../src/components/Footer/Footer.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Footer.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Footer.types.js","sourceRoot":"","sources":["../../../src/components/Footer/Footer.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface FooterLink {\n /** Display text for the footer link. */\n text: string;\n /** URL the link navigates to. */\n url?: string;\n /** Optional image URL displayed before the text. */\n imageLink?: string;\n}\n\nexport interface FooterProps {\n /** Footer links rendered at the bottom of the page. */\n links: FooterLink[];\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './Footer';
2
+ export * from './Footer.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Footer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from './Footer';
2
+ export * from './Footer.types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Footer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,gBAAgB,CAAC","sourcesContent":["export { default } from './Footer';\nexport * from './Footer.types';\n"]}
@@ -18,6 +18,21 @@ export interface BannerOptions {
18
18
  * @default true
19
19
  */
20
20
  tintImage?: boolean;
21
+ /** Controls how the banner fills vertical space.
22
+ * - 'fixed': preset height based on the spacing token
23
+ * - 'content': shrinks to fit content
24
+ * - 'full': fills the visible viewport below the app shell
25
+ * @default 'fixed'
26
+ */
27
+ height?: 'content' | 'fixed' | 'full';
28
+ /** Horizontal alignment of the banner text content.
29
+ * @default 'center'
30
+ */
31
+ align?: 'left' | 'center' | 'right';
32
+ /** Vertical alignment of the banner text content.
33
+ * @default 'center'
34
+ */
35
+ verticalAlign?: 'top' | 'center' | 'bottom';
21
36
  }
22
37
  export interface BannerPageProps extends BaseProps {
23
38
  banner: BannerOptions;
@@ -31,9 +46,15 @@ export interface BannerPageProps extends BaseProps {
31
46
  /** Utilities as the last column */
32
47
  utilities?: ReactNode;
33
48
  }
34
- export declare const StyledBannerPage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
35
- export declare const StyledBannerContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<BannerOptions, "backgroundColor" | "backgroundImage">, never>;
36
- export declare const StyledBanner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<BannerOptions, "backgroundColor" | "backgroundImage" | "variant" | "tintImage">, never>;
37
- export declare const StyledContentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
49
+ export declare const StyledBannerPage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
50
+ export declare const StyledBannerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<BannerOptions, "backgroundColor" | "backgroundImage" | "height">>> & string;
51
+ export declare const StyledBanner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<BannerOptions, "backgroundColor" | "backgroundImage" | "align" | "variant" | "tintImage">>> & string;
52
+ export declare const StyledContentContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
53
+ export declare const StyledBannerHeading: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").TextProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement | HTMLSpanElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
54
+ ref?: ((instance: HTMLHeadingElement | HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLHeadingElement | HTMLSpanElement> | null | undefined;
55
+ }, never>> & string & Omit<ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, keyof import("react").Component<any, {}, any>>;
56
+ export declare const StyledBannerMessage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").TextProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement | HTMLSpanElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
57
+ ref?: ((instance: HTMLHeadingElement | HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLHeadingElement | HTMLSpanElement> | null | undefined;
58
+ }, never>> & string & Omit<ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, keyof import("react").Component<any, {}, any>>;
38
59
  export declare const BannerPage: ForwardRefForwardPropsComponent<BannerPageProps>;
39
60
  //# sourceMappingURL=BannerPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BannerPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/BannerPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAgB7D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1F,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,MAAM,EAAE,aAAa,CAAC;IACtB,mCAAmC;IACnC,CAAC,EAAE,SAAS,EAAE,CAAC;IACf,oFAAoF;IACpF,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,sGAAsG;IACtG,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,GAAG,aAAa,CAAC;IACvD,mCAAmC;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,yGAK3B,CAAC;AAIH,eAAO,MAAM,qBAAqB,iKAoBhC,CAAC;AAIH,eAAO,MAAM,YAAY,2LA+BxB,CAAC;AAIF,eAAO,MAAM,sBAAsB,yGAyBlC,CAAC;AAsBF,eAAO,MAAM,UAAU,EAAE,+BAA+B,CAAC,eAAe,CA4HvE,CAAC"}
1
+ {"version":3,"file":"BannerPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/BannerPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,SAAS,EAAE,GAAG,E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F,eAAO,MAAM,mBAAmB;;uJAQ/B,CAAC;AAkCF,eAAO,MAAM,UAAU,EAAE,+BAA+B,CAAC,eAAe,CAmIvE,CAAC"}
@@ -10,10 +10,19 @@ export const StyledBannerPage = styled.div(({ theme }) => {
10
10
  `;
11
11
  });
12
12
  StyledBannerPage.defaultProps = defaultThemeProp;
13
- export const StyledBannerContainer = styled.div(({ backgroundImage, backgroundColor, theme }) => {
13
+ export const StyledBannerContainer = styled.div(({ backgroundImage, backgroundColor, height = 'fixed', theme }) => {
14
+ const heightValue = {
15
+ content: 'auto',
16
+ fixed: `calc(${theme.base.spacing} * 38)`,
17
+ full: 'calc(100dvh - var(--appshell-offset, 0rem))'
18
+ }[height];
14
19
  return css `
15
20
  width: 100%;
16
- height: calc(${theme.base.spacing} * 38);
21
+ height: ${heightValue};
22
+ ${height !== 'content' &&
23
+ css `
24
+ overflow: hidden;
25
+ `}
17
26
 
18
27
  ${backgroundImage &&
19
28
  css `
@@ -30,7 +39,7 @@ export const StyledBannerContainer = styled.div(({ backgroundImage, backgroundCo
30
39
  `;
31
40
  });
32
41
  StyledBannerContainer.defaultProps = defaultThemeProp;
33
- export const StyledBanner = styled.div(({ variant = 'light', backgroundColor, backgroundImage, tintImage = true, theme: { base: { palette: { light, dark } } } }) => {
42
+ export const StyledBanner = styled.div(({ variant = 'light', backgroundColor, backgroundImage, tintImage = false, align = 'center', theme: { base: { palette: { light, dark } } } }) => {
34
43
  let textColor = variant === 'light' ? dark : light;
35
44
  let overlayColor = variant === 'light' ? transparentize(0.3, light) : transparentize(0.3, dark);
36
45
  if (backgroundColor && !backgroundImage) {
@@ -46,7 +55,7 @@ export const StyledBanner = styled.div(({ variant = 'light', backgroundColor, ba
46
55
  color: ${textColor};
47
56
  width: 100%;
48
57
  height: 100%;
49
- text-align: center;
58
+ text-align: ${align};
50
59
  `;
51
60
  });
52
61
  StyledBanner.defaultProps = defaultThemeProp;
@@ -56,11 +65,6 @@ export const StyledContentContainer = styled.div(({ theme: { base: { breakpoints
56
65
  width: 100%;
57
66
  margin: 0 auto;
58
67
 
59
- h1 {
60
- font-size: 3rem;
61
- word-break: break-word;
62
- }
63
-
64
68
  @media screen and (min-width: ${breakpoints.md}) {
65
69
  width: 100%;
66
70
  padding: calc(${spacing} * 2.5);
@@ -71,12 +75,31 @@ export const StyledContentContainer = styled.div(({ theme: { base: { breakpoints
71
75
  `;
72
76
  });
73
77
  StyledContentContainer.defaultProps = defaultThemeProp;
78
+ export const StyledBannerHeading = styled(Text)(({ theme: { base: { 'font-size': fontSize } } }) => css `
79
+ font-size: calc(${fontSize} * 3);
80
+ word-break: break-word;
81
+ `);
82
+ StyledBannerHeading.defaultProps = defaultThemeProp;
83
+ export const StyledBannerMessage = styled(Text)(({ theme: { base: { 'font-size': fontSize } } }) => css `
84
+ font-size: calc(${fontSize} * 1.5);
85
+ `);
86
+ StyledBannerMessage.defaultProps = defaultThemeProp;
74
87
  const variantMap = {
75
- 'two-column': '1fr 1fr',
76
- 'narrow-wide': '3fr 7fr',
77
- 'wide-narrow': '7fr 3fr'
88
+ 'two-column': 'minmax(0, 1fr) minmax(0, 1fr)',
89
+ 'narrow-wide': 'minmax(0, 3fr) minmax(0, 7fr)',
90
+ 'wide-narrow': 'minmax(0, 7fr) minmax(0, 3fr)'
91
+ };
92
+ const verticalAlignMap = {
93
+ top: 'start',
94
+ center: 'center',
95
+ bottom: 'end'
96
+ };
97
+ const horizontalAlignMap = {
98
+ left: 'start',
99
+ center: 'center',
100
+ right: 'end'
78
101
  };
79
- const StylePageTabContent = styled.div(({ theme }) => {
102
+ const StyledPageTabContent = styled.div(({ theme }) => {
80
103
  return css `
81
104
  padding-block: calc(2 * ${theme.base.spacing});
82
105
 
@@ -85,12 +108,17 @@ const StylePageTabContent = styled.div(({ theme }) => {
85
108
  }
86
109
  `;
87
110
  });
88
- StylePageTabContent.defaultProps = defaultThemeProp;
111
+ StyledPageTabContent.defaultProps = defaultThemeProp;
89
112
  export const BannerPage = forwardRef(function BannerPage({ banner, a, b, variant = 'two-column', utilities, className: classNameProp, ...restProps }, ref) {
90
113
  const className = createClassName('banner-page', classNameProp, { variant });
91
114
  const gridCols = variantMap[variant];
92
- const pageContent = (_jsxs(Grid, { container: { gap: 2 }, md: { container: { cols: '1fr' } }, lg: { container: { cols: b ? `${gridCols}` : '1fr' } }, as: StyledContentContainer, className: createClassName('banner-page-content'), children: [!!a.length && _jsx(Flex, { container: { direction: 'column', gap: 2 }, children: a.map(el => el) }), b && !!b.length && (_jsx(Flex, { container: { direction: 'column', gap: 2 }, children: b.map(el => el) }))] }));
93
- const pageBanner = banner && (_jsx(StyledBannerContainer, { backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, className: createClassName('banner-page-banner'), children: _jsx(Flex, { variant: banner.variant, backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, as: StyledBanner, container: { justify: 'center', alignItems: 'center', direction: 'column', gap: 1 }, tintImage: banner.tintImage, children: _jsxs(StyledContentContainer, { children: [_jsx(Text, { variant: 'h1', children: banner.title }), banner.message && (_jsx(Text, { variant: 'primary', as: 'p', children: banner.message }))] }) }) }));
115
+ const pageContent = (_jsxs(Grid, { container: { gap: 2 }, md: { container: { cols: 'minmax(0, 1fr)' } }, lg: { container: { cols: b ? `${gridCols}` : 'minmax(0, 1fr)' } }, as: StyledContentContainer, className: createClassName('banner-page-content'), children: [!!a.length && _jsx(Flex, { container: { direction: 'column', gap: 2 }, children: a.map(el => el) }), b && !!b.length && (_jsx(Flex, { container: { direction: 'column', gap: 2 }, children: b.map(el => el) }))] }));
116
+ const pageBanner = banner && (_jsx(StyledBannerContainer, { backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, height: banner.height, className: createClassName('banner-page-banner'), children: _jsx(Flex, { variant: banner.variant, backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, as: StyledBanner, container: {
117
+ justify: verticalAlignMap[banner.verticalAlign ?? 'center'] ?? 'center',
118
+ alignItems: horizontalAlignMap[banner.align ?? 'center'] ?? 'center',
119
+ direction: 'column',
120
+ gap: 1
121
+ }, tintImage: banner.tintImage, align: banner.align, children: _jsxs(StyledContentContainer, { children: [_jsx(StyledBannerHeading, { variant: 'h1', children: banner.title }), banner.message && (_jsx(StyledBannerMessage, { variant: 'primary', as: 'p', children: banner.message }))] }) }) }));
94
122
  const isMediumOrAbove = useBreakpoint('md');
95
123
  const [panel, setPanel] = useState('content');
96
124
  const pageTabsRef = useRef(null);
@@ -110,7 +138,7 @@ export const BannerPage = forwardRef(function BannerPage({ banner, a, b, variant
110
138
  if (isMediumOrAbove) {
111
139
  return (_jsxs(Flex, { as: StyledBannerPage, container: { gap: 2 }, ref: ref, ...restProps, className: className, children: [_jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, children: [pageBanner, pageContent] }), _jsx("div", { children: utilities })] }));
112
140
  }
113
- return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, as: StyledBannerPage, className: className, children: [pageBanner, _jsxs(Flex, { container: { direction: 'column', pad: [undefined, 2, undefined] }, children: [_jsx(Tabs, { tabs: pageTabs, onTabClick: handleTabChange, currentTabId: panel, ref: pageTabsRef }), pageTabs.map(tab => (_jsx(TabPanel, { tabId: tab.id, currentTabId: panel, tablistRef: pageTabsRef, children: _jsx(StylePageTabContent, { children: tab.content }) }, tab.id)))] })] }));
141
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, as: StyledBannerPage, className: className, children: [pageBanner, _jsxs(Flex, { container: { direction: 'column', pad: [undefined, 2, undefined] }, children: [_jsx(Tabs, { tabs: pageTabs, onTabClick: handleTabChange, currentTabId: panel, ref: pageTabsRef }), pageTabs.map(tab => (_jsx(TabPanel, { tabId: tab.id, currentTabId: panel, tablistRef: pageTabsRef, children: _jsx(StyledPageTabContent, { children: tab.content }) }, tab.id)))] })] }));
114
142
  }
115
143
  return (_jsxs(StyledBannerPage, { ref: ref, ...restProps, className: className, children: [pageBanner, pageContent] }));
116
144
  });
@@ -1 +1 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AAC,QAAQ,IAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,YACnE,KAAC,mBAAmB,cAAE,GAAG,CAAC,OAAO,GAAuB,IADkB,GAAG,CAAC,EAAE,CAEvE,CACZ,CAAC,IACG,IACF,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,gBAAgB,IAAC,GAAG,EAAE,GAAG,KAAM,SAAS,EAAE,SAAS,EAAE,SAAS,aAC5D,UAAU,EACV,WAAW,IACK,CACpB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { transparentize } from 'polished';\nimport { forwardRef, useState, useRef } from 'react';\nimport type { PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Flex,\n Grid,\n Text,\n tryCatch,\n readableColor,\n useBreakpoint,\n useI18n,\n Tabs,\n TabPanel,\n createClassName\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nexport interface BannerOptions {\n /** An image url for the banner */\n backgroundImage?: string;\n /** A title for the banner */\n title: string;\n /** A fallback background color if the background image is not provided */\n backgroundColor?: string;\n /** Text that will appear below the title */\n message?: string;\n /** The light variant will provide a white translucent filter over the background image\n * with dark text. The dark variant will provide the opposite.\n * @default 'light'\n */\n variant?: 'light' | 'dark';\n /** Toggles the translucent filter provided by the variant\n * @default true\n */\n tintImage?: boolean;\n}\n\nexport interface BannerPageProps extends BaseProps {\n banner: BannerOptions;\n /** Content for the first column */\n a: ReactNode[];\n /** Content for the second column. If not provided the first column will stretch. */\n b?: ReactNode[];\n ref?: Ref<HTMLDivElement>;\n /** Variants for the sizing of the content columns. Two column will make the columns equal in size. */\n variant?: 'two-column' | 'narrow-wide' | 'wide-narrow';\n /** Utilities as the last column */\n utilities?: ReactNode;\n}\n\nexport const StyledBannerPage = styled.div(({ theme }) => {\n return css`\n min-height: calc(100vh - var(--appshell-offset));\n background-color: ${theme.base.palette['app-background']};\n `;\n});\n\nStyledBannerPage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContainer = styled.div<\n Pick<BannerOptions, 'backgroundImage' | 'backgroundColor'>\n>(({ backgroundImage, backgroundColor, theme }) => {\n return css`\n width: 100%;\n height: calc(${theme.base.spacing} * 38);\n\n ${backgroundImage &&\n css`\n background-image: url('${backgroundImage}');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n `}\n\n ${backgroundColor &&\n css`\n background-color: ${backgroundColor};\n `}\n `;\n});\n\nStyledBannerContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div<\n Pick<BannerOptions, 'variant' | 'backgroundColor' | 'backgroundImage' | 'tintImage'>\n>(\n ({\n variant = 'light',\n backgroundColor,\n backgroundImage,\n tintImage = true,\n theme: {\n base: {\n palette: { light, dark }\n }\n }\n }) => {\n let textColor = variant === 'light' ? dark : light;\n let overlayColor = variant === 'light' ? transparentize(0.3, light) : transparentize(0.3, dark);\n if (backgroundColor && !backgroundImage) {\n textColor = tryCatch(() => readableColor(backgroundColor)) ?? dark;\n overlayColor = 'transparent';\n } else if (!backgroundColor && !backgroundImage) {\n overlayColor = 'transparent';\n textColor = dark;\n }\n return css`\n background-color: ${tintImage ? overlayColor : 'transparent'};\n color: ${textColor};\n width: 100%;\n height: 100%;\n text-align: center;\n `;\n }\n);\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nexport const StyledContentContainer = styled.div(\n ({\n theme: {\n base: { breakpoints, spacing }\n }\n }) => {\n return css`\n padding: calc(${spacing} * 2);\n width: 100%;\n margin: 0 auto;\n\n h1 {\n font-size: 3rem;\n word-break: break-word;\n }\n\n @media screen and (min-width: ${breakpoints.md}) {\n width: 100%;\n padding: calc(${spacing} * 2.5);\n }\n @media screen and (min-width: ${breakpoints.lg}) {\n max-width: 93.75rem;\n }\n `;\n }\n);\n\nStyledContentContainer.defaultProps = defaultThemeProp;\n\nconst variantMap = {\n 'two-column': '1fr 1fr',\n 'narrow-wide': '3fr 7fr',\n 'wide-narrow': '7fr 3fr'\n};\n\nconst StylePageTabContent = styled.div(({ theme }) => {\n return css`\n padding-block: calc(2 * ${theme.base.spacing});\n\n ${StyledContentContainer} {\n padding: 0;\n }\n `;\n});\n\nStylePageTabContent.defaultProps = defaultThemeProp;\n\nexport const BannerPage: ForwardRefForwardPropsComponent<BannerPageProps> = forwardRef(\n function BannerPage(\n {\n banner,\n a,\n b,\n variant = 'two-column',\n utilities,\n className: classNameProp,\n ...restProps\n }: PropsWithoutRef<BannerPageProps>,\n ref: BannerPageProps['ref']\n ) {\n const className = createClassName('banner-page', classNameProp, { variant });\n const gridCols = variantMap[variant];\n const pageContent = (\n <Grid\n container={{ gap: 2 }}\n md={{ container: { cols: '1fr' } }}\n lg={{ container: { cols: b ? `${gridCols}` : '1fr' } }}\n as={StyledContentContainer}\n className={createClassName('banner-page-content')}\n >\n {!!a.length && <Flex container={{ direction: 'column', gap: 2 }}>{a.map(el => el)}</Flex>}\n {b && !!b.length && (\n <Flex container={{ direction: 'column', gap: 2 }}>{b.map(el => el)}</Flex>\n )}\n </Grid>\n );\n\n const pageBanner = banner && (\n <StyledBannerContainer\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n className={createClassName('banner-page-banner')}\n >\n <Flex\n variant={banner.variant}\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n as={StyledBanner}\n container={{ justify: 'center', alignItems: 'center', direction: 'column', gap: 1 }}\n tintImage={banner.tintImage}\n >\n <StyledContentContainer>\n <Text variant='h1'>{banner.title}</Text>\n {banner.message && (\n <Text variant='primary' as='p'>\n {banner.message}\n </Text>\n )}\n </StyledContentContainer>\n </Flex>\n </StyledBannerContainer>\n );\n\n const isMediumOrAbove = useBreakpoint('md');\n const [panel, setPanel] = useState('content');\n const pageTabsRef = useRef<HTMLElement>(null);\n const t = useI18n();\n\n const pageTabs = [\n { name: t('content'), id: 'content', content: pageContent },\n {\n name: t('chat_with_ai'),\n id: 'chat_with_ai',\n content: utilities\n }\n ];\n\n const handleTabChange = (id: string) => {\n setPanel(id);\n };\n\n if (utilities) {\n if (isMediumOrAbove) {\n return (\n <Flex\n as={StyledBannerPage}\n container={{ gap: 2 }}\n ref={ref}\n {...restProps}\n className={className}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n {pageBanner}\n {pageContent}\n </Flex>\n <div>{utilities}</div>\n </Flex>\n );\n }\n\n return (\n <Flex\n container={{ direction: 'column', gap: 2 }}\n as={StyledBannerPage}\n className={className}\n >\n {pageBanner}\n <Flex container={{ direction: 'column', pad: [undefined, 2, undefined] }}>\n <Tabs\n tabs={pageTabs}\n onTabClick={handleTabChange}\n currentTabId={panel}\n ref={pageTabsRef}\n />\n {pageTabs.map(tab => (\n <TabPanel tabId={tab.id} currentTabId={panel} tablistRef={pageTabsRef} key={tab.id}>\n <StylePageTabContent>{tab.content}</StylePageTabContent>\n </TabPanel>\n ))}\n </Flex>\n </Flex>\n );\n }\n\n return (\n <StyledBannerPage ref={ref} {...restProps} className={className}>\n {pageBanner}\n {pageContent}\n </StyledBannerPage>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"BannerPage.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/BannerPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAmDjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,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G,EAAE,GAAG,KACJ,SAAS,EACb,SAAS,EAAE,SAAS,aAEpB,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aACxD,UAAU,EACV,WAAW,IACP,EACP,wBAAM,SAAS,GAAO,IACjB,CACR,CAAC;QACJ,CAAC;QAED,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAC1C,EAAE,EAAE,gBAAgB,EACpB,SAAS,EAAE,SAAS,aAEnB,UAAU,EACX,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,aACtE,KAAC,IAAI,IACH,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,eAAe,EAC3B,YAAY,EAAE,KAAK,EACnB,GAAG,EAAE,WAAW,GAChB,EACD,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACnB,KAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,YACnE,KAAC,oBAAoB,cAAE,GAAG,CAAC,OAAO,GAAwB,IADgB,GAAG,CAAC,EAAE,CAEvE,CACZ,CAAC,IACG,IACF,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,gBAAgB,IAAC,GAAG,EAAE,GAAG,KAAM,SAAS,EAAE,SAAS,EAAE,SAAS,aAC5D,UAAU,EACV,WAAW,IACK,CACpB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { transparentize } from 'polished';\nimport { forwardRef, useState, useRef } from 'react';\nimport type { PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Flex,\n Grid,\n Text,\n tryCatch,\n readableColor,\n useBreakpoint,\n useI18n,\n Tabs,\n TabPanel,\n createClassName\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nexport interface BannerOptions {\n /** An image url for the banner */\n backgroundImage?: string;\n /** A title for the banner */\n title: string;\n /** A fallback background color if the background image is not provided */\n backgroundColor?: string;\n /** Text that will appear below the title */\n message?: string;\n /** The light variant will provide a white translucent filter over the background image\n * with dark text. The dark variant will provide the opposite.\n * @default 'light'\n */\n variant?: 'light' | 'dark';\n /** Toggles the translucent filter provided by the variant\n * @default true\n */\n tintImage?: boolean;\n /** Controls how the banner fills vertical space.\n * - 'fixed': preset height based on the spacing token\n * - 'content': shrinks to fit content\n * - 'full': fills the visible viewport below the app shell\n * @default 'fixed'\n */\n height?: 'content' | 'fixed' | 'full';\n /** Horizontal alignment of the banner text content.\n * @default 'center'\n */\n align?: 'left' | 'center' | 'right';\n /** Vertical alignment of the banner text content.\n * @default 'center'\n */\n verticalAlign?: 'top' | 'center' | 'bottom';\n}\n\nexport interface BannerPageProps extends BaseProps {\n banner: BannerOptions;\n /** Content for the first column */\n a: ReactNode[];\n /** Content for the second column. If not provided the first column will stretch. */\n b?: ReactNode[];\n ref?: Ref<HTMLDivElement>;\n /** Variants for the sizing of the content columns. Two column will make the columns equal in size. */\n variant?: 'two-column' | 'narrow-wide' | 'wide-narrow';\n /** Utilities as the last column */\n utilities?: ReactNode;\n}\n\nexport const StyledBannerPage = styled.div(({ theme }) => {\n return css`\n min-height: calc(100vh - var(--appshell-offset));\n background-color: ${theme.base.palette['app-background']};\n `;\n});\n\nStyledBannerPage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContainer = styled.div<\n Pick<BannerOptions, 'backgroundImage' | 'backgroundColor' | 'height'>\n>(({ backgroundImage, backgroundColor, height = 'fixed', theme }) => {\n const heightValue = {\n content: 'auto',\n fixed: `calc(${theme.base.spacing} * 38)`,\n full: 'calc(100dvh - var(--appshell-offset, 0rem))'\n }[height];\n\n return css`\n width: 100%;\n height: ${heightValue};\n ${height !== 'content' &&\n css`\n overflow: hidden;\n `}\n\n ${backgroundImage &&\n css`\n background-image: url('${backgroundImage}');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n `}\n\n ${backgroundColor &&\n css`\n background-color: ${backgroundColor};\n `}\n `;\n});\n\nStyledBannerContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div<\n Pick<BannerOptions, 'variant' | 'backgroundColor' | 'backgroundImage' | 'tintImage' | 'align'>\n>(\n ({\n variant = 'light',\n backgroundColor,\n backgroundImage,\n tintImage = false,\n align = 'center',\n theme: {\n base: {\n palette: { light, dark }\n }\n }\n }) => {\n let textColor = variant === 'light' ? dark : light;\n let overlayColor = variant === 'light' ? transparentize(0.3, light) : transparentize(0.3, dark);\n if (backgroundColor && !backgroundImage) {\n textColor = tryCatch(() => readableColor(backgroundColor)) ?? dark;\n overlayColor = 'transparent';\n } else if (!backgroundColor && !backgroundImage) {\n overlayColor = 'transparent';\n textColor = dark;\n }\n return css`\n background-color: ${tintImage ? overlayColor : 'transparent'};\n color: ${textColor};\n width: 100%;\n height: 100%;\n text-align: ${align};\n `;\n }\n);\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nexport const StyledContentContainer = styled.div(\n ({\n theme: {\n base: { breakpoints, spacing }\n }\n }) => {\n return css`\n padding: calc(${spacing} * 2);\n width: 100%;\n margin: 0 auto;\n\n @media screen and (min-width: ${breakpoints.md}) {\n width: 100%;\n padding: calc(${spacing} * 2.5);\n }\n @media screen and (min-width: ${breakpoints.lg}) {\n max-width: 93.75rem;\n }\n `;\n }\n);\n\nStyledContentContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBannerHeading = styled(Text)(\n ({\n theme: {\n base: { 'font-size': fontSize }\n }\n }) => css`\n font-size: calc(${fontSize} * 3);\n word-break: break-word;\n `\n);\n\nStyledBannerHeading.defaultProps = defaultThemeProp;\n\nexport const StyledBannerMessage = styled(Text)(\n ({\n theme: {\n base: { 'font-size': fontSize }\n }\n }) => css`\n font-size: calc(${fontSize} * 1.5);\n `\n);\n\nStyledBannerMessage.defaultProps = defaultThemeProp;\n\nconst variantMap = {\n 'two-column': 'minmax(0, 1fr) minmax(0, 1fr)',\n 'narrow-wide': 'minmax(0, 3fr) minmax(0, 7fr)',\n 'wide-narrow': 'minmax(0, 7fr) minmax(0, 3fr)'\n};\n\nconst verticalAlignMap = {\n top: 'start',\n center: 'center',\n bottom: 'end'\n} as const;\n\nconst horizontalAlignMap = {\n left: 'start',\n center: 'center',\n right: 'end'\n} as const;\n\nconst StyledPageTabContent = styled.div(({ theme }) => {\n return css`\n padding-block: calc(2 * ${theme.base.spacing});\n\n ${StyledContentContainer} {\n padding: 0;\n }\n `;\n});\n\nStyledPageTabContent.defaultProps = defaultThemeProp;\n\nexport const BannerPage: ForwardRefForwardPropsComponent<BannerPageProps> = forwardRef(\n function BannerPage(\n {\n banner,\n a,\n b,\n variant = 'two-column',\n utilities,\n className: classNameProp,\n ...restProps\n }: PropsWithoutRef<BannerPageProps>,\n ref: BannerPageProps['ref']\n ) {\n const className = createClassName('banner-page', classNameProp, { variant });\n const gridCols = variantMap[variant];\n const pageContent = (\n <Grid\n container={{ gap: 2 }}\n md={{ container: { cols: 'minmax(0, 1fr)' } }}\n lg={{ container: { cols: b ? `${gridCols}` : 'minmax(0, 1fr)' } }}\n as={StyledContentContainer}\n className={createClassName('banner-page-content')}\n >\n {!!a.length && <Flex container={{ direction: 'column', gap: 2 }}>{a.map(el => el)}</Flex>}\n {b && !!b.length && (\n <Flex container={{ direction: 'column', gap: 2 }}>{b.map(el => el)}</Flex>\n )}\n </Grid>\n );\n\n const pageBanner = banner && (\n <StyledBannerContainer\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n height={banner.height}\n className={createClassName('banner-page-banner')}\n >\n <Flex\n variant={banner.variant}\n backgroundImage={banner.backgroundImage}\n backgroundColor={banner.backgroundColor}\n as={StyledBanner}\n container={{\n justify: verticalAlignMap[banner.verticalAlign ?? 'center'] ?? 'center',\n alignItems: horizontalAlignMap[banner.align ?? 'center'] ?? 'center',\n direction: 'column',\n gap: 1\n }}\n tintImage={banner.tintImage}\n align={banner.align}\n >\n <StyledContentContainer>\n <StyledBannerHeading variant='h1'>{banner.title}</StyledBannerHeading>\n {banner.message && (\n <StyledBannerMessage variant='primary' as='p'>\n {banner.message}\n </StyledBannerMessage>\n )}\n </StyledContentContainer>\n </Flex>\n </StyledBannerContainer>\n );\n\n const isMediumOrAbove = useBreakpoint('md');\n const [panel, setPanel] = useState('content');\n const pageTabsRef = useRef<HTMLElement>(null);\n const t = useI18n();\n\n const pageTabs = [\n { name: t('content'), id: 'content', content: pageContent },\n {\n name: t('chat_with_ai'),\n id: 'chat_with_ai',\n content: utilities\n }\n ];\n\n const handleTabChange = (id: string) => {\n setPanel(id);\n };\n\n if (utilities) {\n if (isMediumOrAbove) {\n return (\n <Flex\n as={StyledBannerPage}\n container={{ gap: 2 }}\n ref={ref}\n {...restProps}\n className={className}\n >\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }}>\n {pageBanner}\n {pageContent}\n </Flex>\n <div>{utilities}</div>\n </Flex>\n );\n }\n\n return (\n <Flex\n container={{ direction: 'column', gap: 2 }}\n as={StyledBannerPage}\n className={className}\n >\n {pageBanner}\n <Flex container={{ direction: 'column', pad: [undefined, 2, undefined] }}>\n <Tabs\n tabs={pageTabs}\n onTabClick={handleTabChange}\n currentTabId={panel}\n ref={pageTabsRef}\n />\n {pageTabs.map(tab => (\n <TabPanel tabId={tab.id} currentTabId={panel} tablistRef={pageTabsRef} key={tab.id}>\n <StyledPageTabContent>{tab.content}</StyledPageTabContent>\n </TabPanel>\n ))}\n </Flex>\n </Flex>\n );\n }\n\n return (\n <StyledBannerPage ref={ref} {...restProps} className={className}>\n {pageBanner}\n {pageContent}\n </StyledBannerPage>\n );\n }\n);\n"]}