@webiny/ui 0.0.0-mt-3 → 0.0.0-unstable.2af142b57e

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 (484) 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 +24 -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 +12 -19
  22. package/AutoComplete/AutoComplete.js +147 -148
  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 +12 -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 +5 -9
  76. package/Checkbox/Checkbox.js +38 -43
  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 +75 -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 +25 -0
  127. package/DataTable/DataTable.js +146 -0
  128. package/DataTable/DataTable.js.map +1 -0
  129. package/DataTable/DataTable.stories.d.ts +1 -0
  130. package/DataTable/DataTable.stories.js +71 -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 +2 -0
  137. package/DataTable/styled.js +14 -0
  138. package/DataTable/styled.js.map +1 -0
  139. package/DelayedOnChange/DelayedOnChange.d.ts +40 -0
  140. package/DelayedOnChange/DelayedOnChange.js +110 -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 +45 -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 +20 -14
  248. package/ImageUpload/styled.js +25 -16
  249. package/ImageUpload/styled.js.map +1 -0
  250. package/Input/Input.d.ts +5 -19
  251. package/Input/Input.js +106 -140
  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/List/CollapsibleList/CollapsibleList.stories.js +19 -16
  260. package/List/CollapsibleList/CollapsibleList.stories.js.map +1 -0
  261. package/List/CollapsibleList/index.d.ts +2 -2
  262. package/List/CollapsibleList/index.js +15 -6
  263. package/List/CollapsibleList/index.js.map +1 -0
  264. package/List/DataList/DataList.d.ts +24 -43
  265. package/List/DataList/DataList.js +87 -122
  266. package/List/DataList/DataList.js.map +1 -0
  267. package/List/DataList/DataList.stories.js +30 -26
  268. package/List/DataList/DataList.stories.js.map +1 -0
  269. package/List/DataList/DataListModalOverlay/DataListModalOverlay.d.ts +8 -8
  270. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js +26 -18
  271. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -0
  272. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.d.ts +3 -3
  273. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js +20 -13
  274. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -0
  275. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.d.ts +9 -4
  276. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js +24 -12
  277. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -0
  278. package/List/DataList/DataListModalOverlay/index.js +32 -3
  279. package/List/DataList/DataListModalOverlay/index.js.map +1 -0
  280. package/List/DataList/DataListWithSections.d.ts +45 -0
  281. package/List/DataList/DataListWithSections.js +312 -0
  282. package/List/DataList/DataListWithSections.js.map +1 -0
  283. package/List/DataList/Loader.d.ts +2 -2
  284. package/List/DataList/Loader.js +48 -52
  285. package/List/DataList/Loader.js.map +1 -0
  286. package/List/DataList/NoData.d.ts +2 -2
  287. package/List/DataList/NoData.js +14 -8
  288. package/List/DataList/NoData.js.map +1 -0
  289. package/List/DataList/icons/index.d.ts +1 -1
  290. package/List/DataList/icons/index.js +54 -38
  291. package/List/DataList/icons/index.js.map +1 -0
  292. package/List/DataList/index.d.ts +1 -0
  293. package/List/DataList/index.js +58 -3
  294. package/List/DataList/index.js.map +1 -0
  295. package/List/DataList/types.d.ts +1 -1
  296. package/List/DataList/types.js +5 -1
  297. package/List/DataList/types.js.map +1 -0
  298. package/List/List.d.ts +3 -2
  299. package/List/List.js +66 -62
  300. package/List/List.js.map +1 -0
  301. package/List/List.stories.js +40 -37
  302. package/List/List.stories.js.map +1 -0
  303. package/List/icons/index.js +20 -3
  304. package/List/icons/index.js.map +1 -0
  305. package/List/index.d.ts +1 -1
  306. package/List/index.js +70 -3
  307. package/List/index.js.map +1 -0
  308. package/Menu/Menu.d.ts +14 -21
  309. package/Menu/Menu.js +47 -61
  310. package/Menu/Menu.js.map +1 -0
  311. package/Menu/Menu.stories.js +17 -14
  312. package/Menu/Menu.stories.js.map +1 -0
  313. package/Menu/index.js +16 -1
  314. package/Menu/index.js.map +1 -0
  315. package/Mosaic/Mosaic.d.ts +4 -14
  316. package/Mosaic/Mosaic.js +20 -7
  317. package/Mosaic/Mosaic.js.map +1 -0
  318. package/Mosaic/Mosaic.stories.js +31 -28
  319. package/Mosaic/Mosaic.stories.js.map +1 -0
  320. package/Mosaic/index.js +16 -1
  321. package/Mosaic/index.js.map +1 -0
  322. package/Progress/CircularProgress.d.ts +8 -16
  323. package/Progress/CircularProgress.js +32 -22
  324. package/Progress/CircularProgress.js.map +1 -0
  325. package/Progress/index.js +13 -1
  326. package/Progress/index.js.map +1 -0
  327. package/Radio/Radio.d.ts +2 -6
  328. package/Radio/Radio.js +36 -41
  329. package/Radio/Radio.js.map +1 -0
  330. package/Radio/Radio.styles.js +9 -4
  331. package/Radio/Radio.styles.js.map +1 -0
  332. package/Radio/RadioGroup.d.ts +1 -6
  333. package/Radio/RadioGroup.js +30 -34
  334. package/Radio/RadioGroup.js.map +1 -0
  335. package/Radio/RadioGroup.stories.js +23 -20
  336. package/Radio/RadioGroup.stories.js.map +1 -0
  337. package/Radio/index.js +20 -2
  338. package/Radio/index.js.map +1 -0
  339. package/RichTextEditor/RichTextEditor.d.ts +13 -9
  340. package/RichTextEditor/RichTextEditor.js +79 -78
  341. package/RichTextEditor/RichTextEditor.js.map +1 -0
  342. package/RichTextEditor/RichTextEditor.stories.js +15 -11
  343. package/RichTextEditor/RichTextEditor.stories.js.map +1 -0
  344. package/RichTextEditor/createPropsFromConfig.d.ts +11 -1
  345. package/RichTextEditor/createPropsFromConfig.js +16 -5
  346. package/RichTextEditor/createPropsFromConfig.js.map +1 -0
  347. package/RichTextEditor/index.d.ts +1 -0
  348. package/RichTextEditor/index.js +27 -2
  349. package/RichTextEditor/index.js.map +1 -0
  350. package/Ripple/Ripple.d.ts +4 -5
  351. package/Ripple/Ripple.js +11 -6
  352. package/Ripple/Ripple.js.map +1 -0
  353. package/Ripple/Ripple.stories.js +45 -42
  354. package/Ripple/Ripple.stories.js.map +1 -0
  355. package/Ripple/index.js +16 -1
  356. package/Ripple/index.js.map +1 -0
  357. package/Scrollbar/Scrollbar.d.ts +5 -5
  358. package/Scrollbar/Scrollbar.js +10 -5
  359. package/Scrollbar/Scrollbar.js.map +1 -0
  360. package/Scrollbar/Scrollbar.stories.js +12 -9
  361. package/Scrollbar/Scrollbar.stories.js.map +1 -0
  362. package/Scrollbar/index.js +16 -1
  363. package/Scrollbar/index.js.map +1 -0
  364. package/Section/Section.stories.js +15 -12
  365. package/Section/Section.stories.js.map +1 -0
  366. package/Section/index.d.ts +4 -5
  367. package/Section/index.js +23 -18
  368. package/Section/index.js.map +1 -0
  369. package/Select/Select.d.ts +7 -10
  370. package/Select/Select.js +84 -29
  371. package/Select/Select.js.map +1 -0
  372. package/Select/Select.stories.js +28 -25
  373. package/Select/Select.stories.js.map +1 -0
  374. package/Select/index.js +16 -1
  375. package/Select/index.js.map +1 -0
  376. package/Skeleton/README.md +21 -0
  377. package/Skeleton/Skeleton.d.ts +4 -0
  378. package/Skeleton/Skeleton.js +18 -0
  379. package/Skeleton/Skeleton.js.map +1 -0
  380. package/Skeleton/Skeleton.stories.d.ts +1 -0
  381. package/Skeleton/Skeleton.stories.js +22 -0
  382. package/Skeleton/Skeleton.stories.js.map +1 -0
  383. package/Skeleton/index.d.ts +1 -0
  384. package/Skeleton/index.js +16 -0
  385. package/Skeleton/index.js.map +1 -0
  386. package/Slider/Slider.d.ts +1 -6
  387. package/Slider/Slider.js +39 -47
  388. package/Slider/Slider.js.map +1 -0
  389. package/Slider/Slider.stories.js +20 -17
  390. package/Slider/Slider.stories.js.map +1 -0
  391. package/Slider/index.js +13 -1
  392. package/Slider/index.js.map +1 -0
  393. package/Snackbar/Snackbar.d.ts +5 -7
  394. package/Snackbar/Snackbar.js +29 -33
  395. package/Snackbar/Snackbar.js.map +1 -0
  396. package/Snackbar/Snackbar.stories.js +29 -38
  397. package/Snackbar/Snackbar.stories.js.map +1 -0
  398. package/Snackbar/index.js +18 -1
  399. package/Snackbar/index.js.map +1 -0
  400. package/Switch/Switch.d.ts +3 -7
  401. package/Switch/Switch.js +35 -43
  402. package/Switch/Switch.js.map +1 -0
  403. package/Switch/Switch.stories.js +19 -16
  404. package/Switch/Switch.stories.js.map +1 -0
  405. package/Switch/index.js +16 -1
  406. package/Switch/index.js.map +1 -0
  407. package/Tabs/Tab.d.ts +7 -2
  408. package/Tabs/Tab.js +30 -9
  409. package/Tabs/Tab.js.map +1 -0
  410. package/Tabs/Tabs.d.ts +44 -21
  411. package/Tabs/Tabs.js +123 -130
  412. package/Tabs/Tabs.js.map +1 -0
  413. package/Tabs/Tabs.stories.js +25 -23
  414. package/Tabs/Tabs.stories.js.map +1 -0
  415. package/Tabs/index.js +27 -2
  416. package/Tabs/index.js.map +1 -0
  417. package/Tags/Tags.d.ts +9 -21
  418. package/Tags/Tags.js +95 -124
  419. package/Tags/Tags.js.map +1 -0
  420. package/Tags/Tags.stories.js +19 -16
  421. package/Tags/Tags.stories.js.map +1 -0
  422. package/Tags/index.js +16 -1
  423. package/Tags/index.js.map +1 -0
  424. package/Tooltip/Tooltip.d.ts +9 -8
  425. package/Tooltip/Tooltip.js +33 -33
  426. package/Tooltip/Tooltip.js.map +1 -0
  427. package/Tooltip/Tooltip.stories.js +14 -11
  428. package/Tooltip/Tooltip.stories.js.map +1 -0
  429. package/Tooltip/index.js +16 -1
  430. package/Tooltip/index.js.map +1 -0
  431. package/TopAppBar/TopAppBar.d.ts +1 -1
  432. package/TopAppBar/TopAppBar.js +13 -9
  433. package/TopAppBar/TopAppBar.js.map +1 -0
  434. package/TopAppBar/TopAppBar.stories.js +31 -30
  435. package/TopAppBar/TopAppBar.stories.js.map +1 -0
  436. package/TopAppBar/TopAppBarActionItem.d.ts +1 -1
  437. package/TopAppBar/TopAppBarActionItem.js +10 -5
  438. package/TopAppBar/TopAppBarActionItem.js.map +1 -0
  439. package/TopAppBar/TopAppBarNavigationIcon.d.ts +1 -1
  440. package/TopAppBar/TopAppBarNavigationIcon.js +10 -5
  441. package/TopAppBar/TopAppBarNavigationIcon.js.map +1 -0
  442. package/TopAppBar/TopAppBarPrimary.js +13 -9
  443. package/TopAppBar/TopAppBarPrimary.js.map +1 -0
  444. package/TopAppBar/TopAppBarSecondary.js +15 -11
  445. package/TopAppBar/TopAppBarSecondary.js.map +1 -0
  446. package/TopAppBar/TopAppBarSection.d.ts +1 -1
  447. package/TopAppBar/TopAppBarSection.js +13 -9
  448. package/TopAppBar/TopAppBarSection.js.map +1 -0
  449. package/TopAppBar/TopAppBarTitle.d.ts +1 -1
  450. package/TopAppBar/TopAppBarTitle.js +13 -9
  451. package/TopAppBar/TopAppBarTitle.js.map +1 -0
  452. package/TopAppBar/index.js +82 -7
  453. package/TopAppBar/index.js.map +1 -0
  454. package/TopProgressBar/TopProgressBar.d.ts +7 -7
  455. package/TopProgressBar/TopProgressBar.js +15 -7
  456. package/TopProgressBar/TopProgressBar.js.map +1 -0
  457. package/TopProgressBar/TopProgressBar.stories.js +16 -13
  458. package/TopProgressBar/TopProgressBar.stories.js.map +1 -0
  459. package/TopProgressBar/hoc/index.js +13 -1
  460. package/TopProgressBar/hoc/index.js.map +1 -0
  461. package/TopProgressBar/hoc/withTopProgressBar.d.ts +1 -1
  462. package/TopProgressBar/hoc/withTopProgressBar.js +14 -9
  463. package/TopProgressBar/hoc/withTopProgressBar.js.map +1 -0
  464. package/TopProgressBar/index.js +16 -1
  465. package/TopProgressBar/index.js.map +1 -0
  466. package/Typography/Typography.d.ts +5 -5
  467. package/Typography/Typography.js +10 -5
  468. package/Typography/Typography.js.map +1 -0
  469. package/Typography/Typography.stories.js +37 -34
  470. package/Typography/Typography.stories.js.map +1 -0
  471. package/Typography/index.js +16 -1
  472. package/Typography/index.js.map +1 -0
  473. package/package.json +58 -64
  474. package/styles.scss +3 -4
  475. package/types.d.ts +4 -4
  476. package/types.js +5 -1
  477. package/types.js.map +1 -0
  478. package/Chips/ChipIcon.d.ts +0 -4
  479. package/Chips/ChipIcon.js +0 -8
  480. package/rmwc/textfield/code/index.d.ts +0 -135
  481. package/rmwc/textfield/code/index.js +0 -571
  482. package/rmwc/textfield/next/index.d.ts +0 -135
  483. package/rmwc/textfield/next/index.js +0 -560
  484. package/rmwc/textfield/package.json +0 -45
@@ -1,12 +1,12 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  interface ChildrenRenderProp {
3
- showConfirmation: (onAccept?: Function, onCancel?: Function) => any;
3
+ showConfirmation: (onAccept?: () => void, onCancel?: () => void) => any;
4
4
  }
5
5
  interface ConfirmationCallbacks {
6
- onAccept: Function;
7
- onCancel: Function;
6
+ onAccept?: () => void;
7
+ onCancel?: () => void;
8
8
  }
9
- declare type Props = {
9
+ interface Props {
10
10
  title?: React.ReactNode;
11
11
  message?: React.ReactNode;
12
12
  loading?: React.ReactNode;
@@ -14,15 +14,15 @@ declare type Props = {
14
14
  children: (props: ChildrenRenderProp) => React.ReactNode;
15
15
  disableConfirm?: boolean;
16
16
  style?: React.CSSProperties;
17
- };
18
- declare type State = {
17
+ }
18
+ interface ConfirmationDialogState {
19
19
  show: boolean;
20
20
  loading: boolean;
21
- };
21
+ }
22
22
  /**
23
23
  * Use ConfirmationDialog component to display a list of choices, once the handler is triggered.
24
24
  */
25
- declare class ConfirmationDialog extends React.Component<Props, State> {
25
+ declare class ConfirmationDialog extends React.Component<Props, ConfirmationDialogState> {
26
26
  static defaultProps: {
27
27
  title: string;
28
28
  message: string;
@@ -36,10 +36,10 @@ declare class ConfirmationDialog extends React.Component<Props, State> {
36
36
  };
37
37
  componentDidMount(): void;
38
38
  componentWillUnmount(): void;
39
- showConfirmation: (onAccept?: Function, onCancel?: Function) => void;
40
- hideConfirmation: () => void;
41
- onAccept: () => Promise<void>;
42
- onCancel: () => Promise<void>;
39
+ private readonly showConfirmation;
40
+ private readonly hideConfirmation;
41
+ private readonly onAccept;
42
+ private readonly onCancel;
43
43
  render(): JSX.Element;
44
44
  }
45
45
  export { ConfirmationDialog };
@@ -1,128 +1,110 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _createSuper from "@babel/runtime/helpers/createSuper";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- import _regeneratorRuntime from "@babel/runtime/regenerator";
9
- import * as React from "react";
10
- import noop from "lodash/noop";
11
- import { Dialog, DialogButton, DialogCancel, DialogActions, DialogTitle, DialogContent } from "./../Dialog";
12
- import { CircularProgress } from "../Progress";
1
+ "use strict";
13
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ConfirmationDialog = void 0;
8
+ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
9
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
15
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
+ var _react = _interopRequireDefault(require("react"));
17
+ var _Dialog = require("./../Dialog");
18
+ var _Progress = require("../Progress");
14
19
  /**
15
20
  * Use ConfirmationDialog component to display a list of choices, once the handler is triggered.
16
21
  */
17
22
  var ConfirmationDialog = /*#__PURE__*/function (_React$Component) {
18
- _inherits(ConfirmationDialog, _React$Component);
19
-
20
- var _super = _createSuper(ConfirmationDialog);
21
-
23
+ (0, _inherits2.default)(ConfirmationDialog, _React$Component);
24
+ var _super = (0, _createSuper2.default)(ConfirmationDialog);
22
25
  function ConfirmationDialog() {
23
26
  var _this;
24
-
25
- _classCallCheck(this, ConfirmationDialog);
26
-
27
+ (0, _classCallCheck2.default)(this, ConfirmationDialog);
27
28
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
29
  args[_key] = arguments[_key];
29
30
  }
30
-
31
31
  _this = _super.call.apply(_super, [this].concat(args));
32
-
33
- _defineProperty(_assertThisInitialized(_this), "__isMounted", false);
34
-
35
- _defineProperty(_assertThisInitialized(_this), "callbacks", {
36
- onAccept: noop,
37
- onCancel: noop
32
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "__isMounted", false);
33
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callbacks", {
34
+ onAccept: function onAccept() {
35
+ return void 0;
36
+ },
37
+ onCancel: function onCancel() {
38
+ return void 0;
39
+ }
38
40
  });
39
-
40
- _defineProperty(_assertThisInitialized(_this), "state", {
41
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
41
42
  show: false,
42
43
  loading: false
43
44
  });
44
-
45
- _defineProperty(_assertThisInitialized(_this), "showConfirmation", function (onAccept, onCancel) {
45
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showConfirmation", function (onAccept, onCancel) {
46
46
  _this.callbacks = {
47
47
  onAccept: onAccept,
48
48
  onCancel: onCancel
49
49
  };
50
-
51
50
  _this.setState({
52
51
  show: true
53
52
  });
54
53
  });
55
-
56
- _defineProperty(_assertThisInitialized(_this), "hideConfirmation", function () {
54
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideConfirmation", function () {
57
55
  _this.setState({
58
56
  show: false
59
57
  });
60
58
  });
61
-
62
- _defineProperty(_assertThisInitialized(_this), "onAccept", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
59
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onAccept", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
63
60
  var onAccept;
64
- return _regeneratorRuntime.wrap(function _callee$(_context) {
65
- while (1) {
66
- switch (_context.prev = _context.next) {
67
- case 0:
68
- onAccept = _this.callbacks.onAccept;
69
-
70
- if (!(typeof onAccept === "function")) {
71
- _context.next = 6;
72
- break;
73
- }
74
-
61
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
62
+ while (1) switch (_context.prev = _context.next) {
63
+ case 0:
64
+ onAccept = _this.callbacks.onAccept;
65
+ if (!(typeof onAccept === "function")) {
66
+ _context.next = 6;
67
+ break;
68
+ }
69
+ _this.setState({
70
+ loading: true
71
+ });
72
+ _context.next = 5;
73
+ return onAccept();
74
+ case 5:
75
+ if (_this.__isMounted) {
75
76
  _this.setState({
76
- loading: true
77
+ loading: false,
78
+ show: false
77
79
  });
78
-
79
- _context.next = 5;
80
- return onAccept();
81
-
82
- case 5:
83
- if (_this.__isMounted) {
84
- _this.setState({
85
- loading: false,
86
- show: false
87
- });
88
- }
89
-
90
- case 6:
91
- case "end":
92
- return _context.stop();
93
- }
80
+ }
81
+ case 6:
82
+ case "end":
83
+ return _context.stop();
94
84
  }
95
85
  }, _callee);
96
86
  })));
97
-
98
- _defineProperty(_assertThisInitialized(_this), "onCancel", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
87
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onCancel", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
99
88
  var onCancel;
100
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
101
- while (1) {
102
- switch (_context2.prev = _context2.next) {
103
- case 0:
104
- onCancel = _this.callbacks.onCancel;
105
-
106
- if (!(typeof onCancel === "function")) {
107
- _context2.next = 4;
108
- break;
109
- }
110
-
89
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
90
+ while (1) switch (_context2.prev = _context2.next) {
91
+ case 0:
92
+ onCancel = _this.callbacks.onCancel;
93
+ if (!(typeof onCancel === "function")) {
111
94
  _context2.next = 4;
112
- return onCancel();
113
-
114
- case 4:
115
- case "end":
116
- return _context2.stop();
117
- }
95
+ break;
96
+ }
97
+ _context2.next = 4;
98
+ return onCancel();
99
+ case 4:
100
+ case "end":
101
+ return _context2.stop();
118
102
  }
119
103
  }, _callee2);
120
104
  })));
121
-
122
105
  return _this;
123
106
  }
124
-
125
- _createClass(ConfirmationDialog, [{
107
+ (0, _createClass2.default)(ConfirmationDialog, [{
126
108
  key: "componentDidMount",
127
109
  value: function componentDidMount() {
128
110
  this.__isMounted = true;
@@ -135,14 +117,14 @@ var ConfirmationDialog = /*#__PURE__*/function (_React$Component) {
135
117
  }, {
136
118
  key: "render",
137
119
  value: function render() {
138
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog, {
120
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Dialog.Dialog, {
139
121
  style: this.props.style,
140
122
  open: this.state.show,
141
123
  onClose: this.hideConfirmation,
142
124
  "data-testid": this.props["data-testid"]
143
- }, this.state.loading ? this.props.loading : null, /*#__PURE__*/React.createElement(DialogTitle, null, this.props.title), /*#__PURE__*/React.createElement(DialogContent, null, this.props.message), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(DialogCancel, {
125
+ }, this.state.loading ? this.props.loading : null, /*#__PURE__*/_react.default.createElement(_Dialog.DialogTitle, null, this.props.title), /*#__PURE__*/_react.default.createElement(_Dialog.DialogContent, null, this.props.message), /*#__PURE__*/_react.default.createElement(_Dialog.DialogActions, null, /*#__PURE__*/_react.default.createElement(_Dialog.DialogCancel, {
144
126
  onClick: this.onCancel
145
- }, "Cancel"), /*#__PURE__*/React.createElement(DialogButton, {
127
+ }, "Cancel"), /*#__PURE__*/_react.default.createElement(_Dialog.DialogButton, {
146
128
  "data-testid": "confirmationdialog-confirm-action",
147
129
  onClick: this.onAccept,
148
130
  disabled: this.props.disableConfirm
@@ -151,14 +133,11 @@ var ConfirmationDialog = /*#__PURE__*/function (_React$Component) {
151
133
  }));
152
134
  }
153
135
  }]);
154
-
155
136
  return ConfirmationDialog;
156
- }(React.Component);
157
-
158
- _defineProperty(ConfirmationDialog, "defaultProps", {
137
+ }(_react.default.Component);
138
+ exports.ConfirmationDialog = ConfirmationDialog;
139
+ (0, _defineProperty2.default)(ConfirmationDialog, "defaultProps", {
159
140
  title: "Confirmation",
160
141
  message: "Are you sure you want to continue?",
161
- loading: /*#__PURE__*/React.createElement(CircularProgress, null)
162
- });
163
-
164
- export { ConfirmationDialog };
142
+ loading: /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, null)
143
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ConfirmationDialog","onAccept","onCancel","show","loading","callbacks","setState","__isMounted","props","style","state","hideConfirmation","title","message","disableConfirm","children","showConfirmation","React","Component"],"sources":["ConfirmationDialog.tsx"],"sourcesContent":["import React from \"react\";\n\nimport {\n Dialog,\n DialogButton,\n DialogCancel,\n DialogActions,\n DialogTitle,\n DialogContent\n} from \"./../Dialog\";\n\nimport { CircularProgress } from \"../Progress\";\n\ninterface ChildrenRenderProp {\n showConfirmation: (onAccept?: () => void, onCancel?: () => void) => any;\n}\n\ninterface ConfirmationCallbacks {\n onAccept?: () => void;\n onCancel?: () => void;\n}\n\ninterface Props {\n // Title of confirmation dialog\n title?: React.ReactNode;\n\n // Message of confirmation dialog\n message?: React.ReactNode;\n\n // This element will be rendered during loading\n loading?: React.ReactNode;\n\n // For testing purposes\n \"data-testid\"?: string;\n\n // An element that will trigger the confirmation dialog.\n children: (props: ChildrenRenderProp) => React.ReactNode;\n\n // Is `Confirm` button disabled\n disableConfirm?: boolean;\n\n // Dialog component's custom in-line styles.\n style?: React.CSSProperties;\n}\n\ninterface ConfirmationDialogState {\n show: boolean;\n loading: boolean;\n}\n\n/**\n * Use ConfirmationDialog component to display a list of choices, once the handler is triggered.\n */\nclass ConfirmationDialog extends React.Component<Props, ConfirmationDialogState> {\n static defaultProps = {\n title: \"Confirmation\",\n message: \"Are you sure you want to continue?\",\n loading: <CircularProgress />\n };\n\n __isMounted = false;\n\n callbacks: ConfirmationCallbacks = {\n onAccept: () => {\n return void 0;\n },\n onCancel: () => {\n return void 0;\n }\n };\n\n public override state = {\n show: false,\n loading: false\n };\n\n public override componentDidMount() {\n this.__isMounted = true;\n }\n\n public override componentWillUnmount() {\n this.__isMounted = false;\n }\n\n private readonly showConfirmation = (onAccept?: () => void, onCancel?: () => void) => {\n this.callbacks = {\n onAccept,\n onCancel\n };\n this.setState({ show: true });\n };\n\n private readonly hideConfirmation = () => {\n this.setState({ show: false });\n };\n\n private readonly onAccept = async () => {\n const { onAccept } = this.callbacks;\n if (typeof onAccept === \"function\") {\n this.setState({ loading: true });\n await onAccept();\n if (this.__isMounted) {\n this.setState({ loading: false, show: false });\n }\n }\n };\n\n private readonly onCancel = async () => {\n const { onCancel } = this.callbacks;\n if (typeof onCancel === \"function\") {\n await onCancel();\n }\n };\n\n public override render() {\n return (\n <React.Fragment>\n <Dialog\n style={this.props.style}\n open={this.state.show}\n onClose={this.hideConfirmation}\n data-testid={this.props[\"data-testid\"]}\n >\n {this.state.loading ? this.props.loading : null}\n <DialogTitle>{this.props.title}</DialogTitle>\n <DialogContent>{this.props.message}</DialogContent>\n <DialogActions>\n <DialogCancel onClick={this.onCancel}>Cancel</DialogCancel>\n <DialogButton\n data-testid=\"confirmationdialog-confirm-action\"\n onClick={this.onAccept}\n disabled={this.props.disableConfirm}\n >\n Confirm\n </DialogButton>\n </DialogActions>\n </Dialog>\n {this.props.children({\n showConfirmation: this.showConfirmation\n })}\n </React.Fragment>\n );\n }\n}\n\nexport { ConfirmationDialog };\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAEA;AASA;AAuCA;AACA;AACA;AAFA,IAGMA,kBAAkB;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;MAAA;IAAA;IAAA;IAAA,0FAON,KAAK;IAAA,wFAEgB;MAC/BC,QAAQ,EAAE,oBAAM;QACZ,OAAO,KAAK,CAAC;MACjB,CAAC;MACDC,QAAQ,EAAE,oBAAM;QACZ,OAAO,KAAK,CAAC;MACjB;IACJ,CAAC;IAAA,oFAEuB;MACpBC,IAAI,EAAE,KAAK;MACXC,OAAO,EAAE;IACb,CAAC;IAAA,+FAUmC,UAACH,QAAqB,EAAEC,QAAqB,EAAK;MAClF,MAAKG,SAAS,GAAG;QACbJ,QAAQ,EAARA,QAAQ;QACRC,QAAQ,EAARA;MACJ,CAAC;MACD,MAAKI,QAAQ,CAAC;QAAEH,IAAI,EAAE;MAAK,CAAC,CAAC;IACjC,CAAC;IAAA,+FAEmC,YAAM;MACtC,MAAKG,QAAQ,CAAC;QAAEH,IAAI,EAAE;MAAM,CAAC,CAAC;IAClC,CAAC;IAAA,2LAE2B;MAAA;MAAA;QAAA;UAAA;YAChBF,QAAQ,GAAK,MAAKI,SAAS,CAA3BJ,QAAQ;YAAA,MACZ,OAAOA,QAAQ,KAAK,UAAU;cAAA;cAAA;YAAA;YAC9B,MAAKK,QAAQ,CAAC;cAAEF,OAAO,EAAE;YAAK,CAAC,CAAC;YAAC;YAAA,OAC3BH,QAAQ,EAAE;UAAA;YAChB,IAAI,MAAKM,WAAW,EAAE;cAClB,MAAKD,QAAQ,CAAC;gBAAEF,OAAO,EAAE,KAAK;gBAAED,IAAI,EAAE;cAAM,CAAC,CAAC;YAClD;UAAC;UAAA;YAAA;QAAA;MAAA;IAAA,CAER;IAAA,2LAE2B;MAAA;MAAA;QAAA;UAAA;YAChBD,QAAQ,GAAK,MAAKG,SAAS,CAA3BH,QAAQ;YAAA,MACZ,OAAOA,QAAQ,KAAK,UAAU;cAAA;cAAA;YAAA;YAAA;YAAA,OACxBA,QAAQ,EAAE;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA,CAEvB;IAAA;EAAA;EAAA;IAAA;IAAA,OApCD,6BAAoC;MAChC,IAAI,CAACK,WAAW,GAAG,IAAI;IAC3B;EAAC;IAAA;IAAA,OAED,gCAAuC;MACnC,IAAI,CAACA,WAAW,GAAG,KAAK;IAC5B;EAAC;IAAA;IAAA,OAgCD,kBAAyB;MACrB,oBACI,6BAAC,cAAK,CAAC,QAAQ,qBACX,6BAAC,cAAM;QACH,KAAK,EAAE,IAAI,CAACC,KAAK,CAACC,KAAM;QACxB,IAAI,EAAE,IAAI,CAACC,KAAK,CAACP,IAAK;QACtB,OAAO,EAAE,IAAI,CAACQ,gBAAiB;QAC/B,eAAa,IAAI,CAACH,KAAK,CAAC,aAAa;MAAE,GAEtC,IAAI,CAACE,KAAK,CAACN,OAAO,GAAG,IAAI,CAACI,KAAK,CAACJ,OAAO,GAAG,IAAI,eAC/C,6BAAC,mBAAW,QAAE,IAAI,CAACI,KAAK,CAACI,KAAK,CAAe,eAC7C,6BAAC,qBAAa,QAAE,IAAI,CAACJ,KAAK,CAACK,OAAO,CAAiB,eACnD,6BAAC,qBAAa,qBACV,6BAAC,oBAAY;QAAC,OAAO,EAAE,IAAI,CAACX;MAAS,GAAC,QAAM,CAAe,eAC3D,6BAAC,oBAAY;QACT,eAAY,mCAAmC;QAC/C,OAAO,EAAE,IAAI,CAACD,QAAS;QACvB,QAAQ,EAAE,IAAI,CAACO,KAAK,CAACM;MAAe,GACvC,SAED,CAAe,CACH,CACX,EACR,IAAI,CAACN,KAAK,CAACO,QAAQ,CAAC;QACjBC,gBAAgB,EAAE,IAAI,CAACA;MAC3B,CAAC,CAAC,CACW;IAEzB;EAAC;EAAA;AAAA,EAzF4BC,cAAK,CAACC,SAAS;AAAA;AAAA,8BAA1ClB,kBAAkB,kBACE;EAClBY,KAAK,EAAE,cAAc;EACrBC,OAAO,EAAE,oCAAoC;EAC7CT,OAAO,eAAE,6BAAC,0BAAgB;AAC9B,CAAC"}
@@ -1,19 +1,22 @@
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 "./../ConfirmationDialog/README.md";
5
- import { ButtonPrimary } from "./../Button";
6
- import { ConfirmationDialog } from "./ConfirmationDialog";
7
- var story = storiesOf("Components/ConfirmationDialog", 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("./../ConfirmationDialog/README.md"));
8
+ var _Button = require("./../Button");
9
+ var _ConfirmationDialog = require("./ConfirmationDialog");
10
+ var story = (0, _react2.storiesOf)("Components/ConfirmationDialog", module);
8
11
  story.add("usage", function () {
9
- return /*#__PURE__*/React.createElement(Story, null, /*#__PURE__*/React.createElement(StoryReadme, null, readme), /*#__PURE__*/React.createElement(StorySandbox, {
12
+ return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, {
10
13
  title: "Icon with and without ConfirmationDialog"
11
- }, /*#__PURE__*/React.createElement(StorySandboxExample, null, /*#__PURE__*/React.createElement(ConfirmationDialog, {
14
+ }, /*#__PURE__*/_react.default.createElement(_Story.StorySandboxExample, null, /*#__PURE__*/_react.default.createElement(_ConfirmationDialog.ConfirmationDialog, {
12
15
  title: "Pay Invoice",
13
16
  message: "Are you sure you want pay this invoice?"
14
17
  }, function (_ref) {
15
18
  var showConfirmation = _ref.showConfirmation;
16
- return /*#__PURE__*/React.createElement(ButtonPrimary, {
19
+ return /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
17
20
  onClick: function onClick() {
18
21
  showConfirmation(function () {
19
22
  return console.log("Confirm");
@@ -22,9 +25,9 @@ story.add("usage", function () {
22
25
  });
23
26
  }
24
27
  }, "Pay Invoice");
25
- })), /*#__PURE__*/React.createElement(StorySandboxCode, null, "\n <ConfirmationDialog\n title=\"Pay Invoice\"\n message=\"Are you sure you want pay this invoice?\"\n >\n {({ showConfirmation }) => {\n return (\n <ButtonPrimary\n onClick={() => {\n showConfirmation(\n () => console.log(\"Confirm\"),\n () => console.log(\"Cancel\")\n );\n }}\n >\n Pay Invoice\n </ButtonPrimary>\n );\n }}\n </ConfirmationDialog>\n ")));
28
+ })), /*#__PURE__*/_react.default.createElement(_Story.StorySandboxCode, null, "\n <ConfirmationDialog\n title=\"Pay Invoice\"\n message=\"Are you sure you want pay this invoice?\"\n >\n {({ showConfirmation }) => {\n return (\n <ButtonPrimary\n onClick={() => {\n showConfirmation(\n () => console.log(\"Confirm\"),\n () => console.log(\"Cancel\")\n );\n }}\n >\n Pay Invoice\n </ButtonPrimary>\n );\n }}\n </ConfirmationDialog>\n ")));
26
29
  }, {
27
30
  info: {
28
- propTables: [ConfirmationDialog]
31
+ propTables: [_ConfirmationDialog.ConfirmationDialog]
29
32
  }
30
33
  });
@@ -0,0 +1 @@
1
+ {"version":3,"names":["story","storiesOf","module","add","readme","showConfirmation","console","log","info","propTables","ConfirmationDialog"],"sources":["ConfirmationDialog.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 \"./../ConfirmationDialog/README.md\";\nimport { ButtonPrimary } from \"./../Button\";\nimport { ConfirmationDialog } from \"./ConfirmationDialog\";\n\nconst story = storiesOf(\"Components/ConfirmationDialog\", module);\n\nstory.add(\n \"usage\",\n () => {\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"Icon with and without ConfirmationDialog\"}>\n <StorySandboxExample>\n <ConfirmationDialog\n title=\"Pay Invoice\"\n message=\"Are you sure you want pay this invoice?\"\n >\n {({ showConfirmation }) => {\n return (\n <ButtonPrimary\n onClick={() => {\n showConfirmation(\n () => console.log(\"Confirm\"),\n () => console.log(\"Cancel\")\n );\n }}\n >\n Pay Invoice\n </ButtonPrimary>\n );\n }}\n </ConfirmationDialog>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <ConfirmationDialog\n title=\"Pay Invoice\"\n message=\"Are you sure you want pay this invoice?\"\n >\n {({ showConfirmation }) => {\n return (\n <ButtonPrimary\n onClick={() => {\n showConfirmation(\n () => console.log(\"Confirm\"),\n () => console.log(\"Cancel\")\n );\n }}\n >\n Pay Invoice\n </ButtonPrimary>\n );\n }}\n </ConfirmationDialog>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [ConfirmationDialog] } }\n);\n"],"mappings":";;;AAAA;AACA;AACA;AAOA;AACA;AACA;AAEA,IAAMA,KAAK,GAAG,IAAAC,iBAAS,EAAC,+BAA+B,EAAEC,MAAM,CAAC;AAEhEF,KAAK,CAACG,GAAG,CACL,OAAO,EACP,YAAM;EACF,oBACI,6BAAC,YAAK,qBACF,6BAAC,kBAAW,QAAEC,eAAM,CAAe,eACnC,6BAAC,mBAAY;IAAC,KAAK,EAAE;EAA2C,gBAC5D,6BAAC,0BAAmB,qBAChB,6BAAC,sCAAkB;IACf,KAAK,EAAC,aAAa;IACnB,OAAO,EAAC;EAAyC,GAEhD,gBAA0B;IAAA,IAAvBC,gBAAgB,QAAhBA,gBAAgB;IAChB,oBACI,6BAAC,qBAAa;MACV,OAAO,EAAE,mBAAM;QACXA,gBAAgB,CACZ;UAAA,OAAMC,OAAO,CAACC,GAAG,CAAC,SAAS,CAAC;QAAA,GAC5B;UAAA,OAAMD,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC;QAAA,EAC9B;MACL;IAAE,GACL,aAED,CAAgB;EAExB,CAAC,CACgB,CACH,eACtB,6BAAC,uBAAgB,o7BAsBE,CACR,CACX;AAEhB,CAAC,EACD;EAAEC,IAAI,EAAE;IAAEC,UAAU,EAAE,CAACC,sCAAkB;EAAE;AAAE,CAAC,CACjD"}
@@ -1,2 +1,27 @@
1
- export * from "./ConfirmationDialog";
2
- export * from "./withConfirmation";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _ConfirmationDialog = require("./ConfirmationDialog");
7
+ Object.keys(_ConfirmationDialog).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ConfirmationDialog[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _ConfirmationDialog[key];
14
+ }
15
+ });
16
+ });
17
+ var _withConfirmation = require("./withConfirmation");
18
+ Object.keys(_withConfirmation).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _withConfirmation[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _withConfirmation[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ConfirmationDialog\";\nexport * from \"./withConfirmation\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1,9 +1,9 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  declare type ConfirmationProps = {
3
3
  title?: React.ReactNode;
4
4
  message?: React.ReactNode;
5
5
  };
6
- declare type WithConfirmationParams = (props: any) => ConfirmationProps;
6
+ declare type WithConfirmationParams = (props: Record<string, any>) => ConfirmationProps;
7
7
  export declare type WithConfirmationProps = {
8
8
  showConfirmation: (confirm: Function, cancel: Function) => void;
9
9
  };
@@ -1,15 +1,23 @@
1
- import * as React from "react";
2
- import { ConfirmationDialog } from "./ConfirmationDialog";
3
- export var withConfirmation = function withConfirmation(dialogProps) {
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.withConfirmation = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _ConfirmationDialog = require("./ConfirmationDialog");
10
+ var withConfirmation = function withConfirmation(dialogProps) {
4
11
  return function (Component) {
5
12
  return function withConfirmationRender(ownProps) {
6
13
  var props = typeof dialogProps === "function" ? dialogProps(ownProps) : dialogProps;
7
- return /*#__PURE__*/React.createElement(ConfirmationDialog, props, function (_ref) {
14
+ return /*#__PURE__*/_react.default.createElement(_ConfirmationDialog.ConfirmationDialog, props, function (_ref) {
8
15
  var showConfirmation = _ref.showConfirmation;
9
- return /*#__PURE__*/React.createElement(Component, Object.assign({}, ownProps, {
16
+ return /*#__PURE__*/_react.default.createElement(Component, Object.assign({}, ownProps, {
10
17
  showConfirmation: showConfirmation
11
18
  }));
12
19
  });
13
20
  };
14
21
  };
15
- };
22
+ };
23
+ exports.withConfirmation = withConfirmation;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withConfirmation","dialogProps","Component","withConfirmationRender","ownProps","props","showConfirmation"],"sources":["withConfirmation.tsx"],"sourcesContent":["import React from \"react\";\nimport { ConfirmationDialog } from \"./ConfirmationDialog\";\n\ntype ConfirmationProps = {\n title?: React.ReactNode;\n message?: React.ReactNode;\n};\n\ntype WithConfirmationParams = (props: Record<string, any>) => ConfirmationProps;\n\nexport type WithConfirmationProps = {\n showConfirmation: (confirm: Function, cancel: Function) => void;\n};\n\nexport const withConfirmation = (dialogProps: WithConfirmationParams): Function => {\n return (Component: typeof React.Component) => {\n return function withConfirmationRender(ownProps: Record<string, any>) {\n const props = typeof dialogProps === \"function\" ? dialogProps(ownProps) : dialogProps;\n return (\n <ConfirmationDialog {...props}>\n {({ showConfirmation }) => (\n <Component {...ownProps} showConfirmation={showConfirmation} />\n )}\n </ConfirmationDialog>\n );\n };\n };\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAaO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,CAAIC,WAAmC,EAAe;EAC/E,OAAO,UAACC,SAAiC,EAAK;IAC1C,OAAO,SAASC,sBAAsB,CAACC,QAA6B,EAAE;MAClE,IAAMC,KAAK,GAAG,OAAOJ,WAAW,KAAK,UAAU,GAAGA,WAAW,CAACG,QAAQ,CAAC,GAAGH,WAAW;MACrF,oBACI,6BAAC,sCAAkB,EAAKI,KAAK,EACxB;QAAA,IAAGC,gBAAgB,QAAhBA,gBAAgB;QAAA,oBAChB,6BAAC,SAAS,oBAAKF,QAAQ;UAAE,gBAAgB,EAAEE;QAAiB,GAAG;MAAA,CAClE,CACgB;IAE7B,CAAC;EACL,CAAC;AACL,CAAC;AAAC"}
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ import { DataTableCellProps } from "@rmwc/data-table";
3
+ import "@rmwc/data-table/data-table.css";
4
+ interface Column<T> {
5
+ header: string | number | JSX.Element;
6
+ cell?: (row: T) => string | number | JSX.Element;
7
+ meta?: DataTableCellProps;
8
+ className?: string;
9
+ }
10
+ export declare type Columns<T> = {
11
+ [P in keyof T]?: Column<T>;
12
+ };
13
+ export declare type DefaultData = {
14
+ selectable?: boolean;
15
+ };
16
+ interface Props<T> {
17
+ columns: Columns<T>;
18
+ data: T[];
19
+ onSelectRow?: (rows: T[] | []) => void;
20
+ loadingInitial?: boolean;
21
+ stickyColumns?: number;
22
+ stickyRows?: number;
23
+ }
24
+ export declare const DataTable: <T extends Object & DefaultData>({ data, columns, onSelectRow, loadingInitial, stickyColumns, stickyRows }: Props<T>) => JSX.Element;
25
+ export {};
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.DataTable = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var _dataTable = require("@rmwc/data-table");
14
+ var _reactTable = require("@tanstack/react-table");
15
+ var _Checkbox = require("../Checkbox");
16
+ var _Skeleton = require("../Skeleton");
17
+ require("@rmwc/data-table/data-table.css");
18
+ var _styled = require("./styled");
19
+ var defineColumns = function defineColumns(columns, onSelectRow, loadingInitial) {
20
+ return (0, _react.useMemo)(function () {
21
+ var columnsList = Object.keys(columns).map(function (key) {
22
+ return (0, _objectSpread2.default)({
23
+ id: key
24
+ }, columns[key]);
25
+ });
26
+ var defaults = columnsList.map(function (column) {
27
+ var id = column.id,
28
+ _header = column.header,
29
+ meta = column.meta,
30
+ _cell = column.cell;
31
+ return {
32
+ accessorKey: id,
33
+ header: function header() {
34
+ return _header;
35
+ },
36
+ cell: function cell(info) {
37
+ if (_cell && typeof _cell === "function") {
38
+ return _cell(info.row.original);
39
+ } else {
40
+ return info.getValue();
41
+ }
42
+ },
43
+ meta: meta
44
+ };
45
+ });
46
+ var select = !!onSelectRow ? [{
47
+ id: "datatable-select-column",
48
+ header: function header(_ref) {
49
+ var table = _ref.table;
50
+ return !loadingInitial && /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, {
51
+ indeterminate: table.getIsSomeRowsSelected(),
52
+ value: table.getIsAllRowsSelected(),
53
+ onChange: function onChange(e) {
54
+ return table.toggleAllPageRowsSelected(e);
55
+ }
56
+ });
57
+ },
58
+ cell: function cell(info) {
59
+ if (!info.row.getCanSelect()) {
60
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
61
+ }
62
+ return /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, {
63
+ indeterminate: info.row.getIsSomeSelected(),
64
+ value: info.row.getIsSelected(),
65
+ onChange: info.row.getToggleSelectedHandler()
66
+ });
67
+ },
68
+ meta: {
69
+ hasFormControl: true,
70
+ className: "datatable-select-column"
71
+ }
72
+ }] : [];
73
+ return [].concat(select, (0, _toConsumableArray2.default)(defaults)).map(function (column) {
74
+ if (loadingInitial) {
75
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
76
+ cell: function cell() {
77
+ return /*#__PURE__*/_react.default.createElement(_Skeleton.Skeleton, null);
78
+ }
79
+ });
80
+ }
81
+ return column;
82
+ });
83
+ }, [columns, onSelectRow, loadingInitial]);
84
+ };
85
+ var defineData = function defineData(data, loadingInitial) {
86
+ return (0, _react.useMemo)(function () {
87
+ if (loadingInitial) {
88
+ return Array(10).fill({});
89
+ }
90
+ return data;
91
+ }, [data, loadingInitial]);
92
+ };
93
+ var DataTable = function DataTable(_ref2) {
94
+ var data = _ref2.data,
95
+ columns = _ref2.columns,
96
+ onSelectRow = _ref2.onSelectRow,
97
+ loadingInitial = _ref2.loadingInitial,
98
+ stickyColumns = _ref2.stickyColumns,
99
+ stickyRows = _ref2.stickyRows;
100
+ var _React$useState = _react.default.useState({}),
101
+ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
102
+ rowSelection = _React$useState2[0],
103
+ setRowSelection = _React$useState2[1];
104
+ var table = (0, _reactTable.useReactTable)({
105
+ data: defineData(data, loadingInitial),
106
+ columns: defineColumns(columns, onSelectRow, loadingInitial),
107
+ getCoreRowModel: (0, _reactTable.getCoreRowModel)(),
108
+ state: {
109
+ rowSelection: rowSelection
110
+ },
111
+ enableRowSelection: function enableRowSelection(row) {
112
+ return row.original.selectable || false;
113
+ },
114
+ onRowSelectionChange: setRowSelection
115
+ });
116
+ (0, _react.useEffect)(function () {
117
+ if (onSelectRow && typeof onSelectRow === "function") {
118
+ var dataSelected = table.getSelectedRowModel().flatRows.map(function (row) {
119
+ return row.original;
120
+ });
121
+ onSelectRow(dataSelected);
122
+ }
123
+ }, [rowSelection]);
124
+ return /*#__PURE__*/_react.default.createElement(_styled.Table, {
125
+ stickyColumns: stickyColumns,
126
+ stickyRows: stickyRows
127
+ }, /*#__PURE__*/_react.default.createElement(_dataTable.DataTableContent, null, /*#__PURE__*/_react.default.createElement(_dataTable.DataTableHead, null, table.getHeaderGroups().map(function (headerGroup) {
128
+ return /*#__PURE__*/_react.default.createElement(_dataTable.DataTableRow, {
129
+ key: headerGroup.id
130
+ }, headerGroup.headers.map(function (header) {
131
+ return /*#__PURE__*/_react.default.createElement(_dataTable.DataTableHeadCell, Object.assign({
132
+ key: header.id
133
+ }, header.column.columnDef.meta), header.isPlaceholder ? null : (0, _reactTable.flexRender)(header.column.columnDef.header, header.getContext()));
134
+ }));
135
+ })), /*#__PURE__*/_react.default.createElement(_dataTable.DataTableBody, null, table.getRowModel().rows.map(function (row) {
136
+ return /*#__PURE__*/_react.default.createElement(_dataTable.DataTableRow, {
137
+ key: row.id,
138
+ selected: rowSelection.hasOwnProperty(row.index)
139
+ }, row.getVisibleCells().map(function (cell) {
140
+ return /*#__PURE__*/_react.default.createElement(_dataTable.DataTableCell, Object.assign({
141
+ key: cell.id
142
+ }, cell.column.columnDef.meta), (0, _reactTable.flexRender)(cell.column.columnDef.cell, cell.getContext()));
143
+ }));
144
+ }))));
145
+ };
146
+ exports.DataTable = DataTable;