@pareto-engineering/design-system 2.0.0-alpha.3 → 2.0.0-alpha.30
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/{c/SiteFooter/common/Section/Section.js → a/BackgroundGradient/BackgroundGradient.js} +20 -38
- package/dist/cjs/a/BackgroundGradient/index.js +15 -0
- package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
- package/dist/cjs/a/Conversation/Conversation.js +15 -8
- package/dist/cjs/a/Conversation/common/Message/Message.js +33 -6
- package/dist/cjs/a/Conversation/styles.scss +128 -33
- package/dist/cjs/{experimental/GradientBackground/GradientBackground.js → a/OvalIllustration/OvalIllustration.js} +61 -26
- package/dist/cjs/a/OvalIllustration/index.js +15 -0
- package/dist/cjs/a/OvalIllustration/styles.scss +102 -0
- package/dist/cjs/a/SVG/SVG.js +9 -3
- package/dist/cjs/a/Shapes/Shapes.js +39 -9
- package/dist/cjs/a/Shapes/styles.scss +77 -21
- package/dist/cjs/{c/BlogPostsList/BlogPostsList.js → a/SnapScroller/SnapScroller.js} +15 -11
- package/dist/cjs/{c/SiteFooter/common/Section → a/SnapScroller}/index.js +3 -3
- package/dist/cjs/a/SnapScroller/styles.scss +38 -0
- package/dist/cjs/a/index.js +33 -1
- package/dist/cjs/b/Button/Button.js +10 -4
- package/dist/cjs/b/Button/styles.scss +83 -19
- package/dist/cjs/b/Logo/Logo.js +20 -39
- package/dist/cjs/b/Logo/styles.scss +0 -138
- package/dist/cjs/b/Page/common/Section/Section.js +56 -5
- package/dist/cjs/b/Page/styles.scss +8 -2
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +4 -4
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/cjs/c/ContentSlides/styles.scss +10 -4
- 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/SelectInput/SelectInput.js +36 -10
- package/dist/cjs/f/fields/SelectInput/styles.scss +13 -8
- package/dist/cjs/f/fields/TextInput/TextInput.js +28 -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 +0 -24
- package/dist/cjs/form-reset.scss +1 -1
- package/dist/es/{c/SiteFooter/SiteFooter.js → a/BackgroundGradient/BackgroundGradient.js} +14 -15
- package/dist/es/a/BackgroundGradient/index.js +2 -0
- package/dist/es/a/BackgroundGradient/styles.scss +16 -0
- package/dist/es/a/Conversation/Conversation.js +15 -8
- package/dist/es/a/Conversation/common/Message/Message.js +33 -6
- package/dist/es/a/Conversation/styles.scss +128 -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/SVG/SVG.js +1 -1
- package/dist/es/a/Shapes/Shapes.js +39 -9
- package/dist/es/a/Shapes/styles.scss +77 -21
- package/dist/es/{c/BlogPostsList/BlogPostsList.js → a/SnapScroller/SnapScroller.js} +16 -11
- package/dist/es/a/SnapScroller/index.js +2 -0
- package/dist/es/a/SnapScroller/styles.scss +38 -0
- package/dist/es/a/index.js +5 -1
- package/dist/es/b/Button/Button.js +8 -2
- package/dist/es/b/Button/styles.scss +83 -19
- package/dist/es/b/Logo/Logo.js +20 -39
- package/dist/es/b/Logo/styles.scss +0 -138
- package/dist/es/b/Page/common/Section/Section.js +55 -4
- package/dist/es/b/Page/styles.scss +8 -2
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +4 -4
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/es/c/ContentSlides/styles.scss +10 -4
- 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/SelectInput/SelectInput.js +36 -10
- package/dist/es/f/fields/SelectInput/styles.scss +13 -8
- package/dist/es/f/fields/TextInput/TextInput.js +28 -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 +0 -3
- package/dist/es/form-reset.scss +1 -1
- package/package.json +3 -3
- package/src/__snapshots__/Storyshots.test.js.snap +5048 -2508
- package/src/local.scss +1 -0
- package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
- package/src/stories/a/Conversation.stories.jsx +78 -1
- package/src/stories/a/OvalIllustration.stories.jsx +59 -0
- package/src/stories/a/Shapes.stories.jsx +143 -0
- package/src/stories/a/SnapScroller.stories.jsx +98 -0
- package/src/stories/b/Button.stories.jsx +86 -88
- package/src/stories/b/Logo.stories.jsx +9 -9
- package/src/stories/b/Page.stories.jsx +51 -1
- package/src/stories/c/ContentSlides.stories.jsx +154 -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/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/Conversation/Conversation.jsx +15 -7
- package/src/ui/a/Conversation/common/Message/Message.jsx +40 -7
- package/src/ui/a/Conversation/styles.scss +128 -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/SVG/SVG.jsx +1 -1
- package/src/ui/a/Shapes/Shapes.jsx +191 -0
- package/{dist/es/c/BlogPostsList/common/Card → src/ui/a/Shapes}/index.js +1 -1
- package/src/ui/a/Shapes/styles.scss +255 -0
- 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 +4 -0
- package/src/ui/b/Button/Button.jsx +9 -1
- package/src/ui/b/Button/styles.scss +83 -19
- package/src/ui/b/Logo/Logo.jsx +17 -40
- package/src/ui/b/Logo/styles.scss +0 -138
- package/src/ui/b/Page/common/Section/Section.jsx +68 -2
- package/src/ui/b/Page/styles.scss +8 -2
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +4 -4
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
- package/src/ui/c/ContentSlides/styles.scss +10 -4
- 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/SelectInput/SelectInput.jsx +43 -5
- package/src/ui/f/fields/SelectInput/styles.scss +13 -8
- package/src/ui/f/fields/TextInput/TextInput.jsx +24 -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 +0 -3
- package/src/ui/form-reset.scss +1 -1
- package/dist/cjs/a/GradientBackground/GradientBackground.js +0 -140
- package/dist/cjs/a/GradientBackground/index.js +0 -15
- package/dist/cjs/a/GradientBackground/styles.scss +0 -191
- package/dist/cjs/c/AcceptCookies/AcceptCookies.js +0 -134
- package/dist/cjs/c/AcceptCookies/index.js +0 -15
- package/dist/cjs/c/AcceptCookies/styles.scss +0 -49
- package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +0 -95
- package/dist/cjs/c/BlogCategoryButton/index.js +0 -15
- package/dist/cjs/c/BlogContext/BlogContextProvider.js +0 -63
- package/dist/cjs/c/BlogContext/Context.js +0 -16
- package/dist/cjs/c/BlogContext/ContextProvider.js +0 -63
- package/dist/cjs/c/BlogContext/index.js +0 -31
- package/dist/cjs/c/BlogContext/useBlog.js +0 -16
- package/dist/cjs/c/BlogPost/BlogPost.js +0 -147
- package/dist/cjs/c/BlogPost/index.js +0 -15
- package/dist/cjs/c/BlogPost/styles.scss +0 -33
- package/dist/cjs/c/BlogPostsList/common/Card/Card.js +0 -170
- package/dist/cjs/c/BlogPostsList/common/Card/index.js +0 -15
- package/dist/cjs/c/BlogPostsList/common/index.js +0 -13
- package/dist/cjs/c/BlogPostsList/index.js +0 -15
- package/dist/cjs/c/BlogPostsList/styles.scss +0 -72
- package/dist/cjs/c/SiteFooter/SiteFooter.js +0 -73
- package/dist/cjs/c/SiteFooter/common/index.js +0 -13
- package/dist/cjs/c/SiteFooter/index.js +0 -15
- package/dist/cjs/c/SiteFooter/styles.scss +0 -34
- package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -108
- package/dist/cjs/c/SiteHeaderCTA/index.js +0 -15
- package/dist/cjs/c/SiteHeaderCTA/styles.scss +0 -44
- package/dist/cjs/c/SiteMission/SiteMission.js +0 -113
- package/dist/cjs/c/SiteMission/index.js +0 -15
- package/dist/cjs/c/SiteMission/styles.scss +0 -30
- package/dist/cjs/c/SiteNavigation/SiteNavigation.js +0 -130
- package/dist/cjs/c/SiteNavigation/index.js +0 -15
- package/dist/cjs/c/SiteNavigation/styles.scss +0 -118
- package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -98
- package/dist/cjs/c/SiteOnboardingStep/index.js +0 -15
- package/dist/cjs/c/SiteOnboardingStep/styles.scss +0 -51
- package/dist/cjs/c/SitePricing/SitePricing.js +0 -108
- package/dist/cjs/c/SitePricing/index.js +0 -15
- package/dist/cjs/c/SitePricing/styles.scss +0 -73
- package/dist/cjs/c/SiteServices/SiteServices.js +0 -211
- package/dist/cjs/c/SiteServices/index.js +0 -15
- package/dist/cjs/c/SiteServices/styles.scss +0 -138
- package/dist/cjs/c/TeamGallery/TeamGallery.js +0 -80
- package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +0 -84
- package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +0 -15
- package/dist/cjs/c/TeamGallery/common/index.js +0 -13
- package/dist/cjs/c/TeamGallery/index.js +0 -15
- package/dist/cjs/c/TeamGallery/styles.scss +0 -100
- package/dist/cjs/c/Testimonials/Testimonials.js +0 -119
- package/dist/cjs/c/Testimonials/index.js +0 -15
- package/dist/cjs/c/Testimonials/styles.scss +0 -112
- package/dist/cjs/experimental/GradientBackground/index.js +0 -15
- package/dist/cjs/experimental/GradientBackground/styles.scss +0 -64
- package/dist/cjs/experimental/index.js +0 -13
- package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +0 -105
- package/dist/cjs/f/fields/CheckboxInput/index.js +0 -15
- package/dist/cjs/f/fields/CheckboxInput/styles.scss +0 -28
- package/dist/cjs/f/fields/RadioInput/RadioInput.js +0 -110
- package/dist/cjs/f/fields/RadioInput/index.js +0 -15
- package/dist/cjs/f/fields/RadioInput/styles.scss +0 -26
- package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +0 -129
- package/dist/cjs/f/fields/TaskRecommendation/index.js +0 -15
- package/dist/cjs/f/fields/TaskRecommendation/styles.scss +0 -37
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -131
- package/dist/cjs/f/fields/TaskRecommendationInput/index.js +0 -15
- package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +0 -41
- package/dist/cjs/f/fields/TextArea/TextArea.js +0 -141
- package/dist/cjs/f/fields/TextArea/index.js +0 -15
- package/dist/cjs/f/fields/TextArea/styles.scss +0 -19
- package/dist/es/a/GradientBackground/GradientBackground.js +0 -118
- package/dist/es/a/GradientBackground/index.js +0 -2
- package/dist/es/a/GradientBackground/styles.scss +0 -191
- package/dist/es/c/AcceptCookies/AcceptCookies.js +0 -117
- package/dist/es/c/AcceptCookies/index.js +0 -2
- package/dist/es/c/AcceptCookies/styles.scss +0 -49
- package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +0 -68
- package/dist/es/c/BlogCategoryButton/index.js +0 -2
- package/dist/es/c/BlogContext/BlogContextProvider.js +0 -45
- package/dist/es/c/BlogContext/Context.js +0 -2
- package/dist/es/c/BlogContext/ContextProvider.js +0 -45
- package/dist/es/c/BlogContext/index.js +0 -4
- package/dist/es/c/BlogContext/useBlog.js +0 -3
- package/dist/es/c/BlogPost/BlogPost.js +0 -128
- package/dist/es/c/BlogPost/index.js +0 -2
- package/dist/es/c/BlogPost/styles.scss +0 -33
- package/dist/es/c/BlogPostsList/common/Card/Card.js +0 -143
- package/dist/es/c/BlogPostsList/common/index.js +0 -1
- package/dist/es/c/BlogPostsList/index.js +0 -2
- package/dist/es/c/BlogPostsList/styles.scss +0 -72
- package/dist/es/c/SiteFooter/common/Section/Section.js +0 -73
- package/dist/es/c/SiteFooter/common/Section/index.js +0 -2
- package/dist/es/c/SiteFooter/common/index.js +0 -1
- package/dist/es/c/SiteFooter/index.js +0 -2
- package/dist/es/c/SiteFooter/styles.scss +0 -34
- package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +0 -92
- package/dist/es/c/SiteHeaderCTA/index.js +0 -2
- package/dist/es/c/SiteHeaderCTA/styles.scss +0 -44
- package/dist/es/c/SiteMission/SiteMission.js +0 -96
- package/dist/es/c/SiteMission/index.js +0 -2
- package/dist/es/c/SiteMission/styles.scss +0 -30
- package/dist/es/c/SiteNavigation/SiteNavigation.js +0 -111
- package/dist/es/c/SiteNavigation/index.js +0 -2
- package/dist/es/c/SiteNavigation/styles.scss +0 -118
- package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +0 -81
- package/dist/es/c/SiteOnboardingStep/index.js +0 -2
- package/dist/es/c/SiteOnboardingStep/styles.scss +0 -51
- package/dist/es/c/SitePricing/SitePricing.js +0 -91
- package/dist/es/c/SitePricing/index.js +0 -2
- package/dist/es/c/SitePricing/styles.scss +0 -73
- package/dist/es/c/SiteServices/SiteServices.js +0 -195
- package/dist/es/c/SiteServices/index.js +0 -2
- package/dist/es/c/SiteServices/styles.scss +0 -138
- package/dist/es/c/TeamGallery/TeamGallery.js +0 -64
- package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +0 -64
- package/dist/es/c/TeamGallery/common/PersonCard/index.js +0 -2
- package/dist/es/c/TeamGallery/common/index.js +0 -1
- package/dist/es/c/TeamGallery/index.js +0 -2
- package/dist/es/c/TeamGallery/styles.scss +0 -100
- package/dist/es/c/Testimonials/Testimonials.js +0 -99
- package/dist/es/c/Testimonials/index.js +0 -2
- package/dist/es/c/Testimonials/styles.scss +0 -112
- package/dist/es/experimental/GradientBackground/GradientBackground.js +0 -76
- package/dist/es/experimental/GradientBackground/index.js +0 -2
- package/dist/es/experimental/GradientBackground/styles.scss +0 -64
- package/dist/es/experimental/index.js +0 -1
- package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +0 -85
- package/dist/es/f/fields/CheckboxInput/index.js +0 -2
- package/dist/es/f/fields/CheckboxInput/styles.scss +0 -28
- package/dist/es/f/fields/RadioInput/RadioInput.js +0 -90
- package/dist/es/f/fields/RadioInput/index.js +0 -2
- package/dist/es/f/fields/RadioInput/styles.scss +0 -26
- package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +0 -111
- package/dist/es/f/fields/TaskRecommendation/index.js +0 -2
- package/dist/es/f/fields/TaskRecommendation/styles.scss +0 -37
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +0 -111
- package/dist/es/f/fields/TaskRecommendationInput/index.js +0 -2
- package/dist/es/f/fields/TaskRecommendationInput/styles.scss +0 -41
- package/dist/es/f/fields/TextArea/TextArea.js +0 -124
- package/dist/es/f/fields/TextArea/index.js +0 -2
- package/dist/es/f/fields/TextArea/styles.scss +0 -19
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.0 */
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import { Page } from 'ui'
|
|
4
|
+
import { Page, Quote } from 'ui'
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title :'b/Page',
|
|
@@ -57,3 +57,53 @@ export const WithSections = () => (
|
|
|
57
57
|
</Page.Section>
|
|
58
58
|
</Page>
|
|
59
59
|
)
|
|
60
|
+
|
|
61
|
+
export const SectionsWithBackground = () => (
|
|
62
|
+
<Page
|
|
63
|
+
id="with-background"
|
|
64
|
+
>
|
|
65
|
+
<Page.Section
|
|
66
|
+
id="s1"
|
|
67
|
+
backgroundShape="triangle"
|
|
68
|
+
backgroundHeight="30em"
|
|
69
|
+
backgroundVerticalAlign="flex-end"
|
|
70
|
+
backgroundHorizontalAlign="center"
|
|
71
|
+
className="y-success b-light-y"
|
|
72
|
+
style={{
|
|
73
|
+
height :'30em',
|
|
74
|
+
display :'flex',
|
|
75
|
+
justifyContent:'center',
|
|
76
|
+
alignItems :'center',
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
<Quote author="Austen Spoonts" color="paragraph">
|
|
80
|
+
Pareto was like having a full-time employee without having to hire somebody.
|
|
81
|
+
That’s how I would explain it. An on-call, on-demand full-time employee.
|
|
82
|
+
</Quote>
|
|
83
|
+
</Page.Section>
|
|
84
|
+
</Page>
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
export const SectionsWithBackgroundGradient = () => (
|
|
88
|
+
<Page
|
|
89
|
+
id="with-background-gradient"
|
|
90
|
+
>
|
|
91
|
+
<Page.Section
|
|
92
|
+
id="s1"
|
|
93
|
+
backgroundGradient
|
|
94
|
+
backgroundGradientHeight="50em"
|
|
95
|
+
className="y-success"
|
|
96
|
+
style={{
|
|
97
|
+
height :'30em',
|
|
98
|
+
display :'flex',
|
|
99
|
+
justifyContent:'center',
|
|
100
|
+
alignItems :'center',
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<Quote author="Austen Spoonts" color="paragraph">
|
|
104
|
+
Pareto was like having a full-time employee without having to hire somebody.
|
|
105
|
+
That’s how I would explain it. An on-call, on-demand full-time employee.
|
|
106
|
+
</Quote>
|
|
107
|
+
</Page.Section>
|
|
108
|
+
</Page>
|
|
109
|
+
)
|
|
@@ -4,6 +4,7 @@ import * as React from 'react'
|
|
|
4
4
|
import {
|
|
5
5
|
ContentSlides,
|
|
6
6
|
SiteContextProvider,
|
|
7
|
+
Shapes,
|
|
7
8
|
useContentSlides,
|
|
8
9
|
Title,
|
|
9
10
|
Logo,
|
|
@@ -74,7 +75,7 @@ export const Base = () => {
|
|
|
74
75
|
|
|
75
76
|
return (
|
|
76
77
|
<div className={`ui-${userTheme}`} style={{ height: '100%' }}>
|
|
77
|
-
<ContentSlides className="y-background1" steps={steps}>
|
|
78
|
+
<ContentSlides className="y-background1 b-dark-y" steps={steps}>
|
|
78
79
|
<ContentSlides.Sidebar
|
|
79
80
|
header={(
|
|
80
81
|
<Logo color="paragraph" />
|
|
@@ -341,7 +342,158 @@ export const Simple = () => {
|
|
|
341
342
|
)
|
|
342
343
|
}
|
|
343
344
|
return (
|
|
344
|
-
<ContentSlides className="y-background1" steps={steps} simple>
|
|
345
|
+
<ContentSlides className="y-background1 b-dark-y" steps={steps} simple>
|
|
346
|
+
<Main />
|
|
347
|
+
</ContentSlides>
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export const WithBackgroundShape = () => {
|
|
352
|
+
const steps = [
|
|
353
|
+
{
|
|
354
|
+
id :'welcome',
|
|
355
|
+
title :'Welcome',
|
|
356
|
+
progress:40,
|
|
357
|
+
location:'welcome',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
id :'plan',
|
|
361
|
+
title :'Choose your plan',
|
|
362
|
+
progress:60,
|
|
363
|
+
location:'select-plan',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id :'details',
|
|
367
|
+
title :'Personal details',
|
|
368
|
+
progress:70,
|
|
369
|
+
location:'personal-details',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id :'payment',
|
|
373
|
+
title :'Payment',
|
|
374
|
+
progress:90,
|
|
375
|
+
location:'payment',
|
|
376
|
+
},
|
|
377
|
+
]
|
|
378
|
+
|
|
379
|
+
const Main = () => {
|
|
380
|
+
const { isLastStep } = useContentSlides()
|
|
381
|
+
|
|
382
|
+
return (
|
|
383
|
+
<>
|
|
384
|
+
<ContentSlides.HorizontalMenu hideBackIcon={isLastStep} />
|
|
385
|
+
{' '}
|
|
386
|
+
<main>
|
|
387
|
+
<ContentSlides.Slide
|
|
388
|
+
index={0}
|
|
389
|
+
>
|
|
390
|
+
<Title
|
|
391
|
+
heading="Welcome"
|
|
392
|
+
headingAs="h1"
|
|
393
|
+
headingClassName="small"
|
|
394
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
395
|
+
/>
|
|
396
|
+
<ContentSlides.Navigator />
|
|
397
|
+
</ContentSlides.Slide
|
|
398
|
+
>
|
|
399
|
+
<ContentSlides.Slide
|
|
400
|
+
index={1}
|
|
401
|
+
>
|
|
402
|
+
<Title
|
|
403
|
+
heading="Part 2"
|
|
404
|
+
headingAs="h1"
|
|
405
|
+
headingClassName="small"
|
|
406
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
407
|
+
/>
|
|
408
|
+
<p>
|
|
409
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
410
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
411
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
412
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
413
|
+
porta placerat leo.
|
|
414
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
415
|
+
Cras placerat ac enim viverra rhoncus.
|
|
416
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
417
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
418
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
419
|
+
{' '}
|
|
420
|
+
</p>
|
|
421
|
+
<p>
|
|
422
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
423
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
424
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
425
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
426
|
+
porta placerat leo.
|
|
427
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
428
|
+
Cras placerat ac enim viverra rhoncus.
|
|
429
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
430
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
431
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
432
|
+
{' '}
|
|
433
|
+
</p>
|
|
434
|
+
<p>
|
|
435
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
436
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
437
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
438
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
439
|
+
porta placerat leo.
|
|
440
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
441
|
+
Cras placerat ac enim viverra rhoncus.
|
|
442
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
443
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
444
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
445
|
+
{' '}
|
|
446
|
+
</p>
|
|
447
|
+
<p>
|
|
448
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
449
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
450
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
451
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
452
|
+
porta placerat leo.
|
|
453
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
454
|
+
Cras placerat ac enim viverra rhoncus.
|
|
455
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
456
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
457
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
458
|
+
{' '}
|
|
459
|
+
</p>
|
|
460
|
+
|
|
461
|
+
<ContentSlides.Navigator />
|
|
462
|
+
</ContentSlides.Slide>
|
|
463
|
+
<ContentSlides.Slide
|
|
464
|
+
index={2}
|
|
465
|
+
>
|
|
466
|
+
<Title
|
|
467
|
+
heading="Part 3"
|
|
468
|
+
headingAs="h1"
|
|
469
|
+
headingClassName="small"
|
|
470
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
471
|
+
/>
|
|
472
|
+
<ContentSlides.Navigator />
|
|
473
|
+
</ContentSlides.Slide>
|
|
474
|
+
<ContentSlides.Slide
|
|
475
|
+
index={3}
|
|
476
|
+
>
|
|
477
|
+
<Title
|
|
478
|
+
heading="Part 4"
|
|
479
|
+
headingAs="h1"
|
|
480
|
+
headingClassName="small"
|
|
481
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
482
|
+
/>
|
|
483
|
+
<ContentSlides.Navigator />
|
|
484
|
+
</ContentSlides.Slide>
|
|
485
|
+
</main>
|
|
486
|
+
</>
|
|
487
|
+
)
|
|
488
|
+
}
|
|
489
|
+
return (
|
|
490
|
+
<ContentSlides className="y-background4 b-light-y" steps={steps} simple>
|
|
491
|
+
<Shapes
|
|
492
|
+
height="65em"
|
|
493
|
+
verticalAlign="center"
|
|
494
|
+
horizontalAlign="flex-start"
|
|
495
|
+
shape="spiral"
|
|
496
|
+
/>
|
|
345
497
|
<Main />
|
|
346
498
|
</ContentSlides>
|
|
347
499
|
)
|
|
@@ -13,10 +13,9 @@ export default {
|
|
|
13
13
|
decorators:[
|
|
14
14
|
(storyfn) => (
|
|
15
15
|
<Formik
|
|
16
|
-
initialValues={{ workType: '
|
|
16
|
+
initialValues={{ workType: '' }}
|
|
17
17
|
>
|
|
18
18
|
<Form>
|
|
19
|
-
|
|
20
19
|
{ storyfn() }
|
|
21
20
|
</Form>
|
|
22
21
|
</Formik>
|
|
@@ -32,18 +31,46 @@ export const Base = () => (
|
|
|
32
31
|
<SelectInput
|
|
33
32
|
name="workType"
|
|
34
33
|
label="Work Type"
|
|
35
|
-
options={['Work', 'Managing', 'Training']}
|
|
34
|
+
options={[{ value: '', label: 'Select an option', disabled: true }, 'Work', 'Managing', 'Training']}
|
|
36
35
|
/>
|
|
37
36
|
<FormDebugger />
|
|
38
37
|
</>
|
|
39
38
|
)
|
|
40
39
|
|
|
40
|
+
export const RequiredSelect = () => {
|
|
41
|
+
const requiredInput = (inputValue) => {
|
|
42
|
+
let error = ''
|
|
43
|
+
|
|
44
|
+
if (!inputValue || !inputValue?.length === 0) {
|
|
45
|
+
error = 'This information is required'
|
|
46
|
+
}
|
|
47
|
+
return error
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<SelectInput
|
|
53
|
+
validate={requiredInput}
|
|
54
|
+
name="activity"
|
|
55
|
+
label="Activity Type"
|
|
56
|
+
options={[
|
|
57
|
+
{ value: '', label: 'Select an option', disabled: true },
|
|
58
|
+
{ value: 'review', label: 'Review' },
|
|
59
|
+
{ value: 'Approve', label: 'Approve' },
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
<FormDebugger />
|
|
63
|
+
</>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
41
67
|
export const Objects = () => (
|
|
42
68
|
<>
|
|
43
69
|
<SelectInput
|
|
44
70
|
name="workType"
|
|
45
71
|
label="Work Type"
|
|
46
72
|
options={[
|
|
73
|
+
{ value: '', label: 'Select an option', disabled: true },
|
|
47
74
|
{ value: '20th Aug 2020 to 19th Sept, 2020', label: '20th Aug 2020 to 19th Sept, 2020' },
|
|
48
75
|
{ value: '20th Sept 2020 to 19th Oct, 2020', label: '20th Sept 2020 to 19th Oct, 2020' },
|
|
49
76
|
]}
|
|
@@ -57,7 +84,9 @@ export const StringAndObjects = () => (
|
|
|
57
84
|
<SelectInput
|
|
58
85
|
name="workType"
|
|
59
86
|
label="Work Type"
|
|
60
|
-
options={[
|
|
87
|
+
options={[
|
|
88
|
+
{ value: '', label: 'Select an option', disabled: true },
|
|
89
|
+
'Work', 'Managing', 'Training',
|
|
61
90
|
{ value: '20th Aug 2020 to 19th Sept, 2020', label: '20th Aug 2020 to 19th Sept, 2020' },
|
|
62
91
|
{ value: '20th Sept 2020 to 19th Oct, 2020', label: '20th Sept 2020 to 19th Oct, 2020' },
|
|
63
92
|
]}
|
|
@@ -70,7 +99,9 @@ export const DisabledSelectInput = () => (
|
|
|
70
99
|
<SelectInput
|
|
71
100
|
name="workType"
|
|
72
101
|
label="Work Type"
|
|
73
|
-
options={[
|
|
102
|
+
options={[
|
|
103
|
+
{ value: '', label: 'Select an option', disabled: true },
|
|
104
|
+
'Work', 'Managing', 'Training',
|
|
74
105
|
{ value: '20th Aug 2020 to 19th Sept, 2020', label: '20th Aug 2020 to 19th Sept, 2020' },
|
|
75
106
|
{ value: '20th Sept 2020 to 19th Oct, 2020', label: '20th Sept 2020 to 19th Oct, 2020' },
|
|
76
107
|
]}
|
|
@@ -41,7 +41,7 @@ export const Base = () => {
|
|
|
41
41
|
return errorMessage
|
|
42
42
|
}
|
|
43
43
|
return (
|
|
44
|
-
<div className="
|
|
44
|
+
<div className=" u2 pb-u">
|
|
45
45
|
<TextInput
|
|
46
46
|
name="firstName"
|
|
47
47
|
label="What's your first name ?"
|
|
@@ -52,8 +52,19 @@ export const Base = () => {
|
|
|
52
52
|
)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export const
|
|
56
|
-
<div className="
|
|
55
|
+
export const Placeholder = () => (
|
|
56
|
+
<div className="u2 pb-u">
|
|
57
|
+
<TextInput
|
|
58
|
+
name="firstName"
|
|
59
|
+
label="What's your first name ?"
|
|
60
|
+
placeholder="First Name"
|
|
61
|
+
/>
|
|
62
|
+
<FormDebugger />
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
export const Disabled = () => (
|
|
67
|
+
<div className="u2 pb-u">
|
|
57
68
|
<TextInput
|
|
58
69
|
name="firstName"
|
|
59
70
|
label="What's your first name ?"
|
|
@@ -63,7 +74,7 @@ export const DisabledTextInput = () => (
|
|
|
63
74
|
)
|
|
64
75
|
|
|
65
76
|
export const DateTime = () => (
|
|
66
|
-
<div
|
|
77
|
+
<div>
|
|
67
78
|
<TextInput
|
|
68
79
|
name="date"
|
|
69
80
|
label="Select date"
|
|
@@ -14,7 +14,7 @@ export default {
|
|
|
14
14
|
decorators:[
|
|
15
15
|
(storyfn) => (
|
|
16
16
|
<Formik
|
|
17
|
-
initialValues={{
|
|
17
|
+
initialValues={{ feedback: '' }}
|
|
18
18
|
>
|
|
19
19
|
<Form>
|
|
20
20
|
|
|
@@ -29,18 +29,54 @@ export default {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export const Base = () => (
|
|
32
|
-
<div
|
|
32
|
+
<div>
|
|
33
33
|
<TextareaInput
|
|
34
|
-
name="
|
|
34
|
+
name="feedback"
|
|
35
35
|
label="What can we improve on?"
|
|
36
36
|
/>
|
|
37
37
|
<FormDebugger />
|
|
38
38
|
</div>
|
|
39
39
|
)
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
|
|
41
|
+
export const Placeholder = () => (
|
|
42
|
+
<div>
|
|
43
|
+
<TextareaInput
|
|
44
|
+
name="feedback"
|
|
45
|
+
label="What can we improve on?"
|
|
46
|
+
placeholder="Type your feedback here..."
|
|
47
|
+
/>
|
|
48
|
+
<FormDebugger />
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
export const Validation = () => {
|
|
53
|
+
const validate = (value) => {
|
|
54
|
+
let errorMessage = ''
|
|
55
|
+
const isValid = value.length > 3
|
|
56
|
+
|
|
57
|
+
if (!isValid) {
|
|
58
|
+
errorMessage = 'Value should be greater than 3 characters'
|
|
59
|
+
}
|
|
60
|
+
return errorMessage
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div>
|
|
65
|
+
<TextareaInput
|
|
66
|
+
name="feedback"
|
|
67
|
+
label="What can we improve on?"
|
|
68
|
+
placeholder="Type your feedback here..."
|
|
69
|
+
validate={validate}
|
|
70
|
+
/>
|
|
71
|
+
<FormDebugger />
|
|
72
|
+
</div>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const Disabled = () => (
|
|
77
|
+
<div>
|
|
42
78
|
<TextareaInput
|
|
43
|
-
name="
|
|
79
|
+
name="feedback"
|
|
44
80
|
label="What can we improve on?"
|
|
45
81
|
disabled
|
|
46
82
|
/>
|
|
@@ -0,0 +1,76 @@
|
|
|
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 = 'background-gradient'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is the component description.
|
|
18
|
+
*/
|
|
19
|
+
const BackgroundGradient = ({
|
|
20
|
+
id,
|
|
21
|
+
className:userClassName,
|
|
22
|
+
style,
|
|
23
|
+
height,
|
|
24
|
+
// ...otherProps
|
|
25
|
+
}) => {
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
import('./styles.scss')
|
|
28
|
+
}, [])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
id={id}
|
|
33
|
+
className={[
|
|
34
|
+
|
|
35
|
+
baseClassName,
|
|
36
|
+
|
|
37
|
+
componentClassName,
|
|
38
|
+
userClassName,
|
|
39
|
+
]
|
|
40
|
+
.filter((e) => e)
|
|
41
|
+
.join(' ')}
|
|
42
|
+
style={{
|
|
43
|
+
...style,
|
|
44
|
+
'--gradient-height':height,
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
BackgroundGradient.propTypes = {
|
|
51
|
+
/**
|
|
52
|
+
* The HTML id for this element
|
|
53
|
+
*/
|
|
54
|
+
id:PropTypes.string,
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The HTML class names for this element
|
|
58
|
+
*/
|
|
59
|
+
className:PropTypes.string,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The React-written, css properties for this element.
|
|
63
|
+
*/
|
|
64
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The height of the shape.
|
|
68
|
+
*/
|
|
69
|
+
height:PropTypes.string,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
BackgroundGradient.defaultProps = {
|
|
73
|
+
// someProp: false,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default BackgroundGradient
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.background-gradient{
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: var(--gradient-height);
|
|
10
|
+
background-image: linear-gradient(var(--background1), var(--y) 25%, var(--light-y) 75%, var(--background1));
|
|
11
|
+
opacity: .4;
|
|
12
|
+
z-index: -1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
@@ -28,19 +28,19 @@ const Conversation = ({
|
|
|
28
28
|
ourColor,
|
|
29
29
|
theirColor,
|
|
30
30
|
children,
|
|
31
|
+
hasTriangle,
|
|
31
32
|
// ...otherProps
|
|
32
33
|
}) => {
|
|
33
34
|
useLayoutEffect(() => {
|
|
34
35
|
import('./styles.scss')
|
|
35
36
|
}, [])
|
|
36
37
|
|
|
37
|
-
// const messageColors = { ours: color, theirs: 'main2' }
|
|
38
|
-
|
|
39
38
|
return (
|
|
40
39
|
<ConversationContext.Provider
|
|
41
40
|
value={{
|
|
42
41
|
ourColor,
|
|
43
42
|
theirColor,
|
|
43
|
+
hasTriangle,
|
|
44
44
|
}}
|
|
45
45
|
>
|
|
46
46
|
<div
|
|
@@ -76,11 +76,13 @@ Conversation.propTypes = {
|
|
|
76
76
|
/**
|
|
77
77
|
* The React-written, css properties for this element.
|
|
78
78
|
*/
|
|
79
|
-
style
|
|
79
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
80
|
+
|
|
80
81
|
/**
|
|
81
82
|
* The base color to our messages component
|
|
82
83
|
*/
|
|
83
|
-
ourColor
|
|
84
|
+
ourColor:PropTypes.string,
|
|
85
|
+
|
|
84
86
|
/**
|
|
85
87
|
* The base color to their messages component
|
|
86
88
|
*/
|
|
@@ -94,12 +96,18 @@ Conversation.propTypes = {
|
|
|
94
96
|
* The children JSX
|
|
95
97
|
*/
|
|
96
98
|
children :PropTypes.node,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* whether to add triangle to bubble chats
|
|
102
|
+
*/
|
|
103
|
+
hasTriangle:PropTypes.bool,
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
Conversation.defaultProps = {
|
|
100
|
-
backgroundColor:'
|
|
101
|
-
ourColor :'
|
|
102
|
-
theirColor :'
|
|
107
|
+
backgroundColor:'background2',
|
|
108
|
+
ourColor :'background1',
|
|
109
|
+
theirColor :'background1',
|
|
110
|
+
hasTriangle :'false',
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
Conversation.Message = Message
|
|
@@ -23,9 +23,12 @@ const Message = ({
|
|
|
23
23
|
message,
|
|
24
24
|
sender,
|
|
25
25
|
from,
|
|
26
|
+
attachment,
|
|
27
|
+
attachmentIcon,
|
|
28
|
+
attachmentColor,
|
|
26
29
|
// ...otherProps
|
|
27
30
|
}) => {
|
|
28
|
-
const { ourColor, theirColor } = useConversation()
|
|
31
|
+
const { hasTriangle, ourColor, theirColor } = useConversation()
|
|
29
32
|
|
|
30
33
|
return (
|
|
31
34
|
<div
|
|
@@ -36,6 +39,8 @@ const Message = ({
|
|
|
36
39
|
userClassName,
|
|
37
40
|
`x-${from === 'ours' ? ourColor : theirColor}`,
|
|
38
41
|
from === 'ours' && 'ours',
|
|
42
|
+
hasTriangle === true ? 'has-triangle' : '',
|
|
43
|
+
'v1',
|
|
39
44
|
]
|
|
40
45
|
.filter((e) => e)
|
|
41
46
|
.join(' ')}
|
|
@@ -49,11 +54,19 @@ const Message = ({
|
|
|
49
54
|
<p>
|
|
50
55
|
{message}
|
|
51
56
|
</p>
|
|
57
|
+
{attachment
|
|
58
|
+
&& (
|
|
59
|
+
<div className={`attachment y-${attachmentColor}`}>
|
|
60
|
+
<span className="f-icons">{attachmentIcon}</span>
|
|
61
|
+
<p className="ml-v">
|
|
62
|
+
{attachment}
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
52
66
|
</div>
|
|
53
67
|
</div>
|
|
54
68
|
)
|
|
55
69
|
}
|
|
56
|
-
|
|
57
70
|
Message.propTypes = {
|
|
58
71
|
/**
|
|
59
72
|
* The HTML id for this element
|
|
@@ -65,26 +78,46 @@ Message.propTypes = {
|
|
|
65
78
|
*/
|
|
66
79
|
className:PropTypes.string,
|
|
67
80
|
|
|
81
|
+
/**
|
|
82
|
+
* The React-written, css properties for this element.
|
|
83
|
+
*/
|
|
84
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
85
|
+
|
|
68
86
|
/**
|
|
69
87
|
* The message in the conversation
|
|
70
88
|
*/
|
|
71
89
|
message:PropTypes.string.isRequired,
|
|
90
|
+
|
|
72
91
|
/**
|
|
73
92
|
* The sender of the message
|
|
74
93
|
*/
|
|
75
|
-
sender
|
|
94
|
+
sender:PropTypes.string.isRequired,
|
|
95
|
+
|
|
76
96
|
/**
|
|
77
97
|
* The owner of the message
|
|
78
98
|
*/
|
|
79
|
-
from
|
|
99
|
+
from:PropTypes.oneOf(['ours', 'theirs']),
|
|
100
|
+
|
|
80
101
|
/**
|
|
81
|
-
*
|
|
102
|
+
* name of the attachment file
|
|
103
|
+
*/
|
|
104
|
+
attachment:PropTypes.string,
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* source of the attachment icon
|
|
108
|
+
*/
|
|
109
|
+
attachmentIcon:PropTypes.string,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* background color of the attachment box
|
|
82
113
|
*/
|
|
83
|
-
|
|
114
|
+
attachmentColor:PropTypes.string,
|
|
84
115
|
}
|
|
85
116
|
|
|
86
117
|
Message.defaultProps = {
|
|
87
|
-
from:'theirs',
|
|
118
|
+
from :'theirs',
|
|
119
|
+
attachmentIcon :'A',
|
|
120
|
+
attachmentColor:'main4',
|
|
88
121
|
}
|
|
89
122
|
|
|
90
123
|
export default Message
|