@pega/cosmos-react-demos 4.0.0-dev.1.2 → 4.0.0-dev.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (487) hide show
  1. package/jsx/build/AppShell/AppShell.mocks.d.ts +18 -55
  2. package/jsx/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  3. package/jsx/build/AppShell/AppShell.mocks.jsx +249 -376
  4. package/jsx/build/AppShell/AppShell.mocks.jsx.map +1 -1
  5. package/jsx/build/AppShell/AppShell.stories.d.ts +13 -10
  6. package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
  7. package/jsx/build/AppShell/AppShell.stories.jsx +72 -98
  8. package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
  9. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +2 -0
  10. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +1 -1
  11. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js +23 -0
  12. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +1 -1
  13. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +1 -1
  14. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx +4 -4
  15. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx.map +1 -1
  16. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  17. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +125 -9
  18. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  19. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  20. package/jsx/build/LifeCycle/LifeCycle.stories.jsx +44 -3
  21. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  22. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts +1 -0
  23. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts.map +1 -1
  24. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.js +2 -1
  25. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.js.map +1 -1
  26. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +3 -2
  27. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  28. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +2 -0
  29. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -1
  30. package/jsx/build/PageBanner/PageBanner.stories.d.ts +15 -0
  31. package/jsx/build/PageBanner/PageBanner.stories.d.ts.map +1 -0
  32. package/jsx/build/PageBanner/PageBanner.stories.jsx +41 -0
  33. package/jsx/build/PageBanner/PageBanner.stories.jsx.map +1 -0
  34. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +0 -2
  35. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -1
  36. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +1 -50
  37. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +1 -1
  38. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +7 -3
  39. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  40. package/jsx/build/PageTemplates/GalleryPage.stories.jsx +32 -31
  41. package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +1 -1
  42. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +0 -1
  43. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  44. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +2 -156
  45. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -1
  46. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  47. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +6 -5
  48. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  49. package/jsx/build/PageTemplates/ShowcasePage.stories.d.ts +17 -0
  50. package/jsx/build/PageTemplates/ShowcasePage.stories.d.ts.map +1 -0
  51. package/jsx/build/PageTemplates/ShowcasePage.stories.jsx +42 -0
  52. package/jsx/build/PageTemplates/ShowcasePage.stories.jsx.map +1 -0
  53. package/jsx/condition-builder/ConditionBuilder/props.mock.d.ts.map +1 -1
  54. package/jsx/condition-builder/ConditionBuilder/props.mock.js +4 -2
  55. package/jsx/condition-builder/ConditionBuilder/props.mock.js.map +1 -1
  56. package/jsx/core/AppShell/AppShell.mocks.jsx +1 -1
  57. package/jsx/core/AppShell/AppShell.mocks.jsx.map +1 -1
  58. package/jsx/core/AppShell/AppShell.stories.d.ts +1 -0
  59. package/jsx/core/AppShell/AppShell.stories.d.ts.map +1 -1
  60. package/jsx/core/AppShell/AppShell.stories.jsx +52 -15
  61. package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
  62. package/jsx/core/Backdrop/Backdrop.stories.d.ts.map +1 -1
  63. package/jsx/core/Backdrop/Backdrop.stories.jsx +12 -12
  64. package/jsx/core/Backdrop/Backdrop.stories.jsx.map +1 -1
  65. package/jsx/core/Badges/Count.stories.jsx +1 -1
  66. package/jsx/core/Badges/Count.stories.jsx.map +1 -1
  67. package/jsx/core/Banner/Banner.stories.d.ts +8 -4
  68. package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
  69. package/jsx/core/Banner/Banner.stories.jsx +95 -46
  70. package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
  71. package/jsx/core/Currency/Currency.stories.d.ts +1 -1
  72. package/jsx/core/Currency/Currency.stories.d.ts.map +1 -1
  73. package/jsx/core/Dialog/Dialog.mocks.d.ts +26 -0
  74. package/jsx/core/Dialog/Dialog.mocks.d.ts.map +1 -0
  75. package/jsx/core/Dialog/Dialog.mocks.jsx +136 -0
  76. package/jsx/core/Dialog/Dialog.mocks.jsx.map +1 -0
  77. package/jsx/core/Dialog/Dialog.stories.d.ts +1 -1
  78. package/jsx/core/Dialog/Dialog.stories.d.ts.map +1 -1
  79. package/jsx/core/Dialog/Dialog.stories.jsx +78 -69
  80. package/jsx/core/Dialog/Dialog.stories.jsx.map +1 -1
  81. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +1 -1
  82. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  83. package/jsx/core/Form/Form.stories.d.ts.map +1 -1
  84. package/jsx/core/Form/Form.stories.jsx +2 -2
  85. package/jsx/core/Form/Form.stories.jsx.map +1 -1
  86. package/jsx/core/Link/Link.stories.d.ts +8 -4
  87. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  88. package/jsx/core/Link/Link.stories.jsx +13 -30
  89. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  90. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -1
  91. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx +47 -52
  92. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx.map +1 -1
  93. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +1 -2
  94. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  95. package/jsx/core/ListToolbar/ListToolbar.stories.jsx +13 -18
  96. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -1
  97. package/jsx/core/LiveLog/LiveLog.mocks.d.ts +5 -0
  98. package/jsx/core/LiveLog/LiveLog.mocks.d.ts.map +1 -0
  99. package/jsx/core/LiveLog/LiveLog.mocks.jsx +47 -0
  100. package/jsx/core/LiveLog/LiveLog.mocks.jsx.map +1 -0
  101. package/jsx/core/LiveLog/LiveLog.stories.d.ts +9 -0
  102. package/jsx/core/LiveLog/LiveLog.stories.d.ts.map +1 -0
  103. package/jsx/core/LiveLog/LiveLog.stories.jsx +19 -0
  104. package/jsx/core/LiveLog/LiveLog.stories.jsx.map +1 -0
  105. package/jsx/core/Location/Location.stories.jsx +2 -2
  106. package/jsx/core/Location/Location.stories.jsx.map +1 -1
  107. package/jsx/core/MenuButton/MenuButton.stories.d.ts +1 -1
  108. package/jsx/core/MenuButton/MenuButton.stories.d.ts.map +1 -1
  109. package/jsx/core/Modal/Modal.mocks.d.ts +1 -1
  110. package/jsx/core/Modal/Modal.mocks.d.ts.map +1 -1
  111. package/jsx/core/MultiStepForm/MultiStepForm.stories.d.ts.map +1 -1
  112. package/jsx/core/MultiStepForm/MultiStepForm.stories.jsx +12 -2
  113. package/jsx/core/MultiStepForm/MultiStepForm.stories.jsx.map +1 -1
  114. package/jsx/core/Number/Number.stories.d.ts +1 -1
  115. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  116. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts +1 -1
  117. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  118. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +2 -2
  119. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  120. package/jsx/core/Progress/Progress.stories.d.ts +7 -2
  121. package/jsx/core/Progress/Progress.stories.d.ts.map +1 -1
  122. package/jsx/core/Progress/Progress.stories.jsx +82 -51
  123. package/jsx/core/Progress/Progress.stories.jsx.map +1 -1
  124. package/jsx/core/Progress/Progress.styles.d.ts.map +1 -1
  125. package/jsx/core/Progress/Progress.styles.js +2 -1
  126. package/jsx/core/Progress/Progress.styles.js.map +1 -1
  127. package/jsx/core/QRCode/QRCode.stories.d.ts +9 -0
  128. package/jsx/core/QRCode/QRCode.stories.d.ts.map +1 -0
  129. package/jsx/core/QRCode/QRCode.stories.jsx +17 -0
  130. package/jsx/core/QRCode/QRCode.stories.jsx.map +1 -0
  131. package/jsx/core/SearchInput/SearchInput.stories.jsx +1 -1
  132. package/jsx/core/SearchInput/SearchInput.stories.jsx.map +1 -1
  133. package/jsx/core/Slider/Slider.stories.d.ts +1 -1
  134. package/jsx/core/Slider/Slider.stories.d.ts.map +1 -1
  135. package/jsx/core/SummaryItem/SummaryItem.stories.d.ts +1 -1
  136. package/jsx/core/SummaryItem/SummaryItem.stories.d.ts.map +1 -1
  137. package/jsx/core/Tree/Tree.stories.d.ts +1 -1
  138. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  139. package/jsx/core/Tree/Tree.stories.jsx +10 -18
  140. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  141. package/jsx/core/URL/URL.stories.jsx +1 -1
  142. package/jsx/core/URL/URL.stories.jsx.map +1 -1
  143. package/jsx/cs/CSAppShell/CSAppShell.mocks.d.ts +18 -1
  144. package/jsx/cs/CSAppShell/CSAppShell.mocks.d.ts.map +1 -1
  145. package/jsx/cs/CSAppShell/CSAppShell.mocks.jsx +139 -4
  146. package/jsx/cs/CSAppShell/CSAppShell.mocks.jsx.map +1 -1
  147. package/jsx/cs/CSAppShell/CSAppShell.stories.d.ts.map +1 -1
  148. package/jsx/cs/CSAppShell/CSAppShell.stories.jsx +3 -33
  149. package/jsx/cs/CSAppShell/CSAppShell.stories.jsx.map +1 -1
  150. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts +2 -2
  151. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +1 -1
  152. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  153. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +1 -2
  154. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
  155. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +3 -1
  156. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  157. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +18 -4
  158. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
  159. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  160. package/jsx/cs/TaskManager/TaskManager.stories.jsx +1 -1
  161. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  162. package/jsx/dnd/StandardDragDropList/Popover.d.ts +1 -1
  163. package/jsx/dnd/StandardDragDropList/Popover.d.ts.map +1 -1
  164. package/jsx/dnd/StandardDragDropList/mockData.d.ts +2 -2
  165. package/jsx/dnd/StandardDragDropList/mockData.d.ts.map +1 -1
  166. package/jsx/rte/Editor/Editor.mocks.d.ts +7 -0
  167. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -1
  168. package/jsx/social/Chat/Chat.mocks.d.ts +2 -1
  169. package/jsx/social/Chat/Chat.mocks.d.ts.map +1 -1
  170. package/jsx/social/Chat/Chat.mocks.js +26 -0
  171. package/jsx/social/Chat/Chat.mocks.js.map +1 -1
  172. package/jsx/social/Chat/Chat.stories.d.ts +5 -2
  173. package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
  174. package/jsx/social/Chat/Chat.stories.jsx +35 -103
  175. package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
  176. package/jsx/social/Email/Email.mocks.d.ts +50 -8
  177. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  178. package/jsx/social/Email/Email.mocks.jsx +130 -18
  179. package/jsx/social/Email/Email.mocks.jsx.map +1 -1
  180. package/jsx/social/Email/Email.stories.d.ts +10 -0
  181. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  182. package/jsx/social/Email/Email.stories.jsx +143 -23
  183. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  184. package/jsx/social/Feed/Feed.mocks.d.ts.map +1 -1
  185. package/jsx/social/Feed/Feed.mocks.jsx +2 -2
  186. package/jsx/social/Feed/Feed.mocks.jsx.map +1 -1
  187. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  188. package/jsx/social/Feed/FeedPost.stories.jsx +1 -3
  189. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  190. package/jsx/tools/Clipboard/Clipboard.stories.d.ts.map +1 -1
  191. package/jsx/tools/Clipboard/Clipboard.stories.jsx +12 -14
  192. package/jsx/tools/Clipboard/Clipboard.stories.jsx.map +1 -1
  193. package/jsx/tools/DevTools/DevTools.stories.d.ts.map +1 -1
  194. package/jsx/tools/DevTools/DevTools.stories.jsx +2 -4
  195. package/jsx/tools/DevTools/DevTools.stories.jsx.map +1 -1
  196. package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts +13 -1
  197. package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts.map +1 -1
  198. package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx +27 -2
  199. package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx.map +1 -1
  200. package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts +4 -2
  201. package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts.map +1 -1
  202. package/jsx/tools/PreviewShell/PreviewShell.stories.jsx +77 -51
  203. package/jsx/tools/PreviewShell/PreviewShell.stories.jsx.map +1 -1
  204. package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts +1 -2
  205. package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts.map +1 -1
  206. package/jsx/tools/PreviewShell/PreviewShell.styles.js +1 -2
  207. package/jsx/tools/PreviewShell/PreviewShell.styles.js.map +1 -1
  208. package/jsx/work/CaseView/Attachments.mocks.d.ts.map +1 -1
  209. package/jsx/work/CaseView/Attachments.mocks.jsx +3 -3
  210. package/jsx/work/CaseView/Attachments.mocks.jsx.map +1 -1
  211. package/jsx/work/CaseView/CaseView.mocks.d.ts +4 -16
  212. package/jsx/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  213. package/jsx/work/CaseView/CaseView.mocks.jsx +25 -13
  214. package/jsx/work/CaseView/CaseView.mocks.jsx.map +1 -1
  215. package/jsx/work/CaseView/CaseView.stories.jsx +2 -3
  216. package/jsx/work/CaseView/CaseView.stories.jsx.map +1 -1
  217. package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  218. package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.jsx +9 -2
  219. package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  220. package/jsx/work/SearchResults/SearchResults.mocks.d.ts +1 -1
  221. package/jsx/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
  222. package/jsx/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  223. package/jsx/work/SearchResults/SearchResults.stories.jsx +21 -2
  224. package/jsx/work/SearchResults/SearchResults.stories.jsx.map +1 -1
  225. package/jsx/work/Stages/Stages.mocks.jsx +6 -6
  226. package/jsx/work/Stages/Stages.mocks.jsx.map +1 -1
  227. package/jsx/work/Stages/Stages.stories.d.ts.map +1 -1
  228. package/jsx/work/Stages/Stages.stories.jsx +22 -8
  229. package/jsx/work/Stages/Stages.stories.jsx.map +1 -1
  230. package/jsx/work/Tasks/Tasks.stories.d.ts.map +1 -1
  231. package/jsx/work/Tasks/Tasks.stories.jsx +15 -13
  232. package/jsx/work/Tasks/Tasks.stories.jsx.map +1 -1
  233. package/jsx/work/Timeline/Timeline.stories.jsx +1 -1
  234. package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
  235. package/jsx/wss/AppShell/AppShell.stories.d.ts.map +1 -1
  236. package/jsx/wss/AppShell/AppShell.stories.jsx +18 -0
  237. package/jsx/wss/AppShell/AppShell.stories.jsx.map +1 -1
  238. package/jsx/wss/CaseView/CaseView.stories.jsx +1 -1
  239. package/jsx/wss/CaseView/CaseView.stories.jsx.map +1 -1
  240. package/lib/build/AppShell/AppShell.mocks.d.ts +18 -55
  241. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  242. package/lib/build/AppShell/AppShell.mocks.js +249 -376
  243. package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
  244. package/lib/build/AppShell/AppShell.stories.d.ts +13 -10
  245. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
  246. package/lib/build/AppShell/AppShell.stories.js +70 -98
  247. package/lib/build/AppShell/AppShell.stories.js.map +1 -1
  248. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +2 -0
  249. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +1 -1
  250. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js +23 -0
  251. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +1 -1
  252. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +1 -1
  253. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js +4 -4
  254. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js.map +1 -1
  255. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  256. package/lib/build/FlowModeller/FlowModeller.stories.js +119 -9
  257. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  258. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  259. package/lib/build/LifeCycle/LifeCycle.stories.js +44 -4
  260. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  261. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts +1 -0
  262. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts.map +1 -1
  263. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.js +2 -1
  264. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.js.map +1 -1
  265. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +3 -2
  266. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  267. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +2 -0
  268. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  269. package/lib/build/PageBanner/PageBanner.stories.d.ts +15 -0
  270. package/lib/build/PageBanner/PageBanner.stories.d.ts.map +1 -0
  271. package/lib/build/PageBanner/PageBanner.stories.js +42 -0
  272. package/lib/build/PageBanner/PageBanner.stories.js.map +1 -0
  273. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +0 -2
  274. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -1
  275. package/lib/build/PageTemplates/GalleryPage.mocks.js +1 -50
  276. package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -1
  277. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +7 -3
  278. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  279. package/lib/build/PageTemplates/GalleryPage.stories.js +32 -31
  280. package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
  281. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +0 -1
  282. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  283. package/lib/build/PageTemplates/PageTemplates.mocks.js +2 -154
  284. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -1
  285. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  286. package/lib/build/PageTemplates/PageTemplates.stories.js +4 -5
  287. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  288. package/lib/build/PageTemplates/ShowcasePage.stories.d.ts +17 -0
  289. package/lib/build/PageTemplates/ShowcasePage.stories.d.ts.map +1 -0
  290. package/lib/build/PageTemplates/ShowcasePage.stories.js +43 -0
  291. package/lib/build/PageTemplates/ShowcasePage.stories.js.map +1 -0
  292. package/lib/condition-builder/ConditionBuilder/props.mock.d.ts.map +1 -1
  293. package/lib/condition-builder/ConditionBuilder/props.mock.js +4 -2
  294. package/lib/condition-builder/ConditionBuilder/props.mock.js.map +1 -1
  295. package/lib/core/AppShell/AppShell.mocks.js +1 -1
  296. package/lib/core/AppShell/AppShell.mocks.js.map +1 -1
  297. package/lib/core/AppShell/AppShell.stories.d.ts +1 -0
  298. package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -1
  299. package/lib/core/AppShell/AppShell.stories.js +52 -15
  300. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  301. package/lib/core/Backdrop/Backdrop.stories.d.ts.map +1 -1
  302. package/lib/core/Backdrop/Backdrop.stories.js +2 -2
  303. package/lib/core/Backdrop/Backdrop.stories.js.map +1 -1
  304. package/lib/core/Badges/Count.stories.js +1 -1
  305. package/lib/core/Badges/Count.stories.js.map +1 -1
  306. package/lib/core/Banner/Banner.stories.d.ts +8 -4
  307. package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
  308. package/lib/core/Banner/Banner.stories.js +92 -32
  309. package/lib/core/Banner/Banner.stories.js.map +1 -1
  310. package/lib/core/Currency/Currency.stories.d.ts +1 -1
  311. package/lib/core/Currency/Currency.stories.d.ts.map +1 -1
  312. package/lib/core/Dialog/Dialog.mocks.d.ts +26 -0
  313. package/lib/core/Dialog/Dialog.mocks.d.ts.map +1 -0
  314. package/lib/core/Dialog/Dialog.mocks.js +132 -0
  315. package/lib/core/Dialog/Dialog.mocks.js.map +1 -0
  316. package/lib/core/Dialog/Dialog.stories.d.ts +1 -1
  317. package/lib/core/Dialog/Dialog.stories.d.ts.map +1 -1
  318. package/lib/core/Dialog/Dialog.stories.js +65 -41
  319. package/lib/core/Dialog/Dialog.stories.js.map +1 -1
  320. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +1 -1
  321. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  322. package/lib/core/Form/Form.stories.d.ts.map +1 -1
  323. package/lib/core/Form/Form.stories.js +2 -2
  324. package/lib/core/Form/Form.stories.js.map +1 -1
  325. package/lib/core/Link/Link.stories.d.ts +8 -4
  326. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  327. package/lib/core/Link/Link.stories.js +6 -9
  328. package/lib/core/Link/Link.stories.js.map +1 -1
  329. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -1
  330. package/lib/core/ListToolbar/ListToolbar.mocks.js +26 -33
  331. package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -1
  332. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +1 -2
  333. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  334. package/lib/core/ListToolbar/ListToolbar.stories.js +23 -20
  335. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  336. package/lib/core/LiveLog/LiveLog.mocks.d.ts +5 -0
  337. package/lib/core/LiveLog/LiveLog.mocks.d.ts.map +1 -0
  338. package/lib/core/LiveLog/LiveLog.mocks.js +29 -0
  339. package/lib/core/LiveLog/LiveLog.mocks.js.map +1 -0
  340. package/lib/core/LiveLog/LiveLog.stories.d.ts +9 -0
  341. package/lib/core/LiveLog/LiveLog.stories.d.ts.map +1 -0
  342. package/lib/core/LiveLog/LiveLog.stories.js +20 -0
  343. package/lib/core/LiveLog/LiveLog.stories.js.map +1 -0
  344. package/lib/core/Location/Location.stories.js +2 -2
  345. package/lib/core/Location/Location.stories.js.map +1 -1
  346. package/lib/core/MenuButton/MenuButton.stories.d.ts +1 -1
  347. package/lib/core/MenuButton/MenuButton.stories.d.ts.map +1 -1
  348. package/lib/core/Modal/Modal.mocks.d.ts +1 -1
  349. package/lib/core/Modal/Modal.mocks.d.ts.map +1 -1
  350. package/lib/core/MultiStepForm/MultiStepForm.stories.d.ts.map +1 -1
  351. package/lib/core/MultiStepForm/MultiStepForm.stories.js +12 -2
  352. package/lib/core/MultiStepForm/MultiStepForm.stories.js.map +1 -1
  353. package/lib/core/Number/Number.stories.d.ts +1 -1
  354. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  355. package/lib/core/PageTemplates/PageTemplates.stories.d.ts +1 -1
  356. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  357. package/lib/core/PageTemplates/PageTemplates.stories.js +2 -2
  358. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  359. package/lib/core/Progress/Progress.stories.d.ts +7 -2
  360. package/lib/core/Progress/Progress.stories.d.ts.map +1 -1
  361. package/lib/core/Progress/Progress.stories.js +68 -44
  362. package/lib/core/Progress/Progress.stories.js.map +1 -1
  363. package/lib/core/Progress/Progress.styles.d.ts.map +1 -1
  364. package/lib/core/Progress/Progress.styles.js +2 -1
  365. package/lib/core/Progress/Progress.styles.js.map +1 -1
  366. package/lib/core/QRCode/QRCode.stories.d.ts +9 -0
  367. package/lib/core/QRCode/QRCode.stories.d.ts.map +1 -0
  368. package/lib/core/QRCode/QRCode.stories.js +18 -0
  369. package/lib/core/QRCode/QRCode.stories.js.map +1 -0
  370. package/lib/core/SearchInput/SearchInput.stories.js +1 -1
  371. package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
  372. package/lib/core/Slider/Slider.stories.d.ts +1 -1
  373. package/lib/core/Slider/Slider.stories.d.ts.map +1 -1
  374. package/lib/core/SummaryItem/SummaryItem.stories.d.ts +1 -1
  375. package/lib/core/SummaryItem/SummaryItem.stories.d.ts.map +1 -1
  376. package/lib/core/Tree/Tree.stories.d.ts +1 -1
  377. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  378. package/lib/core/Tree/Tree.stories.js +10 -20
  379. package/lib/core/Tree/Tree.stories.js.map +1 -1
  380. package/lib/core/URL/URL.stories.js +1 -1
  381. package/lib/core/URL/URL.stories.js.map +1 -1
  382. package/lib/cs/CSAppShell/CSAppShell.mocks.d.ts +18 -1
  383. package/lib/cs/CSAppShell/CSAppShell.mocks.d.ts.map +1 -1
  384. package/lib/cs/CSAppShell/CSAppShell.mocks.js +109 -4
  385. package/lib/cs/CSAppShell/CSAppShell.mocks.js.map +1 -1
  386. package/lib/cs/CSAppShell/CSAppShell.stories.d.ts.map +1 -1
  387. package/lib/cs/CSAppShell/CSAppShell.stories.js +4 -17
  388. package/lib/cs/CSAppShell/CSAppShell.stories.js.map +1 -1
  389. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts +2 -2
  390. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +1 -1
  391. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  392. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +1 -2
  393. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
  394. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +3 -1
  395. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  396. package/lib/cs/InteractionNotification/InteractionNotification.stories.js +18 -4
  397. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
  398. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  399. package/lib/cs/TaskManager/TaskManager.stories.js +1 -1
  400. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  401. package/lib/dnd/StandardDragDropList/Popover.d.ts +1 -1
  402. package/lib/dnd/StandardDragDropList/Popover.d.ts.map +1 -1
  403. package/lib/dnd/StandardDragDropList/mockData.d.ts +2 -2
  404. package/lib/dnd/StandardDragDropList/mockData.d.ts.map +1 -1
  405. package/lib/rte/Editor/Editor.mocks.d.ts +7 -0
  406. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -1
  407. package/lib/social/Chat/Chat.mocks.d.ts +2 -1
  408. package/lib/social/Chat/Chat.mocks.d.ts.map +1 -1
  409. package/lib/social/Chat/Chat.mocks.js +26 -0
  410. package/lib/social/Chat/Chat.mocks.js.map +1 -1
  411. package/lib/social/Chat/Chat.stories.d.ts +5 -2
  412. package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
  413. package/lib/social/Chat/Chat.stories.js +36 -78
  414. package/lib/social/Chat/Chat.stories.js.map +1 -1
  415. package/lib/social/Email/Email.mocks.d.ts +50 -8
  416. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  417. package/lib/social/Email/Email.mocks.js +130 -18
  418. package/lib/social/Email/Email.mocks.js.map +1 -1
  419. package/lib/social/Email/Email.stories.d.ts +10 -0
  420. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  421. package/lib/social/Email/Email.stories.js +148 -23
  422. package/lib/social/Email/Email.stories.js.map +1 -1
  423. package/lib/social/Feed/Feed.mocks.d.ts.map +1 -1
  424. package/lib/social/Feed/Feed.mocks.js +2 -2
  425. package/lib/social/Feed/Feed.mocks.js.map +1 -1
  426. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  427. package/lib/social/Feed/FeedPost.stories.js +1 -1
  428. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  429. package/lib/tools/Clipboard/Clipboard.stories.d.ts.map +1 -1
  430. package/lib/tools/Clipboard/Clipboard.stories.js +13 -17
  431. package/lib/tools/Clipboard/Clipboard.stories.js.map +1 -1
  432. package/lib/tools/DevTools/DevTools.stories.d.ts.map +1 -1
  433. package/lib/tools/DevTools/DevTools.stories.js +2 -4
  434. package/lib/tools/DevTools/DevTools.stories.js.map +1 -1
  435. package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts +13 -1
  436. package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts.map +1 -1
  437. package/lib/tools/PreviewShell/PreviewShell.mocks.js +23 -2
  438. package/lib/tools/PreviewShell/PreviewShell.mocks.js.map +1 -1
  439. package/lib/tools/PreviewShell/PreviewShell.stories.d.ts +4 -2
  440. package/lib/tools/PreviewShell/PreviewShell.stories.d.ts.map +1 -1
  441. package/lib/tools/PreviewShell/PreviewShell.stories.js +72 -52
  442. package/lib/tools/PreviewShell/PreviewShell.stories.js.map +1 -1
  443. package/lib/tools/PreviewShell/PreviewShell.styles.d.ts +1 -2
  444. package/lib/tools/PreviewShell/PreviewShell.styles.d.ts.map +1 -1
  445. package/lib/tools/PreviewShell/PreviewShell.styles.js +1 -2
  446. package/lib/tools/PreviewShell/PreviewShell.styles.js.map +1 -1
  447. package/lib/work/CaseView/Attachments.mocks.d.ts.map +1 -1
  448. package/lib/work/CaseView/Attachments.mocks.js +3 -3
  449. package/lib/work/CaseView/Attachments.mocks.js.map +1 -1
  450. package/lib/work/CaseView/CaseView.mocks.d.ts +4 -16
  451. package/lib/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  452. package/lib/work/CaseView/CaseView.mocks.js +25 -13
  453. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  454. package/lib/work/CaseView/CaseView.stories.js +2 -3
  455. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  456. package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  457. package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.js +9 -2
  458. package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  459. package/lib/work/SearchResults/SearchResults.mocks.d.ts +1 -1
  460. package/lib/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
  461. package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  462. package/lib/work/SearchResults/SearchResults.stories.js +21 -2
  463. package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
  464. package/lib/work/Stages/Stages.mocks.js +6 -6
  465. package/lib/work/Stages/Stages.mocks.js.map +1 -1
  466. package/lib/work/Stages/Stages.stories.d.ts.map +1 -1
  467. package/lib/work/Stages/Stages.stories.js +22 -8
  468. package/lib/work/Stages/Stages.stories.js.map +1 -1
  469. package/lib/work/Tasks/Tasks.stories.d.ts.map +1 -1
  470. package/lib/work/Tasks/Tasks.stories.js +2 -2
  471. package/lib/work/Tasks/Tasks.stories.js.map +1 -1
  472. package/lib/work/Timeline/Timeline.stories.js +1 -1
  473. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  474. package/lib/wss/AppShell/AppShell.stories.d.ts.map +1 -1
  475. package/lib/wss/AppShell/AppShell.stories.js +18 -0
  476. package/lib/wss/AppShell/AppShell.stories.js.map +1 -1
  477. package/lib/wss/CaseView/CaseView.stories.js +1 -1
  478. package/lib/wss/CaseView/CaseView.stories.js.map +1 -1
  479. package/package.json +12 -11
  480. package/jsx/build/AppHeader/AppHeader.stories.d.ts +0 -13
  481. package/jsx/build/AppHeader/AppHeader.stories.d.ts.map +0 -1
  482. package/jsx/build/AppHeader/AppHeader.stories.jsx +0 -153
  483. package/jsx/build/AppHeader/AppHeader.stories.jsx.map +0 -1
  484. package/lib/build/AppHeader/AppHeader.stories.d.ts +0 -13
  485. package/lib/build/AppHeader/AppHeader.stories.d.ts.map +0 -1
  486. package/lib/build/AppHeader/AppHeader.stories.js +0 -152
  487. package/lib/build/AppHeader/AppHeader.stories.js.map +0 -1
@@ -6,7 +6,7 @@ import { Card, CardContent, createUID, MenuButton, Icon, registerIcon, Flex, But
6
6
  import * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';
7
7
  import { Email as EmailComponent, EmailConversation, EmailComposer, EmailShell, EmailSummaryItem, EmailSummaryList, EntityList, EmailManager, EmailCaseView } from '@pega/cosmos-react-social';
8
8
  import { AppShellDemo } from '../../core/AppShell/AppShell.stories';
9
- import { bccParticipants, ccParticipants, emailBodyContent, participants, toParticipants, emailAttachments, EntityListMockData, viewAnalysisEmailHeaderMock, topicListMock, generateEmailConversationParticipants, templates, handleExternalEntry, emailDemoActions, LaunchAction, baseComposerProps, sentiment, emailSummaryItems, mockEmails, mockSuggestedReplies, mockEmailBodyTemplates, forwardedContent, getCompositeId, emptyFieldErrorMessage, fieldValidation, emailWorklistItemsMock, contextMenuItemsMock, highlightedEntitiesMock, mockUploadImage, mailDeliverySystemEmail, supportTeamEmail, bodyData } from './Email.mocks';
9
+ import { bccParticipants, ccParticipants, emailBodyContent, participants, toParticipants, emailAttachments, EntityListMockData, viewAnalysisEmailHeaderMock, topicListMock, generateEmailConversationParticipants, templates, handleExternalEntry, emailDemoActions, LaunchAction, baseComposerProps, sentiment, emailSummaryItems, mockEmails, mockSuggestedReplies, forwardedContent, getCompositeId, emptyFieldErrorMessage, fieldValidation, emailWorklistItemsMock, contextMenuItemsMock, highlightedEntitiesMock, mockUploadImage, mailDeliverySystemEmail, supportTeamEmail, bodyData, emailAccounts, getTemplate } from './Email.mocks';
10
10
  import { StyledEmailCardContent } from './Email.styles';
11
11
  registerIcon(filterIcon);
12
12
  export default {
@@ -49,10 +49,11 @@ export const Email = (args) => {
49
49
  ? args.entityHighlightMapping || highlightedEntitiesMock
50
50
  : undefined, subject: args.subject || 'I lost my debit card', banner: args.showEmailBanner
51
51
  ? {
52
- id: 'banner_1',
53
- heading: 'Address not found ',
54
52
  messages: [
55
- '550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipients email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser k24-20020aa790d8000000b0050dd7e3b84csor451330pfk.28'
53
+ {
54
+ label: 'Address not found.',
55
+ description: '550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipients email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser k24-20020aa790d8000000b0050dd7e3b84csor451330pfk.28'
56
+ }
56
57
  ]
57
58
  }
58
59
  : undefined, onReply: args.onReply || (args.showDraft ? undefined : action('On reply')), onReplyAll: args.onReplyAll || (args.showDraft ? undefined : action('On reply all')), onForward: args.onForward || (args.showDraft ? undefined : action('On forward')), onEditDraft: args.onEditDraft || (args.showDraft ? action('On forward') : undefined), onDeleteDraft: args.onDeleteDraft || (args.showDraft ? action('On forward') : undefined), onSuggestionClick: args.onSuggestionClick || action('On Suggested reply clicked'), sentiment: {
@@ -125,7 +126,7 @@ export const Composer = (args) => {
125
126
  bodyContentCurrentValue: value
126
127
  }));
127
128
  }
128
- else if (['responseType', 'attachments', 'selectedTemplateId'].includes(field)) {
129
+ if (['responseType', 'attachments', 'selectedTemplateId'].includes(field)) {
129
130
  setData(prev => ({
130
131
  ...prev,
131
132
  [field]: value
@@ -201,8 +202,8 @@ export const Composer = (args) => {
201
202
  });
202
203
  }
203
204
  }, [data.responseType]);
204
- const onTemplateChange = (id) => {
205
- const selectedTemplate = mockEmailBodyTemplates.find(template => template.id === id);
205
+ const onTemplateChange = (templateId) => {
206
+ const selectedTemplate = getTemplate(templateId);
206
207
  // Simulating api call
207
208
  setComposerProgress({ message: 'Loading template...' });
208
209
  setTimeout(() => {
@@ -280,6 +281,128 @@ Composer.argTypes = {
280
281
  control: { type: 'boolean' }
281
282
  }
282
283
  };
284
+ export const OutboundEmail = (args) => {
285
+ const { enableResponseTypeToggle = true, enableSaveAsDraft = true } = args;
286
+ const [composerProgress, setComposerProgress] = useState(false);
287
+ const composerHandle = useRef(null);
288
+ const [data, setData] = useState({
289
+ to: { value: [] },
290
+ cc: { value: [] },
291
+ bcc: { value: [] },
292
+ subject: { value: '' },
293
+ selectedTemplateId: '',
294
+ bodyContent: {
295
+ defaultValue: ''
296
+ },
297
+ bodyContentCurrentValue: ''
298
+ });
299
+ const handleOnChange = (field, value) => {
300
+ if (field === 'bodyContent') {
301
+ setData(prev => ({
302
+ ...prev,
303
+ bodyContentCurrentValue: value
304
+ }));
305
+ }
306
+ else if (['attachments', 'selectedTemplateId'].includes(field)) {
307
+ setData(prev => ({
308
+ ...prev,
309
+ [field]: value
310
+ }));
311
+ }
312
+ else {
313
+ // Clearing error message as soon as value changes
314
+ setData(prev => {
315
+ return {
316
+ ...prev,
317
+ [field]: { error: undefined, value }
318
+ };
319
+ });
320
+ }
321
+ action('onChange')(field, value);
322
+ };
323
+ const onTemplateChange = (templateId) => {
324
+ const selectedTemplate = getTemplate(templateId);
325
+ // Simulating api call
326
+ setComposerProgress({ message: 'Loading template...' });
327
+ setTimeout(() => {
328
+ setComposerProgress(false);
329
+ composerHandle.current?.replaceBodyContent(selectedTemplate?.content || '');
330
+ // Brings the cursor to the beginning of the body.
331
+ composerHandle.current?.setCursorLocationToStart?.();
332
+ }, 1000);
333
+ };
334
+ useEffect(() => {
335
+ if (data.selectedTemplateId)
336
+ onTemplateChange(data.selectedTemplateId);
337
+ }, [data.selectedTemplateId]);
338
+ const handleOnSend = () => {
339
+ setData(prev => {
340
+ return {
341
+ ...prev,
342
+ emailAccount: {
343
+ value: prev.emailAccount?.value || '',
344
+ error: data.emailAccount?.value ? undefined : emptyFieldErrorMessage
345
+ },
346
+ to: {
347
+ value: prev.to?.value || [],
348
+ error: data?.to?.value.length === 0 ? emptyFieldErrorMessage : fieldValidation(data?.to?.value)
349
+ },
350
+ cc: {
351
+ value: prev.cc?.value || [],
352
+ error: data.cc === undefined ? undefined : fieldValidation(data.cc.value)
353
+ },
354
+ bcc: {
355
+ value: prev.bcc?.value || [],
356
+ error: data.bcc === undefined ? undefined : fieldValidation(data.bcc.value)
357
+ },
358
+ subject: {
359
+ ...prev.subject,
360
+ error: data.subject?.value === '' ? emptyFieldErrorMessage : undefined
361
+ },
362
+ bodyContent: {
363
+ ...prev.bodyContent,
364
+ error: data.bodyContentCurrentValue === '' ? emptyFieldErrorMessage : undefined
365
+ }
366
+ };
367
+ });
368
+ };
369
+ const onImageAdded = (image, id) => {
370
+ action('On Image added');
371
+ setComposerProgress({ message: 'Uploading image' });
372
+ // Simulate image upload
373
+ mockUploadImage(image)
374
+ .then(({ src, alt }) => {
375
+ composerHandle.current?.updateImage({ src, alt }, id);
376
+ setComposerProgress(false);
377
+ })
378
+ .catch(() => {
379
+ setComposerProgress(false);
380
+ });
381
+ };
382
+ useEffect(() => {
383
+ setTimeout(() => {
384
+ composerHandle.current?.replaceBodyContent(bodyData);
385
+ // Brings the cursor to the beginning of the body.
386
+ composerHandle.current?.setCursorLocationToStart?.();
387
+ }, 100);
388
+ }, []);
389
+ return (_jsx(EmailComposer, { handle: composerHandle, progress: composerProgress, onSave: args.onSave || (enableSaveAsDraft ? action('On save') : undefined), onSend: args.onSend || handleOnSend, onCancel: args.onCancel || action('On cancel'), externalValidator: handleExternalEntry, participants: participants, senderAccounts: emailAccounts, onChange: args.onChange || handleOnChange, data: args.data || {
390
+ ...data,
391
+ responseType: enableResponseTypeToggle ? data.responseType : undefined
392
+ }, templates: templates, onImageAdded: onImageAdded }));
393
+ };
394
+ OutboundEmail.args = {
395
+ enableResponseTypeToggle: false,
396
+ enableSaveAsDraft: false
397
+ };
398
+ OutboundEmail.argTypes = {
399
+ enableResponseTypeToggle: {
400
+ control: 'boolean'
401
+ },
402
+ enableSaveAsDraft: {
403
+ control: { type: 'boolean' }
404
+ }
405
+ };
283
406
  // ______ ______ .__ __. ____ ____ _______ .______ _______. ___ .___________. __ ______ .__ __.
284
407
  // / | / __ \ | \ | | \ \ / / | ____|| _ \ / | / \ | || | / __ \ | \ | |
285
408
  // | ,----'| | | | | \| | \ \/ / | |__ | |_) | | (----` / ^ \ `---| |----`| | | | | | | \| |
@@ -381,8 +504,8 @@ export const EmailShellDemo = (args) => {
381
504
  });
382
505
  }
383
506
  };
384
- const handleTemplateIdChange = (uid, templateId) => {
385
- const selectedTemplate = mockEmailBodyTemplates.find(template => template.id === templateId);
507
+ const handleTemplateChange = (uid, templateId) => {
508
+ const selectedTemplate = getTemplate(templateId);
386
509
  setComposersData(prev => {
387
510
  return {
388
511
  ...prev,
@@ -415,7 +538,7 @@ export const EmailShellDemo = (args) => {
415
538
  };
416
539
  const handleChange = (uid, field, value) => {
417
540
  setComposersData(prevData => {
418
- if (field === 'bodyContent') {
541
+ if (field === 'bodyContent' && typeof value === 'string') {
419
542
  return {
420
543
  ...prevData,
421
544
  [uid]: {
@@ -430,7 +553,7 @@ export const EmailShellDemo = (args) => {
430
553
  ...prevData[uid],
431
554
  data: {
432
555
  ...prevData[uid].data,
433
- [field]: ['responseType', 'attachments', 'selectedTemplateId'].includes(field)
556
+ [field]: ['responseType', 'attachments', 'selectedTemplate'].includes(field)
434
557
  ? value
435
558
  : {
436
559
  error: undefined,
@@ -440,11 +563,11 @@ export const EmailShellDemo = (args) => {
440
563
  }
441
564
  };
442
565
  });
443
- if (field === 'responseType') {
566
+ if (field === 'responseType' && typeof value === 'string') {
444
567
  handleResponseTypeChange(uid, value);
445
568
  }
446
- else if (field === 'selectedTemplateId') {
447
- handleTemplateIdChange(uid, value);
569
+ else if (field === 'selectedTemplateId' && typeof value === 'string') {
570
+ handleTemplateChange(uid, value);
448
571
  }
449
572
  };
450
573
  const MyModal = ({ currentID }) => {
@@ -618,7 +741,7 @@ export const EmailShellDemo = (args) => {
618
741
  responseType: 'reply',
619
742
  subject: { value: suggestion?.title || '' },
620
743
  bodyContent: { defaultValue: suggestion ? suggestion.content : '' },
621
- selectedTemplateId: suggestion?.id
744
+ selectedTemplateId: suggestionId
622
745
  },
623
746
  externalValidator: handleExternalEntry
624
747
  });
@@ -662,10 +785,11 @@ export const EmailShellDemo = (args) => {
662
785
  to: [supportTeamEmail],
663
786
  body: '<div>Hi, <br /> <br /><div>Your address change request is approved.</div> <br /> <br />Regards, <br />Support team </div>',
664
787
  banner: {
665
- id: 'banner_1',
666
- heading: 'Address not found ',
667
788
  messages: [
668
- '550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipients email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser k24-20020aa790d8000000b0050dd7e3b84csor451330pfk.28'
789
+ {
790
+ label: 'Address not found.',
791
+ description: '550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipients email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser k24-20020aa790d8000000b0050dd7e3b84csor451330pfk.28'
792
+ }
669
793
  ]
670
794
  },
671
795
  onReply: undefined,
@@ -778,10 +902,11 @@ export const EmailShellDemo = (args) => {
778
902
  to: [supportTeamEmail],
779
903
  body: '<div>Hi, <br /> <br /><div>Your address change request is approved.</div> <br /> <br />Regards, <br />Support team </div>',
780
904
  banner: {
781
- id: 'banner_1',
782
- heading: 'Address not found ',
783
905
  messages: [
784
- '550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipients email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser k24-20020aa790d8000000b0050dd7e3b84csor451330pfk.28'
906
+ {
907
+ label: 'Address not found.',
908
+ description: '550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipients email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser k24-20020aa790d8000000b0050dd7e3b84csor451330pfk.28'
909
+ }
785
910
  ]
786
911
  },
787
912
  onReply: undefined,
@@ -942,7 +1067,7 @@ export const EmailCaseViewDemo = (args) => {
942
1067
  icon: 'mail',
943
1068
  title: 'ET-5432'
944
1069
  }
945
- : undefined, banners: args.showBanners && (_jsx(Banner, { id: 'error', variant: 'urgent', heading: 'Error', messages: ['Your email could not be delivered due to poor network connection.'] })), content: content, utilities: !args.noUtilityView && utilities, utilitiesSummaryItems: !args.noUtilityView
1070
+ : undefined, banners: args.showBanners && (_jsx(Banner, { variant: 'urgent', messages: ['Your email could not be delivered due to poor network connection.'] })), content: content, utilities: !args.noUtilityView && utilities, utilitiesSummaryItems: !args.noUtilityView
946
1071
  ? [
947
1072
  { iconName: 'list-number', count: 7 },
948
1073
  { iconName: 'document-doc', count: 1 },
@@ -1006,7 +1131,7 @@ export const EmailManagerAppShell = (args) => {
1006
1131
  icon: 'mail',
1007
1132
  title: 'Inbox'
1008
1133
  }
1009
- : undefined, list: _jsx(EmailSummaryListDemo, { onItemClick: handleEmailItemClick, items: emailList, onLoadMore: hasMore ? onLoadMore : undefined, loading: loading }), emailCaseDetails: !args.showEmptyView && (_jsx(EmailCaseView, { banners: args.showCaseViewBanners && (_jsx(Banner, { id: 'error', variant: 'urgent', heading: 'Error', messages: [
1134
+ : undefined, list: _jsx(EmailSummaryListDemo, { onItemClick: handleEmailItemClick, items: emailList, onLoadMore: hasMore ? onLoadMore : undefined, loading: loading }), emailCaseDetails: !args.showEmptyView && (_jsx(EmailCaseView, { banners: args.showCaseViewBanners && (_jsx(Banner, { variant: 'urgent', messages: [
1010
1135
  'Your email could not be delivered due to poor network connection.'
1011
1136
  ] })), content: content, utilities: args.showUtilities && utilities, utilitiesSummaryItems: args.showUtilities
1012
1137
  ? [