@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,146 @@
1
+ import { useState, useRef } from 'react';
2
+ import { createUID, DateTimeDisplay, Lightbox, OneColumnPage } from '@pega/cosmos-react-core';
3
+ import { Feed, MentionButtonConfig, HashtagButtonConfig } from '@pega/cosmos-react-social';
4
+ import { Glimpse } from '@pega/cosmos-react-work';
5
+ import { AppShellDemo } from '@pega/cosmos-react-demos/lib/core/AppShell/AppShell.stories';
6
+ import { FeedPostDemo } from './FeedPost.stories';
7
+ import { FeedNewPostDemo } from './FeedNewPost.stories';
8
+ import { caseMentions, feedPosts, userMentions } from './Feed.mocks';
9
+ export default {
10
+ title: 'Social/Feed/Feed',
11
+ component: Feed
12
+ };
13
+ export const FeedDemo = ({ markdownMap }) => {
14
+ const [extraPosts, setExtraPosts] = useState(() => feedPosts);
15
+ const [searchResults, setSearchResults] = useState([]);
16
+ const [filters, setFilters] = useState(Array.from({ length: 10 }, (_, index) => {
17
+ return {
18
+ id: `filter-${index + 1}`,
19
+ label: `Filter ${index + 1}`
20
+ };
21
+ }));
22
+ const toggleFilter = (filterId) => {
23
+ const updatedFilters = [...filters];
24
+ const filterToUpdate = updatedFilters.find(x => x.id === filterId);
25
+ if (filterToUpdate)
26
+ filterToUpdate.on = !filterToUpdate.on;
27
+ setFilters(updatedFilters);
28
+ };
29
+ const onSearch = ({ type, search, mentionType }) => {
30
+ if (type === 'mention') {
31
+ const availableMentions = mentionType === 'case' ? caseMentions : userMentions;
32
+ const mentions = availableMentions
33
+ .filter((user) => {
34
+ const names = user.primary.toLowerCase().split(' ');
35
+ const searchWords = search.toLowerCase().split(' ');
36
+ return !!searchWords.every((word) => names.find((name) => name.startsWith(word)));
37
+ })
38
+ .map(({ id, primary, secondary, visual }) => {
39
+ return {
40
+ id,
41
+ primary,
42
+ secondary,
43
+ visual
44
+ };
45
+ });
46
+ setSearchResults(mentions);
47
+ }
48
+ else {
49
+ setSearchResults(['cosmos', 'hashtag', 'pega']
50
+ .filter(tag => {
51
+ return tag.toLowerCase().includes(search.toLowerCase());
52
+ })
53
+ .map(tag => ({ id: tag, primary: tag })));
54
+ }
55
+ };
56
+ const generateNewPost = () => {
57
+ setTimeout(() => {
58
+ setExtraPosts(posts => [
59
+ ...posts,
60
+ {
61
+ id: createUID(),
62
+ fullname: 'Demo User',
63
+ username: 'demo_user',
64
+ content: 'This post was loaded after the Feed was scrolled to the bottom!',
65
+ attachments: [],
66
+ replies: [],
67
+ renderFeed: false
68
+ }
69
+ ]);
70
+ }, 1000);
71
+ };
72
+ const onMentionClick = ({ id, type }) => {
73
+ if (type === 'user') {
74
+ const user = userMentions.find(mention => mention.id === id);
75
+ if (user)
76
+ return <Glimpse {...user}/>;
77
+ }
78
+ };
79
+ const [lightboxImages, setLightboxImages] = useState(null);
80
+ const defaultLBIndex = useRef(0);
81
+ const renderLightbox = (attachments, name) => {
82
+ const images = attachments
83
+ .filter(attachment => attachment.type.includes('image') && attachment.thumbnail)
84
+ .map(image => {
85
+ return {
86
+ id: image.thumbnail,
87
+ name: image.name,
88
+ description: image.name,
89
+ src: image.thumbnail,
90
+ metadata: [image.type, <DateTimeDisplay value={new Date()} variant='date'/>]
91
+ };
92
+ });
93
+ const idx = images.findIndex(image => image.name === name);
94
+ defaultLBIndex.current = idx > -1 ? idx : 0;
95
+ setLightboxImages(images);
96
+ };
97
+ const deletePost = (index) => {
98
+ setExtraPosts(posts => {
99
+ const postsCopy = [...posts];
100
+ postsCopy.splice(index, 1);
101
+ return [...postsCopy];
102
+ });
103
+ };
104
+ return (<>
105
+ <Feed title='Pulse' userInfo={{ username: 'demo_user', fullname: 'Demo User' }} searchTypes={['user', 'case']} onDecoratorSearch={onSearch} searchResults={searchResults} onMentionClick={onMentionClick} markdownMap={markdownMap} interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]} filters={filters} onFilterChange={toggleFilter} onLoadMore={generateNewPost} newPostRegion={<FeedNewPostDemo onPost={postEvent => {
106
+ const { value, attachments, recipients, clear } = postEvent;
107
+ attachments.forEach(file => {
108
+ delete file.onDelete;
109
+ file.onPreview = file.type.includes('image')
110
+ ? () => renderLightbox(attachments, file.name)
111
+ : undefined;
112
+ file.onDownload = () => { };
113
+ });
114
+ if (value || attachments.length > 0) {
115
+ setExtraPosts(posts => [
116
+ {
117
+ id: createUID(),
118
+ fullname: 'Demo User',
119
+ username: 'demo_user',
120
+ content: value,
121
+ attachments,
122
+ recipients,
123
+ postType: recipients.length ? 'private' : 'public',
124
+ replies: [],
125
+ timeElapsed: 'Just now',
126
+ renderFeed: false
127
+ },
128
+ ...posts
129
+ ]);
130
+ clear();
131
+ }
132
+ }} renderFeed={false}/>} posts={extraPosts.map((post, i) => {
133
+ return <FeedPostDemo {...post} key={post.id} onDelete={() => deletePost(i)}/>;
134
+ })}/>
135
+ {lightboxImages && (<Lightbox items={lightboxImages} defaultIndex={defaultLBIndex.current} onAfterClose={() => {
136
+ setLightboxImages(null);
137
+ }}/>)}
138
+ </>);
139
+ };
140
+ export const FeedWithAppShell = () => {
141
+ return <AppShellDemo appHeader main={<OneColumnPage title='Welcome' a={<FeedDemo />}/>}/>;
142
+ };
143
+ FeedWithAppShell.parameters = {
144
+ layout: 'fullscreen'
145
+ };
146
+ //# sourceMappingURL=Feed.stories.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Feed.stories.jsx","sourceRoot":"","sources":["../../../src/social/Feed/Feed.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EACL,SAAS,EACT,eAAe,EACf,QAAQ,EAGR,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,IAAI,EAEJ,mBAAmB,EACnB,mBAAmB,EAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAgB,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,6DAA6D,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,SAAS,EAA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,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAG,CAAC;QACjF,CAAC,CAAC,CAAC,EAEL;MAAA,CAAC,cAAc,IAAI,CACjB,CAAC,QAAQ,CACP,KAAK,CAAC,CAAC,cAAc,CAAC,CACtB,YAAY,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CACrC,YAAY,CAAC,CAAC,GAAG,EAAE;gBACjB,iBAAiB,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC,CAAC,EACF,CACH,CACH;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,AAAD,EAAG,CAAC,EAAG,CAAC,EAAG,CAAC;AAC9F,CAAC,CAAC;AAEF,gBAAgB,CAAC,UAAU,GAAG;IAC5B,MAAM,EAAE,YAAY;CACrB,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useRef } from 'react';\n\nimport {\n createUID,\n DateTimeDisplay,\n Lightbox,\n LightboxProps,\n MenuItemProps,\n OneColumnPage\n} from '@pega/cosmos-react-core';\nimport { MDMap } from '@pega/cosmos-react-rte';\nimport {\n Feed,\n Filter,\n MentionButtonConfig,\n HashtagButtonConfig,\n AttachedFiles\n} from '@pega/cosmos-react-social';\nimport { Glimpse, GlimpseProps } from '@pega/cosmos-react-work';\nimport { AppShellDemo } from '@pega/cosmos-react-demos/lib/core/AppShell/AppShell.stories';\n\nimport { FeedPostDemo } from './FeedPost.stories';\nimport { FeedNewPostDemo } from './FeedNewPost.stories';\nimport { caseMentions, feedPosts, userMentions, FeedPostDemoProps } from './Feed.mocks';\n\nexport default {\n title: 'Social/Feed/Feed',\n component: Feed\n} as Meta;\n\nexport const FeedDemo = ({ markdownMap }: { markdownMap?: MDMap }) => {\n const [extraPosts, setExtraPosts] = useState<FeedPostDemoProps[]>(() => feedPosts);\n const [searchResults, setSearchResults] = useState<MenuItemProps[]>([]);\n\n const [filters, setFilters] = useState<Filter[]>(\n Array.from({ length: 10 }, (_, index) => {\n return {\n id: `filter-${index + 1}`,\n label: `Filter ${index + 1}`\n };\n })\n );\n\n const toggleFilter = (filterId: string) => {\n const updatedFilters = [...filters];\n const filterToUpdate = updatedFilters.find(x => x.id === filterId);\n\n if (filterToUpdate) filterToUpdate.on = !filterToUpdate.on;\n\n setFilters(updatedFilters);\n };\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 generateNewPost = () => {\n setTimeout(() => {\n setExtraPosts(posts => [\n ...posts,\n {\n id: createUID(),\n fullname: 'Demo User',\n username: 'demo_user',\n content: 'This post was loaded after the Feed was scrolled to the bottom!',\n attachments: [],\n replies: [],\n renderFeed: false\n }\n ]);\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 [lightboxImages, setLightboxImages] = useState<LightboxProps['items'] | null>(null);\n const defaultLBIndex = useRef(0);\n\n const renderLightbox = (attachments: AttachedFiles[], name: string) => {\n const images: LightboxProps['items'] = attachments\n .filter(attachment => attachment.type.includes('image') && attachment.thumbnail)\n .map(image => {\n return {\n id: image.thumbnail as string,\n name: image.name,\n description: image.name,\n src: image.thumbnail as string,\n metadata: [image.type, <DateTimeDisplay value={new Date()} variant='date' />]\n };\n });\n\n const idx = images.findIndex(image => image.name === name);\n defaultLBIndex.current = idx > -1 ? idx : 0;\n setLightboxImages(images);\n };\n\n const deletePost = (index: number) => {\n setExtraPosts(posts => {\n const postsCopy = [...posts];\n postsCopy.splice(index, 1);\n return [...postsCopy];\n });\n };\n\n return (\n <>\n <Feed\n title='Pulse'\n userInfo={{ username: 'demo_user', fullname: 'Demo User' }}\n searchTypes={['user', 'case']}\n onDecoratorSearch={onSearch}\n searchResults={searchResults}\n onMentionClick={onMentionClick}\n markdownMap={markdownMap}\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n filters={filters}\n onFilterChange={toggleFilter}\n onLoadMore={generateNewPost}\n newPostRegion={\n <FeedNewPostDemo\n onPost={postEvent => {\n const { value, attachments, recipients, clear } = postEvent;\n\n attachments.forEach(file => {\n delete file.onDelete;\n file.onPreview = file.type.includes('image')\n ? () => renderLightbox(attachments, file.name)\n : undefined;\n file.onDownload = () => {};\n });\n\n if (value || attachments.length > 0) {\n setExtraPosts(posts => [\n {\n id: createUID(),\n fullname: 'Demo User',\n username: 'demo_user',\n content: value,\n attachments,\n recipients,\n postType: recipients.length ? 'private' : 'public',\n replies: [],\n timeElapsed: 'Just now',\n renderFeed: false\n },\n ...posts\n ]);\n clear();\n }\n }}\n renderFeed={false}\n />\n }\n posts={extraPosts.map((post, i) => {\n return <FeedPostDemo {...post} key={post.id} onDelete={() => deletePost(i)} />;\n })}\n />\n {lightboxImages && (\n <Lightbox\n items={lightboxImages}\n defaultIndex={defaultLBIndex.current}\n onAfterClose={() => {\n setLightboxImages(null);\n }}\n />\n )}\n </>\n );\n};\n\nexport const FeedWithAppShell = () => {\n return <AppShellDemo appHeader main={<OneColumnPage title='Welcome' a={<FeedDemo />} />} />;\n};\n\nFeedWithAppShell.parameters = {\n layout: 'fullscreen'\n};\n"]}
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ import { FeedNewPostProps, AttachedFiles } from '@pega/cosmos-react-social';
4
+ declare const _default: Meta<import("@storybook/react").Args>;
5
+ export default _default;
6
+ export declare const FeedNewPostDemo: ({ onPost, renderFeed }: {
7
+ onPost?: ((event: {
8
+ newPostId: string;
9
+ value: string;
10
+ attachments: AttachedFiles[];
11
+ recipients: import("@pega/cosmos-react-social/lib/components/Feed/FeedNewPostTypeMenu").RecipientMenuItem[];
12
+ username: string;
13
+ clear: () => void;
14
+ }) => void) | undefined;
15
+ renderFeed?: boolean | undefined;
16
+ }) => JSX.Element;
17
+ //# sourceMappingURL=FeedNewPost.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedNewPost.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Feed/FeedNewPost.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIxC,OAAO,EAGL,gBAAgB,EAEhB,aAAa,EACd,MAAM,2BAA2B,CAAC;;AAKnC,wBAGU;AAEV,eAAO,MAAM,eAAe;;;;;;;;;;iBAwH3B,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { useState, useEffect } from 'react';
2
+ import { useUID } from '@pega/cosmos-react-core';
3
+ import { Feed, FeedNewPost } from '@pega/cosmos-react-social';
4
+ import { availableRecipients, caseMentions, userMentions } from './Feed.mocks';
5
+ export default {
6
+ title: 'Social/Feed/FeedNewPost',
7
+ component: FeedNewPost
8
+ };
9
+ export const FeedNewPostDemo = ({ onPost, renderFeed = true }) => {
10
+ const key = useUID();
11
+ const [searchResults, setSearchResults] = useState([]);
12
+ const [attachments, setAttachments] = useState([]);
13
+ const [filterValue, setFilterValue] = useState('');
14
+ const [itemsToRender, setItemsToRender] = useState(availableRecipients);
15
+ const onSearch = ({ type, search, mentionType }) => {
16
+ if (type === 'mention') {
17
+ const availableMentions = mentionType === 'case' ? caseMentions : userMentions;
18
+ const mentions = availableMentions
19
+ .filter((user) => {
20
+ const names = user.primary.toLowerCase().split(' ');
21
+ const searchWords = search.toLowerCase().split(' ');
22
+ return !!searchWords.every((word) => names.find((name) => name.startsWith(word)));
23
+ })
24
+ .map(({ id, primary, secondary, visual }) => {
25
+ return {
26
+ id,
27
+ primary,
28
+ secondary,
29
+ visual
30
+ };
31
+ });
32
+ setSearchResults(mentions);
33
+ }
34
+ else {
35
+ setSearchResults(['cosmos', 'hashtag', 'pega']
36
+ .filter(tag => {
37
+ return tag.toLowerCase().includes(search.toLowerCase());
38
+ })
39
+ .map(tag => ({ id: tag, primary: tag })));
40
+ }
41
+ };
42
+ const onFilesAdded = (files) => {
43
+ files.forEach(file => {
44
+ if (file.type.split('/')[0] === 'image')
45
+ file.thumbnail = URL.createObjectURL(file);
46
+ if (file.size / 1000000 > 100) {
47
+ file.meta = 'File size cannot exceed 100MB';
48
+ file.error = true;
49
+ }
50
+ file.onDelete = () => {
51
+ setAttachments(current => {
52
+ return current.filter(x => x.name !== file.name);
53
+ });
54
+ };
55
+ });
56
+ setAttachments(current => [...current, ...files]);
57
+ };
58
+ useEffect(() => {
59
+ const timeout = setTimeout(() => {
60
+ const newItems = availableRecipients.filter(({ primary, secondary }) => {
61
+ return (primary.toLowerCase().includes(filterValue) ||
62
+ secondary.find(x => x.toLowerCase().includes(filterValue)));
63
+ });
64
+ setItemsToRender(newItems);
65
+ }, 500);
66
+ return () => {
67
+ clearTimeout(timeout);
68
+ };
69
+ }, [filterValue]);
70
+ const newPost = (<FeedNewPost id={key} attachments={attachments} interactionInfo={{
71
+ textAreaPlaceholder: 'Start a conversation',
72
+ postLabel: 'Post'
73
+ }} onFilesAdded={onFilesAdded} onPost={postEvent => {
74
+ onPost?.(postEvent);
75
+ setAttachments([]);
76
+ postEvent.clear();
77
+ }} recipients={itemsToRender} onRecipientSearch={(newSearch) => setFilterValue(newSearch)}/>);
78
+ return renderFeed ? (<Feed searchTypes={['user', 'case']} onDecoratorSearch={onSearch} searchResults={searchResults} userInfo={{ username: 'demo_user', fullname: 'Demo User' }} newPostRegion={newPost}/>) : (newPost);
79
+ };
80
+ //# sourceMappingURL=FeedNewPost.stories.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedNewPost.stories.jsx","sourceRoot":"","sources":["../../../src/social/Feed/FeedNewPost.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAiB,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,WAAW,EAIZ,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/E,eAAe;IACb,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,WAAW;CACf,CAAC;AAEV,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,MAAM,EACN,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;IACpE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAoB,mBAAmB,CAAC,CAAC;IAE3F,MAAM,QAAQ,GAAG,CAAC,EAChB,IAAI,EACJ,MAAM,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AQ,CAAC,CAAC;QAC7B,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,OAAO,GAAG,CACd,CAAC,WAAW,CACV,EAAE,CAAC,CAAC,GAAG,CAAC,CACR,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,eAAe,CAAC,CAAC;YACf,mBAAmB,EAAE,sBAAsB;YAC3C,SAAS,EAAE,MAAM;SAClB,CAAC,CACF,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE;YAClB,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC;YACpB,cAAc,CAAC,EAAE,CAAC,CAAC;YACnB,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC,CAAC,CACF,UAAU,CAAC,CAAC,aAAa,CAAC,CAC1B,iBAAiB,CAAC,CAAC,CAAC,SAAiB,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,EACpE,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,aAAa,CAAC,CAAC,OAAO,CAAC,EACvB,CACH,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useEffect } from 'react';\n\nimport { MenuItemProps, useUID } from '@pega/cosmos-react-core';\nimport {\n Feed,\n FeedNewPost,\n FeedNewPostProps,\n RecipientOption,\n AttachedFiles\n} from '@pega/cosmos-react-social';\nimport { GlimpseProps } from '@pega/cosmos-react-work';\n\nimport { availableRecipients, caseMentions, userMentions } from './Feed.mocks';\n\nexport default {\n title: 'Social/Feed/FeedNewPost',\n component: FeedNewPost\n} as Meta;\n\nexport const FeedNewPostDemo = ({\n onPost,\n renderFeed = true\n}: {\n onPost?: FeedNewPostProps['onPost'];\n renderFeed?: boolean;\n}) => {\n const key = useUID();\n const [searchResults, setSearchResults] = useState<MenuItemProps[]>([]);\n const [attachments, setAttachments] = useState<AttachedFiles[]>([]);\n const [filterValue, setFilterValue] = useState('');\n const [itemsToRender, setItemsToRender] = useState<RecipientOption[]>(availableRecipients);\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 if (file.size / 1000000 > 100) {\n file.meta = 'File size cannot exceed 100MB';\n file.error = true;\n }\n\n file.onDelete = () => {\n setAttachments(current => {\n return current.filter(x => x.name !== file.name);\n });\n };\n });\n\n setAttachments(current => [...current, ...files]);\n };\n\n useEffect(() => {\n // Synthetic delay to mimic async request\n const timeout = setTimeout(() => {\n const newItems = availableRecipients.filter(({ primary, secondary }) => {\n return (\n primary.toLowerCase().includes(filterValue) ||\n secondary.find(x => x.toLowerCase().includes(filterValue))\n );\n });\n\n setItemsToRender(newItems);\n }, 500);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [filterValue]);\n\n const newPost = (\n <FeedNewPost\n id={key}\n attachments={attachments}\n interactionInfo={{\n textAreaPlaceholder: 'Start a conversation',\n postLabel: 'Post'\n }}\n onFilesAdded={onFilesAdded}\n onPost={postEvent => {\n onPost?.(postEvent);\n setAttachments([]);\n postEvent.clear();\n }}\n recipients={itemsToRender}\n onRecipientSearch={(newSearch: string) => setFilterValue(newSearch)}\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 newPostRegion={newPost}\n />\n ) : (\n newPost\n );\n};\n"]}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ import { FeedPostDemoProps } from './Feed.mocks';
4
+ declare const _default: Meta<import("@storybook/react").Args>;
5
+ export default _default;
6
+ export declare const FeedPostDemo: ({ fullname, username, content, postType, recipients, attachments: postAttachments, replies, timeElapsed: time, userStatus, likes: userLikes, likeCount: userLikeCount, onDelete, renderFeed }: FeedPostDemoProps) => JSX.Element;
7
+ export declare const FeedPostWithPresence: () => JSX.Element;
8
+ export declare const FeedPostWithJSX: () => JSX.Element;
9
+ //# sourceMappingURL=FeedPost.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedPost.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Feed/FeedPost.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAwBxC,OAAO,EAKL,iBAAiB,EAClB,MAAM,cAAc,CAAC;;AAEtB,wBAGU;AAEV,eAAO,MAAM,YAAY,kMActB,iBAAiB,gBA6RnB,CAAC;AAEF,eAAO,MAAM,oBAAoB,mBAEhC,CAAC;AAEF,eAAO,MAAM,eAAe,mBA+C3B,CAAC"}
@@ -0,0 +1,248 @@
1
+ import { useState } from 'react';
2
+ import { Avatar, CardContent, Link, Popover, Table, useUID } from '@pega/cosmos-react-core';
3
+ import { HashtagButtonConfig, MentionButtonConfig, Feed, FeedPost } from '@pega/cosmos-react-social';
4
+ import { Glimpse } from '@pega/cosmos-react-work';
5
+ import { FeedReplyDemo } from './FeedReply.stories';
6
+ import { generatedLikes, caseMentions, userMentions, availableRecipients } from './Feed.mocks';
7
+ export default {
8
+ title: 'Social/Feed/FeedPost',
9
+ component: FeedPost
10
+ };
11
+ export const FeedPostDemo = ({ fullname = 'Katie Smith', username = 'katie_smith', content, postType, recipients, attachments: postAttachments, replies, timeElapsed: time, userStatus, likes: userLikes, likeCount: userLikeCount, onDelete = () => { }, renderFeed = true }) => {
12
+ const defaultContent = postAttachments
13
+ ? ''
14
+ : 'This post mentions @deans:Seth DeAngelo:user: and also contains a tag! #cosmos:';
15
+ const defaultReplies = [...new Array(12).keys()].map(index => {
16
+ return (<FeedReplyDemo key={`reply-story-${index + 1}`} fullname={fullname} content={`This is reply number ${index + 1}!`} renderFeed={false}/>);
17
+ });
18
+ const key = useUID();
19
+ const [postContent, setPostContent] = useState(content || defaultContent);
20
+ const [searchResults, setSearchResults] = useState([]);
21
+ const [likes, setLikes] = useState([]);
22
+ const [liked, setLiked] = useState(false);
23
+ const [likeCount, setLikeCount] = useState(userLikeCount || (renderFeed ? generatedLikes.length : 0));
24
+ const [recipientsList, setRecipientsList] = useState([]);
25
+ const [edited, setEdited] = useState(false);
26
+ const [timeElapsed, setTimeElapsed] = useState(time || '4 days ago');
27
+ const [popoverOpen, setPopoverOpen] = useState(false);
28
+ const [popoverTarget, setPopoverTarget] = useState();
29
+ const [extraReplies, setExtraReplies] = useState([]);
30
+ const [replyAttachments, setReplyAttachments] = useState([]);
31
+ const [replyCount, setReplyCount] = useState(replies ? replies.length : defaultReplies.length);
32
+ const [repliesLoading, setRepliesLoading] = useState(false);
33
+ const [repliesShown, setRepliesShown] = useState(3);
34
+ const [additionalLikeAdded, setAdditionalLikeAdded] = useState(false);
35
+ const [allRecipientsVisible, setAllRecipientsVisible] = useState(false);
36
+ const onShowMoreReplies = () => {
37
+ setRepliesLoading(true);
38
+ setTimeout(() => {
39
+ setRepliesShown(curr => {
40
+ if (curr + 3 <= defaultReplies.length)
41
+ return curr + 3;
42
+ return defaultReplies.length;
43
+ });
44
+ setRepliesLoading(false);
45
+ }, 1000);
46
+ };
47
+ const onShowLessReplies = () => {
48
+ setRepliesLoading(true);
49
+ setTimeout(() => {
50
+ setRepliesShown(3);
51
+ setRepliesLoading(false);
52
+ }, 1000);
53
+ };
54
+ const onSearch = ({ type, search, mentionType }) => {
55
+ if (type === 'mention') {
56
+ const availableMentions = mentionType === 'case' ? caseMentions : userMentions;
57
+ const mentions = availableMentions
58
+ .filter((user) => {
59
+ const names = user.primary.toLowerCase().split(' ');
60
+ const searchWords = search.toLowerCase().split(' ');
61
+ return !!searchWords.every((word) => names.find((name) => name.startsWith(word)));
62
+ })
63
+ .map(({ id, primary, secondary, visual }) => {
64
+ return {
65
+ id,
66
+ primary,
67
+ secondary,
68
+ visual
69
+ };
70
+ });
71
+ setSearchResults(mentions);
72
+ }
73
+ else {
74
+ setSearchResults(['cosmos', 'hashtag', 'pega']
75
+ .filter(tag => {
76
+ return tag.toLowerCase().includes(search.toLowerCase());
77
+ })
78
+ .map(tag => ({ id: tag, primary: tag })));
79
+ }
80
+ };
81
+ const onFilesAdded = (files) => {
82
+ files.forEach(file => {
83
+ if (file.type.split('/')[0] === 'image')
84
+ file.thumbnail = URL.createObjectURL(file);
85
+ file.onDelete = () => {
86
+ setReplyAttachments?.(current => {
87
+ return current.filter(x => x.name !== file.name);
88
+ });
89
+ };
90
+ });
91
+ setReplyAttachments(files);
92
+ };
93
+ const getInitialLikes = () => {
94
+ if (likes.length)
95
+ return;
96
+ setLikes(userLikes || (renderFeed ? generatedLikes : []));
97
+ };
98
+ const generateNewLike = () => {
99
+ setTimeout(() => {
100
+ setLikes(oldLikes => [
101
+ ...oldLikes,
102
+ {
103
+ primary: 'Generated Like',
104
+ secondary: ['This like was added after the onLoadMore callback triggered'],
105
+ visual: <Avatar size='l' name='Generated Like'/>,
106
+ id: 'generatedLike'
107
+ }
108
+ ]);
109
+ setAdditionalLikeAdded(true);
110
+ }, 1000);
111
+ };
112
+ const getInitialRecipients = () => {
113
+ if (recipientsList.length)
114
+ return;
115
+ setRecipientsList(recipients ||
116
+ availableRecipients.slice(0, !allRecipientsVisible ? 10 : availableRecipients.length));
117
+ };
118
+ const getAllRecipients = () => {
119
+ setTimeout(() => {
120
+ setAllRecipientsVisible(true);
121
+ setRecipientsList(recipients || availableRecipients);
122
+ }, 1000);
123
+ };
124
+ const onMentionClick = ({ id, type }) => {
125
+ if (type === 'user') {
126
+ const user = userMentions.find(mention => mention.id === id);
127
+ if (user)
128
+ return <Glimpse {...user}/>;
129
+ }
130
+ };
131
+ const post = (<>
132
+ <FeedPost id={key} key={key} info={{
133
+ fullname,
134
+ username,
135
+ timeElapsed,
136
+ content: postContent,
137
+ postType,
138
+ recipients: recipientsList,
139
+ recipientsCount: recipients ? recipients.length : availableRecipients.length,
140
+ attachments: postAttachments,
141
+ liked,
142
+ postContext: renderFeed ? (<Link href='https://www.pega.com' target='_blank'>
143
+ Pega
144
+ </Link>) : undefined,
145
+ userStatus
146
+ }} interactionInfo={{
147
+ likeLabel: 'Like',
148
+ likes,
149
+ likeCount: likeCount >= 10 ? likeCount + 1 : likeCount,
150
+ commentLabel: 'Comment'
151
+ }} maxContentHeight={80} onLikeClick={({ user }) => {
152
+ const userLikedIndex = likes.findIndex(x => x.id === user.id);
153
+ if (userLikedIndex !== -1) {
154
+ setLikes(oldLikes => {
155
+ const oldLikesArr = [...oldLikes];
156
+ oldLikesArr.splice(userLikedIndex, 1);
157
+ return oldLikesArr;
158
+ });
159
+ setLikeCount(curr => curr - 1);
160
+ }
161
+ else {
162
+ setLikes(oldLikes => [user, ...oldLikes]);
163
+ setLikeCount(curr => curr + 1);
164
+ }
165
+ setLiked(curr => !curr);
166
+ }} onLikeCountInteraction={getInitialLikes} onLoadMoreLikes={!additionalLikeAdded ? generateNewLike : undefined} onRecipientInteraction={getInitialRecipients} onLoadMoreRecipients={!allRecipientsVisible ? getAllRecipients : undefined} onUserClick={(_, clickEvent) => {
167
+ if (clickEvent) {
168
+ setPopoverTarget(clickEvent.target);
169
+ setPopoverOpen(curr => !curr);
170
+ }
171
+ }} menuItems={[
172
+ { primary: 'Custom action', id: 'custom', onClick: () => { } },
173
+ { primary: 'Delete', id: 'delete', onClick: onDelete }
174
+ ]} onEditSubmit={({ value }) => {
175
+ setPostContent(value);
176
+ setEdited(true);
177
+ setTimeElapsed('Just now');
178
+ }} edited={edited} replies={replies
179
+ ? [...replies, ...extraReplies]
180
+ : [...defaultReplies.slice(-repliesShown), ...extraReplies]} replyCount={replyCount} repliesLoading={repliesLoading} onShowMoreReplies={onShowMoreReplies} onShowLessReplies={repliesShown > 3 ? onShowLessReplies : undefined} replyInput={{
181
+ commentLabel: 'Send Comment',
182
+ attachments: replyAttachments,
183
+ onFilesAdded,
184
+ onSubmit: replyEvent => {
185
+ setReplyAttachments([]);
186
+ replyEvent.attachments.forEach(file => {
187
+ delete file.onDelete;
188
+ file.onPreview = () => { };
189
+ file.onDownload = () => { };
190
+ });
191
+ setExtraReplies(oldReplies => [
192
+ ...oldReplies,
193
+ <FeedReplyDemo key={`replies-${oldReplies.length}`} fullname='Demo User' username='demo_user' content={replyEvent.value} attachments={replyEvent.attachments} timeElapsed='Just now' renderFeed={false}/>
194
+ ]);
195
+ setReplyCount(oldReplyCount => oldReplyCount + 1);
196
+ replyEvent.clear();
197
+ },
198
+ placeholder: 'Add a comment'
199
+ }}/>
200
+ {popoverTarget && (<Popover show={popoverOpen} target={popoverTarget} placement='bottom' portal>
201
+ <CardContent>{fullname}</CardContent>
202
+ </Popover>)}
203
+ </>);
204
+ return renderFeed ? (<Feed searchTypes={['user', 'case']} onDecoratorSearch={onSearch} searchResults={searchResults} onMentionClick={onMentionClick} interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]} userInfo={{ username: 'demo_user', fullname: 'Demo User' }} posts={[post]}/>) : (post);
205
+ };
206
+ export const FeedPostWithPresence = () => {
207
+ return <FeedPostDemo userStatus='active'/>;
208
+ };
209
+ export const FeedPostWithJSX = () => {
210
+ const data = [
211
+ {
212
+ id: '123',
213
+ name: 'Jane Smith',
214
+ dob: '12/31/1990',
215
+ address: 'Boston, MA',
216
+ email: 'jsmith@email.com',
217
+ balance: '$2,200'
218
+ },
219
+ {
220
+ id: '456',
221
+ name: 'Joe Smith',
222
+ dob: '01/01/1980',
223
+ address: '',
224
+ email: 'joe.smith@email.com',
225
+ balance: '$1,350'
226
+ },
227
+ {
228
+ id: '789',
229
+ name: 'Mirian Lou',
230
+ dob: '02/29/1985',
231
+ address: (<>
232
+ <div>100 Main St.</div>
233
+ <div>Cambridge, MA</div>
234
+ </>),
235
+ email: '',
236
+ balance: '$10'
237
+ }
238
+ ];
239
+ const columns = [
240
+ { renderer: 'name', label: 'Name' },
241
+ { renderer: 'dob', label: 'Date of Birth' },
242
+ { renderer: 'address', label: 'Address' },
243
+ { renderer: 'email', label: 'Email' },
244
+ { renderer: 'balance', label: 'Account Balance', align: 'right' }
245
+ ];
246
+ return (<Feed userInfo={{ username: 'demo_user', fullname: 'Demo User' }} posts={[<FeedPostDemo content={<Table columns={columns} data={data}/>} replies={[]}/>]}/>);
247
+ };
248
+ //# sourceMappingURL=FeedPost.stories.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedPost.stories.jsx","sourceRoot":"","sources":["../../../src/social/Feed/FeedPost.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,MAA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QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;QACnC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE;QAC3C,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;QACzC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QACrC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE;KAClE,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAC3D,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAG,CAAC,CAAC,EACzF,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState } from 'react';\n\nimport {\n Avatar,\n CardContent,\n Link,\n MenuItemProps,\n Popover,\n SummaryListItem,\n Table,\n ColumnProps,\n useUID\n} from '@pega/cosmos-react-core';\nimport {\n HashtagButtonConfig,\n MentionButtonConfig,\n Feed,\n FeedPost,\n AttachedFiles\n} from '@pega/cosmos-react-social';\nimport { Glimpse, GlimpseProps } from '@pega/cosmos-react-work';\n\nimport { FeedReplyDemo } from './FeedReply.stories';\nimport {\n generatedLikes,\n caseMentions,\n userMentions,\n availableRecipients,\n FeedPostDemoProps\n} from './Feed.mocks';\n\nexport default {\n title: 'Social/Feed/FeedPost',\n component: FeedPost\n} as Meta;\n\nexport const FeedPostDemo = ({\n fullname = 'Katie Smith',\n username = 'katie_smith',\n content,\n postType,\n recipients,\n attachments: postAttachments,\n replies,\n timeElapsed: time,\n userStatus,\n likes: userLikes,\n likeCount: userLikeCount,\n onDelete = () => {},\n renderFeed = true\n}: FeedPostDemoProps) => {\n const defaultContent = postAttachments\n ? ''\n : 'This post mentions @deans:Seth DeAngelo:user: and also contains a tag! #cosmos:';\n\n const defaultReplies = [...new Array(12).keys()].map(index => {\n return (\n <FeedReplyDemo\n key={`reply-story-${index + 1}`}\n fullname={fullname}\n content={`This is reply number ${index + 1}!`}\n renderFeed={false}\n />\n );\n });\n\n const key = useUID();\n const [postContent, setPostContent] = useState(content || defaultContent);\n const [searchResults, setSearchResults] = useState<MenuItemProps[]>([]);\n\n const [likes, setLikes] = useState<SummaryListItem[]>([]);\n const [liked, setLiked] = useState(false);\n const [likeCount, setLikeCount] = useState<number>(\n userLikeCount || (renderFeed ? generatedLikes.length : 0)\n );\n const [recipientsList, setRecipientsList] = useState<MenuItemProps[]>([]);\n const [edited, setEdited] = useState(false);\n const [timeElapsed, setTimeElapsed] = useState(time || '4 days ago');\n\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [popoverTarget, setPopoverTarget] = useState<Element>();\n\n const [extraReplies, setExtraReplies] = useState<any[]>([]);\n const [replyAttachments, setReplyAttachments] = useState<AttachedFiles[]>([]);\n const [replyCount, setReplyCount] = useState<number>(\n replies ? replies.length : defaultReplies.length\n );\n const [repliesLoading, setRepliesLoading] = useState(false);\n const [repliesShown, setRepliesShown] = useState(3);\n\n const [additionalLikeAdded, setAdditionalLikeAdded] = useState(false);\n const [allRecipientsVisible, setAllRecipientsVisible] = useState(false);\n\n const onShowMoreReplies = () => {\n setRepliesLoading(true);\n setTimeout(() => {\n setRepliesShown(curr => {\n if (curr + 3 <= defaultReplies.length) return curr + 3;\n return defaultReplies.length;\n });\n setRepliesLoading(false);\n }, 1000);\n };\n\n const onShowLessReplies = () => {\n setRepliesLoading(true);\n setTimeout(() => {\n setRepliesShown(3);\n setRepliesLoading(false);\n }, 1000);\n };\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 setReplyAttachments?.(current => {\n return current.filter(x => x.name !== file.name);\n });\n };\n });\n\n setReplyAttachments(files);\n };\n\n const getInitialLikes = () => {\n if (likes.length) return;\n\n setLikes(userLikes || (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 getInitialRecipients = () => {\n if (recipientsList.length) return;\n\n setRecipientsList(\n recipients ||\n availableRecipients.slice(0, !allRecipientsVisible ? 10 : availableRecipients.length)\n );\n };\n\n const getAllRecipients = () => {\n setTimeout(() => {\n setAllRecipientsVisible(true);\n setRecipientsList(recipients || availableRecipients);\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 post = (\n <>\n <FeedPost\n id={key}\n key={key}\n info={{\n fullname,\n username,\n timeElapsed,\n content: postContent,\n postType,\n recipients: recipientsList,\n recipientsCount: recipients ? recipients.length : availableRecipients.length,\n attachments: postAttachments,\n liked,\n postContext: renderFeed ? (\n <Link href='https://www.pega.com' target='_blank'>\n Pega\n </Link>\n ) : undefined,\n userStatus\n }}\n interactionInfo={{\n likeLabel: 'Like',\n likes,\n likeCount: likeCount >= 10 ? likeCount + 1 : likeCount,\n commentLabel: 'Comment'\n }}\n maxContentHeight={80}\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 onRecipientInteraction={getInitialRecipients}\n onLoadMoreRecipients={!allRecipientsVisible ? getAllRecipients : undefined}\n onUserClick={(_, clickEvent) => {\n if (clickEvent) {\n setPopoverTarget(clickEvent.target as Element);\n setPopoverOpen(curr => !curr);\n }\n }}\n menuItems={[\n { primary: 'Custom action', id: 'custom', onClick: () => {} },\n { primary: 'Delete', id: 'delete', onClick: onDelete }\n ]}\n onEditSubmit={({ value }) => {\n setPostContent(value);\n setEdited(true);\n setTimeElapsed('Just now');\n }}\n edited={edited}\n replies={\n replies\n ? [...replies, ...extraReplies]\n : [...defaultReplies.slice(-repliesShown), ...extraReplies]\n }\n replyCount={replyCount}\n repliesLoading={repliesLoading}\n onShowMoreReplies={onShowMoreReplies}\n onShowLessReplies={repliesShown > 3 ? onShowLessReplies : undefined}\n replyInput={{\n commentLabel: 'Send Comment',\n attachments: replyAttachments,\n onFilesAdded,\n onSubmit: replyEvent => {\n setReplyAttachments([]);\n\n replyEvent.attachments.forEach(file => {\n delete file.onDelete;\n file.onPreview = () => {};\n file.onDownload = () => {};\n });\n\n setExtraReplies(oldReplies => [\n ...oldReplies,\n <FeedReplyDemo\n key={`replies-${oldReplies.length}`}\n fullname='Demo User'\n username='demo_user'\n content={replyEvent.value}\n attachments={replyEvent.attachments}\n timeElapsed='Just now'\n renderFeed={false}\n />\n ]);\n setReplyCount(oldReplyCount => oldReplyCount + 1);\n replyEvent.clear();\n },\n placeholder: 'Add a comment'\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 searchTypes={['user', 'case']}\n onDecoratorSearch={onSearch}\n searchResults={searchResults}\n onMentionClick={onMentionClick}\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n userInfo={{ username: 'demo_user', fullname: 'Demo User' }}\n posts={[post]}\n />\n ) : (\n post\n );\n};\n\nexport const FeedPostWithPresence = () => {\n return <FeedPostDemo userStatus='active' />;\n};\n\nexport const FeedPostWithJSX = () => {\n const data = [\n {\n id: '123',\n name: 'Jane Smith',\n dob: '12/31/1990',\n address: 'Boston, MA',\n email: 'jsmith@email.com',\n balance: '$2,200'\n },\n {\n id: '456',\n name: 'Joe Smith',\n dob: '01/01/1980',\n address: '',\n email: 'joe.smith@email.com',\n balance: '$1,350'\n },\n {\n id: '789',\n name: 'Mirian Lou',\n dob: '02/29/1985',\n address: (\n <>\n <div>100 Main St.</div>\n <div>Cambridge, MA</div>\n </>\n ),\n email: '',\n balance: '$10'\n }\n ];\n\n const columns: ColumnProps<typeof data[number]>[] = [\n { renderer: 'name', label: 'Name' },\n { renderer: 'dob', label: 'Date of Birth' },\n { renderer: 'address', label: 'Address' },\n { renderer: 'email', label: 'Email' },\n { renderer: 'balance', label: 'Account Balance', align: 'right' }\n ];\n\n return (\n <Feed\n userInfo={{ username: 'demo_user', fullname: 'Demo User' }}\n posts={[<FeedPostDemo content={<Table columns={columns} data={data} />} replies={[]} />]}\n />\n );\n};\n"]}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ import { FeedReplyProps } from '@pega/cosmos-react-social';
4
+ declare const _default: Meta<import("@storybook/react").Args>;
5
+ export default _default;
6
+ export declare const FeedReplyDemo: ({ fullname, username, content, attachments, timeElapsed: time, userStatus, renderFeed }: {
7
+ fullname?: string | undefined;
8
+ username?: string | undefined;
9
+ content?: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
10
+ attachments?: FeedReplyProps['info']['attachments'];
11
+ timeElapsed?: string | undefined;
12
+ userStatus?: FeedReplyProps['info']['userStatus'];
13
+ renderFeed?: boolean | undefined;
14
+ }) => JSX.Element;
15
+ export declare const FeedReplyWithPresence: () => JSX.Element;
16
+ //# sourceMappingURL=FeedReply.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedReply.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Feed/FeedReply.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIxC,OAAO,EAGL,cAAc,EAGf,MAAM,2BAA2B,CAAC;;AAKnC,wBAGU;AAEV,eAAO,MAAM,aAAa;;;;kBAYV,cAAc,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;;iBAEtC,cAAc,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;;iBAsHlD,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAEjC,CAAC"}