@pega/cosmos-react-demos 2.0.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 (678) hide show
  1. package/LICENSE +185 -0
  2. package/lib/build/AppHeader/AppHeader.stories.d.ts +8 -0
  3. package/lib/build/AppHeader/AppHeader.stories.d.ts.map +1 -0
  4. package/lib/build/AppHeader/AppHeader.stories.jsx +65 -0
  5. package/lib/build/AppHeader/AppHeader.stories.jsx.map +1 -0
  6. package/lib/build/AppShell/AppShell.mocks.d.ts +50 -0
  7. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -0
  8. package/lib/build/AppShell/AppShell.mocks.js +503 -0
  9. package/lib/build/AppShell/AppShell.mocks.js.map +1 -0
  10. package/lib/build/AppShell/AppShell.stories.d.ts +12 -0
  11. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -0
  12. package/lib/build/AppShell/AppShell.stories.jsx +194 -0
  13. package/lib/build/AppShell/AppShell.stories.jsx.map +1 -0
  14. package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts +45 -0
  15. package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts.map +1 -0
  16. package/lib/build/FlowModeller/AddNodeUtils.mocks.js +291 -0
  17. package/lib/build/FlowModeller/AddNodeUtils.mocks.js.map +1 -0
  18. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +9 -0
  19. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -0
  20. package/lib/build/FlowModeller/FlowModeller.mocks.js +411 -0
  21. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -0
  22. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +12 -0
  23. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -0
  24. package/lib/build/FlowModeller/FlowModeller.stories.jsx +214 -0
  25. package/lib/build/FlowModeller/FlowModeller.stories.jsx.map +1 -0
  26. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts +201 -0
  27. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -0
  28. package/lib/build/LifeCycle/LifeCycle.mocks.js +1128 -0
  29. package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -0
  30. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +11 -0
  31. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -0
  32. package/lib/build/LifeCycle/LifeCycle.stories.jsx +491 -0
  33. package/lib/build/LifeCycle/LifeCycle.stories.jsx.map +1 -0
  34. package/lib/build/LifeCycle/utils.d.ts +65 -0
  35. package/lib/build/LifeCycle/utils.d.ts.map +1 -0
  36. package/lib/build/LifeCycle/utils.js +218 -0
  37. package/lib/build/LifeCycle/utils.js.map +1 -0
  38. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +12 -0
  39. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -0
  40. package/lib/build/PageTemplates/GalleryPage.stories.jsx +126 -0
  41. package/lib/build/PageTemplates/GalleryPage.stories.jsx.map +1 -0
  42. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +26 -0
  43. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -0
  44. package/lib/build/PageTemplates/PageTemplates.stories.jsx +434 -0
  45. package/lib/build/PageTemplates/PageTemplates.stories.jsx.map +1 -0
  46. package/lib/build/Workbench/Workbench.mocks.d.ts +9 -0
  47. package/lib/build/Workbench/Workbench.mocks.d.ts.map +1 -0
  48. package/lib/build/Workbench/Workbench.mocks.js +67 -0
  49. package/lib/build/Workbench/Workbench.mocks.js.map +1 -0
  50. package/lib/build/Workbench/Workbench.stories.d.ts +10 -0
  51. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -0
  52. package/lib/build/Workbench/Workbench.stories.jsx +124 -0
  53. package/lib/build/Workbench/Workbench.stories.jsx.map +1 -0
  54. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +10 -0
  55. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -0
  56. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +263 -0
  57. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -0
  58. package/lib/condition-builder/ConditionBuilder/props.mock.d.ts +6 -0
  59. package/lib/condition-builder/ConditionBuilder/props.mock.d.ts.map +1 -0
  60. package/lib/condition-builder/ConditionBuilder/props.mock.js +113 -0
  61. package/lib/condition-builder/ConditionBuilder/props.mock.js.map +1 -0
  62. package/lib/core/AppShell/AppShell.mocks.d.ts +15 -0
  63. package/lib/core/AppShell/AppShell.mocks.d.ts.map +1 -0
  64. package/lib/core/AppShell/AppShell.mocks.jsx +147 -0
  65. package/lib/core/AppShell/AppShell.mocks.jsx.map +1 -0
  66. package/lib/core/AppShell/AppShell.stories.d.ts +31 -0
  67. package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -0
  68. package/lib/core/AppShell/AppShell.stories.jsx +222 -0
  69. package/lib/core/AppShell/AppShell.stories.jsx.map +1 -0
  70. package/lib/core/AppShell/AppShell.styles.d.ts +2 -0
  71. package/lib/core/AppShell/AppShell.styles.d.ts.map +1 -0
  72. package/lib/core/AppShell/AppShell.styles.js +5 -0
  73. package/lib/core/AppShell/AppShell.styles.js.map +1 -0
  74. package/lib/core/Avatar/Avatar.stories.d.ts +10 -0
  75. package/lib/core/Avatar/Avatar.stories.d.ts.map +1 -0
  76. package/lib/core/Avatar/Avatar.stories.jsx +50 -0
  77. package/lib/core/Avatar/Avatar.stories.jsx.map +1 -0
  78. package/lib/core/Backdrop/Backdrop.stories.d.ts +7 -0
  79. package/lib/core/Backdrop/Backdrop.stories.d.ts.map +1 -0
  80. package/lib/core/Backdrop/Backdrop.stories.jsx +43 -0
  81. package/lib/core/Backdrop/Backdrop.stories.jsx.map +1 -0
  82. package/lib/core/Badges/Alert.stories.d.ts +6 -0
  83. package/lib/core/Badges/Alert.stories.d.ts.map +1 -0
  84. package/lib/core/Badges/Alert.stories.jsx +15 -0
  85. package/lib/core/Badges/Alert.stories.jsx.map +1 -0
  86. package/lib/core/Badges/Count.stories.d.ts +6 -0
  87. package/lib/core/Badges/Count.stories.d.ts.map +1 -0
  88. package/lib/core/Badges/Count.stories.jsx +20 -0
  89. package/lib/core/Badges/Count.stories.jsx.map +1 -0
  90. package/lib/core/Badges/Selection.stories.d.ts +6 -0
  91. package/lib/core/Badges/Selection.stories.d.ts.map +1 -0
  92. package/lib/core/Badges/Selection.stories.jsx +9 -0
  93. package/lib/core/Badges/Selection.stories.jsx.map +1 -0
  94. package/lib/core/Badges/Status.stories.d.ts +6 -0
  95. package/lib/core/Badges/Status.stories.d.ts.map +1 -0
  96. package/lib/core/Badges/Status.stories.jsx +18 -0
  97. package/lib/core/Badges/Status.stories.jsx.map +1 -0
  98. package/lib/core/Badges/Tag.stories.d.ts +6 -0
  99. package/lib/core/Badges/Tag.stories.d.ts.map +1 -0
  100. package/lib/core/Badges/Tag.stories.jsx +9 -0
  101. package/lib/core/Badges/Tag.stories.jsx.map +1 -0
  102. package/lib/core/Banner/Banner.stories.d.ts +22 -0
  103. package/lib/core/Banner/Banner.stories.d.ts.map +1 -0
  104. package/lib/core/Banner/Banner.stories.jsx +125 -0
  105. package/lib/core/Banner/Banner.stories.jsx.map +1 -0
  106. package/lib/core/Boolean/BooleanDisplay.stories.d.ts +6 -0
  107. package/lib/core/Boolean/BooleanDisplay.stories.d.ts.map +1 -0
  108. package/lib/core/Boolean/BooleanDisplay.stories.jsx +19 -0
  109. package/lib/core/Boolean/BooleanDisplay.stories.jsx.map +1 -0
  110. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts +7 -0
  111. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -0
  112. package/lib/core/Breadcrumbs/Breadcrumbs.stories.jsx +29 -0
  113. package/lib/core/Breadcrumbs/Breadcrumbs.stories.jsx.map +1 -0
  114. package/lib/core/Breadcrumbs/Breadcrumbs.styles.d.ts +2 -0
  115. package/lib/core/Breadcrumbs/Breadcrumbs.styles.d.ts.map +1 -0
  116. package/lib/core/Breadcrumbs/Breadcrumbs.styles.js +12 -0
  117. package/lib/core/Breadcrumbs/Breadcrumbs.styles.js.map +1 -0
  118. package/lib/core/Button/Button.stories.d.ts +12 -0
  119. package/lib/core/Button/Button.stories.d.ts.map +1 -0
  120. package/lib/core/Button/Button.stories.jsx +103 -0
  121. package/lib/core/Button/Button.stories.jsx.map +1 -0
  122. package/lib/core/Card/Card.stories.d.ts +8 -0
  123. package/lib/core/Card/Card.stories.d.ts.map +1 -0
  124. package/lib/core/Card/Card.stories.jsx +55 -0
  125. package/lib/core/Card/Card.stories.jsx.map +1 -0
  126. package/lib/core/Card/Card.styles.d.ts +2 -0
  127. package/lib/core/Card/Card.styles.d.ts.map +1 -0
  128. package/lib/core/Card/Card.styles.js +5 -0
  129. package/lib/core/Card/Card.styles.js.map +1 -0
  130. package/lib/core/Checkbox/Checkbox.stories.d.ts +7 -0
  131. package/lib/core/Checkbox/Checkbox.stories.d.ts.map +1 -0
  132. package/lib/core/Checkbox/Checkbox.stories.jsx +28 -0
  133. package/lib/core/Checkbox/Checkbox.stories.jsx.map +1 -0
  134. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts +7 -0
  135. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -0
  136. package/lib/core/CheckboxGroup/CheckboxGroup.stories.jsx +60 -0
  137. package/lib/core/CheckboxGroup/CheckboxGroup.stories.jsx.map +1 -0
  138. package/lib/core/CheckboxGroup/CheckboxGroup.styles.d.ts +4 -0
  139. package/lib/core/CheckboxGroup/CheckboxGroup.styles.d.ts.map +1 -0
  140. package/lib/core/CheckboxGroup/CheckboxGroup.styles.js +9 -0
  141. package/lib/core/CheckboxGroup/CheckboxGroup.styles.js.map +1 -0
  142. package/lib/core/ColorPicker/ColorPicker.stories.d.ts +8 -0
  143. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -0
  144. package/lib/core/ColorPicker/ColorPicker.stories.jsx +91 -0
  145. package/lib/core/ColorPicker/ColorPicker.stories.jsx.map +1 -0
  146. package/lib/core/ComboBox/ComboBox.mocks.d.ts +24 -0
  147. package/lib/core/ComboBox/ComboBox.mocks.d.ts.map +1 -0
  148. package/lib/core/ComboBox/ComboBox.mocks.js +54 -0
  149. package/lib/core/ComboBox/ComboBox.mocks.js.map +1 -0
  150. package/lib/core/ComboBox/ComboBox.stories.d.ts +21 -0
  151. package/lib/core/ComboBox/ComboBox.stories.d.ts.map +1 -0
  152. package/lib/core/ComboBox/ComboBox.stories.jsx +323 -0
  153. package/lib/core/ComboBox/ComboBox.stories.jsx.map +1 -0
  154. package/lib/core/Configuration/Configuration.stories.d.ts +10 -0
  155. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -0
  156. package/lib/core/Configuration/Configuration.stories.jsx +125 -0
  157. package/lib/core/Configuration/Configuration.stories.jsx.map +1 -0
  158. package/lib/core/Currency/Currency.stories.d.ts +11 -0
  159. package/lib/core/Currency/Currency.stories.d.ts.map +1 -0
  160. package/lib/core/Currency/Currency.stories.jsx +65 -0
  161. package/lib/core/Currency/Currency.stories.jsx.map +1 -0
  162. package/lib/core/DateTime/DateTime.stories.d.ts +20 -0
  163. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -0
  164. package/lib/core/DateTime/DateTime.stories.jsx +127 -0
  165. package/lib/core/DateTime/DateTime.stories.jsx.map +1 -0
  166. package/lib/core/DateTime/DateTimeDisplay.stories.d.ts +7 -0
  167. package/lib/core/DateTime/DateTimeDisplay.stories.d.ts.map +1 -0
  168. package/lib/core/DateTime/DateTimeDisplay.stories.jsx +46 -0
  169. package/lib/core/DateTime/DateTimeDisplay.stories.jsx.map +1 -0
  170. package/lib/core/DateTime/DateTimePicker.stories.d.ts +7 -0
  171. package/lib/core/DateTime/DateTimePicker.stories.d.ts.map +1 -0
  172. package/lib/core/DateTime/DateTimePicker.stories.jsx +34 -0
  173. package/lib/core/DateTime/DateTimePicker.stories.jsx.map +1 -0
  174. package/lib/core/Drawer/Drawer.stories.d.ts +7 -0
  175. package/lib/core/Drawer/Drawer.stories.d.ts.map +1 -0
  176. package/lib/core/Drawer/Drawer.stories.jsx +98 -0
  177. package/lib/core/Drawer/Drawer.stories.jsx.map +1 -0
  178. package/lib/core/Drawer/Drawer.styles.d.ts +2 -0
  179. package/lib/core/Drawer/Drawer.styles.d.ts.map +1 -0
  180. package/lib/core/Drawer/Drawer.styles.js +11 -0
  181. package/lib/core/Drawer/Drawer.styles.js.map +1 -0
  182. package/lib/core/Email/EmailDisplay.stories.d.ts +6 -0
  183. package/lib/core/Email/EmailDisplay.stories.d.ts.map +1 -0
  184. package/lib/core/Email/EmailDisplay.stories.jsx +19 -0
  185. package/lib/core/Email/EmailDisplay.stories.jsx.map +1 -0
  186. package/lib/core/EmojiPicker/EmojiPicker.stories.d.ts +8 -0
  187. package/lib/core/EmojiPicker/EmojiPicker.stories.d.ts.map +1 -0
  188. package/lib/core/EmojiPicker/EmojiPicker.stories.jsx +52 -0
  189. package/lib/core/EmojiPicker/EmojiPicker.stories.jsx.map +1 -0
  190. package/lib/core/EmptyState/EmptyState.stories.d.ts +6 -0
  191. package/lib/core/EmptyState/EmptyState.stories.d.ts.map +1 -0
  192. package/lib/core/EmptyState/EmptyState.stories.jsx +18 -0
  193. package/lib/core/EmptyState/EmptyState.stories.jsx.map +1 -0
  194. package/lib/core/ErrorState/ErrorState.stories.d.ts +9 -0
  195. package/lib/core/ErrorState/ErrorState.stories.d.ts.map +1 -0
  196. package/lib/core/ErrorState/ErrorState.stories.jsx +20 -0
  197. package/lib/core/ErrorState/ErrorState.stories.jsx.map +1 -0
  198. package/lib/core/ExpandCollapse/ExpandCollapse.stories.d.ts +7 -0
  199. package/lib/core/ExpandCollapse/ExpandCollapse.stories.d.ts.map +1 -0
  200. package/lib/core/ExpandCollapse/ExpandCollapse.stories.jsx +73 -0
  201. package/lib/core/ExpandCollapse/ExpandCollapse.stories.jsx.map +1 -0
  202. package/lib/core/ExpandCollapse/ExpandCollapse.styles.d.ts +4 -0
  203. package/lib/core/ExpandCollapse/ExpandCollapse.styles.d.ts.map +1 -0
  204. package/lib/core/ExpandCollapse/ExpandCollapse.styles.js +12 -0
  205. package/lib/core/ExpandCollapse/ExpandCollapse.styles.js.map +1 -0
  206. package/lib/core/FieldGroup/FieldGroup.stories.d.ts +11 -0
  207. package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -0
  208. package/lib/core/FieldGroup/FieldGroup.stories.jsx +52 -0
  209. package/lib/core/FieldGroup/FieldGroup.stories.jsx.map +1 -0
  210. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts +10 -0
  211. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -0
  212. package/lib/core/FieldGroup/FieldGroupList.stories.jsx +183 -0
  213. package/lib/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -0
  214. package/lib/core/FieldValueList/FieldValueList.stories.d.ts +10 -0
  215. package/lib/core/FieldValueList/FieldValueList.stories.d.ts.map +1 -0
  216. package/lib/core/FieldValueList/FieldValueList.stories.jsx +54 -0
  217. package/lib/core/FieldValueList/FieldValueList.stories.jsx.map +1 -0
  218. package/lib/core/File/FileDisplay.stories.d.ts +13 -0
  219. package/lib/core/File/FileDisplay.stories.d.ts.map +1 -0
  220. package/lib/core/File/FileDisplay.stories.jsx +100 -0
  221. package/lib/core/File/FileDisplay.stories.jsx.map +1 -0
  222. package/lib/core/File/FileInput.stories.d.ts +9 -0
  223. package/lib/core/File/FileInput.stories.d.ts.map +1 -0
  224. package/lib/core/File/FileInput.stories.jsx +76 -0
  225. package/lib/core/File/FileInput.stories.jsx.map +1 -0
  226. package/lib/core/Flex/Flex.styles.d.ts +10 -0
  227. package/lib/core/Flex/Flex.styles.d.ts.map +1 -0
  228. package/lib/core/Flex/Flex.styles.js +41 -0
  229. package/lib/core/Flex/Flex.styles.js.map +1 -0
  230. package/lib/core/Flex/FlexContainer.stories.d.ts +20 -0
  231. package/lib/core/Flex/FlexContainer.stories.d.ts.map +1 -0
  232. package/lib/core/Flex/FlexContainer.stories.jsx +151 -0
  233. package/lib/core/Flex/FlexContainer.stories.jsx.map +1 -0
  234. package/lib/core/Flex/FlexItem.stories.d.ts +13 -0
  235. package/lib/core/Flex/FlexItem.stories.d.ts.map +1 -0
  236. package/lib/core/Flex/FlexItem.stories.jsx +71 -0
  237. package/lib/core/Flex/FlexItem.stories.jsx.map +1 -0
  238. package/lib/core/Form/Form.stories.d.ts +21 -0
  239. package/lib/core/Form/Form.stories.d.ts.map +1 -0
  240. package/lib/core/Form/Form.stories.jsx +196 -0
  241. package/lib/core/Form/Form.stories.jsx.map +1 -0
  242. package/lib/core/Grid/Grid.styles.d.ts +6 -0
  243. package/lib/core/Grid/Grid.styles.d.ts.map +1 -0
  244. package/lib/core/Grid/Grid.styles.js +36 -0
  245. package/lib/core/Grid/Grid.styles.js.map +1 -0
  246. package/lib/core/Grid/GridContainer.stories.d.ts +23 -0
  247. package/lib/core/Grid/GridContainer.stories.d.ts.map +1 -0
  248. package/lib/core/Grid/GridContainer.stories.jsx +161 -0
  249. package/lib/core/Grid/GridContainer.stories.jsx.map +1 -0
  250. package/lib/core/Grid/GridItem.stories.d.ts +13 -0
  251. package/lib/core/Grid/GridItem.stories.d.ts.map +1 -0
  252. package/lib/core/Grid/GridItem.stories.jsx +74 -0
  253. package/lib/core/Grid/GridItem.stories.jsx.map +1 -0
  254. package/lib/core/Icon/Icon.stories.d.ts +8 -0
  255. package/lib/core/Icon/Icon.stories.d.ts.map +1 -0
  256. package/lib/core/Icon/Icon.stories.jsx +84 -0
  257. package/lib/core/Icon/Icon.stories.jsx.map +1 -0
  258. package/lib/core/IconPicker/IconPicker.stories.d.ts +6 -0
  259. package/lib/core/IconPicker/IconPicker.stories.d.ts.map +1 -0
  260. package/lib/core/IconPicker/IconPicker.stories.jsx +39 -0
  261. package/lib/core/IconPicker/IconPicker.stories.jsx.map +1 -0
  262. package/lib/core/Image/Image.stories.d.ts +6 -0
  263. package/lib/core/Image/Image.stories.d.ts.map +1 -0
  264. package/lib/core/Image/Image.stories.jsx +9 -0
  265. package/lib/core/Image/Image.stories.jsx.map +1 -0
  266. package/lib/core/Input/Input.stories.d.ts +9 -0
  267. package/lib/core/Input/Input.stories.d.ts.map +1 -0
  268. package/lib/core/Input/Input.stories.jsx +44 -0
  269. package/lib/core/Input/Input.stories.jsx.map +1 -0
  270. package/lib/core/Label/Label.stories.d.ts +6 -0
  271. package/lib/core/Label/Label.stories.d.ts.map +1 -0
  272. package/lib/core/Label/Label.stories.jsx +15 -0
  273. package/lib/core/Label/Label.stories.jsx.map +1 -0
  274. package/lib/core/Lightbox/Lightbox.stories.d.ts +9 -0
  275. package/lib/core/Lightbox/Lightbox.stories.d.ts.map +1 -0
  276. package/lib/core/Lightbox/Lightbox.stories.jsx +106 -0
  277. package/lib/core/Lightbox/Lightbox.stories.jsx.map +1 -0
  278. package/lib/core/Link/Link.stories.d.ts +8 -0
  279. package/lib/core/Link/Link.stories.d.ts.map +1 -0
  280. package/lib/core/Link/Link.stories.jsx +32 -0
  281. package/lib/core/Link/Link.stories.jsx.map +1 -0
  282. package/lib/core/List/CommaSeparatedList.stories.d.ts +6 -0
  283. package/lib/core/List/CommaSeparatedList.stories.d.ts.map +1 -0
  284. package/lib/core/List/CommaSeparatedList.stories.jsx +33 -0
  285. package/lib/core/List/CommaSeparatedList.stories.jsx.map +1 -0
  286. package/lib/core/List/OrderedList.stories.d.ts +10 -0
  287. package/lib/core/List/OrderedList.stories.d.ts.map +1 -0
  288. package/lib/core/List/OrderedList.stories.jsx +38 -0
  289. package/lib/core/List/OrderedList.stories.jsx.map +1 -0
  290. package/lib/core/List/UnorderedList.stories.d.ts +10 -0
  291. package/lib/core/List/UnorderedList.stories.d.ts.map +1 -0
  292. package/lib/core/List/UnorderedList.stories.jsx +38 -0
  293. package/lib/core/List/UnorderedList.stories.jsx.map +1 -0
  294. package/lib/core/Location/Location.stories.d.ts +12 -0
  295. package/lib/core/Location/Location.stories.d.ts.map +1 -0
  296. package/lib/core/Location/Location.stories.jsx +130 -0
  297. package/lib/core/Location/Location.stories.jsx.map +1 -0
  298. package/lib/core/Menu/Menu.mocks.d.ts +4 -0
  299. package/lib/core/Menu/Menu.mocks.d.ts.map +1 -0
  300. package/lib/core/Menu/Menu.mocks.js +179 -0
  301. package/lib/core/Menu/Menu.mocks.js.map +1 -0
  302. package/lib/core/Menu/Menu.stories.d.ts +17 -0
  303. package/lib/core/Menu/Menu.stories.d.ts.map +1 -0
  304. package/lib/core/Menu/Menu.stories.jsx +166 -0
  305. package/lib/core/Menu/Menu.stories.jsx.map +1 -0
  306. package/lib/core/Menu/Menu.styles.d.ts +2 -0
  307. package/lib/core/Menu/Menu.styles.d.ts.map +1 -0
  308. package/lib/core/Menu/Menu.styles.js +6 -0
  309. package/lib/core/Menu/Menu.styles.js.map +1 -0
  310. package/lib/core/MenuButton/MenuButton.stories.d.ts +15 -0
  311. package/lib/core/MenuButton/MenuButton.stories.d.ts.map +1 -0
  312. package/lib/core/MenuButton/MenuButton.stories.jsx +188 -0
  313. package/lib/core/MenuButton/MenuButton.stories.jsx.map +1 -0
  314. package/lib/core/MetaList/MetaList.stories.d.ts +9 -0
  315. package/lib/core/MetaList/MetaList.stories.d.ts.map +1 -0
  316. package/lib/core/MetaList/MetaList.stories.jsx +24 -0
  317. package/lib/core/MetaList/MetaList.stories.jsx.map +1 -0
  318. package/lib/core/Modal/Modal.mocks.d.ts +4 -0
  319. package/lib/core/Modal/Modal.mocks.d.ts.map +1 -0
  320. package/lib/core/Modal/Modal.mocks.jsx +44 -0
  321. package/lib/core/Modal/Modal.mocks.jsx.map +1 -0
  322. package/lib/core/Modal/Modal.stories.d.ts +20 -0
  323. package/lib/core/Modal/Modal.stories.d.ts.map +1 -0
  324. package/lib/core/Modal/Modal.stories.jsx +305 -0
  325. package/lib/core/Modal/Modal.stories.jsx.map +1 -0
  326. package/lib/core/MultiStep/MultiStep.stories.d.ts +6 -0
  327. package/lib/core/MultiStep/MultiStep.stories.d.ts.map +1 -0
  328. package/lib/core/MultiStep/MultiStep.stories.jsx +56 -0
  329. package/lib/core/MultiStep/MultiStep.stories.jsx.map +1 -0
  330. package/lib/core/Number/Number.stories.d.ts +13 -0
  331. package/lib/core/Number/Number.stories.d.ts.map +1 -0
  332. package/lib/core/Number/Number.stories.jsx +110 -0
  333. package/lib/core/Number/Number.stories.jsx.map +1 -0
  334. package/lib/core/PageTemplates/PageTemplates.mocks.d.ts +3 -0
  335. package/lib/core/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  336. package/lib/core/PageTemplates/PageTemplates.mocks.js +10 -0
  337. package/lib/core/PageTemplates/PageTemplates.mocks.js.map +1 -0
  338. package/lib/core/PageTemplates/PageTemplates.stories.d.ts +28 -0
  339. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -0
  340. package/lib/core/PageTemplates/PageTemplates.stories.jsx +233 -0
  341. package/lib/core/PageTemplates/PageTemplates.stories.jsx.map +1 -0
  342. package/lib/core/PageTemplates/PageTemplates.styles.d.ts +4 -0
  343. package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -0
  344. package/lib/core/PageTemplates/PageTemplates.styles.js +31 -0
  345. package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -0
  346. package/lib/core/Pagination/Pagination.stories.d.ts +6 -0
  347. package/lib/core/Pagination/Pagination.stories.d.ts.map +1 -0
  348. package/lib/core/Pagination/Pagination.stories.jsx +19 -0
  349. package/lib/core/Pagination/Pagination.stories.jsx.map +1 -0
  350. package/lib/core/Paragraph/ParagraphDisplay.stories.d.ts +6 -0
  351. package/lib/core/Paragraph/ParagraphDisplay.stories.d.ts.map +1 -0
  352. package/lib/core/Paragraph/ParagraphDisplay.stories.jsx +12 -0
  353. package/lib/core/Paragraph/ParagraphDisplay.stories.jsx.map +1 -0
  354. package/lib/core/Phone/Phone.stories.d.ts +7 -0
  355. package/lib/core/Phone/Phone.stories.d.ts.map +1 -0
  356. package/lib/core/Phone/Phone.stories.jsx +42 -0
  357. package/lib/core/Phone/Phone.stories.jsx.map +1 -0
  358. package/lib/core/Popover/Popover.stories.d.ts +8 -0
  359. package/lib/core/Popover/Popover.stories.d.ts.map +1 -0
  360. package/lib/core/Popover/Popover.stories.jsx +184 -0
  361. package/lib/core/Popover/Popover.stories.jsx.map +1 -0
  362. package/lib/core/Progress/Progress.stories.d.ts +7 -0
  363. package/lib/core/Progress/Progress.stories.d.ts.map +1 -0
  364. package/lib/core/Progress/Progress.stories.jsx +71 -0
  365. package/lib/core/Progress/Progress.stories.jsx.map +1 -0
  366. package/lib/core/Progress/Progress.styles.d.ts +2 -0
  367. package/lib/core/Progress/Progress.styles.d.ts.map +1 -0
  368. package/lib/core/Progress/Progress.styles.js +13 -0
  369. package/lib/core/Progress/Progress.styles.js.map +1 -0
  370. package/lib/core/RadioButton/RadioButton.stories.d.ts +7 -0
  371. package/lib/core/RadioButton/RadioButton.stories.d.ts.map +1 -0
  372. package/lib/core/RadioButton/RadioButton.stories.jsx +26 -0
  373. package/lib/core/RadioButton/RadioButton.stories.jsx.map +1 -0
  374. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +7 -0
  375. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -0
  376. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.jsx +62 -0
  377. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.jsx.map +1 -0
  378. package/lib/core/RadioButtonGroup/RadioButtonGroup.styles.d.ts +4 -0
  379. package/lib/core/RadioButtonGroup/RadioButtonGroup.styles.d.ts.map +1 -0
  380. package/lib/core/RadioButtonGroup/RadioButtonGroup.styles.js +9 -0
  381. package/lib/core/RadioButtonGroup/RadioButtonGroup.styles.js.map +1 -0
  382. package/lib/core/Rating/Rating.stories.d.ts +6 -0
  383. package/lib/core/Rating/Rating.stories.d.ts.map +1 -0
  384. package/lib/core/Rating/Rating.stories.jsx +21 -0
  385. package/lib/core/Rating/Rating.stories.jsx.map +1 -0
  386. package/lib/core/SearchInput/SearchInput.stories.d.ts +6 -0
  387. package/lib/core/SearchInput/SearchInput.stories.d.ts.map +1 -0
  388. package/lib/core/SearchInput/SearchInput.stories.jsx +15 -0
  389. package/lib/core/SearchInput/SearchInput.stories.jsx.map +1 -0
  390. package/lib/core/Select/Select.stories.d.ts +9 -0
  391. package/lib/core/Select/Select.stories.d.ts.map +1 -0
  392. package/lib/core/Select/Select.stories.jsx +42 -0
  393. package/lib/core/Select/Select.stories.jsx.map +1 -0
  394. package/lib/core/Sentiment/Sentiment.stories.d.ts +14 -0
  395. package/lib/core/Sentiment/Sentiment.stories.d.ts.map +1 -0
  396. package/lib/core/Sentiment/Sentiment.stories.jsx +39 -0
  397. package/lib/core/Sentiment/Sentiment.stories.jsx.map +1 -0
  398. package/lib/core/Slider/Slider.stories.d.ts +11 -0
  399. package/lib/core/Slider/Slider.stories.d.ts.map +1 -0
  400. package/lib/core/Slider/Slider.stories.jsx +58 -0
  401. package/lib/core/Slider/Slider.stories.jsx.map +1 -0
  402. package/lib/core/SummaryItem/SummaryItem.stories.d.ts +11 -0
  403. package/lib/core/SummaryItem/SummaryItem.stories.d.ts.map +1 -0
  404. package/lib/core/SummaryItem/SummaryItem.stories.jsx +36 -0
  405. package/lib/core/SummaryItem/SummaryItem.stories.jsx.map +1 -0
  406. package/lib/core/SummaryList/SummaryList.mocks.d.ts +32 -0
  407. package/lib/core/SummaryList/SummaryList.mocks.d.ts.map +1 -0
  408. package/lib/core/SummaryList/SummaryList.mocks.jsx +35 -0
  409. package/lib/core/SummaryList/SummaryList.mocks.jsx.map +1 -0
  410. package/lib/core/SummaryList/SummaryList.stories.d.ts +13 -0
  411. package/lib/core/SummaryList/SummaryList.stories.d.ts.map +1 -0
  412. package/lib/core/SummaryList/SummaryList.stories.jsx +131 -0
  413. package/lib/core/SummaryList/SummaryList.stories.jsx.map +1 -0
  414. package/lib/core/Switch/Switch.stories.d.ts +7 -0
  415. package/lib/core/Switch/Switch.stories.d.ts.map +1 -0
  416. package/lib/core/Switch/Switch.stories.jsx +26 -0
  417. package/lib/core/Switch/Switch.stories.jsx.map +1 -0
  418. package/lib/core/Switch/Switch.styles.d.ts +2 -0
  419. package/lib/core/Switch/Switch.styles.d.ts.map +1 -0
  420. package/lib/core/Switch/Switch.styles.js +13 -0
  421. package/lib/core/Switch/Switch.styles.js.map +1 -0
  422. package/lib/core/Table/Table.mocks.d.ts +19 -0
  423. package/lib/core/Table/Table.mocks.d.ts.map +1 -0
  424. package/lib/core/Table/Table.mocks.jsx +32 -0
  425. package/lib/core/Table/Table.mocks.jsx.map +1 -0
  426. package/lib/core/Table/Table.stories.d.ts +14 -0
  427. package/lib/core/Table/Table.stories.d.ts.map +1 -0
  428. package/lib/core/Table/Table.stories.jsx +58 -0
  429. package/lib/core/Table/Table.stories.jsx.map +1 -0
  430. package/lib/core/Table/Table.styles.d.ts +4 -0
  431. package/lib/core/Table/Table.styles.d.ts.map +1 -0
  432. package/lib/core/Table/Table.styles.js +9 -0
  433. package/lib/core/Table/Table.styles.js.map +1 -0
  434. package/lib/core/Tabs/Tabs.stories.d.ts +7 -0
  435. package/lib/core/Tabs/Tabs.stories.d.ts.map +1 -0
  436. package/lib/core/Tabs/Tabs.stories.jsx +59 -0
  437. package/lib/core/Tabs/Tabs.stories.jsx.map +1 -0
  438. package/lib/core/Text/Text.stories.d.ts +6 -0
  439. package/lib/core/Text/Text.stories.d.ts.map +1 -0
  440. package/lib/core/Text/Text.stories.jsx +22 -0
  441. package/lib/core/Text/Text.stories.jsx.map +1 -0
  442. package/lib/core/TextArea/TextArea.stories.d.ts +6 -0
  443. package/lib/core/TextArea/TextArea.stories.d.ts.map +1 -0
  444. package/lib/core/TextArea/TextArea.stories.jsx +43 -0
  445. package/lib/core/TextArea/TextArea.stories.jsx.map +1 -0
  446. package/lib/core/Toaster/Toaster.stories.d.ts +6 -0
  447. package/lib/core/Toaster/Toaster.stories.d.ts.map +1 -0
  448. package/lib/core/Toaster/Toaster.stories.jsx +17 -0
  449. package/lib/core/Toaster/Toaster.stories.jsx.map +1 -0
  450. package/lib/core/Tooltip/Tooltip.stories.d.ts +8 -0
  451. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -0
  452. package/lib/core/Tooltip/Tooltip.stories.jsx +18 -0
  453. package/lib/core/Tooltip/Tooltip.stories.jsx.map +1 -0
  454. package/lib/core/Tree/Tree.mocks.d.ts +2 -0
  455. package/lib/core/Tree/Tree.mocks.d.ts.map +1 -0
  456. package/lib/core/Tree/Tree.mocks.js +20 -0
  457. package/lib/core/Tree/Tree.mocks.js.map +1 -0
  458. package/lib/core/Tree/Tree.stories.d.ts +8 -0
  459. package/lib/core/Tree/Tree.stories.d.ts.map +1 -0
  460. package/lib/core/Tree/Tree.stories.jsx +89 -0
  461. package/lib/core/Tree/Tree.stories.jsx.map +1 -0
  462. package/lib/core/Tree/Tree.styles.d.ts +3 -0
  463. package/lib/core/Tree/Tree.styles.d.ts.map +1 -0
  464. package/lib/core/Tree/Tree.styles.js +10 -0
  465. package/lib/core/Tree/Tree.styles.js.map +1 -0
  466. package/lib/core/URL/URL.stories.d.ts +6 -0
  467. package/lib/core/URL/URL.stories.d.ts.map +1 -0
  468. package/lib/core/URL/URL.stories.jsx +17 -0
  469. package/lib/core/URL/URL.stories.jsx.map +1 -0
  470. package/lib/cs/Article/Article.mocks.d.ts +14 -0
  471. package/lib/cs/Article/Article.mocks.d.ts.map +1 -0
  472. package/lib/cs/Article/Article.mocks.js +14 -0
  473. package/lib/cs/Article/Article.mocks.js.map +1 -0
  474. package/lib/cs/Article/Article.stories.d.ts +15 -0
  475. package/lib/cs/Article/Article.stories.d.ts.map +1 -0
  476. package/lib/cs/Article/Article.stories.jsx +126 -0
  477. package/lib/cs/Article/Article.stories.jsx.map +1 -0
  478. package/lib/cs/ArticleList/ArticleList.mocks.d.ts +21 -0
  479. package/lib/cs/ArticleList/ArticleList.mocks.d.ts.map +1 -0
  480. package/lib/cs/ArticleList/ArticleList.mocks.js +102 -0
  481. package/lib/cs/ArticleList/ArticleList.mocks.js.map +1 -0
  482. package/lib/cs/ArticleList/ArticleList.stories.d.ts +16 -0
  483. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -0
  484. package/lib/cs/ArticleList/ArticleList.stories.jsx +110 -0
  485. package/lib/cs/ArticleList/ArticleList.stories.jsx.map +1 -0
  486. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +45 -0
  487. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -0
  488. package/lib/cs/CSCaseView/CSAppShell.stories.jsx +275 -0
  489. package/lib/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -0
  490. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +57 -0
  491. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -0
  492. package/lib/cs/CSCaseView/CSCaseView.mocks.js +224 -0
  493. package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -0
  494. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts +16 -0
  495. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +1 -0
  496. package/lib/cs/CallControlPanel/CallControlPanel.mocks.js +110 -0
  497. package/lib/cs/CallControlPanel/CallControlPanel.mocks.js.map +1 -0
  498. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +13 -0
  499. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -0
  500. package/lib/cs/CallControlPanel/CallControlPanel.stories.jsx +188 -0
  501. package/lib/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -0
  502. package/lib/cs/DialPad/DialPad.stories.d.ts +9 -0
  503. package/lib/cs/DialPad/DialPad.stories.d.ts.map +1 -0
  504. package/lib/cs/DialPad/DialPad.stories.jsx +18 -0
  505. package/lib/cs/DialPad/DialPad.stories.jsx.map +1 -0
  506. package/lib/cs/DialPad/DialPadKeyboardData.mock.d.ts +11 -0
  507. package/lib/cs/DialPad/DialPadKeyboardData.mock.d.ts.map +1 -0
  508. package/lib/cs/DialPad/DialPadKeyboardData.mock.js +20 -0
  509. package/lib/cs/DialPad/DialPadKeyboardData.mock.js.map +1 -0
  510. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +13 -0
  511. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -0
  512. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +356 -0
  513. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -0
  514. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +8 -0
  515. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -0
  516. package/lib/cs/InteractionNotification/InteractionNotification.stories.jsx +32 -0
  517. package/lib/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -0
  518. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +14 -0
  519. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -0
  520. package/lib/cs/InteractionTimer/InteractionTimer.stories.jsx +85 -0
  521. package/lib/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -0
  522. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +13 -0
  523. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -0
  524. package/lib/cs/TaskManager/TaskManager.mocks.js +140 -0
  525. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -0
  526. package/lib/cs/TaskManager/TaskManager.stories.d.ts +8 -0
  527. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -0
  528. package/lib/cs/TaskManager/TaskManager.stories.jsx +314 -0
  529. package/lib/cs/TaskManager/TaskManager.stories.jsx.map +1 -0
  530. package/lib/dnd/DragDropList/DragDropList.stories.d.ts +11 -0
  531. package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -0
  532. package/lib/dnd/DragDropList/DragDropList.stories.jsx +119 -0
  533. package/lib/dnd/DragDropList/DragDropList.stories.jsx.map +1 -0
  534. package/lib/rte/RichTextEditor/RichTextEditor.mocks.d.ts +3 -0
  535. package/lib/rte/RichTextEditor/RichTextEditor.mocks.d.ts.map +1 -0
  536. package/lib/rte/RichTextEditor/RichTextEditor.mocks.jsx +34 -0
  537. package/lib/rte/RichTextEditor/RichTextEditor.mocks.jsx.map +1 -0
  538. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +10 -0
  539. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -0
  540. package/lib/rte/RichTextEditor/RichTextEditor.stories.jsx +145 -0
  541. package/lib/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -0
  542. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts +7 -0
  543. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -0
  544. package/lib/rte/RichTextEditor/RichTextViewer.stories.jsx +62 -0
  545. package/lib/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -0
  546. package/lib/social/Chat/Chat.mocks.d.ts +385 -0
  547. package/lib/social/Chat/Chat.mocks.d.ts.map +1 -0
  548. package/lib/social/Chat/Chat.mocks.js +648 -0
  549. package/lib/social/Chat/Chat.mocks.js.map +1 -0
  550. package/lib/social/Chat/Chat.stories.d.ts +25 -0
  551. package/lib/social/Chat/Chat.stories.d.ts.map +1 -0
  552. package/lib/social/Chat/Chat.stories.jsx +537 -0
  553. package/lib/social/Chat/Chat.stories.jsx.map +1 -0
  554. package/lib/social/Chat/RepeatingView.stories.d.ts +20 -0
  555. package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -0
  556. package/lib/social/Chat/RepeatingView.stories.jsx +90 -0
  557. package/lib/social/Chat/RepeatingView.stories.jsx.map +1 -0
  558. package/lib/social/Email/Email.mocks.d.ts +87 -0
  559. package/lib/social/Email/Email.mocks.d.ts.map +1 -0
  560. package/lib/social/Email/Email.mocks.jsx +349 -0
  561. package/lib/social/Email/Email.mocks.jsx.map +1 -0
  562. package/lib/social/Email/Email.stories.d.ts +28 -0
  563. package/lib/social/Email/Email.stories.d.ts.map +1 -0
  564. package/lib/social/Email/Email.stories.jsx +798 -0
  565. package/lib/social/Email/Email.stories.jsx.map +1 -0
  566. package/lib/social/Feed/Feed.mocks.d.ts +52 -0
  567. package/lib/social/Feed/Feed.mocks.d.ts.map +1 -0
  568. package/lib/social/Feed/Feed.mocks.jsx +315 -0
  569. package/lib/social/Feed/Feed.mocks.jsx.map +1 -0
  570. package/lib/social/Feed/Feed.stories.d.ts +15 -0
  571. package/lib/social/Feed/Feed.stories.d.ts.map +1 -0
  572. package/lib/social/Feed/Feed.stories.jsx +146 -0
  573. package/lib/social/Feed/Feed.stories.jsx.map +1 -0
  574. package/lib/social/Feed/FeedNewPost.stories.d.ts +17 -0
  575. package/lib/social/Feed/FeedNewPost.stories.d.ts.map +1 -0
  576. package/lib/social/Feed/FeedNewPost.stories.jsx +80 -0
  577. package/lib/social/Feed/FeedNewPost.stories.jsx.map +1 -0
  578. package/lib/social/Feed/FeedPost.stories.d.ts +9 -0
  579. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -0
  580. package/lib/social/Feed/FeedPost.stories.jsx +248 -0
  581. package/lib/social/Feed/FeedPost.stories.jsx.map +1 -0
  582. package/lib/social/Feed/FeedReply.stories.d.ts +16 -0
  583. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -0
  584. package/lib/social/Feed/FeedReply.stories.jsx +99 -0
  585. package/lib/social/Feed/FeedReply.stories.jsx.map +1 -0
  586. package/lib/social/Feed/FeedReplyInput.stories.d.ts +15 -0
  587. package/lib/social/Feed/FeedReplyInput.stories.d.ts.map +1 -0
  588. package/lib/social/Feed/FeedReplyInput.stories.jsx +59 -0
  589. package/lib/social/Feed/FeedReplyInput.stories.jsx.map +1 -0
  590. package/lib/work/AppAnnouncement/AppAnnouncement.stories.d.ts +6 -0
  591. package/lib/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -0
  592. package/lib/work/AppAnnouncement/AppAnnouncement.stories.jsx +30 -0
  593. package/lib/work/AppAnnouncement/AppAnnouncement.stories.jsx.map +1 -0
  594. package/lib/work/CaseView/Attachments.mocks.d.ts +3 -0
  595. package/lib/work/CaseView/Attachments.mocks.d.ts.map +1 -0
  596. package/lib/work/CaseView/Attachments.mocks.jsx +388 -0
  597. package/lib/work/CaseView/Attachments.mocks.jsx.map +1 -0
  598. package/lib/work/CaseView/CaseView.mocks.d.ts +11 -0
  599. package/lib/work/CaseView/CaseView.mocks.d.ts.map +1 -0
  600. package/lib/work/CaseView/CaseView.mocks.jsx +126 -0
  601. package/lib/work/CaseView/CaseView.mocks.jsx.map +1 -0
  602. package/lib/work/CaseView/CaseView.stories.d.ts +34 -0
  603. package/lib/work/CaseView/CaseView.stories.d.ts.map +1 -0
  604. package/lib/work/CaseView/CaseView.stories.jsx +264 -0
  605. package/lib/work/CaseView/CaseView.stories.jsx.map +1 -0
  606. package/lib/work/CaseView/Details.mocks.d.ts +3 -0
  607. package/lib/work/CaseView/Details.mocks.d.ts.map +1 -0
  608. package/lib/work/CaseView/Details.mocks.jsx +21 -0
  609. package/lib/work/CaseView/Details.mocks.jsx.map +1 -0
  610. package/lib/work/CaseView/FileService.mock.d.ts +28 -0
  611. package/lib/work/CaseView/FileService.mock.d.ts.map +1 -0
  612. package/lib/work/CaseView/FileService.mock.jsx +139 -0
  613. package/lib/work/CaseView/FileService.mock.jsx.map +1 -0
  614. package/lib/work/CaseView/MobileCaseView.stories.d.ts +11 -0
  615. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -0
  616. package/lib/work/CaseView/MobileCaseView.stories.jsx +27 -0
  617. package/lib/work/CaseView/MobileCaseView.stories.jsx.map +1 -0
  618. package/lib/work/CaseView/Pulse.mocks.d.ts +6 -0
  619. package/lib/work/CaseView/Pulse.mocks.d.ts.map +1 -0
  620. package/lib/work/CaseView/Pulse.mocks.jsx +35 -0
  621. package/lib/work/CaseView/Pulse.mocks.jsx.map +1 -0
  622. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +10 -0
  623. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -0
  624. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +195 -0
  625. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -0
  626. package/lib/work/Confirmation/Confirmation.stories.d.ts +9 -0
  627. package/lib/work/Confirmation/Confirmation.stories.d.ts.map +1 -0
  628. package/lib/work/Confirmation/Confirmation.stories.jsx +17 -0
  629. package/lib/work/Confirmation/Confirmation.stories.jsx.map +1 -0
  630. package/lib/work/Details/Details.stories.d.ts +5 -0
  631. package/lib/work/Details/Details.stories.d.ts.map +1 -0
  632. package/lib/work/Details/Details.stories.jsx +65 -0
  633. package/lib/work/Details/Details.stories.jsx.map +1 -0
  634. package/lib/work/Glimpse/Glimpse.stories.d.ts +10 -0
  635. package/lib/work/Glimpse/Glimpse.stories.d.ts.map +1 -0
  636. package/lib/work/Glimpse/Glimpse.stories.jsx +39 -0
  637. package/lib/work/Glimpse/Glimpse.stories.jsx.map +1 -0
  638. package/lib/work/SearchResults/SearchResults.mocks.d.ts +8 -0
  639. package/lib/work/SearchResults/SearchResults.mocks.d.ts.map +1 -0
  640. package/lib/work/SearchResults/SearchResults.mocks.jsx +96 -0
  641. package/lib/work/SearchResults/SearchResults.mocks.jsx.map +1 -0
  642. package/lib/work/SearchResults/SearchResults.stories.d.ts +8 -0
  643. package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -0
  644. package/lib/work/SearchResults/SearchResults.stories.jsx +205 -0
  645. package/lib/work/SearchResults/SearchResults.stories.jsx.map +1 -0
  646. package/lib/work/Stages/Stages.stories.d.ts +11 -0
  647. package/lib/work/Stages/Stages.stories.d.ts.map +1 -0
  648. package/lib/work/Stages/Stages.stories.jsx +65 -0
  649. package/lib/work/Stages/Stages.stories.jsx.map +1 -0
  650. package/lib/work/Stakeholders/Stakeholders.stories.d.ts +9 -0
  651. package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -0
  652. package/lib/work/Stakeholders/Stakeholders.stories.jsx +118 -0
  653. package/lib/work/Stakeholders/Stakeholders.stories.jsx.map +1 -0
  654. package/lib/work/Tags/Tags.mocks.d.ts +3 -0
  655. package/lib/work/Tags/Tags.mocks.d.ts.map +1 -0
  656. package/lib/work/Tags/Tags.mocks.js +76 -0
  657. package/lib/work/Tags/Tags.mocks.js.map +1 -0
  658. package/lib/work/Tags/Tags.stories.d.ts +10 -0
  659. package/lib/work/Tags/Tags.stories.d.ts.map +1 -0
  660. package/lib/work/Tags/Tags.stories.jsx +61 -0
  661. package/lib/work/Tags/Tags.stories.jsx.map +1 -0
  662. package/lib/work/Tasks/TaskList.stories.d.ts +5 -0
  663. package/lib/work/Tasks/TaskList.stories.d.ts.map +1 -0
  664. package/lib/work/Tasks/TaskList.stories.jsx +17 -0
  665. package/lib/work/Tasks/TaskList.stories.jsx.map +1 -0
  666. package/lib/work/Tasks/Tasks.stories.d.ts +9 -0
  667. package/lib/work/Tasks/Tasks.stories.d.ts.map +1 -0
  668. package/lib/work/Tasks/Tasks.stories.jsx +101 -0
  669. package/lib/work/Tasks/Tasks.stories.jsx.map +1 -0
  670. package/lib/work/Timeline/Timeline.mocks.d.ts +3 -0
  671. package/lib/work/Timeline/Timeline.mocks.d.ts.map +1 -0
  672. package/lib/work/Timeline/Timeline.mocks.jsx +129 -0
  673. package/lib/work/Timeline/Timeline.mocks.jsx.map +1 -0
  674. package/lib/work/Timeline/Timeline.stories.d.ts +7 -0
  675. package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -0
  676. package/lib/work/Timeline/Timeline.stories.jsx +43 -0
  677. package/lib/work/Timeline/Timeline.stories.jsx.map +1 -0
  678. package/package.json +47 -0
@@ -0,0 +1,99 @@
1
+ import { useState } from 'react';
2
+ import { Avatar, CardContent, Popover, useUID } from '@pega/cosmos-react-core';
3
+ import { Feed, FeedReply, HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';
4
+ import { Glimpse } from '@pega/cosmos-react-work';
5
+ import { generatedLikes, userMentions } from './Feed.mocks';
6
+ export default {
7
+ title: 'Social/Feed/FeedReply',
8
+ component: FeedReply
9
+ };
10
+ export const FeedReplyDemo = ({ fullname = 'Katie Smith', username = 'katie_smith', content, attachments, timeElapsed: time, userStatus, renderFeed = true }) => {
11
+ const defaultContent = attachments
12
+ ? ''
13
+ : 'This reply mentions @deans:Seth DeAngelo:user: and also contains a tag! #cosmos:';
14
+ const key = useUID();
15
+ const [likes, setLikes] = useState([]);
16
+ const [liked, setLiked] = useState(false);
17
+ const [likeCount, setLikeCount] = useState(renderFeed ? generatedLikes.length : 0);
18
+ const [replyContent, setReplyContent] = useState(content || defaultContent);
19
+ const [edited, setEdited] = useState(false);
20
+ const [timeElapsed, setTimeElapsed] = useState(time || '3 days ago');
21
+ const [popoverOpen, setPopoverOpen] = useState(false);
22
+ const [popoverTarget, setPopoverTarget] = useState();
23
+ const [additionalLikeAdded, setAdditionalLikeAdded] = useState(false);
24
+ const getInitialLikes = () => {
25
+ if (likes.length)
26
+ return;
27
+ setLikes(renderFeed ? generatedLikes : []);
28
+ };
29
+ const generateNewLike = () => {
30
+ setTimeout(() => {
31
+ setLikes(oldLikes => [
32
+ ...oldLikes,
33
+ {
34
+ primary: 'Generated Like',
35
+ secondary: ['This like was added after the onLoadMore callback triggered'],
36
+ visual: <Avatar size='l' name='Generated Like'/>,
37
+ id: 'generatedLike'
38
+ }
39
+ ]);
40
+ setAdditionalLikeAdded(true);
41
+ }, 1000);
42
+ };
43
+ const onMentionClick = ({ id, type }) => {
44
+ if (type === 'user') {
45
+ const user = userMentions.find(mention => mention.id === id);
46
+ if (user)
47
+ return <Glimpse {...user}/>;
48
+ }
49
+ };
50
+ const reply = (<>
51
+ <FeedReply id={key} key={key} info={{
52
+ timeElapsed,
53
+ content: replyContent,
54
+ attachments,
55
+ username,
56
+ fullname,
57
+ fullnameLabel: `${fullname}'s Profile`,
58
+ liked,
59
+ userStatus
60
+ }} interactionInfo={{
61
+ likes,
62
+ likeCount: likeCount >= 10 ? likeCount + 1 : likeCount,
63
+ likeLabel: 'Like',
64
+ commentLabel: 'Comment'
65
+ }} maxContentHeight={40} menuItems={[{ primary: 'Custom action', id: 'custom', onClick: () => { } }]} onEditSubmit={({ value }) => {
66
+ setReplyContent(value);
67
+ setEdited(true);
68
+ setTimeElapsed('Just now');
69
+ }} edited={edited} onCommentClick={() => { }} onLikeClick={({ user }) => {
70
+ const userLikedIndex = likes.findIndex(x => x.id === user.id);
71
+ if (userLikedIndex !== -1) {
72
+ setLikes(oldLikes => {
73
+ const oldLikesArr = [...oldLikes];
74
+ oldLikesArr.splice(userLikedIndex, 1);
75
+ return oldLikesArr;
76
+ });
77
+ setLikeCount(curr => curr - 1);
78
+ }
79
+ else {
80
+ setLikes(oldLikes => [user, ...oldLikes]);
81
+ setLikeCount(curr => curr + 1);
82
+ }
83
+ setLiked(curr => !curr);
84
+ }} onLikeCountInteraction={getInitialLikes} onLoadMoreLikes={!additionalLikeAdded ? generateNewLike : undefined} onUserClick={(_, clickEvent) => {
85
+ if (clickEvent) {
86
+ setPopoverTarget(clickEvent.target);
87
+ setPopoverOpen(curr => !curr);
88
+ }
89
+ }}/>
90
+ {popoverTarget && (<Popover show={popoverOpen} target={popoverTarget} placement='bottom' portal>
91
+ <CardContent>{fullname}</CardContent>
92
+ </Popover>)}
93
+ </>);
94
+ return renderFeed ? (<Feed onMentionClick={onMentionClick} interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]} userInfo={{ username: 'demo_user', fullname: 'Demo User' }} posts={[reply]}/>) : (reply);
95
+ };
96
+ export const FeedReplyWithPresence = () => {
97
+ return <FeedReplyDemo userStatus='active'/>;
98
+ };
99
+ //# sourceMappingURL=FeedReply.stories.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedReply.stories.jsx","sourceRoot":"","sources":["../../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C,IAAI,CACH,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,oBAAoB,CAAC,CAAC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CACjE,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAC3D,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EACf,CACH,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAG,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState } from 'react';\n\nimport { Avatar, CardContent, Popover, SummaryListItem, useUID } from '@pega/cosmos-react-core';\nimport {\n Feed,\n FeedReply,\n FeedReplyProps,\n HashtagButtonConfig,\n MentionButtonConfig\n} from '@pega/cosmos-react-social';\nimport { Glimpse } from '@pega/cosmos-react-work';\n\nimport { generatedLikes, userMentions } from './Feed.mocks';\n\nexport default {\n title: 'Social/Feed/FeedReply',\n component: FeedReply\n} as Meta;\n\nexport const FeedReplyDemo = ({\n fullname = 'Katie Smith',\n username = 'katie_smith',\n content,\n attachments,\n timeElapsed: time,\n userStatus,\n renderFeed = true\n}: {\n fullname?: FeedReplyProps['info']['fullname'];\n username?: FeedReplyProps['info']['username'];\n content?: FeedReplyProps['info']['content'];\n attachments?: FeedReplyProps['info']['attachments'];\n timeElapsed?: FeedReplyProps['info']['timeElapsed'];\n userStatus?: FeedReplyProps['info']['userStatus'];\n renderFeed?: boolean;\n}) => {\n const defaultContent = attachments\n ? ''\n : 'This reply mentions @deans:Seth DeAngelo:user: and also contains a tag! #cosmos:';\n\n const key = useUID();\n const [likes, setLikes] = useState<SummaryListItem[]>([]);\n const [liked, setLiked] = useState(false);\n const [likeCount, setLikeCount] = useState(renderFeed ? generatedLikes.length : 0);\n const [replyContent, setReplyContent] = useState(content || defaultContent);\n const [edited, setEdited] = useState(false);\n const [timeElapsed, setTimeElapsed] = useState(time || '3 days ago');\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [popoverTarget, setPopoverTarget] = useState<Element>();\n const [additionalLikeAdded, setAdditionalLikeAdded] = useState(false);\n\n const getInitialLikes = () => {\n if (likes.length) return;\n\n setLikes(renderFeed ? generatedLikes : []);\n };\n\n const generateNewLike = () => {\n setTimeout(() => {\n setLikes(oldLikes => [\n ...oldLikes,\n {\n primary: 'Generated Like',\n secondary: ['This like was added after the onLoadMore callback triggered'],\n visual: <Avatar size='l' name='Generated Like' />,\n id: 'generatedLike'\n }\n ]);\n setAdditionalLikeAdded(true);\n }, 1000);\n };\n\n const onMentionClick = ({ id, type }: { id: string; type: string }) => {\n if (type === 'user') {\n const user = userMentions.find(mention => mention.id === id);\n if (user) return <Glimpse {...user} />;\n }\n };\n\n const reply = (\n <>\n <FeedReply\n id={key}\n key={key}\n info={{\n timeElapsed,\n content: replyContent,\n attachments,\n username,\n fullname,\n fullnameLabel: `${fullname}'s Profile`,\n liked,\n userStatus\n }}\n interactionInfo={{\n likes,\n likeCount: likeCount >= 10 ? likeCount + 1 : likeCount,\n likeLabel: 'Like',\n commentLabel: 'Comment'\n }}\n maxContentHeight={40}\n menuItems={[{ primary: 'Custom action', id: 'custom', onClick: () => {} }]}\n onEditSubmit={({ value }) => {\n setReplyContent(value);\n setEdited(true);\n setTimeElapsed('Just now');\n }}\n edited={edited}\n onCommentClick={() => {}}\n onLikeClick={({ user }) => {\n const userLikedIndex = likes.findIndex(x => x.id === user.id);\n if (userLikedIndex !== -1) {\n setLikes(oldLikes => {\n const oldLikesArr = [...oldLikes];\n oldLikesArr.splice(userLikedIndex, 1);\n return oldLikesArr;\n });\n setLikeCount(curr => curr - 1);\n } else {\n setLikes(oldLikes => [user, ...oldLikes]);\n setLikeCount(curr => curr + 1);\n }\n setLiked(curr => !curr);\n }}\n onLikeCountInteraction={getInitialLikes}\n onLoadMoreLikes={!additionalLikeAdded ? generateNewLike : undefined}\n onUserClick={(_, clickEvent) => {\n if (clickEvent) {\n setPopoverTarget(clickEvent.target as Element);\n setPopoverOpen(curr => !curr);\n }\n }}\n />\n {popoverTarget && (\n <Popover show={popoverOpen} target={popoverTarget} placement='bottom' portal>\n <CardContent>{fullname}</CardContent>\n </Popover>\n )}\n </>\n );\n\n return renderFeed ? (\n <Feed\n onMentionClick={onMentionClick}\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n userInfo={{ username: 'demo_user', fullname: 'Demo User' }}\n posts={[reply]}\n />\n ) : (\n reply\n );\n};\n\nexport const FeedReplyWithPresence = () => {\n return <FeedReplyDemo userStatus='active' />;\n};\n"]}
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ import { FeedReplyInputProps, AttachedFiles } from '@pega/cosmos-react-social';
4
+ declare const _default: Meta<import("@storybook/react").Args>;
5
+ export default _default;
6
+ export declare const FeedReplyInputDemo: ({ onSubmit, renderFeed }: {
7
+ onSubmit?: ((event: {
8
+ replyId: string;
9
+ value: string;
10
+ attachments: AttachedFiles[];
11
+ clear: () => void;
12
+ }) => void) | undefined;
13
+ renderFeed?: boolean | undefined;
14
+ }) => JSX.Element;
15
+ //# sourceMappingURL=FeedReplyInput.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedReplyInput.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Feed/FeedReplyInput.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIxC,OAAO,EAGL,mBAAmB,EACnB,aAAa,EACd,MAAM,2BAA2B,CAAC;;AAKnC,wBAGU;AAEV,eAAO,MAAM,kBAAkB;;;;;;;;iBA2F9B,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { useState } from 'react';
2
+ import { useUID } from '@pega/cosmos-react-core';
3
+ import { Feed, FeedReplyInput } from '@pega/cosmos-react-social';
4
+ import { caseMentions, userMentions } from './Feed.mocks';
5
+ export default {
6
+ title: 'Social/Feed/FeedReplyInput',
7
+ component: FeedReplyInput
8
+ };
9
+ export const FeedReplyInputDemo = ({ onSubmit, renderFeed = true }) => {
10
+ const key = useUID();
11
+ const [searchResults, setSearchResults] = useState([]);
12
+ const [attachments, setAttachments] = useState([]);
13
+ const onSearch = ({ type, search, mentionType }) => {
14
+ if (type === 'mention') {
15
+ const availableMentions = mentionType === 'case' ? caseMentions : userMentions;
16
+ const mentions = availableMentions
17
+ .filter((user) => {
18
+ const names = user.primary.toLowerCase().split(' ');
19
+ const searchWords = search.toLowerCase().split(' ');
20
+ return !!searchWords.every((word) => names.find((name) => name.startsWith(word)));
21
+ })
22
+ .map(({ id, primary, secondary, visual }) => {
23
+ return {
24
+ id,
25
+ primary,
26
+ secondary,
27
+ visual
28
+ };
29
+ });
30
+ setSearchResults(mentions);
31
+ }
32
+ else {
33
+ setSearchResults(['cosmos', 'hashtag', 'pega']
34
+ .filter(tag => {
35
+ return tag.toLowerCase().includes(search.toLowerCase());
36
+ })
37
+ .map(tag => ({ id: tag, primary: tag })));
38
+ }
39
+ };
40
+ const onFilesAdded = (files) => {
41
+ files.forEach(file => {
42
+ if (file.type.split('/')[0] === 'image')
43
+ file.thumbnail = URL.createObjectURL(file);
44
+ file.onDelete = () => {
45
+ setAttachments(current => {
46
+ return current.filter(x => x.name !== file.name);
47
+ });
48
+ };
49
+ });
50
+ setAttachments(files);
51
+ };
52
+ const replyInput = (<FeedReplyInput id={key} commentLabel='Send Comment' attachments={attachments} placeholder='Add a comment' onFilesAdded={onFilesAdded} onSubmit={replyEvent => {
53
+ onSubmit?.(replyEvent);
54
+ setAttachments([]);
55
+ replyEvent.clear();
56
+ }}/>);
57
+ return renderFeed ? (<Feed searchTypes={['user', 'case']} onDecoratorSearch={onSearch} searchResults={searchResults} userInfo={{ username: 'demo_user', fullname: 'Demo User' }} posts={[replyInput]}/>) : (replyInput);
58
+ };
59
+ //# sourceMappingURL=FeedReplyInput.stories.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedReplyInput.stories.jsx","sourceRoot":"","sources":["../../../src/social/Feed/FeedReplyInput.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAiB,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,cAAc,EAGf,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE1D,eAAe;IACb,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,cAAc;CAClB,CAAC;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,QAAQ,EACR,UAAU,GAAG,IAAI,EAIlB,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAkB,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAkB,EAAE,CAAC,CAAC;IAEpE,MAAM,QAAQ,GAAG,CAAC,EAChB,IAAI,EACJ,MAAM,EACN,WAAW,EAKZ,EAAE,EAAE;QACH,IAAI,IAAI,KAAK,SAAS,EAAE;YACtB,MAAM,iBAAiB,GAAG,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;YAE/E,MAAM,QAAQ,GAAoB,iBAAiB;iBAChD,MAAM,CAAC,CAAC,IAAkB,EAAE,EAAE;gBAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACpD,MAAM,WAAW,GAAG,MAAM,CAAC,WAA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C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnD,CAAC,CAAC,CAAC;YACL,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,cAAc,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,CACjB,CAAC,cAAc,CACb,EAAE,CAAC,CAAC,GAAG,CAAC,CACR,YAAY,CAAC,cAAc,CAC3B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,WAAW,CAAC,eAAe,CAC3B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE;YACrB,QAAQ,EAAE,CAAC,UAAU,CAAC,CAAC;YACvB,cAAc,CAAC,EAAE,CAAC,CAAC;YACnB,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC,CAAC,EACF,CACH,CAAC;IAEF,OAAO,UAAU,CAAC,CAAC,CAAC,CAClB,CAAC,IAAI,CACH,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAC9B,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAC5B,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAC3D,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EACpB,CACH,CAAC,CAAC,CAAC,CACF,UAAU,CACX,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState } from 'react';\n\nimport { MenuItemProps, useUID } from '@pega/cosmos-react-core';\nimport {\n Feed,\n FeedReplyInput,\n FeedReplyInputProps,\n AttachedFiles\n} from '@pega/cosmos-react-social';\nimport { GlimpseProps } from '@pega/cosmos-react-work';\n\nimport { caseMentions, userMentions } from './Feed.mocks';\n\nexport default {\n title: 'Social/Feed/FeedReplyInput',\n component: FeedReplyInput\n} as Meta;\n\nexport const FeedReplyInputDemo = ({\n onSubmit,\n renderFeed = true\n}: {\n onSubmit?: FeedReplyInputProps['onSubmit'];\n renderFeed?: boolean;\n}) => {\n const key = useUID();\n const [searchResults, setSearchResults] = useState<MenuItemProps[]>([]);\n const [attachments, setAttachments] = useState<AttachedFiles[]>([]);\n\n const onSearch = ({\n type,\n search,\n mentionType\n }: {\n type: 'mention' | 'tag';\n search: string;\n mentionType: string;\n }) => {\n if (type === 'mention') {\n const availableMentions = mentionType === 'case' ? caseMentions : userMentions;\n\n const mentions: MenuItemProps[] = availableMentions\n .filter((user: GlimpseProps) => {\n const names = user.primary.toLowerCase().split(' ');\n const searchWords = search.toLowerCase().split(' ');\n return !!searchWords.every((word: string) =>\n names.find((name: string) => name.startsWith(word))\n );\n })\n .map(({ id, primary, secondary, visual }) => {\n return {\n id,\n primary,\n secondary,\n visual\n };\n });\n setSearchResults(mentions);\n } else {\n setSearchResults(\n ['cosmos', 'hashtag', 'pega']\n .filter(tag => {\n return tag.toLowerCase().includes(search.toLowerCase());\n })\n .map(tag => ({ id: tag, primary: tag }))\n );\n }\n };\n\n const onFilesAdded = (files: AttachedFiles[]) => {\n files.forEach(file => {\n if (file.type.split('/')[0] === 'image') file.thumbnail = URL.createObjectURL(file);\n\n file.onDelete = () => {\n setAttachments(current => {\n return current.filter(x => x.name !== file.name);\n });\n };\n });\n\n setAttachments(files);\n };\n\n const replyInput = (\n <FeedReplyInput\n id={key}\n commentLabel='Send Comment'\n attachments={attachments}\n placeholder='Add a comment'\n onFilesAdded={onFilesAdded}\n onSubmit={replyEvent => {\n onSubmit?.(replyEvent);\n setAttachments([]);\n replyEvent.clear();\n }}\n />\n );\n\n return renderFeed ? (\n <Feed\n searchTypes={['user', 'case']}\n onDecoratorSearch={onSearch}\n searchResults={searchResults}\n userInfo={{ username: 'demo_user', fullname: 'Demo User' }}\n posts={[replyInput]}\n />\n ) : (\n replyInput\n );\n};\n"]}
@@ -0,0 +1,6 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { AppAnnouncementProps } from '@pega/cosmos-react-work';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const AppAnnouncementDemo: Story<AppAnnouncementProps>;
6
+ //# sourceMappingURL=AppAnnouncement.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppAnnouncement.stories.d.ts","sourceRoot":"","sources":["../../../src/work/AppAnnouncement/AppAnnouncement.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAI/C,OAAO,EAAmB,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;;AAEhF,wBAGU;AAEV,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,oBAAoB,CAa3D,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { useContext } from 'react';
2
+ import { ToasterContext } from '@pega/cosmos-react-core';
3
+ import { AppAnnouncement } from '@pega/cosmos-react-work';
4
+ export default {
5
+ title: 'Work/AppAnnouncement',
6
+ component: AppAnnouncement
7
+ };
8
+ export const AppAnnouncementDemo = (args) => {
9
+ const { push } = useContext(ToasterContext);
10
+ return (<AppAnnouncement heading={args.heading} description={args.description} details={args.details} whatsNewLink={args.whatsNewLink} image={args.image} onDismiss={() => push({ content: 'Dismissed AppAnnouncement' })}/>);
11
+ };
12
+ AppAnnouncementDemo.args = {
13
+ heading: 'Pega Cosmos Design System',
14
+ description: 'We have launched a brand new experience to accelerate your workflow!',
15
+ details: [
16
+ 'New React based UI rendering',
17
+ 'Streamlined components for all business needs',
18
+ 'Other improvements'
19
+ ],
20
+ whatsNewLink: 'https://www.pega.com',
21
+ image: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png'
22
+ };
23
+ AppAnnouncementDemo.argTypes = {
24
+ heading: { control: { type: 'text' } },
25
+ description: { control: { type: 'text' } },
26
+ details: { control: { type: 'object' } },
27
+ whatsNewLink: { control: { type: 'text' } },
28
+ image: { control: { type: 'text' } }
29
+ };
30
+ //# sourceMappingURL=AppAnnouncement.stories.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppAnnouncement.stories.jsx","sourceRoot":"","sources":["../../../src/work/AppAnnouncement/AppAnnouncement.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAwB,MAAM,yBAAyB,CAAC;AAEhF,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,eAAe;CACnB,CAAC;AAEV,MAAM,CAAC,MAAM,mBAAmB,GAAgC,CAAC,IAA0B,EAAE,EAAE;IAC7F,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAE5C,OAAO,CACL,CAAC,eAAe,CACd,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CACtB,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAC9B,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CACtB,YAAY,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAChC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CAAC,EAChE,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,OAAO,EAAE,2BAA2B;IACpC,WAAW,EAAE,sEAAsE;IACnF,OAAO,EAAE;QACP,8BAA8B;QAC9B,+CAA+C;QAC/C,oBAAoB;KACrB;IACD,YAAY,EAAE,sBAAsB;IACpC,KAAK,EACH,kGAAkG;CACrG,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IACtC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAC1C,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACxC,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAC3C,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;CACrC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useContext } from 'react';\n\nimport { ToasterContext } from '@pega/cosmos-react-core';\nimport { AppAnnouncement, AppAnnouncementProps } from '@pega/cosmos-react-work';\n\nexport default {\n title: 'Work/AppAnnouncement',\n component: AppAnnouncement\n} as Meta;\n\nexport const AppAnnouncementDemo: Story<AppAnnouncementProps> = (args: AppAnnouncementProps) => {\n const { push } = useContext(ToasterContext);\n\n return (\n <AppAnnouncement\n heading={args.heading}\n description={args.description}\n details={args.details}\n whatsNewLink={args.whatsNewLink}\n image={args.image}\n onDismiss={() => push({ content: 'Dismissed AppAnnouncement' })}\n />\n );\n};\n\nAppAnnouncementDemo.args = {\n heading: 'Pega Cosmos Design System',\n description: 'We have launched a brand new experience to accelerate your workflow!',\n details: [\n 'New React based UI rendering',\n 'Streamlined components for all business needs',\n 'Other improvements'\n ],\n whatsNewLink: 'https://www.pega.com',\n image:\n 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png'\n};\n\nAppAnnouncementDemo.argTypes = {\n heading: { control: { type: 'text' } },\n description: { control: { type: 'text' } },\n details: { control: { type: 'object' } },\n whatsNewLink: { control: { type: 'text' } },\n image: { control: { type: 'text' } }\n};\n"]}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const AttachmentsMock: () => JSX.Element;
3
+ //# sourceMappingURL=Attachments.mocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attachments.mocks.d.ts","sourceRoot":"","sources":["../../../src/work/CaseView/Attachments.mocks.tsx"],"names":[],"mappings":";AA4fA,eAAO,MAAM,eAAe,mBAyH3B,CAAC"}
@@ -0,0 +1,388 @@
1
+ import { useState, useCallback, useContext, useEffect, useRef, useMemo, forwardRef } from 'react';
2
+ import { Button, FileInput, FileVisual, Progress, Modal, ModalManagerContext, Text, ToasterContext, SummaryList, ViewAll, getKindFromMimeType, getMimeTypeFromFile, Popover, Flex, Input, ComboBox, createUID, useOuterEvent, hasProp, DateTimeDisplay, MetaList } from '@pega/cosmos-react-core';
3
+ import { FileServiceContext, mockAttachmentListRequest, mockCategories } from './FileService.mock';
4
+ const getSummaryListItemProps = ({ ref, file, editFile, cancelFile, deleteFile }) => {
5
+ let actions;
6
+ let visual;
7
+ if (hasProp(file, 'progress') && typeof file.progress === 'number' && file.progress < 100) {
8
+ visual = <Progress value={file.progress} placement='inline' variant='ring'/>;
9
+ actions = [
10
+ {
11
+ id: 'Cancel',
12
+ text: 'Cancel',
13
+ icon: 'times',
14
+ onClick: () => {
15
+ cancelFile(file.id);
16
+ }
17
+ }
18
+ ];
19
+ }
20
+ else {
21
+ visual = (<FileVisual type={getKindFromMimeType(getMimeTypeFromFile(file.name) ?? '')} thumbnail={file.thumbnail}/>);
22
+ actions = [
23
+ {
24
+ id: 'Edit',
25
+ text: 'Edit',
26
+ icon: 'pencil',
27
+ onClick: () => {
28
+ editFile?.(file);
29
+ }
30
+ },
31
+ {
32
+ id: 'Download',
33
+ text: 'Download',
34
+ icon: 'download',
35
+ onClick: () => { }
36
+ },
37
+ {
38
+ id: 'Delete',
39
+ text: 'Delete',
40
+ icon: 'trash',
41
+ onClick: () => {
42
+ deleteFile(file.id);
43
+ }
44
+ }
45
+ ];
46
+ }
47
+ return {
48
+ ref,
49
+ id: file.id,
50
+ visual,
51
+ primary: file.name,
52
+ secondary: (<Text variant='secondary'>
53
+ {hasProp(file, 'progress') && typeof file.progress === 'number' && file.progress < 100 ? (`Uploading…${Math.floor(file.progress)}%`) : (<MetaList items={[
54
+ file.category,
55
+ <>
56
+ Uploaded{' '}
57
+ <DateTimeDisplay variant='relative' value={file.createDate}/>
58
+ </>
59
+ ]}/>)}
60
+ </Text>),
61
+ actions
62
+ };
63
+ };
64
+ const EditPopover = forwardRef(({ file, target, onSubmit, onCancel }, ref) => {
65
+ const [name, setName] = useState(file.name);
66
+ const [error, setError] = useState('');
67
+ const [categories, setCategories] = useState(() => {
68
+ return [
69
+ { id: createUID(), primary: 'No category', selected: false },
70
+ ...mockCategories.map(category => {
71
+ return {
72
+ id: createUID(),
73
+ primary: category,
74
+ selected: file.category === category
75
+ };
76
+ })
77
+ ];
78
+ });
79
+ const selectedCategory = useMemo(() => {
80
+ const sc = categories.find(c => c.selected);
81
+ return sc
82
+ ? {
83
+ items: {
84
+ id: sc.id,
85
+ text: sc.primary
86
+ }
87
+ }
88
+ : undefined;
89
+ }, [categories]);
90
+ return (<Popover ref={ref} target={target} style={{ width: '40ch' }} placement='bottom-start'>
91
+ <Flex container={{ direction: 'column', gap: 2, pad: 2 }}>
92
+ <Text variant='h3'>Details</Text>
93
+
94
+ <Flex container={{ direction: 'column', gap: 2 }}>
95
+ <Input label='Name' placeholder='Enter name…' value={name} info={error} status={error ? 'error' : undefined} autoFocus required onChange={(e) => {
96
+ setName(e.target.value);
97
+ if (error && e.target.value) {
98
+ setError('');
99
+ }
100
+ }} onBlur={() => {
101
+ if (!name) {
102
+ setError('Name is required.');
103
+ }
104
+ }}/>
105
+ <ComboBox label='Category' placeholder='Choose…' selected={selectedCategory} menu={{
106
+ mode: 'single-select',
107
+ items: categories,
108
+ onItemClick: id => {
109
+ setCategories(cur => {
110
+ return cur.map(category => {
111
+ return {
112
+ ...category,
113
+ selected: category.id === id
114
+ };
115
+ });
116
+ });
117
+ }
118
+ }}/>
119
+ </Flex>
120
+
121
+ <Flex container={{ justify: 'between' }}>
122
+ <Button onClick={onCancel}>Cancel</Button>
123
+ <Button variant='primary' onClick={() => {
124
+ if (error)
125
+ return;
126
+ onSubmit({
127
+ name,
128
+ category: !selectedCategory || selectedCategory.items.text === 'No category'
129
+ ? ''
130
+ : selectedCategory.items.text
131
+ });
132
+ }}>
133
+ Submit
134
+ </Button>
135
+ </Flex>
136
+ </Flex>
137
+ </Popover>);
138
+ });
139
+ const AttachmentsModal = ({ defaultMode }) => {
140
+ const [mode, setMode] = useState(defaultMode);
141
+ const { push: pushToaster } = useContext(ToasterContext);
142
+ const { ModalContext } = useContext(ModalManagerContext);
143
+ const { dismiss } = useContext(ModalContext);
144
+ const { files, setFiles, cancelFile, attachFile, deleteFile } = useContext(FileServiceContext);
145
+ const [search, setSearch] = useState('');
146
+ const [loading, setLoading] = useState(true);
147
+ const [newFiles, setNewFiles] = useState([]);
148
+ const attachSelected = useCallback(() => {
149
+ newFiles.forEach(attachFile);
150
+ dismiss();
151
+ }, [newFiles, attachFile]);
152
+ const listItemEls = useRef([]);
153
+ const [editFileIndex, setEditFileIndex] = useState(-1);
154
+ const editPopoverTargetLi = useMemo(() => {
155
+ return editFileIndex !== undefined ? listItemEls.current[editFileIndex] : undefined;
156
+ }, [editFileIndex, listItemEls]);
157
+ const menuButton = useMemo(() => editPopoverTargetLi
158
+ ? editPopoverTargetLi.querySelector('button[aria-haspopup="menu"]')
159
+ : null, [editPopoverTargetLi]);
160
+ const handlePopoverClose = useCallback(() => {
161
+ if (!editPopoverTargetLi)
162
+ return;
163
+ setEditFileIndex(-1);
164
+ menuButton?.focus();
165
+ }, [menuButton, editPopoverTargetLi]);
166
+ const handleKeydown = useCallback((e) => {
167
+ if (e.key === 'Escape') {
168
+ setEditFileIndex(-1);
169
+ }
170
+ }, []);
171
+ const editPopoverRef = useRef(null);
172
+ useOuterEvent('mousedown', [editPopoverRef], handlePopoverClose);
173
+ useEffect(() => {
174
+ if (mode === 'viewAll') {
175
+ const timeout = setTimeout(() => {
176
+ setLoading(false);
177
+ }, 1000);
178
+ return () => {
179
+ clearTimeout(timeout);
180
+ };
181
+ }
182
+ }, [mode]);
183
+ useEffect(() => {
184
+ if (!editPopoverTargetLi)
185
+ return;
186
+ document.addEventListener('keydown', handleKeydown);
187
+ return () => {
188
+ document.removeEventListener('keydown', handleKeydown);
189
+ };
190
+ }, [editPopoverTargetLi]);
191
+ useEffect(() => {
192
+ listItemEls.current = [];
193
+ }, [mode]);
194
+ const onFilesAdded = useCallback((newlyAddedFiles) => {
195
+ setNewFiles(current => [
196
+ ...newlyAddedFiles.map((file, i) => {
197
+ const id = createUID();
198
+ return {
199
+ id,
200
+ name: file.name,
201
+ category: '',
202
+ File: file,
203
+ ref: (el) => {
204
+ listItemEls.current[i] = el;
205
+ },
206
+ onEdit: () => {
207
+ setEditFileIndex(i);
208
+ },
209
+ onCancel: () => {
210
+ setNewFiles(c => c.filter(f => f.id !== id));
211
+ }
212
+ };
213
+ }),
214
+ ...current
215
+ ]);
216
+ }, [files]);
217
+ const actions = mode === 'addNew' ? (<>
218
+ <Button onClick={dismiss}>Cancel</Button>
219
+ <Button type='submit' variant='primary' onClick={attachSelected} disabled={newFiles.length === 0}>
220
+ Attach Files
221
+ </Button>
222
+ </>) : null;
223
+ const content = mode === 'addNew' ? (<FileInput multiple label='Select files to attach' onFilesAdded={onFilesAdded} files={newFiles.map(f => ({ ...f, meta: f.category || undefined }))}/>) : (<ViewAll loading={loading} items={(search ? files.filter(f => f.name.includes(search)) : files).map((file, i) => {
224
+ return getSummaryListItemProps({
225
+ ref: (el) => {
226
+ listItemEls.current[i] = el;
227
+ },
228
+ file,
229
+ editFile: () => {
230
+ setEditFileIndex(i);
231
+ },
232
+ cancelFile: id => {
233
+ const canceledFile = files.find(f => f.id === id);
234
+ cancelFile(id);
235
+ pushToaster({ content: `Cancelled attaching ${canceledFile.name}` });
236
+ },
237
+ deleteFile: async (id) => {
238
+ const deletedFile = files.find(f => f.id === id);
239
+ await deleteFile(id);
240
+ pushToaster({ content: `${deletedFile.name} deleted` });
241
+ }
242
+ });
243
+ })} actions={[
244
+ {
245
+ id: 'addNewFile',
246
+ text: 'Add files',
247
+ onClick: () => {
248
+ setMode('addNew');
249
+ }
250
+ },
251
+ {
252
+ id: 'addNewLink',
253
+ text: 'Add links',
254
+ onClick: () => {
255
+ setMode('addNew');
256
+ }
257
+ }
258
+ ]} searchInputProps={{ onSearchChange: value => setSearch(value) }}/>);
259
+ return (<Modal as={mode === 'addNew' ? 'form' : undefined} heading={mode === 'addNew' ? 'Add attachments' : 'Attachments'} actions={actions} onRequestDismiss={() => {
260
+ return !editPopoverTargetLi;
261
+ }} onSubmit={mode === 'addNew'
262
+ ? (e) => {
263
+ e.preventDefault();
264
+ }
265
+ : undefined}>
266
+ <>
267
+ {content}
268
+ {editPopoverTargetLi && (<EditPopover ref={editPopoverRef} target={menuButton} file={mode === 'addNew' ? newFiles[editFileIndex] : files[editFileIndex]} onCancel={handlePopoverClose} onSubmit={({ name, category }) => {
269
+ handlePopoverClose();
270
+ if (mode === 'addNew') {
271
+ setNewFiles(cur => {
272
+ return cur.map((file, i) => {
273
+ if (i === editFileIndex) {
274
+ return {
275
+ ...file,
276
+ name,
277
+ category
278
+ };
279
+ }
280
+ return file;
281
+ });
282
+ });
283
+ }
284
+ else {
285
+ setFiles(cur => cur.map((file, i) => {
286
+ if (i === editFileIndex) {
287
+ return {
288
+ ...file,
289
+ name,
290
+ category
291
+ };
292
+ }
293
+ return file;
294
+ }));
295
+ }
296
+ }}/>)}
297
+ </>
298
+ </Modal>);
299
+ };
300
+ export const AttachmentsMock = () => {
301
+ const { push: pushToaster } = useContext(ToasterContext);
302
+ const { create: createModal } = useContext(ModalManagerContext);
303
+ const [loading, setLoading] = useState(true);
304
+ const { files, setFiles, cancelFile, deleteFile } = useContext(FileServiceContext);
305
+ const listItemEls = useRef([]);
306
+ const [editFileIndex, setEditFileIndex] = useState(-1);
307
+ const editPopoverTargetLi = useMemo(() => {
308
+ return editFileIndex !== undefined ? listItemEls.current[editFileIndex] : undefined;
309
+ }, [editFileIndex, listItemEls]);
310
+ const menuButton = useMemo(() => editPopoverTargetLi
311
+ ? editPopoverTargetLi.querySelector('button[aria-haspopup="menu"]')
312
+ : null, [editPopoverTargetLi]);
313
+ const handlePopoverClose = useCallback(() => {
314
+ if (!editPopoverTargetLi)
315
+ return;
316
+ setEditFileIndex(-1);
317
+ menuButton?.focus();
318
+ }, [menuButton, editPopoverTargetLi]);
319
+ const handleKeydown = useCallback((e) => {
320
+ if (e.key === 'Escape') {
321
+ setEditFileIndex(-1);
322
+ }
323
+ }, []);
324
+ const editPopoverRef = useRef(null);
325
+ useOuterEvent('mousedown', [editPopoverRef], handlePopoverClose);
326
+ useEffect(() => {
327
+ mockAttachmentListRequest().then(attachments => {
328
+ setLoading(false);
329
+ setFiles(attachments);
330
+ });
331
+ }, []);
332
+ useEffect(() => {
333
+ if (!editPopoverTargetLi)
334
+ return;
335
+ document.addEventListener('keydown', handleKeydown);
336
+ return () => {
337
+ document.removeEventListener('keydown', handleKeydown);
338
+ };
339
+ }, [editPopoverTargetLi]);
340
+ return (<>
341
+ <SummaryList icon='paper-clip' name='Attachments' loading={loading} count={!loading && Array.isArray(files) ? files.length : undefined} actions={[
342
+ {
343
+ text: 'Add attachments',
344
+ id: 'addNew',
345
+ icon: 'plus',
346
+ onClick() {
347
+ createModal(AttachmentsModal, { defaultMode: 'addNew' });
348
+ }
349
+ }
350
+ ]} items={files.slice(0, 3).map((file, i) => {
351
+ return getSummaryListItemProps({
352
+ ref: (el) => {
353
+ listItemEls.current[i] = el;
354
+ },
355
+ file,
356
+ editFile: () => {
357
+ setEditFileIndex(i);
358
+ },
359
+ cancelFile: id => {
360
+ const canceledFile = files.find(f => f.id === id);
361
+ cancelFile(id);
362
+ pushToaster({ content: `Cancelled attaching ${canceledFile.name}` });
363
+ },
364
+ deleteFile: async (id) => {
365
+ const deletedFile = files.find(f => f.id === id);
366
+ await deleteFile(id);
367
+ pushToaster({ content: `${deletedFile.name} deleted` });
368
+ }
369
+ });
370
+ })} onViewAll={() => {
371
+ createModal(AttachmentsModal, { defaultMode: 'viewAll' });
372
+ }}/>
373
+ {editPopoverTargetLi && (<EditPopover ref={editPopoverRef} target={menuButton} file={files[editFileIndex]} onCancel={handlePopoverClose} onSubmit={({ name, category }) => {
374
+ handlePopoverClose();
375
+ setFiles(cur => cur.map((file, i) => {
376
+ if (i === editFileIndex) {
377
+ return {
378
+ ...file,
379
+ name,
380
+ category
381
+ };
382
+ }
383
+ return file;
384
+ }));
385
+ }}/>)}
386
+ </>);
387
+ };
388
+ //# sourceMappingURL=Attachments.mocks.jsx.map