@pega/cosmos-react-build 2.1.6 → 2.1.7

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 (193) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts +29 -0
  2. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -0
  3. package/lib/components/AppHeader/AppHeader.js +32 -0
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -0
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +12 -0
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -0
  7. package/lib/components/AppHeader/AppHeader.styles.js +123 -0
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -0
  9. package/lib/components/AppHeader/index.d.ts +3 -0
  10. package/lib/components/AppHeader/index.d.ts.map +1 -0
  11. package/lib/components/AppHeader/index.js +2 -0
  12. package/lib/components/AppHeader/index.js.map +1 -0
  13. package/lib/components/AppShell/AppShell.d.ts +4 -0
  14. package/lib/components/AppShell/AppShell.d.ts.map +1 -0
  15. package/lib/components/AppShell/AppShell.js +84 -0
  16. package/lib/components/AppShell/AppShell.js.map +1 -0
  17. package/lib/components/AppShell/AppShell.styles.d.ts +20 -0
  18. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -0
  19. package/lib/components/AppShell/AppShell.styles.js +331 -0
  20. package/lib/components/AppShell/AppShell.styles.js.map +1 -0
  21. package/lib/components/AppShell/AppShell.types.d.ts +43 -0
  22. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -0
  23. package/lib/components/AppShell/AppShell.types.js +2 -0
  24. package/lib/components/AppShell/AppShell.types.js.map +1 -0
  25. package/lib/components/AppShell/AppShellContext.d.ts +4 -0
  26. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -0
  27. package/lib/components/AppShell/AppShellContext.js +10 -0
  28. package/lib/components/AppShell/AppShellContext.js.map +1 -0
  29. package/lib/components/AppShell/index.d.ts +3 -0
  30. package/lib/components/AppShell/index.d.ts.map +1 -0
  31. package/lib/components/AppShell/index.js +2 -0
  32. package/lib/components/AppShell/index.js.map +1 -0
  33. package/lib/components/FlowModeller/AddNode.d.ts +16 -0
  34. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -0
  35. package/lib/components/FlowModeller/AddNode.js +62 -0
  36. package/lib/components/FlowModeller/AddNode.js.map +1 -0
  37. package/lib/components/FlowModeller/FlowModeller.d.ts +21 -0
  38. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -0
  39. package/lib/components/FlowModeller/FlowModeller.js +190 -0
  40. package/lib/components/FlowModeller/FlowModeller.js.map +1 -0
  41. package/lib/components/FlowModeller/Node/Node.types.d.ts +54 -0
  42. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -0
  43. package/lib/components/FlowModeller/Node/Node.types.js +28 -0
  44. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -0
  45. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +15 -0
  46. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -0
  47. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +128 -0
  48. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -0
  49. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +6 -0
  50. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -0
  51. package/lib/components/FlowModeller/Node/NodeTemplates.js +64 -0
  52. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -0
  53. package/lib/components/FlowModeller/NodeLibrary.d.ts +13 -0
  54. package/lib/components/FlowModeller/NodeLibrary.d.ts.map +1 -0
  55. package/lib/components/FlowModeller/NodeLibrary.js +51 -0
  56. package/lib/components/FlowModeller/NodeLibrary.js.map +1 -0
  57. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +13 -0
  58. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +1 -0
  59. package/lib/components/FlowModeller/Renderer/Connectors.js +47 -0
  60. package/lib/components/FlowModeller/Renderer/Connectors.js.map +1 -0
  61. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +9 -0
  62. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +1 -0
  63. package/lib/components/FlowModeller/Renderer/Nodes.js +25 -0
  64. package/lib/components/FlowModeller/Renderer/Nodes.js.map +1 -0
  65. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +5 -0
  66. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -0
  67. package/lib/components/FlowModeller/Renderer/Renderer.js +17 -0
  68. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -0
  69. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +18 -0
  70. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -0
  71. package/lib/components/FlowModeller/Renderer/Renderer.types.js +2 -0
  72. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -0
  73. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +54 -0
  74. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -0
  75. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +302 -0
  76. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -0
  77. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +35 -0
  78. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -0
  79. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +107 -0
  80. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -0
  81. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +24 -0
  82. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -0
  83. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +152 -0
  84. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -0
  85. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts +16 -0
  86. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts.map +1 -0
  87. package/lib/components/FlowModeller/Utils/AddNodeUtils.js +118 -0
  88. package/lib/components/FlowModeller/Utils/AddNodeUtils.js.map +1 -0
  89. package/lib/components/FlowModeller/helper.d.ts +23 -0
  90. package/lib/components/FlowModeller/helper.d.ts.map +1 -0
  91. package/lib/components/FlowModeller/helper.js +128 -0
  92. package/lib/components/FlowModeller/helper.js.map +1 -0
  93. package/lib/components/FlowModeller/index.d.ts +10 -0
  94. package/lib/components/FlowModeller/index.d.ts.map +1 -0
  95. package/lib/components/FlowModeller/index.js +8 -0
  96. package/lib/components/FlowModeller/index.js.map +1 -0
  97. package/lib/components/LifeCycle/Category.d.ts +32 -0
  98. package/lib/components/LifeCycle/Category.d.ts.map +1 -0
  99. package/lib/components/LifeCycle/Category.js +98 -0
  100. package/lib/components/LifeCycle/Category.js.map +1 -0
  101. package/lib/components/LifeCycle/LifeCycle.d.ts +22 -0
  102. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -0
  103. package/lib/components/LifeCycle/LifeCycle.js +73 -0
  104. package/lib/components/LifeCycle/LifeCycle.js.map +1 -0
  105. package/lib/components/LifeCycle/LifeCycle.types.d.ts +56 -0
  106. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -0
  107. package/lib/components/LifeCycle/LifeCycle.types.js +2 -0
  108. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -0
  109. package/lib/components/LifeCycle/LifeCycleList.d.ts +22 -0
  110. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -0
  111. package/lib/components/LifeCycle/LifeCycleList.js +65 -0
  112. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -0
  113. package/lib/components/LifeCycle/Stage.d.ts +49 -0
  114. package/lib/components/LifeCycle/Stage.d.ts.map +1 -0
  115. package/lib/components/LifeCycle/Stage.js +293 -0
  116. package/lib/components/LifeCycle/Stage.js.map +1 -0
  117. package/lib/components/LifeCycle/Step.d.ts +51 -0
  118. package/lib/components/LifeCycle/Step.d.ts.map +1 -0
  119. package/lib/components/LifeCycle/Step.js +241 -0
  120. package/lib/components/LifeCycle/Step.js.map +1 -0
  121. package/lib/components/LifeCycle/Task.d.ts +53 -0
  122. package/lib/components/LifeCycle/Task.d.ts.map +1 -0
  123. package/lib/components/LifeCycle/Task.js +188 -0
  124. package/lib/components/LifeCycle/Task.js.map +1 -0
  125. package/lib/components/LifeCycle/index.d.ts +4 -0
  126. package/lib/components/LifeCycle/index.d.ts.map +1 -0
  127. package/lib/components/LifeCycle/index.js +2 -0
  128. package/lib/components/LifeCycle/index.js.map +1 -0
  129. package/lib/components/PageTemplates/GalleryPage.d.ts +23 -0
  130. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -0
  131. package/lib/components/PageTemplates/GalleryPage.js +23 -0
  132. package/lib/components/PageTemplates/GalleryPage.js.map +1 -0
  133. package/lib/components/PageTemplates/GalleryPage.styles.d.ts +9 -0
  134. package/lib/components/PageTemplates/GalleryPage.styles.d.ts.map +1 -0
  135. package/lib/components/PageTemplates/GalleryPage.styles.js +70 -0
  136. package/lib/components/PageTemplates/GalleryPage.styles.js.map +1 -0
  137. package/lib/components/PageTemplates/PageTemplates.d.ts +27 -0
  138. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -0
  139. package/lib/components/PageTemplates/PageTemplates.js +105 -0
  140. package/lib/components/PageTemplates/PageTemplates.js.map +1 -0
  141. package/lib/components/PageTemplates/index.d.ts +5 -0
  142. package/lib/components/PageTemplates/index.d.ts.map +1 -0
  143. package/lib/components/PageTemplates/index.js +4 -0
  144. package/lib/components/PageTemplates/index.js.map +1 -0
  145. package/lib/components/SummaryCard/SummaryCard.d.ts +16 -0
  146. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -0
  147. package/lib/components/SummaryCard/SummaryCard.js +31 -0
  148. package/lib/components/SummaryCard/SummaryCard.js.map +1 -0
  149. package/lib/components/SummaryCard/index.d.ts +3 -0
  150. package/lib/components/SummaryCard/index.d.ts.map +1 -0
  151. package/lib/components/SummaryCard/index.js +3 -0
  152. package/lib/components/SummaryCard/index.js.map +1 -0
  153. package/lib/components/Visual/Visual.d.ts +17 -0
  154. package/lib/components/Visual/Visual.d.ts.map +1 -0
  155. package/lib/components/Visual/Visual.js +28 -0
  156. package/lib/components/Visual/Visual.js.map +1 -0
  157. package/lib/components/Visual/index.d.ts +3 -0
  158. package/lib/components/Visual/index.d.ts.map +1 -0
  159. package/lib/components/Visual/index.js +3 -0
  160. package/lib/components/Visual/index.js.map +1 -0
  161. package/lib/components/Workbench/ConfigurationPanel.d.ts +5 -0
  162. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -0
  163. package/lib/components/Workbench/ConfigurationPanel.js +21 -0
  164. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -0
  165. package/lib/components/Workbench/Toolbar.d.ts +14 -0
  166. package/lib/components/Workbench/Toolbar.d.ts.map +1 -0
  167. package/lib/components/Workbench/Toolbar.js +14 -0
  168. package/lib/components/Workbench/Toolbar.js.map +1 -0
  169. package/lib/components/Workbench/UtilityPanel.d.ts +7 -0
  170. package/lib/components/Workbench/UtilityPanel.d.ts.map +1 -0
  171. package/lib/components/Workbench/UtilityPanel.js +12 -0
  172. package/lib/components/Workbench/UtilityPanel.js.map +1 -0
  173. package/lib/components/Workbench/Workbench.d.ts +6 -0
  174. package/lib/components/Workbench/Workbench.d.ts.map +1 -0
  175. package/lib/components/Workbench/Workbench.js +24 -0
  176. package/lib/components/Workbench/Workbench.js.map +1 -0
  177. package/lib/components/Workbench/Workbench.styles.d.ts +10 -0
  178. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -0
  179. package/lib/components/Workbench/Workbench.styles.js +71 -0
  180. package/lib/components/Workbench/Workbench.styles.js.map +1 -0
  181. package/lib/components/Workbench/Workbench.types.d.ts +49 -0
  182. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -0
  183. package/lib/components/Workbench/Workbench.types.js +2 -0
  184. package/lib/components/Workbench/Workbench.types.js.map +1 -0
  185. package/lib/components/Workbench/index.d.ts +2 -0
  186. package/lib/components/Workbench/index.d.ts.map +1 -0
  187. package/lib/components/Workbench/index.js +2 -0
  188. package/lib/components/Workbench/index.js.map +1 -0
  189. package/lib/index.d.ts +13 -0
  190. package/lib/index.d.ts.map +1 -0
  191. package/lib/index.js +14 -0
  192. package/lib/index.js.map +1 -0
  193. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryPage.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,UAAU,EAAmB,MAAM,OAAO,CAAC;AAEzE,OAAO,EAEL,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,MAAM,EAEP,MAAM,yBAAyB,CAAC;AAEjC,OAAO,WAAiC,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAqB9B,MAAM,MAAM,GAA+E,CAAC,EAC1F,OAAO,EACP,WAAW,EACX,KAAK,EACL,MAAM,EACP,EAAE,EAAE;IACH,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,YAAY,aAC7E,MAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAC3C,KAAC,aAAa,IAAC,OAAO,EAAC,IAAI,YAAE,OAAO,WAAiB,EACpD,WAAW,IAAI,KAAC,iBAAiB,cAAE,WAAW,WAAqB,EACnE,MAAM,IAAI,CACT,KAAC,MAAM,IAAC,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,C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AW,EACX,UAAU,EACV,MAAM,EAC4B,EACpC,GAA4B,EAC5B,EAAE;IACF,OAAO,CACL,KAAC,iBAAiB,IAChB,KAAK,EAAC,EAAE,EACR,GAAG,EAAE,GAAG,EACR,MAAM,EACJ,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,WAAI,EAEtF,CAAC,EACC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC1B,KAAC,eAAe,IAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,WAAI,CAC5D,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,OAAK,UAAU,EAAE,MAAM,EAAE,MAAM,WAAI,CAC/C,EAEH,aAAa,iBACb,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FC, PropsWithoutRef, forwardRef, Ref, MouseEvent } from 'react';\n\nimport {\n ForwardProps,\n Image,\n ImageProps,\n Flex,\n Grid,\n Button,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport SummaryCard, { SummaryCardProps } from '../SummaryCard';\n\nimport {\n StyledDescription,\n StyledHeading,\n StyledSummaryCardList,\n StyledBanner,\n StyledImageContainer,\n StyledGalleryPage,\n StyledBannerInfo\n} from './GalleryPage.styles';\n\ninterface EmptyStateProps {\n heading: string;\n description?: string;\n}\n\nexport interface GalleryPageProps extends NoChildrenProp {\n heading: string;\n description?: string;\n image?: ImageProps;\n action: {\n text: string;\n onClick: (e: MouseEvent<HTMLButtonElement>) => void;\n };\n emptyState: EmptyStateProps;\n items?: SummaryCardProps[];\n onItemClick: (id: SummaryCardProps['id'], e: MouseEvent<HTMLDivElement>) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst Banner: FC<Pick<GalleryPageProps, 'heading' | 'description' | 'image' | 'action'>> = ({\n heading,\n description,\n image,\n action\n}) => {\n return (\n <Flex container={{ alignItems: 'center', justify: 'between' }} as={StyledBanner}>\n <Flex as={StyledBannerInfo} item={{ grow: 1 }}>\n <StyledHeading variant='h1'>{heading}</StyledHeading>\n {description && <StyledDescription>{description}</StyledDescription>}\n {action && (\n <Button onClick={(e: MouseEvent<HTMLButtonElement>) => action.onClick(e)}>\n {action.text}\n </Button>\n )}\n </Flex>\n {image && (\n <StyledImageContainer>\n <Image {...image} />\n </StyledImageContainer>\n )}\n </Flex>\n );\n};\n\nconst SummaryCardList: FC<{\n items: GalleryPageProps['items'];\n onItemClick: GalleryPageProps['onItemClick'];\n}> = ({ items, onItemClick }) => {\n return (\n <Grid\n container={{\n cols: 'repeat(auto-fill, minmax(18.75rem, 1fr))',\n autoRows: '10rem',\n gap: 2\n }}\n as={StyledSummaryCardList}\n >\n {items && items.map(item => <SummaryCard key={item.id} {...item} onClick={onItemClick} />)}\n </Grid>\n );\n};\n\nconst EmptyState: FC<EmptyStateProps & Pick<GalleryPageProps, 'action'>> = ({\n heading,\n description,\n action\n}) => {\n return (\n <Flex\n container={{ direction: 'column', alignItems: 'center', justify: 'center', rowGap: 2 }}\n item={{ grow: 1 }}\n >\n <StyledHeading variant='h2'>{heading}</StyledHeading>\n {description && <StyledDescription>{description}</StyledDescription>}\n {action && (\n <Button variant='primary' onClick={action.onClick}>\n {action.text}\n </Button>\n )}\n </Flex>\n );\n};\n\nconst GalleryPage: FC<GalleryPageProps & ForwardProps> = forwardRef(\n (\n {\n heading,\n description,\n image,\n items,\n onItemClick,\n emptyState,\n action\n }: PropsWithoutRef<GalleryPageProps>,\n ref: GalleryPageProps['ref']\n ) => {\n return (\n <StyledGalleryPage\n title=''\n ref={ref}\n header={\n <Banner heading={heading} description={description} action={action} image={image} />\n }\n a={\n items && items.length > 0 ? (\n <SummaryCardList items={items} onItemClick={onItemClick} />\n ) : (\n <EmptyState {...emptyState} action={action} />\n )\n }\n scrollContent\n />\n );\n }\n);\n\nexport default GalleryPage;\n"]}
@@ -0,0 +1,9 @@
1
+ import { Text, Flex, OneColumnPage } from '@pega/cosmos-react-core';
2
+ export declare const StyledBanner: import("styled-components").StyledComponent<"article", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledBannerInfo: typeof Flex;
4
+ export declare const StyledImageContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const StyledSummaryCardList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const StyledHeading: typeof Text;
7
+ export declare const StyledDescription: typeof Text;
8
+ export declare const StyledGalleryPage: typeof OneColumnPage;
9
+ //# sourceMappingURL=GalleryPage.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryPage.styles.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.styles.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,IAAI,EAGJ,IAAI,EAEJ,aAAa,EAEd,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,YAAY,6GAcvB,CAAC;AAIH,eAAO,MAAM,gBAAgB,EAAE,OAAO,IAqBpC,CAAC;AAIH,eAAO,MAAM,oBAAoB,yGAQhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yGAIhC,CAAC;AAIH,eAAO,MAAM,aAAa,EAAE,OAAO,IAIlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,OAAO,IAKtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,OAAO,aAStC,CAAC"}
@@ -0,0 +1,70 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { readableColor } from 'polished';
3
+ import { Text, StyledButton, tryCatch, Flex, defaultThemeProp, OneColumnPage, StyledRegion } from '@pega/cosmos-react-core';
4
+ export const StyledBanner = styled.article(({ theme }) => {
5
+ const { base: { palette: { 'brand-primary': brandBackground } } } = theme;
6
+ const color = tryCatch(() => readableColor(brandBackground));
7
+ return css `
8
+ background: ${brandBackground};
9
+ color: ${color};
10
+ height: 11rem;
11
+ `;
12
+ });
13
+ StyledBanner.defaultProps = defaultThemeProp;
14
+ export const StyledBannerInfo = styled(Flex)(({ theme }) => {
15
+ const { base: { spacing, shadow } } = theme;
16
+ return css `
17
+ padding-inline-start: calc(5 * ${spacing});
18
+ max-width: 50%;
19
+
20
+ ${StyledButton} {
21
+ margin-block-start: calc(2 * ${spacing});
22
+ &:enabled:focus,
23
+ &:not([disabled]):focus {
24
+ box-shadow: ${shadow['focus-inverted']};
25
+ }
26
+ }
27
+
28
+ span {
29
+ margin-block-start: ${spacing};
30
+ }
31
+ `;
32
+ });
33
+ StyledBannerInfo.defaultProps = defaultThemeProp;
34
+ export const StyledImageContainer = styled.div `
35
+ padding: 0;
36
+ height: 100%;
37
+ max-width: 50%;
38
+ img {
39
+ object-fit: contain;
40
+ height: 100%;
41
+ }
42
+ `;
43
+ export const StyledSummaryCardList = styled.div(({ theme }) => {
44
+ return css `
45
+ margin-block-start: calc(2 * ${theme.base.spacing});
46
+ `;
47
+ });
48
+ StyledSummaryCardList.defaultProps = defaultThemeProp;
49
+ export const StyledHeading = styled(Text) `
50
+ text-overflow: ellipsis;
51
+ white-space: nowrap;
52
+ overflow: hidden;
53
+ `;
54
+ export const StyledDescription = styled(Text) `
55
+ display: -webkit-box;
56
+ -webkit-box-orient: vertical;
57
+ -webkit-line-clamp: 2;
58
+ overflow: hidden;
59
+ `;
60
+ export const StyledGalleryPage = styled(OneColumnPage) `
61
+ gap: 0;
62
+ & > header {
63
+ padding: 0;
64
+ }
65
+
66
+ ${StyledRegion} {
67
+ height: 100%;
68
+ }
69
+ `;
70
+ //# sourceMappingURL=GalleryPage.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryPage.styles.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,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ClD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAgB,MAAM,CAAC,IAAI,CAAC,CAAA;;;;CAIrD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAgB,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;CAKzD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAyB,MAAM,CAAC,aAAa,CAAC,CAAA;;;;;;IAMxE,YAAY;;;CAGf,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Text,\n StyledButton,\n tryCatch,\n Flex,\n defaultThemeProp,\n OneColumnPage,\n StyledRegion\n} from '@pega/cosmos-react-core';\n\nexport const StyledBanner = styled.article(({ theme }) => {\n const {\n base: {\n palette: { 'brand-primary': brandBackground }\n }\n } = theme;\n\n const color = tryCatch(() => readableColor(brandBackground));\n\n return css`\n background: ${brandBackground};\n color: ${color};\n height: 11rem;\n `;\n});\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nexport const StyledBannerInfo: typeof Flex = styled(Flex)(({ theme }) => {\n const {\n base: { spacing, shadow }\n } = theme;\n\n return css`\n padding-inline-start: calc(5 * ${spacing});\n max-width: 50%;\n\n ${StyledButton} {\n margin-block-start: calc(2 * ${spacing});\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${shadow['focus-inverted']};\n }\n }\n\n span {\n margin-block-start: ${spacing};\n }\n `;\n});\n\nStyledBannerInfo.defaultProps = defaultThemeProp;\n\nexport const StyledImageContainer = styled.div`\n padding: 0;\n height: 100%;\n max-width: 50%;\n img {\n object-fit: contain;\n height: 100%;\n }\n`;\n\nexport const StyledSummaryCardList = styled.div(({ theme }) => {\n return css`\n margin-block-start: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledSummaryCardList.defaultProps = defaultThemeProp;\n\nexport const StyledHeading: typeof Text = styled(Text)`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n`;\n\nexport const StyledDescription: typeof Text = styled(Text)`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n`;\n\nexport const StyledGalleryPage: typeof OneColumnPage = styled(OneColumnPage)`\n gap: 0;\n & > header {\n padding: 0;\n }\n\n ${StyledRegion} {\n height: 100%;\n }\n`;\n"]}
@@ -0,0 +1,27 @@
1
+ import { FunctionComponent, MouseEvent } from 'react';
2
+ import { OneColumnPageProps as CoreOneColumnPageProps, TabbedPageProps as CoreTabbedPageProps, FieldValueListProps, ForwardProps, PageTemplateProps, OmitStrict, StatusProps } from '@pega/cosmos-react-core';
3
+ export interface PageHeaderProps extends Pick<PageTemplateProps, 'title' | 'actions'> {
4
+ metadata?: FieldValueListProps['fields'];
5
+ branchName?: string;
6
+ status?: {
7
+ type?: StatusProps['variant'];
8
+ label: string;
9
+ };
10
+ additionalInfo?: {
11
+ title: string;
12
+ description?: string;
13
+ fields: FieldValueListProps['fields'];
14
+ onEdit?: (e: MouseEvent<HTMLButtonElement>) => void;
15
+ };
16
+ }
17
+ declare type OmittedPageProps = 'header' | 'scrollContent';
18
+ export interface OneColumnPageProps extends OmitStrict<CoreOneColumnPageProps, OmittedPageProps>, PageHeaderProps {
19
+ }
20
+ export interface TabbedPageProps extends OmitStrict<CoreTabbedPageProps, OmittedPageProps>, PageHeaderProps {
21
+ }
22
+ export declare const StyledBranch: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
+ export declare const StyledPage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
24
+ export declare const TabbedPage: FunctionComponent<TabbedPageProps & ForwardProps>;
25
+ export declare const OneColumnPage: FunctionComponent<OneColumnPageProps & ForwardProps>;
26
+ export {};
27
+ //# sourceMappingURL=PageTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageTemplates.d.ts","source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M,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAoB9E,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useEffect } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { OneColumnPage as CoreOneColumnPage, TabbedPage as CoreTabbedPage, Flex, Status, SummaryItem, Text, Button, Popover, FieldValueList, Icon, defaultThemeProp, useI18n, useDirection, useElement, useOuterEvent, StyledSummaryItemActions, registerIcon, StyledLabel } from '@pega/cosmos-react-core';
5
+ import * as nodesDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/nodes-down.icon';
6
+ import * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';
7
+ import { StyledRegions, StyledRegion, StyledContent } from '@pega/cosmos-react-core/lib/components/PageTemplates/PageTemplates';
8
+ import { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';
9
+ registerIcon(nodesDownIcon, informationIcon);
10
+ const StyledTextWithEllipsis = styled(Text) `
11
+ overflow: hidden;
12
+ white-space: nowrap;
13
+ text-overflow: ellipsis;
14
+ `;
15
+ const StyledInfoPopover = styled(Popover) `
16
+ max-width: 60ch;
17
+ overflow-wrap: break-word;
18
+ `;
19
+ const StyledMetaFields = styled.dl `
20
+ dd,
21
+ dt {
22
+ display: inline;
23
+ }
24
+ `;
25
+ export const StyledBranch = styled.div(({ theme }) => {
26
+ return css `
27
+ border: 0.0625rem solid ${theme.base.colors.gray.light};
28
+ border-radius: calc(0.5 * ${theme.base['border-radius']});
29
+ padding: calc(0.5 * ${theme.base.spacing});
30
+ max-width: 100%;
31
+ overflow: hidden;
32
+ `;
33
+ });
34
+ StyledBranch.defaultProps = defaultThemeProp;
35
+ const StyledHeaderContent = styled(SummaryItem) `
36
+ ${StyledSummaryItemActions} {
37
+ align-self: start;
38
+ }
39
+ `;
40
+ export const StyledPage = styled.div(({ theme }) => {
41
+ return css `
42
+ ${StyledContent} {
43
+ margin: 0 calc(2 * ${theme.base.spacing});
44
+ }
45
+ ${StyledRegions} {
46
+ padding: 0;
47
+ grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
48
+ ${StyledRegion} {
49
+ height: 100%;
50
+ }
51
+ }
52
+
53
+ ${StyledTabPanel} {
54
+ height: 100%;
55
+ }
56
+ `;
57
+ });
58
+ const MetaFields = ({ metadata }) => {
59
+ return (_jsx(Flex, { container: { wrap: 'wrap', colGap: 1, rowGap: 0.25 }, as: StyledMetaFields, children: metadata.map(meta => {
60
+ return (_jsxs("div", { children: [_jsxs(StyledLabel, { as: 'dt', children: [meta.name, _jsx("span", { "aria-hidden": 'true', children: ": " }, void 0)] }, void 0), _jsx(Text, { variant: 'secondary', as: 'dd', children: meta.value }, void 0)] }, meta.id));
61
+ }) }, void 0));
62
+ };
63
+ const Branch = ({ branchName, status }) => {
64
+ return (_jsxs(Flex, { container: { alignItems: 'center', gap: 0.5 }, as: StyledBranch, children: [status && (_jsx(Flex, { item: { shrink: 0 }, as: Status, variant: status.type, children: status.label }, void 0)), _jsx(Flex, { item: { shrink: 0 }, as: Icon, name: 'nodes-down' }, void 0), branchName && _jsx(StyledTextWithEllipsis, { children: branchName }, void 0)] }, void 0));
65
+ };
66
+ const PageHeader = ({ title, metadata, additionalInfo, actions, branchName, status }) => {
67
+ const [open, setOpen] = useState(false);
68
+ const [popoverEl, setPopoverRef] = useElement();
69
+ const [buttonEl, setButtonEl] = useElement();
70
+ const t = useI18n();
71
+ const { rtl } = useDirection();
72
+ useOuterEvent('mousedown', [popoverEl, buttonEl], () => {
73
+ if (open)
74
+ setOpen(false);
75
+ });
76
+ useEffect(() => {
77
+ const closePopover = (e) => {
78
+ if (e.key === 'Escape') {
79
+ e.preventDefault();
80
+ setOpen(false);
81
+ if (e.currentTarget === popoverEl) {
82
+ e.stopPropagation();
83
+ buttonEl?.focus();
84
+ }
85
+ }
86
+ };
87
+ document.addEventListener('keydown', closePopover);
88
+ popoverEl?.addEventListener('keydown', closePopover);
89
+ return () => {
90
+ document.removeEventListener('keydown', closePopover);
91
+ popoverEl?.removeEventListener('keydown', closePopover);
92
+ };
93
+ }, [popoverEl]);
94
+ return (_jsx(StyledHeaderContent, { container: { rowGap: 0.5 }, primary: _jsxs(Flex, { container: { alignItems: 'start', gap: 0.5, wrap: 'wrap' }, children: [_jsxs(Flex, { container: { gap: 0.5 }, item: { shrink: 0 }, children: [_jsx(StyledTextWithEllipsis, { variant: 'h1', children: title }, void 0), additionalInfo && (_jsxs(_Fragment, { children: [_jsx(Button, { label: t('additional_info'), variant: 'simple', icon: true, ref: setButtonEl, onClick: () => setOpen(cur => !cur), children: _jsx(Icon, { name: 'information' }, void 0) }, void 0), _jsx(StyledInfoPopover, { ref: setPopoverRef, show: open, target: buttonEl, placement: rtl ? 'bottom-end' : 'bottom-start', children: _jsxs(Flex, { container: { direction: 'column', alignItems: 'start', gap: 2, pad: 2 }, children: [_jsxs(Flex, { container: { direction: 'column', gap: 1 }, children: [_jsx(Text, { variant: 'h3', children: additionalInfo.title }, void 0), additionalInfo.description && (_jsx(Text, { as: 'p', children: additionalInfo.description }, void 0)), _jsx(FieldValueList, { variant: 'inline', fields: additionalInfo.fields }, void 0)] }, void 0), additionalInfo.onEdit && (_jsx(Button, { onClick: (e) => {
95
+ setOpen(false);
96
+ additionalInfo.onEdit?.(e);
97
+ }, children: t('edit_details') }, void 0))] }, void 0) }, void 0)] }, void 0))] }, void 0), branchName && status && _jsx(Branch, { branchName: branchName, status: status }, void 0)] }, void 0), secondary: metadata && _jsx(MetaFields, { metadata: metadata }, void 0), actions: actions }, void 0));
98
+ };
99
+ export const TabbedPage = forwardRef(({ tabs, a, ...restProps }, ref) => {
100
+ return (_jsx(CoreTabbedPage, { ...restProps, as: StyledPage, header: _jsx(PageHeader, { ...restProps }, void 0), tabs: tabs, ref: ref, scrollContent: true, a: a }, void 0));
101
+ });
102
+ export const OneColumnPage = forwardRef(({ a, ...restProps }, ref) => {
103
+ return (_jsx(CoreOneColumnPage, { ...restProps, as: StyledPage, header: _jsx(PageHeader, { ...restProps }, void 0), scrollContent: true, a: a, ref: ref }, void 0));
104
+ });
105
+ //# sourceMappingURL=PageTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageTemplates.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/PageTemplates.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,UAAU,EACV,QAAQ,EACR,SAAS,EAGV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,aAAa,IAAI,iBAAiB,EAElC,UAAU,IAAI,cAAc,EAG5B,IAAI,EACJ,MAAM,EACN,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,cAAc,EACd,IAAI,EAEJ,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,aAAa,EAGb,wBAAwB,EAExB,YAAY,EACZ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,KAAK,eAAe,MAAM,oEAAoE,CAAC;AACtG,OAAO,EACL,aAAa,EACb,YAAY,EACZ,aAAa,EACd,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,YAAY,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAwB7C,MAAM,sBAAsB,GAAgB,MAAM,CAAC,IAAI,CAAC,CAAA;;;;CAIvD,CAAC;AAEF,MAAM,iBAAiB,GAAmB,MAAM,CAAC,OAAO,CAAC,CAAA;;;CAGxD,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;CAKjC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE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AM,UAAU,GAAsD,UAAU,CACrF,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,SAAS,EAAoC,EAAE,GAAwB,EAAE,EAAE;IACxF,OAAO,CACL,KAAC,cAAc,OACT,SAAS,EACb,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,KAAC,UAAU,OAAK,SAAS,WAAI,EACrC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,aAAa,QACb,CAAC,EAAE,CAAC,WACJ,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAyD,UAAU,CAC3F,CACE,EACE,CAAC,EAED,GAAG,SAAS,EACwB,EACtC,GAAwB,EACxB,EAAE;IACF,OAAO,CACL,KAAC,iBAAiB,OACZ,SAAS,EACb,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,KAAC,UAAU,OAAK,SAAS,WAAI,EACrC,aAAa,QACb,CAAC,EAAE,CAAC,EACJ,GAAG,EAAE,GAAG,WACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n PropsWithoutRef,\n Ref,\n FunctionComponent,\n forwardRef,\n useState,\n useEffect,\n FC,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n OneColumnPage as CoreOneColumnPage,\n OneColumnPageProps as CoreOneColumnPageProps,\n TabbedPage as CoreTabbedPage,\n TabbedPageProps as CoreTabbedPageProps,\n FieldValueListProps,\n Flex,\n Status,\n SummaryItem,\n Text,\n Button,\n Popover,\n FieldValueList,\n Icon,\n ForwardProps,\n defaultThemeProp,\n useI18n,\n useDirection,\n useElement,\n useOuterEvent,\n PageTemplateProps,\n OmitStrict,\n StyledSummaryItemActions,\n StatusProps,\n registerIcon,\n StyledLabel\n} from '@pega/cosmos-react-core';\nimport * as nodesDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/nodes-down.icon';\nimport * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';\nimport {\n StyledRegions,\n StyledRegion,\n StyledContent\n} from '@pega/cosmos-react-core/lib/components/PageTemplates/PageTemplates';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\n\nregisterIcon(nodesDownIcon, informationIcon);\n\nexport interface PageHeaderProps extends Pick<PageTemplateProps, 'title' | 'actions'> {\n metadata?: FieldValueListProps['fields'];\n branchName?: string;\n status?: { type?: StatusProps['variant']; label: string };\n additionalInfo?: {\n title: string;\n description?: string;\n fields: FieldValueListProps['fields'];\n onEdit?: (e: MouseEvent<HTMLButtonElement>) => void;\n };\n}\n\ntype OmittedPageProps = 'header' | 'scrollContent';\n\nexport interface OneColumnPageProps\n extends OmitStrict<CoreOneColumnPageProps, OmittedPageProps>,\n PageHeaderProps {}\n\nexport interface TabbedPageProps\n extends OmitStrict<CoreTabbedPageProps, OmittedPageProps>,\n PageHeaderProps {}\n\nconst StyledTextWithEllipsis: typeof Text = styled(Text)`\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n`;\n\nconst StyledInfoPopover: typeof Popover = styled(Popover)`\n max-width: 60ch;\n overflow-wrap: break-word;\n`;\n\nconst StyledMetaFields = styled.dl`\n dd,\n dt {\n display: inline;\n }\n`;\n\nexport const StyledBranch = styled.div(({ theme }) => {\n return css`\n border: 0.0625rem solid ${theme.base.colors.gray.light};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: calc(0.5 * ${theme.base.spacing});\n max-width: 100%;\n overflow: hidden;\n `;\n});\n\nStyledBranch.defaultProps = defaultThemeProp;\n\nconst StyledHeaderContent = styled(SummaryItem)`\n ${StyledSummaryItemActions} {\n align-self: start;\n }\n`;\n\nexport const StyledPage = styled.div(({ theme }) => {\n return css`\n ${StyledContent} {\n margin: 0 calc(2 * ${theme.base.spacing});\n }\n ${StyledRegions} {\n padding: 0;\n grid-template-rows: repeat(auto-fit, minmax(0, 1fr));\n ${StyledRegion} {\n height: 100%;\n }\n }\n\n ${StyledTabPanel} {\n height: 100%;\n }\n `;\n});\n\nconst MetaFields: FC<{ metadata: NonNullable<PageHeaderProps['metadata']> }> = ({ metadata }) => {\n return (\n <Flex container={{ wrap: 'wrap', colGap: 1, rowGap: 0.25 }} as={StyledMetaFields}>\n {metadata.map(meta => {\n return (\n <div key={meta.id}>\n <StyledLabel as='dt'>\n {meta.name}\n <span aria-hidden='true'>: </span>\n </StyledLabel>\n <Text variant='secondary' as='dd'>\n {meta.value}\n </Text>\n </div>\n );\n })}\n </Flex>\n );\n};\n\nconst Branch: FC<Pick<PageHeaderProps, 'branchName' | 'status'>> = ({ branchName, status }) => {\n return (\n <Flex container={{ alignItems: 'center', gap: 0.5 }} as={StyledBranch}>\n {status && (\n <Flex item={{ shrink: 0 }} as={Status} variant={status.type}>\n {status.label}\n </Flex>\n )}\n <Flex item={{ shrink: 0 }} as={Icon} name='nodes-down' />\n {branchName && <StyledTextWithEllipsis>{branchName}</StyledTextWithEllipsis>}\n </Flex>\n );\n};\n\nconst PageHeader = ({\n title,\n metadata,\n additionalInfo,\n actions,\n branchName,\n status\n}: PageHeaderProps) => {\n const [open, setOpen] = useState(false);\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const t = useI18n();\n const { rtl } = useDirection();\n\n useOuterEvent('mousedown', [popoverEl, buttonEl], () => {\n if (open) setOpen(false);\n });\n\n useEffect(() => {\n const closePopover = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n setOpen(false);\n if (e.currentTarget === popoverEl) {\n e.stopPropagation();\n buttonEl?.focus();\n }\n }\n };\n\n document.addEventListener('keydown', closePopover);\n popoverEl?.addEventListener('keydown', closePopover);\n\n return () => {\n document.removeEventListener('keydown', closePopover);\n popoverEl?.removeEventListener('keydown', closePopover);\n };\n }, [popoverEl]);\n\n return (\n <StyledHeaderContent\n container={{ rowGap: 0.5 }}\n primary={\n <Flex container={{ alignItems: 'start', gap: 0.5, wrap: 'wrap' }}>\n <Flex container={{ gap: 0.5 }} item={{ shrink: 0 }}>\n <StyledTextWithEllipsis variant='h1'>{title}</StyledTextWithEllipsis>\n {additionalInfo && (\n <>\n <Button\n label={t('additional_info')}\n variant='simple'\n icon\n ref={setButtonEl}\n onClick={() => setOpen(cur => !cur)}\n >\n <Icon name='information' />\n </Button>\n <StyledInfoPopover\n ref={setPopoverRef}\n show={open}\n target={buttonEl}\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n >\n <Flex container={{ direction: 'column', alignItems: 'start', gap: 2, pad: 2 }}>\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{additionalInfo.title}</Text>\n {additionalInfo.description && (\n <Text as='p'>{additionalInfo.description}</Text>\n )}\n <FieldValueList variant='inline' fields={additionalInfo.fields} />\n </Flex>\n {additionalInfo.onEdit && (\n <Button\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n setOpen(false);\n additionalInfo.onEdit?.(e);\n }}\n >\n {t('edit_details')}\n </Button>\n )}\n </Flex>\n </StyledInfoPopover>\n </>\n )}\n </Flex>\n {branchName && status && <Branch branchName={branchName} status={status} />}\n </Flex>\n }\n secondary={metadata && <MetaFields metadata={metadata} />}\n actions={actions}\n />\n );\n};\n\nexport const TabbedPage: FunctionComponent<TabbedPageProps & ForwardProps> = forwardRef(\n ({ tabs, a, ...restProps }: PropsWithoutRef<TabbedPageProps>, ref: Ref<HTMLDivElement>) => {\n return (\n <CoreTabbedPage\n {...restProps}\n as={StyledPage}\n header={<PageHeader {...restProps} />}\n tabs={tabs}\n ref={ref}\n scrollContent\n a={a}\n />\n );\n }\n);\n\nexport const OneColumnPage: FunctionComponent<OneColumnPageProps & ForwardProps> = forwardRef(\n (\n {\n a,\n\n ...restProps\n }: PropsWithoutRef<OneColumnPageProps>,\n ref: Ref<HTMLDivElement>\n ) => {\n return (\n <CoreOneColumnPage\n {...restProps}\n as={StyledPage}\n header={<PageHeader {...restProps} />}\n scrollContent\n a={a}\n ref={ref}\n />\n );\n }\n);\n"]}
@@ -0,0 +1,5 @@
1
+ export { OneColumnPage } from './PageTemplates';
2
+ export { TabbedPage } from './PageTemplates';
3
+ export { default as GalleryPage } from './GalleryPage';
4
+ export { GalleryPageProps } from './GalleryPage';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { OneColumnPage } from './PageTemplates';
2
+ export { TabbedPage } from './PageTemplates';
3
+ export { default as GalleryPage } from './GalleryPage';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { OneColumnPage } from './PageTemplates';\nexport { TabbedPage } from './PageTemplates';\nexport { default as GalleryPage } from './GalleryPage';\nexport { GalleryPageProps } from './GalleryPage';\n"]}
@@ -0,0 +1,16 @@
1
+ import { FC, MouseEvent } from 'react';
2
+ import { Text, Card, MetaListProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ import { VisualProps } from '../Visual';
4
+ export interface SummaryCardProps extends NoChildrenProp {
5
+ id: string;
6
+ title: string;
7
+ description?: string;
8
+ onClick?: (id: string, e: MouseEvent<HTMLDivElement>) => void;
9
+ meta: MetaListProps['items'];
10
+ visual?: VisualProps;
11
+ }
12
+ export declare const StyledTitle: typeof Text;
13
+ export declare const StyledSummaryCard: typeof Card;
14
+ declare const SummaryCard: FC<SummaryCardProps>;
15
+ export default SummaryCard;
16
+ //# sourceMappingURL=SummaryCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummaryCard.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryCard/SummaryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EACL,IAAI,EAGJ,IAAI,EAEJ,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,OAAe,EAAE,WAAW,EAAyB,MAAM,WAAW,CAAC;AAEvE,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC9D,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,OAAO,IAIhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,OAAO,IAarC,CAAC;AAIH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAkBrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled, { css } from 'styled-components';
3
+ import { Text, Flex, MetaList, Card, defaultThemeProp } from '@pega/cosmos-react-core';
4
+ import BareRoleButton from '@pega/cosmos-react-core/lib/components/Button/BareRoleButton';
5
+ import { StyledDescription } from '../PageTemplates/GalleryPage.styles';
6
+ import Visual, { StyledVisualContainer } from '../Visual';
7
+ export const StyledTitle = styled(Text) `
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ white-space: nowrap;
11
+ `;
12
+ export const StyledSummaryCard = styled(Card)(({ theme }) => {
13
+ return css `
14
+ padding: calc(2 * ${theme.base.spacing});
15
+ &:hover,
16
+ &:focus {
17
+ cursor: pointer;
18
+ box-shadow: ${theme.base.shadow.focus};
19
+ }
20
+
21
+ ${StyledVisualContainer} {
22
+ flex-shrink: 0;
23
+ }
24
+ `;
25
+ });
26
+ StyledSummaryCard.defaultProps = defaultThemeProp;
27
+ const SummaryCard = ({ id, title, description, visual, meta, onClick }) => {
28
+ return (_jsxs(BareRoleButton, { container: { direction: 'column', rowGap: 2, justify: 'between' }, as: StyledSummaryCard, onClick: (e) => onClick?.(id, e), children: [_jsxs(Flex, { container: { alignItems: 'center', colGap: 1 }, children: [visual && _jsx(Visual, { ...visual }, void 0), _jsx(StyledTitle, { variant: 'h3', children: title }, void 0)] }, void 0), _jsx(Flex, { item: { grow: 1 }, children: _jsx(StyledDescription, { children: description }, void 0) }, void 0), _jsx(MetaList, { items: meta, wrapItems: false }, void 0)] }, id));
29
+ };
30
+ export default SummaryCard;
31
+ //# sourceMappingURL=SummaryCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummaryCard.js","sourceRoot":"","sources":["../../../src/components/SummaryCard/SummaryCard.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,cAAc,MAAM,8DAA8D,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,MAAM,EAAE,EAAe,qBAAqB,EAAE,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C;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FC, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Text,\n Flex,\n MetaList,\n Card,\n defaultThemeProp,\n MetaListProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport BareRoleButton from '@pega/cosmos-react-core/lib/components/Button/BareRoleButton';\n\nimport { StyledDescription } from '../PageTemplates/GalleryPage.styles';\nimport Visual, { VisualProps, StyledVisualContainer } from '../Visual';\n\nexport interface SummaryCardProps extends NoChildrenProp {\n id: string;\n title: string;\n description?: string;\n onClick?: (id: string, e: MouseEvent<HTMLDivElement>) => void;\n meta: MetaListProps['items'];\n visual?: VisualProps;\n}\n\nexport const StyledTitle: typeof Text = styled(Text)`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const StyledSummaryCard: typeof Card = styled(Card)(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n &:hover,\n &:focus {\n cursor: pointer;\n box-shadow: ${theme.base.shadow.focus};\n }\n\n ${StyledVisualContainer} {\n flex-shrink: 0;\n }\n `;\n});\n\nStyledSummaryCard.defaultProps = defaultThemeProp;\n\nconst SummaryCard: FC<SummaryCardProps> = ({ id, title, description, visual, meta, onClick }) => {\n return (\n <BareRoleButton\n container={{ direction: 'column', rowGap: 2, justify: 'between' }}\n as={StyledSummaryCard}\n key={id}\n onClick={(e: MouseEvent<HTMLDivElement>) => onClick?.(id, e)}\n >\n <Flex container={{ alignItems: 'center', colGap: 1 }}>\n {visual && <Visual {...visual} />}\n <StyledTitle variant='h3'>{title}</StyledTitle>\n </Flex>\n <Flex item={{ grow: 1 }}>\n <StyledDescription>{description}</StyledDescription>\n </Flex>\n <MetaList items={meta} wrapItems={false} />\n </BareRoleButton>\n );\n};\n\nexport default SummaryCard;\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './SummaryCard';
2
+ export * from './SummaryCard';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryCard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from './SummaryCard';
2
+ export * from './SummaryCard';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SummaryCard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC","sourcesContent":["export { default } from './SummaryCard';\nexport * from './SummaryCard';\n"]}
@@ -0,0 +1,17 @@
1
+ import { FC } from 'react';
2
+ import { ImageProps, IconProps, RequiredByKey } from '@pega/cosmos-react-core';
3
+ interface IconWithColor extends IconProps {
4
+ bgColor?: string;
5
+ color?: string;
6
+ }
7
+ interface VisualPropsInterface {
8
+ /** displays the image */
9
+ image?: ImageProps;
10
+ /** displays icon if image is not available */
11
+ icon?: IconWithColor;
12
+ }
13
+ export declare type VisualProps = RequiredByKey<VisualPropsInterface, 'icon'> | RequiredByKey<VisualPropsInterface, 'image'>;
14
+ export declare const StyledVisualContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
15
+ declare const Visual: FC<VisualProps>;
16
+ export default Visual;
17
+ //# sourceMappingURL=Visual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Visual.d.ts","sourceRoot":"","sources":["../../../src/components/Visual/Visual.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,EAEL,UAAU,EACV,SAAS,EAMT,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,UAAU,aAAc,SAAQ,SAAS;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,oBAAoB;IAE5B,yBAAyB;IACzB,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,oBAAY,WAAW,GACnB,aAAa,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAC3C,aAAa,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;AAEjD,eAAO,MAAM,qBAAqB,yGAWhC,CAAC;AAIH,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAmB3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled, { css } from 'styled-components';
3
+ import { readableColor } from 'polished';
4
+ import { Image, Icon, Flex, useTheme, StyledIcon, defaultThemeProp } from '@pega/cosmos-react-core';
5
+ export const StyledVisualContainer = styled.div(({ theme }) => {
6
+ return css `
7
+ width: 2rem;
8
+ height: 2rem;
9
+ border-radius: ${theme.base['border-radius']};
10
+ background-color: var(--bg-color);
11
+ color: var(--fg-color);
12
+ ${StyledIcon} {
13
+ color: var(--fg-color);
14
+ }
15
+ `;
16
+ });
17
+ StyledVisualContainer.defaultProps = defaultThemeProp;
18
+ const Visual = ({ image, icon }) => {
19
+ const theme = useTheme();
20
+ const color = (icon && icon.color) || theme.base.colors.white;
21
+ const bgColor = (icon && icon.bgColor) || readableColor(color);
22
+ return (_jsxs(Flex, { as: StyledVisualContainer, container: { justify: 'center', alignItems: 'center' }, style: {
23
+ '--bg-color': bgColor,
24
+ '--fg-color': color
25
+ }, children: [image && image.src && _jsx(Image, { src: image.src, alt: image.alt }, void 0), icon && icon.name && _jsx(Icon, { name: icon.name }, void 0)] }, void 0));
26
+ };
27
+ export default Visual;
28
+ //# sourceMappingURL=Visual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Visual.js","sourceRoot":"","sources":["../../../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C,IAAI,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,WAAI,YAC1C,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { CSSProperties, FC } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Image,\n ImageProps,\n IconProps,\n Icon,\n Flex,\n useTheme,\n StyledIcon,\n defaultThemeProp,\n RequiredByKey\n} from '@pega/cosmos-react-core';\n\ninterface IconWithColor extends IconProps {\n bgColor?: string;\n color?: string;\n}\n\ninterface VisualPropsInterface {\n // visual: ImageProps | (IconProps & { color?: string; bgColor?: string });\n /** displays the image */\n image?: ImageProps;\n\n /** displays icon if image is not available */\n icon?: IconWithColor;\n}\n\nexport type VisualProps =\n | RequiredByKey<VisualPropsInterface, 'icon'>\n | RequiredByKey<VisualPropsInterface, 'image'>;\n\nexport const StyledVisualContainer = styled.div(({ theme }) => {\n return css`\n width: 2rem;\n height: 2rem;\n border-radius: ${theme.base['border-radius']};\n background-color: var(--bg-color);\n color: var(--fg-color);\n ${StyledIcon} {\n color: var(--fg-color);\n }\n `;\n});\n\nStyledVisualContainer.defaultProps = defaultThemeProp;\n\nconst Visual: FC<VisualProps> = ({ image, icon }) => {\n const theme = useTheme();\n const color = (icon && icon.color) || theme.base.colors.white;\n const bgColor = (icon && icon.bgColor) || readableColor(color);\n return (\n <Flex\n as={StyledVisualContainer}\n container={{ justify: 'center', alignItems: 'center' }}\n style={\n {\n '--bg-color': bgColor,\n '--fg-color': color\n } as CSSProperties\n }\n >\n {image && image.src && <Image src={image.src} alt={image.alt} />}\n {icon && icon.name && <Icon name={icon.name} />}\n </Flex>\n );\n};\n\nexport default Visual;\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './Visual';
2
+ export * from './Visual';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Visual/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from './Visual';
2
+ export * from './Visual';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Visual/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC","sourcesContent":["export { default } from './Visual';\nexport * from './Visual';\n"]}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { ConfigurationPanelProps } from './Workbench.types';
3
+ declare const ConfigurationPanel: FC<ConfigurationPanelProps>;
4
+ export default ConfigurationPanel;
5
+ //# sourceMappingURL=ConfigurationPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/Workbench/ConfigurationPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA0B,MAAM,OAAO,CAAC;AAanD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,QAAA,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA4CnD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect } from 'react';
3
+ import { Flex, Text, Button, Icon, useElement, useI18n, ExpandCollapse } from '@pega/cosmos-react-core';
4
+ import { StyledPanel } from './Workbench.styles';
5
+ const ConfigurationPanel = ({ open, header, content, onDismiss }) => {
6
+ const [buttonEl, setButtonEl] = useElement();
7
+ const t = useI18n();
8
+ const onKeyDown = useCallback(({ key }) => {
9
+ if (key === 'Escape')
10
+ onDismiss();
11
+ }, [onDismiss]);
12
+ useEffect(() => {
13
+ document.addEventListener('keydown', onKeyDown);
14
+ return () => {
15
+ document.removeEventListener('keydown', onKeyDown);
16
+ };
17
+ }, [onKeyDown]);
18
+ return (_jsx(ExpandCollapse, { as: StyledPanel, dimension: 'width', collapsed: !open, min: '0', max: '25rem', onAfterExpand: () => buttonEl?.focus(), children: _jsxs(Flex, { container: { pad: 2, direction: 'column', gap: 1 }, children: [_jsxs(Flex, { container: { justify: 'between', alignItems: 'center' }, children: [_jsx(Text, { variant: 'h3', children: header }, void 0), _jsx(Button, { variant: 'simple', icon: true, onClick: onDismiss, ref: setButtonEl, "aria-label": t('close'), children: _jsx(Icon, { name: 'times' }, void 0) }, void 0)] }, void 0), content] }, void 0) }, void 0));
19
+ };
20
+ export default ConfigurationPanel;
21
+ //# sourceMappingURL=ConfigurationPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationPanel.js","sourceRoot":"","sources":["../../../src/components/Workbench/ConfigurationPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,kBAAkB,GAAgC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;IAC/F,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,UAAU,EAAe,CAAC;IAC1D,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,SAAS,GAAG,WAAW,CAC3B,CAAC,EAAE,GAAG,EAAiB,EAAE,EAAE;QACzB,IAAI,GAAG,KAAK,QAAQ;YAAE,SAAS,EAAE,CAAC;IACpC,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAChD,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,CACL,KAAC,cAAc,IACb,EAAE,EAAE,WAAW,EACf,SAAS,EAAC,OAAO,EACjB,SAAS,EAAE,CAAC,IAAI,EAChB,GAAG,EAAC,GAAG,EACP,GAAG,EAAC,OAAO,EACX,aAAa,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,YAEtC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aACtD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,aAC3D,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,MAAM,WAAQ,EAClC,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,SAAS,EAClB,GAAG,EAAE,WAAW,gBACJ,CAAC,CAAC,OAAO,CAAC,YAEtB,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,WACd,YACJ,EACN,OAAO,YACH,WACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FC, useCallback, useEffect } from 'react';\n\nimport {\n Flex,\n Text,\n Button,\n Icon,\n useElement,\n useI18n,\n ExpandCollapse\n} from '@pega/cosmos-react-core';\n\nimport { StyledPanel } from './Workbench.styles';\nimport { ConfigurationPanelProps } from './Workbench.types';\n\nconst ConfigurationPanel: FC<ConfigurationPanelProps> = ({ open, header, content, onDismiss }) => {\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const t = useI18n();\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === 'Escape') onDismiss();\n },\n [onDismiss]\n );\n\n useEffect(() => {\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [onKeyDown]);\n\n return (\n <ExpandCollapse\n as={StyledPanel}\n dimension='width'\n collapsed={!open}\n min='0'\n max='25rem'\n onAfterExpand={() => buttonEl?.focus()}\n >\n <Flex container={{ pad: 2, direction: 'column', gap: 1 }}>\n <Flex container={{ justify: 'between', alignItems: 'center' }}>\n <Text variant='h3'>{header}</Text>\n <Button\n variant='simple'\n icon\n onClick={onDismiss}\n ref={setButtonEl}\n aria-label={t('close')}\n >\n <Icon name='times' />\n </Button>\n </Flex>\n {content}\n </Flex>\n </ExpandCollapse>\n );\n};\n\nexport default ConfigurationPanel;\n"]}
@@ -0,0 +1,14 @@
1
+ import { FC } from 'react';
2
+ import { ToolbarProps, UtilityPanelProps } from './Workbench.types';
3
+ interface UtilityPanelSelectorProps {
4
+ options: Pick<UtilityPanelProps, 'id' | 'title' | 'icon'>[];
5
+ onToggle: (panelId?: UtilityPanelProps['id']) => void;
6
+ currentPanelId: UtilityPanelProps['id'] | undefined;
7
+ }
8
+ interface ZoomProps {
9
+ zoomLevel: number;
10
+ onZoomLevelChange: (value: number) => void;
11
+ }
12
+ declare const Toolbar: FC<ToolbarProps & UtilityPanelSelectorProps & ZoomProps>;
13
+ export default Toolbar;
14
+ //# sourceMappingURL=Toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/Workbench/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,UAAU,yBAAyB;IACjC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC;IAC5D,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACtD,cAAc,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;CACrD;AAED,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,GAAG,yBAAyB,GAAG,SAAS,CA6ErE,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flex, Icon, NumberInput, Button, useI18n } from '@pega/cosmos-react-core';
3
+ import { StyledPanelToggleWrapper, StyledToolbar, UtilityPanelToggle } from './Workbench.styles';
4
+ const Toolbar = ({ zoom = false, zoomLevel, onZoomLevelChange, options, currentPanelId, onToggle, toolbarActions: { undo, redo } = {} }) => {
5
+ const t = useI18n();
6
+ return (_jsxs(Flex, { as: StyledToolbar, container: { justify: 'between' }, children: [_jsxs(Flex, { container: { alignItems: 'center' }, children: [_jsx(Flex, { container: { alignItems: 'center' }, as: StyledPanelToggleWrapper, children: options.map(panelDef => {
7
+ const selected = panelDef.id === currentPanelId;
8
+ return (_jsx(Button, { variant: 'simple', as: UtilityPanelToggle, icon: true, "aria-selected": selected, onClick: () => {
9
+ onToggle(selected ? undefined : panelDef.id);
10
+ }, label: t(selected ? 'collapse_noun' : 'expand_noun', [panelDef.title]), children: _jsx(Icon, { name: panelDef.icon }, void 0) }, panelDef.id));
11
+ }) }, void 0), undo && (_jsx(Button, { label: t('undo'), variant: 'simple', icon: true, onClick: undo.onClick, disabled: undo.disabled, children: _jsx(Icon, { name: 'arrow-bend-left' }, void 0) }, void 0)), redo && (_jsx(Button, { label: t('redo'), variant: 'simple', icon: true, onClick: redo.onClick, disabled: redo.disabled, children: _jsx(Icon, { name: 'arrow-bend-right' }, void 0) }, void 0))] }, void 0), _jsx(Flex, { container: { alignItems: 'center' }, children: zoom && (_jsx(NumberInput, { variant: 'stepper', label: t('zoom_level'), labelHidden: true, value: zoomLevel.toString(), onChange: value => onZoomLevelChange(Number(value)), showDecimal: false, showGroupSeparators: false, step: 25, unit: '%', unitPlacement: 'after', min: 25, max: 300 }, void 0)) }, void 0)] }, void 0));
12
+ };
13
+ export default Toolbar;
14
+ //# sourceMappingURL=Toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/Workbench/Toolbar.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAcjG,MAAM,OAAO,GAA6D,CAAC,EACzE,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,QAAQ,EACR,cAAc,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EACkB,EAAE,EAAE;IACzD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,aACxD,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,aACvC,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,wBAAwB,YACpE,OAAO,CAAC,GAAG,CAAC,Q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AE,CAAC,CAAC,YAAY,CAAC,EACtB,WAAW,QACX,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,EAC3B,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EACnD,WAAW,EAAE,KAAK,EAClB,mBAAmB,EAAE,KAAK,EAC1B,IAAI,EAAE,EAAE,EACR,IAAI,EAAC,GAAG,EACR,aAAa,EAAC,OAAO,EACrB,GAAG,EAAE,EAAE,EACP,GAAG,EAAE,GAAG,WACR,CACH,WACI,YACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { FC } from 'react';\n\nimport { Flex, Icon, NumberInput, Button, useI18n } from '@pega/cosmos-react-core';\n\nimport { StyledPanelToggleWrapper, StyledToolbar, UtilityPanelToggle } from './Workbench.styles';\nimport { ToolbarProps, UtilityPanelProps } from './Workbench.types';\n\ninterface UtilityPanelSelectorProps {\n options: Pick<UtilityPanelProps, 'id' | 'title' | 'icon'>[];\n onToggle: (panelId?: UtilityPanelProps['id']) => void;\n currentPanelId: UtilityPanelProps['id'] | undefined;\n}\n\ninterface ZoomProps {\n zoomLevel: number;\n onZoomLevelChange: (value: number) => void;\n}\n\nconst Toolbar: FC<ToolbarProps & UtilityPanelSelectorProps & ZoomProps> = ({\n zoom = false,\n zoomLevel,\n onZoomLevelChange,\n options,\n currentPanelId,\n onToggle,\n toolbarActions: { undo, redo } = {}\n}: ToolbarProps & UtilityPanelSelectorProps & ZoomProps) => {\n const t = useI18n();\n\n return (\n <Flex as={StyledToolbar} container={{ justify: 'between' }}>\n <Flex container={{ alignItems: 'center' }}>\n <Flex container={{ alignItems: 'center' }} as={StyledPanelToggleWrapper}>\n {options.map(panelDef => {\n const selected = panelDef.id === currentPanelId;\n return (\n <Button\n variant='simple'\n as={UtilityPanelToggle}\n icon\n aria-selected={selected}\n onClick={() => {\n onToggle(selected ? undefined : panelDef.id);\n }}\n label={t(selected ? 'collapse_noun' : 'expand_noun', [panelDef.title])}\n key={panelDef.id}\n >\n <Icon name={panelDef.icon} />\n </Button>\n );\n })}\n </Flex>\n {undo && (\n <Button\n label={t('undo')}\n variant='simple'\n icon\n onClick={undo.onClick}\n disabled={undo.disabled}\n >\n <Icon name='arrow-bend-left' />\n </Button>\n )}\n {redo && (\n <Button\n label={t('redo')}\n variant='simple'\n icon\n onClick={redo.onClick}\n disabled={redo.disabled}\n >\n <Icon name='arrow-bend-right' />\n </Button>\n )}\n </Flex>\n <Flex container={{ alignItems: 'center' }}>\n {zoom && (\n <NumberInput\n variant='stepper'\n label={t('zoom_level')}\n labelHidden\n value={zoomLevel.toString()}\n onChange={value => onZoomLevelChange(Number(value))}\n showDecimal={false}\n showGroupSeparators={false}\n step={25}\n unit='%'\n unitPlacement='after'\n min={25}\n max={300}\n />\n )}\n </Flex>\n </Flex>\n );\n};\n\nexport default Toolbar;\n"]}
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { UtilityPanelProps } from './Workbench.types';
3
+ declare const UtilityPanel: FC<UtilityPanelProps & {
4
+ open: boolean;
5
+ }>;
6
+ export default UtilityPanel;
7
+ //# sourceMappingURL=UtilityPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UtilityPanel.d.ts","sourceRoot":"","sources":["../../../src/components/Workbench/UtilityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAU,MAAM,OAAO,CAAC;AAKnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAuB3D,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ import { ExpandCollapse, Text, Flex, getFocusables } from '@pega/cosmos-react-core';
4
+ import { StyledPanel } from './Workbench.styles';
5
+ const UtilityPanel = ({ content, title, open }) => {
6
+ const ref = useRef(null);
7
+ return (_jsx(ExpandCollapse, { dimension: 'width', collapsed: !open, as: StyledPanel, min: '0', max: '14rem', onBeforeExpand: () => {
8
+ getFocusables(ref)[0]?.focus();
9
+ }, children: _jsxs(Flex, { container: { pad: 2, gap: 1, direction: 'column' }, ref: ref, children: [_jsx(Text, { variant: 'h3', children: title }, void 0), content] }, void 0) }, void 0));
10
+ };
11
+ export default UtilityPanel;
12
+ //# sourceMappingURL=UtilityPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UtilityPanel.js","sourceRoot":"","sources":["../../../src/components/Workbench/UtilityPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,MAAM,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,YAAY,GAA8C,CAAC,EAC/D,OAAO,EACP,KAAK,EACL,IAAI,EACkC,EAAE,EAAE;IAC1C,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,OAAO,CACL,KAAC,cAAc,IACb,SAAS,EAAC,OAAO,EACjB,SAAS,EAAE,CAAC,IAAI,EAChB,EAAE,EAAE,WAAW,EACf,GAAG,EAAC,GAAG,EACP,GAAG,EAAC,OAAO,EACX,cAAc,EAAE,GAAG,EAAE;YACnB,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QACjC,CAAC,YAED,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,aAChE,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,WAAQ,EAChC,OAAO,YACH,WACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FC, useRef } from 'react';\n\nimport { ExpandCollapse, Text, Flex, getFocusables } from '@pega/cosmos-react-core';\n\nimport { StyledPanel } from './Workbench.styles';\nimport { UtilityPanelProps } from './Workbench.types';\n\nconst UtilityPanel: FC<UtilityPanelProps & { open: boolean }> = ({\n content,\n title,\n open\n}: UtilityPanelProps & { open: boolean }) => {\n const ref = useRef<HTMLDivElement>(null);\n return (\n <ExpandCollapse\n dimension='width'\n collapsed={!open}\n as={StyledPanel}\n min='0'\n max='14rem'\n onBeforeExpand={() => {\n getFocusables(ref)[0]?.focus();\n }}\n >\n <Flex container={{ pad: 2, gap: 1, direction: 'column' }} ref={ref}>\n <Text variant='h3'>{title}</Text>\n {content}\n </Flex>\n </ExpandCollapse>\n );\n};\n\nexport default UtilityPanel;\n"]}