@pega/cosmos-react-work 4.0.0-dev.18.4 → 4.0.0-dev.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.js +3 -3
- package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +20 -20
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +3 -1
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +105 -58
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- package/lib/components/CaseView/CaseView.types.d.ts +1 -2
- package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.types.js.map +1 -1
- package/lib/components/Predictions/Predictions.d.ts.map +1 -1
- package/lib/components/Predictions/Predictions.js +1 -1
- package/lib/components/Predictions/Predictions.js.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.js +1 -1
- package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
- package/lib/components/Tags/Tags.js +1 -1
- package/lib/components/Tags/Tags.js.map +1 -1
- package/lib/components/Tasks/Tasks.d.ts +3 -0
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +1 -1
- package/lib/components/Tasks/Tasks.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { getContrast, hideVisually, meetsContrastGuidelines, parseToHsl, readableColor, rgba, transparentize } from 'polished';
|
|
3
|
-
import { Button, calculateFontSize, CardContent, defaultThemeProp, StyledBreadcrumbs, StyledButtonLink, StyledFieldValue, StyledStackedFieldValue, StyledIcon, StyledLabel, StyledPopover, StyledText, StyledTooltip, tryCatch, FieldValueList, StyledLink, readableHue, Text } from '@pega/cosmos-react-core';
|
|
3
|
+
import { Button, calculateFontSize, CardContent, defaultThemeProp, StyledBreadcrumbs, StyledButtonLink, StyledFieldValue, StyledStackedFieldValue, StyledIcon, StyledLabel, StyledPopover, StyledText, StyledTooltip, tryCatch, FieldValueList, StyledLink, readableHue, StyledCard, Text, useDirection } from '@pega/cosmos-react-core';
|
|
4
4
|
import { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';
|
|
5
5
|
import { colCountChWidth } from '@pega/cosmos-react-work/lib/components/Details/Details.styles';
|
|
6
|
+
import { StyledStage, StyledStages } from '../Stages/Stages.styles';
|
|
7
|
+
import { StyledTasks } from '../Tasks/Tasks';
|
|
6
8
|
import { useCaseViewContext } from './CaseView.context';
|
|
7
9
|
const labelChWidth = 16;
|
|
8
10
|
const inlineEndButtonOffset = '0.375rem';
|
|
@@ -316,84 +318,75 @@ export const StyledCaseSummaryContainer = styled.div(({ theme }) => {
|
|
|
316
318
|
`;
|
|
317
319
|
});
|
|
318
320
|
StyledCaseSummaryContainer.defaultProps = defaultThemeProp;
|
|
319
|
-
export const StyledExpandCollapseButton = styled(Button)((
|
|
321
|
+
export const StyledExpandCollapseButton = styled(Button)(() => {
|
|
322
|
+
return css `
|
|
323
|
+
border: none;
|
|
324
|
+
|
|
325
|
+
${StyledIcon} {
|
|
326
|
+
width: 1.5rem;
|
|
327
|
+
height: 1.5rem;
|
|
328
|
+
}
|
|
329
|
+
`;
|
|
330
|
+
});
|
|
331
|
+
StyledExpandCollapseButton.defaultProps = defaultThemeProp;
|
|
332
|
+
export const StyledExpandCollapseSummaryButton = styled(StyledExpandCollapseButton)(({ theme }) => {
|
|
320
333
|
const { summaryExpanded } = useCaseViewContext();
|
|
334
|
+
const { rtl } = useDirection();
|
|
321
335
|
return css `
|
|
336
|
+
--half-compact-btn-height: calc(${theme.base['hit-area'].compact} / 2);
|
|
337
|
+
--half-btn-compact-difference: calc(
|
|
338
|
+
(${theme.base['hit-area'].mouse} - ${theme.base['hit-area'].compact}) / 2
|
|
339
|
+
);
|
|
340
|
+
--half-case-icon-compact-difference: calc(
|
|
341
|
+
((4 * ${theme.base.spacing}) - ${theme.base['hit-area'].compact}) / 2
|
|
342
|
+
);
|
|
343
|
+
@media (pointer: coarse) {
|
|
344
|
+
--half-btn-compact-difference: calc(
|
|
345
|
+
(${theme.base['hit-area'].finger} - ${theme.base['hit-area'].compact}) / 2
|
|
346
|
+
);
|
|
347
|
+
}
|
|
322
348
|
position: absolute;
|
|
323
349
|
z-index: 1;
|
|
324
|
-
bottom: 0;
|
|
325
|
-
inset-inline-start: ${summaryExpanded ? 'calc(100% - 0.75rem)' : '0'};
|
|
326
|
-
border-radius: ${summaryExpanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};
|
|
327
350
|
box-shadow: ${theme.base.shadow.low};
|
|
328
|
-
border: none;
|
|
329
|
-
opacity: 0;
|
|
330
351
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
352
|
+
${summaryExpanded
|
|
353
|
+
? css `
|
|
354
|
+
inset-block-start: calc(2 * ${theme.base.spacing} + var(--half-btn-compact-difference));
|
|
355
|
+
inset-inline-start: calc(100% - var(--half-compact-btn-height));
|
|
356
|
+
`
|
|
357
|
+
: css `
|
|
358
|
+
inset-block-end: calc(var(--half-compact-btn-height) * -1);
|
|
359
|
+
inset-inline-start: calc(
|
|
360
|
+
2 * ${theme.base.spacing} + var(--half-case-icon-compact-difference)
|
|
361
|
+
);
|
|
362
|
+
`}
|
|
334
363
|
|
|
335
364
|
${StyledIcon} {
|
|
336
|
-
width: 1.5rem;
|
|
337
|
-
height: 1.5rem;
|
|
338
365
|
${summaryExpanded
|
|
339
366
|
? css `
|
|
340
|
-
transform: rotate(0);
|
|
367
|
+
transform: rotate(${rtl ? '180deg' : '0'});
|
|
341
368
|
`
|
|
342
369
|
: css `
|
|
343
|
-
transform: rotate(
|
|
370
|
+
transform: rotate(-90deg);
|
|
344
371
|
`}
|
|
345
372
|
}
|
|
346
373
|
`;
|
|
347
374
|
});
|
|
348
|
-
|
|
349
|
-
export const StyledCaseSummary = styled.div((
|
|
375
|
+
StyledExpandCollapseSummaryButton.defaultProps = defaultThemeProp;
|
|
376
|
+
export const StyledCaseSummary = styled.div(() => {
|
|
350
377
|
const { summaryExpanded, aboveMD } = useCaseViewContext();
|
|
351
|
-
const { base: { spacing } } = theme;
|
|
352
378
|
return css `
|
|
353
379
|
position: relative;
|
|
354
380
|
height: 100%;
|
|
355
|
-
|
|
356
381
|
${aboveMD &&
|
|
382
|
+
summaryExpanded &&
|
|
357
383
|
css `
|
|
358
|
-
|
|
359
|
-
? css `
|
|
360
|
-
width: 25rem;
|
|
361
|
-
|
|
362
|
-
&:focus-within,
|
|
363
|
-
&:hover {
|
|
364
|
-
&::after {
|
|
365
|
-
content: '';
|
|
366
|
-
position: absolute;
|
|
367
|
-
top: 0;
|
|
368
|
-
bottom: 0;
|
|
369
|
-
inset-inline-start: 100%;
|
|
370
|
-
width: 0.75rem;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
${StyledExpandCollapseButton} {
|
|
374
|
-
opacity: 1;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
`
|
|
378
|
-
: css `
|
|
379
|
-
width: 100%;
|
|
380
|
-
|
|
381
|
-
${StyledExpandCollapseButton} {
|
|
382
|
-
opacity: 1;
|
|
383
|
-
transform: translateY(50%);
|
|
384
|
-
margin-inline-start: calc(2 * ${spacing});
|
|
385
|
-
border-radius: 50%;
|
|
386
|
-
|
|
387
|
-
svg {
|
|
388
|
-
transform: rotate(-90deg);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
`}
|
|
384
|
+
width: 25rem;
|
|
392
385
|
`}
|
|
393
386
|
`;
|
|
394
387
|
});
|
|
395
388
|
export const StyledWorkArea = styled.div(({ theme }) => {
|
|
396
|
-
const { summaryExpanded, aboveMD, intelligentGuidance } = useCaseViewContext();
|
|
389
|
+
const { summaryExpanded, aboveMD, intelligentGuidance, stages, tasks } = useCaseViewContext();
|
|
397
390
|
let pbeRem = 0;
|
|
398
391
|
if (intelligentGuidance) {
|
|
399
392
|
pbeRem = aboveMD && !summaryExpanded ? 4 : 6;
|
|
@@ -421,27 +414,81 @@ export const StyledWorkArea = styled.div(({ theme }) => {
|
|
|
421
414
|
/* Accounts for collapsed intelligentGuidance bubble covering work area content when fully scrolled. */
|
|
422
415
|
padding-block-end: ${pbeRem}rem;
|
|
423
416
|
`}
|
|
417
|
+
|
|
418
|
+
${stages &&
|
|
419
|
+
tasks &&
|
|
420
|
+
css `
|
|
421
|
+
${StyledStages} {
|
|
422
|
+
border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
423
|
+
|
|
424
|
+
&,
|
|
425
|
+
> ${StyledStage}:first-child {
|
|
426
|
+
border-end-start-radius: 0;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
&,
|
|
430
|
+
> ${StyledStage}:last-child {
|
|
431
|
+
border-end-end-radius: 0;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
${StyledCard}${StyledTasks} {
|
|
436
|
+
margin-block-start: calc(-2 * ${theme.base.spacing});
|
|
437
|
+
border-start-start-radius: 0;
|
|
438
|
+
border-start-end-radius: 0;
|
|
439
|
+
}
|
|
440
|
+
`}
|
|
424
441
|
`;
|
|
425
442
|
});
|
|
426
443
|
StyledWorkArea.defaultProps = defaultThemeProp;
|
|
427
|
-
export const
|
|
444
|
+
export const StyledUtilitiesHeading = styled(Text) ``;
|
|
445
|
+
export const StyledExpandCollapseUtilitiesButton = styled(StyledExpandCollapseButton)(() => {
|
|
446
|
+
const { utilitiesExpanded } = useCaseViewContext();
|
|
447
|
+
const { rtl } = useDirection();
|
|
428
448
|
return css `
|
|
429
|
-
|
|
430
|
-
margin-inline:
|
|
449
|
+
/* Centers button over the utilities summary */
|
|
450
|
+
margin-inline-end: ${utilitiesExpanded && '0.625rem'};
|
|
451
|
+
|
|
452
|
+
${StyledIcon} {
|
|
453
|
+
${utilitiesExpanded !== rtl
|
|
454
|
+
? css `
|
|
455
|
+
transform: rotate(180deg);
|
|
456
|
+
`
|
|
457
|
+
: css `
|
|
458
|
+
transform: rotate(0);
|
|
459
|
+
`}
|
|
460
|
+
}
|
|
431
461
|
`;
|
|
432
462
|
});
|
|
433
|
-
|
|
463
|
+
StyledExpandCollapseUtilitiesButton.defaultProps = defaultThemeProp;
|
|
434
464
|
export const StyledUtilities = styled.div(({ theme }) => {
|
|
435
|
-
const { utilitiesExpanded, aboveLG } = useCaseViewContext();
|
|
465
|
+
const { utilitiesExpanded, aboveLG, aboveMD } = useCaseViewContext();
|
|
436
466
|
return css `
|
|
437
467
|
height: max-content;
|
|
438
468
|
margin-block: calc(2 * ${theme.base.spacing});
|
|
439
469
|
|
|
470
|
+
/* If utilities are in an expanded drawer. */
|
|
471
|
+
${utilitiesExpanded &&
|
|
472
|
+
aboveMD &&
|
|
473
|
+
!aboveLG &&
|
|
474
|
+
css `
|
|
475
|
+
/* Maintains the column width to avoid page content shift. */
|
|
476
|
+
visibility: hidden;
|
|
477
|
+
`}
|
|
478
|
+
|
|
440
479
|
${aboveLG &&
|
|
441
480
|
utilitiesExpanded &&
|
|
442
481
|
css `
|
|
443
482
|
width: 25rem;
|
|
444
483
|
`}
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
/* Selects the h2 in the utilities column, not the drawer. */
|
|
487
|
+
${StyledUtilitiesHeading} {
|
|
488
|
+
/* Hide the utilities h2 under certain conditions.*/
|
|
489
|
+
${((aboveMD && !utilitiesExpanded) || (aboveMD && utilitiesExpanded && !aboveLG)) &&
|
|
490
|
+
hideVisually()}
|
|
491
|
+
}
|
|
445
492
|
`;
|
|
446
493
|
});
|
|
447
494
|
StyledUtilities.defaultProps = defaultThemeProp;
|
|
@@ -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,EAAgB,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,IAAI,EACJ,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,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,EAER,cAAc,EACd,UAAU,EACV,WAAW,EACX,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAEhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEpD,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,cAAc,CAAC,CAC5D,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACrB,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEvF,OAAO,GAAG,CAAA;QACN,OAAO;QACP,CAAC,CAAC,GAAG,CAAA;;WAEF;QACH,CAAC,CAAC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M,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;MAI3C,YAAY;;CAEjB,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css, DefaultTheme } from 'styled-components';\nimport {\n getContrast,\n hideVisually,\n meetsContrastGuidelines,\n parseToHsl,\n readableColor,\n rgba,\n transparentize\n} from 'polished';\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 FontSize,\n FieldValueList,\n StyledLink,\n readableHue,\n Text\n} from '@pega/cosmos-react-core';\nimport { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';\nimport { colCountChWidth } from '@pega/cosmos-react-work/lib/components/Details/Details.styles';\n\nimport { useCaseViewContext } from './CaseView.context';\n\nconst labelChWidth = 16;\nconst inlineEndButtonOffset = '0.375rem';\n\nexport const StyledCaseSummaryFields = styled.div``;\n\nStyledCaseSummaryFields.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryPrimaryList = styled(FieldValueList)<{ wrapped?: boolean }>(\n ({ theme, wrapped }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n ${wrapped\n ? css`\n grid-template-columns: minmax(0, 1fr);\n `\n : css`\n grid-template-columns: ${labelChWidth}ch 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 }\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 StyledSummaryTabContent = styled(CardContent)(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n const containerWidthCh = colCountChWidth[1].containerWidth;\n const containerWidthMinusLabel = `${containerWidthCh - labelChWidth}ch`;\n\n return css`\n ${StyledSummarySecondaryList} {\n > ${StyledStackedFieldValue} {\n max-width: ${containerWidthCh}ch;\n }\n\n > ${StyledFieldValue} {\n max-width: calc(${containerWidthMinusLabel} - 2 * ${spacing});\n }\n }\n `;\n});\n\nStyledSummaryTabContent.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeader = styled.header(({ theme }) => {\n const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));\n\n return css`\n background-color: ${theme.base.palette['brand-primary']};\n color: ${color};\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n position: relative;\n\n h1:focus-visible {\n outline: transparent;\n box-shadow: ${theme.base.shadow.focus};\n }\n\n ${StyledMenu} {\n color: ${theme.base.palette['foreground-color']};\n z-index: ${theme.base['z-index'].popover + 1};\n }\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseIconWrap = styled.div(({ theme }) => {\n const spacing = theme.base.spacing;\n const borderRadius = theme.base['border-radius'];\n const backgroundColor = tryCatch(() => {\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\n return css`\n background: ${backgroundColor};\n width: calc(4 * ${spacing});\n height: calc(4 * ${spacing});\n border-radius: calc(${borderRadius} / 2);\n margin-block-start: ${spacing};\n\n ${StyledIcon} {\n font-size: calc(2 * ${spacing});\n margin: auto;\n }\n `;\n});\n\nStyledCaseIconWrap.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});\n\nStyledHeaderActions.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderText = styled.hgroup(({ theme }) => {\n const color = readableColor(theme.base.palette['brand-primary']);\n const transparentColor = tryCatch(() => transparentize(0.1, color));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n const idStyle = css`\n color: ${transparentColor};\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 > 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 StyledHeaderBreadcrumbBlock = styled.div<{ breadcrumbWidth?: number }>(\n ({ breadcrumbWidth }) => {\n return css`\n width: ${breadcrumbWidth ? `${breadcrumbWidth}px` : '100%'};\n max-width: 100%;\n `;\n }\n);\n\nexport const StyledCaseHeaderPromotedAction = styled(Button)(({ theme }) => {\n const {\n base: {\n palette: { 'brand-primary': primary, interactive }\n }\n } = theme;\n\n const interactiveUsable = getContrast(primary, interactive) >= 4.5;\n const color = interactiveUsable ? interactive : readableColor(primary);\n let hoverBackground = rgba(color, 0.15);\n\n if (interactiveUsable) {\n hoverBackground = readableHue(hoverBackground, color);\n }\n\n return css`\n --button-background-color: ${primary};\n color: ${color};\n background-color: ${primary};\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 `;\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: inset 0 0 0 0.0625rem ${light}, 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: { 'brand-primary': primary, interactive }\n }\n } = theme;\n\n const interactiveUsable = meetsContrastGuidelines(primary, interactive).AA;\n const color = readableColor(primary);\n const transparentColor = tryCatch(() => transparentize(0.1, color));\n\n return css`\n max-width: 100%;\n min-width: 0;\n\n > ${StyledStackedFieldValue} {\n > ${StyledLabel} {\n color: ${transparentColor};\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, truncate, theme }: { bold?: boolean; truncate?: boolean; theme: DefaultTheme }) => {\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);\n\nStyledHeaderSummaryValue.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryInfo = styled.div(() => {\n const { intelligentGuidance } = useCaseViewContext();\n\n return css`\n overflow: auto;\n flex: 1;\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\nStyledCaseSummaryInfo.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryContainer = styled.div(({ theme }) => {\n return css`\n padding: calc(1.5 * ${theme.base.spacing}) calc(${theme.components.card.padding} * 2);\n `;\n});\n\nStyledCaseSummaryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseButton = styled(Button)(({ theme }) => {\n const { summaryExpanded } = useCaseViewContext();\n\n return css`\n position: absolute;\n z-index: 1;\n bottom: 0;\n inset-inline-start: ${summaryExpanded ? 'calc(100% - 0.75rem)' : '0'};\n border-radius: ${summaryExpanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};\n box-shadow: ${theme.base.shadow.low};\n border: none;\n opacity: 0;\n\n &:focus {\n opacity: 1;\n }\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n ${summaryExpanded\n ? css`\n transform: rotate(0);\n `\n : css`\n transform: rotate(180deg);\n `}\n }\n `;\n});\n\nStyledExpandCollapseButton.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummary = styled.div(({ theme }) => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n const {\n base: { spacing }\n } = theme;\n\n return css`\n position: relative;\n height: 100%;\n\n ${aboveMD &&\n css`\n ${summaryExpanded\n ? css`\n width: 25rem;\n\n &:focus-within,\n &:hover {\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n inset-inline-start: 100%;\n width: 0.75rem;\n }\n\n ${StyledExpandCollapseButton} {\n opacity: 1;\n }\n }\n `\n : css`\n width: 100%;\n\n ${StyledExpandCollapseButton} {\n opacity: 1;\n transform: translateY(50%);\n margin-inline-start: calc(2 * ${spacing});\n border-radius: 50%;\n\n svg {\n transform: rotate(-90deg);\n }\n }\n `}\n `}\n `;\n});\n\nexport const StyledWorkArea = styled.div(({ theme }) => {\n const { summaryExpanded, aboveMD, intelligentGuidance } = 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 * ${theme.base.spacing});\n\n ${aboveMD &&\n css`\n padding: calc(2 * ${theme.base.spacing}) 0;\n\n /* This is required to make scrollStick work. */\n height: max-content;\n\n ${!summaryExpanded &&\n css`\n margin-inline-start: calc(2 * ${theme.base.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});\n\nStyledWorkArea.defaultProps = defaultThemeProp;\n\nexport const StyledUtilToggle = styled.button(({ theme }) => {\n return css`\n color: ${theme.base.palette['foreground-color']};\n margin-inline: auto ${inlineEndButtonOffset};\n `;\n});\n\nStyledUtilToggle.defaultProps = defaultThemeProp;\n\nexport const StyledUtilities = styled.div(({ theme }) => {\n const { utilitiesExpanded, aboveLG } = useCaseViewContext();\n\n return css`\n height: max-content;\n margin-block: calc(2 * ${theme.base.spacing});\n\n ${aboveLG &&\n utilitiesExpanded &&\n css`\n width: 25rem;\n `}\n `;\n});\n\nStyledUtilities.defaultProps = defaultThemeProp;\n\nexport const StyledSummary = styled.div(({ theme }) => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n\n return css`\n top: ${summaryExpanded ? 'var(--top-offset)' : 'var(--appshell-offset, 0)'};\n width: 100%;\n background-color: ${theme.base.palette['primary-background']};\n z-index: ${theme.base['z-index'].popover};\n\n ${aboveMD &&\n summaryExpanded &&\n css`\n height: var(--case-view-height);\n `}\n\n ${aboveMD\n ? css`\n position: sticky;\n `\n : css`\n @media (min-height: ${theme.base.breakpoints.sm}) {\n position: sticky;\n }\n `}\n `;\n});\n\nStyledSummary.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawer = styled.div(({ theme }) => {\n return css`\n min-width: 21.875rem;\n max-width: 31.25rem;\n width: calc((100vw - 31.25rem) / 10 + 21.875rem);\n background-color: ${theme.base.palette['primary-background']};\n height: var(--case-view-height);\n top: var(--top-offset);\n z-index: ${theme.base['z-index'].drawer - 1};\n `;\n});\n\nStyledCaseDrawer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawerContent = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['app-background']};\n padding: calc(2 * ${theme.base.spacing});\n height: 100%;\n overflow: auto;\n `;\n});\n\nStyledCaseDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentUtility = styled.div(({ theme }) => {\n return css`\n min-width: ${theme.base['content-width'].sm};\n max-width: ${theme.base['content-width'].md};\n overflow: auto;\n position: sticky;\n z-index: 1;\n height: var(--case-view-height);\n top: var(--top-offset);\n `;\n});\n\nStyledPersistentUtility.defaultProps = defaultThemeProp;\n\nexport const ScrollStick = styled.div`\n position: sticky;\n top: 0;\n`;\n\nexport const StyledCaseView = styled.div(({ theme }) => {\n const { aboveMD } = 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-color: ${theme.base.palette['app-background']};\n\n ${aboveMD &&\n css`\n ${StyledUtilities}:last-child {\n margin-inline-end: calc(2 * ${theme.base.spacing});\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"]}
|
|
1
|
+
{"version":3,"file":"CaseView.styles.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAgB,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,IAAI,EACJ,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,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,EAER,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACJ,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAEhG,OAAO,EAAE,WAAW,EAAE,YAAY,EA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AK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;;;;;GAM5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGpC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,MAAM,EAAE,OAAO,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAEzC,OAAO,GAAG,CAAA;;;;;wBAKY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;;MAEtD,OAAO;QACT,GAAG,CAAA;QACC,eAAe;sCACe,KAAK,CAAC,IAAI,CAAC,OAAO;;KAEnD;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;MAI3C,YAAY;;CAEjB,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css, DefaultTheme } from 'styled-components';\nimport {\n getContrast,\n hideVisually,\n meetsContrastGuidelines,\n parseToHsl,\n readableColor,\n rgba,\n transparentize\n} from 'polished';\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 FontSize,\n FieldValueList,\n StyledLink,\n readableHue,\n StyledCard,\n Text,\n useDirection\n} from '@pega/cosmos-react-core';\nimport { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';\nimport { colCountChWidth } from '@pega/cosmos-react-work/lib/components/Details/Details.styles';\n\nimport { StyledStage, StyledStages } from '../Stages/Stages.styles';\nimport { StyledTasks } from '../Tasks/Tasks';\n\nimport { useCaseViewContext } from './CaseView.context';\n\nconst labelChWidth = 16;\nconst inlineEndButtonOffset = '0.375rem';\n\nexport const StyledCaseSummaryFields = styled.div``;\n\nStyledCaseSummaryFields.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryPrimaryList = styled(FieldValueList)<{ wrapped?: boolean }>(\n ({ theme, wrapped }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n ${wrapped\n ? css`\n grid-template-columns: minmax(0, 1fr);\n `\n : css`\n grid-template-columns: ${labelChWidth}ch 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 }\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 StyledSummaryTabContent = styled(CardContent)(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n const containerWidthCh = colCountChWidth[1].containerWidth;\n const containerWidthMinusLabel = `${containerWidthCh - labelChWidth}ch`;\n\n return css`\n ${StyledSummarySecondaryList} {\n > ${StyledStackedFieldValue} {\n max-width: ${containerWidthCh}ch;\n }\n\n > ${StyledFieldValue} {\n max-width: calc(${containerWidthMinusLabel} - 2 * ${spacing});\n }\n }\n `;\n});\n\nStyledSummaryTabContent.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeader = styled.header(({ theme }) => {\n const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));\n\n return css`\n background-color: ${theme.base.palette['brand-primary']};\n color: ${color};\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n position: relative;\n\n h1:focus-visible {\n outline: transparent;\n box-shadow: ${theme.base.shadow.focus};\n }\n\n ${StyledMenu} {\n color: ${theme.base.palette['foreground-color']};\n z-index: ${theme.base['z-index'].popover + 1};\n }\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseIconWrap = styled.div(({ theme }) => {\n const spacing = theme.base.spacing;\n const borderRadius = theme.base['border-radius'];\n const backgroundColor = tryCatch(() => {\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\n return css`\n background: ${backgroundColor};\n width: calc(4 * ${spacing});\n height: calc(4 * ${spacing});\n border-radius: calc(${borderRadius} / 2);\n margin-block-start: ${spacing};\n\n ${StyledIcon} {\n font-size: calc(2 * ${spacing});\n margin: auto;\n }\n `;\n});\n\nStyledCaseIconWrap.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});\n\nStyledHeaderActions.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHeaderText = styled.hgroup(({ theme }) => {\n const color = readableColor(theme.base.palette['brand-primary']);\n const transparentColor = tryCatch(() => transparentize(0.1, color));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n const idStyle = css`\n color: ${transparentColor};\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 > 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 StyledHeaderBreadcrumbBlock = styled.div<{ breadcrumbWidth?: number }>(\n ({ breadcrumbWidth }) => {\n return css`\n width: ${breadcrumbWidth ? `${breadcrumbWidth}px` : '100%'};\n max-width: 100%;\n `;\n }\n);\n\nexport const StyledCaseHeaderPromotedAction = styled(Button)(({ theme }) => {\n const {\n base: {\n palette: { 'brand-primary': primary, interactive }\n }\n } = theme;\n\n const interactiveUsable = getContrast(primary, interactive) >= 4.5;\n const color = interactiveUsable ? interactive : readableColor(primary);\n let hoverBackground = rgba(color, 0.15);\n\n if (interactiveUsable) {\n hoverBackground = readableHue(hoverBackground, color);\n }\n\n return css`\n --button-background-color: ${primary};\n color: ${color};\n background-color: ${primary};\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 `;\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: inset 0 0 0 0.0625rem ${light}, 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: { 'brand-primary': primary, interactive }\n }\n } = theme;\n\n const interactiveUsable = meetsContrastGuidelines(primary, interactive).AA;\n const color = readableColor(primary);\n const transparentColor = tryCatch(() => transparentize(0.1, color));\n\n return css`\n max-width: 100%;\n min-width: 0;\n\n > ${StyledStackedFieldValue} {\n > ${StyledLabel} {\n color: ${transparentColor};\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, truncate, theme }: { bold?: boolean; truncate?: boolean; theme: DefaultTheme }) => {\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);\n\nStyledHeaderSummaryValue.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryInfo = styled.div(() => {\n const { intelligentGuidance } = useCaseViewContext();\n\n return css`\n overflow: auto;\n flex: 1;\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\nStyledCaseSummaryInfo.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummaryContainer = styled.div(({ theme }) => {\n return css`\n padding: calc(1.5 * ${theme.base.spacing}) calc(${theme.components.card.padding} * 2);\n `;\n});\n\nStyledCaseSummaryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledExpandCollapseButton = styled(Button)(() => {\n return css`\n border: none;\n\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 const { rtl } = useDirection();\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 ${StyledIcon} {\n ${summaryExpanded\n ? css`\n transform: rotate(${rtl ? '180deg' : '0'});\n `\n : css`\n transform: rotate(-90deg);\n `}\n }\n `;\n});\n\nStyledExpandCollapseSummaryButton.defaultProps = defaultThemeProp;\n\nexport const StyledCaseSummary = styled.div(() => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n\n return css`\n position: relative;\n height: 100%;\n ${aboveMD &&\n summaryExpanded &&\n css`\n width: 25rem;\n `}\n `;\n});\n\nexport const StyledWorkArea = styled.div(({ theme }) => {\n const { summaryExpanded, aboveMD, intelligentGuidance, stages, tasks } = 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 * ${theme.base.spacing});\n\n ${aboveMD &&\n css`\n padding: calc(2 * ${theme.base.spacing}) 0;\n\n /* This is required to make scrollStick work. */\n height: max-content;\n\n ${!summaryExpanded &&\n css`\n margin-inline-start: calc(2 * ${theme.base.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 ${stages &&\n tasks &&\n css`\n ${StyledStages} {\n border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n\n &,\n > ${StyledStage}:first-child {\n border-end-start-radius: 0;\n }\n\n &,\n > ${StyledStage}:last-child {\n border-end-end-radius: 0;\n }\n }\n\n ${StyledCard}${StyledTasks} {\n margin-block-start: calc(-2 * ${theme.base.spacing});\n border-start-start-radius: 0;\n border-start-end-radius: 0;\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 const { rtl } = useDirection();\n\n return css`\n /* Centers button over the utilities summary */\n margin-inline-end: ${utilitiesExpanded && '0.625rem'};\n\n ${StyledIcon} {\n ${utilitiesExpanded !== rtl\n ? css`\n transform: rotate(180deg);\n `\n : css`\n transform: rotate(0);\n `}\n }\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 /* 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(({ theme }) => {\n const { summaryExpanded, aboveMD } = useCaseViewContext();\n\n return css`\n top: ${summaryExpanded ? 'var(--top-offset)' : 'var(--appshell-offset, 0)'};\n width: 100%;\n background-color: ${theme.base.palette['primary-background']};\n z-index: ${theme.base['z-index'].popover};\n\n ${aboveMD &&\n summaryExpanded &&\n css`\n height: var(--case-view-height);\n `}\n\n ${aboveMD\n ? css`\n position: sticky;\n `\n : css`\n @media (min-height: ${theme.base.breakpoints.sm}) {\n position: sticky;\n }\n `}\n `;\n});\n\nStyledSummary.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawer = styled.div(({ theme }) => {\n return css`\n min-width: 21.875rem;\n max-width: 31.25rem;\n width: calc((100vw - 31.25rem) / 10 + 21.875rem);\n background-color: ${theme.base.palette['primary-background']};\n height: var(--case-view-height);\n top: var(--top-offset);\n z-index: ${theme.base['z-index'].drawer - 1};\n `;\n});\n\nStyledCaseDrawer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawerContent = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['app-background']};\n padding: calc(2 * ${theme.base.spacing});\n height: 100%;\n overflow: auto;\n `;\n});\n\nStyledCaseDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentUtility = styled.div(({ theme }) => {\n return css`\n min-width: ${theme.base['content-width'].sm};\n max-width: ${theme.base['content-width'].md};\n overflow: auto;\n position: sticky;\n z-index: 1;\n height: var(--case-view-height);\n top: var(--top-offset);\n `;\n});\n\nStyledPersistentUtility.defaultProps = defaultThemeProp;\n\nexport const ScrollStick = styled.div`\n position: sticky;\n top: 0;\n`;\n\nexport const StyledCaseView = styled.div(({ theme }) => {\n const { aboveMD } = 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-color: ${theme.base.palette['app-background']};\n\n ${aboveMD &&\n css`\n ${StyledUtilities}:last-child {\n margin-inline-end: calc(2 * ${theme.base.spacing});\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"]}
|
|
@@ -82,9 +82,8 @@ export interface CaseViewProps extends NoChildrenProp, BaseProps, TestIdProp {
|
|
|
82
82
|
/** Callback to toggle the utilities. */
|
|
83
83
|
onToggleUtilities?: () => void;
|
|
84
84
|
}
|
|
85
|
-
export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'tabs' | 'summaryExpanded' | 'summaryFields' | 'onToggleSummary' | 'utilitiesExpanded' | 'persistentUtility' | 'intelligentGuidance'> {
|
|
85
|
+
export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'tabs' | 'summaryExpanded' | 'summaryFields' | 'onToggleSummary' | 'utilitiesExpanded' | 'stages' | 'tasks' | 'persistentUtility' | 'intelligentGuidance'> {
|
|
86
86
|
testIds: Partial<ReturnType<typeof getCaseViewTestIds>>;
|
|
87
|
-
summaryId: string;
|
|
88
87
|
aboveSM: boolean;
|
|
89
88
|
aboveMD: boolean;
|
|
90
89
|
aboveLG: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EACL,GAAG,EACH,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,MAAM,EACN,SAAS,EACT,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACtC,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GA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A2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAE1D,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAEhC,iCAAiC;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,qEAAqE;IACrE,qBAAqB,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE7E;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAOhC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CACV,aAAa,EACX,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,MAAM,GACN,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,CACxB;IACD,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;IACxD,
|
|
1
|
+
{"version":3,"file":"CaseView.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EACL,GAAG,EACH,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,aAAa,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AkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,MAAM,GACN,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,QAAQ,GACR,OAAO,GACP,mBAAmB,GACnB,qBAAqB,CACxB;IACD,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,YAAY,CAAC;CAC5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.types.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, ReactNode, MouseEvent } from 'react';\n\nimport {\n Tab,\n NoChildrenProp,\n FieldValueListItemProps,\n ForwardProps,\n MenuItemProps,\n Action,\n BaseProps,\n TestIdProp\n} from '@pega/cosmos-react-core';\n\nimport type { getCaseViewTestIds } from './CaseView.test-ids';\n\nexport type CaseSummaryFieldsProps = {\n primary?: SummaryField[];\n secondary?: SummaryField[];\n inSummaryPanel?: boolean;\n};\n\nexport type SummaryField = {\n name: FieldValueListItemProps['name'];\n value: FieldValueListItemProps['value'];\n simpleValue?: string | number | ReactNode;\n variant?: FieldValueListItemProps['variant'];\n};\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps, TestIdProp {\n /** A unique identifier for the case instance. */\n caseId: string;\n\n /** Text to quickly identify a case instance. */\n heading: string;\n\n /** Supplemental text to identify a case instance. */\n subheading?: string;\n\n /** @internal */\n caseLink?: CaseViewContextValue['caseLink'];\n\n /** A set of Link props representing the case parents, rendered as Breadcrumbs. */\n parentCases?: MenuItemProps[];\n\n /** An icon to serve as a visual for the CaseView. */\n icon?: ReactElement;\n\n /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */\n followed?: boolean;\n\n /** Called when user chooses to follow or unfollow the case. Use this to update followed. */\n onFollowedChange?: (following: boolean) => void;\n\n /** Case level actions available in an action menu. */\n actions?: Action[];\n\n /** Visually promoted case level actions available outside the menu. */\n promotedActions?: Action[];\n\n /** A callback for when the edit button is clicked */\n onEdit?: () => void;\n\n /** Field data to render in summary areas. */\n summaryFields: CaseSummaryFieldsProps;\n\n /**\n * Determines the layout state of the summary region.\n * @default true\n */\n summaryExpanded?: boolean;\n\n /** Callback to toggle the case summary's layout. */\n onToggleSummary?: () => void;\n\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n currentTabId: string;\n };\n\n /** A region within the center column that is controlled by tabs in CaseSummary. */\n tabContent?: { content: ReactNode; id: string }[];\n\n /** A region to hold a Stages component. */\n stages?: ReactNode;\n\n /** A region to hold a Tasks component. */\n tasks?: ReactNode;\n\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n\n /** A region to the right reserved for persistent utilities. */\n persistentUtility?: { content: ReactNode; title: string };\n\n /** Provide an instance of IntelligentGuidance to be rendered for a case. */\n intelligentGuidance?: ReactNode;\n\n /** A region for case widgets. */\n utilities?: ReactNode;\n\n /** An indicator of case widgets when the utilities are collapsed. */\n utilitiesSummaryItems?: { iconName: string; name: string; count?: number }[];\n\n /**\n * Determines the layout state of the utilities.\n * @default true\n */\n utilitiesExpanded?: boolean;\n\n /** Callback to toggle the utilities. */\n onToggleUtilities?: () => void;\n\n /**\n * Indicates CaseView is rendered within a CasePreview.\n * @internal\n */\n isPreview?: boolean;\n}\n\nexport interface CaseViewContextValue\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'tabs'\n | 'summaryExpanded'\n | 'summaryFields'\n | 'onToggleSummary'\n | 'utilitiesExpanded'\n | 'persistentUtility'\n | 'intelligentGuidance'\n > {\n testIds: Partial<ReturnType<typeof getCaseViewTestIds>>;\n
|
|
1
|
+
{"version":3,"file":"CaseView.types.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, ReactNode, MouseEvent } from 'react';\n\nimport {\n Tab,\n NoChildrenProp,\n FieldValueListItemProps,\n ForwardProps,\n MenuItemProps,\n Action,\n BaseProps,\n TestIdProp\n} from '@pega/cosmos-react-core';\n\nimport type { getCaseViewTestIds } from './CaseView.test-ids';\n\nexport type CaseSummaryFieldsProps = {\n primary?: SummaryField[];\n secondary?: SummaryField[];\n inSummaryPanel?: boolean;\n};\n\nexport type SummaryField = {\n name: FieldValueListItemProps['name'];\n value: FieldValueListItemProps['value'];\n simpleValue?: string | number | ReactNode;\n variant?: FieldValueListItemProps['variant'];\n};\n\nexport interface CaseViewProps extends NoChildrenProp, BaseProps, TestIdProp {\n /** A unique identifier for the case instance. */\n caseId: string;\n\n /** Text to quickly identify a case instance. */\n heading: string;\n\n /** Supplemental text to identify a case instance. */\n subheading?: string;\n\n /** @internal */\n caseLink?: CaseViewContextValue['caseLink'];\n\n /** A set of Link props representing the case parents, rendered as Breadcrumbs. */\n parentCases?: MenuItemProps[];\n\n /** An icon to serve as a visual for the CaseView. */\n icon?: ReactElement;\n\n /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */\n followed?: boolean;\n\n /** Called when user chooses to follow or unfollow the case. Use this to update followed. */\n onFollowedChange?: (following: boolean) => void;\n\n /** Case level actions available in an action menu. */\n actions?: Action[];\n\n /** Visually promoted case level actions available outside the menu. */\n promotedActions?: Action[];\n\n /** A callback for when the edit button is clicked */\n onEdit?: () => void;\n\n /** Field data to render in summary areas. */\n summaryFields: CaseSummaryFieldsProps;\n\n /**\n * Determines the layout state of the summary region.\n * @default true\n */\n summaryExpanded?: boolean;\n\n /** Callback to toggle the case summary's layout. */\n onToggleSummary?: () => void;\n\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n currentTabId: string;\n };\n\n /** A region within the center column that is controlled by tabs in CaseSummary. */\n tabContent?: { content: ReactNode; id: string }[];\n\n /** A region to hold a Stages component. */\n stages?: ReactNode;\n\n /** A region to hold a Tasks component. */\n tasks?: ReactNode;\n\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n\n /** A region to the right reserved for persistent utilities. */\n persistentUtility?: { content: ReactNode; title: string };\n\n /** Provide an instance of IntelligentGuidance to be rendered for a case. */\n intelligentGuidance?: ReactNode;\n\n /** A region for case widgets. */\n utilities?: ReactNode;\n\n /** An indicator of case widgets when the utilities are collapsed. */\n utilitiesSummaryItems?: { iconName: string; name: string; count?: number }[];\n\n /**\n * Determines the layout state of the utilities.\n * @default true\n */\n utilitiesExpanded?: boolean;\n\n /** Callback to toggle the utilities. */\n onToggleUtilities?: () => void;\n\n /**\n * Indicates CaseView is rendered within a CasePreview.\n * @internal\n */\n isPreview?: boolean;\n}\n\nexport interface CaseViewContextValue\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'tabs'\n | 'summaryExpanded'\n | 'summaryFields'\n | 'onToggleSummary'\n | 'utilitiesExpanded'\n | 'stages'\n | 'tasks'\n | 'persistentUtility'\n | 'intelligentGuidance'\n > {\n testIds: Partial<ReturnType<typeof getCaseViewTestIds>>;\n aboveSM: boolean;\n aboveMD: boolean;\n aboveLG: boolean;\n aboveXL: boolean;\n isPreview: boolean;\n caseLink?: { href: string } & ForwardProps;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Predictions.d.ts","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAYb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,gBAAoC,MAAM,qBAAqB,CAAC;AAsFvE,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"Predictions.d.ts","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAYb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,gBAAoC,MAAM,qBAAqB,CAAC;AAsFvE,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAqCnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -48,7 +48,7 @@ const Predictions = forwardRef(({ count, items, progress, ...restProps }, ref) =
|
|
|
48
48
|
count
|
|
49
49
|
});
|
|
50
50
|
}, [items, progress, count]);
|
|
51
|
-
return (_jsx(PredictionsList, { ...restProps, ref: ref, name: t('predictions'), icon: 'polaris', count: count, items: items?.slice(0, 3), progress: progress, onViewAll: () => {
|
|
51
|
+
return (_jsx(PredictionsList, { ...restProps, ref: ref, name: t('predictions'), headingTag: 'h3', icon: 'polaris', count: count, items: items?.slice(0, 3), progress: progress, onViewAll: () => {
|
|
52
52
|
viewAllModalRef.current = create(PredictionsViewAllModal, {
|
|
53
53
|
items,
|
|
54
54
|
progress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Predictions.js","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,SAAS,E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,MAAM,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAAC;IACrC,MAAM,eAAe,GAAG,MAAM,EAAkC,CAAC;IAEjE,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC;YAC9B,KAAK;YACL,QAAQ;YACR,KAAK;SACN,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,KAAC,eAAe,OACV,SAAS,EACb,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,EACtB,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EACzB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,GAAG,EAAE;YACd,eAAe,CAAC,OAAO,GAAG,MAAM,CAAC,uBAAuB,EAAE;gBACxD,KAAK;gBACL,QAAQ;gBACR,KAAK;aACN,CAAC,CAAC;QACL,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n FunctionComponent,\n MouseEvent,\n PropsWithoutRef,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\n\nimport {\n ForwardProps,\n registerIcon,\n useI18n,\n Modal,\n SummaryListProps,\n useModalManager,\n SummaryListItem,\n InfoDialog,\n ModalMethods,\n StyledLabel,\n Text,\n SummaryList\n} from '@pega/cosmos-react-core';\nimport * as polarisIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris.icon';\nimport * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';\n\nimport PredictionsProps, { PredictionItem } from './Predictions.types';\n\nregisterIcon(polarisIcon, informationIcon);\n\nconst PredictionsList: FC<\n PredictionsProps & Pick<SummaryListProps, 'onViewAll' | 'name' | 'icon'> & ForwardProps\n> = forwardRef(\n (\n {\n items: itemsProp,\n progress,\n ...restProps\n }: PropsWithoutRef<PredictionsProps & Pick<SummaryListProps, 'onViewAll' | 'name' | 'icon'>>,\n ref: PredictionsProps['ref']\n ) => {\n const t = useI18n();\n const [currentItemIdTarget, setCurrentItemIdTarget] = useState<\n | {\n id: PredictionItem['id'];\n target: HTMLButtonElement | HTMLAnchorElement | HTMLInputElement;\n }\n | undefined\n >();\n const currentItem = itemsProp?.find(({ id }) => id === currentItemIdTarget?.id);\n\n const items: SummaryListItem[] = useMemo(\n () =>\n (itemsProp ?? []).map(item => ({\n id: item.id,\n primary: <StyledLabel forwardedAs='span'>{item.label}</StyledLabel>,\n secondary: (\n <Text variant='h1' as='span'>\n {item.value}\n </Text>\n ),\n overflowStrategy: 'ellipsis',\n actions: item.additionalInfo\n ? [\n {\n id: item.id,\n text: t('learn_more'),\n icon: 'information',\n onClick: (\n id: string,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => {\n setCurrentItemIdTarget({\n id: item.id,\n target: e.currentTarget\n });\n }\n }\n ]\n : undefined\n })),\n [itemsProp]\n );\n\n return (\n <>\n <SummaryList {...restProps} loading={progress} ref={ref} items={items} />\n {currentItemIdTarget && currentItem?.additionalInfo && (\n <InfoDialog\n heading={currentItem.label}\n target={currentItemIdTarget.target}\n onDismiss={() => {\n setCurrentItemIdTarget(undefined);\n }}\n >\n {currentItem.additionalInfo}\n </InfoDialog>\n )}\n </>\n );\n }\n);\n\nconst PredictionsViewAllModal = ({ count, progress, ...restProps }: PredictionsProps) => {\n const t = useI18n();\n return (\n <Modal heading={t('all_predictions')} count={count} progress={progress}>\n <PredictionsList {...restProps} />\n </Modal>\n );\n};\n\nconst Predictions: FunctionComponent<PredictionsProps & ForwardProps> = forwardRef(\n (\n { count, items, progress, ...restProps }: PropsWithoutRef<PredictionsProps>,\n ref: PredictionsProps['ref']\n ) => {\n const t = useI18n();\n const { create } = useModalManager();\n const viewAllModalRef = useRef<ModalMethods<PredictionsProps>>();\n\n useEffect(() => {\n viewAllModalRef.current?.update({\n items,\n progress,\n count\n });\n }, [items, progress, count]);\n\n return (\n <PredictionsList\n {...restProps}\n ref={ref}\n name={t('predictions')}\n icon='polaris'\n count={count}\n items={items?.slice(0, 3)}\n progress={progress}\n onViewAll={() => {\n viewAllModalRef.current = create(PredictionsViewAllModal, {\n items,\n progress,\n count\n });\n }}\n />\n );\n }\n);\n\nexport default Predictions;\n"]}
|
|
1
|
+
{"version":3,"file":"Predictions.js","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,YAAY,EACZ,OAAO,EACP,KAAK,EAEL,eAAe,EAEf,UAAU,EAEV,WAAW,EACX,IAAI,EACJ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,WAAW,MAAM,gEAAgE,CAAC;AAC9F,OAAO,KAAK,eAAe,MAAM,oEAAoE,CAAC;AAItG,YAAY,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;AAE3C,MAAM,eAAe,GAEjB,UAAU,CACZ,CACE,EACE,KAAK,EAAE,SAAS,EAChB,QAAQ,EACR,GAAG,SAAS,EAC8E,EAC5F,GAA4B,EAC5B,EAAE;IACF,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,EAM3D,CAAC;IACJ,MAAM,WAAW,GAAG,SAAS,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAEhF,MAAM,KAAK,GAAsB,OAAO,CACtC,GAAG,EAAE,CACH,CAAC,SAAS,IAAI,EAAE,CAAC,CA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ardRef,\n FunctionComponent,\n MouseEvent,\n PropsWithoutRef,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\n\nimport {\n ForwardProps,\n registerIcon,\n useI18n,\n Modal,\n SummaryListProps,\n useModalManager,\n SummaryListItem,\n InfoDialog,\n ModalMethods,\n StyledLabel,\n Text,\n SummaryList\n} from '@pega/cosmos-react-core';\nimport * as polarisIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris.icon';\nimport * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';\n\nimport PredictionsProps, { PredictionItem } from './Predictions.types';\n\nregisterIcon(polarisIcon, informationIcon);\n\nconst PredictionsList: FC<\n PredictionsProps & Pick<SummaryListProps, 'onViewAll' | 'name' | 'icon'> & ForwardProps\n> = forwardRef(\n (\n {\n items: itemsProp,\n progress,\n ...restProps\n }: PropsWithoutRef<PredictionsProps & Pick<SummaryListProps, 'onViewAll' | 'name' | 'icon'>>,\n ref: PredictionsProps['ref']\n ) => {\n const t = useI18n();\n const [currentItemIdTarget, setCurrentItemIdTarget] = useState<\n | {\n id: PredictionItem['id'];\n target: HTMLButtonElement | HTMLAnchorElement | HTMLInputElement;\n }\n | undefined\n >();\n const currentItem = itemsProp?.find(({ id }) => id === currentItemIdTarget?.id);\n\n const items: SummaryListItem[] = useMemo(\n () =>\n (itemsProp ?? []).map(item => ({\n id: item.id,\n primary: <StyledLabel forwardedAs='span'>{item.label}</StyledLabel>,\n secondary: (\n <Text variant='h1' as='span'>\n {item.value}\n </Text>\n ),\n overflowStrategy: 'ellipsis',\n actions: item.additionalInfo\n ? [\n {\n id: item.id,\n text: t('learn_more'),\n icon: 'information',\n onClick: (\n id: string,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => {\n setCurrentItemIdTarget({\n id: item.id,\n target: e.currentTarget\n });\n }\n }\n ]\n : undefined\n })),\n [itemsProp]\n );\n\n return (\n <>\n <SummaryList {...restProps} loading={progress} ref={ref} items={items} />\n {currentItemIdTarget && currentItem?.additionalInfo && (\n <InfoDialog\n heading={currentItem.label}\n target={currentItemIdTarget.target}\n onDismiss={() => {\n setCurrentItemIdTarget(undefined);\n }}\n >\n {currentItem.additionalInfo}\n </InfoDialog>\n )}\n </>\n );\n }\n);\n\nconst PredictionsViewAllModal = ({ count, progress, ...restProps }: PredictionsProps) => {\n const t = useI18n();\n return (\n <Modal heading={t('all_predictions')} count={count} progress={progress}>\n <PredictionsList {...restProps} />\n </Modal>\n );\n};\n\nconst Predictions: FunctionComponent<PredictionsProps & ForwardProps> = forwardRef(\n (\n { count, items, progress, ...restProps }: PropsWithoutRef<PredictionsProps>,\n ref: PredictionsProps['ref']\n ) => {\n const t = useI18n();\n const { create } = useModalManager();\n const viewAllModalRef = useRef<ModalMethods<PredictionsProps>>();\n\n useEffect(() => {\n viewAllModalRef.current?.update({\n items,\n progress,\n count\n });\n }, [items, progress, count]);\n\n return (\n <PredictionsList\n {...restProps}\n ref={ref}\n name={t('predictions')}\n headingTag='h3'\n icon='polaris'\n count={count}\n items={items?.slice(0, 3)}\n progress={progress}\n onViewAll={() => {\n viewAllModalRef.current = create(PredictionsViewAllModal, {\n items,\n progress,\n count\n });\n }}\n />\n );\n }\n);\n\nexport default Predictions;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stakeholders.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAmBf,OAAO,KAAK,EAAU,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAE5F,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAmBpE,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"Stakeholders.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAmBf,OAAO,KAAK,EAAU,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAE5F,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAmBpE,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAqUrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -198,7 +198,7 @@ const Stakeholders = forwardRef(({ items: itemsProp, count, loading, onAddNew, f
|
|
|
198
198
|
if (!popoverTarget)
|
|
199
199
|
form.onAfterClose?.();
|
|
200
200
|
}, [popoverTarget]);
|
|
201
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledStakeholders, { ...restProps, ref: ref, icon: 'person', name: t('view_stakeholders'), loading: loading, count: count, error: error, items: useMemo(() => mergeItemActions(itemsProp.slice(0, 3)), [mergeItemActions, itemsProp]), actions: onAddNew
|
|
201
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledStakeholders, { ...restProps, ref: ref, icon: 'person', name: t('view_stakeholders'), headingTag: 'h3', loading: loading, count: count, error: error, items: useMemo(() => mergeItemActions(itemsProp.slice(0, 3)), [mergeItemActions, itemsProp]), actions: onAddNew
|
|
202
202
|
? [
|
|
203
203
|
{
|
|
204
204
|
text: t('add'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stakeholders.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EAER,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EACL,WAAW,EACX,OAAO,EAEP,MAAM,EACN,OAAO,EACP,KAAK,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S,EACb,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC5B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,OAAO,CACZ,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAC7C,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAC9B,EACD,OAAO,EACL,QAAQ;oBACN,CAAC,CAAC;wBACE;4BACE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;4BACd,EAAE,EAAE,SAAS;4BACb,IAAI,EAAE,MAAM;4BACZ,OAAO;gCACL,OAAO,CAAC,KAAK,CAAC,CAAC;gCACf,QAAQ,EAAE,EAAE,CAAC;4BACf,CAAC;yBACF;qBACF;oBACH,CAAC,CAAC,SAAS,EAEf,SAAS,EACP,SAAS,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC;oBAC7B,CAAC,CAAC,GAAG,EAAE;wBACH,OAAO,CAAC,SAAS,CAAC,CAAC;wBACnB,SAAS,EAAE,EAAE,CAAC;oBAChB,CAAC;oBACH,CAAC,CAAC,SAAS,GAEf,EACD,aAAa,IAAI,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,IAChE,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useRef,\n useEffect,\n useMemo,\n useState,\n ReactNode,\n useCallback\n} from 'react';\nimport styled from 'styled-components';\nimport { createPortal } from 'react-dom';\n\nimport {\n SummaryList,\n useI18n,\n ModalMethods,\n Button,\n ViewAll,\n Modal,\n Popover,\n Flex,\n Text,\n useModalManager,\n useOuterEvent,\n Progress,\n useAfterInitialEffect\n} from '@pega/cosmos-react-core';\nimport type { Action, ForwardProps, ModalProps, OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { Role, StakeholdersProps } from './Stakeholders.types';\nimport StakeholderForm from './StakeholderForm';\n\nconst StyledStakeholders = styled(SummaryList)``;\n\nconst StyledEditFormWrap = styled.div`\n position: relative;\n min-height: 8rem;\n\n &[aria-busy='true'] > :nth-child(2) {\n visibility: hidden;\n }\n`;\n\nconst StyledPopover = styled(Popover)`\n width: 40ch;\n min-height: 12rem;\n`;\n\nconst Stakeholders: FunctionComponent<StakeholdersProps & ForwardProps> = forwardRef(\n (\n {\n items: itemsProp,\n count,\n loading,\n onAddNew,\n form,\n onViewAll,\n viewAll,\n error,\n ...restProps\n }: PropsWithoutRef<StakeholdersProps>,\n ref: StakeholdersProps['ref']\n ) => {\n const { create: createModal } = useModalManager();\n const t = useI18n();\n const modalMethods = useRef<ModalMethods>();\n const [mode, setMode] = useState<undefined | 'add' | 'viewAll'>();\n const [editing, setEditing] = useState(false);\n const [viewAllSearchValue, setViewAllSearchValue] = useState('');\n const popoverRef = useRef<HTMLDivElement>(null);\n const progressMsgRef = useRef(t('loading'));\n\n // Why? Don't think this should trigger a re-render. We just need the value when we invoke callback props.\n const selectedRoleNameRef = useRef<Role['name'] | undefined>();\n // Setter for the ref. Avoids a re-render.\n const setSelectedRoleNameRef = useCallback((selectedRoleName?: Role['name']) => {\n selectedRoleNameRef.current = selectedRoleName;\n }, []);\n\n const [popoverTarget, setPopoverTarget] = useState<{\n portal: HTMLLIElement;\n button: HTMLButtonElement | null;\n } | null>(null);\n\n const itemElsRef = useRef<{ itemEls: HTMLLIElement[]; viewAllItemEls: HTMLLIElement[] }>({\n itemEls: [],\n viewAllItemEls: []\n });\n\n // This function merges the pre-defined actions(add & edit) to the item object.\n const mergeItemActions = (\n items: StakeholdersProps['items'] | NonNullable<StakeholdersProps['viewAll']>['items']\n ) => {\n return items.map(({ onEdit, onRemove, ...rest }, i) => {\n let itemActions: Action[] = [];\n const elArray = itemElsRef.current[mode === 'viewAll' ? 'viewAllItemEls' : 'itemEls'];\n\n if (onEdit) {\n itemActions = [\n {\n id: 'edit',\n text: t('edit'),\n icon: 'pencil',\n onClick: () => {\n setEditing(true);\n setPopoverTarget({\n portal: elArray[i],\n button: elArray[i].querySelector<HTMLButtonElement>(\n 'button[aria-haspopup=\"menu\"]'\n )\n });\n\n onEdit?.();\n }\n }\n ];\n }\n\n if (onRemove) {\n itemActions = [\n ...itemActions,\n {\n id: 'remove',\n text: t('remove'),\n icon: 'trash',\n onClick: () => {\n onRemove?.();\n }\n }\n ];\n }\n\n return {\n ...rest,\n ref: (el: HTMLLIElement) => {\n elArray[i] = el;\n },\n actions: itemActions\n };\n });\n };\n\n const closePopover = () => {\n if (!popoverTarget || (form.loading && progressMsgRef.current === t('submitting'))) return;\n popoverTarget.button?.focus();\n setPopoverTarget(null);\n setEditing(false);\n progressMsgRef.current = t('loading');\n };\n\n let formContent: ReactNode = null;\n if (\n (mode === 'add' || editing) &&\n (!form.loading || progressMsgRef.current === t('submitting'))\n ) {\n formContent = (\n <StakeholderForm\n roles={form.roles}\n currentRole={form.currentRole}\n renderer={form.renderer}\n rendererProps={form.rendererProps}\n setSelectedRoleNameRef={setSelectedRoleNameRef}\n />\n );\n }\n\n // Actions used for add and edit both in the modal and the popover.\n let formActions: ReactNode = null;\n if (\n (mode === 'add' || editing) &&\n (!form.loading || progressMsgRef.current === t('submitting'))\n ) {\n const closeForm = () => {\n if (mode === 'add') {\n modalMethods.current?.dismiss();\n } else {\n closePopover();\n }\n };\n\n formActions = (\n <>\n <Button\n disabled={form.loading}\n onClick={() => {\n form.onDismiss({ closeForm });\n }}\n >\n {t('cancel')}\n </Button>\n <Button\n disabled={form.loading}\n type='submit'\n variant='primary'\n onClick={() => {\n progressMsgRef.current = t('submitting');\n form.onSubmit({\n selectedRoleName: selectedRoleNameRef.current,\n closeForm\n });\n }}\n >\n {t('submit')}\n </Button>\n </>\n );\n }\n\n // Content for the modal either for adding new or viewing all.\n let modalContent: ReactNode = null;\n if (mode === 'add') modalContent = formContent;\n\n if (!viewAll.loading && (mode === 'viewAll' || (editing && modalMethods.current))) {\n modalContent = (\n <ViewAll\n items={mergeItemActions(viewAll.items)}\n actions={[\n {\n id: 'addStakeHolder',\n text: 'Add new',\n onClick: () => {\n setMode('add');\n onAddNew?.();\n }\n }\n ]}\n searchInputProps={\n viewAll.onSearch\n ? {\n value: viewAllSearchValue,\n onSearchChange: (value: string) => {\n setViewAllSearchValue(value);\n viewAll?.onSearch?.(value);\n }\n }\n : undefined\n }\n />\n );\n }\n\n useEffect(() => {\n if (!mode) {\n modalMethods.current = undefined;\n return;\n }\n\n const modalProps: OmitStrict<ModalProps, 'heading'> = {\n progress:\n (mode === 'add' && form.loading) || viewAll.loading\n ? { message: progressMsgRef.current }\n : undefined,\n count: mode === 'viewAll' ? count : undefined,\n children: modalContent,\n actions: mode === 'add' ? formActions : undefined,\n onRequestDismiss:\n form.loading && progressMsgRef.current === t('submitting') ? () => false : undefined\n };\n\n if (modalMethods.current) {\n modalMethods.current.update(modalProps);\n } else if (mode === 'add' || mode === 'viewAll') {\n modalMethods.current = createModal(Modal, {\n ...modalProps,\n heading: mode === 'add' ? t('add_stakeholders') : t('view_stakeholders'),\n onAfterClose: () => {\n if (mode === 'add') {\n form.onAfterClose?.();\n } else {\n setViewAllSearchValue('');\n viewAll.onAfterClose?.();\n }\n\n progressMsgRef.current = t('loading');\n setMode(undefined);\n }\n });\n }\n }, [mode, modalContent, form.loading, formActions, count, viewAll.loading]);\n\n // Using mousedown instead of click since drag selecting an input's value within the popover, then releasing outside the popover triggers outer click.\n useOuterEvent('mousedown', [popoverRef], closePopover);\n\n let editPopover: ReactNode = null;\n if (popoverTarget) {\n editPopover = (\n <StyledPopover\n ref={popoverRef}\n target={popoverTarget.button}\n placement='auto'\n role='dialog'\n >\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }}>\n <Text variant='h3'>{t('edit_stakeholder')}</Text>\n <StyledEditFormWrap aria-busy={form.loading ? 'true' : 'false'}>\n <Progress placement='local' visible={form.loading} message={progressMsgRef.current} />\n {(!form.loading || progressMsgRef.current === t('submitting')) && (\n <StakeholderForm\n roles={form.roles}\n currentRole={form.currentRole}\n renderer={form.renderer}\n rendererProps={form.rendererProps}\n setSelectedRoleNameRef={setSelectedRoleNameRef}\n />\n )}\n </StyledEditFormWrap>\n {formActions && <Flex container={{ justify: 'between' }}>{formActions}</Flex>}\n </Flex>\n </StyledPopover>\n );\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closePopover();\n }\n };\n\n useEffect(() => {\n if (!popoverTarget) return;\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, [popoverTarget]);\n\n useAfterInitialEffect(() => {\n if (!popoverTarget) form.onAfterClose?.();\n }, [popoverTarget]);\n\n return (\n <>\n <StyledStakeholders\n {...restProps}\n ref={ref}\n icon='person'\n name={t('view_stakeholders')}\n loading={loading}\n count={count}\n error={error}\n items={useMemo(\n () => mergeItemActions(itemsProp.slice(0, 3)),\n [mergeItemActions, itemsProp]\n )}\n actions={\n onAddNew\n ? [\n {\n text: t('add'),\n id: 'add_new',\n icon: 'plus',\n onClick() {\n setMode('add');\n onAddNew?.();\n }\n }\n ]\n : undefined\n }\n onViewAll={\n onViewAll && count && count > 3\n ? () => {\n setMode('viewAll');\n onViewAll?.();\n }\n : undefined\n }\n />\n {popoverTarget && createPortal(editPopover, popoverTarget.portal)}\n </>\n );\n }\n);\n\nexport default Stakeholders;\n"]}
|
|
1
|
+
{"version":3,"file":"Stakeholders.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EAER,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAA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aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,8BACE,KAAC,kBAAkB,OACb,SAAS,EACb,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC5B,UAAU,EAAC,IAAI,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,OAAO,CACZ,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAC7C,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAC9B,EACD,OAAO,EACL,QAAQ;oBACN,CAAC,CAAC;wBACE;4BACE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;4BACd,EAAE,EAAE,SAAS;4BACb,IAAI,EAAE,MAAM;4BACZ,OAAO;gCACL,OAAO,CAAC,KAAK,CAAC,CAAC;gCACf,QAAQ,EAAE,EAAE,CAAC;4BACf,CAAC;yBACF;qBACF;oBACH,CAAC,CAAC,SAAS,EAEf,SAAS,EACP,SAAS,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC;oBAC7B,CAAC,CAAC,GAAG,EAAE;wBACH,OAAO,CAAC,SAAS,CAAC,CAAC;wBACnB,SAAS,EAAE,EAAE,CAAC;oBAChB,CAAC;oBACH,CAAC,CAAC,SAAS,GAEf,EACD,aAAa,IAAI,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,IAChE,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useRef,\n useEffect,\n useMemo,\n useState,\n ReactNode,\n useCallback\n} from 'react';\nimport styled from 'styled-components';\nimport { createPortal } from 'react-dom';\n\nimport {\n SummaryList,\n useI18n,\n ModalMethods,\n Button,\n ViewAll,\n Modal,\n Popover,\n Flex,\n Text,\n useModalManager,\n useOuterEvent,\n Progress,\n useAfterInitialEffect\n} from '@pega/cosmos-react-core';\nimport type { Action, ForwardProps, ModalProps, OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { Role, StakeholdersProps } from './Stakeholders.types';\nimport StakeholderForm from './StakeholderForm';\n\nconst StyledStakeholders = styled(SummaryList)``;\n\nconst StyledEditFormWrap = styled.div`\n position: relative;\n min-height: 8rem;\n\n &[aria-busy='true'] > :nth-child(2) {\n visibility: hidden;\n }\n`;\n\nconst StyledPopover = styled(Popover)`\n width: 40ch;\n min-height: 12rem;\n`;\n\nconst Stakeholders: FunctionComponent<StakeholdersProps & ForwardProps> = forwardRef(\n (\n {\n items: itemsProp,\n count,\n loading,\n onAddNew,\n form,\n onViewAll,\n viewAll,\n error,\n ...restProps\n }: PropsWithoutRef<StakeholdersProps>,\n ref: StakeholdersProps['ref']\n ) => {\n const { create: createModal } = useModalManager();\n const t = useI18n();\n const modalMethods = useRef<ModalMethods>();\n const [mode, setMode] = useState<undefined | 'add' | 'viewAll'>();\n const [editing, setEditing] = useState(false);\n const [viewAllSearchValue, setViewAllSearchValue] = useState('');\n const popoverRef = useRef<HTMLDivElement>(null);\n const progressMsgRef = useRef(t('loading'));\n\n // Why? Don't think this should trigger a re-render. We just need the value when we invoke callback props.\n const selectedRoleNameRef = useRef<Role['name'] | undefined>();\n // Setter for the ref. Avoids a re-render.\n const setSelectedRoleNameRef = useCallback((selectedRoleName?: Role['name']) => {\n selectedRoleNameRef.current = selectedRoleName;\n }, []);\n\n const [popoverTarget, setPopoverTarget] = useState<{\n portal: HTMLLIElement;\n button: HTMLButtonElement | null;\n } | null>(null);\n\n const itemElsRef = useRef<{ itemEls: HTMLLIElement[]; viewAllItemEls: HTMLLIElement[] }>({\n itemEls: [],\n viewAllItemEls: []\n });\n\n // This function merges the pre-defined actions(add & edit) to the item object.\n const mergeItemActions = (\n items: StakeholdersProps['items'] | NonNullable<StakeholdersProps['viewAll']>['items']\n ) => {\n return items.map(({ onEdit, onRemove, ...rest }, i) => {\n let itemActions: Action[] = [];\n const elArray = itemElsRef.current[mode === 'viewAll' ? 'viewAllItemEls' : 'itemEls'];\n\n if (onEdit) {\n itemActions = [\n {\n id: 'edit',\n text: t('edit'),\n icon: 'pencil',\n onClick: () => {\n setEditing(true);\n setPopoverTarget({\n portal: elArray[i],\n button: elArray[i].querySelector<HTMLButtonElement>(\n 'button[aria-haspopup=\"menu\"]'\n )\n });\n\n onEdit?.();\n }\n }\n ];\n }\n\n if (onRemove) {\n itemActions = [\n ...itemActions,\n {\n id: 'remove',\n text: t('remove'),\n icon: 'trash',\n onClick: () => {\n onRemove?.();\n }\n }\n ];\n }\n\n return {\n ...rest,\n ref: (el: HTMLLIElement) => {\n elArray[i] = el;\n },\n actions: itemActions\n };\n });\n };\n\n const closePopover = () => {\n if (!popoverTarget || (form.loading && progressMsgRef.current === t('submitting'))) return;\n popoverTarget.button?.focus();\n setPopoverTarget(null);\n setEditing(false);\n progressMsgRef.current = t('loading');\n };\n\n let formContent: ReactNode = null;\n if (\n (mode === 'add' || editing) &&\n (!form.loading || progressMsgRef.current === t('submitting'))\n ) {\n formContent = (\n <StakeholderForm\n roles={form.roles}\n currentRole={form.currentRole}\n renderer={form.renderer}\n rendererProps={form.rendererProps}\n setSelectedRoleNameRef={setSelectedRoleNameRef}\n />\n );\n }\n\n // Actions used for add and edit both in the modal and the popover.\n let formActions: ReactNode = null;\n if (\n (mode === 'add' || editing) &&\n (!form.loading || progressMsgRef.current === t('submitting'))\n ) {\n const closeForm = () => {\n if (mode === 'add') {\n modalMethods.current?.dismiss();\n } else {\n closePopover();\n }\n };\n\n formActions = (\n <>\n <Button\n disabled={form.loading}\n onClick={() => {\n form.onDismiss({ closeForm });\n }}\n >\n {t('cancel')}\n </Button>\n <Button\n disabled={form.loading}\n type='submit'\n variant='primary'\n onClick={() => {\n progressMsgRef.current = t('submitting');\n form.onSubmit({\n selectedRoleName: selectedRoleNameRef.current,\n closeForm\n });\n }}\n >\n {t('submit')}\n </Button>\n </>\n );\n }\n\n // Content for the modal either for adding new or viewing all.\n let modalContent: ReactNode = null;\n if (mode === 'add') modalContent = formContent;\n\n if (!viewAll.loading && (mode === 'viewAll' || (editing && modalMethods.current))) {\n modalContent = (\n <ViewAll\n items={mergeItemActions(viewAll.items)}\n actions={[\n {\n id: 'addStakeHolder',\n text: 'Add new',\n onClick: () => {\n setMode('add');\n onAddNew?.();\n }\n }\n ]}\n searchInputProps={\n viewAll.onSearch\n ? {\n value: viewAllSearchValue,\n onSearchChange: (value: string) => {\n setViewAllSearchValue(value);\n viewAll?.onSearch?.(value);\n }\n }\n : undefined\n }\n />\n );\n }\n\n useEffect(() => {\n if (!mode) {\n modalMethods.current = undefined;\n return;\n }\n\n const modalProps: OmitStrict<ModalProps, 'heading'> = {\n progress:\n (mode === 'add' && form.loading) || viewAll.loading\n ? { message: progressMsgRef.current }\n : undefined,\n count: mode === 'viewAll' ? count : undefined,\n children: modalContent,\n actions: mode === 'add' ? formActions : undefined,\n onRequestDismiss:\n form.loading && progressMsgRef.current === t('submitting') ? () => false : undefined\n };\n\n if (modalMethods.current) {\n modalMethods.current.update(modalProps);\n } else if (mode === 'add' || mode === 'viewAll') {\n modalMethods.current = createModal(Modal, {\n ...modalProps,\n heading: mode === 'add' ? t('add_stakeholders') : t('view_stakeholders'),\n onAfterClose: () => {\n if (mode === 'add') {\n form.onAfterClose?.();\n } else {\n setViewAllSearchValue('');\n viewAll.onAfterClose?.();\n }\n\n progressMsgRef.current = t('loading');\n setMode(undefined);\n }\n });\n }\n }, [mode, modalContent, form.loading, formActions, count, viewAll.loading]);\n\n // Using mousedown instead of click since drag selecting an input's value within the popover, then releasing outside the popover triggers outer click.\n useOuterEvent('mousedown', [popoverRef], closePopover);\n\n let editPopover: ReactNode = null;\n if (popoverTarget) {\n editPopover = (\n <StyledPopover\n ref={popoverRef}\n target={popoverTarget.button}\n placement='auto'\n role='dialog'\n >\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }}>\n <Text variant='h3'>{t('edit_stakeholder')}</Text>\n <StyledEditFormWrap aria-busy={form.loading ? 'true' : 'false'}>\n <Progress placement='local' visible={form.loading} message={progressMsgRef.current} />\n {(!form.loading || progressMsgRef.current === t('submitting')) && (\n <StakeholderForm\n roles={form.roles}\n currentRole={form.currentRole}\n renderer={form.renderer}\n rendererProps={form.rendererProps}\n setSelectedRoleNameRef={setSelectedRoleNameRef}\n />\n )}\n </StyledEditFormWrap>\n {formActions && <Flex container={{ justify: 'between' }}>{formActions}</Flex>}\n </Flex>\n </StyledPopover>\n );\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closePopover();\n }\n };\n\n useEffect(() => {\n if (!popoverTarget) return;\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, [popoverTarget]);\n\n useAfterInitialEffect(() => {\n if (!popoverTarget) form.onAfterClose?.();\n }, [popoverTarget]);\n\n return (\n <>\n <StyledStakeholders\n {...restProps}\n ref={ref}\n icon='person'\n name={t('view_stakeholders')}\n headingTag='h3'\n loading={loading}\n count={count}\n error={error}\n items={useMemo(\n () => mergeItemActions(itemsProp.slice(0, 3)),\n [mergeItemActions, itemsProp]\n )}\n actions={\n onAddNew\n ? [\n {\n text: t('add'),\n id: 'add_new',\n icon: 'plus',\n onClick() {\n setMode('add');\n onAddNew?.();\n }\n }\n ]\n : undefined\n }\n onViewAll={\n onViewAll && count && count > 3\n ? () => {\n setMode('viewAll');\n onViewAll?.();\n }\n : undefined\n }\n />\n {popoverTarget && createPortal(editPopover, popoverTarget.portal)}\n </>\n );\n }\n);\n\nexport default Stakeholders;\n"]}
|
|
@@ -214,7 +214,7 @@ const Tags = forwardRef(({ tags, availableTags, loading, error, onSearch, onTagC
|
|
|
214
214
|
return (_jsx(Tag, { onClick: () => onTagClick?.(tag), children: tag }, tag));
|
|
215
215
|
}) })) : (_jsx(EmptyState, {}));
|
|
216
216
|
}, [loading, error, tags]);
|
|
217
|
-
return (_jsxs(Card, { ref: consolidatedRef, ...restProps, as: StyledTags, viewAll: viewAll, isLoading: loading, children: [_jsxs(CardHeader, { children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { name: 'tag' }), _jsx(Text, { variant: '
|
|
217
|
+
return (_jsxs(Card, { ref: consolidatedRef, ...restProps, as: StyledTags, viewAll: viewAll, isLoading: loading, children: [_jsxs(CardHeader, { children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { name: 'tag' }), _jsx(Text, { variant: 'h3', children: t('tags') }), _jsx(Count, { children: tags.length })] }), _jsx(Actions, { items: onEditTags
|
|
218
218
|
? [
|
|
219
219
|
{
|
|
220
220
|
id: 'editTags',
|