@pega/cosmos-react-build 3.0.0-dev.9.1 → 3.0.0-rc.10

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 (240) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts +1 -1
  2. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -1
  3. package/lib/components/AppHeader/AppHeader.js +7 -6
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +1 -2
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.styles.js +10 -12
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  9. package/lib/components/AppHeader/BranchButton.d.ts.map +1 -1
  10. package/lib/components/AppHeader/BranchButton.js +22 -18
  11. package/lib/components/AppHeader/BranchButton.js.map +1 -1
  12. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.js +19 -2
  14. package/lib/components/AppShell/AppShell.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.styles.js +1 -3
  17. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  18. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  19. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +50 -38
  20. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  21. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +2 -2
  22. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  23. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -1
  24. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +8 -0
  25. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -0
  26. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +192 -0
  27. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -0
  28. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +10 -0
  29. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -0
  30. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +530 -0
  31. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -0
  32. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +35 -0
  33. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -0
  34. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js +2 -0
  35. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -0
  36. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts +13 -0
  37. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -0
  38. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +51 -0
  39. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -0
  40. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +6 -0
  41. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -0
  42. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +51 -0
  43. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -0
  44. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +14 -0
  45. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -0
  46. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +81 -0
  47. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -0
  48. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +74 -0
  49. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -0
  50. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js +2 -0
  51. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -0
  52. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts +7 -0
  53. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.d.ts.map +1 -0
  54. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js +6 -0
  55. package/lib/components/ExpressionBuilder/ExpressionBuilderContext.js.map +1 -0
  56. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +6 -0
  57. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -0
  58. package/lib/components/ExpressionBuilder/ExpressionDetails.js +12 -0
  59. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -0
  60. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +6 -0
  61. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -0
  62. package/lib/components/ExpressionBuilder/ExpressionItem.js +39 -0
  63. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -0
  64. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +6 -0
  65. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -0
  66. package/lib/components/ExpressionBuilder/ExpressionList.js +32 -0
  67. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -0
  68. package/lib/components/ExpressionBuilder/index.d.ts +8 -0
  69. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -0
  70. package/lib/components/ExpressionBuilder/index.js +6 -0
  71. package/lib/components/ExpressionBuilder/index.js.map +1 -0
  72. package/lib/components/FlowModeller/AddNode.d.ts +2 -2
  73. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  74. package/lib/components/FlowModeller/AddNode.js +26 -7
  75. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  76. package/lib/components/FlowModeller/Connector.d.ts +3 -3
  77. package/lib/components/FlowModeller/Connector.d.ts.map +1 -1
  78. package/lib/components/FlowModeller/Connector.js +41 -4
  79. package/lib/components/FlowModeller/Connector.js.map +1 -1
  80. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -1
  81. package/lib/components/FlowModeller/DeletePopover.js +56 -25
  82. package/lib/components/FlowModeller/DeletePopover.js.map +1 -1
  83. package/lib/components/FlowModeller/FlowModeller.d.ts +3 -23
  84. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  85. package/lib/components/FlowModeller/FlowModeller.js +94 -17
  86. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  87. package/lib/components/FlowModeller/FlowModeller.types.d.ts +27 -0
  88. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +1 -0
  89. package/lib/components/FlowModeller/FlowModeller.types.js +2 -0
  90. package/lib/components/FlowModeller/FlowModeller.types.js.map +1 -0
  91. package/lib/components/FlowModeller/FlowModellerContext.d.ts +11 -0
  92. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +1 -0
  93. package/lib/components/FlowModeller/FlowModellerContext.js +8 -0
  94. package/lib/components/FlowModeller/FlowModellerContext.js.map +1 -0
  95. package/lib/components/FlowModeller/Node/Node.types.d.ts +13 -4
  96. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  97. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  98. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  99. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +17 -8
  100. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  101. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -1
  102. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  103. package/lib/components/FlowModeller/Node/NodeTemplates.js +25 -12
  104. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  105. package/lib/components/FlowModeller/Node.d.ts.map +1 -1
  106. package/lib/components/FlowModeller/Node.js +3 -4
  107. package/lib/components/FlowModeller/Node.js.map +1 -1
  108. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  109. package/lib/components/FlowModeller/Renderer/Renderer.js +37 -6
  110. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  111. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +3 -9
  112. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  113. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  114. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +5 -0
  115. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -1
  116. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  117. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +2 -1
  118. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -1
  119. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +19 -6
  120. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  121. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +1 -2
  122. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  123. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  124. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +6 -5
  125. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +1 -1
  126. package/lib/components/FlowModeller/Utils/addNodeUtils.js +57 -34
  127. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -1
  128. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +3 -2
  129. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -1
  130. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +11 -1
  131. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -1
  132. package/lib/components/FlowModeller/helper.d.ts +21 -2
  133. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  134. package/lib/components/FlowModeller/helper.js +91 -45
  135. package/lib/components/FlowModeller/helper.js.map +1 -1
  136. package/lib/components/FlowModeller/index.d.ts +4 -3
  137. package/lib/components/FlowModeller/index.d.ts.map +1 -1
  138. package/lib/components/FlowModeller/index.js.map +1 -1
  139. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  140. package/lib/components/ItemLibrary/ItemLibrary.js +1 -4
  141. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  142. package/lib/components/LifeCycle/Category.d.ts +3 -20
  143. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  144. package/lib/components/LifeCycle/Category.js +15 -12
  145. package/lib/components/LifeCycle/Category.js.map +1 -1
  146. package/lib/components/LifeCycle/LifeCycle.d.ts +3 -19
  147. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  148. package/lib/components/LifeCycle/LifeCycle.js +14 -10
  149. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  150. package/lib/components/LifeCycle/LifeCycle.types.d.ts +70 -2
  151. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  152. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  153. package/lib/components/LifeCycle/LifeCycleContext.d.ts +9 -0
  154. package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -0
  155. package/lib/components/LifeCycle/LifeCycleContext.js +7 -0
  156. package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -0
  157. package/lib/components/LifeCycle/LifeCycleList.d.ts +1 -5
  158. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  159. package/lib/components/LifeCycle/LifeCycleList.js +3 -3
  160. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  161. package/lib/components/LifeCycle/Stage.d.ts +7 -25
  162. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  163. package/lib/components/LifeCycle/Stage.js +81 -128
  164. package/lib/components/LifeCycle/Stage.js.map +1 -1
  165. package/lib/components/LifeCycle/Step.d.ts +11 -29
  166. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  167. package/lib/components/LifeCycle/Step.js +71 -136
  168. package/lib/components/LifeCycle/Step.js.map +1 -1
  169. package/lib/components/LifeCycle/Task.d.ts +9 -34
  170. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  171. package/lib/components/LifeCycle/Task.js +58 -98
  172. package/lib/components/LifeCycle/Task.js.map +1 -1
  173. package/lib/components/LifeCycle/index.d.ts +2 -2
  174. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  175. package/lib/components/LifeCycle/index.js.map +1 -1
  176. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +9 -0
  177. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -0
  178. package/lib/components/MobileBuildSummary/MobileBuildSummary.js +44 -0
  179. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -0
  180. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts +29 -0
  181. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts.map +1 -0
  182. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js +2 -0
  183. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js.map +1 -0
  184. package/lib/components/MobileBuildSummary/index.d.ts +3 -0
  185. package/lib/components/MobileBuildSummary/index.d.ts.map +1 -0
  186. package/lib/components/MobileBuildSummary/index.js +2 -0
  187. package/lib/components/MobileBuildSummary/index.js.map +1 -0
  188. package/lib/components/ObjectPreview/ObjectPreview.d.ts +1 -1
  189. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -1
  190. package/lib/components/ObjectPreview/ObjectPreview.js +1 -1
  191. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -1
  192. package/lib/components/ObjectSelect/ObjectPicker.d.ts +9 -5
  193. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  194. package/lib/components/ObjectSelect/ObjectPicker.js +19 -5
  195. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  196. package/lib/components/ObjectSelect/ObjectSelect.d.ts +10 -5
  197. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -1
  198. package/lib/components/ObjectSelect/ObjectSelect.js +24 -8
  199. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -1
  200. package/lib/components/ObjectSelect/ObjectSummary.d.ts +6 -4
  201. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
  202. package/lib/components/ObjectSelect/ObjectSummary.js +28 -33
  203. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
  204. package/lib/components/ObjectSelect/useCreateModal.d.ts +34 -0
  205. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -0
  206. package/lib/components/ObjectSelect/useCreateModal.js +61 -0
  207. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -0
  208. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  209. package/lib/components/PageTemplates/PageTemplates.js +26 -8
  210. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  211. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
  212. package/lib/components/Workbench/ConfigurationPanel.js +4 -14
  213. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  214. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  215. package/lib/components/Workbench/Workbench.js +2 -2
  216. package/lib/components/Workbench/Workbench.js.map +1 -1
  217. package/lib/components/Workbench/Workbench.styles.d.ts +1 -0
  218. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  219. package/lib/components/Workbench/Workbench.styles.js +4 -0
  220. package/lib/components/Workbench/Workbench.styles.js.map +1 -1
  221. package/lib/components/Workbench/Workbench.types.d.ts +2 -2
  222. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  223. package/lib/components/Workbench/Workbench.types.js.map +1 -1
  224. package/lib/index.d.ts +3 -0
  225. package/lib/index.d.ts.map +1 -1
  226. package/lib/index.js +3 -0
  227. package/lib/index.js.map +1 -1
  228. package/package.json +11 -8
  229. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +0 -15
  230. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +0 -1
  231. package/lib/components/FlowModeller/Renderer/Connectors.js +0 -49
  232. package/lib/components/FlowModeller/Renderer/Connectors.js.map +0 -1
  233. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +0 -11
  234. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +0 -1
  235. package/lib/components/FlowModeller/Renderer/Nodes.js +0 -31
  236. package/lib/components/FlowModeller/Renderer/Nodes.js.map +0 -1
  237. package/lib/components/ObjectSelect/ObjectConfig.d.ts +0 -18
  238. package/lib/components/ObjectSelect/ObjectConfig.d.ts.map +0 -1
  239. package/lib/components/ObjectSelect/ObjectConfig.js +0 -14
  240. package/lib/components/ObjectSelect/ObjectConfig.js.map +0 -1
@@ -1,13 +1,15 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useCallback } from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useCallback, useContext } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Flex, defaultThemeProp, Button, Icon, Tooltip, useElement, Actions, useI18n, Avatar, StyledTooltip, useOuterEvent, useEscape } from '@pega/cosmos-react-core';
4
+ import { Flex, defaultThemeProp, Button, Icon, Tooltip, useElement, Actions, useI18n, Avatar, useOuterEvent, useEscape } from '@pega/cosmos-react-core';
5
5
  import { ItemLibrary } from '../ItemLibrary';
6
6
  import Step from './Step';
7
+ import LifeCycleContext from './LifeCycleContext';
7
8
  export const StyledTaskList = styled.li(({ theme }) => {
8
9
  return css `
9
10
  list-style-type: none;
10
11
  margin-block-end: ${theme.base.spacing};
12
+
11
13
  &:last-child > article {
12
14
  margin-block-end: 0;
13
15
  }
@@ -26,100 +28,72 @@ export const StyledCardContent = styled.div(() => {
26
28
  padding: 0;
27
29
  `;
28
30
  });
29
- export const StyledInput = styled.input(({ error, theme }) => {
31
+ export const StyledTaskButton = styled.button(({ theme }) => {
30
32
  return css `
31
- height: ${theme.components.input.height};
32
- padding: 0 calc(0.5 * ${theme.base.spacing});
33
+ background: ${theme.base.palette['primary-background']};
34
+ border: none;
35
+ height: ${theme.components.button.height};
36
+ overflow: hidden;
33
37
  text-overflow: ellipsis;
34
- border: 0.0625rem solid transparent;
35
- border-radius: calc(0.5 * ${theme.base['border-radius']});
36
- width: 100%;
37
- outline: none;
38
+ white-space: nowrap;
39
+ text-align: start;
40
+
38
41
  &:hover {
39
42
  cursor: pointer;
40
43
  }
41
- &:disabled {
42
- cursor: not-allowed;
44
+
45
+ &:focus {
46
+ outline: none;
43
47
  }
44
- ${error
45
- ? css `
46
- background: ${theme.base.colors.red['extra-light']};
47
- border: 0.0625rem solid ${theme.base.colors.red.medium};
48
- `
49
- : css `
50
- background: ${theme.base.palette['primary-background']};
51
- &&:hover {
52
- background: ${theme.base.palette['secondary-background']};
53
- }
54
- &&:focus:enabled {
55
- border: 0.0625rem solid ${theme.base.colors.blue.medium};
56
- background: ${theme.base.palette['primary-background']};
57
- }
58
- `}
59
48
  `;
60
49
  });
61
- StyledInput.defaultProps = defaultThemeProp;
62
- export const StyledTaskActions = styled.div(({ error }) => {
50
+ StyledTaskButton.defaultProps = defaultThemeProp;
51
+ export const StyledTask = styled.article(({ hasFocus, theme }) => {
63
52
  return css `
64
- border: none;
65
- visibility: hidden;
53
+ background: ${theme.base.palette['primary-background']};
54
+ border: 0.125rem solid transparent;
55
+ border-radius: calc(0.5 * ${theme.base['border-radius']});
56
+ padding: calc(${theme.base.spacing} - 0.125rem);
57
+
58
+ ${hasFocus &&
59
+ css `
60
+ box-shadow: ${theme.base.shadow.focus};
61
+ `}
62
+
66
63
  &:hover {
67
64
  cursor: pointer;
68
65
  }
69
- ${error &&
70
- css `
71
- visibility: visible;
72
- `}
73
- &:focus-within {
74
- ${StyledTooltip} {
75
- ${css `
76
- display: none;
77
- `}
78
- }
66
+
67
+ &[aria-current='true'] {
68
+ border-color: ${theme.base.palette.interactive};
79
69
  }
80
70
  `;
81
71
  });
82
- export const StyledTask = styled.article(({ theme }) => {
72
+ StyledTask.defaultProps = defaultThemeProp;
73
+ export const StyledWarnIcon = styled(Icon)(({ theme }) => {
83
74
  return css `
84
- background: ${theme.base.palette['primary-background']};
85
- border-radius: calc(0.5 * ${theme.base['border-radius']});
86
- padding: ${theme.base.spacing};
87
- &:focus-within,
88
- &:hover {
89
- ${StyledTaskActions} {
90
- ${css `
91
- visibility: visible;
92
- `}
93
- }
94
- }
95
- &:focus-within {
96
- box-shadow: 0 0 0.2rem 0.0625rem ${theme.base.colors.blue.medium};
97
- }
75
+ color: ${theme.base.palette.urgent};
76
+ margin-inline-end: ${theme.base.spacing};
77
+
98
78
  &:hover {
99
79
  cursor: pointer;
100
80
  }
81
+
82
+ &:focus {
83
+ outline: none;
84
+ box-shadow: ${theme.base.shadow.focus};
85
+ }
101
86
  `;
102
87
  });
103
- StyledTask.defaultProps = defaultThemeProp;
104
- export const StyledInputWrapper = styled.div `
105
- &:focus-within {
106
- ${StyledTooltip} {
107
- ${css `
108
- display: none;
109
- `}
110
- }
111
- }
112
- `;
113
- const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem, error, onAddStep, onChange, onFocus, onBlur, categoryItem, id, step: stepProp, nodeLibrary, ...restProps }) => {
88
+ StyledWarnIcon.defaultProps = defaultThemeProp;
89
+ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem, error, onAddStep, onClick, categoryItem, id, step: stepProp, nodeLibrary, ...restProps }) => {
114
90
  const t = useI18n();
115
- const [taskValue, setTaskValue] = useState(value);
91
+ const { selectedItemId, readOnly } = useContext(LifeCycleContext);
92
+ const [taskHasFocus, setTaskHasFocus] = useState(false);
116
93
  const [showLibrary, setLibrary] = useState(false);
117
94
  const [popoverEl, setPopoverEl] = useElement(null);
118
- const [actionEl, setActionEl] = useElement();
119
- const [inputEl, setInputEl] = useElement();
120
95
  const [addEl, setAddEl] = useElement();
121
- const actionsLabel = t('actions');
122
- const singleActionLabel = actions?.[0]?.text || '';
96
+ const [errorIcon, setErrorIcon] = useElement();
123
97
  const onActionItemClick = (actionId, e) => {
124
98
  const param = {
125
99
  task: item,
@@ -145,33 +119,15 @@ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem,
145
119
  return actionItem;
146
120
  });
147
121
  }
148
- const onInputChange = (e) => {
149
- setTaskValue(e.target.value);
150
- const param = {
151
- value: e.target.value,
152
- task: item,
153
- stage: stageItem,
154
- category: categoryItem
155
- };
156
- onChange?.(param, e);
157
- };
158
- const onInputFocus = (e) => {
159
- const param = {
160
- value: taskValue,
161
- task: item,
162
- stage: stageItem,
163
- category: categoryItem
164
- };
165
- onFocus?.(param, e);
166
- };
167
- const onInputBlur = (e) => {
168
- const param = {
169
- value: taskValue,
122
+ const onTaskClick = (e) => {
123
+ const actionParam = {
124
+ value,
170
125
  task: item,
171
126
  stage: stageItem,
172
- category: categoryItem
127
+ category: categoryItem,
128
+ type: 'Task'
173
129
  };
174
- onBlur?.(param, e);
130
+ onClick?.(actionParam, e);
175
131
  };
176
132
  const onLibraryItemSelect = useCallback((libItem) => {
177
133
  const param = {
@@ -186,7 +142,11 @@ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem,
186
142
  setLibrary(false);
187
143
  });
188
144
  useOuterEvent('mousedown', [addEl, popoverEl], () => setLibrary(false));
189
- return (_jsx(Flex, { as: StyledTaskList, ...restProps, children: _jsxs(Flex, { as: StyledTask, container: { direction: 'column' }, role: 'region', children: [_jsxs(Flex, { as: StyledCardHeader, container: { itemGap: 0.4 }, children: [visual?.imgurl.length > 0 && _jsx(Avatar, { name: taskValue || '', imageSrc: visual?.imgurl }), _jsxs(Flex, { item: { grow: 1 }, as: StyledInputWrapper, container: { inline: true, alignItems: 'center' }, children: [_jsx(StyledInput, { value: taskValue, type: 'text', onChange: onInputChange, ref: setInputEl, error: error, id: item.id, "aria-labelledby": categoryItem.categoryId, onFocus: onInputFocus, onBlur: onInputBlur }), taskValue && (_jsx(Tooltip, { target: inputEl, hideDelay: 'none', children: error || taskValue }))] }), _jsxs(Flex, { as: StyledTaskActions, ref: setActionEl, error: error, children: [actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }), _jsx(Tooltip, { target: actionEl, "aria-hidden": 'true', children: actions && actions?.length > 1 ? actionsLabel : singleActionLabel })] })] }), _jsxs(Flex, { as: StyledCardContent, children: [item?.steps.map((steps) => {
145
+ return (_jsx(StyledTaskList, { ...restProps, id: item.id, children: _jsxs(Flex, { as: StyledTask, "aria-current": selectedItemId === id ? 'true' : undefined, container: { direction: 'column' }, id: `${id}-task`, hasFocus: taskHasFocus && selectedItemId !== id, children: [_jsxs(Flex, { as: StyledCardHeader, container: { inline: true, alignItems: 'center' }, children: [visual?.imgurl.length > 0 && _jsx(Avatar, { name: value, imageSrc: visual?.imgurl }), error && (_jsxs(_Fragment, { children: [_jsx(StyledWarnIcon, { ref: setErrorIcon, role: 'status', tabIndex: '0', "aria-label": t('item_error', [error]), name: 'warn-solid' }), _jsx(Tooltip, { target: errorIcon, "aria-hidden": !!error, hideDelay: 'none', children: error })] })), _jsx(Flex, { item: { grow: 1 }, container: { inline: true, alignItems: 'center' }, onClick: onTaskClick, children: _jsx(StyledTaskButton, { onFocus: () => {
146
+ setTaskHasFocus(true);
147
+ }, onBlur: () => {
148
+ setTaskHasFocus(false);
149
+ }, "aria-label": t('process_name', [value]), children: value }) }), actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true })] }), _jsxs(StyledCardContent, { children: [item?.steps.map((steps) => {
190
150
  const badgeStatus = steps?.status?.type ? steps.status.type : '';
191
151
  const badgeLabel = steps?.status?.label ? steps.status.label : '';
192
152
  return (_jsx(Step, { id: steps.id, value: steps.label, visual: {
@@ -198,7 +158,7 @@ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem,
198
158
  type: badgeStatus,
199
159
  label: badgeLabel
200
160
  }, error: steps.error, categoryItem: categoryItem, ...stepProp }, steps.id));
201
- }), _jsxs(Flex, { children: [_jsx(Button, { variant: 'simple', label: addStepTitle, onClick: () => setLibrary(!showLibrary), ref: setAddEl, icon: true, "aria-label": `${t('add')} ${addStepTitle}`, children: _jsx(Icon, { name: 'plus' }) }), _jsx(Tooltip, { target: addEl, "aria-hidden": 'true', children: `${t('add')} ${addStepTitle}` }), _jsx(ItemLibrary, { items: nodeLibrary, show: showLibrary, target: addEl, onClick: onLibraryItemSelect, ref: setPopoverEl, placeholder: t('search_nodes') })] })] })] }) }));
161
+ }), !readOnly && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', ref: setAddEl, label: t('add_noun', [addStepTitle]), onClick: () => setLibrary(prev => !prev), icon: true, children: _jsx(Icon, { name: 'plus' }) }), _jsx(ItemLibrary, { items: nodeLibrary, show: showLibrary, target: addEl, onClick: onLibraryItemSelect, ref: setPopoverEl, placeholder: t('search_nodes') })] }))] })] }) }));
202
162
  };
203
163
  export default Task;
204
164
  //# sourceMappingURL=Task.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EAMR,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAGhB,MAAM,EACN,IAAI,EAEJ,OAAO,EACP,UAAU,EACV,OAAO,EAEP,OAAO,EACP,MAAM,EACN,aAAa,EACb,aAAa,EACb,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAe,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,IAAmB,MAAM,QAAQ,CAAC;AAmDzC,MAAM,CAAC,MAAM,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AAQ,EAAE,IAAI,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE;oCACL,IAAI,EAAE,WAAW;oCACjB,KAAK,EAAE,UAAU;iCAClB,EACD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,YAAY,EAAE,YAAY,KACtB,QAAQ,IAlBP,KAAK,CAAC,EAAE,CAmBb,CACH,CAAC;wBACJ,CAAC,CAAC,EACF,MAAC,IAAI,eACH,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,EACvC,GAAG,EAAE,QAAQ,EACb,IAAI,sBACQ,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,EAAE,YAEzC,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,EACT,KAAC,OAAO,IAAC,MAAM,EAAE,KAAK,iBAAc,MAAM,YACvC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,EAAE,GACtB,EACV,KAAC,WAAW,IACV,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,KAAoB,EAC5B,OAAO,EAAE,mBAAmB,EAC5B,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,IACG,IACF,IACF,GACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import {\n useState,\n FunctionComponent,\n PropsWithChildren,\n ChangeEvent,\n FocusEvent,\n MouseEvent,\n useCallback\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Button,\n Icon,\n Action,\n Tooltip,\n useElement,\n Actions,\n FormControlProps,\n useI18n,\n Avatar,\n StyledTooltip,\n useOuterEvent,\n useEscape\n} from '@pega/cosmos-react-core';\n\nimport { LibraryItem, ItemLibrary } from '../ItemLibrary';\n\nimport Step, { StepProps } from './Step';\nimport {\n TaskItemProps,\n StageItemProps,\n StepItemProps,\n CategoryItemProps,\n LifeCycleAction,\n LifeCycleActionParam\n} from './LifeCycle.types';\n\nexport interface TaskProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Tooltip for adding items to the task component */\n addStepTitle: string;\n /** Region for adding the task component */\n addTask: {\n title: string;\n showOnce: boolean;\n onAddTask?: LifeCycleAction['onClick'];\n };\n onAddStep?: (param: LifeCycleActionParam, selectedItem: LibraryItem) => void;\n onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;\n /** callback for Focus of input */\n onFocus?: (param: LifeCycleActionParam, e: FocusEvent<HTMLInputElement>) => void;\n /** callback for Blur of input */\n onBlur?: (param: LifeCycleActionParam, e: FocusEvent<HTMLInputElement>) => void;\n /** Types of Nodes */\n nodeLibrary: LibraryItem[];\n}\n\ninterface TaskComponentProps extends BaseProps, TaskProps {\n /** Pass text for the task. */\n value?: string;\n /** support for an Avatar, Icon, or other supporting visual. */\n visual: {\n imgurl: string;\n };\n /** Pass task data */\n item: TaskItemProps;\n /* The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Step Props */\n step?: StepProps;\n /** Stage data to pass it as callback */\n stageItem: StageItemProps;\n /** Category data to pass it as callback */\n categoryItem: CategoryItemProps;\n id: string;\n}\n\nexport const StyledTaskList = styled.li(({ theme }) => {\n return css`\n list-style-type: none;\n margin-block-end: ${theme.base.spacing};\n &:last-child > article {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledTaskList.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(({ theme }) => {\n return css`\n padding: 0;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(() => {\n return css`\n padding: 0;\n `;\n});\n\nexport const StyledInput = styled.input<{ error: string | undefined }>(({ error, theme }) => {\n return css`\n height: ${theme.components.input.height};\n padding: 0 calc(0.5 * ${theme.base.spacing});\n text-overflow: ellipsis;\n border: 0.0625rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n width: 100%;\n outline: none;\n &:hover {\n cursor: pointer;\n }\n &:disabled {\n cursor: not-allowed;\n }\n ${error\n ? css`\n background: ${theme.base.colors.red['extra-light']};\n border: 0.0625rem solid ${theme.base.colors.red.medium};\n `\n : css`\n background: ${theme.base.palette['primary-background']};\n &&:hover {\n background: ${theme.base.palette['secondary-background']};\n }\n &&:focus:enabled {\n border: 0.0625rem solid ${theme.base.colors.blue.medium};\n background: ${theme.base.palette['primary-background']};\n }\n `}\n `;\n});\n\nStyledInput.defaultProps = defaultThemeProp;\n\nexport const StyledTaskActions = styled.div<{\n ref: HTMLDivElement;\n error: string;\n}>(({ error }) => {\n return css`\n border: none;\n visibility: hidden;\n &:hover {\n cursor: pointer;\n }\n ${error &&\n css`\n visibility: visible;\n `}\n &:focus-within {\n ${StyledTooltip} {\n ${css`\n display: none;\n `}\n }\n }\n `;\n});\n\nexport const StyledTask = styled.article(({ theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: ${theme.base.spacing};\n &:focus-within,\n &:hover {\n ${StyledTaskActions} {\n ${css`\n visibility: visible;\n `}\n }\n }\n &:focus-within {\n box-shadow: 0 0 0.2rem 0.0625rem ${theme.base.colors.blue.medium};\n }\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledTask.defaultProps = defaultThemeProp;\n\nexport const StyledInputWrapper = styled.div`\n &:focus-within {\n ${StyledTooltip} {\n ${css`\n display: none;\n `}\n }\n }\n`;\n\nconst Task: FunctionComponent<TaskComponentProps & ForwardProps> = ({\n value,\n visual,\n actions,\n item,\n addStepTitle,\n addTask,\n stageItem,\n error,\n onAddStep,\n onChange,\n onFocus,\n onBlur,\n categoryItem,\n id,\n step: stepProp,\n nodeLibrary,\n ...restProps\n}: PropsWithChildren<TaskComponentProps>) => {\n const t = useI18n();\n const [taskValue, setTaskValue] = useState(value);\n const [showLibrary, setLibrary] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [actionEl, setActionEl] = useElement();\n const [inputEl, setInputEl] = useElement();\n const [addEl, setAddEl] = useElement();\n const actionsLabel = t('actions');\n const singleActionLabel = (actions?.[0]?.text as string) || '';\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n /* Deep copy of actions is required to provide consistent callback objects on actions */\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n setTaskValue(e.target.value);\n const param: LifeCycleActionParam = {\n value: e.target.value,\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onChange?.(param, e);\n };\n\n const onInputFocus = (e: FocusEvent<HTMLInputElement>) => {\n const param: LifeCycleActionParam = {\n value: taskValue,\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onFocus?.(param, e);\n };\n\n const onInputBlur = (e: FocusEvent<HTMLInputElement>) => {\n const param: LifeCycleActionParam = {\n value: taskValue,\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onBlur?.(param, e);\n };\n\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddStep?.(param, libItem);\n setLibrary(false);\n },\n [onAddStep]\n );\n\n useEscape(() => {\n setLibrary(false);\n });\n\n useOuterEvent('mousedown', [addEl, popoverEl], () => setLibrary(false));\n\n return (\n <Flex as={StyledTaskList} {...restProps}>\n <Flex as={StyledTask} container={{ direction: 'column' }} role='region'>\n <Flex as={StyledCardHeader} container={{ itemGap: 0.4 }}>\n {visual?.imgurl.length > 0 && <Avatar name={taskValue || ''} imageSrc={visual?.imgurl} />}\n <Flex\n item={{ grow: 1 }}\n as={StyledInputWrapper}\n container={{ inline: true, alignItems: 'center' }}\n >\n <StyledInput\n value={taskValue}\n type='text'\n onChange={onInputChange}\n ref={setInputEl}\n error={error}\n id={item.id}\n aria-labelledby={categoryItem.categoryId}\n onFocus={onInputFocus}\n onBlur={onInputBlur}\n />\n {taskValue && (\n <Tooltip target={inputEl} hideDelay='none'>\n {error || taskValue}\n </Tooltip>\n )}\n </Flex>\n <Flex as={StyledTaskActions} ref={setActionEl} error={error}>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n <Tooltip target={actionEl} aria-hidden='true'>\n {actions && actions?.length > 1 ? actionsLabel : singleActionLabel}\n </Tooltip>\n </Flex>\n </Flex>\n <Flex as={StyledCardContent}>\n {item?.steps.map((steps: StepItemProps) => {\n const badgeStatus = steps?.status?.type ? steps.status.type : '';\n const badgeLabel = steps?.status?.label ? steps.status.label : '';\n return (\n <Step\n key={steps.id}\n id={steps.id}\n value={steps.label}\n visual={{\n imgurl: steps.visual.imgurl,\n color: steps.visual.color,\n icon: steps.visual.icon,\n title: steps.visual.label\n }}\n item={steps}\n taskItem={item}\n stageItem={stageItem}\n badge={{\n type: badgeStatus,\n label: badgeLabel\n }}\n error={steps.error}\n categoryItem={categoryItem}\n {...stepProp}\n />\n );\n })}\n <Flex>\n <Button\n variant='simple'\n label={addStepTitle}\n onClick={() => setLibrary(!showLibrary)}\n ref={setAddEl}\n icon\n aria-label={`${t('add')} ${addStepTitle}`}\n >\n <Icon name='plus' />\n </Button>\n <Tooltip target={addEl} aria-hidden='true'>\n {`${t('add')} ${addStepTitle}`}\n </Tooltip>\n <ItemLibrary\n items={nodeLibrary}\n show={showLibrary}\n target={addEl as HTMLElement}\n onClick={onLibraryItemSelect}\n ref={setPopoverEl}\n placeholder={t('search_nodes')}\n />\n </Flex>\n </Flex>\n </Flex>\n </Flex>\n );\n};\n\nexport default Task;\n"]}
1
+ {"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EAIR,WAAW,EACX,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAGhB,MAAM,EACN,IAAI,EAEJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,aAAa,EACb,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAe,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,IAAI,MAAM,QAAQ,CAAC;AAU1B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAuBlD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,OAAO,GAAG,CAAA;;wBAEY,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;GAKvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1D,OAAO,GAAG,CAAA;;6BAEiB,KAAK,CAAC,IAAI,CAAC,OAAO;GAC5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBA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L,OAAO,EAAC,QAAQ,EAChB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,YAAY,CAAC,CAAC,EACpC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EACxC,IAAI,kBAEJ,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACb,EACT,KAAC,WAAW,IACV,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,KAAoB,EAC5B,OAAO,EAAE,mBAAmB,EAC5B,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,IACD,CACJ,IACiB,IACf,GACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import {\n useState,\n FunctionComponent,\n PropsWithChildren,\n MouseEvent,\n useCallback,\n useContext\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Button,\n Icon,\n Action,\n Tooltip,\n useElement,\n Actions,\n useI18n,\n Avatar,\n useOuterEvent,\n useEscape\n} from '@pega/cosmos-react-core';\n\nimport { LibraryItem, ItemLibrary } from '../ItemLibrary';\n\nimport Step from './Step';\nimport {\n TaskItemProps,\n StageItemProps,\n StepItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps,\n TaskProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\n\ninterface TaskComponentProps extends BaseProps, TaskProps {\n /** Pass text for the task. */\n value: string;\n /** support for an Avatar, Icon, or other supporting visual. */\n visual: {\n imgurl: string;\n };\n /** Pass task data */\n item: TaskItemProps;\n /* The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Step Props */\n step?: StepProps;\n /** Stage data to pass it as callback */\n stageItem: StageItemProps;\n /** Category data to pass it as callback */\n categoryItem: CategoryItemProps;\n /** unique id of task */\n id: string;\n}\n\nexport const StyledTaskList = styled.li(({ theme }) => {\n return css`\n list-style-type: none;\n margin-block-end: ${theme.base.spacing};\n\n &:last-child > article {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledTaskList.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(({ theme }) => {\n return css`\n padding: 0;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(() => {\n return css`\n padding: 0;\n `;\n});\n\nexport const StyledTaskButton = styled.button(({ theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n});\n\nStyledTaskButton.defaultProps = defaultThemeProp;\n\nexport const StyledTask = styled.article<{ hasFocus: boolean }>(({ hasFocus, theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: calc(${theme.base.spacing} - 0.125rem);\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &[aria-current='true'] {\n border-color: ${theme.base.palette.interactive};\n }\n `;\n});\n\nStyledTask.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon: typeof Icon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline-end: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Task: FunctionComponent<TaskComponentProps & ForwardProps> = ({\n value,\n visual,\n actions,\n item,\n addStepTitle,\n addTask,\n stageItem,\n error,\n onAddStep,\n onClick,\n categoryItem,\n id,\n step: stepProp,\n nodeLibrary,\n ...restProps\n}: PropsWithChildren<TaskComponentProps>) => {\n const t = useI18n();\n const { selectedItemId, readOnly } = useContext(LifeCycleContext);\n const [taskHasFocus, setTaskHasFocus] = useState(false);\n const [showLibrary, setLibrary] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [addEl, setAddEl] = useElement();\n const [errorIcon, setErrorIcon] = useElement();\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n /* Deep copy of actions is required to provide consistent callback objects on actions */\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n const onTaskClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n task: item,\n stage: stageItem,\n category: categoryItem,\n type: 'Task'\n };\n onClick?.(actionParam, e);\n };\n\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddStep?.(param, libItem);\n setLibrary(false);\n },\n [onAddStep]\n );\n\n useEscape(() => {\n setLibrary(false);\n });\n\n useOuterEvent('mousedown', [addEl, popoverEl], () => setLibrary(false));\n\n return (\n <StyledTaskList {...restProps} id={item.id}>\n <Flex\n as={StyledTask}\n aria-current={selectedItemId === id ? 'true' : undefined}\n container={{ direction: 'column' }}\n id={`${id}-task`}\n hasFocus={taskHasFocus && selectedItemId !== id}\n >\n <Flex as={StyledCardHeader} container={{ inline: true, alignItems: 'center' }}>\n {visual?.imgurl.length > 0 && <Avatar name={value} imageSrc={visual?.imgurl} />}\n {error && (\n <>\n <StyledWarnIcon\n ref={setErrorIcon}\n role='status'\n tabIndex='0'\n aria-label={t('item_error', [error])}\n name='warn-solid'\n />\n <Tooltip target={errorIcon} aria-hidden={!!error} hideDelay='none'>\n {error}\n </Tooltip>\n </>\n )}\n <Flex\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center' }}\n onClick={onTaskClick}\n >\n <StyledTaskButton\n onFocus={() => {\n setTaskHasFocus(true);\n }}\n onBlur={() => {\n setTaskHasFocus(false);\n }}\n aria-label={t('process_name', [value])}\n >\n {value}\n </StyledTaskButton>\n </Flex>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </Flex>\n <StyledCardContent>\n {item?.steps.map((steps: StepItemProps) => {\n const badgeStatus = steps?.status?.type ? steps.status.type : '';\n const badgeLabel = steps?.status?.label ? steps.status.label : '';\n return (\n <Step\n key={steps.id}\n id={steps.id}\n value={steps.label}\n visual={{\n imgurl: steps.visual.imgurl,\n color: steps.visual.color,\n icon: steps.visual.icon,\n title: steps.visual.label\n }}\n item={steps}\n taskItem={item}\n stageItem={stageItem}\n badge={{\n type: badgeStatus,\n label: badgeLabel\n }}\n error={steps.error}\n categoryItem={categoryItem}\n {...stepProp}\n />\n );\n })}\n {!readOnly && (\n <>\n <Button\n variant='simple'\n ref={setAddEl}\n label={t('add_noun', [addStepTitle])}\n onClick={() => setLibrary(prev => !prev)}\n icon\n >\n <Icon name='plus' />\n </Button>\n <ItemLibrary\n items={nodeLibrary}\n show={showLibrary}\n target={addEl as HTMLElement}\n onClick={onLibraryItemSelect}\n ref={setPopoverEl}\n placeholder={t('search_nodes')}\n />\n </>\n )}\n </StyledCardContent>\n </Flex>\n </StyledTaskList>\n );\n};\n\nexport default Task;\n"]}
@@ -1,3 +1,3 @@
1
- export { default, LifeCycleProps } from './LifeCycle';
2
- export { StepItemProps, TaskItemProps, StageItemProps, CategoryItemProps, CategoriesItemProps, LifeCycleActionParam, LifeCycleAction } from './LifeCycle.types';
1
+ export { default } from './LifeCycle';
2
+ export { StepItemProps, TaskItemProps, StageItemProps, CategoryItemProps, CategoriesItemProps, LifeCycleActionParam, LifeCycleAction, LifeCycleProps } from './LifeCycle.types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACf,MAAM,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,aAAa,CAAC","sourcesContent":["export { default, LifeCycleProps } from './LifeCycle';\n\nexport {\n StepItemProps,\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam,\n LifeCycleAction\n} from './LifeCycle.types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { default } from './LifeCycle';\n\nexport {\n StepItemProps,\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam,\n LifeCycleAction,\n LifeCycleProps\n} from './LifeCycle.types';\n"]}
@@ -0,0 +1,9 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { ForwardProps } from '@pega/cosmos-react-core';
3
+ import { MobileBuildSummaryProps } from './MobileBuildSummary.types';
4
+ export declare const StyledInteractionTimerIconWrapper: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const StyledQRWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const StyledContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
+ declare const MobileBuildSummary: FunctionComponent<MobileBuildSummaryProps & ForwardProps>;
8
+ export default MobileBuildSummary;
9
+ //# sourceMappingURL=MobileBuildSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileBuildSummary.d.ts","sourceRoot":"","sources":["../../../src/components/MobileBuildSummary/MobileBuildSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAGvE,OAAO,EAUL,YAAY,EASb,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAIrE,eAAO,MAAM,iCAAiC,0GAG7C,CAAC;AAIF,eAAO,MAAM,eAAe,yGAQ1B,CAAC;AAIH,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAIF,QAAA,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,GAAG,YAAY,CAoGjF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { Button, Card, CardContent, CardHeader, defaultThemeProp, EmptyState, FieldValueList, Flex, formatNumber, Icon, Link, Progress, registerIcon, Text, useConfiguration, useI18n, useUID } from '@pega/cosmos-react-core';
5
+ import * as osAndroid from '@pega/cosmos-react-core/lib/components/Icon/icons/os-android.icon';
6
+ import * as osApple from '@pega/cosmos-react-core/lib/components/Icon/icons/os-apple.icon';
7
+ import * as galaxyIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/galaxy.icon';
8
+ registerIcon(galaxyIcon, osAndroid, osApple);
9
+ export const StyledInteractionTimerIconWrapper = styled.span `
10
+ position: relative;
11
+ min-height: 4rem;
12
+ `;
13
+ StyledInteractionTimerIconWrapper.defaultProps = defaultThemeProp;
14
+ export const StyledQRWrapper = styled.div(({ theme }) => {
15
+ return css `
16
+ height: ${theme.base['content-width'].xs};
17
+ width: ${theme.base['content-width'].xs};
18
+ border: 0.0625rem solid ${theme.base.palette['border-line']};
19
+ border-radius: calc(${theme.base['border-radius']} / 2);
20
+ text-align: center;
21
+ `;
22
+ });
23
+ StyledQRWrapper.defaultProps = defaultThemeProp;
24
+ export const StyledContent = styled.div `
25
+ min-height: 10rem;
26
+ `;
27
+ StyledContent.defaultProps = defaultThemeProp;
28
+ const MobileBuildSummary = forwardRef(({ type, progress = undefined, onBuild, buildSummary, ...restProps }, ref) => {
29
+ const progressId = useUID();
30
+ const { locale } = useConfiguration();
31
+ const t = useI18n();
32
+ return (_jsxs(Card, { ...restProps, ref: ref, children: [_jsxs(CardHeader, { container: { alignItems: 'center', itemGap: 1 }, children: [_jsx(Icon, { name: type === 'android' ? 'os-android' : 'os-apple' }), _jsx(Text, { variant: 'h3', children: type === 'android' ? 'Android' : 'iOS' })] }), _jsx(CardContent, { children: _jsxs(_Fragment, { children: [progress === undefined && !buildSummary && (_jsxs(Flex, { container: { alignItems: 'center', gap: 1, direction: 'column', justify: 'center' }, as: StyledContent, children: [_jsx(EmptyState, { message: t('no_app_build') }), onBuild && (_jsx(Button, { variant: 'secondary', onClick: onBuild, children: t('build_app') }))] })), progress !== undefined && (_jsxs(Flex, { container: { alignItems: 'center', gap: 1, direction: 'column', justify: 'center' }, as: StyledContent, children: [_jsx(StyledInteractionTimerIconWrapper, { children: _jsx(Progress, { "aria-describedby": progressId, variant: 'ring', placement: 'local', message: formatNumber(progress / 100, {
33
+ locale,
34
+ options: { style: 'percent' }
35
+ }), value: progress, minValue: 0, maxValue: 100 }) }), _jsx(Text, { variant: 'secondary', id: progressId, children: t('build_in_progress') })] })), buildSummary && !progress && (_jsxs(Flex, { container: { wrap: 'wrap', gap: 2 }, as: StyledContent, children: [_jsxs(Flex, { container: {
36
+ direction: 'column',
37
+ alignItems: 'center',
38
+ justify: 'center',
39
+ gap: 1,
40
+ pad: 2
41
+ }, as: StyledQRWrapper, children: [_jsx(Icon, { name: 'galaxy' }), _jsx(Text, { variant: 'secondary', children: t('qr_code_not_available') })] }), _jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsx(FieldValueList, { variant: 'inline', fields: buildSummary.summaryFields }), _jsxs(Flex, { container: { wrap: 'wrap', rowGap: 1 }, children: [onBuild && (_jsx(Button, { variant: 'secondary', onClick: onBuild, children: t('rebuild_app') })), _jsx(Link, { href: buildSummary.downloadUrl, variant: 'secondary', onClick: buildSummary.onDownload, children: t('download_app') })] })] })] }))] }) })] }));
42
+ });
43
+ export default MobileBuildSummary;
44
+ //# sourceMappingURL=MobileBuildSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileBuildSummary.js","sourceRoot":"","sources":["../../../src/components/MobileBuildSummary/MobileBuildSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAmB,MAAM,OAAO,CAAC;AACvE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,IA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EACnB,OAAO,EAAE,YAAY,CAAC,UAAU,YAE/B,CAAC,CAAC,cAAc,CAAC,GACb,IACF,IACF,IACF,CACR,IACA,GACS,IACT,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n defaultThemeProp,\n EmptyState,\n FieldValueList,\n Flex,\n formatNumber,\n ForwardProps,\n Icon,\n Link,\n Progress,\n registerIcon,\n Text,\n useConfiguration,\n useI18n,\n useUID\n} from '@pega/cosmos-react-core';\nimport * as osAndroid from '@pega/cosmos-react-core/lib/components/Icon/icons/os-android.icon';\nimport * as osApple from '@pega/cosmos-react-core/lib/components/Icon/icons/os-apple.icon';\nimport * as galaxyIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/galaxy.icon';\n\nimport { MobileBuildSummaryProps } from './MobileBuildSummary.types';\n\nregisterIcon(galaxyIcon, osAndroid, osApple);\n\nexport const StyledInteractionTimerIconWrapper = styled.span`\n position: relative;\n min-height: 4rem;\n`;\n\nStyledInteractionTimerIconWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledQRWrapper = styled.div(({ theme }) => {\n return css`\n height: ${theme.base['content-width'].xs};\n width: ${theme.base['content-width'].xs};\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(${theme.base['border-radius']} / 2);\n text-align: center;\n `;\n});\n\nStyledQRWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledContent = styled.div`\n min-height: 10rem;\n`;\n\nStyledContent.defaultProps = defaultThemeProp;\n\nconst MobileBuildSummary: FunctionComponent<MobileBuildSummaryProps & ForwardProps> = forwardRef(\n (\n {\n type,\n progress = undefined,\n onBuild,\n buildSummary,\n ...restProps\n }: PropsWithoutRef<MobileBuildSummaryProps>,\n ref: MobileBuildSummaryProps['ref']\n ) => {\n const progressId = useUID();\n const { locale } = useConfiguration();\n const t = useI18n();\n\n return (\n <Card {...restProps} ref={ref}>\n <CardHeader container={{ alignItems: 'center', itemGap: 1 }}>\n <Icon name={type === 'android' ? 'os-android' : 'os-apple'} />\n <Text variant='h3'>{type === 'android' ? 'Android' : 'iOS'}</Text>\n </CardHeader>\n <CardContent>\n <>\n {progress === undefined && !buildSummary && (\n <Flex\n container={{ alignItems: 'center', gap: 1, direction: 'column', justify: 'center' }}\n as={StyledContent}\n >\n <EmptyState message={t('no_app_build')} />\n {onBuild && (\n <Button variant='secondary' onClick={onBuild}>\n {t('build_app')}\n </Button>\n )}\n </Flex>\n )}\n {progress !== undefined && (\n <Flex\n container={{ alignItems: 'center', gap: 1, direction: 'column', justify: 'center' }}\n as={StyledContent}\n >\n <StyledInteractionTimerIconWrapper>\n <Progress\n aria-describedby={progressId}\n variant='ring'\n placement='local'\n message={formatNumber(progress / 100, {\n locale,\n options: { style: 'percent' }\n })}\n value={progress}\n minValue={0}\n maxValue={100}\n />\n </StyledInteractionTimerIconWrapper>\n <Text variant='secondary' id={progressId}>\n {t('build_in_progress')}\n </Text>\n </Flex>\n )}\n {buildSummary && !progress && (\n <Flex container={{ wrap: 'wrap', gap: 2 }} as={StyledContent}>\n <Flex\n container={{\n direction: 'column',\n alignItems: 'center',\n justify: 'center',\n gap: 1,\n pad: 2\n }}\n as={StyledQRWrapper}\n >\n <Icon name='galaxy' />\n <Text variant='secondary'>{t('qr_code_not_available')}</Text>\n </Flex>\n <Flex container={{ direction: 'column', gap: 2 }}>\n <FieldValueList variant='inline' fields={buildSummary.summaryFields} />\n <Flex container={{ wrap: 'wrap', rowGap: 1 }}>\n {onBuild && (\n <Button variant='secondary' onClick={onBuild}>\n {t('rebuild_app')}\n </Button>\n )}\n\n <Link\n href={buildSummary.downloadUrl}\n variant='secondary'\n onClick={buildSummary.onDownload}\n >\n {t('download_app')}\n </Link>\n </Flex>\n </Flex>\n </Flex>\n )}\n </>\n </CardContent>\n </Card>\n );\n }\n);\n\nexport default MobileBuildSummary;\n"]}
@@ -0,0 +1,29 @@
1
+ import { Ref, MouseEventHandler } from 'react';
2
+ import { BaseProps } from '@pega/cosmos-react-core';
3
+ import { FieldValueListItemProps } from '@pega/cosmos-react-core/lib/components/FieldValueList/FieldValueList';
4
+ export interface AppBuildProps {
5
+ /** URL to the application resource. */
6
+ downloadUrl: string;
7
+ /** Click handler for the download link. */
8
+ onDownload?: MouseEventHandler<HTMLAnchorElement>;
9
+ /** The set of field values to render in the list. */
10
+ summaryFields: FieldValueListItemProps[];
11
+ }
12
+ export interface MobileBuildSummaryProps extends BaseProps {
13
+ /** Determines which platform type should be rendered. */
14
+ type: 'android' | 'ios';
15
+ /**
16
+ * Progress state is visible with current progress, if provided. Value within the range of 0-100 should be passed.
17
+ */
18
+ progress?: number;
19
+ /**
20
+ * Callback when build or rebuild application button is clicked.
21
+ * If not passed, button will be not displayed.
22
+ */
23
+ onBuild?: () => void;
24
+ /** The build summary fields to display. */
25
+ buildSummary?: AppBuildProps;
26
+ /** Ref to the element. */
27
+ ref?: Ref<HTMLDivElement>;
28
+ }
29
+ //# sourceMappingURL=MobileBuildSummary.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileBuildSummary.types.d.ts","sourceRoot":"","sources":["../../../src/components/MobileBuildSummary/MobileBuildSummary.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAE/G,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAClD,qDAAqD;IACrD,aAAa,EAAE,uBAAuB,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,yDAAyD;IACzD,IAAI,EAAE,SAAS,GAAG,KAAK,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,0BAA0B;IAC1B,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MobileBuildSummary.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileBuildSummary.types.js","sourceRoot":"","sources":["../../../src/components/MobileBuildSummary/MobileBuildSummary.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref, MouseEventHandler } from 'react';\n\nimport { BaseProps } from '@pega/cosmos-react-core';\nimport { FieldValueListItemProps } from '@pega/cosmos-react-core/lib/components/FieldValueList/FieldValueList';\n\nexport interface AppBuildProps {\n /** URL to the application resource. */\n downloadUrl: string;\n /** Click handler for the download link. */\n onDownload?: MouseEventHandler<HTMLAnchorElement>;\n /** The set of field values to render in the list. */\n summaryFields: FieldValueListItemProps[];\n}\n\nexport interface MobileBuildSummaryProps extends BaseProps {\n /** Determines which platform type should be rendered. */\n type: 'android' | 'ios';\n /**\n * Progress state is visible with current progress, if provided. Value within the range of 0-100 should be passed.\n */\n progress?: number;\n /**\n * Callback when build or rebuild application button is clicked.\n * If not passed, button will be not displayed.\n */\n onBuild?: () => void;\n /** The build summary fields to display. */\n buildSummary?: AppBuildProps;\n /** Ref to the element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { default as MobileBuildSummary } from './MobileBuildSummary';
2
+ export { AppBuildProps, MobileBuildSummaryProps } from './MobileBuildSummary.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MobileBuildSummary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as MobileBuildSummary } from './MobileBuildSummary';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MobileBuildSummary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { default as MobileBuildSummary } from './MobileBuildSummary';\nexport { AppBuildProps, MobileBuildSummaryProps } from './MobileBuildSummary.types';\n"]}
@@ -4,7 +4,7 @@ import { PageHeaderProps } from '@pega/cosmos-react-build/lib/components/PageTem
4
4
  export interface ObjectPreviewProps extends Pick<DrawerProps, 'onAfterOpen' | 'onAfterClose' | 'onBeforeOpen' | 'onBeforeClose'> {
5
5
  open?: boolean;
6
6
  header: OmitStrict<PageHeaderProps, 'status'>;
7
- primaryAction: Action;
7
+ primaryAction?: Action;
8
8
  secondaryAction?: Action;
9
9
  additionalActions?: ActionsProps;
10
10
  content: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectPreview.d.ts","sourceRoot":"","sources":["../../../src/components/ObjectPreview/ObjectPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAEF,eAAe,EACf,SAAS,EACT,GAAG,EAIJ,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,MAAM,EAEN,YAAY,EAGZ,YAAY,EAGZ,UAAU,EAIV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EAGhB,MAAM,qEAAqE,CAAC;AAE7E,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,WAAW,EAA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AE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAiDD,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,GAAG,YAAY,CAyCzE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -9,7 +9,7 @@ const StyledObjectPreview = styled(Drawer) `
9
9
  `;
10
10
  const PreviewHeader = ({ header, primaryAction, secondaryAction, additionalActions, onDismiss, dismissButtonRef }) => {
11
11
  const t = useI18n();
12
- return (_jsxs(Flex, { container: { direction: 'column', rowGap: 1 }, children: [_jsxs(Flex, { container: { justify: 'between' }, children: [_jsx(Button, { icon: true, variant: 'simple', ref: dismissButtonRef, label: t('dismiss_label_a11y'), onClick: onDismiss, children: _jsx(Icon, { name: 'times' }) }), _jsxs(Flex, { container: true, children: [secondaryAction && (_jsx(Button, { onClick: secondaryAction.onClick, children: secondaryAction.text })), _jsx(Button, { variant: 'primary', onClick: primaryAction.onClick, children: primaryAction.text }), additionalActions && _jsx(Actions, { ...additionalActions })] })] }), _jsx(PageHeader, { ...header, titleTag: 'h2' })] }));
12
+ return (_jsxs(Flex, { container: { direction: 'column', rowGap: 1 }, children: [_jsxs(Flex, { container: { justify: 'between' }, children: [_jsx(Button, { icon: true, variant: 'simple', ref: dismissButtonRef, label: t('dismiss_label_a11y'), onClick: onDismiss, children: _jsx(Icon, { name: 'times' }) }), _jsxs(Flex, { container: true, children: [secondaryAction && (_jsx(Button, { onClick: secondaryAction.onClick, children: secondaryAction.text })), primaryAction && (_jsx(Button, { variant: 'primary', onClick: primaryAction.onClick, children: primaryAction.text })), additionalActions && _jsx(Actions, { ...additionalActions })] })] }), _jsx(PageHeader, { ...header, titleTag: 'h2' })] }));
13
13
  };
14
14
  const ObjectPreview = forwardRef(({ content, header, open, onAfterOpen, onAfterClose, onBeforeOpen, onBeforeClose, ...restprops }, ref) => {
15
15
  const contentRef = useConsolidatedRef(ref);
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectPreview.js","sour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,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n PropsWithoutRef,\n ReactNode,\n Ref,\n useRef,\n useEffect,\n RefObject\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Action,\n Actions,\n ActionsProps,\n Button,\n Flex,\n ForwardProps,\n Icon,\n OneColumnPage,\n OmitStrict,\n Drawer,\n useI18n,\n useConsolidatedRef,\n DrawerProps\n} from '@pega/cosmos-react-core';\nimport {\n PageHeaderProps,\n PageHeader,\n StyledPage\n} from '@pega/cosmos-react-build/lib/components/PageTemplates/PageTemplates';\n\nexport interface ObjectPreviewProps\n extends Pick<DrawerProps, 'onAfterOpen' | 'onAfterClose' | 'onBeforeOpen' | 'onBeforeClose'> {\n open?: boolean;\n header: OmitStrict<PageHeaderProps, 'status'>;\n primaryAction: Action;\n secondaryAction?: Action;\n additionalActions?: ActionsProps;\n content: ReactNode;\n onDismiss: () => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledObjectPreview = styled(Drawer)`\n height: calc(100vh - 3rem);\n top: 3rem;\n`;\n\nconst PreviewHeader: FC<\n OmitStrict<ObjectPreviewProps, 'ref' | 'content' | 'open'> & {\n dismissButtonRef: RefObject<HTMLButtonElement>;\n }\n> = ({\n header,\n primaryAction,\n secondaryAction,\n additionalActions,\n onDismiss,\n dismissButtonRef\n}) => {\n const t = useI18n();\n return (\n <Flex container={{ direction: 'column', rowGap: 1 }}>\n <Flex container={{ justify: 'between' }}>\n <Button\n icon\n variant='simple'\n ref={dismissButtonRef}\n label={t('dismiss_label_a11y')}\n onClick={onDismiss}\n >\n <Icon name='times' />\n </Button>\n <Flex container>\n {secondaryAction && (\n <Button onClick={secondaryAction.onClick}>{secondaryAction.text}</Button>\n )}\n <Button variant='primary' onClick={primaryAction.onClick}>\n {primaryAction.text}\n </Button>\n {additionalActions && <Actions {...additionalActions} />}\n </Flex>\n </Flex>\n <PageHeader {...header} titleTag='h2' />\n </Flex>\n );\n};\n\nconst ObjectPreview: FC<PropsWithoutRef<ObjectPreviewProps> & ForwardProps> = forwardRef(\n (\n { content, header, open, onAfterOpen, onAfterClose, onBeforeOpen, onBeforeClose, ...restprops },\n ref: ObjectPreviewProps['ref']\n ) => {\n const contentRef = useConsolidatedRef<HTMLDivElement>(ref);\n const dismissButtonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (open && contentRef.current) {\n contentRef.current?.querySelector('button')?.focus();\n }\n }, [open]);\n\n return (\n <StyledObjectPreview\n ref={contentRef}\n open={!!open}\n nullWhenClosed\n position='fixed'\n size='30%'\n shadow\n placement='right'\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onBeforeOpen={onBeforeOpen}\n onBeforeClose={onBeforeClose}\n >\n <OneColumnPage\n ref={contentRef}\n title={header.title}\n as={StyledPage}\n header={\n <PreviewHeader dismissButtonRef={dismissButtonRef} header={header} {...restprops} />\n }\n scrollContent\n a={content}\n />\n </StyledObjectPreview>\n );\n }\n);\n\nexport default ObjectPreview;\n"]}
1
+ {"version":3,"file":"ObjectPreview.js","sourceRoot":"","sources":["../../../src/components/ObjectPreview/ObjectPreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,MAAM,EACN,SAAS,EAEV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAEL,OAAO,EAEP,MAAM,EACN,IAAI,EAEJ,IAAI,EACJ,aAAa,EAEb,MAAM,EACN,OAAO,EACP,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,UAAU,EACV,UAAU,EACX,MAAM,qEAAqE,CAAC;AAc7E,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;CAGzC,CAAC;AAEF,MAAM,aAAa,GAIf,CAAC,EACH,MAAM,EACN,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EACjB,EAAE,EAAE;IACH,MAAM,CAAC,GAAG,OA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AQ,CAAC,EAAE,KAAK,EAAE,CAAC;SACtD;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CACL,KAAC,mBAAmB,IAClB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,CAAC,CAAC,IAAI,EACZ,cAAc,QACd,QAAQ,EAAC,OAAO,EAChB,IAAI,EAAC,KAAK,EACV,MAAM,QACN,SAAS,EAAC,OAAO,EACjB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,YAE5B,KAAC,aAAa,IACZ,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,EAAE,EAAE,UAAU,EACd,MAAM,EACJ,KAAC,aAAa,IAAC,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,KAAM,SAAS,GAAI,EAEtF,aAAa,QACb,CAAC,EAAE,OAAO,GACV,GACkB,CACvB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n PropsWithoutRef,\n ReactNode,\n Ref,\n useRef,\n useEffect,\n RefObject\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Action,\n Actions,\n ActionsProps,\n Button,\n Flex,\n ForwardProps,\n Icon,\n OneColumnPage,\n OmitStrict,\n Drawer,\n useI18n,\n useConsolidatedRef,\n DrawerProps\n} from '@pega/cosmos-react-core';\nimport {\n PageHeaderProps,\n PageHeader,\n StyledPage\n} from '@pega/cosmos-react-build/lib/components/PageTemplates/PageTemplates';\n\nexport interface ObjectPreviewProps\n extends Pick<DrawerProps, 'onAfterOpen' | 'onAfterClose' | 'onBeforeOpen' | 'onBeforeClose'> {\n open?: boolean;\n header: OmitStrict<PageHeaderProps, 'status'>;\n primaryAction?: Action;\n secondaryAction?: Action;\n additionalActions?: ActionsProps;\n content: ReactNode;\n onDismiss: () => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledObjectPreview = styled(Drawer)`\n height: calc(100vh - 3rem);\n top: 3rem;\n`;\n\nconst PreviewHeader: FC<\n OmitStrict<ObjectPreviewProps, 'ref' | 'content' | 'open'> & {\n dismissButtonRef: RefObject<HTMLButtonElement>;\n }\n> = ({\n header,\n primaryAction,\n secondaryAction,\n additionalActions,\n onDismiss,\n dismissButtonRef\n}) => {\n const t = useI18n();\n return (\n <Flex container={{ direction: 'column', rowGap: 1 }}>\n <Flex container={{ justify: 'between' }}>\n <Button\n icon\n variant='simple'\n ref={dismissButtonRef}\n label={t('dismiss_label_a11y')}\n onClick={onDismiss}\n >\n <Icon name='times' />\n </Button>\n <Flex container>\n {secondaryAction && (\n <Button onClick={secondaryAction.onClick}>{secondaryAction.text}</Button>\n )}\n {primaryAction && (\n <Button variant='primary' onClick={primaryAction.onClick}>\n {primaryAction.text}\n </Button>\n )}\n {additionalActions && <Actions {...additionalActions} />}\n </Flex>\n </Flex>\n <PageHeader {...header} titleTag='h2' />\n </Flex>\n );\n};\n\nconst ObjectPreview: FC<PropsWithoutRef<ObjectPreviewProps> & ForwardProps> = forwardRef(\n (\n { content, header, open, onAfterOpen, onAfterClose, onBeforeOpen, onBeforeClose, ...restprops },\n ref: ObjectPreviewProps['ref']\n ) => {\n const contentRef = useConsolidatedRef<HTMLDivElement>(ref);\n const dismissButtonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (open && contentRef.current) {\n contentRef.current?.querySelector('button')?.focus();\n }\n }, [open]);\n\n return (\n <StyledObjectPreview\n ref={contentRef}\n open={!!open}\n nullWhenClosed\n position='fixed'\n size='30%'\n shadow\n placement='right'\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onBeforeOpen={onBeforeOpen}\n onBeforeClose={onBeforeClose}\n >\n <OneColumnPage\n ref={contentRef}\n title={header.title}\n as={StyledPage}\n header={\n <PreviewHeader dismissButtonRef={dismissButtonRef} header={header} {...restprops} />\n }\n scrollContent\n a={content}\n />\n </StyledObjectPreview>\n );\n }\n);\n\nexport default ObjectPreview;\n"]}
@@ -1,11 +1,15 @@
1
- import { FC, Ref } from 'react';
2
- import { BaseProps, ForwardProps, MenuProps, MenuItemProps, ComboBoxProps, NoChildrenProp } from '@pega/cosmos-react-core';
1
+ import { FunctionComponent, MouseEventHandler } from 'react';
2
+ import { BaseProps, MenuProps, MenuItemProps, ComboBoxProps, NoChildrenProp, ButtonProps } from '@pega/cosmos-react-core';
3
3
  export interface ObjectPickerProps extends BaseProps, NoChildrenProp, Pick<ComboBoxProps, 'id' | 'label' | 'labelHidden' | 'required' | 'disabled' | 'readOnly' | 'name' | 'status' | 'info' | 'placeholder'> {
4
4
  items: MenuProps['items'];
5
5
  loading: MenuProps['loading'];
6
- onSelect: (id: MenuItemProps['id']) => void;
7
- ref?: Ref<HTMLDivElement>;
6
+ onSelect: MenuItemProps['onClick'];
7
+ createProps?: {
8
+ onClick?: MouseEventHandler<HTMLButtonElement>;
9
+ href?: ButtonProps['href'];
10
+ };
11
+ ref?: ComboBoxProps['ref'];
8
12
  }
9
- declare const ObjectPicker: FC<ObjectPickerProps & ForwardProps>;
13
+ declare const ObjectPicker: FunctionComponent<ObjectPickerProps>;
10
14
  export default ObjectPicker;
11
15
  //# sourceMappingURL=ObjectPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ObjectSelect/ObjectPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,EAAE,EAAkC,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EACL,SAAS,EAGT,YAAY,EACZ,SAAS,EACT,aAAa,EAEb,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,iBACf,SAAQ,SAAS,EACf,cAAc,EACd,IAAI,CACF,aAAa,EACX,IAAI,GACJ,OAAO,GACP,aAAa,GACb,UAAU,GACV,UAAU,G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