@pega/cosmos-react-demos 3.0.0-dev.1.0 → 3.0.0-dev.4.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 (419) hide show
  1. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +9 -0
  2. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -0
  3. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +79 -0
  4. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -0
  5. package/jsx/build/DynamicContentEditor/FieldSelector.d.ts +11 -0
  6. package/jsx/build/DynamicContentEditor/FieldSelector.d.ts.map +1 -0
  7. package/jsx/build/DynamicContentEditor/FieldSelector.jsx +80 -0
  8. package/jsx/build/DynamicContentEditor/FieldSelector.jsx.map +1 -0
  9. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +16 -0
  10. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -0
  11. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
  12. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -0
  13. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +14 -0
  14. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -0
  15. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +312 -0
  16. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -0
  17. package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts +4 -0
  18. package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts.map +1 -0
  19. package/jsx/build/ObjectSelect/ObjectSelect.styles.js +27 -0
  20. package/jsx/build/ObjectSelect/ObjectSelect.styles.js.map +1 -0
  21. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  22. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +6 -10
  23. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  24. package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
  25. package/jsx/build/Workbench/Workbench.stories.jsx +13 -18
  26. package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
  27. package/jsx/core/AppShell/AppShell.stories.d.ts +6 -0
  28. package/jsx/core/AppShell/AppShell.stories.d.ts.map +1 -1
  29. package/jsx/core/AppShell/AppShell.stories.jsx +28 -2
  30. package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
  31. package/jsx/core/Avatar/Avatar.stories.d.ts +5 -0
  32. package/jsx/core/Avatar/Avatar.stories.d.ts.map +1 -1
  33. package/jsx/core/Avatar/Avatar.stories.jsx +27 -2
  34. package/jsx/core/Avatar/Avatar.stories.jsx.map +1 -1
  35. package/jsx/core/Badges/Status.stories.d.ts +5 -0
  36. package/jsx/core/Badges/Status.stories.d.ts.map +1 -1
  37. package/jsx/core/Badges/Status.stories.jsx +25 -1
  38. package/jsx/core/Badges/Status.stories.jsx.map +1 -1
  39. package/jsx/core/Banner/Banner.stories.d.ts +5 -1
  40. package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
  41. package/jsx/core/Banner/Banner.stories.jsx +24 -3
  42. package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
  43. package/jsx/core/Button/Button.stories.d.ts +8 -0
  44. package/jsx/core/Button/Button.stories.d.ts.map +1 -1
  45. package/jsx/core/Button/Button.stories.jsx +30 -1
  46. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  47. package/jsx/core/Card/Card.stories.d.ts +5 -0
  48. package/jsx/core/Card/Card.stories.d.ts.map +1 -1
  49. package/jsx/core/Card/Card.stories.jsx +30 -1
  50. package/jsx/core/Card/Card.stories.jsx.map +1 -1
  51. package/jsx/core/Checkbox/Checkbox.stories.d.ts +12 -0
  52. package/jsx/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  53. package/jsx/core/Checkbox/Checkbox.stories.jsx +54 -1
  54. package/jsx/core/Checkbox/Checkbox.stories.jsx.map +1 -1
  55. package/jsx/core/Configuration/Configuration.stories.d.ts +17 -0
  56. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  57. package/jsx/core/Configuration/Configuration.stories.jsx +94 -3
  58. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  59. package/jsx/core/Currency/Currency.stories.d.ts +5 -2
  60. package/jsx/core/Currency/Currency.stories.d.ts.map +1 -1
  61. package/jsx/core/Currency/Currency.stories.jsx +30 -12
  62. package/jsx/core/Currency/Currency.stories.jsx.map +1 -1
  63. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
  64. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  65. package/jsx/core/FieldGroup/FieldGroup.stories.jsx +8 -4
  66. package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
  67. package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
  68. package/jsx/core/File/FileDisplay.stories.jsx +16 -38
  69. package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
  70. package/jsx/core/File/FileInput.stories.d.ts.map +1 -1
  71. package/jsx/core/File/FileInput.stories.jsx +1 -1
  72. package/jsx/core/File/FileInput.stories.jsx.map +1 -1
  73. package/jsx/core/Form/Form.mocks.d.ts.map +1 -1
  74. package/jsx/core/Form/Form.mocks.jsx +2 -2
  75. package/jsx/core/Form/Form.mocks.jsx.map +1 -1
  76. package/jsx/core/Form/Form.stories.d.ts +10 -0
  77. package/jsx/core/Form/Form.stories.d.ts.map +1 -1
  78. package/jsx/core/Form/Form.stories.jsx +42 -2
  79. package/jsx/core/Form/Form.stories.jsx.map +1 -1
  80. package/jsx/core/HTML/HTML.stories.d.ts +6 -0
  81. package/jsx/core/HTML/HTML.stories.d.ts.map +1 -0
  82. package/jsx/core/HTML/HTML.stories.jsx +13 -0
  83. package/jsx/core/HTML/HTML.stories.jsx.map +1 -0
  84. package/jsx/core/Input/Input.stories.d.ts +9 -0
  85. package/jsx/core/Input/Input.stories.d.ts.map +1 -1
  86. package/jsx/core/Input/Input.stories.jsx +40 -1
  87. package/jsx/core/Input/Input.stories.jsx.map +1 -1
  88. package/jsx/core/Label/Label.stories.d.ts +4 -0
  89. package/jsx/core/Label/Label.stories.d.ts.map +1 -1
  90. package/jsx/core/Label/Label.stories.jsx +18 -1
  91. package/jsx/core/Label/Label.stories.jsx.map +1 -1
  92. package/jsx/core/Modal/Modal.mocks.d.ts.map +1 -1
  93. package/jsx/core/Modal/Modal.mocks.jsx +3 -3
  94. package/jsx/core/Modal/Modal.mocks.jsx.map +1 -1
  95. package/jsx/core/Modal/Modal.stories.d.ts.map +1 -1
  96. package/jsx/core/Modal/Modal.stories.jsx +29 -43
  97. package/jsx/core/Modal/Modal.stories.jsx.map +1 -1
  98. package/jsx/core/Number/Number.stories.d.ts +3 -3
  99. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  100. package/jsx/core/Number/Number.stories.jsx +14 -13
  101. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  102. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts +5 -3
  103. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  104. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +106 -30
  105. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  106. package/jsx/core/Progress/Progress.stories.d.ts +4 -0
  107. package/jsx/core/Progress/Progress.stories.d.ts.map +1 -1
  108. package/jsx/core/Progress/Progress.stories.jsx +22 -1
  109. package/jsx/core/Progress/Progress.stories.jsx.map +1 -1
  110. package/jsx/core/RadioButton/RadioButton.stories.d.ts +12 -0
  111. package/jsx/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  112. package/jsx/core/RadioButton/RadioButton.stories.jsx +53 -1
  113. package/jsx/core/RadioButton/RadioButton.stories.jsx.map +1 -1
  114. package/jsx/core/Rating/Rating.stories.d.ts +4 -0
  115. package/jsx/core/Rating/Rating.stories.d.ts.map +1 -1
  116. package/jsx/core/Rating/Rating.stories.jsx +18 -1
  117. package/jsx/core/Rating/Rating.stories.jsx.map +1 -1
  118. package/jsx/core/SearchInput/SearchInput.stories.d.ts +4 -0
  119. package/jsx/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  120. package/jsx/core/SearchInput/SearchInput.stories.jsx +18 -1
  121. package/jsx/core/SearchInput/SearchInput.stories.jsx.map +1 -1
  122. package/jsx/core/Select/Select.stories.d.ts +8 -0
  123. package/jsx/core/Select/Select.stories.d.ts.map +1 -1
  124. package/jsx/core/Select/Select.stories.jsx +35 -1
  125. package/jsx/core/Select/Select.stories.jsx.map +1 -1
  126. package/jsx/core/Sentiment/Sentiment.stories.d.ts +6 -0
  127. package/jsx/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
  128. package/jsx/core/Sentiment/Sentiment.stories.jsx +32 -1
  129. package/jsx/core/Sentiment/Sentiment.stories.jsx.map +1 -1
  130. package/jsx/core/Switch/Switch.stories.d.ts +7 -0
  131. package/jsx/core/Switch/Switch.stories.d.ts.map +1 -1
  132. package/jsx/core/Switch/Switch.stories.jsx +34 -1
  133. package/jsx/core/Switch/Switch.stories.jsx.map +1 -1
  134. package/jsx/core/Table/Table.mocks.d.ts +6 -0
  135. package/jsx/core/Table/Table.mocks.d.ts.map +1 -1
  136. package/jsx/core/Table/Table.mocks.jsx +134 -0
  137. package/jsx/core/Table/Table.mocks.jsx.map +1 -1
  138. package/jsx/core/Table/Table.stories.d.ts +25 -0
  139. package/jsx/core/Table/Table.stories.d.ts.map +1 -1
  140. package/jsx/core/Table/Table.stories.jsx +120 -1
  141. package/jsx/core/Table/Table.stories.jsx.map +1 -1
  142. package/jsx/core/Tabs/Tabs.stories.d.ts +5 -0
  143. package/jsx/core/Tabs/Tabs.stories.d.ts.map +1 -1
  144. package/jsx/core/Tabs/Tabs.stories.jsx +39 -1
  145. package/jsx/core/Tabs/Tabs.stories.jsx.map +1 -1
  146. package/jsx/core/Text/Text.stories.d.ts +19 -0
  147. package/jsx/core/Text/Text.stories.d.ts.map +1 -1
  148. package/jsx/core/Text/Text.stories.jsx +112 -1
  149. package/jsx/core/Text/Text.stories.jsx.map +1 -1
  150. package/jsx/core/TextArea/TextArea.stories.d.ts +5 -0
  151. package/jsx/core/TextArea/TextArea.stories.d.ts.map +1 -1
  152. package/jsx/core/TextArea/TextArea.stories.jsx +22 -1
  153. package/jsx/core/TextArea/TextArea.stories.jsx.map +1 -1
  154. package/jsx/core/Toaster/Toaster.stories.jsx +17 -12
  155. package/jsx/core/Toaster/Toaster.stories.jsx.map +1 -1
  156. package/jsx/core/Tooltip/Tooltip.stories.d.ts +6 -0
  157. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  158. package/jsx/core/Tooltip/Tooltip.stories.jsx +28 -1
  159. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  160. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +1 -1
  161. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  162. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +10 -10
  163. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
  164. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  165. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +8 -8
  166. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  167. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  168. package/jsx/cs/TaskManager/TaskManager.stories.jsx +1 -1
  169. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  170. package/jsx/rte/Editor/Editor.stories.jsx +2 -2
  171. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  172. package/jsx/social/Email/Email.mocks.d.ts +19 -2
  173. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  174. package/jsx/social/Email/Email.mocks.js +48 -1
  175. package/jsx/social/Email/Email.mocks.js.map +1 -1
  176. package/jsx/social/Email/Email.stories.d.ts +1 -1
  177. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  178. package/jsx/social/Email/Email.stories.jsx +80 -15
  179. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  180. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  181. package/jsx/social/Feed/Feed.stories.jsx +1 -1
  182. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  183. package/jsx/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  184. package/jsx/work/CaseView/CaseView.mocks.jsx +1 -1
  185. package/jsx/work/CaseView/CaseView.mocks.jsx.map +1 -1
  186. package/jsx/work/CaseView/CaseView.stories.d.ts.map +1 -1
  187. package/jsx/work/CaseView/CaseView.stories.jsx +7 -7
  188. package/jsx/work/CaseView/CaseView.stories.jsx.map +1 -1
  189. package/jsx/work/CaseView/Details.mocks.d.ts.map +1 -1
  190. package/jsx/work/CaseView/Details.mocks.jsx +1 -1
  191. package/jsx/work/CaseView/Details.mocks.jsx.map +1 -1
  192. package/jsx/work/CaseView/Pulse.mocks.d.ts.map +1 -1
  193. package/jsx/work/CaseView/Pulse.mocks.jsx +1 -1
  194. package/jsx/work/CaseView/Pulse.mocks.jsx.map +1 -1
  195. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  196. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +1 -1
  197. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  198. package/jsx/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
  199. package/jsx/work/Confirmation/Confirmation.stories.jsx +2 -2
  200. package/jsx/work/Confirmation/Confirmation.stories.jsx.map +1 -1
  201. package/jsx/work/Details/Details.stories.d.ts.map +1 -1
  202. package/jsx/work/Details/Details.stories.jsx +21 -16
  203. package/jsx/work/Details/Details.stories.jsx.map +1 -1
  204. package/jsx/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  205. package/jsx/work/SearchResults/SearchResults.stories.jsx +1 -1
  206. package/jsx/work/SearchResults/SearchResults.stories.jsx.map +1 -1
  207. package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -1
  208. package/jsx/work/Stakeholders/Stakeholders.mocks.jsx +2 -2
  209. package/jsx/work/Stakeholders/Stakeholders.mocks.jsx.map +1 -1
  210. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +9 -0
  211. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -0
  212. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +63 -0
  213. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -0
  214. package/lib/build/DynamicContentEditor/FieldSelector.d.ts +14 -0
  215. package/lib/build/DynamicContentEditor/FieldSelector.d.ts.map +1 -0
  216. package/lib/build/DynamicContentEditor/FieldSelector.js +81 -0
  217. package/lib/build/DynamicContentEditor/FieldSelector.js.map +1 -0
  218. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +16 -0
  219. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -0
  220. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
  221. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -0
  222. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +14 -0
  223. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -0
  224. package/lib/build/ObjectSelect/ObjectSelect.stories.js +247 -0
  225. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -0
  226. package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts +4 -0
  227. package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts.map +1 -0
  228. package/lib/build/ObjectSelect/ObjectSelect.styles.js +27 -0
  229. package/lib/build/ObjectSelect/ObjectSelect.styles.js.map +1 -0
  230. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  231. package/lib/build/PageTemplates/PageTemplates.stories.js +6 -6
  232. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  233. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  234. package/lib/build/Workbench/Workbench.stories.js +17 -22
  235. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  236. package/lib/core/AppShell/AppShell.stories.d.ts +6 -0
  237. package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -1
  238. package/lib/core/AppShell/AppShell.stories.js +26 -2
  239. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  240. package/lib/core/Avatar/Avatar.stories.d.ts +5 -0
  241. package/lib/core/Avatar/Avatar.stories.d.ts.map +1 -1
  242. package/lib/core/Avatar/Avatar.stories.js +25 -2
  243. package/lib/core/Avatar/Avatar.stories.js.map +1 -1
  244. package/lib/core/Badges/Status.stories.d.ts +5 -0
  245. package/lib/core/Badges/Status.stories.d.ts.map +1 -1
  246. package/lib/core/Badges/Status.stories.js +23 -1
  247. package/lib/core/Badges/Status.stories.js.map +1 -1
  248. package/lib/core/Banner/Banner.stories.d.ts +5 -1
  249. package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
  250. package/lib/core/Banner/Banner.stories.js +20 -3
  251. package/lib/core/Banner/Banner.stories.js.map +1 -1
  252. package/lib/core/Button/Button.stories.d.ts +8 -0
  253. package/lib/core/Button/Button.stories.d.ts.map +1 -1
  254. package/lib/core/Button/Button.stories.js +28 -1
  255. package/lib/core/Button/Button.stories.js.map +1 -1
  256. package/lib/core/Card/Card.stories.d.ts +5 -0
  257. package/lib/core/Card/Card.stories.d.ts.map +1 -1
  258. package/lib/core/Card/Card.stories.js +19 -1
  259. package/lib/core/Card/Card.stories.js.map +1 -1
  260. package/lib/core/Checkbox/Checkbox.stories.d.ts +12 -0
  261. package/lib/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  262. package/lib/core/Checkbox/Checkbox.stories.js +52 -1
  263. package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
  264. package/lib/core/Configuration/Configuration.stories.d.ts +17 -0
  265. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  266. package/lib/core/Configuration/Configuration.stories.js +62 -3
  267. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  268. package/lib/core/Currency/Currency.stories.d.ts +5 -2
  269. package/lib/core/Currency/Currency.stories.d.ts.map +1 -1
  270. package/lib/core/Currency/Currency.stories.js +30 -12
  271. package/lib/core/Currency/Currency.stories.js.map +1 -1
  272. package/lib/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
  273. package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  274. package/lib/core/FieldGroup/FieldGroup.stories.js +7 -3
  275. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  276. package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
  277. package/lib/core/File/FileDisplay.stories.js +17 -29
  278. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  279. package/lib/core/File/FileInput.stories.d.ts.map +1 -1
  280. package/lib/core/File/FileInput.stories.js +1 -1
  281. package/lib/core/File/FileInput.stories.js.map +1 -1
  282. package/lib/core/Form/Form.mocks.d.ts.map +1 -1
  283. package/lib/core/Form/Form.mocks.js +2 -2
  284. package/lib/core/Form/Form.mocks.js.map +1 -1
  285. package/lib/core/Form/Form.stories.d.ts +10 -0
  286. package/lib/core/Form/Form.stories.d.ts.map +1 -1
  287. package/lib/core/Form/Form.stories.js +40 -2
  288. package/lib/core/Form/Form.stories.js.map +1 -1
  289. package/lib/core/HTML/HTML.stories.d.ts +6 -0
  290. package/lib/core/HTML/HTML.stories.d.ts.map +1 -0
  291. package/lib/core/HTML/HTML.stories.js +14 -0
  292. package/lib/core/HTML/HTML.stories.js.map +1 -0
  293. package/lib/core/Input/Input.stories.d.ts +9 -0
  294. package/lib/core/Input/Input.stories.d.ts.map +1 -1
  295. package/lib/core/Input/Input.stories.js +38 -1
  296. package/lib/core/Input/Input.stories.js.map +1 -1
  297. package/lib/core/Label/Label.stories.d.ts +4 -0
  298. package/lib/core/Label/Label.stories.d.ts.map +1 -1
  299. package/lib/core/Label/Label.stories.js +16 -1
  300. package/lib/core/Label/Label.stories.js.map +1 -1
  301. package/lib/core/Modal/Modal.mocks.d.ts.map +1 -1
  302. package/lib/core/Modal/Modal.mocks.js +3 -3
  303. package/lib/core/Modal/Modal.mocks.js.map +1 -1
  304. package/lib/core/Modal/Modal.stories.d.ts.map +1 -1
  305. package/lib/core/Modal/Modal.stories.js +14 -14
  306. package/lib/core/Modal/Modal.stories.js.map +1 -1
  307. package/lib/core/Number/Number.stories.d.ts +3 -3
  308. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  309. package/lib/core/Number/Number.stories.js +14 -13
  310. package/lib/core/Number/Number.stories.js.map +1 -1
  311. package/lib/core/PageTemplates/PageTemplates.stories.d.ts +5 -3
  312. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  313. package/lib/core/PageTemplates/PageTemplates.stories.js +95 -27
  314. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  315. package/lib/core/Progress/Progress.stories.d.ts +4 -0
  316. package/lib/core/Progress/Progress.stories.d.ts.map +1 -1
  317. package/lib/core/Progress/Progress.stories.js +18 -1
  318. package/lib/core/Progress/Progress.stories.js.map +1 -1
  319. package/lib/core/RadioButton/RadioButton.stories.d.ts +12 -0
  320. package/lib/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  321. package/lib/core/RadioButton/RadioButton.stories.js +51 -1
  322. package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
  323. package/lib/core/Rating/Rating.stories.d.ts +4 -0
  324. package/lib/core/Rating/Rating.stories.d.ts.map +1 -1
  325. package/lib/core/Rating/Rating.stories.js +16 -1
  326. package/lib/core/Rating/Rating.stories.js.map +1 -1
  327. package/lib/core/SearchInput/SearchInput.stories.d.ts +4 -0
  328. package/lib/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  329. package/lib/core/SearchInput/SearchInput.stories.js +16 -1
  330. package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
  331. package/lib/core/Select/Select.stories.d.ts +8 -0
  332. package/lib/core/Select/Select.stories.d.ts.map +1 -1
  333. package/lib/core/Select/Select.stories.js +28 -1
  334. package/lib/core/Select/Select.stories.js.map +1 -1
  335. package/lib/core/Sentiment/Sentiment.stories.d.ts +6 -0
  336. package/lib/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
  337. package/lib/core/Sentiment/Sentiment.stories.js +29 -2
  338. package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
  339. package/lib/core/Switch/Switch.stories.d.ts +7 -0
  340. package/lib/core/Switch/Switch.stories.d.ts.map +1 -1
  341. package/lib/core/Switch/Switch.stories.js +32 -1
  342. package/lib/core/Switch/Switch.stories.js.map +1 -1
  343. package/lib/core/Table/Table.mocks.d.ts +6 -0
  344. package/lib/core/Table/Table.mocks.d.ts.map +1 -1
  345. package/lib/core/Table/Table.mocks.js +134 -0
  346. package/lib/core/Table/Table.mocks.js.map +1 -1
  347. package/lib/core/Table/Table.stories.d.ts +25 -0
  348. package/lib/core/Table/Table.stories.d.ts.map +1 -1
  349. package/lib/core/Table/Table.stories.js +113 -1
  350. package/lib/core/Table/Table.stories.js.map +1 -1
  351. package/lib/core/Tabs/Tabs.stories.d.ts +5 -0
  352. package/lib/core/Tabs/Tabs.stories.d.ts.map +1 -1
  353. package/lib/core/Tabs/Tabs.stories.js +30 -1
  354. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  355. package/lib/core/Text/Text.stories.d.ts +19 -0
  356. package/lib/core/Text/Text.stories.d.ts.map +1 -1
  357. package/lib/core/Text/Text.stories.js +102 -2
  358. package/lib/core/Text/Text.stories.js.map +1 -1
  359. package/lib/core/TextArea/TextArea.stories.d.ts +5 -0
  360. package/lib/core/TextArea/TextArea.stories.d.ts.map +1 -1
  361. package/lib/core/TextArea/TextArea.stories.js +20 -1
  362. package/lib/core/TextArea/TextArea.stories.js.map +1 -1
  363. package/lib/core/Toaster/Toaster.stories.js +15 -19
  364. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  365. package/lib/core/Tooltip/Tooltip.stories.d.ts +6 -0
  366. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  367. package/lib/core/Tooltip/Tooltip.stories.js +20 -1
  368. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  369. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +1 -1
  370. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  371. package/lib/cs/CSCaseView/CSAppShell.stories.js +10 -10
  372. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
  373. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  374. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +8 -8
  375. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  376. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  377. package/lib/cs/TaskManager/TaskManager.stories.js +1 -1
  378. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  379. package/lib/rte/Editor/Editor.stories.js +2 -2
  380. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  381. package/lib/social/Email/Email.mocks.d.ts +19 -2
  382. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  383. package/lib/social/Email/Email.mocks.js +48 -1
  384. package/lib/social/Email/Email.mocks.js.map +1 -1
  385. package/lib/social/Email/Email.stories.d.ts +1 -1
  386. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  387. package/lib/social/Email/Email.stories.js +63 -15
  388. package/lib/social/Email/Email.stories.js.map +1 -1
  389. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  390. package/lib/social/Feed/Feed.stories.js +1 -1
  391. package/lib/social/Feed/Feed.stories.js.map +1 -1
  392. package/lib/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  393. package/lib/work/CaseView/CaseView.mocks.js +1 -1
  394. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  395. package/lib/work/CaseView/CaseView.stories.d.ts.map +1 -1
  396. package/lib/work/CaseView/CaseView.stories.js +7 -7
  397. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  398. package/lib/work/CaseView/Details.mocks.d.ts.map +1 -1
  399. package/lib/work/CaseView/Details.mocks.js +1 -1
  400. package/lib/work/CaseView/Details.mocks.js.map +1 -1
  401. package/lib/work/CaseView/Pulse.mocks.d.ts.map +1 -1
  402. package/lib/work/CaseView/Pulse.mocks.js +1 -1
  403. package/lib/work/CaseView/Pulse.mocks.js.map +1 -1
  404. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  405. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +1 -1
  406. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  407. package/lib/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
  408. package/lib/work/Confirmation/Confirmation.stories.js +2 -2
  409. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  410. package/lib/work/Details/Details.stories.d.ts.map +1 -1
  411. package/lib/work/Details/Details.stories.js +56 -53
  412. package/lib/work/Details/Details.stories.js.map +1 -1
  413. package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  414. package/lib/work/SearchResults/SearchResults.stories.js +1 -1
  415. package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
  416. package/lib/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -1
  417. package/lib/work/Stakeholders/Stakeholders.mocks.js +2 -2
  418. package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -1
  419. package/package.json +16 -16
@@ -1,4 +1,4 @@
1
- import { Status } from '@pega/cosmos-react-core';
1
+ import { Configuration, Status } from '@pega/cosmos-react-core';
2
2
  export default {
3
3
  component: Status,
4
4
  title: 'Core/Badges/Status'
@@ -15,4 +15,28 @@ StatusBadge.argTypes = {
15
15
  control: { type: 'select' }
16
16
  }
17
17
  };
18
+ export const ConfigurableStatusBadge = (args) => {
19
+ return (<Configuration theme={{
20
+ components: {
21
+ badges: {
22
+ status: {
23
+ success: {
24
+ foreground: args.foreground,
25
+ background: args.background
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }}>
31
+ <Status variant='success'>Configurable Success</Status>
32
+ </Configuration>);
33
+ };
34
+ ConfigurableStatusBadge.args = {
35
+ foreground: '#156f35',
36
+ background: '#d4f7d5'
37
+ };
38
+ ConfigurableStatusBadge.argTypes = {
39
+ foreground: { control: { type: 'color' } },
40
+ background: { control: { type: 'color' } }
41
+ };
18
42
  //# sourceMappingURL=Status.stories.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Status.stories.jsx","sourceRoot":"","sources":["../../../src/core/Badges/Status.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,MAAM,yBAAyB,CAAC;AAE9D,eAAe;IACb,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,oBAAoB;CACpB,CAAC;AAEV,MAAM,CAAC,MAAM,WAAW,GAAuB,CAAC,IAAiB,EAAE,EAAE;IACnE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,WAAW,CAAC,IAAI,GAAG;IACjB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,WAAW,CAAC,QAAQ,GAAG;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC;QACzD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;CACF,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport { Status, StatusProps } from '@pega/cosmos-react-core';\n\nexport default {\n component: Status,\n title: 'Core/Badges/Status'\n} as Meta;\n\nexport const StatusBadge: Story<StatusProps> = (args: StatusProps) => {\n return <Status variant={args.variant}>{args.variant}</Status>;\n};\n\nStatusBadge.args = {\n variant: 'success'\n};\n\nStatusBadge.argTypes = {\n variant: {\n options: ['success', 'urgent', 'warn', 'pending', 'info'],\n control: { type: 'select' }\n }\n};\n"]}
1
+ {"version":3,"file":"Status.stories.jsx","sourceRoot":"","sources":["../../../src/core/Badges/Status.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAe,MAAM,yBAAyB,CAAC;AAE7E,eAAe;IACb,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,oBAAoB;CACpB,CAAC;AAEV,MAAM,CAAC,MAAM,WAAW,GAAuB,CAAC,IAAiB,EAAE,EAAE;IACnE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,WAAW,CAAC,IAAI,GAAG;IACjB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,WAAW,CAAC,QAAQ,GAAG;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC;QACzD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;CACF,CAAC;AAOF,MAAM,CAAC,MAAM,uBAAuB,GAAwC,CAC1E,IAAkC,EAClC,EAAE;IACF,OAAO,CACL,CAAC,aAAa,CACZ,KAAK,CAAC,CAAC;YACL,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,MAAM,EAAE;wBACN,OAAO,EAAE;4BACP,UAAU,EAAE,IAAI,CAAC,UAAU;4BAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;yBAC5B;qBACF;iBACF;aACF;SACF,CAAC,CAEF;MAAA,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,oBAAoB,EAAE,MAAM,CACxD;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,uBAAuB,CAAC,IAAI,GAAG;IAC7B,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEF,uBAAuB,CAAC,QAAQ,GAAG;IACjC,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAC1C,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;CAC3C,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport { Configuration, Status, StatusProps } from '@pega/cosmos-react-core';\n\nexport default {\n component: Status,\n title: 'Core/Badges/Status'\n} as Meta;\n\nexport const StatusBadge: Story<StatusProps> = (args: StatusProps) => {\n return <Status variant={args.variant}>{args.variant}</Status>;\n};\n\nStatusBadge.args = {\n variant: 'success'\n};\n\nStatusBadge.argTypes = {\n variant: {\n options: ['success', 'urgent', 'warn', 'pending', 'info'],\n control: { type: 'select' }\n }\n};\n\ninterface ConfigurableStatusBadgeProps {\n foreground?: string;\n background?: string;\n}\n\nexport const ConfigurableStatusBadge: Story<ConfigurableStatusBadgeProps> = (\n args: ConfigurableStatusBadgeProps\n) => {\n return (\n <Configuration\n theme={{\n components: {\n badges: {\n status: {\n success: {\n foreground: args.foreground,\n background: args.background\n }\n }\n }\n }\n }}\n >\n <Status variant='success'>Configurable Success</Status>\n </Configuration>\n );\n};\n\nConfigurableStatusBadge.args = {\n foreground: '#156f35',\n background: '#d4f7d5'\n};\n\nConfigurableStatusBadge.argTypes = {\n foreground: { control: { type: 'color' } },\n background: { control: { type: 'color' } }\n};\n"]}
@@ -1,11 +1,15 @@
1
1
  /// <reference types="react" />
2
- import { Meta } from '@storybook/react';
2
+ import { Meta, Story } from '@storybook/react';
3
3
  declare const _default: Meta<import("@storybook/react").Args>;
4
4
  export default _default;
5
5
  export declare const SuccessBanner: () => JSX.Element;
6
6
  export declare const ErrorBanner: () => JSX.Element;
7
7
  export declare const WarningBanner: () => JSX.Element;
8
8
  export declare const InfoBanner: () => JSX.Element;
9
+ interface ConfigurableErrorBannerProps {
10
+ background?: string;
11
+ }
12
+ export declare const ConfigurableErrorBanner: Story<ConfigurableErrorBannerProps>;
9
13
  export declare const ShownInForm: () => JSX.Element;
10
14
  export declare const ShownInCaseView: {
11
15
  (): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AASxC,wBAGU;AAEV,eAAO,MAAM,aAAa,mBAiBzB,CAAC;AAEF,eAAO,MAAM,WAAW,mBAcvB,CAAC;AAEF,eAAO,MAAM,aAAa,mBAazB,CAAC;AAEF,eAAO,MAAM,UAAU,mBAkBtB,CAAC;AAMF,eAAO,MAAM,WAAW,mBA6DvB,CAAC;AAKF,eAAO,MAAM,eAAe;;;;;CAiB3B,CAAC;AASF,eAAO,MAAM,eAAe;;;;;CAsB3B,CAAC"}
1
+ {"version":3,"file":"Banner.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAU/C,wBAGU;AAEV,eAAO,MAAM,aAAa,mBAiBzB,CAAC;AAEF,eAAO,MAAM,WAAW,mBAcvB,CAAC;AAEF,eAAO,MAAM,aAAa,mBAazB,CAAC;AAEF,eAAO,MAAM,UAAU,mBAkBtB,CAAC;AAEF,UAAU,4BAA4B;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,4BAA4B,CA4BvE,CAAC;AAcF,eAAO,MAAM,WAAW,mBA6DvB,CAAC;AAKF,eAAO,MAAM,eAAe;;;;;CAiB3B,CAAC;AASF,eAAO,MAAM,eAAe;;;;;CAsB3B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { useState, useCallback, useReducer } from 'react';
2
- import { Banner, Button, Form, Input, Link } from '@pega/cosmos-react-core';
3
- import { AppShellDemo } from '@pega/cosmos-react-demos/lib/core/AppShell/AppShell.stories';
4
- import { CaseViewDemo } from '@pega/cosmos-react-demos/lib/work/CaseView/CaseView.stories';
2
+ import { Banner, Button, Configuration, Form, Input, Link } from '@pega/cosmos-react-core';
3
+ import { AppShellDemo } from '../AppShell/AppShell.stories';
4
+ import { CaseViewDemo } from '../../work/CaseView/CaseView.stories';
5
5
  import { demoFields, fieldReducer, formActions } from './Banner.mocks';
6
6
  export default {
7
7
  title: 'Core/Banner',
@@ -33,6 +33,27 @@ export const InfoBanner = () => {
33
33
  ]}/>)}
34
34
  </>);
35
35
  };
36
+ export const ConfigurableErrorBanner = (args) => {
37
+ return (<Configuration theme={{
38
+ components: {
39
+ banner: {
40
+ urgent: {
41
+ background: args.background
42
+ }
43
+ }
44
+ }
45
+ }}>
46
+ <Banner id='error' variant='urgent' heading='Error' action={<div>
47
+ <Button variant='link'>Try again</Button>
48
+ </div>} messages={['Your request failed to send!', 'Please review your request and try again']}/>
49
+ </Configuration>);
50
+ };
51
+ ConfigurableErrorBanner.args = {
52
+ background: '#d91c29'
53
+ };
54
+ ConfigurableErrorBanner.argTypes = {
55
+ background: { control: { type: 'color' } }
56
+ };
36
57
  export const ShownInForm = () => {
37
58
  const [fields, setField] = useReducer(fieldReducer, demoFields);
38
59
  const [banner, setBanner] = useState();
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.stories.jsx","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AA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C,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/C,OAAO,CACL,CAAC,YAAY,CACX,OAAO,CAAC,CACN,SAAS,IAAI,CACX,CAAC,MAAM,CACL,EAAE,CAAC,0BAA0B,CAC7B,OAAO,CAAC,+BAA+B,CACvC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAClC,OAAO,CAAC,SAAS,CACjB,QAAQ,CAAC,CAAC,CAAC,gBAAgB,EAAE,wBAAwB,CAAC,CAAC,CACvD,MAAM,CAAC,CACL,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAC/C;;cACF,EAAE,IAAI,CAAC,CACR,EACD,CACH,CACF,EACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,UAAU,GAAG;IAC3B,MAAM,EAAE,YAAY;CACrB,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useCallback, FormEvent, useReducer } from 'react';\n\nimport { Banner, Button, Form, Input, Link } from '@pega/cosmos-react-core';\nimport { AppShellDemo } from '@pega/cosmos-react-demos/lib/core/AppShell/AppShell.stories';\nimport { CaseViewDemo } from '@pega/cosmos-react-demos/lib/work/CaseView/CaseView.stories';\n\nimport { demoFields, DemoFormField, fieldReducer, formActions } from './Banner.mocks';\n\nexport default {\n title: 'Core/Banner',\n component: Banner\n} as Meta;\n\nexport const SuccessBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='success'\n variant='success'\n onDismiss={() => setShowBanner(false)}\n heading='2 items uploaded successfully'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n />\n )}\n </>\n );\n};\n\nexport const ErrorBanner = () => {\n return (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n action={\n <div>\n <Button variant='link'>Try again</Button>\n </div>\n }\n messages={['Your request failed to send!', 'Please review your request and try again']}\n />\n );\n};\n\nexport const WarningBanner = () => {\n return (\n <Banner\n id='warning'\n variant='warning'\n action={\n <div>\n <Button variant='link'>Why this matters</Button>\n </div>\n }\n messages={['Your submission is missing some important documents.']}\n />\n );\n};\n\nexport const InfoBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='info'\n variant='info'\n onDismiss={() => setShowBanner(false)}\n messages={[\n 'US-123456 is currently being modified by Jane Smith and may not be edited simultaneously.'\n ]}\n />\n )}\n </>\n );\n};\n\n// -----------------------------------------------------------------------------\n// Form story\n// -----------------------------------------------------------------------------\n\nexport const ShownInForm = () => {\n const [fields, setField] = useReducer(fieldReducer, demoFields);\n const [banner, setBanner] = useState<any>();\n\n const onSubmit = useCallback((e: FormEvent) => {\n e.preventDefault();\n const errorFields = fields.filter(field => !field.validator(field.value));\n let heading = 'Wow, great job!';\n let variant: 'success' | 'urgent' = 'success';\n let messages = fields.map(f => `${f.name} was typed perfectly`);\n let bannerAction;\n\n if (errorFields.length > 0) {\n heading = \"I'm sorry you're having trouble\";\n variant = 'urgent';\n messages = errorFields.map(f => `${f.name} was not typed correctly`);\n bannerAction = (\n <Link href='https://community.pega.com/support' target='_blank'>\n Visit Pega support for assistance\n </Link>\n );\n }\n\n setBanner(\n <Banner\n {...{\n heading,\n variant,\n messages,\n id: 'formBanner',\n action: bannerAction,\n onDismiss() {\n setBanner(false);\n }\n }}\n />\n );\n }, []);\n\n return (\n <Form\n banners={banner}\n actions={formActions}\n onSubmit={onSubmit}\n style={{ margin: 'auto', padding: '2.5rem', maxWidth: '37.5rem' }}\n >\n {fields.map((field: DemoFormField) => {\n return (\n <Input\n key={field.name}\n autoComplete='off'\n name={field.name}\n label={field.label}\n info={field.info}\n value={field.value}\n onChange={(e: InputEvent) => setField(e.target as any)}\n />\n );\n })}\n </Form>\n );\n};\n\n// -----------------------------------------------------------------------------\n// CaseView story\n// -----------------------------------------------------------------------------\nexport const ShownInCaseView = () => {\n const [hasBanner, setHasBanner] = useState(true);\n return (\n <CaseViewDemo\n banners={\n hasBanner && (\n <Banner\n id='case-view-error'\n heading='Waring'\n onDismiss={() => setHasBanner(false)}\n variant='warning'\n messages={['Your submission is missing some important documents.']}\n />\n )\n }\n />\n );\n};\n\nShownInCaseView.parameters = {\n layout: 'fullscreen'\n};\n\n// -----------------------------------------------------------------------------\n// AppShell story\n// -----------------------------------------------------------------------------\nexport const ShownInAppShell = () => {\n const [hasBanner, setHasBanner] = useState([]);\n return (\n <AppShellDemo\n banners={\n hasBanner && (\n <Banner\n id='app-shell-banner-success'\n heading='2 items uploaded successfully'\n onDismiss={() => setHasBanner([])}\n variant='success'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n action={\n <Link target='_blank' href='https://www.pega.com'>\n Link Here!\n </Link>\n }\n />\n )\n }\n />\n );\n};\n\nShownInAppShell.parameters = {\n layout: 'fullscreen'\n};\n"]}
1
+ {"version":3,"file":"Banner.stories.jsx","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAiB,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtF,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,E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,CACX,CAAC,MAAM,CACL,EAAE,CAAC,iBAAiB,CACpB,OAAO,CAAC,QAAQ,CAChB,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CACrC,OAAO,CAAC,SAAS,CACjB,QAAQ,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,EACnE,CACH,CACF,EACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,UAAU,GAAG;IAC3B,MAAM,EAAE,YAAY;CACrB,CAAC;AAKF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/C,OAAO,CACL,CAAC,YAAY,CACX,OAAO,CAAC,CACN,SAAS,IAAI,CACX,CAAC,MAAM,CACL,EAAE,CAAC,0BAA0B,CAC7B,OAAO,CAAC,+BAA+B,CACvC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAClC,OAAO,CAAC,SAAS,CACjB,QAAQ,CAAC,CAAC,CAAC,gBAAgB,EAAE,wBAAwB,CAAC,CAAC,CACvD,MAAM,CAAC,CACL,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAC/C;;cACF,EAAE,IAAI,CAAC,CACR,EACD,CACH,CACF,EACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,UAAU,GAAG;IAC3B,MAAM,EAAE,YAAY;CACrB,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useCallback, FormEvent, useReducer } from 'react';\n\nimport { Banner, Button, Configuration, Form, Input, Link } from '@pega/cosmos-react-core';\n\nimport { AppShellDemo } from '../AppShell/AppShell.stories';\nimport { CaseViewDemo } from '../../work/CaseView/CaseView.stories';\n\nimport { demoFields, DemoFormField, fieldReducer, formActions } from './Banner.mocks';\n\nexport default {\n title: 'Core/Banner',\n component: Banner\n} as Meta;\n\nexport const SuccessBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='success'\n variant='success'\n onDismiss={() => setShowBanner(false)}\n heading='2 items uploaded successfully'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n />\n )}\n </>\n );\n};\n\nexport const ErrorBanner = () => {\n return (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n action={\n <div>\n <Button variant='link'>Try again</Button>\n </div>\n }\n messages={['Your request failed to send!', 'Please review your request and try again']}\n />\n );\n};\n\nexport const WarningBanner = () => {\n return (\n <Banner\n id='warning'\n variant='warning'\n action={\n <div>\n <Button variant='link'>Why this matters</Button>\n </div>\n }\n messages={['Your submission is missing some important documents.']}\n />\n );\n};\n\nexport const InfoBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='info'\n variant='info'\n onDismiss={() => setShowBanner(false)}\n messages={[\n 'US-123456 is currently being modified by Jane Smith and may not be edited simultaneously.'\n ]}\n />\n )}\n </>\n );\n};\n\ninterface ConfigurableErrorBannerProps {\n background?: string;\n}\n\nexport const ConfigurableErrorBanner: Story<ConfigurableErrorBannerProps> = (\n args: ConfigurableErrorBannerProps\n) => {\n return (\n <Configuration\n theme={{\n components: {\n banner: {\n urgent: {\n background: args.background\n }\n }\n }\n }}\n >\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n action={\n <div>\n <Button variant='link'>Try again</Button>\n </div>\n }\n messages={['Your request failed to send!', 'Please review your request and try again']}\n />\n </Configuration>\n );\n};\n\nConfigurableErrorBanner.args = {\n background: '#d91c29'\n};\n\nConfigurableErrorBanner.argTypes = {\n background: { control: { type: 'color' } }\n};\n\n// -----------------------------------------------------------------------------\n// Form story\n// -----------------------------------------------------------------------------\n\nexport const ShownInForm = () => {\n const [fields, setField] = useReducer(fieldReducer, demoFields);\n const [banner, setBanner] = useState<any>();\n\n const onSubmit = useCallback((e: FormEvent) => {\n e.preventDefault();\n const errorFields = fields.filter(field => !field.validator(field.value));\n let heading = 'Wow, great job!';\n let variant: 'success' | 'urgent' = 'success';\n let messages = fields.map(f => `${f.name} was typed perfectly`);\n let bannerAction;\n\n if (errorFields.length > 0) {\n heading = \"I'm sorry you're having trouble\";\n variant = 'urgent';\n messages = errorFields.map(f => `${f.name} was not typed correctly`);\n bannerAction = (\n <Link href='https://community.pega.com/support' target='_blank'>\n Visit Pega support for assistance\n </Link>\n );\n }\n\n setBanner(\n <Banner\n {...{\n heading,\n variant,\n messages,\n id: 'formBanner',\n action: bannerAction,\n onDismiss() {\n setBanner(false);\n }\n }}\n />\n );\n }, []);\n\n return (\n <Form\n banners={banner}\n actions={formActions}\n onSubmit={onSubmit}\n style={{ margin: 'auto', padding: '2.5rem', maxWidth: '37.5rem' }}\n >\n {fields.map((field: DemoFormField) => {\n return (\n <Input\n key={field.name}\n autoComplete='off'\n name={field.name}\n label={field.label}\n info={field.info}\n value={field.value}\n onChange={(e: InputEvent) => setField(e.target as any)}\n />\n );\n })}\n </Form>\n );\n};\n\n// -----------------------------------------------------------------------------\n// CaseView story\n// -----------------------------------------------------------------------------\nexport const ShownInCaseView = () => {\n const [hasBanner, setHasBanner] = useState(true);\n return (\n <CaseViewDemo\n banners={\n hasBanner && (\n <Banner\n id='case-view-error'\n heading='Waring'\n onDismiss={() => setHasBanner(false)}\n variant='warning'\n messages={['Your submission is missing some important documents.']}\n />\n )\n }\n />\n );\n};\n\nShownInCaseView.parameters = {\n layout: 'fullscreen'\n};\n\n// -----------------------------------------------------------------------------\n// AppShell story\n// -----------------------------------------------------------------------------\nexport const ShownInAppShell = () => {\n const [hasBanner, setHasBanner] = useState([]);\n return (\n <AppShellDemo\n banners={\n hasBanner && (\n <Banner\n id='app-shell-banner-success'\n heading='2 items uploaded successfully'\n onDismiss={() => setHasBanner([])}\n variant='success'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n action={\n <Link target='_blank' href='https://www.pega.com'>\n Link Here!\n </Link>\n }\n />\n )\n }\n />\n );\n};\n\nShownInAppShell.parameters = {\n layout: 'fullscreen'\n};\n"]}
@@ -9,4 +9,12 @@ export declare const IconButtons: Story<ButtonProps>;
9
9
  export declare const LoadingButtons: Story<ButtonProps>;
10
10
  export declare const ButtonAsLink: () => JSX.Element;
11
11
  export declare const BareButtonDemo: Story<ButtonProps>;
12
+ interface ConfigurableButtonProps {
13
+ borderWidth?: string;
14
+ borderRadius?: number;
15
+ color?: string;
16
+ secondaryColor?: string;
17
+ padding?: string;
18
+ }
19
+ export declare const ConfigurableButton: Story<ConfigurableButtonProps>;
12
20
  //# sourceMappingURL=Button.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAU,WAAW,EAA4B,MAAM,yBAAyB,CAAC;;AAMxF,wBAMU;AAEV,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC;AAeF,eAAO,MAAM,eAAe,mBAoB3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,WAAW,CAoB1C,CAAC;AAUF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC;AAYF,eAAO,MAAM,YAAY,mBAMxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC"}
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAEL,WAAW,EAKZ,MAAM,yBAAyB,CAAC;;AAMjC,wBAMU;AAEV,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC;AAeF,eAAO,MAAM,eAAe,mBAoB3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,WAAW,CAoB1C,CAAC;AAUF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC;AAYF,eAAO,MAAM,YAAY,mBAMxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC;AAYF,UAAU,uBAAuB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,uBAAuB,CAoB7D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Button, Flex, Icon, registerIcon } from '@pega/cosmos-react-core';
1
+ import { Button, Configuration, Flex, Icon, registerIcon } from '@pega/cosmos-react-core';
2
2
  import * as plusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';
3
3
  import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
4
4
  registerIcon(plusIcon);
@@ -100,4 +100,33 @@ BareButtonDemo.argTypes = {
100
100
  disabled: { control: { type: 'boolean' } },
101
101
  href: { control: { type: 'text' } }
102
102
  };
103
+ export const ConfigurableButton = (args) => {
104
+ return (<Configuration theme={{
105
+ components: {
106
+ button: {
107
+ 'border-width': args.borderWidth,
108
+ 'border-radius': args.borderRadius,
109
+ color: args.color,
110
+ 'secondary-color': args.secondaryColor,
111
+ padding: args.padding
112
+ }
113
+ }
114
+ }}>
115
+ <Button>Configurable Button</Button>
116
+ </Configuration>);
117
+ };
118
+ ConfigurableButton.args = {
119
+ borderWidth: '0.0625rem',
120
+ borderRadius: 9999,
121
+ color: '#076bc9',
122
+ secondaryColor: '#ffffff',
123
+ padding: '0rem 1rem'
124
+ };
125
+ ConfigurableButton.argTypes = {
126
+ borderWidth: { control: { type: 'text' } },
127
+ borderRadius: { control: { type: 'number' } },
128
+ color: { control: { type: 'color' } },
129
+ secondaryColor: { control: { type: 'color' } },
130
+ padding: { control: { type: 'text' } }
131
+ };
103
132
  //# sourceMappingURL=Button.stories.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.stories.jsx","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,YAAY,CAAC,QAAQ,CAAC,CAAC;AAEvB,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,cAAc,GAAuB,CAAC,IAAiB,EAAE,EAAE;IACtE,OAAO,CACL,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CACnD;;IACF,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,IAAI,GAAG;IACpB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,KAAK;CACf,CAAC;AAEF,cAAc,CAAC,QAAQ,GAAG;IACxB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MA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,CAAC;AAEF,cAAc,CAAC,IAAI,GAAG;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,KAAK;CACZ,CAAC;AAEF,cAAc,CAAC,QAAQ,GAAG;IACxB,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC3E,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,OAAO,CACL,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CACnE;;IACF,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAuB,CAAC,IAAiB,EAAE,EAAE;IACtE,OAAO,CACL,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,CAChE;;IACF,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,IAAI,GAAG;IACpB,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,cAAc,CAAC,QAAQ,GAAG;IACxB,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC1C,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;CACpC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport { Button, ButtonProps, Flex, Icon, registerIcon } from '@pega/cosmos-react-core';\nimport * as plusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nregisterIcon(plusIcon);\n\nexport default {\n title: 'Core/Button',\n component: Button,\n parameters: {\n layout: 'centered'\n }\n} as Meta;\n\nexport const ButtonVariants: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <Button variant={args.variant} compact={args.compact}>\n Click me\n </Button>\n );\n};\n\nButtonVariants.args = {\n variant: 'primary',\n compact: false\n};\n\nButtonVariants.argTypes = {\n variant: {\n options: ['primary', 'secondary', 'simple', 'link', 'text'],\n control: { type: 'select' }\n },\n compact: { control: { type: 'boolean' } }\n};\n\nexport const DisabledButtons = () => {\n return (\n <>\n <Button variant='primary' disabled>\n Primary disabled\n </Button>\n <Button variant='secondary' disabled>\n Secondary disabled\n </Button>\n <Button variant='simple' disabled>\n Simple disabled\n </Button>\n <Button variant='link' disabled>\n Link disabled\n </Button>\n <Button variant='text' disabled>\n Text disabled\n </Button>\n </>\n );\n};\n\nexport const IconButtons: Story<ButtonProps> = ({ compact }: ButtonProps) => {\n return (\n <Flex container={{ alignItems: 'center' }}>\n <Button variant='primary' label='Icon button primary' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='secondary' label='Icon button secondary' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='simple' label='Icon button simple' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='link' label='Icon button link' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='text' label='Icon button text' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n </Flex>\n );\n};\n\nIconButtons.args = {\n compact: false\n};\n\nIconButtons.argTypes = {\n compact: { control: { type: 'boolean' } }\n};\n\nexport const LoadingButtons: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <Button variant={args.variant} icon={args.icon} label='Loading' loading>\n {args.icon ? <Icon name='plus' /> : 'Loading'}\n </Button>\n );\n};\n\nLoadingButtons.args = {\n variant: 'primary',\n icon: false\n};\n\nLoadingButtons.argTypes = {\n variant: { options: ['primary', 'secondary'], control: { type: 'select' } },\n icon: { control: { type: 'boolean' } }\n};\n\nexport const ButtonAsLink = () => {\n return (\n <Button variant='primary' href='https://www.pega.com' target='_blank'>\n Go to pega.com\n </Button>\n );\n};\n\nexport const BareButtonDemo: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <BareButton disabled={args.disabled} href={args.href || undefined}>\n Click me\n </BareButton>\n );\n};\n\nBareButtonDemo.args = {\n disabled: false,\n href: ''\n};\n\nBareButtonDemo.argTypes = {\n disabled: { control: { type: 'boolean' } },\n href: { control: { type: 'text' } }\n};\n"]}
1
+ {"version":3,"file":"Button.stories.jsx","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EAEN,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,YAAY,CAAC,QAAQ,CAAC,CAAC;AAEvB,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,cAAc,GAAuB,CAAC,IAAiB,EAAE,EAAE;IACtE,OAAO,CACL,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CACnD;;IACF,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,IAAI,GAAG;IACpB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,KAAK;CACf,CAAC;AAEF,cAAc,CAAC,QAAQ,GAAG;IACxB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,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UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,cAAc,EAAE,IAAI,CAAC,WAAW;oBAChC,eAAe,EAAE,IAAI,CAAC,YAAY;oBAClC,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,iBAAiB,EAAE,IAAI,CAAC,cAAc;oBACtC,OAAO,EAAE,IAAI,CAAC,OAAO;iBACtB;aACF;SACF,CAAC,CAEF;MAAA,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CACrC;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAkB,CAAC,IAAI,GAAG;IACxB,WAAW,EAAE,WAAW;IACxB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,kBAAkB,CAAC,QAAQ,GAAG;IAC5B,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAC1C,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC7C,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACrC,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAC9C,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;CACvC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport {\n Button,\n ButtonProps,\n Configuration,\n Flex,\n Icon,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport * as plusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nregisterIcon(plusIcon);\n\nexport default {\n title: 'Core/Button',\n component: Button,\n parameters: {\n layout: 'centered'\n }\n} as Meta;\n\nexport const ButtonVariants: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <Button variant={args.variant} compact={args.compact}>\n Click me\n </Button>\n );\n};\n\nButtonVariants.args = {\n variant: 'primary',\n compact: false\n};\n\nButtonVariants.argTypes = {\n variant: {\n options: ['primary', 'secondary', 'simple', 'link', 'text'],\n control: { type: 'select' }\n },\n compact: { control: { type: 'boolean' } }\n};\n\nexport const DisabledButtons = () => {\n return (\n <>\n <Button variant='primary' disabled>\n Primary disabled\n </Button>\n <Button variant='secondary' disabled>\n Secondary disabled\n </Button>\n <Button variant='simple' disabled>\n Simple disabled\n </Button>\n <Button variant='link' disabled>\n Link disabled\n </Button>\n <Button variant='text' disabled>\n Text disabled\n </Button>\n </>\n );\n};\n\nexport const IconButtons: Story<ButtonProps> = ({ compact }: ButtonProps) => {\n return (\n <Flex container={{ alignItems: 'center' }}>\n <Button variant='primary' label='Icon button primary' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='secondary' label='Icon button secondary' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='simple' label='Icon button simple' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='link' label='Icon button link' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='text' label='Icon button text' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n </Flex>\n );\n};\n\nIconButtons.args = {\n compact: false\n};\n\nIconButtons.argTypes = {\n compact: { control: { type: 'boolean' } }\n};\n\nexport const LoadingButtons: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <Button variant={args.variant} icon={args.icon} label='Loading' loading>\n {args.icon ? <Icon name='plus' /> : 'Loading'}\n </Button>\n );\n};\n\nLoadingButtons.args = {\n variant: 'primary',\n icon: false\n};\n\nLoadingButtons.argTypes = {\n variant: { options: ['primary', 'secondary'], control: { type: 'select' } },\n icon: { control: { type: 'boolean' } }\n};\n\nexport const ButtonAsLink = () => {\n return (\n <Button variant='primary' href='https://www.pega.com' target='_blank'>\n Go to pega.com\n </Button>\n );\n};\n\nexport const BareButtonDemo: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <BareButton disabled={args.disabled} href={args.href || undefined}>\n Click me\n </BareButton>\n );\n};\n\nBareButtonDemo.args = {\n disabled: false,\n href: ''\n};\n\nBareButtonDemo.argTypes = {\n disabled: { control: { type: 'boolean' } },\n href: { control: { type: 'text' } }\n};\n\ninterface ConfigurableButtonProps {\n borderWidth?: string;\n borderRadius?: number;\n color?: string;\n secondaryColor?: string;\n padding?: string;\n}\n\nexport const ConfigurableButton: Story<ConfigurableButtonProps> = (\n args: ConfigurableButtonProps\n) => {\n return (\n <Configuration\n theme={{\n components: {\n button: {\n 'border-width': args.borderWidth,\n 'border-radius': args.borderRadius,\n color: args.color,\n 'secondary-color': args.secondaryColor,\n padding: args.padding\n }\n }\n }}\n >\n <Button>Configurable Button</Button>\n </Configuration>\n );\n};\n\nConfigurableButton.args = {\n borderWidth: '0.0625rem',\n borderRadius: 9999,\n color: '#076bc9',\n secondaryColor: '#ffffff',\n padding: '0rem 1rem'\n};\n\nConfigurableButton.argTypes = {\n borderWidth: { control: { type: 'text' } },\n borderRadius: { control: { type: 'number' } },\n color: { control: { type: 'color' } },\n secondaryColor: { control: { type: 'color' } },\n padding: { control: { type: 'text' } }\n};\n"]}
@@ -5,4 +5,9 @@ declare const _default: Meta<import("@storybook/react").Args>;
5
5
  export default _default;
6
6
  export declare const SimpleCard: () => JSX.Element;
7
7
  export declare const FullCard: Story<CardFooterProps>;
8
+ interface ConfigurableCardProps {
9
+ borderRadius?: string;
10
+ background?: string;
11
+ }
12
+ export declare const ConfigurableCard: Story<ConfigurableCardProps>;
8
13
  //# sourceMappingURL=Card.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Card/Card.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAML,eAAe,EAIhB,MAAM,yBAAyB,CAAC;;AAIjC,wBAMU;AAEV,eAAO,MAAM,UAAU,mBAatB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,eAAe,CAwC3C,CAAC"}
1
+ {"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Card/Card.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAML,eAAe,EAKhB,MAAM,yBAAyB,CAAC;;AAIjC,wBAMU;AAEV,eAAO,MAAM,UAAU,mBAatB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,eAAe,CAwC3C,CAAC;AAaF,UAAU,qBAAqB;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,qBAAqB,CAwBzD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Card, CardHeader, CardMedia, CardContent, CardFooter, Image, MenuButton, Text } from '@pega/cosmos-react-core';
1
+ import { Card, CardHeader, CardMedia, CardContent, CardFooter, Image, MenuButton, Text, Configuration } from '@pega/cosmos-react-core';
2
2
  import { StyledCard } from './Card.styles';
3
3
  export default {
4
4
  title: 'Core/Card',
@@ -52,4 +52,33 @@ FullCard.argTypes = {
52
52
  control: { type: 'select' }
53
53
  }
54
54
  };
55
+ export const ConfigurableCard = (args) => {
56
+ return (<Configuration theme={{
57
+ components: {
58
+ card: {
59
+ 'border-radius': args.borderRadius,
60
+ background: args.background
61
+ }
62
+ }
63
+ }}>
64
+ <Card as={StyledCard}>
65
+ <CardHeader>
66
+ <Text variant='h2'>Simple Card</Text>
67
+ </CardHeader>
68
+ <CardContent>
69
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
70
+ ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
71
+ ullamco laboris nisi ut aliquip ex ea commodo consequat.
72
+ </CardContent>
73
+ </Card>
74
+ </Configuration>);
75
+ };
76
+ ConfigurableCard.args = {
77
+ borderRadius: '0.5rem',
78
+ background: '#71baff'
79
+ };
80
+ ConfigurableCard.argTypes = {
81
+ borderRadius: { control: { type: 'text' } },
82
+ background: { control: { type: 'color' } }
83
+ };
55
84
  //# sourceMappingURL=Card.stories.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.stories.jsx","sourceRoot":"","sources":["../../../src/core/Card/Card.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EAEV,KAAK,EACL,UAAU,EACV,IAAI,EACL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,OAAO,CACL,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CACnB;MAAA,CAAC,UAAU,CACT;QAAA,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CACtC;MAAA,EAAE,UAAU,CACZ;MAAA,CAAC,WAAW,CACV;;;;MAGF,EAAE,WAAW,CACf;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAA2B,CAAC,IAAqB,EAAE,EAAE;IACxE,OAAO,CACL,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CACnB;MAAA,CAAC,SAAS,CACR;QAAA,CAAC,KAAK,CACJ,GAAG,CAAC,yDAAyD,CAC7D,MAAM,CAAC,KAAK,CACZ,GAAG,CAAC,OAAO,EAEf;MAAA,EAAE,SAAS,CACX;MAAA,CAAC,UAAU,CACT,OAAO,CAAC,CACN,CAAC,UAAU,CACT,MAAM,CACN,OAAO,CAAC,QAAQ,CAChB,IAAI,CAAC,cAAc,CACnB,IAAI,CAAC,MAAM,CACX,QAAQ,CACR,IAAI,CAAC,CAAC;gBACJ,KAAK,EAAE;oBACL,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE;oBAC5C,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE;oBAC5C,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE;iBAC7C;aACF,CAAC,EACF,CACH,CAED;QAAA,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CACpC;MAAA,EAAE,UAAU,CACZ;MAAA,CAAC,WAAW,CACV;;;;MAGF,EAAE,WAAW,CACb;MAAA,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAChC;QAAA,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,sBAAsB,EAAE,IAAI,CACxD;MAAA,EAAE,UAAU,CACd;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,IAAI,GAAG;IACd,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,QAAQ,CAAC,QAAQ,GAAG;IAClB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;QAClE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;CACF,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport {\n Card,\n CardHeader,\n CardMedia,\n CardContent,\n CardFooter,\n CardFooterProps,\n Image,\n MenuButton,\n Text\n} from '@pega/cosmos-react-core';\n\nimport { StyledCard } from './Card.styles';\n\nexport default {\n title: 'Core/Card',\n component: Card,\n parameters: {\n layout: 'centered'\n }\n} as Meta;\n\nexport const SimpleCard = () => {\n return (\n <Card as={StyledCard}>\n <CardHeader>\n <Text variant='h2'>Simple Card</Text>\n </CardHeader>\n <CardContent>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut\n labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco\n laboris nisi ut aliquip ex ea commodo consequat.\n </CardContent>\n </Card>\n );\n};\n\nexport const FullCard: Story<CardFooterProps> = (args: CardFooterProps) => {\n return (\n <Card as={StyledCard}>\n <CardMedia>\n <Image\n src='https://www.pega.com/sites/default/files/default-og.jpg'\n height='100'\n alt='Media'\n />\n </CardMedia>\n <CardHeader\n actions={\n <MenuButton\n portal\n variant='simple'\n text='Card actions'\n icon='more'\n iconOnly\n menu={{\n items: [\n { id: 'action-1', primary: 'Card action 1' },\n { id: 'action-2', primary: 'Card action 2' },\n { id: 'action-3', primary: 'Card action 3' }\n ]\n }}\n />\n }\n >\n <Text variant='h2'>Full Card</Text>\n </CardHeader>\n <CardContent>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut\n labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco\n laboris nisi ut aliquip ex ea commodo consequat.\n </CardContent>\n <CardFooter justify={args.justify}>\n <Text variant='secondary'>This is the CardFooter</Text>\n </CardFooter>\n </Card>\n );\n};\n\nFullCard.args = {\n justify: 'start'\n};\n\nFullCard.argTypes = {\n justify: {\n options: ['start', 'end', 'center', 'between', 'around', 'evenly'],\n control: { type: 'select' }\n }\n};\n"]}
1
+ {"version":3,"file":"Card.stories.jsx","sourceRoot":"","sources":["../../../src/core/Card/Card.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,SAAS,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Aa,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,IAAI,GAAG;IACtB,YAAY,EAAE,QAAQ;IACtB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEF,gBAAgB,CAAC,QAAQ,GAAG;IAC1B,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAC3C,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;CAC3C,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport {\n Card,\n CardHeader,\n CardMedia,\n CardContent,\n CardFooter,\n CardFooterProps,\n Image,\n MenuButton,\n Text,\n Configuration\n} from '@pega/cosmos-react-core';\n\nimport { StyledCard } from './Card.styles';\n\nexport default {\n title: 'Core/Card',\n component: Card,\n parameters: {\n layout: 'centered'\n }\n} as Meta;\n\nexport const SimpleCard = () => {\n return (\n <Card as={StyledCard}>\n <CardHeader>\n <Text variant='h2'>Simple Card</Text>\n </CardHeader>\n <CardContent>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut\n labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco\n laboris nisi ut aliquip ex ea commodo consequat.\n </CardContent>\n </Card>\n );\n};\n\nexport const FullCard: Story<CardFooterProps> = (args: CardFooterProps) => {\n return (\n <Card as={StyledCard}>\n <CardMedia>\n <Image\n src='https://www.pega.com/sites/default/files/default-og.jpg'\n height='100'\n alt='Media'\n />\n </CardMedia>\n <CardHeader\n actions={\n <MenuButton\n portal\n variant='simple'\n text='Card actions'\n icon='more'\n iconOnly\n menu={{\n items: [\n { id: 'action-1', primary: 'Card action 1' },\n { id: 'action-2', primary: 'Card action 2' },\n { id: 'action-3', primary: 'Card action 3' }\n ]\n }}\n />\n }\n >\n <Text variant='h2'>Full Card</Text>\n </CardHeader>\n <CardContent>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut\n labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco\n laboris nisi ut aliquip ex ea commodo consequat.\n </CardContent>\n <CardFooter justify={args.justify}>\n <Text variant='secondary'>This is the CardFooter</Text>\n </CardFooter>\n </Card>\n );\n};\n\nFullCard.args = {\n justify: 'start'\n};\n\nFullCard.argTypes = {\n justify: {\n options: ['start', 'end', 'center', 'between', 'around', 'evenly'],\n control: { type: 'select' }\n }\n};\n\ninterface ConfigurableCardProps {\n borderRadius?: string;\n background?: string;\n}\n\nexport const ConfigurableCard: Story<ConfigurableCardProps> = (args: ConfigurableCardProps) => {\n return (\n <Configuration\n theme={{\n components: {\n card: {\n 'border-radius': args.borderRadius,\n background: args.background\n }\n }\n }}\n >\n <Card as={StyledCard}>\n <CardHeader>\n <Text variant='h2'>Simple Card</Text>\n </CardHeader>\n <CardContent>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt\n ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation\n ullamco laboris nisi ut aliquip ex ea commodo consequat.\n </CardContent>\n </Card>\n </Configuration>\n );\n};\n\nConfigurableCard.args = {\n borderRadius: '0.5rem',\n background: '#71baff'\n};\n\nConfigurableCard.argTypes = {\n borderRadius: { control: { type: 'text' } },\n background: { control: { type: 'color' } }\n};\n"]}
@@ -4,4 +4,16 @@ declare const _default: Meta<import("@storybook/react").Args>;
4
4
  export default _default;
5
5
  export declare const DefaultCheckbox: Story<RadioCheckProps>;
6
6
  export declare const CheckboxCard: Story<RadioCheckProps>;
7
+ interface ConfigurableCheckboxProps extends RadioCheckProps {
8
+ size?: string;
9
+ backgroundColor?: string;
10
+ borderColor?: string;
11
+ borderWidth?: string;
12
+ borderRadius?: string;
13
+ labelColor?: string;
14
+ labelFontWeight?: string;
15
+ checkedBackgroundColor?: string;
16
+ checkedBorderColor?: string;
17
+ }
18
+ export declare const ConfigurableCheckbox: Story<ConfigurableCheckboxProps>;
7
19
  //# sourceMappingURL=Checkbox.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAY,eAAe,EAAE,MAAM,yBAAyB,CAAC;;AAEpE,wBAmBU;AAEV,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,eAAe,CAWlD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,eAAe,CAY/C,CAAC"}
1
+ {"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAA2B,eAAe,EAAE,MAAM,yBAAyB,CAAC;;AAEnF,wBAmBU;AAEV,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,eAAe,CAWlD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,eAAe,CAY/C,CAAC;AAEF,UAAU,yBAA0B,SAAQ,eAAe;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,yBAAyB,CA8BjE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Checkbox } from '@pega/cosmos-react-core';
1
+ import { Checkbox, Configuration } from '@pega/cosmos-react-core';
2
2
  export default {
3
3
  title: 'Core/Checkbox',
4
4
  component: Checkbox,
@@ -25,4 +25,57 @@ export const DefaultCheckbox = (args) => {
25
25
  export const CheckboxCard = (args) => {
26
26
  return (<Checkbox variant='card' status={args.status} label={args.label} required={args.required} disabled={args.disabled} readOnly={args.readOnly} indeterminate={args.indeterminate}/>);
27
27
  };
28
+ export const ConfigurableCheckbox = (args) => {
29
+ return (<Configuration theme={{
30
+ components: {
31
+ checkbox: {
32
+ 'border-radius': args.borderRadius
33
+ },
34
+ 'radio-check': {
35
+ 'border-color': args.borderColor,
36
+ 'border-width': args.borderWidth,
37
+ 'background-color': args.backgroundColor,
38
+ label: {
39
+ color: args.labelColor,
40
+ 'font-weight': args.labelFontWeight
41
+ },
42
+ size: args.size,
43
+ ':checked': {
44
+ 'background-color': args.checkedBackgroundColor,
45
+ 'border-color': args.checkedBorderColor
46
+ }
47
+ }
48
+ }
49
+ }}>
50
+ <Checkbox label='Configurable Checkbox'/>
51
+ </Configuration>);
52
+ };
53
+ ConfigurableCheckbox.args = {
54
+ size: '1.25rem',
55
+ backgroundColor: '#ffffff',
56
+ borderColor: '#939393',
57
+ borderWidth: '0.0625rem',
58
+ borderRadius: '0.5',
59
+ labelColor: '#939393',
60
+ labelFontWeight: '400',
61
+ checkedBackgroundColor: '#076bc9',
62
+ checkedBorderColor: '#076bc9'
63
+ };
64
+ ConfigurableCheckbox.argTypes = {
65
+ size: { control: { type: 'text' } },
66
+ backgroundColor: { control: { type: 'color' } },
67
+ borderColor: { control: { type: 'color' } },
68
+ borderWidth: { control: { type: 'text' } },
69
+ borderRadius: { control: { type: 'text' } },
70
+ labelColor: { control: { type: 'color' } },
71
+ labelFontWeight: { control: { type: 'text' } },
72
+ checkedBackgroundColor: { control: { type: 'color' } },
73
+ checkedBorderColor: { control: { type: 'color' } },
74
+ status: { table: { disable: true } },
75
+ label: { table: { disable: true } },
76
+ required: { table: { disable: true } },
77
+ disabled: { table: { disable: true } },
78
+ readOnly: { table: { disable: true } },
79
+ indeterminate: { table: { disable: true } }
80
+ };
28
81
  //# sourceMappingURL=Checkbox.stories.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.stories.jsx","sourceRoot":"","sources":["../../../src/core/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAmB,MAAM,yBAAyB,CAAC;AAEpE,eAAe;IACb,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,kBAAkB;QACzB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,KAAK;KACrB;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAC5F,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACpC,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC1C,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC1C,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC1C,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;KAChD;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,eAAe,GAA2B,CAAC,IAAqB,EAAE,EAAE;IAC/E,OAAO,CACL,CAAC,QAAQ,CACP,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CACpB,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxB,aAAa,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAClC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAA2B,CAAC,IAAqB,EAAE,EAAE;IAC5E,OAAO,CACL,CAAC,QAAQ,CACP,OAAO,CAAC,MAAM,CACd,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CACpB,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxB,aAAa,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAClC,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport { Checkbox, RadioCheckProps } from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Core/Checkbox',\n component: Checkbox,\n args: {\n status: undefined,\n label: 'Check me, please',\n required: false,\n disabled: false,\n readOnly: false,\n indeterminate: false\n },\n argTypes: {\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n label: { control: { type: 'text' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } },\n indeterminate: { control: { type: 'boolean' } }\n }\n} as Meta;\n\nexport const DefaultCheckbox: Story<RadioCheckProps> = (args: RadioCheckProps) => {\n return (\n <Checkbox\n status={args.status}\n label={args.label}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n indeterminate={args.indeterminate}\n />\n );\n};\n\nexport const CheckboxCard: Story<RadioCheckProps> = (args: RadioCheckProps) => {\n return (\n <Checkbox\n variant='card'\n status={args.status}\n label={args.label}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n indeterminate={args.indeterminate}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"Checkbox.stories.jsx","sourceRoot":"","sources":["../../../src/core/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAmB,MAAM,yBAAyB,CAAC;AAEnF,eAAe;IACb,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,kBAAkB;QACzB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,KAAK;KACrB;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAC5F,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACpC,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC1C,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC1C,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC1C,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;KAChD;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,eAAe,GAA2B,CAAC,IAAqB,EAAE,EAAE;IAC/E,OAAO,CACL,CAAC,QAAQ,CACP,MAAM,CAA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AE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACpC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACnC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtC,aAAa,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC5C,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport { Checkbox, Configuration, RadioCheckProps } from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Core/Checkbox',\n component: Checkbox,\n args: {\n status: undefined,\n label: 'Check me, please',\n required: false,\n disabled: false,\n readOnly: false,\n indeterminate: false\n },\n argTypes: {\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n label: { control: { type: 'text' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } },\n indeterminate: { control: { type: 'boolean' } }\n }\n} as Meta;\n\nexport const DefaultCheckbox: Story<RadioCheckProps> = (args: RadioCheckProps) => {\n return (\n <Checkbox\n status={args.status}\n label={args.label}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n indeterminate={args.indeterminate}\n />\n );\n};\n\nexport const CheckboxCard: Story<RadioCheckProps> = (args: RadioCheckProps) => {\n return (\n <Checkbox\n variant='card'\n status={args.status}\n label={args.label}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n indeterminate={args.indeterminate}\n />\n );\n};\n\ninterface ConfigurableCheckboxProps extends RadioCheckProps {\n size?: string;\n backgroundColor?: string;\n borderColor?: string;\n borderWidth?: string;\n borderRadius?: string;\n labelColor?: string;\n labelFontWeight?: string;\n checkedBackgroundColor?: string;\n checkedBorderColor?: string;\n}\n\nexport const ConfigurableCheckbox: Story<ConfigurableCheckboxProps> = (\n args: ConfigurableCheckboxProps\n) => {\n return (\n <Configuration\n theme={{\n components: {\n checkbox: {\n 'border-radius': args.borderRadius\n },\n 'radio-check': {\n 'border-color': args.borderColor,\n 'border-width': args.borderWidth,\n 'background-color': args.backgroundColor,\n label: {\n color: args.labelColor,\n 'font-weight': args.labelFontWeight\n },\n size: args.size,\n ':checked': {\n 'background-color': args.checkedBackgroundColor,\n 'border-color': args.checkedBorderColor\n }\n }\n }\n }}\n >\n <Checkbox label='Configurable Checkbox' />\n </Configuration>\n );\n};\n\nConfigurableCheckbox.args = {\n size: '1.25rem',\n backgroundColor: '#ffffff',\n borderColor: '#939393',\n borderWidth: '0.0625rem',\n borderRadius: '0.5',\n labelColor: '#939393',\n labelFontWeight: '400',\n checkedBackgroundColor: '#076bc9',\n checkedBorderColor: '#076bc9'\n};\n\nConfigurableCheckbox.argTypes = {\n size: { control: { type: 'text' } },\n backgroundColor: { control: { type: 'color' } },\n borderColor: { control: { type: 'color' } },\n borderWidth: { control: { type: 'text' } },\n borderRadius: { control: { type: 'text' } },\n labelColor: { control: { type: 'color' } },\n labelFontWeight: { control: { type: 'text' } },\n checkedBackgroundColor: { control: { type: 'color' } },\n checkedBorderColor: { control: { type: 'color' } },\n status: { table: { disable: true } },\n label: { table: { disable: true } },\n required: { table: { disable: true } },\n disabled: { table: { disable: true } },\n readOnly: { table: { disable: true } },\n indeterminate: { table: { disable: true } }\n};\n"]}
@@ -7,4 +7,21 @@ export declare const ThemedForm: Story<{
7
7
  }>;
8
8
  export declare const ThemingHierarchy: () => JSX.Element;
9
9
  export declare const OverridableActionMenu: () => JSX.Element;
10
+ interface ConfigurableBaseThemeProps {
11
+ interactive?: string;
12
+ }
13
+ export declare const ConfigurableBaseTheme: Story<ConfigurableBaseThemeProps>;
14
+ interface ConfigurableComponentThemeProps {
15
+ buttonColor?: string;
16
+ checkedBackgroundColor?: string;
17
+ }
18
+ export declare const ConfigurableComponentTheme: Story<ConfigurableComponentThemeProps>;
19
+ interface ConfigurableLocaleProps {
20
+ locale?: string;
21
+ }
22
+ export declare const ConfigurableLocale: Story<ConfigurableLocaleProps>;
23
+ interface ConfigurableTranslationsProps {
24
+ placeholderTranslation?: string;
25
+ }
26
+ export declare const ConfigurableTranslations: Story<ConfigurableTranslationsProps>;
10
27
  //# sourceMappingURL=Configuration.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAa/C,wBAGU;AAEV,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CA+B7D,CAAC;AA2CF,eAAO,MAAM,gBAAgB,mBAyE5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAWjC,CAAC"}
1
+ {"version":3,"file":"Configuration.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAoB/C,wBAIU;AAEV,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CA+B7D,CAAC;AA2CF,eAAO,MAAM,gBAAgB,mBAyE5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAWjC,CAAC;AAEF,UAAU,0BAA0B;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,0BAA0B,CAsBnE,CAAC;AAUF,UAAU,+BAA+B;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,+BAA+B,CA2B7E,CAAC;AAYF,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,uBAAuB,CAU7D,CAAC;AAUF,UAAU,6BAA6B;IACrC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,6BAA6B,CAsBzE,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { useState } from 'react';
2
2
  import styled from 'styled-components';
3
- import { Button, Configuration, MenuButton, resetToInitial } from '@pega/cosmos-react-core';
4
- import { FormContent } from '@pega/cosmos-react-demos/lib/core/Form/Form.mocks';
3
+ import { Button, Configuration, MenuButton, resetToInitial, Flex, Checkbox, RadioButton, DateInput, SearchInput, Text } from '@pega/cosmos-react-core';
4
+ import { FormContent } from '../Form/Form.mocks';
5
5
  export default {
6
6
  title: 'Core/Configuration',
7
- component: Configuration
7
+ component: Configuration,
8
+ includeStories: ['ThemedForm', 'ThemingHierarchy', 'OverridableActionMenu']
8
9
  };
9
10
  export const ThemedForm = (args) => {
10
11
  const themes = {
@@ -122,4 +123,94 @@ export const OverridableActionMenu = () => {
122
123
  </Configuration>
123
124
  </>);
124
125
  };
126
+ export const ConfigurableBaseTheme = (args) => {
127
+ return (<Configuration theme={{
128
+ base: {
129
+ palette: {
130
+ interactive: args.interactive
131
+ }
132
+ }
133
+ }}>
134
+ <Flex container={{ gap: 2, justify: 'start' }}>
135
+ <Button variant='primary'>Primary</Button>
136
+ <Flex item={{ shrink: 1, alignSelf: 'center' }}>
137
+ <Checkbox id='checkbox' label='Checkbox Option' defaultChecked/>
138
+ </Flex>
139
+ <RadioButton id='radio-button' label='Radio Option' defaultChecked/>
140
+ </Flex>
141
+ </Configuration>);
142
+ };
143
+ ConfigurableBaseTheme.args = {
144
+ interactive: '#681fc3'
145
+ };
146
+ ConfigurableBaseTheme.argTypes = {
147
+ interactive: { control: { type: 'color' } }
148
+ };
149
+ export const ConfigurableComponentTheme = (args) => {
150
+ return (<Configuration theme={{
151
+ components: {
152
+ button: {
153
+ color: args.buttonColor
154
+ },
155
+ 'radio-check': {
156
+ ':checked': {
157
+ 'background-color': args.checkedBackgroundColor
158
+ }
159
+ }
160
+ }
161
+ }}>
162
+ <Flex container={{ gap: 2, justify: 'start' }}>
163
+ <Button variant='primary'>Primary</Button>
164
+ <Flex item={{ shrink: 1, alignSelf: 'center' }}>
165
+ <Checkbox id='checkbox' label='Checkbox Option' defaultChecked/>
166
+ </Flex>
167
+ <RadioButton id='radio-button' label='Radio Option' defaultChecked/>
168
+ </Flex>
169
+ </Configuration>);
170
+ };
171
+ ConfigurableComponentTheme.args = {
172
+ buttonColor: '#681fc3',
173
+ checkedBackgroundColor: '#20aa50'
174
+ };
175
+ ConfigurableComponentTheme.argTypes = {
176
+ buttonColor: { control: { type: 'color' } },
177
+ checkedBackgroundColor: { control: { type: 'color' } }
178
+ };
179
+ export const ConfigurableLocale = (args) => {
180
+ return (<Configuration locale={args.locale}>
181
+ <Flex container={{ direction: 'column', gap: 2 }}>
182
+ <DateInput label='Date Input with locale support' value={new Date()}/>
183
+ </Flex>
184
+ </Configuration>);
185
+ };
186
+ ConfigurableLocale.args = {
187
+ locale: 'en-US'
188
+ };
189
+ ConfigurableLocale.argTypes = {
190
+ locale: { options: ['en-US', 'pl', 'fr', 'hu', 'de-DE'], control: { type: 'select' } }
191
+ };
192
+ export const ConfigurableTranslations = (args) => {
193
+ const spanishTranslation = {
194
+ search_placeholder_default: args.placeholderTranslation
195
+ };
196
+ return (<Flex container={{ gap: 4 }}>
197
+ <Flex container={{ direction: 'column' }}>
198
+ <Text variant='h4'>Default</Text>
199
+ <SearchInput />
200
+ </Flex>
201
+
202
+ <Configuration translations={spanishTranslation}>
203
+ <Flex container={{ direction: 'column' }}>
204
+ <Text variant='h4'>Translated</Text>
205
+ <SearchInput />
206
+ </Flex>
207
+ </Configuration>
208
+ </Flex>);
209
+ };
210
+ ConfigurableTranslations.args = {
211
+ placeholderTranslation: 'Buscar...'
212
+ };
213
+ ConfigurableTranslations.argTypes = {
214
+ placeholderTranslation: { control: { type: 'text' } }
215
+ };
125
216
  //# sourceMappingURL=Configuration.stories.jsx.map