@pareto-engineering/design-system 4.0.0-alpha.4 → 4.0.0-alpha.41
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/dist/cjs/a/AnimatedBlobs/AnimatedBlobs.js +90 -0
- package/dist/cjs/a/AnimatedBlobs/index.js +13 -0
- package/dist/cjs/a/AnimatedBlobs/styles.scss +87 -0
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +60 -0
- package/dist/cjs/a/AnimatedGradient/index.js +13 -0
- package/dist/cjs/a/AnimatedGradient/styles.scss +14 -0
- package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +528 -0
- package/dist/cjs/a/AppContext/ContextProvider.js +0 -2
- package/dist/cjs/a/AppContext/useTheme.js +0 -4
- package/dist/cjs/a/BlurOverlay/BlurOverlay.js +59 -0
- package/dist/cjs/a/BlurOverlay/index.js +13 -0
- package/dist/cjs/a/BlurOverlay/styles.scss +31 -0
- package/dist/cjs/a/ContentTree/ContentTree.js +11 -5
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/cjs/a/ContentTree/styles.scss +34 -11
- package/dist/cjs/a/Conversation/Conversation.js +12 -17
- package/dist/cjs/a/Conversation/common/Message/Message.js +15 -12
- package/dist/cjs/a/Conversation/styles.scss +56 -124
- package/dist/cjs/a/DotInfo/DotInfo.js +2 -2
- package/dist/cjs/a/Figure/Figure.js +2 -2
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +2 -2
- package/dist/cjs/a/IconList/IconList.js +2 -2
- package/dist/cjs/a/IconList/common/Item/Item.js +1 -1
- package/dist/cjs/a/Label/Label.js +14 -6
- package/dist/cjs/a/Label/styles.scss +4 -4
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +2 -2
- package/dist/cjs/a/MetaCard/MetaCard.js +65 -0
- package/dist/cjs/a/MetaCard/index.js +13 -0
- package/dist/cjs/a/MetaCard/styles.scss +45 -0
- package/dist/cjs/a/People/People.js +2 -2
- package/dist/cjs/a/People/common/Person/Person.js +5 -5
- package/dist/cjs/a/People/styles.scss +10 -4
- package/dist/cjs/a/Popover/Popover.js +4 -4
- package/dist/cjs/a/Popover/styles.scss +1 -1
- package/dist/cjs/a/ProgressBar/ProgressBar.js +2 -2
- package/dist/cjs/a/Quote/Quote.js +2 -2
- package/dist/cjs/a/SVG/SVG.js +2 -2
- package/dist/cjs/a/SnapScroller/SnapScroller.js +2 -2
- package/dist/cjs/a/SnapScroller/styles.scss +30 -9
- package/dist/cjs/a/Spinner/Spinner.js +2 -2
- package/dist/cjs/a/TextSteps/TextSteps.js +70 -0
- package/dist/cjs/a/TextSteps/index.js +13 -0
- package/dist/cjs/a/TextSteps/styles.scss +29 -0
- package/dist/cjs/a/Timestamp/Timestamp.js +2 -2
- package/dist/cjs/a/Tip/Tip.js +72 -0
- package/dist/cjs/a/Tip/index.js +13 -0
- package/dist/cjs/a/Tip/styles.scss +22 -0
- package/dist/cjs/a/index.js +43 -1
- package/dist/cjs/b/Button/Button.js +21 -8
- package/dist/cjs/b/Button/common/Group/Group.js +57 -0
- package/dist/cjs/b/Button/common/Group/index.js +13 -0
- package/dist/cjs/b/Button/common/Group/styles.scss +11 -0
- package/dist/cjs/b/Button/common/index.js +12 -0
- package/dist/cjs/b/Button/styles.scss +38 -8
- package/dist/cjs/b/Card/Card.js +74 -0
- package/dist/cjs/b/Card/common/Group/Group.js +73 -0
- package/dist/cjs/b/Card/common/Group/index.js +13 -0
- package/dist/cjs/b/Card/common/Group/styles.scss +38 -0
- package/dist/cjs/b/Card/common/Section/Section.js +59 -0
- package/dist/cjs/b/Card/common/Section/index.js +13 -0
- package/dist/cjs/b/Card/common/index.js +19 -0
- package/dist/cjs/b/Card/index.js +13 -0
- package/dist/cjs/b/Card/styles.scss +57 -0
- package/dist/cjs/b/Logo/Logo.js +2 -2
- package/dist/cjs/b/Page/Page.js +16 -6
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +4 -2
- package/dist/cjs/b/Page/common/Section/Section.js +13 -3
- package/dist/cjs/b/Page/styles.scss +25 -4
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +2 -2
- package/dist/cjs/b/SocialMediaButton/styles.scss +1 -15
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +19 -31
- package/dist/cjs/b/ThemeSelector/styles.scss +2 -7
- package/dist/cjs/b/Title/Title.js +5 -3
- package/dist/cjs/b/index.js +8 -1
- package/dist/cjs/c/ContentSlides/ContentSlides.js +3 -3
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -3
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -2
- package/dist/cjs/c/ContentSlides/styles.scss +2 -2
- package/dist/cjs/c/Modal/Modal.js +3 -3
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/cjs/c/Modal/styles.scss +9 -13
- package/dist/cjs/c/Shortener/Shortener.js +2 -2
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +2 -2
- package/dist/cjs/f/FormInput/FormInput.js +8 -4
- package/dist/cjs/f/common/Debugger/Debugger.js +2 -2
- package/dist/cjs/f/common/Description/Description.js +2 -2
- package/dist/cjs/f/common/InputWrapper/InputWrapper.js +74 -0
- package/dist/cjs/f/common/InputWrapper/index.js +13 -0
- package/dist/cjs/f/common/InputWrapper/styles.scss +13 -0
- package/dist/cjs/f/common/Label/Label.js +20 -6
- package/dist/cjs/f/common/Label/styles.scss +8 -2
- package/dist/cjs/f/common/index.js +8 -1
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +42 -12
- package/dist/cjs/f/fields/Checkbox/styles.scss +6 -8
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +57 -26
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +2 -2
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +52 -43
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +191 -0
- package/dist/cjs/f/fields/EditorInput/common/Toolbar.js +193 -0
- package/dist/cjs/f/fields/EditorInput/common/TreeViewPlugin.js +19 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +20 -0
- package/dist/cjs/f/fields/EditorInput/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/styles.scss +119 -0
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +164 -0
- package/dist/cjs/f/fields/LinkInput/index.js +13 -0
- package/dist/cjs/f/fields/LinkInput/styles.scss +89 -0
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +27 -3
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +37 -7
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +44 -17
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +36 -26
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +64 -29
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +17 -3
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +43 -21
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +5 -5
- package/dist/cjs/f/fields/RatingsInput/styles.scss +6 -13
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +47 -17
- package/dist/cjs/f/fields/SelectInput/styles.scss +60 -26
- package/dist/cjs/f/fields/TextInput/TextInput.js +50 -17
- package/dist/cjs/f/fields/TextInput/styles.scss +56 -20
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +45 -24
- package/dist/cjs/f/fields/TextareaInput/styles.scss +42 -25
- package/dist/cjs/f/fields/index.js +15 -1
- package/dist/cjs/form.scss +1 -1
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +1 -1
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +1 -1
- package/dist/cjs/test/QueryLoader/QueryLoader.js +2 -0
- package/dist/es/a/AnimatedBlobs/AnimatedBlobs.js +82 -0
- package/dist/es/a/AnimatedBlobs/index.js +1 -0
- package/dist/es/a/AnimatedBlobs/styles.scss +87 -0
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +52 -0
- package/dist/es/a/AnimatedGradient/index.js +1 -0
- package/dist/es/a/AnimatedGradient/styles.scss +14 -0
- package/dist/es/a/AnimatedGradient/webGIRenderer.js +492 -0
- package/dist/es/a/AppContext/useTheme.js +0 -4
- package/dist/es/a/BlurOverlay/BlurOverlay.js +51 -0
- package/dist/es/a/BlurOverlay/index.js +2 -0
- package/dist/es/a/BlurOverlay/styles.scss +31 -0
- package/dist/es/a/ContentTree/ContentTree.js +11 -5
- package/dist/es/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/es/a/ContentTree/styles.scss +34 -11
- package/dist/es/a/Conversation/Conversation.js +12 -17
- package/dist/es/a/Conversation/common/Message/Message.js +15 -12
- package/dist/es/a/Conversation/styles.scss +56 -124
- package/dist/es/a/DotInfo/DotInfo.js +2 -2
- package/dist/es/a/Figure/Figure.js +2 -2
- package/dist/es/a/HamburgerButton/HamburgerButton.js +2 -2
- package/dist/es/a/IconList/IconList.js +2 -2
- package/dist/es/a/Label/Label.js +14 -6
- package/dist/es/a/Label/styles.scss +4 -4
- package/dist/es/a/LoadingCircle/LoadingCircle.js +2 -2
- package/dist/es/a/MetaCard/MetaCard.js +57 -0
- package/dist/es/a/MetaCard/index.js +1 -0
- package/dist/es/a/MetaCard/styles.scss +45 -0
- package/dist/es/a/People/People.js +2 -2
- package/dist/es/a/People/common/Person/Person.js +5 -5
- package/dist/es/a/People/styles.scss +10 -4
- package/dist/es/a/Popover/Popover.js +4 -4
- package/dist/es/a/Popover/styles.scss +1 -1
- package/dist/es/a/ProgressBar/ProgressBar.js +2 -2
- package/dist/es/a/Quote/Quote.js +2 -2
- package/dist/es/a/SVG/SVG.js +2 -2
- package/dist/es/a/SnapScroller/SnapScroller.js +2 -2
- package/dist/es/a/SnapScroller/styles.scss +30 -9
- package/dist/es/a/Spinner/Spinner.js +2 -2
- package/dist/es/a/TextSteps/TextSteps.js +61 -0
- package/dist/es/a/TextSteps/index.js +1 -0
- package/dist/es/a/TextSteps/styles.scss +29 -0
- package/dist/es/a/Timestamp/Timestamp.js +2 -2
- package/dist/es/a/Tip/Tip.js +64 -0
- package/dist/es/a/Tip/index.js +2 -0
- package/dist/es/a/Tip/styles.scss +22 -0
- package/dist/es/a/index.js +7 -1
- package/dist/es/b/Button/Button.js +21 -7
- package/dist/es/b/Button/common/Group/Group.js +49 -0
- package/dist/es/b/Button/common/Group/index.js +1 -0
- package/dist/es/b/Button/common/Group/styles.scss +11 -0
- package/dist/es/b/Button/common/index.js +1 -0
- package/dist/es/b/Button/styles.scss +38 -8
- package/dist/es/b/Card/Card.js +66 -0
- package/dist/es/b/Card/common/Group/Group.js +65 -0
- package/dist/es/b/Card/common/Group/index.js +1 -0
- package/dist/es/b/Card/common/Group/styles.scss +38 -0
- package/dist/es/b/Card/common/Section/Section.js +48 -0
- package/dist/es/b/Card/common/Section/index.js +1 -0
- package/dist/es/b/Card/common/index.js +2 -0
- package/dist/es/b/Card/index.js +1 -0
- package/dist/es/b/Card/styles.scss +57 -0
- package/dist/es/b/Logo/Logo.js +2 -2
- package/dist/es/b/Page/Page.js +16 -5
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +4 -2
- package/dist/es/b/Page/common/Section/Section.js +12 -2
- package/dist/es/b/Page/styles.scss +25 -4
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +2 -2
- package/dist/es/b/SocialMediaButton/styles.scss +1 -15
- package/dist/es/b/ThemeSelector/ThemeSelector.js +19 -32
- package/dist/es/b/ThemeSelector/styles.scss +2 -7
- package/dist/es/b/Title/Title.js +18 -12
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/ContentSlides/ContentSlides.js +3 -3
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -1
- package/dist/es/c/ContentSlides/styles.scss +2 -2
- package/dist/es/c/Modal/Modal.js +3 -3
- package/dist/es/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/es/c/Modal/styles.scss +9 -13
- package/dist/es/c/Shortener/Shortener.js +2 -2
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +2 -2
- package/dist/es/f/FormInput/FormInput.js +9 -3
- package/dist/es/f/common/Debugger/Debugger.js +2 -2
- package/dist/es/f/common/Description/Description.js +2 -2
- package/dist/es/f/common/InputWrapper/InputWrapper.js +66 -0
- package/dist/es/f/common/InputWrapper/index.js +2 -0
- package/dist/es/f/common/InputWrapper/styles.scss +13 -0
- package/dist/es/f/common/Label/Label.js +20 -6
- package/dist/es/f/common/Label/styles.scss +8 -2
- package/dist/es/f/common/index.js +2 -1
- package/dist/es/f/fields/Checkbox/Checkbox.js +43 -13
- package/dist/es/f/fields/Checkbox/styles.scss +6 -8
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +58 -27
- package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
- package/dist/es/f/fields/ChoicesInput/styles.scss +52 -43
- package/dist/es/f/fields/EditorInput/EditorInput.js +186 -0
- package/dist/es/f/fields/EditorInput/common/Toolbar.js +182 -0
- package/dist/es/f/fields/EditorInput/common/TreeViewPlugin.js +11 -0
- package/dist/es/f/fields/EditorInput/common/index.js +2 -0
- package/dist/es/f/fields/EditorInput/index.js +2 -0
- package/dist/es/f/fields/EditorInput/styles.scss +119 -0
- package/dist/es/f/fields/LinkInput/LinkInput.js +156 -0
- package/dist/es/f/fields/LinkInput/index.js +2 -0
- package/dist/es/f/fields/LinkInput/styles.scss +89 -0
- package/dist/es/f/fields/QueryChoices/QueryChoices.js +26 -2
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +37 -7
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +43 -16
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +35 -25
- package/dist/es/f/fields/QueryCombobox/styles.scss +64 -29
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +17 -3
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +44 -22
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +4 -4
- package/dist/es/f/fields/RatingsInput/styles.scss +6 -13
- package/dist/es/f/fields/SelectInput/SelectInput.js +48 -18
- package/dist/es/f/fields/SelectInput/styles.scss +60 -26
- package/dist/es/f/fields/TextInput/TextInput.js +51 -18
- package/dist/es/f/fields/TextInput/styles.scss +56 -20
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +46 -25
- package/dist/es/f/fields/TextareaInput/styles.scss +42 -25
- package/dist/es/f/fields/index.js +3 -1
- package/dist/es/form.scss +1 -1
- package/package.json +19 -16
- package/src/stories/a/BlurOverlay.stories.jsx +39 -0
- package/src/stories/a/Conversation.stories.jsx +11 -42
- package/src/stories/a/MetaCard.stories.jsx +35 -0
- package/src/stories/a/People.stories.jsx +22 -2
- package/src/stories/a/Quote.stories.jsx +1 -1
- package/src/stories/a/SnapScroller.stories.jsx +2 -2
- package/src/stories/a/Spinner.stories.jsx +1 -1
- package/src/stories/a/TextSteps.stories.jsx +19 -0
- package/src/stories/a/Tip.stories.jsx +28 -0
- package/src/stories/b/{Button.stories.jsx → Button/Button.stories.jsx} +18 -0
- package/src/stories/b/Button/Group.stories.jsx +35 -0
- package/src/stories/b/Card/Card.stories.jsx +59 -0
- package/src/stories/b/Card/Group.stories.jsx +59 -0
- package/src/stories/b/Page.stories.jsx +19 -3
- package/src/stories/b/ThemeSelector.stories.jsx +1 -1
- package/src/stories/b/Title.stories.jsx +1 -1
- package/src/stories/c/ContentSlides.stories.jsx +1 -1
- package/src/stories/colors.js +22 -10
- package/src/stories/f/Checkbox.stories.jsx +22 -7
- package/src/stories/f/ChoicesInput.stories.jsx +21 -7
- package/src/stories/f/EditorInput.stories.jsx +88 -0
- package/src/stories/f/LinkInput.stories.jsx +100 -0
- package/src/stories/f/QueryChoices.stories.jsx +20 -4
- package/src/stories/f/QueryCombobox.stories.jsx +25 -13
- package/src/stories/f/QuerySelect.stories.jsx +20 -5
- package/src/stories/f/RatingsInput.stories.jsx +16 -2
- package/src/stories/f/SelectInput.stories.jsx +27 -5
- package/src/stories/f/TextInput.stories.jsx +33 -12
- package/src/stories/f/TextareaInput.stories.jsx +16 -2
- package/src/ui/a/AnimatedBlobs/AnimatedBlobs.jsx +102 -0
- package/src/ui/a/AnimatedBlobs/index.js +1 -0
- package/src/ui/a/AnimatedBlobs/styles.scss +87 -0
- package/src/ui/a/AnimatedGradient/AnimatedGradient.jsx +73 -0
- package/src/ui/a/AnimatedGradient/index.js +1 -0
- package/src/ui/a/AnimatedGradient/styles.scss +14 -0
- package/src/ui/a/AnimatedGradient/webGIRenderer.js +541 -0
- package/src/ui/a/AppContext/useTheme.js +0 -4
- package/src/ui/a/BlurOverlay/BlurOverlay.jsx +75 -0
- package/src/ui/a/BlurOverlay/index.js +2 -0
- package/src/ui/a/BlurOverlay/styles.scss +31 -0
- package/src/ui/a/ContentTree/ContentTree.jsx +10 -6
- package/src/ui/a/ContentTree/common/Tree/Tree.jsx +19 -7
- package/src/ui/a/ContentTree/styles.scss +34 -11
- package/src/ui/a/Conversation/Conversation.jsx +16 -20
- package/src/ui/a/Conversation/common/Message/Message.jsx +18 -11
- package/src/ui/a/Conversation/styles.scss +56 -124
- package/src/ui/a/DotInfo/DotInfo.jsx +2 -2
- package/src/ui/a/Figure/Figure.jsx +2 -2
- package/src/ui/a/HamburgerButton/HamburgerButton.jsx +2 -2
- package/src/ui/a/IconList/IconList.jsx +2 -2
- package/src/ui/a/Label/Label.jsx +13 -4
- package/src/ui/a/Label/styles.scss +4 -4
- package/src/ui/a/LoadingCircle/LoadingCircle.jsx +2 -2
- package/src/ui/a/MetaCard/MetaCard.jsx +81 -0
- package/src/ui/a/MetaCard/index.js +1 -0
- package/src/ui/a/MetaCard/styles.scss +45 -0
- package/src/ui/a/People/People.jsx +2 -2
- package/src/ui/a/People/common/Person/Person.jsx +5 -5
- package/src/ui/a/People/styles.scss +10 -4
- package/src/ui/a/Popover/Popover.jsx +4 -4
- package/src/ui/a/Popover/styles.scss +1 -1
- package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -2
- package/src/ui/a/Quote/Quote.jsx +2 -2
- package/src/ui/a/SVG/SVG.jsx +2 -2
- package/src/ui/a/SnapScroller/SnapScroller.jsx +2 -2
- package/src/ui/a/SnapScroller/styles.scss +30 -9
- package/src/ui/a/Spinner/Spinner.jsx +2 -2
- package/src/ui/a/TextSteps/TextSteps.jsx +87 -0
- package/src/ui/a/TextSteps/index.js +1 -0
- package/src/ui/a/TextSteps/styles.scss +29 -0
- package/src/ui/a/Timestamp/Timestamp.jsx +2 -2
- package/src/ui/a/Tip/Tip.jsx +88 -0
- package/src/ui/a/Tip/index.js +2 -0
- package/src/ui/a/Tip/styles.scss +22 -0
- package/src/ui/a/index.js +6 -0
- package/src/ui/b/Button/Button.jsx +26 -7
- package/src/ui/b/Button/common/Group/Group.jsx +71 -0
- package/src/ui/b/Button/common/Group/index.js +1 -0
- package/src/ui/b/Button/common/Group/styles.scss +11 -0
- package/src/ui/b/Button/common/index.js +1 -0
- package/src/ui/b/Button/styles.scss +38 -8
- package/src/ui/b/Card/Card.jsx +94 -0
- package/src/ui/b/Card/common/Group/Group.jsx +91 -0
- package/src/ui/b/Card/common/Group/index.js +1 -0
- package/src/ui/b/Card/common/Group/styles.scss +38 -0
- package/src/ui/b/Card/common/Section/Section.jsx +70 -0
- package/src/ui/b/Card/common/Section/index.js +1 -0
- package/src/ui/b/Card/common/index.js +2 -0
- package/src/ui/b/Card/index.js +1 -0
- package/src/ui/b/Card/styles.scss +57 -0
- package/src/ui/b/Logo/Logo.jsx +2 -2
- package/src/ui/b/Page/Page.jsx +13 -3
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +2 -3
- package/src/ui/b/Page/common/Section/Section.jsx +16 -1
- package/src/ui/b/Page/styles.scss +25 -4
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +2 -2
- package/src/ui/b/SocialMediaButton/styles.scss +1 -15
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +12 -30
- package/src/ui/b/ThemeSelector/styles.scss +2 -7
- package/src/ui/b/Title/Title.jsx +30 -23
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/ContentSlides/ContentSlides.jsx +3 -3
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +1 -1
- package/src/ui/c/ContentSlides/styles.scss +2 -2
- package/src/ui/c/Modal/Modal.jsx +3 -3
- package/src/ui/c/Modal/common/ModalHeader/ModalHeader.jsx +1 -1
- package/src/ui/c/Modal/styles.scss +9 -13
- package/src/ui/c/Shortener/Shortener.jsx +2 -2
- package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +2 -2
- package/src/ui/f/FormInput/FormInput.jsx +14 -2
- package/src/ui/f/common/Debugger/Debugger.jsx +2 -2
- package/src/ui/f/common/Description/Description.jsx +2 -2
- package/src/ui/f/common/InputWrapper/InputWrapper.jsx +89 -0
- package/src/ui/f/common/InputWrapper/index.js +2 -0
- package/src/ui/f/common/InputWrapper/styles.scss +13 -0
- package/src/ui/f/common/Label/Label.jsx +20 -4
- package/src/ui/f/common/Label/styles.scss +8 -2
- package/src/ui/f/common/index.js +1 -0
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +67 -29
- package/src/ui/f/fields/Checkbox/styles.scss +6 -8
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +85 -50
- package/src/ui/f/fields/ChoicesInput/common/Choice/Choice.jsx +10 -3
- package/src/ui/f/fields/ChoicesInput/styles.scss +52 -43
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +237 -0
- package/src/ui/f/fields/EditorInput/common/Toolbar.jsx +254 -0
- package/src/ui/f/fields/EditorInput/common/TreeViewPlugin.jsx +16 -0
- package/src/ui/f/fields/EditorInput/common/index.jsx +2 -0
- package/src/ui/f/fields/EditorInput/index.js +2 -0
- package/src/ui/f/fields/EditorInput/styles.scss +119 -0
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +197 -0
- package/src/ui/f/fields/LinkInput/index.js +2 -0
- package/src/ui/f/fields/LinkInput/styles.scss +89 -0
- package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +28 -0
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +39 -4
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +68 -38
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +81 -66
- package/src/ui/f/fields/QueryCombobox/styles.scss +64 -29
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +16 -1
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +57 -30
- package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +4 -4
- package/src/ui/f/fields/RatingsInput/styles.scss +6 -13
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +90 -51
- package/src/ui/f/fields/SelectInput/styles.scss +60 -26
- package/src/ui/f/fields/TextInput/TextInput.jsx +71 -35
- package/src/ui/f/fields/TextInput/styles.scss +56 -20
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +67 -45
- package/src/ui/f/fields/TextareaInput/styles.scss +42 -25
- package/src/ui/f/fields/index.js +2 -0
- package/src/ui/form.scss +1 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +14551 -6190
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
|
|
3
3
|
@use "@pareto-engineering/bem";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
@use "@pareto-engineering/styles/src/mixins";
|
|
5
|
+
@use "@pareto-engineering/styles/src/globals" as *;
|
|
6
6
|
|
|
7
7
|
.#{bem.$base}.checkbox {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.#{bem.$base}.label {
|
|
13
|
-
margin-bottom: $default-margin;
|
|
8
|
+
&.#{bem.$base}.input-wrapper {
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
14
12
|
}
|
|
15
13
|
}
|
|
@@ -12,7 +12,7 @@ var _common2 = require("../../common");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /* @pareto-engineering/generator-front 1.0.12 */ // Local Definitions
|
|
16
16
|
const baseClassName = _exports.default.base;
|
|
17
17
|
const componentClassName = 'choices-input';
|
|
18
18
|
|
|
@@ -28,40 +28,50 @@ const ChoicesInput = _ref => {
|
|
|
28
28
|
validate,
|
|
29
29
|
options,
|
|
30
30
|
multiple,
|
|
31
|
-
gridColumnsMobile,
|
|
32
|
-
gridColumnsDesktop,
|
|
33
31
|
color,
|
|
34
|
-
colorChecked,
|
|
35
32
|
label,
|
|
33
|
+
labelColor,
|
|
36
34
|
optional,
|
|
37
|
-
disabled
|
|
38
|
-
|
|
35
|
+
disabled,
|
|
36
|
+
description,
|
|
37
|
+
spaceBetween,
|
|
38
|
+
labelSpan,
|
|
39
|
+
desktopLabelSpan,
|
|
40
|
+
inputSpan,
|
|
41
|
+
desktopInputSpan,
|
|
42
|
+
...otherProps
|
|
39
43
|
} = _ref;
|
|
40
|
-
(0, React.
|
|
44
|
+
(0, React.useInsertionEffect)(() => {
|
|
41
45
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
42
46
|
}, []);
|
|
43
|
-
return /*#__PURE__*/React.createElement(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
...style
|
|
50
|
-
}
|
|
47
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement(_common2.FormLabel, {
|
|
48
|
+
name: name,
|
|
49
|
+
color: labelColor,
|
|
50
|
+
optional: optional,
|
|
51
|
+
columnSpan: labelSpan,
|
|
52
|
+
desktopColumnSpan: desktopLabelSpan
|
|
51
53
|
// {...otherProps}
|
|
52
|
-
}, label
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
}, label), /*#__PURE__*/React.createElement(_common2.InputWrapper, {
|
|
55
|
+
id: id,
|
|
56
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
57
|
+
style: style,
|
|
58
|
+
columnSpan: inputSpan,
|
|
59
|
+
desktopColumnSpan: desktopInputSpan
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: ['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')
|
|
57
62
|
}, options.map(choice => /*#__PURE__*/React.createElement(_common.Choice, _extends({
|
|
63
|
+
className: `x-${color}`,
|
|
58
64
|
key: choice.value,
|
|
59
65
|
name: name,
|
|
60
66
|
id: `${name}-${choice.value}`,
|
|
61
67
|
multiple: multiple,
|
|
62
68
|
validate: validate,
|
|
63
69
|
disabled: disabled
|
|
64
|
-
}, choice))))
|
|
70
|
+
}, otherProps, choice)))), /*#__PURE__*/React.createElement(_common2.FormDescription, {
|
|
71
|
+
className: "s-1",
|
|
72
|
+
description: description,
|
|
73
|
+
name: name
|
|
74
|
+
})));
|
|
65
75
|
};
|
|
66
76
|
ChoicesInput.propTypes = {
|
|
67
77
|
/**
|
|
@@ -122,13 +132,34 @@ ChoicesInput.propTypes = {
|
|
|
122
132
|
/**
|
|
123
133
|
* Whether the input is optional or not
|
|
124
134
|
*/
|
|
125
|
-
optional: _propTypes.default.bool
|
|
135
|
+
optional: _propTypes.default.bool,
|
|
136
|
+
/**
|
|
137
|
+
* The select input description
|
|
138
|
+
*/
|
|
139
|
+
description: _propTypes.default.string,
|
|
140
|
+
/**
|
|
141
|
+
* The number of columns the label should span
|
|
142
|
+
*/
|
|
143
|
+
labelSpan: _propTypes.default.number,
|
|
144
|
+
/**
|
|
145
|
+
* The number of columns the input should span
|
|
146
|
+
*/
|
|
147
|
+
inputSpan: _propTypes.default.number,
|
|
148
|
+
/**
|
|
149
|
+
* The number of columns the label should span on desktop
|
|
150
|
+
*/
|
|
151
|
+
desktopLabelSpan: _propTypes.default.number,
|
|
152
|
+
/**
|
|
153
|
+
* The number of columns the input should span on desktop
|
|
154
|
+
*/
|
|
155
|
+
desktopInputSpan: _propTypes.default.number,
|
|
156
|
+
/**
|
|
157
|
+
* The color of the label
|
|
158
|
+
*/
|
|
159
|
+
labelColor: _propTypes.default.string
|
|
126
160
|
};
|
|
127
161
|
ChoicesInput.defaultProps = {
|
|
128
|
-
|
|
129
|
-
gridColumnsDesktop: 3,
|
|
130
|
-
color: 'background2',
|
|
131
|
-
colorChecked: 'main2',
|
|
162
|
+
color: 'interactive',
|
|
132
163
|
disabled: false
|
|
133
164
|
};
|
|
134
165
|
var _default = /*#__PURE__*/(0, React.memo)(ChoicesInput);
|
|
@@ -11,7 +11,7 @@ var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports")
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* @pareto-engineering/generator-front 1.0.12 */ // Local Definitions
|
|
15
15
|
const baseClassName = _exports.default.base;
|
|
16
16
|
const componentClassName = 'choice';
|
|
17
17
|
|
|
@@ -51,7 +51,7 @@ const Choice = _ref => {
|
|
|
51
51
|
disabled: disabled
|
|
52
52
|
})), /*#__PURE__*/React.createElement("label", {
|
|
53
53
|
htmlFor: id,
|
|
54
|
-
className: labelClassName,
|
|
54
|
+
className: [labelClassName, disabled && 'disabled'].filter(e => e).join(' '),
|
|
55
55
|
style: labelStyle
|
|
56
56
|
}, label));
|
|
57
57
|
};
|
|
@@ -1,67 +1,76 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
/* stylelint-disable selector-max-compound-selectors -- exception */
|
|
3
|
+
/* stylelint-disable max-nesting-depth -- exception */
|
|
3
4
|
|
|
4
5
|
@use "@pareto-engineering/bem";
|
|
5
6
|
@use "@pareto-engineering/styles/src/mixins";
|
|
6
7
|
@use "@pareto-engineering/styles/src/globals" as *;
|
|
7
8
|
|
|
8
|
-
$default-
|
|
9
|
-
$default-
|
|
10
|
-
$default-
|
|
9
|
+
$default-flex-separator:calc(1em / 2) calc(.75em / 2);
|
|
10
|
+
$default-transition:var(--theme-default-transition);
|
|
11
|
+
$default-label-padding: .3em 1em calc(2em - .3em);
|
|
12
|
+
$default-label-height: .5em;
|
|
13
|
+
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
14
|
+
$default-border: var(--theme-default-input-border);
|
|
15
|
+
$hover-border: var(--theme-hover-input-border);
|
|
16
|
+
$focus-border: var(--theme-focus-input-border);
|
|
17
|
+
$default-background: var(--background-inputs);
|
|
18
|
+
$disabled-background: var(--background-inputs-30);
|
|
11
19
|
|
|
12
20
|
.#{bem.$base}.choices-input {
|
|
13
|
-
.
|
|
14
|
-
display:
|
|
15
|
-
|
|
16
|
-
grid-template-columns: repeat(var(--grid-columns-mobile), 1fr);
|
|
21
|
+
&.#{bem.$base}.input-wrapper {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
grid-template-columns: repeat(var(--grid-columns-desktop), 1fr);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.choice {
|
|
25
|
+
> .choices {
|
|
23
26
|
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
gap: $default-flex-separator;
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
position: absolute;
|
|
28
|
-
visibility: none;
|
|
29
|
-
z-index: -1;
|
|
30
|
+
&.space-between {
|
|
31
|
+
justify-content: space-between;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
34
|
+
>.choice {
|
|
35
|
+
display: flex;
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
input {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
position: absolute;
|
|
40
|
+
visibility: none;
|
|
41
|
+
z-index: -1;
|
|
39
42
|
}
|
|
40
|
-
}
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
input:disabled + label {
|
|
45
|
+
background-color: $disabled-background;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
> label {
|
|
49
|
+
background-color: $default-background;
|
|
50
|
+
border: $default-border;
|
|
51
|
+
border-radius: $default-input-border-radius;
|
|
52
|
+
color: var(--paragraph);
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
display: block;
|
|
55
|
+
height: $default-label-height;
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
padding: $default-label-padding;
|
|
58
|
+
position: relative;
|
|
59
|
+
transition: $default-transition;
|
|
60
|
+
white-space: nowrap;
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
&:not(.disabled) {
|
|
63
|
+
&:hover {
|
|
64
|
+
border: $hover-border;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
58
68
|
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
input:checked + label {
|
|
70
|
+
background: var(--x);
|
|
71
|
+
color: var(--on-x);
|
|
61
72
|
}
|
|
62
73
|
}
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
76
|
}
|
|
66
|
-
|
|
67
|
-
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _formik = require("formik");
|
|
9
|
+
var _LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
10
|
+
var _LexicalRichTextPlugin = require("@lexical/react/LexicalRichTextPlugin");
|
|
11
|
+
var _LexicalContentEditable = require("@lexical/react/LexicalContentEditable");
|
|
12
|
+
var _LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
13
|
+
var _LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin");
|
|
14
|
+
var _LexicalLinkPlugin = require("@lexical/react/LexicalLinkPlugin");
|
|
15
|
+
var _LexicalListPlugin = require("@lexical/react/LexicalListPlugin");
|
|
16
|
+
var _LexicalTabIndentationPlugin = require("@lexical/react/LexicalTabIndentationPlugin");
|
|
17
|
+
var _link = require("@lexical/link");
|
|
18
|
+
var _list = require("@lexical/list");
|
|
19
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
20
|
+
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
21
|
+
var _common = require("../../common");
|
|
22
|
+
var _common2 = require("./common");
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /* @pareto-engineering/generator-front 1.0.12 */ /* eslint-disable import/no-extraneous-dependencies -- required here */ // Local Definitions
|
|
26
|
+
const baseClassName = _exports.default.base;
|
|
27
|
+
const componentClassName = 'editor-input';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This is the component description.
|
|
31
|
+
*/
|
|
32
|
+
const EditorInput = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
id,
|
|
35
|
+
className: userClassName,
|
|
36
|
+
style,
|
|
37
|
+
name,
|
|
38
|
+
label,
|
|
39
|
+
// validate,
|
|
40
|
+
resize,
|
|
41
|
+
color,
|
|
42
|
+
rows,
|
|
43
|
+
optional,
|
|
44
|
+
labelColor,
|
|
45
|
+
description,
|
|
46
|
+
disabled,
|
|
47
|
+
labelSpan,
|
|
48
|
+
desktopLabelSpan,
|
|
49
|
+
inputSpan,
|
|
50
|
+
desktopInputSpan,
|
|
51
|
+
showDebugger
|
|
52
|
+
// ...otherProps
|
|
53
|
+
} = _ref;
|
|
54
|
+
(0, React.useInsertionEffect)(() => {
|
|
55
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
56
|
+
}, []);
|
|
57
|
+
const formik = (0, _formik.useFormikContext)();
|
|
58
|
+
const setInitialValue = () => {
|
|
59
|
+
const value = formik.values[name];
|
|
60
|
+
return value || undefined;
|
|
61
|
+
};
|
|
62
|
+
const onChange = state => {
|
|
63
|
+
formik.setValues({
|
|
64
|
+
...formik.values,
|
|
65
|
+
[name]: JSON.stringify(state)
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const initialConfig = {
|
|
69
|
+
nameSpace: name,
|
|
70
|
+
editable: !disabled,
|
|
71
|
+
editorState: setInitialValue(),
|
|
72
|
+
theme: {
|
|
73
|
+
text: {
|
|
74
|
+
italic: 'italic',
|
|
75
|
+
strikethrough: 'strikethrough',
|
|
76
|
+
underline: 'underlined'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
nodes: [_link.AutoLinkNode, _link.LinkNode, _list.ListNode, _list.ListItemNode]
|
|
80
|
+
};
|
|
81
|
+
return /*#__PURE__*/React.createElement(_LexicalComposer.LexicalComposer, {
|
|
82
|
+
initialConfig: initialConfig
|
|
83
|
+
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
84
|
+
name: name,
|
|
85
|
+
color: labelColor,
|
|
86
|
+
optional: optional,
|
|
87
|
+
columnSpan: labelSpan,
|
|
88
|
+
desktopColumnSpan: desktopLabelSpan
|
|
89
|
+
// {...otherProps}
|
|
90
|
+
}, label), /*#__PURE__*/React.createElement(_common.InputWrapper, {
|
|
91
|
+
id: id,
|
|
92
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`, disabled && 'disabled'].filter(e => e).join(' '),
|
|
93
|
+
style: {
|
|
94
|
+
...style,
|
|
95
|
+
'--resize': resize,
|
|
96
|
+
'--rows': `${rows}em`
|
|
97
|
+
},
|
|
98
|
+
columnSpan: inputSpan,
|
|
99
|
+
desktopColumnSpan: desktopInputSpan
|
|
100
|
+
}, !disabled && /*#__PURE__*/React.createElement(_common2.Toolbar, null), /*#__PURE__*/React.createElement(_LexicalRichTextPlugin.RichTextPlugin, {
|
|
101
|
+
contentEditable: /*#__PURE__*/React.createElement(_LexicalContentEditable.ContentEditable, {
|
|
102
|
+
id: name,
|
|
103
|
+
className: "content-editable"
|
|
104
|
+
})
|
|
105
|
+
}), /*#__PURE__*/React.createElement(_LexicalOnChangePlugin.OnChangePlugin, {
|
|
106
|
+
onChange: onChange
|
|
107
|
+
}), /*#__PURE__*/React.createElement(_LexicalLinkPlugin.LinkPlugin, null), /*#__PURE__*/React.createElement(_LexicalListPlugin.ListPlugin, null), /*#__PURE__*/React.createElement(_LexicalTabIndentationPlugin.TabIndentationPlugin, null), /*#__PURE__*/React.createElement(_LexicalHistoryPlugin.HistoryPlugin, null), /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
108
|
+
className: "s-1",
|
|
109
|
+
description: description,
|
|
110
|
+
name: name
|
|
111
|
+
}), showDebugger && /*#__PURE__*/React.createElement(_common2.TreeViewPlugin, null)));
|
|
112
|
+
};
|
|
113
|
+
EditorInput.propTypes = {
|
|
114
|
+
/**
|
|
115
|
+
* The HTML id for this element
|
|
116
|
+
*/
|
|
117
|
+
id: _propTypes.default.string,
|
|
118
|
+
/**
|
|
119
|
+
* The HTML class names for this element
|
|
120
|
+
*/
|
|
121
|
+
className: _propTypes.default.string,
|
|
122
|
+
/**
|
|
123
|
+
* The React-written, css properties for this element.
|
|
124
|
+
*/
|
|
125
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
126
|
+
/**
|
|
127
|
+
* The input name (html - and Formik state)
|
|
128
|
+
*/
|
|
129
|
+
name: _propTypes.default.string.isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* The input label
|
|
132
|
+
*/
|
|
133
|
+
label: _propTypes.default.string.isRequired,
|
|
134
|
+
/**
|
|
135
|
+
* The input value validator function
|
|
136
|
+
*/
|
|
137
|
+
// validate:PropTypes.func,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The number of rows int the text area
|
|
141
|
+
*/
|
|
142
|
+
rows: _propTypes.default.number,
|
|
143
|
+
/**
|
|
144
|
+
* Color of the text
|
|
145
|
+
*/
|
|
146
|
+
color: _propTypes.default.string,
|
|
147
|
+
/**
|
|
148
|
+
* Label base color
|
|
149
|
+
*/
|
|
150
|
+
labelColor: _propTypes.default.string,
|
|
151
|
+
/**
|
|
152
|
+
* Text area description
|
|
153
|
+
*/
|
|
154
|
+
description: _propTypes.default.string,
|
|
155
|
+
/**
|
|
156
|
+
* Whether the text area should be disabled
|
|
157
|
+
*/
|
|
158
|
+
disabled: _propTypes.default.bool,
|
|
159
|
+
/**
|
|
160
|
+
* Whether the input is optional or not
|
|
161
|
+
*/
|
|
162
|
+
optional: _propTypes.default.bool,
|
|
163
|
+
/**
|
|
164
|
+
* The number of columns the label should span
|
|
165
|
+
*/
|
|
166
|
+
labelSpan: _propTypes.default.number,
|
|
167
|
+
/**
|
|
168
|
+
* The number of columns the input should span
|
|
169
|
+
*/
|
|
170
|
+
inputSpan: _propTypes.default.number,
|
|
171
|
+
/**
|
|
172
|
+
* The number of columns the label should span on desktop
|
|
173
|
+
*/
|
|
174
|
+
desktopLabelSpan: _propTypes.default.number,
|
|
175
|
+
/**
|
|
176
|
+
* The number of columns the input should span on desktop
|
|
177
|
+
*/
|
|
178
|
+
desktopInputSpan: _propTypes.default.number,
|
|
179
|
+
/**
|
|
180
|
+
* The resize property of the text area
|
|
181
|
+
*/
|
|
182
|
+
resize: _propTypes.default.oneOf(['none', 'both', 'horizontal', 'vertical'])
|
|
183
|
+
};
|
|
184
|
+
EditorInput.defaultProps = {
|
|
185
|
+
rows: 10,
|
|
186
|
+
disabled: false,
|
|
187
|
+
color: 'paragraph',
|
|
188
|
+
resize: 'vertical'
|
|
189
|
+
};
|
|
190
|
+
var _default = /*#__PURE__*/(0, React.memo)(EditorInput);
|
|
191
|
+
exports.default = _default;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _lexical = require("lexical");
|
|
9
|
+
var _list = require("@lexical/list");
|
|
10
|
+
var _selection = require("@lexical/selection");
|
|
11
|
+
var _link = require("@lexical/link");
|
|
12
|
+
var _LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
13
|
+
var _utils = require("@lexical/utils");
|
|
14
|
+
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
19
|
+
|
|
20
|
+
const baseClassName = _exports.default.base;
|
|
21
|
+
const componentClassName = 'toolbar';
|
|
22
|
+
const getSelectedNode = selection => {
|
|
23
|
+
const {
|
|
24
|
+
anchor,
|
|
25
|
+
focus
|
|
26
|
+
} = selection;
|
|
27
|
+
const anchorNode = selection.anchor.getNode();
|
|
28
|
+
const focusNode = selection.focus.getNode();
|
|
29
|
+
if (anchorNode === focusNode) {
|
|
30
|
+
return anchorNode;
|
|
31
|
+
}
|
|
32
|
+
const isBackward = selection.isBackward();
|
|
33
|
+
if (isBackward) {
|
|
34
|
+
return (0, _selection.$isAtNodeEnd)(focus) ? anchorNode : focusNode;
|
|
35
|
+
}
|
|
36
|
+
return (0, _selection.$isAtNodeEnd)(anchor) ? focusNode : anchorNode;
|
|
37
|
+
};
|
|
38
|
+
const Toolbar = () => {
|
|
39
|
+
const [editor] = (0, _LexicalComposerContext.useLexicalComposerContext)();
|
|
40
|
+
const [isBold, setIsBold] = (0, React.useState)(false);
|
|
41
|
+
const [isItalic, setIsItalic] = (0, React.useState)(false);
|
|
42
|
+
const [isStrikethrough, setIsStrikethrough] = (0, React.useState)(false);
|
|
43
|
+
const [blockType, setBlockType] = (0, React.useState)('paragraph');
|
|
44
|
+
const [isLink, setIsLink] = (0, React.useState)(false);
|
|
45
|
+
const [isUnderline, setIsUnderline] = (0, React.useState)(false);
|
|
46
|
+
const formatBulletList = () => {
|
|
47
|
+
if (blockType !== 'ul') {
|
|
48
|
+
editor.dispatchCommand(_list.INSERT_UNORDERED_LIST_COMMAND);
|
|
49
|
+
} else {
|
|
50
|
+
editor.dispatchCommand(_list.REMOVE_LIST_COMMAND);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const formatNumberedList = () => {
|
|
54
|
+
if (blockType !== 'ol') {
|
|
55
|
+
editor.dispatchCommand(_list.INSERT_ORDERED_LIST_COMMAND);
|
|
56
|
+
} else {
|
|
57
|
+
editor.dispatchCommand(_list.REMOVE_LIST_COMMAND);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const formatLink = (0, React.useCallback)(() => {
|
|
61
|
+
if (!isLink) {
|
|
62
|
+
// eslint-disable-next-line no-alert
|
|
63
|
+
const path = prompt('Enter the full URL. Ex: https://www.example.com');
|
|
64
|
+
editor.dispatchCommand(_link.TOGGLE_LINK_COMMAND, path);
|
|
65
|
+
} else {
|
|
66
|
+
editor.dispatchCommand(_link.TOGGLE_LINK_COMMAND, null);
|
|
67
|
+
}
|
|
68
|
+
}, [editor, isLink]);
|
|
69
|
+
const updateToolbar = (0, React.useCallback)(() => {
|
|
70
|
+
const selection = (0, _lexical.$getSelection)();
|
|
71
|
+
|
|
72
|
+
// Check list selection
|
|
73
|
+
if ((0, _lexical.$isRangeSelection)(selection)) {
|
|
74
|
+
const anchorNode = selection.anchor.getNode();
|
|
75
|
+
const element = anchorNode.getKey() === 'root' ? anchorNode : anchorNode.getTopLevelElementOrThrow();
|
|
76
|
+
if ((0, _list.$isListNode)(element)) {
|
|
77
|
+
const parentList = (0, _utils.$getNearestNodeOfType)(anchorNode, _list.ListNode);
|
|
78
|
+
const type = parentList ? parentList.getTag() : element.getTag();
|
|
79
|
+
setBlockType(type);
|
|
80
|
+
} else {
|
|
81
|
+
setBlockType(element);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Check selection text styles
|
|
85
|
+
setIsBold(selection.hasFormat('bold'));
|
|
86
|
+
setIsItalic(selection.hasFormat('italic'));
|
|
87
|
+
setIsStrikethrough(selection.hasFormat('strikethrough'));
|
|
88
|
+
setIsUnderline(selection.hasFormat('underline'));
|
|
89
|
+
setIsLink(selection.hasFormat('link'));
|
|
90
|
+
|
|
91
|
+
// Check links
|
|
92
|
+
const node = getSelectedNode(selection);
|
|
93
|
+
const parent = node.getParent();
|
|
94
|
+
if ((0, _link.$isLinkNode)(parent) || (0, _link.$isLinkNode)(node)) {
|
|
95
|
+
setIsLink(true);
|
|
96
|
+
} else {
|
|
97
|
+
setIsLink(false);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, [editor]);
|
|
101
|
+
(0, React.useEffect)(() => (0, _utils.mergeRegister)(editor.registerUpdateListener(_ref => {
|
|
102
|
+
let {
|
|
103
|
+
editorState
|
|
104
|
+
} = _ref;
|
|
105
|
+
editorState.read(() => {
|
|
106
|
+
updateToolbar();
|
|
107
|
+
});
|
|
108
|
+
})), [updateToolbar, editor]);
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: `${baseClassName} ${componentClassName}`
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: "group"
|
|
113
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
114
|
+
type: "button",
|
|
115
|
+
className: isBold ? 'active' : undefined,
|
|
116
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_TEXT_COMMAND, 'bold')
|
|
117
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
118
|
+
className: "icon"
|
|
119
|
+
}, "|")), /*#__PURE__*/React.createElement("button", {
|
|
120
|
+
type: "button",
|
|
121
|
+
className: isItalic ? 'active' : undefined,
|
|
122
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_TEXT_COMMAND, 'italic')
|
|
123
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
124
|
+
className: "icon"
|
|
125
|
+
}, "}")), /*#__PURE__*/React.createElement("button", {
|
|
126
|
+
type: "button",
|
|
127
|
+
className: isUnderline ? 'active' : undefined,
|
|
128
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_TEXT_COMMAND, 'underline')
|
|
129
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
130
|
+
className: "icon"
|
|
131
|
+
}, "~")), /*#__PURE__*/React.createElement("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
className: isStrikethrough ? 'active' : undefined,
|
|
134
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_TEXT_COMMAND, 'strikethrough')
|
|
135
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
136
|
+
className: "icon"
|
|
137
|
+
}, "?")), /*#__PURE__*/React.createElement("button", {
|
|
138
|
+
type: "button",
|
|
139
|
+
className: isLink ? 'active' : undefined,
|
|
140
|
+
onClick: () => formatLink()
|
|
141
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
142
|
+
className: "icon"
|
|
143
|
+
}, "]")), /*#__PURE__*/React.createElement("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
className: blockType === 'ul' ? 'active' : undefined,
|
|
146
|
+
onClick: () => formatBulletList()
|
|
147
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
148
|
+
className: "icon"
|
|
149
|
+
}, ".")), /*#__PURE__*/React.createElement("button", {
|
|
150
|
+
type: "button",
|
|
151
|
+
className: blockType === 'ol' ? 'active' : undefined,
|
|
152
|
+
onClick: () => formatNumberedList()
|
|
153
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
154
|
+
className: "icon"
|
|
155
|
+
}, "-"))), /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: "group"
|
|
157
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
158
|
+
type: "button",
|
|
159
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_ELEMENT_COMMAND, 'left')
|
|
160
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
161
|
+
className: "icon"
|
|
162
|
+
}, "^")), /*#__PURE__*/React.createElement("button", {
|
|
163
|
+
type: "button",
|
|
164
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_ELEMENT_COMMAND, 'center')
|
|
165
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
166
|
+
className: "icon"
|
|
167
|
+
}, "_")), /*#__PURE__*/React.createElement("button", {
|
|
168
|
+
type: "button",
|
|
169
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_ELEMENT_COMMAND, 'right')
|
|
170
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
171
|
+
className: "icon"
|
|
172
|
+
}, "`")), /*#__PURE__*/React.createElement("button", {
|
|
173
|
+
type: "button",
|
|
174
|
+
onClick: () => editor.dispatchCommand(_lexical.FORMAT_ELEMENT_COMMAND, 'justify')
|
|
175
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
176
|
+
className: "icon"
|
|
177
|
+
}, "{"))), /*#__PURE__*/React.createElement("div", {
|
|
178
|
+
className: "group"
|
|
179
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
180
|
+
type: "button",
|
|
181
|
+
onClick: () => editor.dispatchCommand(_lexical.UNDO_COMMAND)
|
|
182
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
183
|
+
className: "icon"
|
|
184
|
+
}, "\\")), /*#__PURE__*/React.createElement("button", {
|
|
185
|
+
type: "button",
|
|
186
|
+
className: "flip",
|
|
187
|
+
onClick: () => editor.dispatchCommand(_lexical.REDO_COMMAND)
|
|
188
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
189
|
+
className: "icon"
|
|
190
|
+
}, "\\"))));
|
|
191
|
+
};
|
|
192
|
+
var _default = Toolbar;
|
|
193
|
+
exports.default = _default;
|