@webiny/ui 5.24.0-beta.0 → 5.25.0-beta.1
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.
- package/Accordion/Accordion.d.ts +1 -1
- package/Accordion/Accordion.js +1 -1
- package/Accordion/Accordion.js.map +1 -0
- package/Accordion/Accordion.stories.js.map +1 -0
- package/Accordion/AccordionItem.d.ts +4 -8
- package/Accordion/AccordionItem.js +1 -1
- package/Accordion/AccordionItem.js.map +1 -0
- package/Accordion/index.js.map +1 -0
- package/Alert/Alert.d.ts +4 -4
- package/Alert/Alert.js +1 -1
- package/Alert/Alert.js.map +1 -0
- package/Alert/Alert.stories.js.map +1 -0
- package/Alert/index.js.map +1 -0
- package/AutoComplete/AutoComplete.d.ts +5 -10
- package/AutoComplete/AutoComplete.js +6 -4
- package/AutoComplete/AutoComplete.js.map +1 -0
- package/AutoComplete/AutoComplete.stories.js.map +1 -0
- package/AutoComplete/MultiAutoComplete.d.ts +4 -11
- package/AutoComplete/MultiAutoComplete.js +9 -5
- package/AutoComplete/MultiAutoComplete.js.map +1 -0
- package/AutoComplete/MultiAutoComplete.stories.js.map +1 -0
- package/AutoComplete/index.js.map +1 -0
- package/AutoComplete/styles.js.map +1 -0
- package/AutoComplete/types.d.ts +4 -3
- package/AutoComplete/types.js.map +1 -0
- package/AutoComplete/utils.d.ts +3 -3
- package/AutoComplete/utils.js +1 -1
- package/AutoComplete/utils.js.map +1 -0
- package/Avatar/Avatar.d.ts +5 -11
- package/Avatar/Avatar.js +12 -7
- package/Avatar/Avatar.js.map +1 -0
- package/Avatar/Avatar.stories.js.map +1 -0
- package/Avatar/index.js.map +1 -0
- package/Button/Button.d.ts +1 -16
- package/Button/Button.js +7 -22
- package/Button/Button.js.map +1 -0
- package/Button/Button.stories.js.map +1 -0
- package/Button/CopyButton/CopyButton.d.ts +4 -7
- package/Button/CopyButton/CopyButton.js +1 -4
- package/Button/CopyButton/CopyButton.js.map +1 -0
- package/Button/CopyButton/CopyButton.stories.js.map +1 -0
- package/Button/IconButton/IconButton.d.ts +4 -7
- package/Button/IconButton/IconButton.js +1 -4
- package/Button/IconButton/IconButton.js.map +1 -0
- package/Button/IconButton/IconButton.stories.js.map +1 -0
- package/Button/index.js.map +1 -0
- package/Carousel/Carousel.d.ts +3 -3
- package/Carousel/Carousel.js +1 -1
- package/Carousel/Carousel.js.map +1 -0
- package/Carousel/Carouser.stories.js.map +1 -0
- package/Carousel/index.js.map +1 -0
- package/Checkbox/Checkbox.d.ts +1 -2
- package/Checkbox/Checkbox.js +8 -10
- package/Checkbox/Checkbox.js.map +1 -0
- package/Checkbox/Checkbox.stories.js.map +1 -0
- package/Checkbox/Checkbox.styles.js.map +1 -0
- package/Checkbox/CheckboxGroup.d.ts +1 -1
- package/Checkbox/CheckboxGroup.js +1 -1
- package/Checkbox/CheckboxGroup.js.map +1 -0
- package/Checkbox/CheckboxGroup.stories.js +1 -1
- package/Checkbox/CheckboxGroup.stories.js.map +1 -0
- package/Checkbox/index.js.map +1 -0
- package/Chips/Chip.d.ts +3 -8
- package/Chips/Chip.js +1 -1
- package/Chips/Chip.js.map +1 -0
- package/Chips/ChipIcon.d.ts +2 -2
- package/Chips/ChipIcon.js +1 -1
- package/Chips/ChipIcon.js.map +1 -0
- package/Chips/Chips.d.ts +4 -4
- package/Chips/Chips.js +1 -1
- package/Chips/Chips.js.map +1 -0
- package/Chips/Chips.stories.js.map +1 -0
- package/Chips/index.js.map +1 -0
- package/Chips/styles.js.map +1 -0
- package/CodeEditor/CodeEditor.d.ts +3 -4
- package/CodeEditor/CodeEditor.js +7 -10
- package/CodeEditor/CodeEditor.js.map +1 -0
- package/CodeEditor/CodeEditor.stories.js.map +1 -0
- package/CodeEditor/index.js.map +1 -0
- package/ColorPicker/ColorPicker.d.ts +7 -5
- package/ColorPicker/ColorPicker.js +8 -11
- package/ColorPicker/ColorPicker.js.map +1 -0
- package/ColorPicker/ColorPicker.stories.js +1 -1
- package/ColorPicker/ColorPicker.stories.js.map +1 -0
- package/ColorPicker/index.js.map +1 -0
- package/ConfirmationDialog/ConfirmationDialog.d.ts +12 -12
- package/ConfirmationDialog/ConfirmationDialog.js +7 -4
- package/ConfirmationDialog/ConfirmationDialog.js.map +1 -0
- package/ConfirmationDialog/ConfirmationDialog.stories.js +1 -1
- package/ConfirmationDialog/ConfirmationDialog.stories.js.map +1 -0
- package/ConfirmationDialog/index.js.map +1 -0
- package/ConfirmationDialog/withConfirmation.d.ts +1 -1
- package/ConfirmationDialog/withConfirmation.js +1 -1
- package/ConfirmationDialog/withConfirmation.js.map +1 -0
- package/Dialog/Dialog.d.ts +20 -28
- package/Dialog/Dialog.js +4 -1
- package/Dialog/Dialog.js.map +1 -0
- package/Dialog/Dialog.stories.js.map +1 -0
- package/Dialog/index.js.map +1 -0
- package/Drawer/Drawer.d.ts +1 -1
- package/Drawer/Drawer.js +1 -1
- package/Drawer/Drawer.js.map +1 -0
- package/Drawer/Drawer.stories.js.map +1 -0
- package/Drawer/index.js.map +1 -0
- package/DynamicFieldset/Fieldset.d.ts +5 -5
- package/DynamicFieldset/Fieldset.js +21 -14
- package/DynamicFieldset/Fieldset.js.map +1 -0
- package/DynamicFieldset/index.js.map +1 -0
- package/Elevation/Elevation.d.ts +1 -1
- package/Elevation/Elevation.js +1 -1
- package/Elevation/Elevation.js.map +1 -0
- package/Elevation/Elevation.stories.js +1 -1
- package/Elevation/Elevation.stories.js.map +1 -0
- package/Elevation/index.js.map +1 -0
- package/FormElementMessage/FormElementMessage.d.ts +1 -1
- package/FormElementMessage/FormElementMessage.js +1 -1
- package/FormElementMessage/FormElementMessage.js.map +1 -0
- package/FormElementMessage/index.js.map +1 -0
- package/FullName/FullName.js.map +1 -0
- package/FullName/index.js.map +1 -0
- package/Grid/Grid.d.ts +1 -1
- package/Grid/Grid.js +1 -1
- package/Grid/Grid.js.map +1 -0
- package/Grid/Grid.stories.js.map +1 -0
- package/Grid/index.js.map +1 -0
- package/Helpers/ClassNames.d.ts +4 -3
- package/Helpers/ClassNames.js +5 -3
- package/Helpers/ClassNames.js.map +1 -0
- package/Helpers/index.js.map +1 -0
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js +1 -1
- package/Icon/Icon.js.map +1 -0
- package/Icon/Icon.stories.js.map +1 -0
- package/Icon/index.js.map +1 -0
- package/Image/Image.d.ts +4 -4
- package/Image/Image.js +6 -4
- package/Image/Image.js.map +1 -0
- package/Image/Image.stories.js +1 -1
- package/Image/Image.stories.js.map +1 -0
- package/Image/index.js.map +1 -0
- package/ImageEditor/ImageEditor.d.ts +24 -24
- package/ImageEditor/ImageEditor.js +18 -18
- package/ImageEditor/ImageEditor.js.map +1 -0
- package/ImageEditor/index.js.map +1 -0
- package/ImageEditor/toolbar/crop.js +2 -2
- package/ImageEditor/toolbar/crop.js.map +1 -0
- package/ImageEditor/toolbar/filter.js.map +1 -0
- package/ImageEditor/toolbar/flip.js +1 -1
- package/ImageEditor/toolbar/flip.js.map +1 -0
- package/ImageEditor/toolbar/icons/index.js.map +1 -0
- package/ImageEditor/toolbar/index.js.map +1 -0
- package/ImageEditor/toolbar/rotate.js +5 -1
- package/ImageEditor/toolbar/rotate.js.map +1 -0
- package/ImageEditor/toolbar/types.d.ts +1 -1
- package/ImageEditor/toolbar/types.js.map +1 -0
- package/ImageUpload/Image.d.ts +6 -6
- package/ImageUpload/Image.js +1 -1
- package/ImageUpload/Image.js.map +1 -0
- package/ImageUpload/ImageEditorDialog.d.ts +5 -4
- package/ImageUpload/ImageEditorDialog.js +7 -2
- package/ImageUpload/ImageEditorDialog.js.map +1 -0
- package/ImageUpload/MultiImageUpload.d.ts +5 -5
- package/ImageUpload/MultiImageUpload.js +21 -16
- package/ImageUpload/MultiImageUpload.js.map +1 -0
- package/ImageUpload/MultiImageUpload.stories.js.map +1 -0
- package/ImageUpload/SingleImageUpload.d.ts +14 -13
- package/ImageUpload/SingleImageUpload.js +18 -12
- package/ImageUpload/SingleImageUpload.js.map +1 -0
- package/ImageUpload/SingleImageUpload.stories.js.map +1 -0
- package/ImageUpload/index.js.map +1 -0
- package/ImageUpload/styled.d.ts +18 -14
- package/ImageUpload/styled.js.map +1 -0
- package/Input/Input.d.ts +1 -1
- package/Input/Input.js +8 -8
- package/Input/Input.js.map +1 -0
- package/Input/Input.stories.js +1 -1
- package/Input/Input.stories.js.map +1 -0
- package/Input/__tests__/Input.test.js +32 -26
- package/Input/__tests__/Input.test.js.map +1 -0
- package/Input/index.js.map +1 -0
- package/List/CollapsibleList/CollapsibleList.stories.js.map +1 -0
- package/List/CollapsibleList/index.d.ts +2 -2
- package/List/CollapsibleList/index.js +1 -1
- package/List/CollapsibleList/index.js.map +1 -0
- package/List/DataList/DataList.d.ts +16 -12
- package/List/DataList/DataList.js +20 -11
- package/List/DataList/DataList.js.map +1 -0
- package/List/DataList/DataList.stories.js.map +1 -0
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.d.ts +7 -8
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -0
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.d.ts +3 -3
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -0
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.d.ts +9 -4
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js +6 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -0
- package/List/DataList/DataListModalOverlay/index.js.map +1 -0
- package/List/DataList/Loader.d.ts +2 -2
- package/List/DataList/Loader.js +1 -1
- package/List/DataList/Loader.js.map +1 -0
- package/List/DataList/NoData.d.ts +2 -2
- package/List/DataList/NoData.js +1 -1
- package/List/DataList/NoData.js.map +1 -0
- package/List/DataList/icons/index.d.ts +1 -1
- package/List/DataList/icons/index.js +1 -1
- package/List/DataList/icons/index.js.map +1 -0
- package/List/DataList/index.js.map +1 -0
- package/List/DataList/types.d.ts +1 -1
- package/List/DataList/types.js.map +1 -0
- package/List/List.d.ts +1 -1
- package/List/List.js +1 -1
- package/List/List.js.map +1 -0
- package/List/List.stories.js.map +1 -0
- package/List/icons/index.js.map +1 -0
- package/List/index.js.map +1 -0
- package/Menu/Menu.d.ts +13 -15
- package/Menu/Menu.js +1 -2
- package/Menu/Menu.js.map +1 -0
- package/Menu/Menu.stories.js.map +1 -0
- package/Menu/index.js.map +1 -0
- package/Mosaic/Mosaic.js.map +1 -0
- package/Mosaic/Mosaic.stories.js +1 -1
- package/Mosaic/Mosaic.stories.js.map +1 -0
- package/Mosaic/index.js.map +1 -0
- package/Progress/CircularProgress.d.ts +3 -3
- package/Progress/CircularProgress.js +12 -8
- package/Progress/CircularProgress.js.map +1 -0
- package/Progress/index.js.map +1 -0
- package/Radio/Radio.d.ts +1 -2
- package/Radio/Radio.js +8 -10
- package/Radio/Radio.js.map +1 -0
- package/Radio/Radio.styles.js.map +1 -0
- package/Radio/RadioGroup.d.ts +1 -2
- package/Radio/RadioGroup.js +8 -11
- package/Radio/RadioGroup.js.map +1 -0
- package/Radio/RadioGroup.stories.js +1 -1
- package/Radio/RadioGroup.stories.js.map +1 -0
- package/Radio/index.js.map +1 -0
- package/RichTextEditor/RichTextEditor.js +26 -4
- package/RichTextEditor/RichTextEditor.js.map +1 -0
- package/RichTextEditor/RichTextEditor.stories.js +1 -1
- package/RichTextEditor/RichTextEditor.stories.js.map +1 -0
- package/RichTextEditor/createPropsFromConfig.js.map +1 -0
- package/RichTextEditor/index.js.map +1 -0
- package/Ripple/Ripple.d.ts +1 -1
- package/Ripple/Ripple.js +1 -1
- package/Ripple/Ripple.js.map +1 -0
- package/Ripple/Ripple.stories.js +1 -1
- package/Ripple/Ripple.stories.js.map +1 -0
- package/Ripple/index.js.map +1 -0
- package/Scrollbar/Scrollbar.d.ts +1 -1
- package/Scrollbar/Scrollbar.js +1 -1
- package/Scrollbar/Scrollbar.js.map +1 -0
- package/Scrollbar/Scrollbar.stories.js +1 -1
- package/Scrollbar/Scrollbar.stories.js.map +1 -0
- package/Scrollbar/index.js.map +1 -0
- package/Section/Section.stories.js.map +1 -0
- package/Section/index.d.ts +1 -1
- package/Section/index.js +1 -1
- package/Section/index.js.map +1 -0
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +60 -10
- package/Select/Select.js.map +1 -0
- package/Select/Select.stories.js.map +1 -0
- package/Select/index.js.map +1 -0
- package/Slider/Slider.d.ts +1 -2
- package/Slider/Slider.js +7 -10
- package/Slider/Slider.js.map +1 -0
- package/Slider/Slider.stories.js +1 -1
- package/Slider/Slider.stories.js.map +1 -0
- package/Slider/index.js.map +1 -0
- package/Snackbar/Snackbar.d.ts +3 -6
- package/Snackbar/Snackbar.js +2 -5
- package/Snackbar/Snackbar.js.map +1 -0
- package/Snackbar/Snackbar.stories.js +1 -1
- package/Snackbar/Snackbar.stories.js.map +1 -0
- package/Snackbar/index.js.map +1 -0
- package/Switch/Switch.d.ts +1 -2
- package/Switch/Switch.js +8 -10
- package/Switch/Switch.js.map +1 -0
- package/Switch/Switch.stories.js.map +1 -0
- package/Switch/index.js.map +1 -0
- package/Tabs/Tab.d.ts +2 -2
- package/Tabs/Tab.js +1 -1
- package/Tabs/Tab.js.map +1 -0
- package/Tabs/Tabs.d.ts +3 -3
- package/Tabs/Tabs.js +28 -16
- package/Tabs/Tabs.js.map +1 -0
- package/Tabs/Tabs.stories.js +1 -1
- package/Tabs/Tabs.stories.js.map +1 -0
- package/Tabs/index.js.map +1 -0
- package/Tags/Tags.d.ts +8 -7
- package/Tags/Tags.js +7 -11
- package/Tags/Tags.js.map +1 -0
- package/Tags/Tags.stories.js.map +1 -0
- package/Tags/index.js.map +1 -0
- package/Tooltip/Tooltip.d.ts +7 -4
- package/Tooltip/Tooltip.js +2 -2
- package/Tooltip/Tooltip.js.map +1 -0
- package/Tooltip/Tooltip.stories.js.map +1 -0
- package/Tooltip/index.js.map +1 -0
- package/TopAppBar/TopAppBar.d.ts +1 -1
- package/TopAppBar/TopAppBar.js +1 -1
- package/TopAppBar/TopAppBar.js.map +1 -0
- package/TopAppBar/TopAppBar.stories.js.map +1 -0
- package/TopAppBar/TopAppBarActionItem.js +1 -1
- package/TopAppBar/TopAppBarActionItem.js.map +1 -0
- package/TopAppBar/TopAppBarNavigationIcon.js +1 -1
- package/TopAppBar/TopAppBarNavigationIcon.js.map +1 -0
- package/TopAppBar/TopAppBarPrimary.js +1 -1
- package/TopAppBar/TopAppBarPrimary.js.map +1 -0
- package/TopAppBar/TopAppBarSecondary.js +1 -1
- package/TopAppBar/TopAppBarSecondary.js.map +1 -0
- package/TopAppBar/TopAppBarSection.d.ts +1 -1
- package/TopAppBar/TopAppBarSection.js +1 -1
- package/TopAppBar/TopAppBarSection.js.map +1 -0
- package/TopAppBar/TopAppBarTitle.d.ts +1 -1
- package/TopAppBar/TopAppBarTitle.js +1 -1
- package/TopAppBar/TopAppBarTitle.js.map +1 -0
- package/TopAppBar/index.js.map +1 -0
- package/TopProgressBar/TopProgressBar.d.ts +2 -2
- package/TopProgressBar/TopProgressBar.js.map +1 -0
- package/TopProgressBar/TopProgressBar.stories.js +1 -1
- package/TopProgressBar/TopProgressBar.stories.js.map +1 -0
- package/TopProgressBar/hoc/index.js.map +1 -0
- package/TopProgressBar/hoc/withTopProgressBar.d.ts +1 -1
- package/TopProgressBar/hoc/withTopProgressBar.js +1 -1
- package/TopProgressBar/hoc/withTopProgressBar.js.map +1 -0
- package/TopProgressBar/index.js.map +1 -0
- package/Typography/Typography.d.ts +1 -1
- package/Typography/Typography.js +1 -1
- package/Typography/Typography.js.map +1 -0
- package/Typography/Typography.stories.js +1 -1
- package/Typography/Typography.stories.js.map +1 -0
- package/Typography/index.js.map +1 -0
- package/package.json +17 -13
- package/rmwc/base/LICENSE +21 -0
- package/rmwc/base/README.md +3 -0
- package/rmwc/base/code/component.d.ts +18 -0
- package/rmwc/base/code/component.js +163 -0
- package/rmwc/base/code/foundation-component.d.ts +79 -0
- package/rmwc/base/code/foundation-component.js +354 -0
- package/rmwc/base/code/index.d.ts +16 -0
- package/rmwc/base/code/index.js +25 -0
- package/rmwc/base/code/test-polyfill.d.ts +3 -0
- package/rmwc/base/code/test-polyfill.js +33 -0
- package/rmwc/base/code/utils/apply-passive.d.ts +8 -0
- package/rmwc/base/code/utils/apply-passive.js +63 -0
- package/rmwc/base/code/utils/debounce.d.ts +2 -0
- package/rmwc/base/code/utils/debounce.js +17 -0
- package/rmwc/base/code/utils/deprecation.d.ts +6 -0
- package/rmwc/base/code/utils/deprecation.js +76 -0
- package/rmwc/base/code/utils/emitter.d.ts +13 -0
- package/rmwc/base/code/utils/emitter.js +120 -0
- package/rmwc/base/code/utils/events-map.d.ts +87 -0
- package/rmwc/base/code/utils/events-map.js +90 -0
- package/rmwc/base/code/utils/index.d.ts +10 -0
- package/rmwc/base/code/utils/index.js +19 -0
- package/rmwc/base/code/utils/ponyfills.d.ts +3 -0
- package/rmwc/base/code/utils/ponyfills.js +29 -0
- package/rmwc/base/code/utils/random-id.d.ts +6 -0
- package/rmwc/base/code/utils/random-id.js +14 -0
- package/rmwc/base/code/utils/strings.d.ts +3 -0
- package/rmwc/base/code/utils/strings.js +13 -0
- package/rmwc/base/code/utils/use-knob.d.ts +2 -0
- package/rmwc/base/code/utils/use-knob.js +64 -0
- package/rmwc/base/code/utils/wrap-child.d.ts +3 -0
- package/rmwc/base/code/utils/wrap-child.js +55 -0
- package/rmwc/base/code/with-theme.d.ts +15 -0
- package/rmwc/base/code/with-theme.js +106 -0
- package/rmwc/base/package.json +40 -0
- package/types.d.ts +2 -2
- package/types.js.map +1 -0
package/Drawer/Drawer.js
CHANGED
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./Drawer\";\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
interface ChildrenRenderPropRowCallableParams {
|
|
3
3
|
index: number;
|
|
4
|
-
data:
|
|
4
|
+
data: any;
|
|
5
5
|
}
|
|
6
6
|
interface ChildrenRenderPropRowCallable {
|
|
7
7
|
(params: ChildrenRenderPropRowCallableParams): React.ReactNode;
|
|
@@ -22,13 +22,13 @@ interface ChildrenRenderProp {
|
|
|
22
22
|
empty: (cb: ChildrenRenderPropEmptyCallable) => React.ReactNode;
|
|
23
23
|
}
|
|
24
24
|
interface FieldsetProps {
|
|
25
|
-
value?:
|
|
25
|
+
value?: any[];
|
|
26
26
|
description?: string;
|
|
27
27
|
validation?: {
|
|
28
28
|
isValid: null | boolean;
|
|
29
29
|
message?: string;
|
|
30
30
|
};
|
|
31
|
-
onChange
|
|
31
|
+
onChange: Function;
|
|
32
32
|
children: (props: ChildrenRenderProp) => React.ReactNode;
|
|
33
33
|
}
|
|
34
34
|
declare class Fieldset extends React.Component<FieldsetProps> {
|
|
@@ -45,7 +45,7 @@ declare class Fieldset extends React.Component<FieldsetProps> {
|
|
|
45
45
|
renderHeader: (cb: () => React.ReactNode) => React.ReactNode;
|
|
46
46
|
renderRow: (cb: ChildrenRenderPropRowCallable) => React.ReactNode;
|
|
47
47
|
renderEmpty: (cb: () => React.ReactNode) => React.ReactNode;
|
|
48
|
-
renderComponent():
|
|
48
|
+
renderComponent(): React.ReactNode;
|
|
49
49
|
render(): JSX.Element;
|
|
50
50
|
}
|
|
51
51
|
export default Fieldset;
|
|
@@ -5,7 +5,7 @@ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
6
|
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import
|
|
8
|
+
import React from "react";
|
|
9
9
|
import dotProp from "dot-prop-immutable";
|
|
10
10
|
import { FormElementMessage } from "../FormElementMessage";
|
|
11
11
|
import styled from "@emotion/styled";
|
|
@@ -65,9 +65,12 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
65
65
|
|
|
66
66
|
_defineProperty(_assertThisInitialized(_this), "addData", function () {
|
|
67
67
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
var onChange = _this.props.onChange;
|
|
69
|
+
var value = _this.props.value;
|
|
70
|
+
|
|
71
|
+
if (!value) {
|
|
72
|
+
value = [];
|
|
73
|
+
}
|
|
71
74
|
|
|
72
75
|
if (index < 0) {
|
|
73
76
|
onChange([].concat(_toConsumableArray(value), [{}]));
|
|
@@ -83,6 +86,11 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
83
86
|
|
|
84
87
|
_defineProperty(_assertThisInitialized(_this), "renderRow", function (cb) {
|
|
85
88
|
var value = _this.props.value;
|
|
89
|
+
|
|
90
|
+
if (!value) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
86
94
|
_this.rows = value.map(function (record, index) {
|
|
87
95
|
return /*#__PURE__*/React.createElement(DynamicFieldsetRow, {
|
|
88
96
|
key: index
|
|
@@ -114,21 +122,21 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
114
122
|
empty: this.renderEmpty
|
|
115
123
|
});
|
|
116
124
|
|
|
117
|
-
if (value.length) {
|
|
118
|
-
return
|
|
125
|
+
if (!value || value.length === 0) {
|
|
126
|
+
return this.empty;
|
|
119
127
|
}
|
|
120
128
|
|
|
121
|
-
return this.
|
|
129
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, this.header, this.rows);
|
|
122
130
|
}
|
|
123
131
|
}, {
|
|
124
132
|
key: "render",
|
|
125
133
|
value: function render() {
|
|
126
|
-
var _this$
|
|
127
|
-
description = _this$
|
|
128
|
-
_this$
|
|
129
|
-
validation = _this$
|
|
134
|
+
var _this$props2 = this.props,
|
|
135
|
+
description = _this$props2.description,
|
|
136
|
+
_this$props2$validati = _this$props2.validation,
|
|
137
|
+
validation = _this$props2$validati === void 0 ? {
|
|
130
138
|
isValid: null
|
|
131
|
-
} : _this$
|
|
139
|
+
} : _this$props2$validati;
|
|
132
140
|
return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderComponent(), validation.isValid === false && /*#__PURE__*/React.createElement(FormElementMessage, {
|
|
133
141
|
error: true
|
|
134
142
|
}, validation.message), validation.isValid !== false && description && /*#__PURE__*/React.createElement(FormElementMessage, null, description));
|
|
@@ -139,8 +147,7 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
139
147
|
}(React.Component);
|
|
140
148
|
|
|
141
149
|
_defineProperty(Fieldset, "defaultProps", {
|
|
142
|
-
value: []
|
|
143
|
-
description: null
|
|
150
|
+
value: []
|
|
144
151
|
});
|
|
145
152
|
|
|
146
153
|
export default Fieldset;
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["default","DynamicFieldset"],"mappings":"AAAA,SAASA,OAAO,IAAIC,eAApB","sourcesContent":["export { default as DynamicFieldset } from \"./Fieldset\";\n"]}
|
package/Elevation/Elevation.d.ts
CHANGED
package/Elevation/Elevation.js
CHANGED
|
@@ -0,0 +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,5 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { storiesOf } from "@storybook/react";
|
|
4
4
|
import { Story, StoryReadme, StorySandboxCode, StorySandbox, StorySandboxExample } from "@webiny/storybook-utils/Story";
|
|
5
5
|
import readme from "./../Elevation/README.md";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Elevation.stories.tsx"],"names":["React","storiesOf","Story","StoryReadme","StorySandboxCode","StorySandbox","StorySandboxExample","readme","withKnobs","boolean","select","Elevation","story","module","addDecorator","add","transition","z","Array","keys","style","padding","backgroundColor","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,EAA6BC,MAA7B,QAA2C,wBAA3C;AACA,SAASC,SAAT;AAEA,IAAMC,KAAK,GAAGX,SAAS,CAAC,sBAAD,EAAyBY,MAAzB,CAAvB;AACAD,KAAK,CAACE,YAAN,CAAmBN,SAAnB;AAEAI,KAAK,CAACG,GAAN,CACI,OADJ,EAEI,YAAM;AACF,MAAMC,UAAU,GAAGP,OAAO,CAAC,YAAD,EAAe,IAAf,CAA1B;AACA,MAAMQ,CAAC,GAAGP,MAAM,CAAC,sBAAD,qBAA6BQ,KAAK,CAAC,EAAD,CAAL,CAAUC,IAAV,EAA7B,GAAgD,CAAhD,CAAhB;AAEA,MAAMC,KAAK,GAAG;AACVC,IAAAA,OAAO,EAAE,EADC;AAEVC,IAAAA,eAAe,EAAE;AAFP,GAAd;AAKA,sBACI,oBAAC,KAAD,qBACI,oBAAC,WAAD,QAAcf,MAAd,CADJ,eAEI,oBAAC,YAAD;AAAc,IAAA,KAAK,EAAE;AAArB,kBACI,oBAAC,mBAAD,qBACI,oBAAC,SAAD;AAAW,IAAA,CAAC,EAAEU,CAAd;AAAiB,IAAA,UAAU,EAAED;AAA7B,kBACI;AAAK,IAAA,KAAK,EAAEI;AAAZ,oCADJ,CADJ,CADJ,eAMI,oBAAC,gBAAD,0DAEoBH,CAFpB,2BAEsCD,UAFtC,yIANJ,CAFJ,CADJ;AAmBH,CA9BL,EA+BI;AAAEO,EAAAA,IAAI,EAAE;AAAEC,IAAAA,UAAU,EAAE,CAACb,SAAD;AAAd;AAAR,CA/BJ","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 \"./../Elevation/README.md\";\nimport { withKnobs, boolean, select } from \"@storybook/addon-knobs\";\nimport { Elevation } from \"./Elevation\";\n\nconst story = storiesOf(\"Components/Elevation\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const transition = boolean(\"Transition\", true);\n const z = select(\"Z (elevation height)\", [...Array(25).keys()], 1);\n\n const style = {\n padding: 20,\n backgroundColor: \"white\"\n };\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"An area with applied elevation\"}>\n <StorySandboxExample>\n <Elevation z={z} transition={transition}>\n <div style={style}>This is an elevated content.</div>\n </Elevation>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <Elevation z={${z}} transition={${transition}}>\n <div>This is an elevated content.</div>\n </Elevation>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Elevation] } }\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./Elevation\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["FormElementMessage.tsx"],"names":["React","classnames","FormElementMessage","props","classNames","className","error","children"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;;AAaA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,KAAD,EAAkB;AACzC,MAAMC,UAAU,GAAGH,UAAU,CACzB,mEADyB,EAEzBE,KAAK,CAACE,SAFmB,EAGzB;AAAE,yCAAqCF,KAAK,CAACG;AAA7C,GAHyB,CAA7B;AAMA,sBAAO;AAAK,IAAA,SAAS,EAAEF;AAAhB,KAA6BD,KAAK,CAACI,QAAnC,CAAP;AACH,CARD;;AAUA,SAASL,kBAAT","sourcesContent":["import React from \"react\";\nimport classnames from \"classnames\";\n\ntype Props = {\n // message to display\n children: React.ReactNode;\n\n // optional class name\n className?: string;\n\n // is it an error message we're displaying\n error?: boolean;\n};\n\nconst FormElementMessage = (props: Props) => {\n const classNames = classnames(\n \"mdc-text-field-helper-text mdc-text-field-helper-text--persistent\",\n props.className,\n { \"mdc-text-field-helper-text--error\": props.error }\n );\n\n return <div className={classNames}>{props.children}</div>;\n};\n\nexport { FormElementMessage };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["FormElementMessage"],"mappings":"AAAA,SAASA,kBAAT","sourcesContent":["export { FormElementMessage } from \"./FormElementMessage\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["FullName.ts"],"names":["FullName","props","data","output","firstName","lastName"],"mappings":"AAOA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAkB;AAC/B,MAAQC,IAAR,GAAiBD,KAAjB,CAAQC,IAAR;;AAEA,MAAI,CAACA,IAAL,EAAW;AACP,WAAO,KAAP;AACH;;AAED,MAAIC,MAAM,GAAG,EAAb;;AACA,MAAID,IAAI,CAACE,SAAT,EAAoB;AAChBD,IAAAA,MAAM,IAAID,IAAI,CAACE,SAAf;AACH;;AAED,MAAIF,IAAI,CAACG,QAAT,EAAmB;AACfF,IAAAA,MAAM,IAAI,MAAMD,IAAI,CAACG,QAArB;AACH;;AAED,SAAOF,MAAP;AACH,CAjBD;;AAmBA,SAASH,QAAT","sourcesContent":["type Props = {\n data?: {\n firstName?: string;\n lastName?: string;\n };\n};\n\nconst FullName = (props: Props) => {\n const { data } = props;\n\n if (!data) {\n return \"N/A\";\n }\n\n let output = \"\";\n if (data.firstName) {\n output += data.firstName;\n }\n\n if (data.lastName) {\n output += \" \" + data.lastName;\n }\n\n return output;\n};\n\nexport { FullName };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./FullName\";\n"]}
|
package/Grid/Grid.d.ts
CHANGED
package/Grid/Grid.js
CHANGED
package/Grid/Grid.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Grid.tsx"],"names":["React","Grid","RmwcGrid","GridCell","RmwcGridCell","GridInner","RmwcGridInner","Cell","props","children","displayName"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACIC,IAAI,IAAIC,QADZ,EAEIC,QAAQ,IAAIC,YAFhB,EAGIC,SAAS,IAAIC,aAHjB,QAMO,YANP;;AAwBA;AACA;AACA;AACA,OAAO,IAAMC,IAAI,GAAG,SAAPA,IAAO,CAACC,KAAD,EAAsB;AACtC,sBAAO,oBAAC,YAAD,EAAkBA,KAAlB,EAA0BA,KAAK,CAACC,QAAhC,CAAP;AACH,CAFM;AAcP,OAAO,IAAMJ,SAAS,GAAG,SAAZA,SAAY,CAACG,KAAD,EAA2B;AAChD,sBAAO,oBAAC,aAAD,EAAmBA,KAAnB,EAA2BA,KAAK,CAACC,QAAjC,CAAP;AACH,CAFM;AAIPJ,SAAS,CAACK,WAAV,GAAwB,WAAxB;AAEA;AACA;AACA;;AACA,OAAO,IAAMT,IAAI,GAAG,SAAPA,IAAO,CAACO,KAAD,EAAsB;AACtC,sBAAO,oBAAC,QAAD,EAAcA,KAAd,EAAsBA,KAAK,CAACC,QAA5B,CAAP;AACH,CAFM","sourcesContent":["import React from \"react\";\nimport {\n Grid as RmwcGrid,\n GridCell as RmwcGridCell,\n GridInner as RmwcGridInner,\n GridCellProps as RmwcGridCellProps,\n GridProps as RmwcGridProps\n} from \"@rmwc/grid\";\nimport { CSSProperties } from \"react\";\n\nexport type CellProps = RmwcGridCellProps & {\n // One or more Cell components.\n children?: React.ReactNode;\n\n // CSS class name that will be added to the element\n className?: string;\n\n style?: { [key: string]: any };\n};\n\nexport type GridProps = RmwcGridProps & {\n className?: string;\n style?: CSSProperties;\n};\n\n/**\n * Cell must be direct children of Grid component.\n */\nexport const Cell = (props: CellProps) => {\n return <RmwcGridCell {...props}>{props.children}</RmwcGridCell>;\n};\n\nexport type GridInnerProps = {\n // One or more Cell components.\n children: React.ReactElement<typeof Cell> | React.ReactElement<typeof Cell>[];\n\n /**\n * CSS class name\n */\n className?: string;\n};\n\nexport const GridInner = (props: GridInnerProps) => {\n return <RmwcGridInner {...props}>{props.children}</RmwcGridInner>;\n};\n\nGridInner.displayName = \"GridInner\";\n\n/**\n * Use Grid component to display a list of choices, once the handler is triggered.\n */\nexport const Grid = (props: GridProps) => {\n return <RmwcGrid {...props}>{props.children}</RmwcGrid>;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Grid.stories.tsx"],"names":["React","storiesOf","Story","StoryReadme","StorySandbox","readme","Grid","Cell","story","module","add","info","propTables"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAT,EAAgBC,WAAhB,EAA6BC,YAA7B,QAAiD,+BAAjD;AACA,OAAOC,MAAP;AACA,SAASC,IAAT,EAAeC,IAAf;AAEA,IAAMC,KAAK,GAAGP,SAAS,CAAC,iBAAD,EAAoBQ,MAApB,CAAvB;AAEAD,KAAK,CAACE,GAAN,CACI,OADJ,EAEI,YAAM;AACF,sBACI,oBAAC,KAAD,qBACI,oBAAC,WAAD,QAAcL,MAAd,CADJ,eAEI,oBAAC,YAAD;AAAc,IAAA,KAAK,EAAE;AAArB,kBACI,oBAAC,IAAD,qBACI,oBAAC,IAAD;AAAM,IAAA,IAAI,EAAE,CAAZ;AAAe,IAAA,MAAM,EAAE,CAAvB;AAA0B,IAAA,KAAK,EAAE;AAAjC,cADJ,eAII,oBAAC,IAAD;AAAM,IAAA,IAAI,EAAE,CAAZ;AAAe,IAAA,MAAM,EAAE,CAAvB;AAA0B,IAAA,KAAK,EAAE;AAAjC,eAJJ,eAOI,oBAAC,IAAD;AAAM,IAAA,IAAI,EAAE,CAAZ;AAAe,IAAA,MAAM,EAAE,CAAvB;AAA0B,IAAA,KAAK,EAAE;AAAjC,eAPJ,eAUI,oBAAC,IAAD;AAAM,IAAA,IAAI,EAAE,CAAZ;AAAe,IAAA,MAAM,EAAE,CAAvB;AAA0B,IAAA,KAAK,EAAE;AAAjC,oBAVJ,CADJ,CAFJ,CADJ;AAqBH,CAxBL,EAyBI;AAAEM,EAAAA,IAAI,EAAE;AAAEC,IAAAA,UAAU,EAAE,CAACN,IAAD,EAAOC,IAAP;AAAd;AAAR,CAzBJ","sourcesContent":["import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport { Story, StoryReadme, StorySandbox } from \"@webiny/storybook-utils/Story\";\nimport readme from \"./../Grid/README.md\";\nimport { Grid, Cell } from \"./Grid\";\n\nconst story = storiesOf(\"Components/Grid\", module);\n\nstory.add(\n \"usage\",\n () => {\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"A simple grid.\"}>\n <Grid>\n <Cell span={3} tablet={6} phone={12}>\n Apples\n </Cell>\n <Cell span={3} tablet={6} phone={12}>\n Oranges\n </Cell>\n <Cell span={3} tablet={6} phone={12}>\n Bananas\n </Cell>\n <Cell span={3} tablet={6} phone={12}>\n Strawberries\n </Cell>\n </Grid>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Grid, Cell] } }\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./Grid\";\n"]}
|
package/Helpers/ClassNames.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* the provided appendClasses(string) and any class names defined inside your props.
|
|
4
4
|
* To you the function just do: {...getClasses (props)}
|
|
5
5
|
* and make sure you are not spreading the `props` element, as this will clone and spread your current `props` element already.
|
|
6
|
-
* @param {*} propList
|
|
7
|
-
* @param {*} appendClasses
|
|
8
6
|
*/
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* TODO @ts-refactor figure out propList type
|
|
9
|
+
*/
|
|
10
|
+
declare const getClasses: (propList: any, appendClasses: string[] | string) => any;
|
|
10
11
|
export { getClasses };
|
package/Helpers/ClassNames.js
CHANGED
|
@@ -6,11 +6,13 @@ import classnames from "classnames";
|
|
|
6
6
|
* the provided appendClasses(string) and any class names defined inside your props.
|
|
7
7
|
* To you the function just do: {...getClasses (props)}
|
|
8
8
|
* and make sure you are not spreading the `props` element, as this will clone and spread your current `props` element already.
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* TODO @ts-refactor figure out propList type
|
|
11
13
|
*/
|
|
12
14
|
var getClasses = function getClasses(propList, appendClasses) {
|
|
13
|
-
var classes =
|
|
15
|
+
var classes = "";
|
|
14
16
|
|
|
15
17
|
var props = _clone(propList);
|
|
16
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ClassNames.ts"],"names":["classnames","getClasses","propList","appendClasses","classes","props","hasOwnProperty","className"],"mappings":";AAAA,OAAOA,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,QAAD,EAAgBC,aAAhB,EAAqD;AACpE,MAAIC,OAAO,GAAG,EAAd;;AACA,MAAMC,KAAK,GAAG,OAAMH,QAAN,CAAd;;AACA,MAAIA,QAAQ,CAACI,cAAT,CAAwB,WAAxB,CAAJ,EAA0C;AACtCF,IAAAA,OAAO,GAAGJ,UAAU,CAACE,QAAQ,CAACK,SAAV,CAApB;AACA,WAAOF,KAAK,CAACE,SAAb;AACH;;AAED,MAAI,OAAOJ,aAAP,KAAyB,WAA7B,EAA0C;AACtCC,IAAAA,OAAO,GAAGJ,UAAU,CAACI,OAAD,EAAUD,aAAV,CAApB;AACH;;AAEDE,EAAAA,KAAK,CAACE,SAAN,GAAkBH,OAAlB;AAEA,SAAOC,KAAP;AACH,CAfD;;AAiBA,SAASJ,UAAT","sourcesContent":["import classnames from \"classnames\";\nimport { clone } from \"lodash\";\n\n/**\n * This is a pass-through that modifies your object's props and creates the required className prop by merging\n * the provided appendClasses(string) and any class names defined inside your props.\n * To you the function just do: {...getClasses (props)}\n * and make sure you are not spreading the `props` element, as this will clone and spread your current `props` element already.\n */\n/**\n * TODO @ts-refactor figure out propList type\n */\nconst getClasses = (propList: any, appendClasses: string[] | string) => {\n let classes = \"\";\n const props = clone(propList);\n if (propList.hasOwnProperty(\"className\")) {\n classes = classnames(propList.className);\n delete props.className;\n }\n\n if (typeof appendClasses !== \"undefined\") {\n classes = classnames(classes, appendClasses);\n }\n\n props.className = classes;\n\n return props;\n};\n\nexport { getClasses };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["getClasses"],"mappings":"AAAA,SAASA,UAAT;AAEA,SAASA,UAAT","sourcesContent":["import { getClasses } from \"./ClassNames\";\n\nexport { getClasses };\n"]}
|
package/Icon/Icon.d.ts
CHANGED
package/Icon/Icon.js
CHANGED
package/Icon/Icon.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Icon.tsx"],"names":["React","css","classNames","webinyIcon","marginLeft","width","display","Icon","props","cloneElement","icon","className","onClick"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,GAAT,QAAoB,SAApB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAsBA,IAAMC,UAAU,gBAAGF,GAAG,CAClB,EADkB,EAElB;AACI,wBAAsB;AAClBG,IAAAA,UAAU,EAAE,CADM;AAElBC,IAAAA,KAAK,EAAE,SAFW;AAGlBC,IAAAA,OAAO,EAAE;AAHS;AAD1B,CAFkB,sBAAtB;AAWA;AACA;AACA;;AACA,IAAMC,IAAyB,GAAG,SAA5BA,IAA4B,CAAAC,KAAK,EAAI;AACvC,sBAAOR,KAAK,CAACS,YAAN,CAAmBD,KAAK,CAACE,IAAzB,EAA+B;AAClC,mBAAeF,KAAK,CAAC,aAAD,CADc;AAElCG,IAAAA,SAAS,EAAET,UAAU,CAAC,iCAAD,EAAoCC,UAApC,EAAgDK,KAAK,CAACG,SAAtD,CAFa;AAGlCC,IAAAA,OAAO,EAAEJ,KAAK,CAACI;AAHmB,GAA/B,CAAP;AAKH,CAND;;AAQA,SAASL,IAAT","sourcesContent":["import React from \"react\";\nimport { css } from \"emotion\";\nimport classNames from \"classnames\";\n\nexport type IconProps = {\n /**\n * SvgComponent containing the svg icon\n */\n icon: React.ReactElement;\n\n /**\n * Optional onclick handler\n */\n onClick?: Function;\n\n /**\n * CSS class to be added to the icon\n */\n className?: string;\n\n // For testing purposes.\n \"data-testid\"?: string;\n};\n\nconst webinyIcon = css(\n {},\n {\n \"&.mdc-button__icon\": {\n marginLeft: 0,\n width: \"inherit\",\n display: \"block\"\n }\n }\n);\n\n/**\n * Use Icon component to display an icon.\n */\nconst Icon: React.FC<IconProps> = props => {\n return React.cloneElement(props.icon, {\n \"data-testid\": props[\"data-testid\"],\n className: classNames(\"mdc-button__icon webiny-ui-icon\", webinyIcon, props.className),\n onClick: props.onClick\n });\n};\n\nexport { Icon };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Icon.stories.tsx"],"names":["React","storiesOf","Story","StoryReadme","StorySandbox","readme","ReactComponent","AutoRenewIcon","CloudDoneIcon","BaselineDeleteIcon","BaselineDoneIcon","Icon","story","module","add","info","propTables"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAT,EAAgBC,WAAhB,EAA6BC,YAA7B,QAAiD,+BAAjD;AACA,OAAOC,MAAP;AAEA,SAASC,cAAc,IAAIC,aAA3B;AACA,SAASD,cAAc,IAAIE,aAA3B;AACA,SAASF,cAAc,IAAIG,kBAA3B;AACA,SAASH,cAAc,IAAII,gBAA3B;AACA,SAASC,IAAT;AAEA,IAAMC,KAAK,GAAGX,SAAS,CAAC,iBAAD,EAAoBY,MAApB,CAAvB;AAEAD,KAAK,CAACE,GAAN,CACI,OADJ,EAEI,YAAM;AACF,sBACI,oBAAC,KAAD,qBACI,oBAAC,WAAD,QAAcT,MAAd,CADJ,eAEI,oBAAC,YAAD;AAAc,IAAA,KAAK,EAAE;AAArB,kBACI,8CACI,oBAAC,IAAD;AAAM,IAAA,IAAI,eAAE,oBAAC,aAAD;AAAZ,IADJ,uBAGI,oBAAC,IAAD;AAAM,IAAA,IAAI,eAAE,oBAAC,aAAD;AAAZ,IAHJ,uBAKI,oBAAC,IAAD;AAAM,IAAA,IAAI,eAAE,oBAAC,kBAAD;AAAZ,IALJ,uBAOI,oBAAC,IAAD;AAAM,IAAA,IAAI,eAAE,oBAAC,gBAAD;AAAZ,IAPJ,SADJ,CAFJ,CADJ;AAiBH,CApBL,EAqBI;AAAEU,EAAAA,IAAI,EAAE;AAAEC,IAAAA,UAAU,EAAE,CAACL,IAAD;AAAd;AAAR,CArBJ","sourcesContent":["import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport { Story, StoryReadme, StorySandbox } from \"@webiny/storybook-utils/Story\";\nimport readme from \"./../Icon/README.md\";\n\nimport { ReactComponent as AutoRenewIcon } from \"./svg/baseline-autorenew-24px.svg\";\nimport { ReactComponent as CloudDoneIcon } from \"./svg/baseline-cloud_done-24px.svg\";\nimport { ReactComponent as BaselineDeleteIcon } from \"./svg/baseline-delete-24px.svg\";\nimport { ReactComponent as BaselineDoneIcon } from \"./svg/baseline-done-24px.svg\";\nimport { Icon } from \"./Icon\";\n\nconst story = storiesOf(\"Components/Icon\", module);\n\nstory.add(\n \"usage\",\n () => {\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"A simple icon\"}>\n <div>\n <Icon icon={<AutoRenewIcon />} />\n \n <Icon icon={<CloudDoneIcon />} />\n \n <Icon icon={<BaselineDeleteIcon />} />\n \n <Icon icon={<BaselineDoneIcon />} />\n \n </div>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Icon] } }\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./Icon\";\n"]}
|
package/Image/Image.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
|
|
3
3
|
[key: string]: any;
|
|
4
|
-
}
|
|
5
|
-
declare const Image:
|
|
4
|
+
}
|
|
5
|
+
declare const Image: React.FC<Props>;
|
|
6
6
|
export { Image };
|
package/Image/Image.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import
|
|
2
|
+
import React from "react"; // Accepts all props that a normal <img> element would accept.
|
|
3
3
|
|
|
4
4
|
var Image = function Image(_ref) {
|
|
5
5
|
var rest = Object.assign({}, _ref);
|
|
6
6
|
|
|
7
7
|
var finalProps = _objectSpread({}, rest);
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var srcSet = finalProps.srcSet;
|
|
10
|
+
|
|
11
|
+
if (srcSet && typeof srcSet === "object") {
|
|
12
|
+
finalProps.srcSet = Object.keys(srcSet).map(function (key) {
|
|
13
|
+
return "".concat(srcSet[key], " ").concat(key);
|
|
12
14
|
}).join(", ");
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Image.tsx"],"names":["React","Image","rest","finalProps","srcSet","Object","keys","map","key","join"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB,C,CAEA;;AAMA,IAAMC,KAAsB,GAAG,SAAzBA,KAAyB,OAAiB;AAAA,MAAXC,IAAW;;AAC5C,MAAMC,UAAU,qBAAQD,IAAR,CAAhB;;AACA,MAAME,MAAM,GAAGD,UAAU,CAACC,MAA1B;;AACA,MAAIA,MAAM,IAAI,OAAOA,MAAP,KAAkB,QAAhC,EAA0C;AACtCD,IAAAA,UAAU,CAACC,MAAX,GAAoBC,MAAM,CAACC,IAAP,CAAYF,MAAZ,EACfG,GADe,CACX,UAAAC,GAAG;AAAA,uBAAOJ,MAAM,CAACI,GAAD,CAAb,cAAsBA,GAAtB;AAAA,KADQ,EAEfC,IAFe,CAEV,IAFU,CAApB;AAGH;;AAED,sBAAO,2BAASN,UAAT,CAAP;AACH,CAVD;;AAYA,SAASF,KAAT","sourcesContent":["import React from \"react\";\n\n// Accepts all props that a normal <img> element would accept.\ninterface Props\n extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {\n [key: string]: any;\n}\n\nconst Image: React.FC<Props> = ({ ...rest }) => {\n const finalProps = { ...rest };\n const srcSet = finalProps.srcSet;\n if (srcSet && typeof srcSet === \"object\") {\n finalProps.srcSet = Object.keys(srcSet)\n .map(key => `${srcSet[key]} ${key}`)\n .join(\", \");\n }\n\n return <img {...finalProps} />;\n};\n\nexport { Image };\n"]}
|
package/Image/Image.stories.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { storiesOf } from "@storybook/react";
|
|
3
3
|
import { Story, StoryReadme, StorySandboxCode, StorySandbox, StorySandboxExample } from "@webiny/storybook-utils/Story";
|
|
4
4
|
import readme from "./../Image/README.md";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Image.stories.tsx"],"names":["React","storiesOf","Story","StoryReadme","StorySandboxCode","StorySandbox","StorySandboxExample","readme","withKnobs","Image","story","module","addDecorator","add","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;AAQA,OAAOC,MAAP;AACA,SAASC,SAAT,QAA0B,wBAA1B;AAEA,SAASC,KAAT;AAEA,IAAMC,KAAK,GAAGT,SAAS,CAAC,kBAAD,EAAqBU,MAArB,CAAvB;AACAD,KAAK,CAACE,YAAN,CAAmBJ,SAAnB;AAEAE,KAAK,CAACG,GAAN,CACI,OADJ,EAEI,YAAM;AACF,sBACI,oBAAC,KAAD,qBACI,oBAAC,WAAD,QAAcN,MAAd,CADJ,eAEI,oBAAC,YAAD,qBACI,oBAAC,mBAAD,qBACI,oBAAC,KAAD;AAAO,IAAA,GAAG,EAAC,iCAAX;AAA6C,IAAA,GAAG,EAAC;AAAjD,IADJ,CADJ,eAII,oBAAC,gBAAD,qBACI,oBAAC,KAAD;AAAO,IAAA,GAAG,EAAC,iCAAX;AAA6C,IAAA,GAAG,EAAC;AAAjD,IADJ,CAJJ,CAFJ,CADJ;AAaH,CAhBL,EAiBI;AAAEO,EAAAA,IAAI,EAAE;AAAEC,IAAAA,UAAU,EAAE,CAACN,KAAD;AAAd;AAAR,CAjBJ","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\";\n\nimport readme from \"./../Image/README.md\";\nimport { withKnobs } from \"@storybook/addon-knobs\";\n\nimport { Image } from \"./Image\";\n\nconst story = storiesOf(\"Components/Image\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox>\n <StorySandboxExample>\n <Image src=\"http://i.pravatar.cc/150?img=49\" alt=\"Nice image.\" />\n </StorySandboxExample>\n <StorySandboxCode>\n <Image src=\"http://i.pravatar.cc/150?img=49\" alt=\"Nice image.\" />\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Image] } }\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA","sourcesContent":["export * from \"./Image\";\n"]}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { ImageEditorTool, ToolbarTool } from "./toolbar/types";
|
|
3
3
|
interface RenderPropArgs {
|
|
4
4
|
render: Function;
|
|
5
5
|
getCanvasDataUrl: () => string;
|
|
6
|
-
activeTool
|
|
7
|
-
applyActiveTool:
|
|
8
|
-
cancelActiveTool:
|
|
6
|
+
activeTool: ImageEditorTool | null;
|
|
7
|
+
applyActiveTool: () => Promise<void>;
|
|
8
|
+
cancelActiveTool: () => Promise<void>;
|
|
9
9
|
}
|
|
10
|
-
interface
|
|
10
|
+
interface ImageEditorPropsPropsOptions {
|
|
11
11
|
autoEnable: boolean;
|
|
12
12
|
}
|
|
13
|
-
interface
|
|
13
|
+
interface ImageEditorProps {
|
|
14
14
|
src: string;
|
|
15
15
|
tools: ToolbarTool[];
|
|
16
16
|
options?: {
|
|
17
|
-
flip:
|
|
18
|
-
filter:
|
|
19
|
-
crop:
|
|
20
|
-
rotate:
|
|
17
|
+
flip: ImageEditorPropsPropsOptions;
|
|
18
|
+
filter: ImageEditorPropsPropsOptions;
|
|
19
|
+
crop: ImageEditorPropsPropsOptions;
|
|
20
|
+
rotate: ImageEditorPropsPropsOptions;
|
|
21
21
|
};
|
|
22
22
|
onToolActivate?: Function;
|
|
23
23
|
onToolDeactivate?: Function;
|
|
24
24
|
children?: (props: RenderPropArgs) => React.ReactNode;
|
|
25
25
|
}
|
|
26
|
-
interface
|
|
27
|
-
tool
|
|
26
|
+
interface ImageEditorState {
|
|
27
|
+
tool: ImageEditorTool | null;
|
|
28
28
|
src: string;
|
|
29
29
|
}
|
|
30
|
-
declare class ImageEditor extends React.Component<
|
|
31
|
-
static defaultProps: Partial<
|
|
32
|
-
state:
|
|
30
|
+
declare class ImageEditor extends React.Component<ImageEditorProps, ImageEditorState> {
|
|
31
|
+
static defaultProps: Partial<ImageEditorProps>;
|
|
32
|
+
state: ImageEditorState;
|
|
33
33
|
canvas: React.RefObject<HTMLCanvasElement>;
|
|
34
|
-
image
|
|
34
|
+
image?: HTMLImageElement;
|
|
35
35
|
componentDidMount(): void;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
getCanvasDataUrl: () => string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
render():
|
|
36
|
+
private readonly updateCanvas;
|
|
37
|
+
private readonly activateTool;
|
|
38
|
+
private readonly deactivateTool;
|
|
39
|
+
readonly getCanvasDataUrl: () => string;
|
|
40
|
+
private readonly applyActiveTool;
|
|
41
|
+
private readonly cancelActiveTool;
|
|
42
|
+
private readonly getToolOptions;
|
|
43
|
+
render(): React.ReactNode;
|
|
44
44
|
}
|
|
45
45
|
export { ImageEditor };
|
|
@@ -6,7 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
-
import
|
|
9
|
+
import React from "react";
|
|
10
10
|
import { flip, filter, crop, rotate } from "./toolbar";
|
|
11
11
|
import styled from "@emotion/styled";
|
|
12
12
|
import classNames from "classnames";
|
|
@@ -93,7 +93,7 @@ var ImageEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
93
93
|
|
|
94
94
|
_defineProperty(_assertThisInitialized(_this), "canvas", /*#__PURE__*/React.createRef());
|
|
95
95
|
|
|
96
|
-
_defineProperty(_assertThisInitialized(_this), "image",
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "image", void 0);
|
|
97
97
|
|
|
98
98
|
_defineProperty(_assertThisInitialized(_this), "updateCanvas", function () {
|
|
99
99
|
var src = _this.props.src;
|
|
@@ -168,22 +168,20 @@ var ImageEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
168
168
|
return _context.abrupt("return");
|
|
169
169
|
|
|
170
170
|
case 3:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (!_context.t0) {
|
|
174
|
-
_context.next = 7;
|
|
171
|
+
if (!tool.apply) {
|
|
172
|
+
_context.next = 6;
|
|
175
173
|
break;
|
|
176
174
|
}
|
|
177
175
|
|
|
178
|
-
_context.next =
|
|
176
|
+
_context.next = 6;
|
|
179
177
|
return tool.apply({
|
|
180
178
|
canvas: _this.canvas
|
|
181
179
|
});
|
|
182
180
|
|
|
183
|
-
case
|
|
181
|
+
case 6:
|
|
184
182
|
_this.deactivateTool();
|
|
185
183
|
|
|
186
|
-
case
|
|
184
|
+
case 7:
|
|
187
185
|
case "end":
|
|
188
186
|
return _context.stop();
|
|
189
187
|
}
|
|
@@ -207,22 +205,20 @@ var ImageEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
207
205
|
return _context2.abrupt("return");
|
|
208
206
|
|
|
209
207
|
case 3:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (!_context2.t0) {
|
|
213
|
-
_context2.next = 7;
|
|
208
|
+
if (!tool.cancel) {
|
|
209
|
+
_context2.next = 6;
|
|
214
210
|
break;
|
|
215
211
|
}
|
|
216
212
|
|
|
217
|
-
_context2.next =
|
|
213
|
+
_context2.next = 6;
|
|
218
214
|
return tool.cancel({
|
|
219
215
|
canvas: _this.canvas
|
|
220
216
|
});
|
|
221
217
|
|
|
222
|
-
case
|
|
218
|
+
case 6:
|
|
223
219
|
_this.deactivateTool();
|
|
224
220
|
|
|
225
|
-
case
|
|
221
|
+
case 7:
|
|
226
222
|
case "end":
|
|
227
223
|
return _context2.stop();
|
|
228
224
|
}
|
|
@@ -302,9 +298,13 @@ var ImageEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
302
298
|
image: this.image,
|
|
303
299
|
canvas: this.canvas
|
|
304
300
|
}), /*#__PURE__*/React.createElement(ApplyCancelActions, null, /*#__PURE__*/React.createElement(ButtonSecondary, {
|
|
305
|
-
onClick:
|
|
301
|
+
onClick: function onClick() {
|
|
302
|
+
_this3.cancelActiveTool();
|
|
303
|
+
}
|
|
306
304
|
}, "Cancel"), "\xA0", /*#__PURE__*/React.createElement(ButtonPrimary, {
|
|
307
|
-
onClick:
|
|
305
|
+
onClick: function onClick() {
|
|
306
|
+
_this3.applyActiveTool();
|
|
307
|
+
}
|
|
308
308
|
}, "Apply"))) : /*#__PURE__*/React.createElement("div", {
|
|
309
309
|
style: {
|
|
310
310
|
textAlign: "center"
|