@pega/cosmos-react-wss 10.0.0-build.12.3 → 10.0.0-build.12.5
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/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +16 -4
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +9 -2
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAuB7D,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,yBAAyB,CAAC;AAcjE,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,kBAAkB,CAAC;AAE9D,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAwV9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { parseToHsl } from 'polished';
|
|
3
|
-
import { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
-
import { useBreakpoint, Card, CardContent, Flex, Tabs, TabPanel, Text, useI18n, Icon, useAfterInitialEffect, getEdge, useDirection, throttle, readableColor, tryCatch, useTheme, MetaList } from '@pega/cosmos-react-core';
|
|
3
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { useBreakpoint, Card, CardContent, Flex, Tabs, TabPanel, Text, useI18n, Icon, useAfterInitialEffect, getEdge, useDirection, throttle, readableColor, tryCatch, useTheme, MetaList, useConfiguration, focusHeadingOrContainer } from '@pega/cosmos-react-core';
|
|
5
5
|
import { StyledCaseHeaderPromotedAction } from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';
|
|
6
6
|
import { StyledAside, StyledCaseHeader, StyledCaseView, StyledCaseViewIcon, StyledCaseHeaderMenuButton, StyledSubheading, StyledContentContainer, StyledContent, resolveCaseTypeColor } from './CaseView.styles';
|
|
7
7
|
const CaseView = ({ caseId, heading, subheading, icon, color, actions, stages, tasks, summary, details, tabs: detailTabs, feed, utility, promotedActions = [], ...restProps }) => {
|
|
8
8
|
const isMediumOrAbove = useBreakpoint('md');
|
|
9
9
|
const t = useI18n();
|
|
10
|
-
const tabsRef = useRef(null);
|
|
11
10
|
const theme = useTheme();
|
|
11
|
+
const { loadedRef } = useConfiguration();
|
|
12
|
+
const tabsRef = useRef(null);
|
|
13
|
+
const caseViewRef = useRef(null);
|
|
12
14
|
const { iconForeground, iconBackground } = useMemo(() => {
|
|
13
15
|
const backgroundSetting = theme.components['case-view'].icon.background;
|
|
14
16
|
const foregroundSetting = theme.components['case-view'].icon.color;
|
|
@@ -76,6 +78,16 @@ const CaseView = ({ caseId, heading, subheading, icon, color, actions, stages, t
|
|
|
76
78
|
const wrapActionsBreakpoint = useRef(null);
|
|
77
79
|
const { ltr } = useDirection();
|
|
78
80
|
const actionsIconOnly = promotedActions.length > 0 || !isMediumOrAbove;
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!caseViewRef.current)
|
|
83
|
+
return;
|
|
84
|
+
if (loadedRef.current) {
|
|
85
|
+
focusHeadingOrContainer(caseViewRef.current, heading);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
loadedRef.current = true;
|
|
89
|
+
}
|
|
90
|
+
}, [caseId]);
|
|
79
91
|
useAfterInitialEffect(() => {
|
|
80
92
|
setCurrentTabId(cur => {
|
|
81
93
|
if (tabs.length === 0)
|
|
@@ -118,7 +130,7 @@ const CaseView = ({ caseId, heading, subheading, icon, color, actions, stages, t
|
|
|
118
130
|
resizeObserver.disconnect();
|
|
119
131
|
};
|
|
120
132
|
}, [contentEl, actionsContainerEl, headerEl, promotedActions, heading, wrapPromotedActions]);
|
|
121
|
-
return (_jsxs(StyledCaseView, { ...restProps, children: [_jsx(StyledCaseHeader, { computeButtonFgColor: !isMediumOrAbove || promotedActions.length > 0, "$color": color, children: _jsxs(Flex, { container: {
|
|
133
|
+
return (_jsxs(StyledCaseView, { ref: caseViewRef, ...restProps, children: [_jsx(StyledCaseHeader, { computeButtonFgColor: !isMediumOrAbove || promotedActions.length > 0, "$color": color, children: _jsxs(Flex, { container: {
|
|
122
134
|
direction: 'column',
|
|
123
135
|
justify: 'between',
|
|
124
136
|
pad: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EACL,aAAa,EACb,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,qBAAqB,EACrB,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,8BAA8B,EAAE,MAAM,iEAAiE,CAAC;AAEjH,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB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BAAa,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,aAChE,KAAK,EAAE,OAAO,IAAI,CACjB,cAAK,IAAI,EAAC,QAAQ,gBAAa,KAAK,EAAE,KAAK,YACxC,KAAK,CAAC,OAAO,GACV,CACP,EACA,uBAAuB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CACpC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CACf,cAAK,IAAI,EAAC,QAAQ,gBAAa,MAAM,CAAC,KAAK,YACzC,KAAC,IAAI,cACH,KAAC,WAAW,cACV,KAAC,aAAa,cAAE,MAAM,CAAC,OAAO,GAAiB,GACnC,GACT,IALyC,MAAM,CAAC,EAAE,CAMrD,CACP,CAAC,CAAC,CAAC,IAAI,CACT,EACA,IAAI,EAAE,OAAO,IAAI,CAChB,cAAK,IAAI,EAAC,QAAQ,gBAAa,IAAI,EAAE,KAAK,YACvC,IAAI,CAAC,OAAO,GACT,CACP,IACI,IACF,CACR,IACI,IACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { parseToHsl } from 'polished';\nimport { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { FC, MouseEvent, PropsWithoutRef } from 'react';\n\nimport {\n useBreakpoint,\n Card,\n CardContent,\n Flex,\n Tabs,\n TabPanel,\n Text,\n useI18n,\n Icon,\n useAfterInitialEffect,\n getEdge,\n useDirection,\n throttle,\n readableColor,\n tryCatch,\n useTheme,\n MetaList\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps, Tab } from '@pega/cosmos-react-core';\nimport { StyledCaseHeaderPromotedAction } from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';\n\nimport {\n StyledAside,\n StyledCaseHeader,\n StyledCaseView,\n StyledCaseViewIcon,\n StyledCaseHeaderMenuButton,\n StyledSubheading,\n StyledContentContainer,\n StyledContent,\n resolveCaseTypeColor\n} from './CaseView.styles';\nimport type { CaseViewProps, Region } from './CaseView.types';\n\nconst CaseView: FC<CaseViewProps & ForwardProps> = ({\n caseId,\n heading,\n subheading,\n icon,\n color,\n actions,\n stages,\n tasks,\n summary,\n details,\n tabs: detailTabs,\n feed,\n utility,\n promotedActions = [],\n ...restProps\n}: PropsWithoutRef<CaseViewProps>) => {\n const isMediumOrAbove = useBreakpoint('md');\n const t = useI18n();\n const tabsRef = useRef<HTMLElement>(null);\n const theme = useTheme();\n\n const { iconForeground, iconBackground } = useMemo(() => {\n const backgroundSetting = theme.components['case-view'].icon.background;\n const foregroundSetting = theme.components['case-view'].icon.color;\n const headerForeground = theme.components['case-view'].header['foreground-color'];\n const headerBackground = theme.components['case-view'].header.background;\n\n const resolvedIconBackground =\n backgroundSetting !== 'auto'\n ? backgroundSetting\n : tryCatch(\n () => {\n const { lightness } = parseToHsl(headerBackground);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n },\n () => 'transparent'\n ) ?? 'transparent';\n\n let resolvedIconForeground =\n foregroundSetting !== 'auto' ? foregroundSetting : headerForeground;\n\n if (resolvedIconForeground === 'auto') {\n const caseTypeIconColor =\n color && theme.base['case-type-colors'] !== 'ignored'\n ? resolveCaseTypeColor(theme, color)\n : resolvedIconBackground;\n\n resolvedIconForeground = readableColor(caseTypeIconColor ?? resolvedIconBackground, {\n mode: 'light',\n level: 'AANonText'\n });\n }\n\n return {\n iconForeground: resolvedIconForeground,\n iconBackground: resolvedIconBackground\n };\n }, [theme, color]);\n\n const detailRegions = useMemo(() => {\n if (detailTabs?.length) return detailTabs;\n return details ? [details] : [];\n }, [detailTabs, details]);\n const identifiedDetailRegions = useMemo(\n () =>\n detailRegions.map((region, index) => ({ ...region, id: region.id ?? `details-${index}` })),\n [detailRegions]\n );\n\n const tabs = useMemo(() => {\n if (isMediumOrAbove) return [];\n const tabsArr: { id: string; name: Tab['name']; content: Region['content'] }[] = [];\n\n if (summary)\n tabsArr.push({\n id: 'summary',\n name: 'Summary',\n content: summary.content\n });\n identifiedDetailRegions.forEach(region => {\n tabsArr.push({\n id: region.id,\n name: region.label,\n content: region.content\n });\n });\n if (feed) tabsArr.push({ id: 'feed', name: 'Feed', content: feed.content });\n if (utility)\n tabsArr.push({\n id: 'utility',\n name: 'Utility',\n content: utility.content\n });\n\n return tabsArr;\n }, [isMediumOrAbove, summary, identifiedDetailRegions, feed, utility]);\n\n const [currentTabId, setCurrentTabId] = useState(tabs && tabs.length > 0 ? tabs[0].id : null);\n const [wrapPromotedActions, setWrapPromotedActions] = useState(false);\n const actionsContainerEl = useRef<HTMLDivElement>(null);\n const contentEl = useRef<HTMLDivElement>(null);\n const headerEl = useRef<HTMLDivElement>(null);\n const wrapActionsBreakpoint = useRef<number | null>(null);\n const { ltr } = useDirection();\n const actionsIconOnly = promotedActions.length > 0 || !isMediumOrAbove;\n\n useAfterInitialEffect(() => {\n setCurrentTabId(cur => {\n if (tabs.length === 0) return null;\n return cur && tabs.some(tab => tab.id === cur) ? cur : tabs[0].id;\n });\n }, [tabs]);\n\n useLayoutEffect(() => {\n if (\n !wrapPromotedActions &&\n contentEl.current &&\n actionsContainerEl.current &&\n headerEl.current\n ) {\n const contentStart = getEdge({\n el: contentEl.current,\n side: 'leading',\n ltr\n });\n\n const headerGroupEnd = getEdge({\n el: headerEl.current,\n side: 'trailing',\n ltr\n });\n const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;\n\n wrapActionsBreakpoint.current =\n Math.abs(Math.ceil(contentStart) - Math.ceil(headerGroupEnd)) +\n Math.ceil(actionsContainerWidth);\n }\n\n const promotedActionsWrapHandler = () => {\n if (wrapActionsBreakpoint.current && contentEl.current) {\n const availableWidth = Math.ceil(contentEl.current.offsetWidth) - 20;\n setWrapPromotedActions(availableWidth < wrapActionsBreakpoint.current);\n }\n };\n\n const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));\n promotedActionsWrapHandler();\n\n if (contentEl.current) {\n resizeObserver.observe(contentEl.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [contentEl, actionsContainerEl, headerEl, promotedActions, heading, wrapPromotedActions]);\n\n return (\n <StyledCaseView {...restProps}>\n <StyledCaseHeader\n computeButtonFgColor={!isMediumOrAbove || promotedActions.length > 0}\n $color={color}\n >\n <Flex\n container={{\n direction: 'column',\n justify: 'between',\n pad: 2,\n alignItems: 'center',\n gap: 2\n }}\n ref={contentEl}\n as={StyledContentContainer}\n >\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 2 }} item={{ grow: 1 }}>\n <Flex container={{ alignItems: 'center', gap: 2 }} item={{ grow: 2 }}>\n {icon && (\n <StyledCaseViewIcon\n name={icon}\n emphasized\n size='l'\n $caseTypeColor={color}\n foreground={iconForeground}\n background={iconBackground}\n />\n )}\n <Flex container={{ direction: 'column', alignItems: 'start' }} ref={headerEl}>\n <Text variant='h1'>{heading}</Text>\n\n {subheading && (\n <StyledSubheading>\n {Array.isArray(subheading) ? <MetaList items={subheading} /> : subheading}\n </StyledSubheading>\n )}\n </Flex>\n </Flex>\n\n {(promotedActions.length > 0 || actions) && (\n <Flex\n container={{\n gap: 1\n }}\n ref={actionsContainerEl}\n >\n {!wrapPromotedActions &&\n promotedActions.map(action => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick?.(action.id, e)}\n key={action.id}\n >\n {action.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n {actions && actions.length > 0 && (\n <StyledCaseHeaderMenuButton\n icon={actionsIconOnly ? 'more' : undefined}\n iconOnly={actionsIconOnly}\n variant='simple'\n text={t('actions')}\n aria-label={t('actions_for', [caseId])}\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 )}\n </Flex>\n )}\n </Flex>\n\n {wrapPromotedActions && promotedActions.length > 0 && (\n <Flex\n item={{ grow: 1 }}\n container={{\n justify: 'start',\n gap: 1,\n alignItems: 'center',\n wrap: 'wrap'\n }}\n >\n {promotedActions.map(action => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick?.(action.id, e)}\n key={action.id}\n >\n {action.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n </Flex>\n )}\n </Flex>\n </StyledCaseHeader>\n\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }} as={StyledContentContainer}>\n {stages?.content}\n {tabs.length > 0 && currentTabId && (\n <>\n {tasks?.content}\n <div>\n <Tabs\n tabs={tabs}\n onTabClick={setCurrentTabId}\n currentTabId={currentTabId}\n ref={tabsRef}\n />\n\n {tabs.map(tab => (\n <TabPanel\n tabId={tab.id}\n currentTabId={currentTabId}\n key={tab.id}\n tablistRef={tabsRef}\n >\n <StyledContent>{tab.content}</StyledContent>\n </TabPanel>\n ))}\n </div>\n </>\n )}\n\n {tabs.length === 0 && (\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 {tasks?.content && (\n <div role='region' aria-label={tasks?.label}>\n {tasks.content}\n </div>\n )}\n {identifiedDetailRegions.map(region =>\n region.content ? (\n <div role='region' aria-label={region.label} key={region.id}>\n <Card>\n <CardContent>\n <StyledContent>{region.content}</StyledContent>\n </CardContent>\n </Card>\n </div>\n ) : null\n )}\n {feed?.content && (\n <div role='region' aria-label={feed?.label}>\n {feed.content}\n </div>\n )}\n </Flex>\n </Flex>\n )}\n </Flex>\n </StyledCaseView>\n );\n};\n\nexport default CaseView;\n"]}
|
|
1
|
+
{"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9E,OAAO,EACL,aAAa,EACb,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,qBAAqB,EACrB,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,8BAA8B,EAAE,MAAM,iEAAiE,CAAC;AAEjH,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,QAAQ,GAAqC,CAAC,EAClD,MAAM,EACN,OAAO,EACP,UAAU,EACV,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,EAAE,UAAU,EAChB,IAAI,EACJ,OAAO,EACP,eAAe,GAAG,EAAE,EACpB,GAAG,SAAS,EACmB,EAAE,EAAE;IACnC,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,EAAE,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I,CACR,EACD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAChE,KAAK,EAAE,OAAO,IAAI,CACjB,cAAK,IAAI,EAAC,QAAQ,gBAAa,KAAK,EAAE,KAAK,YACxC,KAAK,CAAC,OAAO,GACV,CACP,EACA,uBAAuB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CACpC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CACf,cAAK,IAAI,EAAC,QAAQ,gBAAa,MAAM,CAAC,KAAK,YACzC,KAAC,IAAI,cACH,KAAC,WAAW,cACV,KAAC,aAAa,cAAE,MAAM,CAAC,OAAO,GAAiB,GACnC,GACT,IALyC,MAAM,CAAC,EAAE,CAMrD,CACP,CAAC,CAAC,CAAC,IAAI,CACT,EACA,IAAI,EAAE,OAAO,IAAI,CAChB,cAAK,IAAI,EAAC,QAAQ,gBAAa,IAAI,EAAE,KAAK,YACvC,IAAI,CAAC,OAAO,GACT,CACP,IACI,IACF,CACR,IACI,IACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { parseToHsl } from 'polished';\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { FC, MouseEvent, PropsWithoutRef } from 'react';\n\nimport {\n useBreakpoint,\n Card,\n CardContent,\n Flex,\n Tabs,\n TabPanel,\n Text,\n useI18n,\n Icon,\n useAfterInitialEffect,\n getEdge,\n useDirection,\n throttle,\n readableColor,\n tryCatch,\n useTheme,\n MetaList,\n useConfiguration,\n focusHeadingOrContainer\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps, Tab } from '@pega/cosmos-react-core';\nimport { StyledCaseHeaderPromotedAction } from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';\n\nimport {\n StyledAside,\n StyledCaseHeader,\n StyledCaseView,\n StyledCaseViewIcon,\n StyledCaseHeaderMenuButton,\n StyledSubheading,\n StyledContentContainer,\n StyledContent,\n resolveCaseTypeColor\n} from './CaseView.styles';\nimport type { CaseViewProps, Region } from './CaseView.types';\n\nconst CaseView: FC<CaseViewProps & ForwardProps> = ({\n caseId,\n heading,\n subheading,\n icon,\n color,\n actions,\n stages,\n tasks,\n summary,\n details,\n tabs: detailTabs,\n feed,\n utility,\n promotedActions = [],\n ...restProps\n}: PropsWithoutRef<CaseViewProps>) => {\n const isMediumOrAbove = useBreakpoint('md');\n const t = useI18n();\n const theme = useTheme();\n const { loadedRef } = useConfiguration();\n\n const tabsRef = useRef<HTMLElement>(null);\n const caseViewRef = useRef<HTMLDivElement>(null);\n\n const { iconForeground, iconBackground } = useMemo(() => {\n const backgroundSetting = theme.components['case-view'].icon.background;\n const foregroundSetting = theme.components['case-view'].icon.color;\n const headerForeground = theme.components['case-view'].header['foreground-color'];\n const headerBackground = theme.components['case-view'].header.background;\n\n const resolvedIconBackground =\n backgroundSetting !== 'auto'\n ? backgroundSetting\n : tryCatch(\n () => {\n const { lightness } = parseToHsl(headerBackground);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n },\n () => 'transparent'\n ) ?? 'transparent';\n\n let resolvedIconForeground =\n foregroundSetting !== 'auto' ? foregroundSetting : headerForeground;\n\n if (resolvedIconForeground === 'auto') {\n const caseTypeIconColor =\n color && theme.base['case-type-colors'] !== 'ignored'\n ? resolveCaseTypeColor(theme, color)\n : resolvedIconBackground;\n\n resolvedIconForeground = readableColor(caseTypeIconColor ?? resolvedIconBackground, {\n mode: 'light',\n level: 'AANonText'\n });\n }\n\n return {\n iconForeground: resolvedIconForeground,\n iconBackground: resolvedIconBackground\n };\n }, [theme, color]);\n\n const detailRegions = useMemo(() => {\n if (detailTabs?.length) return detailTabs;\n return details ? [details] : [];\n }, [detailTabs, details]);\n const identifiedDetailRegions = useMemo(\n () =>\n detailRegions.map((region, index) => ({ ...region, id: region.id ?? `details-${index}` })),\n [detailRegions]\n );\n\n const tabs = useMemo(() => {\n if (isMediumOrAbove) return [];\n const tabsArr: { id: string; name: Tab['name']; content: Region['content'] }[] = [];\n\n if (summary)\n tabsArr.push({\n id: 'summary',\n name: 'Summary',\n content: summary.content\n });\n identifiedDetailRegions.forEach(region => {\n tabsArr.push({\n id: region.id,\n name: region.label,\n content: region.content\n });\n });\n if (feed) tabsArr.push({ id: 'feed', name: 'Feed', content: feed.content });\n if (utility)\n tabsArr.push({\n id: 'utility',\n name: 'Utility',\n content: utility.content\n });\n\n return tabsArr;\n }, [isMediumOrAbove, summary, identifiedDetailRegions, feed, utility]);\n\n const [currentTabId, setCurrentTabId] = useState(tabs && tabs.length > 0 ? tabs[0].id : null);\n const [wrapPromotedActions, setWrapPromotedActions] = useState(false);\n const actionsContainerEl = useRef<HTMLDivElement>(null);\n const contentEl = useRef<HTMLDivElement>(null);\n const headerEl = useRef<HTMLDivElement>(null);\n const wrapActionsBreakpoint = useRef<number | null>(null);\n const { ltr } = useDirection();\n const actionsIconOnly = promotedActions.length > 0 || !isMediumOrAbove;\n\n useEffect(() => {\n if (!caseViewRef.current) return;\n\n if (loadedRef.current) {\n focusHeadingOrContainer(caseViewRef.current, heading);\n } else {\n loadedRef.current = true;\n }\n }, [caseId]);\n\n useAfterInitialEffect(() => {\n setCurrentTabId(cur => {\n if (tabs.length === 0) return null;\n return cur && tabs.some(tab => tab.id === cur) ? cur : tabs[0].id;\n });\n }, [tabs]);\n\n useLayoutEffect(() => {\n if (\n !wrapPromotedActions &&\n contentEl.current &&\n actionsContainerEl.current &&\n headerEl.current\n ) {\n const contentStart = getEdge({\n el: contentEl.current,\n side: 'leading',\n ltr\n });\n\n const headerGroupEnd = getEdge({\n el: headerEl.current,\n side: 'trailing',\n ltr\n });\n const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;\n\n wrapActionsBreakpoint.current =\n Math.abs(Math.ceil(contentStart) - Math.ceil(headerGroupEnd)) +\n Math.ceil(actionsContainerWidth);\n }\n\n const promotedActionsWrapHandler = () => {\n if (wrapActionsBreakpoint.current && contentEl.current) {\n const availableWidth = Math.ceil(contentEl.current.offsetWidth) - 20;\n setWrapPromotedActions(availableWidth < wrapActionsBreakpoint.current);\n }\n };\n\n const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));\n promotedActionsWrapHandler();\n\n if (contentEl.current) {\n resizeObserver.observe(contentEl.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [contentEl, actionsContainerEl, headerEl, promotedActions, heading, wrapPromotedActions]);\n\n return (\n <StyledCaseView ref={caseViewRef} {...restProps}>\n <StyledCaseHeader\n computeButtonFgColor={!isMediumOrAbove || promotedActions.length > 0}\n $color={color}\n >\n <Flex\n container={{\n direction: 'column',\n justify: 'between',\n pad: 2,\n alignItems: 'center',\n gap: 2\n }}\n ref={contentEl}\n as={StyledContentContainer}\n >\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 2 }} item={{ grow: 1 }}>\n <Flex container={{ alignItems: 'center', gap: 2 }} item={{ grow: 2 }}>\n {icon && (\n <StyledCaseViewIcon\n name={icon}\n emphasized\n size='l'\n $caseTypeColor={color}\n foreground={iconForeground}\n background={iconBackground}\n />\n )}\n <Flex container={{ direction: 'column', alignItems: 'start' }} ref={headerEl}>\n <Text variant='h1'>{heading}</Text>\n\n {subheading && (\n <StyledSubheading>\n {Array.isArray(subheading) ? <MetaList items={subheading} /> : subheading}\n </StyledSubheading>\n )}\n </Flex>\n </Flex>\n\n {(promotedActions.length > 0 || actions) && (\n <Flex\n container={{\n gap: 1\n }}\n ref={actionsContainerEl}\n >\n {!wrapPromotedActions &&\n promotedActions.map(action => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick?.(action.id, e)}\n key={action.id}\n >\n {action.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n {actions && actions.length > 0 && (\n <StyledCaseHeaderMenuButton\n icon={actionsIconOnly ? 'more' : undefined}\n iconOnly={actionsIconOnly}\n variant='simple'\n text={t('actions')}\n aria-label={t('actions_for', [caseId])}\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 )}\n </Flex>\n )}\n </Flex>\n\n {wrapPromotedActions && promotedActions.length > 0 && (\n <Flex\n item={{ grow: 1 }}\n container={{\n justify: 'start',\n gap: 1,\n alignItems: 'center',\n wrap: 'wrap'\n }}\n >\n {promotedActions.map(action => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick?.(action.id, e)}\n key={action.id}\n >\n {action.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n </Flex>\n )}\n </Flex>\n </StyledCaseHeader>\n\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }} as={StyledContentContainer}>\n {stages?.content}\n {tabs.length > 0 && currentTabId && (\n <>\n {tasks?.content}\n <div>\n <Tabs\n tabs={tabs}\n onTabClick={setCurrentTabId}\n currentTabId={currentTabId}\n ref={tabsRef}\n />\n\n {tabs.map(tab => (\n <TabPanel\n tabId={tab.id}\n currentTabId={currentTabId}\n key={tab.id}\n tablistRef={tabsRef}\n >\n <StyledContent>{tab.content}</StyledContent>\n </TabPanel>\n ))}\n </div>\n </>\n )}\n\n {tabs.length === 0 && (\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 {tasks?.content && (\n <div role='region' aria-label={tasks?.label}>\n {tasks.content}\n </div>\n )}\n {identifiedDetailRegions.map(region =>\n region.content ? (\n <div role='region' aria-label={region.label} key={region.id}>\n <Card>\n <CardContent>\n <StyledContent>{region.content}</StyledContent>\n </CardContent>\n </Card>\n </div>\n ) : null\n )}\n {feed?.content && (\n <div role='region' aria-label={feed?.label}>\n {feed.content}\n </div>\n )}\n </Flex>\n </Flex>\n )}\n </Flex>\n </StyledCaseView>\n );\n};\n\nexport default CaseView;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DefaultTheme } from 'styled-components';
|
|
2
2
|
export declare const StyledCaseView: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
3
|
export declare const StyledSubheading: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
-
export declare const resolveCaseTypeColor: (theme: DefaultTheme, color: string) => string;
|
|
4
|
+
export declare const resolveCaseTypeColor: (theme: DefaultTheme, color: string) => string | undefined;
|
|
5
5
|
export declare const StyledCaseHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
|
|
6
6
|
computeButtonFgColor: boolean;
|
|
7
7
|
$color?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAwBtD,eAAO,MAAM,cAAc,6NAAe,CAAC;AAE3C,eAAO,MAAM,gBAAgB,6NAW5B,CAAC;AAIF,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,EAAE,OAAO,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"CaseView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAwBtD,eAAO,MAAM,cAAc,6NAAe,CAAC;AAE3C,eAAO,MAAM,gBAAgB,6NAW5B,CAAC;AAIF,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,EAAE,OAAO,MAAM,KAAG,MAAM,GAAG,SAIlF,CAAC;AAEF,eAAO,MAAM,gBAAgB;0BAAyC,OAAO;aAAW,MAAM;YAkF7F,CAAC;AAIF,eAAO,MAAM,kBAAkB;qBACZ,MAAM;0JAsCvB,CAAC;AAIH,eAAO,MAAM,WAAW,6NAKtB,CAAC;AAIH,eAAO,MAAM,sBAAsB,6NAwBjC,CAAC;AAIH,eAAO,MAAM,aAAa,6NAaxB,CAAC;AAKH,eAAO,MAAM,0BAA0B;;;eAAmC,OAAO;;2BAxKvE,CAAA;iDAmLT,CAAC"}
|
|
@@ -20,16 +20,18 @@ export const StyledSubheading = styled.div `
|
|
|
20
20
|
`;
|
|
21
21
|
StyledSubheading.defaultProps = defaultThemeProp;
|
|
22
22
|
export const resolveCaseTypeColor = (theme, color) => {
|
|
23
|
+
if (color === 'Default')
|
|
24
|
+
return undefined;
|
|
23
25
|
const supplementalColor = resolveSupplementalColor(theme, color);
|
|
24
26
|
return supplementalColor ?? color;
|
|
25
27
|
};
|
|
26
28
|
export const StyledCaseHeader = styled.header(({ theme, computeButtonFgColor, $color }) => {
|
|
27
29
|
const { components: { 'case-view': { header: { background, 'foreground-color': foregroundColor } } }, base: { palette: { interactive }, 'min-contrast': minContrast } } = theme;
|
|
28
30
|
const resolvedCaseTypeColor = $color ? resolveCaseTypeColor(theme, $color) : undefined;
|
|
29
|
-
const caseTypeBackground =
|
|
31
|
+
const caseTypeBackground = resolvedCaseTypeColor &&
|
|
30
32
|
theme.base['case-type-colors'] === 'header-and-icon' &&
|
|
31
33
|
isSolidColor(theme.components.card.background)
|
|
32
|
-
? mix(0.85, theme.components.card.background,
|
|
34
|
+
? mix(0.85, theme.components.card.background, resolvedCaseTypeColor)
|
|
33
35
|
: undefined;
|
|
34
36
|
const headerBackground = caseTypeBackground ?? background;
|
|
35
37
|
const fgColor = resolvedCaseTypeColor && theme.base['case-type-colors'] === 'header-and-icon'
|
|
@@ -48,6 +50,11 @@ export const StyledCaseHeader = styled.header(({ theme, computeButtonFgColor, $c
|
|
|
48
50
|
|
|
49
51
|
h1 {
|
|
50
52
|
color: ${fgColor};
|
|
53
|
+
|
|
54
|
+
&:focus-visible {
|
|
55
|
+
outline: transparent;
|
|
56
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
57
|
+
}
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
${computeButtonFgColor &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.styles.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,YAAY,EACZ,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,UAAU,EACV,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AACrF,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAElG,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,C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,CAAC,EAAE;;;;;;;MAO3C,YAAY;;;;YAIN,UAAU;QACd,mBAAmB;;;;GAIxB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,OAAO,GAAG,CAAA;MACN,wBAAwB;;6BAED,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEzC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ;QAChC,GAAG,CAAA;WACI,UAAU,MAAM,gBAAgB;;;KAGtC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,UAAU,CAAC,CAC1D,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACf,QAAQ;IACR,GAAG,CAAA;;;;;;;KAOF,CACJ,CAAC;AAEF,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { mix } from 'polished';\n\nimport {\n defaultThemeProp,\n Icon,\n StyledButton,\n calculateForegroundColor,\n isSolidColor,\n isTransparentColor,\n meetsMinContrast,\n resolveContrastColor,\n resolveSupplementalColor,\n StyledCard,\n MenuButton\n} from '@pega/cosmos-react-core';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';\nimport {\n StyledCaseHeaderPromotedAction,\n StyledSummaryPrimaryList\n} from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';\nimport { StyledStagesWrapper } from '@pega/cosmos-react-work/lib/components/Stages/Stages.styles';\n\nexport const StyledCaseView = styled.div``;\n\nexport const StyledSubheading = styled.div`\n color: inherit;\n font-size: inherit;\n font-weight: inherit;\n\n /* MetaList renders items as Text elements with explicit styles. */\n && li {\n color: inherit;\n font-size: inherit;\n font-weight: inherit;\n }\n`;\n\nStyledSubheading.defaultProps = defaultThemeProp;\n\nexport const resolveCaseTypeColor = (theme: DefaultTheme, color: string): string => {\n const supplementalColor = resolveSupplementalColor(theme, color);\n return supplementalColor ?? color;\n};\n\nexport const StyledCaseHeader = styled.header<{ computeButtonFgColor: boolean; $color?: string }>(\n ({ theme, computeButtonFgColor, $color }) => {\n const {\n components: {\n 'case-view': {\n header: { background, 'foreground-color': foregroundColor }\n }\n },\n base: {\n palette: { interactive },\n 'min-contrast': minContrast\n }\n } = theme;\n\n const resolvedCaseTypeColor = $color ? resolveCaseTypeColor(theme, $color) : undefined;\n\n const caseTypeBackground =\n $color &&\n theme.base['case-type-colors'] === 'header-and-icon' &&\n isSolidColor(theme.components.card.background)\n ? mix(0.85, theme.components.card.background, resolveCaseTypeColor(theme, $color))\n : undefined;\n\n const headerBackground = caseTypeBackground ?? background;\n const fgColor =\n resolvedCaseTypeColor && theme.base['case-type-colors'] === 'header-and-icon'\n ? resolveContrastColor({\n background: headerBackground,\n theme\n })\n : calculateForegroundColor(headerBackground, foregroundColor, theme);\n\n const interactiveColor = meetsMinContrast(\n interactive,\n theme.base.palette['primary-background'],\n minContrast\n )\n ? interactive\n : fgColor;\n\n return css`\n position: relative;\n background: ${headerBackground};\n color: ${fgColor};\n\n h1 {\n color: ${fgColor};\n }\n\n ${computeButtonFgColor &&\n css`\n button {\n color: ${fgColor};\n }\n `}\n\n ${isTransparentColor(headerBackground) &&\n css`\n > div {\n padding-block-end: 0;\n }\n\n button,\n button:hover,\n button:active {\n color: ${interactiveColor};\n }\n\n ${StyledCaseHeaderPromotedAction},\n ${StyledCaseHeaderPromotedAction}:hover,\n ${StyledCaseHeaderPromotedAction}:active {\n color: ${interactiveColor};\n border-color: ${interactiveColor};\n }\n `}\n `;\n }\n);\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseViewIcon = styled(Icon)<{\n $caseTypeColor?: string;\n}>(({ theme, $caseTypeColor }) => {\n const caseTypeColorsEnabled =\n theme.base['case-type-colors'] === 'icon-only' ||\n theme.base['case-type-colors'] === 'header-and-icon';\n const resolvedCaseTypeColor =\n caseTypeColorsEnabled && $caseTypeColor !== undefined\n ? resolveCaseTypeColor(theme, $caseTypeColor)\n : undefined;\n\n return css`\n --icon-color: ${resolvedCaseTypeColor ?? theme.base.palette['brand-accent']};\n --gradient-start: oklch(from var(--icon-color) calc(l - 0.3) calc(c * 1.5) h);\n --gradient-mid: oklch(from var(--icon-color) l c h);\n --gradient-end: oklch(from var(--icon-color) calc(l + 0.5) calc(c * 1.5) h);\n\n ${theme.components['case-view'].icon.color !== 'auto' &&\n css`\n color: ${theme.components['case-view'].icon.color};\n `}\n\n ${theme.components['case-view'].icon.background !== 'auto' &&\n css`\n background: ${theme.components['case-view'].icon.background};\n `}\n\n ${theme.components['case-view'].icon.background === 'auto' &&\n caseTypeColorsEnabled &&\n resolvedCaseTypeColor &&\n css`\n background: ${resolvedCaseTypeColor};\n `}\n\n ${theme.components['case-view'].icon['box-shadow'] !== 'auto' &&\n css`\n box-shadow: ${theme.components['case-view'].icon['box-shadow']};\n `}\n `;\n});\n\nStyledCaseViewIcon.defaultProps = defaultThemeProp;\n\nexport const StyledAside = styled.div(({ theme }) => {\n return css`\n min-width: ${theme.base['content-width'].sm};\n max-width: 40%;\n `;\n});\n\nStyledAside.defaultProps = defaultThemeProp;\n\nexport const StyledContentContainer = styled.div(({ theme }) => {\n return css`\n width: 100%;\n max-width: 75rem;\n margin-inline: auto;\n\n h1 {\n min-width: ${theme.base['content-width'].xs};\n }\n\n & > div {\n width: 100%;\n }\n\n ${StyledButton} {\n margin-inline-start: 0;\n }\n\n &:has(${StyledTabs}) {\n ${StyledStagesWrapper} {\n --stages-wrapper-bottom-radius: 0;\n }\n }\n `;\n});\n\nStyledContentContainer.defaultProps = defaultThemeProp;\n\nexport const StyledContent = styled.div(({ theme }) => {\n return css`\n ${StyledSummaryPrimaryList} {\n grid-template-columns: auto 1fr;\n column-gap: calc(2 * ${theme.base.spacing});\n }\n ${theme.components.tabs.detached &&\n css`\n && ${StyledCard} > ${StyledCardHeader} {\n padding-inline: 0;\n }\n `}\n `;\n});\n\nStyledContent.defaultProps = defaultThemeProp;\n\n// Icon-only buttons are 40 x 40px; the Button hit-area minimum is smaller.\nexport const StyledCaseHeaderMenuButton = styled(MenuButton)<{ iconOnly?: boolean }>(\n ({ iconOnly }) =>\n iconOnly &&\n css`\n && {\n width: 2.5rem;\n height: 2.5rem;\n min-width: 2.5rem;\n min-height: 2.5rem;\n }\n `\n);\n\nStyledCaseHeaderMenuButton.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"CaseView.styles.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,YAAY,EACZ,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,UAAU,EACV,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AACrF,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAElG,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE3C,MAAM,CAAC,MA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AAG,CAAA;;;;;;mBAMO,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;;;;;;MAO3C,YAAY;;;;YAIN,UAAU;QACd,mBAAmB;;;;GAIxB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,OAAO,GAAG,CAAA;MACN,wBAAwB;;6BAED,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEzC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ;QAChC,GAAG,CAAA;WACI,UAAU,MAAM,gBAAgB;;;KAGtC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,UAAU,CAAC,CAC1D,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACf,QAAQ;IACR,GAAG,CAAA;;;;;;;KAOF,CACJ,CAAC;AAEF,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { mix } from 'polished';\n\nimport {\n defaultThemeProp,\n Icon,\n StyledButton,\n calculateForegroundColor,\n isSolidColor,\n isTransparentColor,\n meetsMinContrast,\n resolveContrastColor,\n resolveSupplementalColor,\n StyledCard,\n MenuButton\n} from '@pega/cosmos-react-core';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';\nimport {\n StyledCaseHeaderPromotedAction,\n StyledSummaryPrimaryList\n} from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';\nimport { StyledStagesWrapper } from '@pega/cosmos-react-work/lib/components/Stages/Stages.styles';\n\nexport const StyledCaseView = styled.div``;\n\nexport const StyledSubheading = styled.div`\n color: inherit;\n font-size: inherit;\n font-weight: inherit;\n\n /* MetaList renders items as Text elements with explicit styles. */\n && li {\n color: inherit;\n font-size: inherit;\n font-weight: inherit;\n }\n`;\n\nStyledSubheading.defaultProps = defaultThemeProp;\n\nexport const resolveCaseTypeColor = (theme: DefaultTheme, color: string): string | undefined => {\n if (color === 'Default') return undefined;\n const supplementalColor = resolveSupplementalColor(theme, color);\n return supplementalColor ?? color;\n};\n\nexport const StyledCaseHeader = styled.header<{ computeButtonFgColor: boolean; $color?: string }>(\n ({ theme, computeButtonFgColor, $color }) => {\n const {\n components: {\n 'case-view': {\n header: { background, 'foreground-color': foregroundColor }\n }\n },\n base: {\n palette: { interactive },\n 'min-contrast': minContrast\n }\n } = theme;\n\n const resolvedCaseTypeColor = $color ? resolveCaseTypeColor(theme, $color) : undefined;\n\n const caseTypeBackground =\n resolvedCaseTypeColor &&\n theme.base['case-type-colors'] === 'header-and-icon' &&\n isSolidColor(theme.components.card.background)\n ? mix(0.85, theme.components.card.background, resolvedCaseTypeColor)\n : undefined;\n\n const headerBackground = caseTypeBackground ?? background;\n const fgColor =\n resolvedCaseTypeColor && theme.base['case-type-colors'] === 'header-and-icon'\n ? resolveContrastColor({\n background: headerBackground,\n theme\n })\n : calculateForegroundColor(headerBackground, foregroundColor, theme);\n\n const interactiveColor = meetsMinContrast(\n interactive,\n theme.base.palette['primary-background'],\n minContrast\n )\n ? interactive\n : fgColor;\n\n return css`\n position: relative;\n background: ${headerBackground};\n color: ${fgColor};\n\n h1 {\n color: ${fgColor};\n\n &:focus-visible {\n outline: transparent;\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n\n ${computeButtonFgColor &&\n css`\n button {\n color: ${fgColor};\n }\n `}\n\n ${isTransparentColor(headerBackground) &&\n css`\n > div {\n padding-block-end: 0;\n }\n\n button,\n button:hover,\n button:active {\n color: ${interactiveColor};\n }\n\n ${StyledCaseHeaderPromotedAction},\n ${StyledCaseHeaderPromotedAction}:hover,\n ${StyledCaseHeaderPromotedAction}:active {\n color: ${interactiveColor};\n border-color: ${interactiveColor};\n }\n `}\n `;\n }\n);\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseViewIcon = styled(Icon)<{\n $caseTypeColor?: string;\n}>(({ theme, $caseTypeColor }) => {\n const caseTypeColorsEnabled =\n theme.base['case-type-colors'] === 'icon-only' ||\n theme.base['case-type-colors'] === 'header-and-icon';\n const resolvedCaseTypeColor =\n caseTypeColorsEnabled && $caseTypeColor !== undefined\n ? resolveCaseTypeColor(theme, $caseTypeColor)\n : undefined;\n\n return css`\n --icon-color: ${resolvedCaseTypeColor ?? theme.base.palette['brand-accent']};\n --gradient-start: oklch(from var(--icon-color) calc(l - 0.3) calc(c * 1.5) h);\n --gradient-mid: oklch(from var(--icon-color) l c h);\n --gradient-end: oklch(from var(--icon-color) calc(l + 0.5) calc(c * 1.5) h);\n\n ${theme.components['case-view'].icon.color !== 'auto' &&\n css`\n color: ${theme.components['case-view'].icon.color};\n `}\n\n ${theme.components['case-view'].icon.background !== 'auto' &&\n css`\n background: ${theme.components['case-view'].icon.background};\n `}\n\n ${theme.components['case-view'].icon.background === 'auto' &&\n caseTypeColorsEnabled &&\n resolvedCaseTypeColor &&\n css`\n background: ${resolvedCaseTypeColor};\n `}\n\n ${theme.components['case-view'].icon['box-shadow'] !== 'auto' &&\n css`\n box-shadow: ${theme.components['case-view'].icon['box-shadow']};\n `}\n `;\n});\n\nStyledCaseViewIcon.defaultProps = defaultThemeProp;\n\nexport const StyledAside = styled.div(({ theme }) => {\n return css`\n min-width: ${theme.base['content-width'].sm};\n max-width: 40%;\n `;\n});\n\nStyledAside.defaultProps = defaultThemeProp;\n\nexport const StyledContentContainer = styled.div(({ theme }) => {\n return css`\n width: 100%;\n max-width: 75rem;\n margin-inline: auto;\n\n h1 {\n min-width: ${theme.base['content-width'].xs};\n }\n\n & > div {\n width: 100%;\n }\n\n ${StyledButton} {\n margin-inline-start: 0;\n }\n\n &:has(${StyledTabs}) {\n ${StyledStagesWrapper} {\n --stages-wrapper-bottom-radius: 0;\n }\n }\n `;\n});\n\nStyledContentContainer.defaultProps = defaultThemeProp;\n\nexport const StyledContent = styled.div(({ theme }) => {\n return css`\n ${StyledSummaryPrimaryList} {\n grid-template-columns: auto 1fr;\n column-gap: calc(2 * ${theme.base.spacing});\n }\n ${theme.components.tabs.detached &&\n css`\n && ${StyledCard} > ${StyledCardHeader} {\n padding-inline: 0;\n }\n `}\n `;\n});\n\nStyledContent.defaultProps = defaultThemeProp;\n\n// Icon-only buttons are 40 x 40px; the Button hit-area minimum is smaller.\nexport const StyledCaseHeaderMenuButton = styled(MenuButton)<{ iconOnly?: boolean }>(\n ({ iconOnly }) =>\n iconOnly &&\n css`\n && {\n width: 2.5rem;\n height: 2.5rem;\n min-width: 2.5rem;\n min-height: 2.5rem;\n }\n `\n);\n\nStyledCaseHeaderMenuButton.defaultProps = defaultThemeProp;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-wss",
|
|
3
|
-
"version": "10.0.0-build.12.
|
|
3
|
+
"version": "10.0.0-build.12.5",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-core": "10.0.0-build.12.
|
|
18
|
-
"@pega/cosmos-react-work": "10.0.0-build.12.
|
|
17
|
+
"@pega/cosmos-react-core": "10.0.0-build.12.5",
|
|
18
|
+
"@pega/cosmos-react-work": "10.0.0-build.12.5",
|
|
19
19
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
20
20
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
21
21
|
"polished": "^4.1.0",
|