@pega/cosmos-react-build 2.0.0-dev.12.1 → 2.0.0-dev.14.2
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/AppHeader/AppHeader.d.ts.map +1 -1
- package/lib/components/AppHeader/AppHeader.js +4 -4
- package/lib/components/AppHeader/AppHeader.js.map +1 -1
- package/lib/components/AppHeader/AppHeader.styles.d.ts +2 -2
- package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppHeader/AppHeader.styles.js +21 -13
- package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +3 -2
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/LifeCycle/Category.d.ts +32 -0
- package/lib/components/LifeCycle/Category.d.ts.map +1 -0
- package/lib/components/LifeCycle/Category.js +98 -0
- package/lib/components/LifeCycle/Category.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.d.ts +22 -0
- package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.js +75 -0
- package/lib/components/LifeCycle/LifeCycle.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +56 -0
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.types.js +2 -0
- package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycleList.d.ts +21 -0
- package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycleList.js +65 -0
- package/lib/components/LifeCycle/LifeCycleList.js.map +1 -0
- package/lib/components/LifeCycle/Stage.d.ts +47 -0
- package/lib/components/LifeCycle/Stage.d.ts.map +1 -0
- package/lib/components/LifeCycle/Stage.js +290 -0
- package/lib/components/LifeCycle/Stage.js.map +1 -0
- package/lib/components/LifeCycle/Step.d.ts +48 -0
- package/lib/components/LifeCycle/Step.d.ts.map +1 -0
- package/lib/components/LifeCycle/Step.js +231 -0
- package/lib/components/LifeCycle/Step.js.map +1 -0
- package/lib/components/LifeCycle/Task.d.ts +51 -0
- package/lib/components/LifeCycle/Task.d.ts.map +1 -0
- package/lib/components/LifeCycle/Task.js +179 -0
- package/lib/components/LifeCycle/Task.js.map +1 -0
- package/lib/components/LifeCycle/index.d.ts +4 -0
- package/lib/components/LifeCycle/index.d.ts.map +1 -0
- package/lib/components/LifeCycle/index.js +2 -0
- package/lib/components/LifeCycle/index.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,GAAG,EACH,iBAAiB,EACjB,UAAU,EAMX,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,WAAW,EACX,SAAS,EAET,YAAY,EAKZ,gBAAgB,EAChB,aAAa,EAEb,GAAG,EAEH,cAAc,EACf,MAAM,yBAAyB,CAAC;AAejC,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,cAAc;IAC/D,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AACD,UAAU,UAAU;IAClB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,OAAO,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;CACzC;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F;AAED,UAAU,UAAU;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAClC;AAwED,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAU/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
3
3
|
import { Flex, Icon, Text, useI18n, useBreakpoint, MenuButton, SearchInput } from '@pega/cosmos-react-core';
|
|
4
4
|
import { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';
|
|
5
|
-
import { StyledAppHeader, StyledTabs, StyledAppAvator, StyledUtilsContainer, StyledBrandContainer, StyledBranchContainer,
|
|
6
|
-
const BrandContainer = ({ name }) => {
|
|
7
|
-
return (_jsxs(StyledBrandContainer, Object.assign({ container: { alignItems: 'center', justify: 'between' } }, { children: [_jsx(StyledIconContainer, { children: _jsx(
|
|
5
|
+
import { StyledAppHeader, StyledTabs, StyledAppAvator, StyledUtilsContainer, StyledBrandContainer, StyledBranchContainer, StyledTitle, StyledBrandButton, StyledIconContainer } from './AppHeader.styles';
|
|
6
|
+
const BrandContainer = ({ name, onClick, href }) => {
|
|
7
|
+
return (_jsxs(StyledBrandContainer, Object.assign({ container: { alignItems: 'center', justify: 'between' }, onClick: onClick, href: href, forwardedAs: onClick || href ? StyledBrandButton : 'div' }, { children: [_jsx(StyledIconContainer, Object.assign({ container: { alignItems: 'center', justify: 'center' } }, { children: _jsx(Icon, { name: 'pegasus' }, void 0) }), void 0), _jsx(StyledTitle, { children: name }, void 0)] }), void 0));
|
|
8
8
|
};
|
|
9
9
|
const Links = ({ links = [] }) => {
|
|
10
10
|
const [currentTabId, setCurrentTabId] = useState(links[0].id || '');
|
|
@@ -18,7 +18,7 @@ const Links = ({ links = [] }) => {
|
|
|
18
18
|
setCurrentTabId(newActiveTab.id);
|
|
19
19
|
}
|
|
20
20
|
}, [links]);
|
|
21
|
-
return
|
|
21
|
+
return _jsx(StyledTabs, { tabs: links, currentTabId: currentTabId, onTabClick: handleTabClick }, void 0);
|
|
22
22
|
};
|
|
23
23
|
const Utils = ({ avatar, search, branchName, actions }) => {
|
|
24
24
|
const t = useI18n();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAOV,WAAW,EACX,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAGL,IAAI,EAEJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EAGb,UAAU,EAEV,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAE5G,OAAO,EACL,eAAe,EACf,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAOV,WAAW,EACX,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAGL,IAAI,EAEJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EAGb,UAAU,EAEV,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAE5G,OAAO,EACL,eAAe,EACf,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,E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AAC,eAAe,oBAAK,MAAM,UAAI,aACV,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAqD,UAAU,CAC5E,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAmC,EAAE,GAA0B,EAAE,EAAE;IACvF,OAAO,CACL,MAAC,IAAI,kBAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,iBACpE,KAAC,cAAc,oBAAK,KAAK,UAAI,EAC5B,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,WAAI,EACpD,KAAK,IAAI,KAAC,KAAK,oBAAK,KAAK,UAAI,aACzB,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n Ref,\n MouseEventHandler,\n MouseEvent,\n FC,\n PropsWithoutRef,\n useCallback,\n useEffect,\n useState\n} from 'react';\n\nimport {\n AvatarProps,\n BaseProps,\n Flex,\n ForwardProps,\n Icon,\n Text,\n useI18n,\n useBreakpoint,\n SearchInputProps,\n MenuItemProps,\n MenuButton,\n Tab,\n SearchInput,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { StyledAppHeaderSearchForm } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';\n\nimport {\n StyledAppHeader,\n StyledTabs,\n StyledAppAvator,\n StyledUtilsContainer,\n StyledBrandContainer,\n StyledBranchContainer,\n StyledTitle,\n StyledBrandButton,\n StyledIconContainer\n} from './AppHeader.styles';\n\nexport interface AppHeaderProps extends BaseProps, NoChildrenProp {\n brand: BrandProps;\n links?: LinkProps[];\n utils?: UtilsProps;\n ref?: Ref<HTMLDivElement>;\n}\ninterface BrandProps {\n /** The primary text to render in the header. */\n name: string;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** Click handler for the header. */\n onClick?: MouseEventHandler<MouseEvent>;\n}\n\ninterface LinkProps extends Tab {\n onClick?: (id: string, event?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n}\n\ninterface UtilsProps {\n avatar: AvatarProps;\n search?: SearchInputProps;\n branchName?: string;\n actions?: MenuItemProps['items'];\n}\n\nconst BrandContainer: FC<BrandProps> = ({ name, onClick, href }) => {\n return (\n <StyledBrandContainer\n container={{ alignItems: 'center', justify: 'between' }}\n onClick={onClick}\n href={href}\n forwardedAs={onClick || href ? StyledBrandButton : 'div'}\n >\n <StyledIconContainer container={{ alignItems: 'center', justify: 'center' }}>\n <Icon name='pegasus' />\n </StyledIconContainer>\n <StyledTitle>{name}</StyledTitle>\n </StyledBrandContainer>\n );\n};\n\nconst Links: FC<{ links: AppHeaderProps['links'] }> = ({ links = [] }) => {\n const [currentTabId, setCurrentTabId] = useState(links[0].id || '');\n\n useEffect(() => {\n setCurrentTabId(links[0].id || '');\n }, [links]);\n\n const handleTabClick = useCallback(\n (id: string, event?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const newActiveTab = links.find(item => item.id === id);\n if (newActiveTab) {\n newActiveTab.onClick?.(id, event);\n setCurrentTabId(newActiveTab.id);\n }\n },\n [links]\n );\n\n return <StyledTabs tabs={links} currentTabId={currentTabId} onTabClick={handleTabClick} />;\n};\n\nconst Utils: FC<UtilsProps> = ({ avatar, search, branchName, actions }: UtilsProps) => {\n const t = useI18n();\n const isMediumOrAbove = useBreakpoint('md');\n\n return (\n <StyledUtilsContainer\n isMediumOrAbove={isMediumOrAbove}\n container={{ alignItems: 'center', justify: 'end' }}\n >\n {search && (\n <StyledAppHeaderSearchForm\n role='search'\n aria-label={search.searchInputAriaLabel}\n onSubmit={e => e.preventDefault()}\n isMediumOrAbove={isMediumOrAbove}\n >\n <SearchInput {...search} />\n </StyledAppHeaderSearchForm>\n )}\n {branchName && (\n <StyledBranchContainer container={{ alignItems: 'center', justify: 'between' }}>\n <Icon name='nodes-right' />\n <Text aria-label={branchName}>{branchName}</Text>\n </StyledBranchContainer>\n )}\n {actions && actions.length > 0 && (\n <MenuButton variant='link' menu={{ items: actions }} text={t('actions')} />\n )}\n <StyledAppAvator {...avatar} />\n </StyledUtilsContainer>\n );\n};\n\nconst AppHeader: FunctionComponent<AppHeaderProps & ForwardProps> = forwardRef(\n ({ brand, utils, links }: PropsWithoutRef<AppHeaderProps>, ref: AppHeaderProps['ref']) => {\n return (\n <Flex as={StyledAppHeader} container={{ justify: 'between' }} ref={ref}>\n <BrandContainer {...brand} />\n {links && links.length > 0 && <Links links={links} />}\n {utils && <Utils {...utils} />}\n </Flex>\n );\n }\n);\n\nexport default AppHeader;\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Avatar, Flex,
|
|
1
|
+
import { Avatar, Flex, Text, Tabs } from '@pega/cosmos-react-core';
|
|
2
2
|
export declare const StyledAppHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const StyledTitle: typeof Text;
|
|
4
4
|
export declare const StyledBrandContainer: typeof Flex;
|
|
5
5
|
export declare const StyledIconContainer: typeof Flex;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const StyledBrandButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core/lib/components/Button/BareButton").BareButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
export declare const StyledTabs: typeof Tabs;
|
|
8
8
|
export declare const StyledUtilsContainer: typeof Flex;
|
|
9
9
|
export declare const StyledBranchContainer: typeof Flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAoB,IAAI,
|
|
1
|
+
{"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAoB,IAAI,EAAc,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGjG,eAAO,MAAM,eAAe,4GAQ1B,CAAC;AAIH,eAAO,MAAM,WAAW,EAAE,OAAO,IAU/B,CAAC;AAIH,eAAO,MAAM,oBAAoB,EAAE,OAAO,IAKxC,CAAC;AAIH,eAAO,MAAM,mBAAmB,EAAE,OAAO,IAcvC,CAAC;AAIH,eAAO,MAAM,iBAAiB,0QAM5B,CAAC;AAIH,eAAO,MAAM,UAAU,EAAE,OAAO,IAqB9B,CAAC;AAIH,eAAO,MAAM,oBAAoB,EAAE,OAAO,IAiBzC,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,OAAO,IAYzC,CAAC;AAIH,eAAO,MAAM,eAAe,EAAE,OAAO,MAGpC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { Avatar, defaultThemeProp, Flex,
|
|
2
|
+
import { Avatar, defaultThemeProp, Flex, StyledIcon, Text, Tabs } from '@pega/cosmos-react-core';
|
|
3
|
+
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
3
4
|
export const StyledAppHeader = styled.header(({ theme }) => {
|
|
4
5
|
return css `
|
|
5
6
|
height: 3rem;
|
|
6
7
|
padding: 0 calc(2 * ${theme.base.spacing});
|
|
7
|
-
border-bottom: 0.0625rem solid ${theme.base.colors.gray.
|
|
8
|
+
border-bottom: 0.0625rem solid ${theme.base.colors.gray.light};
|
|
8
9
|
box-shadow: ${theme.base.shadow.low};
|
|
9
10
|
background-color: ${theme.base.palette['primary-background']};
|
|
10
11
|
`;
|
|
@@ -25,6 +26,7 @@ StyledTitle.defaultProps = defaultThemeProp;
|
|
|
25
26
|
export const StyledBrandContainer = styled(Flex)(({ theme }) => {
|
|
26
27
|
return css `
|
|
27
28
|
padding-block: ${theme.base.spacing};
|
|
29
|
+
text-decoration: none;
|
|
28
30
|
`;
|
|
29
31
|
});
|
|
30
32
|
StyledBrandContainer.defaultProps = defaultThemeProp;
|
|
@@ -35,29 +37,31 @@ export const StyledIconContainer = styled(Flex)(({ theme }) => {
|
|
|
35
37
|
height: 2rem;
|
|
36
38
|
position: relative;
|
|
37
39
|
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
40
|
+
|
|
41
|
+
${StyledIcon} {
|
|
42
|
+
width: 1.25rem;
|
|
43
|
+
height: 1.25rem;
|
|
44
|
+
color: ${theme.base.palette.light};
|
|
45
|
+
}
|
|
38
46
|
`;
|
|
39
47
|
});
|
|
40
48
|
StyledIconContainer.defaultProps = defaultThemeProp;
|
|
41
|
-
export const
|
|
49
|
+
export const StyledBrandButton = styled(BareButton)(({ theme }) => {
|
|
42
50
|
return css `
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
transform: translate(-50%, -50%);
|
|
47
|
-
width: 1.25rem;
|
|
48
|
-
height: 1.25rem;
|
|
49
|
-
color: ${theme.base.palette.light};
|
|
51
|
+
&:not([disabled]):focus {
|
|
52
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
53
|
+
}
|
|
50
54
|
`;
|
|
51
55
|
});
|
|
52
|
-
|
|
56
|
+
StyledBrandButton.defaultProps = defaultThemeProp;
|
|
53
57
|
export const StyledTabs = styled(Tabs)(({ theme }) => {
|
|
54
58
|
return css `
|
|
55
59
|
margin-inline-start: calc(2 * ${theme.base.spacing});
|
|
56
60
|
margin-inline-end: calc(2 * ${theme.base.spacing});
|
|
57
|
-
height: 100%;
|
|
58
61
|
border: none;
|
|
62
|
+
min-height: 3rem;
|
|
59
63
|
button {
|
|
60
|
-
height:
|
|
64
|
+
height: auto;
|
|
61
65
|
span:first-of-type {
|
|
62
66
|
text-transform: none;
|
|
63
67
|
}
|
|
@@ -75,6 +79,7 @@ export const StyledTabs = styled(Tabs)(({ theme }) => {
|
|
|
75
79
|
StyledTabs.defaultProps = defaultThemeProp;
|
|
76
80
|
export const StyledUtilsContainer = styled(Flex)(({ theme, isMediumOrAbove }) => {
|
|
77
81
|
return css `
|
|
82
|
+
margin-inline-start: auto;
|
|
78
83
|
padding-block: ${theme.base.spacing};
|
|
79
84
|
width: auto;
|
|
80
85
|
min-width: ${isMediumOrAbove ? '32%' : 'auto'};
|
|
@@ -83,6 +88,9 @@ export const StyledUtilsContainer = styled(Flex)(({ theme, isMediumOrAbove }) =>
|
|
|
83
88
|
margin-inline-start: ${theme.base.spacing};
|
|
84
89
|
margin-inline-end: ${theme.base.spacing};
|
|
85
90
|
}
|
|
91
|
+
& > div:last-child {
|
|
92
|
+
margin-inline-end: 0;
|
|
93
|
+
}
|
|
86
94
|
`;
|
|
87
95
|
});
|
|
88
96
|
StyledUtilsContainer.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../src/components/AppHeader/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzD,OAAO,GAAG,CAAA;;0BAEc,KAAK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,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;yCAClB,KAAK,CAAC,IAAI,CAAC,OAAO;uCACpB,KAAK,CAAC,IAAI,CAAC,OAAO;;GAEtD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,eAAe,GAAkB,MAAM,CAAC,MAAM,CAAC,CAAA;;;CAG3D,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Avatar, defaultThemeProp, Flex, StyledIcon, Text, Tabs } from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nexport const StyledAppHeader = styled.header(({ theme }) => {\n return css`\n height: 3rem;\n padding: 0 calc(2 * ${theme.base.spacing});\n border-bottom: 0.0625rem solid ${theme.base.colors.gray.light};\n box-shadow: ${theme.base.shadow.low};\n background-color: ${theme.base.palette['primary-background']};\n `;\n});\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTitle: typeof Text = styled(Text)(({ theme }) => {\n return css`\n max-width: 25ch;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${theme.base.palette['foreground-color']};\n font-weight: ${theme.base['font-weight'].bold};\n margin-inline-start: calc(0.75 * ${theme.base.spacing});\n `;\n});\n\nStyledTitle.defaultProps = defaultThemeProp;\n\nexport const StyledBrandContainer: typeof Flex = styled(Flex)(({ theme }) => {\n return css`\n padding-block: ${theme.base.spacing};\n text-decoration: none;\n `;\n});\n\nStyledBrandContainer.defaultProps = defaultThemeProp;\n\nexport const StyledIconContainer: typeof Flex = styled(Flex)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['brand-primary']};\n width: 2rem;\n height: 2rem;\n position: relative;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n ${StyledIcon} {\n width: 1.25rem;\n height: 1.25rem;\n color: ${theme.base.palette.light};\n }\n `;\n});\n\nStyledIconContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBrandButton = styled(BareButton)(({ theme }) => {\n return css`\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledBrandButton.defaultProps = defaultThemeProp;\n\nexport const StyledTabs: typeof Tabs = styled(Tabs)(({ theme }) => {\n return css`\n margin-inline-start: calc(2 * ${theme.base.spacing});\n margin-inline-end: calc(2 * ${theme.base.spacing});\n border: none;\n min-height: 3rem;\n button {\n height: auto;\n span:first-of-type {\n text-transform: none;\n }\n }\n button[aria-selected='false'] > span {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n button:hover,\n button:focus,\n button:active {\n box-shadow: none;\n }\n `;\n});\n\nStyledTabs.defaultProps = defaultThemeProp;\n\nexport const StyledUtilsContainer: typeof Flex = styled(Flex)<{ isMediumOrAbove: boolean }>(\n ({ theme, isMediumOrAbove }) => {\n return css`\n margin-inline-start: auto;\n padding-block: ${theme.base.spacing};\n width: auto;\n min-width: ${isMediumOrAbove ? '32%' : 'auto'};\n & > div,\n & > span {\n margin-inline-start: ${theme.base.spacing};\n margin-inline-end: ${theme.base.spacing};\n }\n & > div:last-child {\n margin-inline-end: 0;\n }\n `;\n }\n);\n\nStyledUtilsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledBranchContainer: typeof Flex = styled(Flex)(({ theme }) => {\n return css`\n span {\n white-space: nowrap;\n max-width: 25ch;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: ${theme.base['font-weight']['semi-bold']};\n margin-inline-start: calc(0.75 * ${theme.base.spacing});\n margin-inline-end: calc(0.75 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledBranchContainer.defaultProps = defaultThemeProp;\n\nexport const StyledAppAvator: typeof Avatar = styled(Avatar)`\n width: 1.5rem;\n height: 1.5rem;\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,eAAe,qOA+B1B,CAAC;AAIH,eAAO,MAAM,YAAY,yGAUvB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAI7B,CAAC;AAIH,eAAO,MAAM,mBAAmB,mOAI9B,CAAC;AAIH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,eAAe,qOA+B1B,CAAC;AAIH,eAAO,MAAM,YAAY,yGAUvB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAI7B,CAAC;AAIH,eAAO,MAAM,mBAAmB,mOAI9B,CAAC;AAIH,eAAO,MAAM,cAAc,mOAOzB,CAAC;AAIH,eAAO,MAAM,WAAW;iBAA6B,OAAO;SA8B1D,CAAC;AAIH,eAAO,MAAM,cAAc,wGAsBzB,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAO3B,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAmB3B,CAAC;AAIH,eAAO,MAAM,UAAU,0GAQrB,CAAC;AAIH,eAAO,MAAM,mBAAmB,yGAO9B,CAAC;AAIH,eAAO,MAAM,qBAAqB;aAAyB,MAAM;SAY/D,CAAC;AAIH,eAAO,MAAM,uBAAuB,qOAYlC,CAAC;AAIH,eAAO,MAAM,cAAc,yGAUzB,CAAC;AAIH,eAAO,MAAM,SAAS,yGAkHpB,CAAC"}
|
|
@@ -62,7 +62,6 @@ export const StyledNavHeaderIcon = styled(Icon)(({ theme }) => {
|
|
|
62
62
|
StyledNavHeaderIcon.defaultProps = defaultThemeProp;
|
|
63
63
|
export const StyledNavTitle = styled(Text)(({ theme }) => {
|
|
64
64
|
return css `
|
|
65
|
-
margin-inline-start: ${theme.base.spacing};
|
|
66
65
|
color: ${theme.base.colors.white};
|
|
67
66
|
text-overflow: ellipsis;
|
|
68
67
|
white-space: nowrap;
|
|
@@ -84,7 +83,7 @@ export const StyledUtils = styled.div(({ theme, showDevMode }) => {
|
|
|
84
83
|
height: calc(2rem + 4 * ${theme.base.spacing});
|
|
85
84
|
padding: calc(2 * ${theme.base.spacing});
|
|
86
85
|
text-transform: capitalize;
|
|
87
|
-
color: ${theme.base.colors.gray.
|
|
86
|
+
color: ${theme.base.colors.gray.light};
|
|
88
87
|
font-weight: ${theme.base['font-weight'].bold};
|
|
89
88
|
|
|
90
89
|
&::before,
|
|
@@ -175,6 +174,7 @@ export const StyledNavHeaderVisual = styled.div(({ theme, bgColor }) => {
|
|
|
175
174
|
min-height: 2rem;
|
|
176
175
|
border-radius: 0.4rem;
|
|
177
176
|
background-color: ${bgColor};
|
|
177
|
+
margin-inline-end: ${theme.base.spacing};
|
|
178
178
|
color: ${theme.base.colors.white};
|
|
179
179
|
& svg {
|
|
180
180
|
color: ${theme.base.colors.white};
|
|
@@ -184,6 +184,7 @@ export const StyledNavHeaderVisual = styled.div(({ theme, bgColor }) => {
|
|
|
184
184
|
StyledNavHeaderVisual.defaultProps = defaultThemeProp;
|
|
185
185
|
export const StyledDrawerCloseButton = styled(Button)(({ theme }) => {
|
|
186
186
|
return css `
|
|
187
|
+
margin-inline-end: ${theme.base.spacing};
|
|
187
188
|
min-width: 1.5rem;
|
|
188
189
|
min-height: 1.5rem;
|
|
189
190
|
color: ${theme.base.colors.white};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,YAAY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AAM;;kBAEzB,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC;;;MAGjE,cAAc;eACL,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;0BACf,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;;MAGlF,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAChC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;wCA0BiC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;KAuB9D;;;QAGG,eAAe;UACb,YAAY;;;;;;;;;;;;;;wBAcE,KAAK,CAAC,IAAI,CAAC,OAAO;;;;MAIpC,kBAAkB;eACT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;QAE9B,cAAc;uBACC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;QAGrD,qBAAqB;;;8BAGC,OAAO;;;;YAIzB,cAAc;YACd,cAAc;qBACL,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;;;;;;;UAOvC,UAAU;6BACS,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;;GAE1D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, hideVisually } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n Icon,\n Text,\n tryCatch,\n defaultThemeProp,\n Button,\n useDirection,\n StyledIcon,\n StyledTooltip\n} from '@pega/cosmos-react-core';\nimport { StyledSwitch, SwitchLabel } from '@pega/cosmos-react-core/lib/components/Switch/Switch';\nimport { StyledBareButton } from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport {\n StyledNodeIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst hoverBg = 'rgba(0, 0, 0, 0.4)';\n\nexport const StyledNavToggle = styled(Button)(({ theme }) => {\n const { ltr } = useDirection();\n\n return css`\n position: absolute;\n z-index: 1;\n inset-block-start: calc(2 * ${theme.base.spacing});\n inset-inline-end: 0;\n min-width: 1.5rem;\n min-height: 1.5rem;\n border: none;\n color: ${theme.base.palette['foreground-color']};\n box-shadow: ${theme.base.shadow.low};\n transition-property: background-color;\n transform: translateX(${ltr ? '50%' : '-50%'});\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n &[aria-expanded='${ltr ? 'true' : 'false'}'] {\n ${StyledIcon} {\n transform: rotateY(180deg);\n }\n }\n\n & + ${StyledTooltip} {\n z-index: calc(${theme.base['z-index'].drawer} + 1);\n }\n `;\n});\n\nStyledNavToggle.defaultProps = defaultThemeProp;\n\nexport const StyledHeader = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n width: 100%;\n min-height: 4rem;\n border-bottom: 0.0625rem solid ${borderColor};\n `;\n});\n\nStyledHeader.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerHeader = styled(StyledHeader)(({ theme }) => {\n return css`\n padding-inline-start: ${theme.base.spacing};\n `;\n});\n\nStyledDrawerHeader.defaultProps = defaultThemeProp;\n\nexport const StyledNavHeaderIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.colors.white};\n `;\n});\n\nStyledNavHeaderIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavTitle = styled(Text)(({ theme }) => {\n return css`\n margin-inline-start: ${theme.base.spacing};\n color: ${theme.base.colors.white};\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow-x: hidden;\n `;\n});\n\nStyledNavTitle.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div<{ showDevMode: boolean }>(({ theme, showDevMode }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-bottom: calc(${showDevMode ? 2 : 0} * ${theme.base.spacing});\n border-top: 0.0625rem solid ${borderColor};\n ${StyledSwitch} {\n &:hover {\n background-color: ${hoverBg};\n }\n\n ${SwitchLabel} {\n height: calc(2rem + 4 * ${theme.base.spacing});\n padding: calc(2 * ${theme.base.spacing});\n text-transform: capitalize;\n color: ${theme.base.colors.gray.medium};\n font-weight: ${theme.base['font-weight'].bold};\n\n &::before,\n &::after {\n margin-inline-end: calc(2 * ${theme.base.spacing});\n }\n }\n }\n & > ul {\n list-style: none;\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledUtilItem = styled.li(({ theme }) => {\n return css`\n color: ${theme.base.colors.white};\n\n &:hover {\n background-color: rgba(0, 0, 0, 0.4);\n }\n\n &:focus,\n &:focus-within {\n color: ${theme.base.colors.blue.light};\n }\n\n ${StyledBareButton} {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n color: ${theme.base.colors.white};\n width: 100%;\n height: 100%;\n text-align: start;\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledUtilItem.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n const { drawerOpen } = useContext(AppShellContext);\n\n return css`\n height: ${drawerOpen ? 'calc(100% - 4rem)' : '100%'};\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledNavContent = styled.div(({ theme }) => {\n const { navExpanded, navState } = useContext(AppShellContext);\n\n return css`\n width: 14rem;\n height: 100%;\n opacity: 0;\n transition: opacity ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n\n ${navState === 'collapsed' &&\n css`\n display: none;\n `}\n\n ${navExpanded &&\n css`\n opacity: 1;\n `}\n `;\n});\n\nStyledNavContent.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main(({ theme }) => {\n return css`\n position: relative;\n height: calc(100vh - 3rem);\n background-color: ${theme.base.palette['app-background']};\n overflow-y: auto;\n transition: margin ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n `;\n});\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerWrapper = styled.div(() => {\n const { drawerOpen } = useContext(AppShellContext);\n\n return css`\n position: relative;\n height: ${drawerOpen ? '100%' : 'auto'};\n `;\n});\n\nStyledDrawerWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledNavHeaderVisual = styled.div<{ bgColor: string }>(({ theme, bgColor }) => {\n return css`\n min-width: 2rem;\n min-height: 2rem;\n border-radius: 0.4rem;\n background-color: ${bgColor};\n color: ${theme.base.colors.white};\n & svg {\n color: ${theme.base.colors.white};\n }\n `;\n});\n\nStyledNavHeaderVisual.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerCloseButton = styled(Button)(({ theme }) => {\n return css`\n min-width: 1.5rem;\n min-height: 1.5rem;\n color: ${theme.base.colors.white};\n\n ${StyledIcon} {\n width: 1em;\n height: 1em;\n }\n `;\n});\n\nStyledDrawerCloseButton.defaultProps = defaultThemeProp;\n\nexport const StyledInnerNav = styled.div(() => {\n const { navState } = useContext(AppShellContext);\n\n return css`\n height: 100%;\n ${(navState === 'collapsing' || navState === 'expanding') &&\n css`\n overflow: hidden;\n `}\n `;\n});\n\nStyledInnerNav.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(({ theme }) => {\n const { navExpanded } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n z-index: ${theme.base['z-index'].drawer};\n height: calc(100vh - 3rem);\n background: ${theme.components['app-shell'].nav['background-color']};\n\n &,\n ${StyledInnerNav} {\n width: ${navExpanded ? '14' : '1.5'}rem;\n transition: width ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${theme.base['border-radius']});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n\n &:not(:hover) {\n ${StyledNavToggle}[aria-expanded='true']:not(:focus) {\n ${hideVisually}\n }\n }\n\n /*\n * A hoverable area just outside the nav for easier mouse interaction with the collapse button.\n * As the collpase button straddles the nav boundary, so maybe too should the hoverable area.\n */\n &::after {\n content: '';\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 100%;\n width: calc(2 * ${theme.base.spacing});\n height: 100%;\n }\n\n ${StyledStandardTree} {\n color: ${theme.base.colors.white};\n\n ${StyledNodeText} {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n\n ${StyledNodeInteraction} {\n &:hover,\n &[aria-current='true'] {\n background-color: ${hoverBg};\n }\n\n &[aria-current='true'] {\n ${StyledNodeIcon},\n ${StyledNodeText} {\n color: ${theme.base.colors.blue.light};\n }\n }\n }\n }\n\n /* Style for main is here since nav(the \"&\") may be conditionally rendered. */\n & + ${StyledMain} {\n margin-inline-start: ${navExpanded ? '14rem' : '1.5rem'};\n }\n `;\n});\n\nStyledNav.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,UAAU,EACV,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAC5F,OAAO,EACL,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,iEAAiE,CAAC;AAEzE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,GAAG,oBAAoB,CAAC;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1D,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAE/B,OAAO,GAAG,CAAA;;;kCAGsB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;aAKvC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;kBACjC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG;;4BAEX,GAAG,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AC,WAAW,CAAC;;;QAGrD,qBAAqB;;;8BAGC,OAAO;;;;YAIzB,cAAc;YACd,cAAc;qBACL,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;;;;;;;UAOvC,UAAU;6BACS,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;;GAE1D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, hideVisually } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n Icon,\n Text,\n tryCatch,\n defaultThemeProp,\n Button,\n useDirection,\n StyledIcon,\n StyledTooltip\n} from '@pega/cosmos-react-core';\nimport { StyledSwitch, SwitchLabel } from '@pega/cosmos-react-core/lib/components/Switch/Switch';\nimport { StyledBareButton } from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport {\n StyledNodeIcon,\n StyledNodeText,\n StyledNodeInteraction,\n StyledStandardTree\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nimport AppShellContext from './AppShellContext';\n\nconst hoverBg = 'rgba(0, 0, 0, 0.4)';\n\nexport const StyledNavToggle = styled(Button)(({ theme }) => {\n const { ltr } = useDirection();\n\n return css`\n position: absolute;\n z-index: 1;\n inset-block-start: calc(2 * ${theme.base.spacing});\n inset-inline-end: 0;\n min-width: 1.5rem;\n min-height: 1.5rem;\n border: none;\n color: ${theme.base.palette['foreground-color']};\n box-shadow: ${theme.base.shadow.low};\n transition-property: background-color;\n transform: translateX(${ltr ? '50%' : '-50%'});\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n &[aria-expanded='${ltr ? 'true' : 'false'}'] {\n ${StyledIcon} {\n transform: rotateY(180deg);\n }\n }\n\n & + ${StyledTooltip} {\n z-index: calc(${theme.base['z-index'].drawer} + 1);\n }\n `;\n});\n\nStyledNavToggle.defaultProps = defaultThemeProp;\n\nexport const StyledHeader = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n width: 100%;\n min-height: 4rem;\n border-bottom: 0.0625rem solid ${borderColor};\n `;\n});\n\nStyledHeader.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerHeader = styled(StyledHeader)(({ theme }) => {\n return css`\n padding-inline-start: ${theme.base.spacing};\n `;\n});\n\nStyledDrawerHeader.defaultProps = defaultThemeProp;\n\nexport const StyledNavHeaderIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.colors.white};\n `;\n});\n\nStyledNavHeaderIcon.defaultProps = defaultThemeProp;\n\nexport const StyledNavTitle = styled(Text)(({ theme }) => {\n return css`\n color: ${theme.base.colors.white};\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow-x: hidden;\n `;\n});\n\nStyledNavTitle.defaultProps = defaultThemeProp;\n\nexport const StyledUtils = styled.div<{ showDevMode: boolean }>(({ theme, showDevMode }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n padding-bottom: calc(${showDevMode ? 2 : 0} * ${theme.base.spacing});\n border-top: 0.0625rem solid ${borderColor};\n ${StyledSwitch} {\n &:hover {\n background-color: ${hoverBg};\n }\n\n ${SwitchLabel} {\n height: calc(2rem + 4 * ${theme.base.spacing});\n padding: calc(2 * ${theme.base.spacing});\n text-transform: capitalize;\n color: ${theme.base.colors.gray.light};\n font-weight: ${theme.base['font-weight'].bold};\n\n &::before,\n &::after {\n margin-inline-end: calc(2 * ${theme.base.spacing});\n }\n }\n }\n & > ul {\n list-style: none;\n }\n `;\n});\n\nStyledUtils.defaultProps = defaultThemeProp;\n\nexport const StyledUtilItem = styled.li(({ theme }) => {\n return css`\n color: ${theme.base.colors.white};\n\n &:hover {\n background-color: rgba(0, 0, 0, 0.4);\n }\n\n &:focus,\n &:focus-within {\n color: ${theme.base.colors.blue.light};\n }\n\n ${StyledBareButton} {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n color: ${theme.base.colors.white};\n width: 100%;\n height: 100%;\n text-align: start;\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledUtilItem.defaultProps = defaultThemeProp;\n\nexport const StyledScrollWrap = styled.div(() => {\n const { drawerOpen } = useContext(AppShellContext);\n\n return css`\n height: ${drawerOpen ? 'calc(100% - 4rem)' : '100%'};\n overflow-y: auto;\n `;\n});\n\nStyledScrollWrap.defaultProps = defaultThemeProp;\n\nexport const StyledNavContent = styled.div(({ theme }) => {\n const { navExpanded, navState } = useContext(AppShellContext);\n\n return css`\n width: 14rem;\n height: 100%;\n opacity: 0;\n transition: opacity ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n\n ${navState === 'collapsed' &&\n css`\n display: none;\n `}\n\n ${navExpanded &&\n css`\n opacity: 1;\n `}\n `;\n});\n\nStyledNavContent.defaultProps = defaultThemeProp;\n\nexport const StyledMain = styled.main(({ theme }) => {\n return css`\n position: relative;\n height: calc(100vh - 3rem);\n background-color: ${theme.base.palette['app-background']};\n overflow-y: auto;\n transition: margin ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n `;\n});\n\nStyledMain.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerWrapper = styled.div(() => {\n const { drawerOpen } = useContext(AppShellContext);\n\n return css`\n position: relative;\n height: ${drawerOpen ? '100%' : 'auto'};\n `;\n});\n\nStyledDrawerWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledNavHeaderVisual = styled.div<{ bgColor: string }>(({ theme, bgColor }) => {\n return css`\n min-width: 2rem;\n min-height: 2rem;\n border-radius: 0.4rem;\n background-color: ${bgColor};\n margin-inline-end: ${theme.base.spacing};\n color: ${theme.base.colors.white};\n & svg {\n color: ${theme.base.colors.white};\n }\n `;\n});\n\nStyledNavHeaderVisual.defaultProps = defaultThemeProp;\n\nexport const StyledDrawerCloseButton = styled(Button)(({ theme }) => {\n return css`\n margin-inline-end: ${theme.base.spacing};\n min-width: 1.5rem;\n min-height: 1.5rem;\n color: ${theme.base.colors.white};\n\n ${StyledIcon} {\n width: 1em;\n height: 1em;\n }\n `;\n});\n\nStyledDrawerCloseButton.defaultProps = defaultThemeProp;\n\nexport const StyledInnerNav = styled.div(() => {\n const { navState } = useContext(AppShellContext);\n\n return css`\n height: 100%;\n ${(navState === 'collapsing' || navState === 'expanding') &&\n css`\n overflow: hidden;\n `}\n `;\n});\n\nStyledInnerNav.defaultProps = defaultThemeProp;\n\nexport const StyledNav = styled.nav(({ theme }) => {\n const { navExpanded } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n z-index: ${theme.base['z-index'].drawer};\n height: calc(100vh - 3rem);\n background: ${theme.components['app-shell'].nav['background-color']};\n\n &,\n ${StyledInnerNav} {\n width: ${navExpanded ? '14' : '1.5'}rem;\n transition: width ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n }\n\n ${theme.base['custom-scrollbar'] &&\n css`\n * {\n scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);\n scrollbar-width: thin;\n }\n\n @supports not ((scrollbar-width: thin) or (scrollbar-color: black white)) {\n /* stylelint-disable unit-allowed-list */\n\n *::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n *::-webkit-scrollbar-track {\n background-color: rgba(0, 0, 0, 0.2);\n }\n\n *::-webkit-scrollbar-corner {\n background-color: rgba(0, 0, 0, 0.2);\n border-bottom-right-radius: inherit;\n }\n\n *::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 3px solid transparent;\n border-radius: calc(1.125 * ${theme.base['border-radius']});\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.6);\n }\n\n *::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 2px 4px rgba(255, 255, 255, 0.7);\n }\n\n *::-webkit-scrollbar-track:horizontal {\n border-bottom-left-radius: inherit;\n }\n\n *::-webkit-scrollbar-track:vertical {\n border-top-right-radius: inherit;\n }\n\n /* stylelint-disable-next-line selector-pseudo-class-no-unknown */\n *::-webkit-scrollbar-track:not(:corner-present) {\n border-bottom-right-radius: inherit;\n }\n\n /* stylelint-enable unit-allowed-list */\n }\n `}\n\n &:not(:hover) {\n ${StyledNavToggle}[aria-expanded='true']:not(:focus) {\n ${hideVisually}\n }\n }\n\n /*\n * A hoverable area just outside the nav for easier mouse interaction with the collapse button.\n * As the collpase button straddles the nav boundary, so maybe too should the hoverable area.\n */\n &::after {\n content: '';\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 100%;\n width: calc(2 * ${theme.base.spacing});\n height: 100%;\n }\n\n ${StyledStandardTree} {\n color: ${theme.base.colors.white};\n\n ${StyledNodeText} {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n\n ${StyledNodeInteraction} {\n &:hover,\n &[aria-current='true'] {\n background-color: ${hoverBg};\n }\n\n &[aria-current='true'] {\n ${StyledNodeIcon},\n ${StyledNodeText} {\n color: ${theme.base.colors.blue.light};\n }\n }\n }\n }\n\n /* Style for main is here since nav(the \"&\") may be conditionally rendered. */\n & + ${StyledMain} {\n margin-inline-start: ${navExpanded ? '14rem' : '1.5rem'};\n }\n `;\n});\n\nStyledNav.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FunctionComponent, Ref } from 'react';
|
|
2
|
+
import { ForwardProps, BaseProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StageItemProps, CategoryItemProps, CategoriesItemProps } from './LifeCycle.types';
|
|
4
|
+
import { TaskProps } from './Task';
|
|
5
|
+
export interface CategoriesProps extends CategoriesItemProps {
|
|
6
|
+
height?: number;
|
|
7
|
+
elementId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CategoryProps extends BaseProps {
|
|
10
|
+
ref?: Ref<HTMLOListElement>;
|
|
11
|
+
item: CategoryItemProps;
|
|
12
|
+
showTitle?: boolean;
|
|
13
|
+
category?: CategoriesProps;
|
|
14
|
+
/** Task component prop */
|
|
15
|
+
task: TaskProps;
|
|
16
|
+
/** Stage data - to be passed in callbacks */
|
|
17
|
+
stageItem: StageItemProps;
|
|
18
|
+
/** Id for the component */
|
|
19
|
+
id?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const StyledCategory: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {
|
|
22
|
+
showTitle: boolean;
|
|
23
|
+
}, never>;
|
|
24
|
+
export declare const StyledList: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {
|
|
25
|
+
category?: CategoriesProps | undefined;
|
|
26
|
+
id: string;
|
|
27
|
+
}, never>;
|
|
28
|
+
export declare const StyledParallelTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
29
|
+
export declare const StyledAddTask: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
30
|
+
declare const Category: FunctionComponent<CategoryProps & ForwardProps>;
|
|
31
|
+
export default Category;
|
|
32
|
+
//# sourceMappingURL=Category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAc,GAAG,EAAyC,MAAM,OAAO,CAAC;AAGlG,OAAO,EACL,YAAY,EACZ,SAAS,EASV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAa,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAE1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAE5B,IAAI,EAAE,iBAAiB,CAAC;IAExB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,0BAA0B;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,6CAA6C;IAC7C,SAAS,EAAE,cAAc,CAAC;IAC1B,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,cAAc;eAA0B,OAAO;SAQ1D,CAAC;AAEH,eAAO,MAAM,UAAU;eAA0B,eAAe,GAAG,SAAS;QAAM,MAAM;SAUvF,CAAC;AAEF,eAAO,MAAM,mBAAmB,yGA0B9B,CAAC;AAEH,eAAO,MAAM,aAAa,yGAaxB,CAAC;AAIH,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA+G7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, Fragment } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { Flex, Button, Icon, Tooltip, useElement, useI18n, createUID, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
import Task from './Task';
|
|
6
|
+
export const StyledCategory = styled.h3(({ showTitle, theme }) => {
|
|
7
|
+
return css `
|
|
8
|
+
${!showTitle &&
|
|
9
|
+
css `
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
`}
|
|
12
|
+
margin: ${theme.base.spacing} 0 0 0;
|
|
13
|
+
`;
|
|
14
|
+
});
|
|
15
|
+
export const StyledList = styled.ol(({ category, theme, id }) => {
|
|
16
|
+
return css `
|
|
17
|
+
margin-block-start: ${theme.base.spacing};
|
|
18
|
+
margin-block-end: calc(2 * ${theme.base.spacing});
|
|
19
|
+
${category?.elementId !== id &&
|
|
20
|
+
` min-height: ${category?.height ? `${category.height}px` : 'auto'};
|
|
21
|
+
`}
|
|
22
|
+
`;
|
|
23
|
+
});
|
|
24
|
+
export const StyledParallelTitle = styled.div(({ theme }) => {
|
|
25
|
+
return css `
|
|
26
|
+
position: relative;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
margin-block-end: 0.5rem;
|
|
29
|
+
text-align: center;
|
|
30
|
+
&::before {
|
|
31
|
+
border-block-start: calc(0.2 * ${theme.base.spacing}) solid ${theme.base.colors.slate.medium};
|
|
32
|
+
content: '';
|
|
33
|
+
margin: 0 auto;
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 50%;
|
|
36
|
+
left: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
bottom: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
z-index: -1;
|
|
41
|
+
}
|
|
42
|
+
span {
|
|
43
|
+
background: ${theme.base.colors.slate.medium};
|
|
44
|
+
padding: 0 ${theme.base.spacing};
|
|
45
|
+
border-radius: calc(0.25 * ${theme.base['border-radius']});
|
|
46
|
+
color: ${theme.base.colors.white};
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
});
|
|
51
|
+
export const StyledAddTask = styled.div(({ theme }) => {
|
|
52
|
+
return css `
|
|
53
|
+
> button {
|
|
54
|
+
background: ${theme.base.palette['secondary-background']};
|
|
55
|
+
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
56
|
+
width: 100%;
|
|
57
|
+
justify-content: flex-start;
|
|
58
|
+
padding: calc(1 * ${theme.base.spacing}) calc(1.75 * ${theme.base.spacing});
|
|
59
|
+
> div {
|
|
60
|
+
margin: 0 calc(2 * ${theme.base.spacing});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
});
|
|
65
|
+
StyledAddTask.defaultProps = defaultThemeProp;
|
|
66
|
+
const Category = forwardRef(({ item, showTitle = false, stageItem, category, id, task, ...restProps }, ref) => {
|
|
67
|
+
const [addTaskEl, setAddTaskEl] = useElement();
|
|
68
|
+
let showAddTaskButton = true;
|
|
69
|
+
const t = useI18n();
|
|
70
|
+
if (task?.addTask?.showOnce && item?.tasks?.length !== 0) {
|
|
71
|
+
showAddTaskButton = false;
|
|
72
|
+
}
|
|
73
|
+
/* Call back for click of add task button */
|
|
74
|
+
const onAddTaskClick = (e) => {
|
|
75
|
+
const param = {
|
|
76
|
+
category: item,
|
|
77
|
+
stage: stageItem
|
|
78
|
+
};
|
|
79
|
+
task?.addTask.onAddTask?.(param, e);
|
|
80
|
+
};
|
|
81
|
+
return (_jsxs(_Fragment, { children: [category?.label && (_jsx(StyledCategory, Object.assign({ showTitle: showTitle, tabIndex: -1, id: item?.categoryId }, { children: category?.label }), void 0)), _jsxs(StyledList, Object.assign({ ref: ref, role: 'gridcell', category: category, id: item?.id, "data-id": item?.categoryId }, { children: [item &&
|
|
82
|
+
item.tasks.length !== 0 &&
|
|
83
|
+
item.tasks.map((TaskItem, index) => {
|
|
84
|
+
if (Array.isArray(TaskItem)) {
|
|
85
|
+
if (task && task.addTask && task.addTask.showOnce && TaskItem.length !== 0) {
|
|
86
|
+
showAddTaskButton = false;
|
|
87
|
+
}
|
|
88
|
+
/* Using creatUID instead of useUID, since it is a list item and multiple ref is trying to get created which causes issue */
|
|
89
|
+
const parallelListItemId = createUID();
|
|
90
|
+
return (_jsxs(Fragment, { children: [index !== 0 && (_jsx(Flex, Object.assign({ as: StyledParallelTitle, container: { justify: 'center' } }, { children: _jsx("span", { children: t('parallel') }, void 0) }), void 0)), TaskItem.map((parallelTask) => {
|
|
91
|
+
return (_jsx(Task, Object.assign({ id: parallelTask.id, value: parallelTask.label, item: parallelTask, visual: parallelTask.visual, stageItem: stageItem, categoryItem: item, error: parallelTask.error }, task, restProps), parallelTask.id));
|
|
92
|
+
})] }, parallelListItemId));
|
|
93
|
+
}
|
|
94
|
+
return (_jsx(Task, Object.assign({ id: TaskItem.id, value: TaskItem.label, item: TaskItem, visual: TaskItem.visual, stageItem: stageItem, categoryItem: item, onAddStep: task?.onAddStep, error: TaskItem.error }, task, restProps), TaskItem.id));
|
|
95
|
+
}), (showAddTaskButton || !item) && (_jsxs(_Fragment, { children: [_jsx(Flex, Object.assign({ as: StyledAddTask }, { children: _jsxs(Button, Object.assign({ variant: 'simple', icon: true, ref: setAddTaskEl, onClick: onAddTaskClick }, { children: [_jsx(Icon, { name: 'plus' }, void 0), _jsx(Flex, { children: task?.addTask.title }, void 0)] }), void 0) }), void 0), _jsx(Tooltip, Object.assign({ target: addTaskEl, "aria-hidden": 'true' }, { children: `${t('add')} ${task?.addTask.title}` }), void 0)] }, void 0))] }), void 0)] }, void 0));
|
|
96
|
+
});
|
|
97
|
+
export default Category;
|
|
98
|
+
//# sourceMappingURL=Category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAO,QAAQ,EAA+B,MAAM,OAAO,CAAC;AAClG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAGL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,IAAmB,MAAM,QAAQ,CAAC;AAwBzC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAyB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IACvF,OAAO,GAAG,CAAA;MACN,CAAC,SAAS;QACZ,GAAG,CAAA;;KAEF;cACS,KAAK,CAAC,IAAI,CAAC,OAAO;GAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,C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Q,CAAC,EAAE,CAWhB,CACH,CAAC;wBACJ,CAAC,CAAC,EACH,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,IAAI,CAC/B,8BACE,KAAC,IAAI,kBAAC,EAAE,EAAE,aAAa,gBACrB,MAAC,MAAM,kBAAC,OAAO,EAAC,QAAQ,EAAC,IAAI,QAAC,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,iBACtE,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,WAAG,EACpB,KAAC,IAAI,cAAE,IAAI,EAAE,OAAO,CAAC,KAAK,WAAQ,aAC3B,YACJ,EACP,KAAC,OAAO,kBAAC,MAAM,EAAE,SAAS,iBAAc,MAAM,gBAC3C,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,YAC7B,YACT,CACJ,aACU,YACZ,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, Ref, Fragment, PropsWithoutRef, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n ForwardProps,\n BaseProps,\n Flex,\n Button,\n Icon,\n Tooltip,\n useElement,\n useI18n,\n createUID,\n defaultThemeProp\n} from '@pega/cosmos-react-core';\n\nimport {\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam\n} from './LifeCycle.types';\nimport Task, { TaskProps } from './Task';\n\nexport interface CategoriesProps extends CategoriesItemProps {\n /* height property used to manipulate height of catergory dom */\n height?: number;\n elementId?: string;\n}\n\nexport interface CategoryProps extends BaseProps {\n ref?: Ref<HTMLOListElement>;\n /* Pass the category items */\n item: CategoryItemProps;\n /* Enable the title for categories */\n showTitle?: boolean;\n /* Props of the categoryColumn */\n category?: CategoriesProps;\n /** Task component prop */\n task: TaskProps;\n /** Stage data - to be passed in callbacks */\n stageItem: StageItemProps;\n /** Id for the component */\n id?: string;\n}\n\nexport const StyledCategory = styled.h3<{ showTitle: boolean }>(({ showTitle, theme }) => {\n return css`\n ${!showTitle &&\n css`\n visibility: hidden;\n `}\n margin: ${theme.base.spacing} 0 0 0;\n `;\n});\n\nexport const StyledList = styled.ol<{ category?: CategoriesProps | undefined; id: string }>(\n ({ category, theme, id }) => {\n return css`\n margin-block-start: ${theme.base.spacing};\n margin-block-end: calc(2 * ${theme.base.spacing});\n ${category?.elementId !== id &&\n ` min-height: ${category?.height ? `${category.height}px` : 'auto'};\n `}\n `;\n }\n);\n\nexport const StyledParallelTitle = styled.div(({ theme }) => {\n return css`\n position: relative;\n z-index: 1;\n margin-block-end: 0.5rem;\n text-align: center;\n &::before {\n border-block-start: calc(0.2 * ${theme.base.spacing}) solid ${theme.base.colors.slate.medium};\n content: '';\n margin: 0 auto;\n position: absolute;\n top: 50%;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n z-index: -1;\n }\n span {\n background: ${theme.base.colors.slate.medium};\n padding: 0 ${theme.base.spacing};\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n color: ${theme.base.colors.white};\n text-transform: uppercase;\n }\n `;\n});\n\nexport const StyledAddTask = styled.div(({ theme }) => {\n return css`\n > button {\n background: ${theme.base.palette['secondary-background']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n width: 100%;\n justify-content: flex-start;\n padding: calc(1 * ${theme.base.spacing}) calc(1.75 * ${theme.base.spacing});\n > div {\n margin: 0 calc(2 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledAddTask.defaultProps = defaultThemeProp;\n\nconst Category: FunctionComponent<CategoryProps & ForwardProps> = forwardRef(\n (\n {\n item,\n showTitle = false,\n stageItem,\n category,\n id,\n task,\n ...restProps\n }: PropsWithoutRef<CategoryProps>,\n ref: CategoryProps['ref']\n ) => {\n const [addTaskEl, setAddTaskEl] = useElement();\n let showAddTaskButton = true;\n const t = useI18n();\n\n if (task?.addTask?.showOnce && item?.tasks?.length !== 0) {\n showAddTaskButton = false;\n }\n /* Call back for click of add task button */\n const onAddTaskClick = (e: MouseEvent<HTMLButtonElement>) => {\n const param: LifeCycleActionParam = {\n category: item,\n stage: stageItem\n };\n task?.addTask.onAddTask?.(param, e);\n };\n\n return (\n <>\n {category?.label && (\n <StyledCategory showTitle={showTitle} tabIndex={-1} id={item?.categoryId}>\n {category?.label}\n </StyledCategory>\n )}\n <StyledList\n ref={ref}\n role='gridcell'\n category={category}\n id={item?.id}\n data-id={item?.categoryId}\n >\n {item &&\n item.tasks.length !== 0 &&\n item.tasks.map((TaskItem: TaskItemProps | TaskItemProps[], index: number) => {\n if (Array.isArray(TaskItem)) {\n if (task && task.addTask && task.addTask.showOnce && TaskItem.length !== 0) {\n showAddTaskButton = false;\n }\n /* Using creatUID instead of useUID, since it is a list item and multiple ref is trying to get created which causes issue */\n const parallelListItemId = createUID();\n return (\n <Fragment key={parallelListItemId}>\n {index !== 0 && (\n <Flex as={StyledParallelTitle} container={{ justify: 'center' }}>\n <span>{t('parallel')}</span>\n </Flex>\n )}\n {TaskItem.map((parallelTask: TaskItemProps) => {\n return (\n <Task\n key={parallelTask.id}\n id={parallelTask.id}\n value={parallelTask.label}\n item={parallelTask}\n visual={parallelTask.visual}\n stageItem={stageItem}\n categoryItem={item}\n error={parallelTask.error}\n {...task}\n {...restProps}\n />\n );\n })}\n </Fragment>\n );\n }\n return (\n <Task\n key={TaskItem.id}\n id={TaskItem.id}\n value={TaskItem.label}\n item={TaskItem}\n visual={TaskItem.visual}\n stageItem={stageItem}\n categoryItem={item}\n onAddStep={task?.onAddStep}\n error={TaskItem.error}\n {...task}\n {...restProps}\n />\n );\n })}\n {(showAddTaskButton || !item) && (\n <>\n <Flex as={StyledAddTask}>\n <Button variant='simple' icon ref={setAddTaskEl} onClick={onAddTaskClick}>\n <Icon name='plus' />\n <Flex>{task?.addTask.title}</Flex>\n </Button>\n </Flex>\n <Tooltip target={addTaskEl} aria-hidden='true'>\n {`${t('add')} ${task?.addTask.title}`}\n </Tooltip>\n </>\n )}\n </StyledList>\n </>\n );\n }\n);\n\nexport default Category;\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FunctionComponent, Ref } from 'react';
|
|
2
|
+
import { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StageItemProps } from './LifeCycle.types';
|
|
4
|
+
import { StageProps } from './Stage';
|
|
5
|
+
import { CategoriesProps } from './Category';
|
|
6
|
+
import { TaskProps } from './Task';
|
|
7
|
+
import { StepProps } from './Step';
|
|
8
|
+
export interface LifeCycleProps extends BaseProps {
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
|
+
items: StageItemProps[];
|
|
11
|
+
alternateItems?: StageItemProps[];
|
|
12
|
+
task: TaskProps[];
|
|
13
|
+
stage: StageProps;
|
|
14
|
+
alternateStage: StageProps;
|
|
15
|
+
categories: CategoriesProps[];
|
|
16
|
+
step: StepProps[];
|
|
17
|
+
onAddStage: () => void;
|
|
18
|
+
onAddAlternateStage: () => void;
|
|
19
|
+
}
|
|
20
|
+
declare const LifeCycle: FunctionComponent<LifeCycleProps & ForwardProps>;
|
|
21
|
+
export default LifeCycle;
|
|
22
|
+
//# sourceMappingURL=LifeCycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LifeCycle.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,SAAS,EACT,YAAY,EAKb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,WAAW,cAAe,SAAQ,SAAS;IAE/C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAE1B,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;IAElC,IAAI,EAAE,SAAS,EAAE,CAAC;IAElB,KAAK,EAAE,UAAU,CAAC;IAElB,cAAc,EAAE,UAAU,CAAC;IAE3B,UAAU,EAAE,eAAe,EAAE,CAAC;IAE9B,IAAI,EAAE,SAAS,EAAE,CAAC;IAElB,UAAU,EAAE,MAAM,IAAI,CAAC;IAEvB,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC;AAeD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAmI/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { defaultThemeProp, Flex, Button, Icon, useI18n } from '@pega/cosmos-react-core';
|
|
5
|
+
import LifeCycleList from './LifeCycleList';
|
|
6
|
+
const StyledLifeCycle = styled.ol ``;
|
|
7
|
+
StyledLifeCycle.defaultProps = defaultThemeProp;
|
|
8
|
+
const StyledAddButton = styled(Button)(({ theme }) => {
|
|
9
|
+
return css `
|
|
10
|
+
align-self: flex-start;
|
|
11
|
+
margin-block-start: calc(${theme.base.spacing} / 2);
|
|
12
|
+
`;
|
|
13
|
+
});
|
|
14
|
+
StyledAddButton.defaultProps = defaultThemeProp;
|
|
15
|
+
const LifeCycle = forwardRef(({ items, categories, alternateItems = [], onAddStage, onAddAlternateStage, stage, alternateStage, ...restProps }, ref) => {
|
|
16
|
+
const lifeCycleEl = useRef(null);
|
|
17
|
+
const t = useI18n();
|
|
18
|
+
const locStage = t('stage');
|
|
19
|
+
const locAltStage = t('alternateStage');
|
|
20
|
+
const [categoriesState, setcategoriesState] = useState(categories);
|
|
21
|
+
const categoryElements = [];
|
|
22
|
+
const setRef = (element) => {
|
|
23
|
+
if (element) {
|
|
24
|
+
categoryElements.push(element);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
useLayoutEffect(() => {
|
|
28
|
+
let isHeightChanged = false;
|
|
29
|
+
const categoriesColumn = [...categories];
|
|
30
|
+
if (categoriesColumn && categoriesColumn.length > 0) {
|
|
31
|
+
categoriesColumn.forEach((categoryItem, index) => {
|
|
32
|
+
const categoryElm = [...categoryElements];
|
|
33
|
+
let isActiveElement = false;
|
|
34
|
+
const categoryComponent = categoryElm.filter((element) => {
|
|
35
|
+
if (element.getAttribute('data-id') === categoryItem.id) {
|
|
36
|
+
if (categoryItem.elementId === element.getAttribute('id')) {
|
|
37
|
+
isActiveElement = true;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
if (!isActiveElement) {
|
|
44
|
+
categoryItem.elementId = '';
|
|
45
|
+
categoryItem.height = 0;
|
|
46
|
+
}
|
|
47
|
+
categoryComponent.forEach(categoryElement => {
|
|
48
|
+
const columnHeight = categoryItem?.height ?? 0;
|
|
49
|
+
const height = categoryElement.scrollHeight;
|
|
50
|
+
const elementId = categoryElement.getAttribute('id');
|
|
51
|
+
if (height > columnHeight ||
|
|
52
|
+
(categoryItem.elementId === elementId && height !== columnHeight)) {
|
|
53
|
+
isHeightChanged = true;
|
|
54
|
+
categoriesColumn[index].height = height;
|
|
55
|
+
if (elementId)
|
|
56
|
+
categoriesColumn[index].elementId = elementId;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
if (isHeightChanged) {
|
|
61
|
+
isHeightChanged = false;
|
|
62
|
+
setcategoriesState(categoriesColumn);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return (_jsxs(Flex, Object.assign({ container: { itemGap: 2 }, ref: ref }, { children: [_jsxs(Flex, Object.assign({ as: StyledLifeCycle, ref: lifeCycleEl, container: true, role: 'grid', "aria-label": locStage }, { children: [items.map((stageItem, index, stageArray) => {
|
|
67
|
+
const listId = stageItem.id;
|
|
68
|
+
return (_jsx(LifeCycleList, Object.assign({ id: listId, item: stageItem, isFirstItem: index === 0, isLastItem: index === stageArray.length - 1, ref: setRef, stage: stage, categories: categoriesState }, restProps), listId));
|
|
69
|
+
}), _jsx(StyledAddButton, Object.assign({ variant: 'simple', label: `${t('add')} ${locStage}`, icon: true, onClick: onAddStage }, { children: _jsx(Icon, { name: 'plus' }, void 0) }), void 0)] }), void 0), alternateItems.length !== 0 && (_jsxs(Flex, Object.assign({ as: StyledLifeCycle, container: true, ref: lifeCycleEl, role: 'grid', "aria-label": locAltStage }, { children: [alternateItems.map((stageItem) => {
|
|
70
|
+
const listId = stageItem.id;
|
|
71
|
+
return (_jsx(LifeCycleList, Object.assign({ id: listId, item: stageItem, ref: setRef, categories: categoriesState, stageVariant: 'alternate', stage: alternateStage }, restProps), listId));
|
|
72
|
+
}), _jsx(StyledAddButton, Object.assign({ variant: 'simple', label: `${t('add')} ${locAltStage}`, icon: true, onClick: onAddAlternateStage }, { children: _jsx(Icon, { name: 'plus' }, void 0) }), void 0)] }), void 0))] }), void 0));
|
|
73
|
+
});
|
|
74
|
+
export default LifeCycle;
|
|
75
|
+
//# sourceMappingURL=LifeCycle.js.map
|