@pareto-engineering/design-system 2.0.0-alpha.6 → 2.0.0-alpha.60
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/.env.scripts.example +4 -0
- package/.eslintrc.js +25 -1
- package/babel.config.js +1 -0
- package/dist/cjs/a/Alert/Alert.js +141 -0
- package/dist/cjs/a/Alert/index.js +15 -0
- package/dist/cjs/a/Alert/styles.scss +74 -0
- package/dist/cjs/a/AppContext/Context.js +16 -0
- package/dist/cjs/a/AppContext/ContextProvider.js +96 -0
- package/dist/cjs/a/AppContext/index.js +39 -0
- package/dist/cjs/a/AppContext/useApp.js +16 -0
- package/dist/cjs/a/AppContext/useTheme.js +45 -0
- package/dist/cjs/a/BackgroundGradient/BackgroundGradient.js +77 -0
- package/dist/cjs/a/BackgroundGradient/index.js +15 -0
- package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
- package/dist/cjs/a/ContentTree/ContentTree.js +83 -0
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +116 -0
- package/dist/cjs/a/ContentTree/common/Tree/index.js +15 -0
- package/dist/cjs/a/ContentTree/common/index.js +31 -0
- package/dist/cjs/a/ContentTree/common/useContentTree.js +82 -0
- package/dist/cjs/a/ContentTree/common/useFirstVisibleNode.js +65 -0
- package/dist/cjs/a/ContentTree/index.js +15 -0
- package/dist/cjs/a/ContentTree/styles.scss +33 -0
- package/dist/cjs/a/Conversation/Conversation.js +14 -8
- package/dist/cjs/a/Conversation/common/Message/Message.js +32 -6
- package/dist/cjs/a/Conversation/styles.scss +132 -33
- package/dist/cjs/a/OvalIllustration/OvalIllustration.js +133 -0
- package/dist/cjs/a/OvalIllustration/index.js +15 -0
- package/dist/cjs/a/OvalIllustration/styles.scss +102 -0
- package/dist/cjs/a/Popover/Popover.js +134 -0
- package/dist/cjs/a/Popover/common/Divider/Divider.js +67 -0
- package/dist/cjs/a/Popover/common/Divider/index.js +15 -0
- package/dist/cjs/a/Popover/common/Item/Item.js +67 -0
- package/dist/cjs/a/Popover/common/Item/index.js +15 -0
- package/dist/cjs/a/Popover/common/index.js +21 -0
- package/dist/cjs/a/Popover/index.js +15 -0
- package/dist/cjs/a/Popover/styles.scss +33 -0
- package/dist/cjs/a/Shapes/Shapes.js +9 -1
- package/dist/cjs/a/Shapes/styles.scss +42 -9
- package/dist/cjs/a/SnapScroller/SnapScroller.js +77 -0
- package/dist/cjs/a/SnapScroller/index.js +15 -0
- package/dist/cjs/a/SnapScroller/styles.scss +38 -0
- package/dist/cjs/a/index.js +57 -9
- package/dist/cjs/b/Button/Button.js +10 -4
- package/dist/cjs/b/Button/styles.scss +55 -10
- package/dist/cjs/b/Logo/Logo.js +41 -41
- package/dist/cjs/b/Logo/styles.scss +0 -138
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +1 -1
- package/dist/cjs/b/Page/common/Section/Section.js +17 -3
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +4 -4
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +1 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +16 -9
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/cjs/c/ContentSlides/styles.scss +10 -4
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +111 -0
- package/dist/cjs/c/SocialMediaShareButton/index.js +15 -0
- package/dist/cjs/c/SocialMediaShareButton/styles.scss +39 -0
- package/dist/cjs/c/index.js +9 -1
- package/dist/cjs/f/FormInput/FormInput.js +26 -3
- package/dist/cjs/f/FormInput/styles.scss +11 -0
- package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
- package/dist/cjs/f/common/Description/Description.js +20 -14
- package/dist/cjs/f/common/Label/Label.js +1 -1
- package/dist/cjs/f/common/Label/styles.scss +1 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +2 -2
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +5 -2
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/cjs/f/fields/IntlTelInput/IntlTelInput.js +170 -0
- package/dist/cjs/f/fields/IntlTelInput/index.js +15 -0
- package/dist/cjs/f/fields/IntlTelInput/styles.scss +37 -0
- package/dist/cjs/f/fields/PhoneIntlTelInput/PhoneIntlTelInput.js +180 -0
- package/dist/cjs/f/fields/PhoneIntlTelInput/index.js +15 -0
- package/dist/cjs/f/fields/PhoneIntlTelInput/styles.scss +43 -0
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +235 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +208 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +103 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +307 -0
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/index.js +29 -0
- package/dist/cjs/f/fields/QueryCombobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +90 -0
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +201 -0
- package/dist/cjs/f/fields/QuerySelect/index.js +15 -0
- package/dist/cjs/f/fields/QuerySelect/styles.scss +21 -0
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +39 -6
- package/dist/cjs/f/fields/RatingsInput/styles.scss +29 -20
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +59 -14
- package/dist/cjs/f/fields/SelectInput/styles.scss +33 -13
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/cjs/f/fields/TextInput/TextInput.js +50 -13
- package/dist/cjs/f/fields/TextInput/styles.scss +16 -7
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +41 -15
- package/dist/cjs/f/fields/TextareaInput/styles.scss +19 -6
- package/dist/cjs/f/fields/index.js +15 -23
- package/dist/cjs/form-reset.scss +1 -1
- package/dist/cjs/index.js +26 -0
- package/dist/cjs/test/QueryLoader/QueryLoader.js +41 -0
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +49 -0
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/index.js +15 -0
- package/dist/cjs/test/QueryLoader/common/index.js +13 -0
- package/dist/cjs/test/QueryLoader/index.js +15 -0
- package/dist/cjs/test/QueryLoader/styles.scss +9 -0
- package/dist/cjs/test/index.js +13 -0
- package/dist/cjs/utils/hooks/index.js +23 -0
- package/dist/cjs/utils/hooks/useDynamicPosition.js +107 -0
- package/dist/cjs/utils/hooks/useWindowSize.js +39 -0
- package/dist/cjs/utils/index.js +19 -0
- package/dist/es/a/Alert/Alert.js +118 -0
- package/dist/es/a/Alert/index.js +2 -0
- package/dist/es/a/Alert/styles.scss +74 -0
- package/dist/es/a/AppContext/Context.js +2 -0
- package/dist/es/a/AppContext/ContextProvider.js +78 -0
- package/dist/es/a/AppContext/index.js +5 -0
- package/dist/es/a/AppContext/useApp.js +3 -0
- package/dist/es/a/AppContext/useTheme.js +34 -0
- package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
- package/dist/es/a/BackgroundGradient/index.js +2 -0
- package/dist/es/a/BackgroundGradient/styles.scss +16 -0
- package/dist/es/a/ContentTree/ContentTree.js +67 -0
- package/dist/es/a/ContentTree/common/Tree/Tree.js +98 -0
- package/dist/es/a/ContentTree/common/Tree/index.js +2 -0
- package/dist/es/a/ContentTree/common/index.js +3 -0
- package/dist/es/a/ContentTree/common/useContentTree.js +74 -0
- package/dist/es/a/ContentTree/common/useFirstVisibleNode.js +54 -0
- package/dist/es/a/ContentTree/index.js +2 -0
- package/dist/es/a/ContentTree/styles.scss +33 -0
- package/dist/es/a/Conversation/Conversation.js +14 -8
- package/dist/es/a/Conversation/common/Message/Message.js +32 -6
- package/dist/es/a/Conversation/styles.scss +132 -33
- package/dist/es/a/OvalIllustration/OvalIllustration.js +111 -0
- package/dist/es/a/OvalIllustration/index.js +2 -0
- package/dist/es/a/OvalIllustration/styles.scss +102 -0
- package/dist/es/a/Popover/Popover.js +118 -0
- package/dist/es/a/Popover/common/Divider/Divider.js +47 -0
- package/dist/es/a/Popover/common/Divider/index.js +2 -0
- package/dist/es/a/Popover/common/Item/Item.js +47 -0
- package/dist/es/a/Popover/common/Item/index.js +2 -0
- package/dist/es/a/Popover/common/index.js +2 -0
- package/dist/es/a/Popover/index.js +2 -0
- package/dist/es/a/Popover/styles.scss +33 -0
- package/dist/es/a/Shapes/Shapes.js +9 -1
- package/dist/es/a/Shapes/styles.scss +42 -9
- package/dist/es/a/SnapScroller/SnapScroller.js +61 -0
- package/dist/es/a/SnapScroller/index.js +2 -0
- package/dist/es/a/SnapScroller/styles.scss +38 -0
- package/dist/es/a/index.js +8 -2
- package/dist/es/b/Button/Button.js +8 -2
- package/dist/es/b/Button/styles.scss +55 -10
- package/dist/es/b/Logo/Logo.js +41 -41
- package/dist/es/b/Logo/styles.scss +0 -138
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +2 -2
- package/dist/es/b/Page/common/Section/Section.js +17 -3
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +5 -5
- package/dist/es/b/ThemeSelector/ThemeSelector.js +2 -2
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +16 -9
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/es/c/ContentSlides/styles.scss +10 -4
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +95 -0
- package/dist/es/c/SocialMediaShareButton/index.js +2 -0
- package/dist/es/c/SocialMediaShareButton/styles.scss +39 -0
- package/dist/es/c/index.js +2 -1
- package/dist/es/f/FormInput/FormInput.js +26 -3
- package/dist/es/f/FormInput/styles.scss +11 -0
- package/dist/es/f/common/Debugger/Debugger.js +1 -1
- package/dist/es/f/common/Description/Description.js +19 -14
- package/dist/es/f/common/Label/Label.js +1 -1
- package/dist/es/f/common/Label/styles.scss +1 -1
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +2 -2
- package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +5 -2
- package/dist/es/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/es/f/fields/IntlTelInput/IntlTelInput.js +152 -0
- package/dist/es/f/fields/IntlTelInput/index.js +2 -0
- package/dist/es/f/fields/IntlTelInput/styles.scss +37 -0
- package/dist/es/f/fields/PhoneIntlTelInput/PhoneIntlTelInput.js +163 -0
- package/dist/es/f/fields/PhoneIntlTelInput/index.js +2 -0
- package/dist/es/f/fields/PhoneIntlTelInput/styles.scss +43 -0
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +212 -0
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +188 -0
- package/dist/es/f/fields/QueryCombobox/common/Combobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/Menu/Menu.js +77 -0
- package/dist/es/f/fields/QueryCombobox/common/Menu/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +279 -0
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/index.js +3 -0
- package/dist/es/f/fields/QueryCombobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/styles.scss +90 -0
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +179 -0
- package/dist/es/f/fields/QuerySelect/index.js +2 -0
- package/dist/es/f/fields/QuerySelect/styles.scss +21 -0
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +38 -6
- package/dist/es/f/fields/RatingsInput/styles.scss +29 -20
- package/dist/es/f/fields/SelectInput/SelectInput.js +58 -14
- package/dist/es/f/fields/SelectInput/styles.scss +33 -13
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/es/f/fields/TextInput/TextInput.js +50 -13
- package/dist/es/f/fields/TextInput/styles.scss +16 -7
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +41 -15
- package/dist/es/f/fields/TextareaInput/styles.scss +19 -6
- package/dist/es/f/fields/index.js +3 -4
- package/dist/es/form-reset.scss +1 -1
- package/dist/es/index.js +3 -1
- package/dist/es/test/QueryLoader/QueryLoader.js +29 -0
- package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
- package/dist/es/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +31 -0
- package/dist/es/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
- package/dist/es/test/QueryLoader/common/index.js +1 -0
- package/dist/es/test/QueryLoader/index.js +2 -0
- package/dist/es/test/QueryLoader/styles.scss +9 -0
- package/dist/es/test/index.js +1 -0
- package/dist/es/utils/hooks/index.js +2 -0
- package/dist/es/utils/hooks/useDynamicPosition.js +93 -0
- package/dist/es/utils/hooks/useWindowSize.js +27 -0
- package/dist/es/utils/index.js +1 -0
- package/package.json +18 -4
- package/relay.config.js +12 -0
- package/schema.graphql +4075 -0
- package/scripts/fetchSchema.js +74 -0
- package/src/__snapshots__/Storyshots.test.js.snap +10152 -5495
- package/src/local.scss +4 -2
- package/src/stories/StyleGuide/Sprites.stories.mdx +25 -0
- package/src/stories/StyleGuide/helpers.js +16 -0
- package/src/stories/a/Alert.stories.jsx +75 -0
- package/src/stories/a/{SiteContext.stories.jsx → AppContext.stories.jsx} +8 -8
- package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
- package/src/stories/a/ContentTree.stories.jsx +662 -0
- package/src/stories/a/Conversation.stories.jsx +78 -1
- package/src/stories/a/DotInfo.stories.jsx +14 -13
- package/src/stories/a/OvalIllustration.stories.jsx +59 -0
- package/src/stories/a/Popover.stories.jsx +106 -0
- package/src/stories/a/ProgressBar.stories.jsx +16 -7
- package/src/stories/a/Shapes.stories.jsx +18 -0
- package/src/stories/a/SnapScroller.stories.jsx +98 -0
- package/src/stories/a/Timestamp.stories.jsx +35 -39
- package/src/stories/b/Button.stories.jsx +27 -4
- package/src/stories/b/Logo.stories.jsx +23 -14
- package/src/stories/b/Page.stories.jsx +25 -1
- package/src/stories/b/QuestionDropdown.stories.jsx +20 -30
- package/src/stories/b/SocialMediaButton.stories.jsx +36 -53
- package/src/stories/b/ThemeSelector.stories.jsx +5 -5
- package/src/stories/b/Title.stories.jsx +13 -15
- package/src/stories/c/ContentSlides.stories.jsx +35 -151
- package/src/stories/c/Shortener.stories.jsx +9 -3
- package/src/stories/c/SocialMediaShareButton.stories.jsx +33 -0
- package/src/stories/f/ChoicesInput.stories.jsx +91 -129
- package/src/stories/f/Description.stories.jsx +22 -4
- package/src/stories/f/FormInput.stories.jsx +259 -0
- package/src/stories/f/QueryCombobox.stories.jsx +273 -0
- package/src/stories/f/QuerySelect.stories.jsx +135 -0
- package/src/stories/f/RatingsInput.stories.jsx +29 -22
- package/src/stories/f/SelectInput.stories.jsx +41 -49
- package/src/stories/f/TextInput.stories.jsx +63 -43
- package/src/stories/f/TextareaInput.stories.jsx +63 -19
- package/src/stories/f/__generated__/FormInputAllTaskStatusesQuery.graphql.js +122 -0
- package/src/stories/f/__generated__/FormInputAllTeamsQuery.graphql.js +139 -0
- package/src/stories/f/__generated__/QueryComboboxAllTeamsQuery.graphql.js +139 -0
- package/src/stories/f/__generated__/QuerySelectAllTaskStatusesQuery.graphql.js +122 -0
- package/src/stories/test/QueryLoader.stories.jsx +36 -0
- package/src/stories/utils/generateNodeId.js +12 -0
- package/src/stories/utils/lorem.js +15 -0
- package/src/stories/utils/relay/EnvironmentProvider.jsx +14 -0
- package/src/stories/utils/relay/environment.js +5 -0
- package/src/stories/utils/relay/index.js +4 -0
- package/src/stories/utils/relay/mockRelayOperation.js +14 -0
- package/src/stories/utils/relay/mockResolvers.js +299 -0
- package/src/stories/utils/testData.js +63 -0
- package/src/ui/a/Alert/Alert.jsx +144 -0
- package/src/ui/a/Alert/index.js +2 -0
- package/src/ui/a/Alert/styles.scss +74 -0
- package/src/ui/a/{SiteContext → AppContext}/Context.js +0 -0
- package/src/ui/a/{SiteContext → AppContext}/ContextProvider.jsx +8 -7
- package/src/ui/a/AppContext/index.js +5 -0
- package/src/ui/a/{SiteContext/useSite.js → AppContext/useApp.js} +0 -0
- package/src/ui/a/{SiteContext → AppContext}/useTheme.js +0 -0
- package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
- package/src/ui/a/BackgroundGradient/index.js +2 -0
- package/src/ui/a/BackgroundGradient/styles.scss +16 -0
- package/src/ui/a/ContentTree/ContentTree.jsx +88 -0
- package/src/ui/a/ContentTree/common/Tree/Tree.jsx +138 -0
- package/src/ui/a/ContentTree/common/Tree/index.js +2 -0
- package/src/ui/a/ContentTree/common/index.js +3 -0
- package/src/ui/a/ContentTree/common/useContentTree.js +83 -0
- package/src/ui/a/ContentTree/common/useFirstVisibleNode.js +59 -0
- package/src/ui/a/ContentTree/index.js +2 -0
- package/src/ui/a/ContentTree/styles.scss +33 -0
- package/src/ui/a/Conversation/Conversation.jsx +15 -7
- package/src/ui/a/Conversation/common/Message/Message.jsx +38 -6
- package/src/ui/a/Conversation/styles.scss +132 -33
- package/src/ui/a/OvalIllustration/OvalIllustration.jsx +134 -0
- package/src/ui/a/OvalIllustration/index.js +2 -0
- package/src/ui/a/OvalIllustration/styles.scss +102 -0
- package/src/ui/a/Popover/Popover.jsx +157 -0
- package/src/ui/a/Popover/index.js +2 -0
- package/src/ui/a/Popover/styles.scss +33 -0
- package/src/ui/a/Shapes/Shapes.jsx +10 -0
- package/src/ui/a/Shapes/styles.scss +42 -9
- package/src/ui/a/SnapScroller/SnapScroller.jsx +83 -0
- package/src/ui/a/SnapScroller/index.js +2 -0
- package/src/ui/a/SnapScroller/styles.scss +38 -0
- package/src/ui/a/index.js +10 -4
- package/src/ui/b/Button/Button.jsx +9 -1
- package/src/ui/b/Button/styles.scss +55 -10
- package/src/ui/b/Logo/Logo.jsx +41 -41
- package/src/ui/b/Logo/styles.scss +0 -138
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +2 -2
- package/src/ui/b/Page/common/Section/Section.jsx +19 -2
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +4 -4
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +2 -2
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +12 -5
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
- package/src/ui/c/ContentSlides/styles.scss +10 -4
- package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +121 -0
- package/src/ui/c/SocialMediaShareButton/index.js +2 -0
- package/src/ui/c/SocialMediaShareButton/styles.scss +39 -0
- package/src/ui/c/index.js +1 -0
- package/src/ui/f/FormInput/FormInput.jsx +38 -1
- package/src/ui/f/FormInput/styles.scss +11 -0
- package/src/ui/f/common/Debugger/Debugger.jsx +1 -1
- package/src/ui/f/common/Description/Description.jsx +34 -29
- package/src/ui/f/common/Label/Label.jsx +1 -1
- package/src/ui/f/common/Label/styles.scss +1 -1
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +2 -2
- package/src/ui/f/fields/ChoicesInput/common/Choice/Choice.jsx +10 -2
- package/src/ui/f/fields/ChoicesInput/styles.scss +17 -2
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +227 -0
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +218 -0
- package/src/ui/f/fields/QueryCombobox/common/Combobox/index.js +2 -0
- package/src/ui/f/fields/QueryCombobox/common/Menu/Menu.jsx +103 -0
- package/src/ui/f/fields/QueryCombobox/common/Menu/index.js +2 -0
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +314 -0
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/src/ui/f/fields/QueryCombobox/common/index.js +3 -0
- package/src/ui/f/fields/QueryCombobox/index.js +2 -0
- package/src/ui/f/fields/QueryCombobox/styles.scss +90 -0
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +200 -0
- package/src/ui/f/fields/QuerySelect/index.js +2 -0
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +54 -19
- package/src/ui/f/fields/RatingsInput/styles.scss +29 -20
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +66 -8
- package/src/ui/f/fields/SelectInput/styles.scss +33 -13
- package/src/ui/f/fields/TextInput/TextInput.jsx +44 -10
- package/src/ui/f/fields/TextInput/styles.scss +16 -7
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +42 -21
- package/src/ui/f/fields/TextareaInput/styles.scss +19 -6
- package/src/ui/f/fields/index.js +2 -3
- package/src/ui/form-reset.scss +1 -1
- package/src/ui/index.js +2 -0
- package/src/ui/test/QueryLoader/QueryLoader.jsx +41 -0
- package/src/ui/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +68 -0
- package/src/ui/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.jsx +51 -0
- package/src/ui/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
- package/src/ui/test/QueryLoader/common/index.js +1 -0
- package/src/ui/test/QueryLoader/index.js +2 -0
- package/src/ui/test/index.js +1 -0
- package/src/ui/utils/hooks/index.js +2 -0
- package/src/ui/utils/hooks/useDynamicPosition.js +104 -0
- package/src/ui/utils/hooks/useWindowSize.js +32 -0
- package/src/ui/utils/index.js +1 -0
- package/stylelint.config.js +13 -13
- package/src/stories/f/CheckboxInput.stories.jsx +0 -37
- package/src/stories/f/RadioInput.stories.jsx +0 -37
- package/src/stories/f/TaskRecommendationInput.stories.jsx +0 -38
- package/src/ui/a/SiteContext/index.js +0 -5
- package/src/ui/f/fields/CheckboxInput/CheckboxInput.jsx +0 -107
- package/src/ui/f/fields/CheckboxInput/index.js +0 -2
- package/src/ui/f/fields/CheckboxInput/styles.scss +0 -28
- package/src/ui/f/fields/RadioInput/RadioInput.jsx +0 -112
- package/src/ui/f/fields/RadioInput/index.js +0 -2
- package/src/ui/f/fields/RadioInput/styles.scss +0 -26
- package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +0 -130
- package/src/ui/f/fields/TaskRecommendationInput/index.js +0 -2
- package/src/ui/f/fields/TaskRecommendationInput/styles.scss +0 -41
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactRelay = require("react-relay");
|
|
11
|
+
|
|
12
|
+
var _formik = require("formik");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _ = require("../..");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
25
|
+
// Local Definitions
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* This is the component description.
|
|
29
|
+
*/
|
|
30
|
+
var QuerySelect = _ref => {
|
|
31
|
+
var {
|
|
32
|
+
id,
|
|
33
|
+
className: userClassName,
|
|
34
|
+
style,
|
|
35
|
+
name,
|
|
36
|
+
label,
|
|
37
|
+
query,
|
|
38
|
+
variables,
|
|
39
|
+
optionsKeyMap,
|
|
40
|
+
description,
|
|
41
|
+
disabled,
|
|
42
|
+
color,
|
|
43
|
+
loadingOption,
|
|
44
|
+
defaultOption // ...otherProps
|
|
45
|
+
|
|
46
|
+
} = _ref;
|
|
47
|
+
var [,, helpers] = (0, _formik.useField)(name);
|
|
48
|
+
var {
|
|
49
|
+
setError
|
|
50
|
+
} = helpers;
|
|
51
|
+
var environment = (0, _reactRelay.useRelayEnvironment)();
|
|
52
|
+
var [isFetching, setIsFetching] = (0, React.useState)(false);
|
|
53
|
+
var [options, setOptions] = (0, React.useState)([]);
|
|
54
|
+
var {
|
|
55
|
+
graphql,
|
|
56
|
+
accessor
|
|
57
|
+
} = query;
|
|
58
|
+
|
|
59
|
+
var getOptions = () => {
|
|
60
|
+
if (isFetching) return;
|
|
61
|
+
(0, _reactRelay.fetchQuery)(environment, graphql, variables).subscribe({
|
|
62
|
+
start: () => {
|
|
63
|
+
setIsFetching(true);
|
|
64
|
+
setOptions([loadingOption]);
|
|
65
|
+
},
|
|
66
|
+
complete: () => {
|
|
67
|
+
setIsFetching(false);
|
|
68
|
+
},
|
|
69
|
+
error: fetchError => {
|
|
70
|
+
setIsFetching(false);
|
|
71
|
+
if (setError) setError(fetchError.message);
|
|
72
|
+
},
|
|
73
|
+
next: data => {
|
|
74
|
+
setOptions([defaultOption, ...data[accessor].edges.map(_ref2 => {
|
|
75
|
+
var {
|
|
76
|
+
node
|
|
77
|
+
} = _ref2;
|
|
78
|
+
return {
|
|
79
|
+
value: node[optionsKeyMap.value],
|
|
80
|
+
label: optionsKeyMap.getLabel(node)
|
|
81
|
+
};
|
|
82
|
+
})]);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
(0, React.useEffect)(() => {
|
|
88
|
+
getOptions();
|
|
89
|
+
}, [variables]);
|
|
90
|
+
return /*#__PURE__*/React.createElement(_.SelectInput, {
|
|
91
|
+
id: id,
|
|
92
|
+
className: userClassName,
|
|
93
|
+
style: style,
|
|
94
|
+
name: name,
|
|
95
|
+
label: label,
|
|
96
|
+
color: color,
|
|
97
|
+
description: description,
|
|
98
|
+
disabled: isFetching || disabled,
|
|
99
|
+
options: options,
|
|
100
|
+
isLoading: isFetching
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
QuerySelect.propTypes = {
|
|
105
|
+
/**
|
|
106
|
+
* The HTML id for this element
|
|
107
|
+
*/
|
|
108
|
+
id: _propTypes.default.string,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The HTML class names for this element
|
|
112
|
+
*/
|
|
113
|
+
className: _propTypes.default.string,
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The React-written, css properties for this element.
|
|
117
|
+
*/
|
|
118
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The name of the custom select input
|
|
122
|
+
*/
|
|
123
|
+
name: _propTypes.default.string,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The label of the custom select input
|
|
127
|
+
*/
|
|
128
|
+
label: _propTypes.default.string,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The custom select input description
|
|
132
|
+
*/
|
|
133
|
+
description: _propTypes.default.string,
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Whether the input should be disabled
|
|
137
|
+
*/
|
|
138
|
+
disabled: _propTypes.default.bool,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The base color of the custom select input
|
|
142
|
+
*/
|
|
143
|
+
color: _propTypes.default.string,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The graphql query to fetch the options and the accessor to destructure the results from
|
|
147
|
+
*/
|
|
148
|
+
query: _propTypes.default.shape({
|
|
149
|
+
accessor: _propTypes.default.string,
|
|
150
|
+
graphql: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]).isRequired
|
|
151
|
+
}),
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The variables that might be required to be used in the query to fetch
|
|
155
|
+
* select options.
|
|
156
|
+
*/
|
|
157
|
+
variables: _propTypes.default.objectOf(_propTypes.default.string),
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The select option keys to be used to map the data to the select options.
|
|
161
|
+
* i.e `{ value: 'id', label: 'name' }`
|
|
162
|
+
*/
|
|
163
|
+
optionsKeyMap: _propTypes.default.shape({
|
|
164
|
+
value: _propTypes.default.string.isRequired,
|
|
165
|
+
getLabel: _propTypes.default.func.isRequired
|
|
166
|
+
}).isRequired,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The default select option for the query select
|
|
170
|
+
*/
|
|
171
|
+
defaultOption: _propTypes.default.shape({
|
|
172
|
+
value: _propTypes.default.string.isRequired,
|
|
173
|
+
label: _propTypes.default.string.isRequired,
|
|
174
|
+
disabled: _propTypes.default.bool.isRequired
|
|
175
|
+
}),
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The option to dipslayed when the select options are being fetched
|
|
179
|
+
*/
|
|
180
|
+
loadingOption: _propTypes.default.shape({
|
|
181
|
+
value: _propTypes.default.string.isRequired,
|
|
182
|
+
label: _propTypes.default.string.isRequired,
|
|
183
|
+
disabled: _propTypes.default.bool.isRequired
|
|
184
|
+
})
|
|
185
|
+
};
|
|
186
|
+
QuerySelect.defaultProps = {
|
|
187
|
+
disabled: false,
|
|
188
|
+
color: 'background2',
|
|
189
|
+
defaultOption: {
|
|
190
|
+
value: '',
|
|
191
|
+
label: 'Select an option',
|
|
192
|
+
disabled: true
|
|
193
|
+
},
|
|
194
|
+
loadingOption: {
|
|
195
|
+
value: '',
|
|
196
|
+
label: 'Fetching Options',
|
|
197
|
+
disabled: true
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var _default = QuerySelect;
|
|
201
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "QuerySelect", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _QuerySelect.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _QuerySelect = _interopRequireDefault(require("./QuerySelect"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
$default-loading-circle-displacement: .8em;
|
|
5
|
+
|
|
6
|
+
.#{bem.$base}.query-select {
|
|
7
|
+
position: relative;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
>.#{bem.$base}.select-input {
|
|
11
|
+
select:disabled {
|
|
12
|
+
appearance: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
>.#{bem.$base}.loading-circle {
|
|
17
|
+
position: absolute;
|
|
18
|
+
right: $default-loading-circle-displacement;
|
|
19
|
+
bottom: $default-loading-circle-displacement;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -13,6 +13,8 @@ var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
|
|
|
13
13
|
|
|
14
14
|
var _common = require("./common");
|
|
15
15
|
|
|
16
|
+
var _common2 = require("../../common");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -33,9 +35,13 @@ var RatingsInput = _ref => {
|
|
|
33
35
|
name,
|
|
34
36
|
ratingCount,
|
|
35
37
|
showRatingValue,
|
|
38
|
+
oneInputLabel,
|
|
39
|
+
label,
|
|
40
|
+
labelColor,
|
|
36
41
|
labelMax,
|
|
37
42
|
labelMin,
|
|
38
|
-
displayRatingsLabel
|
|
43
|
+
displayRatingsLabel,
|
|
44
|
+
optional // ...otherProps
|
|
39
45
|
|
|
40
46
|
} = _ref;
|
|
41
47
|
(0, React.useLayoutEffect)(() => {
|
|
@@ -45,8 +51,14 @@ var RatingsInput = _ref => {
|
|
|
45
51
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
52
|
id: id,
|
|
47
53
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
48
|
-
style: style
|
|
49
|
-
|
|
54
|
+
style: style
|
|
55
|
+
}, /*#__PURE__*/React.createElement(_common2.FormLabel, {
|
|
56
|
+
className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
|
|
57
|
+
name: name,
|
|
58
|
+
color: labelColor,
|
|
59
|
+
optional: optional
|
|
60
|
+
}, label), /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "stars"
|
|
50
62
|
}, displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
|
|
51
63
|
className: "label-text md-s-1 s-2 x-metadata c-x"
|
|
52
64
|
}, labelMin), [...Array(ratingCount)].map((_, index) => {
|
|
@@ -62,7 +74,7 @@ var RatingsInput = _ref => {
|
|
|
62
74
|
});
|
|
63
75
|
}), displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
|
|
64
76
|
className: "label-text md-s-1 s-2 x-metadata c-x"
|
|
65
|
-
}, labelMax));
|
|
77
|
+
}, labelMax)));
|
|
66
78
|
};
|
|
67
79
|
|
|
68
80
|
RatingsInput.propTypes = {
|
|
@@ -96,6 +108,11 @@ RatingsInput.propTypes = {
|
|
|
96
108
|
*/
|
|
97
109
|
showRatingValue: _propTypes.default.bool,
|
|
98
110
|
|
|
111
|
+
/**
|
|
112
|
+
* The label of the ratings input
|
|
113
|
+
*/
|
|
114
|
+
label: _propTypes.default.string.isRequired,
|
|
115
|
+
|
|
99
116
|
/**
|
|
100
117
|
* description for the highest rating value
|
|
101
118
|
*/
|
|
@@ -109,11 +126,27 @@ RatingsInput.propTypes = {
|
|
|
109
126
|
/**
|
|
110
127
|
* If the rating lables should be shown
|
|
111
128
|
*/
|
|
112
|
-
displayRatingsLabel: _propTypes.default.bool
|
|
129
|
+
displayRatingsLabel: _propTypes.default.bool,
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Whether the input is optional or not
|
|
133
|
+
*/
|
|
134
|
+
optional: _propTypes.default.bool,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* If the slide will only have one input
|
|
138
|
+
*/
|
|
139
|
+
oneInputLabel: _propTypes.default.bool,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* String that will represent color for the label
|
|
143
|
+
*/
|
|
144
|
+
labelColor: _propTypes.default.string
|
|
113
145
|
};
|
|
114
146
|
RatingsInput.defaultProps = {
|
|
115
147
|
labelMin: 'not satisfied.',
|
|
116
|
-
labelMax: 'very satisfied.'
|
|
148
|
+
labelMax: 'very satisfied.',
|
|
149
|
+
labelColor: 'main2'
|
|
117
150
|
};
|
|
118
151
|
|
|
119
152
|
var _default = /*#__PURE__*/(0, React.memo)(RatingsInput);
|
|
@@ -7,34 +7,43 @@ $default-transition: all .2s;
|
|
|
7
7
|
|
|
8
8
|
.#{bem.$base}.ratings-input {
|
|
9
9
|
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
p {
|
|
13
|
+
padding: $default-padding;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
.stars {
|
|
16
17
|
display: flex;
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
position: absolute;
|
|
21
|
-
visibility: none;
|
|
22
|
-
z-index: -1;
|
|
19
|
+
>:not(:last-child) {
|
|
20
|
+
margin-right: $default-rating-icon-margin;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
|
|
23
|
+
.#{bem.$base}.rating {
|
|
26
24
|
display: flex;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
|
|
26
|
+
input {
|
|
27
|
+
opacity: 0;
|
|
28
|
+
position: absolute;
|
|
29
|
+
visibility: none;
|
|
30
|
+
z-index: -1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
label {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
padding: $default-padding;
|
|
38
|
+
transition: $default-transition;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.label-text {
|
|
44
|
+
margin-bottom: 0;
|
|
45
|
+
align-self: flex-end;
|
|
32
46
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.label-text {
|
|
36
|
-
margin-bottom: 0;
|
|
37
|
-
align-self: flex-end;
|
|
38
47
|
}
|
|
39
48
|
}
|
|
40
49
|
|
|
@@ -13,6 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
|
|
15
15
|
|
|
16
|
+
var _a = require("../../../a");
|
|
17
|
+
|
|
16
18
|
var _common = require("../../common");
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -37,27 +39,38 @@ var SelectInput = _ref => {
|
|
|
37
39
|
style,
|
|
38
40
|
name,
|
|
39
41
|
label,
|
|
42
|
+
color,
|
|
40
43
|
options,
|
|
41
|
-
|
|
44
|
+
validate,
|
|
45
|
+
description,
|
|
46
|
+
disabled,
|
|
47
|
+
isLoading,
|
|
48
|
+
autoComplete // ...otherProps
|
|
42
49
|
|
|
43
50
|
} = _ref;
|
|
44
51
|
(0, React.useLayoutEffect)(() => {
|
|
45
52
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
46
53
|
}, []);
|
|
47
|
-
var [field
|
|
54
|
+
var [field] = (0, _formik.useField)({
|
|
55
|
+
name,
|
|
56
|
+
validate
|
|
57
|
+
});
|
|
48
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
59
|
id: id,
|
|
50
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
60
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(color)].filter(e => e).join(' '),
|
|
51
61
|
style: style // {...otherProps}
|
|
52
62
|
|
|
53
63
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
54
|
-
className: "input-label",
|
|
55
64
|
name: name
|
|
56
|
-
}, label), /*#__PURE__*/React.createElement("
|
|
57
|
-
className: "
|
|
65
|
+
}, label), /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: "select-wrapper"
|
|
67
|
+
}, /*#__PURE__*/React.createElement("select", _extends({
|
|
68
|
+
className: "input"
|
|
58
69
|
}, field, {
|
|
70
|
+
value: field.value || '',
|
|
59
71
|
id: name,
|
|
60
|
-
disabled: disabled
|
|
72
|
+
disabled: disabled,
|
|
73
|
+
autoComplete: autoComplete
|
|
61
74
|
}), options.map(option => {
|
|
62
75
|
// i.e if option is a string like "blah", return { value: "blah", label: "blah" }
|
|
63
76
|
var newOption = typeof option === 'string' ? {
|
|
@@ -66,11 +79,16 @@ var SelectInput = _ref => {
|
|
|
66
79
|
} : option;
|
|
67
80
|
return /*#__PURE__*/React.createElement("option", {
|
|
68
81
|
key: newOption.value,
|
|
69
|
-
value: newOption.value
|
|
82
|
+
value: newOption.value,
|
|
83
|
+
disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false
|
|
70
84
|
}, newOption.label);
|
|
71
|
-
})),
|
|
72
|
-
|
|
73
|
-
},
|
|
85
|
+
})), isLoading && /*#__PURE__*/React.createElement(_a.LoadingCircle, {
|
|
86
|
+
className: "x-main2"
|
|
87
|
+
})), /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
88
|
+
className: "v50 mt-v s-1",
|
|
89
|
+
description: description,
|
|
90
|
+
name: name
|
|
91
|
+
}));
|
|
74
92
|
};
|
|
75
93
|
|
|
76
94
|
SelectInput.propTypes = {
|
|
@@ -99,21 +117,48 @@ SelectInput.propTypes = {
|
|
|
99
117
|
*/
|
|
100
118
|
label: _propTypes.default.string,
|
|
101
119
|
|
|
120
|
+
/**
|
|
121
|
+
* The input field validator function
|
|
122
|
+
*/
|
|
123
|
+
validate: _propTypes.default.func,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The select input description
|
|
127
|
+
*/
|
|
128
|
+
description: _propTypes.default.string,
|
|
129
|
+
|
|
102
130
|
/**
|
|
103
131
|
* The options of the select input
|
|
104
132
|
*/
|
|
105
133
|
options: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
|
|
106
134
|
value: _propTypes.default.string,
|
|
107
|
-
label: _propTypes.default.string
|
|
135
|
+
label: _propTypes.default.string,
|
|
136
|
+
disabled: _propTypes.default.bool
|
|
108
137
|
})])),
|
|
109
138
|
|
|
110
139
|
/**
|
|
111
140
|
* Whether the select input should be disabled
|
|
112
141
|
*/
|
|
113
|
-
disabled: _propTypes.default.bool
|
|
142
|
+
disabled: _propTypes.default.bool,
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The color of the select input
|
|
146
|
+
*/
|
|
147
|
+
color: _propTypes.default.string,
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
* Whether the query that is fetching the select options is still in flight
|
|
151
|
+
*/
|
|
152
|
+
isLoading: _propTypes.default.bool,
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The autoComplete value that the browser should watch for the input
|
|
156
|
+
*/
|
|
157
|
+
autoComplete: _propTypes.default.string
|
|
114
158
|
};
|
|
115
159
|
SelectInput.defaultProps = {
|
|
116
|
-
disabled: false
|
|
160
|
+
disabled: false,
|
|
161
|
+
color: 'background2'
|
|
117
162
|
};
|
|
118
163
|
|
|
119
164
|
var _default = /*#__PURE__*/(0, React.memo)(SelectInput);
|
|
@@ -5,26 +5,46 @@
|
|
|
5
5
|
@use "../../../form.scss";
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
$default-padding: 0.75em
|
|
9
|
-
|
|
8
|
+
$default-padding: 0.75em;
|
|
9
|
+
$default-margin: 1em;
|
|
10
10
|
|
|
11
11
|
.#{bem.$base}.select-input {
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
color: var(--main1);
|
|
15
|
+
.#{bem.$base}.label {
|
|
16
|
+
margin-bottom: $default-margin
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
color: var(--on-background1);
|
|
23
|
-
padding: $default-padding;
|
|
19
|
+
.select-wrapper {
|
|
20
|
+
position: relative;
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
>.#{bem.$base}.loading-circle {
|
|
23
|
+
position: absolute;
|
|
24
|
+
right: 0;
|
|
25
|
+
top: 50%;
|
|
26
|
+
transform: translateY(-50%);
|
|
27
27
|
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
28
|
|
|
29
|
+
>.input {
|
|
30
|
+
width: 100%;
|
|
31
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
32
|
+
background: var(--light-y);
|
|
33
|
+
color: var(--on-y);
|
|
34
|
+
padding: $default-padding;
|
|
35
|
+
|
|
36
|
+
&:not(:disabled):hover {
|
|
37
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:disabled {
|
|
41
|
+
background-color: var(--dark-y);
|
|
42
|
+
appearance: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus {
|
|
46
|
+
background: var(--y);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -123,7 +123,7 @@ TaskRecommendationInput.propTypes = {
|
|
|
123
123
|
image: _propTypes.default.string.isRequired
|
|
124
124
|
};
|
|
125
125
|
TaskRecommendationInput.defaultProps = {
|
|
126
|
-
color: '
|
|
126
|
+
color: 'main2'
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
var _default = /*#__PURE__*/(0, React.memo)(TaskRecommendationInput);
|
|
@@ -38,36 +38,46 @@ var TextInput = _ref => {
|
|
|
38
38
|
type,
|
|
39
39
|
name,
|
|
40
40
|
label,
|
|
41
|
+
color,
|
|
42
|
+
labelColor,
|
|
41
43
|
validate,
|
|
42
44
|
oneInputLabel,
|
|
43
45
|
description,
|
|
44
|
-
disabled
|
|
46
|
+
disabled,
|
|
47
|
+
placeholder,
|
|
48
|
+
optional,
|
|
49
|
+
autoComplete // ...otherProps
|
|
45
50
|
|
|
46
51
|
} = _ref;
|
|
47
52
|
(0, React.useLayoutEffect)(() => {
|
|
48
53
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
49
54
|
}, []);
|
|
50
|
-
var [field
|
|
55
|
+
var [field] = (0, _formik.useField)({
|
|
51
56
|
name,
|
|
52
57
|
validate
|
|
53
58
|
});
|
|
54
59
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
60
|
id: id,
|
|
56
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
61
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(color)].filter(e => e).join(' '),
|
|
57
62
|
style: style // {...otherProps}
|
|
58
63
|
|
|
59
64
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
60
|
-
className: [
|
|
61
|
-
name: name
|
|
65
|
+
className: [oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
|
|
66
|
+
name: name,
|
|
67
|
+
color: labelColor,
|
|
68
|
+
optional: optional
|
|
62
69
|
}, label), /*#__PURE__*/React.createElement("input", _extends({
|
|
63
70
|
id: name,
|
|
64
|
-
className: "input
|
|
71
|
+
className: "input",
|
|
65
72
|
type: type,
|
|
66
|
-
disabled: disabled
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
disabled: disabled,
|
|
74
|
+
placeholder: placeholder,
|
|
75
|
+
autoComplete: autoComplete
|
|
76
|
+
}, field)), /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
77
|
+
className: "v50 mt-v s-1",
|
|
78
|
+
description: description,
|
|
79
|
+
name: name
|
|
80
|
+
}));
|
|
71
81
|
};
|
|
72
82
|
|
|
73
83
|
TextInput.propTypes = {
|
|
@@ -96,10 +106,15 @@ TextInput.propTypes = {
|
|
|
96
106
|
*/
|
|
97
107
|
label: _propTypes.default.string.isRequired,
|
|
98
108
|
|
|
109
|
+
/**
|
|
110
|
+
* The input label color
|
|
111
|
+
*/
|
|
112
|
+
labelColor: _propTypes.default.string,
|
|
113
|
+
|
|
99
114
|
/**
|
|
100
115
|
* The type of the input (html)
|
|
101
116
|
*/
|
|
102
|
-
type: _propTypes.default.oneOf(['text', 'email', 'password', 'number', 'date', 'time', 'datetime', 'month', 'tel', 'hidden']),
|
|
117
|
+
type: _propTypes.default.oneOf(['text', 'email', 'password', 'number', 'date', 'time', 'datetime', 'month', 'tel', 'hidden', 'url']),
|
|
103
118
|
|
|
104
119
|
/**
|
|
105
120
|
* The input field validator function
|
|
@@ -119,10 +134,32 @@ TextInput.propTypes = {
|
|
|
119
134
|
/**
|
|
120
135
|
* Whether the text input should be disabled
|
|
121
136
|
*/
|
|
122
|
-
disabled: _propTypes.default.bool
|
|
137
|
+
disabled: _propTypes.default.bool,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The placeholder text for the input
|
|
141
|
+
*/
|
|
142
|
+
placeholder: _propTypes.default.string,
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The text input color
|
|
146
|
+
*/
|
|
147
|
+
color: _propTypes.default.string,
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Whether the input is optional or not
|
|
151
|
+
*/
|
|
152
|
+
optional: _propTypes.default.bool,
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The autoComplete value that the browser should watch for the input
|
|
156
|
+
* `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
|
|
157
|
+
*/
|
|
158
|
+
autoComplete: _propTypes.default.string
|
|
123
159
|
};
|
|
124
160
|
TextInput.defaultProps = {
|
|
125
161
|
type: 'text',
|
|
162
|
+
color: 'background2',
|
|
126
163
|
disabled: false
|
|
127
164
|
};
|
|
128
165
|
|