@pega/cosmos-react-work 4.0.0-dev.9.1 → 4.0.0-rc.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.
Files changed (251) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +7 -21
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +3 -2
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  5. package/lib/components/AppAnnouncement/index.d.ts +1 -1
  6. package/lib/components/AppAnnouncement/index.d.ts.map +1 -1
  7. package/lib/components/AppAnnouncement/index.js.map +1 -1
  8. package/lib/components/Article/Article.d.ts +49 -0
  9. package/lib/components/Article/Article.d.ts.map +1 -0
  10. package/lib/components/Article/Article.js +73 -0
  11. package/lib/components/Article/Article.js.map +1 -0
  12. package/lib/components/Article/ArticleFooter.d.ts +40 -0
  13. package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
  14. package/lib/components/Article/ArticleFooter.js +54 -0
  15. package/lib/components/Article/ArticleFooter.js.map +1 -0
  16. package/lib/components/Article/ArticleMeta.d.ts +13 -0
  17. package/lib/components/Article/ArticleMeta.d.ts.map +1 -0
  18. package/lib/components/Article/ArticleMeta.js +24 -0
  19. package/lib/components/Article/ArticleMeta.js.map +1 -0
  20. package/lib/components/Article/index.d.ts +5 -0
  21. package/lib/components/Article/index.d.ts.map +1 -0
  22. package/lib/components/Article/index.js +3 -0
  23. package/lib/components/Article/index.js.map +1 -0
  24. package/lib/components/ArticleList/ArticleList.d.ts +6 -0
  25. package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
  26. package/lib/components/ArticleList/ArticleList.js +137 -0
  27. package/lib/components/ArticleList/ArticleList.js.map +1 -0
  28. package/lib/components/ArticleList/ArticleList.types.d.ts +87 -0
  29. package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
  30. package/lib/components/ArticleList/ArticleList.types.js +2 -0
  31. package/lib/components/ArticleList/ArticleList.types.js.map +1 -0
  32. package/lib/components/ArticleList/ArticleListFilter.d.ts +6 -0
  33. package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -0
  34. package/lib/components/ArticleList/ArticleListFilter.js +61 -0
  35. package/lib/components/ArticleList/ArticleListFilter.js.map +1 -0
  36. package/lib/components/ArticleList/ArticleListHeader.d.ts +5 -0
  37. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
  38. package/lib/components/ArticleList/ArticleListHeader.js +20 -0
  39. package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
  40. package/lib/components/ArticleList/ArticleSummary.d.ts +7 -0
  41. package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
  42. package/lib/components/ArticleList/ArticleSummary.js +56 -0
  43. package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
  44. package/lib/components/ArticleList/index.d.ts +6 -0
  45. package/lib/components/ArticleList/index.d.ts.map +1 -0
  46. package/lib/components/ArticleList/index.js +4 -0
  47. package/lib/components/ArticleList/index.js.map +1 -0
  48. package/lib/components/Assignments/Assignments.d.ts +21 -0
  49. package/lib/components/Assignments/Assignments.d.ts.map +1 -0
  50. package/lib/components/Assignments/Assignments.js +20 -0
  51. package/lib/components/Assignments/Assignments.js.map +1 -0
  52. package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
  53. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
  54. package/lib/components/Assignments/Assignments.styles.js +41 -0
  55. package/lib/components/Assignments/Assignments.styles.js.map +1 -0
  56. package/lib/components/Assignments/index.d.ts +2 -0
  57. package/lib/components/Assignments/index.d.ts.map +1 -0
  58. package/lib/components/Assignments/index.js +2 -0
  59. package/lib/components/Assignments/index.js.map +1 -0
  60. package/lib/components/CasePreview/CasePreview.d.ts +9 -4
  61. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  62. package/lib/components/CasePreview/CasePreview.js +7 -10
  63. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  64. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
  65. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
  66. package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
  67. package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
  68. package/lib/components/CasePreview/index.d.ts +1 -1
  69. package/lib/components/CasePreview/index.d.ts.map +1 -1
  70. package/lib/components/CasePreview/index.js.map +1 -1
  71. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
  72. package/lib/components/CaseView/CaseHeader/CaseHeader.js +119 -0
  73. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
  74. package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
  75. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
  76. package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
  77. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
  78. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -1
  79. package/lib/components/CaseView/CaseSummary.js +9 -4
  80. package/lib/components/CaseView/CaseSummary.js.map +1 -1
  81. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -1
  82. package/lib/components/CaseView/CaseSummaryFields.js +12 -3
  83. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -1
  84. package/lib/components/CaseView/CaseView.d.ts +4 -2
  85. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  86. package/lib/components/CaseView/CaseView.js +174 -67
  87. package/lib/components/CaseView/CaseView.js.map +1 -1
  88. package/lib/components/CaseView/CaseView.styles.d.ts +45 -22
  89. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  90. package/lib/components/CaseView/CaseView.styles.js +298 -79
  91. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  92. package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
  93. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
  94. package/lib/components/CaseView/CaseView.test-ids.js +17 -0
  95. package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
  96. package/lib/components/CaseView/CaseView.types.d.ts +23 -24
  97. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  98. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  99. package/lib/components/CaseView/UtilitiesSummary.d.ts +0 -1
  100. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  101. package/lib/components/CaseView/UtilitiesSummary.js +4 -8
  102. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  103. package/lib/components/CaseView/index.d.ts +1 -6
  104. package/lib/components/CaseView/index.d.ts.map +1 -1
  105. package/lib/components/CaseView/index.js +0 -4
  106. package/lib/components/CaseView/index.js.map +1 -1
  107. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
  108. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +1 -1
  109. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
  110. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +1 -3
  111. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
  112. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -1
  113. package/lib/components/ConfigurableLayout/index.d.ts +1 -1
  114. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -1
  115. package/lib/components/ConfigurableLayout/index.js.map +1 -1
  116. package/lib/components/Confirmation/Confirmation.d.ts +1 -1
  117. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  118. package/lib/components/Confirmation/Confirmation.js +20 -5
  119. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  120. package/lib/components/Confirmation/index.d.ts +1 -1
  121. package/lib/components/Confirmation/index.d.ts.map +1 -1
  122. package/lib/components/Confirmation/index.js.map +1 -1
  123. package/lib/components/Details/Details.d.ts +8 -4
  124. package/lib/components/Details/Details.d.ts.map +1 -1
  125. package/lib/components/Details/Details.js +33 -21
  126. package/lib/components/Details/Details.js.map +1 -1
  127. package/lib/components/Details/Details.styles.d.ts +7 -4
  128. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  129. package/lib/components/Details/Details.styles.js +46 -101
  130. package/lib/components/Details/Details.styles.js.map +1 -1
  131. package/lib/components/Details/Details.test-ids.d.ts +2 -0
  132. package/lib/components/Details/Details.test-ids.d.ts.map +1 -0
  133. package/lib/components/Details/Details.test-ids.js +9 -0
  134. package/lib/components/Details/Details.test-ids.js.map +1 -0
  135. package/lib/components/Glimpse/Glimpse.d.ts +10 -10
  136. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  137. package/lib/components/Glimpse/Glimpse.js +7 -17
  138. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  139. package/lib/components/Glimpse/index.d.ts +1 -1
  140. package/lib/components/Glimpse/index.d.ts.map +1 -1
  141. package/lib/components/Glimpse/index.js +0 -1
  142. package/lib/components/Glimpse/index.js.map +1 -1
  143. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  144. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +38 -27
  145. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  146. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +3 -2
  147. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  148. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +137 -81
  149. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  150. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +9 -9
  151. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -1
  152. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -1
  153. package/lib/components/IntelligentGuidance/index.d.ts +1 -1
  154. package/lib/components/IntelligentGuidance/index.d.ts.map +1 -1
  155. package/lib/components/IntelligentGuidance/index.js.map +1 -1
  156. package/lib/components/Predictions/Predictions.d.ts +6 -0
  157. package/lib/components/Predictions/Predictions.d.ts.map +1 -0
  158. package/lib/components/Predictions/Predictions.js +68 -0
  159. package/lib/components/Predictions/Predictions.js.map +1 -0
  160. package/lib/components/Predictions/Predictions.types.d.ts +23 -0
  161. package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
  162. package/lib/components/Predictions/Predictions.types.js +2 -0
  163. package/lib/components/Predictions/Predictions.types.js.map +1 -0
  164. package/lib/components/Predictions/index.d.ts +3 -0
  165. package/lib/components/Predictions/index.d.ts.map +1 -0
  166. package/lib/components/Predictions/index.js +2 -0
  167. package/lib/components/Predictions/index.js.map +1 -0
  168. package/lib/components/SearchResults/SearchResults.js +1 -1
  169. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  170. package/lib/components/SearchResults/SearchResults.types.d.ts +5 -5
  171. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
  172. package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
  173. package/lib/components/SearchResults/index.d.ts +1 -1
  174. package/lib/components/SearchResults/index.d.ts.map +1 -1
  175. package/lib/components/SearchResults/index.js.map +1 -1
  176. package/lib/components/Stages/Stages.d.ts.map +1 -1
  177. package/lib/components/Stages/Stages.js +8 -8
  178. package/lib/components/Stages/Stages.js.map +1 -1
  179. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  180. package/lib/components/Stages/Stages.styles.js +0 -2
  181. package/lib/components/Stages/Stages.styles.js.map +1 -1
  182. package/lib/components/Stages/index.d.ts +1 -1
  183. package/lib/components/Stages/index.d.ts.map +1 -1
  184. package/lib/components/Stages/index.js.map +1 -1
  185. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  186. package/lib/components/Stakeholders/Stakeholders.js +3 -3
  187. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  188. package/lib/components/Stakeholders/Stakeholders.types.d.ts +5 -13
  189. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -1
  190. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -1
  191. package/lib/components/Stakeholders/index.d.ts +1 -1
  192. package/lib/components/Stakeholders/index.d.ts.map +1 -1
  193. package/lib/components/Stakeholders/index.js.map +1 -1
  194. package/lib/components/Tags/Tags.d.ts +1 -1
  195. package/lib/components/Tags/Tags.d.ts.map +1 -1
  196. package/lib/components/Tags/Tags.js +5 -21
  197. package/lib/components/Tags/Tags.js.map +1 -1
  198. package/lib/components/Tags/index.d.ts +2 -1
  199. package/lib/components/Tags/index.d.ts.map +1 -1
  200. package/lib/components/Tags/index.js.map +1 -1
  201. package/lib/components/Tasks/TaskList.d.ts +18 -7
  202. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  203. package/lib/components/Tasks/TaskList.js +48 -10
  204. package/lib/components/Tasks/TaskList.js.map +1 -1
  205. package/lib/components/Tasks/Tasks.d.ts +21 -15
  206. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  207. package/lib/components/Tasks/Tasks.js +9 -9
  208. package/lib/components/Tasks/Tasks.js.map +1 -1
  209. package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
  210. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
  211. package/lib/components/Tasks/Tasks.test-ids.js +5 -0
  212. package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
  213. package/lib/components/Tasks/index.d.ts +3 -5
  214. package/lib/components/Tasks/index.d.ts.map +1 -1
  215. package/lib/components/Tasks/index.js +1 -0
  216. package/lib/components/Tasks/index.js.map +1 -1
  217. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  218. package/lib/components/Timeline/Timeline.js +15 -13
  219. package/lib/components/Timeline/Timeline.js.map +1 -1
  220. package/lib/components/Timeline/Timeline.styles.d.ts +4 -5
  221. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  222. package/lib/components/Timeline/Timeline.styles.js +28 -53
  223. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  224. package/lib/components/Timeline/Timeline.types.d.ts +8 -8
  225. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  226. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  227. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  228. package/lib/components/Timeline/TimelineItem.js +19 -7
  229. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  230. package/lib/components/Timeline/TimelineToolbar.js +1 -1
  231. package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
  232. package/lib/components/Timeline/index.d.ts +1 -1
  233. package/lib/components/Timeline/index.d.ts.map +1 -1
  234. package/lib/components/Timeline/index.js.map +1 -1
  235. package/lib/components/Timeline/utils.d.ts +1 -0
  236. package/lib/components/Timeline/utils.d.ts.map +1 -1
  237. package/lib/components/Timeline/utils.js +12 -0
  238. package/lib/components/Timeline/utils.js.map +1 -1
  239. package/lib/index.d.ts +8 -0
  240. package/lib/index.d.ts.map +1 -1
  241. package/lib/index.js +8 -0
  242. package/lib/index.js.map +1 -1
  243. package/package.json +14 -14
  244. package/lib/components/CaseView/CaseHeader.d.ts.map +0 -1
  245. package/lib/components/CaseView/CaseHeader.js +0 -49
  246. package/lib/components/CaseView/CaseHeader.js.map +0 -1
  247. package/lib/components/CaseView/MobileCaseView.d.ts +0 -13
  248. package/lib/components/CaseView/MobileCaseView.d.ts.map +0 -1
  249. package/lib/components/CaseView/MobileCaseView.js +0 -25
  250. package/lib/components/CaseView/MobileCaseView.js.map +0 -1
  251. /package/lib/components/CaseView/{CaseHeader.d.ts → CaseHeader/CaseHeader.d.ts} +0 -0
@@ -1 +1 @@
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,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AAC,CAAC,CAAC,KAAC,cAAc,IAAC,SAAS,EAAE,CAAC,IAAI,YAAG,OAAO,GAAkB,CAAC,CAAC,CAAC,OAAO,IACvE,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 ExpandCollapse,\n Button,\n Flex,\n Icon,\n useI18n\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\nexport interface DetailsProps {\n highlightedData?: ReactNode[];\n children?: ReactNode;\n /** Text used as heading of list */\n name?: string;\n /**\n * Whether the items children can be collapsed (only applies if name is provided)\n * @default false\n */\n collapsible?: boolean;\n /**\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 collapsible = 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 t = useI18n();\n\n const [flexContextMobileView, setFlexContextMobileView] = useState(false);\n const [open, setOpen] = useState(true);\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 /**\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 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 const nameText = useMemo(() => {\n return (\n <Text variant={`h${Math.min(headingDepth, 6)}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'}>\n {name}\n </Text>\n );\n }, [name, headingDepth]);\n\n const details = useMemo(() => {\n return (\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 </>\n );\n }, [\n highlightedData,\n nested,\n columnCount,\n labelLength,\n applyMobileView,\n name,\n asFlex,\n flexRow,\n valueComparison,\n children\n ]);\n\n return (\n <DetailsContext.Provider value={contextValue}>\n <StyledDetails>\n {name && (\n <StyledFieldValueGroupLabel>\n {collapsible ? (\n <Button\n type='button'\n variant='text'\n onClick={() => {\n setOpen(cur => !cur);\n }}\n aria-expanded={open ? 'true' : 'false'}\n aria-label={t(open ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Flex container={{ alignItems: 'center', gap: 0.5 }} as='span'>\n <Icon name='caret-right' />\n {nameText}\n </Flex>\n </Button>\n ) : (\n nameText\n )}\n </StyledFieldValueGroupLabel>\n )}\n\n {collapsible ? <ExpandCollapse collapsed={!open}>{details}</ExpandCollapse> : details}\n </StyledDetails>\n </DetailsContext.Provider>\n );\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,EAER,cAAc,EACd,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,yBAAyB,EACzB,OAAO,EAEP,IAAI,EAEJ,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,o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C,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE;4BACZ,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;wBACvB,CAAC,mBACc,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,gBAC1B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,YAE7D,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAC,MAAM,aAC5D,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,EAC1B,QAAQ,IACJ,GACA,CACV,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,GAC0B,CAC9B,EAEA,WAAW,IAAI,CACd,KAAC,uBAAuB,mBAAc,OAAO,CAAC,WAAW,YACvD,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,OAAO,EAAE,WAAW,GAAI,GACb,CAC3B,EAEA,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,cAAc,mBAAc,OAAO,CAAC,cAAc,EAAE,SAAS,EAAE,CAAC,IAAI,YAClE,OAAO,GACO,CAClB,CAAC,CAAC,CAAC,CACF,OAAO,CACR,IACa,GACQ,CAC3B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,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 ExpandCollapse,\n Button,\n Flex,\n Icon,\n useChToPxConversionFactor,\n useI18n,\n HeadingTag,\n HTML,\n TestIdProp,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\n\nimport { getDetailsTestIds } from './Details.test-ids';\nimport DetailsContext from './DetailsContext';\nimport {\n StyledFieldValueGroupLabel,\n StyledDetails,\n StyledDetailList,\n StyledHighlightedDetailList,\n flexGapProp,\n StyledDetailDescription\n} from './Details.styles';\n\nexport interface DetailsProps extends TestIdProp {\n highlightedData?: ReactNode[];\n children?: ReactNode;\n /** Text used as heading of list */\n name?: string;\n /** Copy placed in paragraph below the name */\n description?: string;\n /**\n * Whether the items children can be collapsed (only applies if name is provided)\n * @default false\n */\n collapsible?: boolean;\n /**\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(function Details(\n {\n testId,\n highlightedData,\n children,\n name,\n description,\n columnCount = 1,\n nested = false,\n asFlex = false,\n valueComparison = false,\n collapsible = false\n },\n ref\n) {\n const {\n longestLabelLength,\n mobileView: inMobileView,\n depth,\n ...context\n } = useContext(DetailsContext);\n const {\n base: {\n 'content-width': { sm: smContentWidth }\n }\n } = useTheme();\n const isSmallOrAbove = useBreakpoint('sm');\n const listRef = useConsolidatedRef<HTMLDListElement>(ref);\n const isXsContentWidthOrAbove = useBreakpoint('xs', {\n breakpointRef: listRef,\n themeProp: 'content-width'\n });\n const isMdContentWidthOrAbove = useBreakpoint('md', {\n breakpointRef: listRef,\n themeProp: 'content-width'\n });\n const flexRow = useBreakpoint(columnCount > 2 ? 'lg' : 'md', {\n breakpointRef: listRef,\n themeProp: 'content-width'\n });\n const t = useI18n();\n const testIds = useTestIds(testId, getDetailsTestIds);\n\n const [flexContextMobileView, setFlexContextMobileView] = useState(false);\n const [open, setOpen] = useState(true);\n\n const labelLength = Math.max(14, Math.min(longestLabelLength ?? 16, 40));\n const headingDepth = depth ?? 1;\n const applyMobileView =\n inMobileView ||\n !isSmallOrAbove ||\n !isXsContentWidthOrAbove ||\n (asFlex && flexRow && flexContextMobileView);\n\n const chToPxConversionFactor = useChToPxConversionFactor();\n\n // Mount resize observer to update flex context mobile view & run initial check.\n useEffect(() => {\n const checkBreakpoint = (elementWidth: number) => {\n const minWidthPx = parseInt(smContentWidth, 10) * chToPxConversionFactor;\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 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 const nameText = useMemo(() => {\n return <Text variant={`h${Math.min(headingDepth, 6)}` as HeadingTag}>{name}</Text>;\n }, [name, headingDepth]);\n\n const details = useMemo(() => {\n return (\n <>\n {highlightedData && (\n <>\n <Flex\n data-testid={testIds.highlightedData}\n as={StyledHighlightedDetailList}\n forwardedAs={nested ? 'div' : 'dl'}\n container={{ wrap: 'wrap', colGap: 10, rowGap: 1, alignItems: 'start' }}\n >\n {highlightedData.map((child, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={i}>{child}</Fragment>\n ))}\n </Flex>\n\n <hr />\n </>\n )}\n\n {children ? (\n <StyledDetailList\n data-testid={testIds.data}\n ref={listRef}\n as={nested ? 'div' : 'dl'}\n columnCount={columnCount}\n labelLength={labelLength}\n stacked={applyMobileView}\n nested={nested}\n flex={asFlex}\n wrapped={asFlex ? !flexRow : false}\n variant={valueComparison ? 'value-comparison' : undefined}\n narrow={!isMdContentWidthOrAbove}\n >\n {children}\n </StyledDetailList>\n ) : null}\n </>\n );\n }, [\n highlightedData,\n nested,\n columnCount,\n labelLength,\n applyMobileView,\n name,\n asFlex,\n flexRow,\n valueComparison,\n children,\n testIds\n ]);\n\n if (!name && !children && !highlightedData && !description) return null;\n\n return (\n <DetailsContext.Provider value={contextValue}>\n <StyledDetails data-testid={testIds.root}>\n {name && (\n <StyledFieldValueGroupLabel data-testid={testIds.heading}>\n {collapsible ? (\n <Button\n type='button'\n variant='text'\n onClick={() => {\n setOpen(cur => !cur);\n }}\n aria-expanded={open ? 'true' : 'false'}\n aria-label={t(open ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Flex container={{ alignItems: 'center', gap: 0.5 }} as='span'>\n <Icon name='caret-right' />\n {nameText}\n </Flex>\n </Button>\n ) : (\n nameText\n )}\n </StyledFieldValueGroupLabel>\n )}\n\n {description && (\n <StyledDetailDescription data-testid={testIds.description}>\n <HTML as='p' content={description} />\n </StyledDetailDescription>\n )}\n\n {collapsible ? (\n <ExpandCollapse data-testid={testIds.expandCollapse} collapsed={!open}>\n {details}\n </ExpandCollapse>\n ) : (\n details\n )}\n </StyledDetails>\n </DetailsContext.Provider>\n );\n});\n\nexport default withTestIds(Details, getDetailsTestIds);\n"]}
@@ -5,8 +5,6 @@ interface StyledDetailListProps extends StyledFieldValueListProps {
5
5
  stacked?: boolean;
6
6
  /** Whether the list is a flex row of other lists */
7
7
  flex?: boolean;
8
- /** Whether the list has a name attribute */
9
- hasName?: boolean;
10
8
  /** Whether the list is nested */
11
9
  nested?: boolean;
12
10
  /** The character length applied to all list labels */
@@ -21,6 +19,11 @@ interface StyledDetailListProps extends StyledFieldValueListProps {
21
19
  * @default 1
22
20
  */
23
21
  columnCount?: 1 | 2 | 3;
22
+ /**
23
+ * Whether to apply narrow list styles
24
+ * @default false
25
+ */
26
+ narrow?: boolean;
24
27
  theme: DefaultTheme;
25
28
  }
26
29
  export declare const colCountChWidth: {
@@ -38,10 +41,10 @@ export declare const colCountChWidth: {
38
41
  };
39
42
  };
40
43
  export declare const flexGapProp = 5.5;
41
- export declare const chToRem: (chVal: number) => number;
42
44
  export declare const StyledFieldValueGroupLabel: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
45
+ export declare const StyledDetailDescription: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
43
46
  export declare const StyledHighlightedDetailList: import("styled-components").StyledComponent<"dl", DefaultTheme, {}, never>;
44
47
  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>;
48
+ export declare const StyledDetailList: import("styled-components").StyledComponent<"dl", DefaultTheme, StyledFieldValueListProps & Pick<StyledDetailListProps, "flex" | "theme" | "variant" | "narrow" | "stacked" | "nested" | "labelLength"> & Required<Pick<StyledDetailListProps, "columnCount" | "wrapped">>, never>;
46
49
  export {};
47
50
  //# sourceMappingURL=Details.styles.d.ts.map
@@ -1 +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,EAM1B,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,6EA4BrC,CAAC;AAIH,eAAO,MAAM,2BAA2B,4EA4BtC,CAAC;AAIH,eAAO,MAAM,aAAa,6EAIxB,CAAC;AAkCH,eAAO,MAAM,gBAAgB,uQAwJ5B,CAAC"}
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,EAM1B,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,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;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;CACrB;AAUD,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAa3B,CAAC;AAEF,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B,eAAO,MAAM,0BAA0B,6EAyBrC,CAAC;AAIH,eAAO,MAAM,uBAAuB,6EAYlC,CAAC;AAIH,eAAO,MAAM,2BAA2B,4EAuBtC,CAAC;AAIH,eAAO,MAAM,aAAa,6EAAe,CAAC;AAE1C,eAAO,MAAM,gBAAgB,oRA+H5B,CAAC"}
@@ -17,9 +17,6 @@ export const colCountChWidth = {
17
17
  }
18
18
  };
19
19
  export const flexGapProp = 5.5;
20
- export const chToRem = (chVal) => {
21
- return chVal / 2;
22
- };
23
20
  export const StyledFieldValueGroupLabel = styled.div(({ theme }) => {
24
21
  const { base: { spacing, animation } } = theme;
25
22
  const { rtl } = useDirection();
@@ -28,10 +25,7 @@ export const StyledFieldValueGroupLabel = styled.div(({ theme }) => {
28
25
  grid-column-start: 1;
29
26
  grid-column-end: -1;
30
27
  margin-block-end: calc(0.5 * ${spacing});
31
-
32
- &:not(:first-child) {
33
- margin-block-start: calc(3 * ${spacing});
34
- }
28
+ margin-block-start: calc(1.5 * ${spacing});
35
29
 
36
30
  ${StyledButton} ${StyledIcon} {
37
31
  transition: transform ${animation.speed} ${animation.timing.ease};
@@ -47,16 +41,19 @@ export const StyledFieldValueGroupLabel = styled.div(({ theme }) => {
47
41
  `;
48
42
  });
49
43
  StyledFieldValueGroupLabel.defaultProps = defaultThemeProp;
44
+ export const StyledDetailDescription = styled.div(({ theme }) => {
45
+ const { base: { spacing, 'content-width': { xl } } } = theme;
46
+ return css `
47
+ max-width: ${xl};
48
+ margin-block: calc(1.5 * ${spacing});
49
+ `;
50
+ });
51
+ StyledDetailDescription.defaultProps = defaultThemeProp;
50
52
  export const StyledHighlightedDetailList = styled.dl(({ theme }) => {
51
53
  const { base: { spacing, palette } } = theme;
52
54
  const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
53
55
  return css `
54
- display: grid;
55
- grid-template-columns: repeat(auto-fit, minmax(40ch, 1fr));
56
- column-gap: calc(5 * ${spacing});
57
- gap: calc(2 * ${spacing});
58
- align-items: start;
59
- max-width: ${`${colCountChWidth[3].containerWidth}ch}`};
56
+ max-width: ${colCountChWidth[3].containerWidth}ch;
60
57
  padding-block-end: calc(1.5 * ${spacing});
61
58
 
62
59
  dd {
@@ -74,40 +71,12 @@ export const StyledHighlightedDetailList = styled.dl(({ theme }) => {
74
71
  `;
75
72
  });
76
73
  StyledHighlightedDetailList.defaultProps = defaultThemeProp;
77
- export const StyledDetails = styled.div(() => {
78
- return css `
79
- grid-column: 1 / -1;
80
- `;
81
- });
82
- StyledDetails.defaultProps = defaultThemeProp;
83
- const nthRecursiveContainerSelector = (depth, includeAllImmediateContainers) => {
84
- const firstContainerSelector = '> div:first-child';
85
- const baseSelector = includeAllImmediateContainers ? '> div' : firstContainerSelector;
86
- return baseSelector.concat(` ${firstContainerSelector}`.repeat(depth));
87
- };
88
- const initialLabelNoMargin = (applyToAllChildren = false) => {
89
- return css `
90
- ${nthRecursiveContainerSelector(0, applyToAllChildren)},
91
- ${nthRecursiveContainerSelector(1, applyToAllChildren)},
92
- ${nthRecursiveContainerSelector(2, applyToAllChildren)},
93
- ${nthRecursiveContainerSelector(3, applyToAllChildren)},
94
- ${nthRecursiveContainerSelector(4, applyToAllChildren)},
95
- ${nthRecursiveContainerSelector(5, applyToAllChildren)},
96
- ${nthRecursiveContainerSelector(6, applyToAllChildren)},
97
- ${nthRecursiveContainerSelector(7, applyToAllChildren)},
98
- ${nthRecursiveContainerSelector(8, applyToAllChildren)},
99
- ${nthRecursiveContainerSelector(9, applyToAllChildren)},
100
- ${nthRecursiveContainerSelector(10, applyToAllChildren)} {
101
- > ${StyledFieldValueGroupLabel}:first-child {
102
- margin-block-start: 0;
103
- }
104
- }
105
- `;
106
- };
107
- export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, hasName, nested, labelLength, variant, theme, wrapped = false, columnCount = 1 }) => {
74
+ export const StyledDetails = styled.div ``;
75
+ export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, nested, labelLength, variant, theme, wrapped = false, columnCount = 1, narrow = false }) => {
108
76
  const { base: { spacing } } = theme;
109
77
  const isValueComparison = variant === 'value-comparison';
110
78
  const containerWidthCh = colCountChWidth[columnCount].containerWidth;
79
+ const columnWidthCh = colCountChWidth[columnCount].colWidth;
111
80
  const containerWidthMinusLabel = `${containerWidthCh - (labelLength ?? 0)}ch`;
112
81
  return css `
113
82
  /* Top Level Styles */
@@ -118,14 +87,6 @@ export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, h
118
87
  overflow: auto;
119
88
  }
120
89
 
121
- ${StyledFieldValueGroupLabel} {
122
- margin-block-start: calc(3 * ${spacing});
123
- }
124
-
125
- > ${StyledFieldValueGroupLabel}:nth-child(1) {
126
- margin-block-start: 0;
127
- }
128
-
129
90
  ${StyledStackedFieldValue} {
130
91
  grid-column: 1 / -1;
131
92
  }
@@ -141,7 +102,7 @@ export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, h
141
102
  ${!flex &&
142
103
  css `
143
104
  display: grid;
144
- grid-template-columns: ${`minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr)`};
105
+ grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);
145
106
  column-gap: calc(2 * ${spacing});
146
107
  row-gap: calc(${verticalGapSpacingMultiplier} * ${spacing});
147
108
 
@@ -152,11 +113,16 @@ export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, h
152
113
  `}
153
114
 
154
115
  > ${StyledStackedFieldValue} {
155
- max-width: ${`${containerWidthCh}ch`};
116
+ max-width: ${containerWidthCh}ch;
156
117
  }
157
118
 
158
119
  > ${StyledFieldValue} {
159
120
  max-width: calc(${containerWidthMinusLabel} - calc(2 * ${spacing}));
121
+
122
+ ${!isValueComparison &&
123
+ css `
124
+ width: 100%;
125
+ `}
160
126
  }
161
127
 
162
128
  ${isValueComparison &&
@@ -164,8 +130,18 @@ export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, h
164
130
  grid-template-columns: auto auto;
165
131
  column-gap: 0;
166
132
  row-gap: calc(0.5 * ${spacing});
167
- max-width: ${`${containerWidthCh}ch`};
133
+ max-width: ${containerWidthCh}ch;
134
+
135
+ > dd {
136
+ display: flex;
137
+ flex-direction: column;
138
+ justify-content: flex-end;
139
+ }
168
140
  `}
141
+
142
+ > ${StyledDetails} {
143
+ grid-column: 1 / -1;
144
+ }
169
145
  `}
170
146
 
171
147
  /* As Flex Container */
@@ -175,68 +151,37 @@ export const StyledDetailList = styled(StyledFieldValueList)(({ stacked, flex, h
175
151
  flex-direction: ${wrapped ? 'column' : 'row'};
176
152
  column-gap: calc(${flexGapProp} * ${spacing});
177
153
  align-items: flex-start;
178
-
179
- max-width: ${`${containerWidthCh}ch`};
154
+ max-width: ${containerWidthCh}ch;
180
155
 
181
156
  ${!wrapped &&
182
157
  css `
183
158
  > * {
184
- max-width: ${`${100 / columnCount}%`};
159
+ width: 100%;
160
+ max-width: ${columnWidthCh}%;
185
161
  }
186
-
187
- ${hasName && initialLabelNoMargin(true)}
188
- `}
189
-
190
- ${wrapped &&
191
- css `
192
- ${hasName && initialLabelNoMargin()}
193
-
194
- ${!stacked &&
195
- css `
196
- > div:not(:first-child) {
197
- margin-block-start: calc(${verticalGapSpacingMultiplier} * ${spacing});
198
- }
199
- `}}
200
162
  `}
201
- `}
202
163
 
203
- /* Key / Group Label Spacing */
204
- ${!nested &&
205
- css `
206
- > div {
207
- + dt {
208
- margin-block-start: calc(3 * ${spacing});
209
- }
210
-
211
- + ${StyledStackedFieldValue} {
212
- margin-block-start: calc(3 * ${spacing});
213
- }
214
-
215
- ${!stacked &&
216
- css `
217
- + dt + dd {
218
- margin-block-start: calc(3 * ${spacing});
219
- }
220
- `}
164
+ > ${StyledDetails} {
165
+ width: 100%;
221
166
  }
222
-
223
- ${initialLabelNoMargin()}
224
167
  `}
225
168
 
169
+ /* Key / Group Label Spacing */
226
170
  ${stacked &&
171
+ !isValueComparison &&
227
172
  css `
228
- dt {
173
+ > dt {
229
174
  margin-block-start: calc(${verticalGapSpacingMultiplier} * ${spacing});
230
175
  }
231
176
  `}
232
177
 
233
- ${StyledFieldValueGroupLabel} + div {
234
- > ${StyledFieldValueGroupLabel}:first-child {
235
- margin-block-start: 0;
236
- }
237
-
238
- ${initialLabelNoMargin()}
239
- }
178
+ /* Responsive behavior */
179
+ ${narrow &&
180
+ !stacked &&
181
+ !isValueComparison &&
182
+ css `
183
+ grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(50%, 1fr);
184
+ `}
240
185
  `;
241
186
  });
242
187
  StyledDetailList.defaultProps = defaultThemeProp;
@@ -1 +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,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EAEpB,UAAU,EAGV,YAAY,EACZ,YAAY,EACb,MAAM,yBAAyB,CAAC;AA+BjC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAEvC,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE;QACH,cAAc,EAAE,GAAG;QACnB,QAAQ,EAAE,GAAG;KACd;IACD,GAAG,EAAE;QACH,cAAc,EAAE,EAAE,GAAG,CAAC;QACtB,QAAQ,EAAE,EAAE;KACb;IACD,GAAG,EAAE;QACH,cAAc,EAAE,EAAE,GAAG,CAAC;QACtB,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAE/B,MAAM,CAAC,MAAM,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AAM,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 StyledIcon,\n FontSize,\n PropsWithDefaults,\n useDirection,\n StyledButton\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, animation }\n } = theme;\n const { rtl } = useDirection();\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 ${StyledButton} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButton}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButton}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\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"]}
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,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EAEpB,UAAU,EAGV,YAAY,EACZ,YAAY,EACb,MAAM,yBAAyB,CAAC;AAkCjC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAEvC,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE;QACH,cAAc,EAAE,GAAG;QACnB,QAAQ,EAAE,GAAG;KACd;IACD,GAAG,EAAE;QACH,cAAc,EAAE,EAAE,GAAG,CAAC;QACtB,QAAQ,EAAE,EAAE;KACb;IACD,GAAG,EAAE;QACH,cAAc,EAAE,EAAE,GAAG,CAAC;QACtB,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAE/B,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjE,MAAM,EACJ,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAC7B,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAE/B,OAAO,GAAG,CAAA;;;;mCAIuB,OAAO;qCACL,OAAO;;MAEtC,YAAY,IAAI,UAAU;8BACF,SA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N,GAAG,CAAA;;0BAEiB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;2BACzB,WAAW,MAAM,OAAO;;qBAE9B,gBAAgB;;UAE3B,CAAC,OAAO;YACV,GAAG,CAAA;;;yBAGc,aAAa;;SAE7B;;YAEG,aAAa;;;OAGlB;;;QAGC,OAAO;QACT,CAAC,iBAAiB;QAClB,GAAG,CAAA;;qCAE4B,4BAA4B,MAAM,OAAO;;OAEvE;;;QAGC,MAAM;QACR,CAAC,OAAO;QACR,CAAC,iBAAiB;QAClB,GAAG,CAAA;8CACqC,WAAW;OAClD;KACF,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 StyledIcon,\n FontSize,\n PropsWithDefaults,\n useDirection,\n StyledButton\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 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 /**\n * Whether to apply narrow list styles\n * @default false\n */\n narrow?: boolean;\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 StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing, animation }\n } = theme;\n const { rtl } = useDirection();\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 margin-block-start: calc(1.5 * ${spacing});\n\n ${StyledButton} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButton}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButton}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledDetailDescription = styled.div(({ theme }) => {\n const {\n base: {\n spacing,\n 'content-width': { xl }\n }\n } = theme;\n\n return css`\n max-width: ${xl};\n margin-block: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailDescription.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 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\nexport const StyledDetailList = styled(StyledFieldValueList)<StyledDetailListPropsWithDefaults>(\n ({\n stacked,\n flex,\n nested,\n labelLength,\n variant,\n theme,\n wrapped = false,\n columnCount = 1,\n narrow = false\n }): any => {\n const {\n base: { spacing }\n } = theme;\n\n const isValueComparison = variant === 'value-comparison';\n const containerWidthCh = colCountChWidth[columnCount].containerWidth;\n const columnWidthCh = colCountChWidth[columnCount].colWidth;\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 ${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 ${!isValueComparison &&\n css`\n width: 100%;\n `}\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 > dd {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n `}\n\n > ${StyledDetails} {\n grid-column: 1 / -1;\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 max-width: ${containerWidthCh}ch;\n\n ${!wrapped &&\n css`\n > * {\n width: 100%;\n max-width: ${columnWidthCh}%;\n }\n `}\n\n > ${StyledDetails} {\n width: 100%;\n }\n `}\n\n /* Key / Group Label Spacing */\n ${stacked &&\n !isValueComparison &&\n css`\n > dt {\n margin-block-start: calc(${verticalGapSpacingMultiplier} * ${spacing});\n }\n `}\n\n /* Responsive behavior */\n ${narrow &&\n !stacked &&\n !isValueComparison &&\n css`\n grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(50%, 1fr);\n `}\n `;\n }\n);\n\nStyledDetailList.defaultProps = defaultThemeProp;\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const getDetailsTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "highlighted-data", "data", "expand-collapse"]>;
2
+ //# sourceMappingURL=Details.test-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Details.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,0KAMnB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { createTestIds } from '@pega/cosmos-react-core';
2
+ export const getDetailsTestIds = createTestIds('details', [
3
+ 'heading',
4
+ 'description',
5
+ 'highlighted-data',
6
+ 'data',
7
+ 'expand-collapse'
8
+ ]);
9
+ //# sourceMappingURL=Details.test-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Details.test-ids.js","sourceRoot":"","sources":["../../../src/components/Details/Details.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,SAAS,EAAE;IACxD,SAAS;IACT,aAAa;IACb,kBAAkB;IAClB,MAAM;IACN,iBAAiB;CACT,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getDetailsTestIds = createTestIds('details', [\n 'heading',\n 'description',\n 'highlighted-data',\n 'data',\n 'expand-collapse'\n] as const);\n"]}
@@ -1,20 +1,20 @@
1
- import { FunctionComponent, Ref } from 'react';
2
- import { BaseProps, FieldValueListProps, ForwardProps, MenuItemProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
- export interface GlimpseProps extends BaseProps, NoChildrenProp {
1
+ import { FunctionComponent, MouseEventHandler, Ref } from 'react';
2
+ import { BaseProps, ButtonProps, FieldValueListProps, ForwardProps, InfoDialogProps, NoChildrenProp, OmitStrict } from '@pega/cosmos-react-core';
3
+ type InfoDialogSummaryHeading = Extract<InfoDialogProps['heading'], object>;
4
+ export interface GlimpseProps extends BaseProps, OmitStrict<InfoDialogProps, 'children'>, NoChildrenProp {
4
5
  /** The unique id for the operator. */
5
6
  id: string;
6
- /** The primary piece of item information as a string. */
7
- primary: MenuItemProps['primary'];
8
- /** Secondary info about an item. Useful for additional metadata or context. */
9
- secondary?: MenuItemProps['secondary'];
10
- /** A visual to assist identifying an item. e.g. Avatar or Icon. */
11
- visual?: MenuItemProps['visual'];
7
+ /** Primary, secondary and avatar for the glimpse. */
8
+ heading?: InfoDialogSummaryHeading;
12
9
  /** The set of field values to render in the list. */
13
10
  fields?: FieldValueListProps['fields'];
14
11
  /** Ref for the wrapping element. */
15
12
  ref?: Ref<HTMLDivElement>;
13
+ /** Callback for click event on View profile button. Passing this will render View profile button */
14
+ onViewProfile?: MouseEventHandler<HTMLButtonElement>;
15
+ /** A URL location to navigate to. Passing an href will render View profile button as a link. */
16
+ href?: ButtonProps['href'];
16
17
  }
17
- export declare const StyledGlimpse: import("styled-components").StyledComponent<FunctionComponent<import("@pega/cosmos-react-core").CardProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
18
18
  declare const Glimpse: FunctionComponent<GlimpseProps & ForwardProps>;
19
19
  export default Glimpse;
20
20
  //# sourceMappingURL=Glimpse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Glimpse.d.ts","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EACL,SAAS,EAMT,mBAAmB,E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MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,oGAAoG;IACpG,aAAa,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,gGAAgG;IAChG,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAyC1D,CAAC;AAEH,eAAe,OAAO,CAAC"}
@@ -1,22 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import styled, { css } from 'styled-components';
4
- import { Card, CardContent, CardHeader, defaultThemeProp, FieldValueList, MetaList, StyledFieldValueList, SummaryItem } from '@pega/cosmos-react-core';
5
- import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
6
- export const StyledGlimpse = styled(Card)(({ theme }) => {
7
- return css `
8
- ${StyledCardContent} {
9
- border-top: solid 0.0625rem ${theme.base.palette['border-line']};
10
- }
11
-
12
- ${StyledFieldValueList} {
13
- padding-top: calc(1.5 * ${theme.base.spacing});
14
- }
15
- `;
16
- });
17
- StyledGlimpse.defaultProps = defaultThemeProp;
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 }), visual: visual }) }), !!fields.length && (_jsx(CardContent, { children: _jsx(FieldValueList, { fields: fields }) }))] }));
3
+ import { Button, FieldValueList, Flex, InfoDialog, useI18n } from '@pega/cosmos-react-core';
4
+ const Glimpse = forwardRef(function Glimpse({ heading, fields = [], target, onDismiss, href, progress, onViewProfile, ...restProps }, ref) {
5
+ const t = useI18n();
6
+ return (_jsx(InfoDialog, { ...restProps, target: target, heading: heading, progress: progress, onDismiss: onDismiss, ref: ref, children: _jsxs(Flex, { container: { direction: 'column', alignItems: 'start', gap: 2 }, children: [fields.length > 0 && _jsx(FieldValueList, { fields: fields }), (onViewProfile || href) && (_jsx(Button, { href: href, onClick: (e) => {
7
+ onViewProfile?.(e);
8
+ onDismiss();
9
+ }, children: t('view_profile') }))] }) }));
20
10
  });
21
11
  export default Glimpse;
22
12
  //# 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,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"]}
1
+ {"version":3,"file":"Glimpse.js","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAMX,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,MAAM,EAEN,cAAc,EAEd,IAAI,EAEJ,UAAU,EAIV,OAAO,EACR,MAAM,yBAAyB,CAAC;AAsBjC,MAAM,OAAO,GAAmD,UAAU,CAAC,SAAS,OAAO,CACzF,EACE,OAAO,EACP,MAAM,GAAG,EAAE,EACX,MAAM,EACN,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,GAAG,SAAS,EACkB,EAChC,GAAwB;IAExB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,OAAO,CACL,KAAC,UAAU,OACL,SAAS,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,YAER,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,aAClE,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,GAAI,EAEvD,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,CAC1B,KAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE;wBAC5C,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;wBACnB,SAAS,EAAE,CAAC;oBACd,CAAC,YAEA,CAAC,CAAC,cAAc,CAAC,GACX,CACV,IACI,GACI,CACd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n MouseEvent,\n MouseEventHandler,\n PropsWithoutRef,\n Ref\n} from 'react';\n\nimport {\n BaseProps,\n Button,\n ButtonProps,\n FieldValueList,\n FieldValueListProps,\n Flex,\n ForwardProps,\n InfoDialog,\n InfoDialogProps,\n NoChildrenProp,\n OmitStrict,\n useI18n\n} from '@pega/cosmos-react-core';\n\ntype InfoDialogSummaryHeading = Extract<InfoDialogProps['heading'], object>;\n\nexport interface GlimpseProps\n extends BaseProps,\n OmitStrict<InfoDialogProps, 'children'>,\n NoChildrenProp {\n /** The unique id for the operator. */\n id: string;\n /** Primary, secondary and avatar for the glimpse. */\n heading?: InfoDialogSummaryHeading;\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 /** Callback for click event on View profile button. Passing this will render View profile button */\n onViewProfile?: MouseEventHandler<HTMLButtonElement>;\n /** A URL location to navigate to. Passing an href will render View profile button as a link. */\n href?: ButtonProps['href'];\n}\n\nconst Glimpse: FunctionComponent<GlimpseProps & ForwardProps> = forwardRef(function Glimpse(\n {\n heading,\n fields = [],\n target,\n onDismiss,\n href,\n progress,\n onViewProfile,\n ...restProps\n }: PropsWithoutRef<GlimpseProps>,\n ref: GlimpseProps['ref']\n) {\n const t = useI18n();\n\n return (\n <InfoDialog\n {...restProps}\n target={target}\n heading={heading}\n progress={progress}\n onDismiss={onDismiss}\n ref={ref}\n >\n <Flex container={{ direction: 'column', alignItems: 'start', gap: 2 }}>\n {fields.length > 0 && <FieldValueList fields={fields} />}\n\n {(onViewProfile || href) && (\n <Button\n href={href}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onViewProfile?.(e);\n onDismiss();\n }}\n >\n {t('view_profile')}\n </Button>\n )}\n </Flex>\n </InfoDialog>\n );\n});\n\nexport default Glimpse;\n"]}
@@ -1,3 +1,3 @@
1
1
  export { default } from './Glimpse';
2
- export { GlimpseProps, StyledGlimpse } from './Glimpse';
2
+ export type { GlimpseProps } from './Glimpse';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Glimpse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Glimpse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -1,3 +1,2 @@
1
1
  export { default } from './Glimpse';
2
- export { StyledGlimpse } from './Glimpse';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Glimpse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAgB,aAAa,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Glimpse';\nexport { GlimpseProps, StyledGlimpse } from './Glimpse';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Glimpse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Glimpse';\nexport type { GlimpseProps } from './Glimpse';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IntelligentGuidance.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAQb,MAAM,yBAAyB,CAAC;AAQjC,OAAO,KAAK,wBAAwB,MAAM,6BAA6B,CAAC;AAIxE,QAAA,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,wBAAwB,GAAG,YAAY,CAgHnF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"IntelligentGuidance.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAYb,MAAM,yBAAyB,CAAC;AAQjC,OAAO,KAAK,wBAAwB,MAAM,6BAA6B,CAAC;AAExE,QAAA,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,wBAAwB,GAAG,YAAY,CA8InF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}