@webiny/ui 0.0.0-mt-3 → 0.0.0-unstable.085ff6572f

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 (490) hide show
  1. package/Accordion/Accordion.d.ts +5 -5
  2. package/Accordion/Accordion.js +22 -22
  3. package/Accordion/Accordion.js.map +1 -0
  4. package/Accordion/Accordion.stories.js +26 -23
  5. package/Accordion/Accordion.stories.js.map +1 -0
  6. package/Accordion/AccordionItem.d.ts +27 -8
  7. package/Accordion/AccordionItem.js +91 -84
  8. package/Accordion/AccordionItem.js.map +1 -0
  9. package/Accordion/AccordionItemActions.d.ts +8 -0
  10. package/Accordion/AccordionItemActions.js +28 -0
  11. package/Accordion/AccordionItemActions.js.map +1 -0
  12. package/Accordion/index.js +27 -2
  13. package/Accordion/index.js.map +1 -0
  14. package/Alert/Alert.d.ts +4 -4
  15. package/Alert/Alert.js +19 -15
  16. package/Alert/Alert.js.map +1 -0
  17. package/Alert/Alert.stories.js +16 -13
  18. package/Alert/Alert.stories.js.map +1 -0
  19. package/Alert/index.js +16 -1
  20. package/Alert/index.js.map +1 -0
  21. package/AutoComplete/AutoComplete.d.ts +13 -19
  22. package/AutoComplete/AutoComplete.js +150 -149
  23. package/AutoComplete/AutoComplete.js.map +1 -0
  24. package/AutoComplete/AutoComplete.stories.js +20 -17
  25. package/AutoComplete/AutoComplete.stories.js.map +1 -0
  26. package/AutoComplete/MultiAutoComplete.d.ts +44 -40
  27. package/AutoComplete/MultiAutoComplete.js +304 -311
  28. package/AutoComplete/MultiAutoComplete.js.map +1 -0
  29. package/AutoComplete/MultiAutoComplete.stories.js +31 -28
  30. package/AutoComplete/MultiAutoComplete.stories.js.map +1 -0
  31. package/AutoComplete/index.js +27 -2
  32. package/AutoComplete/index.js.map +1 -0
  33. package/AutoComplete/styles.js +33 -4
  34. package/AutoComplete/styles.js.map +1 -0
  35. package/AutoComplete/types.d.ts +4 -3
  36. package/AutoComplete/types.js +5 -1
  37. package/AutoComplete/types.js.map +1 -0
  38. package/AutoComplete/utils.d.ts +11 -5
  39. package/AutoComplete/utils.js +15 -8
  40. package/AutoComplete/utils.js.map +1 -0
  41. package/Avatar/Avatar.d.ts +5 -11
  42. package/Avatar/Avatar.js +37 -28
  43. package/Avatar/Avatar.js.map +1 -0
  44. package/Avatar/Avatar.stories.js +13 -10
  45. package/Avatar/Avatar.stories.js.map +1 -0
  46. package/Avatar/index.js +16 -1
  47. package/Avatar/index.js.map +1 -0
  48. package/Button/Button.d.ts +39 -24
  49. package/Button/Button.js +74 -83
  50. package/Button/Button.js.map +1 -0
  51. package/Button/Button.stories.js +32 -29
  52. package/Button/Button.stories.js.map +1 -0
  53. package/Button/Button.styles.d.ts +6 -0
  54. package/Button/Button.styles.js +13 -0
  55. package/Button/Button.styles.js.map +1 -0
  56. package/Button/CopyButton/CopyButton.d.ts +4 -7
  57. package/Button/CopyButton/CopyButton.js +18 -18
  58. package/Button/CopyButton/CopyButton.js.map +1 -0
  59. package/Button/CopyButton/CopyButton.stories.js +13 -10
  60. package/Button/CopyButton/CopyButton.stories.js.map +1 -0
  61. package/Button/IconButton/IconButton.d.ts +4 -7
  62. package/Button/IconButton/IconButton.js +16 -15
  63. package/Button/IconButton/IconButton.js.map +1 -0
  64. package/Button/IconButton/IconButton.stories.js +22 -19
  65. package/Button/IconButton/IconButton.stories.js.map +1 -0
  66. package/Button/index.js +38 -3
  67. package/Button/index.js.map +1 -0
  68. package/Carousel/Carousel.d.ts +3 -3
  69. package/Carousel/Carousel.js +24 -25
  70. package/Carousel/Carousel.js.map +1 -0
  71. package/Carousel/Carouser.stories.js +20 -17
  72. package/Carousel/Carouser.stories.js.map +1 -0
  73. package/Carousel/index.js +13 -1
  74. package/Carousel/index.js.map +1 -0
  75. package/Checkbox/Checkbox.d.ts +6 -9
  76. package/Checkbox/Checkbox.js +40 -44
  77. package/Checkbox/Checkbox.js.map +1 -0
  78. package/Checkbox/Checkbox.stories.js +19 -16
  79. package/Checkbox/Checkbox.stories.js.map +1 -0
  80. package/Checkbox/Checkbox.styles.js +9 -4
  81. package/Checkbox/Checkbox.styles.js.map +1 -0
  82. package/Checkbox/CheckboxGroup.d.ts +2 -2
  83. package/Checkbox/CheckboxGroup.js +34 -35
  84. package/Checkbox/CheckboxGroup.js.map +1 -0
  85. package/Checkbox/CheckboxGroup.stories.js +23 -20
  86. package/Checkbox/CheckboxGroup.stories.js.map +1 -0
  87. package/Checkbox/index.js +20 -2
  88. package/Checkbox/index.js.map +1 -0
  89. package/Chips/Chip.d.ts +3 -8
  90. package/Chips/Chip.js +15 -8
  91. package/Chips/Chip.js.map +1 -0
  92. package/Chips/Chips.d.ts +4 -4
  93. package/Chips/Chips.js +21 -14
  94. package/Chips/Chips.js.map +1 -0
  95. package/Chips/Chips.stories.js +25 -18
  96. package/Chips/Chips.stories.js.map +1 -0
  97. package/Chips/index.d.ts +0 -1
  98. package/Chips/index.js +27 -3
  99. package/Chips/index.js.map +1 -0
  100. package/Chips/styles.js +19 -9
  101. package/Chips/styles.js.map +1 -0
  102. package/CodeEditor/CodeEditor.d.ts +5 -8
  103. package/CodeEditor/CodeEditor.js +42 -49
  104. package/CodeEditor/CodeEditor.js.map +1 -0
  105. package/CodeEditor/CodeEditor.stories.js +20 -17
  106. package/CodeEditor/CodeEditor.stories.js.map +1 -0
  107. package/CodeEditor/index.js +16 -1
  108. package/CodeEditor/index.js.map +1 -0
  109. package/ColorPicker/ColorPicker.d.ts +9 -10
  110. package/ColorPicker/ColorPicker.js +54 -66
  111. package/ColorPicker/ColorPicker.js.map +1 -0
  112. package/ColorPicker/ColorPicker.stories.js +18 -15
  113. package/ColorPicker/ColorPicker.stories.js.map +1 -0
  114. package/ColorPicker/index.js +16 -1
  115. package/ColorPicker/index.js.map +1 -0
  116. package/ConfirmationDialog/ConfirmationDialog.d.ts +13 -13
  117. package/ConfirmationDialog/ConfirmationDialog.js +76 -96
  118. package/ConfirmationDialog/ConfirmationDialog.js.map +1 -0
  119. package/ConfirmationDialog/ConfirmationDialog.stories.js +15 -12
  120. package/ConfirmationDialog/ConfirmationDialog.stories.js.map +1 -0
  121. package/ConfirmationDialog/index.js +27 -2
  122. package/ConfirmationDialog/index.js.map +1 -0
  123. package/ConfirmationDialog/withConfirmation.d.ts +2 -2
  124. package/ConfirmationDialog/withConfirmation.js +14 -6
  125. package/ConfirmationDialog/withConfirmation.js.map +1 -0
  126. package/DataTable/DataTable.d.ts +75 -0
  127. package/DataTable/DataTable.js +198 -0
  128. package/DataTable/DataTable.js.map +1 -0
  129. package/DataTable/DataTable.stories.d.ts +1 -0
  130. package/DataTable/DataTable.stories.js +74 -0
  131. package/DataTable/DataTable.stories.js.map +1 -0
  132. package/DataTable/README.md +72 -0
  133. package/DataTable/index.d.ts +1 -0
  134. package/DataTable/index.js +16 -0
  135. package/DataTable/index.js.map +1 -0
  136. package/DataTable/styled.d.ts +30 -0
  137. package/DataTable/styled.js +36 -0
  138. package/DataTable/styled.js.map +1 -0
  139. package/DelayedOnChange/DelayedOnChange.d.ts +40 -0
  140. package/DelayedOnChange/DelayedOnChange.js +113 -0
  141. package/DelayedOnChange/DelayedOnChange.js.map +1 -0
  142. package/DelayedOnChange/index.d.ts +2 -0
  143. package/DelayedOnChange/index.js +20 -0
  144. package/DelayedOnChange/index.js.map +1 -0
  145. package/DelayedOnChange/withDelayedOnChange.d.ts +3 -0
  146. package/DelayedOnChange/withDelayedOnChange.js +31 -0
  147. package/DelayedOnChange/withDelayedOnChange.js.map +1 -0
  148. package/Dialog/Dialog.d.ts +22 -30
  149. package/Dialog/Dialog.js +59 -55
  150. package/Dialog/Dialog.js.map +1 -0
  151. package/Dialog/Dialog.stories.js +19 -16
  152. package/Dialog/Dialog.stories.js.map +1 -0
  153. package/Dialog/index.js +16 -1
  154. package/Dialog/index.js.map +1 -0
  155. package/Drawer/Drawer.d.ts +1 -1
  156. package/Drawer/Drawer.js +14 -9
  157. package/Drawer/Drawer.js.map +1 -0
  158. package/Drawer/Drawer.stories.js +18 -15
  159. package/Drawer/Drawer.stories.js.map +1 -0
  160. package/Drawer/index.js +16 -1
  161. package/Drawer/index.js.map +1 -0
  162. package/DynamicFieldset/Fieldset.d.ts +26 -16
  163. package/DynamicFieldset/Fieldset.js +69 -74
  164. package/DynamicFieldset/Fieldset.js.map +1 -0
  165. package/DynamicFieldset/index.js +13 -1
  166. package/DynamicFieldset/index.js.map +1 -0
  167. package/Elevation/Elevation.d.ts +1 -1
  168. package/Elevation/Elevation.js +12 -6
  169. package/Elevation/Elevation.js.map +1 -0
  170. package/Elevation/Elevation.stories.js +19 -16
  171. package/Elevation/Elevation.stories.js.map +1 -0
  172. package/Elevation/index.js +16 -1
  173. package/Elevation/index.js.map +1 -0
  174. package/FormElementMessage/FormElementMessage.d.ts +1 -1
  175. package/FormElementMessage/FormElementMessage.js +11 -6
  176. package/FormElementMessage/FormElementMessage.js.map +1 -0
  177. package/FormElementMessage/index.js +12 -1
  178. package/FormElementMessage/index.js.map +1 -0
  179. package/FullName/FullName.js +7 -7
  180. package/FullName/FullName.js.map +1 -0
  181. package/FullName/index.js +16 -1
  182. package/FullName/index.js.map +1 -0
  183. package/Grid/Grid.d.ts +1 -1
  184. package/Grid/Grid.js +19 -10
  185. package/Grid/Grid.js.map +1 -0
  186. package/Grid/Grid.stories.js +15 -12
  187. package/Grid/Grid.stories.js.map +1 -0
  188. package/Grid/index.js +16 -1
  189. package/Grid/index.js.map +1 -0
  190. package/Helpers/ClassNames.d.ts +4 -3
  191. package/Helpers/ClassNames.js +16 -14
  192. package/Helpers/ClassNames.js.map +1 -0
  193. package/Helpers/index.js +12 -2
  194. package/Helpers/index.js.map +1 -0
  195. package/Icon/Icon.d.ts +3 -6
  196. package/Icon/Icon.js +15 -12
  197. package/Icon/Icon.js.map +1 -0
  198. package/Icon/Icon.stories.js +23 -20
  199. package/Icon/Icon.stories.js.map +1 -0
  200. package/Icon/index.js +16 -1
  201. package/Icon/index.js.map +1 -0
  202. package/Image/Image.d.ts +5 -4
  203. package/Image/Image.js +17 -13
  204. package/Image/Image.js.map +1 -0
  205. package/Image/Image.stories.js +14 -11
  206. package/Image/Image.stories.js.map +1 -0
  207. package/Image/index.js +16 -1
  208. package/Image/index.js.map +1 -0
  209. package/ImageEditor/ImageEditor.d.ts +33 -34
  210. package/ImageEditor/ImageEditor.js +129 -163
  211. package/ImageEditor/ImageEditor.js.map +1 -0
  212. package/ImageEditor/index.js +16 -1
  213. package/ImageEditor/index.js.map +1 -0
  214. package/ImageEditor/toolbar/crop.js +26 -22
  215. package/ImageEditor/toolbar/crop.js.map +1 -0
  216. package/ImageEditor/toolbar/filter.js +63 -59
  217. package/ImageEditor/toolbar/filter.js.map +1 -0
  218. package/ImageEditor/toolbar/flip.js +27 -25
  219. package/ImageEditor/toolbar/flip.js.map +1 -0
  220. package/ImageEditor/toolbar/icons/index.js +61 -8
  221. package/ImageEditor/toolbar/icons/index.js.map +1 -0
  222. package/ImageEditor/toolbar/index.js +34 -4
  223. package/ImageEditor/toolbar/index.js.map +1 -0
  224. package/ImageEditor/toolbar/rotate.js +55 -61
  225. package/ImageEditor/toolbar/rotate.js.map +1 -0
  226. package/ImageEditor/toolbar/types.d.ts +23 -12
  227. package/ImageEditor/toolbar/types.js +5 -1
  228. package/ImageEditor/toolbar/types.js.map +1 -0
  229. package/ImageUpload/Image.d.ts +6 -6
  230. package/ImageUpload/Image.js +52 -54
  231. package/ImageUpload/Image.js.map +1 -0
  232. package/ImageUpload/ImageEditorDialog.d.ts +11 -6
  233. package/ImageUpload/ImageEditorDialog.js +47 -46
  234. package/ImageUpload/ImageEditorDialog.js.map +1 -0
  235. package/ImageUpload/MultiImageUpload.d.ts +10 -31
  236. package/ImageUpload/MultiImageUpload.js +194 -222
  237. package/ImageUpload/MultiImageUpload.js.map +1 -0
  238. package/ImageUpload/MultiImageUpload.stories.js +18 -15
  239. package/ImageUpload/MultiImageUpload.stories.js.map +1 -0
  240. package/ImageUpload/SingleImageUpload.d.ts +16 -37
  241. package/ImageUpload/SingleImageUpload.js +96 -106
  242. package/ImageUpload/SingleImageUpload.js.map +1 -0
  243. package/ImageUpload/SingleImageUpload.stories.js +19 -16
  244. package/ImageUpload/SingleImageUpload.stories.js.map +1 -0
  245. package/ImageUpload/index.js +34 -4
  246. package/ImageUpload/index.js.map +1 -0
  247. package/ImageUpload/styled.d.ts +30 -14
  248. package/ImageUpload/styled.js +25 -16
  249. package/ImageUpload/styled.js.map +1 -0
  250. package/Input/Input.d.ts +6 -19
  251. package/Input/Input.js +102 -141
  252. package/Input/Input.js.map +1 -0
  253. package/Input/Input.stories.js +49 -46
  254. package/Input/Input.stories.js.map +1 -0
  255. package/Input/__tests__/Input.test.js +54 -63
  256. package/Input/__tests__/Input.test.js.map +1 -0
  257. package/Input/index.js +16 -1
  258. package/Input/index.js.map +1 -0
  259. package/Input/styled.d.ts +4 -0
  260. package/Input/styled.js +12 -0
  261. package/Input/styled.js.map +1 -0
  262. package/List/CollapsibleList/CollapsibleList.stories.js +19 -16
  263. package/List/CollapsibleList/CollapsibleList.stories.js.map +1 -0
  264. package/List/CollapsibleList/index.d.ts +2 -2
  265. package/List/CollapsibleList/index.js +15 -6
  266. package/List/CollapsibleList/index.js.map +1 -0
  267. package/List/DataList/DataList.d.ts +24 -43
  268. package/List/DataList/DataList.js +87 -122
  269. package/List/DataList/DataList.js.map +1 -0
  270. package/List/DataList/DataList.stories.js +30 -26
  271. package/List/DataList/DataList.stories.js.map +1 -0
  272. package/List/DataList/DataListModalOverlay/DataListModalOverlay.d.ts +14 -12
  273. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js +29 -20
  274. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -0
  275. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.d.ts +3 -3
  276. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js +20 -13
  277. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -0
  278. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.d.ts +9 -4
  279. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js +24 -12
  280. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -0
  281. package/List/DataList/DataListModalOverlay/index.js +32 -3
  282. package/List/DataList/DataListModalOverlay/index.js.map +1 -0
  283. package/List/DataList/DataListWithSections.d.ts +45 -0
  284. package/List/DataList/DataListWithSections.js +312 -0
  285. package/List/DataList/DataListWithSections.js.map +1 -0
  286. package/List/DataList/Loader.d.ts +2 -2
  287. package/List/DataList/Loader.js +48 -52
  288. package/List/DataList/Loader.js.map +1 -0
  289. package/List/DataList/NoData.d.ts +2 -2
  290. package/List/DataList/NoData.js +14 -8
  291. package/List/DataList/NoData.js.map +1 -0
  292. package/List/DataList/icons/index.d.ts +1 -1
  293. package/List/DataList/icons/index.js +54 -38
  294. package/List/DataList/icons/index.js.map +1 -0
  295. package/List/DataList/index.d.ts +1 -0
  296. package/List/DataList/index.js +58 -3
  297. package/List/DataList/index.js.map +1 -0
  298. package/List/DataList/types.d.ts +1 -1
  299. package/List/DataList/types.js +5 -1
  300. package/List/DataList/types.js.map +1 -0
  301. package/List/List.d.ts +3 -2
  302. package/List/List.js +66 -62
  303. package/List/List.js.map +1 -0
  304. package/List/List.stories.js +40 -37
  305. package/List/List.stories.js.map +1 -0
  306. package/List/icons/index.js +20 -3
  307. package/List/icons/index.js.map +1 -0
  308. package/List/index.d.ts +1 -1
  309. package/List/index.js +70 -3
  310. package/List/index.js.map +1 -0
  311. package/Menu/Menu.d.ts +14 -21
  312. package/Menu/Menu.js +49 -62
  313. package/Menu/Menu.js.map +1 -0
  314. package/Menu/Menu.stories.js +17 -14
  315. package/Menu/Menu.stories.js.map +1 -0
  316. package/Menu/index.js +16 -1
  317. package/Menu/index.js.map +1 -0
  318. package/Mosaic/Mosaic.d.ts +4 -14
  319. package/Mosaic/Mosaic.js +20 -7
  320. package/Mosaic/Mosaic.js.map +1 -0
  321. package/Mosaic/Mosaic.stories.js +31 -28
  322. package/Mosaic/Mosaic.stories.js.map +1 -0
  323. package/Mosaic/index.js +16 -1
  324. package/Mosaic/index.js.map +1 -0
  325. package/Progress/CircularProgress.d.ts +8 -16
  326. package/Progress/CircularProgress.js +32 -22
  327. package/Progress/CircularProgress.js.map +1 -0
  328. package/Progress/index.js +13 -1
  329. package/Progress/index.js.map +1 -0
  330. package/Radio/Radio.d.ts +2 -6
  331. package/Radio/Radio.js +36 -41
  332. package/Radio/Radio.js.map +1 -0
  333. package/Radio/Radio.styles.js +9 -4
  334. package/Radio/Radio.styles.js.map +1 -0
  335. package/Radio/RadioGroup.d.ts +1 -6
  336. package/Radio/RadioGroup.js +30 -34
  337. package/Radio/RadioGroup.js.map +1 -0
  338. package/Radio/RadioGroup.stories.js +23 -20
  339. package/Radio/RadioGroup.stories.js.map +1 -0
  340. package/Radio/index.js +20 -2
  341. package/Radio/index.js.map +1 -0
  342. package/RichTextEditor/RichTextEditor.d.ts +13 -9
  343. package/RichTextEditor/RichTextEditor.js +79 -78
  344. package/RichTextEditor/RichTextEditor.js.map +1 -0
  345. package/RichTextEditor/RichTextEditor.stories.js +15 -11
  346. package/RichTextEditor/RichTextEditor.stories.js.map +1 -0
  347. package/RichTextEditor/createPropsFromConfig.d.ts +11 -1
  348. package/RichTextEditor/createPropsFromConfig.js +16 -5
  349. package/RichTextEditor/createPropsFromConfig.js.map +1 -0
  350. package/RichTextEditor/index.d.ts +1 -0
  351. package/RichTextEditor/index.js +27 -2
  352. package/RichTextEditor/index.js.map +1 -0
  353. package/Ripple/Ripple.d.ts +4 -5
  354. package/Ripple/Ripple.js +11 -6
  355. package/Ripple/Ripple.js.map +1 -0
  356. package/Ripple/Ripple.stories.js +45 -42
  357. package/Ripple/Ripple.stories.js.map +1 -0
  358. package/Ripple/index.js +16 -1
  359. package/Ripple/index.js.map +1 -0
  360. package/Scrollbar/Scrollbar.d.ts +5 -5
  361. package/Scrollbar/Scrollbar.js +10 -5
  362. package/Scrollbar/Scrollbar.js.map +1 -0
  363. package/Scrollbar/Scrollbar.stories.js +12 -9
  364. package/Scrollbar/Scrollbar.stories.js.map +1 -0
  365. package/Scrollbar/index.js +16 -1
  366. package/Scrollbar/index.js.map +1 -0
  367. package/Section/Section.stories.js +15 -12
  368. package/Section/Section.stories.js.map +1 -0
  369. package/Section/index.d.ts +4 -5
  370. package/Section/index.js +23 -18
  371. package/Section/index.js.map +1 -0
  372. package/Select/Select.d.ts +8 -10
  373. package/Select/Select.js +79 -39
  374. package/Select/Select.js.map +1 -0
  375. package/Select/Select.stories.js +28 -25
  376. package/Select/Select.stories.js.map +1 -0
  377. package/Select/index.js +16 -1
  378. package/Select/index.js.map +1 -0
  379. package/Select/styled.d.ts +8 -0
  380. package/Select/styled.js +18 -0
  381. package/Select/styled.js.map +1 -0
  382. package/Skeleton/README.md +21 -0
  383. package/Skeleton/Skeleton.d.ts +8 -0
  384. package/Skeleton/Skeleton.js +22 -0
  385. package/Skeleton/Skeleton.js.map +1 -0
  386. package/Skeleton/Skeleton.stories.d.ts +1 -0
  387. package/Skeleton/Skeleton.stories.js +22 -0
  388. package/Skeleton/Skeleton.stories.js.map +1 -0
  389. package/Skeleton/index.d.ts +1 -0
  390. package/Skeleton/index.js +16 -0
  391. package/Skeleton/index.js.map +1 -0
  392. package/Slider/Slider.d.ts +1 -6
  393. package/Slider/Slider.js +39 -47
  394. package/Slider/Slider.js.map +1 -0
  395. package/Slider/Slider.stories.js +20 -17
  396. package/Slider/Slider.stories.js.map +1 -0
  397. package/Slider/index.js +13 -1
  398. package/Slider/index.js.map +1 -0
  399. package/Snackbar/Snackbar.d.ts +5 -7
  400. package/Snackbar/Snackbar.js +29 -33
  401. package/Snackbar/Snackbar.js.map +1 -0
  402. package/Snackbar/Snackbar.stories.js +29 -38
  403. package/Snackbar/Snackbar.stories.js.map +1 -0
  404. package/Snackbar/index.js +18 -1
  405. package/Snackbar/index.js.map +1 -0
  406. package/Switch/Switch.d.ts +3 -7
  407. package/Switch/Switch.js +35 -43
  408. package/Switch/Switch.js.map +1 -0
  409. package/Switch/Switch.stories.js +19 -16
  410. package/Switch/Switch.stories.js.map +1 -0
  411. package/Switch/index.js +16 -1
  412. package/Switch/index.js.map +1 -0
  413. package/Tabs/Tab.d.ts +7 -2
  414. package/Tabs/Tab.js +30 -9
  415. package/Tabs/Tab.js.map +1 -0
  416. package/Tabs/Tabs.d.ts +44 -21
  417. package/Tabs/Tabs.js +128 -129
  418. package/Tabs/Tabs.js.map +1 -0
  419. package/Tabs/Tabs.stories.js +25 -23
  420. package/Tabs/Tabs.stories.js.map +1 -0
  421. package/Tabs/index.js +27 -2
  422. package/Tabs/index.js.map +1 -0
  423. package/Tags/Tags.d.ts +9 -21
  424. package/Tags/Tags.js +95 -124
  425. package/Tags/Tags.js.map +1 -0
  426. package/Tags/Tags.stories.js +19 -16
  427. package/Tags/Tags.stories.js.map +1 -0
  428. package/Tags/index.js +16 -1
  429. package/Tags/index.js.map +1 -0
  430. package/Tooltip/Tooltip.d.ts +9 -8
  431. package/Tooltip/Tooltip.js +33 -33
  432. package/Tooltip/Tooltip.js.map +1 -0
  433. package/Tooltip/Tooltip.stories.js +14 -11
  434. package/Tooltip/Tooltip.stories.js.map +1 -0
  435. package/Tooltip/index.js +16 -1
  436. package/Tooltip/index.js.map +1 -0
  437. package/TopAppBar/TopAppBar.d.ts +1 -1
  438. package/TopAppBar/TopAppBar.js +13 -9
  439. package/TopAppBar/TopAppBar.js.map +1 -0
  440. package/TopAppBar/TopAppBar.stories.js +31 -30
  441. package/TopAppBar/TopAppBar.stories.js.map +1 -0
  442. package/TopAppBar/TopAppBarActionItem.d.ts +1 -1
  443. package/TopAppBar/TopAppBarActionItem.js +10 -5
  444. package/TopAppBar/TopAppBarActionItem.js.map +1 -0
  445. package/TopAppBar/TopAppBarNavigationIcon.d.ts +1 -1
  446. package/TopAppBar/TopAppBarNavigationIcon.js +10 -5
  447. package/TopAppBar/TopAppBarNavigationIcon.js.map +1 -0
  448. package/TopAppBar/TopAppBarPrimary.js +13 -9
  449. package/TopAppBar/TopAppBarPrimary.js.map +1 -0
  450. package/TopAppBar/TopAppBarSecondary.js +15 -11
  451. package/TopAppBar/TopAppBarSecondary.js.map +1 -0
  452. package/TopAppBar/TopAppBarSection.d.ts +1 -1
  453. package/TopAppBar/TopAppBarSection.js +13 -9
  454. package/TopAppBar/TopAppBarSection.js.map +1 -0
  455. package/TopAppBar/TopAppBarTitle.d.ts +1 -1
  456. package/TopAppBar/TopAppBarTitle.js +13 -9
  457. package/TopAppBar/TopAppBarTitle.js.map +1 -0
  458. package/TopAppBar/index.js +82 -7
  459. package/TopAppBar/index.js.map +1 -0
  460. package/TopProgressBar/TopProgressBar.d.ts +7 -7
  461. package/TopProgressBar/TopProgressBar.js +15 -7
  462. package/TopProgressBar/TopProgressBar.js.map +1 -0
  463. package/TopProgressBar/TopProgressBar.stories.js +16 -13
  464. package/TopProgressBar/TopProgressBar.stories.js.map +1 -0
  465. package/TopProgressBar/hoc/index.js +13 -1
  466. package/TopProgressBar/hoc/index.js.map +1 -0
  467. package/TopProgressBar/hoc/withTopProgressBar.d.ts +1 -1
  468. package/TopProgressBar/hoc/withTopProgressBar.js +14 -9
  469. package/TopProgressBar/hoc/withTopProgressBar.js.map +1 -0
  470. package/TopProgressBar/index.js +16 -1
  471. package/TopProgressBar/index.js.map +1 -0
  472. package/Typography/Typography.d.ts +5 -5
  473. package/Typography/Typography.js +10 -5
  474. package/Typography/Typography.js.map +1 -0
  475. package/Typography/Typography.stories.js +37 -34
  476. package/Typography/Typography.stories.js.map +1 -0
  477. package/Typography/index.js +16 -1
  478. package/Typography/index.js.map +1 -0
  479. package/package.json +76 -81
  480. package/styles.scss +3 -4
  481. package/types.d.ts +4 -4
  482. package/types.js +5 -1
  483. package/types.js.map +1 -0
  484. package/Chips/ChipIcon.d.ts +0 -4
  485. package/Chips/ChipIcon.js +0 -8
  486. package/rmwc/textfield/code/index.d.ts +0 -135
  487. package/rmwc/textfield/code/index.js +0 -571
  488. package/rmwc/textfield/next/index.d.ts +0 -135
  489. package/rmwc/textfield/next/index.js +0 -560
  490. package/rmwc/textfield/package.json +0 -45
@@ -1,71 +1,74 @@
1
- import * as React from "react";
2
- import { storiesOf } from "@storybook/react";
3
- import { Story, StoryReadme, StorySandboxCode, StorySandbox, StorySandboxExample } from "@webiny/storybook-utils/Story";
4
- import readme from "./../Ripple/README.md";
5
- import { Icon } from "./../Icon";
6
- import { withKnobs, boolean } from "@storybook/addon-knobs";
7
- import { ReactComponent as AutoRenewIcon } from "@svgr/webpack!./svg/baseline-autorenew-24px.svg";
8
- import { ReactComponent as CloudDoneIcon } from "@svgr/webpack!./svg/baseline-cloud_done-24px.svg";
9
- import { ReactComponent as BaselineDeleteIcon } from "@svgr/webpack!./svg/baseline-delete-24px.svg";
10
- import { ReactComponent as BaselineDoneIcon } from "@svgr/webpack!./svg/baseline-done-24px.svg";
11
- import { Ripple } from "./Ripple";
12
- var story = storiesOf("Components/Ripple", module);
13
- story.addDecorator(withKnobs);
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _react2 = require("@storybook/react");
6
+ var _Story = require("@webiny/storybook-utils/Story");
7
+ var _README = _interopRequireDefault(require("./../Ripple/README.md"));
8
+ var _Icon = require("../Icon");
9
+ var _addonKnobs = require("@storybook/addon-knobs");
10
+ var _baselineAutorenew24px = require("./svg/baseline-autorenew-24px.svg");
11
+ var _baselineCloud_done24px = require("./svg/baseline-cloud_done-24px.svg");
12
+ var _baselineDelete24px = require("./svg/baseline-delete-24px.svg");
13
+ var _baselineDone24px = require("./svg/baseline-done-24px.svg");
14
+ var _Ripple = require("./Ripple");
15
+ var story = (0, _react2.storiesOf)("Components/Ripple", module);
16
+ story.addDecorator(_addonKnobs.withKnobs);
14
17
  story.add("usage", function () {
15
- var disabled = boolean("Disabled", false);
18
+ var disabled = (0, _addonKnobs.boolean)("Disabled", false);
16
19
  var style = {
17
20
  padding: 20,
18
21
  width: 20,
19
22
  height: 20,
20
23
  display: "inline-block"
21
24
  };
22
- return /*#__PURE__*/React.createElement(Story, null, /*#__PURE__*/React.createElement(StoryReadme, null, readme), /*#__PURE__*/React.createElement(StorySandbox, {
25
+ return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, {
23
26
  title: "Icon with and without ripple"
24
- }, /*#__PURE__*/React.createElement(StorySandboxExample, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "No effect"), /*#__PURE__*/React.createElement("div", {
27
+ }, /*#__PURE__*/_react.default.createElement(_Story.StorySandboxExample, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, "No effect"), /*#__PURE__*/_react.default.createElement("div", {
25
28
  style: style
26
- }, /*#__PURE__*/React.createElement(Icon, {
27
- icon: /*#__PURE__*/React.createElement(AutoRenewIcon, null)
28
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("code", null, "unbounded")), /*#__PURE__*/React.createElement(Ripple, {
29
+ }, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
30
+ icon: /*#__PURE__*/_react.default.createElement(_baselineAutorenew24px.ReactComponent, null)
31
+ })), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("code", null, "unbounded")), /*#__PURE__*/_react.default.createElement(_Ripple.Ripple, {
29
32
  type: "unbounded",
30
33
  disabled: disabled
31
- }, /*#__PURE__*/React.createElement("div", {
34
+ }, /*#__PURE__*/_react.default.createElement("div", {
32
35
  style: style
33
- }, /*#__PURE__*/React.createElement(Icon, {
34
- icon: /*#__PURE__*/React.createElement(CloudDoneIcon, null)
35
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("code", null, "primary")), /*#__PURE__*/React.createElement(Ripple, {
36
+ }, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
37
+ icon: /*#__PURE__*/_react.default.createElement(_baselineCloud_done24px.ReactComponent, null)
38
+ }))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("code", null, "primary")), /*#__PURE__*/_react.default.createElement(_Ripple.Ripple, {
36
39
  type: "primary",
37
40
  disabled: disabled
38
- }, /*#__PURE__*/React.createElement("div", {
41
+ }, /*#__PURE__*/_react.default.createElement("div", {
39
42
  style: style
40
- }, /*#__PURE__*/React.createElement(Icon, {
41
- icon: /*#__PURE__*/React.createElement(BaselineDeleteIcon, null)
42
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("code", null, "accent")), /*#__PURE__*/React.createElement(Ripple, {
43
+ }, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
44
+ icon: /*#__PURE__*/_react.default.createElement(_baselineDelete24px.ReactComponent, null)
45
+ }))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("code", null, "accent")), /*#__PURE__*/_react.default.createElement(_Ripple.Ripple, {
43
46
  type: "accent",
44
47
  disabled: disabled
45
- }, /*#__PURE__*/React.createElement("div", {
48
+ }, /*#__PURE__*/_react.default.createElement("div", {
46
49
  style: style
47
- }, /*#__PURE__*/React.createElement(Icon, {
48
- icon: /*#__PURE__*/React.createElement(BaselineDoneIcon, null)
49
- }))))), /*#__PURE__*/React.createElement(StorySandboxCode, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
50
- icon: /*#__PURE__*/React.createElement(AutoRenewIcon, null)
51
- })), /*#__PURE__*/React.createElement(Ripple, {
50
+ }, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
51
+ icon: /*#__PURE__*/_react.default.createElement(_baselineDone24px.ReactComponent, null)
52
+ }))))), /*#__PURE__*/_react.default.createElement(_Story.StorySandboxCode, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
53
+ icon: /*#__PURE__*/_react.default.createElement(_baselineAutorenew24px.ReactComponent, null)
54
+ })), /*#__PURE__*/_react.default.createElement(_Ripple.Ripple, {
52
55
  type: "unbounded",
53
56
  disabled: disabled
54
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
55
- icon: /*#__PURE__*/React.createElement(CloudDoneIcon, null)
56
- }))), /*#__PURE__*/React.createElement(Ripple, {
57
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
58
+ icon: /*#__PURE__*/_react.default.createElement(_baselineCloud_done24px.ReactComponent, null)
59
+ }))), /*#__PURE__*/_react.default.createElement(_Ripple.Ripple, {
57
60
  type: "primary",
58
61
  disabled: disabled
59
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
60
- icon: /*#__PURE__*/React.createElement(BaselineDeleteIcon, null)
61
- }))), /*#__PURE__*/React.createElement(Ripple, {
62
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
63
+ icon: /*#__PURE__*/_react.default.createElement(_baselineDelete24px.ReactComponent, null)
64
+ }))), /*#__PURE__*/_react.default.createElement(_Ripple.Ripple, {
62
65
  type: "accent",
63
66
  disabled: disabled
64
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
65
- icon: /*#__PURE__*/React.createElement(BaselineDoneIcon, null)
67
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
68
+ icon: /*#__PURE__*/_react.default.createElement(_baselineDone24px.ReactComponent, null)
66
69
  })))))));
67
70
  }, {
68
71
  info: {
69
- propTables: [Ripple]
72
+ propTables: [_Ripple.Ripple]
70
73
  }
71
74
  });
@@ -0,0 +1 @@
1
+ {"version":3,"names":["story","storiesOf","module","addDecorator","withKnobs","add","disabled","boolean","style","padding","width","height","display","readme","info","propTables","Ripple"],"sources":["Ripple.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport {\n Story,\n StoryReadme,\n StorySandboxCode,\n StorySandbox,\n StorySandboxExample\n} from \"@webiny/storybook-utils/Story\";\nimport readme from \"./../Ripple/README.md\";\nimport { Icon } from \"~/Icon\";\nimport { withKnobs, boolean } from \"@storybook/addon-knobs\";\n\nimport { ReactComponent as AutoRenewIcon } from \"./svg/baseline-autorenew-24px.svg\";\nimport { ReactComponent as CloudDoneIcon } from \"./svg/baseline-cloud_done-24px.svg\";\nimport { ReactComponent as BaselineDeleteIcon } from \"./svg/baseline-delete-24px.svg\";\nimport { ReactComponent as BaselineDoneIcon } from \"./svg/baseline-done-24px.svg\";\n\nimport { Ripple } from \"./Ripple\";\n\nconst story = storiesOf(\"Components/Ripple\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const disabled = boolean(\"Disabled\", false);\n\n const style = { padding: 20, width: 20, height: 20, display: \"inline-block\" };\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"Icon with and without ripple\"}>\n <StorySandboxExample>\n <div>\n <div>No effect</div>\n <div style={style}>\n <Icon icon={<AutoRenewIcon />} />\n </div>\n\n <div>\n <code>unbounded</code>\n </div>\n <Ripple type=\"unbounded\" disabled={disabled}>\n <div style={style}>\n <Icon icon={<CloudDoneIcon />} />\n </div>\n </Ripple>\n\n <div>\n <code>primary</code>\n </div>\n <Ripple type=\"primary\" disabled={disabled}>\n <div style={style}>\n <Icon icon={<BaselineDeleteIcon />} />\n </div>\n </Ripple>\n\n <div>\n <code>accent</code>\n </div>\n <Ripple type=\"accent\" disabled={disabled}>\n <div style={style}>\n <Icon icon={<BaselineDoneIcon />} />\n </div>\n </Ripple>\n </div>\n </StorySandboxExample>\n <StorySandboxCode>\n <div>\n <div>\n <Icon icon={<AutoRenewIcon />} />\n </div>\n\n <Ripple type=\"unbounded\" disabled={disabled}>\n <div>\n <Icon icon={<CloudDoneIcon />} />\n </div>\n </Ripple>\n\n <Ripple type=\"primary\" disabled={disabled}>\n <div>\n <Icon icon={<BaselineDeleteIcon />} />\n </div>\n </Ripple>\n\n <Ripple type=\"accent\" disabled={disabled}>\n <div>\n <Icon icon={<BaselineDoneIcon />} />\n </div>\n </Ripple>\n </div>\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Ripple] } }\n);\n"],"mappings":";;;AAAA;AACA;AACA;AAOA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA,IAAMA,KAAK,GAAG,IAAAC,iBAAS,EAAC,mBAAmB,EAAEC,MAAM,CAAC;AACpDF,KAAK,CAACG,YAAY,CAACC,qBAAS,CAAC;AAE7BJ,KAAK,CAACK,GAAG,CACL,OAAO,EACP,YAAM;EACF,IAAMC,QAAQ,GAAG,IAAAC,mBAAO,EAAC,UAAU,EAAE,KAAK,CAAC;EAE3C,IAAMC,KAAK,GAAG;IAAEC,OAAO,EAAE,EAAE;IAAEC,KAAK,EAAE,EAAE;IAAEC,MAAM,EAAE,EAAE;IAAEC,OAAO,EAAE;EAAe,CAAC;EAE7E,oBACI,6BAAC,YAAK,qBACF,6BAAC,kBAAW,QAAEC,eAAM,CAAe,eACnC,6BAAC,mBAAY;IAAC,KAAK,EAAE;EAA+B,gBAChD,6BAAC,0BAAmB,qBAChB,uDACI,0CAAK,WAAS,CAAM,eACpB;IAAK,KAAK,EAAEL;EAAM,gBACd,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,qCAAa;EAAI,EAAG,CAC/B,eAEN,uDACI,2CAAM,WAAS,CAAO,CACpB,eACN,6BAAC,cAAM;IAAC,IAAI,EAAC,WAAW;IAAC,QAAQ,EAAEF;EAAS,gBACxC;IAAK,KAAK,EAAEE;EAAM,gBACd,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,sCAAa;EAAI,EAAG,CAC/B,CACD,eAET,uDACI,2CAAM,SAAO,CAAO,CAClB,eACN,6BAAC,cAAM;IAAC,IAAI,EAAC,SAAS;IAAC,QAAQ,EAAEF;EAAS,gBACtC;IAAK,KAAK,EAAEE;EAAM,gBACd,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,kCAAkB;EAAI,EAAG,CACpC,CACD,eAET,uDACI,2CAAM,QAAM,CAAO,CACjB,eACN,6BAAC,cAAM;IAAC,IAAI,EAAC,QAAQ;IAAC,QAAQ,EAAEF;EAAS,gBACrC;IAAK,KAAK,EAAEE;EAAM,gBACd,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,gCAAgB;EAAI,EAAG,CAClC,CACD,CACP,CACY,eACtB,6BAAC,uBAAgB,qBACb,uDACI,uDACI,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,qCAAa;EAAI,EAAG,CAC/B,eAEN,6BAAC,cAAM;IAAC,IAAI,EAAC,WAAW;IAAC,QAAQ,EAAEF;EAAS,gBACxC,uDACI,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,sCAAa;EAAI,EAAG,CAC/B,CACD,eAET,6BAAC,cAAM;IAAC,IAAI,EAAC,SAAS;IAAC,QAAQ,EAAEA;EAAS,gBACtC,uDACI,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,kCAAkB;EAAI,EAAG,CACpC,CACD,eAET,6BAAC,cAAM;IAAC,IAAI,EAAC,QAAQ;IAAC,QAAQ,EAAEA;EAAS,gBACrC,uDACI,6BAAC,UAAI;IAAC,IAAI,eAAE,6BAAC,gCAAgB;EAAI,EAAG,CAClC,CACD,CACP,CACS,CACR,CACX;AAEhB,CAAC,EACD;EAAEQ,IAAI,EAAE;IAAEC,UAAU,EAAE,CAACC,cAAM;EAAE;AAAE,CAAC,CACrC"}
package/Ripple/index.js CHANGED
@@ -1 +1,16 @@
1
- export * from "./Ripple";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Ripple = require("./Ripple");
7
+ Object.keys(_Ripple).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Ripple[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _Ripple[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Ripple\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1,11 +1,11 @@
1
- import * as React from "react";
2
- declare type Props = {
3
- children?: React.ReactNode;
1
+ import React from "react";
2
+ import { ScrollbarProps } from "react-custom-scrollbars";
3
+ interface Props extends ScrollbarProps {
4
4
  style?: React.CSSProperties;
5
5
  [key: string]: any;
6
- };
6
+ }
7
7
  /**
8
8
  * Use Scrollbar component to show vertical or horizontal scrollbars.
9
9
  */
10
- declare const Scrollbar: (props: Props) => JSX.Element;
10
+ declare const Scrollbar: React.FC<Props>;
11
11
  export { Scrollbar };
@@ -1,11 +1,16 @@
1
- import * as React from "react";
2
- import { Scrollbars } from "react-custom-scrollbars";
1
+ "use strict";
3
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Scrollbar = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactCustomScrollbars = require("react-custom-scrollbars");
4
10
  /**
5
11
  * Use Scrollbar component to show vertical or horizontal scrollbars.
6
12
  */
7
13
  var Scrollbar = function Scrollbar(props) {
8
- return /*#__PURE__*/React.createElement(Scrollbars, props);
14
+ return /*#__PURE__*/_react.default.createElement(_reactCustomScrollbars.Scrollbars, props);
9
15
  };
10
-
11
- export { Scrollbar };
16
+ exports.Scrollbar = Scrollbar;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Scrollbar","props"],"sources":["Scrollbar.tsx"],"sourcesContent":["import React from \"react\";\nimport { ScrollbarProps, Scrollbars } from \"react-custom-scrollbars\";\n\ninterface Props extends ScrollbarProps {\n style?: React.CSSProperties;\n [key: string]: any;\n}\n\n/**\n * Use Scrollbar component to show vertical or horizontal scrollbars.\n */\nconst Scrollbar: React.FC<Props> = props => {\n return <Scrollbars {...props} />;\n};\n\nexport { Scrollbar };\n"],"mappings":";;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACA,IAAMA,SAA0B,GAAG,SAA7BA,SAA0B,CAAGC,KAAK,EAAI;EACxC,oBAAO,6BAAC,iCAAU,EAAKA,KAAK,CAAI;AACpC,CAAC;AAAC"}
@@ -1,13 +1,16 @@
1
- import * as React from "react";
2
- import { storiesOf } from "@storybook/react";
3
- import { Story, StoryReadme, StorySandbox } from "@webiny/storybook-utils/Story";
4
- import readme from "./../Scrollbar/README.md";
5
- import { Scrollbar } from "./Scrollbar";
6
- var story = storiesOf("Components/Scrollbar", module);
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _react2 = require("@storybook/react");
6
+ var _Story = require("@webiny/storybook-utils/Story");
7
+ var _README = _interopRequireDefault(require("./../Scrollbar/README.md"));
8
+ var _Scrollbar = require("./Scrollbar");
9
+ var story = (0, _react2.storiesOf)("Components/Scrollbar", module);
7
10
  story.add("usage", function () {
8
- return /*#__PURE__*/React.createElement(Story, null, /*#__PURE__*/React.createElement(StoryReadme, null, readme), /*#__PURE__*/React.createElement(StorySandbox, {
11
+ return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, {
9
12
  title: "Scrollbar demo"
10
- }, /*#__PURE__*/React.createElement(Scrollbar, {
13
+ }, /*#__PURE__*/_react.default.createElement(_Scrollbar.Scrollbar, {
11
14
  style: {
12
15
  width: 300,
13
16
  height: 200
@@ -15,6 +18,6 @@ story.add("usage", function () {
15
18
  }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lorem leo, aliquam aliquet arcu vel, faucibus feugiat est. Nulla facilisi. Donec lobortis metus dictum sem egestas, non lobortis erat suscipit. Nunc fermentum tempor nisi, nec venenatis odio egestas at. Nulla facilisi. Fusce sed venenatis velit, ac rhoncus ligula. Integer hendrerit egestas ante, tristique posuere augue auctor non. Curabitur accumsan, ipsum cursus euismod volutpat, enim ligula interdum diam, id suscipit ipsum lectus id ligula. Ut nec odio vel lacus volutpat commodo. In hac habitasse platea dictumst. Donec nunc lacus, venenatis non tellus vel, semper porta quam. Ut fermentum mattis urna non imperdiet. Fusce tincidunt enim nec tincidunt dapibus. Aliquam eu ligula quis ligula pretium tincidunt non sit amet velit. Curabitur vel interdum enim, ut molestie ligula.")));
16
19
  }, {
17
20
  info: {
18
- propTables: [Scrollbar]
21
+ propTables: [_Scrollbar.Scrollbar]
19
22
  }
20
23
  });
@@ -0,0 +1 @@
1
+ {"version":3,"names":["story","storiesOf","module","add","readme","width","height","info","propTables","Scrollbar"],"sources":["Scrollbar.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport { Story, StoryReadme, StorySandbox } from \"@webiny/storybook-utils/Story\";\nimport readme from \"./../Scrollbar/README.md\";\nimport { Scrollbar } from \"./Scrollbar\";\n\nconst story = storiesOf(\"Components/Scrollbar\", module);\n\nstory.add(\n \"usage\",\n () => {\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"Scrollbar demo\"}>\n <Scrollbar style={{ width: 300, height: 200 }}>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lorem leo,\n aliquam aliquet arcu vel, faucibus feugiat est. Nulla facilisi. Donec\n lobortis metus dictum sem egestas, non lobortis erat suscipit. Nunc\n fermentum tempor nisi, nec venenatis odio egestas at. Nulla facilisi. Fusce\n sed venenatis velit, ac rhoncus ligula. Integer hendrerit egestas ante,\n tristique posuere augue auctor non. Curabitur accumsan, ipsum cursus euismod\n volutpat, enim ligula interdum diam, id suscipit ipsum lectus id ligula. Ut\n nec odio vel lacus volutpat commodo. In hac habitasse platea dictumst. Donec\n nunc lacus, venenatis non tellus vel, semper porta quam. Ut fermentum mattis\n urna non imperdiet. Fusce tincidunt enim nec tincidunt dapibus. Aliquam eu\n ligula quis ligula pretium tincidunt non sit amet velit. Curabitur vel\n interdum enim, ut molestie ligula.\n </Scrollbar>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Scrollbar] } }\n);\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AAEA,IAAMA,KAAK,GAAG,IAAAC,iBAAS,EAAC,sBAAsB,EAAEC,MAAM,CAAC;AAEvDF,KAAK,CAACG,GAAG,CACL,OAAO,EACP,YAAM;EACF,oBACI,6BAAC,YAAK,qBACF,6BAAC,kBAAW,QAAEC,eAAM,CAAe,eACnC,6BAAC,mBAAY;IAAC,KAAK,EAAE;EAAiB,gBAClC,6BAAC,oBAAS;IAAC,KAAK,EAAE;MAAEC,KAAK,EAAE,GAAG;MAAEC,MAAM,EAAE;IAAI;EAAE,GAAC,i1BAa/C,CAAY,CACD,CACX;AAEhB,CAAC,EACD;EAAEC,IAAI,EAAE;IAAEC,UAAU,EAAE,CAACC,oBAAS;EAAE;AAAE,CAAC,CACxC"}
@@ -1 +1,16 @@
1
- export * from "./Scrollbar";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Scrollbar = require("./Scrollbar");
7
+ Object.keys(_Scrollbar).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Scrollbar[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _Scrollbar[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Scrollbar\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1,11 +1,14 @@
1
- import React from "react";
2
- import { storiesOf } from "@storybook/react";
3
- import { Story, StoryReadme, StorySandboxCode, StorySandbox, StorySandboxExample } from "@webiny/storybook-utils/Story";
4
- import readme from "./README.md";
5
- import Section from "./index";
6
- import styled from "@emotion/styled";
7
- var story = storiesOf("Components/Section", module);
8
- var RenderSection = /*#__PURE__*/styled("div", {
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _react2 = require("@storybook/react");
6
+ var _Story = require("@webiny/storybook-utils/Story");
7
+ var _README = _interopRequireDefault(require("./README.md"));
8
+ var _index = _interopRequireDefault(require("./index"));
9
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
10
+ var story = (0, _react2.storiesOf)("Components/Section", module);
11
+ var RenderSection = /*#__PURE__*/(0, _styled.default)("div", {
9
12
  target: "e1mp9e2d0",
10
13
  label: "RenderSection"
11
14
  })({
@@ -13,13 +16,13 @@ var RenderSection = /*#__PURE__*/styled("div", {
13
16
  padding: "1px 25px 0 25px"
14
17
  });
15
18
  story.add("usage", function () {
16
- return /*#__PURE__*/React.createElement(Story, null, /*#__PURE__*/React.createElement(StoryReadme, null, readme), /*#__PURE__*/React.createElement(StorySandbox, null, /*#__PURE__*/React.createElement(StorySandboxExample, null, /*#__PURE__*/React.createElement(RenderSection, null, /*#__PURE__*/React.createElement(Section, {
19
+ return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, null, /*#__PURE__*/_react.default.createElement(_Story.StorySandboxExample, null, /*#__PURE__*/_react.default.createElement(RenderSection, null, /*#__PURE__*/_react.default.createElement(_index.default, {
17
20
  title: "Section 1"
18
- }, "Here goes the first section"), /*#__PURE__*/React.createElement(Section, {
21
+ }, "Here goes the first section"), /*#__PURE__*/_react.default.createElement(_index.default, {
19
22
  title: "Section 2"
20
- }, "And this is the second section \uD83E\uDD84"))), /*#__PURE__*/React.createElement(StorySandboxCode, null, "\n import styled from \"@emotion/styled\";\n \n const RenderSection = styled(\"div\")({\n backgroundColor: \"var(--mdc-theme-background)\",\n padding: \"1px 25px 0 25px\"\n });\n\n <RenderSection>\n <Section title=\"Section 1\">Here goes the first section</Section>\n <Section title=\"Section 2\">And this is the second section \uD83E\uDD84</Section>\n </RenderSection>\n ")));
23
+ }, "And this is the second section \uD83E\uDD84"))), /*#__PURE__*/_react.default.createElement(_Story.StorySandboxCode, null, "\n import styled from \"@emotion/styled\";\n \n const RenderSection = styled(\"div\")({\n backgroundColor: \"var(--mdc-theme-background)\",\n padding: \"1px 25px 0 25px\"\n });\n\n <RenderSection>\n <Section title=\"Section 1\">Here goes the first section</Section>\n <Section title=\"Section 2\">And this is the second section \uD83E\uDD84</Section>\n </RenderSection>\n ")));
21
24
  }, {
22
25
  info: {
23
- propTables: [Section]
26
+ propTables: [_index.default]
24
27
  }
25
28
  });
@@ -0,0 +1 @@
1
+ {"version":3,"names":["story","storiesOf","module","RenderSection","styled","backgroundColor","padding","add","readme","info","propTables","Section"],"sources":["Section.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport {\n Story,\n StoryReadme,\n StorySandboxCode,\n StorySandbox,\n StorySandboxExample\n} from \"@webiny/storybook-utils/Story\";\nimport readme from \"./README.md\";\n\nimport Section from \"./index\";\nimport styled from \"@emotion/styled\";\n\nconst story = storiesOf(\"Components/Section\", module);\n\nconst RenderSection = styled(\"div\")({\n backgroundColor: \"var(--mdc-theme-background)\",\n padding: \"1px 25px 0 25px\"\n});\n\nstory.add(\n \"usage\",\n () => {\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox>\n <StorySandboxExample>\n <RenderSection>\n <Section title=\"Section 1\">Here goes the first section</Section>\n <Section title=\"Section 2\">And this is the second section 🦄</Section>\n </RenderSection>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n import styled from \"@emotion/styled\";\n \n const RenderSection = styled(\"div\")({\n backgroundColor: \"var(--mdc-theme-background)\",\n padding: \"1px 25px 0 25px\"\n });\n\n <RenderSection>\n <Section title=\"Section 1\">Here goes the first section</Section>\n <Section title=\"Section 2\">And this is the second section 🦄</Section>\n </RenderSection>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Section] } }\n);\n"],"mappings":";;;AAAA;AACA;AACA;AAOA;AAEA;AACA;AAEA,IAAMA,KAAK,GAAG,IAAAC,iBAAS,EAAC,oBAAoB,EAAEC,MAAM,CAAC;AAErD,IAAMC,aAAa,oBAAGC,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,GAAE;EAChCC,eAAe,EAAE,6BAA6B;EAC9CC,OAAO,EAAE;AACb,CAAC,CAAC;AAEFN,KAAK,CAACO,GAAG,CACL,OAAO,EACP,YAAM;EACF,oBACI,6BAAC,YAAK,qBACF,6BAAC,kBAAW,QAAEC,eAAM,CAAe,eACnC,6BAAC,mBAAY,qBACT,6BAAC,0BAAmB,qBAChB,6BAAC,aAAa,qBACV,6BAAC,cAAO;IAAC,KAAK,EAAC;EAAW,GAAC,6BAA2B,CAAU,eAChE,6BAAC,cAAO;IAAC,KAAK,EAAC;EAAW,GAAC,6CAAiC,CAAU,CAC1D,CACE,eACtB,6BAAC,uBAAgB,yoBAcE,CACR,CACX;AAEhB,CAAC,EACD;EAAEC,IAAI,EAAE;IAAEC,UAAU,EAAE,CAACC,cAAO;EAAE;AAAE,CAAC,CACtC"}
@@ -1,7 +1,6 @@
1
- import * as React from "react";
2
- declare type SectionProps = {
3
- children?: React.ReactNode;
1
+ import React from "react";
2
+ interface SectionProps {
4
3
  title?: String;
5
- };
6
- declare const Section: ({ children, title, ...props }: SectionProps) => JSX.Element;
4
+ }
5
+ declare const Section: React.FC<SectionProps>;
7
6
  export default Section;
package/Section/index.js CHANGED
@@ -1,18 +1,25 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
11
+ var _emotion = require("emotion");
12
+ var _Typography = require("../Typography");
13
+ var _Elevation = require("../Elevation");
2
14
  var _excluded = ["children", "title"];
3
- import * as React from "react";
4
- import styled from "@emotion/styled";
5
- import { css } from "emotion";
6
- import { Typography } from "../Typography";
7
- import { Elevation } from "../Elevation";
8
- var SectionWrapper = /*#__PURE__*/styled("div", {
15
+ var SectionWrapper = /*#__PURE__*/(0, _styled.default)("div", {
9
16
  target: "e12inb750",
10
17
  label: "SectionWrapper"
11
18
  })({
12
19
  backgroundColor: "var(--mdc-theme-background)",
13
20
  padding: "0 0 25px 0"
14
21
  });
15
- var titleStyle = /*#__PURE__*/css({
22
+ var titleStyle = /*#__PURE__*/(0, _emotion.css)({
16
23
  display: "flex",
17
24
  alignItems: "center",
18
25
  color: "var(--mdc-theme-on-surface)",
@@ -24,25 +31,23 @@ var titleStyle = /*#__PURE__*/css({
24
31
  }
25
32
  }
26
33
  }, "label:titleStyle;");
27
- var ElevationContent = /*#__PURE__*/styled("div", {
34
+ var ElevationContent = /*#__PURE__*/(0, _styled.default)("div", {
28
35
  target: "e12inb751",
29
36
  label: "ElevationContent"
30
37
  })({
31
38
  padding: 20,
32
39
  backgroundColor: "#fff"
33
40
  });
34
-
35
41
  var Section = function Section(_ref) {
36
42
  var children = _ref.children,
37
- title = _ref.title,
38
- props = _objectWithoutProperties(_ref, _excluded);
39
-
40
- return /*#__PURE__*/React.createElement(SectionWrapper, props, /*#__PURE__*/React.createElement("h4", null, /*#__PURE__*/React.createElement(Typography, {
43
+ title = _ref.title,
44
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
45
+ return /*#__PURE__*/_react.default.createElement(SectionWrapper, props, /*#__PURE__*/_react.default.createElement("h4", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
41
46
  className: titleStyle,
42
47
  use: "overline"
43
- }, title)), /*#__PURE__*/React.createElement(Elevation, {
48
+ }, title)), /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
44
49
  z: 2
45
- }, /*#__PURE__*/React.createElement(ElevationContent, null, children)));
50
+ }, /*#__PURE__*/_react.default.createElement(ElevationContent, null, children)));
46
51
  };
47
-
48
- export default Section;
52
+ var _default = Section;
53
+ exports.default = _default;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SectionWrapper","styled","backgroundColor","padding","titleStyle","css","display","alignItems","color","lineHeight","svg","height","ElevationContent","Section","children","title","props"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\nimport { Typography } from \"~/Typography\";\nimport { Elevation } from \"~/Elevation\";\n\nconst SectionWrapper = styled(\"div\")({\n backgroundColor: \"var(--mdc-theme-background)\",\n padding: \"0 0 25px 0\"\n});\n\nconst titleStyle = css({\n display: \"flex\",\n alignItems: \"center\",\n color: \"var(--mdc-theme-on-surface)\",\n \".tooltip-content-wrapper\": {\n lineHeight: \"100%\",\n svg: {\n height: 13,\n color: \"var(--mdc-theme-on-surface)\"\n }\n }\n});\n\nconst ElevationContent = styled(\"div\")({\n padding: 20,\n backgroundColor: \"#fff\"\n});\n\ninterface SectionProps {\n title?: String;\n}\n\nconst Section: React.FC<SectionProps> = ({ children, title, ...props }) => {\n return (\n <SectionWrapper {...props}>\n <h4>\n <Typography className={titleStyle} use={\"overline\"}>\n {title}\n </Typography>\n </h4>\n\n <Elevation z={2}>\n <ElevationContent>{children}</ElevationContent>\n </Elevation>\n </SectionWrapper>\n );\n};\n\nexport default Section;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAAwC;AAExC,IAAMA,cAAc,oBAAGC,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,GAAE;EACjCC,eAAe,EAAE,6BAA6B;EAC9CC,OAAO,EAAE;AACb,CAAC,CAAC;AAEF,IAAMC,UAAU,gBAAG,IAAAC,YAAG,EAAC;EACnBC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,KAAK,EAAE,6BAA6B;EACpC,0BAA0B,EAAE;IACxBC,UAAU,EAAE,MAAM;IAClBC,GAAG,EAAE;MACDC,MAAM,EAAE,EAAE;MACVH,KAAK,EAAE;IACX;EACJ;AACJ,CAAC,sBAAC;AAEF,IAAMI,gBAAgB,oBAAGX,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,GAAE;EACnCE,OAAO,EAAE,EAAE;EACXD,eAAe,EAAE;AACrB,CAAC,CAAC;AAMF,IAAMW,OAA+B,GAAG,SAAlCA,OAA+B,OAAsC;EAAA,IAAhCC,QAAQ,QAARA,QAAQ;IAAEC,KAAK,QAALA,KAAK;IAAKC,KAAK;EAChE,oBACI,6BAAC,cAAc,EAAKA,KAAK,eACrB,sDACI,6BAAC,sBAAU;IAAC,SAAS,EAAEZ,UAAW;IAAC,GAAG,EAAE;EAAW,GAC9CW,KAAK,CACG,CACZ,eAEL,6BAAC,oBAAS;IAAC,CAAC,EAAE;EAAE,gBACZ,6BAAC,gBAAgB,QAAED,QAAQ,CAAoB,CACvC,CACC;AAEzB,CAAC;AAAC,eAEaD,OAAO;AAAA"}
@@ -1,7 +1,7 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  import { SelectProps as RmwcSelectProps } from "@rmwc/select";
3
3
  import { FormComponentProps } from "../types";
4
- declare type SelectProps = FormComponentProps & RmwcSelectProps & {
4
+ export declare type SelectProps = FormComponentProps & RmwcSelectProps & {
5
5
  label?: string;
6
6
  disabled?: boolean;
7
7
  description?: string;
@@ -10,13 +10,11 @@ declare type SelectProps = FormComponentProps & RmwcSelectProps & {
10
10
  children?: Array<React.ReactElement<"option"> | React.ReactElement<"optgroup">>;
11
11
  rootProps?: Object;
12
12
  className?: string;
13
+ size?: "small" | "medium" | "large";
13
14
  };
14
- export declare const Select: {
15
- (props: SelectProps): JSX.Element;
16
- defaultProps: {
17
- validation: {
18
- isValid: any;
19
- };
20
- };
21
- };
15
+ /**
16
+ * We check for null and undefined in the value because React is complaining about those values.
17
+ * Error says to use the empty string in null/undefined case.
18
+ */
19
+ export declare const Select: React.FC<SelectProps>;
22
20
  export default Select;
package/Select/Select.js CHANGED
@@ -1,60 +1,100 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.Select = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _select = require("@rmwc/select");
13
+ var _FormElementMessage = require("../FormElementMessage");
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+ var _styled = require("./styled");
3
16
  var _excluded = ["value", "description", "validation"];
4
- import * as React from "react";
5
- import { Select as RmwcSelect } from "@rmwc/select";
6
- import { FormElementMessage } from "../FormElementMessage";
7
- import { css } from "emotion";
8
- import classNames from "classnames";
9
- var noLabel = /*#__PURE__*/css({
10
- "&.mdc-select": {
11
- height: 35,
12
- ".mdc-select__native-control": {
13
- paddingTop: 0
14
- },
15
- "&.mdc-select--box": {
16
- ".mdc-select__native-control": {
17
- height: 35,
18
- paddingTop: 5
17
+ /**
18
+ * TODO verify that this is correct method get all options.
19
+ */
20
+ var getOptions = function getOptions(initialOptions) {
21
+ if (!initialOptions) {
22
+ return [];
23
+ } else if (Array.isArray(initialOptions)) {
24
+ var options = [];
25
+ var _iterator = (0, _createForOfIteratorHelper2.default)(initialOptions),
26
+ _step;
27
+ try {
28
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
29
+ var option = _step.value;
30
+ if (typeof option === "string") {
31
+ options.push({
32
+ label: option,
33
+ value: option
34
+ });
35
+ continue;
36
+ }
37
+ options.push({
38
+ label: option.label,
39
+ value: option.value,
40
+ options: option.options
41
+ });
19
42
  }
43
+ } catch (err) {
44
+ _iterator.e(err);
45
+ } finally {
46
+ _iterator.f();
20
47
  }
48
+ return options;
21
49
  }
22
- }, "label:noLabel;");
50
+ return Object.keys(initialOptions).map(function (key) {
51
+ return {
52
+ label: initialOptions[key],
53
+ value: key
54
+ };
55
+ });
56
+ };
57
+
23
58
  /**
24
59
  * Select component lets users choose a value from given set of options.
25
60
  */
26
-
27
- var skipProps = ["validate"];
28
-
61
+ var skipProps = ["validate", "form"];
29
62
  var getRmwcProps = function getRmwcProps(props) {
30
63
  var newProps = {};
31
64
  Object.keys(props).filter(function (name) {
32
65
  return !skipProps.includes(name);
33
- }).forEach(function (name) {
66
+ })
67
+ // @ts-ignore
68
+ .forEach(function (name) {
34
69
  return newProps[name] = props[name];
35
70
  });
36
71
  return newProps;
37
72
  };
38
-
39
- export var Select = function Select(props) {
40
- var value = props.value,
41
- description = props.description,
42
- validation = props.validation,
43
- other = _objectWithoutProperties(props, _excluded);
44
-
45
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(RmwcSelect, Object.assign({}, getRmwcProps(other), {
73
+ /**
74
+ * We check for null and undefined in the value because React is complaining about those values.
75
+ * Error says to use the empty string in null/undefined case.
76
+ */
77
+ var Select = function Select(props) {
78
+ var initialValue = props.value,
79
+ description = props.description,
80
+ validation = props.validation,
81
+ other = (0, _objectWithoutProperties2.default)(props, _excluded);
82
+ var value = initialValue === null || initialValue === undefined ? "" : initialValue;
83
+ var _ref = validation || {},
84
+ validationIsValid = _ref.isValid,
85
+ validationMessage = _ref.message;
86
+ var options = getOptions(other.options);
87
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_select.Select, Object.assign({}, getRmwcProps(other), {
88
+ options: options,
46
89
  value: value,
47
- className: classNames("webiny-ui-select", props.className, _defineProperty({}, noLabel, !props.label)),
90
+ className: (0, _classnames.default)("webiny-ui-select mdc-ripple-surface mdc-ripple-upgraded", _styled.webinySelect, props.size ? "webiny-ui-select--size-".concat(props.size) : null, props.className, (0, _defineProperty2.default)({}, _styled.noLabel, !props.label)),
48
91
  onChange: function onChange(e) {
49
92
  props.onChange && props.onChange(e.target.value);
50
93
  }
51
- })), validation.isValid === false && /*#__PURE__*/React.createElement(FormElementMessage, {
94
+ })), validationIsValid === false && /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, {
52
95
  error: true
53
- }, validation.message), validation.isValid !== false && description && /*#__PURE__*/React.createElement(FormElementMessage, null, description));
54
- };
55
- Select.defaultProps = {
56
- validation: {
57
- isValid: null
58
- }
96
+ }, validationMessage), validationIsValid !== false && description && /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, null, description));
59
97
  };
60
- export default Select;
98
+ exports.Select = Select;
99
+ var _default = Select;
100
+ exports.default = _default;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getOptions","initialOptions","Array","isArray","options","option","push","label","value","Object","keys","map","key","skipProps","getRmwcProps","props","newProps","filter","name","includes","forEach","Select","initialValue","description","validation","other","undefined","validationIsValid","isValid","validationMessage","message","classNames","webinySelect","size","className","noLabel","e","onChange","target"],"sources":["Select.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n FormattedOption,\n Select as RmwcSelect,\n SelectProps as RmwcSelectProps\n} from \"@rmwc/select\";\nimport { FormElementMessage } from \"~/FormElementMessage\";\nimport { FormComponentProps } from \"~/types\";\nimport classNames from \"classnames\";\nimport { webinySelect, noLabel } from \"./styled\";\n\nexport type SelectProps = FormComponentProps &\n RmwcSelectProps & {\n // Component label.\n label?: string;\n\n // Is checkbox disabled?\n disabled?: boolean;\n\n // Description beneath the select.\n description?: string;\n\n // Placeholder text for the form control. Set to a blank string to create a non-floating placeholder label.\n placeholder?: string;\n\n // Makes the Select have a visual box.\n box?: string;\n\n // One or more <option> or <optgroup> elements.\n children?: Array<React.ReactElement<\"option\"> | React.ReactElement<\"optgroup\">>;\n\n // IconProps for the root element. By default, additional props spread to the native select element.\n rootProps?: Object;\n\n // A className for the root element.\n className?: string;\n\n // Size - small, medium or large\n size?: \"small\" | \"medium\" | \"large\";\n };\n\n/**\n * TODO verify that this is correct method get all options.\n */\nconst getOptions = (initialOptions: SelectProps[\"options\"]): FormattedOption[] => {\n if (!initialOptions) {\n return [];\n } else if (Array.isArray(initialOptions)) {\n const options: FormattedOption[] = [];\n for (const option of initialOptions) {\n if (typeof option === \"string\") {\n options.push({\n label: option,\n value: option\n });\n continue;\n }\n options.push({\n label: option.label,\n value: option.value,\n options: option.options\n });\n }\n return options;\n }\n return Object.keys(initialOptions).map(key => {\n return {\n label: initialOptions[key],\n value: key\n };\n });\n};\n\n/**\n * Select component lets users choose a value from given set of options.\n */\nconst skipProps = [\"validate\", \"form\"];\n\nconst getRmwcProps = (props: SelectProps): FormComponentProps & RmwcSelectProps => {\n const newProps: FormComponentProps & RmwcSelectProps = {};\n Object.keys(props)\n .filter(name => !skipProps.includes(name))\n // @ts-ignore\n .forEach((name: any) => (newProps[name] = props[name]));\n\n return newProps;\n};\n/**\n * We check for null and undefined in the value because React is complaining about those values.\n * Error says to use the empty string in null/undefined case.\n */\nexport const Select: React.FC<SelectProps> = props => {\n const { value: initialValue, description, validation, ...other } = props;\n\n const value = initialValue === null || initialValue === undefined ? \"\" : initialValue;\n\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n\n const options = getOptions(other.options);\n\n return (\n <React.Fragment>\n <RmwcSelect\n {...getRmwcProps(other)}\n options={options}\n value={value}\n className={classNames(\n \"webiny-ui-select mdc-ripple-surface mdc-ripple-upgraded\",\n webinySelect,\n props.size ? `webiny-ui-select--size-${props.size}` : null,\n props.className,\n {\n [noLabel]: !props.label\n }\n )}\n onChange={e => {\n props.onChange && props.onChange((e.target as any).value);\n }}\n />\n\n {validationIsValid === false && (\n <FormElementMessage error>{validationMessage}</FormElementMessage>\n )}\n\n {validationIsValid !== false && description && (\n <FormElementMessage>{description}</FormElementMessage>\n )}\n </React.Fragment>\n );\n};\n\nexport default Select;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AAKA;AAEA;AACA;AAAiD;AAgCjD;AACA;AACA;AACA,IAAMA,UAAU,GAAG,SAAbA,UAAU,CAAIC,cAAsC,EAAwB;EAC9E,IAAI,CAACA,cAAc,EAAE;IACjB,OAAO,EAAE;EACb,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACF,cAAc,CAAC,EAAE;IACtC,IAAMG,OAA0B,GAAG,EAAE;IAAC,yDACjBH,cAAc;MAAA;IAAA;MAAnC,oDAAqC;QAAA,IAA1BI,MAAM;QACb,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;UAC5BD,OAAO,CAACE,IAAI,CAAC;YACTC,KAAK,EAAEF,MAAM;YACbG,KAAK,EAAEH;UACX,CAAC,CAAC;UACF;QACJ;QACAD,OAAO,CAACE,IAAI,CAAC;UACTC,KAAK,EAAEF,MAAM,CAACE,KAAK;UACnBC,KAAK,EAAEH,MAAM,CAACG,KAAK;UACnBJ,OAAO,EAAEC,MAAM,CAACD;QACpB,CAAC,CAAC;MACN;IAAC;MAAA;IAAA;MAAA;IAAA;IACD,OAAOA,OAAO;EAClB;EACA,OAAOK,MAAM,CAACC,IAAI,CAACT,cAAc,CAAC,CAACU,GAAG,CAAC,UAAAC,GAAG,EAAI;IAC1C,OAAO;MACHL,KAAK,EAAEN,cAAc,CAACW,GAAG,CAAC;MAC1BJ,KAAK,EAAEI;IACX,CAAC;EACL,CAAC,CAAC;AACN,CAAC;;AAED;AACA;AACA;AACA,IAAMC,SAAS,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC;AAEtC,IAAMC,YAAY,GAAG,SAAfA,YAAY,CAAIC,KAAkB,EAA2C;EAC/E,IAAMC,QAA8C,GAAG,CAAC,CAAC;EACzDP,MAAM,CAACC,IAAI,CAACK,KAAK,CAAC,CACbE,MAAM,CAAC,UAAAC,IAAI;IAAA,OAAI,CAACL,SAAS,CAACM,QAAQ,CAACD,IAAI,CAAC;EAAA;EACzC;EAAA,CACCE,OAAO,CAAC,UAACF,IAAS;IAAA,OAAMF,QAAQ,CAACE,IAAI,CAAC,GAAGH,KAAK,CAACG,IAAI,CAAC;EAAA,CAAC,CAAC;EAE3D,OAAOF,QAAQ;AACnB,CAAC;AACD;AACA;AACA;AACA;AACO,IAAMK,MAA6B,GAAG,SAAhCA,MAA6B,CAAGN,KAAK,EAAI;EAClD,IAAeO,YAAY,GAAwCP,KAAK,CAAhEP,KAAK;IAAgBe,WAAW,GAA2BR,KAAK,CAA3CQ,WAAW;IAAEC,UAAU,GAAeT,KAAK,CAA9BS,UAAU;IAAKC,KAAK,0CAAKV,KAAK;EAExE,IAAMP,KAAK,GAAGc,YAAY,KAAK,IAAI,IAAIA,YAAY,KAAKI,SAAS,GAAG,EAAE,GAAGJ,YAAY;EAErF,WAAmEE,UAAU,IAAI,CAAC,CAAC;IAAlEG,iBAAiB,QAA1BC,OAAO;IAA8BC,iBAAiB,QAA1BC,OAAO;EAE3C,IAAM1B,OAAO,GAAGJ,UAAU,CAACyB,KAAK,CAACrB,OAAO,CAAC;EAEzC,oBACI,6BAAC,cAAK,CAAC,QAAQ,qBACX,6BAAC,cAAU,oBACHU,YAAY,CAACW,KAAK,CAAC;IACvB,OAAO,EAAErB,OAAQ;IACjB,KAAK,EAAEI,KAAM;IACb,SAAS,EAAE,IAAAuB,mBAAU,EACjB,yDAAyD,EACzDC,oBAAY,EACZjB,KAAK,CAACkB,IAAI,oCAA6BlB,KAAK,CAACkB,IAAI,IAAK,IAAI,EAC1DlB,KAAK,CAACmB,SAAS,oCAEVC,eAAO,EAAG,CAACpB,KAAK,CAACR,KAAK,EAE7B;IACF,QAAQ,EAAE,kBAAA6B,CAAC,EAAI;MACXrB,KAAK,CAACsB,QAAQ,IAAItB,KAAK,CAACsB,QAAQ,CAAED,CAAC,CAACE,MAAM,CAAS9B,KAAK,CAAC;IAC7D;EAAE,GACJ,EAEDmB,iBAAiB,KAAK,KAAK,iBACxB,6BAAC,sCAAkB;IAAC,KAAK;EAAA,GAAEE,iBAAiB,CAC/C,EAEAF,iBAAiB,KAAK,KAAK,IAAIJ,WAAW,iBACvC,6BAAC,sCAAkB,QAAEA,WAAW,CACnC,CACY;AAEzB,CAAC;AAAC;AAAA,eAEaF,MAAM;AAAA"}