@webiny/ui 5.27.0 → 5.29.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/Accordion/Accordion.js +27 -13
  2. package/Accordion/Accordion.js.map +1 -1
  3. package/Accordion/Accordion.stories.js +34 -23
  4. package/Accordion/Accordion.stories.js.map +1 -1
  5. package/Accordion/AccordionItem.js +60 -36
  6. package/Accordion/AccordionItem.js.map +1 -1
  7. package/Accordion/index.js +31 -2
  8. package/Accordion/index.js.map +1 -1
  9. package/Alert/Alert.js +21 -10
  10. package/Alert/Alert.js.map +1 -1
  11. package/Alert/Alert.stories.js +22 -13
  12. package/Alert/Alert.stories.js.map +1 -1
  13. package/Alert/index.js +18 -1
  14. package/Alert/index.js.map +1 -1
  15. package/AutoComplete/AutoComplete.js +100 -77
  16. package/AutoComplete/AutoComplete.js.map +1 -1
  17. package/AutoComplete/AutoComplete.stories.js +27 -17
  18. package/AutoComplete/AutoComplete.stories.js.map +1 -1
  19. package/AutoComplete/MultiAutoComplete.js +164 -139
  20. package/AutoComplete/MultiAutoComplete.js.map +1 -1
  21. package/AutoComplete/MultiAutoComplete.stories.js +39 -28
  22. package/AutoComplete/MultiAutoComplete.stories.js.map +1 -1
  23. package/AutoComplete/index.js +31 -2
  24. package/AutoComplete/index.js.map +1 -1
  25. package/AutoComplete/styles.js +14 -4
  26. package/AutoComplete/styles.js.map +1 -1
  27. package/AutoComplete/types.js +5 -1
  28. package/AutoComplete/types.js.map +1 -1
  29. package/AutoComplete/utils.js +19 -4
  30. package/AutoComplete/utils.js.map +1 -1
  31. package/Avatar/Avatar.js +30 -15
  32. package/Avatar/Avatar.js.map +1 -1
  33. package/Avatar/Avatar.stories.js +19 -10
  34. package/Avatar/Avatar.stories.js.map +1 -1
  35. package/Avatar/index.js +18 -1
  36. package/Avatar/index.js.map +1 -1
  37. package/Button/Button.js +52 -23
  38. package/Button/Button.js.map +1 -1
  39. package/Button/Button.stories.js +42 -29
  40. package/Button/Button.stories.js.map +1 -1
  41. package/Button/CopyButton/CopyButton.js +24 -11
  42. package/Button/CopyButton/CopyButton.js.map +1 -1
  43. package/Button/CopyButton/CopyButton.stories.js +20 -10
  44. package/Button/CopyButton/CopyButton.stories.js.map +1 -1
  45. package/Button/IconButton/IconButton.js +14 -4
  46. package/Button/IconButton/IconButton.js.map +1 -1
  47. package/Button/IconButton/IconButton.stories.js +31 -19
  48. package/Button/IconButton/IconButton.stories.js.map +1 -1
  49. package/Button/index.js +44 -3
  50. package/Button/index.js.map +1 -1
  51. package/Carousel/Carousel.js +34 -21
  52. package/Carousel/Carousel.js.map +1 -1
  53. package/Carousel/Carouser.stories.js +27 -17
  54. package/Carousel/Carouser.stories.js.map +1 -1
  55. package/Carousel/index.js +15 -1
  56. package/Carousel/index.js.map +1 -1
  57. package/Checkbox/Checkbox.js +37 -22
  58. package/Checkbox/Checkbox.js.map +1 -1
  59. package/Checkbox/Checkbox.stories.js +27 -16
  60. package/Checkbox/Checkbox.stories.js.map +1 -1
  61. package/Checkbox/Checkbox.styles.js +11 -4
  62. package/Checkbox/Checkbox.styles.js.map +1 -1
  63. package/Checkbox/CheckboxGroup.js +36 -21
  64. package/Checkbox/CheckboxGroup.js.map +1 -1
  65. package/Checkbox/CheckboxGroup.stories.js +29 -18
  66. package/Checkbox/CheckboxGroup.stories.js.map +1 -1
  67. package/Checkbox/index.js +23 -2
  68. package/Checkbox/index.js.map +1 -1
  69. package/Chips/Chip.js +21 -7
  70. package/Chips/Chip.js.map +1 -1
  71. package/Chips/ChipIcon.js +21 -7
  72. package/Chips/ChipIcon.js.map +1 -1
  73. package/Chips/Chips.js +29 -12
  74. package/Chips/Chips.js.map +1 -1
  75. package/Chips/Chips.stories.js +27 -16
  76. package/Chips/Chips.stories.js.map +1 -1
  77. package/Chips/index.js +44 -3
  78. package/Chips/index.js.map +1 -1
  79. package/Chips/styles.js +14 -4
  80. package/Chips/styles.js.map +1 -1
  81. package/CodeEditor/CodeEditor.js +48 -29
  82. package/CodeEditor/CodeEditor.js.map +1 -1
  83. package/CodeEditor/CodeEditor.stories.js +30 -17
  84. package/CodeEditor/CodeEditor.stories.js.map +1 -1
  85. package/CodeEditor/index.js +18 -1
  86. package/CodeEditor/index.js.map +1 -1
  87. package/ColorPicker/ColorPicker.js +58 -44
  88. package/ColorPicker/ColorPicker.js.map +1 -1
  89. package/ColorPicker/ColorPicker.stories.js +26 -15
  90. package/ColorPicker/ColorPicker.stories.js.map +1 -1
  91. package/ColorPicker/index.js +18 -1
  92. package/ColorPicker/index.js.map +1 -1
  93. package/ConfirmationDialog/ConfirmationDialog.js +51 -42
  94. package/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
  95. package/ConfirmationDialog/ConfirmationDialog.stories.js +22 -12
  96. package/ConfirmationDialog/ConfirmationDialog.stories.js.map +1 -1
  97. package/ConfirmationDialog/index.js +31 -2
  98. package/ConfirmationDialog/index.js.map +1 -1
  99. package/ConfirmationDialog/withConfirmation.js +19 -6
  100. package/ConfirmationDialog/withConfirmation.js.map +1 -1
  101. package/Dialog/Dialog.js +68 -37
  102. package/Dialog/Dialog.js.map +1 -1
  103. package/Dialog/Dialog.stories.js +26 -16
  104. package/Dialog/Dialog.stories.js.map +1 -1
  105. package/Dialog/index.js +18 -1
  106. package/Dialog/index.js.map +1 -1
  107. package/Drawer/Drawer.js +20 -6
  108. package/Drawer/Drawer.js.map +1 -1
  109. package/Drawer/Drawer.stories.js +26 -15
  110. package/Drawer/Drawer.stories.js.map +1 -1
  111. package/Drawer/index.js +18 -1
  112. package/Drawer/index.js.map +1 -1
  113. package/DynamicFieldset/Fieldset.js +56 -47
  114. package/DynamicFieldset/Fieldset.js.map +1 -1
  115. package/DynamicFieldset/index.js +15 -1
  116. package/DynamicFieldset/index.js.map +1 -1
  117. package/Elevation/Elevation.js +17 -6
  118. package/Elevation/Elevation.js.map +1 -1
  119. package/Elevation/Elevation.stories.js +27 -16
  120. package/Elevation/Elevation.stories.js.map +1 -1
  121. package/Elevation/index.js +18 -1
  122. package/Elevation/index.js.map +1 -1
  123. package/FormElementMessage/FormElementMessage.js +15 -5
  124. package/FormElementMessage/FormElementMessage.js.map +1 -1
  125. package/FormElementMessage/index.js +13 -1
  126. package/FormElementMessage/index.js.map +1 -1
  127. package/FullName/FullName.js +8 -1
  128. package/FullName/FullName.js.map +1 -1
  129. package/FullName/index.js +18 -1
  130. package/FullName/index.js.map +1 -1
  131. package/Grid/Grid.js +26 -9
  132. package/Grid/Grid.js.map +1 -1
  133. package/Grid/Grid.stories.js +21 -12
  134. package/Grid/Grid.stories.js.map +1 -1
  135. package/Grid/index.js +18 -1
  136. package/Grid/index.js.map +1 -1
  137. package/Helpers/ClassNames.js +16 -7
  138. package/Helpers/ClassNames.js.map +1 -1
  139. package/Helpers/index.js +13 -2
  140. package/Helpers/index.js.map +1 -1
  141. package/Icon/Icon.js +19 -7
  142. package/Icon/Icon.js.map +1 -1
  143. package/Icon/Icon.stories.js +33 -20
  144. package/Icon/Icon.stories.js.map +1 -1
  145. package/Icon/index.js +18 -1
  146. package/Icon/index.js.map +1 -1
  147. package/Image/Image.js +15 -7
  148. package/Image/Image.js.map +1 -1
  149. package/Image/Image.stories.js +21 -11
  150. package/Image/Image.stories.js.map +1 -1
  151. package/Image/index.js +18 -1
  152. package/Image/index.js.map +1 -1
  153. package/ImageEditor/ImageEditor.js +75 -65
  154. package/ImageEditor/ImageEditor.js.map +1 -1
  155. package/ImageEditor/index.js +18 -1
  156. package/ImageEditor/index.js.map +1 -1
  157. package/ImageEditor/toolbar/crop.js +30 -13
  158. package/ImageEditor/toolbar/crop.js.map +1 -1
  159. package/ImageEditor/toolbar/filter.js +61 -44
  160. package/ImageEditor/toolbar/filter.js.map +1 -1
  161. package/ImageEditor/toolbar/flip.js +32 -15
  162. package/ImageEditor/toolbar/flip.js.map +1 -1
  163. package/ImageEditor/toolbar/icons/index.js +69 -8
  164. package/ImageEditor/toolbar/icons/index.js.map +1 -1
  165. package/ImageEditor/toolbar/index.js +39 -4
  166. package/ImageEditor/toolbar/index.js.map +1 -1
  167. package/ImageEditor/toolbar/rotate.js +58 -35
  168. package/ImageEditor/toolbar/rotate.js.map +1 -1
  169. package/ImageEditor/toolbar/types.js +5 -1
  170. package/ImageEditor/toolbar/types.js.map +1 -1
  171. package/ImageUpload/Image.js +57 -35
  172. package/ImageUpload/Image.js.map +1 -1
  173. package/ImageUpload/ImageEditorDialog.js +48 -30
  174. package/ImageUpload/ImageEditorDialog.js.map +1 -1
  175. package/ImageUpload/MultiImageUpload.js +88 -70
  176. package/ImageUpload/MultiImageUpload.js.map +1 -1
  177. package/ImageUpload/MultiImageUpload.stories.js +26 -15
  178. package/ImageUpload/MultiImageUpload.stories.js.map +1 -1
  179. package/ImageUpload/SingleImageUpload.js +68 -45
  180. package/ImageUpload/SingleImageUpload.js.map +1 -1
  181. package/ImageUpload/SingleImageUpload.stories.js +27 -16
  182. package/ImageUpload/SingleImageUpload.stories.js.map +1 -1
  183. package/ImageUpload/index.js +39 -4
  184. package/ImageUpload/index.js.map +1 -1
  185. package/ImageUpload/styled.d.ts +2 -2
  186. package/ImageUpload/styled.js +29 -15
  187. package/ImageUpload/styled.js.map +1 -1
  188. package/Input/Input.js +52 -35
  189. package/Input/Input.js.map +1 -1
  190. package/Input/Input.stories.js +62 -46
  191. package/Input/Input.stories.js.map +1 -1
  192. package/Input/__tests__/Input.test.js +37 -26
  193. package/Input/__tests__/Input.test.js.map +1 -1
  194. package/Input/index.js +18 -1
  195. package/Input/index.js.map +1 -1
  196. package/List/CollapsibleList/CollapsibleList.stories.js +27 -16
  197. package/List/CollapsibleList/CollapsibleList.stories.js.map +1 -1
  198. package/List/CollapsibleList/index.js +21 -6
  199. package/List/CollapsibleList/index.js.map +1 -1
  200. package/List/DataList/DataList.js +89 -60
  201. package/List/DataList/DataList.js.map +1 -1
  202. package/List/DataList/DataList.stories.js +37 -25
  203. package/List/DataList/DataList.stories.js.map +1 -1
  204. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js +29 -10
  205. package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -1
  206. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js +27 -9
  207. package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -1
  208. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js +24 -8
  209. package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -1
  210. package/List/DataList/DataListModalOverlay/index.js +35 -3
  211. package/List/DataList/DataListModalOverlay/index.js.map +1 -1
  212. package/List/DataList/Loader.js +25 -13
  213. package/List/DataList/Loader.js.map +1 -1
  214. package/List/DataList/NoData.js +19 -6
  215. package/List/DataList/NoData.js.map +1 -1
  216. package/List/DataList/icons/index.js +83 -38
  217. package/List/DataList/icons/index.js.map +1 -1
  218. package/List/DataList/index.js +48 -3
  219. package/List/DataList/index.js.map +1 -1
  220. package/List/DataList/types.js +5 -1
  221. package/List/DataList/types.js.map +1 -1
  222. package/List/List.js +92 -49
  223. package/List/List.js.map +1 -1
  224. package/List/List.stories.js +52 -37
  225. package/List/List.stories.js.map +1 -1
  226. package/List/icons/index.js +23 -3
  227. package/List/icons/index.js.map +1 -1
  228. package/List/index.js +60 -3
  229. package/List/index.js.map +1 -1
  230. package/Menu/Menu.js +58 -46
  231. package/Menu/Menu.js.map +1 -1
  232. package/Menu/Menu.stories.js +24 -14
  233. package/Menu/Menu.stories.js.map +1 -1
  234. package/Menu/index.js +18 -1
  235. package/Menu/index.js.map +1 -1
  236. package/Mosaic/Mosaic.js +16 -7
  237. package/Mosaic/Mosaic.js.map +1 -1
  238. package/Mosaic/Mosaic.stories.js +37 -28
  239. package/Mosaic/Mosaic.stories.js.map +1 -1
  240. package/Mosaic/index.js +18 -1
  241. package/Mosaic/index.js.map +1 -1
  242. package/Progress/CircularProgress.js +25 -11
  243. package/Progress/CircularProgress.js.map +1 -1
  244. package/Progress/index.js +15 -1
  245. package/Progress/index.js.map +1 -1
  246. package/Radio/Radio.js +37 -22
  247. package/Radio/Radio.js.map +1 -1
  248. package/Radio/Radio.styles.js +11 -4
  249. package/Radio/Radio.styles.js.map +1 -1
  250. package/Radio/RadioGroup.js +33 -19
  251. package/Radio/RadioGroup.js.map +1 -1
  252. package/Radio/RadioGroup.stories.js +29 -18
  253. package/Radio/RadioGroup.stories.js.map +1 -1
  254. package/Radio/index.js +23 -2
  255. package/Radio/index.js.map +1 -1
  256. package/RichTextEditor/RichTextEditor.js +56 -32
  257. package/RichTextEditor/RichTextEditor.js.map +1 -1
  258. package/RichTextEditor/RichTextEditor.stories.js +21 -10
  259. package/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  260. package/RichTextEditor/createPropsFromConfig.js +15 -4
  261. package/RichTextEditor/createPropsFromConfig.js.map +1 -1
  262. package/RichTextEditor/index.js +30 -2
  263. package/RichTextEditor/index.js.map +1 -1
  264. package/Ripple/Ripple.js +16 -5
  265. package/Ripple/Ripple.js.map +1 -1
  266. package/Ripple/Ripple.stories.js +57 -42
  267. package/Ripple/Ripple.stories.js.map +1 -1
  268. package/Ripple/index.js +18 -1
  269. package/Ripple/index.js.map +1 -1
  270. package/Scrollbar/Scrollbar.js +14 -4
  271. package/Scrollbar/Scrollbar.js.map +1 -1
  272. package/Scrollbar/Scrollbar.stories.js +18 -9
  273. package/Scrollbar/Scrollbar.stories.js.map +1 -1
  274. package/Scrollbar/index.js +18 -1
  275. package/Scrollbar/index.js.map +1 -1
  276. package/Section/Section.stories.js +22 -12
  277. package/Section/Section.stories.js.map +1 -1
  278. package/Section/index.js +30 -15
  279. package/Section/index.js.map +1 -1
  280. package/Select/Select.js +37 -18
  281. package/Select/Select.js.map +1 -1
  282. package/Select/Select.stories.js +36 -25
  283. package/Select/Select.stories.js.map +1 -1
  284. package/Select/index.js +18 -1
  285. package/Select/index.js.map +1 -1
  286. package/Slider/Slider.js +43 -27
  287. package/Slider/Slider.js.map +1 -1
  288. package/Slider/Slider.stories.js +27 -16
  289. package/Slider/Slider.stories.js.map +1 -1
  290. package/Slider/index.js +15 -1
  291. package/Slider/index.js.map +1 -1
  292. package/Snackbar/Snackbar.js +38 -20
  293. package/Snackbar/Snackbar.js.map +1 -1
  294. package/Snackbar/Snackbar.stories.js +44 -30
  295. package/Snackbar/Snackbar.stories.js.map +1 -1
  296. package/Snackbar/index.js +19 -1
  297. package/Snackbar/index.js.map +1 -1
  298. package/Switch/Switch.js +43 -27
  299. package/Switch/Switch.js.map +1 -1
  300. package/Switch/Switch.stories.js +27 -16
  301. package/Switch/Switch.stories.js.map +1 -1
  302. package/Switch/index.js +18 -1
  303. package/Switch/index.js.map +1 -1
  304. package/Tabs/Tab.js +21 -7
  305. package/Tabs/Tab.js.map +1 -1
  306. package/Tabs/Tabs.js +49 -28
  307. package/Tabs/Tabs.js.map +1 -1
  308. package/Tabs/Tabs.stories.js +34 -22
  309. package/Tabs/Tabs.stories.js.map +1 -1
  310. package/Tabs/index.js +31 -2
  311. package/Tabs/index.js.map +1 -1
  312. package/Tags/Tags.js +64 -40
  313. package/Tags/Tags.js.map +1 -1
  314. package/Tags/Tags.stories.js +27 -16
  315. package/Tags/Tags.stories.js.map +1 -1
  316. package/Tags/index.js +18 -1
  317. package/Tags/index.js.map +1 -1
  318. package/Tooltip/Tooltip.js +38 -24
  319. package/Tooltip/Tooltip.js.map +1 -1
  320. package/Tooltip/Tooltip.stories.js +20 -11
  321. package/Tooltip/Tooltip.stories.js.map +1 -1
  322. package/Tooltip/index.js +18 -1
  323. package/Tooltip/index.js.map +1 -1
  324. package/TopAppBar/TopAppBar.js +18 -7
  325. package/TopAppBar/TopAppBar.js.map +1 -1
  326. package/TopAppBar/TopAppBar.stories.js +39 -25
  327. package/TopAppBar/TopAppBar.stories.js.map +1 -1
  328. package/TopAppBar/TopAppBarActionItem.js +14 -4
  329. package/TopAppBar/TopAppBarActionItem.js.map +1 -1
  330. package/TopAppBar/TopAppBarNavigationIcon.js +14 -4
  331. package/TopAppBar/TopAppBarNavigationIcon.js.map +1 -1
  332. package/TopAppBar/TopAppBarPrimary.js +18 -7
  333. package/TopAppBar/TopAppBarPrimary.js.map +1 -1
  334. package/TopAppBar/TopAppBarSecondary.js +18 -7
  335. package/TopAppBar/TopAppBarSecondary.js.map +1 -1
  336. package/TopAppBar/TopAppBarSection.js +18 -7
  337. package/TopAppBar/TopAppBarSection.js.map +1 -1
  338. package/TopAppBar/TopAppBarTitle.js +18 -7
  339. package/TopAppBar/TopAppBarTitle.js.map +1 -1
  340. package/TopAppBar/index.js +96 -7
  341. package/TopAppBar/index.js.map +1 -1
  342. package/TopProgressBar/TopProgressBar.js +20 -7
  343. package/TopProgressBar/TopProgressBar.js.map +1 -1
  344. package/TopProgressBar/TopProgressBar.stories.js +22 -12
  345. package/TopProgressBar/TopProgressBar.stories.js.map +1 -1
  346. package/TopProgressBar/hoc/index.js +15 -1
  347. package/TopProgressBar/hoc/index.js.map +1 -1
  348. package/TopProgressBar/hoc/withTopProgressBar.js +16 -5
  349. package/TopProgressBar/hoc/withTopProgressBar.js.map +1 -1
  350. package/TopProgressBar/index.js +18 -1
  351. package/TopProgressBar/index.js.map +1 -1
  352. package/Typography/Typography.js +14 -4
  353. package/Typography/Typography.js.map +1 -1
  354. package/Typography/Typography.stories.js +43 -34
  355. package/Typography/Typography.stories.js.map +1 -1
  356. package/Typography/index.js +18 -1
  357. package/Typography/index.js.map +1 -1
  358. package/package.json +9 -9
  359. package/types.js +5 -1
  360. package/types.js.map +1 -1
@@ -1,30 +1,40 @@
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 "./../Dialog/README.md";
5
- import { withKnobs, boolean } from "@storybook/addon-knobs";
6
- import { Dialog, DialogButton, DialogAccept, DialogCancel, DialogActions, DialogTitle, DialogContent } from ".";
7
- var story = storiesOf("Components/Dialog", module);
8
- story.addDecorator(withKnobs);
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _react2 = require("@storybook/react");
8
+
9
+ var _Story = require("@webiny/storybook-utils/Story");
10
+
11
+ var _README = _interopRequireDefault(require("./../Dialog/README.md"));
12
+
13
+ var _addonKnobs = require("@storybook/addon-knobs");
14
+
15
+ var _ = require(".");
16
+
17
+ var story = (0, _react2.storiesOf)("Components/Dialog", module);
18
+ story.addDecorator(_addonKnobs.withKnobs);
9
19
  story.add("usage", function () {
10
- var open = boolean("Open", false);
11
- return /*#__PURE__*/React.createElement(Story, null, /*#__PURE__*/React.createElement(StoryReadme, null, readme), /*#__PURE__*/React.createElement(StorySandbox, {
20
+ var open = (0, _addonKnobs.boolean)("Open", false);
21
+ return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, {
12
22
  title: "dialog"
13
- }, /*#__PURE__*/React.createElement(StorySandboxExample, {
23
+ }, /*#__PURE__*/_react.default.createElement(_Story.StorySandboxExample, {
14
24
  title: "A list with all possible options"
15
- }, "Toggle ", /*#__PURE__*/React.createElement("code", null, "open"), " prop via the bottom knobs.", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "Note that instead of using ", /*#__PURE__*/React.createElement("code", null, "DialogFooter.Button"), " with", " ", /*#__PURE__*/React.createElement("code", null, "accept"), " or ", /*#__PURE__*/React.createElement("code", null, "cancel"), " prop, you can use a shorter", " ", /*#__PURE__*/React.createElement("code", null, "DialogAccept"), " and ", /*#__PURE__*/React.createElement("code", null, "DialogCancel"), " components respectively.", /*#__PURE__*/React.createElement(Dialog, {
25
+ }, "Toggle ", /*#__PURE__*/_react.default.createElement("code", null, "open"), " prop via the bottom knobs.", /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("br", null), "Note that instead of using ", /*#__PURE__*/_react.default.createElement("code", null, "DialogFooter.Button"), " with", " ", /*#__PURE__*/_react.default.createElement("code", null, "accept"), " or ", /*#__PURE__*/_react.default.createElement("code", null, "cancel"), " prop, you can use a shorter", " ", /*#__PURE__*/_react.default.createElement("code", null, "DialogAccept"), " and ", /*#__PURE__*/_react.default.createElement("code", null, "DialogCancel"), " components respectively.", /*#__PURE__*/_react.default.createElement(_.Dialog, {
16
26
  open: open
17
- }, /*#__PURE__*/React.createElement(DialogTitle, null, "Delete confirmation"), /*#__PURE__*/React.createElement(DialogContent, null, "Are you sure you want to delete?"), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(DialogCancel, {
27
+ }, /*#__PURE__*/_react.default.createElement(_.DialogTitle, null, "Delete confirmation"), /*#__PURE__*/_react.default.createElement(_.DialogContent, null, "Are you sure you want to delete?"), /*#__PURE__*/_react.default.createElement(_.DialogActions, null, /*#__PURE__*/_react.default.createElement(_.DialogCancel, {
18
28
  onClick: function onClick() {
19
29
  return console.log("Cancel");
20
30
  }
21
- }, "Cancel"), /*#__PURE__*/React.createElement(DialogAccept, {
31
+ }, "Cancel"), /*#__PURE__*/_react.default.createElement(_.DialogAccept, {
22
32
  onClick: function onClick() {
23
33
  return console.log("Accept");
24
34
  }
25
- }, "OK")))), /*#__PURE__*/React.createElement(StorySandboxCode, null, "\n <Dialog open={".concat(open, "}>\n <DialogTitle>\n Delete confirmation\n </DialogTitle>\n <DialogBody>Are you sure you want to delete?</DialogBody>\n <DialogFooter>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>Cancel</DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>OK</DialogAccept>\n </DialogFooter>\n </Dialog>\n "))));
35
+ }, "OK")))), /*#__PURE__*/_react.default.createElement(_Story.StorySandboxCode, null, "\n <Dialog open={".concat(open, "}>\n <DialogTitle>\n Delete confirmation\n </DialogTitle>\n <DialogBody>Are you sure you want to delete?</DialogBody>\n <DialogFooter>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>Cancel</DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>OK</DialogAccept>\n </DialogFooter>\n </Dialog>\n "))));
26
36
  }, {
27
37
  info: {
28
- propTables: [Dialog, DialogButton, DialogAccept, DialogCancel, DialogActions, DialogTitle, DialogContent]
38
+ propTables: [_.Dialog, _.DialogButton, _.DialogAccept, _.DialogCancel, _.DialogActions, _.DialogTitle, _.DialogContent]
29
39
  }
30
40
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["Dialog.stories.tsx"],"names":["React","storiesOf","Story","StoryReadme","StorySandboxCode","StorySandbox","StorySandboxExample","readme","withKnobs","boolean","Dialog","DialogButton","DialogAccept","DialogCancel","DialogActions","DialogTitle","DialogContent","story","module","addDecorator","add","open","console","log","info","propTables"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACIC,KADJ,EAEIC,WAFJ,EAGIC,gBAHJ,EAIIC,YAJJ,EAKIC,mBALJ,QAMO,+BANP;AAOA,OAAOC,MAAP;AACA,SAASC,SAAT,EAAoBC,OAApB,QAAmC,wBAAnC;AAEA,SACIC,MADJ,EAEIC,YAFJ,EAGIC,YAHJ,EAIIC,YAJJ,EAKIC,aALJ,EAMIC,WANJ,EAOIC,aAPJ,QAQO,GARP;AAUA,IAAMC,KAAK,GAAGhB,SAAS,CAAC,mBAAD,EAAsBiB,MAAtB,CAAvB;AACAD,KAAK,CAACE,YAAN,CAAmBX,SAAnB;AAEAS,KAAK,CAACG,GAAN,CACI,OADJ,EAEI,YAAM;AACF,MAAMC,IAAI,GAAGZ,OAAO,CAAC,MAAD,EAAS,KAAT,CAApB;AAEA,sBACI,oBAAC,KAAD,qBACI,oBAAC,WAAD,QAAcF,MAAd,CADJ,eAEI,oBAAC,YAAD;AAAc,IAAA,KAAK,EAAE;AAArB,kBACI,oBAAC,mBAAD;AAAqB,IAAA,KAAK,EAAE;AAA5B,6BACW,yCADX,8CAEI,+BAFJ,eAGI,+BAHJ,8CAI+B,wDAJ/B,WAIqE,GAJrE,eAKI,2CALJ,uBAK2B,2CAL3B,kCAK2E,GAL3E,eAMI,iDANJ,wBAMkC,iDANlC,4CAQI,oBAAC,MAAD;AAAQ,IAAA,IAAI,EAAEc;AAAd,kBACI,oBAAC,WAAD,8BADJ,eAEI,oBAAC,aAAD,2CAFJ,eAGI,oBAAC,aAAD,qBACI,oBAAC,YAAD;AAAc,IAAA,OAAO,EAAE;AAAA,aAAMC,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;AAAA;AAAvB,cADJ,eAII,oBAAC,YAAD;AAAc,IAAA,OAAO,EAAE;AAAA,aAAMD,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;AAAA;AAAvB,UAJJ,CAHJ,CARJ,CADJ,eAsBI,oBAAC,gBAAD,sDAEgBF,IAFhB,+iBAtBJ,CAFJ,CADJ;AA0CH,CA/CL,EAgDI;AACIG,EAAAA,IAAI,EAAE;AACFC,IAAAA,UAAU,EAAE,CACRf,MADQ,EAERC,YAFQ,EAGRC,YAHQ,EAIRC,YAJQ,EAKRC,aALQ,EAMRC,WANQ,EAORC,aAPQ;AADV;AADV,CAhDJ","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 \"./../Dialog/README.md\";\nimport { withKnobs, boolean } from \"@storybook/addon-knobs\";\n\nimport {\n Dialog,\n DialogButton,\n DialogAccept,\n DialogCancel,\n DialogActions,\n DialogTitle,\n DialogContent\n} from \".\";\n\nconst story = storiesOf(\"Components/Dialog\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const open = boolean(\"Open\", false);\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"dialog\"}>\n <StorySandboxExample title={\"A list with all possible options\"}>\n Toggle <code>open</code> prop via the bottom knobs.\n <br />\n <br />\n Note that instead of using <code>DialogFooter.Button</code> with{\" \"}\n <code>accept</code> or <code>cancel</code> prop, you can use a shorter{\" \"}\n <code>DialogAccept</code> and <code>DialogCancel</code> components\n respectively.\n <Dialog open={open}>\n <DialogTitle>Delete confirmation</DialogTitle>\n <DialogContent>Are you sure you want to delete?</DialogContent>\n <DialogActions>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>\n Cancel\n </DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>\n OK\n </DialogAccept>\n </DialogActions>\n </Dialog>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <Dialog open={${open}}>\n <DialogTitle>\n Delete confirmation\n </DialogTitle>\n <DialogBody>Are you sure you want to delete?</DialogBody>\n <DialogFooter>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>Cancel</DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>OK</DialogAccept>\n </DialogFooter>\n </Dialog>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n {\n info: {\n propTables: [\n Dialog,\n DialogButton,\n DialogAccept,\n DialogCancel,\n DialogActions,\n DialogTitle,\n DialogContent\n ]\n }\n }\n);\n"]}
1
+ {"version":3,"names":["story","storiesOf","module","addDecorator","withKnobs","add","open","boolean","readme","console","log","info","propTables","Dialog","DialogButton","DialogAccept","DialogCancel","DialogActions","DialogTitle","DialogContent"],"sources":["Dialog.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 \"./../Dialog/README.md\";\nimport { withKnobs, boolean } from \"@storybook/addon-knobs\";\n\nimport {\n Dialog,\n DialogButton,\n DialogAccept,\n DialogCancel,\n DialogActions,\n DialogTitle,\n DialogContent\n} from \".\";\n\nconst story = storiesOf(\"Components/Dialog\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const open = boolean(\"Open\", false);\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"dialog\"}>\n <StorySandboxExample title={\"A list with all possible options\"}>\n Toggle <code>open</code> prop via the bottom knobs.\n <br />\n <br />\n Note that instead of using <code>DialogFooter.Button</code> with{\" \"}\n <code>accept</code> or <code>cancel</code> prop, you can use a shorter{\" \"}\n <code>DialogAccept</code> and <code>DialogCancel</code> components\n respectively.\n <Dialog open={open}>\n <DialogTitle>Delete confirmation</DialogTitle>\n <DialogContent>Are you sure you want to delete?</DialogContent>\n <DialogActions>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>\n Cancel\n </DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>\n OK\n </DialogAccept>\n </DialogActions>\n </Dialog>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <Dialog open={${open}}>\n <DialogTitle>\n Delete confirmation\n </DialogTitle>\n <DialogBody>Are you sure you want to delete?</DialogBody>\n <DialogFooter>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>Cancel</DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>OK</DialogAccept>\n </DialogFooter>\n </Dialog>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n {\n info: {\n propTables: [\n Dialog,\n DialogButton,\n DialogAccept,\n DialogCancel,\n DialogActions,\n DialogTitle,\n DialogContent\n ]\n }\n }\n);\n"],"mappings":";;;;AAAA;;AACA;;AACA;;AAOA;;AACA;;AAEA;;AAUA,IAAMA,KAAK,GAAG,IAAAC,iBAAA,EAAU,mBAAV,EAA+BC,MAA/B,CAAd;AACAF,KAAK,CAACG,YAAN,CAAmBC,qBAAnB;AAEAJ,KAAK,CAACK,GAAN,CACI,OADJ,EAEI,YAAM;EACF,IAAMC,IAAI,GAAG,IAAAC,mBAAA,EAAQ,MAAR,EAAgB,KAAhB,CAAb;EAEA,oBACI,6BAAC,YAAD,qBACI,6BAAC,kBAAD,QAAcC,eAAd,CADJ,eAEI,6BAAC,mBAAD;IAAc,KAAK,EAAE;EAArB,gBACI,6BAAC,0BAAD;IAAqB,KAAK,EAAE;EAA5B,2BACW,kDADX,8CAEI,wCAFJ,eAGI,wCAHJ,8CAI+B,iEAJ/B,WAIqE,GAJrE,eAKI,oDALJ,uBAK2B,oDAL3B,kCAK2E,GAL3E,eAMI,0DANJ,wBAMkC,0DANlC,4CAQI,6BAAC,QAAD;IAAQ,IAAI,EAAEF;EAAd,gBACI,6BAAC,aAAD,8BADJ,eAEI,6BAAC,eAAD,2CAFJ,eAGI,6BAAC,eAAD,qBACI,6BAAC,cAAD;IAAc,OAAO,EAAE;MAAA,OAAMG,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;IAAA;EAAvB,YADJ,eAII,6BAAC,cAAD;IAAc,OAAO,EAAE;MAAA,OAAMD,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;IAAA;EAAvB,QAJJ,CAHJ,CARJ,CADJ,eAsBI,6BAAC,uBAAD,sDAEgBJ,IAFhB,+iBAtBJ,CAFJ,CADJ;AA0CH,CA/CL,EAgDI;EACIK,IAAI,EAAE;IACFC,UAAU,EAAE,CACRC,QADQ,EAERC,cAFQ,EAGRC,cAHQ,EAIRC,cAJQ,EAKRC,eALQ,EAMRC,aANQ,EAORC,eAPQ;EADV;AADV,CAhDJ"}
package/Dialog/index.js CHANGED
@@ -1 +1,18 @@
1
- export * from "./Dialog";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _Dialog = require("./Dialog");
8
+
9
+ Object.keys(_Dialog).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _Dialog[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _Dialog[key];
16
+ }
17
+ });
18
+ });
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./Dialog\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Dialog\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
package/Drawer/Drawer.js CHANGED
@@ -1,25 +1,39 @@
1
- import React from "react";
2
- import { Drawer as RmwcDrawer, DrawerContent as RmwcDrawerContent, DrawerHeader as RmwcDrawerHeader } from "@rmwc/drawer";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.DrawerHeader = exports.DrawerContent = exports.Drawer = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _drawer = require("@rmwc/drawer");
3
13
 
4
14
  /**
5
15
  * Shows header of the drawer.
6
16
  */
7
17
  var DrawerHeader = function DrawerHeader(props) {
8
- return /*#__PURE__*/React.createElement(RmwcDrawerHeader, props);
18
+ return /*#__PURE__*/_react.default.createElement(_drawer.DrawerHeader, props);
9
19
  };
10
20
 
21
+ exports.DrawerHeader = DrawerHeader;
22
+
11
23
  /**
12
24
  * Shows drawer content. It can be anything, but commonly a List component would suffice here.
13
25
  */
14
26
  var DrawerContent = function DrawerContent(props) {
15
- return /*#__PURE__*/React.createElement(RmwcDrawerContent, props);
27
+ return /*#__PURE__*/_react.default.createElement(_drawer.DrawerContent, props);
16
28
  };
17
29
 
30
+ exports.DrawerContent = DrawerContent;
31
+
18
32
  /**
19
33
  * Use Drawer component to display navigation for the whole app or just a small section of it.
20
34
  */
21
35
  var Drawer = function Drawer(props) {
22
- return /*#__PURE__*/React.createElement(RmwcDrawer, props);
36
+ return /*#__PURE__*/_react.default.createElement(_drawer.Drawer, props);
23
37
  };
24
38
 
25
- export { Drawer, DrawerHeader, DrawerContent };
39
+ exports.Drawer = Drawer;
@@ -1 +1 @@
1
- {"version":3,"sources":["Drawer.tsx"],"names":["React","Drawer","RmwcDrawer","DrawerContent","RmwcDrawerContent","DrawerHeader","RmwcDrawerHeader","props"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACIC,MAAM,IAAIC,UADd,EAEIC,aAAa,IAAIC,iBAFrB,EAGIC,YAAY,IAAIC,gBAHpB,QAOO,cAPP;;AAcA;AACA;AACA;AACA,IAAMD,YAAY,GAAG,SAAfA,YAAe,CAACE,KAAD;AAAA,sBAA8B,oBAAC,gBAAD,EAAsBA,KAAtB,CAA9B;AAAA,CAArB;;AAkBA;AACA;AACA;AACA,IAAMJ,aAAa,GAAG,SAAhBA,aAAgB,CAACI,KAAD;AAAA,sBAA+B,oBAAC,iBAAD,EAAuBA,KAAvB,CAA/B;AAAA,CAAtB;;AAiBA;AACA;AACA;AACA,IAAMN,MAAM,GAAG,SAATA,MAAS,CAACM,KAAD,EAAwB;AACnC,sBAAO,oBAAC,UAAD,EAAgBA,KAAhB,CAAP;AACH,CAFD;;AAIA,SAASN,MAAT,EAAiBI,YAAjB,EAA+BF,aAA/B","sourcesContent":["import React from \"react\";\nimport {\n Drawer as RmwcDrawer,\n DrawerContent as RmwcDrawerContent,\n DrawerHeader as RmwcDrawerHeader,\n DrawerProps as RmwcDrawerProps,\n DrawerHeaderProps as RmwcDrawerHeaderProps,\n DrawerContentProps as RmwcDrawerContentProps\n} from \"@rmwc/drawer\";\n\ntype DrawerHeaderProps = RmwcDrawerHeaderProps & {\n children: any;\n className?: string;\n};\n\n/**\n * Shows header of the drawer.\n */\nconst DrawerHeader = (props: DrawerHeaderProps) => <RmwcDrawerHeader {...props} />;\n\nexport type DrawerContentProps = RmwcDrawerContentProps & {\n /**\n * Drawer direction.\n */\n dir?: string;\n /**\n * Drawer content.\n */\n children: React.ReactNode;\n\n /**\n * CSS class name\n */\n className?: string;\n};\n\n/**\n * Shows drawer content. It can be anything, but commonly a List component would suffice here.\n */\nconst DrawerContent = (props: DrawerContentProps) => <RmwcDrawerContent {...props} />;\n\ntype DrawerProps = RmwcDrawerProps & {\n /**\n * Drawer direction.\n */\n dir?: string;\n /**\n * Drawer content.\n */\n children: React.ReactNode;\n\n /**\n * CSS class name\n */\n className?: string;\n};\n/**\n * Use Drawer component to display navigation for the whole app or just a small section of it.\n */\nconst Drawer = (props: DrawerProps) => {\n return <RmwcDrawer {...props} />;\n};\n\nexport { Drawer, DrawerHeader, DrawerContent };\n"]}
1
+ {"version":3,"names":["DrawerHeader","props","DrawerContent","Drawer"],"sources":["Drawer.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Drawer as RmwcDrawer,\n DrawerContent as RmwcDrawerContent,\n DrawerHeader as RmwcDrawerHeader,\n DrawerProps as RmwcDrawerProps,\n DrawerHeaderProps as RmwcDrawerHeaderProps,\n DrawerContentProps as RmwcDrawerContentProps\n} from \"@rmwc/drawer\";\n\ntype DrawerHeaderProps = RmwcDrawerHeaderProps & {\n children: any;\n className?: string;\n};\n\n/**\n * Shows header of the drawer.\n */\nconst DrawerHeader = (props: DrawerHeaderProps) => <RmwcDrawerHeader {...props} />;\n\nexport type DrawerContentProps = RmwcDrawerContentProps & {\n /**\n * Drawer direction.\n */\n dir?: string;\n /**\n * Drawer content.\n */\n children: React.ReactNode;\n\n /**\n * CSS class name\n */\n className?: string;\n};\n\n/**\n * Shows drawer content. It can be anything, but commonly a List component would suffice here.\n */\nconst DrawerContent = (props: DrawerContentProps) => <RmwcDrawerContent {...props} />;\n\ntype DrawerProps = RmwcDrawerProps & {\n /**\n * Drawer direction.\n */\n dir?: string;\n /**\n * Drawer content.\n */\n children: React.ReactNode;\n\n /**\n * CSS class name\n */\n className?: string;\n};\n/**\n * Use Drawer component to display navigation for the whole app or just a small section of it.\n */\nconst Drawer = (props: DrawerProps) => {\n return <RmwcDrawer {...props} />;\n};\n\nexport { Drawer, DrawerHeader, DrawerContent };\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAcA;AACA;AACA;AACA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD;EAAA,oBAA8B,6BAAC,oBAAD,EAAsBA,KAAtB,CAA9B;AAAA,CAArB;;;;AAkBA;AACA;AACA;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACD,KAAD;EAAA,oBAA+B,6BAAC,qBAAD,EAAuBA,KAAvB,CAA/B;AAAA,CAAtB;;;;AAiBA;AACA;AACA;AACA,IAAME,MAAM,GAAG,SAATA,MAAS,CAACF,KAAD,EAAwB;EACnC,oBAAO,6BAAC,cAAD,EAAgBA,KAAhB,CAAP;AACH,CAFD"}
@@ -1,23 +1,34 @@
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 { List, ListItem } from "./../List";
5
- import readme from "./../Drawer/README.md";
6
- import { withKnobs, boolean } from "@storybook/addon-knobs";
7
- import { Drawer, DrawerHeader, DrawerContent } from "./Drawer";
8
- var story = storiesOf("Components/Drawer", module);
9
- story.addDecorator(withKnobs);
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _react2 = require("@storybook/react");
8
+
9
+ var _Story = require("@webiny/storybook-utils/Story");
10
+
11
+ var _List = require("./../List");
12
+
13
+ var _README = _interopRequireDefault(require("./../Drawer/README.md"));
14
+
15
+ var _addonKnobs = require("@storybook/addon-knobs");
16
+
17
+ var _Drawer = require("./Drawer");
18
+
19
+ var story = (0, _react2.storiesOf)("Components/Drawer", module);
20
+ story.addDecorator(_addonKnobs.withKnobs);
10
21
  story.add("usage", function () {
11
- var open = boolean("Open", true);
12
- return /*#__PURE__*/React.createElement(Story, null, /*#__PURE__*/React.createElement(StoryReadme, null, readme), /*#__PURE__*/React.createElement(StorySandbox, {
22
+ var open = (0, _addonKnobs.boolean)("Open", true);
23
+ return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, {
13
24
  title: "drawer"
14
- }, /*#__PURE__*/React.createElement(StorySandboxExample, {
25
+ }, /*#__PURE__*/_react.default.createElement(_Story.StorySandboxExample, {
15
26
  title: "A list with all possible options"
16
- }, /*#__PURE__*/React.createElement(Drawer, {
27
+ }, /*#__PURE__*/_react.default.createElement(_Drawer.Drawer, {
17
28
  open: open
18
- }, /*#__PURE__*/React.createElement(DrawerHeader, null, "Main Menu"), /*#__PURE__*/React.createElement(DrawerContent, null, /*#__PURE__*/React.createElement(List, null, /*#__PURE__*/React.createElement(ListItem, null, "Users"), /*#__PURE__*/React.createElement(ListItem, null, "Companies"), /*#__PURE__*/React.createElement(ListItem, null, "Brands"), /*#__PURE__*/React.createElement(ListItem, null, "ACL"), /*#__PURE__*/React.createElement(ListItem, null, "Settings"))))), /*#__PURE__*/React.createElement(StorySandboxCode, null, "\n <Drawer>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n ")));
29
+ }, /*#__PURE__*/_react.default.createElement(_Drawer.DrawerHeader, null, "Main Menu"), /*#__PURE__*/_react.default.createElement(_Drawer.DrawerContent, null, /*#__PURE__*/_react.default.createElement(_List.List, null, /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Users"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Companies"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Brands"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "ACL"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Settings"))))), /*#__PURE__*/_react.default.createElement(_Story.StorySandboxCode, null, "\n <Drawer>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n ")));
19
30
  }, {
20
31
  info: {
21
- propTables: [Drawer, DrawerHeader, DrawerContent]
32
+ propTables: [_Drawer.Drawer, _Drawer.DrawerHeader, _Drawer.DrawerContent]
22
33
  }
23
34
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["Drawer.stories.tsx"],"names":["React","storiesOf","Story","StoryReadme","StorySandboxCode","StorySandbox","StorySandboxExample","List","ListItem","readme","withKnobs","boolean","Drawer","DrawerHeader","DrawerContent","story","module","addDecorator","add","open","info","propTables"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACIC,KADJ,EAEIC,WAFJ,EAGIC,gBAHJ,EAIIC,YAJJ,EAKIC,mBALJ,QAMO,+BANP;AAOA,SAASC,IAAT,EAAeC,QAAf;AAEA,OAAOC,MAAP;AACA,SAASC,SAAT,EAAoBC,OAApB,QAAmC,wBAAnC;AACA,SAASC,MAAT,EAAiBC,YAAjB,EAA+BC,aAA/B;AAEA,IAAMC,KAAK,GAAGd,SAAS,CAAC,mBAAD,EAAsBe,MAAtB,CAAvB;AACAD,KAAK,CAACE,YAAN,CAAmBP,SAAnB;AAEAK,KAAK,CAACG,GAAN,CACI,OADJ,EAEI,YAAM;AACF,MAAMC,IAAI,GAAGR,OAAO,CAAC,MAAD,EAAS,IAAT,CAApB;AAEA,sBACI,oBAAC,KAAD,qBACI,oBAAC,WAAD,QAAcF,MAAd,CADJ,eAEI,oBAAC,YAAD;AAAc,IAAA,KAAK,EAAE;AAArB,kBACI,oBAAC,mBAAD;AAAqB,IAAA,KAAK,EAAE;AAA5B,kBACI,oBAAC,MAAD;AAAQ,IAAA,IAAI,EAAEU;AAAd,kBACI,oBAAC,YAAD,oBADJ,eAEI,oBAAC,aAAD,qBACI,oBAAC,IAAD,qBACI,oBAAC,QAAD,gBADJ,eAEI,oBAAC,QAAD,oBAFJ,eAGI,oBAAC,QAAD,iBAHJ,eAII,oBAAC,QAAD,cAJJ,eAKI,oBAAC,QAAD,mBALJ,CADJ,CAFJ,CADJ,CADJ,eAeI,oBAAC,gBAAD,4mBAfJ,CAFJ,CADJ;AAqCH,CA1CL,EA2CI;AAAEC,EAAAA,IAAI,EAAE;AAAEC,IAAAA,UAAU,EAAE,CAACT,MAAD,EAASC,YAAT,EAAuBC,aAAvB;AAAd;AAAR,CA3CJ","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 { List, ListItem } from \"./../List\";\n\nimport readme from \"./../Drawer/README.md\";\nimport { withKnobs, boolean } from \"@storybook/addon-knobs\";\nimport { Drawer, DrawerHeader, DrawerContent } from \"./Drawer\";\n\nconst story = storiesOf(\"Components/Drawer\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const open = boolean(\"Open\", true);\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"drawer\"}>\n <StorySandboxExample title={\"A list with all possible options\"}>\n <Drawer open={open}>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <Drawer>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Drawer, DrawerHeader, DrawerContent] } }\n);\n"]}
1
+ {"version":3,"names":["story","storiesOf","module","addDecorator","withKnobs","add","open","boolean","readme","info","propTables","Drawer","DrawerHeader","DrawerContent"],"sources":["Drawer.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 { List, ListItem } from \"./../List\";\n\nimport readme from \"./../Drawer/README.md\";\nimport { withKnobs, boolean } from \"@storybook/addon-knobs\";\nimport { Drawer, DrawerHeader, DrawerContent } from \"./Drawer\";\n\nconst story = storiesOf(\"Components/Drawer\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const open = boolean(\"Open\", true);\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"drawer\"}>\n <StorySandboxExample title={\"A list with all possible options\"}>\n <Drawer open={open}>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <Drawer>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Drawer, DrawerHeader, DrawerContent] } }\n);\n"],"mappings":";;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;AACA;;AAEA,IAAMA,KAAK,GAAG,IAAAC,iBAAA,EAAU,mBAAV,EAA+BC,MAA/B,CAAd;AACAF,KAAK,CAACG,YAAN,CAAmBC,qBAAnB;AAEAJ,KAAK,CAACK,GAAN,CACI,OADJ,EAEI,YAAM;EACF,IAAMC,IAAI,GAAG,IAAAC,mBAAA,EAAQ,MAAR,EAAgB,IAAhB,CAAb;EAEA,oBACI,6BAAC,YAAD,qBACI,6BAAC,kBAAD,QAAcC,eAAd,CADJ,eAEI,6BAAC,mBAAD;IAAc,KAAK,EAAE;EAArB,gBACI,6BAAC,0BAAD;IAAqB,KAAK,EAAE;EAA5B,gBACI,6BAAC,cAAD;IAAQ,IAAI,EAAEF;EAAd,gBACI,6BAAC,oBAAD,oBADJ,eAEI,6BAAC,qBAAD,qBACI,6BAAC,UAAD,qBACI,6BAAC,cAAD,gBADJ,eAEI,6BAAC,cAAD,oBAFJ,eAGI,6BAAC,cAAD,iBAHJ,eAII,6BAAC,cAAD,cAJJ,eAKI,6BAAC,cAAD,mBALJ,CADJ,CAFJ,CADJ,CADJ,eAeI,6BAAC,uBAAD,4mBAfJ,CAFJ,CADJ;AAqCH,CA1CL,EA2CI;EAAEG,IAAI,EAAE;IAAEC,UAAU,EAAE,CAACC,cAAD,EAASC,oBAAT,EAAuBC,qBAAvB;EAAd;AAAR,CA3CJ"}
package/Drawer/index.js CHANGED
@@ -1 +1,18 @@
1
- export * from "./Drawer";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _Drawer = require("./Drawer");
8
+
9
+ Object.keys(_Drawer).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _Drawer[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _Drawer[key];
16
+ }
17
+ });
18
+ });
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./Drawer\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Drawer\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1,15 +1,35 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
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 React from "react";
9
- import dotProp from "dot-prop-immutable";
10
- import { FormElementMessage } from "../FormElementMessage";
11
- import styled from "@emotion/styled";
12
- var DynamicFieldsetRow = /*#__PURE__*/styled("div", {
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+
16
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
+
18
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
+
20
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
21
+
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _react = _interopRequireDefault(require("react"));
25
+
26
+ var _dotPropImmutable = _interopRequireDefault(require("dot-prop-immutable"));
27
+
28
+ var _FormElementMessage = require("../FormElementMessage");
29
+
30
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
31
+
32
+ var DynamicFieldsetRow = /*#__PURE__*/(0, _styled.default)("div", {
13
33
  target: "eqcnudi0",
14
34
  label: "DynamicFieldsetRow"
15
35
  })({
@@ -20,28 +40,24 @@ var DynamicFieldsetRow = /*#__PURE__*/styled("div", {
20
40
  });
21
41
 
22
42
  var Fieldset = /*#__PURE__*/function (_React$Component) {
23
- _inherits(Fieldset, _React$Component);
43
+ (0, _inherits2.default)(Fieldset, _React$Component);
24
44
 
25
- var _super = _createSuper(Fieldset);
45
+ var _super = (0, _createSuper2.default)(Fieldset);
26
46
 
27
47
  function Fieldset() {
28
48
  var _this;
29
49
 
30
- _classCallCheck(this, Fieldset);
50
+ (0, _classCallCheck2.default)(this, Fieldset);
31
51
 
32
52
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
53
  args[_key] = arguments[_key];
34
54
  }
35
55
 
36
56
  _this = _super.call.apply(_super, [this].concat(args));
37
-
38
- _defineProperty(_assertThisInitialized(_this), "header", null);
39
-
40
- _defineProperty(_assertThisInitialized(_this), "rows", null);
41
-
42
- _defineProperty(_assertThisInitialized(_this), "empty", null);
43
-
44
- _defineProperty(_assertThisInitialized(_this), "actions", {
57
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "header", null);
58
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "rows", null);
59
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "empty", null);
60
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "actions", {
45
61
  add: function add() {
46
62
  var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
47
63
  return function () {
@@ -55,15 +71,13 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
55
71
  };
56
72
  }
57
73
  });
58
-
59
- _defineProperty(_assertThisInitialized(_this), "removeData", function (index) {
74
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "removeData", function (index) {
60
75
  var _this$props = _this.props,
61
76
  value = _this$props.value,
62
77
  onChange = _this$props.onChange;
63
- onChange(dotProp.delete(value, index));
78
+ onChange(_dotPropImmutable.default.delete(value, index));
64
79
  });
65
-
66
- _defineProperty(_assertThisInitialized(_this), "addData", function () {
80
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "addData", function () {
67
81
  var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
68
82
  var onChange = _this.props.onChange;
69
83
  var value = _this.props.value;
@@ -73,18 +87,16 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
73
87
  }
74
88
 
75
89
  if (index < 0) {
76
- onChange([].concat(_toConsumableArray(value), [{}]));
90
+ onChange([].concat((0, _toConsumableArray2.default)(value), [{}]));
77
91
  } else {
78
- onChange([].concat(_toConsumableArray(value.slice(0, index + 1)), [{}], _toConsumableArray(value.slice(index + 1))));
92
+ onChange([].concat((0, _toConsumableArray2.default)(value.slice(0, index + 1)), [{}], (0, _toConsumableArray2.default)(value.slice(index + 1))));
79
93
  }
80
94
  });
81
-
82
- _defineProperty(_assertThisInitialized(_this), "renderHeader", function (cb) {
95
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderHeader", function (cb) {
83
96
  _this.header = cb();
84
97
  return null;
85
98
  });
86
-
87
- _defineProperty(_assertThisInitialized(_this), "renderRow", function (cb) {
99
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderRow", function (cb) {
88
100
  var value = _this.props.value;
89
101
 
90
102
  if (!value) {
@@ -92,7 +104,7 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
92
104
  }
93
105
 
94
106
  _this.rows = value.map(function (record, index) {
95
- return /*#__PURE__*/React.createElement(DynamicFieldsetRow, {
107
+ return /*#__PURE__*/_react.default.createElement(DynamicFieldsetRow, {
96
108
  key: index
97
109
  }, cb({
98
110
  data: record,
@@ -101,16 +113,14 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
101
113
  });
102
114
  return null;
103
115
  });
104
-
105
- _defineProperty(_assertThisInitialized(_this), "renderEmpty", function (cb) {
116
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderEmpty", function (cb) {
106
117
  _this.empty = cb();
107
118
  return null;
108
119
  });
109
-
110
120
  return _this;
111
121
  }
112
122
 
113
- _createClass(Fieldset, [{
123
+ (0, _createClass2.default)(Fieldset, [{
114
124
  key: "renderComponent",
115
125
  value: function renderComponent() {
116
126
  var value = this.props.value;
@@ -126,7 +136,7 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
126
136
  return this.empty;
127
137
  }
128
138
 
129
- return /*#__PURE__*/React.createElement(React.Fragment, null, this.header, this.rows);
139
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.header, this.rows);
130
140
  }
131
141
  }, {
132
142
  key: "render",
@@ -137,17 +147,16 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
137
147
  validation = _this$props2$validati === void 0 ? {
138
148
  isValid: null
139
149
  } : _this$props2$validati;
140
- return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderComponent(), validation.isValid === false && /*#__PURE__*/React.createElement(FormElementMessage, {
150
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderComponent(), validation.isValid === false && /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, {
141
151
  error: true
142
- }, validation.message), validation.isValid !== false && description && /*#__PURE__*/React.createElement(FormElementMessage, null, description));
152
+ }, validation.message), validation.isValid !== false && description && /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, null, description));
143
153
  }
144
154
  }]);
145
-
146
155
  return Fieldset;
147
- }(React.Component);
156
+ }(_react.default.Component);
148
157
 
149
- _defineProperty(Fieldset, "defaultProps", {
158
+ (0, _defineProperty2.default)(Fieldset, "defaultProps", {
150
159
  value: []
151
160
  });
152
-
153
- export default Fieldset;
161
+ var _default = Fieldset;
162
+ exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["Fieldset.tsx"],"names":["React","dotProp","FormElementMessage","styled","DynamicFieldsetRow","paddingBottom","padding","Fieldset","add","index","addData","remove","removeData","props","value","onChange","delete","slice","cb","header","rows","map","record","data","empty","children","actions","renderHeader","row","renderRow","renderEmpty","length","description","validation","isValid","renderComponent","message","Component"],"mappings":"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","sourcesContent":["import React from \"react\";\nimport dotProp from \"dot-prop-immutable\";\nimport { FormElementMessage } from \"~/FormElementMessage\";\nimport styled from \"@emotion/styled\";\n\ninterface ChildrenRenderPropRowCallableParams {\n index: number;\n data: any;\n}\ninterface ChildrenRenderPropRowCallable {\n (params: ChildrenRenderPropRowCallableParams): React.ReactNode;\n}\n\ninterface ChildrenRenderPropHeaderCallable {\n (): React.ReactNode;\n}\ninterface ChildrenRenderPropEmptyCallable {\n (): React.ReactNode;\n}\ninterface ChildrenRenderProp {\n actions: {\n add: Function;\n remove: Function;\n };\n header: (cb: ChildrenRenderPropHeaderCallable) => React.ReactNode;\n row: (cb: ChildrenRenderPropRowCallable) => React.ReactNode;\n empty: (cb: ChildrenRenderPropEmptyCallable) => React.ReactNode;\n}\n\ninterface FieldsetProps {\n value?: any[];\n description?: string;\n validation?: { isValid: null | boolean; message?: string };\n onChange: Function;\n children: (props: ChildrenRenderProp) => React.ReactNode;\n}\n\nconst DynamicFieldsetRow = styled(\"div\")({\n paddingBottom: 10,\n \"> .mdc-layout-grid\": {\n padding: 0\n }\n});\n\nclass Fieldset extends React.Component<FieldsetProps> {\n static defaultProps: Partial<FieldsetProps> = {\n value: []\n };\n\n header: React.ReactNode = null;\n rows: React.ReactNode = null;\n empty: React.ReactNode = null;\n\n actions = {\n add:\n (index = -1) =>\n () =>\n this.addData(index),\n remove:\n (index = -1) =>\n () =>\n this.removeData(index)\n };\n\n removeData = (index: number) => {\n const { value, onChange } = this.props;\n onChange(dotProp.delete(value, index));\n };\n\n addData = (index = -1) => {\n const { onChange } = this.props;\n let value = this.props.value;\n if (!value) {\n value = [];\n }\n if (index < 0) {\n onChange([...value, {}]);\n } else {\n onChange([...value.slice(0, index + 1), {}, ...value.slice(index + 1)]);\n }\n };\n\n renderHeader = (cb: () => React.ReactNode): React.ReactNode => {\n this.header = cb();\n return null;\n };\n\n renderRow = (cb: ChildrenRenderPropRowCallable): React.ReactNode => {\n const { value } = this.props;\n if (!value) {\n return null;\n }\n this.rows = value.map((record, index) => {\n return (\n <DynamicFieldsetRow key={index}>{cb({ data: record, index })}</DynamicFieldsetRow>\n );\n });\n return null;\n };\n\n renderEmpty = (cb: () => React.ReactNode): React.ReactNode => {\n this.empty = cb();\n return null;\n };\n\n public renderComponent(): React.ReactNode {\n const { value } = this.props;\n const { children } = this.props;\n\n children({\n actions: this.actions,\n header: this.renderHeader,\n row: this.renderRow,\n empty: this.renderEmpty\n });\n\n if (!value || value.length === 0) {\n return this.empty;\n }\n\n return (\n <React.Fragment>\n {this.header}\n {this.rows}\n </React.Fragment>\n );\n }\n\n public override render() {\n const { description, validation = { isValid: null } } = this.props;\n\n return (\n <>\n {this.renderComponent()}\n {validation.isValid === false && (\n <FormElementMessage error>{validation.message}</FormElementMessage>\n )}\n\n {validation.isValid !== false && description && (\n <FormElementMessage>{description}</FormElementMessage>\n )}\n </>\n );\n }\n}\n\nexport default Fieldset;\n"]}
1
+ {"version":3,"names":["DynamicFieldsetRow","styled","paddingBottom","padding","Fieldset","add","index","addData","remove","removeData","props","value","onChange","dotProp","delete","slice","cb","header","rows","map","record","data","empty","children","actions","renderHeader","row","renderRow","renderEmpty","length","description","validation","isValid","renderComponent","message","React","Component"],"sources":["Fieldset.tsx"],"sourcesContent":["import React from \"react\";\nimport dotProp from \"dot-prop-immutable\";\nimport { FormElementMessage } from \"~/FormElementMessage\";\nimport styled from \"@emotion/styled\";\n\ninterface ChildrenRenderPropRowCallableParams {\n index: number;\n data: any;\n}\ninterface ChildrenRenderPropRowCallable {\n (params: ChildrenRenderPropRowCallableParams): React.ReactNode;\n}\n\ninterface ChildrenRenderPropHeaderCallable {\n (): React.ReactNode;\n}\ninterface ChildrenRenderPropEmptyCallable {\n (): React.ReactNode;\n}\ninterface ChildrenRenderProp {\n actions: {\n add: Function;\n remove: Function;\n };\n header: (cb: ChildrenRenderPropHeaderCallable) => React.ReactNode;\n row: (cb: ChildrenRenderPropRowCallable) => React.ReactNode;\n empty: (cb: ChildrenRenderPropEmptyCallable) => React.ReactNode;\n}\n\ninterface FieldsetProps {\n value?: any[];\n description?: string;\n validation?: { isValid: null | boolean; message?: string };\n onChange: Function;\n children: (props: ChildrenRenderProp) => React.ReactNode;\n}\n\nconst DynamicFieldsetRow = styled(\"div\")({\n paddingBottom: 10,\n \"> .mdc-layout-grid\": {\n padding: 0\n }\n});\n\nclass Fieldset extends React.Component<FieldsetProps> {\n static defaultProps: Partial<FieldsetProps> = {\n value: []\n };\n\n header: React.ReactNode = null;\n rows: React.ReactNode = null;\n empty: React.ReactNode = null;\n\n actions = {\n add:\n (index = -1) =>\n () =>\n this.addData(index),\n remove:\n (index = -1) =>\n () =>\n this.removeData(index)\n };\n\n removeData = (index: number) => {\n const { value, onChange } = this.props;\n onChange(dotProp.delete(value, index));\n };\n\n addData = (index = -1) => {\n const { onChange } = this.props;\n let value = this.props.value;\n if (!value) {\n value = [];\n }\n if (index < 0) {\n onChange([...value, {}]);\n } else {\n onChange([...value.slice(0, index + 1), {}, ...value.slice(index + 1)]);\n }\n };\n\n renderHeader = (cb: () => React.ReactNode): React.ReactNode => {\n this.header = cb();\n return null;\n };\n\n renderRow = (cb: ChildrenRenderPropRowCallable): React.ReactNode => {\n const { value } = this.props;\n if (!value) {\n return null;\n }\n this.rows = value.map((record, index) => {\n return (\n <DynamicFieldsetRow key={index}>{cb({ data: record, index })}</DynamicFieldsetRow>\n );\n });\n return null;\n };\n\n renderEmpty = (cb: () => React.ReactNode): React.ReactNode => {\n this.empty = cb();\n return null;\n };\n\n public renderComponent(): React.ReactNode {\n const { value } = this.props;\n const { children } = this.props;\n\n children({\n actions: this.actions,\n header: this.renderHeader,\n row: this.renderRow,\n empty: this.renderEmpty\n });\n\n if (!value || value.length === 0) {\n return this.empty;\n }\n\n return (\n <React.Fragment>\n {this.header}\n {this.rows}\n </React.Fragment>\n );\n }\n\n public override render() {\n const { description, validation = { isValid: null } } = this.props;\n\n return (\n <>\n {this.renderComponent()}\n {validation.isValid === false && (\n <FormElementMessage error>{validation.message}</FormElementMessage>\n )}\n\n {validation.isValid !== false && description && (\n <FormElementMessage>{description}</FormElementMessage>\n )}\n </>\n );\n }\n}\n\nexport default Fieldset;\n"],"mappings":"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"}
@@ -1 +1,15 @@
1
- export { default as DynamicFieldset } from "./Fieldset";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "DynamicFieldset", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _Fieldset.default;
12
+ }
13
+ });
14
+
15
+ var _Fieldset = _interopRequireDefault(require("./Fieldset"));
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["default","DynamicFieldset"],"mappings":"AAAA,SAASA,OAAO,IAAIC,eAApB","sourcesContent":["export { default as DynamicFieldset } from \"./Fieldset\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as DynamicFieldset } from \"./Fieldset\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
@@ -1,13 +1,24 @@
1
- import React from "react";
2
- import { Elevation as RmwcElevation } from "@rmwc/elevation";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Elevation = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _elevation = require("@rmwc/elevation");
3
13
 
4
14
  /**
5
15
  * Elevation component visually raises any content by applying shadow.
6
16
  */
7
- var Elevation = /*#__PURE__*/React.forwardRef(function (props, ref) {
8
- return /*#__PURE__*/React.createElement(RmwcElevation, Object.assign({
17
+ var Elevation = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
18
+ return /*#__PURE__*/_react.default.createElement(_elevation.Elevation, Object.assign({
9
19
  ref: ref
10
20
  }, props), props.children);
11
21
  });
12
- Elevation.displayName = "Elevation";
13
- export { Elevation };
22
+
23
+ exports.Elevation = Elevation;
24
+ Elevation.displayName = "Elevation";
@@ -1 +1 @@
1
- {"version":3,"sources":["Elevation.tsx"],"names":["React","Elevation","RmwcElevation","forwardRef","props","ref","children","displayName"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAS,IAAIC,aAAtB,QAA2C,iBAA3C;;AAmBA;AACA;AACA;AACA,IAAMD,SAAS,gBAAGD,KAAK,CAACG,UAAN,CAAiB,UAACC,KAAD,EAAwBC,GAAxB,EAAgD;AAC/E,sBACI,oBAAC,aAAD;AAAe,IAAA,GAAG,EAAEA;AAApB,KAA6BD,KAA7B,GACKA,KAAK,CAACE,QADX,CADJ;AAKH,CANiB,CAAlB;AAQAL,SAAS,CAACM,WAAV,GAAwB,WAAxB;AAEA,SAASN,SAAT","sourcesContent":["import React from \"react\";\nimport { Elevation as RmwcElevation } from \"@rmwc/elevation\";\n\nexport type ElevationProps = {\n // Any element that needs to be highlighted.\n children?: React.ReactNode;\n\n // Increasing this number (from 0 to 24) will increase the amount of shadow applied.\n z: number;\n\n // Adds smooth transitions when the z value changes.\n transition?: boolean;\n\n // CSS class name\n className?: string;\n\n // Style object\n style?: React.CSSProperties;\n};\n\n/**\n * Elevation component visually raises any content by applying shadow.\n */\nconst Elevation = React.forwardRef((props: ElevationProps, ref: React.Ref<any>) => {\n return (\n <RmwcElevation ref={ref} {...props}>\n {props.children}\n </RmwcElevation>\n );\n});\n\nElevation.displayName = \"Elevation\";\n\nexport { Elevation };\n"]}
1
+ {"version":3,"names":["Elevation","React","forwardRef","props","ref","children","displayName"],"sources":["Elevation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Elevation as RmwcElevation } from \"@rmwc/elevation\";\n\nexport type ElevationProps = {\n // Any element that needs to be highlighted.\n children?: React.ReactNode;\n\n // Increasing this number (from 0 to 24) will increase the amount of shadow applied.\n z: number;\n\n // Adds smooth transitions when the z value changes.\n transition?: boolean;\n\n // CSS class name\n className?: string;\n\n // Style object\n style?: React.CSSProperties;\n};\n\n/**\n * Elevation component visually raises any content by applying shadow.\n */\nconst Elevation = React.forwardRef((props: ElevationProps, ref: React.Ref<any>) => {\n return (\n <RmwcElevation ref={ref} {...props}>\n {props.children}\n </RmwcElevation>\n );\n});\n\nElevation.displayName = \"Elevation\";\n\nexport { Elevation };\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAmBA;AACA;AACA;AACA,IAAMA,SAAS,gBAAGC,cAAA,CAAMC,UAAN,CAAiB,UAACC,KAAD,EAAwBC,GAAxB,EAAgD;EAC/E,oBACI,6BAAC,oBAAD;IAAe,GAAG,EAAEA;EAApB,GAA6BD,KAA7B,GACKA,KAAK,CAACE,QADX,CADJ;AAKH,CANiB,CAAlB;;;AAQAL,SAAS,CAACM,WAAV,GAAwB,WAAxB"}