@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
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { useInsertionEffect, memo } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import styleNames from '@pareto-engineering/bem/exports';
|
|
7
7
|
|
|
8
8
|
// Local Definitions
|
|
9
9
|
|
|
10
10
|
import { Choice } from "./common";
|
|
11
|
-
import { FormLabel } from "../../common";
|
|
11
|
+
import { FormDescription, FormLabel, InputWrapper } from "../../common";
|
|
12
12
|
const baseClassName = styleNames.base;
|
|
13
13
|
const componentClassName = 'choices-input';
|
|
14
14
|
|
|
@@ -23,40 +23,50 @@ const ChoicesInput = ({
|
|
|
23
23
|
validate,
|
|
24
24
|
options,
|
|
25
25
|
multiple,
|
|
26
|
-
gridColumnsMobile,
|
|
27
|
-
gridColumnsDesktop,
|
|
28
26
|
color,
|
|
29
|
-
colorChecked,
|
|
30
27
|
label,
|
|
28
|
+
labelColor,
|
|
31
29
|
optional,
|
|
32
|
-
disabled
|
|
33
|
-
|
|
30
|
+
disabled,
|
|
31
|
+
description,
|
|
32
|
+
spaceBetween,
|
|
33
|
+
labelSpan,
|
|
34
|
+
desktopLabelSpan,
|
|
35
|
+
inputSpan,
|
|
36
|
+
desktopInputSpan,
|
|
37
|
+
...otherProps
|
|
34
38
|
}) => {
|
|
35
|
-
|
|
39
|
+
useInsertionEffect(() => {
|
|
36
40
|
import("./styles.scss");
|
|
37
41
|
}, []);
|
|
38
|
-
return /*#__PURE__*/React.createElement(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
...style
|
|
45
|
-
}
|
|
42
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement(FormLabel, {
|
|
43
|
+
name: name,
|
|
44
|
+
color: labelColor,
|
|
45
|
+
optional: optional,
|
|
46
|
+
columnSpan: labelSpan,
|
|
47
|
+
desktopColumnSpan: desktopLabelSpan
|
|
46
48
|
// {...otherProps}
|
|
47
|
-
}, label
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
}, label), /*#__PURE__*/React.createElement(InputWrapper, {
|
|
50
|
+
id: id,
|
|
51
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
52
|
+
style: style,
|
|
53
|
+
columnSpan: inputSpan,
|
|
54
|
+
desktopColumnSpan: desktopInputSpan
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: ['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')
|
|
52
57
|
}, options.map(choice => /*#__PURE__*/React.createElement(Choice, _extends({
|
|
58
|
+
className: `x-${color}`,
|
|
53
59
|
key: choice.value,
|
|
54
60
|
name: name,
|
|
55
61
|
id: `${name}-${choice.value}`,
|
|
56
62
|
multiple: multiple,
|
|
57
63
|
validate: validate,
|
|
58
64
|
disabled: disabled
|
|
59
|
-
}, choice))))
|
|
65
|
+
}, otherProps, choice)))), /*#__PURE__*/React.createElement(FormDescription, {
|
|
66
|
+
className: "s-1",
|
|
67
|
+
description: description,
|
|
68
|
+
name: name
|
|
69
|
+
})));
|
|
60
70
|
};
|
|
61
71
|
ChoicesInput.propTypes = {
|
|
62
72
|
/**
|
|
@@ -117,13 +127,34 @@ ChoicesInput.propTypes = {
|
|
|
117
127
|
/**
|
|
118
128
|
* Whether the input is optional or not
|
|
119
129
|
*/
|
|
120
|
-
optional: PropTypes.bool
|
|
130
|
+
optional: PropTypes.bool,
|
|
131
|
+
/**
|
|
132
|
+
* The select input description
|
|
133
|
+
*/
|
|
134
|
+
description: PropTypes.string,
|
|
135
|
+
/**
|
|
136
|
+
* The number of columns the label should span
|
|
137
|
+
*/
|
|
138
|
+
labelSpan: PropTypes.number,
|
|
139
|
+
/**
|
|
140
|
+
* The number of columns the input should span
|
|
141
|
+
*/
|
|
142
|
+
inputSpan: PropTypes.number,
|
|
143
|
+
/**
|
|
144
|
+
* The number of columns the label should span on desktop
|
|
145
|
+
*/
|
|
146
|
+
desktopLabelSpan: PropTypes.number,
|
|
147
|
+
/**
|
|
148
|
+
* The number of columns the input should span on desktop
|
|
149
|
+
*/
|
|
150
|
+
desktopInputSpan: PropTypes.number,
|
|
151
|
+
/**
|
|
152
|
+
* The color of the label
|
|
153
|
+
*/
|
|
154
|
+
labelColor: PropTypes.string
|
|
121
155
|
};
|
|
122
156
|
ChoicesInput.defaultProps = {
|
|
123
|
-
|
|
124
|
-
gridColumnsDesktop: 3,
|
|
125
|
-
color: 'background2',
|
|
126
|
-
colorChecked: 'main2',
|
|
157
|
+
color: 'interactive',
|
|
127
158
|
disabled: false
|
|
128
159
|
};
|
|
129
160
|
export default /*#__PURE__*/memo(ChoicesInput);
|
|
@@ -44,7 +44,7 @@ const Choice = ({
|
|
|
44
44
|
disabled: disabled
|
|
45
45
|
})), /*#__PURE__*/React.createElement("label", {
|
|
46
46
|
htmlFor: id,
|
|
47
|
-
className: labelClassName,
|
|
47
|
+
className: [labelClassName, disabled && 'disabled'].filter(e => e).join(' '),
|
|
48
48
|
style: labelStyle
|
|
49
49
|
}, label));
|
|
50
50
|
};
|
|
@@ -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,186 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useInsertionEffect, memo } from 'react';
|
|
5
|
+
import { useFormikContext } from 'formik';
|
|
6
|
+
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
|
7
|
+
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
|
|
8
|
+
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
|
9
|
+
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
10
|
+
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
|
11
|
+
import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
|
12
|
+
import { ListPlugin } from '@lexical/react/LexicalListPlugin';
|
|
13
|
+
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin';
|
|
14
|
+
import { AutoLinkNode, LinkNode } from '@lexical/link';
|
|
15
|
+
import { ListItemNode, ListNode } from '@lexical/list';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
18
|
+
|
|
19
|
+
// Local Definitions
|
|
20
|
+
|
|
21
|
+
import { FormLabel, FormDescription, InputWrapper } from "../../common";
|
|
22
|
+
import { Toolbar, TreeViewPlugin } from "./common";
|
|
23
|
+
const baseClassName = styleNames.base;
|
|
24
|
+
const componentClassName = 'editor-input';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This is the component description.
|
|
28
|
+
*/
|
|
29
|
+
const EditorInput = ({
|
|
30
|
+
id,
|
|
31
|
+
className: userClassName,
|
|
32
|
+
style,
|
|
33
|
+
name,
|
|
34
|
+
label,
|
|
35
|
+
// validate,
|
|
36
|
+
resize,
|
|
37
|
+
color,
|
|
38
|
+
rows,
|
|
39
|
+
optional,
|
|
40
|
+
labelColor,
|
|
41
|
+
description,
|
|
42
|
+
disabled,
|
|
43
|
+
labelSpan,
|
|
44
|
+
desktopLabelSpan,
|
|
45
|
+
inputSpan,
|
|
46
|
+
desktopInputSpan,
|
|
47
|
+
showDebugger
|
|
48
|
+
// ...otherProps
|
|
49
|
+
}) => {
|
|
50
|
+
useInsertionEffect(() => {
|
|
51
|
+
import("./styles.scss");
|
|
52
|
+
}, []);
|
|
53
|
+
const formik = useFormikContext();
|
|
54
|
+
const setInitialValue = () => {
|
|
55
|
+
const value = formik.values[name];
|
|
56
|
+
return value || undefined;
|
|
57
|
+
};
|
|
58
|
+
const onChange = state => {
|
|
59
|
+
formik.setValues({
|
|
60
|
+
...formik.values,
|
|
61
|
+
[name]: JSON.stringify(state)
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const initialConfig = {
|
|
65
|
+
nameSpace: name,
|
|
66
|
+
editable: !disabled,
|
|
67
|
+
editorState: setInitialValue(),
|
|
68
|
+
theme: {
|
|
69
|
+
text: {
|
|
70
|
+
italic: 'italic',
|
|
71
|
+
strikethrough: 'strikethrough',
|
|
72
|
+
underline: 'underlined'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
nodes: [AutoLinkNode, LinkNode, ListNode, ListItemNode]
|
|
76
|
+
};
|
|
77
|
+
return /*#__PURE__*/React.createElement(LexicalComposer, {
|
|
78
|
+
initialConfig: initialConfig
|
|
79
|
+
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
80
|
+
name: name,
|
|
81
|
+
color: labelColor,
|
|
82
|
+
optional: optional,
|
|
83
|
+
columnSpan: labelSpan,
|
|
84
|
+
desktopColumnSpan: desktopLabelSpan
|
|
85
|
+
// {...otherProps}
|
|
86
|
+
}, label), /*#__PURE__*/React.createElement(InputWrapper, {
|
|
87
|
+
id: id,
|
|
88
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`, disabled && 'disabled'].filter(e => e).join(' '),
|
|
89
|
+
style: {
|
|
90
|
+
...style,
|
|
91
|
+
'--resize': resize,
|
|
92
|
+
'--rows': `${rows}em`
|
|
93
|
+
},
|
|
94
|
+
columnSpan: inputSpan,
|
|
95
|
+
desktopColumnSpan: desktopInputSpan
|
|
96
|
+
}, !disabled && /*#__PURE__*/React.createElement(Toolbar, null), /*#__PURE__*/React.createElement(RichTextPlugin, {
|
|
97
|
+
contentEditable: /*#__PURE__*/React.createElement(ContentEditable, {
|
|
98
|
+
id: name,
|
|
99
|
+
className: "content-editable"
|
|
100
|
+
})
|
|
101
|
+
}), /*#__PURE__*/React.createElement(OnChangePlugin, {
|
|
102
|
+
onChange: onChange
|
|
103
|
+
}), /*#__PURE__*/React.createElement(LinkPlugin, null), /*#__PURE__*/React.createElement(ListPlugin, null), /*#__PURE__*/React.createElement(TabIndentationPlugin, null), /*#__PURE__*/React.createElement(HistoryPlugin, null), /*#__PURE__*/React.createElement(FormDescription, {
|
|
104
|
+
className: "s-1",
|
|
105
|
+
description: description,
|
|
106
|
+
name: name
|
|
107
|
+
}), showDebugger && /*#__PURE__*/React.createElement(TreeViewPlugin, null)));
|
|
108
|
+
};
|
|
109
|
+
EditorInput.propTypes = {
|
|
110
|
+
/**
|
|
111
|
+
* The HTML id for this element
|
|
112
|
+
*/
|
|
113
|
+
id: PropTypes.string,
|
|
114
|
+
/**
|
|
115
|
+
* The HTML class names for this element
|
|
116
|
+
*/
|
|
117
|
+
className: PropTypes.string,
|
|
118
|
+
/**
|
|
119
|
+
* The React-written, css properties for this element.
|
|
120
|
+
*/
|
|
121
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
122
|
+
/**
|
|
123
|
+
* The input name (html - and Formik state)
|
|
124
|
+
*/
|
|
125
|
+
name: PropTypes.string.isRequired,
|
|
126
|
+
/**
|
|
127
|
+
* The input label
|
|
128
|
+
*/
|
|
129
|
+
label: PropTypes.string.isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* The input value validator function
|
|
132
|
+
*/
|
|
133
|
+
// validate:PropTypes.func,
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The number of rows int the text area
|
|
137
|
+
*/
|
|
138
|
+
rows: PropTypes.number,
|
|
139
|
+
/**
|
|
140
|
+
* Color of the text
|
|
141
|
+
*/
|
|
142
|
+
color: PropTypes.string,
|
|
143
|
+
/**
|
|
144
|
+
* Label base color
|
|
145
|
+
*/
|
|
146
|
+
labelColor: PropTypes.string,
|
|
147
|
+
/**
|
|
148
|
+
* Text area description
|
|
149
|
+
*/
|
|
150
|
+
description: PropTypes.string,
|
|
151
|
+
/**
|
|
152
|
+
* Whether the text area should be disabled
|
|
153
|
+
*/
|
|
154
|
+
disabled: PropTypes.bool,
|
|
155
|
+
/**
|
|
156
|
+
* Whether the input is optional or not
|
|
157
|
+
*/
|
|
158
|
+
optional: PropTypes.bool,
|
|
159
|
+
/**
|
|
160
|
+
* The number of columns the label should span
|
|
161
|
+
*/
|
|
162
|
+
labelSpan: PropTypes.number,
|
|
163
|
+
/**
|
|
164
|
+
* The number of columns the input should span
|
|
165
|
+
*/
|
|
166
|
+
inputSpan: PropTypes.number,
|
|
167
|
+
/**
|
|
168
|
+
* The number of columns the label should span on desktop
|
|
169
|
+
*/
|
|
170
|
+
desktopLabelSpan: PropTypes.number,
|
|
171
|
+
/**
|
|
172
|
+
* The number of columns the input should span on desktop
|
|
173
|
+
*/
|
|
174
|
+
desktopInputSpan: PropTypes.number,
|
|
175
|
+
/**
|
|
176
|
+
* The resize property of the text area
|
|
177
|
+
*/
|
|
178
|
+
resize: PropTypes.oneOf(['none', 'both', 'horizontal', 'vertical'])
|
|
179
|
+
};
|
|
180
|
+
EditorInput.defaultProps = {
|
|
181
|
+
rows: 10,
|
|
182
|
+
disabled: false,
|
|
183
|
+
color: 'paragraph',
|
|
184
|
+
resize: 'vertical'
|
|
185
|
+
};
|
|
186
|
+
export default /*#__PURE__*/memo(EditorInput);
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useEffect, useState, useCallback } from 'react';
|
|
4
|
+
import { $getSelection, $isRangeSelection, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, UNDO_COMMAND, REDO_COMMAND } from 'lexical';
|
|
5
|
+
import { INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, $isListNode, ListNode } from '@lexical/list';
|
|
6
|
+
import { $isAtNodeEnd } from '@lexical/selection';
|
|
7
|
+
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
|
8
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
9
|
+
import { mergeRegister, $getNearestNodeOfType } from '@lexical/utils';
|
|
10
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
11
|
+
const baseClassName = styleNames.base;
|
|
12
|
+
const componentClassName = 'toolbar';
|
|
13
|
+
const getSelectedNode = selection => {
|
|
14
|
+
const {
|
|
15
|
+
anchor,
|
|
16
|
+
focus
|
|
17
|
+
} = selection;
|
|
18
|
+
const anchorNode = selection.anchor.getNode();
|
|
19
|
+
const focusNode = selection.focus.getNode();
|
|
20
|
+
if (anchorNode === focusNode) {
|
|
21
|
+
return anchorNode;
|
|
22
|
+
}
|
|
23
|
+
const isBackward = selection.isBackward();
|
|
24
|
+
if (isBackward) {
|
|
25
|
+
return $isAtNodeEnd(focus) ? anchorNode : focusNode;
|
|
26
|
+
}
|
|
27
|
+
return $isAtNodeEnd(anchor) ? focusNode : anchorNode;
|
|
28
|
+
};
|
|
29
|
+
const Toolbar = () => {
|
|
30
|
+
const [editor] = useLexicalComposerContext();
|
|
31
|
+
const [isBold, setIsBold] = useState(false);
|
|
32
|
+
const [isItalic, setIsItalic] = useState(false);
|
|
33
|
+
const [isStrikethrough, setIsStrikethrough] = useState(false);
|
|
34
|
+
const [blockType, setBlockType] = useState('paragraph');
|
|
35
|
+
const [isLink, setIsLink] = useState(false);
|
|
36
|
+
const [isUnderline, setIsUnderline] = useState(false);
|
|
37
|
+
const formatBulletList = () => {
|
|
38
|
+
if (blockType !== 'ul') {
|
|
39
|
+
editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND);
|
|
40
|
+
} else {
|
|
41
|
+
editor.dispatchCommand(REMOVE_LIST_COMMAND);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const formatNumberedList = () => {
|
|
45
|
+
if (blockType !== 'ol') {
|
|
46
|
+
editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND);
|
|
47
|
+
} else {
|
|
48
|
+
editor.dispatchCommand(REMOVE_LIST_COMMAND);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const formatLink = useCallback(() => {
|
|
52
|
+
if (!isLink) {
|
|
53
|
+
// eslint-disable-next-line no-alert
|
|
54
|
+
const path = prompt('Enter the full URL. Ex: https://www.example.com');
|
|
55
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, path);
|
|
56
|
+
} else {
|
|
57
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
|
|
58
|
+
}
|
|
59
|
+
}, [editor, isLink]);
|
|
60
|
+
const updateToolbar = useCallback(() => {
|
|
61
|
+
const selection = $getSelection();
|
|
62
|
+
|
|
63
|
+
// Check list selection
|
|
64
|
+
if ($isRangeSelection(selection)) {
|
|
65
|
+
const anchorNode = selection.anchor.getNode();
|
|
66
|
+
const element = anchorNode.getKey() === 'root' ? anchorNode : anchorNode.getTopLevelElementOrThrow();
|
|
67
|
+
if ($isListNode(element)) {
|
|
68
|
+
const parentList = $getNearestNodeOfType(anchorNode, ListNode);
|
|
69
|
+
const type = parentList ? parentList.getTag() : element.getTag();
|
|
70
|
+
setBlockType(type);
|
|
71
|
+
} else {
|
|
72
|
+
setBlockType(element);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Check selection text styles
|
|
76
|
+
setIsBold(selection.hasFormat('bold'));
|
|
77
|
+
setIsItalic(selection.hasFormat('italic'));
|
|
78
|
+
setIsStrikethrough(selection.hasFormat('strikethrough'));
|
|
79
|
+
setIsUnderline(selection.hasFormat('underline'));
|
|
80
|
+
setIsLink(selection.hasFormat('link'));
|
|
81
|
+
|
|
82
|
+
// Check links
|
|
83
|
+
const node = getSelectedNode(selection);
|
|
84
|
+
const parent = node.getParent();
|
|
85
|
+
if ($isLinkNode(parent) || $isLinkNode(node)) {
|
|
86
|
+
setIsLink(true);
|
|
87
|
+
} else {
|
|
88
|
+
setIsLink(false);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, [editor]);
|
|
92
|
+
useEffect(() => mergeRegister(editor.registerUpdateListener(({
|
|
93
|
+
editorState
|
|
94
|
+
}) => {
|
|
95
|
+
editorState.read(() => {
|
|
96
|
+
updateToolbar();
|
|
97
|
+
});
|
|
98
|
+
})), [updateToolbar, editor]);
|
|
99
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: `${baseClassName} ${componentClassName}`
|
|
101
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: "group"
|
|
103
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
104
|
+
type: "button",
|
|
105
|
+
className: isBold ? 'active' : undefined,
|
|
106
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')
|
|
107
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
108
|
+
className: "icon"
|
|
109
|
+
}, "|")), /*#__PURE__*/React.createElement("button", {
|
|
110
|
+
type: "button",
|
|
111
|
+
className: isItalic ? 'active' : undefined,
|
|
112
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')
|
|
113
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
114
|
+
className: "icon"
|
|
115
|
+
}, "}")), /*#__PURE__*/React.createElement("button", {
|
|
116
|
+
type: "button",
|
|
117
|
+
className: isUnderline ? 'active' : undefined,
|
|
118
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')
|
|
119
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
120
|
+
className: "icon"
|
|
121
|
+
}, "~")), /*#__PURE__*/React.createElement("button", {
|
|
122
|
+
type: "button",
|
|
123
|
+
className: isStrikethrough ? 'active' : undefined,
|
|
124
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')
|
|
125
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
126
|
+
className: "icon"
|
|
127
|
+
}, "?")), /*#__PURE__*/React.createElement("button", {
|
|
128
|
+
type: "button",
|
|
129
|
+
className: isLink ? 'active' : undefined,
|
|
130
|
+
onClick: () => formatLink()
|
|
131
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
132
|
+
className: "icon"
|
|
133
|
+
}, "]")), /*#__PURE__*/React.createElement("button", {
|
|
134
|
+
type: "button",
|
|
135
|
+
className: blockType === 'ul' ? 'active' : undefined,
|
|
136
|
+
onClick: () => formatBulletList()
|
|
137
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
138
|
+
className: "icon"
|
|
139
|
+
}, ".")), /*#__PURE__*/React.createElement("button", {
|
|
140
|
+
type: "button",
|
|
141
|
+
className: blockType === 'ol' ? 'active' : undefined,
|
|
142
|
+
onClick: () => formatNumberedList()
|
|
143
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
144
|
+
className: "icon"
|
|
145
|
+
}, "-"))), /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
className: "group"
|
|
147
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
148
|
+
type: "button",
|
|
149
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')
|
|
150
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
151
|
+
className: "icon"
|
|
152
|
+
}, "^")), /*#__PURE__*/React.createElement("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')
|
|
155
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
156
|
+
className: "icon"
|
|
157
|
+
}, "_")), /*#__PURE__*/React.createElement("button", {
|
|
158
|
+
type: "button",
|
|
159
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')
|
|
160
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
161
|
+
className: "icon"
|
|
162
|
+
}, "`")), /*#__PURE__*/React.createElement("button", {
|
|
163
|
+
type: "button",
|
|
164
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')
|
|
165
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
166
|
+
className: "icon"
|
|
167
|
+
}, "{"))), /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: "group"
|
|
169
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
170
|
+
type: "button",
|
|
171
|
+
onClick: () => editor.dispatchCommand(UNDO_COMMAND)
|
|
172
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
173
|
+
className: "icon"
|
|
174
|
+
}, "\\")), /*#__PURE__*/React.createElement("button", {
|
|
175
|
+
type: "button",
|
|
176
|
+
className: "flip",
|
|
177
|
+
onClick: () => editor.dispatchCommand(REDO_COMMAND)
|
|
178
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
179
|
+
className: "icon"
|
|
180
|
+
}, "\\"))));
|
|
181
|
+
};
|
|
182
|
+
export default Toolbar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
|
+
import { TreeView } from '@lexical/react/LexicalTreeView';
|
|
4
|
+
const TreeViewPlugin = () => {
|
|
5
|
+
const [editor] = useLexicalComposerContext();
|
|
6
|
+
return /*#__PURE__*/React.createElement(TreeView, {
|
|
7
|
+
viewClassName: "tree-view-output",
|
|
8
|
+
editor: editor
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export default TreeViewPlugin;
|