@pareto-engineering/design-system 2.0.0-alpha.5 → 2.0.0-alpha.52
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/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 +39 -9
- package/dist/cjs/a/Shapes/styles.scss +79 -23
- 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 +41 -1
- 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/Section/Section.js +35 -7
- 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 +20 -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/Label/Label.js +1 -1
- package/dist/cjs/f/common/Label/styles.scss +1 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +236 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +205 -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 +304 -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 +50 -13
- 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 +35 -7
- package/dist/cjs/f/fields/TextInput/styles.scss +16 -7
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -8
- 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/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 +39 -9
- package/dist/es/a/Shapes/styles.scss +79 -23
- 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 +6 -1
- 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/Section/Section.js +34 -6
- 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 +20 -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/Label/Label.js +1 -1
- package/dist/es/f/common/Label/styles.scss +1 -1
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/es/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +213 -0
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +185 -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 +276 -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 +49 -13
- 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 +35 -7
- package/dist/es/f/fields/TextInput/styles.scss +16 -7
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -8
- 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 +7018 -3507
- 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/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/OvalIllustration.stories.jsx +59 -0
- package/src/stories/a/Popover.stories.jsx +106 -0
- package/src/stories/a/Shapes.stories.jsx +74 -43
- package/src/stories/a/SnapScroller.stories.jsx +98 -0
- package/src/stories/b/Button.stories.jsx +27 -4
- package/src/stories/b/Logo.stories.jsx +17 -9
- package/src/stories/b/Page.stories.jsx +27 -2
- package/src/stories/c/ContentSlides.stories.jsx +154 -2
- package/src/stories/c/SocialMediaShareButton.stories.jsx +25 -0
- package/src/stories/f/FormInput.stories.jsx +233 -0
- package/src/stories/f/QueryCombobox.stories.jsx +269 -0
- package/src/stories/f/QuerySelect.stories.jsx +134 -0
- package/src/stories/f/RatingsInput.stories.jsx +3 -2
- package/src/stories/f/SelectInput.stories.jsx +36 -5
- package/src/stories/f/TextInput.stories.jsx +15 -4
- package/src/stories/f/TextareaInput.stories.jsx +42 -6
- 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/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 +44 -7
- package/src/ui/a/Shapes/styles.scss +79 -23
- 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 +5 -0
- 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/Section/Section.jsx +39 -5
- 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 +26 -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/Label/Label.jsx +1 -1
- package/src/ui/f/common/Label/styles.scss +1 -1
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +1 -1
- 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 +222 -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 +318 -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 +59 -8
- package/src/ui/f/fields/SelectInput/styles.scss +33 -13
- package/src/ui/f/fields/TextInput/TextInput.jsx +31 -3
- package/src/ui/f/fields/TextInput/styles.scss +16 -7
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +24 -13
- 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/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,102 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "@aztlan/stylebook/src/mixins";
|
|
5
|
+
@use "@aztlan/stylebook/src/globals" as *;
|
|
6
|
+
|
|
7
|
+
$default-clockwise-degree:60deg;
|
|
8
|
+
$default-counter-clockwise-degree:-60deg;
|
|
9
|
+
$default-ellipse-size:30% 43% at 50% 50%;
|
|
10
|
+
|
|
11
|
+
.#{bem.$base}.oval-illustration {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
position: relative;
|
|
16
|
+
|
|
17
|
+
&.left {
|
|
18
|
+
.oval-background {
|
|
19
|
+
transform: rotate($default-clockwise-degree);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.illustration {
|
|
23
|
+
transform: rotate($default-counter-clockwise-degree);
|
|
24
|
+
|
|
25
|
+
> img {
|
|
26
|
+
transform: rotate($default-clockwise-degree);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.right {
|
|
32
|
+
.oval-background {
|
|
33
|
+
transform: rotate($default-counter-clockwise-degree);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.illustration {
|
|
37
|
+
transform: rotate($default-clockwise-degree);
|
|
38
|
+
|
|
39
|
+
> img {
|
|
40
|
+
transform: rotate($default-counter-clockwise-degree);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.oval-background {
|
|
46
|
+
background: var(--y);
|
|
47
|
+
clip-path: ellipse($default-ellipse-size);
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
position: absolute;
|
|
50
|
+
z-index: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.illustration {
|
|
54
|
+
clip-path: ellipse($default-ellipse-size);
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
|
|
57
|
+
> img {
|
|
58
|
+
height: 100%;
|
|
59
|
+
object-fit: cover;
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// mobile style
|
|
65
|
+
@include mixins.media($to:$sm-md) {
|
|
66
|
+
.oval-background {
|
|
67
|
+
height: var(--mobile-size);
|
|
68
|
+
width: var(--mobile-size);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.illustration {
|
|
72
|
+
height: var(--mobile-size);
|
|
73
|
+
width: var(--mobile-size);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// tablet style
|
|
78
|
+
@include mixins.media($from:$xs-sm, $to:$sm-md) {
|
|
79
|
+
.oval-background {
|
|
80
|
+
height: var(--tablet-size);
|
|
81
|
+
width: var(--tablet-size);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.illustration {
|
|
85
|
+
height: var(--tablet-size);
|
|
86
|
+
width: var(--tablet-size);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// desktop style
|
|
91
|
+
@include mixins.media($from:$sm-md) {
|
|
92
|
+
.oval-background {
|
|
93
|
+
height: var(--desktop-size);
|
|
94
|
+
width: var(--desktop-size);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.illustration {
|
|
98
|
+
height: var(--desktop-size);
|
|
99
|
+
width: var(--desktop-size);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useRef, useLayoutEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem'
|
|
9
|
+
|
|
10
|
+
// Local Definitions
|
|
11
|
+
import { useDynamicPosition } from 'ui/utils'
|
|
12
|
+
|
|
13
|
+
const baseClassName = styleNames.base
|
|
14
|
+
|
|
15
|
+
const componentClassName = 'popover'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This is the component description.
|
|
19
|
+
*/
|
|
20
|
+
const Popover = ({
|
|
21
|
+
id,
|
|
22
|
+
className:userClassName,
|
|
23
|
+
style,
|
|
24
|
+
color,
|
|
25
|
+
children,
|
|
26
|
+
isOpen,
|
|
27
|
+
parentRef,
|
|
28
|
+
preferredPrimaryOrder,
|
|
29
|
+
preferredSecondaryOrder,
|
|
30
|
+
offsetXPx,
|
|
31
|
+
offsetYPx,
|
|
32
|
+
// ...otherProps
|
|
33
|
+
}) => {
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
import('./styles.scss')
|
|
36
|
+
}, [])
|
|
37
|
+
|
|
38
|
+
const popoverRef = useRef(null)
|
|
39
|
+
const {
|
|
40
|
+
primaryPosition,
|
|
41
|
+
secondaryPosition,
|
|
42
|
+
} = useDynamicPosition({
|
|
43
|
+
preferredPrimaryOrder,
|
|
44
|
+
preferredSecondaryOrder,
|
|
45
|
+
elementRef:popoverRef,
|
|
46
|
+
parentRef,
|
|
47
|
+
offsetXPx,
|
|
48
|
+
offsetYPx,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
id={id}
|
|
54
|
+
className={[
|
|
55
|
+
baseClassName,
|
|
56
|
+
componentClassName,
|
|
57
|
+
userClassName,
|
|
58
|
+
isOpen && 'open',
|
|
59
|
+
`x-${color}`,
|
|
60
|
+
primaryPosition,
|
|
61
|
+
secondaryPosition,
|
|
62
|
+
]
|
|
63
|
+
.filter((e) => e)
|
|
64
|
+
.join(' ')}
|
|
65
|
+
style={style}
|
|
66
|
+
ref={popoverRef}
|
|
67
|
+
// {...otherProps}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
Popover.propTypes = {
|
|
75
|
+
/**
|
|
76
|
+
* The HTML id for this element
|
|
77
|
+
*/
|
|
78
|
+
id:PropTypes.string,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The HTML class names for this element
|
|
82
|
+
*/
|
|
83
|
+
className:PropTypes.string,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The React-written, css properties for this element.
|
|
87
|
+
*/
|
|
88
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The children JSX
|
|
92
|
+
*/
|
|
93
|
+
children:PropTypes.node,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The base color of the popover
|
|
97
|
+
*/
|
|
98
|
+
color:PropTypes.string,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Whether the popover should be visible or not
|
|
102
|
+
*/
|
|
103
|
+
isOpen:PropTypes.bool,
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The preferred primary position order of the popover
|
|
107
|
+
*/
|
|
108
|
+
preferredPrimaryOrder:PropTypes.arrayOf(
|
|
109
|
+
PropTypes.oneOf([
|
|
110
|
+
'bottom',
|
|
111
|
+
'top',
|
|
112
|
+
'right',
|
|
113
|
+
'left',
|
|
114
|
+
]),
|
|
115
|
+
),
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The preferred secondary position order of the popover
|
|
119
|
+
*/
|
|
120
|
+
preferredSecondaryOrder:PropTypes.arrayOf(
|
|
121
|
+
PropTypes.oneOf([
|
|
122
|
+
'left',
|
|
123
|
+
'right',
|
|
124
|
+
'bottom',
|
|
125
|
+
'top',
|
|
126
|
+
]),
|
|
127
|
+
),
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The horizonal offset in pixels from the anchor point to the popover
|
|
131
|
+
*/
|
|
132
|
+
offsetXPx:PropTypes.number,
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The vertical offset in pixels from the anchor point to the popover
|
|
136
|
+
*/
|
|
137
|
+
offsetYPx:PropTypes.number,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The reference to the parent element
|
|
141
|
+
*/
|
|
142
|
+
parentRef:PropTypes.oneOfType([
|
|
143
|
+
PropTypes.func,
|
|
144
|
+
PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
|
|
145
|
+
]),
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
Popover.defaultProps = {
|
|
149
|
+
color :'background1',
|
|
150
|
+
isOpen :false,
|
|
151
|
+
preferredPrimaryOrder :['bottom', 'top', 'right', 'left'],
|
|
152
|
+
preferredSecondaryOrder:['left', 'right', 'bottom', 'top'],
|
|
153
|
+
offsetXPx :16,
|
|
154
|
+
offsetYPx :0,
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export default Popover
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
$default-border: var(--theme-border-style) var(--metadata);
|
|
5
|
+
|
|
6
|
+
.#{bem.$base}.popover {
|
|
7
|
+
position: absolute;
|
|
8
|
+
z-index: 1;
|
|
9
|
+
background-color: var(--x);
|
|
10
|
+
border: $default-border;
|
|
11
|
+
|
|
12
|
+
&:not(.open) {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.bottom {
|
|
17
|
+
top: 100%;
|
|
18
|
+
// bottom: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.left {
|
|
22
|
+
left: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.right {
|
|
26
|
+
right: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.top {
|
|
30
|
+
bottom: 100%;
|
|
31
|
+
top: auto;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -20,9 +20,11 @@ const Shapes = ({
|
|
|
20
20
|
id,
|
|
21
21
|
className:userClassName,
|
|
22
22
|
style,
|
|
23
|
-
pin,
|
|
24
23
|
shape,
|
|
25
24
|
height,
|
|
25
|
+
overflow,
|
|
26
|
+
verticalAlign,
|
|
27
|
+
horizontalAlign,
|
|
26
28
|
// ...otherProps
|
|
27
29
|
}) => {
|
|
28
30
|
useLayoutEffect(() => {
|
|
@@ -43,13 +45,17 @@ const Shapes = ({
|
|
|
43
45
|
.join(' ')}
|
|
44
46
|
style={{
|
|
45
47
|
...style,
|
|
46
|
-
'--
|
|
47
|
-
'--
|
|
48
|
+
'--shape-height' :height,
|
|
49
|
+
'--overflow' :overflow,
|
|
50
|
+
'--vertical-align' :verticalAlign,
|
|
51
|
+
'--horizontal-align':horizontalAlign,
|
|
48
52
|
}}
|
|
49
53
|
// {...otherProps}
|
|
50
54
|
>
|
|
51
55
|
{ shape === 'triangle'
|
|
52
56
|
&& <div className="triangle" />}
|
|
57
|
+
{ shape === 'inverted-triangle'
|
|
58
|
+
&& <div className="inverted-triangle" />}
|
|
53
59
|
{ shape === 'half-ellipses'
|
|
54
60
|
&& (
|
|
55
61
|
<div className="half-ellipses">
|
|
@@ -95,6 +101,18 @@ const Shapes = ({
|
|
|
95
101
|
<div className="circle-four" />
|
|
96
102
|
</div>
|
|
97
103
|
)}
|
|
104
|
+
{shape === 'rotated-ellipses' && (
|
|
105
|
+
<div className="rotated-ellipses">
|
|
106
|
+
<div className="ellipse-one" />
|
|
107
|
+
<div className="ellipse-two" />
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
{shape === 'intersecting-circles' && (
|
|
111
|
+
<div className="intersecting-circles">
|
|
112
|
+
<div className="left" />
|
|
113
|
+
<div className="right" />
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
98
116
|
</div>
|
|
99
117
|
)
|
|
100
118
|
}
|
|
@@ -121,9 +139,18 @@ Shapes.propTypes = {
|
|
|
121
139
|
height:PropTypes.string,
|
|
122
140
|
|
|
123
141
|
/**
|
|
124
|
-
*
|
|
142
|
+
* The vertical alignment of the shape.
|
|
143
|
+
*/
|
|
144
|
+
verticalAlign:PropTypes.oneOf([
|
|
145
|
+
'flex-start',
|
|
146
|
+
'center',
|
|
147
|
+
'flex-end',
|
|
148
|
+
]),
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The horizontal alignment of the shape.
|
|
125
152
|
*/
|
|
126
|
-
|
|
153
|
+
horizontalAlign:PropTypes.oneOf([
|
|
127
154
|
'flex-start',
|
|
128
155
|
'center',
|
|
129
156
|
'flex-end',
|
|
@@ -143,12 +170,22 @@ Shapes.propTypes = {
|
|
|
143
170
|
'half-circle',
|
|
144
171
|
'ellipses',
|
|
145
172
|
'rectangles',
|
|
173
|
+
'rotated-ellipses',
|
|
174
|
+
'inverted-triangle',
|
|
175
|
+
'intersecting-circles',
|
|
146
176
|
]),
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The overflow of the shape.
|
|
180
|
+
*/
|
|
181
|
+
overflow:PropTypes.oneOf(['hidden', 'visible']),
|
|
147
182
|
}
|
|
148
183
|
|
|
149
184
|
Shapes.defaultProps = {
|
|
150
|
-
|
|
151
|
-
|
|
185
|
+
verticalAlign :'center',
|
|
186
|
+
horizontalAlign:'center',
|
|
187
|
+
shape :'triangle',
|
|
188
|
+
overflow :'hidden',
|
|
152
189
|
}
|
|
153
190
|
|
|
154
191
|
export default Shapes
|
|
@@ -15,43 +15,51 @@ $default-shapes-opacity:.8;
|
|
|
15
15
|
left: 0;
|
|
16
16
|
display: flex;
|
|
17
17
|
flex-direction: column;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
overflow: var(--overflow);
|
|
19
|
+
justify-content: var(--vertical-align);
|
|
20
|
+
align-items: var(--horizontal-align);
|
|
20
21
|
height: 100%;
|
|
21
22
|
width: 100%;
|
|
22
23
|
|
|
23
24
|
.triangle {
|
|
24
|
-
background-image: linear-gradient(
|
|
25
|
+
background-image: linear-gradient(var(--light-y), var(--dark-y));
|
|
25
26
|
clip-path: polygon(0 0, 50% 100%, 100% 0);
|
|
26
27
|
height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
|
|
27
28
|
opacity: $default-shapes-opacity;
|
|
28
29
|
width: var(--shape-height, #{$default-triangle-height});
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
.inverted-triangle {
|
|
33
|
+
background-image: linear-gradient(var(--dark-y), var(--light-y));
|
|
34
|
+
clip-path: polygon(50% 0, 0 100%, 100% 100%);
|
|
35
|
+
height: calc(var(--shape-height, #{$default-triangle-height}) * 0.86);
|
|
36
|
+
opacity: $default-shapes-opacity;
|
|
37
|
+
width: var(--shape-height, #{$default-triangle-height});
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
.half-ellipses {
|
|
32
41
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
33
42
|
opacity: $default-shapes-opacity;
|
|
34
43
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
35
44
|
|
|
36
45
|
.up {
|
|
37
|
-
background-image:
|
|
38
|
-
clip-path: ellipse(
|
|
46
|
+
background-image: radial-gradient(ellipse at center bottom, var(--y) 5%, transparent 65%);
|
|
47
|
+
clip-path: ellipse(35% 100% at 50% 0%);
|
|
39
48
|
height: 50%;
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
.down {
|
|
43
|
-
background-image:
|
|
44
|
-
clip-path: ellipse(
|
|
52
|
+
background-image: radial-gradient(ellipse at center top, var(--y) 5%, transparent 65%);
|
|
53
|
+
clip-path: ellipse(35% 100% at 50% 100%);
|
|
45
54
|
height: 50%;
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
.ellipse {
|
|
50
|
-
background-image: linear-gradient(
|
|
51
|
-
clip-path: ellipse(50%
|
|
59
|
+
background-image: linear-gradient(var(--dark-y), var(--light-y));
|
|
60
|
+
clip-path: ellipse(50% 50% at 50% 50%);
|
|
52
61
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
53
62
|
opacity: $default-shapes-opacity;
|
|
54
|
-
transform: rotate3d(0, 0, -1, 10deg);
|
|
55
63
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
56
64
|
}
|
|
57
65
|
|
|
@@ -109,15 +117,15 @@ $default-shapes-opacity:.8;
|
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
.half-ellipse {
|
|
112
|
-
background-image:
|
|
113
|
-
clip-path: ellipse(
|
|
120
|
+
background-image: radial-gradient(ellipse at center bottom, var(--y) 10%, var(--light-y) 65%);
|
|
121
|
+
clip-path: ellipse(60% 100% at 50% 0%);
|
|
114
122
|
height: var(--shape-height, #{$default-ellipse-height});
|
|
115
123
|
opacity: $default-shapes-opacity;
|
|
116
124
|
width: calc(var(--shape-height, #{$default-ellipse-height}) * 2);
|
|
117
125
|
}
|
|
118
126
|
|
|
119
127
|
.circle {
|
|
120
|
-
background-image: linear-gradient(var(--
|
|
128
|
+
background-image: linear-gradient(var(--dark-y), var(--light-y));
|
|
121
129
|
clip-path: circle(50% at 50% 50%);
|
|
122
130
|
height: var(--shape-height, #{$default-circle-height});
|
|
123
131
|
opacity: $default-shapes-opacity;
|
|
@@ -139,7 +147,7 @@ $default-shapes-opacity:.8;
|
|
|
139
147
|
width: var(--shape-height, #{$default-ellipse-height});
|
|
140
148
|
|
|
141
149
|
.first {
|
|
142
|
-
background-image: linear-gradient(to top, var(--dark-y), var(--y), var(--light-y) 50%,
|
|
150
|
+
background-image: linear-gradient(to top, var(--dark-y), var(--y), var(--light-y) 50%, var(--background1));
|
|
143
151
|
clip-path: ellipse(50% 20% at 50% 60%);
|
|
144
152
|
height: 100%;
|
|
145
153
|
position: absolute;
|
|
@@ -148,7 +156,7 @@ $default-shapes-opacity:.8;
|
|
|
148
156
|
}
|
|
149
157
|
|
|
150
158
|
.second {
|
|
151
|
-
background-image: linear-gradient(to bottom,var(--dark-y), var(--y), var(--light-y) 45%,
|
|
159
|
+
background-image: linear-gradient(to bottom,var(--dark-y), var(--y), var(--light-y) 45%, var(--background1));
|
|
152
160
|
clip-path: ellipse(50% 20% at 50% 40%);
|
|
153
161
|
height: 100%;
|
|
154
162
|
position: absolute;
|
|
@@ -167,33 +175,81 @@ $default-shapes-opacity:.8;
|
|
|
167
175
|
|
|
168
176
|
> * {
|
|
169
177
|
border-radius: 50%;
|
|
170
|
-
background: radial-gradient(ellipse at center bottom
|
|
178
|
+
background: radial-gradient(ellipse at center bottom, var(--dark-y) 10%, var(--light-y) 60%);
|
|
171
179
|
position: absolute;
|
|
172
180
|
opacity: .5;
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
.circle-one {
|
|
176
184
|
transform: rotate(45deg);
|
|
177
|
-
height:
|
|
178
|
-
width:
|
|
185
|
+
height:calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
186
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.4);
|
|
179
187
|
}
|
|
180
188
|
|
|
181
189
|
.circle-two {
|
|
182
|
-
height:
|
|
183
|
-
width:
|
|
190
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
191
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.6);
|
|
184
192
|
}
|
|
185
193
|
|
|
186
194
|
.circle-three {
|
|
187
195
|
transform: rotate(-45deg);
|
|
188
|
-
height:
|
|
189
|
-
width:
|
|
196
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
197
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 0.8);
|
|
190
198
|
}
|
|
191
199
|
|
|
192
200
|
.circle-four {
|
|
193
201
|
transform: rotate(-90deg);
|
|
194
|
-
height:
|
|
202
|
+
height: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
203
|
+
width: calc(var(--shape-height, #{$default-ellipse-height})* 1);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
.rotated-ellipses {
|
|
207
|
+
height: var(--shape-height, #{$default-ellipse-height});
|
|
208
|
+
opacity: $default-shapes-opacity;
|
|
209
|
+
width: var(--shape-height, #{$default-ellipse-height});
|
|
210
|
+
display: flex;
|
|
211
|
+
|
|
212
|
+
> *{
|
|
195
213
|
width: 100%;
|
|
214
|
+
height: 100%;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ellipse-one {
|
|
218
|
+
background-image: radial-gradient(ellipse at bottom left, var(--y) 30%, transparent 65%);
|
|
219
|
+
transform: rotate(-15deg);
|
|
220
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.ellipse-two {
|
|
224
|
+
background-image: radial-gradient(ellipse at top right, var(--y) 30%, transparent 65%);
|
|
225
|
+
transform: rotate(-15deg);
|
|
226
|
+
clip-path: ellipse(50% 35% at 50% 50%);
|
|
196
227
|
}
|
|
197
228
|
}
|
|
198
229
|
|
|
230
|
+
.intersecting-circles {
|
|
231
|
+
height: var(--shape-height, #{$default-circle-height});
|
|
232
|
+
opacity: $default-shapes-opacity;
|
|
233
|
+
width: calc(var(--shape-height, #{$default-circle-height}) * 2);
|
|
234
|
+
display: grid;
|
|
235
|
+
grid-template-columns: repeat(7, 1fr);
|
|
236
|
+
position: relative;
|
|
237
|
+
|
|
238
|
+
> * {
|
|
239
|
+
border-radius: 50%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
width: 100%;
|
|
242
|
+
position: absolute;
|
|
243
|
+
opacity: .8;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.left {
|
|
247
|
+
background-image: linear-gradient(to right ,var(--dark-y),var(--y), var(--light-y));
|
|
248
|
+
grid-column: 1 / 5;
|
|
249
|
+
}
|
|
250
|
+
.right {
|
|
251
|
+
background-image: linear-gradient(to left, var(--dark-y), var(--y), var(--light-y));
|
|
252
|
+
grid-column: 4 / 8;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
199
255
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useLayoutEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem'
|
|
9
|
+
|
|
10
|
+
// Local Definitions
|
|
11
|
+
|
|
12
|
+
const baseClassName = styleNames.base
|
|
13
|
+
|
|
14
|
+
const componentClassName = 'snap-scroller'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is the component description.
|
|
18
|
+
*/
|
|
19
|
+
const SnapScroller = ({
|
|
20
|
+
id,
|
|
21
|
+
className:userClassName,
|
|
22
|
+
style,
|
|
23
|
+
children,
|
|
24
|
+
noScrollOnDesktop,
|
|
25
|
+
// ...otherProps
|
|
26
|
+
}) => {
|
|
27
|
+
useLayoutEffect(() => {
|
|
28
|
+
import('./styles.scss')
|
|
29
|
+
}, [])
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
id={id}
|
|
34
|
+
className={[
|
|
35
|
+
|
|
36
|
+
baseClassName,
|
|
37
|
+
|
|
38
|
+
componentClassName,
|
|
39
|
+
userClassName,
|
|
40
|
+
noScrollOnDesktop && 'desktop-no-scroll',
|
|
41
|
+
]
|
|
42
|
+
.filter((e) => e)
|
|
43
|
+
.join(' ')}
|
|
44
|
+
style={style}
|
|
45
|
+
// {...otherProps}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
SnapScroller.propTypes = {
|
|
53
|
+
/**
|
|
54
|
+
* The HTML id for this element
|
|
55
|
+
*/
|
|
56
|
+
id:PropTypes.string,
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The HTML class names for this element
|
|
60
|
+
*/
|
|
61
|
+
className:PropTypes.string,
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The React-written, css properties for this element.
|
|
65
|
+
*/
|
|
66
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The children JSX
|
|
70
|
+
*/
|
|
71
|
+
children:PropTypes.node,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Whether to snap scroll on desktop (false will enable a flexbox)
|
|
75
|
+
*/
|
|
76
|
+
noScrollOnDesktop:PropTypes.bool,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
SnapScroller.defaultProps = {
|
|
80
|
+
noScrollOnDesktop:false,
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default SnapScroller
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "@aztlan/stylebook/src/mixins";
|
|
5
|
+
@use "@aztlan/stylebook/src/globals" as *;
|
|
6
|
+
|
|
7
|
+
$default-spacing:var(--spacing, var(--u));
|
|
8
|
+
|
|
9
|
+
.#{bem.$base}.snap-scroller {
|
|
10
|
+
display: flex;
|
|
11
|
+
-ms-overflow-style: none; /* for Internet Explorer, Edge */
|
|
12
|
+
overflow-x: auto;
|
|
13
|
+
scroll-padding: calc(#{$default-spacing} *2);
|
|
14
|
+
scroll-snap-type: x mandatory;
|
|
15
|
+
scrollbar-width: none;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
> * {
|
|
19
|
+
&:first-child {
|
|
20
|
+
margin-left: $default-spacing;
|
|
21
|
+
}
|
|
22
|
+
display: inline-block;
|
|
23
|
+
margin-right: $default-spacing;
|
|
24
|
+
scroll-snap-align: start;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@include mixins.media($from:$sm-md) {
|
|
29
|
+
&.desktop-no-scroll {
|
|
30
|
+
overflow: auto;
|
|
31
|
+
-ms-overflow-style: unset; /* for Internet Explorer, Edge */
|
|
32
|
+
scroll-snap-type: none;
|
|
33
|
+
scrollbar-width: unset;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|