@pega/cosmos-react-wss 5.0.0-dev.4.7 → 5.0.0-dev.4.9
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/package.json +4 -4
- package/lib/components/AppShell/AppShell.d.ts +0 -6
- package/lib/components/AppShell/AppShell.d.ts.map +0 -1
- package/lib/components/AppShell/AppShell.js +0 -127
- package/lib/components/AppShell/AppShell.js.map +0 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +0 -39
- package/lib/components/AppShell/AppShell.styles.d.ts.map +0 -1
- package/lib/components/AppShell/AppShell.styles.js +0 -302
- package/lib/components/AppShell/AppShell.styles.js.map +0 -1
- package/lib/components/AppShell/AppShell.types.d.ts +0 -96
- package/lib/components/AppShell/AppShell.types.d.ts.map +0 -1
- package/lib/components/AppShell/AppShell.types.js +0 -2
- package/lib/components/AppShell/AppShell.types.js.map +0 -1
- package/lib/components/AppShell/MobileHeaderContent.d.ts +0 -11
- package/lib/components/AppShell/MobileHeaderContent.d.ts.map +0 -1
- package/lib/components/AppShell/MobileHeaderContent.js +0 -9
- package/lib/components/AppShell/MobileHeaderContent.js.map +0 -1
- package/lib/components/AppShell/NavLinks.d.ts +0 -11
- package/lib/components/AppShell/NavLinks.d.ts.map +0 -1
- package/lib/components/AppShell/NavLinks.js +0 -15
- package/lib/components/AppShell/NavLinks.js.map +0 -1
- package/lib/components/AppShell/Notifications.d.ts +0 -9
- package/lib/components/AppShell/Notifications.d.ts.map +0 -1
- package/lib/components/AppShell/Notifications.js +0 -18
- package/lib/components/AppShell/Notifications.js.map +0 -1
- package/lib/components/AppShell/index.d.ts +0 -3
- package/lib/components/AppShell/index.d.ts.map +0 -1
- package/lib/components/AppShell/index.js +0 -2
- package/lib/components/AppShell/index.js.map +0 -1
- package/lib/components/CaseView/CaseView.d.ts +0 -6
- package/lib/components/CaseView/CaseView.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.js +0 -35
- package/lib/components/CaseView/CaseView.js.map +0 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +0 -5
- package/lib/components/CaseView/CaseView.styles.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.styles.js +0 -49
- package/lib/components/CaseView/CaseView.styles.js.map +0 -1
- package/lib/components/CaseView/CaseView.types.d.ts +0 -25
- package/lib/components/CaseView/CaseView.types.d.ts.map +0 -1
- package/lib/components/CaseView/CaseView.types.js +0 -2
- package/lib/components/CaseView/CaseView.types.js.map +0 -1
- package/lib/components/CaseView/index.d.ts +0 -3
- package/lib/components/CaseView/index.d.ts.map +0 -1
- package/lib/components/CaseView/index.js +0 -2
- package/lib/components/CaseView/index.js.map +0 -1
- package/lib/components/PageTemplates/BannerPage.d.ts +0 -36
- package/lib/components/PageTemplates/BannerPage.d.ts.map +0 -1
- package/lib/components/PageTemplates/BannerPage.js +0 -70
- package/lib/components/PageTemplates/BannerPage.js.map +0 -1
- package/lib/components/PageTemplates/index.d.ts +0 -3
- package/lib/components/PageTemplates/index.d.ts.map +0 -1
- package/lib/components/PageTemplates/index.js +0 -2
- package/lib/components/PageTemplates/index.js.map +0 -1
- package/lib/components/QuickCreate/QuickCreate.d.ts +0 -17
- package/lib/components/QuickCreate/QuickCreate.d.ts.map +0 -1
- package/lib/components/QuickCreate/QuickCreate.js +0 -43
- package/lib/components/QuickCreate/QuickCreate.js.map +0 -1
- package/lib/components/QuickCreate/index.d.ts +0 -3
- package/lib/components/QuickCreate/index.d.ts.map +0 -1
- package/lib/components/QuickCreate/index.js +0 -2
- package/lib/components/QuickCreate/index.js.map +0 -1
- package/lib/index.d.ts +0 -8
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -9
- package/lib/index.js.map +0 -1
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode, Ref } from 'react';
|
|
2
|
-
import { AvatarProps, BaseProps, ImageProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
-
import { ContextSwitcherProps, NavListItemProps } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.types';
|
|
4
|
-
export type InteractionEvent = MouseEvent | KeyboardEvent;
|
|
5
|
-
interface AppInfoProps {
|
|
6
|
-
/** Name of the application. */
|
|
7
|
-
appName: string;
|
|
8
|
-
/** URL source of the logo image. */
|
|
9
|
-
imageSrc: ImageProps['src'];
|
|
10
|
-
/** URL or DOM id to navigate to from the logo and appName. */
|
|
11
|
-
href?: string;
|
|
12
|
-
/** Click handler for the logo and appName. */
|
|
13
|
-
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
14
|
-
/** Specifies where to open the link href. */
|
|
15
|
-
target?: string;
|
|
16
|
-
}
|
|
17
|
-
interface NavLinkProps {
|
|
18
|
-
/** Unique id for the link */
|
|
19
|
-
id: string;
|
|
20
|
-
/** Text that is displayed for the link. */
|
|
21
|
-
text: string;
|
|
22
|
-
/** URL or DOM id to navigate to. */
|
|
23
|
-
href: string;
|
|
24
|
-
/** Click handler for the link. */
|
|
25
|
-
onClick?: (e: InteractionEvent) => void;
|
|
26
|
-
/** Indicates if the link represents the current view within the app. */
|
|
27
|
-
current?: boolean;
|
|
28
|
-
}
|
|
29
|
-
interface OperatorProps {
|
|
30
|
-
/** Props for constructing the operator avatar. */
|
|
31
|
-
avatar: AvatarProps;
|
|
32
|
-
/** The title of the operator menu. */
|
|
33
|
-
title: string;
|
|
34
|
-
/** A list of actions that will populate a menu attached to the operator. */
|
|
35
|
-
actions: Pick<NavListItemProps, 'id' | 'primary' | 'href' | 'onClick' | 'visual'>[];
|
|
36
|
-
}
|
|
37
|
-
export interface NotificationItem {
|
|
38
|
-
/** An id representing the item. */
|
|
39
|
-
id: string;
|
|
40
|
-
/** The primary text for the item. */
|
|
41
|
-
primary: string;
|
|
42
|
-
/** Secondary text that will be rendered as a Meta List. */
|
|
43
|
-
secondary?: string[];
|
|
44
|
-
/** A visual associated with the item. */
|
|
45
|
-
visual?: ReactNode;
|
|
46
|
-
/** A flag indicating if the item has been read. */
|
|
47
|
-
unread?: boolean;
|
|
48
|
-
/** URL or DOM id to navigate to. */
|
|
49
|
-
href?: string;
|
|
50
|
-
/** The onClick handler for the item. */
|
|
51
|
-
onClick?: (event: InteractionEvent) => void;
|
|
52
|
-
}
|
|
53
|
-
export interface NotificationProps {
|
|
54
|
-
/** The title of the notifications view. */
|
|
55
|
-
title: string;
|
|
56
|
-
/** The number of new notifications. */
|
|
57
|
-
count: number;
|
|
58
|
-
/** A list of notification items. */
|
|
59
|
-
items: NotificationItem[];
|
|
60
|
-
/** If true, a loading indicator will render in place of the list. */
|
|
61
|
-
loading?: boolean;
|
|
62
|
-
/** Click event for items within the list. */
|
|
63
|
-
onItemClick?: (id: string, event: InteractionEvent) => void;
|
|
64
|
-
/** Callback that fires when the notification view opens. */
|
|
65
|
-
onNotificationsOpen?: () => void;
|
|
66
|
-
/** Callback that fires when the notification view closes. */
|
|
67
|
-
onNotificationsClose?: () => void;
|
|
68
|
-
}
|
|
69
|
-
export interface AppShellProps extends BaseProps, NoChildrenProp {
|
|
70
|
-
/** The content of the application. */
|
|
71
|
-
main: ReactNode;
|
|
72
|
-
/** Props related to the app name and logo. */
|
|
73
|
-
appInfo: AppInfoProps;
|
|
74
|
-
/** Context manager configuration. */
|
|
75
|
-
contextSwitcher?: ContextSwitcherProps;
|
|
76
|
-
/** A set of navigation links for the application. */
|
|
77
|
-
navLinks: NavLinkProps[];
|
|
78
|
-
/** Props for the operator menu. */
|
|
79
|
-
operator: OperatorProps;
|
|
80
|
-
/** Props related to notifications for the application. */
|
|
81
|
-
notifications?: NotificationProps;
|
|
82
|
-
/**
|
|
83
|
-
* The alignment of navigation links within the header.
|
|
84
|
-
* @default 'end'
|
|
85
|
-
*/
|
|
86
|
-
navAlignment?: 'start' | 'center' | 'end';
|
|
87
|
-
/**
|
|
88
|
-
* The positioning of the navigation links relative to the other app header elements.
|
|
89
|
-
* @default 'inline'
|
|
90
|
-
*/
|
|
91
|
-
navPosition?: 'inline' | 'below';
|
|
92
|
-
/** Ref for the wrapping div element. */
|
|
93
|
-
ref?: Ref<HTMLDivElement>;
|
|
94
|
-
}
|
|
95
|
-
export {};
|
|
96
|
-
//# sourceMappingURL=AppShell.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.types.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,gEAAgE,CAAC;AAExE,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAC;AAE1D,UAAU,YAAY;IACpB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,YAAY;IACpB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACxC,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,aAAa;IACrB,kDAAkD;IAClD,MAAM,EAAE,WAAW,CAAC;IACpB,sCAAsC;IACtC,KAAK,EAAE,MAA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,EAAE,YAAY,EAAE,CAAC;IACzB,mCAAmC;IACnC,QAAQ,EAAE,aAAa,CAAC;IACxB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC1C;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IACjC,wCAAwC;IACxC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.types.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport { AvatarProps, BaseProps, ImageProps, NoChildrenProp } from '@pega/cosmos-react-core';\nimport {\n ContextSwitcherProps,\n NavListItemProps\n} from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.types';\n\nexport type InteractionEvent = MouseEvent | KeyboardEvent;\n\ninterface AppInfoProps {\n /** Name of the application. */\n appName: string;\n /** URL source of the logo image. */\n imageSrc: ImageProps['src'];\n /** URL or DOM id to navigate to from the logo and appName. */\n href?: string;\n /** Click handler for the logo and appName. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n /** Specifies where to open the link href. */\n target?: string;\n}\n\ninterface NavLinkProps {\n /** Unique id for the link */\n id: string;\n /** Text that is displayed for the link. */\n text: string;\n /** URL or DOM id to navigate to. */\n href: string;\n /** Click handler for the link. */\n onClick?: (e: InteractionEvent) => void;\n /** Indicates if the link represents the current view within the app. */\n current?: boolean;\n}\n\ninterface OperatorProps {\n /** Props for constructing the operator avatar. */\n avatar: AvatarProps;\n /** The title of the operator menu. */\n title: string;\n /** A list of actions that will populate a menu attached to the operator. */\n actions: Pick<NavListItemProps, 'id' | 'primary' | 'href' | 'onClick' | 'visual'>[];\n}\n\nexport interface NotificationItem {\n /** An id representing the item. */\n id: string;\n /** The primary text for the item. */\n primary: string;\n /** Secondary text that will be rendered as a Meta List. */\n secondary?: string[];\n /** A visual associated with the item. */\n visual?: ReactNode;\n /** A flag indicating if the item has been read. */\n unread?: boolean;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** The onClick handler for the item. */\n onClick?: (event: InteractionEvent) => void;\n}\n\nexport interface NotificationProps {\n /** The title of the notifications view. */\n title: string;\n /** The number of new notifications. */\n count: number;\n /** A list of notification items. */\n items: NotificationItem[];\n /** If true, a loading indicator will render in place of the list. */\n loading?: boolean;\n /** Click event for items within the list. */\n onItemClick?: (id: string, event: InteractionEvent) => void;\n /** Callback that fires when the notification view opens. */\n onNotificationsOpen?: () => void;\n /** Callback that fires when the notification view closes. */\n onNotificationsClose?: () => void;\n}\n\nexport interface AppShellProps extends BaseProps, NoChildrenProp {\n /** The content of the application. */\n main: ReactNode;\n /** Props related to the app name and logo. */\n appInfo: AppInfoProps;\n /** Context manager configuration. */\n contextSwitcher?: ContextSwitcherProps;\n /** A set of navigation links for the application. */\n navLinks: NavLinkProps[];\n /** Props for the operator menu. */\n operator: OperatorProps;\n /** Props related to notifications for the application. */\n notifications?: NotificationProps;\n /**\n * The alignment of navigation links within the header.\n * @default 'end'\n */\n navAlignment?: 'start' | 'center' | 'end';\n /**\n * The positioning of the navigation links relative to the other app header elements.\n * @default 'inline'\n */\n navPosition?: 'inline' | 'below';\n /** Ref for the wrapping div element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { AppShellProps } from './AppShell.types';
|
|
3
|
-
interface MobileHeaderContentProps {
|
|
4
|
-
appInfo: AppShellProps['appInfo'];
|
|
5
|
-
navLinks: AppShellProps['navLinks'];
|
|
6
|
-
operator: AppShellProps['operator'];
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
}
|
|
9
|
-
declare const MobileHeaderContent: FunctionComponent<MobileHeaderContentProps>;
|
|
10
|
-
export default MobileHeaderContent;
|
|
11
|
-
//# sourceMappingURL=MobileHeaderContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MobileHeaderContent.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/MobileHeaderContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAY1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,UAAU,wBAAwB;IAChC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,wBAAwB,CA0EpE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex, Button, Avatar, Icon, Text, useI18n } from '@pega/cosmos-react-core';
|
|
3
|
-
import { HorizontalBreak, StyledLinkSection, StyledMobileLink, StyledMobileNav, StyledOperatorSection, StyledPrimaryName } from './AppShell.styles';
|
|
4
|
-
const MobileHeaderContent = ({ appInfo, navLinks, operator, onClose }) => {
|
|
5
|
-
const t = useI18n();
|
|
6
|
-
return (_jsxs(Flex, { as: StyledMobileNav, container: { direction: 'column' }, children: [_jsx(Flex, { container: { pad: 1 }, item: { alignSelf: 'end' }, children: _jsx(Button, { variant: 'simple', icon: true, onClick: onClose, label: t('close'), children: _jsx(Icon, { name: 'times' }) }) }), _jsx(Button, { as: StyledMobileLink, variant: 'text', href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: _jsx(Text, { as: StyledPrimaryName, variant: 'h1', children: appInfo.appName }) }), _jsx(Flex, { as: StyledLinkSection, container: { direction: 'column', gap: 1, pad: [1, 0] }, item: { grow: 1 }, children: navLinks.map(navLink => (_jsx(Button, { as: StyledMobileLink, variant: 'text', "aria-current": navLink.current ? 'page' : undefined, href: navLink.href, onClick: navLink.onClick, children: navLink.text }, navLink.id))) }), _jsxs(Flex, { as: StyledOperatorSection, container: { direction: 'column', gap: 2, pad: [0, 0, 2, 0] }, children: [_jsx(HorizontalBreak, {}), _jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsx(Avatar, { ...operator.avatar }), _jsx(Text, { as: StyledPrimaryName, variant: 'h2', children: "Account" })] }), _jsx(Flex, { container: { direction: 'column', gap: 1 }, children: operator.actions.map(action => (_jsx(Button, { as: StyledMobileLink, variant: 'text', href: action.href, onClick: action.onClick, children: action.primary }, action.id))) })] })] }));
|
|
7
|
-
};
|
|
8
|
-
export default MobileHeaderContent;
|
|
9
|
-
//# sourceMappingURL=MobileHeaderContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MobileHeaderContent.js","sourceRoot":"","sources":["../../../src/components/AppShell/MobileHeaderContent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,mBAAmB,GAAgD,CAAC,EACxE,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACkB,EAAE,EAAE;IAC7B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAC3D,KA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,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,aAE7D,KAAC,eAAe,KAAG,EACnB,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,aAC/C,KAAC,MAAM,OAAK,QAAQ,CAAC,MAAM,GAAI,EAC/B,KAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAC,IAAI,wBAElC,IACF,EACP,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,YAC7C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC9B,KAAC,MAAM,IACL,EAAE,EAAE,gBAAgB,EACpB,OAAO,EAAC,MAAM,EAEd,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,OAAO,EAAE,MAAM,CAAC,OAAO,YAEtB,MAAM,CAAC,OAAO,IAJV,MAAM,CAAC,EAAE,CAKP,CACV,CAAC,GACG,IACF,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport { Flex, Button, Avatar, Icon, Text, useI18n } from '@pega/cosmos-react-core';\n\nimport {\n HorizontalBreak,\n StyledLinkSection,\n StyledMobileLink,\n StyledMobileNav,\n StyledOperatorSection,\n StyledPrimaryName\n} from './AppShell.styles';\nimport { AppShellProps } from './AppShell.types';\n\ninterface MobileHeaderContentProps {\n appInfo: AppShellProps['appInfo'];\n navLinks: AppShellProps['navLinks'];\n operator: AppShellProps['operator'];\n onClose: () => void;\n}\n\nconst MobileHeaderContent: FunctionComponent<MobileHeaderContentProps> = ({\n appInfo,\n navLinks,\n operator,\n onClose\n}: MobileHeaderContentProps) => {\n const t = useI18n();\n\n return (\n <Flex as={StyledMobileNav} container={{ direction: 'column' }}>\n <Flex container={{ pad: 1 }} item={{ alignSelf: 'end' }}>\n <Button variant='simple' icon onClick={onClose} label={t('close')}>\n <Icon name='times' />\n </Button>\n </Flex>\n\n <Button\n as={StyledMobileLink}\n variant='text'\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Text as={StyledPrimaryName} variant='h1'>\n {appInfo.appName}\n </Text>\n </Button>\n\n <Flex\n as={StyledLinkSection}\n container={{ direction: 'column', gap: 1, pad: [1, 0] }}\n item={{ grow: 1 }}\n >\n {navLinks.map(navLink => (\n <Button\n as={StyledMobileLink}\n variant='text'\n key={navLink.id}\n aria-current={navLink.current ? 'page' : undefined}\n href={navLink.href}\n onClick={navLink.onClick}\n >\n {navLink.text}\n </Button>\n ))}\n </Flex>\n\n <Flex\n as={StyledOperatorSection}\n container={{ direction: 'column', gap: 2, pad: [0, 0, 2, 0] }}\n >\n <HorizontalBreak />\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n <Avatar {...operator.avatar} />\n <Text as={StyledPrimaryName} variant='h2'>\n Account\n </Text>\n </Flex>\n <Flex container={{ direction: 'column', gap: 1 }}>\n {operator.actions.map(action => (\n <Button\n as={StyledMobileLink}\n variant='text'\n key={action.id}\n href={action.href}\n onClick={action.onClick}\n >\n {action.primary}\n </Button>\n ))}\n </Flex>\n </Flex>\n </Flex>\n );\n};\n\nexport default MobileHeaderContent;\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { AppShellProps } from './AppShell.types';
|
|
3
|
-
interface NavLinksProps {
|
|
4
|
-
navLinks: AppShellProps['navLinks'];
|
|
5
|
-
navAlignment: AppShellProps['navAlignment'];
|
|
6
|
-
navPosition: AppShellProps['navPosition'];
|
|
7
|
-
ref?: Ref<HTMLDivElement>;
|
|
8
|
-
}
|
|
9
|
-
declare const NavLinks: FunctionComponent<NavLinksProps>;
|
|
10
|
-
export default NavLinks;
|
|
11
|
-
//# sourceMappingURL=NavLinks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavLinks.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,UAAU,aAAa;IACrB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC5C,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC1C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,CAgC7C,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Flex, Button } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledNav, StyledLink } from './AppShell.styles';
|
|
5
|
-
const NavLinks = forwardRef(function NavLinks({ navLinks, navAlignment, navPosition }, ref) {
|
|
6
|
-
return (_jsx(Flex, { as: StyledNav, ref: ref, container: {
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
gap: 1,
|
|
9
|
-
justify: navAlignment
|
|
10
|
-
}, item: { grow: 1 }, navPosition: navPosition, children: navLinks.map(navLink => {
|
|
11
|
-
return (_jsx(StyledLink, { as: Button, "aria-current": navLink.current ? 'page' : undefined, variant: 'text', href: navLink.href, onClick: navLink.onClick, children: navLink.text }, navLink.id));
|
|
12
|
-
}) }));
|
|
13
|
-
});
|
|
14
|
-
export default NavLinks;
|
|
15
|
-
//# sourceMappingURL=NavLinks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavLinks.js","sourceRoot":"","sources":["../../../src/components/AppShell/NavLinks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAwB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAU1D,MAAM,QAAQ,GAAqC,UAAU,CAAC,SAAS,QAAQ,CAC7E,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAkC,EACvE,GAAyB;IAEzB,OAAO,CACL,KAAC,IAAI,IACH,EAAE,EAAE,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE;YACT,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,YAAY;SACtB,EACD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,WAAW,EAAE,WAAW,YAEvB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACtB,OAAO,CACL,KAAC,UAAU,IACT,EAAE,EAAE,MAAM,kBACI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAClD,OAAO,EAAC,MAAM,EAEd,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,OAAO,EAAE,OAAO,CAAC,OAAO,YAEvB,OAAO,CAAC,IAAI,IAJR,OAAO,CAAC,EAAE,CAKJ,CACd,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef, Ref } from 'react';\n\nimport { Flex, Button } from '@pega/cosmos-react-core';\n\nimport { StyledNav, StyledLink } from './AppShell.styles';\nimport { AppShellProps } from './AppShell.types';\n\ninterface NavLinksProps {\n navLinks: AppShellProps['navLinks'];\n navAlignment: AppShellProps['navAlignment'];\n navPosition: AppShellProps['navPosition'];\n ref?: Ref<HTMLDivElement>;\n}\n\nconst NavLinks: FunctionComponent<NavLinksProps> = forwardRef(function NavLinks(\n { navLinks, navAlignment, navPosition }: PropsWithoutRef<NavLinksProps>,\n ref: NavLinksProps['ref']\n) {\n return (\n <Flex\n as={StyledNav}\n ref={ref}\n container={{\n alignItems: 'center',\n gap: 1,\n justify: navAlignment\n }}\n item={{ grow: 1 }}\n navPosition={navPosition}\n >\n {navLinks.map(navLink => {\n return (\n <StyledLink\n as={Button}\n aria-current={navLink.current ? 'page' : undefined}\n variant='text'\n key={navLink.id}\n href={navLink.href}\n onClick={navLink.onClick}\n >\n {navLink.text}\n </StyledLink>\n );\n })}\n </Flex>\n );\n});\n\nexport default NavLinks;\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { NotificationProps } from './AppShell.types';
|
|
3
|
-
interface NotificationsViewProps extends NotificationProps {
|
|
4
|
-
popover?: boolean;
|
|
5
|
-
onClose?: () => void;
|
|
6
|
-
}
|
|
7
|
-
declare const Notifications: FunctionComponent<NotificationsViewProps>;
|
|
8
|
-
export default Notifications;
|
|
9
|
-
//# sourceMappingURL=Notifications.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/Notifications.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAe1C,OAAO,EAAsC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAWzF,UAAU,sBAAuB,SAAQ,iBAAiB;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,sBAAsB,CA4E5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex, Button, Icon, Text, Progress, MetaList, SummaryItem, Alert, EmptyState, useI18n } from '@pega/cosmos-react-core';
|
|
3
|
-
import { StyledNotifications, StyledNotificationList, StyledNotification, StyledNotificationPrimary, StyledNotificationSecondary, StyledNotificationVisual, StyledPrimaryName } from './AppShell.styles';
|
|
4
|
-
const Notifications = ({ title, items, loading, onItemClick, popover, onClose }) => {
|
|
5
|
-
const t = useI18n();
|
|
6
|
-
const renderContent = items.length ? (_jsx(Flex, { as: StyledNotificationList, item: { grow: 1 }, children: items.map(({ id, primary, secondary, visual, unread, href, onClick }) => {
|
|
7
|
-
const onSummaryItemClick = (e) => {
|
|
8
|
-
if (e.type === 'click' || (e.type === 'keyup' && e.key === 'Enter')) {
|
|
9
|
-
onClick?.(e);
|
|
10
|
-
onItemClick?.(id, e);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
return (_jsxs("li", { children: [unread && (_jsx(StyledNotificationVisual, { unread: unread, children: _jsx(Alert, { variant: 'urgent' }) })), _jsx(SummaryItem, { as: StyledNotification, primary: _jsx(StyledNotificationPrimary, { unread: unread, children: primary }), secondary: secondary?.length ? (_jsx(StyledNotificationSecondary, { unread: unread, children: _jsx(MetaList, { items: secondary }) })) : undefined, visual: visual, href: href, onClick: onSummaryItemClick })] }, id));
|
|
14
|
-
}) })) : (_jsx(Flex, { container: { justify: 'center', alignItems: 'center' }, item: { grow: 1 }, children: _jsx(EmptyState, { message: t('app_header_notifications_empty') }) }));
|
|
15
|
-
return (_jsxs(Flex, { as: StyledNotifications, container: { direction: 'column', gap: 1 }, popover: popover, children: [onClose && (_jsx(Flex, { container: { pad: 1 }, item: { alignSelf: 'end' }, children: _jsx(Button, { variant: 'simple', icon: true, onClick: onClose, label: t('close'), children: _jsx(Icon, { name: 'times' }) }) })), _jsx(Flex, { container: { pad: popover ? [2, 3, 0, 3] : [0, 3] }, children: _jsx(Text, { as: StyledPrimaryName, variant: 'h1', children: title }) }), loading ? (_jsx(Flex, { container: { justify: 'center', alignItems: 'center' }, item: { grow: 1 }, children: _jsx(Progress, { placement: 'local', message: t('app_header_notifications_loading') }) })) : (renderContent)] }));
|
|
16
|
-
};
|
|
17
|
-
export default Notifications;
|
|
18
|
-
//# sourceMappingURL=Notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../../src/components/AppShell/Notifications.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,KAAK,EACL,UAAU,EACV,OAAO,EACR,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAO3B,MAAM,aAAa,GAA8C,CAAC,EAChE,KAAK,EACL,KAAK,EACL,OAAO,EACP,WAAW,EACX,OAAO,EACP,OAAO,EACgB,EAAE,EAAE;IAC3B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACnC,KAAC,IAAI,IAAC,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAChD,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAoB,EAAE,EAAE;YACzF,MAAM,kBAAkB,GAAG,CAAC,CAAmB,EAAE,EAAE;gBACjD,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,CAA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AE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,YACrD,KAAC,MAAM,IAAC,OAAO,EAAC,QAAQ,EAAC,IAAI,QAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,YAC/D,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,GACJ,CACR,EACD,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YACvD,KAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAC,IAAI,YACtC,KAAK,GACD,GACF,EACN,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAC7E,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,CAAC,kCAAkC,CAAC,GAAI,GACzE,CACR,CAAC,CAAC,CAAC,CACF,aAAa,CACd,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport {\n Flex,\n Button,\n Icon,\n Text,\n Progress,\n MetaList,\n SummaryItem,\n Alert,\n EmptyState,\n useI18n\n} from '@pega/cosmos-react-core';\n\nimport { InteractionEvent, NotificationItem, NotificationProps } from './AppShell.types';\nimport {\n StyledNotifications,\n StyledNotificationList,\n StyledNotification,\n StyledNotificationPrimary,\n StyledNotificationSecondary,\n StyledNotificationVisual,\n StyledPrimaryName\n} from './AppShell.styles';\n\ninterface NotificationsViewProps extends NotificationProps {\n popover?: boolean;\n onClose?: () => void;\n}\n\nconst Notifications: FunctionComponent<NotificationsViewProps> = ({\n title,\n items,\n loading,\n onItemClick,\n popover,\n onClose\n}: NotificationsViewProps) => {\n const t = useI18n();\n\n const renderContent = items.length ? (\n <Flex as={StyledNotificationList} item={{ grow: 1 }}>\n {items.map(({ id, primary, secondary, visual, unread, href, onClick }: NotificationItem) => {\n const onSummaryItemClick = (e: InteractionEvent) => {\n if (e.type === 'click' || (e.type === 'keyup' && (e as KeyboardEvent).key === 'Enter')) {\n onClick?.(e);\n onItemClick?.(id, e);\n }\n };\n\n return (\n <li key={id}>\n {unread && (\n <StyledNotificationVisual unread={unread}>\n <Alert variant='urgent' />\n </StyledNotificationVisual>\n )}\n <SummaryItem\n as={StyledNotification}\n primary={\n <StyledNotificationPrimary unread={unread}>{primary}</StyledNotificationPrimary>\n }\n secondary={\n secondary?.length ? (\n <StyledNotificationSecondary unread={unread}>\n <MetaList items={secondary} />\n </StyledNotificationSecondary>\n ) : undefined\n }\n visual={visual}\n href={href}\n onClick={onSummaryItemClick}\n />\n </li>\n );\n })}\n </Flex>\n ) : (\n <Flex container={{ justify: 'center', alignItems: 'center' }} item={{ grow: 1 }}>\n <EmptyState message={t('app_header_notifications_empty')} />\n </Flex>\n );\n\n return (\n <Flex as={StyledNotifications} container={{ direction: 'column', gap: 1 }} popover={popover}>\n {onClose && (\n <Flex container={{ pad: 1 }} item={{ alignSelf: 'end' }}>\n <Button variant='simple' icon onClick={onClose} label={t('close')}>\n <Icon name='times' />\n </Button>\n </Flex>\n )}\n <Flex container={{ pad: popover ? [2, 3, 0, 3] : [0, 3] }}>\n <Text as={StyledPrimaryName} variant='h1'>\n {title}\n </Text>\n </Flex>\n {loading ? (\n <Flex container={{ justify: 'center', alignItems: 'center' }} item={{ grow: 1 }}>\n <Progress placement='local' message={t('app_header_notifications_loading')} />\n </Flex>\n ) : (\n renderContent\n )}\n </Flex>\n );\n};\n\nexport default Notifications;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default } from './AppShell';\nexport type { AppShellProps, NotificationItem } from './AppShell.types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsC,MAAM,OAAO,CAAC;AAE/D,OAAO,EACL,YAAY,EAWb,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAAE,aAAa,EAAU,MAAM,kBAAkB,CAAC;AAEzD,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAuG9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useState } from 'react';
|
|
3
|
-
import { useBreakpoint, Flex, Tabs, TabPanel, Text, MenuButton, useI18n, Icon, useAfterInitialEffect } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledAside, StyledCaseHeader, StyledCaseView, StyledContentContainer } from './CaseView.styles';
|
|
5
|
-
const CaseView = ({ heading, actions, stages, tasks, summary, feed, utility, ...restProps }) => {
|
|
6
|
-
const isMediumOrAbove = useBreakpoint('md');
|
|
7
|
-
const t = useI18n();
|
|
8
|
-
const tabs = useMemo(() => {
|
|
9
|
-
if (isMediumOrAbove)
|
|
10
|
-
return null;
|
|
11
|
-
const tabsArr = [];
|
|
12
|
-
if (summary)
|
|
13
|
-
tabsArr.push({ name: 'Summary', content: summary.content });
|
|
14
|
-
if (feed)
|
|
15
|
-
tabsArr.push({ name: 'Feed', content: feed.content });
|
|
16
|
-
if (utility)
|
|
17
|
-
tabsArr.push({ name: 'Utility', content: utility.content });
|
|
18
|
-
return tabsArr.map(tab => ({ ...tab, id: tab.name }));
|
|
19
|
-
}, [isMediumOrAbove, summary, feed, utility]);
|
|
20
|
-
const [currentTabId, setCurrentTabId] = useState(tabs && tabs.length > 0 ? tabs[0].id : null);
|
|
21
|
-
useAfterInitialEffect(() => {
|
|
22
|
-
if (tabs && tabs.length > 0)
|
|
23
|
-
setCurrentTabId(cur => cur ?? tabs[0].id);
|
|
24
|
-
}, [tabs]);
|
|
25
|
-
return (_jsxs(StyledCaseView, { ...restProps, children: [_jsx(StyledCaseHeader, { children: _jsxs(Flex, { container: { justify: 'between', pad: 2, alignItems: 'center' }, as: StyledContentContainer, children: [_jsx(Text, { variant: 'h1', children: heading }), actions && (_jsx("div", { children: _jsx(MenuButton, { icon: !isMediumOrAbove ? 'more' : undefined, iconOnly: !isMediumOrAbove, variant: 'simple', text: t('actions'), menu: {
|
|
26
|
-
items: actions.map(action => ({
|
|
27
|
-
...action,
|
|
28
|
-
primary: action.text,
|
|
29
|
-
visual: action.icon ? _jsx(Icon, { name: action.icon }) : undefined
|
|
30
|
-
})),
|
|
31
|
-
scrollAt: 20
|
|
32
|
-
} }) }))] }) }), _jsxs(Flex, { container: { direction: 'column', gap: 2, pad: 2 }, as: StyledContentContainer, children: [stages?.content, tabs && currentTabId && (_jsxs(_Fragment, { children: [tasks?.content, _jsx(Tabs, { tabs: tabs, onTabClick: setCurrentTabId, currentTabId: currentTabId }), tabs.map(tab => (_jsx(TabPanel, { tabId: tab.id, currentTabId: currentTabId, children: tab.content }, tab.id)))] })), !tabs && (_jsxs(Flex, { container: { gap: 2 }, children: [(utility || summary) && (_jsxs(Flex, { as: StyledAside, container: { direction: 'column', gap: 2 }, children: [summary?.content && (_jsx("div", { role: 'region', "aria-label": summary?.label, children: summary?.content })), utility?.content && (_jsx("div", { role: 'region', "aria-label": utility?.label, children: utility?.content }))] })), _jsxs(Flex, { container: { direction: 'column', gap: 2 }, item: { grow: 1 }, children: [_jsx("div", { role: 'region', "aria-label": tasks?.label, children: tasks?.content }), _jsx("div", { role: 'region', "aria-label": feed?.label, children: feed?.content })] })] }))] })] }));
|
|
33
|
-
};
|
|
34
|
-
export default CaseView;
|
|
35
|
-
//# sourceMappingURL=CaseView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAEL,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,QAAQ,EAER,IAAI,EACJ,UAAU,EACV,OAAO,EACP,IAAI,EACJ,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,QAAQ,GAAqC,CAAC,EAClD,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,GAAG,SAAS,EACmB,EAAE,EAAE;IACnC,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,eAAe;YAAE,OAAO,IAAI,CAAC;QACjC,MAAM,OAAO,GAAwD,EAAE,CAAC;QAExE,IAAI,OAAO;YAAE,OAAO,CAAC,IAAI,CAAC,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,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CACvB,MAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9D,OAAO,EAAE,OAAO,IAAI,CACnB,cAAK,IAAI,EAAC,QAAQ,gBAAa,OAAO,EAAE,KAAK,YAC1C,OAAO,EAAE,OAAO,GACb,CACP,EACA,OAAO,EAAE,OAAO,IAAI,CACnB,cAAK,IAAI,EAAC,QAAQ,gBAAa,OAAO,EAAE,KAAK,YAC1C,OAAO,EAAE,OAAO,GACb,CACP,IACI,CACR,EACD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aACjE,cAAK,IAAI,EAAC,QAAQ,gBAAa,KAAK,EAAE,KAAK,YACxC,KAAK,EAAE,OAAO,GACX,EACN,cAAK,IAAI,EAAC,QAAQ,gBAAa,IAAI,EAAE,KAAK,YACvC,IAAI,EAAE,OAAO,GACV,IACD,IACF,CACR,IACI,IACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FC, PropsWithoutRef, useMemo, useState } from 'react';\n\nimport {\n ForwardProps,\n useBreakpoint,\n Flex,\n Tabs,\n TabPanel,\n Tab,\n Text,\n MenuButton,\n useI18n,\n Icon,\n useAfterInitialEffect\n} from '@pega/cosmos-react-core';\n\nimport {\n StyledAside,\n StyledCaseHeader,\n StyledCaseView,\n StyledContentContainer\n} from './CaseView.styles';\nimport { CaseViewProps, Region } from './CaseView.types';\n\nconst CaseView: FC<CaseViewProps & ForwardProps> = ({\n heading,\n actions,\n stages,\n tasks,\n summary,\n feed,\n utility,\n ...restProps\n}: PropsWithoutRef<CaseViewProps>) => {\n const isMediumOrAbove = useBreakpoint('md');\n const t = useI18n();\n\n const tabs = useMemo(() => {\n if (isMediumOrAbove) return null;\n const tabsArr: { name: Tab['name']; content: Region['content'] }[] = [];\n\n if (summary) tabsArr.push({ name: 'Summary', content: summary.content });\n if (feed) tabsArr.push({ name: 'Feed', content: feed.content });\n if (utility) tabsArr.push({ name: 'Utility', content: utility.content });\n\n return tabsArr.map(tab => ({ ...tab, id: tab.name }));\n }, [isMediumOrAbove, summary, feed, utility]);\n\n const [currentTabId, setCurrentTabId] = useState(tabs && tabs.length > 0 ? tabs[0].id : null);\n useAfterInitialEffect(() => {\n if (tabs && tabs.length > 0) setCurrentTabId(cur => cur ?? tabs[0].id);\n }, [tabs]);\n\n return (\n <StyledCaseView {...restProps}>\n <StyledCaseHeader>\n <Flex\n container={{ justify: 'between', pad: 2, alignItems: 'center' }}\n as={StyledContentContainer}\n >\n <Text variant='h1'>{heading}</Text>\n {actions && (\n <div>\n <MenuButton\n icon={!isMediumOrAbove ? 'more' : undefined}\n iconOnly={!isMediumOrAbove}\n variant='simple'\n text={t('actions')}\n menu={{\n items: actions.map(action => ({\n ...action,\n primary: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : undefined\n })),\n scrollAt: 20\n }}\n />\n </div>\n )}\n </Flex>\n </StyledCaseHeader>\n\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }} as={StyledContentContainer}>\n {stages?.content}\n\n {tabs && currentTabId && (\n <>\n {tasks?.content}\n <Tabs tabs={tabs} onTabClick={setCurrentTabId} currentTabId={currentTabId} />\n\n {tabs.map(tab => (\n <TabPanel tabId={tab.id} currentTabId={currentTabId} key={tab.id}>\n {tab.content}\n </TabPanel>\n ))}\n </>\n )}\n\n {!tabs && (\n <Flex container={{ gap: 2 }}>\n {(utility || summary) && (\n <Flex as={StyledAside} container={{ direction: 'column', gap: 2 }}>\n {summary?.content && (\n <div role='region' aria-label={summary?.label}>\n {summary?.content}\n </div>\n )}\n {utility?.content && (\n <div role='region' aria-label={utility?.label}>\n {utility?.content}\n </div>\n )}\n </Flex>\n )}\n <Flex container={{ direction: 'column', gap: 2 }} item={{ grow: 1 }}>\n <div role='region' aria-label={tasks?.label}>\n {tasks?.content}\n </div>\n <div role='region' aria-label={feed?.label}>\n {feed?.content}\n </div>\n </Flex>\n </Flex>\n )}\n </Flex>\n </StyledCaseView>\n );\n};\n\nexport default CaseView;\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const StyledAside: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
-
export declare const StyledContentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
export declare const StyledCaseHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
export declare const StyledCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
//# sourceMappingURL=CaseView.styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,yGAItB,CAAC;AAIH,eAAO,MAAM,sBAAsB,yGAMjC,CAAC;AAEH,eAAO,MAAM,gBAAgB,4GAmB3B,CAAC;AAIH,eAAO,MAAM,cAAc,yGAOzB,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
import { readableColor } from 'polished';
|
|
3
|
-
import { defaultThemeProp, StyledCard, tryCatch, useBreakpoint } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledStages } from '@pega/cosmos-react-work/lib/components/Stages/Stages.styles';
|
|
5
|
-
import { StyledFeedPost } from '@pega/cosmos-react-social/lib/components/Feed/FeedPost';
|
|
6
|
-
import { StyledCaseSummaryFields } from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';
|
|
7
|
-
export const StyledAside = styled.div(() => {
|
|
8
|
-
return css `
|
|
9
|
-
max-width: 40%;
|
|
10
|
-
`;
|
|
11
|
-
});
|
|
12
|
-
StyledAside.defaultProps = defaultThemeProp;
|
|
13
|
-
export const StyledContentContainer = styled.div(() => {
|
|
14
|
-
return css `
|
|
15
|
-
width: 100%;
|
|
16
|
-
max-width: 75rem;
|
|
17
|
-
margin-inline: auto;
|
|
18
|
-
`;
|
|
19
|
-
});
|
|
20
|
-
export const StyledCaseHeader = styled.header(({ theme }) => {
|
|
21
|
-
const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));
|
|
22
|
-
const isMediumOrAbove = useBreakpoint('md');
|
|
23
|
-
return css `
|
|
24
|
-
position: relative;
|
|
25
|
-
background-color: ${theme.base.palette['brand-primary']};
|
|
26
|
-
|
|
27
|
-
h1 {
|
|
28
|
-
color: ${color};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
${!isMediumOrAbove &&
|
|
32
|
-
css `
|
|
33
|
-
button {
|
|
34
|
-
color: ${color};
|
|
35
|
-
}
|
|
36
|
-
`}
|
|
37
|
-
`;
|
|
38
|
-
});
|
|
39
|
-
StyledCaseHeader.defaultProps = defaultThemeProp;
|
|
40
|
-
export const StyledCaseView = styled.div(({ theme }) => {
|
|
41
|
-
return css `
|
|
42
|
-
${StyledStages}, ${StyledCaseSummaryFields}, ${StyledFeedPost}, ${StyledCard} {
|
|
43
|
-
border: ${theme.components.button['border-width']} solid ${theme.base.palette['border-line']};
|
|
44
|
-
border-radius: ${theme.base['border-radius']};
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
47
|
-
});
|
|
48
|
-
StyledCaseView.defaultProps = defaultThemeProp;
|
|
49
|
-
//# sourceMappingURL=CaseView.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.styles.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE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AE,KAAK,EAAE,EAAE,EAAE;IACrD,OAAO,GAAG,CAAA;MACN,YAAY,KAAK,uBAAuB,KAAK,cAAc,KAAK,UAAU;gBAChE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;uBAC3E,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;GAE/C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { defaultThemeProp, StyledCard, tryCatch, useBreakpoint } from '@pega/cosmos-react-core';\nimport { StyledStages } from '@pega/cosmos-react-work/lib/components/Stages/Stages.styles';\nimport { StyledFeedPost } from '@pega/cosmos-react-social/lib/components/Feed/FeedPost';\nimport { StyledCaseSummaryFields } from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';\n\nexport const StyledAside = styled.div(() => {\n return css`\n max-width: 40%;\n `;\n});\n\nStyledAside.defaultProps = defaultThemeProp;\n\nexport const StyledContentContainer = styled.div(() => {\n return css`\n width: 100%;\n max-width: 75rem;\n margin-inline: auto;\n `;\n});\n\nexport const StyledCaseHeader = styled.header(({ theme }) => {\n const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));\n const isMediumOrAbove = useBreakpoint('md');\n\n return css`\n position: relative;\n background-color: ${theme.base.palette['brand-primary']};\n\n h1 {\n color: ${color};\n }\n\n ${!isMediumOrAbove &&\n css`\n button {\n color: ${color};\n }\n `}\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseView = styled.div(({ theme }) => {\n return css`\n ${StyledStages}, ${StyledCaseSummaryFields}, ${StyledFeedPost}, ${StyledCard} {\n border: ${theme.components.button['border-width']} solid ${theme.base.palette['border-line']};\n border-radius: ${theme.base['border-radius']};\n }\n `;\n});\n\nStyledCaseView.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { NoChildrenProp, Action, BaseProps, IconName } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface Region {
|
|
4
|
-
label: string;
|
|
5
|
-
content: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export interface CaseViewProps extends NoChildrenProp, BaseProps {
|
|
8
|
-
/** A text region for the title of the CaseView. */
|
|
9
|
-
heading: string;
|
|
10
|
-
/** An icon to serve as a visual for the CaseView. */
|
|
11
|
-
icon?: IconName;
|
|
12
|
-
/** Case level actions available in an action menu. */
|
|
13
|
-
actions?: Action[];
|
|
14
|
-
/** A region to display any summary information about the CaseView. */
|
|
15
|
-
summary?: Region;
|
|
16
|
-
/** A region to hold a Stages component. */
|
|
17
|
-
stages?: Region;
|
|
18
|
-
/** A region to hold a Tasks component. */
|
|
19
|
-
tasks?: Region;
|
|
20
|
-
/** A region to hold a Feed component. */
|
|
21
|
-
feed?: Region;
|
|
22
|
-
/** A region to hold a Utilities component. */
|
|
23
|
-
utility?: Region;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=CaseView.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEtF,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,SAAS;IAC9D,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.types.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode } from 'react';\n\nimport { NoChildrenProp, Action, BaseProps, IconName } from '@pega/cosmos-react-core';\n\nexport interface Region {\n label: string;\n content: ReactNode;\n}\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps {\n /** A text region for the title of the CaseView. */\n heading: string;\n /** An icon to serve as a visual for the CaseView. */\n icon?: IconName;\n /** Case level actions available in an action menu. */\n actions?: Action[];\n /** A region to display any summary information about the CaseView. */\n summary?: Region;\n /** A region to hold a Stages component. */\n stages?: Region;\n /** A region to hold a Tasks component. */\n tasks?: Region;\n /** A region to hold a Feed component. */\n feed?: Region;\n /** A region to hold a Utilities component. */\n utility?: Region;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default } from './CaseView';\nexport type { CaseViewProps } from './CaseView.types';\n"]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode, Ref } from 'react';
|
|
2
|
-
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface BannerOptions {
|
|
4
|
-
/** An image url for the banner */
|
|
5
|
-
backgroundImage?: string;
|
|
6
|
-
/** A title for the banner */
|
|
7
|
-
title: string;
|
|
8
|
-
/** A fallback background color if the background image is not provided */
|
|
9
|
-
backgroundColor?: string;
|
|
10
|
-
/** Text that will appear below the title */
|
|
11
|
-
message?: string;
|
|
12
|
-
/** The light variant will provide a white translucent filter over the background image
|
|
13
|
-
* with dark text. The dark variant will provide the opposite.
|
|
14
|
-
* @default 'light'
|
|
15
|
-
*/
|
|
16
|
-
variant?: 'light' | 'dark';
|
|
17
|
-
/** Toggles the translucent filter provided by the variant
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
tintImage?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface BannerPageProps {
|
|
23
|
-
banner: BannerOptions;
|
|
24
|
-
/** Content for the first column */
|
|
25
|
-
a: ReactNode;
|
|
26
|
-
/** Content for the second column. If not provided the first column will stretch. */
|
|
27
|
-
b?: ReactNode;
|
|
28
|
-
ref?: Ref<HTMLDivElement>;
|
|
29
|
-
/** Variants for the sizing of the content columns. Two column will make the columns equal in size. */
|
|
30
|
-
variant?: 'two-column' | 'narrow-wide' | 'wide-narrow';
|
|
31
|
-
}
|
|
32
|
-
export declare const StyledBannerContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<BannerOptions, "backgroundColor" | "backgroundImage">, never>;
|
|
33
|
-
export declare const StyledBanner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<BannerOptions, "backgroundColor" | "backgroundImage" | "variant" | "tintImage">, never>;
|
|
34
|
-
export declare const StyledContentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
35
|
-
export declare const BannerPage: FC<BannerPageProps & ForwardProps>;
|
|
36
|
-
//# sourceMappingURL=BannerPage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BannerPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/BannerPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAA+B,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGxE,OAAO,EAGL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAEjC,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,eAAe;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,mCAAmC;IACnC,CAAC,EAAE,SAAS,CAAC;IACb,oFAAoF;IACpF,CAAC,CAAC,EAAE,SAAS,CAAC;IACd,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,sGAAsG;IACtG,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,GAAG,aAAa,CAAC;CACxD;AAED,eAAO,MAAM,qBAAqB,iKAoBhC,CAAC;AAIH,eAAO,MAAM,YAAY,2LA+BxB,CAAC;AAIF,eAAO,MAAM,sBAAsB,yGAmBlC,CAAC;AAUF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,YAAY,CA0CxD,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { readableColor, transparentize } from 'polished';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
import styled, { css } from 'styled-components';
|
|
5
|
-
import { defaultThemeProp, Flex, Grid, Text, tryCatch } from '@pega/cosmos-react-core';
|
|
6
|
-
export const StyledBannerContainer = styled.div(({ backgroundImage, backgroundColor, theme }) => {
|
|
7
|
-
return css `
|
|
8
|
-
width: 100%;
|
|
9
|
-
height: calc(${theme.base.spacing} * 38);
|
|
10
|
-
|
|
11
|
-
${backgroundImage &&
|
|
12
|
-
css `
|
|
13
|
-
background-image: url('${backgroundImage}');
|
|
14
|
-
background-size: cover;
|
|
15
|
-
background-position: center;
|
|
16
|
-
background-repeat: no-repeat;
|
|
17
|
-
`}
|
|
18
|
-
|
|
19
|
-
${backgroundColor &&
|
|
20
|
-
css `
|
|
21
|
-
background-color: ${backgroundColor};
|
|
22
|
-
`}
|
|
23
|
-
`;
|
|
24
|
-
});
|
|
25
|
-
StyledBannerContainer.defaultProps = defaultThemeProp;
|
|
26
|
-
export const StyledBanner = styled.div(({ variant = 'light', backgroundColor, backgroundImage, tintImage = true, theme: { base: { palette: { light, dark } } } }) => {
|
|
27
|
-
let textColor = variant === 'light' ? dark : light;
|
|
28
|
-
let overlayColor = variant === 'light' ? transparentize(0.3, light) : transparentize(0.3, dark);
|
|
29
|
-
if (backgroundColor && !backgroundImage) {
|
|
30
|
-
textColor = tryCatch(() => readableColor(backgroundColor, light, dark)) ?? dark;
|
|
31
|
-
overlayColor = 'transparent';
|
|
32
|
-
}
|
|
33
|
-
else if (!backgroundColor && !backgroundImage) {
|
|
34
|
-
overlayColor = 'transparent';
|
|
35
|
-
textColor = dark;
|
|
36
|
-
}
|
|
37
|
-
return css `
|
|
38
|
-
background-color: ${tintImage ? overlayColor : 'transparent'};
|
|
39
|
-
color: ${textColor};
|
|
40
|
-
width: 100%;
|
|
41
|
-
height: 100%;
|
|
42
|
-
text-align: center;
|
|
43
|
-
`;
|
|
44
|
-
});
|
|
45
|
-
StyledBanner.defaultProps = defaultThemeProp;
|
|
46
|
-
export const StyledContentContainer = styled.div(({ theme: { base: { breakpoints, spacing } } }) => {
|
|
47
|
-
return css `
|
|
48
|
-
padding: calc(${spacing} * 2);
|
|
49
|
-
width: 100%;
|
|
50
|
-
margin: 0 auto;
|
|
51
|
-
@media screen and (min-width: ${breakpoints.md}) {
|
|
52
|
-
width: 100%;
|
|
53
|
-
padding: calc(${spacing} * 2.5);
|
|
54
|
-
}
|
|
55
|
-
@media screen and (min-width: ${breakpoints.lg}) {
|
|
56
|
-
max-width: 93.75rem;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
});
|
|
60
|
-
StyledContentContainer.defaultProps = defaultThemeProp;
|
|
61
|
-
const variantMap = {
|
|
62
|
-
'two-column': '1fr 1fr',
|
|
63
|
-
'narrow-wide': '3fr 7fr',
|
|
64
|
-
'wide-narrow': '7fr 3fr'
|
|
65
|
-
};
|
|
66
|
-
export const BannerPage = forwardRef(function BannerPage({ banner, a, b, variant = 'two-column', ...restProps }, ref) {
|
|
67
|
-
const gridCols = variantMap[variant];
|
|
68
|
-
return (_jsxs("div", { ref: ref, ...restProps, children: [banner && (_jsx(StyledBannerContainer, { backgroundImage: banner.backgroundImage, backgroundColor: banner.backgroundColor, 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 }))] }) }) })), _jsxs(Grid, { container: { gap: 2 }, md: { container: { cols: '1fr' } }, lg: { container: { cols: b ? `${gridCols}` : '1fr' } }, as: StyledContentContainer, children: [_jsx("div", { children: a }), b && _jsx("div", { children: b })] })] }));
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=BannerPage.js.map
|