@pega/cosmos-react-build 2.0.0-dev.9.4 → 2.0.0-rc.4

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 (189) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts +4 -3
  2. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -1
  3. package/lib/components/AppHeader/AppHeader.js +10 -18
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +4 -3
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.styles.js +35 -17
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  9. package/lib/components/AppShell/AppShell.d.ts +4 -0
  10. package/lib/components/AppShell/AppShell.d.ts.map +1 -0
  11. package/lib/components/AppShell/AppShell.js +82 -0
  12. package/lib/components/AppShell/AppShell.js.map +1 -0
  13. package/lib/components/AppShell/AppShell.styles.d.ts +20 -0
  14. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -0
  15. package/lib/components/AppShell/AppShell.styles.js +329 -0
  16. package/lib/components/AppShell/AppShell.styles.js.map +1 -0
  17. package/lib/components/AppShell/AppShell.types.d.ts +43 -0
  18. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -0
  19. package/lib/components/AppShell/AppShell.types.js +2 -0
  20. package/lib/components/AppShell/AppShell.types.js.map +1 -0
  21. package/lib/components/AppShell/AppShellContext.d.ts +4 -0
  22. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -0
  23. package/lib/components/AppShell/AppShellContext.js +13 -0
  24. package/lib/components/AppShell/AppShellContext.js.map +1 -0
  25. package/lib/components/AppShell/index.d.ts +3 -0
  26. package/lib/components/AppShell/index.d.ts.map +1 -0
  27. package/lib/components/AppShell/index.js +2 -0
  28. package/lib/components/AppShell/index.js.map +1 -0
  29. package/lib/components/FlowModeller/FlowModeller.d.ts +21 -0
  30. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -0
  31. package/lib/components/FlowModeller/FlowModeller.js +201 -0
  32. package/lib/components/FlowModeller/FlowModeller.js.map +1 -0
  33. package/lib/components/FlowModeller/Node/Node.types.d.ts +54 -0
  34. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -0
  35. package/lib/components/FlowModeller/Node/Node.types.js +28 -0
  36. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -0
  37. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +19 -0
  38. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -0
  39. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +128 -0
  40. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -0
  41. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +6 -0
  42. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -0
  43. package/lib/components/FlowModeller/Node/NodeTemplates.js +55 -0
  44. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -0
  45. package/lib/components/FlowModeller/NodeLibrary.d.ts +12 -0
  46. package/lib/components/FlowModeller/NodeLibrary.d.ts.map +1 -0
  47. package/lib/components/FlowModeller/NodeLibrary.js +49 -0
  48. package/lib/components/FlowModeller/NodeLibrary.js.map +1 -0
  49. package/lib/components/FlowModeller/Renderer/AddNode.d.ts +10 -0
  50. package/lib/components/FlowModeller/Renderer/AddNode.d.ts.map +1 -0
  51. package/lib/components/FlowModeller/Renderer/AddNode.js +42 -0
  52. package/lib/components/FlowModeller/Renderer/AddNode.js.map +1 -0
  53. package/lib/components/FlowModeller/Renderer/Connector.d.ts +5 -0
  54. package/lib/components/FlowModeller/Renderer/Connector.d.ts.map +1 -0
  55. package/lib/components/FlowModeller/Renderer/Connector.js +50 -0
  56. package/lib/components/FlowModeller/Renderer/Connector.js.map +1 -0
  57. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.d.ts +12 -0
  58. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.d.ts.map +1 -0
  59. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.js +15 -0
  60. package/lib/components/FlowModeller/Renderer/ConnectorsContainer.js.map +1 -0
  61. package/lib/components/FlowModeller/Renderer/Node.d.ts +5 -0
  62. package/lib/components/FlowModeller/Renderer/Node.d.ts.map +1 -0
  63. package/lib/components/FlowModeller/Renderer/Node.js +18 -0
  64. package/lib/components/FlowModeller/Renderer/Node.js.map +1 -0
  65. package/lib/components/FlowModeller/Renderer/NodesContainer.d.ts +8 -0
  66. package/lib/components/FlowModeller/Renderer/NodesContainer.d.ts.map +1 -0
  67. package/lib/components/FlowModeller/Renderer/NodesContainer.js +15 -0
  68. package/lib/components/FlowModeller/Renderer/NodesContainer.js.map +1 -0
  69. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +5 -0
  70. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -0
  71. package/lib/components/FlowModeller/Renderer/Renderer.js +17 -0
  72. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -0
  73. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +18 -0
  74. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -0
  75. package/lib/components/FlowModeller/Renderer/Renderer.types.js +2 -0
  76. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -0
  77. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +51 -0
  78. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -0
  79. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +247 -0
  80. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -0
  81. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +35 -0
  82. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -0
  83. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +104 -0
  84. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -0
  85. package/lib/components/FlowModeller/helper.d.ts +22 -0
  86. package/lib/components/FlowModeller/helper.d.ts.map +1 -0
  87. package/lib/components/FlowModeller/helper.js +97 -0
  88. package/lib/components/FlowModeller/helper.js.map +1 -0
  89. package/lib/components/FlowModeller/index.d.ts +8 -0
  90. package/lib/components/FlowModeller/index.d.ts.map +1 -0
  91. package/lib/components/FlowModeller/index.js +6 -0
  92. package/lib/components/FlowModeller/index.js.map +1 -0
  93. package/lib/components/LifeCycle/Category.d.ts +32 -0
  94. package/lib/components/LifeCycle/Category.d.ts.map +1 -0
  95. package/lib/components/LifeCycle/Category.js +98 -0
  96. package/lib/components/LifeCycle/Category.js.map +1 -0
  97. package/lib/components/LifeCycle/LifeCycle.d.ts +22 -0
  98. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -0
  99. package/lib/components/LifeCycle/LifeCycle.js +73 -0
  100. package/lib/components/LifeCycle/LifeCycle.js.map +1 -0
  101. package/lib/components/LifeCycle/LifeCycle.types.d.ts +56 -0
  102. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -0
  103. package/lib/components/LifeCycle/LifeCycle.types.js +2 -0
  104. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -0
  105. package/lib/components/LifeCycle/LifeCycleList.d.ts +22 -0
  106. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -0
  107. package/lib/components/LifeCycle/LifeCycleList.js +65 -0
  108. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -0
  109. package/lib/components/LifeCycle/Stage.d.ts +49 -0
  110. package/lib/components/LifeCycle/Stage.d.ts.map +1 -0
  111. package/lib/components/LifeCycle/Stage.js +293 -0
  112. package/lib/components/LifeCycle/Stage.js.map +1 -0
  113. package/lib/components/LifeCycle/Step.d.ts +51 -0
  114. package/lib/components/LifeCycle/Step.d.ts.map +1 -0
  115. package/lib/components/LifeCycle/Step.js +241 -0
  116. package/lib/components/LifeCycle/Step.js.map +1 -0
  117. package/lib/components/LifeCycle/Task.d.ts +53 -0
  118. package/lib/components/LifeCycle/Task.d.ts.map +1 -0
  119. package/lib/components/LifeCycle/Task.js +188 -0
  120. package/lib/components/LifeCycle/Task.js.map +1 -0
  121. package/lib/components/LifeCycle/index.d.ts +4 -0
  122. package/lib/components/LifeCycle/index.d.ts.map +1 -0
  123. package/lib/components/LifeCycle/index.js +2 -0
  124. package/lib/components/LifeCycle/index.js.map +1 -0
  125. package/lib/components/PageTemplates/GalleryPage.d.ts +23 -0
  126. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -0
  127. package/lib/components/PageTemplates/GalleryPage.js +23 -0
  128. package/lib/components/PageTemplates/GalleryPage.js.map +1 -0
  129. package/lib/components/PageTemplates/GalleryPage.styles.d.ts +9 -0
  130. package/lib/components/PageTemplates/GalleryPage.styles.d.ts.map +1 -0
  131. package/lib/components/PageTemplates/GalleryPage.styles.js +70 -0
  132. package/lib/components/PageTemplates/GalleryPage.styles.js.map +1 -0
  133. package/lib/components/PageTemplates/PageTemplates.d.ts +27 -0
  134. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -0
  135. package/lib/components/PageTemplates/PageTemplates.js +106 -0
  136. package/lib/components/PageTemplates/PageTemplates.js.map +1 -0
  137. package/lib/components/PageTemplates/index.d.ts +5 -0
  138. package/lib/components/PageTemplates/index.d.ts.map +1 -0
  139. package/lib/components/PageTemplates/index.js +4 -0
  140. package/lib/components/PageTemplates/index.js.map +1 -0
  141. package/lib/components/SummaryCard/SummaryCard.d.ts +16 -0
  142. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -0
  143. package/lib/components/SummaryCard/SummaryCard.js +31 -0
  144. package/lib/components/SummaryCard/SummaryCard.js.map +1 -0
  145. package/lib/components/SummaryCard/index.d.ts +3 -0
  146. package/lib/components/SummaryCard/index.d.ts.map +1 -0
  147. package/lib/components/SummaryCard/index.js +3 -0
  148. package/lib/components/SummaryCard/index.js.map +1 -0
  149. package/lib/components/Visual/Visual.d.ts +17 -0
  150. package/lib/components/Visual/Visual.d.ts.map +1 -0
  151. package/lib/components/Visual/Visual.js +28 -0
  152. package/lib/components/Visual/Visual.js.map +1 -0
  153. package/lib/components/Visual/index.d.ts +3 -0
  154. package/lib/components/Visual/index.d.ts.map +1 -0
  155. package/lib/components/Visual/index.js +3 -0
  156. package/lib/components/Visual/index.js.map +1 -0
  157. package/lib/components/Workbench/ConfigurationPanel.d.ts +5 -0
  158. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -0
  159. package/lib/components/Workbench/ConfigurationPanel.js +21 -0
  160. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -0
  161. package/lib/components/Workbench/Toolbar.d.ts +14 -0
  162. package/lib/components/Workbench/Toolbar.d.ts.map +1 -0
  163. package/lib/components/Workbench/Toolbar.js +14 -0
  164. package/lib/components/Workbench/Toolbar.js.map +1 -0
  165. package/lib/components/Workbench/UtilityPanel.d.ts +7 -0
  166. package/lib/components/Workbench/UtilityPanel.d.ts.map +1 -0
  167. package/lib/components/Workbench/UtilityPanel.js +12 -0
  168. package/lib/components/Workbench/UtilityPanel.js.map +1 -0
  169. package/lib/components/Workbench/Workbench.d.ts +6 -0
  170. package/lib/components/Workbench/Workbench.d.ts.map +1 -0
  171. package/lib/components/Workbench/Workbench.js +24 -0
  172. package/lib/components/Workbench/Workbench.js.map +1 -0
  173. package/lib/components/Workbench/Workbench.styles.d.ts +10 -0
  174. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -0
  175. package/lib/components/Workbench/Workbench.styles.js +72 -0
  176. package/lib/components/Workbench/Workbench.styles.js.map +1 -0
  177. package/lib/components/Workbench/Workbench.types.d.ts +49 -0
  178. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -0
  179. package/lib/components/Workbench/Workbench.types.js +2 -0
  180. package/lib/components/Workbench/Workbench.types.js.map +1 -0
  181. package/lib/components/Workbench/index.d.ts +2 -0
  182. package/lib/components/Workbench/index.d.ts.map +1 -0
  183. package/lib/components/Workbench/index.js +2 -0
  184. package/lib/components/Workbench/index.js.map +1 -0
  185. package/lib/index.d.ts +10 -0
  186. package/lib/index.d.ts.map +1 -1
  187. package/lib/index.js +10 -0
  188. package/lib/index.js.map +1 -1
  189. package/package.json +15 -14
@@ -0,0 +1,106 @@
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
+ overflow: hidden;
47
+ padding: 0;
48
+ grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
49
+ ${StyledRegion} {
50
+ height: 100%;
51
+ }
52
+ }
53
+
54
+ ${StyledTabPanel} {
55
+ height: 100%;
56
+ }
57
+ `;
58
+ });
59
+ const MetaFields = ({ metadata }) => {
60
+ return (_jsx(Flex, { container: { wrap: 'wrap', colGap: 1, rowGap: 0.25 }, as: StyledMetaFields, children: metadata.map(meta => {
61
+ 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));
62
+ }) }, void 0));
63
+ };
64
+ const Branch = ({ branchName, status }) => {
65
+ 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));
66
+ };
67
+ const PageHeader = ({ title, metadata, additionalInfo, actions, branchName, status }) => {
68
+ const [open, setOpen] = useState(false);
69
+ const [popoverEl, setPopoverRef] = useElement();
70
+ const [buttonEl, setButtonEl] = useElement();
71
+ const t = useI18n();
72
+ const { rtl } = useDirection();
73
+ useOuterEvent('mousedown', [popoverEl, buttonEl], () => {
74
+ if (open)
75
+ setOpen(false);
76
+ });
77
+ useEffect(() => {
78
+ const closePopover = (e) => {
79
+ if (e.key === 'Escape') {
80
+ e.preventDefault();
81
+ setOpen(false);
82
+ if (e.currentTarget === popoverEl) {
83
+ e.stopPropagation();
84
+ buttonEl?.focus();
85
+ }
86
+ }
87
+ };
88
+ document.addEventListener('keydown', closePopover);
89
+ popoverEl?.addEventListener('keydown', closePopover);
90
+ return () => {
91
+ document.removeEventListener('keydown', closePopover);
92
+ popoverEl?.removeEventListener('keydown', closePopover);
93
+ };
94
+ }, [popoverEl]);
95
+ 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) => {
96
+ setOpen(false);
97
+ additionalInfo.onEdit?.(e);
98
+ }, 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));
99
+ };
100
+ export const TabbedPage = forwardRef(({ tabs, a, ...restProps }, ref) => {
101
+ return (_jsx(CoreTabbedPage, { ...restProps, as: StyledPage, header: _jsx(PageHeader, { ...restProps }, void 0), tabs: tabs, ref: ref, scrollContent: true, a: a }, void 0));
102
+ });
103
+ export const OneColumnPage = forwardRef(({ a, ...restProps }, ref) => {
104
+ return (_jsx(CoreOneColumnPage, { ...restProps, as: StyledPage, header: _jsx(PageHeader, { ...restProps }, void 0), scrollContent: true, a: a, ref: ref }, void 0));
105
+ });
106
+ //# 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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AQ,EAAE,QAAQ,WAAI,EACzD,OAAO,EAAE,OAAO,WAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,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 overflow: hidden;\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,MAA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KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,WAAI,KAVtC,EAAE,CAWQ,CAClB,CAAC;AACJ,CAAC,CAAC;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":["../../../src/components/Visual/Visual.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,KAAK,EAGL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAoBjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5D,OAAO,GAAG,CAAA;;;qBAGS,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;MAG1C,UAAU;;;GAGb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,MAAM,GAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAClD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9D,MAAM,OAAO,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/D,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAE,qBAAqB,EACzB,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EACtD,KAAK,EACH;YACE,YAAY,EAAE,OAAO;YACrB,YAAY,EAAE,KAAK;SACH,aAGnB,KAAK,IAAI,KAAK,CAAC,GAAG,IAAI,KAAC,KAAK,IAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,WAAI,EAC/D,IAAI,IAAI,IAAI,CAAC,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,KAA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SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,YACtC,IAAI,IAAI,CACP,KAAC,WAAW,IACV,OAAO,EAAC,SAAS,EACjB,KAAK,EAAE,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"]}
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import { ForwardProps } from '@pega/cosmos-react-core';
3
+ import { WorkbenchProps } from './Workbench.types';
4
+ declare const Workbench: FC<WorkbenchProps & ForwardProps>;
5
+ export default Workbench;
6
+ //# sourceMappingURL=Workbench.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Workbench.d.ts","sourceRoot":"","sources":["../../../src/components/Workbench/Workbench.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAiD,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAQ,MAAM,yBAAyB,CAAC;AAI7D,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAItE,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,GAAG,YAAY,CA6DhD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, forwardRef, useRef } from 'react';
3
+ import { Grid } from '@pega/cosmos-react-core';
4
+ import Toolbar from './Toolbar';
5
+ import { StyledMain, StyledWorkbench, ZoomContainer } from './Workbench.styles';
6
+ import ConfigurationPanel from './ConfigurationPanel';
7
+ import UtilityPanel from './UtilityPanel';
8
+ const Workbench = forwardRef(({ children, utilityPanels = [], configurationPanel, toolbar, initiallyVisiblePanelId }, ref) => {
9
+ const [zoomValue, setZoomValue] = useState(100);
10
+ const [currentlyOpenPanelId, setCurrentlyOpenPanelId] = useState(initiallyVisiblePanelId);
11
+ const panelContentRef = useRef(utilityPanels.find(panel => panel.id === initiallyVisiblePanelId));
12
+ const onToggle = (panelId) => {
13
+ setCurrentlyOpenPanelId(panelId);
14
+ if (panelId)
15
+ panelContentRef.current = utilityPanels.find(panel => panel.id === panelId);
16
+ };
17
+ return (_jsxs(Grid, { container: {
18
+ cols: 'min-content minmax(10rem, 1fr) min-content',
19
+ rows: 'auto minmax(0, 1fr)',
20
+ areas: '"header header header" "utility main configuration"'
21
+ }, as: StyledWorkbench, ref: ref, children: [_jsx(Grid, { item: { area: 'header' }, children: _jsx(Toolbar, { ...toolbar, zoomLevel: zoomValue, onZoomLevelChange: setZoomValue, options: utilityPanels, onToggle: onToggle, currentPanelId: currentlyOpenPanelId }, void 0) }, void 0), panelContentRef.current && (_jsx(Grid, { item: { area: 'utility' }, children: _jsx(UtilityPanel, { ...panelContentRef.current, open: !!currentlyOpenPanelId }, void 0) }, void 0)), _jsx(Grid, { item: { area: 'main' }, children: _jsx(StyledMain, { children: _jsx(ZoomContainer, { zoomLevel: zoomValue / 100, children: children }, void 0) }, void 0) }, void 0), _jsx(Grid, { item: { area: 'configuration' }, children: _jsx(ConfigurationPanel, { ...configurationPanel }, void 0) }, void 0)] }, void 0));
22
+ });
23
+ export default Workbench;
24
+ //# sourceMappingURL=Workbench.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Workbench.js","sourceRoot":"","sources":["../../../src/components/Workbench/Workbench.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,UAAU,EAAmB,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAgB,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEhF,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,SAAS,GAAsC,UAAU,CAC7D,CACE,EACE,QAAQ,EACR,aAAa,GAAG,EAAE,EAClB,kBAAkB,EAClB,OAAO,EACP,uBAAuB,EACS,EAClC,GAA0B,EAC1B,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEhD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAE9D,uBAAuB,CAAC,CAAC;IAE3B,MAAM,eAAe,GAAG,MAAM,CAC5B,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,uBAAuB,CAAC,CAClE,CAAC;IACF,MAAM,QAAQ,GAAG,CAAC,OAAiC,EAAE,EAAE;QACrD,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,OAAO;YAAE,eAAe,CAAC,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IAC3F,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE;YACT,IAAI,EAAE,4CAA4C;YAClD,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,qDAAqD;SAC7D,EACD,EAAE,EAAE,eAAe,EACnB,GAAG,EAAE,GAAG,aAER,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,YAC5B,KAAC,OAAO,OACF,OAAO,EACX,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,YAAY,EAC/B,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,oBAAoB,WACpC,WACG,EACN,eAAe,CAAC,OAAO,IAAI,CAC1B,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAC7B,KAAC,YAAY,OAAK,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,oBAAoB,WAAI,WACtE,CACR,EACD,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,YAC1B,KAAC,UAAU,cACT,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,GAAG,GAAG,YAAG,QAAQ,WAAiB,WAC1D,WACR,EACP,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,YACnC,KAAC,kBAAkB,OAAK,kBAAkB,WAAI,WACzC,YACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { FC, useState, forwardRef, PropsWithoutRef, useRef } from 'react';\n\nimport { ForwardProps, Grid } from '@pega/cosmos-react-core';\n\nimport Toolbar from './Toolbar';\nimport { StyledMain, StyledWorkbench, ZoomContainer } from './Workbench.styles';\nimport { UtilityPanelProps, WorkbenchProps } from './Workbench.types';\nimport ConfigurationPanel from './ConfigurationPanel';\nimport UtilityPanel from './UtilityPanel';\n\nconst Workbench: FC<WorkbenchProps & ForwardProps> = forwardRef(\n (\n {\n children,\n utilityPanels = [],\n configurationPanel,\n toolbar,\n initiallyVisiblePanelId\n }: PropsWithoutRef<WorkbenchProps>,\n ref: WorkbenchProps['ref']\n ) => {\n const [zoomValue, setZoomValue] = useState(100);\n\n const [currentlyOpenPanelId, setCurrentlyOpenPanelId] = useState<\n UtilityPanelProps['id'] | undefined\n >(initiallyVisiblePanelId);\n\n const panelContentRef = useRef<UtilityPanelProps | undefined>(\n utilityPanels.find(panel => panel.id === initiallyVisiblePanelId)\n );\n const onToggle = (panelId?: UtilityPanelProps['id']) => {\n setCurrentlyOpenPanelId(panelId);\n if (panelId) panelContentRef.current = utilityPanels.find(panel => panel.id === panelId);\n };\n\n return (\n <Grid\n container={{\n cols: 'min-content minmax(10rem, 1fr) min-content',\n rows: 'auto minmax(0, 1fr)',\n areas: '\"header header header\" \"utility main configuration\"'\n }}\n as={StyledWorkbench}\n ref={ref}\n >\n <Grid item={{ area: 'header' }}>\n <Toolbar\n {...toolbar}\n zoomLevel={zoomValue}\n onZoomLevelChange={setZoomValue}\n options={utilityPanels}\n onToggle={onToggle}\n currentPanelId={currentlyOpenPanelId}\n />\n </Grid>\n {panelContentRef.current && (\n <Grid item={{ area: 'utility' }}>\n <UtilityPanel {...panelContentRef.current} open={!!currentlyOpenPanelId} />\n </Grid>\n )}\n <Grid item={{ area: 'main' }}>\n <StyledMain>\n <ZoomContainer zoomLevel={zoomValue / 100}>{children}</ZoomContainer>\n </StyledMain>\n </Grid>\n <Grid item={{ area: 'configuration' }}>\n <ConfigurationPanel {...configurationPanel} />\n </Grid>\n </Grid>\n );\n }\n);\n\nexport default Workbench;\n"]}
@@ -0,0 +1,10 @@
1
+ export declare const StyledPanelToggleWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const UtilityPanelToggle: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledToolbar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const StyledMain: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const StyledWorkbench: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const StyledPanel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
+ export declare const ZoomContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
+ zoomLevel: number;
9
+ }, never>;
10
+ //# sourceMappingURL=Workbench.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Workbench.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Workbench/Workbench.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,wBAAwB,yGAEpC,CAAC;AAIF,eAAO,MAAM,kBAAkB,qOAmB7B,CAAC;AAIH,eAAO,MAAM,aAAa,yGA8BzB,CAAC;AAIF,eAAO,MAAM,UAAU,yGAItB,CAAC;AAIF,eAAO,MAAM,eAAe,yGAG3B,CAAC;AAIF,eAAO,MAAM,WAAW,yGAMtB,CAAC;AAIH,eAAO,MAAM,aAAa;eAA2B,MAAM;SAIzD,CAAC"}
@@ -0,0 +1,72 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { Button, defaultThemeProp } from '@pega/cosmos-react-core';
3
+ import { StyledStepperInput } from '@pega/cosmos-react-core/lib/components/Number/NumberInput.styles';
4
+ export const StyledPanelToggleWrapper = styled.div `
5
+ height: 100%;
6
+ `;
7
+ StyledPanelToggleWrapper.defaultProps = defaultThemeProp;
8
+ export const UtilityPanelToggle = styled(Button)(props => {
9
+ const { theme: { base: { colors }, components: { link: { color: linkColor } } } } = props;
10
+ return css `
11
+ background-color: transparent;
12
+ color: ${colors.slate['extra-dark']};
13
+
14
+ &[aria-selected='true'] {
15
+ background-color: ${colors.blue['extra-light']};
16
+ color: ${linkColor};
17
+ }
18
+ `;
19
+ });
20
+ UtilityPanelToggle.defaultProps = defaultThemeProp;
21
+ export const StyledToolbar = styled.div(({ theme: { base: { spacing, palette, colors } } }) => {
22
+ return css `
23
+ height: 2.5rem;
24
+ padding: 0 calc(2 * ${spacing});
25
+ background-color: ${palette['primary-background']};
26
+ border-bottom: 0.0625rem solid ${colors.gray['extra-light']};
27
+
28
+ ${StyledStepperInput} {
29
+ width: 8rem;
30
+ }
31
+
32
+ ${StyledPanelToggleWrapper}:empty {
33
+ display: none;
34
+ }
35
+
36
+ ${StyledPanelToggleWrapper}:not(:last-child) {
37
+ ::after {
38
+ content: '';
39
+ margin: 0 calc(2 * ${spacing});
40
+ height: 80%;
41
+ border: 0.0625rem solid ${colors.gray['extra-light']};
42
+ }
43
+ }
44
+ `;
45
+ });
46
+ StyledToolbar.defaultProps = defaultThemeProp;
47
+ export const StyledMain = styled.div `
48
+ width: 100%;
49
+ height: 100%;
50
+ overflow: auto;
51
+ `;
52
+ StyledMain.defaultProps = defaultThemeProp;
53
+ export const StyledWorkbench = styled.div `
54
+ height: 100%;
55
+ min-width: 50rem;
56
+ `;
57
+ StyledWorkbench.defaultProps = defaultThemeProp;
58
+ export const StyledPanel = styled.div(({ theme }) => {
59
+ return css `
60
+ background-color: ${theme.base.palette['primary-background']};
61
+ height: 100%;
62
+ overflow-y: auto;
63
+ `;
64
+ });
65
+ StyledPanel.defaultProps = defaultThemeProp;
66
+ export const ZoomContainer = styled.div(({ zoomLevel }) => {
67
+ return css `
68
+ transform: scale(${zoomLevel});
69
+ `;
70
+ });
71
+ ZoomContainer.defaultProps = defaultThemeProp;
72
+ //# sourceMappingURL=Workbench.styles.js.map