@pega/cosmos-react-work 9.0.0-build.13.1 → 9.0.0-build.13.3

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":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAwC5C,QAAA,MAAM,UAAU,EAAE,EA0TjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAyC5C,QAAA,MAAM,UAAU,EAAE,EAmUjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -4,7 +4,7 @@ import { parseToHsl } from 'polished';
4
4
  import { Breadcrumbs, Flex, getEdge, Icon, registerIcon, Text, Link, Button, throttle, useDirection, useI18n, useAfterInitialEffect, useTheme, tryCatch, Actions, StyledIconShape } from '@pega/cosmos-react-core';
5
5
  import * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';
6
6
  import * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';
7
- import { StyledCaseHeader, StyledCaseHeaderText, StyledExpandCollapseSummaryButton, StyledSubheading, StyledHeaderActions, StyledCaseHeaderPromotedAction, StyledCaseViewImage } from '../CaseView.styles';
7
+ import { StyledCaseHeader, StyledCaseHeaderText, StyledExpandCollapseSummaryButton, StyledSubheading, StyledHeaderActions, StyledCaseHeaderPromotedAction, StyledCaseViewImage, StyledCaseViewIcon } from '../CaseView.styles';
8
8
  import { useCaseViewContext } from '../CaseView.context';
9
9
  import Summary from './Summary';
10
10
  registerIcon(pencilIcon, moreIcon);
@@ -16,9 +16,15 @@ const CaseHeader = () => {
16
16
  const [wrapPromotedActions, setWrapPromotedActions] = useState(false);
17
17
  const [summaryResetID, setSummaryResetID] = useState(Math.random());
18
18
  const wrapActionsBreakpoint = useRef(null);
19
+ const iconForeground = theme.components['case-view'].icon.color !== 'auto'
20
+ ? theme.components['case-view'].icon.color
21
+ : theme.components['case-view'].header['foreground-color'];
19
22
  const iconBackground = useMemo(() => {
23
+ if (theme.components['case-view'].icon.background !== 'auto') {
24
+ return theme.components['case-view'].icon.background;
25
+ }
20
26
  return tryCatch(() => {
21
- const { lightness } = parseToHsl(theme.base.palette['brand-primary']);
27
+ const { lightness } = parseToHsl(theme.components['case-view'].header['background-color']);
22
28
  return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';
23
29
  }, () => 'transparent');
24
30
  }, [theme]);
@@ -99,7 +105,7 @@ const CaseHeader = () => {
99
105
  }, [typeof icon === 'string' ? icon : icon?.href]);
100
106
  return (_jsxs(Flex, { "data-testid": testIds.header, as: StyledCaseHeader, container: { direction: 'column', gap: 1.5 }, children: [_jsxs(Flex, { container: true, ref: contentsEl, children: [showExpandCollapse && onToggleSummary && !persistentUtility && (_jsx(StyledExpandCollapseSummaryButton, { ref: toggleButtonRef, onClick: onToggleSummary, label: t(summaryExpanded ? 'collapse' : 'expand'), "aria-label": t(summaryExpanded ? 'collapse_summary' : 'expand_summary'), icon: true, compact: true, children: _jsx(Icon, { name: summaryExpanded ? `arrow-micro-${start}` : 'arrow-micro-down' }) })), showIcon && (_jsx(Flex, { container: { pad: [1, 0, 0] }, item: { shrink: 0 }, children: (() => {
101
107
  if (typeof icon === 'string') {
102
- return (_jsx(Icon, { "data-testid": testIds.icon, "aria-label": t('case_type_icon', [caseType ?? t('case_type')]), name: icon, background: iconBackground }));
108
+ return (_jsx(StyledCaseViewIcon, { "data-testid": testIds.icon, "aria-label": t('case_type_icon', [caseType ?? t('case_type')]), name: icon, foreground: iconForeground, background: iconBackground }));
103
109
  }
104
110
  return (_jsx(StyledIconShape, { background: iconBackground, "data-testid": testIds.icon, children: _jsx(StyledCaseViewImage, { src: icon.href, alt: t('case_image'), onLoad: () => {
105
111
  setHasBrokenImage(false);
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,qBAAqB,EACrB,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAC5F,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AAExF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iCAAiC,EACjC,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC9B,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEnC,MAAM,UAAU,GAAO,GAAG,EAAE;IAC1B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ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CAAC,CAC9C,wBACE,KAAC,8BAA8B,IAC7B,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,YAE9D,IAAI,GAC0B,IANzB,IAAI,CAOR,CACP,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { FC, MouseEvent } from 'react';\nimport { parseToHsl } from 'polished';\n\nimport {\n Breadcrumbs,\n Flex,\n getEdge,\n Icon,\n registerIcon,\n Text,\n Link,\n Button,\n throttle,\n useDirection,\n useI18n,\n useAfterInitialEffect,\n useTheme,\n tryCatch,\n Actions,\n StyledIconShape\n} from '@pega/cosmos-react-core';\nimport type { Action } from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledCaseHeader,\n StyledCaseHeaderText,\n StyledExpandCollapseSummaryButton,\n StyledSubheading,\n StyledHeaderActions,\n StyledCaseHeaderPromotedAction,\n StyledCaseViewImage\n} from '../CaseView.styles';\nimport { useCaseViewContext } from '../CaseView.context';\n\nimport Summary from './Summary';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n const { ltr, start } = useDirection();\n const theme = useTheme();\n\n const {\n testIds,\n caseId,\n icon,\n heading,\n subheading,\n caseType,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryExpanded,\n onToggleSummary,\n isPreview,\n aboveSM,\n aboveMD,\n persistentUtility\n } = useCaseViewContext();\n\n const [wrapPromotedActions, setWrapPromotedActions] = useState(false);\n const [summaryResetID, setSummaryResetID] = useState<number | undefined>(Math.random());\n\n const wrapActionsBreakpoint = useRef<number | null>(null);\n\n const iconBackground = useMemo(() => {\n return tryCatch(\n () => {\n const { lightness } = parseToHsl(theme.base.palette['brand-primary']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n },\n () => 'transparent'\n );\n }, [theme]);\n\n const [hasBrokenImage, setHasBrokenImage] = useState<undefined | boolean>();\n const showIcon = !!icon && !hasBrokenImage;\n\n const contentsEl = useRef<HTMLDivElement>(null);\n const headerGroupEl = useRef<HTMLElement>(null);\n const actionsContainerEl = useRef<HTMLDivElement>(null);\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n const caseActions: Action[] | undefined = actions\n ? actions.map(action => {\n return {\n ...action,\n text: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n })\n : undefined;\n const showExpandCollapse = !isPreview && aboveMD;\n const collapsedMainHeader =\n (!isPreview && !aboveMD && aboveSM) || (showExpandCollapse && !summaryExpanded);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n // Actions wrapping\n useLayoutEffect(() => {\n if (\n !wrapPromotedActions &&\n contentsEl.current &&\n headerGroupEl.current &&\n actionsContainerEl.current\n ) {\n const contentStart = getEdge({\n el: contentsEl.current,\n side: 'leading',\n ltr\n });\n const headerGroupEnd = getEdge({\n el: headerGroupEl.current,\n side: 'trailing',\n ltr\n });\n const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;\n\n wrapActionsBreakpoint.current =\n Math.ceil(headerGroupEnd) - Math.ceil(contentStart) + Math.ceil(actionsContainerWidth);\n }\n\n const promotedActionsWrapHandler = () => {\n if (wrapActionsBreakpoint.current && contentsEl.current) {\n setWrapPromotedActions(\n Math.ceil(contentsEl.current.offsetWidth) < wrapActionsBreakpoint.current\n );\n }\n };\n\n const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));\n\n promotedActionsWrapHandler();\n\n if (contentsEl.current) {\n resizeObserver.observe(contentsEl.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [\n contentsEl,\n headerGroupEl,\n actionsContainerEl,\n promotedActions,\n heading,\n subheading,\n wrapPromotedActions\n ]);\n\n // Reset summary\n useEffect(() => {\n setSummaryResetID(Math.random());\n }, [heading, promotedActions]);\n\n useEffect(() => {\n setHasBrokenImage(undefined);\n }, [typeof icon === 'string' ? icon : icon?.href]);\n\n return (\n <Flex\n data-testid={testIds.header}\n as={StyledCaseHeader}\n container={{ direction: 'column', gap: 1.5 }}\n >\n <Flex container ref={contentsEl}>\n {showExpandCollapse && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseSummaryButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse' : 'expand')}\n aria-label={t(summaryExpanded ? 'collapse_summary' : 'expand_summary')}\n icon\n compact\n >\n <Icon name={summaryExpanded ? `arrow-micro-${start}` : 'arrow-micro-down'} />\n </StyledExpandCollapseSummaryButton>\n )}\n\n {showIcon && (\n <Flex container={{ pad: [1, 0, 0] }} item={{ shrink: 0 }}>\n {(() => {\n if (typeof icon === 'string') {\n return (\n <Icon\n data-testid={testIds.icon}\n aria-label={t('case_type_icon', [caseType ?? t('case_type')])}\n name={icon}\n background={iconBackground}\n />\n );\n }\n\n return (\n <StyledIconShape background={iconBackground} data-testid={testIds.icon}>\n <StyledCaseViewImage\n src={icon.href}\n alt={t('case_image')}\n onLoad={() => {\n setHasBrokenImage(false);\n }}\n onError={() => {\n setHasBrokenImage(true);\n }}\n />\n </StyledIconShape>\n );\n })()}\n </Flex>\n )}\n\n {/* header group */}\n <Flex\n as={StyledCaseHeaderText}\n container={{\n direction: 'column',\n pad: [0.5, 2, 0.5, showIcon ? 1 : undefined],\n alignItems: 'start',\n justify: 'center'\n }}\n item={aboveSM ? { shrink: wrapPromotedActions ? 1 : 0 } : { shrink: 1, grow: 1 }}\n ref={headerGroupEl}\n >\n <Text data-testid={testIds.heading} variant='h1'>\n {caseLink ? <Link {...caseLink}>{heading}</Link> : heading}\n </Text>\n\n {subheading && (!parentCases || subheading !== caseId) && (\n <StyledSubheading data-testid={testIds.subheading}>{subheading}</StyledSubheading>\n )}\n\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n {\n ...caseLink,\n id: caseId,\n primary: caseId,\n href: caseLink?.href\n }\n ]}\n leafOnly\n />\n )}\n </Flex>\n {/* summary */}\n {collapsedMainHeader && !wrapPromotedActions && (\n <Summary siblingRef={actionsContainerEl} key={summaryResetID} />\n )}\n {/* inline actions */}\n <Flex\n as={StyledHeaderActions}\n item={{ shrink: 0 }}\n container={{ alignItems: 'start', pad: [0, 0, 0, 2] }}\n offsetEnd={!summaryExpanded}\n ref={actionsContainerEl}\n >\n {collapsedMainHeader &&\n !wrapPromotedActions &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <>\n {promotedActions.map(promotedAction => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n promotedAction.onClick?.(promotedAction.id, e)\n }\n key={promotedAction.id}\n >\n {promotedAction.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n </>\n ) : null}\n\n {onEdit && (\n <Button\n data-testid={testIds.edit}\n icon\n variant='simple'\n onClick={onEdit}\n label={t('edit')}\n aria-label={`${t('edit')} - ${heading}`}\n >\n <Icon name='pencil' />\n </Button>\n )}\n\n {(caseActions || onFollowedChange) && (\n <Actions\n contextualLabel={isPreview ? t('previewed_case') : t('current_case')}\n data-testid={testIds.actions}\n iconOnly\n items={[\n ...(onFollowedChange\n ? [\n {\n id: 'follow',\n text: followed ? t('unfollow') : t('follow'),\n onClick: () => onFollowedChange(!followed)\n }\n ]\n : []),\n ...(caseActions ?? [])\n ]}\n menuAt={1}\n filterAt={5}\n scrollAt={Infinity}\n />\n )}\n </Flex>\n </Flex>\n\n {/* wrapped promoted actions */}\n {(!collapsedMainHeader || wrapPromotedActions || !aboveSM) &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <Flex\n data-testid={testIds.promotedActions}\n container={{ justify: 'start', wrap: 'wrap', gap: 1, pad: [0, 0, 0.5] }}\n >\n {promotedActions.map(({ id, text, onClick }) => (\n <div key={text}>\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick?.(id, e)}\n >\n {text}\n </StyledCaseHeaderPromotedAction>\n </div>\n ))}\n </Flex>\n ) : null}\n </Flex>\n );\n};\n\nexport default CaseHeader;\n"]}
1
+ {"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,qBAAqB,EACrB,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAC5F,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AAExF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iCAAiC,EACjC,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OA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MouseEvent } from 'react';\nimport { parseToHsl } from 'polished';\n\nimport {\n Breadcrumbs,\n Flex,\n getEdge,\n Icon,\n registerIcon,\n Text,\n Link,\n Button,\n throttle,\n useDirection,\n useI18n,\n useAfterInitialEffect,\n useTheme,\n tryCatch,\n Actions,\n StyledIconShape\n} from '@pega/cosmos-react-core';\nimport type { Action } from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledCaseHeader,\n StyledCaseHeaderText,\n StyledExpandCollapseSummaryButton,\n StyledSubheading,\n StyledHeaderActions,\n StyledCaseHeaderPromotedAction,\n StyledCaseViewImage,\n StyledCaseViewIcon\n} from '../CaseView.styles';\nimport { useCaseViewContext } from '../CaseView.context';\n\nimport Summary from './Summary';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n const { ltr, start } = useDirection();\n const theme = useTheme();\n\n const {\n testIds,\n caseId,\n icon,\n heading,\n subheading,\n caseType,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryExpanded,\n onToggleSummary,\n isPreview,\n aboveSM,\n aboveMD,\n persistentUtility\n } = useCaseViewContext();\n\n const [wrapPromotedActions, setWrapPromotedActions] = useState(false);\n const [summaryResetID, setSummaryResetID] = useState<number | undefined>(Math.random());\n\n const wrapActionsBreakpoint = useRef<number | null>(null);\n\n const iconForeground =\n theme.components['case-view'].icon.color !== 'auto'\n ? theme.components['case-view'].icon.color\n : theme.components['case-view'].header['foreground-color'];\n\n const iconBackground = useMemo(() => {\n if (theme.components['case-view'].icon.background !== 'auto') {\n return theme.components['case-view'].icon.background;\n }\n return tryCatch(\n () => {\n const { lightness } = parseToHsl(theme.components['case-view'].header['background-color']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n },\n () => 'transparent'\n );\n }, [theme]);\n\n const [hasBrokenImage, setHasBrokenImage] = useState<undefined | boolean>();\n const showIcon = !!icon && !hasBrokenImage;\n\n const contentsEl = useRef<HTMLDivElement>(null);\n const headerGroupEl = useRef<HTMLElement>(null);\n const actionsContainerEl = useRef<HTMLDivElement>(null);\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n const caseActions: Action[] | undefined = actions\n ? actions.map(action => {\n return {\n ...action,\n text: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n })\n : undefined;\n const showExpandCollapse = !isPreview && aboveMD;\n const collapsedMainHeader =\n (!isPreview && !aboveMD && aboveSM) || (showExpandCollapse && !summaryExpanded);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n // Actions wrapping\n useLayoutEffect(() => {\n if (\n !wrapPromotedActions &&\n contentsEl.current &&\n headerGroupEl.current &&\n actionsContainerEl.current\n ) {\n const contentStart = getEdge({\n el: contentsEl.current,\n side: 'leading',\n ltr\n });\n const headerGroupEnd = getEdge({\n el: headerGroupEl.current,\n side: 'trailing',\n ltr\n });\n const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;\n\n wrapActionsBreakpoint.current =\n Math.ceil(headerGroupEnd) - Math.ceil(contentStart) + Math.ceil(actionsContainerWidth);\n }\n\n const promotedActionsWrapHandler = () => {\n if (wrapActionsBreakpoint.current && contentsEl.current) {\n setWrapPromotedActions(\n Math.ceil(contentsEl.current.offsetWidth) < wrapActionsBreakpoint.current\n );\n }\n };\n\n const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));\n\n promotedActionsWrapHandler();\n\n if (contentsEl.current) {\n resizeObserver.observe(contentsEl.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [\n contentsEl,\n headerGroupEl,\n actionsContainerEl,\n promotedActions,\n heading,\n subheading,\n wrapPromotedActions\n ]);\n\n // Reset summary\n useEffect(() => {\n setSummaryResetID(Math.random());\n }, [heading, promotedActions]);\n\n useEffect(() => {\n setHasBrokenImage(undefined);\n }, [typeof icon === 'string' ? icon : icon?.href]);\n\n return (\n <Flex\n data-testid={testIds.header}\n as={StyledCaseHeader}\n container={{ direction: 'column', gap: 1.5 }}\n >\n <Flex container ref={contentsEl}>\n {showExpandCollapse && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseSummaryButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse' : 'expand')}\n aria-label={t(summaryExpanded ? 'collapse_summary' : 'expand_summary')}\n icon\n compact\n >\n <Icon name={summaryExpanded ? `arrow-micro-${start}` : 'arrow-micro-down'} />\n </StyledExpandCollapseSummaryButton>\n )}\n\n {showIcon && (\n <Flex container={{ pad: [1, 0, 0] }} item={{ shrink: 0 }}>\n {(() => {\n if (typeof icon === 'string') {\n return (\n <StyledCaseViewIcon\n data-testid={testIds.icon}\n aria-label={t('case_type_icon', [caseType ?? t('case_type')])}\n name={icon}\n foreground={iconForeground}\n background={iconBackground}\n />\n );\n }\n\n return (\n <StyledIconShape background={iconBackground} data-testid={testIds.icon}>\n <StyledCaseViewImage\n src={icon.href}\n alt={t('case_image')}\n onLoad={() => {\n setHasBrokenImage(false);\n }}\n onError={() => {\n setHasBrokenImage(true);\n }}\n />\n </StyledIconShape>\n );\n })()}\n </Flex>\n )}\n\n {/* header group */}\n <Flex\n as={StyledCaseHeaderText}\n container={{\n direction: 'column',\n pad: [0.5, 2, 0.5, showIcon ? 1 : undefined],\n alignItems: 'start',\n justify: 'center'\n }}\n item={aboveSM ? { shrink: wrapPromotedActions ? 1 : 0 } : { shrink: 1, grow: 1 }}\n ref={headerGroupEl}\n >\n <Text data-testid={testIds.heading} variant='h1'>\n {caseLink ? <Link {...caseLink}>{heading}</Link> : heading}\n </Text>\n\n {subheading && (!parentCases || subheading !== caseId) && (\n <StyledSubheading data-testid={testIds.subheading}>{subheading}</StyledSubheading>\n )}\n\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n {\n ...caseLink,\n id: caseId,\n primary: caseId,\n href: caseLink?.href\n }\n ]}\n leafOnly\n />\n )}\n </Flex>\n {/* summary */}\n {collapsedMainHeader && !wrapPromotedActions && (\n <Summary siblingRef={actionsContainerEl} key={summaryResetID} />\n )}\n {/* inline actions */}\n <Flex\n as={StyledHeaderActions}\n item={{ shrink: 0 }}\n container={{ alignItems: 'start', pad: [0, 0, 0, 2] }}\n offsetEnd={!summaryExpanded}\n ref={actionsContainerEl}\n >\n {collapsedMainHeader &&\n !wrapPromotedActions &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <>\n {promotedActions.map(promotedAction => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n promotedAction.onClick?.(promotedAction.id, e)\n }\n key={promotedAction.id}\n >\n {promotedAction.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n </>\n ) : null}\n\n {onEdit && (\n <Button\n data-testid={testIds.edit}\n icon\n variant='simple'\n onClick={onEdit}\n label={t('edit')}\n aria-label={`${t('edit')} - ${heading}`}\n >\n <Icon name='pencil' />\n </Button>\n )}\n\n {(caseActions || onFollowedChange) && (\n <Actions\n contextualLabel={isPreview ? t('previewed_case') : t('current_case')}\n data-testid={testIds.actions}\n iconOnly\n items={[\n ...(onFollowedChange\n ? [\n {\n id: 'follow',\n text: followed ? t('unfollow') : t('follow'),\n onClick: () => onFollowedChange(!followed)\n }\n ]\n : []),\n ...(caseActions ?? [])\n ]}\n menuAt={1}\n filterAt={5}\n scrollAt={Infinity}\n />\n )}\n </Flex>\n </Flex>\n\n {/* wrapped promoted actions */}\n {(!collapsedMainHeader || wrapPromotedActions || !aboveSM) &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <Flex\n data-testid={testIds.promotedActions}\n container={{ justify: 'start', wrap: 'wrap', gap: 1, pad: [0, 0, 0.5] }}\n >\n {promotedActions.map(({ id, text, onClick }) => (\n <div key={text}>\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick?.(id, e)}\n >\n {text}\n </StyledCaseHeaderPromotedAction>\n </div>\n ))}\n </Flex>\n ) : null}\n </Flex>\n );\n};\n\nexport default CaseHeader;\n"]}
@@ -59,4 +59,5 @@ export declare const StyledCoachButton: import("styled-components").StyledCompon
59
59
  export declare const StyledUtilitiesWrapper: import("styled-components").StyledComponent<"div", DefaultTheme, {
60
60
  genAIHeight: number | undefined;
61
61
  }, never>;
62
+ export declare const StyledCaseViewIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, DefaultTheme, {}, never>;
62
63
  //# sourceMappingURL=CaseView.styles.d.ts.map
@@ -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;AAqCtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAiC5G,eAAO,MAAM,wBAAwB;2BAdwB,CAAC;;cAelD,OAAO;SA0BjB,CAAC;AAIH,eAAO,MAAM,0BAA0B;2BA7CsB,CAAC;2BAmD5D,CAAC;AAEH,eAAO,MAAM,uBAAuB,6EAsBlC,CAAC;AAIH,eAAO,MAAM,uBAAuB,8MAelC,CAAC;AAIH,eAAO,MAAM,oBAAoB,sLAI/B,CAAC;AAIH,eAAO,MAAM,mBAAmB,uLAE/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,6EA+C3B,CAAC;AAIH,eAAO,MAAM,oBAAoB,+EAShC,CAAC;AAI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AAC;AAIH,eAAO,MAAM,iBAAiB,6EAyD7B,CAAC;AAIF,eAAO,MAAM,WAAW,6EAavB,CAAC;AAGF,eAAO,MAAM,qBAAqB,6EAcjC,CAAC;AAKF,eAAO,MAAM,iCAAiC,6EAM5C,CAAC;AAEH,eAAO,MAAM,cAAc,6EA4H1B,CAAC;AAIF,eAAO,MAAM,sBAAsB,sLAAiB,CAAC;AAErD,eAAO,MAAM,mCAAmC,wLAO9C,CAAC;AAIH,eAAO,MAAM,eAAe,6EAkC1B,CAAC;AAIH,eAAO,MAAM,aAAa,6EA+DzB,CAAC;AAIF,eAAO,MAAM,gBAAgB;oBACX,oBAAoB,CAAC,eAAe,CAAC;wBACjC,OAAO;SA6B3B,CAAC;AAIH,eAAO,MAAM,uBAAuB,6EAgBnC,CAAC;AAIF,eAAO,MAAM,uBAAuB;gCAA4C,OAAO;SAYtF,CAAC;AAIF,eAAO,MAAM,yBAAyB,6EAQpC,CAAC;AAIH,eAAO,MAAM,uBAAuB,6EAIlC,CAAC;AAIH,eAAO,MAAM,WAAW,6EAGvB,CAAC;AAEF,eAAO,MAAM,cAAc,6EAqF1B,CAAC;AAIF,eAAO,MAAM,qBAAqB,sLAMjC,CAAC;AAIF,eAAO,MAAM,iBAAiB,sPAoB5B,CAAC;AAIH,eAAO,MAAM,sBAAsB;iBACpB,MAAM,GAAG,SAAS;SAO/B,CAAC;AAEH,eAAO,MAAM,kBAAkB,8JAoB7B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { getContrast, hideVisually, meetsContrastGuidelines, rgba, transparentize } from 'polished';
3
3
  import { useContext } from 'react';
4
- import { Button, calculateFontSize, CardContent, defaultThemeProp, StyledBreadcrumbs, StyledButtonLink, StyledFieldValue, StyledStackedFieldValue, StyledIcon, StyledLabel, StyledPopover, StyledText, StyledTooltip, tryCatch, FieldValueList, StyledLink, readableHue, StyledCard, Text, readableColor, AppShellContext, AIButton, StyledButton, calculateForegroundColor, calculateBackgroundAndContrastColor, isSolidColor, StyledSummaryListItem, StyledProgressBackdrop, Image } from '@pega/cosmos-react-core';
4
+ import { Button, calculateFontSize, CardContent, defaultThemeProp, StyledBreadcrumbs, StyledButtonLink, StyledFieldValue, StyledStackedFieldValue, StyledIcon, StyledLabel, StyledPopover, StyledText, StyledTooltip, tryCatch, FieldValueList, StyledLink, readableHue, StyledCard, Text, readableColor, AppShellContext, AIButton, StyledButton, calculateForegroundColor, calculateBackgroundAndContrastColor, isSolidColor, StyledSummaryListItem, StyledProgressBackdrop, Image, Icon } from '@pega/cosmos-react-core';
5
5
  import { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';
6
6
  import { headerHeight } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';
7
7
  import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
@@ -844,4 +844,26 @@ export const StyledUtilitiesWrapper = styled.div(({ genAIHeight }) => {
844
844
  `
845
845
  : null;
846
846
  });
847
+ export const StyledCaseViewIcon = styled(Icon)(({ theme }) => {
848
+ return css `
849
+ ${theme.components['case-view'].icon.color !== 'auto'
850
+ ? css `
851
+ color: ${theme.components['case-view'].icon.color};
852
+ `
853
+ : null}
854
+
855
+ ${theme.components['case-view'].icon.background !== 'auto'
856
+ ? css `
857
+ background: ${theme.components['case-view'].icon.background};
858
+ `
859
+ : null}
860
+
861
+ ${theme.components['case-view'].icon['box-shadow'] !== 'auto'
862
+ ? css `
863
+ box-shadow: ${theme.components['case-view'].icon['box-shadow']};
864
+ `
865
+ : null}
866
+ `;
867
+ });
868
+ StyledCaseViewIcon.defaultProps = defaultThemeProp;
847
869
  //# sourceMappingURL=CaseView.styles.js.map
@@ -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,OA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AM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAE7C,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;IACrB,OAAO,WAAW,KAAK,SAAS;QAC9B,CAAC,CAAC,GAAG,CAAA;kCACyB,WAAW;OACtC;QACH,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { getContrast, hideVisually, meetsContrastGuidelines, rgba, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n Button,\n calculateFontSize,\n CardContent,\n defaultThemeProp,\n StyledBreadcrumbs,\n StyledButtonLink,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledIcon,\n StyledLabel,\n StyledPopover,\n StyledText,\n StyledTooltip,\n tryCatch,\n FieldValueList,\n StyledLink,\n readableHue,\n StyledCard,\n Text,\n readableColor,\n AppShellContext,\n AIButton,\n StyledButton,\n calculateForegroundColor,\n calculateBackgroundAndContrastColor,\n isSolidColor,\n StyledSummaryListItem,\n StyledProgressBackdrop,\n Image\n} from '@pega/cosmos-react-core';\nimport type { FontSize } from '@pega/cosmos-react-core';\nimport { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';\nimport type { AppShellContextValue } from '@pega/cosmos-react-core/lib/components/AppShell/AppShellContext';\nimport { headerHeight } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport {\n StyledAllTabsWrapper,\n StyledTabs,\n StylesAllTabsButtonWrapper\n} from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';\nimport {\n resizeDrawerMinWidth,\n resizeDrawerMaxWidth,\n resizeDrawerDefaultWidth\n} from '@pega/cosmos-react-core/lib/styles/constants';\nimport { StyledMenuButton } from '@pega/cosmos-react-core/lib/components/MenuButton/MenuButton';\nimport { StyledTab } from '@pega/cosmos-react-core/lib/components/Tabs/Tab';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\n\nimport { StyledStage, StyledStageContainer, StyledStages } from '../Stages/Stages.styles';\nimport { StyledAssignments } from '../Assignments/Assignments.styles';\nimport { StyledAssignments as StyledHierarchicalAssignments } from '../HierarchicalAssignments/Assignments.styles';\nimport {\n StyledGenAICoachContainer,\n StyledInitialMessageContainer\n} from '../GenAICoach/GenAICoach.styles';\nimport { StyledTaskList } from '../Tasks/TaskList';\nimport { oneColumnDetailsColumnWidth } from '../Details/Details.styles';\n\nimport { useCaseViewContext } from './CaseView.context';\n\nconst labelWidth = '16ch';\nconst inlineEndButtonOffset = '0.375rem';\n\nexport const StyledSummaryPrimaryList = styled(FieldValueList)<{\n wrapped?: boolean;\n}>(({ theme, wrapped }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const detached = theme.components['field-value-list'].inline.detached;\n\n return css`\n ${wrapped\n ? css`\n grid-template-columns: minmax(0, 1fr);\n `\n : css`\n ${detached &&\n css`\n gap: calc(${theme.base.spacing});\n `}\n grid-template-columns: ${labelWidth} auto;\n `}\n\n ${StyledFieldValue} {\n font-size: ${fontSizes[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n > ${StyledButtonLink} {\n font-weight: inherit;\n }\n }\n `;\n});\n\nStyledSummaryPrimaryList.defaultProps = defaultThemeProp;\n\nexport const StyledSummarySecondaryList = styled(FieldValueList)(() => {\n return css`\n ${StyledStackedFieldValue} {\n grid-column: 1 / -1;\n }\n `;\n});\n\nexport const StyledCaseSummaryFields = styled.div(({ theme }) => {\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n\n return (\n detached &&\n css`\n ${StyledSummaryPrimaryList} {\n padding-block-start: calc(${theme.components.card.padding} * 2);\n padding-inline: calc(${theme.components.card.padding} * 2);\n }\n\n ${StyledSummarySecondaryList} {\n padding: calc(${theme.components.card.padding} * 2);\n }\n `\n );\n});\n\nStyledCaseSummaryFields.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryTabContent = styled(CardContent)(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n return css`\n ${StyledSummarySecondaryList} {\n > ${StyledStackedFieldValue} {\n max-width: ${oneColumnDetailsColumnWidth};\n }\n\n > ${StyledFieldValue} {\n max-width: calc(${oneColumnDetailsColumnWidth} - ${labelWidth} - 2 * ${spacing});\n }\n }\n `;\n});\n\nStyledSummaryTabContent.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryHeading = styled(Text)(({ theme }) => {\n return css`\n margin-block-end: ${theme.base.spacing};\n `;\n});\n\nStyledSummaryHeading.defaultProps = defaultThemeProp;\n\nexport const StyledCaseViewImage = styled(Image)`\n max-height: 100%;\n`;\n\nexport const StyledCaseHeader = styled.div(({ theme }) => {\n const {\n components: {\n 'case-view': {\n header: { 'foreground-color': caseHeaderForegroundColor, background },\n summary: { detached: summaryDetached },\n utilities: { detached: utilitiesDetached }\n }\n },\n base: { 'border-radius': borderRadius, spacing, shadow, 'z-index': zIndex, palette }\n } = theme;\n const foregroundColor = calculateForegroundColor(background, caseHeaderForegroundColor);\n const { aboveSM, aboveMD, persistentUtility, aboveXL, summaryExpanded, isPreview } =\n useCaseViewContext();\n const shouldRenderMobileTabs = !aboveMD || (persistentUtility && !aboveXL) || !summaryExpanded;\n const caseHeaderBorderRadius = shouldRenderMobileTabs\n ? `0 0 ${utilitiesDetached ? borderRadius : 0} ${borderRadius}`\n : `${borderRadius} ${borderRadius} 0 0`;\n\n return css`\n background: ${background};\n color: ${foregroundColor};\n padding: ${spacing} calc(2 * ${spacing});\n position: relative;\n\n ${summaryDetached &&\n css`\n border-bottom: 0.0625rem solid ${palette['border-line']};\n `}\n\n ${summaryDetached &&\n !isPreview &&\n aboveSM &&\n css`\n border-radius: ${caseHeaderBorderRadius};\n `}\n\n h1:focus-visible {\n outline: transparent;\n box-shadow: ${shadow.focus};\n }\n\n ${StyledMenu} {\n color: ${palette['foreground-color']};\n z-index: ${zIndex.popover + 1};\n }\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledFollowIconWrap = styled.label`\n font-size: 1.25rem;\n input {\n ${hideVisually}\n }\n\n input:focus + svg {\n box-shadow: ${({ theme }) => theme.base.shadow.focus};\n }\n`;\n\nStyledFollowIconWrap.defaultProps = defaultThemeProp;\n\nexport const StyledSubheading = styled.p``;\n\nStyledSubheading.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderActions = styled.div<{ offsetEnd: boolean }>(({ offsetEnd, theme }) => {\n return css`\n margin-inline-start: auto;\n padding-block: ${theme.base.spacing};\n padding-inline-start: calc(2 * ${theme.base.spacing});\n\n ${offsetEnd &&\n css`\n padding-inline-end: ${inlineEndButtonOffset};\n `};\n\n ${StyledButton} {\n margin-inline-start: 0;\n }\n `;\n});\n\nStyledHeaderActions.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderText = styled.hgroup(({ theme }) => {\n const {\n components: {\n 'case-view': {\n header: { 'foreground-color': foregroundColor, background: caseHeaderBackground }\n }\n }\n } = theme;\n\n /* If the foreground-color is auto, we calculate the text color and transparentColor based on the background color. */\n const color = calculateForegroundColor(caseHeaderBackground, foregroundColor);\n\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n const idStyle = css`\n color: ${color};\n font-size: ${fontSize.s};\n font-weight: normal;\n `;\n\n return css`\n word-break: break-word;\n\n ${StyledSubheading} {\n ${idStyle}\n }\n\n ${StyledBreadcrumbs} {\n max-width: 100%;\n\n > a,\n > span,\n > button,\n > svg {\n ${idStyle}\n }\n\n > a,\n > button {\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n\n ${StyledPopover}:not(${StyledTooltip}) {\n color: ${theme.base.palette['foreground-color']};\n }\n }\n\n > ${StyledText} > ${StyledLink} {\n color: ${color};\n }\n\n + ${StyledHeaderActions} {\n padding-inline-start: 0;\n }\n `;\n});\n\nStyledCaseHeaderText.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderPromotedAction = styled(Button)(({ theme }) => {\n const {\n base: {\n palette: { interactive }\n },\n components: {\n 'case-view': {\n header: { background, 'foreground-color': foregroundColor }\n }\n }\n } = theme;\n\n /* If foreground color is auto, we calculate the text color based on the background color. */\n const textColor = calculateForegroundColor(background, foregroundColor);\n const isGradientBackground = !isSolidColor(background);\n const backgroundColor = isGradientBackground ? readableColor(textColor) : background;\n const interactiveUsable = getContrast(backgroundColor, interactive) >= 4.5;\n const color = !isGradientBackground && interactiveUsable ? interactive : textColor;\n\n let hoverBackground = rgba(color, 0.15);\n if (!isGradientBackground && interactiveUsable) {\n hoverBackground = readableHue(interactive, color);\n }\n return css`\n --button-background-color: ${backgroundColor};\n color: ${color};\n background-color: transparent;\n border-color: ${color};\n\n @media (hover: hover) {\n &:hover {\n --button-background-color: ${hoverBackground};\n color: ${color};\n background-color: ${hoverBackground};\n border-color: ${color};\n }\n\n &:active {\n --button-background-color: ${hoverBackground};\n color: ${color};\n background-color: ${hoverBackground};\n border-color: ${color};\n }\n }\n `;\n});\n\nStyledCaseHeaderPromotedAction.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderSummaryBlock = styled.div<{ hasItems: boolean }>(({ hasItems, theme }) => {\n const {\n base: {\n spacing,\n palette: { 'brand-primary': primary }\n }\n } = theme;\n\n const color = readableColor(primary);\n const transparentColor = tryCatch(() => transparentize(0.5, color));\n\n return css`\n ${hasItems &&\n css`\n border-inline-start: 0.0625rem solid ${transparentColor};\n `}\n\n ${StyledStackedFieldValue}:first-child {\n margin-inline-start: calc(2 * ${spacing});\n }\n `;\n});\n\nStyledHeaderSummaryBlock.defaultProps = defaultThemeProp;\n\nconst popoverColorReset = (theme: DefaultTheme) => {\n const {\n base: {\n palette: { interactive, light, 'foreground-color': baseForeground }\n }\n } = theme;\n\n return css`\n ${StyledPopover}:not(${StyledTooltip}) {\n color: ${baseForeground};\n\n ${StyledButtonLink},\n ${StyledLink} {\n color: ${interactive};\n text-decoration: none;\n\n &:hover,\n &:active {\n text-decoration: underline;\n }\n\n &:focus {\n box-shadow:\n inset 0 0 0 0.0625rem ${light},\n 0 0 0.125rem 0.0625rem ${interactive};\n }\n }\n }\n `;\n};\n\nexport const StyledHeaderSummary = styled.dl(({ theme }) => {\n const {\n base: {\n palette: { interactive }\n },\n components: {\n 'case-view': {\n header: { 'foreground-color': foregroundColor, background }\n }\n }\n } = theme;\n\n /* If the foreground-color is auto, we calculate the text color and transparentColor based on the background color. */\n const color = calculateForegroundColor(background, foregroundColor);\n const { backgroundColor } = calculateBackgroundAndContrastColor(background, foregroundColor);\n const interactiveUsable = meetsContrastGuidelines(backgroundColor, interactive).AA;\n\n return css`\n max-width: 100%;\n min-width: 0;\n\n > ${StyledStackedFieldValue} {\n > ${StyledLabel} {\n color: ${color};\n white-space: nowrap;\n }\n\n > ${StyledFieldValue} {\n color: ${color};\n white-space: nowrap;\n }\n\n ${StyledButtonLink},\n ${StyledLink} {\n &:focus-visible {\n box-shadow: inset 0 0 0 0.0625rem ${color};\n }\n\n ${!interactiveUsable &&\n css`\n color: ${color};\n text-decoration: underline;\n `}\n }\n\n ${popoverColorReset(theme)}\n }\n `;\n});\n\nStyledHeaderSummary.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderSummaryValue = styled(StyledFieldValue)(({\n bold,\n truncate,\n theme\n}: {\n bold?: boolean;\n truncate?: boolean;\n theme: DefaultTheme;\n}) => {\n const {\n base: {\n 'content-width': { xs }\n },\n components: {\n text: {\n h1: { 'font-weight': h1Weight }\n }\n }\n } = theme;\n\n return css`\n overflow: hidden;\n text-overflow: ellipsis;\n\n ${truncate &&\n css`\n max-width: ${xs};\n `}\n\n ${bold &&\n css`\n font-weight: ${h1Weight};\n `}\n\n /*\n * :not([hidden]) necessary to prevent hidden span with preview a11y instructions from\n * factoring into scrollWidth of element when determining truncation.\n */\n > :not([hidden]) {\n display: inline;\n }\n `;\n});\n\nStyledHeaderSummaryValue.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryInfo = styled.div(\n ({\n theme: {\n base: { 'border-radius': borderRadius },\n components: {\n tabs: { detached: tabsDetached },\n card: { background }\n }\n }\n }) => {\n const { intelligentGuidance } = useCaseViewContext();\n\n return css`\n overflow: auto;\n flex: 1;\n ${tabsDetached &&\n css`\n background: ${background};\n border-radius: ${borderRadius};\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n `}\n ${intelligentGuidance &&\n css`\n /* Accounts for collapsed intelligentGuidance list covering summary panel content when fully scrolled. */\n padding-block-end: 4rem;\n `}\n `;\n }\n);\n\nStyledCaseSummaryInfo.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryContainer = styled.div(({ theme }) => {\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n },\n card: { background }\n }\n } = theme;\n return css`\n padding: calc(1.5 * ${theme.base.spacing}) calc(${theme.components.card.padding} * 2);\n\n ${detached &&\n css`\n padding: 0;\n background: ${background};\n `}\n `;\n});\n\nStyledCaseSummaryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseButton = styled(Button)(() => {\n return css`\n border: none;\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n }\n `;\n});\n\nStyledExpandCollapseButton.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseSummaryButton = styled(StyledExpandCollapseButton)(({ theme }) => {\n const { summaryExpanded } = useCaseViewContext();\n\n return css`\n --half-compact-btn-height: calc(${theme.base['hit-area'].compact} / 2);\n --half-btn-compact-difference: calc(\n (${theme.base['hit-area'].mouse} - ${theme.base['hit-area'].compact}) / 2\n );\n --half-case-icon-compact-difference: calc(\n ((4 * ${theme.base.spacing}) - ${theme.base['hit-area'].compact}) / 2\n );\n @media (pointer: coarse) {\n --half-btn-compact-difference: calc(\n (${theme.base['hit-area'].finger} - ${theme.base['hit-area'].compact}) / 2\n );\n }\n position: absolute;\n z-index: 1;\n box-shadow: ${theme.base.shadow.low};\n\n ${summaryExpanded\n ? css`\n inset-block-start: calc(2 * ${theme.base.spacing} + var(--half-btn-compact-difference));\n inset-inline-start: calc(100% - var(--half-compact-btn-height));\n `\n : css`\n inset-block-end: calc(var(--half-compact-btn-height) * -1);\n inset-inline-start: calc(\n 2 * ${theme.base.spacing} + var(--half-case-icon-compact-difference)\n );\n `}\n `;\n});\n\nStyledExpandCollapseSummaryButton.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummary = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'border-line': borderLine, interactive },\n 'border-radius': borderRadius,\n 'hit-area': { 'mouse-min': mouseMin, 'finger-min': fingerMin }\n },\n components: {\n 'case-view': {\n summary: { detached }\n },\n card: { background: cardBackground },\n tabs: { detached: tabsDetached }\n }\n }\n }) => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n\n return css`\n background: ${cardBackground};\n position: relative;\n height: 100%;\n ${aboveMD &&\n summaryExpanded &&\n css`\n width: 25rem;\n `}\n\n ${detached &&\n css`\n border-radius: ${borderRadius};\n --border-radius: calc(${borderRadius} * 0.5);\n `}\n\n ${tabsDetached &&\n css`\n & ${StyledTabs} {\n &[aria-orientation='vertical'] {\n padding-top: calc(1.5 * ${spacing});\n border-block-start: 0.0625rem solid ${borderLine};\n & ${StyledTab} {\n height: ${mouseMin};\n\n @media (pointer: coarse) {\n height: ${fingerMin};\n }\n &[aria-selected='true'] {\n background-color: ${transparentize(0.92, interactive)};\n }\n }\n }\n }\n `}\n `;\n }\n);\n\nStyledCaseSummary.defaultProps = defaultThemeProp;\n\nexport const StyledTasks = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n &:not(:has(${StyledCard})) {\n /* Add negative top margin to compensate extra row-gap due to empty Tasks container */\n margin-block-start: calc(-2 * ${spacing});\n }\n `;\n }\n);\nStyledTasks.defaultProps = defaultThemeProp;\n\nexport const StyledTabPanelWrapper = styled.div(\n ({\n theme: {\n components: {\n card: { 'border-radius': cardBorderRadius }\n }\n }\n }) => {\n return css`\n ${StyledTabPanel} ${StyledProgressBackdrop} {\n border-radius: ${cardBorderRadius};\n }\n `;\n }\n);\n\nStyledTabPanelWrapper.defaultProps = defaultThemeProp;\n\n// This component defintion was primarily required to conditionally hide empty div and avoid unnecessary row gap in work area.\nexport const StyledBannersStagesTasksContainer = styled.div(() => {\n return css`\n &:has(> ${StyledTasks}:only-child > :only-child:empty[data-flow]) {\n display: none;\n }\n `;\n});\n\nexport const StyledWorkArea = styled.div(\n ({\n theme: {\n base: {\n palette: { 'border-line': borderLine },\n spacing,\n 'border-radius': borderRadius\n },\n components: {\n 'case-view': {\n assignments: {\n detached: assignmentDetached,\n background: assignmentBackground,\n 'foreground-color': assignmentForegroundColor\n }\n },\n tabs: { detached: tabsDetached },\n card: { background, 'foreground-color': foregroundColor, 'border-radius': cardBorderRadius }\n }\n }\n }) => {\n const { backgroundColor } = calculateBackgroundAndContrastColor(background, foregroundColor);\n const foregroundColorForAssignment = calculateForegroundColor(\n assignmentBackground,\n assignmentForegroundColor\n );\n const { summaryExpanded, aboveMD, intelligentGuidance, isPreview } = useCaseViewContext();\n let pbeRem = 0;\n\n if (intelligentGuidance) {\n pbeRem = aboveMD && !summaryExpanded ? 4 : 6;\n }\n\n return css`\n grid-area: work-area;\n padding: calc(2 * ${spacing});\n\n ${aboveMD &&\n css`\n padding: calc(2 * ${spacing}) 0;\n\n /* This is required to make scrollStick work. */\n ${!isPreview &&\n css`\n height: max-content;\n `}\n\n ${!summaryExpanded &&\n css`\n margin-inline-start: calc(2 * ${spacing});\n `}\n `}\n\n /* Order of style here is necessary for overriding styles above. */\n ${pbeRem > 0 &&\n css`\n /* Accounts for collapsed intelligentGuidance bubble covering work area content when fully scrolled. */\n padding-block-end: ${pbeRem}rem;\n `}\n\n &:has(${StyledAssignments}),\n &:has(${StyledHierarchicalAssignments}) {\n ${StyledStages} {\n border-block-end: 0.0625rem solid ${borderLine};\n\n &,\n ${StyledStageContainer}:first-of-type > ${StyledStage} {\n border-end-start-radius: 0;\n }\n\n &,\n ${StyledStageContainer}:last-of-type > ${StyledStage} {\n border-end-end-radius: 0;\n }\n }\n }\n\n ${tabsDetached &&\n css`\n ${StyledAllTabsWrapper} {\n border-start-start-radius: ${cardBorderRadius};\n border-start-end-radius: ${cardBorderRadius};\n\n ${StyledTabs} {\n border-radius: unset;\n border-start-end-radius: inherit;\n }\n\n ${StylesAllTabsButtonWrapper}, ${StyledMenuButton} {\n border-start-start-radius: inherit;\n }\n }\n `}\n\n &:has(${StyledStages}) {\n ${StyledCard}${StyledAssignments},\n ${StyledCard}${StyledHierarchicalAssignments} {\n margin-block-start: calc(-2 * ${spacing});\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n &:has(${StyledCard}${StyledAssignments} > ${StyledCardHeader}),\n &:has(${StyledCard}${StyledHierarchicalAssignments} > ${StyledCardHeader}) {\n ${StyledCard}${StyledAssignments},\n ${StyledCard}${StyledHierarchicalAssignments} {\n background: ${assignmentBackground};\n color: ${foregroundColorForAssignment};\n ${assignmentDetached &&\n css`\n ${StyledTaskList} {\n background-color: ${backgroundColor};\n border: solid 0.0625rem ${borderLine};\n border-radius: var(--border-radius, ${borderRadius});\n ${StyledSummaryListItem} {\n padding: calc(${spacing} / 2) ${spacing};\n }\n }\n `}\n }\n }\n }\n `;\n }\n);\n\nStyledWorkArea.defaultProps = defaultThemeProp;\n\nexport const StyledUtilitiesHeading = styled(Text)``;\n\nexport const StyledExpandCollapseUtilitiesButton = styled(StyledExpandCollapseButton)(() => {\n const { utilitiesExpanded } = useCaseViewContext();\n\n return css`\n /* Centers button over the utilities summary */\n margin-inline-end: ${utilitiesExpanded && '0.625rem'};\n `;\n});\n\nStyledExpandCollapseUtilitiesButton.defaultProps = defaultThemeProp;\n\nexport const StyledUtilities = styled.div(({ theme }) => {\n const { utilitiesExpanded, aboveLG, aboveMD } = useCaseViewContext();\n\n return css`\n height: max-content;\n margin-block: calc(2 * ${theme.base.spacing});\n\n ${StyledCardContent} ${StyledProgressBackdrop} {\n border-radius: ${theme.components.card['border-radius']};\n }\n\n /* If utilities are in an expanded drawer. */\n ${utilitiesExpanded &&\n aboveMD &&\n !aboveLG &&\n css`\n /* Maintains the column width to avoid page content shift. */\n visibility: hidden;\n `}\n\n ${aboveLG &&\n utilitiesExpanded &&\n css`\n width: 25rem;\n `}\n\n\n /* Selects the h2 in the utilities column, not the drawer. */\n ${StyledUtilitiesHeading} {\n /* Hide the utilities h2 under certain conditions.*/\n ${((aboveMD && !utilitiesExpanded) || (aboveMD && utilitiesExpanded && !aboveLG)) &&\n hideVisually()}\n }\n `;\n});\n\nStyledUtilities.defaultProps = defaultThemeProp;\n\nexport const StyledSummary = styled.div(\n ({\n theme: {\n base: {\n spacing,\n breakpoints,\n 'z-index': zIndex,\n palette: { 'app-background': appBackground }\n },\n components: {\n 'app-shell': {\n nav: { background: navBackground }\n },\n 'case-view': {\n summary: { detached: summaryDetached },\n utilities: { detached: utilitiesDetached }\n }\n }\n }\n }) => {\n const { aboveSM, aboveMD, persistentUtility, aboveXL, summaryExpanded, isPreview } =\n useCaseViewContext();\n const shouldRenderMobileTabs = !aboveMD || (persistentUtility && !aboveXL) || !summaryExpanded;\n const inlineStartPadding =\n navBackground === appBackground ? `${spacing}` : `calc(${spacing} * 2)`;\n\n return css`\n top: ${summaryExpanded ? 'var(--top-offset)' : 'var(--appshell-offset, 0)'};\n width: 100%;\n z-index: ${zIndex.popover};\n\n ${aboveMD &&\n summaryExpanded &&\n css`\n height: var(--case-view-height);\n `}\n\n ${summaryDetached &&\n aboveSM &&\n css`\n padding-inline-start: ${inlineStartPadding};\n padding-inline-end: ${utilitiesDetached && shouldRenderMobileTabs\n ? `calc(2 * ${spacing})`\n : 0};\n padding-block: ${shouldRenderMobileTabs ? 0 : `calc(2 * ${spacing})`};\n `}\n\n ${isPreview &&\n css`\n padding: 0;\n `}\n\n ${aboveMD\n ? css`\n position: sticky;\n `\n : css`\n @media (min-height: ${breakpoints.sm}) {\n position: sticky;\n }\n `}\n `;\n }\n);\n\nStyledSummary.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawer = styled.div<{\n previewActive?: AppShellContextValue['previewActive'];\n utilitiesExpanded?: boolean;\n}>(({ previewActive, utilitiesExpanded, theme }) => {\n return css`\n --utilities-drawer-width: var(--resize-drawer-width);\n --utilities-drawer-min-width: ${resizeDrawerMinWidth};\n min-width: var(--utilities-drawer-min-width);\n max-width: ${resizeDrawerMaxWidth};\n width: var(--utilities-drawer-width);\n background-color: ${theme.base.palette['primary-background']};\n height: calc(100vh - ${headerHeight});\n inset-block-start: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer - 1};\n\n ${previewActive &&\n css`\n @media (min-width: ${theme.base.breakpoints.xl}) {\n inset-inline-end: ${resizeDrawerDefaultWidth};\n ${utilitiesExpanded &&\n css`\n inset-inline-end: var(--resize-drawer-width);\n width: var(--utilities-drawer-min-width);\n `}\n }\n `}\n\n ${StyledGenAICoachContainer} {\n width: calc(var(--utilities-drawer-width) - 2rem);\n }\n `;\n});\n\nStyledCaseDrawer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawerContent = styled.div(\n ({\n theme: {\n base: {\n palette: { 'app-background': appBackground },\n spacing\n }\n }\n }) => {\n return css`\n background: ${appBackground};\n padding: calc(2 * ${spacing});\n height: 100%;\n overflow: auto;\n `;\n }\n);\n\nStyledCaseDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentUtility = styled.div<{ persistentUtilityExpanded?: boolean }>(\n ({ theme, persistentUtilityExpanded }) => {\n return css`\n width: ${persistentUtilityExpanded ? '100%' : theme.base['content-width'].md};\n overflow: auto;\n position: sticky;\n z-index: 1;\n height: var(--case-view-height);\n inset-block-start: var(--top-offset);\n padding-block: calc(2 * ${theme.base.spacing});\n `;\n }\n);\n\nStyledPersistentUtility.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentContainer = styled.div(({ theme }) => {\n return css`\n height: 100%;\n\n &&& ${StyledCardHeader} {\n padding-inline-start: ${theme.base.spacing};\n }\n `;\n});\n\nStyledPersistentContainer.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentContent = styled.div(({ theme }) => {\n return css`\n height: calc(100% - calc(4 * ${theme.base.spacing}));\n `;\n});\n\nStyledPersistentContent.defaultProps = defaultThemeProp;\n\nexport const ScrollStick = styled.div`\n position: sticky;\n top: 0;\n`;\n\nexport const StyledCaseView = styled.div(\n ({\n theme: {\n base: {\n palette: { 'app-background': appBackground },\n spacing,\n 'border-radius': borderRadius\n },\n components: {\n 'case-view': {\n utilities: {\n detached: utilitiesDetached,\n background: utilitiesBackground,\n 'foreground-color': utilitiesForegroundColor\n },\n summary: { detached: summaryDetached }\n }\n }\n }\n }) => {\n const utilitiesForegroundComputed = calculateForegroundColor(\n utilitiesBackground,\n utilitiesForegroundColor\n );\n const { aboveSM, aboveMD, isPreview } = useCaseViewContext();\n\n return css`\n --top-offset: calc(var(--appshell-offset, 0rem) + var(--summary-height));\n --case-view-height: calc(100vh - var(--top-offset));\n position: relative;\n min-height: var(--case-view-height);\n background: ${appBackground};\n\n ${aboveMD &&\n css`\n ${StyledUtilities}:last-child {\n margin-inline-end: calc(2 * ${spacing});\n color: ${utilitiesForegroundComputed};\n\n ${!utilitiesDetached &&\n css`\n background: ${utilitiesBackground};\n margin-inline-end: 0;\n padding: calc(2 * ${spacing});\n padding-inline-end: 0;\n border-radius: ${borderRadius} 0 0 ${borderRadius};\n\n ${StyledCard},\n ${StyledGenAICoachContainer} {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n ${StyledGenAICoachContainer} {\n inset-inline-end: 0;\n }\n `}\n }\n `}\n\n ${aboveSM &&\n summaryDetached &&\n !isPreview &&\n css`\n &:not(:has(${StyledUtilities})) {\n ${StyledSummary} {\n padding-inline-end: calc(2 * ${spacing});\n }\n ${StyledCaseHeader} {\n border-end-end-radius: ${borderRadius};\n }\n }\n `}\n\n ${!aboveMD &&\n css`\n ${StyledGenAICoachContainer} {\n height: 42.5rem;\n ${StyledInitialMessageContainer} {\n justify-content: center;\n }\n }\n `}\n `;\n }\n);\n\nStyledCaseView.defaultProps = defaultThemeProp;\n\nexport const StyledUtilitiesHeader = styled(Text)`\n align-self: center;\n\n &:not(:focus) {\n ${hideVisually}\n }\n`;\n\nStyledUtilitiesHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCoachButton = styled(AIButton)(({\n theme: {\n base: { spacing, breakpoints }\n }\n}) => {\n const { previewActive } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n width: 2.75rem;\n height: 2.75rem;\n inset-block-end: calc(2 * ${spacing});\n inset-inline-end: calc(2 * ${spacing});\n ${previewActive &&\n css`\n @media (min-width: ${breakpoints.xl}) {\n margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});\n }\n `}\n `;\n});\n\nStyledCoachButton.defaultProps = defaultThemeProp;\n\nexport const StyledUtilitiesWrapper = styled.div<{\n genAIHeight: number | undefined;\n}>(({ genAIHeight }) => {\n return genAIHeight !== undefined\n ? css`\n padding-block-end: calc(${genAIHeight}px + 1rem);\n `\n : null;\n});\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,WAAW,EAAE,YAAY,EAAE,uBAAuB,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,aAAa,EACb,QAAQ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AE;IAC3D,OAAO,GAAG,CAAA;MACN,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,MAAM;QACnD,CAAC,CAAC,GAAG,CAAA;mBACQ,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK;SAClD;QACH,CAAC,CAAC,IAAI;;MAEN,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAU,KAAK,MAAM;QACxD,CAAC,CAAC,GAAG,CAAA;wBACa,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAU;SAC5D;QACH,CAAC,CAAC,IAAI;;MAEN,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,MAAM;QAC3D,CAAC,CAAC,GAAG,CAAA;wBACa,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;SAC/D;QACH,CAAC,CAAC,IAAI;GACT,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { getContrast, hideVisually, meetsContrastGuidelines, rgba, transparentize } from 'polished';\nimport { useContext } from 'react';\n\nimport {\n Button,\n calculateFontSize,\n CardContent,\n defaultThemeProp,\n StyledBreadcrumbs,\n StyledButtonLink,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledIcon,\n StyledLabel,\n StyledPopover,\n StyledText,\n StyledTooltip,\n tryCatch,\n FieldValueList,\n StyledLink,\n readableHue,\n StyledCard,\n Text,\n readableColor,\n AppShellContext,\n AIButton,\n StyledButton,\n calculateForegroundColor,\n calculateBackgroundAndContrastColor,\n isSolidColor,\n StyledSummaryListItem,\n StyledProgressBackdrop,\n Image,\n Icon\n} from '@pega/cosmos-react-core';\nimport type { FontSize } from '@pega/cosmos-react-core';\nimport { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';\nimport type { AppShellContextValue } from '@pega/cosmos-react-core/lib/components/AppShell/AppShellContext';\nimport { headerHeight } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport {\n StyledAllTabsWrapper,\n StyledTabs,\n StylesAllTabsButtonWrapper\n} from '@pega/cosmos-react-core/lib/components/Tabs/Tabs.styles';\nimport {\n resizeDrawerMinWidth,\n resizeDrawerMaxWidth,\n resizeDrawerDefaultWidth\n} from '@pega/cosmos-react-core/lib/styles/constants';\nimport { StyledMenuButton } from '@pega/cosmos-react-core/lib/components/MenuButton/MenuButton';\nimport { StyledTab } from '@pega/cosmos-react-core/lib/components/Tabs/Tab';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\n\nimport { StyledStage, StyledStageContainer, StyledStages } from '../Stages/Stages.styles';\nimport { StyledAssignments } from '../Assignments/Assignments.styles';\nimport { StyledAssignments as StyledHierarchicalAssignments } from '../HierarchicalAssignments/Assignments.styles';\nimport {\n StyledGenAICoachContainer,\n StyledInitialMessageContainer\n} from '../GenAICoach/GenAICoach.styles';\nimport { StyledTaskList } from '../Tasks/TaskList';\nimport { oneColumnDetailsColumnWidth } from '../Details/Details.styles';\n\nimport { useCaseViewContext } from './CaseView.context';\n\nconst labelWidth = '16ch';\nconst inlineEndButtonOffset = '0.375rem';\n\nexport const StyledSummaryPrimaryList = styled(FieldValueList)<{\n wrapped?: boolean;\n}>(({ theme, wrapped }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const detached = theme.components['field-value-list'].inline.detached;\n\n return css`\n ${wrapped\n ? css`\n grid-template-columns: minmax(0, 1fr);\n `\n : css`\n ${detached &&\n css`\n gap: calc(${theme.base.spacing});\n `}\n grid-template-columns: ${labelWidth} auto;\n `}\n\n ${StyledFieldValue} {\n font-size: ${fontSizes[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n > ${StyledButtonLink} {\n font-weight: inherit;\n }\n }\n `;\n});\n\nStyledSummaryPrimaryList.defaultProps = defaultThemeProp;\n\nexport const StyledSummarySecondaryList = styled(FieldValueList)(() => {\n return css`\n ${StyledStackedFieldValue} {\n grid-column: 1 / -1;\n }\n `;\n});\n\nexport const StyledCaseSummaryFields = styled.div(({ theme }) => {\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n\n return (\n detached &&\n css`\n ${StyledSummaryPrimaryList} {\n padding-block-start: calc(${theme.components.card.padding} * 2);\n padding-inline: calc(${theme.components.card.padding} * 2);\n }\n\n ${StyledSummarySecondaryList} {\n padding: calc(${theme.components.card.padding} * 2);\n }\n `\n );\n});\n\nStyledCaseSummaryFields.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryTabContent = styled(CardContent)(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n return css`\n ${StyledSummarySecondaryList} {\n > ${StyledStackedFieldValue} {\n max-width: ${oneColumnDetailsColumnWidth};\n }\n\n > ${StyledFieldValue} {\n max-width: calc(${oneColumnDetailsColumnWidth} - ${labelWidth} - 2 * ${spacing});\n }\n }\n `;\n});\n\nStyledSummaryTabContent.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryHeading = styled(Text)(({ theme }) => {\n return css`\n margin-block-end: ${theme.base.spacing};\n `;\n});\n\nStyledSummaryHeading.defaultProps = defaultThemeProp;\n\nexport const StyledCaseViewImage = styled(Image)`\n max-height: 100%;\n`;\n\nexport const StyledCaseHeader = styled.div(({ theme }) => {\n const {\n components: {\n 'case-view': {\n header: { 'foreground-color': caseHeaderForegroundColor, background },\n summary: { detached: summaryDetached },\n utilities: { detached: utilitiesDetached }\n }\n },\n base: { 'border-radius': borderRadius, spacing, shadow, 'z-index': zIndex, palette }\n } = theme;\n const foregroundColor = calculateForegroundColor(background, caseHeaderForegroundColor);\n const { aboveSM, aboveMD, persistentUtility, aboveXL, summaryExpanded, isPreview } =\n useCaseViewContext();\n const shouldRenderMobileTabs = !aboveMD || (persistentUtility && !aboveXL) || !summaryExpanded;\n const caseHeaderBorderRadius = shouldRenderMobileTabs\n ? `0 0 ${utilitiesDetached ? borderRadius : 0} ${borderRadius}`\n : `${borderRadius} ${borderRadius} 0 0`;\n\n return css`\n background: ${background};\n color: ${foregroundColor};\n padding: ${spacing} calc(2 * ${spacing});\n position: relative;\n\n ${summaryDetached &&\n css`\n border-bottom: 0.0625rem solid ${palette['border-line']};\n `}\n\n ${summaryDetached &&\n !isPreview &&\n aboveSM &&\n css`\n border-radius: ${caseHeaderBorderRadius};\n `}\n\n h1:focus-visible {\n outline: transparent;\n box-shadow: ${shadow.focus};\n }\n\n ${StyledMenu} {\n color: ${palette['foreground-color']};\n z-index: ${zIndex.popover + 1};\n }\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledFollowIconWrap = styled.label`\n font-size: 1.25rem;\n input {\n ${hideVisually}\n }\n\n input:focus + svg {\n box-shadow: ${({ theme }) => theme.base.shadow.focus};\n }\n`;\n\nStyledFollowIconWrap.defaultProps = defaultThemeProp;\n\nexport const StyledSubheading = styled.p``;\n\nStyledSubheading.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderActions = styled.div<{ offsetEnd: boolean }>(({ offsetEnd, theme }) => {\n return css`\n margin-inline-start: auto;\n padding-block: ${theme.base.spacing};\n padding-inline-start: calc(2 * ${theme.base.spacing});\n\n ${offsetEnd &&\n css`\n padding-inline-end: ${inlineEndButtonOffset};\n `};\n\n ${StyledButton} {\n margin-inline-start: 0;\n }\n `;\n});\n\nStyledHeaderActions.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderText = styled.hgroup(({ theme }) => {\n const {\n components: {\n 'case-view': {\n header: { 'foreground-color': foregroundColor, background: caseHeaderBackground }\n }\n }\n } = theme;\n\n /* If the foreground-color is auto, we calculate the text color and transparentColor based on the background color. */\n const color = calculateForegroundColor(caseHeaderBackground, foregroundColor);\n\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n const idStyle = css`\n color: ${color};\n font-size: ${fontSize.s};\n font-weight: normal;\n `;\n\n return css`\n word-break: break-word;\n\n ${StyledSubheading} {\n ${idStyle}\n }\n\n ${StyledBreadcrumbs} {\n max-width: 100%;\n\n > a,\n > span,\n > button,\n > svg {\n ${idStyle}\n }\n\n > a,\n > button {\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n\n ${StyledPopover}:not(${StyledTooltip}) {\n color: ${theme.base.palette['foreground-color']};\n }\n }\n\n > ${StyledText} > ${StyledLink} {\n color: ${color};\n }\n\n + ${StyledHeaderActions} {\n padding-inline-start: 0;\n }\n `;\n});\n\nStyledCaseHeaderText.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderPromotedAction = styled(Button)(({ theme }) => {\n const {\n base: {\n palette: { interactive }\n },\n components: {\n 'case-view': {\n header: { background, 'foreground-color': foregroundColor }\n }\n }\n } = theme;\n\n /* If foreground color is auto, we calculate the text color based on the background color. */\n const textColor = calculateForegroundColor(background, foregroundColor);\n const isGradientBackground = !isSolidColor(background);\n const backgroundColor = isGradientBackground ? readableColor(textColor) : background;\n const interactiveUsable = getContrast(backgroundColor, interactive) >= 4.5;\n const color = !isGradientBackground && interactiveUsable ? interactive : textColor;\n\n let hoverBackground = rgba(color, 0.15);\n if (!isGradientBackground && interactiveUsable) {\n hoverBackground = readableHue(interactive, color);\n }\n return css`\n --button-background-color: ${backgroundColor};\n color: ${color};\n background-color: transparent;\n border-color: ${color};\n\n @media (hover: hover) {\n &:hover {\n --button-background-color: ${hoverBackground};\n color: ${color};\n background-color: ${hoverBackground};\n border-color: ${color};\n }\n\n &:active {\n --button-background-color: ${hoverBackground};\n color: ${color};\n background-color: ${hoverBackground};\n border-color: ${color};\n }\n }\n `;\n});\n\nStyledCaseHeaderPromotedAction.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderSummaryBlock = styled.div<{ hasItems: boolean }>(({ hasItems, theme }) => {\n const {\n base: {\n spacing,\n palette: { 'brand-primary': primary }\n }\n } = theme;\n\n const color = readableColor(primary);\n const transparentColor = tryCatch(() => transparentize(0.5, color));\n\n return css`\n ${hasItems &&\n css`\n border-inline-start: 0.0625rem solid ${transparentColor};\n `}\n\n ${StyledStackedFieldValue}:first-child {\n margin-inline-start: calc(2 * ${spacing});\n }\n `;\n});\n\nStyledHeaderSummaryBlock.defaultProps = defaultThemeProp;\n\nconst popoverColorReset = (theme: DefaultTheme) => {\n const {\n base: {\n palette: { interactive, light, 'foreground-color': baseForeground }\n }\n } = theme;\n\n return css`\n ${StyledPopover}:not(${StyledTooltip}) {\n color: ${baseForeground};\n\n ${StyledButtonLink},\n ${StyledLink} {\n color: ${interactive};\n text-decoration: none;\n\n &:hover,\n &:active {\n text-decoration: underline;\n }\n\n &:focus {\n box-shadow:\n inset 0 0 0 0.0625rem ${light},\n 0 0 0.125rem 0.0625rem ${interactive};\n }\n }\n }\n `;\n};\n\nexport const StyledHeaderSummary = styled.dl(({ theme }) => {\n const {\n base: {\n palette: { interactive }\n },\n components: {\n 'case-view': {\n header: { 'foreground-color': foregroundColor, background }\n }\n }\n } = theme;\n\n /* If the foreground-color is auto, we calculate the text color and transparentColor based on the background color. */\n const color = calculateForegroundColor(background, foregroundColor);\n const { backgroundColor } = calculateBackgroundAndContrastColor(background, foregroundColor);\n const interactiveUsable = meetsContrastGuidelines(backgroundColor, interactive).AA;\n\n return css`\n max-width: 100%;\n min-width: 0;\n\n > ${StyledStackedFieldValue} {\n > ${StyledLabel} {\n color: ${color};\n white-space: nowrap;\n }\n\n > ${StyledFieldValue} {\n color: ${color};\n white-space: nowrap;\n }\n\n ${StyledButtonLink},\n ${StyledLink} {\n &:focus-visible {\n box-shadow: inset 0 0 0 0.0625rem ${color};\n }\n\n ${!interactiveUsable &&\n css`\n color: ${color};\n text-decoration: underline;\n `}\n }\n\n ${popoverColorReset(theme)}\n }\n `;\n});\n\nStyledHeaderSummary.defaultProps = defaultThemeProp;\n\nexport const StyledHeaderSummaryValue = styled(StyledFieldValue)(({\n bold,\n truncate,\n theme\n}: {\n bold?: boolean;\n truncate?: boolean;\n theme: DefaultTheme;\n}) => {\n const {\n base: {\n 'content-width': { xs }\n },\n components: {\n text: {\n h1: { 'font-weight': h1Weight }\n }\n }\n } = theme;\n\n return css`\n overflow: hidden;\n text-overflow: ellipsis;\n\n ${truncate &&\n css`\n max-width: ${xs};\n `}\n\n ${bold &&\n css`\n font-weight: ${h1Weight};\n `}\n\n /*\n * :not([hidden]) necessary to prevent hidden span with preview a11y instructions from\n * factoring into scrollWidth of element when determining truncation.\n */\n > :not([hidden]) {\n display: inline;\n }\n `;\n});\n\nStyledHeaderSummaryValue.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryInfo = styled.div(\n ({\n theme: {\n base: { 'border-radius': borderRadius },\n components: {\n tabs: { detached: tabsDetached },\n card: { background }\n }\n }\n }) => {\n const { intelligentGuidance } = useCaseViewContext();\n\n return css`\n overflow: auto;\n flex: 1;\n ${tabsDetached &&\n css`\n background: ${background};\n border-radius: ${borderRadius};\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n `}\n ${intelligentGuidance &&\n css`\n /* Accounts for collapsed intelligentGuidance list covering summary panel content when fully scrolled. */\n padding-block-end: 4rem;\n `}\n `;\n }\n);\n\nStyledCaseSummaryInfo.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryContainer = styled.div(({ theme }) => {\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n },\n card: { background }\n }\n } = theme;\n return css`\n padding: calc(1.5 * ${theme.base.spacing}) calc(${theme.components.card.padding} * 2);\n\n ${detached &&\n css`\n padding: 0;\n background: ${background};\n `}\n `;\n});\n\nStyledCaseSummaryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseButton = styled(Button)(() => {\n return css`\n border: none;\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n }\n `;\n});\n\nStyledExpandCollapseButton.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseSummaryButton = styled(StyledExpandCollapseButton)(({ theme }) => {\n const { summaryExpanded } = useCaseViewContext();\n\n return css`\n --half-compact-btn-height: calc(${theme.base['hit-area'].compact} / 2);\n --half-btn-compact-difference: calc(\n (${theme.base['hit-area'].mouse} - ${theme.base['hit-area'].compact}) / 2\n );\n --half-case-icon-compact-difference: calc(\n ((4 * ${theme.base.spacing}) - ${theme.base['hit-area'].compact}) / 2\n );\n @media (pointer: coarse) {\n --half-btn-compact-difference: calc(\n (${theme.base['hit-area'].finger} - ${theme.base['hit-area'].compact}) / 2\n );\n }\n position: absolute;\n z-index: 1;\n box-shadow: ${theme.base.shadow.low};\n\n ${summaryExpanded\n ? css`\n inset-block-start: calc(2 * ${theme.base.spacing} + var(--half-btn-compact-difference));\n inset-inline-start: calc(100% - var(--half-compact-btn-height));\n `\n : css`\n inset-block-end: calc(var(--half-compact-btn-height) * -1);\n inset-inline-start: calc(\n 2 * ${theme.base.spacing} + var(--half-case-icon-compact-difference)\n );\n `}\n `;\n});\n\nStyledExpandCollapseSummaryButton.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummary = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'border-line': borderLine, interactive },\n 'border-radius': borderRadius,\n 'hit-area': { 'mouse-min': mouseMin, 'finger-min': fingerMin }\n },\n components: {\n 'case-view': {\n summary: { detached }\n },\n card: { background: cardBackground },\n tabs: { detached: tabsDetached }\n }\n }\n }) => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n\n return css`\n background: ${cardBackground};\n position: relative;\n height: 100%;\n ${aboveMD &&\n summaryExpanded &&\n css`\n width: 25rem;\n `}\n\n ${detached &&\n css`\n border-radius: ${borderRadius};\n --border-radius: calc(${borderRadius} * 0.5);\n `}\n\n ${tabsDetached &&\n css`\n & ${StyledTabs} {\n &[aria-orientation='vertical'] {\n padding-top: calc(1.5 * ${spacing});\n border-block-start: 0.0625rem solid ${borderLine};\n & ${StyledTab} {\n height: ${mouseMin};\n\n @media (pointer: coarse) {\n height: ${fingerMin};\n }\n &[aria-selected='true'] {\n background-color: ${transparentize(0.92, interactive)};\n }\n }\n }\n }\n `}\n `;\n }\n);\n\nStyledCaseSummary.defaultProps = defaultThemeProp;\n\nexport const StyledTasks = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n &:not(:has(${StyledCard})) {\n /* Add negative top margin to compensate extra row-gap due to empty Tasks container */\n margin-block-start: calc(-2 * ${spacing});\n }\n `;\n }\n);\nStyledTasks.defaultProps = defaultThemeProp;\n\nexport const StyledTabPanelWrapper = styled.div(\n ({\n theme: {\n components: {\n card: { 'border-radius': cardBorderRadius }\n }\n }\n }) => {\n return css`\n ${StyledTabPanel} ${StyledProgressBackdrop} {\n border-radius: ${cardBorderRadius};\n }\n `;\n }\n);\n\nStyledTabPanelWrapper.defaultProps = defaultThemeProp;\n\n// This component defintion was primarily required to conditionally hide empty div and avoid unnecessary row gap in work area.\nexport const StyledBannersStagesTasksContainer = styled.div(() => {\n return css`\n &:has(> ${StyledTasks}:only-child > :only-child:empty[data-flow]) {\n display: none;\n }\n `;\n});\n\nexport const StyledWorkArea = styled.div(\n ({\n theme: {\n base: {\n palette: { 'border-line': borderLine },\n spacing,\n 'border-radius': borderRadius\n },\n components: {\n 'case-view': {\n assignments: {\n detached: assignmentDetached,\n background: assignmentBackground,\n 'foreground-color': assignmentForegroundColor\n }\n },\n tabs: { detached: tabsDetached },\n card: { background, 'foreground-color': foregroundColor, 'border-radius': cardBorderRadius }\n }\n }\n }) => {\n const { backgroundColor } = calculateBackgroundAndContrastColor(background, foregroundColor);\n const foregroundColorForAssignment = calculateForegroundColor(\n assignmentBackground,\n assignmentForegroundColor\n );\n const { summaryExpanded, aboveMD, intelligentGuidance, isPreview } = useCaseViewContext();\n let pbeRem = 0;\n\n if (intelligentGuidance) {\n pbeRem = aboveMD && !summaryExpanded ? 4 : 6;\n }\n\n return css`\n grid-area: work-area;\n padding: calc(2 * ${spacing});\n\n ${aboveMD &&\n css`\n padding: calc(2 * ${spacing}) 0;\n\n /* This is required to make scrollStick work. */\n ${!isPreview &&\n css`\n height: max-content;\n `}\n\n ${!summaryExpanded &&\n css`\n margin-inline-start: calc(2 * ${spacing});\n `}\n `}\n\n /* Order of style here is necessary for overriding styles above. */\n ${pbeRem > 0 &&\n css`\n /* Accounts for collapsed intelligentGuidance bubble covering work area content when fully scrolled. */\n padding-block-end: ${pbeRem}rem;\n `}\n\n &:has(${StyledAssignments}),\n &:has(${StyledHierarchicalAssignments}) {\n ${StyledStages} {\n border-block-end: 0.0625rem solid ${borderLine};\n\n &,\n ${StyledStageContainer}:first-of-type > ${StyledStage} {\n border-end-start-radius: 0;\n }\n\n &,\n ${StyledStageContainer}:last-of-type > ${StyledStage} {\n border-end-end-radius: 0;\n }\n }\n }\n\n ${tabsDetached &&\n css`\n ${StyledAllTabsWrapper} {\n border-start-start-radius: ${cardBorderRadius};\n border-start-end-radius: ${cardBorderRadius};\n\n ${StyledTabs} {\n border-radius: unset;\n border-start-end-radius: inherit;\n }\n\n ${StylesAllTabsButtonWrapper}, ${StyledMenuButton} {\n border-start-start-radius: inherit;\n }\n }\n `}\n\n &:has(${StyledStages}) {\n ${StyledCard}${StyledAssignments},\n ${StyledCard}${StyledHierarchicalAssignments} {\n margin-block-start: calc(-2 * ${spacing});\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n &:has(${StyledCard}${StyledAssignments} > ${StyledCardHeader}),\n &:has(${StyledCard}${StyledHierarchicalAssignments} > ${StyledCardHeader}) {\n ${StyledCard}${StyledAssignments},\n ${StyledCard}${StyledHierarchicalAssignments} {\n background: ${assignmentBackground};\n color: ${foregroundColorForAssignment};\n ${assignmentDetached &&\n css`\n ${StyledTaskList} {\n background-color: ${backgroundColor};\n border: solid 0.0625rem ${borderLine};\n border-radius: var(--border-radius, ${borderRadius});\n ${StyledSummaryListItem} {\n padding: calc(${spacing} / 2) ${spacing};\n }\n }\n `}\n }\n }\n }\n `;\n }\n);\n\nStyledWorkArea.defaultProps = defaultThemeProp;\n\nexport const StyledUtilitiesHeading = styled(Text)``;\n\nexport const StyledExpandCollapseUtilitiesButton = styled(StyledExpandCollapseButton)(() => {\n const { utilitiesExpanded } = useCaseViewContext();\n\n return css`\n /* Centers button over the utilities summary */\n margin-inline-end: ${utilitiesExpanded && '0.625rem'};\n `;\n});\n\nStyledExpandCollapseUtilitiesButton.defaultProps = defaultThemeProp;\n\nexport const StyledUtilities = styled.div(({ theme }) => {\n const { utilitiesExpanded, aboveLG, aboveMD } = useCaseViewContext();\n\n return css`\n height: max-content;\n margin-block: calc(2 * ${theme.base.spacing});\n\n ${StyledCardContent} ${StyledProgressBackdrop} {\n border-radius: ${theme.components.card['border-radius']};\n }\n\n /* If utilities are in an expanded drawer. */\n ${utilitiesExpanded &&\n aboveMD &&\n !aboveLG &&\n css`\n /* Maintains the column width to avoid page content shift. */\n visibility: hidden;\n `}\n\n ${aboveLG &&\n utilitiesExpanded &&\n css`\n width: 25rem;\n `}\n\n\n /* Selects the h2 in the utilities column, not the drawer. */\n ${StyledUtilitiesHeading} {\n /* Hide the utilities h2 under certain conditions.*/\n ${((aboveMD && !utilitiesExpanded) || (aboveMD && utilitiesExpanded && !aboveLG)) &&\n hideVisually()}\n }\n `;\n});\n\nStyledUtilities.defaultProps = defaultThemeProp;\n\nexport const StyledSummary = styled.div(\n ({\n theme: {\n base: {\n spacing,\n breakpoints,\n 'z-index': zIndex,\n palette: { 'app-background': appBackground }\n },\n components: {\n 'app-shell': {\n nav: { background: navBackground }\n },\n 'case-view': {\n summary: { detached: summaryDetached },\n utilities: { detached: utilitiesDetached }\n }\n }\n }\n }) => {\n const { aboveSM, aboveMD, persistentUtility, aboveXL, summaryExpanded, isPreview } =\n useCaseViewContext();\n const shouldRenderMobileTabs = !aboveMD || (persistentUtility && !aboveXL) || !summaryExpanded;\n const inlineStartPadding =\n navBackground === appBackground ? `${spacing}` : `calc(${spacing} * 2)`;\n\n return css`\n top: ${summaryExpanded ? 'var(--top-offset)' : 'var(--appshell-offset, 0)'};\n width: 100%;\n z-index: ${zIndex.popover};\n\n ${aboveMD &&\n summaryExpanded &&\n css`\n height: var(--case-view-height);\n `}\n\n ${summaryDetached &&\n aboveSM &&\n css`\n padding-inline-start: ${inlineStartPadding};\n padding-inline-end: ${utilitiesDetached && shouldRenderMobileTabs\n ? `calc(2 * ${spacing})`\n : 0};\n padding-block: ${shouldRenderMobileTabs ? 0 : `calc(2 * ${spacing})`};\n `}\n\n ${isPreview &&\n css`\n padding: 0;\n `}\n\n ${aboveMD\n ? css`\n position: sticky;\n `\n : css`\n @media (min-height: ${breakpoints.sm}) {\n position: sticky;\n }\n `}\n `;\n }\n);\n\nStyledSummary.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawer = styled.div<{\n previewActive?: AppShellContextValue['previewActive'];\n utilitiesExpanded?: boolean;\n}>(({ previewActive, utilitiesExpanded, theme }) => {\n return css`\n --utilities-drawer-width: var(--resize-drawer-width);\n --utilities-drawer-min-width: ${resizeDrawerMinWidth};\n min-width: var(--utilities-drawer-min-width);\n max-width: ${resizeDrawerMaxWidth};\n width: var(--utilities-drawer-width);\n background-color: ${theme.base.palette['primary-background']};\n height: calc(100vh - ${headerHeight});\n inset-block-start: ${headerHeight};\n z-index: ${theme.base['z-index'].drawer - 1};\n\n ${previewActive &&\n css`\n @media (min-width: ${theme.base.breakpoints.xl}) {\n inset-inline-end: ${resizeDrawerDefaultWidth};\n ${utilitiesExpanded &&\n css`\n inset-inline-end: var(--resize-drawer-width);\n width: var(--utilities-drawer-min-width);\n `}\n }\n `}\n\n ${StyledGenAICoachContainer} {\n width: calc(var(--utilities-drawer-width) - 2rem);\n }\n `;\n});\n\nStyledCaseDrawer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawerContent = styled.div(\n ({\n theme: {\n base: {\n palette: { 'app-background': appBackground },\n spacing\n }\n }\n }) => {\n return css`\n background: ${appBackground};\n padding: calc(2 * ${spacing});\n height: 100%;\n overflow: auto;\n `;\n }\n);\n\nStyledCaseDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentUtility = styled.div<{ persistentUtilityExpanded?: boolean }>(\n ({ theme, persistentUtilityExpanded }) => {\n return css`\n width: ${persistentUtilityExpanded ? '100%' : theme.base['content-width'].md};\n overflow: auto;\n position: sticky;\n z-index: 1;\n height: var(--case-view-height);\n inset-block-start: var(--top-offset);\n padding-block: calc(2 * ${theme.base.spacing});\n `;\n }\n);\n\nStyledPersistentUtility.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentContainer = styled.div(({ theme }) => {\n return css`\n height: 100%;\n\n &&& ${StyledCardHeader} {\n padding-inline-start: ${theme.base.spacing};\n }\n `;\n});\n\nStyledPersistentContainer.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentContent = styled.div(({ theme }) => {\n return css`\n height: calc(100% - calc(4 * ${theme.base.spacing}));\n `;\n});\n\nStyledPersistentContent.defaultProps = defaultThemeProp;\n\nexport const ScrollStick = styled.div`\n position: sticky;\n top: 0;\n`;\n\nexport const StyledCaseView = styled.div(\n ({\n theme: {\n base: {\n palette: { 'app-background': appBackground },\n spacing,\n 'border-radius': borderRadius\n },\n components: {\n 'case-view': {\n utilities: {\n detached: utilitiesDetached,\n background: utilitiesBackground,\n 'foreground-color': utilitiesForegroundColor\n },\n summary: { detached: summaryDetached }\n }\n }\n }\n }) => {\n const utilitiesForegroundComputed = calculateForegroundColor(\n utilitiesBackground,\n utilitiesForegroundColor\n );\n const { aboveSM, aboveMD, isPreview } = useCaseViewContext();\n\n return css`\n --top-offset: calc(var(--appshell-offset, 0rem) + var(--summary-height));\n --case-view-height: calc(100vh - var(--top-offset));\n position: relative;\n min-height: var(--case-view-height);\n background: ${appBackground};\n\n ${aboveMD &&\n css`\n ${StyledUtilities}:last-child {\n margin-inline-end: calc(2 * ${spacing});\n color: ${utilitiesForegroundComputed};\n\n ${!utilitiesDetached &&\n css`\n background: ${utilitiesBackground};\n margin-inline-end: 0;\n padding: calc(2 * ${spacing});\n padding-inline-end: 0;\n border-radius: ${borderRadius} 0 0 ${borderRadius};\n\n ${StyledCard},\n ${StyledGenAICoachContainer} {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n ${StyledGenAICoachContainer} {\n inset-inline-end: 0;\n }\n `}\n }\n `}\n\n ${aboveSM &&\n summaryDetached &&\n !isPreview &&\n css`\n &:not(:has(${StyledUtilities})) {\n ${StyledSummary} {\n padding-inline-end: calc(2 * ${spacing});\n }\n ${StyledCaseHeader} {\n border-end-end-radius: ${borderRadius};\n }\n }\n `}\n\n ${!aboveMD &&\n css`\n ${StyledGenAICoachContainer} {\n height: 42.5rem;\n ${StyledInitialMessageContainer} {\n justify-content: center;\n }\n }\n `}\n `;\n }\n);\n\nStyledCaseView.defaultProps = defaultThemeProp;\n\nexport const StyledUtilitiesHeader = styled(Text)`\n align-self: center;\n\n &:not(:focus) {\n ${hideVisually}\n }\n`;\n\nStyledUtilitiesHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCoachButton = styled(AIButton)(({\n theme: {\n base: { spacing, breakpoints }\n }\n}) => {\n const { previewActive } = useContext(AppShellContext);\n\n return css`\n position: fixed;\n width: 2.75rem;\n height: 2.75rem;\n inset-block-end: calc(2 * ${spacing});\n inset-inline-end: calc(2 * ${spacing});\n ${previewActive &&\n css`\n @media (min-width: ${breakpoints.xl}) {\n margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});\n }\n `}\n `;\n});\n\nStyledCoachButton.defaultProps = defaultThemeProp;\n\nexport const StyledUtilitiesWrapper = styled.div<{\n genAIHeight: number | undefined;\n}>(({ genAIHeight }) => {\n return genAIHeight !== undefined\n ? css`\n padding-block-end: calc(${genAIHeight}px + 1rem);\n `\n : null;\n});\n\nexport const StyledCaseViewIcon = styled(Icon)(({ theme }) => {\n return css`\n ${theme.components['case-view'].icon.color !== 'auto'\n ? css`\n color: ${theme.components['case-view'].icon.color};\n `\n : null}\n\n ${theme.components['case-view'].icon.background !== 'auto'\n ? css`\n background: ${theme.components['case-view'].icon.background};\n `\n : null}\n\n ${theme.components['case-view'].icon['box-shadow'] !== 'auto'\n ? css`\n box-shadow: ${theme.components['case-view'].icon['box-shadow']};\n `\n : null}\n `;\n});\n\nStyledCaseViewIcon.defaultProps = defaultThemeProp;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,OAAO,CAAC;AA+E5D,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAchF,eAAO,MAAM,SAAS,+CAqCrB,CAAC;;;;AAm4BF,wBAA6D"}
1
+ {"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAoF5D,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAchF,eAAO,MAAM,SAAS,+CAqCrB,CAAC;;;;AAi8BF,wBAA6D"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { Button, Flex, Icon, MenuButton, Progress, Text, createUID, menuHelpers, useI18n, useTestIds, useTheme, withTestIds, registerIcon, usePrevious, getFocusables, isMenuGroupProps, ErrorState, useArrows, focusableSelector, useLiveLog, useOuterEvent, ThemeOverride, hasProp, getActiveElement, useElement, Actions, useBreakpoint, Grid, useRefMap, VisuallyHiddenText, FileList, Lightbox, FullscreenButton, FormField, Fullscreen, useUID } from '@pega/cosmos-react-core';
3
+ import { Button, Flex, Icon, MenuButton, Progress, Text, createUID, menuHelpers, useI18n, useSpeechRecognition, useTestIds, useTheme, withTestIds, registerIcon, usePrevious, getFocusables, isMenuGroupProps, ErrorState, useArrows, focusableSelector, useLiveLog, useOuterEvent, ThemeOverride, hasProp, getActiveElement, useElement, Actions, useBreakpoint, Grid, useRefMap, VisuallyHiddenText, FileList, Lightbox, FullscreenButton, FormField, Fullscreen, useUID, SpeechToTextButton, Toaster, useToaster } from '@pega/cosmos-react-core';
4
4
  import * as caretUpIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-up.icon';
5
5
  import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
6
6
  import * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';
@@ -17,7 +17,8 @@ import ConversationHistory from './ConversationHistory';
17
17
  import { GenAIMessage, InitialSuggestedMessage } from '.';
18
18
  registerIcon(caretUpIcon, timesIcon, caretDownIcon, minusIcon, polarisSolidIcon, paperClipIcon, warnSolidIcon, squareSolidIcon, sendSolidIcon);
19
19
  export const AgentIcon = () => (_jsxs(StyledAgentIcon, { xmlns: 'http://www.w3.org/2000/svg', filter: 'drop-shadow(0 .125rem .125rem rgba(0,0,0,.03)) drop-shadow(.125rem .5rem .5rem rgba(0,0,0,.05)) drop-shadow(.125rem 1rem 1rem rgba(0,0,0,.08))', viewBox: '0 0 60 60', children: [_jsxs("linearGradient", { id: 'a', x1: '30.586', x2: '3.059', y1: '58.111', y2: '30.584', gradientUnits: 'userSpaceOnUse', children: [_jsx("stop", { offset: '.115', stopColor: '#681fc3' }), _jsx("stop", { offset: '.418', stopColor: '#9795f3' }), _jsx("stop", { offset: '.591', stopColor: '#b3d2ff' }), _jsx("stop", { offset: '.966', stopColor: '#a467f0' })] }), _jsxs("linearGradient", { id: 'b', x1: '7.137', x2: '29.565', y1: '0', y2: '60.151', gradientUnits: 'userSpaceOnUse', children: [_jsx("stop", { offset: '.457', stopColor: '#8165d2', stopOpacity: '0' }), _jsx("stop", { offset: '.524', stopColor: '#280096', stopOpacity: '.4' })] }), _jsx("clipPath", { id: 'c', children: _jsx("path", { d: 'M0 0h60v60H0z' }) }), _jsxs("g", { fillRule: 'evenodd', clipPath: 'url(#c)', clipRule: 'evenodd', children: [_jsx("path", { fill: 'url(#a)', d: 'M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z' }), _jsx("path", { fill: 'url(#b)', d: 'M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z' })] })] }));
20
- const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, ...restProps }) => {
20
+ const VOICE_ERROR_DISMISS_DURATION = 3000;
21
+ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, ...restProps }) => {
21
22
  const theme = useTheme();
22
23
  const t = useI18n();
23
24
  const testIds = useTestIds(testId, getGenAICoachTestIds);
@@ -38,10 +39,12 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
38
39
  const historyViewRef = useRef(null);
39
40
  const fileUploadInputRef = useRef(null);
40
41
  const attachmentsAdded = useRef(false);
42
+ const pendingResult = useRef(false);
41
43
  const isSmallOrAbove = useBreakpoint('sm', {
42
44
  breakpointRef: genAICoachRef
43
45
  });
44
46
  const [message, setMessage] = useState('');
47
+ const [interimMessage, setInterimMessage] = useState('');
45
48
  const [coachOptions, setCoachOptions] = useState(coachOptionsProps);
46
49
  const [arrowKey, setArrowKey] = useState(null);
47
50
  const [animationInitialCursorPos, setAnimationInitialCursorPos] = useState(0);
@@ -78,6 +81,24 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
78
81
  return coachOptions[0].primary;
79
82
  }
80
83
  }, [coachOptions]);
84
+ const onResult = useCallback(value => {
85
+ pendingResult.current = false;
86
+ setMessage(prevMessage => {
87
+ return prevMessage ? `${prevMessage} ${value}` : value;
88
+ });
89
+ setInterimMessage('');
90
+ }, []);
91
+ const onInterimResult = useCallback(value => {
92
+ if (value) {
93
+ pendingResult.current = true;
94
+ setInterimMessage(message ? ` ${value}` : value);
95
+ }
96
+ }, [message]);
97
+ const { supported, active, start, stop, error: voiceToTextError } = useSpeechRecognition({
98
+ onResult,
99
+ onInterimResult,
100
+ langCode: voiceToTextProps?.langCode
101
+ });
81
102
  const handleSendMessage = useCallback(() => {
82
103
  const isMessageAndAttachmentsEmpty = !message && (!attachments || attachments.length === 0);
83
104
  const hasAttachmentsError = attachments &&
@@ -96,6 +117,9 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
96
117
  attachmentIds: attachments?.map(({ id }) => id)
97
118
  });
98
119
  setMessage('');
120
+ if (active) {
121
+ stop();
122
+ }
99
123
  }, [[message, latestMessage, attachments, attachmentsError]]);
100
124
  const handleEnterKeyDown = (e) => {
101
125
  if (e.key === 'Enter' && !e.shiftKey) {
@@ -244,6 +268,15 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
244
268
  setArrowKey(null);
245
269
  focusInMessageListRef.current = false;
246
270
  });
271
+ const { push } = useToaster();
272
+ const onSpeechToTextButtonClick = useCallback(() => {
273
+ if (active) {
274
+ stop();
275
+ }
276
+ else {
277
+ start();
278
+ }
279
+ }, [active, stop, start]);
247
280
  const onFileChange = (e) => {
248
281
  if (e.target.files) {
249
282
  const newFiles = Array.from(e.target.files);
@@ -257,7 +290,14 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
257
290
  return singleCol;
258
291
  return multiCol;
259
292
  };
260
- const genAIFooter = (_jsxs(Flex, { container: { direction: 'column' }, as: StyledGenAIFooter, children: [_jsx(FormField, { label: t('message_pega_gen_ai_coach'), labelHidden: true, labelFor: composerId, children: _jsx(StyledGenAIFormControl, { focused: focused, children: _jsxs(Flex, { container: { direction: 'column', gap: 0.25 }, children: [_jsx(StyledGenAITextArea, { id: composerId, ref: textAreaRef, value: message, placeholder: t('write_message'), onKeyDown: handleEnterKeyDown, onChange: handleTextAreaChange, onFocus: () => {
293
+ useEffect(() => {
294
+ if (voiceToTextError) {
295
+ push({ content: voiceToTextError });
296
+ }
297
+ }, [voiceToTextError]);
298
+ const genAIFooter = (_jsxs(Flex, { container: { direction: 'column' }, as: StyledGenAIFooter, children: [_jsx(FormField, { label: t('message_pega_gen_ai_coach'), labelHidden: true, labelFor: composerId, children: _jsx(StyledGenAIFormControl, { focused: focused, children: _jsxs(Flex, { container: { direction: 'column', gap: 0.25 }, children: [_jsx(StyledGenAITextArea, { id: composerId, ref: textAreaRef, value: interimMessage ? `${message}${interimMessage}` : message, placeholder: t('write_message'), onKeyDown: handleEnterKeyDown, onChange: handleTextAreaChange, onFocus: () => {
299
+ if (active)
300
+ stop();
261
301
  setFocused(true);
262
302
  }, onBlur: () => {
263
303
  setFocused(false);
@@ -275,17 +315,20 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
275
315
  textAreaRef.current?.focus();
276
316
  }
277
317
  }
278
- }, showArrow: false })), onAddAttachment && (_jsxs(_Fragment, { children: [_jsx(Button, { icon: true, onClick: () => {
318
+ }, showArrow: false })), voiceToTextProps?.enableDictation && supported && (_jsx(SpeechToTextButton, { active: active, onClick: onSpeechToTextButtonClick })), onAddAttachment && (_jsxs(_Fragment, { children: [_jsx(Button, { icon: true, onClick: () => {
279
319
  if (fileUploadInputRef.current) {
280
320
  fileUploadInputRef.current.value = '';
281
321
  }
282
322
  fileUploadInputRef.current?.click();
283
- }, variant: 'simple', label: t('add_attachment'), children: _jsx(Icon, { name: 'paper-clip' }) }), _jsx(StyledInput, { type: 'file', ref: fileUploadInputRef, onChange: onFileChange, multiple: false, "data-testid": testIds.attachments })] }))] }), latestMessage && isCoachMessage(latestMessage) && latestMessage.loading ? (_jsxs(Flex, { container: {
323
+ }, variant: 'simple', label: t('add_attachment'), children: _jsx(Icon, { name: 'paper-clip' }) }), _jsx(StyledInput, { type: 'file', ref: fileUploadInputRef, onChange: onFileChange, multiple: false, "data-testid": testIds.attachments })] }))] }), (latestMessage && isCoachMessage(latestMessage) && latestMessage.loading) ||
324
+ (active && pendingResult.current) ? (_jsxs(Flex, { container: {
284
325
  gap: 1,
285
326
  justify: 'end',
286
327
  alignItems: 'center',
287
328
  pad: 1
288
- }, children: [t('generating_response'), _jsx(Progress, { placement: 'inline' })] })) : (_jsx(_Fragment, { children: latestMessage &&
329
+ }, children: [active && pendingResult.current
330
+ ? t('processing_speech')
331
+ : t('generating_response'), _jsx(Progress, { placement: 'inline' })] })) : (_jsx(_Fragment, { children: latestMessage &&
289
332
  isCoachMessage(latestMessage) &&
290
333
  latestMessage.isToolConfirmation ? (_jsx(StyledStopButton, { iconOnly: true, icon: 'square-solid', variant: 'primary', label: t('stop_processing'), onClick: () => {
291
334
  textAreaRef.current?.focus();
@@ -475,7 +518,7 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
475
518
  focusTextArea.current = true;
476
519
  conversationHistory.onDismiss();
477
520
  }, inFullPage: !condition, ref: historyViewRef }));
478
- return (_jsx(Fullscreen, { children: _jsxs(Flex, { container: { direction: 'column' }, as: StyledGenAICoachContainer, "data-testid": testIds.root, variant: variant, fullScreen: fullScreen, isCompact: isCompact, ref: genAICoachRef, ...restProps, children: [_jsx(Flex, { container: { justify: 'between', alignItems: 'center', pad: [1.5, 2, 0.5] }, children: headerContent }), condition ? (_jsx(_Fragment, { children: conversationHistory ? historyView : GenAICoachElement })) : (_jsxs(Grid, { container: { gap: 0.5, cols: '2fr 3fr' }, as: StyledGridContainer, conversationHistory: !!conversationHistory, children: [historyView, GenAICoachElement] })), lightboxPreviewProps && _jsx(Lightbox, { ...lightboxPreviewProps })] }) }));
521
+ return (_jsx(Toaster, { dismissAfter: VOICE_ERROR_DISMISS_DURATION, children: _jsx(Fullscreen, { children: _jsxs(Flex, { container: { direction: 'column' }, as: StyledGenAICoachContainer, "data-testid": testIds.root, variant: variant, fullScreen: fullScreen, isCompact: isCompact, ref: genAICoachRef, ...restProps, children: [_jsx(Flex, { container: { justify: 'between', alignItems: 'center', pad: [1.5, 2, 0.5] }, children: headerContent }), condition ? (_jsx(_Fragment, { children: conversationHistory ? historyView : GenAICoachElement })) : (_jsxs(Grid, { container: { gap: 0.5, cols: '2fr 3fr' }, as: StyledGridContainer, conversationHistory: !!conversationHistory, children: [historyView, GenAICoachElement] })), lightboxPreviewProps && _jsx(Lightbox, { ...lightboxPreviewProps })] }) }) }));
479
522
  };
480
523
  export default withTestIds(GenAICoach, getGenAICoachTestIds);
481
524
  //# sourceMappingURL=GenAICoach.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,EACX,OAAO,EACP,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,gBAAgB,EA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,CAAC,EAAE,YAC9E,aAAa,GACT,EACN,SAAS,CAAC,CAAC,CAAC,CACX,4BAAG,mBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,GAAI,CAC7D,CAAC,CAAC,CAAC,CACF,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,EACxC,EAAE,EAAE,mBAAmB,EACvB,mBAAmB,EAAE,CAAC,CAAC,mBAAmB,aAEzC,WAAW,EACX,iBAAiB,IACb,CACR,EACA,oBAAoB,IAAI,KAAC,QAAQ,OAAK,oBAAoB,GAAI,IAC1D,GACI,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ChangeEvent, FunctionComponent } from 'react';\n\nimport {\n Button,\n Flex,\n Icon,\n MenuButton,\n Progress,\n Text,\n createUID,\n menuHelpers,\n useI18n,\n useTestIds,\n useTheme,\n withTestIds,\n registerIcon,\n usePrevious,\n getFocusables,\n isMenuGroupProps,\n ErrorState,\n useArrows,\n focusableSelector,\n useLiveLog,\n useOuterEvent,\n ThemeOverride,\n hasProp,\n getActiveElement,\n useElement,\n Actions,\n useBreakpoint,\n Grid,\n useRefMap,\n VisuallyHiddenText,\n FileList,\n Lightbox,\n FullscreenButton,\n FormField,\n Fullscreen,\n useUID\n} from '@pega/cosmos-react-core';\nimport type { MenuItemProps, MenuProps } from '@pega/cosmos-react-core';\nimport * as caretUpIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-up.icon';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport * as minusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/minus.icon';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';\nimport * as warnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\nimport * as sendSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/send-solid.icon';\nimport * as squareSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/square-solid.icon';\n\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\nimport { isCoachMessage, isInUtilities, isUserMessage } from './GenAICoach.utils';\nimport {\n StyledMessagesContainer,\n StyledDisclaimerText,\n StyledGenAICoachContainer,\n StyledGenAIOptionsMenu,\n StyledInitialMessageContainer,\n StyledInputContainer,\n StyledMenuSuggestions,\n StyledMessagesList,\n StyledGridContainer,\n StyledFlexWrapper,\n StyledErrorContainer,\n StyledInput,\n StyledGuidedSuggestions,\n StyledComposerSection,\n StyledSendButton,\n StyledGenAIFormControl,\n StyledGenAITextArea,\n StyledInitialMessageGrid,\n StyledGenAIFooter,\n StyledAgentIcon,\n StyledStopButton\n} from './GenAICoach.styles';\nimport ConversationHistory from './ConversationHistory';\nimport type { Tool } from './GenAICoach.types';\n\nimport { GenAIMessage, InitialSuggestedMessage, type GenAICoachProps } from '.';\n\nregisterIcon(\n caretUpIcon,\n timesIcon,\n caretDownIcon,\n minusIcon,\n polarisSolidIcon,\n paperClipIcon,\n warnSolidIcon,\n squareSolidIcon,\n sendSolidIcon\n);\n\nexport const AgentIcon = () => (\n <StyledAgentIcon\n xmlns='http://www.w3.org/2000/svg'\n filter='drop-shadow(0 .125rem .125rem rgba(0,0,0,.03)) drop-shadow(.125rem .5rem .5rem rgba(0,0,0,.05)) drop-shadow(.125rem 1rem 1rem rgba(0,0,0,.08))'\n viewBox='0 0 60 60'\n >\n <linearGradient\n id='a'\n x1='30.586'\n x2='3.059'\n y1='58.111'\n y2='30.584'\n gradientUnits='userSpaceOnUse'\n >\n <stop offset='.115' stopColor='#681fc3' />\n <stop offset='.418' stopColor='#9795f3' />\n <stop offset='.591' stopColor='#b3d2ff' />\n <stop offset='.966' stopColor='#a467f0' />\n </linearGradient>\n <linearGradient id='b' x1='7.137' x2='29.565' y1='0' y2='60.151' gradientUnits='userSpaceOnUse'>\n <stop offset='.457' stopColor='#8165d2' stopOpacity='0' />\n <stop offset='.524' stopColor='#280096' stopOpacity='.4' />\n </linearGradient>\n <clipPath id='c'>\n <path d='M0 0h60v60H0z' />\n </clipPath>\n <g fillRule='evenodd' clipPath='url(#c)' clipRule='evenodd'>\n <path\n fill='url(#a)'\n d='M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z'\n />\n <path\n fill='url(#b)'\n d='M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z'\n />\n </g>\n </StyledAgentIcon>\n);\n\nconst GenAICoach: FunctionComponent<GenAICoachProps> = ({\n testId,\n coachOptions: coachOptionsProps,\n onCoachChange: onCoachChangeProp,\n messages = [],\n onSend,\n initialSuggestedMessages,\n suggestions,\n loading,\n error,\n variant,\n onOpen,\n guidedMode = false,\n actions,\n conversationHistory,\n onLayoutChange,\n onAddAttachment,\n attachments,\n attachmentsError,\n lightboxPreviewProps,\n allowFullScreen = true,\n isInLandingPageUtilities,\n stopProcess,\n ...restProps\n}) => {\n const theme = useTheme();\n const t = useI18n();\n const testIds = useTestIds(testId, getGenAICoachTestIds);\n const { announcePolite } = useLiveLog();\n\n const elementRef = useRef<HTMLElement | null>(null);\n const conversationRef = useRef<HTMLUListElement>(null);\n const genAICoachRef = useRef<HTMLDivElement>(null);\n const [messageEls, getMessageCbRef] = useRefMap<HTMLLIElement>();\n\n const focusInMessageListRef = useRef(false);\n const isUserTriggered = useRef(false);\n const lastFocusedMessageRef = useRef<HTMLElement | null>(null);\n const initialFocusedElementRef = useRef<HTMLElement | null>(null);\n const messageContainerRef = useRef<HTMLDivElement>(null);\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n const [suggestionMenuButton, setSuggestionMenuButton] = useElement<HTMLButtonElement>(null);\n const isGeneratingResponse = useRef(false);\n const focusTextArea = useRef(false);\n const historyViewRef = useRef<HTMLUListElement>(null);\n const fileUploadInputRef = useRef<HTMLInputElement>(null);\n const attachmentsAdded = useRef(false);\n\n const isSmallOrAbove = useBreakpoint('sm', {\n breakpointRef: genAICoachRef\n });\n\n const [message, setMessage] = useState('');\n const [coachOptions, setCoachOptions] = useState<MenuProps['items']>(coachOptionsProps);\n const [arrowKey, setArrowKey] = useState<\n 'ArrowRight' | 'ArrowLeft' | 'ArrowUp' | 'ArrowDown' | null\n >(null);\n\n const [animationInitialCursorPos, setAnimationInitialCursorPos] = useState(0);\n const [focused, setFocused] = useState(false);\n const [fullScreen, setFullScreen] = useState(false);\n\n const prevFullScreen = usePrevious(fullScreen);\n const previousMessages = usePrevious(messages);\n\n const composerId = useUID();\n\n const latestMessage = messages.at(-1);\n const condition =\n !(fullScreen && conversationHistory) &&\n (variant.placement === 'dialog' ||\n variant.placement === 'utilities' ||\n (variant.placement === 'fullpage' && !isSmallOrAbove) ||\n !conversationHistory);\n\n const onCoachChange = (id: MenuItemProps['id']) => {\n setCoachOptions(cur => {\n return cur.map(coach => {\n return {\n ...coach,\n selected: coach.id === id\n };\n });\n });\n onCoachChangeProp?.(id);\n };\n\n const selectedCoach = useMemo(() => {\n const selected = menuHelpers.getSelected(coachOptions)[0];\n if (selected) return selected.primary;\n\n if (coachOptions[0]) {\n if (isMenuGroupProps(coachOptions[0])) {\n return coachOptions[0].items[0].primary;\n }\n return coachOptions[0].primary;\n }\n }, [coachOptions]);\n\n const handleSendMessage = useCallback(() => {\n const isMessageAndAttachmentsEmpty = !message && (!attachments || attachments.length === 0);\n const hasAttachmentsError =\n attachments &&\n attachments.length > 0 &&\n (attachmentsError || attachments.some(attachment => attachment.error));\n const isCoachMessageLoading =\n latestMessage && isCoachMessage(latestMessage) && latestMessage.loading;\n if (\n isMessageAndAttachmentsEmpty ||\n hasAttachmentsError ||\n isCoachMessageLoading ||\n (latestMessage && isCoachMessage(latestMessage) && latestMessage.isToolConfirmation)\n )\n return;\n onSend({\n id: createUID(),\n message,\n fromComposer: true,\n attachmentIds: attachments?.map(({ id }) => id)\n });\n setMessage('');\n }, [[message, latestMessage, attachments, attachmentsError]]);\n\n const handleEnterKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n e.stopPropagation();\n handleSendMessage();\n }\n };\n\n const handleTextAreaChange = useCallback(\n (e: ChangeEvent<HTMLTextAreaElement>) => {\n setMessage(e.currentTarget.value);\n },\n [setMessage]\n );\n\n const renderCoachOptions = useMemo(() => {\n if (coachOptions.length === 0 || !selectedCoach) {\n return null;\n }\n if (coachOptions.length === 1) {\n return <Text variant='h2'>{selectedCoach}</Text>;\n }\n return (\n <MenuButton\n text={selectedCoach}\n aria-label={t('agent_switcher', [selectedCoach])}\n variant='text'\n as={StyledGenAIOptionsMenu}\n menu={{\n mode: 'single-select',\n items: coachOptions,\n onItemClick: onCoachChange\n }}\n />\n );\n }, [coachOptions, selectedCoach]);\n\n const headerContent = useMemo(() => {\n return isInUtilities(variant) && variant.state === 'minimized' ? (\n <>\n <Text variant='h2'>{selectedCoach}</Text>\n <Flex container={{ alignItems: 'center' }}>\n <Button\n icon\n label={t('maximize')}\n aria-label={t('agent_noun', [t('maximize')])}\n variant='simple'\n onClick={() => {\n variant.onStateChange('maximized');\n isUserTriggered.current = true;\n }}\n >\n <Icon name='caret-up' />\n </Button>\n </Flex>\n </>\n ) : (\n <>\n {renderCoachOptions}\n\n <Flex container>\n {isInUtilities(variant) && (\n <Button\n icon\n label={t('minimize')}\n aria-label={t('agent_noun', [t('minimize')])}\n variant='simple'\n onClick={() => {\n variant.onStateChange('minimized');\n isUserTriggered.current = true;\n }}\n >\n <Icon name='minus' />\n </Button>\n )}\n\n {allowFullScreen && <FullscreenButton onClick={() => setFullScreen(prev => !prev)} />}\n\n {actions && (\n <Actions data-testid={testIds.actions} contextualLabel={selectedCoach} {...actions} />\n )}\n {variant.placement === 'dialog' && (\n <Button\n icon\n label={t('close')}\n aria-label={t('agent_noun', [t('close')])}\n variant='simple'\n onClick={variant.onClose}\n >\n <Icon name='times' />\n </Button>\n )}\n </Flex>\n </>\n );\n }, [variant, coachOptions]);\n\n const getMessageContainingElement = (element: Element | null) => {\n if (element) return Array.from(messageEls.values()).find(el => el && el.contains(element));\n return null;\n };\n\n const setLastFocusableElement = () => {\n focusInMessageListRef.current = false;\n lastFocusedMessageRef.current = elementRef.current ?? null;\n if (\n lastFocusedMessageRef.current &&\n lastFocusedMessageRef.current?.tagName.toLowerCase() !== 'li'\n ) {\n lastFocusedMessageRef.current =\n getMessageContainingElement(lastFocusedMessageRef.current) ?? null;\n }\n };\n\n const onResize = () => {\n if (genAICoachRef.current && isInUtilities(variant)) {\n const height = genAICoachRef.current.clientHeight;\n variant.setGenAIHeight?.(height);\n }\n };\n\n const variantState = useMemo(() => {\n if (variant.placement === 'utilities') {\n return variant.state;\n }\n }, [variant]);\n\n useEffect(() => {\n if (isInUtilities(variant)) {\n onResize();\n }\n if (isUserTriggered.current) {\n if (\n isInUtilities(variant) &&\n (variant.state === 'minimized' || (guidedMode && variant.state === 'maximized')) &&\n getFocusables(genAICoachRef).length > 0\n ) {\n getFocusables(genAICoachRef)[0].focus();\n isUserTriggered.current = false;\n } else if (variant.placement !== 'fullpage') {\n textAreaRef.current?.focus();\n elementRef.current = null;\n isUserTriggered.current = false;\n }\n }\n }, [variantState, variant.placement]);\n\n useEffect(() => {\n onLayoutChange?.(!condition);\n }, [condition]);\n\n useEffect(() => {\n onOpen?.();\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n useEffect(() => {\n const prevFilteredMsgs = previousMessages?.filter(item => !hasProp(item, 'loading')) ?? [];\n const currentFilteredMsgs = messages?.filter(item => !hasProp(item, 'loading')) ?? [];\n\n if (\n prevFilteredMsgs.length < currentFilteredMsgs.length ||\n (latestMessage && hasProp(latestMessage, 'loading'))\n ) {\n setTimeout(() => {\n conversationRef.current?.lastElementChild?.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest'\n });\n }, 0);\n if (latestMessage && isUserMessage(latestMessage)) {\n textAreaRef.current?.focus();\n setLastFocusableElement();\n elementRef.current = null;\n setArrowKey(null);\n } else if (latestMessage?.loading) {\n isGeneratingResponse.current = true;\n } else {\n announcePolite({ message: t('agent_noun', [`${t('new_message')} ${t('from')}`]) });\n }\n }\n }, [messages]);\n\n useEffect(() => {\n if (suggestionMenuButton && isGeneratingResponse.current) {\n announcePolite({ message: t('response_generated') });\n isGeneratingResponse.current = false;\n\n const activeElement = getActiveElement();\n if (activeElement && activeElement === document.body) suggestionMenuButton.focus();\n }\n }, [suggestionMenuButton]);\n\n /** Supports arrow key behaviors */\n useEffect(() => {\n const focusables = getFocusables(elementRef);\n if (arrowKey === 'ArrowRight') {\n focusables[0]?.focus();\n } else if (arrowKey === 'ArrowLeft') {\n focusables[focusables.length - 1]?.focus();\n }\n }, [arrowKey, elementRef.current]);\n\n useArrows(\n conversationRef,\n {\n cycle: true,\n selector: ':scope > li',\n dir: 'up-down',\n allowTabFocus: true,\n initialFocusElement: initialFocusedElementRef.current\n },\n [messages, initialFocusedElementRef.current]\n );\n\n useArrows(\n elementRef,\n {\n cycle: true,\n selector: `li ${focusableSelector}`,\n dir: 'left-right',\n allowTabFocus: true,\n updateTabIndex: false\n },\n [messages, elementRef.current, arrowKey]\n );\n\n useOuterEvent('mousedown', [conversationRef.current], () => {\n setArrowKey(null);\n focusInMessageListRef.current = false;\n });\n\n const onFileChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files) {\n const newFiles = Array.from(e.target.files);\n onAddAttachment?.(newFiles);\n }\n };\n\n const getGridColumns = () => {\n const multiCol = 'repeat(auto-fit, minmax(calc(100% / 4 - 1rem), 1fr))';\n const singleCol = '1fr';\n\n if (!isSmallOrAbove && !fullScreen) return singleCol;\n\n return multiCol;\n };\n\n const genAIFooter = (\n <Flex container={{ direction: 'column' }} as={StyledGenAIFooter}>\n <FormField label={t('message_pega_gen_ai_coach')} labelHidden labelFor={composerId}>\n <StyledGenAIFormControl focused={focused}>\n <Flex container={{ direction: 'column', gap: 0.25 }}>\n <StyledGenAITextArea\n id={composerId}\n ref={textAreaRef}\n value={message}\n placeholder={t('write_message')}\n onKeyDown={handleEnterKeyDown}\n onChange={handleTextAreaChange}\n onFocus={() => {\n setFocused(true);\n }}\n onBlur={() => {\n setFocused(false);\n }}\n autoResize\n />\n\n <Flex\n container={{\n direction: 'row',\n justify: 'between',\n gap: 1,\n pad: [undefined, 1, 1, 1]\n }}\n >\n <Flex container={{ alignItems: 'center' }}>\n {suggestions && (\n <MenuButton\n text={t('suggestions')}\n variant='simple'\n icon='chat-typing'\n iconOnly\n as={StyledMenuSuggestions}\n menu={{\n items: suggestions,\n onItemClick: id => {\n const selected = menuHelpers.getItem(suggestions, id);\n if (selected) {\n setMessage(selected.primary);\n textAreaRef.current?.focus();\n }\n }\n }}\n showArrow={false}\n />\n )}\n\n {onAddAttachment && (\n <>\n <Button\n icon\n onClick={() => {\n if (fileUploadInputRef.current) {\n fileUploadInputRef.current.value = '';\n }\n fileUploadInputRef.current?.click();\n }}\n variant='simple'\n label={t('add_attachment')}\n >\n <Icon name='paper-clip' />\n </Button>\n <StyledInput\n type='file'\n ref={fileUploadInputRef}\n onChange={onFileChange}\n multiple={false}\n data-testid={testIds.attachments}\n />\n </>\n )}\n </Flex>\n\n {latestMessage && isCoachMessage(latestMessage) && latestMessage.loading ? (\n <Flex\n container={{\n gap: 1,\n justify: 'end',\n alignItems: 'center',\n pad: 1\n }}\n >\n {t('generating_response')}\n <Progress placement='inline' />\n </Flex>\n ) : (\n <>\n {latestMessage &&\n isCoachMessage(latestMessage) &&\n latestMessage.isToolConfirmation ? (\n <StyledStopButton\n iconOnly\n icon='square-solid'\n variant='primary'\n label={t('stop_processing')}\n onClick={() => {\n textAreaRef.current?.focus();\n stopProcess?.();\n }}\n />\n ) : (\n <StyledSendButton\n variant='primary'\n onClick={handleSendMessage}\n icon\n label={t('send')}\n aria-label={t('send_message')}\n >\n <Icon name='send-solid' />\n </StyledSendButton>\n )}\n </>\n )}\n </Flex>\n </Flex>\n </StyledGenAIFormControl>\n </FormField>\n\n {attachments && attachments.length > 0 && (\n <>\n <Flex\n as={FileList}\n type='item'\n aria-label={`${t('attachments')}`}\n items={attachments}\n container={{ pad: [1, 0] }}\n />\n\n {attachmentsError && (\n <Flex container={{ gap: 1, alignItems: 'center' }} as={StyledErrorContainer}>\n <Icon name='warn-solid' />\n <VisuallyHiddenText>{`${t('error')} `}</VisuallyHiddenText>\n\n {attachmentsError}\n </Flex>\n )}\n </>\n )}\n\n <Flex container={{ justify: 'center' }}>\n <StyledDisclaimerText inFullPage={!condition}>{t('ai_disclaimer')}</StyledDisclaimerText>\n </Flex>\n </Flex>\n );\n\n const isCompact =\n variant.placement === 'fullpage' &&\n !fullScreen &&\n !isInLandingPageUtilities &&\n messages.length === 0;\n\n const fullPageAndInitialScreen =\n (fullScreen || (variant.placement === 'fullpage' && !isInLandingPageUtilities)) &&\n messages.length === 0;\n\n const renderTextArea = fullPageAndInitialScreen ? null : genAIFooter;\n\n const GenAICoachElement = (\n <>\n {((isInUtilities(variant) && variant.state !== 'minimized') || !isInUtilities(variant)) && (\n <Flex container={{ direction: 'column' }} as={StyledFlexWrapper}>\n <Flex\n as={StyledMessagesContainer}\n ref={messageContainerRef}\n container={\n loading || error\n ? { direction: 'column', pad: [0, 2], justify: 'center' }\n : { direction: 'column', pad: [0, 2] }\n }\n item={{ grow: 1 }}\n >\n {loading || error ? (\n <Flex container={{ justify: 'center', alignItems: 'center' }}>\n {loading ? (\n <Progress\n variant='ring'\n placement='block'\n message={typeof loading === 'string' ? loading : t('loading')}\n />\n ) : (\n <ErrorState message={error} />\n )}\n </Flex>\n ) : (\n <>\n {messages.length === 0 ? (\n <Flex\n as={StyledInitialMessageContainer}\n container={{\n justify: isCompact ? 'start' : 'center',\n direction: 'column',\n alignItems: 'center',\n gap: 2\n }}\n item={{ grow: 1 }}\n >\n {((isInUtilities(variant) && variant.state === 'maximized') ||\n !isInUtilities(variant)) && (\n <Flex container={{ direction: 'column', alignItems: 'center', gap: 1 }}>\n <AgentIcon />\n\n <Text variant='h2'>{t('welcome_text')}</Text>\n </Flex>\n )}\n\n <Grid\n as={StyledInitialMessageGrid}\n container={{ cols: getGridColumns(), gap: 1.5 }}\n >\n {initialSuggestedMessages?.map(initialSuggestedMessage => (\n <InitialSuggestedMessage\n {...initialSuggestedMessage}\n onSend={initialMessage => {\n if (guidedMode) {\n onSend({\n id: initialMessage.id,\n message: initialMessage.message\n });\n } else {\n setMessage(initialMessage.message);\n }\n isUserTriggered.current = true;\n textAreaRef.current?.focus();\n }}\n testId={initialSuggestedMessage.id}\n />\n ))}\n </Grid>\n\n {fullPageAndInitialScreen && !guidedMode && genAIFooter}\n </Flex>\n ) : (\n <Flex\n as={StyledMessagesList}\n ref={conversationRef}\n aria-label={`${t('conversation')} ${t('view')}`}\n container={{ direction: 'column' }}\n onFocus={() => {\n if (!focusInMessageListRef.current) {\n if (lastFocusedMessageRef.current) {\n lastFocusedMessageRef.current.focus();\n } else {\n /** Focus on the latest message if the chat message list was never focused */\n const lastChild =\n conversationRef.current && conversationRef.current.lastElementChild;\n if (lastChild instanceof HTMLElement) {\n lastChild.focus();\n }\n }\n }\n focusInMessageListRef.current = true;\n setArrowKey(null);\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n setArrowKey(e.key);\n elementRef.current =\n getMessageContainingElement(document.activeElement) ?? null;\n lastFocusedMessageRef.current = elementRef.current;\n } else if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n const activeMessageElement = Array.from(messageEls.values()).find(\n el => el === document.activeElement\n );\n elementRef.current =\n getMessageContainingElement(document.activeElement) ?? null;\n initialFocusedElementRef.current = elementRef.current;\n\n if (\n activeMessageElement &&\n getFocusables(activeMessageElement).length > 0\n ) {\n setArrowKey(e.key);\n }\n } else if (e.key === 'Tab') {\n e.preventDefault();\n setLastFocusableElement();\n if (e.shiftKey) {\n if (\n !condition &&\n conversationHistory &&\n conversationHistory.selectedItemId\n ) {\n const selectedId = historyViewRef.current?.querySelector<HTMLLIElement>(\n `li[id=\"${conversationHistory.selectedItemId}\"]`\n );\n\n if (selectedId) {\n selectedId.focus();\n e.preventDefault();\n }\n } else {\n const prevElement =\n conversationRef.current?.parentElement?.parentElement\n ?.previousElementSibling;\n if (prevElement) {\n const focusables = getFocusables(prevElement);\n if (focusables.length) {\n e.preventDefault();\n focusables[focusables.length - 1].focus();\n }\n }\n }\n } else {\n const nextElement =\n conversationRef.current?.parentElement?.nextElementSibling;\n if (nextElement) {\n const focusables = getFocusables(nextElement);\n if (focusables.length) {\n e.preventDefault();\n focusables[0].focus();\n }\n }\n\n setArrowKey(null);\n }\n }\n }}\n >\n {messages.map(item => {\n const messageProps = isCoachMessage(item)\n ? {\n ...item,\n suggestions:\n messages.findLast(messageItem => isCoachMessage(messageItem))?.id ===\n item.id\n ? item.suggestions\n : undefined,\n onSend,\n onSubmit: item.isToolConfirmation\n ? (tools: Tool[]) => {\n onSend({\n ...item,\n message: item.message ?? '',\n tools\n });\n }\n : undefined\n }\n : item;\n\n return (\n <GenAIMessage\n {...messageProps}\n ref={getMessageCbRef(item.id)}\n testId={item.id}\n announceInteraction={!focusInMessageListRef.current}\n onAnimationCursorUpdate={animatedTillCursor => {\n if (isCoachMessage(item)) {\n setAnimationInitialCursorPos(animatedTillCursor);\n }\n }}\n {...(prevFullScreen !== fullScreen ? { animationInitialCursorPos } : {})}\n />\n );\n })}\n </Flex>\n )}\n </>\n )}\n </Flex>\n\n {((isInUtilities(variant) && variant.state !== 'minimized') || !isInUtilities(variant)) &&\n !loading && (\n <Flex container={{ direction: 'column' }} as={StyledInputContainer}>\n <StyledComposerSection>\n {guidedMode ? (\n <>\n {suggestions && messages.length > 0 && (\n <>\n {latestMessage &&\n isCoachMessage(latestMessage) &&\n latestMessage.loading ? (\n <Flex\n container={{\n gap: 1,\n justify: 'center',\n alignItems: 'center',\n pad: 1\n }}\n >\n {t('generating_response')}\n <Progress\n placement='inline'\n focusOnVisible\n message={t('generating_response')}\n />\n </Flex>\n ) : (\n <ThemeOverride\n theme={{\n components: {\n button: {\n color: theme.base.palette.ai,\n 'secondary-color': theme.base.palette.ai,\n 'secondary-fill-style': 'outline'\n }\n }\n }}\n >\n <MenuButton\n as={StyledGuidedSuggestions}\n text={t('ask_coach', [selectedCoach ?? ''])}\n variant='primary'\n icon='polaris-solid'\n ref={setSuggestionMenuButton}\n menu={{\n items: suggestions,\n onItemClick: id => {\n const selected = menuHelpers.getItem(suggestions, id);\n if (selected) {\n onSend({\n id: selected.id,\n message: selected.primary\n });\n }\n }\n }}\n />\n </ThemeOverride>\n )}\n\n <Flex container={{ justify: 'center' }}>\n <StyledDisclaimerText inFullPage={!condition}>\n {t('ai_disclaimer')}\n </StyledDisclaimerText>\n </Flex>\n </>\n )}\n </>\n ) : (\n renderTextArea\n )}\n </StyledComposerSection>\n </Flex>\n )}\n </Flex>\n )}\n </>\n );\n\n useEffect(() => {\n if (focusTextArea.current && !conversationHistory && textAreaRef.current) {\n textAreaRef.current.focus();\n focusTextArea.current = false;\n }\n }, [conversationHistory, focusTextArea.current]);\n\n useEffect(() => {\n if (attachmentsError) {\n announcePolite({\n message: attachmentsError\n });\n } else if (attachments && attachments.length > 0) {\n announcePolite({\n message: t('attachment_added')\n });\n attachmentsAdded.current = true;\n } else if (attachmentsAdded.current && attachments && attachments.length === 0) {\n textAreaRef.current?.focus();\n attachmentsAdded.current = false;\n }\n }, [attachments, attachmentsError]);\n\n const historyView = conversationHistory && (\n <ConversationHistory\n testId={testIds.root}\n {...conversationHistory}\n onItemClick={conversationId => {\n if (condition) {\n focusTextArea.current = true;\n } else {\n textAreaRef.current?.focus();\n }\n\n conversationHistory.onItemClick?.(conversationId);\n }}\n onDismiss={() => {\n focusTextArea.current = true;\n conversationHistory.onDismiss();\n }}\n inFullPage={!condition}\n ref={historyViewRef}\n />\n );\n\n return (\n <Fullscreen>\n <Flex\n container={{ direction: 'column' }}\n as={StyledGenAICoachContainer}\n data-testid={testIds.root}\n variant={variant}\n fullScreen={fullScreen}\n isCompact={isCompact}\n ref={genAICoachRef}\n {...restProps}\n >\n <Flex container={{ justify: 'between', alignItems: 'center', pad: [1.5, 2, 0.5] }}>\n {headerContent}\n </Flex>\n {condition ? (\n <>{conversationHistory ? historyView : GenAICoachElement}</>\n ) : (\n <Grid\n container={{ gap: 0.5, cols: '2fr 3fr' }}\n as={StyledGridContainer}\n conversationHistory={!!conversationHistory}\n >\n {historyView}\n {GenAICoachElement}\n </Grid>\n )}\n {lightboxPreviewProps && <Lightbox {...lightboxPreviewProps} />}\n </Flex>\n </Fullscreen>\n );\n};\n\nexport default withTestIds(GenAICoach, getGenAICoachTestIds);\n"]}
1
+ {"version":3,"file":"GenAICoach.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,EACX,OAAO,EACP,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,aAAa,EACb,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,aAAa,EACb,IAAI,EACJ,SAAS,EACT,kBAAkB,EAClB,QAA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AAE,GAAG,EAAE;YACd,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;YAC7B,mBAAmB,CAAC,SAAS,EAAE,CAAC;QAClC,CAAC,EACD,UAAU,EAAE,CAAC,SAAS,EACtB,GAAG,EAAE,cAAc,GACnB,CACH,CAAC;IACF,OAAO,CACL,KAAC,OAAO,IAAC,YAAY,EAAE,4BAA4B,YACjD,KAAC,UAAU,cACT,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,EAAE,EAAE,yBAAyB,iBAChB,OAAO,CAAC,IAAI,EACzB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,aAAa,KACd,SAAS,aAEb,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,YAC9E,aAAa,GACT,EACN,SAAS,CAAC,CAAC,CAAC,CACX,4BAAG,mBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,GAAI,CAC7D,CAAC,CAAC,CAAC,CACF,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,EACxC,EAAE,EAAE,mBAAmB,EACvB,mBAAmB,EAAE,CAAC,CAAC,mBAAmB,aAEzC,WAAW,EACX,iBAAiB,IACb,CACR,EACA,oBAAoB,IAAI,KAAC,QAAQ,OAAK,oBAAoB,GAAI,IAC1D,GACI,GACL,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ChangeEvent, FunctionComponent } from 'react';\n\nimport {\n Button,\n Flex,\n Icon,\n MenuButton,\n Progress,\n Text,\n createUID,\n menuHelpers,\n useI18n,\n useSpeechRecognition,\n useTestIds,\n useTheme,\n withTestIds,\n registerIcon,\n usePrevious,\n getFocusables,\n isMenuGroupProps,\n ErrorState,\n useArrows,\n focusableSelector,\n useLiveLog,\n useOuterEvent,\n ThemeOverride,\n hasProp,\n getActiveElement,\n useElement,\n Actions,\n useBreakpoint,\n Grid,\n useRefMap,\n VisuallyHiddenText,\n FileList,\n Lightbox,\n FullscreenButton,\n FormField,\n Fullscreen,\n useUID,\n SpeechToTextButton,\n Toaster,\n useToaster\n} from '@pega/cosmos-react-core';\nimport type { MenuItemProps, MenuProps } from '@pega/cosmos-react-core';\nimport * as caretUpIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-up.icon';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport * as minusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/minus.icon';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';\nimport * as warnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\nimport * as sendSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/send-solid.icon';\nimport * as squareSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/square-solid.icon';\nimport type { UseSpeechRecognitionProps } from '@pega/cosmos-react-core/lib/hooks/useSpeechRecognition';\n\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\nimport { isCoachMessage, isInUtilities, isUserMessage } from './GenAICoach.utils';\nimport {\n StyledMessagesContainer,\n StyledDisclaimerText,\n StyledGenAICoachContainer,\n StyledGenAIOptionsMenu,\n StyledInitialMessageContainer,\n StyledInputContainer,\n StyledMenuSuggestions,\n StyledMessagesList,\n StyledGridContainer,\n StyledFlexWrapper,\n StyledErrorContainer,\n StyledInput,\n StyledGuidedSuggestions,\n StyledComposerSection,\n StyledSendButton,\n StyledGenAIFormControl,\n StyledGenAITextArea,\n StyledInitialMessageGrid,\n StyledGenAIFooter,\n StyledAgentIcon,\n StyledStopButton\n} from './GenAICoach.styles';\nimport ConversationHistory from './ConversationHistory';\nimport type { Tool } from './GenAICoach.types';\n\nimport { GenAIMessage, InitialSuggestedMessage, type GenAICoachProps } from '.';\n\nregisterIcon(\n caretUpIcon,\n timesIcon,\n caretDownIcon,\n minusIcon,\n polarisSolidIcon,\n paperClipIcon,\n warnSolidIcon,\n squareSolidIcon,\n sendSolidIcon\n);\n\nexport const AgentIcon = () => (\n <StyledAgentIcon\n xmlns='http://www.w3.org/2000/svg'\n filter='drop-shadow(0 .125rem .125rem rgba(0,0,0,.03)) drop-shadow(.125rem .5rem .5rem rgba(0,0,0,.05)) drop-shadow(.125rem 1rem 1rem rgba(0,0,0,.08))'\n viewBox='0 0 60 60'\n >\n <linearGradient\n id='a'\n x1='30.586'\n x2='3.059'\n y1='58.111'\n y2='30.584'\n gradientUnits='userSpaceOnUse'\n >\n <stop offset='.115' stopColor='#681fc3' />\n <stop offset='.418' stopColor='#9795f3' />\n <stop offset='.591' stopColor='#b3d2ff' />\n <stop offset='.966' stopColor='#a467f0' />\n </linearGradient>\n <linearGradient id='b' x1='7.137' x2='29.565' y1='0' y2='60.151' gradientUnits='userSpaceOnUse'>\n <stop offset='.457' stopColor='#8165d2' stopOpacity='0' />\n <stop offset='.524' stopColor='#280096' stopOpacity='.4' />\n </linearGradient>\n <clipPath id='c'>\n <path d='M0 0h60v60H0z' />\n </clipPath>\n <g fillRule='evenodd' clipPath='url(#c)' clipRule='evenodd'>\n <path\n fill='url(#a)'\n d='M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z'\n />\n <path\n fill='url(#b)'\n d='M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z'\n />\n </g>\n </StyledAgentIcon>\n);\n\nconst VOICE_ERROR_DISMISS_DURATION = 3000;\n\nconst GenAICoach: FunctionComponent<GenAICoachProps> = ({\n testId,\n coachOptions: coachOptionsProps,\n onCoachChange: onCoachChangeProp,\n messages = [],\n onSend,\n initialSuggestedMessages,\n suggestions,\n loading,\n error,\n variant,\n onOpen,\n guidedMode = false,\n actions,\n conversationHistory,\n onLayoutChange,\n onAddAttachment,\n attachments,\n attachmentsError,\n lightboxPreviewProps,\n allowFullScreen = true,\n isInLandingPageUtilities,\n stopProcess,\n voiceToTextProps,\n ...restProps\n}) => {\n const theme = useTheme();\n const t = useI18n();\n const testIds = useTestIds(testId, getGenAICoachTestIds);\n const { announcePolite } = useLiveLog();\n\n const elementRef = useRef<HTMLElement | null>(null);\n const conversationRef = useRef<HTMLUListElement>(null);\n const genAICoachRef = useRef<HTMLDivElement>(null);\n const [messageEls, getMessageCbRef] = useRefMap<HTMLLIElement>();\n\n const focusInMessageListRef = useRef(false);\n const isUserTriggered = useRef(false);\n const lastFocusedMessageRef = useRef<HTMLElement | null>(null);\n const initialFocusedElementRef = useRef<HTMLElement | null>(null);\n const messageContainerRef = useRef<HTMLDivElement>(null);\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n const [suggestionMenuButton, setSuggestionMenuButton] = useElement<HTMLButtonElement>(null);\n const isGeneratingResponse = useRef(false);\n const focusTextArea = useRef(false);\n const historyViewRef = useRef<HTMLUListElement>(null);\n const fileUploadInputRef = useRef<HTMLInputElement>(null);\n const attachmentsAdded = useRef(false);\n const pendingResult = useRef(false);\n\n const isSmallOrAbove = useBreakpoint('sm', {\n breakpointRef: genAICoachRef\n });\n\n const [message, setMessage] = useState('');\n const [interimMessage, setInterimMessage] = useState('');\n const [coachOptions, setCoachOptions] = useState<MenuProps['items']>(coachOptionsProps);\n const [arrowKey, setArrowKey] = useState<\n 'ArrowRight' | 'ArrowLeft' | 'ArrowUp' | 'ArrowDown' | null\n >(null);\n\n const [animationInitialCursorPos, setAnimationInitialCursorPos] = useState(0);\n const [focused, setFocused] = useState(false);\n const [fullScreen, setFullScreen] = useState(false);\n\n const prevFullScreen = usePrevious(fullScreen);\n const previousMessages = usePrevious(messages);\n\n const composerId = useUID();\n\n const latestMessage = messages.at(-1);\n const condition =\n !(fullScreen && conversationHistory) &&\n (variant.placement === 'dialog' ||\n variant.placement === 'utilities' ||\n (variant.placement === 'fullpage' && !isSmallOrAbove) ||\n !conversationHistory);\n\n const onCoachChange = (id: MenuItemProps['id']) => {\n setCoachOptions(cur => {\n return cur.map(coach => {\n return {\n ...coach,\n selected: coach.id === id\n };\n });\n });\n onCoachChangeProp?.(id);\n };\n\n const selectedCoach = useMemo(() => {\n const selected = menuHelpers.getSelected(coachOptions)[0];\n if (selected) return selected.primary;\n\n if (coachOptions[0]) {\n if (isMenuGroupProps(coachOptions[0])) {\n return coachOptions[0].items[0].primary;\n }\n return coachOptions[0].primary;\n }\n }, [coachOptions]);\n\n const onResult: UseSpeechRecognitionProps['onResult'] = useCallback(value => {\n pendingResult.current = false;\n setMessage(prevMessage => {\n return prevMessage ? `${prevMessage} ${value}` : value;\n });\n setInterimMessage('');\n }, []);\n\n const onInterimResult: NonNullable<UseSpeechRecognitionProps['onInterimResult']> = useCallback(\n value => {\n if (value) {\n pendingResult.current = true;\n setInterimMessage(message ? ` ${value}` : value);\n }\n },\n [message]\n );\n\n const {\n supported,\n active,\n start,\n stop,\n error: voiceToTextError\n } = useSpeechRecognition({\n onResult,\n onInterimResult,\n langCode: voiceToTextProps?.langCode\n });\n\n const handleSendMessage = useCallback(() => {\n const isMessageAndAttachmentsEmpty = !message && (!attachments || attachments.length === 0);\n const hasAttachmentsError =\n attachments &&\n attachments.length > 0 &&\n (attachmentsError || attachments.some(attachment => attachment.error));\n const isCoachMessageLoading =\n latestMessage && isCoachMessage(latestMessage) && latestMessage.loading;\n if (\n isMessageAndAttachmentsEmpty ||\n hasAttachmentsError ||\n isCoachMessageLoading ||\n (latestMessage && isCoachMessage(latestMessage) && latestMessage.isToolConfirmation)\n )\n return;\n onSend({\n id: createUID(),\n message,\n fromComposer: true,\n attachmentIds: attachments?.map(({ id }) => id)\n });\n setMessage('');\n if (active) {\n stop();\n }\n }, [[message, latestMessage, attachments, attachmentsError]]);\n\n const handleEnterKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n e.stopPropagation();\n handleSendMessage();\n }\n };\n\n const handleTextAreaChange = useCallback(\n (e: ChangeEvent<HTMLTextAreaElement>) => {\n setMessage(e.currentTarget.value);\n },\n [setMessage]\n );\n\n const renderCoachOptions = useMemo(() => {\n if (coachOptions.length === 0 || !selectedCoach) {\n return null;\n }\n if (coachOptions.length === 1) {\n return <Text variant='h2'>{selectedCoach}</Text>;\n }\n return (\n <MenuButton\n text={selectedCoach}\n aria-label={t('agent_switcher', [selectedCoach])}\n variant='text'\n as={StyledGenAIOptionsMenu}\n menu={{\n mode: 'single-select',\n items: coachOptions,\n onItemClick: onCoachChange\n }}\n />\n );\n }, [coachOptions, selectedCoach]);\n\n const headerContent = useMemo(() => {\n return isInUtilities(variant) && variant.state === 'minimized' ? (\n <>\n <Text variant='h2'>{selectedCoach}</Text>\n <Flex container={{ alignItems: 'center' }}>\n <Button\n icon\n label={t('maximize')}\n aria-label={t('agent_noun', [t('maximize')])}\n variant='simple'\n onClick={() => {\n variant.onStateChange('maximized');\n isUserTriggered.current = true;\n }}\n >\n <Icon name='caret-up' />\n </Button>\n </Flex>\n </>\n ) : (\n <>\n {renderCoachOptions}\n\n <Flex container>\n {isInUtilities(variant) && (\n <Button\n icon\n label={t('minimize')}\n aria-label={t('agent_noun', [t('minimize')])}\n variant='simple'\n onClick={() => {\n variant.onStateChange('minimized');\n isUserTriggered.current = true;\n }}\n >\n <Icon name='minus' />\n </Button>\n )}\n\n {allowFullScreen && <FullscreenButton onClick={() => setFullScreen(prev => !prev)} />}\n\n {actions && (\n <Actions data-testid={testIds.actions} contextualLabel={selectedCoach} {...actions} />\n )}\n {variant.placement === 'dialog' && (\n <Button\n icon\n label={t('close')}\n aria-label={t('agent_noun', [t('close')])}\n variant='simple'\n onClick={variant.onClose}\n >\n <Icon name='times' />\n </Button>\n )}\n </Flex>\n </>\n );\n }, [variant, coachOptions]);\n\n const getMessageContainingElement = (element: Element | null) => {\n if (element) return Array.from(messageEls.values()).find(el => el && el.contains(element));\n return null;\n };\n\n const setLastFocusableElement = () => {\n focusInMessageListRef.current = false;\n lastFocusedMessageRef.current = elementRef.current ?? null;\n if (\n lastFocusedMessageRef.current &&\n lastFocusedMessageRef.current?.tagName.toLowerCase() !== 'li'\n ) {\n lastFocusedMessageRef.current =\n getMessageContainingElement(lastFocusedMessageRef.current) ?? null;\n }\n };\n\n const onResize = () => {\n if (genAICoachRef.current && isInUtilities(variant)) {\n const height = genAICoachRef.current.clientHeight;\n variant.setGenAIHeight?.(height);\n }\n };\n\n const variantState = useMemo(() => {\n if (variant.placement === 'utilities') {\n return variant.state;\n }\n }, [variant]);\n\n useEffect(() => {\n if (isInUtilities(variant)) {\n onResize();\n }\n if (isUserTriggered.current) {\n if (\n isInUtilities(variant) &&\n (variant.state === 'minimized' || (guidedMode && variant.state === 'maximized')) &&\n getFocusables(genAICoachRef).length > 0\n ) {\n getFocusables(genAICoachRef)[0].focus();\n isUserTriggered.current = false;\n } else if (variant.placement !== 'fullpage') {\n textAreaRef.current?.focus();\n elementRef.current = null;\n isUserTriggered.current = false;\n }\n }\n }, [variantState, variant.placement]);\n\n useEffect(() => {\n onLayoutChange?.(!condition);\n }, [condition]);\n\n useEffect(() => {\n onOpen?.();\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n useEffect(() => {\n const prevFilteredMsgs = previousMessages?.filter(item => !hasProp(item, 'loading')) ?? [];\n const currentFilteredMsgs = messages?.filter(item => !hasProp(item, 'loading')) ?? [];\n\n if (\n prevFilteredMsgs.length < currentFilteredMsgs.length ||\n (latestMessage && hasProp(latestMessage, 'loading'))\n ) {\n setTimeout(() => {\n conversationRef.current?.lastElementChild?.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest'\n });\n }, 0);\n if (latestMessage && isUserMessage(latestMessage)) {\n textAreaRef.current?.focus();\n setLastFocusableElement();\n elementRef.current = null;\n setArrowKey(null);\n } else if (latestMessage?.loading) {\n isGeneratingResponse.current = true;\n } else {\n announcePolite({ message: t('agent_noun', [`${t('new_message')} ${t('from')}`]) });\n }\n }\n }, [messages]);\n\n useEffect(() => {\n if (suggestionMenuButton && isGeneratingResponse.current) {\n announcePolite({ message: t('response_generated') });\n isGeneratingResponse.current = false;\n\n const activeElement = getActiveElement();\n if (activeElement && activeElement === document.body) suggestionMenuButton.focus();\n }\n }, [suggestionMenuButton]);\n\n /** Supports arrow key behaviors */\n useEffect(() => {\n const focusables = getFocusables(elementRef);\n if (arrowKey === 'ArrowRight') {\n focusables[0]?.focus();\n } else if (arrowKey === 'ArrowLeft') {\n focusables[focusables.length - 1]?.focus();\n }\n }, [arrowKey, elementRef.current]);\n\n useArrows(\n conversationRef,\n {\n cycle: true,\n selector: ':scope > li',\n dir: 'up-down',\n allowTabFocus: true,\n initialFocusElement: initialFocusedElementRef.current\n },\n [messages, initialFocusedElementRef.current]\n );\n\n useArrows(\n elementRef,\n {\n cycle: true,\n selector: `li ${focusableSelector}`,\n dir: 'left-right',\n allowTabFocus: true,\n updateTabIndex: false\n },\n [messages, elementRef.current, arrowKey]\n );\n\n useOuterEvent('mousedown', [conversationRef.current], () => {\n setArrowKey(null);\n focusInMessageListRef.current = false;\n });\n\n const { push } = useToaster();\n\n const onSpeechToTextButtonClick = useCallback(() => {\n if (active) {\n stop();\n } else {\n start();\n }\n }, [active, stop, start]);\n\n const onFileChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files) {\n const newFiles = Array.from(e.target.files);\n onAddAttachment?.(newFiles);\n }\n };\n\n const getGridColumns = () => {\n const multiCol = 'repeat(auto-fit, minmax(calc(100% / 4 - 1rem), 1fr))';\n const singleCol = '1fr';\n\n if (!isSmallOrAbove && !fullScreen) return singleCol;\n\n return multiCol;\n };\n\n useEffect(() => {\n if (voiceToTextError) {\n push({ content: voiceToTextError });\n }\n }, [voiceToTextError]);\n\n const genAIFooter = (\n <Flex container={{ direction: 'column' }} as={StyledGenAIFooter}>\n <FormField label={t('message_pega_gen_ai_coach')} labelHidden labelFor={composerId}>\n <StyledGenAIFormControl focused={focused}>\n <Flex container={{ direction: 'column', gap: 0.25 }}>\n <StyledGenAITextArea\n id={composerId}\n ref={textAreaRef}\n value={interimMessage ? `${message}${interimMessage}` : message}\n placeholder={t('write_message')}\n onKeyDown={handleEnterKeyDown}\n onChange={handleTextAreaChange}\n onFocus={() => {\n if (active) stop();\n setFocused(true);\n }}\n onBlur={() => {\n setFocused(false);\n }}\n autoResize\n />\n\n <Flex\n container={{\n direction: 'row',\n justify: 'between',\n gap: 1,\n pad: [undefined, 1, 1, 1]\n }}\n >\n <Flex container={{ alignItems: 'center' }}>\n {suggestions && (\n <MenuButton\n text={t('suggestions')}\n variant='simple'\n icon='chat-typing'\n iconOnly\n as={StyledMenuSuggestions}\n menu={{\n items: suggestions,\n onItemClick: id => {\n const selected = menuHelpers.getItem(suggestions, id);\n if (selected) {\n setMessage(selected.primary);\n textAreaRef.current?.focus();\n }\n }\n }}\n showArrow={false}\n />\n )}\n {voiceToTextProps?.enableDictation && supported && (\n <SpeechToTextButton active={active} onClick={onSpeechToTextButtonClick} />\n )}\n\n {onAddAttachment && (\n <>\n <Button\n icon\n onClick={() => {\n if (fileUploadInputRef.current) {\n fileUploadInputRef.current.value = '';\n }\n fileUploadInputRef.current?.click();\n }}\n variant='simple'\n label={t('add_attachment')}\n >\n <Icon name='paper-clip' />\n </Button>\n <StyledInput\n type='file'\n ref={fileUploadInputRef}\n onChange={onFileChange}\n multiple={false}\n data-testid={testIds.attachments}\n />\n </>\n )}\n </Flex>\n\n {(latestMessage && isCoachMessage(latestMessage) && latestMessage.loading) ||\n (active && pendingResult.current) ? (\n <Flex\n container={{\n gap: 1,\n justify: 'end',\n alignItems: 'center',\n pad: 1\n }}\n >\n {active && pendingResult.current\n ? t('processing_speech')\n : t('generating_response')}\n <Progress placement='inline' />\n </Flex>\n ) : (\n <>\n {latestMessage &&\n isCoachMessage(latestMessage) &&\n latestMessage.isToolConfirmation ? (\n <StyledStopButton\n iconOnly\n icon='square-solid'\n variant='primary'\n label={t('stop_processing')}\n onClick={() => {\n textAreaRef.current?.focus();\n stopProcess?.();\n }}\n />\n ) : (\n <StyledSendButton\n variant='primary'\n onClick={handleSendMessage}\n icon\n label={t('send')}\n aria-label={t('send_message')}\n >\n <Icon name='send-solid' />\n </StyledSendButton>\n )}\n </>\n )}\n </Flex>\n </Flex>\n </StyledGenAIFormControl>\n </FormField>\n\n {attachments && attachments.length > 0 && (\n <>\n <Flex\n as={FileList}\n type='item'\n aria-label={`${t('attachments')}`}\n items={attachments}\n container={{ pad: [1, 0] }}\n />\n\n {attachmentsError && (\n <Flex container={{ gap: 1, alignItems: 'center' }} as={StyledErrorContainer}>\n <Icon name='warn-solid' />\n <VisuallyHiddenText>{`${t('error')} `}</VisuallyHiddenText>\n\n {attachmentsError}\n </Flex>\n )}\n </>\n )}\n\n <Flex container={{ justify: 'center' }}>\n <StyledDisclaimerText inFullPage={!condition}>{t('ai_disclaimer')}</StyledDisclaimerText>\n </Flex>\n </Flex>\n );\n\n const isCompact =\n variant.placement === 'fullpage' &&\n !fullScreen &&\n !isInLandingPageUtilities &&\n messages.length === 0;\n\n const fullPageAndInitialScreen =\n (fullScreen || (variant.placement === 'fullpage' && !isInLandingPageUtilities)) &&\n messages.length === 0;\n\n const renderTextArea = fullPageAndInitialScreen ? null : genAIFooter;\n\n const GenAICoachElement = (\n <>\n {((isInUtilities(variant) && variant.state !== 'minimized') || !isInUtilities(variant)) && (\n <Flex container={{ direction: 'column' }} as={StyledFlexWrapper}>\n <Flex\n as={StyledMessagesContainer}\n ref={messageContainerRef}\n container={\n loading || error\n ? { direction: 'column', pad: [0, 2], justify: 'center' }\n : { direction: 'column', pad: [0, 2] }\n }\n item={{ grow: 1 }}\n >\n {loading || error ? (\n <Flex container={{ justify: 'center', alignItems: 'center' }}>\n {loading ? (\n <Progress\n variant='ring'\n placement='block'\n message={typeof loading === 'string' ? loading : t('loading')}\n />\n ) : (\n <ErrorState message={error} />\n )}\n </Flex>\n ) : (\n <>\n {messages.length === 0 ? (\n <Flex\n as={StyledInitialMessageContainer}\n container={{\n justify: isCompact ? 'start' : 'center',\n direction: 'column',\n alignItems: 'center',\n gap: 2\n }}\n item={{ grow: 1 }}\n >\n {((isInUtilities(variant) && variant.state === 'maximized') ||\n !isInUtilities(variant)) && (\n <Flex container={{ direction: 'column', alignItems: 'center', gap: 1 }}>\n <AgentIcon />\n\n <Text variant='h2'>{t('welcome_text')}</Text>\n </Flex>\n )}\n\n <Grid\n as={StyledInitialMessageGrid}\n container={{ cols: getGridColumns(), gap: 1.5 }}\n >\n {initialSuggestedMessages?.map(initialSuggestedMessage => (\n <InitialSuggestedMessage\n {...initialSuggestedMessage}\n onSend={initialMessage => {\n if (guidedMode) {\n onSend({\n id: initialMessage.id,\n message: initialMessage.message\n });\n } else {\n setMessage(initialMessage.message);\n }\n isUserTriggered.current = true;\n textAreaRef.current?.focus();\n }}\n testId={initialSuggestedMessage.id}\n />\n ))}\n </Grid>\n\n {fullPageAndInitialScreen && !guidedMode && genAIFooter}\n </Flex>\n ) : (\n <Flex\n as={StyledMessagesList}\n ref={conversationRef}\n aria-label={`${t('conversation')} ${t('view')}`}\n container={{ direction: 'column' }}\n onFocus={() => {\n if (!focusInMessageListRef.current) {\n if (lastFocusedMessageRef.current) {\n lastFocusedMessageRef.current.focus();\n } else {\n /** Focus on the latest message if the chat message list was never focused */\n const lastChild =\n conversationRef.current && conversationRef.current.lastElementChild;\n if (lastChild instanceof HTMLElement) {\n lastChild.focus();\n }\n }\n }\n focusInMessageListRef.current = true;\n setArrowKey(null);\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n setArrowKey(e.key);\n elementRef.current =\n getMessageContainingElement(document.activeElement) ?? null;\n lastFocusedMessageRef.current = elementRef.current;\n } else if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n const activeMessageElement = Array.from(messageEls.values()).find(\n el => el === document.activeElement\n );\n elementRef.current =\n getMessageContainingElement(document.activeElement) ?? null;\n initialFocusedElementRef.current = elementRef.current;\n\n if (\n activeMessageElement &&\n getFocusables(activeMessageElement).length > 0\n ) {\n setArrowKey(e.key);\n }\n } else if (e.key === 'Tab') {\n e.preventDefault();\n setLastFocusableElement();\n if (e.shiftKey) {\n if (\n !condition &&\n conversationHistory &&\n conversationHistory.selectedItemId\n ) {\n const selectedId = historyViewRef.current?.querySelector<HTMLLIElement>(\n `li[id=\"${conversationHistory.selectedItemId}\"]`\n );\n\n if (selectedId) {\n selectedId.focus();\n e.preventDefault();\n }\n } else {\n const prevElement =\n conversationRef.current?.parentElement?.parentElement\n ?.previousElementSibling;\n if (prevElement) {\n const focusables = getFocusables(prevElement);\n if (focusables.length) {\n e.preventDefault();\n focusables[focusables.length - 1].focus();\n }\n }\n }\n } else {\n const nextElement =\n conversationRef.current?.parentElement?.nextElementSibling;\n if (nextElement) {\n const focusables = getFocusables(nextElement);\n if (focusables.length) {\n e.preventDefault();\n focusables[0].focus();\n }\n }\n\n setArrowKey(null);\n }\n }\n }}\n >\n {messages.map(item => {\n const messageProps = isCoachMessage(item)\n ? {\n ...item,\n suggestions:\n messages.findLast(messageItem => isCoachMessage(messageItem))?.id ===\n item.id\n ? item.suggestions\n : undefined,\n onSend,\n onSubmit: item.isToolConfirmation\n ? (tools: Tool[]) => {\n onSend({\n ...item,\n message: item.message ?? '',\n tools\n });\n }\n : undefined\n }\n : item;\n\n return (\n <GenAIMessage\n {...messageProps}\n ref={getMessageCbRef(item.id)}\n testId={item.id}\n announceInteraction={!focusInMessageListRef.current}\n onAnimationCursorUpdate={animatedTillCursor => {\n if (isCoachMessage(item)) {\n setAnimationInitialCursorPos(animatedTillCursor);\n }\n }}\n {...(prevFullScreen !== fullScreen ? { animationInitialCursorPos } : {})}\n />\n );\n })}\n </Flex>\n )}\n </>\n )}\n </Flex>\n\n {((isInUtilities(variant) && variant.state !== 'minimized') || !isInUtilities(variant)) &&\n !loading && (\n <Flex container={{ direction: 'column' }} as={StyledInputContainer}>\n <StyledComposerSection>\n {guidedMode ? (\n <>\n {suggestions && messages.length > 0 && (\n <>\n {latestMessage &&\n isCoachMessage(latestMessage) &&\n latestMessage.loading ? (\n <Flex\n container={{\n gap: 1,\n justify: 'center',\n alignItems: 'center',\n pad: 1\n }}\n >\n {t('generating_response')}\n <Progress\n placement='inline'\n focusOnVisible\n message={t('generating_response')}\n />\n </Flex>\n ) : (\n <ThemeOverride\n theme={{\n components: {\n button: {\n color: theme.base.palette.ai,\n 'secondary-color': theme.base.palette.ai,\n 'secondary-fill-style': 'outline'\n }\n }\n }}\n >\n <MenuButton\n as={StyledGuidedSuggestions}\n text={t('ask_coach', [selectedCoach ?? ''])}\n variant='primary'\n icon='polaris-solid'\n ref={setSuggestionMenuButton}\n menu={{\n items: suggestions,\n onItemClick: id => {\n const selected = menuHelpers.getItem(suggestions, id);\n if (selected) {\n onSend({\n id: selected.id,\n message: selected.primary\n });\n }\n }\n }}\n />\n </ThemeOverride>\n )}\n\n <Flex container={{ justify: 'center' }}>\n <StyledDisclaimerText inFullPage={!condition}>\n {t('ai_disclaimer')}\n </StyledDisclaimerText>\n </Flex>\n </>\n )}\n </>\n ) : (\n renderTextArea\n )}\n </StyledComposerSection>\n </Flex>\n )}\n </Flex>\n )}\n </>\n );\n\n useEffect(() => {\n if (focusTextArea.current && !conversationHistory && textAreaRef.current) {\n textAreaRef.current.focus();\n focusTextArea.current = false;\n }\n }, [conversationHistory, focusTextArea.current]);\n\n useEffect(() => {\n if (attachmentsError) {\n announcePolite({\n message: attachmentsError\n });\n } else if (attachments && attachments.length > 0) {\n announcePolite({\n message: t('attachment_added')\n });\n attachmentsAdded.current = true;\n } else if (attachmentsAdded.current && attachments && attachments.length === 0) {\n textAreaRef.current?.focus();\n attachmentsAdded.current = false;\n }\n }, [attachments, attachmentsError]);\n\n const historyView = conversationHistory && (\n <ConversationHistory\n testId={testIds.root}\n {...conversationHistory}\n onItemClick={conversationId => {\n if (condition) {\n focusTextArea.current = true;\n } else {\n textAreaRef.current?.focus();\n }\n\n conversationHistory.onItemClick?.(conversationId);\n }}\n onDismiss={() => {\n focusTextArea.current = true;\n conversationHistory.onDismiss();\n }}\n inFullPage={!condition}\n ref={historyViewRef}\n />\n );\n return (\n <Toaster dismissAfter={VOICE_ERROR_DISMISS_DURATION}>\n <Fullscreen>\n <Flex\n container={{ direction: 'column' }}\n as={StyledGenAICoachContainer}\n data-testid={testIds.root}\n variant={variant}\n fullScreen={fullScreen}\n isCompact={isCompact}\n ref={genAICoachRef}\n {...restProps}\n >\n <Flex container={{ justify: 'between', alignItems: 'center', pad: [1.5, 2, 0.5] }}>\n {headerContent}\n </Flex>\n {condition ? (\n <>{conversationHistory ? historyView : GenAICoachElement}</>\n ) : (\n <Grid\n container={{ gap: 0.5, cols: '2fr 3fr' }}\n as={StyledGridContainer}\n conversationHistory={!!conversationHistory}\n >\n {historyView}\n {GenAICoachElement}\n </Grid>\n )}\n {lightboxPreviewProps && <Lightbox {...lightboxPreviewProps} />}\n </Flex>\n </Fullscreen>\n </Toaster>\n );\n};\n\nexport default withTestIds(GenAICoach, getGenAICoachTestIds);\n"]}
@@ -157,6 +157,11 @@ export type GenAICoachProps = WithAttributes<'div', TestIdProp & {
157
157
  lightboxPreviewProps?: LightboxProps;
158
158
  /** Enable full screen */
159
159
  allowFullScreen?: boolean;
160
+ /** Enable voice to text */
161
+ voiceToTextProps?: {
162
+ enableDictation: boolean;
163
+ langCode: string;
164
+ };
160
165
  }>;
161
166
  export interface UtilitiesGenAICoachProps extends OmitStrict<GenAICoachProps, 'variant'> {
162
167
  onClose?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.types.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE5C,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,WAAW,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC/D,GACD;IAAE,SAAS,EAAE,UAAU,CAAA;CAAE,GACzB;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,aA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E5C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,4DAA4D;IAC5D,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,+CAA+C;IAC/C,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAC1C,uBAAuB;IACvB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,2BAA2B;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mGAAmG;IACnG,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,yBAAyB;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2BAA2B;IAC3B,gBAAgB,CAAC,EAAE;QACjB,eAAe,EAAE,OAAO,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CACF,CAAC;AAEF,MAAM,WAAW,wBAAyB,SAAQ,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC;IACtF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.types.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Dispatch, Ref, SetStateAction } from 'react';\n\nimport type {\n BaseProps,\n MenuProps,\n OmitStrict,\n ProgressProps,\n RequireAtLeastOne,\n TestIdProp,\n WithAttributes,\n ActionsProps,\n FileItemProps,\n FileDisplayProps,\n LightboxProps\n} from '@pega/cosmos-react-core';\nimport type { MDMap } from '@pega/cosmos-react-rte';\n\nexport type State = 'minimized' | 'maximized';\nexport type Reaction = 'liked' | 'disliked';\n\nexport type Variant =\n | {\n placement: 'utilities';\n state: State;\n onStateChange: (state: State) => void;\n setGenAIHeight?: Dispatch<SetStateAction<number | undefined>>;\n }\n | { placement: 'fullpage' }\n | { placement: 'dialog'; onClose: () => void };\n\nexport interface MessageProps {\n id: string;\n message: string;\n announceInteraction?: boolean;\n attachments?: FileDisplayProps[];\n /**\n * Whether the message is a suggestion from the composer\n * @default false\n */\n fromComposer?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLLIElement>;\n}\n\nexport type InitialSuggestedMessageProps = Pick<GenAICoachProps, 'onSend'> &\n BaseProps &\n TestIdProp &\n MessageProps;\n\nexport interface UserMessageProps extends BaseProps, TestIdProp, MessageProps {\n from: 'user';\n}\n\nexport type ToolParameters = {\n id: string;\n label: string;\n type: 'text' | 'number' | 'boolean';\n value: string;\n};\n\nexport interface Tool {\n id: string;\n name: string;\n message: string;\n decision: 'accept' | 'modify' | 'reject';\n parameters: ToolParameters[];\n}\n\nexport interface ToolDetailsProps {\n isToolConfirmation: true;\n tools: Tool[];\n onSubmit?: (tools: Tool[]) => void;\n onCancel?: () => void;\n toolsConfirmed: boolean;\n}\n\nexport type CoachMessageProps = RequireAtLeastOne<\n Partial<Pick<GenAICoachProps, 'onSend'>> &\n BaseProps &\n TestIdProp &\n Pick<MessageProps, 'id' | 'announceInteraction' | 'ref'> &\n (\n | ToolDetailsProps\n | {\n isToolConfirmation?: false;\n tools?: never;\n onSubmit?: never;\n onCancel?: never;\n toolsConfirmed?: never;\n }\n ) & {\n from: 'coach';\n coachName: string;\n suggestions?: MessageProps[];\n loading?: boolean;\n enableStreaming?: boolean;\n allChunksReceived?: boolean;\n error?: string;\n message?: MessageProps['message'];\n markdownMap?: MDMap;\n onStreamingUpdate?: (isStreamingDone: boolean) => void;\n feedback?: {\n reaction: Reaction | undefined;\n onReaction: (id: MessageProps['id'], reaction: Reaction) => void;\n onFeedbackComplete: (id: MessageProps['id'], comment?: string) => void;\n };\n onAnimationCursorUpdate?: (animatedTillCursor: number) => void;\n animationInitialCursorPos?: number;\n },\n 'loading' | 'message' | 'error'\n>;\n\nexport interface SystemMessageProps\n extends TestIdProp,\n Pick<MessageProps, 'id' | 'message' | 'ref' | 'announceInteraction'> {\n from: 'system';\n loading?: boolean;\n}\n\nexport type GenAIMessageProps = UserMessageProps | CoachMessageProps | SystemMessageProps;\n\nexport interface ConversationHistoryProps extends TestIdProp {\n /** List of History items. */\n data: {\n id: string;\n section: string;\n conversations: {\n id: string;\n title: string;\n }[];\n }[];\n /** Click event for items within the list. */\n onItemClick?: (conversationId: string) => void;\n /** List loading state. */\n loading?: boolean;\n /** Called at scroll trigger to load more items. */\n loadMore?: () => void;\n /** True if History view is rendered in Full page view. */\n inFullPage?: boolean;\n /** Callback triggered when closing the history view. */\n onDismiss: () => void;\n /** Id of the selected item. */\n selectedItemId?: string;\n /** Set if there is an error in retreiving the data. */\n error?: string;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport type SendMessageProps = OmitStrict<MessageProps, 'attachments'> & {\n attachmentIds?: string[];\n tools?: Tool[];\n};\n\nexport type GenAICoachProps = WithAttributes<\n 'div',\n TestIdProp & {\n /** Chat loading indicator */\n loading?: boolean | ProgressProps['message'];\n /** Set if there is an error in retreiving the data */\n error?: string;\n /** Coaches available in the chat header */\n coachOptions: MenuProps['items'];\n /** Handle the coach selections */\n onCoachChange: (id: MenuProps['id']) => void;\n /** Suggested messages to start the conversation */\n initialSuggestedMessages?: MessageProps[];\n /** Additional suggestions presented at the bottom of the chat window */\n suggestions?: MenuProps['items'];\n /** Send prompts */\n onSend: (message: SendMessageProps) => void;\n\n stopProcess?: () => void;\n /** Messages to be shown in the chatting window. */\n messages?: GenAIMessageProps[];\n /** Placement of the component */\n variant: Variant;\n /** From landing page utilities */\n isInLandingPageUtilities?: boolean;\n /** callback when component is mounted */\n onOpen?: () => void;\n /**\n * User would be guided with selective prompts to enable interaction with coach.\n * @default false\n */\n guidedMode?: boolean;\n /** Pass an array of Action objects to show Action button. */\n actions?: ActionsProps;\n /** Pass data to show history view. */\n conversationHistory?: ConversationHistoryProps;\n /** Callback triggered when the layout component changes. */\n onLayoutChange?: (inFullPage: boolean) => void;\n /** Callback when attachment icon is clicked */\n onAddAttachment?: (files: File[]) => void;\n /** Attachments list */\n attachments?: FileItemProps[];\n /** Error in attachments */\n attachmentsError?: string;\n /** Configuration for the Lightbox component that handles preview of media attachments and files */\n lightboxPreviewProps?: LightboxProps;\n /** Enable full screen */\n allowFullScreen?: boolean;\n }\n>;\n\nexport interface UtilitiesGenAICoachProps extends OmitStrict<GenAICoachProps, 'variant'> {\n onClose?: () => void;\n}\n"]}
1
+ {"version":3,"file":"GenAICoach.types.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Dispatch, Ref, SetStateAction } from 'react';\n\nimport type {\n BaseProps,\n MenuProps,\n OmitStrict,\n ProgressProps,\n RequireAtLeastOne,\n TestIdProp,\n WithAttributes,\n ActionsProps,\n FileItemProps,\n FileDisplayProps,\n LightboxProps\n} from '@pega/cosmos-react-core';\nimport type { MDMap } from '@pega/cosmos-react-rte';\n\nexport type State = 'minimized' | 'maximized';\nexport type Reaction = 'liked' | 'disliked';\n\nexport type Variant =\n | {\n placement: 'utilities';\n state: State;\n onStateChange: (state: State) => void;\n setGenAIHeight?: Dispatch<SetStateAction<number | undefined>>;\n }\n | { placement: 'fullpage' }\n | { placement: 'dialog'; onClose: () => void };\n\nexport interface MessageProps {\n id: string;\n message: string;\n announceInteraction?: boolean;\n attachments?: FileDisplayProps[];\n /**\n * Whether the message is a suggestion from the composer\n * @default false\n */\n fromComposer?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLLIElement>;\n}\n\nexport type InitialSuggestedMessageProps = Pick<GenAICoachProps, 'onSend'> &\n BaseProps &\n TestIdProp &\n MessageProps;\n\nexport interface UserMessageProps extends BaseProps, TestIdProp, MessageProps {\n from: 'user';\n}\n\nexport type ToolParameters = {\n id: string;\n label: string;\n type: 'text' | 'number' | 'boolean';\n value: string;\n};\n\nexport interface Tool {\n id: string;\n name: string;\n message: string;\n decision: 'accept' | 'modify' | 'reject';\n parameters: ToolParameters[];\n}\n\nexport interface ToolDetailsProps {\n isToolConfirmation: true;\n tools: Tool[];\n onSubmit?: (tools: Tool[]) => void;\n onCancel?: () => void;\n toolsConfirmed: boolean;\n}\n\nexport type CoachMessageProps = RequireAtLeastOne<\n Partial<Pick<GenAICoachProps, 'onSend'>> &\n BaseProps &\n TestIdProp &\n Pick<MessageProps, 'id' | 'announceInteraction' | 'ref'> &\n (\n | ToolDetailsProps\n | {\n isToolConfirmation?: false;\n tools?: never;\n onSubmit?: never;\n onCancel?: never;\n toolsConfirmed?: never;\n }\n ) & {\n from: 'coach';\n coachName: string;\n suggestions?: MessageProps[];\n loading?: boolean;\n enableStreaming?: boolean;\n allChunksReceived?: boolean;\n error?: string;\n message?: MessageProps['message'];\n markdownMap?: MDMap;\n onStreamingUpdate?: (isStreamingDone: boolean) => void;\n feedback?: {\n reaction: Reaction | undefined;\n onReaction: (id: MessageProps['id'], reaction: Reaction) => void;\n onFeedbackComplete: (id: MessageProps['id'], comment?: string) => void;\n };\n onAnimationCursorUpdate?: (animatedTillCursor: number) => void;\n animationInitialCursorPos?: number;\n },\n 'loading' | 'message' | 'error'\n>;\n\nexport interface SystemMessageProps\n extends TestIdProp,\n Pick<MessageProps, 'id' | 'message' | 'ref' | 'announceInteraction'> {\n from: 'system';\n loading?: boolean;\n}\n\nexport type GenAIMessageProps = UserMessageProps | CoachMessageProps | SystemMessageProps;\n\nexport interface ConversationHistoryProps extends TestIdProp {\n /** List of History items. */\n data: {\n id: string;\n section: string;\n conversations: {\n id: string;\n title: string;\n }[];\n }[];\n /** Click event for items within the list. */\n onItemClick?: (conversationId: string) => void;\n /** List loading state. */\n loading?: boolean;\n /** Called at scroll trigger to load more items. */\n loadMore?: () => void;\n /** True if History view is rendered in Full page view. */\n inFullPage?: boolean;\n /** Callback triggered when closing the history view. */\n onDismiss: () => void;\n /** Id of the selected item. */\n selectedItemId?: string;\n /** Set if there is an error in retreiving the data. */\n error?: string;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport type SendMessageProps = OmitStrict<MessageProps, 'attachments'> & {\n attachmentIds?: string[];\n tools?: Tool[];\n};\n\nexport type GenAICoachProps = WithAttributes<\n 'div',\n TestIdProp & {\n /** Chat loading indicator */\n loading?: boolean | ProgressProps['message'];\n /** Set if there is an error in retreiving the data */\n error?: string;\n /** Coaches available in the chat header */\n coachOptions: MenuProps['items'];\n /** Handle the coach selections */\n onCoachChange: (id: MenuProps['id']) => void;\n /** Suggested messages to start the conversation */\n initialSuggestedMessages?: MessageProps[];\n /** Additional suggestions presented at the bottom of the chat window */\n suggestions?: MenuProps['items'];\n /** Send prompts */\n onSend: (message: SendMessageProps) => void;\n\n stopProcess?: () => void;\n /** Messages to be shown in the chatting window. */\n messages?: GenAIMessageProps[];\n /** Placement of the component */\n variant: Variant;\n /** From landing page utilities */\n isInLandingPageUtilities?: boolean;\n /** callback when component is mounted */\n onOpen?: () => void;\n /**\n * User would be guided with selective prompts to enable interaction with coach.\n * @default false\n */\n guidedMode?: boolean;\n /** Pass an array of Action objects to show Action button. */\n actions?: ActionsProps;\n /** Pass data to show history view. */\n conversationHistory?: ConversationHistoryProps;\n /** Callback triggered when the layout component changes. */\n onLayoutChange?: (inFullPage: boolean) => void;\n /** Callback when attachment icon is clicked */\n onAddAttachment?: (files: File[]) => void;\n /** Attachments list */\n attachments?: FileItemProps[];\n /** Error in attachments */\n attachmentsError?: string;\n /** Configuration for the Lightbox component that handles preview of media attachments and files */\n lightboxPreviewProps?: LightboxProps;\n /** Enable full screen */\n allowFullScreen?: boolean;\n /** Enable voice to text */\n voiceToTextProps?: {\n enableDictation: boolean;\n langCode: string;\n };\n }\n>;\n\nexport interface UtilitiesGenAICoachProps extends OmitStrict<GenAICoachProps, 'variant'> {\n onClose?: () => void;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-work",
3
- "version": "9.0.0-build.13.1",
3
+ "version": "9.0.0-build.13.3",
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.0.0-build.13.1",
18
- "@pega/cosmos-react-rte": "9.0.0-build.13.1",
17
+ "@pega/cosmos-react-core": "9.0.0-build.13.3",
18
+ "@pega/cosmos-react-rte": "9.0.0-build.13.3",
19
19
  "@types/react": "^17.0.62 || ^18.3.3",
20
20
  "@types/react-dom": "^17.0.20 || ^18.3.0",
21
21
  "@types/styled-components": "^5.1.26",