@pega/cosmos-react-build 9.0.0-build.2.6 → 9.0.0-build.2.7
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/AuthoringPanel/AuthoringPanel.d.ts +7 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.js +30 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.d.ts +17 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.js +93 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.styles.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.d.ts +2 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.js +16 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.d.ts +77 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.js +2 -0
- package/lib/components/AuthoringPanel/AuthoringPanel.types.js.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.d.ts +6 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.js +36 -0
- package/lib/components/AuthoringPanel/AuthoringPanelHeader.js.map +1 -0
- package/lib/components/AuthoringPanel/index.d.ts +4 -0
- package/lib/components/AuthoringPanel/index.d.ts.map +1 -0
- package/lib/components/AuthoringPanel/index.js +3 -0
- package/lib/components/AuthoringPanel/index.js.map +1 -0
- package/lib/components/PageBanner/PageBanner.d.ts +6 -4
- package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.js +10 -9
- package/lib/components/PageBanner/PageBanner.js.map +1 -1
- package/lib/components/PageBanner/PageBanner.test-ids.d.ts +2 -0
- package/lib/components/PageBanner/PageBanner.test-ids.d.ts.map +1 -0
- package/lib/components/PageBanner/PageBanner.test-ids.js +9 -0
- package/lib/components/PageBanner/PageBanner.test-ids.js.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.d.ts +12 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.d.ts.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.js +158 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.js.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.d.ts +5 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.d.ts.map +1 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.js +10 -0
- package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.js.map +1 -0
- package/lib/components/PageTemplates/GalleryPage.d.ts +14 -4
- package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.js +57 -12
- package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
- package/lib/components/PageTemplates/HeaderActionButtons.d.ts +5 -0
- package/lib/components/PageTemplates/HeaderActionButtons.d.ts.map +1 -0
- package/lib/components/PageTemplates/HeaderActionButtons.js +8 -0
- package/lib/components/PageTemplates/HeaderActionButtons.js.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.d.ts +8 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.d.ts.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.js +23 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.js.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.d.ts +5 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.d.ts.map +1 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.js +10 -0
- package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.js.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.d.ts +5 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.d.ts.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.js +10 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.js.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.d.ts +21 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.d.ts.map +1 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.js +22 -0
- package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.js.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.styles.d.ts +13 -0
- package/lib/components/PageTemplates/PageTemplate.styles.d.ts.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.styles.js +141 -0
- package/lib/components/PageTemplates/PageTemplate.styles.js.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.types.d.ts +109 -0
- package/lib/components/PageTemplates/PageTemplate.types.d.ts.map +1 -0
- package/lib/components/PageTemplates/PageTemplate.types.js +2 -0
- package/lib/components/PageTemplates/PageTemplate.types.js.map +1 -0
- package/lib/components/PageTemplates/PageTemplates.d.ts +16 -12
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +8 -7
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.test-ids.d.ts +4 -0
- package/lib/components/PageTemplates/PageTemplates.test-ids.d.ts.map +1 -0
- package/lib/components/PageTemplates/PageTemplates.test-ids.js +25 -0
- package/lib/components/PageTemplates/PageTemplates.test-ids.js.map +1 -0
- package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
- package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.js +5 -6
- package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
- package/lib/components/PageTemplates/index.d.ts +6 -1
- package/lib/components/PageTemplates/index.d.ts.map +1 -1
- package/lib/components/PageTemplates/index.js +5 -1
- package/lib/components/PageTemplates/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FunctionComponent, MouseEventHandler } from 'react';
|
|
2
|
+
import { type ImageProps, type NoChildrenProp, type TestIdProp } from '@pega/cosmos-react-core';
|
|
3
|
+
interface Action {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
+
}
|
|
7
|
+
export interface PageBannerProps extends NoChildrenProp, TestIdProp {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
image?: ImageProps;
|
|
11
|
+
actions?: [Action] | [Action, Action];
|
|
12
|
+
link?: {
|
|
13
|
+
label: string;
|
|
14
|
+
href: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare const _default: FunctionComponent<PageBannerProps> & {
|
|
18
|
+
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["title", "status", "edit-details", "additional-info-icon", "type", "meta-data", "primary-meta-data", "secondary-meta-data", "visual", "primary-action", "secondary-action", "additional-actions", "banner-description", "banner-link", "banner-actions", "banner-image"]>;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=PageBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/PageTemplates/OverviewPageTemplate/PageBanner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAML,KAAK,UAAU,EAIf,KAAK,cAAc,EACnB,KAAK,UAAU,EAGhB,MAAM,yBAAyB,CAAC;AAKjC,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc,EAAE,UAAU;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,IAAI,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;;;;AA8DD,wBAA6D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { Flex, Grid, Image, Text, Button, Link, useBreakpoint, ShowMoreLess, useTestIds, withTestIds } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledActions, StyledPageBanner } from '../PageTemplate.styles';
|
|
5
|
+
import { getPageHeaderTestIds } from '../PageTemplates.test-ids';
|
|
6
|
+
const PageBanner = ({ testId, title, description, image, actions, link }) => {
|
|
7
|
+
const testIds = useTestIds(testId, getPageHeaderTestIds);
|
|
8
|
+
const headerRef = useRef(null);
|
|
9
|
+
const isMediumOrAbove = useBreakpoint('md', { breakpointRef: headerRef });
|
|
10
|
+
const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: headerRef });
|
|
11
|
+
const largePadding = 8;
|
|
12
|
+
const smallPadding = 2;
|
|
13
|
+
const largeGap = 8;
|
|
14
|
+
const mediumGap = 4;
|
|
15
|
+
return (_jsx("div", { ref: headerRef, children: _jsxs(Grid, { container: {
|
|
16
|
+
cols: isSmallOrAbove && image ? '1fr 25%' : '1fr',
|
|
17
|
+
pad: isMediumOrAbove ? [0, largePadding, 0, smallPadding] : [0, smallPadding],
|
|
18
|
+
gap: isMediumOrAbove ? largeGap : mediumGap
|
|
19
|
+
}, as: StyledPageBanner, children: [_jsxs(Flex, { container: { direction: 'column', pad: [smallPadding, 0], rowGap: 1 }, children: [_jsx(Text, { "data-testid": testIds.title, variant: 'h1', children: title }), _jsx(ShowMoreLess, { lines: 3, children: _jsx(Text, { "data-testid": testIds.bannerDescription, as: 'p', children: description }) }), (actions || link) && (_jsxs(StyledActions, { "data-testid": testIds.bannerActions, container: { alignItems: 'center', pad: [1, 0, 0, 0], colGap: 2, wrap: 'wrap' }, children: [actions?.map(action => (_jsx(Button, { onClick: action.onClick, children: action.label }, action.label))), link && (_jsx(Link, { "data-testid": testIds.bannerLink, href: link.href, children: link.label }))] }))] }), isSmallOrAbove && image && _jsx(Image, { ...image, "data-testid": testIds.bannerImage })] }) }));
|
|
20
|
+
};
|
|
21
|
+
export default withTestIds(PageBanner, getPageHeaderTestIds);
|
|
22
|
+
//# sourceMappingURL=PageBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageBanner.js","sourceRoot":"","sources":["../../../../src/components/PageTemplates/OverviewPageTemplate/PageBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EAEN,IAAI,EACJ,aAAa,EACb,YAAY,EAGZ,UAAU,EACV,WAAW,EACZ,MAAM,yB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AAM,EAAE,CAAC,EAAE,aACzE,KAAC,IAAI,mBAAc,OAAO,CAAC,KAAK,EAAE,OAAO,EAAC,IAAI,YAC3C,KAAK,GACD,EACP,KAAC,YAAY,IAAC,KAAK,EAAE,CAAC,YACpB,KAAC,IAAI,mBAAc,OAAO,CAAC,iBAAiB,EAAE,EAAE,EAAC,GAAG,YACjD,WAAW,GACP,GACM,EACd,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CACpB,MAAC,aAAa,mBACC,OAAO,CAAC,aAAa,EAClC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,aAE9E,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACtB,KAAC,MAAM,IAAoB,OAAO,EAAE,MAAM,CAAC,OAAO,YAC/C,MAAM,CAAC,KAAK,IADF,MAAM,CAAC,KAAK,CAEhB,CACV,CAAC,EACD,IAAI,IAAI,CACP,KAAC,IAAI,mBAAc,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,YACnD,IAAI,CAAC,KAAK,GACN,CACR,IACa,CACjB,IACI,EACN,cAAc,IAAI,KAAK,IAAI,KAAC,KAAK,OAAK,KAAK,iBAAe,OAAO,CAAC,WAAW,GAAI,IAC7E,GACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { useRef } from 'react';\nimport type { FunctionComponent, MouseEventHandler } from 'react';\n\nimport {\n Flex,\n Grid,\n Image,\n Text,\n Button,\n type ImageProps,\n Link,\n useBreakpoint,\n ShowMoreLess,\n type NoChildrenProp,\n type TestIdProp,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\n\nimport { StyledActions, StyledPageBanner } from '../PageTemplate.styles';\nimport { getPageHeaderTestIds } from '../PageTemplates.test-ids';\n\ninterface Action {\n label: string;\n onClick: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface PageBannerProps extends NoChildrenProp, TestIdProp {\n title: string;\n description: string;\n image?: ImageProps;\n actions?: [Action] | [Action, Action];\n link?: {\n label: string;\n href: string;\n };\n}\n\nconst PageBanner: FunctionComponent<PageBannerProps> = ({\n testId,\n title,\n description,\n image,\n actions,\n link\n}) => {\n const testIds = useTestIds(testId, getPageHeaderTestIds);\n const headerRef = useRef<HTMLDivElement>(null);\n const isMediumOrAbove = useBreakpoint('md', { breakpointRef: headerRef });\n const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: headerRef });\n const largePadding = 8;\n const smallPadding = 2;\n const largeGap = 8;\n const mediumGap = 4;\n\n return (\n <div ref={headerRef}>\n <Grid\n container={{\n cols: isSmallOrAbove && image ? '1fr 25%' : '1fr',\n pad: isMediumOrAbove ? [0, largePadding, 0, smallPadding] : [0, smallPadding],\n gap: isMediumOrAbove ? largeGap : mediumGap\n }}\n as={StyledPageBanner}\n >\n <Flex container={{ direction: 'column', pad: [smallPadding, 0], rowGap: 1 }}>\n <Text data-testid={testIds.title} variant='h1'>\n {title}\n </Text>\n <ShowMoreLess lines={3}>\n <Text data-testid={testIds.bannerDescription} as='p'>\n {description}\n </Text>\n </ShowMoreLess>\n {(actions || link) && (\n <StyledActions\n data-testid={testIds.bannerActions}\n container={{ alignItems: 'center', pad: [1, 0, 0, 0], colGap: 2, wrap: 'wrap' }}\n >\n {actions?.map(action => (\n <Button key={action.label} onClick={action.onClick}>\n {action.label}\n </Button>\n ))}\n {link && (\n <Link data-testid={testIds.bannerLink} href={link.href}>\n {link.label}\n </Link>\n )}\n </StyledActions>\n )}\n </Flex>\n {isSmallOrAbove && image && <Image {...image} data-testid={testIds.bannerImage} />}\n </Grid>\n </div>\n );\n};\n\nexport default withTestIds(PageBanner, getPageHeaderTestIds);\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Text, Button } from '@pega/cosmos-react-core';
|
|
2
|
+
export declare const StyledPageBanner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledActions: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledDescription: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const StyledInventoryPage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledInventoryPageTitleWrapper: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
export declare const StyledOverviewPage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
+
export declare const StyledHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
+
export declare const StyledTitleContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
export declare const StyledTextWithEllipsis: typeof Text;
|
|
11
|
+
export declare const StyledText: typeof Text;
|
|
12
|
+
export declare const StyledPrimaryMetaButton: typeof Button;
|
|
13
|
+
//# sourceMappingURL=PageTemplate.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplate.styles.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplate.styles.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,IAAI,EAEJ,MAAM,EAQP,MAAM,yBAAyB,CAAC;AAWjC,eAAO,MAAM,gBAAgB,yGAuC3B,CAAC;AAIH,eAAO,MAAM,aAAa,kNAEzB,CAAC;AAGF,eAAO,MAAM,iBAAiB,yGAO5B,CAAC;AAKH,eAAO,MAAM,mBAAmB,yGAgC/B,CAAC;AAIF,eAAO,MAAM,+BAA+B,kNAW1C,CAAC;AAKH,eAAO,MAAM,kBAAkB,yGAS9B,CAAC;AAGF,eAAO,MAAM,YAAY,yGAMvB,CAAC;AAIH,eAAO,MAAM,oBAAoB,yGAEhC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,OAAO,IAG3C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAAO,IAQ9B,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,OAAO,MAoB3C,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { readableColor } from 'polished';
|
|
3
|
+
import { Text, defaultThemeProp, Button, StyledPageHeader, tryCatch, StyledButton, StyledLink, StyledShowMoreLessButton, Flex, StyledImage } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledBanner, StyledBannerMessageList } from '@pega/cosmos-react-core/lib/components/Banner/Banner';
|
|
5
|
+
import { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';
|
|
6
|
+
import { calculateFontSize } from '@pega/cosmos-react-core/lib/styles';
|
|
7
|
+
import { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';
|
|
8
|
+
// Page banner styles
|
|
9
|
+
export const StyledPageBanner = styled.div(({ theme }) => {
|
|
10
|
+
const { base: { palette: { 'brand-primary': brandBackground }, 'font-weight': fontWeight, 'content-width': contentWidth } } = theme;
|
|
11
|
+
const color = tryCatch(() => readableColor(brandBackground));
|
|
12
|
+
return css `
|
|
13
|
+
background: ${brandBackground};
|
|
14
|
+
color: ${color};
|
|
15
|
+
|
|
16
|
+
h1:focus-visible {
|
|
17
|
+
outline: transparent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
${StyledButton} + ${StyledButton} {
|
|
21
|
+
margin-inline-start: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
${StyledLink}, ${StyledShowMoreLessButton} {
|
|
25
|
+
font-weight: ${fontWeight['semi-bold']};
|
|
26
|
+
color: ${color};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
p {
|
|
30
|
+
max-width: ${contentWidth.xl};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
${StyledImage} {
|
|
34
|
+
object-fit: contain;
|
|
35
|
+
max-height: 10rem;
|
|
36
|
+
justify-self: center;
|
|
37
|
+
align-self: center;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
});
|
|
41
|
+
StyledPageBanner.defaultProps = defaultThemeProp;
|
|
42
|
+
export const StyledActions = styled(Flex) `
|
|
43
|
+
margin-block-start: auto;
|
|
44
|
+
`;
|
|
45
|
+
// Common styles
|
|
46
|
+
export const StyledDescription = styled.div(({ theme }) => {
|
|
47
|
+
return css `
|
|
48
|
+
max-width: ${theme.base['content-width'].lg};
|
|
49
|
+
* {
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
});
|
|
54
|
+
StyledDescription.defaultProps = defaultThemeProp;
|
|
55
|
+
// Inventory page styles
|
|
56
|
+
export const StyledInventoryPage = styled.div(({ theme: { base: { spacing, palette: { 'primary-background': primaryBackground, 'border-line': borderLine } } } }) => {
|
|
57
|
+
return css `
|
|
58
|
+
background: ${primaryBackground};
|
|
59
|
+
height: 100%;
|
|
60
|
+
|
|
61
|
+
${StyledBanner},
|
|
62
|
+
${StyledTabs} {
|
|
63
|
+
margin-block-start: calc(1.5 * ${spacing});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
${StyledPageHeader} {
|
|
67
|
+
padding: calc(2 * ${spacing});
|
|
68
|
+
border-block-end: 0.0625rem solid ${borderLine};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
${StyledBannerMessageList} {
|
|
72
|
+
max-height: 25vh;
|
|
73
|
+
overflow: auto;
|
|
74
|
+
}
|
|
75
|
+
${StyledDescription} {
|
|
76
|
+
margin-block-start: calc(${spacing} * 1.5);
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
});
|
|
80
|
+
StyledInventoryPage.defaultProps = defaultThemeProp;
|
|
81
|
+
export const StyledInventoryPageTitleWrapper = styled(Flex)(({ theme }) => {
|
|
82
|
+
const { base: { 'content-width': contentWidth, spacing } } = theme;
|
|
83
|
+
return css `
|
|
84
|
+
max-width: ${contentWidth.xl};
|
|
85
|
+
|
|
86
|
+
h1 {
|
|
87
|
+
margin-inline-end: calc(${spacing} * 2);
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
});
|
|
91
|
+
StyledInventoryPageTitleWrapper.defaultProps = defaultThemeProp;
|
|
92
|
+
// overview page styles
|
|
93
|
+
export const StyledOverviewPage = styled.div `
|
|
94
|
+
/* remove the default padding set by header */
|
|
95
|
+
${StyledPageHeader} {
|
|
96
|
+
padding: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
${StyledShowMoreLessButton} {
|
|
100
|
+
max-width: fit-content;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
// Construct page styles
|
|
104
|
+
export const StyledHeader = styled.div(({ theme }) => {
|
|
105
|
+
return css `
|
|
106
|
+
h1:focus-visible {
|
|
107
|
+
box-shadow: ${theme.base.shadow['focus-inset']};
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
});
|
|
111
|
+
StyledHeader.defaultProps = defaultThemeProp;
|
|
112
|
+
export const StyledTitleContainer = styled.div `
|
|
113
|
+
width: calc(100% - 3rem);
|
|
114
|
+
`;
|
|
115
|
+
export const StyledTextWithEllipsis = styled(Text) `
|
|
116
|
+
display: block;
|
|
117
|
+
${ellipsisOverflow}
|
|
118
|
+
`;
|
|
119
|
+
export const StyledText = styled(Text)(({ showEllipsis }) => {
|
|
120
|
+
return css `
|
|
121
|
+
width: 100%;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
${showEllipsis && ellipsisOverflow}
|
|
124
|
+
`;
|
|
125
|
+
});
|
|
126
|
+
export const StyledPrimaryMetaButton = styled(Button)(props => {
|
|
127
|
+
const { theme: { base: { 'font-size': fontSize, 'font-scale': fontScale, shadow }, components: { text } } } = props;
|
|
128
|
+
const fontSizes = calculateFontSize(fontSize, fontScale);
|
|
129
|
+
return css `
|
|
130
|
+
font-size: ${fontSizes[text.h1['font-size']]};
|
|
131
|
+
font-weight: ${text.h1['font-weight']};
|
|
132
|
+
width: 100%;
|
|
133
|
+
${ellipsisOverflow}
|
|
134
|
+
|
|
135
|
+
&:not([disabled]):focus {
|
|
136
|
+
box-shadow: ${shadow['focus-inset']};
|
|
137
|
+
}
|
|
138
|
+
`;
|
|
139
|
+
});
|
|
140
|
+
StyledPrimaryMetaButton.defaultProps = defaultThemeProp;
|
|
141
|
+
//# sourceMappingURL=PageTemplate.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplate.styles.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplate.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,IAAI,EACJ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,YAAY,EACZ,uBAAuB,EACxB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAE7E,qBAAqB;AACrB,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,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AE,EAAE;IACH,OAAO,GAAG,CAAA;;;MAGN,YAAY,IAAI,gBAAgB;GACnC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAkB,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE;IAC3E,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,EAChE,UAAU,EAAE,EAAE,IAAI,EAAE,EACrB,EACF,GAAG,KAAK,CAAC;IAEV,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEzD,OAAO,GAAG,CAAA;iBACK,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAa,CAAC;mBACzC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;;MAEnC,gBAAgB;;;oBAGF,MAAM,CAAC,aAAa,CAAC;;GAEtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Text,\n defaultThemeProp,\n Button,\n StyledPageHeader,\n tryCatch,\n StyledButton,\n StyledLink,\n StyledShowMoreLessButton,\n Flex,\n StyledImage\n} from '@pega/cosmos-react-core';\nimport {\n StyledBanner,\n StyledBannerMessageList\n} from '@pega/cosmos-react-core/lib/components/Banner/Banner';\nimport { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';\nimport { calculateFontSize } from '@pega/cosmos-react-core/lib/styles';\nimport type { FontSize } from '@pega/cosmos-react-core/lib/styles';\nimport { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';\n\n// Page banner styles\nexport const StyledPageBanner = styled.div(({ theme }) => {\n const {\n base: {\n palette: { 'brand-primary': brandBackground },\n 'font-weight': fontWeight,\n 'content-width': contentWidth\n }\n } = theme;\n\n const color = tryCatch(() => readableColor(brandBackground));\n\n return css`\n background: ${brandBackground};\n color: ${color};\n\n h1:focus-visible {\n outline: transparent;\n }\n\n ${StyledButton} + ${StyledButton} {\n margin-inline-start: 0;\n }\n\n ${StyledLink}, ${StyledShowMoreLessButton} {\n font-weight: ${fontWeight['semi-bold']};\n color: ${color};\n }\n\n p {\n max-width: ${contentWidth.xl};\n }\n\n ${StyledImage} {\n object-fit: contain;\n max-height: 10rem;\n justify-self: center;\n align-self: center;\n }\n `;\n});\n\nStyledPageBanner.defaultProps = defaultThemeProp;\n\nexport const StyledActions = styled(Flex)`\n margin-block-start: auto;\n`;\n\n// Common styles\nexport const StyledDescription = styled.div(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].lg};\n * {\n overflow: hidden;\n }\n `;\n});\n\nStyledDescription.defaultProps = defaultThemeProp;\n\n// Inventory page styles\nexport const StyledInventoryPage = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'primary-background': primaryBackground, 'border-line': borderLine }\n }\n }\n }) => {\n return css`\n background: ${primaryBackground};\n height: 100%;\n\n ${StyledBanner},\n ${StyledTabs} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n ${StyledPageHeader} {\n padding: calc(2 * ${spacing});\n border-block-end: 0.0625rem solid ${borderLine};\n }\n\n ${StyledBannerMessageList} {\n max-height: 25vh;\n overflow: auto;\n }\n ${StyledDescription} {\n margin-block-start: calc(${spacing} * 1.5);\n }\n `;\n }\n);\n\nStyledInventoryPage.defaultProps = defaultThemeProp;\n\nexport const StyledInventoryPageTitleWrapper = styled(Flex)(({ theme }) => {\n const {\n base: { 'content-width': contentWidth, spacing }\n } = theme;\n return css`\n max-width: ${contentWidth.xl};\n\n h1 {\n margin-inline-end: calc(${spacing} * 2);\n }\n `;\n});\n\nStyledInventoryPageTitleWrapper.defaultProps = defaultThemeProp;\n\n// overview page styles\nexport const StyledOverviewPage = styled.div`\n /* remove the default padding set by header */\n ${StyledPageHeader} {\n padding: 0;\n }\n\n ${StyledShowMoreLessButton} {\n max-width: fit-content;\n }\n`;\n\n// Construct page styles\nexport const StyledHeader = styled.div(({ theme }) => {\n return css`\n h1:focus-visible {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n `;\n});\n\nStyledHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTitleContainer = styled.div`\n width: calc(100% - 3rem);\n`;\n\nexport const StyledTextWithEllipsis: typeof Text = styled(Text)`\n display: block;\n ${ellipsisOverflow}\n`;\n\nexport const StyledText: typeof Text = styled(Text)<{ showEllipsis: boolean }>(({\n showEllipsis\n}) => {\n return css`\n width: 100%;\n white-space: nowrap;\n ${showEllipsis && ellipsisOverflow}\n `;\n});\n\nexport const StyledPrimaryMetaButton: typeof Button = styled(Button)(props => {\n const {\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, shadow },\n components: { text }\n }\n } = props;\n\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${fontSizes[text.h1['font-size'] as FontSize]};\n font-weight: ${text.h1['font-weight']};\n width: 100%;\n ${ellipsisOverflow}\n\n &:not([disabled]):focus {\n box-shadow: ${shadow['focus-inset']};\n }\n `;\n});\n\nStyledPrimaryMetaButton.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { MouseEvent, Ref } from 'react';
|
|
2
|
+
import type { BannerProps, OmitStrict, TestIdProp, ButtonProps, BaseProps, TabsProps, MenuItemProps, TestIdsRecord } from '@pega/cosmos-react-core';
|
|
3
|
+
import type { OneColumnPageProps, TabbedPageTab } from '@pega/cosmos-react-core/lib/components/PageTemplates/PageTemplates';
|
|
4
|
+
import type { IconTileProps } from '../IconTile';
|
|
5
|
+
import type { PageBannerProps } from './OverviewPageTemplate/PageBanner';
|
|
6
|
+
import { elements as pageHeaderElements } from './PageTemplates.test-ids';
|
|
7
|
+
export interface PageTemplateProps extends BaseProps, TestIdProp {
|
|
8
|
+
/** PropTypes for error banner inside Page Template. */
|
|
9
|
+
errorBanner?: Pick<BannerProps, 'variant' | 'onDismiss' | 'messages'>;
|
|
10
|
+
/** If true, disables all the action buttons on page header. */
|
|
11
|
+
progress?: boolean;
|
|
12
|
+
/** Ref to the Page Template. */
|
|
13
|
+
ref?: Ref<HTMLDivElement>;
|
|
14
|
+
}
|
|
15
|
+
type PageHeaderProps = {
|
|
16
|
+
/** The primary header text on the page header. */
|
|
17
|
+
title: string;
|
|
18
|
+
/** Description text for the page header and additional info dialog. */
|
|
19
|
+
description?: string;
|
|
20
|
+
};
|
|
21
|
+
export type HeaderActionItemProps = Pick<MenuItemProps, 'id' | 'onClick' | 'disabled' | 'primary'>;
|
|
22
|
+
export interface MetaFieldValueListProps {
|
|
23
|
+
id?: string;
|
|
24
|
+
name: string;
|
|
25
|
+
value?: string;
|
|
26
|
+
onClick?: (value: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface ActionButtonProps {
|
|
29
|
+
testIds: Partial<TestIdsRecord<typeof pageHeaderElements>>;
|
|
30
|
+
progress?: PageTemplateProps['progress'];
|
|
31
|
+
primaryAction?: HeaderActionItemProps & {
|
|
32
|
+
variant?: ButtonProps['variant'];
|
|
33
|
+
};
|
|
34
|
+
secondaryAction?: HeaderActionItemProps;
|
|
35
|
+
additionalActions?: HeaderActionItemProps[];
|
|
36
|
+
animatePrimaryButton?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface ConstructPageTemplateProps extends PageTemplateProps {
|
|
39
|
+
header: PageHeaderProps & {
|
|
40
|
+
/**
|
|
41
|
+
* Metadata for the Page Header and additional info dialog.
|
|
42
|
+
* Only First 4 items of metadata are rendered on page header.
|
|
43
|
+
*/
|
|
44
|
+
metadata?: {
|
|
45
|
+
/** Primary Metadata
|
|
46
|
+
* Primary Metadata highlights the important metadata for the user by staying next to the title
|
|
47
|
+
*/
|
|
48
|
+
primary?: MetaFieldValueListProps[];
|
|
49
|
+
/** Secondary Metadata
|
|
50
|
+
* Secondary Metadata highlights the next secondary meta information for the user by staying close to the action button
|
|
51
|
+
*/
|
|
52
|
+
secondary?: [MetaFieldValueListProps] | [MetaFieldValueListProps, MetaFieldValueListProps];
|
|
53
|
+
/** Additional Metadata
|
|
54
|
+
* All meta information for the user shown within the interaction of Info icon.
|
|
55
|
+
*/
|
|
56
|
+
additional: MetaFieldValueListProps[];
|
|
57
|
+
};
|
|
58
|
+
/** A visual associated with the page header. */
|
|
59
|
+
visual: OmitStrict<IconTileProps, 'size'>;
|
|
60
|
+
/** The type of the page content. */
|
|
61
|
+
type: {
|
|
62
|
+
name: string;
|
|
63
|
+
onClick?: (e?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
64
|
+
href?: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* PrimaryAction button on page header.
|
|
68
|
+
* If variant is set as primary, live log is triggered announcing the user about dirty changes state on the page. */
|
|
69
|
+
primaryAction?: HeaderActionItemProps & {
|
|
70
|
+
variant?: ButtonProps['variant'];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* SecondaryAction to the page header.
|
|
74
|
+
* Secondary Action button shifts inside the additionalActions based on screen width.
|
|
75
|
+
*/
|
|
76
|
+
secondaryAction?: HeaderActionItemProps;
|
|
77
|
+
/** A set of Action Buttons to render on the Action Menu button on page header. */
|
|
78
|
+
additionalActions?: HeaderActionItemProps[];
|
|
79
|
+
};
|
|
80
|
+
/** Props for tabbedpage component */
|
|
81
|
+
tabs: OmitStrict<TabsProps, 'tabs'> & {
|
|
82
|
+
tabs: TabbedPageTab[];
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface InventoryPageTemplateProps extends PageTemplateProps {
|
|
86
|
+
header: PageHeaderProps & {
|
|
87
|
+
/**
|
|
88
|
+
* PrimaryAction button on page header.
|
|
89
|
+
* If variant is set as primary, live log is triggered announcing the user about dirty changes state on the page. */
|
|
90
|
+
primaryAction?: HeaderActionItemProps & {
|
|
91
|
+
variant?: ButtonProps['variant'];
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* SecondaryAction to the page header.
|
|
95
|
+
* Secondary Action button shifts inside the additionalActions based on screen width.
|
|
96
|
+
*/
|
|
97
|
+
secondaryAction?: HeaderActionItemProps;
|
|
98
|
+
/** A set of Action Buttons to render on the Action Menu button on page header. */
|
|
99
|
+
additionalActions?: HeaderActionItemProps[];
|
|
100
|
+
};
|
|
101
|
+
content: OneColumnPageProps['a'];
|
|
102
|
+
}
|
|
103
|
+
export interface OverviewPageTemplateProps extends TestIdProp, BaseProps {
|
|
104
|
+
header: PageBannerProps;
|
|
105
|
+
content: OneColumnPageProps['a'];
|
|
106
|
+
ref?: Ref<HTMLDivElement>;
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=PageTemplate.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplate.types.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplate.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACd,MAAM,oEAAoE,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,MAAM,WAAW,iBAAkB,SAAQ,SAAS,EAAE,UAAU;IAC9D,uDAAuD;IACvD,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,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AE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACjC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplate.types.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplate.types.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["import type { MouseEvent, Ref } from 'react';\n\nimport type {\n BannerProps,\n OmitStrict,\n TestIdProp,\n ButtonProps,\n BaseProps,\n TabsProps,\n MenuItemProps,\n TestIdsRecord\n} from '@pega/cosmos-react-core';\nimport type {\n OneColumnPageProps,\n TabbedPageTab\n} from '@pega/cosmos-react-core/lib/components/PageTemplates/PageTemplates';\n\nimport type { IconTileProps } from '../IconTile';\n\nimport type { PageBannerProps } from './OverviewPageTemplate/PageBanner';\nimport { elements as pageHeaderElements } from './PageTemplates.test-ids';\n\nexport interface PageTemplateProps extends BaseProps, TestIdProp {\n /** PropTypes for error banner inside Page Template. */\n errorBanner?: Pick<BannerProps, 'variant' | 'onDismiss' | 'messages'>;\n /** If true, disables all the action buttons on page header. */\n progress?: boolean;\n /** Ref to the Page Template. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype PageHeaderProps = {\n /** The primary header text on the page header. */\n title: string;\n /** Description text for the page header and additional info dialog. */\n description?: string;\n};\n\nexport type HeaderActionItemProps = Pick<MenuItemProps, 'id' | 'onClick' | 'disabled' | 'primary'>;\n\nexport interface MetaFieldValueListProps {\n id?: string;\n name: string;\n value?: string;\n onClick?: (value: string) => void;\n}\n\nexport interface ActionButtonProps {\n testIds: Partial<TestIdsRecord<typeof pageHeaderElements>>;\n progress?: PageTemplateProps['progress'];\n primaryAction?: HeaderActionItemProps & {\n variant?: ButtonProps['variant'];\n };\n secondaryAction?: HeaderActionItemProps;\n additionalActions?: HeaderActionItemProps[];\n animatePrimaryButton?: boolean;\n}\n\nexport interface ConstructPageTemplateProps extends PageTemplateProps {\n header: PageHeaderProps & {\n /**\n * Metadata for the Page Header and additional info dialog.\n * Only First 4 items of metadata are rendered on page header.\n */\n metadata?: {\n /** Primary Metadata\n * Primary Metadata highlights the important metadata for the user by staying next to the title\n */\n primary?: MetaFieldValueListProps[];\n /** Secondary Metadata\n * Secondary Metadata highlights the next secondary meta information for the user by staying close to the action button\n */\n secondary?: [MetaFieldValueListProps] | [MetaFieldValueListProps, MetaFieldValueListProps];\n /** Additional Metadata\n * All meta information for the user shown within the interaction of Info icon.\n */\n additional: MetaFieldValueListProps[];\n };\n /** A visual associated with the page header. */\n visual: OmitStrict<IconTileProps, 'size'>;\n /** The type of the page content. */\n type: {\n name: string;\n onClick?: (e?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n href?: string;\n };\n /**\n * PrimaryAction button on page header.\n * If variant is set as primary, live log is triggered announcing the user about dirty changes state on the page. */\n primaryAction?: HeaderActionItemProps & {\n variant?: ButtonProps['variant'];\n };\n /**\n * SecondaryAction to the page header.\n * Secondary Action button shifts inside the additionalActions based on screen width.\n */\n secondaryAction?: HeaderActionItemProps;\n /** A set of Action Buttons to render on the Action Menu button on page header. */\n additionalActions?: HeaderActionItemProps[];\n };\n /** Props for tabbedpage component */\n tabs: OmitStrict<TabsProps, 'tabs'> & {\n tabs: TabbedPageTab[];\n };\n}\n\nexport interface InventoryPageTemplateProps extends PageTemplateProps {\n header: PageHeaderProps & {\n /**\n * PrimaryAction button on page header.\n * If variant is set as primary, live log is triggered announcing the user about dirty changes state on the page. */\n primaryAction?: HeaderActionItemProps & {\n variant?: ButtonProps['variant'];\n };\n /**\n * SecondaryAction to the page header.\n * Secondary Action button shifts inside the additionalActions based on screen width.\n */\n secondaryAction?: HeaderActionItemProps;\n /** A set of Action Buttons to render on the Action Menu button on page header. */\n additionalActions?: HeaderActionItemProps[];\n };\n content: OneColumnPageProps['a'];\n}\n\nexport interface OverviewPageTemplateProps extends TestIdProp, BaseProps {\n header: PageBannerProps;\n content: OneColumnPageProps['a'];\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import type { MouseEvent } from 'react';
|
|
2
|
-
import type { OneColumnPageProps as CoreOneColumnPageProps, TabbedPageProps as CoreTabbedPageProps, FieldValueListProps,
|
|
3
|
-
export interface
|
|
2
|
+
import type { OneColumnPageProps as CoreOneColumnPageProps, TabbedPageProps as CoreTabbedPageProps, FieldValueListProps, PageTemplateProps, OmitStrict, StatusProps, TestIdProp, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface AdditionalInfoProps extends TestIdProp {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
fields: FieldValueListProps['fields'];
|
|
7
|
+
onEdit?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface PageHeaderProps extends Pick<PageTemplateProps, 'title' | 'actions'>, TestIdProp {
|
|
4
10
|
metadata?: FieldValueListProps['fields'];
|
|
5
11
|
status?: {
|
|
6
12
|
type: StatusProps['variant'];
|
|
7
13
|
label: string;
|
|
8
14
|
};
|
|
9
15
|
titleTag?: 'h1' | 'h2';
|
|
10
|
-
additionalInfo?:
|
|
11
|
-
title: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
fields: FieldValueListProps['fields'];
|
|
14
|
-
onEdit?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
15
|
-
};
|
|
16
|
+
additionalInfo?: AdditionalInfoProps;
|
|
16
17
|
}
|
|
17
18
|
type OmittedPageProps = 'header' | 'scrollContent';
|
|
18
|
-
export interface OneColumnPageProps extends OmitStrict<CoreOneColumnPageProps, OmittedPageProps>, PageHeaderProps {
|
|
19
|
+
export interface OneColumnPageProps extends OmitStrict<CoreOneColumnPageProps, OmittedPageProps>, PageHeaderProps, TestIdProp {
|
|
19
20
|
}
|
|
20
|
-
export interface TabbedPageProps extends OmitStrict<CoreTabbedPageProps, OmittedPageProps>, PageHeaderProps {
|
|
21
|
+
export interface TabbedPageProps extends OmitStrict<CoreTabbedPageProps, OmittedPageProps>, PageHeaderProps, TestIdProp {
|
|
21
22
|
}
|
|
22
23
|
export declare const StyledPage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
-
export declare const PageHeader: ({ title, metadata, additionalInfo, actions, status, titleTag }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const PageHeader: ({ testId, title, metadata, additionalInfo, actions, status, titleTag }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export declare const TabbedPage: ForwardRefForwardPropsComponent<TabbedPageProps>;
|
|
25
26
|
export declare const OneColumnPage: ForwardRefForwardPropsComponent<OneColumnPageProps>;
|
|
26
|
-
|
|
27
|
+
declare const _default: (({ testId, title, metadata, additionalInfo, actions, status, titleTag }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
28
|
+
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["title", "status", "edit-details", "additional-info-icon", "type", "meta-data", "primary-meta-data", "secondary-meta-data", "visual", "primary-action", "secondary-action", "additional-actions", "banner-description", "banner-link", "banner-actions", "banner-image"]>;
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
27
31
|
//# sourceMappingURL=PageTemplates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageTemplates.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PageTemplates.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,UAAU,EAAE,MAAM,OAAO,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AAM,aAAa,EAAE,+BAA+B,CAAC,kBAAkB,CAoB7E,CAAC;kGA/GC,eAAe;;;AAiHlB,wBAA6D"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useMemo, useRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { OneColumnPage as CoreOneColumnPage, TabbedPage as CoreTabbedPage, Flex, Status, SummaryItem, Text, Button, Popover, FieldValueList, defaultThemeProp, useI18n, StyledSummaryItemActions,
|
|
5
|
-
import * as nodesDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/nodes-down.icon';
|
|
6
|
-
import * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';
|
|
4
|
+
import { OneColumnPage as CoreOneColumnPage, TabbedPage as CoreTabbedPage, Flex, Status, SummaryItem, Text, Button, Popover, FieldValueList, defaultThemeProp, useI18n, StyledSummaryItemActions, StyledRegion, MetaList, StyledBreadcrumbs, StyledPageHeader, AdditionalInfo, useTestIds, withTestIds, useElement, Tooltip } from '@pega/cosmos-react-core';
|
|
7
5
|
import { StyledForm } from '@pega/cosmos-react-core/lib/components/MultiStepForm/MultiStepForm';
|
|
8
6
|
import { StyledBanner } from '@pega/cosmos-react-core/lib/components/Banner/Banner';
|
|
9
7
|
import { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';
|
|
10
8
|
import { StyledWorkbench } from '../Workbench/Workbench.styles';
|
|
11
|
-
|
|
9
|
+
import { getPageHeaderTestIds } from './PageTemplates.test-ids';
|
|
12
10
|
const StyledTextWithEllipsis = styled(Text) `
|
|
13
11
|
overflow: hidden;
|
|
14
12
|
white-space: nowrap;
|
|
@@ -54,14 +52,16 @@ export const StyledPage = styled.div(({ theme: { base: { spacing, palette: { 'pr
|
|
|
54
52
|
`;
|
|
55
53
|
});
|
|
56
54
|
StyledPage.defaultProps = defaultThemeProp;
|
|
57
|
-
export const PageHeader = ({ title, metadata, additionalInfo, actions, status, titleTag }) => {
|
|
55
|
+
export const PageHeader = ({ testId, title, metadata, additionalInfo, actions, status, titleTag }) => {
|
|
58
56
|
const t = useI18n();
|
|
57
|
+
const [el, setEl] = useElement();
|
|
58
|
+
const testIds = useTestIds(testId, getPageHeaderTestIds);
|
|
59
59
|
const metaListItems = useMemo(() => metadata?.map(({ name, value }) => `${name}: ${value}`), [metadata]);
|
|
60
60
|
const infoDialogHandle = useRef(null);
|
|
61
|
-
return (_jsx(StyledHeaderContent, { container: true, primary: _jsxs(Flex, { container: { alignItems: 'center', gap: 0.5, wrap: 'wrap' }, children: [_jsxs(Flex, { container: { gap: 0.5, alignItems: 'end' }, item: { shrink: 0 }, children: [_jsx(StyledTextWithEllipsis, { variant: 'h1',
|
|
61
|
+
return (_jsx(StyledHeaderContent, { testId: testId, container: true, primary: _jsxs(Flex, { container: { alignItems: 'center', gap: 0.5, wrap: 'wrap' }, children: [_jsxs(Flex, { container: { gap: 0.5, alignItems: 'end' }, item: { shrink: 0 }, children: [_jsx(StyledTextWithEllipsis, { "data-testid": testIds.title, variant: 'h1', as: titleTag, ref: setEl, children: title }), el && (_jsx(Tooltip, { target: el, smart: true, showDelay: 'none', hideDelay: 'none', children: title })), additionalInfo && (_jsx(AdditionalInfo, { "data-testid": additionalInfo.testId, heading: additionalInfo.title, dialogHandle: infoDialogHandle, children: _jsxs(Flex, { container: { direction: 'column', alignItems: 'start', gap: 2 }, children: [_jsxs(Flex, { container: { direction: 'column', gap: 1 }, item: { grow: 1, alignSelf: 'stretch' }, children: [additionalInfo.description && _jsx(Text, { as: 'p', children: additionalInfo.description }), _jsx(FieldValueList, { variant: 'inline', fields: additionalInfo.fields })] }), additionalInfo.onEdit && (_jsx(Button, { "data-testid": testIds.editDetails, onClick: (e) => {
|
|
62
62
|
infoDialogHandle.current?.close();
|
|
63
63
|
additionalInfo.onEdit?.(e);
|
|
64
|
-
}, children: t('edit_details') }))] }) }))] }), status && _jsx(Status, { variant: status.type, children: status.label })] }), secondary: metaListItems && _jsx(MetaList, { items: metaListItems }), actions: actions }));
|
|
64
|
+
}, children: t('edit_details') }))] }) }))] }), status && (_jsx(Status, { "data-testid": testIds.status, variant: status.type, children: status.label }))] }), secondary: metaListItems && _jsx(MetaList, { items: metaListItems }), actions: actions }));
|
|
65
65
|
};
|
|
66
66
|
export const TabbedPage = forwardRef(function TabbedPage({ tabs, ...restProps }, ref) {
|
|
67
67
|
return (_jsx(CoreTabbedPage, { ...restProps, as: StyledPage, header: _jsx(PageHeader, { ...restProps }), tabs: tabs, ref: ref, scrollContent: true }));
|
|
@@ -69,4 +69,5 @@ export const TabbedPage = forwardRef(function TabbedPage({ tabs, ...restProps },
|
|
|
69
69
|
export const OneColumnPage = forwardRef(function OneColumnPage({ a, ...restProps }, ref) {
|
|
70
70
|
return (_jsx(CoreOneColumnPage, { ...restProps, as: StyledPage, header: _jsx(PageHeader, { ...restProps }), scrollContent: true, a: a, ref: ref }));
|
|
71
71
|
});
|
|
72
|
+
export default withTestIds(PageHeader, getPageHeaderTestIds);
|
|
72
73
|
//# sourceMappingURL=PageTemplates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageTemplates.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,UAAU,IAAI,cAAc,EAC5B,IAAI,EACJ,MAAM,EACN,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,wBAAwB,EACxB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EACh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Z,SAAS,EACb,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,KAAC,UAAU,OAAK,SAAS,GAAI,EACrC,aAAa,QACb,CAAC,EAAE,CAAC,EACJ,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef, useMemo, useRef } from 'react';\nimport type { PropsWithoutRef, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n OneColumnPage as CoreOneColumnPage,\n TabbedPage as CoreTabbedPage,\n Flex,\n Status,\n SummaryItem,\n Text,\n Button,\n Popover,\n FieldValueList,\n defaultThemeProp,\n useI18n,\n StyledSummaryItemActions,\n registerIcon,\n StyledRegion,\n MetaList,\n StyledBreadcrumbs,\n StyledPageHeader,\n AdditionalInfo\n} from '@pega/cosmos-react-core';\nimport type {\n OneColumnPageProps as CoreOneColumnPageProps,\n TabbedPageProps as CoreTabbedPageProps,\n FieldValueListProps,\n ForwardRefForwardPropsComponent,\n PageTemplateProps,\n OmitStrict,\n StatusProps,\n DialogHandleValue\n} from '@pega/cosmos-react-core';\nimport * as nodesDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/nodes-down.icon';\nimport * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';\nimport { StyledForm } from '@pega/cosmos-react-core/lib/components/MultiStepForm/MultiStepForm';\nimport { StyledBanner } from '@pega/cosmos-react-core/lib/components/Banner/Banner';\nimport { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';\n\nimport { StyledWorkbench } from '../Workbench/Workbench.styles';\n\nregisterIcon(nodesDownIcon, informationIcon);\n\nexport interface PageHeaderProps extends Pick<PageTemplateProps, 'title' | 'actions'> {\n metadata?: FieldValueListProps['fields'];\n status?: { type: StatusProps['variant']; label: string };\n titleTag?: 'h1' | 'h2';\n additionalInfo?: {\n title: string;\n description?: string;\n fields: FieldValueListProps['fields'];\n onEdit?: (e: MouseEvent<HTMLButtonElement>) => void;\n };\n}\n\ntype OmittedPageProps = 'header' | 'scrollContent';\n\nexport interface OneColumnPageProps\n extends OmitStrict<CoreOneColumnPageProps, OmittedPageProps>,\n PageHeaderProps {}\n\nexport interface TabbedPageProps\n extends OmitStrict<CoreTabbedPageProps, OmittedPageProps>,\n PageHeaderProps {}\n\nconst StyledTextWithEllipsis: typeof Text = styled(Text)`\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n line-height: 1.15;\n`;\n\nconst StyledInfoPopover = styled(Popover)(({\n theme: {\n base: { 'content-width': contentWidth }\n }\n}) => {\n return css`\n min-width: ${contentWidth.sm};\n max-width: ${contentWidth.md};\n overflow-wrap: break-word;\n `;\n});\n\nStyledInfoPopover.defaultProps = defaultThemeProp;\n\nconst StyledHeaderContent = styled(SummaryItem)`\n ${StyledSummaryItemActions} {\n align-self: start;\n }\n`;\n\nexport const StyledPage = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'primary-background': primaryBackground }\n }\n }\n }) => {\n return css`\n background: ${primaryBackground};\n height: 100%;\n\n ${StyledBanner},\n ${StyledTabs} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n ${StyledRegion} ${StyledWorkbench} {\n position: absolute;\n width: 100%;\n margin: 0 calc(-2 * ${spacing});\n }\n\n ${StyledRegion} ${StyledForm} {\n max-width: 80ch;\n }\n\n ${StyledPageHeader} > ${StyledBreadcrumbs} {\n margin-block-end: 0;\n }\n `;\n }\n);\n\nStyledPage.defaultProps = defaultThemeProp;\n\nexport const PageHeader = ({\n title,\n metadata,\n additionalInfo,\n actions,\n status,\n titleTag\n}: PageHeaderProps) => {\n const t = useI18n();\n\n const metaListItems = useMemo(\n () => metadata?.map(({ name, value }) => `${name}: ${value}`),\n [metadata]\n );\n\n const infoDialogHandle = useRef<DialogHandleValue>(null);\n\n return (\n <StyledHeaderContent\n container\n primary={\n <Flex container={{ alignItems: 'center', gap: 0.5, wrap: 'wrap' }}>\n <Flex container={{ gap: 0.5, alignItems: 'end' }} item={{ shrink: 0 }}>\n <StyledTextWithEllipsis variant='h1' forwardedAs={titleTag}>\n {title}\n </StyledTextWithEllipsis>\n {additionalInfo && (\n <AdditionalInfo heading={additionalInfo.title} dialogHandle={infoDialogHandle}>\n <Flex container={{ direction: 'column', alignItems: 'start', gap: 2 }}>\n <Flex\n container={{ direction: 'column', gap: 1 }}\n item={{ grow: 1, alignSelf: 'stretch' }}\n >\n {additionalInfo.description && <Text as='p'>{additionalInfo.description}</Text>}\n <FieldValueList variant='inline' fields={additionalInfo.fields} />\n </Flex>\n {additionalInfo.onEdit && (\n <Button\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n infoDialogHandle.current?.close();\n additionalInfo.onEdit?.(e);\n }}\n >\n {t('edit_details')}\n </Button>\n )}\n </Flex>\n </AdditionalInfo>\n )}\n </Flex>\n {status && <Status variant={status.type}>{status.label}</Status>}\n </Flex>\n }\n secondary={metaListItems && <MetaList items={metaListItems} />}\n actions={actions}\n />\n );\n};\n\nexport const TabbedPage: ForwardRefForwardPropsComponent<TabbedPageProps> = forwardRef(\n function TabbedPage(\n { tabs, ...restProps }: PropsWithoutRef<TabbedPageProps>,\n ref: TabbedPageProps['ref']\n ) {\n return (\n <CoreTabbedPage\n {...restProps}\n as={StyledPage}\n header={<PageHeader {...restProps} />}\n tabs={tabs}\n ref={ref}\n scrollContent\n />\n );\n }\n);\n\nexport const OneColumnPage: ForwardRefForwardPropsComponent<OneColumnPageProps> = forwardRef(\n function OneColumnPage(\n {\n a,\n\n ...restProps\n }: PropsWithoutRef<OneColumnPageProps>,\n ref: OneColumnPageProps['ref']\n ) {\n return (\n <CoreOneColumnPage\n {...restProps}\n as={StyledPage}\n header={<PageHeader {...restProps} />}\n scrollContent\n a={a}\n ref={ref}\n />\n );\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"PageTemplates.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,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,IACI,EACN,MAAM,IAAI,CACT,KAAC,MAAM,mBAAc,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,YACtD,MAAM,CAAC,KAAK,GACN,CACV,IACI,EAET,SAAS,EAAE,aAAa,IAAI,KAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,GAAI,EAC9D,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAqD,UAAU,CACpF,SAAS,UAAU,CACjB,EAAE,IAAI,EAAE,GAAG,SAAS,EAAoC,EACxD,GAA2B;IAE3B,OAAO,CACL,KAAC,cAAc,OACT,SAAS,EACb,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,KAAC,UAAU,OAAK,SAAS,GAAI,EACrC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,aAAa,SACb,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAwD,UAAU,CAC1F,SAAS,aAAa,CACpB,EACE,CAAC,EAED,GAAG,SAAS,EACwB,EACtC,GAA8B;IAE9B,OAAO,CACL,KAAC,iBAAiB,OACZ,SAAS,EACb,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,KAAC,UAAU,OAAK,SAAS,GAAI,EACrC,aAAa,QACb,CAAC,EAAE,CAAC,EACJ,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { forwardRef, useMemo, useRef } from 'react';\nimport type { PropsWithoutRef, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n OneColumnPage as CoreOneColumnPage,\n TabbedPage as CoreTabbedPage,\n Flex,\n Status,\n SummaryItem,\n Text,\n Button,\n Popover,\n FieldValueList,\n defaultThemeProp,\n useI18n,\n StyledSummaryItemActions,\n StyledRegion,\n MetaList,\n StyledBreadcrumbs,\n StyledPageHeader,\n AdditionalInfo,\n useTestIds,\n withTestIds,\n useElement,\n Tooltip\n} from '@pega/cosmos-react-core';\nimport type {\n OneColumnPageProps as CoreOneColumnPageProps,\n TabbedPageProps as CoreTabbedPageProps,\n FieldValueListProps,\n PageTemplateProps,\n OmitStrict,\n StatusProps,\n DialogHandleValue,\n TestIdProp,\n ForwardRefForwardPropsComponent\n} from '@pega/cosmos-react-core';\nimport { StyledForm } from '@pega/cosmos-react-core/lib/components/MultiStepForm/MultiStepForm';\nimport { StyledBanner } from '@pega/cosmos-react-core/lib/components/Banner/Banner';\nimport { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';\n\nimport { StyledWorkbench } from '../Workbench/Workbench.styles';\n\nimport { getPageHeaderTestIds } from './PageTemplates.test-ids';\n\nexport interface AdditionalInfoProps extends TestIdProp {\n title: string;\n description?: string;\n fields: FieldValueListProps['fields'];\n onEdit?: (e: MouseEvent<HTMLButtonElement>) => void;\n}\nexport interface PageHeaderProps extends Pick<PageTemplateProps, 'title' | 'actions'>, TestIdProp {\n metadata?: FieldValueListProps['fields'];\n status?: { type: StatusProps['variant']; label: string };\n titleTag?: 'h1' | 'h2';\n additionalInfo?: AdditionalInfoProps;\n}\n\ntype OmittedPageProps = 'header' | 'scrollContent';\n\nexport interface OneColumnPageProps\n extends OmitStrict<CoreOneColumnPageProps, OmittedPageProps>,\n PageHeaderProps,\n TestIdProp {}\n\nexport interface TabbedPageProps\n extends OmitStrict<CoreTabbedPageProps, OmittedPageProps>,\n PageHeaderProps,\n TestIdProp {}\n\nconst StyledTextWithEllipsis: typeof Text = styled(Text)`\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n line-height: 1.15;\n`;\n\nconst StyledInfoPopover = styled(Popover)(({\n theme: {\n base: { 'content-width': contentWidth }\n }\n}) => {\n return css`\n min-width: ${contentWidth.sm};\n max-width: ${contentWidth.md};\n overflow-wrap: break-word;\n `;\n});\n\nStyledInfoPopover.defaultProps = defaultThemeProp;\n\nconst StyledHeaderContent = styled(SummaryItem)`\n ${StyledSummaryItemActions} {\n align-self: start;\n }\n`;\n\nexport const StyledPage = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'primary-background': primaryBackground }\n }\n }\n }) => {\n return css`\n background: ${primaryBackground};\n height: 100%;\n\n ${StyledBanner},\n ${StyledTabs} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n ${StyledRegion} ${StyledWorkbench} {\n position: absolute;\n width: 100%;\n margin: 0 calc(-2 * ${spacing});\n }\n\n ${StyledRegion} ${StyledForm} {\n max-width: 80ch;\n }\n\n ${StyledPageHeader} > ${StyledBreadcrumbs} {\n margin-block-end: 0;\n }\n `;\n }\n);\n\nStyledPage.defaultProps = defaultThemeProp;\n\nexport const PageHeader = ({\n testId,\n title,\n metadata,\n additionalInfo,\n actions,\n status,\n titleTag\n}: PageHeaderProps) => {\n const t = useI18n();\n const [el, setEl] = useElement();\n const testIds = useTestIds(testId, getPageHeaderTestIds);\n const metaListItems = useMemo(\n () => metadata?.map(({ name, value }) => `${name}: ${value}`),\n [metadata]\n );\n\n const infoDialogHandle = useRef<DialogHandleValue>(null);\n\n return (\n <StyledHeaderContent\n testId={testId}\n container\n primary={\n <Flex container={{ alignItems: 'center', gap: 0.5, wrap: 'wrap' }}>\n <Flex container={{ gap: 0.5, alignItems: 'end' }} item={{ shrink: 0 }}>\n <StyledTextWithEllipsis\n data-testid={testIds.title}\n variant='h1'\n as={titleTag}\n ref={setEl}\n >\n {title}\n </StyledTextWithEllipsis>\n {el && (\n <Tooltip target={el} smart showDelay='none' hideDelay='none'>\n {title}\n </Tooltip>\n )}\n {additionalInfo && (\n <AdditionalInfo\n data-testid={additionalInfo.testId}\n heading={additionalInfo.title}\n dialogHandle={infoDialogHandle}\n >\n <Flex container={{ direction: 'column', alignItems: 'start', gap: 2 }}>\n <Flex\n container={{ direction: 'column', gap: 1 }}\n item={{ grow: 1, alignSelf: 'stretch' }}\n >\n {additionalInfo.description && <Text as='p'>{additionalInfo.description}</Text>}\n <FieldValueList variant='inline' fields={additionalInfo.fields} />\n </Flex>\n {additionalInfo.onEdit && (\n <Button\n data-testid={testIds.editDetails}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n infoDialogHandle.current?.close();\n additionalInfo.onEdit?.(e);\n }}\n >\n {t('edit_details')}\n </Button>\n )}\n </Flex>\n </AdditionalInfo>\n )}\n </Flex>\n {status && (\n <Status data-testid={testIds.status} variant={status.type}>\n {status.label}\n </Status>\n )}\n </Flex>\n }\n secondary={metaListItems && <MetaList items={metaListItems} />}\n actions={actions}\n />\n );\n};\n\nexport const TabbedPage: ForwardRefForwardPropsComponent<TabbedPageProps> = forwardRef(\n function TabbedPage(\n { tabs, ...restProps }: PropsWithoutRef<TabbedPageProps>,\n ref: TabbedPageProps['ref']\n ) {\n return (\n <CoreTabbedPage\n {...restProps}\n as={StyledPage}\n header={<PageHeader {...restProps} />}\n tabs={tabs}\n ref={ref}\n scrollContent\n />\n );\n }\n);\n\nexport const OneColumnPage: ForwardRefForwardPropsComponent<OneColumnPageProps> = forwardRef(\n function OneColumnPage(\n {\n a,\n\n ...restProps\n }: PropsWithoutRef<OneColumnPageProps>,\n ref: OneColumnPageProps['ref']\n ) {\n return (\n <CoreOneColumnPage\n {...restProps}\n as={StyledPage}\n header={<PageHeader {...restProps} />}\n scrollContent\n a={a}\n ref={ref}\n />\n );\n }\n);\n\nexport default withTestIds(PageHeader, getPageHeaderTestIds);\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const elements: readonly ["title", "status", "edit-details", "additional-info-icon", "type", "meta-data", "primary-meta-data", "secondary-meta-data", "visual", "primary-action", "secondary-action", "additional-actions", "banner-description", "banner-link", "banner-actions", "banner-image"];
|
|
2
|
+
export declare const getPageHeaderTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["title", "status", "edit-details", "additional-info-icon", "type", "meta-data", "primary-meta-data", "secondary-meta-data", "visual", "primary-action", "secondary-action", "additional-actions", "banner-description", "banner-link", "banner-actions", "banner-image"]>;
|
|
3
|
+
export declare const getGalleryPageEmptyStateTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description"]>;
|
|
4
|
+
//# sourceMappingURL=PageTemplates.test-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplates.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,oRAiBX,CAAC;AAEX,eAAO,MAAM,oBAAoB,8YAAyC,CAAC;AAE3E,eAAO,MAAM,+BAA+B,+JAGjC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createTestIds } from '@pega/cosmos-react-core';
|
|
2
|
+
export const elements = [
|
|
3
|
+
'title',
|
|
4
|
+
'status',
|
|
5
|
+
'edit-details',
|
|
6
|
+
'additional-info-icon',
|
|
7
|
+
'type',
|
|
8
|
+
'meta-data',
|
|
9
|
+
'primary-meta-data',
|
|
10
|
+
'secondary-meta-data',
|
|
11
|
+
'visual',
|
|
12
|
+
'primary-action',
|
|
13
|
+
'secondary-action',
|
|
14
|
+
'additional-actions',
|
|
15
|
+
'banner-description',
|
|
16
|
+
'banner-link',
|
|
17
|
+
'banner-actions',
|
|
18
|
+
'banner-image'
|
|
19
|
+
];
|
|
20
|
+
export const getPageHeaderTestIds = createTestIds('page-header', elements);
|
|
21
|
+
export const getGalleryPageEmptyStateTestIds = createTestIds('gallery-page-empty-state', [
|
|
22
|
+
'heading',
|
|
23
|
+
'description'
|
|
24
|
+
]);
|
|
25
|
+
//# sourceMappingURL=PageTemplates.test-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplates.test-ids.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO;IACP,QAAQ;IACR,cAAc;IACd,sBAAsB;IACtB,MAAM;IACN,WAAW;IACX,mBAAmB;IACnB,qBAAqB;IACrB,QAAQ;IACR,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;IACpB,oBAAoB;IACpB,aAAa;IACb,gBAAgB;IAChB,cAAc;CACN,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,+BAA+B,GAAG,aAAa,CAAC,0BAA0B,EAAE;IACvF,SAAS;IACT,aAAa;CACL,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const elements = [\n 'title',\n 'status',\n 'edit-details',\n 'additional-info-icon',\n 'type',\n 'meta-data',\n 'primary-meta-data',\n 'secondary-meta-data',\n 'visual',\n 'primary-action',\n 'secondary-action',\n 'additional-actions',\n 'banner-description',\n 'banner-link',\n 'banner-actions',\n 'banner-image'\n] as const;\n\nexport const getPageHeaderTestIds = createTestIds('page-header', elements);\n\nexport const getGalleryPageEmptyStateTestIds = createTestIds('gallery-page-empty-state', [\n 'heading',\n 'description'\n] as const);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Ref, ReactNode } from 'react';
|
|
2
|
-
import type { NoChildrenProp } from '@pega/cosmos-react-core';
|
|
2
|
+
import type { NoChildrenProp, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PageBannerProps } from '../PageBanner';
|
|
4
4
|
export interface ShowcasePageProps extends NoChildrenProp, PageBannerProps {
|
|
5
5
|
/** Content to render in the main region of the page. */
|
|
@@ -11,6 +11,6 @@ export interface ShowcasePageProps extends NoChildrenProp, PageBannerProps {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const StyledShowcasePage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
13
13
|
export declare const StyledContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
14
|
-
declare const ShowcasePage:
|
|
14
|
+
declare const ShowcasePage: ForwardRefForwardPropsComponent<ShowcasePageProps>;
|
|
15
15
|
export default ShowcasePage;
|
|
16
16
|
//# sourceMappingURL=ShowcasePage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowcasePage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/ShowcasePage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ShowcasePage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/ShowcasePage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAC;AAS7D,OAAO,KAAK,EAAE,cAAc,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAG/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,iBAAkB,SAAQ,cAAc,EAAE,eAAe;IACxE,wDAAwD;IACxD,OAAO,EAAE,SAAS,CAAC;IACnB,uEAAuE;IACvE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,yGAE9B,CAAC;AAEF,eAAO,MAAM,aAAa,yGAAe,CAAC;AAE1C,QAAA,MAAM,YAAY,EAAE,+BAA+B,CAAC,iBAAiB,CA+CpE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|