@pega/cosmos-react-wss 9.15.1 → 9.16.1

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.
@@ -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;AAqB7D,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,yBAAyB,CAAC;AAYjE,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,kBAAkB,CAAC;AAE9D,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAyS9C,CAAC;AAEF,eAAe,QAAQ,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;AAsB7D,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,yBAAyB,CAAC;AAajE,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,kBAAkB,CAAC;AAE9D,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAkT9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { parseToHsl } from 'polished';
3
3
  import { useLayoutEffect, useMemo, useRef, useState } from 'react';
4
- import { useBreakpoint, Card, CardContent, Flex, Tabs, TabPanel, Text, MenuButton, useI18n, Icon, useAfterInitialEffect, getEdge, useDirection, throttle, readableColor, tryCatch, useTheme } from '@pega/cosmos-react-core';
4
+ import { useBreakpoint, Card, CardContent, Flex, Tabs, TabPanel, Text, MenuButton, useI18n, Icon, useAfterInitialEffect, getEdge, useDirection, throttle, readableColor, tryCatch, useTheme, MetaList } from '@pega/cosmos-react-core';
5
5
  import { StyledCaseHeaderPromotedAction } from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';
6
- import { StyledAside, StyledCaseHeader, StyledCaseView, StyledCaseViewIcon, StyledContentContainer, StyledContent, resolveCaseTypeColor } from './CaseView.styles';
7
- const CaseView = ({ caseId, heading, icon, color, actions, stages, tasks, summary, details, feed, utility, promotedActions = [], ...restProps }) => {
6
+ import { StyledAside, StyledCaseHeader, StyledCaseView, StyledCaseViewIcon, StyledSubheading, StyledContentContainer, StyledContent, resolveCaseTypeColor } from './CaseView.styles';
7
+ const CaseView = ({ caseId, heading, subheading, icon, color, actions, stages, tasks, summary, details, feed, utility, promotedActions = [], ...restProps }) => {
8
8
  const isMediumOrAbove = useBreakpoint('md');
9
9
  const t = useI18n();
10
10
  const tabsRef = useRef(null);
@@ -107,7 +107,7 @@ const CaseView = ({ caseId, heading, icon, color, actions, stages, tasks, summar
107
107
  pad: 2,
108
108
  alignItems: 'center',
109
109
  gap: 2
110
- }, ref: contentEl, as: StyledContentContainer, children: [_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 2 }, item: { grow: 1 }, children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 2 }, item: { grow: 2 }, children: [icon && (_jsx(StyledCaseViewIcon, { name: icon, "$caseTypeColor": color, foreground: iconForeground, background: iconBackground })), _jsx(Text, { variant: 'h1', ref: headerEl, children: heading })] }), (promotedActions.length > 0 || actions) && (_jsxs(Flex, { container: {
110
+ }, ref: contentEl, as: StyledContentContainer, children: [_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 2 }, item: { grow: 1 }, children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 2 }, item: { grow: 2 }, children: [icon && (_jsx(StyledCaseViewIcon, { name: icon, "$caseTypeColor": color, foreground: iconForeground, background: iconBackground })), _jsxs(Flex, { container: { direction: 'column', alignItems: 'start' }, children: [_jsx(Text, { variant: 'h1', ref: headerEl, children: heading }), subheading && (_jsx(StyledSubheading, { children: Array.isArray(subheading) ? _jsx(MetaList, { items: subheading }) : subheading }))] })] }), (promotedActions.length > 0 || actions) && (_jsxs(Flex, { container: {
111
111
  gap: 1
112
112
  }, ref: actionsContainerEl, children: [!wrapPromotedActions &&
113
113
  promotedActions.map(action => (_jsx(StyledCaseHeaderPromotedAction, { variant: 'secondary', onClick: (e) => action.onClick?.(action.id, e), children: action.text }, action.id))), actions && actions.length > 0 && (_jsx(MenuButton, { icon: promotedActions.length > 0 || !isMediumOrAbove ? 'more' : undefined, iconOnly: promotedActions.length > 0 || !isMediumOrAbove, variant: 'simple', text: t('actions'), "aria-label": t('actions_for', [caseId]), menu: {
@@ -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,UAAU,EACV,OAAO,EACP,IAAI,EACJ,qBAAqB,EACrB,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,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,EAClB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,QAAQ,GAAqC,CAAC,EAClD,MAAM,EACN,OAAO,EACP,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,IAAI,E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AAC,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,OAAO,EAAE,OAAO,IAAI,CACnB,cAAK,IAAI,EAAC,QAAQ,gBAAa,OAAO,EAAE,KAAK,YAC3C,KAAC,IAAI,cACH,KAAC,WAAW,cACV,KAAC,aAAa,cAAE,OAAO,EAAE,OAAO,GAAiB,GACrC,GACT,GACH,CACP,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 MenuButton,\n useI18n,\n Icon,\n useAfterInitialEffect,\n getEdge,\n useDirection,\n throttle,\n readableColor,\n tryCatch,\n useTheme\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 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 icon,\n color,\n actions,\n stages,\n tasks,\n summary,\n details,\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 tabs = useMemo(() => {\n if (isMediumOrAbove) return [];\n const tabsArr: { name: Tab['name']; content: Region['content'] }[] = [];\n\n if (summary)\n tabsArr.push({\n name: 'Summary',\n content: summary.content\n });\n if (details) tabsArr.push({ name: details.label, content: details.content });\n if (feed) tabsArr.push({ name: 'Feed', content: feed.content });\n if (utility)\n tabsArr.push({\n name: 'Utility',\n content: utility.content\n });\n\n return tabsArr.map(tab => ({ ...tab, id: tab.name }));\n }, [isMediumOrAbove, summary, details, 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\n useAfterInitialEffect(() => {\n if (tabs.length > 0) setCurrentTabId(cur => cur ?? tabs[0].id);\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 $caseTypeColor={color}\n foreground={iconForeground}\n background={iconBackground}\n />\n )}\n <Text variant='h1' ref={headerEl}>\n {heading}\n </Text>\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 <MenuButton\n icon={promotedActions.length > 0 || !isMediumOrAbove ? 'more' : undefined}\n iconOnly={promotedActions.length > 0 || !isMediumOrAbove}\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 {details?.content && (\n <div role='region' aria-label={details?.label}>\n <Card>\n <CardContent>\n <StyledContent>{details?.content}</StyledContent>\n </CardContent>\n </Card>\n </div>\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,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,UAAU,EACV,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,EAClB,gBAAgB,EAChB,sBA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AC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,aACxB,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CACvB,MAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9D,OAAO,EAAE,OAAO,IAAI,CACnB,cAAK,IAAI,EAAC,QAAQ,gBAAa,OAAO,EAAE,KAAK,YAC1C,OAAO,EAAE,OAAO,GACb,CACP,EACA,OAAO,EAAE,OAAO,IAAI,CACnB,cAAK,IAAI,EAAC,QAAQ,gBAAa,OAAO,EAAE,KAAK,YAC1C,OAAO,EAAE,OAAO,GACb,CACP,IACI,CACR,EACD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAChE,KAAK,EAAE,OAAO,IAAI,CACjB,cAAK,IAAI,EAAC,QAAQ,gBAAa,KAAK,EAAE,KAAK,YACxC,KAAK,CAAC,OAAO,GACV,CACP,EACA,OAAO,EAAE,OAAO,IAAI,CACnB,cAAK,IAAI,EAAC,QAAQ,gBAAa,OAAO,EAAE,KAAK,YAC3C,KAAC,IAAI,cACH,KAAC,WAAW,cACV,KAAC,aAAa,cAAE,OAAO,EAAE,OAAO,GAAiB,GACrC,GACT,GACH,CACP,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 MenuButton,\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 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 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 tabs = useMemo(() => {\n if (isMediumOrAbove) return [];\n const tabsArr: { name: Tab['name']; content: Region['content'] }[] = [];\n\n if (summary)\n tabsArr.push({\n name: 'Summary',\n content: summary.content\n });\n if (details) tabsArr.push({ name: details.label, content: details.content });\n if (feed) tabsArr.push({ name: 'Feed', content: feed.content });\n if (utility)\n tabsArr.push({\n name: 'Utility',\n content: utility.content\n });\n\n return tabsArr.map(tab => ({ ...tab, id: tab.name }));\n }, [isMediumOrAbove, summary, details, 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\n useAfterInitialEffect(() => {\n if (tabs.length > 0) setCurrentTabId(cur => cur ?? tabs[0].id);\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 $caseTypeColor={color}\n foreground={iconForeground}\n background={iconBackground}\n />\n )}\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <Text variant='h1' ref={headerEl}>\n {heading}\n </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 <MenuButton\n icon={promotedActions.length > 0 || !isMediumOrAbove ? 'more' : undefined}\n iconOnly={promotedActions.length > 0 || !isMediumOrAbove}\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 {details?.content && (\n <div role='region' aria-label={details?.label}>\n <Card>\n <CardContent>\n <StyledContent>{details?.content}</StyledContent>\n </CardContent>\n </Card>\n </div>\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,5 +1,6 @@
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
+ 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;
3
4
  export declare const resolveCaseTypeColor: (theme: DefaultTheme, color: string) => string;
4
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>, {
5
6
  computeButtonFgColor: boolean;
@@ -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;AAkBtD,eAAO,MAAM,cAAc,6NAAe,CAAC;AAE3C,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,EAAE,OAAO,MAAM,KAAG,MAGzE,CAAC;AAEF,eAAO,MAAM,gBAAgB;0BAAyC,OAAO;aAAW,MAAM;YAyC7F,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"}
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;AAkBtD,eAAO,MAAM,cAAc,6NAAe,CAAC;AAE3C,eAAO,MAAM,gBAAgB,6NAW5B,CAAC;AAIF,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,EAAE,OAAO,MAAM,KAAG,MAGzE,CAAC;AAEF,eAAO,MAAM,gBAAgB;0BAAyC,OAAO;aAAW,MAAM;YA0C7F,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"}
@@ -6,6 +6,19 @@ import { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.sty
6
6
  import { StyledSummaryPrimaryList } from '@pega/cosmos-react-work/lib/components/CaseView/CaseView.styles';
7
7
  import { StyledStagesWrapper } from '@pega/cosmos-react-work/lib/components/Stages/Stages.styles';
8
8
  export const StyledCaseView = styled.div ``;
9
+ export const StyledSubheading = styled.div `
10
+ color: inherit;
11
+ font-size: inherit;
12
+ font-weight: inherit;
13
+
14
+ /* MetaList renders items as Text elements with explicit styles. */
15
+ && li {
16
+ color: inherit;
17
+ font-size: inherit;
18
+ font-weight: inherit;
19
+ }
20
+ `;
21
+ StyledSubheading.defaultProps = defaultThemeProp;
9
22
  export const resolveCaseTypeColor = (theme, color) => {
10
23
  const supplementalColor = resolveSupplementalColor(theme, color);
11
24
  return supplementalColor ?? color;
@@ -25,6 +38,7 @@ export const StyledCaseHeader = styled.header(({ theme, computeButtonFgColor, $c
25
38
  return css `
26
39
  position: relative;
27
40
  background: ${headerBackground};
41
+ color: ${fgColor};
28
42
 
29
43
  h1 {
30
44
  color: ${fgColor};
@@ -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,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AgB,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","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 readableColor,\n resolveSupplementalColor,\n StyledCard\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 { StyledSummaryPrimaryList } 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 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 } = 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 ? readableColor(headerBackground)\n : calculateForegroundColor(headerBackground, foregroundColor);\n\n return css`\n position: relative;\n background: ${headerBackground};\n\n h1 {\n color: ${fgColor};\n }\n\n ${computeButtonFgColor &&\n css`\n button {\n color: ${fgColor};\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"]}
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,aAAa,EACb,wBAAwB,EACxB,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iEAAiE,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAElG,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;CAWzC,CA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{ mix } from 'polished';\n\nimport {\n defaultThemeProp,\n Icon,\n StyledButton,\n calculateForegroundColor,\n isSolidColor,\n readableColor,\n resolveSupplementalColor,\n StyledCard\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 { StyledSummaryPrimaryList } 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 } = 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 ? readableColor(headerBackground)\n : calculateForegroundColor(headerBackground, foregroundColor);\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 }\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"]}
@@ -1,9 +1,15 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { NoChildrenProp, Action, BaseProps, IconName } from '@pega/cosmos-react-core';
2
+ import type { NoChildrenProp, Action, BaseProps, IconName, FieldValueListItemProps } from '@pega/cosmos-react-core';
3
3
  export interface Region {
4
4
  label: string;
5
5
  content: ReactNode;
6
6
  }
7
+ export interface SummaryRegion extends Region {
8
+ /** Primary fields */
9
+ primarySummaryFields?: FieldValueListItemProps[];
10
+ /** Secondary fields */
11
+ secondarySummaryFields?: FieldValueListItemProps[];
12
+ }
7
13
  export interface CaseViewProps extends NoChildrenProp, BaseProps {
8
14
  /** A unique identifier for the case instance. */
9
15
  caseId: string;
@@ -14,13 +20,13 @@ export interface CaseViewProps extends NoChildrenProp, BaseProps {
14
20
  /** A contextual color for the case type. */
15
21
  color?: string;
16
22
  /** A secondary text rendered below the heading. */
17
- subheading?: string;
23
+ subheading?: string | string[];
18
24
  /** Case level promoted actions available in the CaseView header. */
19
25
  promotedActions?: Action[];
20
26
  /** Case level actions available in an action menu. */
21
27
  actions?: Action[];
22
28
  /** A region to display any summary information about the CaseView. */
23
- summary?: Region;
29
+ summary?: SummaryRegion;
24
30
  /** A region to hold a Stages component. */
25
31
  stages?: Region;
26
32
  /** A region to hold a Tasks component. */
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE3F,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,SAAS;IAC9D,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
1
+ {"version":3,"file":"CaseView.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EACV,cAAc,EACd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
- {"version":3,"file":"CaseView.types.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { NoChildrenProp, Action, BaseProps, IconName } from '@pega/cosmos-react-core';\n\nexport interface Region {\n label: string;\n content: ReactNode;\n}\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps {\n /** A unique identifier for the case instance. */\n caseId: string;\n /** A text region for the title of the CaseView. */\n heading: string;\n /** An icon to serve as a visual for the CaseView. */\n icon?: IconName;\n /** A contextual color for the case type. */\n color?: string;\n /** A secondary text rendered below the heading. */\n subheading?: string;\n /** Case level promoted actions available in the CaseView header. */\n promotedActions?: Action[];\n /** Case level actions available in an action menu. */\n actions?: Action[];\n /** A region to display any summary information about the CaseView. */\n summary?: Region;\n /** A region to hold a Stages component. */\n stages?: Region;\n /** A region to hold a Tasks component. */\n tasks?: Region;\n /** A region to hold the main details/tabs content. */\n details?: Region;\n /** A region to hold a Feed component. */\n feed?: Region;\n /** A region to hold a Utilities component. */\n utility?: Region;\n /** Whether to show the Pulse region. */\n showPulse?: boolean;\n /** Whether to show the Utility region. */\n showUtility?: boolean;\n /** Whether the case is in a create stage. */\n isCreateStage?: boolean;\n}\n"]}
1
+ {"version":3,"file":"CaseView.types.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type {\n NoChildrenProp,\n Action,\n BaseProps,\n IconName,\n FieldValueListItemProps\n} from '@pega/cosmos-react-core';\n\nexport interface Region {\n label: string;\n content: ReactNode;\n}\n\nexport interface SummaryRegion extends Region {\n /** Primary fields */\n primarySummaryFields?: FieldValueListItemProps[];\n /** Secondary fields */\n secondarySummaryFields?: FieldValueListItemProps[];\n}\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps {\n /** A unique identifier for the case instance. */\n caseId: string;\n /** A text region for the title of the CaseView. */\n heading: string;\n /** An icon to serve as a visual for the CaseView. */\n icon?: IconName;\n /** A contextual color for the case type. */\n color?: string;\n /** A secondary text rendered below the heading. */\n subheading?: string | string[];\n /** Case level promoted actions available in the CaseView header. */\n promotedActions?: Action[];\n /** Case level actions available in an action menu. */\n actions?: Action[];\n /** A region to display any summary information about the CaseView. */\n summary?: SummaryRegion;\n /** A region to hold a Stages component. */\n stages?: Region;\n /** A region to hold a Tasks component. */\n tasks?: Region;\n /** A region to hold the main details/tabs content. */\n details?: Region;\n /** A region to hold a Feed component. */\n feed?: Region;\n /** A region to hold a Utilities component. */\n utility?: Region;\n /** Whether to show the Pulse region. */\n showPulse?: boolean;\n /** Whether to show the Utility region. */\n showUtility?: boolean;\n /** Whether the case is in a create stage. */\n isCreateStage?: boolean;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-wss",
3
- "version": "9.15.1",
3
+ "version": "9.16.1",
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": "9.15.1",
18
- "@pega/cosmos-react-work": "9.15.1",
17
+ "@pega/cosmos-react-core": "9.16.1",
18
+ "@pega/cosmos-react-work": "9.16.1",
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",