@pega/cosmos-react-work 3.0.0-dev.2.0 → 3.0.0-dev.21.0

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.
Files changed (126) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +4 -0
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +4 -3
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  5. package/lib/components/CaseHeader/CaseHeader.d.ts +4 -1
  6. package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
  7. package/lib/components/CaseHeader/CaseHeader.js +35 -21
  8. package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
  9. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  10. package/lib/components/CasePreview/CasePreview.js +7 -2
  11. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  12. package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
  13. package/lib/components/CaseSummary/CaseSummary.js +4 -3
  14. package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
  15. package/lib/components/CaseSummaryFields/CaseSummaryFields.js +1 -1
  16. package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  17. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  18. package/lib/components/CaseView/CaseView.js +8 -8
  19. package/lib/components/CaseView/CaseView.js.map +1 -1
  20. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  21. package/lib/components/CaseView/CaseView.styles.js +1 -0
  22. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  23. package/lib/components/CaseView/MobileCaseView.js +1 -1
  24. package/lib/components/CaseView/MobileCaseView.js.map +1 -1
  25. package/lib/components/CaseView/UtilitiesSummary.js +2 -2
  26. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  27. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +1 -1
  28. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  29. package/lib/components/ConfigurableLayout/LayoutCell.js +1 -1
  30. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -1
  31. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +1 -1
  32. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -1
  33. package/lib/components/Confirmation/Confirmation.d.ts +2 -2
  34. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  35. package/lib/components/Confirmation/Confirmation.js +1 -1
  36. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  37. package/lib/components/Details/Details.d.ts +25 -10
  38. package/lib/components/Details/Details.d.ts.map +1 -1
  39. package/lib/components/Details/Details.js +56 -35
  40. package/lib/components/Details/Details.js.map +1 -1
  41. package/lib/components/Details/Details.styles.d.ts +47 -0
  42. package/lib/components/Details/Details.styles.d.ts.map +1 -0
  43. package/lib/components/Details/Details.styles.js +230 -0
  44. package/lib/components/Details/Details.styles.js.map +1 -0
  45. package/lib/components/Details/DetailsContext.d.ts +9 -0
  46. package/lib/components/Details/DetailsContext.d.ts.map +1 -0
  47. package/lib/components/Details/DetailsContext.js +9 -0
  48. package/lib/components/Details/DetailsContext.js.map +1 -0
  49. package/lib/components/Details/index.d.ts +2 -2
  50. package/lib/components/Details/index.d.ts.map +1 -1
  51. package/lib/components/Details/index.js +2 -1
  52. package/lib/components/Details/index.js.map +1 -1
  53. package/lib/components/Glimpse/Glimpse.js +1 -1
  54. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  55. package/lib/components/SearchResults/Filter.js +2 -2
  56. package/lib/components/SearchResults/Filter.js.map +1 -1
  57. package/lib/components/SearchResults/SearchResult.d.ts +1 -1
  58. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  59. package/lib/components/SearchResults/SearchResult.js +9 -3
  60. package/lib/components/SearchResults/SearchResult.js.map +1 -1
  61. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  62. package/lib/components/SearchResults/SearchResults.js +54 -39
  63. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  64. package/lib/components/SearchResults/SearchResults.styles.d.ts +3 -0
  65. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -1
  66. package/lib/components/SearchResults/SearchResults.styles.js +33 -17
  67. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -1
  68. package/lib/components/SearchResults/SearchResults.types.d.ts +4 -0
  69. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
  70. package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
  71. package/lib/components/Stages/StageGlimpse.d.ts +10 -0
  72. package/lib/components/Stages/StageGlimpse.d.ts.map +1 -0
  73. package/lib/components/Stages/StageGlimpse.js +11 -0
  74. package/lib/components/Stages/StageGlimpse.js.map +1 -0
  75. package/lib/components/Stages/Stages.d.ts +1 -1
  76. package/lib/components/Stages/Stages.d.ts.map +1 -1
  77. package/lib/components/Stages/Stages.js +105 -112
  78. package/lib/components/Stages/Stages.js.map +1 -1
  79. package/lib/components/Stages/Stages.styles.d.ts +4 -7
  80. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  81. package/lib/components/Stages/Stages.styles.js +169 -186
  82. package/lib/components/Stages/Stages.styles.js.map +1 -1
  83. package/lib/components/Stages/Stages.types.d.ts +19 -4
  84. package/lib/components/Stages/Stages.types.d.ts.map +1 -1
  85. package/lib/components/Stages/Stages.types.js.map +1 -1
  86. package/lib/components/Stakeholders/StakeholderForm.js +4 -4
  87. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -1
  88. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  89. package/lib/components/Stakeholders/Stakeholders.js +13 -7
  90. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  91. package/lib/components/Tags/Tags.js +12 -12
  92. package/lib/components/Tags/Tags.js.map +1 -1
  93. package/lib/components/Tasks/TaskList.d.ts +8 -5
  94. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  95. package/lib/components/Tasks/TaskList.js +14 -6
  96. package/lib/components/Tasks/TaskList.js.map +1 -1
  97. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  98. package/lib/components/Tasks/Tasks.js +5 -4
  99. package/lib/components/Tasks/Tasks.js.map +1 -1
  100. package/lib/components/Timeline/Timeline.js +2 -2
  101. package/lib/components/Timeline/Timeline.js.map +1 -1
  102. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  103. package/lib/components/Timeline/Timeline.styles.js +1 -0
  104. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  105. package/lib/components/Timeline/Timeline.types.d.ts +24 -3
  106. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  107. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  108. package/lib/components/Timeline/TimelineItem.js +3 -3
  109. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  110. package/lib/components/Timeline/TimelineToolbar.d.ts +6 -0
  111. package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -0
  112. package/lib/components/Timeline/TimelineToolbar.js +68 -0
  113. package/lib/components/Timeline/TimelineToolbar.js.map +1 -0
  114. package/lib/components/Timeline/index.d.ts +1 -0
  115. package/lib/components/Timeline/index.d.ts.map +1 -1
  116. package/lib/components/Timeline/index.js +1 -0
  117. package/lib/components/Timeline/index.js.map +1 -1
  118. package/package.json +17 -11
  119. package/lib/components/Stages/Steps.d.ts +0 -8
  120. package/lib/components/Stages/Steps.d.ts.map +0 -1
  121. package/lib/components/Stages/Steps.js +0 -12
  122. package/lib/components/Stages/Steps.js.map +0 -1
  123. package/lib/components/Stages/StepsContainer.d.ts +0 -8
  124. package/lib/components/Stages/StepsContainer.d.ts.map +0 -1
  125. package/lib/components/Stages/StepsContainer.js +0 -11
  126. package/lib/components/Stages/StepsContainer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Details.js","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":";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ACH,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;oBAC3C,UAAU,EAAE,OAAO;oBACnB,YAAY,EAAE,OAAO;oBACrB,GAAG,EAAE,CAAC;iBACP,YAEA,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;oBAC3B,oDAAoD;oBACpD,OAAO,wBAAc,OAAO,IAAX,CAAC,CAAiB,CAAC;gBACtC,CAAC,CAAC,WACG,CACR,YACa,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { FunctionComponent, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Grid,\n defaultThemeProp,\n FieldValueList,\n StyledFieldValueList,\n FieldValueListProps,\n ForwardProps,\n BaseProps,\n calculateFontSize,\n FontSize,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nexport interface DetailsProps extends BaseProps, NoChildrenProp {\n /** The set of field values to render in the Highlighted Data list. */\n highlightedFields?: FieldValueListProps['fields'];\n /** List of React components below the highlighted data and line seperation. */\n regions?: [ReactNode] | [ReactNode, ReactNode] | [ReactNode, ReactNode, ReactNode];\n}\n\nexport const StyledDetails = styled.div``;\n\nexport const StyledHighlightedFields = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n ${StyledFieldValueList} {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(20ch, 1fr));\n padding-block-end: calc(1.5 * ${theme.base.spacing});\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n column-gap: calc(5 * ${theme.base.spacing});\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n }\n\n & + div {\n padding-block-start: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledHighlightedFields.defaultProps = defaultThemeProp;\n\nconst Details: FunctionComponent<DetailsProps & ForwardProps> = ({\n highlightedFields,\n regions\n}: DetailsProps) => {\n return (\n <StyledDetails>\n {highlightedFields && (\n <StyledHighlightedFields>\n <FieldValueList variant='stacked' fields={highlightedFields} />\n </StyledHighlightedFields>\n )}\n {regions && regions.length > 0 && (\n <Grid\n container={{\n cols: 'repeat(auto-fit, minmax(30ch, 1fr))',\n alignItems: 'start',\n alignContent: 'start',\n gap: 2\n }}\n >\n {regions?.map((colItem, i) => {\n // eslint-disable-next-line react/no-array-index-key\n return <div key={i}>{colItem}</div>;\n })}\n </Grid>\n )}\n </StyledDetails>\n );\n};\n\nexport default Details;\n"]}
1
+ {"version":3,"file":"Details.js","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,QAAQ,EAGR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,QAAQ,EAET,MAAM,yBAAyB,CAAC;AAEjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,EACX,OAAO,EACR,MAAM,kBAAkB,CAAC;AA0B1B,MAAM,OAAO,GAAoC,UAAU,CACzD,CACE,EACE,eAAe,EACf,QAAQ,EACR,IAAI,EACJ,WAAW,GAAG,CAAC,EACf,MAAM,GAAG,KAAK,EACd,MAAM,GAAG,KAAK,EACd,eAAe,GAAG,KAAK,EACxB,EACD,GAAG,EACH,EAAE;IACF,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACzF,MAAM,EACJ,IAAI,EAAE,EACJ,eAAe,EAAE,EAAE,EAAE,EAAE,EACxB,EACF,GAAG,QAAQ,EA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,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,YACnD,eAAe,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;4BACjC,oDAAoD;4BACpD,KAAC,QAAQ,cAAU,KAAK,IAAT,CAAC,CAAoB,CACrC,CAAC,GAC0B,EAE9B,cAAM,IACL,CACJ,EAED,KAAC,gBAAgB,IACf,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACzB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,CAAC,CAAC,IAAI,EACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAClC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,YAExD,QAAQ,GACQ,IACL,GACQ,CAC3B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import {\n forwardRef,\n FC,\n Fragment,\n ReactNode,\n Ref,\n useState,\n useContext,\n useEffect,\n useMemo\n} from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n Text,\n useBreakpoint,\n useConsolidatedRef,\n useTheme,\n ForwardProps\n} from '@pega/cosmos-react-core';\n\nimport DetailsContext from './DetailsContext';\nimport {\n StyledFieldValueGroupLabel,\n StyledDetails,\n StyledDetailList,\n StyledHighlightedDetailList,\n flexGapProp,\n chToRem\n} from './Details.styles';\n\ninterface DetailsProps {\n highlightedData?: ReactNode[];\n children?: ReactNode;\n /** Text used as heading of list */\n name?: string;\n /** Number of columns in detail layout\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n /** Whether detail list is rendering within another detail list\n * @default false\n */\n nested?: boolean;\n /** Whether detail list is rendering multiple sub-lists in columns (passed as children)\n * @default false\n */\n asFlex?: boolean;\n /** Whether to apply `value-comparison` styles to list items\n * @default false\n */\n valueComparison?: boolean;\n ref?: Ref<HTMLDListElement>;\n}\n\nconst Details: FC<DetailsProps & ForwardProps> = forwardRef(\n (\n {\n highlightedData,\n children,\n name,\n columnCount = 1,\n nested = false,\n asFlex = false,\n valueComparison = false\n },\n ref\n ) => {\n const { longestLabelLength, mobileView, depth, ...context } = useContext(DetailsContext);\n const {\n base: {\n 'content-width': { sm }\n }\n } = useTheme();\n const isSmallOrAbove = useBreakpoint('sm');\n const listRef = useConsolidatedRef<HTMLDListElement>(ref);\n const flexRow = useBreakpoint(columnCount > 2 ? 'md' : 'sm', {\n breakpointRef: listRef,\n themeProp: 'content-width'\n });\n const [flexContextMobileView, setFlexContextMobileView] = useState(false);\n\n const labelLength = Math.max(14, Math.min(longestLabelLength ?? 16, 40));\n const headingDepth = depth ?? 1;\n const applyMobileView = asFlex\n ? mobileView || (flexRow && flexContextMobileView) || !isSmallOrAbove\n : mobileView || !isSmallOrAbove;\n\n const contextValue = useMemo(() => {\n return {\n mobileView: applyMobileView,\n depth: name ? headingDepth + 1 : headingDepth,\n longestLabelLength,\n ...context\n };\n }, [applyMobileView, name, headingDepth, longestLabelLength, context]);\n\n /**\n * Mount resize observer to update flex context mobile view & run initial check.\n */\n useEffect(() => {\n const checkBreakpoint = (elementWidth: number) => {\n const minWidthRem = chToRem(parseInt(sm, 10));\n const minWidthPx = parseInt(remToPx(minWidthRem), 10);\n const oneRemInPx = parseInt(remToPx(1), 10);\n const colGapPxAllowance = oneRemInPx * (0.5 * flexGapProp) * (columnCount - 1);\n const mobileViewBreakpoint = minWidthPx * columnCount + colGapPxAllowance;\n\n setFlexContextMobileView(elementWidth < mobileViewBreakpoint);\n };\n const resizeObserver = new ResizeObserver(entries => {\n const containerPxWidth = entries[0].contentRect.width;\n checkBreakpoint(containerPxWidth);\n });\n\n if (listRef.current) {\n checkBreakpoint(listRef.current.offsetWidth);\n resizeObserver.observe(listRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [listRef, columnCount]);\n\n return (\n <DetailsContext.Provider value={contextValue}>\n <StyledDetails>\n {name && (\n <StyledFieldValueGroupLabel>\n <Text\n variant={`h${Math.min(headingDepth, 6)}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'}\n >\n {name}\n </Text>\n </StyledFieldValueGroupLabel>\n )}\n\n {highlightedData && (\n <>\n <StyledHighlightedDetailList as={nested ? 'div' : 'dl'}>\n {highlightedData.map((child, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={i}>{child}</Fragment>\n ))}\n </StyledHighlightedDetailList>\n\n <hr />\n </>\n )}\n\n <StyledDetailList\n ref={listRef}\n as={nested ? 'div' : 'dl'}\n columnCount={columnCount}\n labelLength={labelLength}\n stacked={applyMobileView}\n hasName={!!name}\n nested={nested}\n flex={asFlex}\n wrapped={asFlex ? !flexRow : false}\n variant={valueComparison ? 'value-comparison' : undefined}\n >\n {children}\n </StyledDetailList>\n </StyledDetails>\n </DetailsContext.Provider>\n );\n }\n);\n\nexport default Details;\n"]}
@@ -0,0 +1,47 @@
1
+ import { DefaultTheme } from 'styled-components';
2
+ import { StyledFieldValueListProps } from '@pega/cosmos-react-core';
3
+ interface StyledDetailListProps extends StyledFieldValueListProps {
4
+ /** Whether individual list items all have labels stacks on top */
5
+ stacked?: boolean;
6
+ /** Whether the list is a flex row of other lists */
7
+ flex?: boolean;
8
+ /** Whether the list has a name attribute */
9
+ hasName?: boolean;
10
+ /** Whether the list is nested */
11
+ nested?: boolean;
12
+ /** The character length applied to all list labels */
13
+ labelLength?: number;
14
+ /**
15
+ * Whether the list is wrapped to 1 column
16
+ * @default false
17
+ */
18
+ wrapped?: boolean;
19
+ /**
20
+ * Number of columns in the list
21
+ * @default 1
22
+ */
23
+ columnCount?: 1 | 2 | 3;
24
+ theme: DefaultTheme;
25
+ }
26
+ export declare const colCountChWidth: {
27
+ '1': {
28
+ containerWidth: number;
29
+ colWidth: number;
30
+ };
31
+ '2': {
32
+ containerWidth: number;
33
+ colWidth: number;
34
+ };
35
+ '3': {
36
+ containerWidth: number;
37
+ colWidth: number;
38
+ };
39
+ };
40
+ export declare const flexGapProp = 5.5;
41
+ export declare const chToRem: (chVal: number) => number;
42
+ export declare const StyledFieldValueGroupLabel: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
43
+ export declare const StyledHighlightedDetailList: import("styled-components").StyledComponent<"dl", DefaultTheme, {}, never>;
44
+ export declare const StyledDetails: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
45
+ export declare const StyledDetailList: import("styled-components").StyledComponent<"dl", DefaultTheme, StyledFieldValueListProps & import("@pega/cosmos-react-core").OmitStrict<StyledDetailListProps, "columnCount" | "wrapped"> & Required<Pick<StyledDetailListProps, "columnCount" | "wrapped">>, never>;
46
+ export {};
47
+ //# sourceMappingURL=Details.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Details.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AAAA,OAAe,EAAO,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAML,yBAAyB,EAG1B,MAAM,yBAAyB,CAAC;AAEjC,UAAU,qBAAsB,SAAQ,yBAAyB;IAC/D,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;CACrB;AAUD,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAa3B,CAAC;AAEF,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAEvC,CAAC;AAEF,eAAO,MAAM,0BAA0B,6EAerC,CAAC;AAIH,eAAO,MAAM,2BAA2B,4EA4BtC,CAAC;AAIH,eAAO,MAAM,aAAa,6EAIxB,CAAC;AAkCH,eAAO,MAAM,gBAAgB,uQAwJ5B,CAAC"}
@@ -0,0 +1,230 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { calculateFontSize, defaultThemeProp, StyledFieldValue, StyledStackedFieldValue, StyledFieldValueList } from '@pega/cosmos-react-core';
3
+ const verticalGapSpacingMultiplier = 1;
4
+ // colWidth reduces by 20% as column count increases
5
+ export const colCountChWidth = {
6
+ '1': {
7
+ containerWidth: 100,
8
+ colWidth: 100
9
+ },
10
+ '2': {
11
+ containerWidth: 80 * 2,
12
+ colWidth: 80
13
+ },
14
+ '3': {
15
+ containerWidth: 64 * 3,
16
+ colWidth: 64
17
+ }
18
+ };
19
+ export const flexGapProp = 5.5;
20
+ export const chToRem = (chVal) => {
21
+ return chVal / 2;
22
+ };
23
+ export const StyledFieldValueGroupLabel = styled.div(({ theme }) => {
24
+ const { base: { spacing } } = theme;
25
+ return css `
26
+ width: 100%;
27
+ grid-column-start: 1;
28
+ grid-column-end: -1;
29
+ margin-block-end: calc(0.5 * ${spacing});
30
+
31
+ &:not(:first-child) {
32
+ margin-block-start: calc(3 * ${spacing});
33
+ }
34
+ `;
35
+ });
36
+ StyledFieldValueGroupLabel.defaultProps = defaultThemeProp;
37
+ export const StyledHighlightedDetailList = styled.dl(({ theme }) => {
38
+ const { base: { spacing, palette } } = theme;
39
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
40
+ return css `
41
+ display: grid;
42
+ grid-template-columns: repeat(auto-fit, minmax(40ch, 1fr));
43
+ column-gap: calc(5 * ${spacing});
44
+ gap: calc(2 * ${spacing});
45
+ align-items: start;
46
+ max-width: ${`${colCountChWidth[3].containerWidth}ch}`};
47
+ padding-block-end: calc(1.5 * ${spacing});
48
+
49
+ dd {
50
+ font-size: ${fontSize[theme.components.text.h1['font-size']]};
51
+ font-weight: ${theme.components.text.h1['font-weight']};
52
+ }
53
+
54
+ + hr {
55
+ border-top: unset;
56
+ border-radius: unset;
57
+ border-style: unset;
58
+ border-bottom: 0.0625rem solid ${palette['border-line']};
59
+ margin-block-end: calc(1.5 * ${spacing});
60
+ }
61
+ `;
62
+ });
63
+ StyledHighlightedDetailList.defaultProps = defaultThemeProp;
64
+ export const StyledDetails = styled.div(() => {
65
+ return css `
66
+ grid-column: 1 / -1;
67
+ `;
68
+ });
69
+ StyledDetails.defaultProps = defaultThemeProp;
70
+ const nthRecursiveContainerSelector = (depth, includeAllImmediateContainers) => {
71
+ const firstContainerSelector = '> div:first-child';
72
+ const baseSelector = includeAllImmediateContainers ? '> div' : firstContainerSelector;
73
+ return baseSelector.concat(` ${firstContainerSelector}`.repeat(depth));
74
+ };
75
+ const initialLabelNoMargin = (applyToAllChildren = false) => {
76
+ return css `
77
+ ${nthRecursiveContainerSelector(0, applyToAllChildren)},
78
+ ${nthRecursiveContainerSelector(1, applyToAllChildren)},
79
+ ${nthRecursiveContainerSelector(2, applyToAllChildren)},
80
+ ${nthRecursiveContainerSelector(3, applyToAllChildren)},
81
+ ${nthRecursiveContainerSelector(4, applyToAllChildren)},
82
+ ${nthRecursiveContainerSelector(5, applyToAllChildren)},
83
+ ${nthRecursiveContainerSelector(6, applyToAllChildren)},
84
+ ${nthRecursiveContainerSelector(7, applyToAllChildren)},
85
+ ${nthRecursiveContainerSelector(8, applyToAllChildren)},
86
+ ${nthRecursiveContainerSelector(9, applyToAllChildren)},
87
+ ${nthRecursiveContainerSelector(10, applyToAllChildren)} {
88
+ > ${StyledFieldValueGroupLabel}:first-child {
89
+ margin-block-start: 0;
90
+ }
91
+ }
92
+ `;
93
+ };
94
+ export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, hasName, nested, labelLength, variant, theme, wrapped = false, columnCount = 1 }) => {
95
+ const { base: { spacing } } = theme;
96
+ const isValueComparison = variant === 'value-comparison';
97
+ const containerWidthCh = colCountChWidth[columnCount].containerWidth;
98
+ const containerWidthMinusLabel = `${containerWidthCh - (labelLength ?? 0)}ch`;
99
+ return css `
100
+ /* Top Level Styles */
101
+ ${!nested &&
102
+ css `
103
+ ${StyledFieldValue} {
104
+ word-break: break-word;
105
+ overflow: auto;
106
+ }
107
+
108
+ ${StyledFieldValueGroupLabel} {
109
+ margin-block-start: calc(3 * ${spacing});
110
+ }
111
+
112
+ > ${StyledFieldValueGroupLabel}:nth-child(1) {
113
+ margin-block-start: 0;
114
+ }
115
+
116
+ ${StyledStackedFieldValue} {
117
+ grid-column: 1 / -1;
118
+ }
119
+ `}
120
+
121
+ /* Nested List */
122
+ ${nested &&
123
+ css `
124
+ grid-column: 1 / -1;
125
+ `}
126
+
127
+ /* As Field Grid */
128
+ ${!flex &&
129
+ css `
130
+ display: grid;
131
+ grid-template-columns: ${`minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr)`};
132
+ column-gap: calc(2 * ${spacing});
133
+ row-gap: calc(${verticalGapSpacingMultiplier} * ${spacing});
134
+
135
+ ${stacked &&
136
+ css `
137
+ grid-template-columns: minmax(0, 1fr);
138
+ row-gap: 0;
139
+ `}
140
+
141
+ > ${StyledStackedFieldValue} {
142
+ max-width: ${`${containerWidthCh}ch`};
143
+ }
144
+
145
+ > ${StyledFieldValue} {
146
+ max-width: calc(${containerWidthMinusLabel} - calc(2 * ${spacing}));
147
+ }
148
+
149
+ ${isValueComparison &&
150
+ css `
151
+ grid-template-columns: auto auto;
152
+ column-gap: 0;
153
+ row-gap: calc(0.5 * ${spacing});
154
+ max-width: ${`${containerWidthCh}ch`};
155
+ `}
156
+ `}
157
+
158
+ /* As Flex Container */
159
+ ${flex &&
160
+ css `
161
+ display: flex;
162
+ flex-direction: ${wrapped ? 'column' : 'row'};
163
+ column-gap: calc(${flexGapProp} * ${spacing});
164
+ align-items: flex-start;
165
+
166
+ max-width: ${`${containerWidthCh}ch`};
167
+
168
+ ${!wrapped &&
169
+ css `
170
+ > * {
171
+ max-width: ${`${100 / columnCount}%`};
172
+ }
173
+
174
+ ${hasName && initialLabelNoMargin(true)}
175
+ `}
176
+
177
+ ${wrapped &&
178
+ css `
179
+ ${hasName && initialLabelNoMargin()}
180
+
181
+ ${!stacked &&
182
+ css `
183
+ > div:not(:first-child) {
184
+ margin-block-start: calc(${verticalGapSpacingMultiplier} * ${spacing});
185
+ }
186
+ `}}
187
+ `}
188
+ `}
189
+
190
+ /* Key / Group Label Spacing */
191
+ ${!nested &&
192
+ css `
193
+ > div {
194
+ + dt {
195
+ margin-block-start: calc(3 * ${spacing});
196
+ }
197
+
198
+ + ${StyledStackedFieldValue} {
199
+ margin-block-start: calc(3 * ${spacing});
200
+ }
201
+
202
+ ${!stacked &&
203
+ css `
204
+ + dt + dd {
205
+ margin-block-start: calc(3 * ${spacing});
206
+ }
207
+ `}
208
+ }
209
+
210
+ ${initialLabelNoMargin()}
211
+ `}
212
+
213
+ ${stacked &&
214
+ css `
215
+ dt {
216
+ margin-block-start: calc(${verticalGapSpacingMultiplier} * ${spacing});
217
+ }
218
+ `}
219
+
220
+ ${StyledFieldValueGroupLabel} + div {
221
+ > ${StyledFieldValueGroupLabel}:first-child {
222
+ margin-block-start: 0;
223
+ }
224
+
225
+ ${initialLabelNoMargin()}
226
+ }
227
+ `;
228
+ });
229
+ StyledDetailList.defaultProps = defaultThemeProp;
230
+ //# sourceMappingURL=Details.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Details.styles.js","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAgB,MAAM,mBAAmB,CAAC;AAE9D,OAAO,E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B;4BACA,wBAAwB,eAAe,OAAO;;;UAGhE,iBAAiB;YACnB,GAAG,CAAA;;;gCAGqB,OAAO;uBAChB,GAAG,gBAAgB,IAAI;SACrC;OACF;;;QAGC,IAAI;QACN,GAAG,CAAA;;0BAEiB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;2BACzB,WAAW,MAAM,OAAO;;;qBAG9B,GAAG,gBAAgB,IAAI;;UAElC,CAAC,OAAO;YACV,GAAG,CAAA;;yBAEc,GAAG,GAAG,GAAG,WAAW,GAAG;;;YAGpC,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC;SACxC;;UAEC,OAAO;YACT,GAAG,CAAA;YACC,OAAO,IAAI,oBAAoB,EAAE;;YAGjC,CAAC,OAAO;gBACR,GAAG,CAAA;;2CAE4B,4BAA4B,MAAM,OAAO;;aAG1E;SACD;OACF;;;QAGC,CAAC,MAAM;QACT,GAAG,CAAA;;;2CAGkC,OAAO;;;cAGpC,uBAAuB;2CACM,OAAO;;;YAGtC,CAAC,OAAO;YACV,GAAG,CAAA;;6CAEgC,OAAO;;WAEzC;;;UAGD,oBAAoB,EAAE;OACzB;;QAEC,OAAO;QACT,GAAG,CAAA;;qCAE4B,4BAA4B,MAAM,OAAO;;OAEvE;;QAEC,0BAA0B;YACtB,0BAA0B;;;;UAI5B,oBAAoB,EAAE;;KAE3B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css, DefaultTheme } from 'styled-components';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledFieldValueList,\n StyledFieldValueListProps,\n FontSize,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\n\ninterface StyledDetailListProps extends StyledFieldValueListProps {\n /** Whether individual list items all have labels stacks on top */\n stacked?: boolean;\n /** Whether the list is a flex row of other lists */\n flex?: boolean;\n /** Whether the list has a name attribute */\n hasName?: boolean;\n /** Whether the list is nested */\n nested?: boolean;\n /** The character length applied to all list labels */\n labelLength?: number;\n /**\n * Whether the list is wrapped to 1 column\n * @default false\n */\n wrapped?: boolean;\n /**\n * Number of columns in the list\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n theme: DefaultTheme;\n}\n\ntype StyledDetailListPropsWithDefaults = PropsWithDefaults<\n StyledDetailListProps,\n 'wrapped' | 'columnCount'\n>;\n\nconst verticalGapSpacingMultiplier = 1;\n\n// colWidth reduces by 20% as column count increases\nexport const colCountChWidth = {\n '1': {\n containerWidth: 100,\n colWidth: 100\n },\n '2': {\n containerWidth: 80 * 2,\n colWidth: 80\n },\n '3': {\n containerWidth: 64 * 3,\n colWidth: 64\n }\n};\n\nexport const flexGapProp = 5.5;\n\nexport const chToRem = (chVal: number): number => {\n return chVal / 2;\n};\n\nexport const StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n width: 100%;\n grid-column-start: 1;\n grid-column-end: -1;\n margin-block-end: calc(0.5 * ${spacing});\n\n &:not(:first-child) {\n margin-block-start: calc(3 * ${spacing});\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledHighlightedDetailList = styled.dl(({ theme }) => {\n const {\n base: { spacing, palette }\n } = theme;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(40ch, 1fr));\n column-gap: calc(5 * ${spacing});\n gap: calc(2 * ${spacing});\n align-items: start;\n max-width: ${`${colCountChWidth[3].containerWidth}ch}`};\n padding-block-end: calc(1.5 * ${spacing});\n\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n\n + hr {\n border-top: unset;\n border-radius: unset;\n border-style: unset;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n margin-block-end: calc(1.5 * ${spacing});\n }\n `;\n});\n\nStyledHighlightedDetailList.defaultProps = defaultThemeProp;\n\nexport const StyledDetails = styled.div(() => {\n return css`\n grid-column: 1 / -1;\n `;\n});\n\nStyledDetails.defaultProps = defaultThemeProp;\n\nconst nthRecursiveContainerSelector = (\n depth: number,\n includeAllImmediateContainers?: boolean\n): string => {\n const firstContainerSelector = '> div:first-child';\n const baseSelector = includeAllImmediateContainers ? '> div' : firstContainerSelector;\n\n return baseSelector.concat(` ${firstContainerSelector}`.repeat(depth));\n};\n\nconst initialLabelNoMargin = (applyToAllChildren = false) => {\n return css`\n ${nthRecursiveContainerSelector(0, applyToAllChildren)},\n ${nthRecursiveContainerSelector(1, applyToAllChildren)},\n ${nthRecursiveContainerSelector(2, applyToAllChildren)},\n ${nthRecursiveContainerSelector(3, applyToAllChildren)},\n ${nthRecursiveContainerSelector(4, applyToAllChildren)},\n ${nthRecursiveContainerSelector(5, applyToAllChildren)},\n ${nthRecursiveContainerSelector(6, applyToAllChildren)},\n ${nthRecursiveContainerSelector(7, applyToAllChildren)},\n ${nthRecursiveContainerSelector(8, applyToAllChildren)},\n ${nthRecursiveContainerSelector(9, applyToAllChildren)},\n ${nthRecursiveContainerSelector(10, applyToAllChildren)} {\n > ${StyledFieldValueGroupLabel}:first-child {\n margin-block-start: 0;\n }\n }\n `;\n};\n\nexport const StyledDetailList = styled(StyledFieldValueList)<StyledDetailListPropsWithDefaults>(\n ({\n stacked,\n flex,\n hasName,\n nested,\n labelLength,\n variant,\n theme,\n wrapped = false,\n columnCount = 1\n }): any => {\n const {\n base: { spacing }\n } = theme;\n\n const isValueComparison = variant === 'value-comparison';\n const containerWidthCh = colCountChWidth[columnCount].containerWidth;\n const containerWidthMinusLabel = `${containerWidthCh - (labelLength ?? 0)}ch`;\n\n return css`\n /* Top Level Styles */\n ${!nested &&\n css`\n ${StyledFieldValue} {\n word-break: break-word;\n overflow: auto;\n }\n\n ${StyledFieldValueGroupLabel} {\n margin-block-start: calc(3 * ${spacing});\n }\n\n > ${StyledFieldValueGroupLabel}:nth-child(1) {\n margin-block-start: 0;\n }\n\n ${StyledStackedFieldValue} {\n grid-column: 1 / -1;\n }\n `}\n\n /* Nested List */\n ${nested &&\n css`\n grid-column: 1 / -1;\n `}\n\n /* As Field Grid */\n ${!flex &&\n css`\n display: grid;\n grid-template-columns: ${`minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr)`};\n column-gap: calc(2 * ${spacing});\n row-gap: calc(${verticalGapSpacingMultiplier} * ${spacing});\n\n ${stacked &&\n css`\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n `}\n\n > ${StyledStackedFieldValue} {\n max-width: ${`${containerWidthCh}ch`};\n }\n\n > ${StyledFieldValue} {\n max-width: calc(${containerWidthMinusLabel} - calc(2 * ${spacing}));\n }\n\n ${isValueComparison &&\n css`\n grid-template-columns: auto auto;\n column-gap: 0;\n row-gap: calc(0.5 * ${spacing});\n max-width: ${`${containerWidthCh}ch`};\n `}\n `}\n\n /* As Flex Container */\n ${flex &&\n css`\n display: flex;\n flex-direction: ${wrapped ? 'column' : 'row'};\n column-gap: calc(${flexGapProp} * ${spacing});\n align-items: flex-start;\n\n max-width: ${`${containerWidthCh}ch`};\n\n ${!wrapped &&\n css`\n > * {\n max-width: ${`${100 / columnCount}%`};\n }\n\n ${hasName && initialLabelNoMargin(true)}\n `}\n\n ${wrapped &&\n css`\n ${hasName && initialLabelNoMargin()}\n\n ${\n !stacked &&\n css`\n > div:not(:first-child) {\n margin-block-start: calc(${verticalGapSpacingMultiplier} * ${spacing});\n }\n `\n }}\n `}\n `}\n\n /* Key / Group Label Spacing */\n ${!nested &&\n css`\n > div {\n + dt {\n margin-block-start: calc(3 * ${spacing});\n }\n\n + ${StyledStackedFieldValue} {\n margin-block-start: calc(3 * ${spacing});\n }\n\n ${!stacked &&\n css`\n + dt + dd {\n margin-block-start: calc(3 * ${spacing});\n }\n `}\n }\n\n ${initialLabelNoMargin()}\n `}\n\n ${stacked &&\n css`\n dt {\n margin-block-start: calc(${verticalGapSpacingMultiplier} * ${spacing});\n }\n `}\n\n ${StyledFieldValueGroupLabel} + div {\n > ${StyledFieldValueGroupLabel}:first-child {\n margin-block-start: 0;\n }\n\n ${initialLabelNoMargin()}\n }\n `;\n }\n);\n\nStyledDetailList.defaultProps = defaultThemeProp;\n"]}
@@ -0,0 +1,9 @@
1
+ export interface DetailsContextValue {
2
+ longestLabelLength?: number;
3
+ setLongestLabelLength?: (val: number) => void;
4
+ mobileView?: boolean;
5
+ depth?: number;
6
+ }
7
+ declare const DetailsContext: import("react").Context<DetailsContextValue>;
8
+ export default DetailsContext;
9
+ //# sourceMappingURL=DetailsContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DetailsContext.d.ts","sourceRoot":"","sources":["../../../src/components/Details/DetailsContext.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,cAAc,8CAKlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { createContext } from 'react';
2
+ const DetailsContext = createContext({
3
+ longestLabelLength: undefined,
4
+ setLongestLabelLength: () => { },
5
+ mobileView: false,
6
+ depth: 1
7
+ });
8
+ export default DetailsContext;
9
+ //# sourceMappingURL=DetailsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DetailsContext.js","sourceRoot":"","sources":["../../../src/components/Details/DetailsContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC,MAAM,cAAc,GAAG,aAAa,CAAsB;IACxD,kBAAkB,EAAE,SAAS;IAC7B,qBAAqB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC/B,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,CAAC;CACT,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC","sourcesContent":["import { createContext } from 'react';\n\nexport interface DetailsContextValue {\n longestLabelLength?: number;\n setLongestLabelLength?: (val: number) => void;\n mobileView?: boolean;\n depth?: number;\n}\n\nconst DetailsContext = createContext<DetailsContextValue>({\n longestLabelLength: undefined,\n setLongestLabelLength: () => {},\n mobileView: false,\n depth: 1\n});\n\nexport default DetailsContext;\n"]}
@@ -1,4 +1,4 @@
1
1
  export { default } from './Details';
2
- export { DetailsProps } from './Details';
3
- export { StyledDetails, StyledHighlightedFields } from './Details';
2
+ export { default as DetailsContext } from './DetailsContext';
3
+ export { StyledFieldValueGroupLabel, StyledDetailList, StyledDetails, StyledHighlightedDetailList } from './Details.styles';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,EACb,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { default } from './Details';
2
- export { StyledDetails, StyledHighlightedFields } from './Details';
2
+ export { default as DetailsContext } from './DetailsContext';
3
+ export { StyledFieldValueGroupLabel, StyledDetailList, StyledDetails, StyledHighlightedDetailList } from './Details.styles';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Details';\nexport { DetailsProps } from './Details';\nexport { StyledDetails, StyledHighlightedFields } from './Details';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,EACb,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './Details';\nexport { default as DetailsContext } from './DetailsContext';\nexport {\n StyledFieldValueGroupLabel,\n StyledDetailList,\n StyledDetails,\n StyledHighlightedDetailList\n} from './Details.styles';\n"]}
@@ -16,7 +16,7 @@ export const StyledGlimpse = styled(Card)(({ theme }) => {
16
16
  });
17
17
  StyledGlimpse.defaultProps = defaultThemeProp;
18
18
  const Glimpse = forwardRef(({ primary, visual, secondary = [], fields = [] }, ref) => {
19
- return (_jsxs(StyledGlimpse, { ref: ref, children: [_jsx(CardHeader, { children: _jsx(SummaryItem, { primary: primary, secondary: _jsx(MetaList, { items: secondary }, void 0), visual: visual }, void 0) }, void 0), !!fields.length && (_jsx(CardContent, { children: _jsx(FieldValueList, { fields: fields }, void 0) }, void 0))] }, void 0));
19
+ return (_jsxs(StyledGlimpse, { ref: ref, children: [_jsx(CardHeader, { children: _jsx(SummaryItem, { primary: primary, secondary: _jsx(MetaList, { items: secondary }), visual: visual }) }), !!fields.length && (_jsx(CardContent, { children: _jsx(FieldValueList, { fields: fields }) }))] }));
20
20
  });
21
21
  export default Glimpse;
22
22
  //# sourceMappingURL=Glimpse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Glimpse.js","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,cAAc,EAId,QAAQ,EAER,oBAAoB,EACpB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAiB5F,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,OAAO,GAAG,CAAA;MACN,iBAAiB;oCACa,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;;MAG/D,oBAAoB;gCACM,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE/C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,OAAO,GAAmD,UAAU,CACxE,CACE,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAiC,EAC/E,GAAwB,EACxB,EAAE;IACF,OAAO,CACL,MAAC,aAAa,IAAC,GAAG,EAAE,GAAG,aACrB,KAAC,UAAU,cACT,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,WAAI,EACzC,MAAM,EAAE,MAAM,WACd,WACS,EACZ,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAClB,KAAC,WAAW,cACV,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,WAAI,WACtB,CACf,YACa,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n BaseProps,\n Card,\n CardContent,\n CardHeader,\n defaultThemeProp,\n FieldValueList,\n FieldValueListProps,\n ForwardProps,\n MenuItemProps,\n MetaList,\n NoChildrenProp,\n StyledFieldValueList,\n SummaryItem\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\n\nexport interface GlimpseProps extends BaseProps, NoChildrenProp {\n /** The unique id for the operator. */\n id: string;\n /** The primary piece of item information as a string. */\n primary: MenuItemProps['primary'];\n /** Secondary info about an item. Useful for additional metadata or context. */\n secondary?: MenuItemProps['secondary'];\n /** A visual to assist identifying an item. e.g. Avatar or Icon. */\n visual?: MenuItemProps['visual'];\n /** The set of field values to render in the list. */\n fields?: FieldValueListProps['fields'];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledGlimpse = styled(Card)(({ theme }) => {\n return css`\n ${StyledCardContent} {\n border-top: solid 0.0625rem ${theme.base.palette['border-line']};\n }\n\n ${StyledFieldValueList} {\n padding-top: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledGlimpse.defaultProps = defaultThemeProp;\n\nconst Glimpse: FunctionComponent<GlimpseProps & ForwardProps> = forwardRef(\n (\n { primary, visual, secondary = [], fields = [] }: PropsWithoutRef<GlimpseProps>,\n ref: GlimpseProps['ref']\n ) => {\n return (\n <StyledGlimpse ref={ref}>\n <CardHeader>\n <SummaryItem\n primary={primary}\n secondary={<MetaList items={secondary} />}\n visual={visual}\n />\n </CardHeader>\n {!!fields.length && (\n <CardContent>\n <FieldValueList fields={fields} />\n </CardContent>\n )}\n </StyledGlimpse>\n );\n }\n);\n\nexport default Glimpse;\n"]}
1
+ {"version":3,"file":"Glimpse.js","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,cAAc,EAId,QAAQ,EAER,oBAAoB,EACpB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAiB5F,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,OAAO,GAAG,CAAA;MACN,iBAAiB;oCACa,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;;MAG/D,oBAAoB;gCACM,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE/C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,OAAO,GAAmD,UAAU,CACxE,CACE,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAiC,EAC/E,GAAwB,EACxB,EAAE;IACF,OAAO,CACL,MAAC,aAAa,IAAC,GAAG,EAAE,GAAG,aACrB,KAAC,UAAU,cACT,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,GAAI,EACzC,MAAM,EAAE,MAAM,GACd,GACS,EACZ,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAClB,KAAC,WAAW,cACV,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,GAAI,GACtB,CACf,IACa,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n BaseProps,\n Card,\n CardContent,\n CardHeader,\n defaultThemeProp,\n FieldValueList,\n FieldValueListProps,\n ForwardProps,\n MenuItemProps,\n MetaList,\n NoChildrenProp,\n StyledFieldValueList,\n SummaryItem\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\n\nexport interface GlimpseProps extends BaseProps, NoChildrenProp {\n /** The unique id for the operator. */\n id: string;\n /** The primary piece of item information as a string. */\n primary: MenuItemProps['primary'];\n /** Secondary info about an item. Useful for additional metadata or context. */\n secondary?: MenuItemProps['secondary'];\n /** A visual to assist identifying an item. e.g. Avatar or Icon. */\n visual?: MenuItemProps['visual'];\n /** The set of field values to render in the list. */\n fields?: FieldValueListProps['fields'];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledGlimpse = styled(Card)(({ theme }) => {\n return css`\n ${StyledCardContent} {\n border-top: solid 0.0625rem ${theme.base.palette['border-line']};\n }\n\n ${StyledFieldValueList} {\n padding-top: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledGlimpse.defaultProps = defaultThemeProp;\n\nconst Glimpse: FunctionComponent<GlimpseProps & ForwardProps> = forwardRef(\n (\n { primary, visual, secondary = [], fields = [] }: PropsWithoutRef<GlimpseProps>,\n ref: GlimpseProps['ref']\n ) => {\n return (\n <StyledGlimpse ref={ref}>\n <CardHeader>\n <SummaryItem\n primary={primary}\n secondary={<MetaList items={secondary} />}\n visual={visual}\n />\n </CardHeader>\n {!!fields.length && (\n <CardContent>\n <FieldValueList fields={fields} />\n </CardContent>\n )}\n </StyledGlimpse>\n );\n }\n);\n\nexport default Glimpse;\n"]}
@@ -33,13 +33,13 @@ const Filter = ({ onFilterChange, onClearFilter, name, expanded = true, ...contr
33
33
  if (filterOption.checked)
34
34
  filterActive = true;
35
35
  return (_jsx(SelectFilter, { id: filterOption.id, name: filterOption.name, label: filterOption.label, checked: filterOption.checked }, filterOption.id));
36
- }) }, void 0));
36
+ }) }));
37
37
  break;
38
38
  }
39
39
  default:
40
40
  filterControl = null;
41
41
  }
42
- return (_jsxs(StyledFilter, { children: [_jsxs(Flex, { container: { justify: 'between' }, children: [_jsxs(Flex, { as: StyledFilterButton, container: { gap: 1, alignItems: 'center' }, variant: 'text', onClick: () => setFilterExpanded(curr => !curr), "aria-expanded": filterExpanded, "aria-label": t(filterExpanded ? 'collapse_noun' : 'expand_noun', [name]), children: [_jsx(Icon, { name: 'caret-down' }, void 0), _jsx(Text, { variant: 'h3', as: 'span', children: name }, void 0)] }, void 0), filterActive && (_jsx(Button, { variant: 'link', onClick: () => onClearFilter?.(name), children: t('clear') }, void 0))] }, void 0), _jsx(ExpandCollapse, { collapsed: !filterExpanded, children: filterControl }, void 0)] }, void 0));
42
+ return (_jsxs(StyledFilter, { children: [_jsxs(Flex, { container: { justify: 'between' }, children: [_jsxs(Flex, { as: StyledFilterButton, container: { gap: 1, alignItems: 'center' }, variant: 'text', onClick: () => setFilterExpanded(curr => !curr), "aria-expanded": filterExpanded, "aria-label": t(filterExpanded ? 'collapse_noun' : 'expand_noun', [name]), children: [_jsx(Icon, { name: 'caret-down' }), _jsx(Text, { variant: 'h3', as: 'span', children: name })] }), filterActive && (_jsx(Button, { variant: 'link', onClick: () => onClearFilter?.(name), children: t('clear') }))] }), _jsx(ExpandCollapse, { collapsed: !filterExpanded, children: filterControl })] }));
43
43
  };
44
44
  export default Filter;
45
45
  //# sourceMappingURL=Filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../src/components/SearchResults/Filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,QAAQ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,EACN,YAAY,IAAI,CACf,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,YACxD,CAAC,CAAC,OAAO,CAAC,WACJ,CACV,YACI,EACP,KAAC,cAAc,IAAC,SAAS,EAAE,CAAC,cAAc,YAAG,aAAa,WAAkB,YAC/D,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { useState } from 'react';\n\nimport {\n Button,\n Checkbox,\n CheckboxGroup,\n ExpandCollapse,\n Flex,\n Icon,\n registerIcon,\n RadioButton,\n RadioButtonGroup,\n Text,\n useI18n\n} from '@pega/cosmos-react-core';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\n\nimport { FilterProps, SearchResultsProps, SelectFilterItemProps } from './SearchResults.types';\nimport { StyledFilter, StyledFilterButton } from './SearchResults.styles';\n\nregisterIcon(caretDownIcon);\n\ninterface FilterComponentProps {\n onFilterChange?: SearchResultsProps['onFilterChange'];\n onClearFilter?: SearchResultsProps['onClearFilter'];\n}\n\nconst Filter = ({\n onFilterChange,\n onClearFilter,\n name,\n expanded = true,\n ...control\n}: FilterProps & FilterComponentProps): JSX.Element => {\n const t = useI18n();\n const [filterExpanded, setFilterExpanded] = useState(expanded);\n\n let filterControl;\n let filterActive = false;\n // eslint-disable-next-line sonarjs/no-small-switch\n switch (control.type) {\n case 'select': {\n const { selectType, items } = control;\n let SelectFilterGroup = CheckboxGroup;\n let SelectFilter = Checkbox;\n if (selectType === 'single-select') {\n SelectFilterGroup = RadioButtonGroup;\n SelectFilter = RadioButton;\n }\n filterControl = (\n <SelectFilterGroup\n label={name}\n labelHidden\n onChange={e => {\n const item = items.find((x: SelectFilterItemProps) => x.id === e.target.id);\n if (!item) return;\n const newItem = { ...item, checked: !item.checked };\n\n onFilterChange?.({\n name,\n type: control.type,\n value: newItem\n });\n }}\n >\n {control.items.map((filterOption: SelectFilterItemProps) => {\n if (filterOption.checked) filterActive = true;\n return (\n <SelectFilter\n key={filterOption.id}\n id={filterOption.id}\n name={filterOption.name}\n label={filterOption.label}\n checked={filterOption.checked}\n />\n );\n })}\n </SelectFilterGroup>\n );\n break;\n }\n default:\n filterControl = null;\n }\n\n return (\n <StyledFilter>\n <Flex container={{ justify: 'between' }}>\n <Flex\n as={StyledFilterButton}\n container={{ gap: 1, alignItems: 'center' }}\n variant='text'\n onClick={() => setFilterExpanded(curr => !curr)}\n aria-expanded={filterExpanded}\n aria-label={t(filterExpanded ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Icon name='caret-down' />\n <Text variant='h3' as='span'>\n {name}\n </Text>\n </Flex>\n {filterActive && (\n <Button variant='link' onClick={() => onClearFilter?.(name)}>\n {t('clear')}\n </Button>\n )}\n </Flex>\n <ExpandCollapse collapsed={!filterExpanded}>{filterControl}</ExpandCollapse>\n </StyledFilter>\n );\n};\n\nexport default Filter;\n"]}
1
+ {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../src/components/SearchResults/Filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,IAAI,EACJ,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAGnG,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,YAAY,CAAC,aAAa,CAAC,CAAC;AAO5B,MAAM,MAAM,GAAG,CAAC,EACd,cAAc,EACd,aAAa,EACb,IAAI,EACJ,QAAQ,GAAG,IAAI,EACf,GAAG,OAAO,EACyB,EAAe,EAAE;IACpD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAC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,KAAK,EAAE,YAAY,CAAC,KAAK,EACzB,OAAO,EAAE,YAAY,CAAC,OAAO,IAJxB,YAAY,CAAC,EAAE,CAKpB,CACH,CAAC;gBACJ,CAAC,CAAC,GACgB,CACrB,CAAC;YACF,MAAM;SACP;QACD;YACE,aAAa,GAAG,IAAI,CAAC;KACxB;IAED,OAAO,CACL,MAAC,YAAY,eACX,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,aACrC,MAAC,IAAI,IACH,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAC3C,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,mBAChC,cAAc,gBACjB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,aAEvE,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,EAC1B,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAC,MAAM,YACzB,IAAI,GACA,IACF,EACN,YAAY,IAAI,CACf,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,YACxD,CAAC,CAAC,OAAO,CAAC,GACJ,CACV,IACI,EACP,KAAC,cAAc,IAAC,SAAS,EAAE,CAAC,cAAc,YAAG,aAAa,GAAkB,IAC/D,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { useState } from 'react';\n\nimport {\n Button,\n Checkbox,\n CheckboxGroup,\n ExpandCollapse,\n Flex,\n Icon,\n registerIcon,\n RadioButton,\n RadioButtonGroup,\n Text,\n useI18n\n} from '@pega/cosmos-react-core';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\n\nimport { FilterProps, SearchResultsProps, SelectFilterItemProps } from './SearchResults.types';\nimport { StyledFilter, StyledFilterButton } from './SearchResults.styles';\n\nregisterIcon(caretDownIcon);\n\ninterface FilterComponentProps {\n onFilterChange?: SearchResultsProps['onFilterChange'];\n onClearFilter?: SearchResultsProps['onClearFilter'];\n}\n\nconst Filter = ({\n onFilterChange,\n onClearFilter,\n name,\n expanded = true,\n ...control\n}: FilterProps & FilterComponentProps): JSX.Element => {\n const t = useI18n();\n const [filterExpanded, setFilterExpanded] = useState(expanded);\n\n let filterControl;\n let filterActive = false;\n // eslint-disable-next-line sonarjs/no-small-switch\n switch (control.type) {\n case 'select': {\n const { selectType, items } = control;\n let SelectFilterGroup = CheckboxGroup;\n let SelectFilter = Checkbox;\n if (selectType === 'single-select') {\n SelectFilterGroup = RadioButtonGroup;\n SelectFilter = RadioButton;\n }\n filterControl = (\n <SelectFilterGroup\n label={name}\n labelHidden\n onChange={e => {\n const item = items.find((x: SelectFilterItemProps) => x.id === e.target.id);\n if (!item) return;\n const newItem = { ...item, checked: !item.checked };\n\n onFilterChange?.({\n name,\n type: control.type,\n value: newItem\n });\n }}\n >\n {control.items.map((filterOption: SelectFilterItemProps) => {\n if (filterOption.checked) filterActive = true;\n return (\n <SelectFilter\n key={filterOption.id}\n id={filterOption.id}\n name={filterOption.name}\n label={filterOption.label}\n checked={filterOption.checked}\n />\n );\n })}\n </SelectFilterGroup>\n );\n break;\n }\n default:\n filterControl = null;\n }\n\n return (\n <StyledFilter>\n <Flex container={{ justify: 'between' }}>\n <Flex\n as={StyledFilterButton}\n container={{ gap: 1, alignItems: 'center' }}\n variant='text'\n onClick={() => setFilterExpanded(curr => !curr)}\n aria-expanded={filterExpanded}\n aria-label={t(filterExpanded ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Icon name='caret-down' />\n <Text variant='h3' as='span'>\n {name}\n </Text>\n </Flex>\n {filterActive && (\n <Button variant='link' onClick={() => onClearFilter?.(name)}>\n {t('clear')}\n </Button>\n )}\n </Flex>\n <ExpandCollapse collapsed={!filterExpanded}>{filterControl}</ExpandCollapse>\n </StyledFilter>\n );\n};\n\nexport default Filter;\n"]}
@@ -1,4 +1,4 @@
1
1
  import { SearchResultProps } from './SearchResults.types';
2
- declare const SearchResult: ({ id, title, link, description, meta }: SearchResultProps) => JSX.Element;
2
+ declare const SearchResult: ({ title, link, description, meta, accent }: SearchResultProps) => JSX.Element;
3
3
  export default SearchResult;
4
4
  //# sourceMappingURL=SearchResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResult.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAmB1D,QAAA,MAAM,YAAY,2CAMf,iBAAiB,KAAG,WAetB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SearchResult.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAyB1D,QAAA,MAAM,YAAY,+CAMf,iBAAiB,KAAG,WActB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled, { css } from 'styled-components';
3
- import { defaultThemeProp, Text, MetaList, Link, Flex, StyledPopover, calculateFontSize } from '@pega/cosmos-react-core';
3
+ import { defaultThemeProp, Text, MetaList, Link, Flex, StyledPopover, calculateFontSize, replaceMatchWithElement, Mark } from '@pega/cosmos-react-core';
4
4
  const StyledSearchResult = styled.article(({ theme }) => {
5
5
  const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
6
6
  return css `
@@ -8,14 +8,20 @@ const StyledSearchResult = styled.article(({ theme }) => {
8
8
  font-size: ${fontSize.s};
9
9
  font-weight: ${theme.base['font-weight'].normal};
10
10
  }
11
+ padding-block-end: calc(2 * ${theme.base.spacing});
12
+ border-bottom: 0.0125rem solid ${theme.base.palette['border-line']};
13
+
14
+ &:last-of-type {
15
+ border-bottom: none;
16
+ }
11
17
  `;
12
18
  });
13
19
  StyledSearchResult.defaultProps = defaultThemeProp;
14
20
  const StyledDescription = styled(Text) `
15
21
  word-break: break-word;
16
22
  `;
17
- const SearchResult = ({ id, title, link, description, meta = [] }) => {
18
- return (_jsxs(Flex, { as: StyledSearchResult, container: { direction: 'column', gap: 1 }, children: [_jsxs(Flex, { container: { direction: 'column-reverse' }, children: [_jsx(Text, { variant: 'h2', children: _jsx(Link, { ...link, children: title }, void 0) }, void 0), _jsx(Text, { variant: 'secondary', as: 'div', children: id }, void 0)] }, void 0), description && _jsx(StyledDescription, { forwardedAs: 'p', children: description }, void 0), !!meta.length && _jsx(MetaList, { items: meta }, void 0)] }, void 0));
23
+ const SearchResult = ({ title, link, description, meta = [], accent }) => {
24
+ return (_jsxs(Flex, { as: StyledSearchResult, container: { direction: 'column', gap: 1 }, children: [_jsxs(Flex, { container: { direction: 'column' }, children: [_jsx(Text, { variant: 'h2', children: _jsx(Link, { ...link, children: accent ? replaceMatchWithElement(title, accent, match => _jsx(Mark, { children: match })) : title }) }), !!meta.length && _jsx(MetaList, { items: meta })] }), description && _jsx(StyledDescription, { forwardedAs: 'p', children: description })] }));
19
25
  };
20
26
  export default SearchResult;
21
27
  //# sourceMappingURL=SearchResult.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResult.js","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,iBA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CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Text,\n MetaList,\n Link,\n Flex,\n StyledPopover,\n calculateFontSize\n} from '@pega/cosmos-react-core';\n\nimport { SearchResultProps } from './SearchResults.types';\n\nconst StyledSearchResult = styled.article(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n h2 ${StyledPopover} {\n font-size: ${fontSize.s};\n font-weight: ${theme.base['font-weight'].normal};\n }\n `;\n});\n\nStyledSearchResult.defaultProps = defaultThemeProp;\n\nconst StyledDescription = styled(Text)`\n word-break: break-word;\n`;\n\nconst SearchResult = ({\n id,\n title,\n link,\n description,\n meta = []\n}: SearchResultProps): JSX.Element => {\n return (\n <Flex as={StyledSearchResult} container={{ direction: 'column', gap: 1 }}>\n <Flex container={{ direction: 'column-reverse' }}>\n <Text variant='h2'>\n <Link {...link}>{title}</Link>\n </Text>\n <Text variant='secondary' as='div'>\n {id}\n </Text>\n </Flex>\n {description && <StyledDescription forwardedAs='p'>{description}</StyledDescription>}\n {!!meta.length && <MetaList items={meta} />}\n </Flex>\n );\n};\n\nexport default SearchResult;\n"]}
1
+ {"version":3,"file":"SearchResult.js","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,uBAAuB,EACvB,IAAI,EACL,MAAM,yBAAyB,CAAC;AAIjC,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC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\n StyledPopover,\n calculateFontSize,\n replaceMatchWithElement,\n Mark\n} from '@pega/cosmos-react-core';\n\nimport { SearchResultProps } from './SearchResults.types';\n\nconst StyledSearchResult = styled.article(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n h2 ${StyledPopover} {\n font-size: ${fontSize.s};\n font-weight: ${theme.base['font-weight'].normal};\n }\n padding-block-end: calc(2 * ${theme.base.spacing});\n border-bottom: 0.0125rem solid ${theme.base.palette['border-line']};\n\n &:last-of-type {\n border-bottom: none;\n }\n `;\n});\n\nStyledSearchResult.defaultProps = defaultThemeProp;\n\nconst StyledDescription = styled(Text)`\n word-break: break-word;\n`;\n\nconst SearchResult = ({\n title,\n link,\n description,\n meta = [],\n accent\n}: SearchResultProps): JSX.Element => {\n return (\n <Flex as={StyledSearchResult} container={{ direction: 'column', gap: 1 }}>\n <Flex container={{ direction: 'column' }}>\n <Text variant='h2'>\n <Link {...link}>\n {accent ? replaceMatchWithElement(title, accent, match => <Mark>{match}</Mark>) : title}\n </Link>\n </Text>\n {!!meta.length && <MetaList items={meta} />}\n </Flex>\n {description && <StyledDescription forwardedAs='p'>{description}</StyledDescription>}\n </Flex>\n );\n};\n\nexport default SearchResult;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAGlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAML,YAAY,EAcb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EACL,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AA2E/B,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAgMvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAIlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAIL,YAAY,EAmBb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EACL,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AA6E/B,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CA0OvE,CAAC;AAEF,eAAe,aAAa,CAAC"}