@pega/cosmos-react-demos 2.1.2 → 3.0.0-dev.2.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 (580) hide show
  1. package/jsx/build/AppHeader/AppHeader.stories.d.ts +2 -1
  2. package/jsx/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
  3. package/jsx/build/AppHeader/AppHeader.stories.jsx +46 -13
  4. package/jsx/build/AppHeader/AppHeader.stories.jsx.map +1 -1
  5. package/jsx/build/AppShell/AppShell.stories.d.ts +2 -1
  6. package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
  7. package/jsx/build/AppShell/AppShell.stories.jsx +46 -13
  8. package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
  9. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts +7 -0
  10. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -0
  11. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js +50 -0
  12. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -0
  13. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +9 -0
  14. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -0
  15. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx +45 -0
  16. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -0
  17. package/jsx/build/LifeCycle/LifeCycle.mocks.js +1 -1
  18. package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  19. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  20. package/jsx/build/LifeCycle/LifeCycle.stories.jsx +52 -34
  21. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  22. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  23. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +2 -6
  24. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  25. package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
  26. package/jsx/build/Workbench/Workbench.stories.jsx +10 -12
  27. package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
  28. package/jsx/core/AppShell/AppShell.stories.d.ts +5 -0
  29. package/jsx/core/AppShell/AppShell.stories.d.ts.map +1 -1
  30. package/jsx/core/AppShell/AppShell.stories.jsx +25 -1
  31. package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
  32. package/jsx/core/Avatar/Avatar.stories.d.ts +5 -0
  33. package/jsx/core/Avatar/Avatar.stories.d.ts.map +1 -1
  34. package/jsx/core/Avatar/Avatar.stories.jsx +32 -5
  35. package/jsx/core/Avatar/Avatar.stories.jsx.map +1 -1
  36. package/jsx/core/Badges/Status.stories.d.ts +5 -0
  37. package/jsx/core/Badges/Status.stories.d.ts.map +1 -1
  38. package/jsx/core/Badges/Status.stories.jsx +25 -1
  39. package/jsx/core/Badges/Status.stories.jsx.map +1 -1
  40. package/jsx/core/Banner/Banner.mocks.d.ts +18 -0
  41. package/jsx/core/Banner/Banner.mocks.d.ts.map +1 -0
  42. package/jsx/core/Banner/Banner.mocks.jsx +41 -0
  43. package/jsx/core/Banner/Banner.mocks.jsx.map +1 -0
  44. package/jsx/core/Banner/Banner.stories.d.ts +5 -1
  45. package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
  46. package/jsx/core/Banner/Banner.stories.jsx +22 -39
  47. package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
  48. package/jsx/core/Button/Button.stories.d.ts +8 -0
  49. package/jsx/core/Button/Button.stories.d.ts.map +1 -1
  50. package/jsx/core/Button/Button.stories.jsx +32 -3
  51. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  52. package/jsx/core/Card/Card.stories.d.ts +5 -0
  53. package/jsx/core/Card/Card.stories.d.ts.map +1 -1
  54. package/jsx/core/Card/Card.stories.jsx +30 -1
  55. package/jsx/core/Card/Card.stories.jsx.map +1 -1
  56. package/jsx/core/Checkbox/Checkbox.stories.d.ts +12 -0
  57. package/jsx/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  58. package/jsx/core/Checkbox/Checkbox.stories.jsx +54 -1
  59. package/jsx/core/Checkbox/Checkbox.stories.jsx.map +1 -1
  60. package/jsx/core/Configuration/Configuration.stories.d.ts +17 -0
  61. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  62. package/jsx/core/Configuration/Configuration.stories.jsx +94 -3
  63. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  64. package/jsx/core/DateTime/DateTimeDisplay.stories.jsx +1 -0
  65. package/jsx/core/DateTime/DateTimeDisplay.stories.jsx.map +1 -1
  66. package/jsx/core/ExpandCollapse/ExpandCollapse.styles.d.ts.map +1 -1
  67. package/jsx/core/ExpandCollapse/ExpandCollapse.styles.js +5 -0
  68. package/jsx/core/ExpandCollapse/ExpandCollapse.styles.js.map +1 -1
  69. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +21 -0
  70. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -0
  71. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +36 -0
  72. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -0
  73. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  74. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +1 -34
  75. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
  76. package/jsx/core/File/FileDisplay.stories.d.ts +8 -1
  77. package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
  78. package/jsx/core/File/FileDisplay.stories.jsx +37 -2
  79. package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
  80. package/jsx/core/Flex/Flex.styles.d.ts +2 -2
  81. package/jsx/core/Flex/Flex.styles.d.ts.map +1 -1
  82. package/jsx/core/Flex/Flex.styles.js +17 -17
  83. package/jsx/core/Flex/Flex.styles.js.map +1 -1
  84. package/jsx/core/Flex/FlexContainer.stories.d.ts +2 -0
  85. package/jsx/core/Flex/FlexContainer.stories.d.ts.map +1 -1
  86. package/jsx/core/Flex/FlexContainer.stories.jsx +45 -32
  87. package/jsx/core/Flex/FlexContainer.stories.jsx.map +1 -1
  88. package/jsx/core/Flex/FlexItem.stories.jsx +13 -13
  89. package/jsx/core/Flex/FlexItem.stories.jsx.map +1 -1
  90. package/jsx/core/Form/Form.mocks.d.ts +8 -0
  91. package/jsx/core/Form/Form.mocks.d.ts.map +1 -0
  92. package/jsx/core/Form/Form.mocks.jsx +138 -0
  93. package/jsx/core/Form/Form.mocks.jsx.map +1 -0
  94. package/jsx/core/Form/Form.stories.d.ts +10 -7
  95. package/jsx/core/Form/Form.stories.d.ts.map +1 -1
  96. package/jsx/core/Form/Form.stories.jsx +44 -138
  97. package/jsx/core/Form/Form.stories.jsx.map +1 -1
  98. package/jsx/core/Grid/Grid.styles.d.ts +2 -2
  99. package/jsx/core/Grid/Grid.styles.d.ts.map +1 -1
  100. package/jsx/core/Grid/Grid.styles.js +4 -4
  101. package/jsx/core/Grid/Grid.styles.js.map +1 -1
  102. package/jsx/core/Grid/GridContainer.stories.d.ts +6 -5
  103. package/jsx/core/Grid/GridContainer.stories.d.ts.map +1 -1
  104. package/jsx/core/Grid/GridContainer.stories.jsx +51 -44
  105. package/jsx/core/Grid/GridContainer.stories.jsx.map +1 -1
  106. package/jsx/core/Grid/GridItem.stories.d.ts +2 -2
  107. package/jsx/core/Grid/GridItem.stories.d.ts.map +1 -1
  108. package/jsx/core/Grid/GridItem.stories.jsx +28 -28
  109. package/jsx/core/Grid/GridItem.stories.jsx.map +1 -1
  110. package/jsx/core/Icon/Icon.mocks.d.ts +3 -0
  111. package/jsx/core/Icon/Icon.mocks.d.ts.map +1 -0
  112. package/jsx/core/Icon/Icon.mocks.jsx +9 -0
  113. package/jsx/core/Icon/Icon.mocks.jsx.map +1 -0
  114. package/jsx/core/Icon/Icon.stories.d.ts +1 -0
  115. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  116. package/jsx/core/Icon/Icon.stories.jsx +7 -1
  117. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  118. package/jsx/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
  119. package/jsx/core/IconPicker/IconPicker.stories.jsx +0 -1
  120. package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
  121. package/jsx/core/Input/Input.stories.d.ts +9 -0
  122. package/jsx/core/Input/Input.stories.d.ts.map +1 -1
  123. package/jsx/core/Input/Input.stories.jsx +40 -1
  124. package/jsx/core/Input/Input.stories.jsx.map +1 -1
  125. package/jsx/core/Label/Label.stories.d.ts +4 -0
  126. package/jsx/core/Label/Label.stories.d.ts.map +1 -1
  127. package/jsx/core/Label/Label.stories.jsx +18 -1
  128. package/jsx/core/Label/Label.stories.jsx.map +1 -1
  129. package/jsx/core/Lightbox/Lightbox.mocks.d.ts +15 -0
  130. package/jsx/core/Lightbox/Lightbox.mocks.d.ts.map +1 -0
  131. package/jsx/core/Lightbox/Lightbox.mocks.js +59 -0
  132. package/jsx/core/Lightbox/Lightbox.mocks.js.map +1 -0
  133. package/jsx/core/Lightbox/Lightbox.stories.d.ts +7 -6
  134. package/jsx/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
  135. package/jsx/core/Lightbox/Lightbox.stories.jsx +14 -65
  136. package/jsx/core/Lightbox/Lightbox.stories.jsx.map +1 -1
  137. package/jsx/core/Link/Link.stories.d.ts +11 -1
  138. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  139. package/jsx/core/Link/Link.stories.jsx +22 -5
  140. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  141. package/jsx/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
  142. package/jsx/core/List/CommaSeparatedList.stories.jsx +17 -19
  143. package/jsx/core/List/CommaSeparatedList.stories.jsx.map +1 -1
  144. package/jsx/core/List/OrderedList.stories.d.ts.map +1 -1
  145. package/jsx/core/List/OrderedList.stories.jsx +10 -10
  146. package/jsx/core/List/OrderedList.stories.jsx.map +1 -1
  147. package/jsx/core/List/UnorderedList.stories.d.ts.map +1 -1
  148. package/jsx/core/List/UnorderedList.stories.jsx +10 -10
  149. package/jsx/core/List/UnorderedList.stories.jsx.map +1 -1
  150. package/jsx/core/Menu/Menu.stories.d.ts +3 -3
  151. package/jsx/core/Menu/Menu.stories.d.ts.map +1 -1
  152. package/jsx/core/Menu/Menu.stories.jsx +8 -12
  153. package/jsx/core/Menu/Menu.stories.jsx.map +1 -1
  154. package/jsx/core/Modal/Modal.mocks.jsx +1 -1
  155. package/jsx/core/Modal/Modal.mocks.jsx.map +1 -1
  156. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  157. package/jsx/core/Number/Number.stories.jsx +1 -4
  158. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  159. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts +5 -2
  160. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  161. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +3 -3
  162. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  163. package/jsx/core/Paragraph/ParagraphDisplay.stories.jsx +3 -0
  164. package/jsx/core/Paragraph/ParagraphDisplay.stories.jsx.map +1 -1
  165. package/jsx/core/Popover/Popover.stories.d.ts +1 -2
  166. package/jsx/core/Popover/Popover.stories.d.ts.map +1 -1
  167. package/jsx/core/Popover/Popover.stories.jsx +35 -37
  168. package/jsx/core/Popover/Popover.stories.jsx.map +1 -1
  169. package/jsx/core/Progress/Progress.stories.d.ts +4 -0
  170. package/jsx/core/Progress/Progress.stories.d.ts.map +1 -1
  171. package/jsx/core/Progress/Progress.stories.jsx +22 -1
  172. package/jsx/core/Progress/Progress.stories.jsx.map +1 -1
  173. package/jsx/core/RadioButton/RadioButton.stories.d.ts +12 -0
  174. package/jsx/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  175. package/jsx/core/RadioButton/RadioButton.stories.jsx +53 -1
  176. package/jsx/core/RadioButton/RadioButton.stories.jsx.map +1 -1
  177. package/jsx/core/Rating/Rating.stories.d.ts +8 -1
  178. package/jsx/core/Rating/Rating.stories.d.ts.map +1 -1
  179. package/jsx/core/Rating/Rating.stories.jsx +21 -4
  180. package/jsx/core/Rating/Rating.stories.jsx.map +1 -1
  181. package/jsx/core/SearchInput/SearchInput.stories.d.ts +4 -0
  182. package/jsx/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  183. package/jsx/core/SearchInput/SearchInput.stories.jsx +18 -1
  184. package/jsx/core/SearchInput/SearchInput.stories.jsx.map +1 -1
  185. package/jsx/core/Select/Select.stories.d.ts +8 -0
  186. package/jsx/core/Select/Select.stories.d.ts.map +1 -1
  187. package/jsx/core/Select/Select.stories.jsx +35 -1
  188. package/jsx/core/Select/Select.stories.jsx.map +1 -1
  189. package/jsx/core/Sentiment/Sentiment.stories.d.ts +6 -0
  190. package/jsx/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
  191. package/jsx/core/Sentiment/Sentiment.stories.jsx +37 -6
  192. package/jsx/core/Sentiment/Sentiment.stories.jsx.map +1 -1
  193. package/jsx/core/SummaryList/SummaryList.stories.jsx +1 -1
  194. package/jsx/core/SummaryList/SummaryList.stories.jsx.map +1 -1
  195. package/jsx/core/Switch/Switch.stories.d.ts +7 -0
  196. package/jsx/core/Switch/Switch.stories.d.ts.map +1 -1
  197. package/jsx/core/Switch/Switch.stories.jsx +34 -1
  198. package/jsx/core/Switch/Switch.stories.jsx.map +1 -1
  199. package/jsx/core/Table/Table.stories.d.ts +25 -0
  200. package/jsx/core/Table/Table.stories.d.ts.map +1 -1
  201. package/jsx/core/Table/Table.stories.jsx +120 -1
  202. package/jsx/core/Table/Table.stories.jsx.map +1 -1
  203. package/jsx/core/Tabs/Tabs.stories.d.ts +5 -0
  204. package/jsx/core/Tabs/Tabs.stories.d.ts.map +1 -1
  205. package/jsx/core/Tabs/Tabs.stories.jsx +39 -1
  206. package/jsx/core/Tabs/Tabs.stories.jsx.map +1 -1
  207. package/jsx/core/Text/Text.stories.d.ts +19 -0
  208. package/jsx/core/Text/Text.stories.d.ts.map +1 -1
  209. package/jsx/core/Text/Text.stories.jsx +112 -1
  210. package/jsx/core/Text/Text.stories.jsx.map +1 -1
  211. package/jsx/core/TextArea/TextArea.stories.d.ts +5 -0
  212. package/jsx/core/TextArea/TextArea.stories.d.ts.map +1 -1
  213. package/jsx/core/TextArea/TextArea.stories.jsx +22 -1
  214. package/jsx/core/TextArea/TextArea.stories.jsx.map +1 -1
  215. package/jsx/core/Toaster/Toaster.stories.d.ts.map +1 -1
  216. package/jsx/core/Toaster/Toaster.stories.jsx +8 -3
  217. package/jsx/core/Toaster/Toaster.stories.jsx.map +1 -1
  218. package/jsx/core/Tooltip/Tooltip.stories.d.ts +6 -0
  219. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  220. package/jsx/core/Tooltip/Tooltip.stories.jsx +28 -1
  221. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  222. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +1 -1
  223. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
  224. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  225. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +12 -10
  226. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  227. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +1 -2
  228. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  229. package/jsx/cs/TaskManager/TaskManager.mocks.js +5 -10
  230. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  231. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +8 -3
  232. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  233. package/jsx/cs/TaskManager/TaskManager.stories.jsx +164 -132
  234. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  235. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx +1 -1
  236. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  237. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts +1 -0
  238. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  239. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx +19 -2
  240. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -1
  241. package/jsx/social/Chat/Chat.stories.d.ts +31 -22
  242. package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
  243. package/jsx/social/Chat/Chat.stories.jsx +106 -153
  244. package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
  245. package/jsx/social/Email/Email.mocks.d.ts +1 -2
  246. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  247. package/jsx/social/Email/{Email.mocks.jsx → Email.mocks.js} +2 -3
  248. package/jsx/social/Email/Email.mocks.js.map +1 -0
  249. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  250. package/jsx/social/Email/Email.stories.jsx +7 -8
  251. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  252. package/jsx/social/Feed/FeedNewPost.stories.jsx +1 -1
  253. package/jsx/social/Feed/FeedNewPost.stories.jsx.map +1 -1
  254. package/jsx/social/Feed/FeedPost.stories.jsx +1 -1
  255. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  256. package/jsx/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
  257. package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx +6 -7
  258. package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx.map +1 -1
  259. package/jsx/work/CaseView/FileService.mock.d.ts.map +1 -1
  260. package/jsx/work/CaseView/FileService.mock.jsx +6 -2
  261. package/jsx/work/CaseView/FileService.mock.jsx.map +1 -1
  262. package/jsx/work/Confirmation/Confirmation.stories.d.ts +1 -1
  263. package/jsx/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
  264. package/jsx/work/Confirmation/Confirmation.stories.jsx +14 -3
  265. package/jsx/work/Confirmation/Confirmation.stories.jsx.map +1 -1
  266. package/jsx/work/Confirmation/Confirmation.styles.d.ts +2 -0
  267. package/jsx/work/Confirmation/Confirmation.styles.d.ts.map +1 -0
  268. package/jsx/work/Confirmation/Confirmation.styles.js +7 -0
  269. package/jsx/work/Confirmation/Confirmation.styles.js.map +1 -0
  270. package/jsx/work/Details/Details.stories.jsx +3 -3
  271. package/jsx/work/Details/Details.stories.jsx.map +1 -1
  272. package/jsx/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  273. package/jsx/work/SearchResults/SearchResults.stories.jsx +3 -9
  274. package/jsx/work/SearchResults/SearchResults.stories.jsx.map +1 -1
  275. package/jsx/work/SearchResults/SearchResults.styles.d.ts +5 -0
  276. package/jsx/work/SearchResults/SearchResults.styles.d.ts.map +1 -0
  277. package/jsx/work/SearchResults/SearchResults.styles.js +12 -0
  278. package/jsx/work/SearchResults/SearchResults.styles.js.map +1 -0
  279. package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts +17 -0
  280. package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -0
  281. package/jsx/work/Stakeholders/Stakeholders.mocks.jsx +32 -0
  282. package/jsx/work/Stakeholders/Stakeholders.mocks.jsx.map +1 -0
  283. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts +2 -5
  284. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  285. package/jsx/work/Stakeholders/Stakeholders.stories.jsx +2 -30
  286. package/jsx/work/Stakeholders/Stakeholders.stories.jsx.map +1 -1
  287. package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
  288. package/jsx/work/Timeline/Timeline.stories.jsx +2 -2
  289. package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
  290. package/lib/build/AppHeader/AppHeader.stories.d.ts +2 -1
  291. package/lib/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
  292. package/lib/build/AppHeader/AppHeader.stories.js +46 -13
  293. package/lib/build/AppHeader/AppHeader.stories.js.map +1 -1
  294. package/lib/build/AppShell/AppShell.stories.d.ts +2 -1
  295. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
  296. package/lib/build/AppShell/AppShell.stories.js +46 -13
  297. package/lib/build/AppShell/AppShell.stories.js.map +1 -1
  298. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +7 -0
  299. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -0
  300. package/lib/build/ItemLibrary/LibraryPicker.mocks.js +50 -0
  301. package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -0
  302. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +9 -0
  303. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -0
  304. package/lib/build/ItemLibrary/LibraryPicker.stories.js +40 -0
  305. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -0
  306. package/lib/build/LifeCycle/LifeCycle.mocks.js +1 -1
  307. package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  308. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  309. package/lib/build/LifeCycle/LifeCycle.stories.js +52 -48
  310. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  311. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  312. package/lib/build/PageTemplates/PageTemplates.stories.js +2 -2
  313. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  314. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  315. package/lib/build/Workbench/Workbench.stories.js +15 -17
  316. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  317. package/lib/core/AppShell/AppShell.stories.d.ts +5 -0
  318. package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -1
  319. package/lib/core/AppShell/AppShell.stories.js +23 -1
  320. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  321. package/lib/core/Avatar/Avatar.stories.d.ts +5 -0
  322. package/lib/core/Avatar/Avatar.stories.d.ts.map +1 -1
  323. package/lib/core/Avatar/Avatar.stories.js +30 -5
  324. package/lib/core/Avatar/Avatar.stories.js.map +1 -1
  325. package/lib/core/Badges/Status.stories.d.ts +5 -0
  326. package/lib/core/Badges/Status.stories.d.ts.map +1 -1
  327. package/lib/core/Badges/Status.stories.js +23 -1
  328. package/lib/core/Badges/Status.stories.js.map +1 -1
  329. package/lib/core/Banner/Banner.mocks.d.ts +18 -0
  330. package/lib/core/Banner/Banner.mocks.d.ts.map +1 -0
  331. package/lib/core/Banner/Banner.mocks.js +36 -0
  332. package/lib/core/Banner/Banner.mocks.js.map +1 -0
  333. package/lib/core/Banner/Banner.stories.d.ts +5 -1
  334. package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
  335. package/lib/core/Banner/Banner.stories.js +21 -33
  336. package/lib/core/Banner/Banner.stories.js.map +1 -1
  337. package/lib/core/Button/Button.stories.d.ts +8 -0
  338. package/lib/core/Button/Button.stories.d.ts.map +1 -1
  339. package/lib/core/Button/Button.stories.js +29 -2
  340. package/lib/core/Button/Button.stories.js.map +1 -1
  341. package/lib/core/Card/Card.stories.d.ts +5 -0
  342. package/lib/core/Card/Card.stories.d.ts.map +1 -1
  343. package/lib/core/Card/Card.stories.js +19 -1
  344. package/lib/core/Card/Card.stories.js.map +1 -1
  345. package/lib/core/Checkbox/Checkbox.stories.d.ts +12 -0
  346. package/lib/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  347. package/lib/core/Checkbox/Checkbox.stories.js +52 -1
  348. package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
  349. package/lib/core/Configuration/Configuration.stories.d.ts +17 -0
  350. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  351. package/lib/core/Configuration/Configuration.stories.js +62 -3
  352. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  353. package/lib/core/DateTime/DateTimeDisplay.stories.js +1 -0
  354. package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
  355. package/lib/core/ExpandCollapse/ExpandCollapse.styles.d.ts.map +1 -1
  356. package/lib/core/ExpandCollapse/ExpandCollapse.styles.js +5 -0
  357. package/lib/core/ExpandCollapse/ExpandCollapse.styles.js.map +1 -1
  358. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +21 -0
  359. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -0
  360. package/lib/core/FieldGroup/FieldGroupList.mocks.js +38 -0
  361. package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -0
  362. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  363. package/lib/core/FieldGroup/FieldGroupList.stories.js +1 -35
  364. package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
  365. package/lib/core/File/FileDisplay.stories.d.ts +8 -1
  366. package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
  367. package/lib/core/File/FileDisplay.stories.js +32 -2
  368. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  369. package/lib/core/Flex/Flex.styles.d.ts +2 -2
  370. package/lib/core/Flex/Flex.styles.d.ts.map +1 -1
  371. package/lib/core/Flex/Flex.styles.js +17 -17
  372. package/lib/core/Flex/Flex.styles.js.map +1 -1
  373. package/lib/core/Flex/FlexContainer.stories.d.ts +2 -0
  374. package/lib/core/Flex/FlexContainer.stories.d.ts.map +1 -1
  375. package/lib/core/Flex/FlexContainer.stories.js +10 -7
  376. package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
  377. package/lib/core/Flex/FlexItem.stories.js +4 -4
  378. package/lib/core/Flex/FlexItem.stories.js.map +1 -1
  379. package/lib/core/Form/Form.mocks.d.ts +8 -0
  380. package/lib/core/Form/Form.mocks.d.ts.map +1 -0
  381. package/lib/core/Form/Form.mocks.js +97 -0
  382. package/lib/core/Form/Form.mocks.js.map +1 -0
  383. package/lib/core/Form/Form.stories.d.ts +10 -7
  384. package/lib/core/Form/Form.stories.d.ts.map +1 -1
  385. package/lib/core/Form/Form.stories.js +42 -96
  386. package/lib/core/Form/Form.stories.js.map +1 -1
  387. package/lib/core/Grid/Grid.styles.d.ts +2 -2
  388. package/lib/core/Grid/Grid.styles.d.ts.map +1 -1
  389. package/lib/core/Grid/Grid.styles.js +4 -4
  390. package/lib/core/Grid/Grid.styles.js.map +1 -1
  391. package/lib/core/Grid/GridContainer.stories.d.ts +6 -5
  392. package/lib/core/Grid/GridContainer.stories.d.ts.map +1 -1
  393. package/lib/core/Grid/GridContainer.stories.js +27 -24
  394. package/lib/core/Grid/GridContainer.stories.js.map +1 -1
  395. package/lib/core/Grid/GridItem.stories.d.ts +2 -2
  396. package/lib/core/Grid/GridItem.stories.d.ts.map +1 -1
  397. package/lib/core/Grid/GridItem.stories.js +10 -10
  398. package/lib/core/Grid/GridItem.stories.js.map +1 -1
  399. package/lib/core/Icon/Icon.mocks.d.ts +3 -0
  400. package/lib/core/Icon/Icon.mocks.d.ts.map +1 -0
  401. package/lib/core/Icon/Icon.mocks.js +10 -0
  402. package/lib/core/Icon/Icon.mocks.js.map +1 -0
  403. package/lib/core/Icon/Icon.stories.d.ts +1 -0
  404. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  405. package/lib/core/Icon/Icon.stories.js +7 -1
  406. package/lib/core/Icon/Icon.stories.js.map +1 -1
  407. package/lib/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
  408. package/lib/core/IconPicker/IconPicker.stories.js +0 -1
  409. package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
  410. package/lib/core/Input/Input.stories.d.ts +9 -0
  411. package/lib/core/Input/Input.stories.d.ts.map +1 -1
  412. package/lib/core/Input/Input.stories.js +38 -1
  413. package/lib/core/Input/Input.stories.js.map +1 -1
  414. package/lib/core/Label/Label.stories.d.ts +4 -0
  415. package/lib/core/Label/Label.stories.d.ts.map +1 -1
  416. package/lib/core/Label/Label.stories.js +16 -1
  417. package/lib/core/Label/Label.stories.js.map +1 -1
  418. package/lib/core/Lightbox/Lightbox.mocks.d.ts +15 -0
  419. package/lib/core/Lightbox/Lightbox.mocks.d.ts.map +1 -0
  420. package/lib/core/Lightbox/Lightbox.mocks.js +67 -0
  421. package/lib/core/Lightbox/Lightbox.mocks.js.map +1 -0
  422. package/lib/core/Lightbox/Lightbox.stories.d.ts +7 -6
  423. package/lib/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
  424. package/lib/core/Lightbox/Lightbox.stories.js +14 -73
  425. package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
  426. package/lib/core/Link/Link.stories.d.ts +11 -1
  427. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  428. package/lib/core/Link/Link.stories.js +7 -4
  429. package/lib/core/Link/Link.stories.js.map +1 -1
  430. package/lib/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
  431. package/lib/core/List/CommaSeparatedList.stories.js +17 -17
  432. package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
  433. package/lib/core/List/OrderedList.stories.d.ts.map +1 -1
  434. package/lib/core/List/OrderedList.stories.js +10 -10
  435. package/lib/core/List/OrderedList.stories.js.map +1 -1
  436. package/lib/core/List/UnorderedList.stories.d.ts.map +1 -1
  437. package/lib/core/List/UnorderedList.stories.js +10 -10
  438. package/lib/core/List/UnorderedList.stories.js.map +1 -1
  439. package/lib/core/Menu/Menu.stories.d.ts +3 -3
  440. package/lib/core/Menu/Menu.stories.d.ts.map +1 -1
  441. package/lib/core/Menu/Menu.stories.js +8 -12
  442. package/lib/core/Menu/Menu.stories.js.map +1 -1
  443. package/lib/core/Modal/Modal.mocks.js +1 -1
  444. package/lib/core/Modal/Modal.mocks.js.map +1 -1
  445. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  446. package/lib/core/Number/Number.stories.js +1 -4
  447. package/lib/core/Number/Number.stories.js.map +1 -1
  448. package/lib/core/PageTemplates/PageTemplates.stories.d.ts +5 -2
  449. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  450. package/lib/core/PageTemplates/PageTemplates.stories.js +3 -3
  451. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  452. package/lib/core/Paragraph/ParagraphDisplay.stories.js +3 -0
  453. package/lib/core/Paragraph/ParagraphDisplay.stories.js.map +1 -1
  454. package/lib/core/Popover/Popover.stories.d.ts +1 -2
  455. package/lib/core/Popover/Popover.stories.d.ts.map +1 -1
  456. package/lib/core/Popover/Popover.stories.js +24 -25
  457. package/lib/core/Popover/Popover.stories.js.map +1 -1
  458. package/lib/core/Progress/Progress.stories.d.ts +4 -0
  459. package/lib/core/Progress/Progress.stories.d.ts.map +1 -1
  460. package/lib/core/Progress/Progress.stories.js +18 -1
  461. package/lib/core/Progress/Progress.stories.js.map +1 -1
  462. package/lib/core/RadioButton/RadioButton.stories.d.ts +12 -0
  463. package/lib/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  464. package/lib/core/RadioButton/RadioButton.stories.js +51 -1
  465. package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
  466. package/lib/core/Rating/Rating.stories.d.ts +8 -1
  467. package/lib/core/Rating/Rating.stories.d.ts.map +1 -1
  468. package/lib/core/Rating/Rating.stories.js +19 -4
  469. package/lib/core/Rating/Rating.stories.js.map +1 -1
  470. package/lib/core/SearchInput/SearchInput.stories.d.ts +4 -0
  471. package/lib/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  472. package/lib/core/SearchInput/SearchInput.stories.js +16 -1
  473. package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
  474. package/lib/core/Select/Select.stories.d.ts +8 -0
  475. package/lib/core/Select/Select.stories.d.ts.map +1 -1
  476. package/lib/core/Select/Select.stories.js +28 -1
  477. package/lib/core/Select/Select.stories.js.map +1 -1
  478. package/lib/core/Sentiment/Sentiment.stories.d.ts +6 -0
  479. package/lib/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
  480. package/lib/core/Sentiment/Sentiment.stories.js +34 -7
  481. package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
  482. package/lib/core/SummaryList/SummaryList.stories.js +1 -1
  483. package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
  484. package/lib/core/Switch/Switch.stories.d.ts +7 -0
  485. package/lib/core/Switch/Switch.stories.d.ts.map +1 -1
  486. package/lib/core/Switch/Switch.stories.js +32 -1
  487. package/lib/core/Switch/Switch.stories.js.map +1 -1
  488. package/lib/core/Table/Table.stories.d.ts +25 -0
  489. package/lib/core/Table/Table.stories.d.ts.map +1 -1
  490. package/lib/core/Table/Table.stories.js +113 -1
  491. package/lib/core/Table/Table.stories.js.map +1 -1
  492. package/lib/core/Tabs/Tabs.stories.d.ts +5 -0
  493. package/lib/core/Tabs/Tabs.stories.d.ts.map +1 -1
  494. package/lib/core/Tabs/Tabs.stories.js +30 -1
  495. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  496. package/lib/core/Text/Text.stories.d.ts +19 -0
  497. package/lib/core/Text/Text.stories.d.ts.map +1 -1
  498. package/lib/core/Text/Text.stories.js +102 -2
  499. package/lib/core/Text/Text.stories.js.map +1 -1
  500. package/lib/core/TextArea/TextArea.stories.d.ts +5 -0
  501. package/lib/core/TextArea/TextArea.stories.d.ts.map +1 -1
  502. package/lib/core/TextArea/TextArea.stories.js +20 -1
  503. package/lib/core/TextArea/TextArea.stories.js.map +1 -1
  504. package/lib/core/Toaster/Toaster.stories.d.ts.map +1 -1
  505. package/lib/core/Toaster/Toaster.stories.js +8 -3
  506. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  507. package/lib/core/Tooltip/Tooltip.stories.d.ts +6 -0
  508. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  509. package/lib/core/Tooltip/Tooltip.stories.js +20 -1
  510. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  511. package/lib/cs/CSCaseView/CSAppShell.stories.js +1 -1
  512. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
  513. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  514. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +12 -10
  515. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  516. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +1 -2
  517. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  518. package/lib/cs/TaskManager/TaskManager.mocks.js +5 -10
  519. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  520. package/lib/cs/TaskManager/TaskManager.stories.d.ts +8 -3
  521. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  522. package/lib/cs/TaskManager/TaskManager.stories.js +142 -119
  523. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  524. package/lib/rte/RichTextEditor/RichTextEditor.stories.js +1 -1
  525. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  526. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts +1 -0
  527. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  528. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +15 -2
  529. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  530. package/lib/social/Chat/Chat.stories.d.ts +33 -22
  531. package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
  532. package/lib/social/Chat/Chat.stories.js +102 -158
  533. package/lib/social/Chat/Chat.stories.js.map +1 -1
  534. package/lib/social/Email/Email.mocks.d.ts +1 -2
  535. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  536. package/lib/social/Email/Email.mocks.js +1 -3
  537. package/lib/social/Email/Email.mocks.js.map +1 -1
  538. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  539. package/lib/social/Email/Email.stories.js +7 -8
  540. package/lib/social/Email/Email.stories.js.map +1 -1
  541. package/lib/social/Feed/FeedNewPost.stories.js +1 -1
  542. package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
  543. package/lib/social/Feed/FeedPost.stories.js +1 -1
  544. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  545. package/lib/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
  546. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js +6 -7
  547. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js.map +1 -1
  548. package/lib/work/CaseView/FileService.mock.d.ts.map +1 -1
  549. package/lib/work/CaseView/FileService.mock.js +6 -2
  550. package/lib/work/CaseView/FileService.mock.js.map +1 -1
  551. package/lib/work/Confirmation/Confirmation.stories.d.ts +1 -1
  552. package/lib/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
  553. package/lib/work/Confirmation/Confirmation.stories.js +12 -4
  554. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  555. package/lib/work/Confirmation/Confirmation.styles.d.ts +2 -0
  556. package/lib/work/Confirmation/Confirmation.styles.d.ts.map +1 -0
  557. package/lib/work/Confirmation/Confirmation.styles.js +7 -0
  558. package/lib/work/Confirmation/Confirmation.styles.js.map +1 -0
  559. package/lib/work/Details/Details.stories.js +3 -3
  560. package/lib/work/Details/Details.stories.js.map +1 -1
  561. package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  562. package/lib/work/SearchResults/SearchResults.stories.js +3 -9
  563. package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
  564. package/lib/work/SearchResults/SearchResults.styles.d.ts +5 -0
  565. package/lib/work/SearchResults/SearchResults.styles.d.ts.map +1 -0
  566. package/lib/work/SearchResults/SearchResults.styles.js +12 -0
  567. package/lib/work/SearchResults/SearchResults.styles.js.map +1 -0
  568. package/lib/work/Stakeholders/Stakeholders.mocks.d.ts +22 -0
  569. package/lib/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -0
  570. package/lib/work/Stakeholders/Stakeholders.mocks.js +36 -0
  571. package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -0
  572. package/lib/work/Stakeholders/Stakeholders.stories.d.ts +2 -5
  573. package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  574. package/lib/work/Stakeholders/Stakeholders.stories.js +3 -34
  575. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  576. package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
  577. package/lib/work/Timeline/Timeline.stories.js +2 -2
  578. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  579. package/package.json +16 -16
  580. package/jsx/social/Email/Email.mocks.jsx.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAoC/C,wBAeU;AAyEV,eAAO,MAAM,WAAW;UAMhB,MAAM;iBACC,OAAO;;;wBA8IrB,CAAC;AAEF,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,cAAc,CAE/C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,cAAc,CAE/C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,cAAc,CAEjD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CA+D5E,CAAC"}
1
+ {"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAe/C,wBAcU;AACV,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,cAAc,CAE/C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,cAAc,CAE/C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,cAAc,CAEjD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CA+D5E,CAAC;AAUF,UAAU,qBAAsB,SAAQ,cAAc;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,qBAAqB,CAwBzD,CAAC"}
@@ -1,15 +1,12 @@
1
- import { useReducer, useRef, useContext, useState } from 'react';
2
- import { Editor as RichTextEditor } from '@pega/cosmos-react-rte';
3
- import { Banner, Button, Checkbox, CheckboxGroup, Flex, Form, FormField, Grid, Input, RadioButton, RadioButtonGroup, Select, Option, TextArea, ToasterContext } from '@pega/cosmos-react-core';
4
- import { FileInputDemo } from '@pega/cosmos-react-demos/lib/core/File/FileInput.stories';
5
- import { FilterableSingleSelect as ComboboxFilterableStory } from '@pega/cosmos-react-demos/lib/core/ComboBox/ComboBox.stories';
1
+ import { useState } from 'react';
2
+ import { Banner, Button, Configuration, Flex, Form, FormField, Input } from '@pega/cosmos-react-core';
3
+ import { FormContent } from './Form.mocks';
6
4
  export default {
7
5
  title: 'Core/Form',
8
6
  component: Form,
9
7
  subcomponents: {
10
8
  FormField
11
9
  },
12
- includeStories: ['OneColumnForm', 'TwoColumnForm', 'ThreeColumnForm', 'SimpleFormDemo'],
13
10
  args: {
14
11
  heading: 'Form demo',
15
12
  description: ''
@@ -19,138 +16,6 @@ export default {
19
16
  description: { control: { type: 'text' } }
20
17
  }
21
18
  };
22
- const initFields = () => {
23
- const common = { value: undefined, status: undefined };
24
- return [
25
- {
26
- ...common,
27
- name: 'name',
28
- required: true,
29
- error: 'Please enter first and last name',
30
- validator() {
31
- if (!this.value)
32
- return false;
33
- return /^[a-z]+\s[a-z]+$/i.test(this.value);
34
- }
35
- },
36
- {
37
- ...common,
38
- name: 'email',
39
- required: true,
40
- error: 'Enter a @pega.com address',
41
- validator() {
42
- if (!this.value)
43
- return false;
44
- return /^\S+@pega\.com$/.test(this.value);
45
- }
46
- },
47
- {
48
- ...common,
49
- name: 'notes',
50
- required: true,
51
- help: 'See how fast you can type 20 characters…go',
52
- error: 'You need to tell us more than 20 characters',
53
- validator() {
54
- if (!this.value)
55
- return false;
56
- return this.value.length >= 20;
57
- }
58
- }
59
- ];
60
- };
61
- const fieldReducer = (fields, { target, type }) => {
62
- return fields.map(field => {
63
- if (field.name === target.name) {
64
- field.value = target.value;
65
- if (type === 'blur' || field.status === 'error') {
66
- if ((field.required || field.value) && !field.validator()) {
67
- field.status = 'error';
68
- field.info = field.error;
69
- }
70
- else {
71
- field.status = undefined;
72
- field.info = field.help;
73
- }
74
- }
75
- }
76
- return field;
77
- });
78
- };
79
- export const FormContent = ({ cols, heading, description, showActions }) => {
80
- const editorRef = useRef(null);
81
- const [fields, setField] = useReducer(fieldReducer, undefined, initFields);
82
- const { push } = useContext(ToasterContext);
83
- const name = fields.find(field => field.name === 'name');
84
- const email = fields.find(field => field.name === 'email');
85
- const notes = fields.find(field => field.name === 'notes');
86
- if (!name || !email || !notes)
87
- return null;
88
- const canSubmit = fields.every(field => field.value && field.validator());
89
- const actions = (<>
90
- <Button name='Cancel' variant='secondary' onClick={() => {
91
- push({ content: 'Form cancelled!' });
92
- }}>
93
- Cancel
94
- </Button>
95
- <Button name='Submit' type='submit' variant='primary' disabled={!canSubmit}>
96
- Submit
97
- </Button>
98
- </>);
99
- const onImageAdded = (image, id) => {
100
- const src = URL.createObjectURL(image);
101
- editorRef.current?.appendImage({ src, alt: image.name }, id);
102
- };
103
- return (<Form actions={showActions ? actions : undefined} description={description} heading={heading} onSubmit={(e) => {
104
- e.preventDefault();
105
- push({ content: 'Form submitted!' });
106
- }} style={{ margin: 'auto', maxWidth: '37.5rem' }}>
107
- <Grid container={{ gap: 1, cols: `repeat(${cols}, minmax(0, 1fr))` }}>
108
- <Input name='name' label='Name' value={name.value} required={name.required} status={name.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
109
-
110
- <Input name='email' value={email.value} type='email' label='Email' required={email.required} status={email.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
111
-
112
- <Grid item={{ colStartEnd: '1/-1' }}>
113
- <CheckboxGroup name='visited' label='Places you have worked'>
114
- {['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (<Checkbox key={office} label={office} onChange={(e) => setField({ ...e })}/>))}
115
- </CheckboxGroup>
116
- </Grid>
117
-
118
- <Grid item={{ colStartEnd: '1/-1' }}>
119
- <RadioButtonGroup name='meetings' label='Do you enjoy early morning meetings?'>
120
- {['Yes', "No… no I don't"].map(option => (<RadioButton key={option} label={option} onChange={(e) => setField({ ...e })}/>))}
121
- </RadioButtonGroup>
122
- </Grid>
123
-
124
- <Select label='What would you like to eat?' info='FYI: options are limited'>
125
- <Option>choose meal…</Option>
126
- <Option>Pizza</Option>
127
- <Option>Sandwich</Option>
128
- <Option>Salad</Option>
129
- </Select>
130
-
131
- <Grid item={{ colStartEnd: '1/-1' }}>
132
- <TextArea name='notes' required={notes.required} label='Meeting Notes' status={notes.status} info={notes.info || notes.help} onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })}/>
133
- </Grid>
134
-
135
- <Grid item={{ colStartEnd: '1/-1' }}>
136
- <RichTextEditor label='Detailed meeting notes' info='The rich text editor can be used in forms, comments, and documents' toolbar={[
137
- 'inline-styling',
138
- 'headers',
139
- 'tables',
140
- 'links',
141
- 'images',
142
- 'lists',
143
- 'cut-copy-paste',
144
- 'indentation'
145
- ]} onImageAdded={onImageAdded} ref={editorRef}/>
146
- </Grid>
147
- <Grid item={{ colStartEnd: '1/-1' }}>
148
- <FileInputDemo />
149
- </Grid>
150
- <ComboboxFilterableStory />
151
- </Grid>
152
- </Form>);
153
- };
154
19
  export const OneColumnForm = (args) => {
155
20
  return <FormContent cols={1} heading={args.heading} description={args.description} showActions/>;
156
21
  };
@@ -193,4 +58,45 @@ SimpleFormDemo.args = {
193
58
  SimpleFormDemo.argTypes = {
194
59
  withBanners: { control: { type: 'boolean' } }
195
60
  };
61
+ export const ConfigurableForm = (args) => {
62
+ return (<Configuration theme={{
63
+ components: {
64
+ 'form-control': {
65
+ 'foreground-color': args.foregroundColor,
66
+ 'background-color': args.backgroundColor,
67
+ 'border-color': args.borderColor,
68
+ 'border-width': args.borderWidth,
69
+ 'border-radius': args.borderRadius,
70
+ ':hover': {
71
+ 'border-color': args.hoverBorderColor
72
+ },
73
+ ':focus': {
74
+ 'border-color': args.focusBorderColor
75
+ }
76
+ }
77
+ }
78
+ }}>
79
+ <FormContent cols={2} showActions/>
80
+ </Configuration>);
81
+ };
82
+ ConfigurableForm.args = {
83
+ foregroundColor: '#000000',
84
+ backgroundColor: '#ffffff',
85
+ borderColor: '#939393',
86
+ borderWidth: '0.0625rem',
87
+ borderRadius: 0.5,
88
+ hoverBorderColor: '#3f3f3f',
89
+ focusBorderColor: 'transparent'
90
+ };
91
+ ConfigurableForm.argTypes = {
92
+ foregroundColor: { control: { type: 'color' } },
93
+ backgroundColor: { control: { type: 'color' } },
94
+ borderColor: { control: { type: 'color' } },
95
+ borderWidth: { control: { type: 'text' } },
96
+ borderRadius: { control: { type: 'number' } },
97
+ hoverBorderColor: { control: { type: 'color' } },
98
+ focusBorderColor: { control: { type: 'color' } },
99
+ heading: { table: { disable: true } },
100
+ description: { table: { disable: true } }
101
+ };
196
102
  //# sourceMappingURL=Form.stories.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.stories.jsx","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAIV,MAAM,EACN,UAAU,EACV,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,MAAM,IAAI,cAAc,EAEzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,IAAI,EAEJ,SAAS,EACT,IAAI,EACJ,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAC;AACzF,OAAO,EAAE,sBAAsB,IAAI,uBAAuB,EAAE,MAAM,6DAA6D,CAAC;AAEhI,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE;QACb,SAAS;KACV;IACD,cAAc,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,CAAC;IACvF,IAAI,EAAE;QACJ,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,EAAE;KAChB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACtC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;KAC3C;CACM,CAAC;AASV,MAAM,UAAU,GAAG,GAAY,EAAE;IAC/B,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,E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AAC,EAAE,CAAC,CAAC;YACf,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,EAEN;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,IAAI,GAAG;IACpB,WAAW,EAAE,KAAK;CACnB,CAAC;AAEF,cAAc,CAAC,QAAQ,GAAG;IACxB,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CAC9C,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport {\n useReducer,\n ChangeEvent,\n FocusEvent,\n FormEvent,\n useRef,\n useContext,\n useState\n} from 'react';\n\nimport {\n Editor as RichTextEditor,\n EditorState as RichTextEditorState\n} from '@pega/cosmos-react-rte';\nimport {\n Banner,\n Button,\n Checkbox,\n CheckboxGroup,\n Flex,\n Form,\n FormControlProps,\n FormField,\n Grid,\n Input,\n RadioButton,\n RadioButtonGroup,\n Select,\n Option,\n TextArea,\n ToasterContext\n} from '@pega/cosmos-react-core';\nimport { FileInputDemo } from '@pega/cosmos-react-demos/lib/core/File/FileInput.stories';\nimport { FilterableSingleSelect as ComboboxFilterableStory } from '@pega/cosmos-react-demos/lib/core/ComboBox/ComboBox.stories';\n\nexport default {\n title: 'Core/Form',\n component: Form,\n subcomponents: {\n FormField\n },\n includeStories: ['OneColumnForm', 'TwoColumnForm', 'ThreeColumnForm', 'SimpleFormDemo'],\n args: {\n heading: 'Form demo',\n description: ''\n },\n argTypes: {\n heading: { control: { type: 'text' } },\n description: { control: { type: 'text' } }\n }\n} as Meta;\n\ninterface Field extends FormControlProps {\n help?: string;\n error?: string;\n validator: (this: Field) => boolean;\n}\n\n// Get initial field properties\nconst initFields = (): Field[] => {\n const common = { value: undefined, status: undefined };\n return [\n {\n ...common,\n name: 'name',\n required: true,\n error: 'Please enter first and last name',\n validator() {\n if (!this.value) return false;\n return /^[a-z]+\\s[a-z]+$/i.test(this.value);\n }\n },\n {\n ...common,\n name: 'email',\n required: true,\n error: 'Enter a @pega.com address',\n validator() {\n if (!this.value) return false;\n return /^\\S+@pega\\.com$/.test(this.value);\n }\n },\n {\n ...common,\n name: 'notes',\n required: true,\n help: 'See how fast you can type 20 characters…go',\n error: 'You need to tell us more than 20 characters',\n validator() {\n if (!this.value) return false;\n return this.value.length >= 20;\n }\n }\n ];\n};\n\n// Handles setting of state for all fields\nconst fieldReducer = (\n fields: Field[],\n {\n target,\n type\n }:\n | ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n | FocusEvent<HTMLInputElement | HTMLTextAreaElement>\n) => {\n return fields.map(field => {\n if (field.name === target.name) {\n field.value = target.value;\n if (type === 'blur' || field.status === 'error') {\n if ((field.required || field.value) && !field.validator()) {\n field.status = 'error';\n field.info = field.error;\n } else {\n field.status = undefined;\n field.info = field.help;\n }\n }\n }\n return field;\n });\n};\n\nexport const FormContent = ({\n cols,\n heading,\n description,\n showActions\n}: {\n cols: number;\n showActions: boolean;\n heading?: string;\n description?: string;\n}) => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [fields, setField] = useReducer(fieldReducer, undefined, initFields);\n const { push } = useContext(ToasterContext);\n\n const name = fields.find(field => field.name === 'name');\n const email = fields.find(field => field.name === 'email');\n const notes = fields.find(field => field.name === 'notes');\n\n if (!name || !email || !notes) return null;\n\n const canSubmit = fields.every(field => field.value && field.validator());\n\n const actions = (\n <>\n <Button\n name='Cancel'\n variant='secondary'\n onClick={() => {\n push({ content: 'Form cancelled!' });\n }}\n >\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary' disabled={!canSubmit}>\n Submit\n </Button>\n </>\n );\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n return (\n <Form\n actions={showActions ? actions : undefined}\n description={description}\n heading={heading}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n push({ content: 'Form submitted!' });\n }}\n style={{ margin: 'auto', maxWidth: '37.5rem' }}\n >\n <Grid container={{ gap: 1, cols: `repeat(${cols}, minmax(0, 1fr))` }}>\n <Input\n name='name'\n label='Name'\n value={name.value}\n required={name.required}\n status={name.status}\n info='some help text here'\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n autoComplete='off'\n />\n\n <Input\n name='email'\n value={email.value}\n type='email'\n label='Email'\n required={email.required}\n status={email.status}\n info='some help text here'\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n autoComplete='off'\n />\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <CheckboxGroup name='visited' label='Places you have worked'>\n {['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (\n <Checkbox\n key={office}\n label={office}\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n />\n ))}\n </CheckboxGroup>\n </Grid>\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <RadioButtonGroup name='meetings' label='Do you enjoy early morning meetings?'>\n {['Yes', \"No… no I don't\"].map(option => (\n <RadioButton\n key={option}\n label={option}\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n />\n ))}\n </RadioButtonGroup>\n </Grid>\n\n <Select label='What would you like to eat?' info='FYI: options are limited'>\n <Option>choose meal…</Option>\n <Option>Pizza</Option>\n <Option>Sandwich</Option>\n <Option>Salad</Option>\n </Select>\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <TextArea\n name='notes'\n required={notes.required}\n label='Meeting Notes'\n status={notes.status}\n info={notes.info || notes.help}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n />\n </Grid>\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <RichTextEditor\n label='Detailed meeting notes'\n info='The rich text editor can be used in forms, comments, and documents'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n ref={editorRef}\n />\n </Grid>\n <Grid item={{ colStartEnd: '1/-1' }}>\n <FileInputDemo />\n </Grid>\n <ComboboxFilterableStory />\n </Grid>\n </Form>\n );\n};\n\ninterface FormStoryProps {\n heading?: string;\n description?: string;\n}\n\nexport const OneColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={1} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const TwoColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={2} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const ThreeColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={3} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const SimpleFormDemo: Story<FormStoryProps & { withBanners?: boolean }> = (\n args: FormStoryProps & { withBanners?: boolean }\n) => {\n const [inputValue, setInputValue] = useState('');\n const [success, setSuccess] = useState('');\n\n const actions = (\n <>\n <Button name='Cancel' variant='secondary' onClick={() => setInputValue('')}>\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary'>\n Submit\n </Button>\n </>\n );\n\n const successBanner = (\n <Banner\n id='success'\n variant='success'\n heading='Success'\n messages={['Form submitted', `Input value: ${success}`]}\n />\n );\n\n const errorBanner = (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n messages={['All required fields in the form must be completed.']}\n />\n );\n\n const banner = success ? successBanner : errorBanner;\n\n return (\n <Form\n banners={args.withBanners ? banner : undefined}\n actions={actions}\n heading={args.heading}\n description={args.description}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n setSuccess(inputValue);\n setInputValue('');\n }}\n >\n <Flex container={{ direction: 'column', itemGap: 2 }}>\n <Input\n label='Name'\n info='Enter your first name'\n required\n value={inputValue}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n setSuccess('');\n setInputValue(e.target.value);\n }}\n />\n </Flex>\n </Form>\n );\n};\n\nSimpleFormDemo.args = {\n withBanners: false\n};\n\nSimpleFormDemo.argTypes = {\n withBanners: { control: { type: 'boolean' } }\n};\n"]}
1
+ {"version":3,"file":"Form.stories.jsx","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACN,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE;QACb,SAAS;KACV;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,EAAE;KAChB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACtC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;KAC3C;CACM,CAAC;AAMV,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,IAAoB,EAAE,EAAE;IAC3E,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,WAAW,EAAG,CAAC;AACpG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,IAAoB,EAAE,EAAE;IAC3E,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CA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E,IAAI,EAAE,MAAM,EAAE,EAAE;IAC1C,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC7C,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAChD,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAChD,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACrC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC1C,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { ChangeEvent, FormEvent, useState } from 'react';\n\nimport {\n Banner,\n Button,\n Configuration,\n Flex,\n Form,\n FormField,\n Input\n} from '@pega/cosmos-react-core';\n\nimport { FormContent } from './Form.mocks';\n\nexport default {\n title: 'Core/Form',\n component: Form,\n subcomponents: {\n FormField\n },\n args: {\n heading: 'Form demo',\n description: ''\n },\n argTypes: {\n heading: { control: { type: 'text' } },\n description: { control: { type: 'text' } }\n }\n} as Meta;\ninterface FormStoryProps {\n heading?: string;\n description?: string;\n}\n\nexport const OneColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={1} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const TwoColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={2} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const ThreeColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={3} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const SimpleFormDemo: Story<FormStoryProps & { withBanners?: boolean }> = (\n args: FormStoryProps & { withBanners?: boolean }\n) => {\n const [inputValue, setInputValue] = useState('');\n const [success, setSuccess] = useState('');\n\n const actions = (\n <>\n <Button name='Cancel' variant='secondary' onClick={() => setInputValue('')}>\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary'>\n Submit\n </Button>\n </>\n );\n\n const successBanner = (\n <Banner\n id='success'\n variant='success'\n heading='Success'\n messages={['Form submitted', `Input value: ${success}`]}\n />\n );\n\n const errorBanner = (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n messages={['All required fields in the form must be completed.']}\n />\n );\n\n const banner = success ? successBanner : errorBanner;\n\n return (\n <Form\n banners={args.withBanners ? banner : undefined}\n actions={actions}\n heading={args.heading}\n description={args.description}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n setSuccess(inputValue);\n setInputValue('');\n }}\n >\n <Flex container={{ direction: 'column', itemGap: 2 }}>\n <Input\n label='Name'\n info='Enter your first name'\n required\n value={inputValue}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n setSuccess('');\n setInputValue(e.target.value);\n }}\n />\n </Flex>\n </Form>\n );\n};\n\nSimpleFormDemo.args = {\n withBanners: false\n};\n\nSimpleFormDemo.argTypes = {\n withBanners: { control: { type: 'boolean' } }\n};\n\ninterface ConfigurableFormProps extends FormStoryProps {\n foregroundColor?: string;\n backgroundColor?: string;\n borderColor?: string;\n borderWidth?: string;\n borderRadius?: number;\n hoverBorderColor?: string;\n focusBorderColor?: string;\n}\n\nexport const ConfigurableForm: Story<ConfigurableFormProps> = (args: ConfigurableFormProps) => {\n return (\n <Configuration\n theme={{\n components: {\n 'form-control': {\n 'foreground-color': args.foregroundColor,\n 'background-color': args.backgroundColor,\n 'border-color': args.borderColor,\n 'border-width': args.borderWidth,\n 'border-radius': args.borderRadius,\n ':hover': {\n 'border-color': args.hoverBorderColor\n },\n ':focus': {\n 'border-color': args.focusBorderColor\n }\n }\n }\n }}\n >\n <FormContent cols={2} showActions />\n </Configuration>\n );\n};\n\nConfigurableForm.args = {\n foregroundColor: '#000000',\n backgroundColor: '#ffffff',\n borderColor: '#939393',\n borderWidth: '0.0625rem',\n borderRadius: 0.5,\n hoverBorderColor: '#3f3f3f',\n focusBorderColor: 'transparent'\n};\n\nConfigurableForm.argTypes = {\n foregroundColor: { control: { type: 'color' } },\n backgroundColor: { control: { type: 'color' } },\n borderColor: { control: { type: 'color' } },\n borderWidth: { control: { type: 'text' } },\n borderRadius: { control: { type: 'number' } },\n hoverBorderColor: { control: { type: 'color' } },\n focusBorderColor: { control: { type: 'color' } },\n heading: { table: { disable: true } },\n description: { table: { disable: true } }\n};\n"]}
@@ -1,6 +1,6 @@
1
- export declare const StyledContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
1
+ export declare const StyledGridContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
2
2
  fitContent?: boolean | undefined;
3
3
  height?: number | undefined;
4
4
  }, never>;
5
- export declare const StyledItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const StyledGridItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
6
  //# sourceMappingURL=Grid.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/Grid.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;;SAiB3B,CAAC;AAIF,eAAO,MAAM,UAAU,yGAerB,CAAC"}
1
+ {"version":3,"file":"Grid.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/Grid.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;SAiB/B,CAAC;AAIF,eAAO,MAAM,cAAc,yGAezB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { calculateFontSize, defaultThemeProp } from '@pega/cosmos-react-core';
3
- export const StyledContainer = styled.div(({ fitContent, height, theme }) => {
3
+ export const StyledGridContainer = styled.div(({ fitContent, height, theme }) => {
4
4
  return css `
5
5
  border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};
6
6
  background-color: ${theme.base.colors.blue.light};
@@ -16,8 +16,8 @@ export const StyledContainer = styled.div(({ fitContent, height, theme }) => {
16
16
  `}
17
17
  `;
18
18
  });
19
- StyledContainer.defaultProps = defaultThemeProp;
20
- export const StyledItem = styled.div(({ theme }) => {
19
+ StyledGridContainer.defaultProps = defaultThemeProp;
20
+ export const StyledGridItem = styled.div(({ theme }) => {
21
21
  const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
22
22
  return css `
23
23
  border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};
@@ -32,5 +32,5 @@ export const StyledItem = styled.div(({ theme }) => {
32
32
  }
33
33
  `;
34
34
  });
35
- StyledItem.defaultProps = defaultThemeProp;
35
+ StyledGridItem.defaultProps = defaultThemeProp;
36
36
  //# sourceMappingURL=Grid.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.styles.js","sourceRoot":"","sources":["../../../src/core/Grid/Grid.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CACvC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;IAChC,OAAO,GAAG,CAAA;2BACa,KAAK,CAAC,IAAI,CAAC,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;0BACrD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;;QAE9C,MAAM;QACR,GAAG,CAAA;kBACS,MAAM;OACjB;;QAEC,UAAU;QACZ,GAAG,CAAA;;OAEF;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,GAAG,CAAA;yBACa,KAAK,CAAC,IAAI,CAAC,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;eAC9D,KAAK,CAAC,IAAI,CAAC,OAAO;;wBAET,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK;aACzC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;mBAGjB,QAAQ,CAAC,EAAE;qBACT,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI;;GAEhD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { calculateFontSize, defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledContainer = styled.div<{ fitContent?: boolean; height?: number }>(\n ({ fitContent, height, theme }) => {\n return css`\n border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};\n background-color: ${theme.base.colors.blue.light};\n\n ${height &&\n css`\n height: ${height}rem;\n `}\n\n ${fitContent &&\n css`\n width: fit-content;\n `}\n `;\n }\n);\n\nStyledContainer.defaultProps = defaultThemeProp;\n\nexport const StyledItem = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};\n padding: ${theme.base.spacing};\n text-align: center;\n background-color: ${theme.base.colors.orange.light};\n color: ${theme.base.colors.black};\n\n span {\n font-size: ${fontSize.xl};\n font-weight: ${theme.base['font-weight'].bold};\n }\n `;\n});\n\nStyledItem.defaultProps = defaultThemeProp;\n"]}
1
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AAC,IAAI;;GAEhD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { calculateFontSize, defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledGridContainer = styled.div<{ fitContent?: boolean; height?: number }>(\n ({ fitContent, height, theme }) => {\n return css`\n border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};\n background-color: ${theme.base.colors.blue.light};\n\n ${height &&\n css`\n height: ${height}rem;\n `}\n\n ${fitContent &&\n css`\n width: fit-content;\n `}\n `;\n }\n);\n\nStyledGridContainer.defaultProps = defaultThemeProp;\n\nexport const StyledGridItem = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};\n padding: ${theme.base.spacing};\n text-align: center;\n background-color: ${theme.base.colors.orange.light};\n color: ${theme.base.colors.black};\n\n span {\n font-size: ${fontSize.xl};\n font-weight: ${theme.base['font-weight'].bold};\n }\n `;\n});\n\nStyledGridItem.defaultProps = defaultThemeProp;\n"]}
@@ -15,9 +15,10 @@ interface GridStoryProps {
15
15
  export declare const ColumnsAndRows: () => JSX.Element;
16
16
  export declare const Areas: () => JSX.Element;
17
17
  export declare const Template: () => JSX.Element;
18
- export declare const GapAndPadding: Story<GridStoryProps>;
19
- export declare const JustifyItems: Story<GridStoryProps>;
20
- export declare const JustifyContent: Story<GridStoryProps>;
21
- export declare const AlignItems: Story<GridStoryProps>;
22
- export declare const AlignContent: Story<GridStoryProps>;
18
+ export declare const GapsAndPadding: Story<GridStoryProps>;
19
+ export declare const JustifyGridItems: Story<GridStoryProps>;
20
+ export declare const JustifyGridContent: Story<GridStoryProps>;
21
+ export declare const AlignGridItems: Story<GridStoryProps>;
22
+ export declare const AlignGridContent: Story<GridStoryProps>;
23
+ export declare const ResponsiveGrid: () => JSX.Element;
23
24
  //# sourceMappingURL=GridContainer.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridContainer.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/GridContainer.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAQ,kBAAkB,EAAQ,MAAM,yBAAyB,CAAC;;AAIzE,wBAMU;AAEV,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,GAAG,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAClD,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,cAAc,mBAkB1B,CAAC;AAEF,eAAO,MAAM,KAAK,mBA0BjB,CAAC;AAEF,eAAO,MAAM,QAAQ,mBAyBpB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,cAAc,CAoB/C,CAAC;AAcF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,cAAc,CAmB9C,CAAC;AAUF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,CAkBhD,CAAC;AAaF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,cAAc,CAmB5C,CAAC;AAUF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,cAAc,CAoB9C,CAAC"}
1
+ {"version":3,"file":"GridContainer.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/GridContainer.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAQ,kBAAkB,EAAQ,MAAM,yBAAyB,CAAC;;AAIzE,wBAMU;AAEV,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,GAAG,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAClD,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,cAAc,mBAkB1B,CAAC;AAEF,eAAO,MAAM,KAAK,mBA0BjB,CAAC;AAEF,eAAO,MAAM,QAAQ,mBAyBpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,CAoBhD,CAAC;AAcF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAmBlD,CAAC;AAUF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,cAAc,CAkBpD,CAAC;AAaF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,CAmBhD,CAAC;AAUF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAoBlD,CAAC;AAaF,eAAO,MAAM,cAAc,mBAkB1B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Grid, Text } from '@pega/cosmos-react-core';
2
- import { StyledContainer, StyledItem } from './Grid.styles';
2
+ import { StyledGridContainer, StyledGridItem } from './Grid.styles';
3
3
  export default {
4
4
  title: 'Core/Grid/Container',
5
5
  component: Grid,
@@ -12,10 +12,10 @@ export const ColumnsAndRows = () => {
12
12
  cols: '7rem [line1] 1fr [line2] 3fr [line3]',
13
13
  rows: 'repeat(3, 3rem) auto',
14
14
  pad: 2
15
- }} as={StyledContainer} height={20}>
16
- {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledItem key={`colRows-${index}`}>
15
+ }} as={StyledGridContainer} height={20}>
16
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`colRows-${index}`}>
17
17
  <Text>Item {index}</Text>
18
- </StyledItem>))}
18
+ </StyledGridItem>))}
19
19
  </Grid>);
20
20
  };
21
21
  export const Areas = () => {
@@ -24,17 +24,17 @@ export const Areas = () => {
24
24
  rows: 'repeat(3, 3rem) auto',
25
25
  areas: '"sidebar header header" "sidebar . main" "sidebar . main" "sidebar footer footer"',
26
26
  pad: 2
27
- }} as={StyledContainer} height={20}>
28
- <Grid item={{ area: 'header' }} as={StyledItem}>
27
+ }} as={StyledGridContainer} height={20}>
28
+ <Grid item={{ area: 'header' }} as={StyledGridItem}>
29
29
  <Text>Header</Text>
30
30
  </Grid>
31
- <Grid item={{ area: 'sidebar' }} as={StyledItem}>
31
+ <Grid item={{ area: 'sidebar' }} as={StyledGridItem}>
32
32
  <Text>Side</Text>
33
33
  </Grid>
34
- <Grid item={{ area: 'main' }} as={StyledItem}>
34
+ <Grid item={{ area: 'main' }} as={StyledGridItem}>
35
35
  <Text>Main</Text>
36
36
  </Grid>
37
- <Grid item={{ area: 'footer' }} as={StyledItem}>
37
+ <Grid item={{ area: 'footer' }} as={StyledGridItem}>
38
38
  <Text>Footer</Text>
39
39
  </Grid>
40
40
  </Grid>);
@@ -42,120 +42,127 @@ export const Areas = () => {
42
42
  export const Template = () => {
43
43
  const rowsAndAreas = '"sidebar header header" 3rem "sidebar . main" 3rem "sidebar . main" 3rem "sidebar footer footer" auto';
44
44
  const columns = '5rem 1fr 3fr';
45
- return (<Grid container={{ template: `${rowsAndAreas} / ${columns}`, pad: 2 }} as={StyledContainer} height={20}>
46
- <Grid item={{ area: 'header' }} as={StyledItem}>
45
+ return (<Grid container={{ template: `${rowsAndAreas} / ${columns}`, pad: 2 }} as={StyledGridContainer} height={20}>
46
+ <Grid item={{ area: 'header' }} as={StyledGridItem}>
47
47
  <Text>Header</Text>
48
48
  </Grid>
49
- <Grid item={{ area: 'sidebar' }} as={StyledItem}>
49
+ <Grid item={{ area: 'sidebar' }} as={StyledGridItem}>
50
50
  <Text>Side</Text>
51
51
  </Grid>
52
- <Grid item={{ area: 'main' }} as={StyledItem}>
52
+ <Grid item={{ area: 'main' }} as={StyledGridItem}>
53
53
  <Text>Main</Text>
54
54
  </Grid>
55
- <Grid item={{ area: 'footer' }} as={StyledItem}>
55
+ <Grid item={{ area: 'footer' }} as={StyledGridItem}>
56
56
  <Text>Footer</Text>
57
57
  </Grid>
58
58
  </Grid>);
59
59
  };
60
- export const GapAndPadding = (args) => {
60
+ export const GapsAndPadding = (args) => {
61
61
  return (<Grid container={{
62
62
  cols: '7rem 1fr 3fr',
63
63
  colGap: args.colGap,
64
64
  rows: 'repeat(3, 3rem) auto',
65
65
  rowGap: args.rowGap,
66
66
  pad: args.pad
67
- }} as={StyledContainer} height={20}>
68
- {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledItem key={`colRowGap-${index}`}>
67
+ }} as={StyledGridContainer} height={20}>
68
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`colRowGap-${index}`}>
69
69
  <Text>Item {index}</Text>
70
- </StyledItem>))}
70
+ </StyledGridItem>))}
71
71
  </Grid>);
72
72
  };
73
- GapAndPadding.args = {
73
+ GapsAndPadding.args = {
74
74
  pad: 1,
75
75
  colGap: 1,
76
76
  rowGap: 1
77
77
  };
78
- GapAndPadding.argTypes = {
78
+ GapsAndPadding.argTypes = {
79
79
  pad: { control: { type: 'number' } },
80
80
  colGap: { control: { type: 'number' } },
81
81
  rowGap: { control: { type: 'number' } }
82
82
  };
83
- export const JustifyItems = (args) => {
83
+ export const JustifyGridItems = (args) => {
84
84
  return (<Grid container={{
85
85
  cols: '7rem 1fr 3fr',
86
86
  rows: 'repeat(3, 3rem) auto',
87
87
  justifyItems: args.justifyItems,
88
88
  pad: 2
89
- }} as={StyledContainer} height={20}>
90
- {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledItem key={`justifyItems-${index}`}>
89
+ }} as={StyledGridContainer} height={20}>
90
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`justifyItems-${index}`}>
91
91
  <Text>Item {index}</Text>
92
- </StyledItem>))}
92
+ </StyledGridItem>))}
93
93
  </Grid>);
94
94
  };
95
- JustifyItems.args = {
95
+ JustifyGridItems.args = {
96
96
  justifyItems: 'stretch'
97
97
  };
98
- JustifyItems.argTypes = {
98
+ JustifyGridItems.argTypes = {
99
99
  justifyItems: { options: ['stretch', 'start', 'center', 'end'], control: { type: 'select' } }
100
100
  };
101
- export const JustifyContent = (args) => {
101
+ export const JustifyGridContent = (args) => {
102
102
  return (<Grid container={{
103
103
  cols: 'repeat(3, 7rem)',
104
104
  rows: 'repeat(4, 3rem)',
105
105
  justifyContent: args.justifyContent,
106
106
  pad: 2
107
- }} as={StyledContainer}>
108
- {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledItem key={`justifyContent-${index}`}>
107
+ }} as={StyledGridContainer}>
108
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`justifyContent-${index}`}>
109
109
  <Text>Item {index}</Text>
110
- </StyledItem>))}
110
+ </StyledGridItem>))}
111
111
  </Grid>);
112
112
  };
113
- JustifyContent.args = {
113
+ JustifyGridContent.args = {
114
114
  justifyContent: 'start'
115
115
  };
116
- JustifyContent.argTypes = {
116
+ JustifyGridContent.argTypes = {
117
117
  justifyContent: {
118
118
  options: ['start', 'end', 'center', 'around', 'between', 'evenly'],
119
119
  control: { type: 'select' }
120
120
  }
121
121
  };
122
- export const AlignItems = (args) => {
122
+ export const AlignGridItems = (args) => {
123
123
  return (<Grid container={{
124
124
  cols: '7rem 1fr 3fr',
125
125
  rows: 'repeat(3, 5rem) auto',
126
126
  alignItems: args.alignItems,
127
127
  pad: 2
128
- }} as={StyledContainer} height={20}>
129
- {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledItem key={`alignItems-${index}`}>
128
+ }} as={StyledGridContainer} height={20}>
129
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`alignItems-${index}`}>
130
130
  <Text>Item {index}</Text>
131
- </StyledItem>))}
131
+ </StyledGridItem>))}
132
132
  </Grid>);
133
133
  };
134
- AlignItems.args = {
134
+ AlignGridItems.args = {
135
135
  alignItems: 'stretch'
136
136
  };
137
- AlignItems.argTypes = {
137
+ AlignGridItems.argTypes = {
138
138
  alignItems: { options: ['stretch', 'start', 'center', 'end'], control: { type: 'select' } }
139
139
  };
140
- export const AlignContent = (args) => {
140
+ export const AlignGridContent = (args) => {
141
141
  return (<Grid container={{
142
142
  cols: 'repeat(3, 7rem)',
143
143
  rows: 'repeat(4, 3rem)',
144
144
  alignContent: args.alignContent,
145
145
  pad: 2
146
- }} as={StyledContainer} height={30} fitContent>
147
- {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledItem key={`alignContent-${index}`}>
146
+ }} as={StyledGridContainer} height={30} fitContent>
147
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`alignContent-${index}`}>
148
148
  <Text>Item {index}</Text>
149
- </StyledItem>))}
149
+ </StyledGridItem>))}
150
150
  </Grid>);
151
151
  };
152
- AlignContent.args = {
152
+ AlignGridContent.args = {
153
153
  alignContent: 'start'
154
154
  };
155
- AlignContent.argTypes = {
155
+ AlignGridContent.argTypes = {
156
156
  alignContent: {
157
157
  options: ['start', 'end', 'center', 'around', 'between', 'evenly'],
158
158
  control: { type: 'select' }
159
159
  }
160
160
  };
161
+ export const ResponsiveGrid = () => {
162
+ return (<Grid container={{ pad: 1, cols: 'repeat(3, 7rem)', rows: 'repeat(4, 3rem)' }} xl={{ container: { cols: 'repeat(12, 1fr)', rows: 'repeat(1, 3rem)' } }} lg={{ container: { cols: 'repeat(6, 1fr)', rows: 'repeat(2, 3rem)' } }} md={{ container: { cols: 'repeat(4, 1fr)', rows: 'repeat(3, 3rem)' } }} sm={{ container: { cols: 'repeat(3, 1fr)', rows: 'repeat(4, 3rem)' } }} xs={{ container: { cols: 'repeat(2, 1fr)', rows: 'repeat(6, 3rem)' } }} as={StyledGridContainer}>
163
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`colRows-${index}`}>
164
+ <Text>Item {index}</Text>
165
+ </StyledGridItem>))}
166
+ </Grid>);
167
+ };
161
168
  //# sourceMappingURL=GridContainer.stories.jsx.map