@pareto-engineering/design-system 2.0.0-alpha.51 → 2.0.0-alpha.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/a/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/GradientBackground/GradientBackground.js +140 -0
- package/dist/cjs/a/GradientBackground/index.js +15 -0
- package/dist/cjs/a/GradientBackground/styles.scss +191 -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/index.js +8 -8
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +1 -1
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +4 -4
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +1 -1
- package/dist/cjs/c/AcceptCookies/AcceptCookies.js +134 -0
- package/dist/cjs/c/AcceptCookies/index.js +15 -0
- package/dist/cjs/c/AcceptCookies/styles.scss +49 -0
- package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +95 -0
- package/dist/cjs/c/BlogCategoryButton/index.js +15 -0
- package/dist/cjs/c/BlogContext/BlogContextProvider.js +63 -0
- package/dist/cjs/c/BlogContext/Context.js +16 -0
- package/dist/cjs/c/BlogContext/ContextProvider.js +63 -0
- package/dist/cjs/c/BlogContext/index.js +31 -0
- package/dist/cjs/c/BlogContext/useBlog.js +16 -0
- package/dist/cjs/c/BlogPost/BlogPost.js +147 -0
- package/dist/cjs/c/BlogPost/index.js +15 -0
- package/dist/cjs/c/BlogPost/styles.scss +33 -0
- package/dist/cjs/c/BlogPostsList/BlogPostsList.js +73 -0
- package/dist/cjs/c/BlogPostsList/common/Card/Card.js +170 -0
- package/dist/cjs/c/BlogPostsList/common/Card/index.js +15 -0
- package/dist/cjs/c/BlogPostsList/common/index.js +13 -0
- package/dist/cjs/c/BlogPostsList/index.js +15 -0
- package/dist/cjs/c/BlogPostsList/styles.scss +72 -0
- package/dist/cjs/c/SiteFooter/SiteFooter.js +73 -0
- package/dist/cjs/c/SiteFooter/common/Section/Section.js +95 -0
- package/dist/cjs/c/SiteFooter/common/Section/index.js +15 -0
- package/dist/cjs/c/SiteFooter/common/index.js +13 -0
- package/dist/cjs/c/SiteFooter/index.js +15 -0
- package/dist/cjs/c/SiteFooter/styles.scss +34 -0
- package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +108 -0
- package/dist/cjs/c/SiteHeaderCTA/index.js +15 -0
- package/dist/cjs/c/SiteHeaderCTA/styles.scss +44 -0
- package/dist/cjs/c/SiteMission/SiteMission.js +113 -0
- package/dist/cjs/c/SiteMission/index.js +15 -0
- package/dist/cjs/c/SiteMission/styles.scss +30 -0
- package/dist/cjs/c/SiteNavigation/SiteNavigation.js +130 -0
- package/dist/cjs/c/SiteNavigation/index.js +15 -0
- package/dist/cjs/c/SiteNavigation/styles.scss +118 -0
- package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +98 -0
- package/dist/cjs/c/SiteOnboardingStep/index.js +15 -0
- package/dist/cjs/c/SiteOnboardingStep/styles.scss +51 -0
- package/dist/cjs/c/SitePricing/SitePricing.js +108 -0
- package/dist/cjs/c/SitePricing/index.js +15 -0
- package/dist/cjs/c/SitePricing/styles.scss +73 -0
- package/dist/cjs/c/SiteServices/SiteServices.js +211 -0
- package/dist/cjs/c/SiteServices/index.js +15 -0
- package/dist/cjs/c/SiteServices/styles.scss +138 -0
- package/dist/cjs/c/TeamGallery/TeamGallery.js +80 -0
- package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +84 -0
- package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +15 -0
- package/dist/cjs/c/TeamGallery/common/index.js +13 -0
- package/dist/cjs/c/TeamGallery/index.js +15 -0
- package/dist/cjs/c/TeamGallery/styles.scss +100 -0
- package/dist/cjs/c/Testimonials/Testimonials.js +119 -0
- package/dist/cjs/c/Testimonials/index.js +15 -0
- package/dist/cjs/c/Testimonials/styles.scss +112 -0
- package/dist/cjs/experimental/GradientBackground/GradientBackground.js +98 -0
- package/dist/cjs/experimental/GradientBackground/index.js +15 -0
- package/dist/cjs/experimental/GradientBackground/styles.scss +64 -0
- package/dist/cjs/experimental/index.js +13 -0
- package/dist/cjs/f/common/Description/Description.js +20 -14
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +0 -2
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
- package/dist/cjs/f/fields/QuerySelect/styles.scss +21 -0
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +16 -8
- package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +129 -0
- package/dist/cjs/f/fields/TaskRecommendation/index.js +15 -0
- package/dist/cjs/f/fields/TaskRecommendation/styles.scss +37 -0
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/cjs/f/fields/TextArea/TextArea.js +141 -0
- package/dist/cjs/f/fields/TextArea/index.js +15 -0
- package/dist/cjs/f/fields/TextArea/styles.scss +19 -0
- package/dist/cjs/f/fields/TextInput/TextInput.js +18 -9
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +16 -8
- package/dist/cjs/test/QueryLoader/styles.scss +9 -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/GradientBackground/GradientBackground.js +118 -0
- package/dist/es/a/GradientBackground/index.js +2 -0
- package/dist/es/a/GradientBackground/styles.scss +191 -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/index.js +1 -1
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +2 -2
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +5 -5
- package/dist/es/b/ThemeSelector/ThemeSelector.js +2 -2
- package/dist/es/c/AcceptCookies/AcceptCookies.js +117 -0
- package/dist/es/c/AcceptCookies/index.js +2 -0
- package/dist/es/c/AcceptCookies/styles.scss +49 -0
- package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +68 -0
- package/dist/es/c/BlogCategoryButton/index.js +2 -0
- package/dist/es/c/BlogContext/BlogContextProvider.js +45 -0
- package/dist/es/c/BlogContext/Context.js +2 -0
- package/dist/es/c/BlogContext/ContextProvider.js +45 -0
- package/dist/es/c/BlogContext/index.js +4 -0
- package/dist/es/c/BlogContext/useBlog.js +3 -0
- package/dist/es/c/BlogPost/BlogPost.js +128 -0
- package/dist/es/c/BlogPost/index.js +2 -0
- package/dist/es/c/BlogPost/styles.scss +33 -0
- package/dist/es/c/BlogPostsList/BlogPostsList.js +56 -0
- package/dist/es/c/BlogPostsList/common/Card/Card.js +143 -0
- package/dist/es/c/BlogPostsList/common/Card/index.js +2 -0
- package/dist/es/c/BlogPostsList/common/index.js +1 -0
- package/dist/es/c/BlogPostsList/index.js +2 -0
- package/dist/es/c/BlogPostsList/styles.scss +72 -0
- package/dist/es/c/SiteFooter/SiteFooter.js +56 -0
- package/dist/es/c/SiteFooter/common/Section/Section.js +73 -0
- package/dist/es/c/SiteFooter/common/Section/index.js +2 -0
- package/dist/es/c/SiteFooter/common/index.js +1 -0
- package/dist/es/c/SiteFooter/index.js +2 -0
- package/dist/es/c/SiteFooter/styles.scss +34 -0
- package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +92 -0
- package/dist/es/c/SiteHeaderCTA/index.js +2 -0
- package/dist/es/c/SiteHeaderCTA/styles.scss +44 -0
- package/dist/es/c/SiteMission/SiteMission.js +96 -0
- package/dist/es/c/SiteMission/index.js +2 -0
- package/dist/es/c/SiteMission/styles.scss +30 -0
- package/dist/es/c/SiteNavigation/SiteNavigation.js +111 -0
- package/dist/es/c/SiteNavigation/index.js +2 -0
- package/dist/es/c/SiteNavigation/styles.scss +118 -0
- package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +81 -0
- package/dist/es/c/SiteOnboardingStep/index.js +2 -0
- package/dist/es/c/SiteOnboardingStep/styles.scss +51 -0
- package/dist/es/c/SitePricing/SitePricing.js +91 -0
- package/dist/es/c/SitePricing/index.js +2 -0
- package/dist/es/c/SitePricing/styles.scss +73 -0
- package/dist/es/c/SiteServices/SiteServices.js +195 -0
- package/dist/es/c/SiteServices/index.js +2 -0
- package/dist/es/c/SiteServices/styles.scss +138 -0
- package/dist/es/c/TeamGallery/TeamGallery.js +64 -0
- package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +64 -0
- package/dist/es/c/TeamGallery/common/PersonCard/index.js +2 -0
- package/dist/es/c/TeamGallery/common/index.js +1 -0
- package/dist/es/c/TeamGallery/index.js +2 -0
- package/dist/es/c/TeamGallery/styles.scss +100 -0
- package/dist/es/c/Testimonials/Testimonials.js +99 -0
- package/dist/es/c/Testimonials/index.js +2 -0
- package/dist/es/c/Testimonials/styles.scss +112 -0
- package/dist/es/experimental/GradientBackground/GradientBackground.js +76 -0
- package/dist/es/experimental/GradientBackground/index.js +2 -0
- package/dist/es/experimental/GradientBackground/styles.scss +64 -0
- package/dist/es/experimental/index.js +1 -0
- package/dist/es/f/common/Description/Description.js +19 -14
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +0 -2
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
- package/dist/es/f/fields/QuerySelect/styles.scss +21 -0
- package/dist/es/f/fields/SelectInput/SelectInput.js +16 -8
- package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +111 -0
- package/dist/es/f/fields/TaskRecommendation/index.js +2 -0
- package/dist/es/f/fields/TaskRecommendation/styles.scss +37 -0
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/es/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/es/f/fields/TextArea/TextArea.js +124 -0
- package/dist/es/f/fields/TextArea/index.js +2 -0
- package/dist/es/f/fields/TextArea/styles.scss +19 -0
- package/dist/es/f/fields/TextInput/TextInput.js +18 -9
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +16 -8
- package/dist/es/test/QueryLoader/styles.scss +9 -0
- package/package.json +1 -1
- package/src/__snapshots__/Storyshots.test.js.snap +1528 -1385
- package/src/stories/a/{SiteContext.stories.jsx → AppContext.stories.jsx} +8 -8
- package/src/stories/a/DotInfo.stories.jsx +12 -12
- package/src/stories/a/ProgressBar.stories.jsx +12 -6
- package/src/stories/a/Timestamp.stories.jsx +32 -38
- package/src/stories/b/Logo.stories.jsx +13 -13
- package/src/stories/b/QuestionDropdown.stories.jsx +17 -30
- package/src/stories/b/SocialMediaButton.stories.jsx +34 -52
- package/src/stories/b/ThemeSelector.stories.jsx +5 -5
- package/src/stories/b/Title.stories.jsx +11 -13
- package/src/stories/c/ContentSlides.stories.jsx +30 -300
- package/src/stories/f/ChoicesInput.stories.jsx +62 -129
- package/src/stories/f/Description.stories.jsx +12 -2
- package/src/stories/f/RatingsInput.stories.jsx +21 -22
- package/src/stories/f/SelectInput.stories.jsx +35 -75
- package/src/stories/f/TextInput.stories.jsx +55 -52
- package/src/stories/f/TextareaInput.stories.jsx +31 -46
- 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/index.js +4 -4
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +2 -2
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +4 -4
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +2 -2
- package/src/ui/f/common/Description/Description.jsx +34 -29
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +1 -2
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +1 -11
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +1 -11
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +16 -9
- package/src/ui/f/fields/TextInput/TextInput.jsx +13 -7
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +9 -8
- package/src/ui/a/SiteContext/index.js +0 -5
|
@@ -26,87 +26,47 @@ export default {
|
|
|
26
26
|
},
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const Template = (args) => (
|
|
30
30
|
<>
|
|
31
|
-
<SelectInput
|
|
32
|
-
name="workType"
|
|
33
|
-
label="Work Type"
|
|
34
|
-
options={[{ value: '', label: 'Select an option', disabled: true }, 'Work', 'Managing', 'Training']}
|
|
35
|
-
/>
|
|
31
|
+
<SelectInput {...args} />
|
|
36
32
|
<FormDebugger />
|
|
37
33
|
</>
|
|
38
34
|
)
|
|
39
35
|
|
|
40
|
-
export const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
export const Base = Template.bind({})
|
|
37
|
+
Base.args = {
|
|
38
|
+
name :'workType',
|
|
39
|
+
label :'Work Type',
|
|
40
|
+
options:[
|
|
41
|
+
{ value: '', label: 'Select an option', disabled: true },
|
|
42
|
+
{ value: 'Work', label: 'Work' },
|
|
43
|
+
{ value: 'Managing', label: 'Managing' },
|
|
44
|
+
{ value: 'Training', label: 'Training' },
|
|
45
|
+
],
|
|
46
|
+
}
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
)
|
|
48
|
+
export const StringAndObjects = Template.bind({})
|
|
49
|
+
StringAndObjects.args = {
|
|
50
|
+
...Base.args,
|
|
51
|
+
options:[...Base.args.options, 'Option1', 'Option2', 'Option3'],
|
|
65
52
|
}
|
|
66
53
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<SelectInput
|
|
70
|
-
name="workType"
|
|
71
|
-
label="Work Type"
|
|
72
|
-
options={[
|
|
73
|
-
{ value: '', label: 'Select an option', disabled: true },
|
|
74
|
-
{ value: '20th Aug 2020 to 19th Sept, 2020', label: '20th Aug 2020 to 19th Sept, 2020' },
|
|
75
|
-
{ value: '20th Sept 2020 to 19th Oct, 2020', label: '20th Sept 2020 to 19th Oct, 2020' },
|
|
76
|
-
]}
|
|
77
|
-
/>
|
|
78
|
-
<FormDebugger />
|
|
79
|
-
</>
|
|
80
|
-
)
|
|
54
|
+
const requiredInput = (inputValue) => {
|
|
55
|
+
let error = ''
|
|
81
56
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<>
|
|
99
|
-
<SelectInput
|
|
100
|
-
name="workType"
|
|
101
|
-
label="Work Type"
|
|
102
|
-
options={[
|
|
103
|
-
{ value: '', label: 'Select an option', disabled: true },
|
|
104
|
-
'Work', 'Managing', 'Training',
|
|
105
|
-
{ value: '20th Aug 2020 to 19th Sept, 2020', label: '20th Aug 2020 to 19th Sept, 2020' },
|
|
106
|
-
{ value: '20th Sept 2020 to 19th Oct, 2020', label: '20th Sept 2020 to 19th Oct, 2020' },
|
|
107
|
-
]}
|
|
108
|
-
disabled
|
|
109
|
-
/>
|
|
110
|
-
<FormDebugger />
|
|
111
|
-
</>
|
|
112
|
-
)
|
|
57
|
+
if (!inputValue || !inputValue?.length === 0) {
|
|
58
|
+
error = 'This information is required'
|
|
59
|
+
}
|
|
60
|
+
return error
|
|
61
|
+
}
|
|
62
|
+
export const Required = Template.bind({})
|
|
63
|
+
Required.args = {
|
|
64
|
+
...Base.args,
|
|
65
|
+
validate:requiredInput,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const DisabledSelectInput = Template.bind({})
|
|
69
|
+
DisabledSelectInput.args = {
|
|
70
|
+
...Base.args,
|
|
71
|
+
disabled:true,
|
|
72
|
+
}
|
|
@@ -30,61 +30,64 @@ export default {
|
|
|
30
30
|
},
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
// eslint-disable-next-line react/prop-types
|
|
34
|
+
const Template = (args) => (
|
|
35
|
+
<div className=" u2 pb-u">
|
|
36
|
+
<TextInput {...args} />
|
|
37
|
+
<FormDebugger />
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
export const Base = Template.bind({})
|
|
42
|
+
Base.args = {
|
|
43
|
+
name :'firstName',
|
|
44
|
+
label:"What's your first name ?",
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const validate = (value) => {
|
|
48
|
+
let errorMessage = ''
|
|
49
|
+
const isValid = value.length > 3
|
|
37
50
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
return errorMessage
|
|
51
|
+
if (!isValid) {
|
|
52
|
+
errorMessage = 'Value should be greater than 3 characters'
|
|
42
53
|
}
|
|
43
|
-
return
|
|
44
|
-
<div className=" u2 pb-u">
|
|
45
|
-
<TextInput
|
|
46
|
-
name="firstName"
|
|
47
|
-
label="What's your first name ?"
|
|
48
|
-
validate={validate}
|
|
49
|
-
/>
|
|
50
|
-
<FormDebugger />
|
|
51
|
-
</div>
|
|
52
|
-
)
|
|
54
|
+
return errorMessage
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
placeholder="First Name"
|
|
61
|
-
/>
|
|
62
|
-
<FormDebugger />
|
|
63
|
-
</div>
|
|
64
|
-
)
|
|
57
|
+
export const WithValidation = Template.bind({})
|
|
58
|
+
WithValidation.args = {
|
|
59
|
+
...Base.args,
|
|
60
|
+
validate,
|
|
61
|
+
}
|
|
65
62
|
|
|
66
|
-
export const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
disabled
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
)
|
|
63
|
+
export const WithPlaceholder = Template.bind({})
|
|
64
|
+
WithPlaceholder.args = {
|
|
65
|
+
...Base.args,
|
|
66
|
+
placeholder:'First Name',
|
|
67
|
+
}
|
|
75
68
|
|
|
76
|
-
export const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
69
|
+
export const WithAutoCompleteOff = Template.bind({})
|
|
70
|
+
WithAutoCompleteOff.args = {
|
|
71
|
+
...Base.args,
|
|
72
|
+
autoComplete:'off',
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const WithDisabled = Template.bind({})
|
|
76
|
+
WithDisabled.args = {
|
|
77
|
+
...Base.args,
|
|
78
|
+
disabled:true,
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const Date = Template.bind({})
|
|
82
|
+
Date.args = {
|
|
83
|
+
type :'date',
|
|
84
|
+
name :'date',
|
|
85
|
+
label:'Select date',
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Time = Template.bind({})
|
|
89
|
+
Time.args = {
|
|
90
|
+
type :'time',
|
|
91
|
+
name :'time',
|
|
92
|
+
label:'Select time',
|
|
93
|
+
}
|
|
@@ -28,58 +28,43 @@ export default {
|
|
|
28
28
|
},
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<TextareaInput
|
|
34
|
-
name="feedback"
|
|
35
|
-
label="What can we improve on?"
|
|
36
|
-
/>
|
|
31
|
+
const Template = (args) => (
|
|
32
|
+
<>
|
|
33
|
+
<TextareaInput {...args} />
|
|
37
34
|
<FormDebugger />
|
|
38
|
-
|
|
35
|
+
</>
|
|
39
36
|
)
|
|
40
37
|
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
export const Base = Template.bind({})
|
|
39
|
+
Base.args = {
|
|
40
|
+
name :'feedback',
|
|
41
|
+
label:'What can we improve on?',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const Placeholder = Template.bind({})
|
|
45
|
+
Placeholder.args = {
|
|
46
|
+
...Base.args,
|
|
47
|
+
placeholder:'Type your feedback here...',
|
|
48
|
+
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const isValid = value.length > 3
|
|
50
|
+
const validate = (value) => {
|
|
51
|
+
let errorMessage = ''
|
|
52
|
+
const isValid = value.length > 3
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return errorMessage
|
|
54
|
+
if (!isValid) {
|
|
55
|
+
errorMessage = 'Value should be greater than 3 characters'
|
|
61
56
|
}
|
|
57
|
+
return errorMessage
|
|
58
|
+
}
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
label="What can we improve on?"
|
|
68
|
-
placeholder="Type your feedback here..."
|
|
69
|
-
validate={validate}
|
|
70
|
-
/>
|
|
71
|
-
<FormDebugger />
|
|
72
|
-
</div>
|
|
73
|
-
)
|
|
60
|
+
export const Validation = Template.bind({})
|
|
61
|
+
Validation.args = {
|
|
62
|
+
...Base.args,
|
|
63
|
+
validate,
|
|
74
64
|
}
|
|
75
65
|
|
|
76
|
-
export const Disabled = ()
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
disabled
|
|
82
|
-
/>
|
|
83
|
-
<FormDebugger />
|
|
84
|
-
</div>
|
|
85
|
-
)
|
|
66
|
+
export const Disabled = Template.bind({})
|
|
67
|
+
Disabled.args = {
|
|
68
|
+
...Base.args,
|
|
69
|
+
disabled:true,
|
|
70
|
+
}
|
|
File without changes
|
|
@@ -24,7 +24,7 @@ const reducer = (state, action) => {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const AppContextProvider = ({
|
|
28
28
|
children,
|
|
29
29
|
initialTheme,
|
|
30
30
|
config,
|
|
@@ -48,7 +48,7 @@ const SiteContextProvider = ({
|
|
|
48
48
|
)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
AppContextProvider.propTypes = {
|
|
52
52
|
/**
|
|
53
53
|
* The children JSX
|
|
54
54
|
*/
|
|
@@ -60,10 +60,10 @@ SiteContextProvider.propTypes = {
|
|
|
60
60
|
initialTheme:PropTypes.string,
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* A dictionnary containing settings and preferences to be used
|
|
63
|
+
* A dictionnary containing settings and preferences to be used application-wide
|
|
64
64
|
*/
|
|
65
65
|
config:PropTypes.shape({
|
|
66
|
-
|
|
66
|
+
APP:PropTypes.shape({
|
|
67
67
|
NAME :PropTypes.string.isRequired,
|
|
68
68
|
CANONICAL :PropTypes.string.isRequired,
|
|
69
69
|
SUPPORT_EMAIL:PropTypes.string,
|
|
@@ -74,16 +74,17 @@ SiteContextProvider.propTypes = {
|
|
|
74
74
|
INSTAGRAM:PropTypes.string,
|
|
75
75
|
YOUTUBE :PropTypes.string,
|
|
76
76
|
}),
|
|
77
|
+
CONSTANTS:PropTypes.shape({}),
|
|
77
78
|
}).isRequired,
|
|
78
79
|
|
|
79
80
|
/**
|
|
80
|
-
*
|
|
81
|
+
* Application context initial state
|
|
81
82
|
*/
|
|
82
83
|
initialState:PropTypes.objectOf(PropTypes.string),
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
AppContextProvider.defaultProps = {
|
|
86
87
|
initialState:{},
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
export default
|
|
90
|
+
export default AppContextProvider
|
|
File without changes
|
|
File without changes
|
package/src/ui/a/index.js
CHANGED
|
@@ -2,11 +2,11 @@ export { SVG } from './SVG'
|
|
|
2
2
|
export { DashboardNavbar } from './DashboardNavbar'
|
|
3
3
|
export { IconList } from './IconList'
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
AppContext,
|
|
6
|
+
AppContextProvider,
|
|
7
|
+
useApp,
|
|
8
8
|
useTheme,
|
|
9
|
-
} from './
|
|
9
|
+
} from './AppContext'
|
|
10
10
|
export { ProgressBar } from './ProgressBar'
|
|
11
11
|
export { TeamInfo } from './TeamInfo'
|
|
12
12
|
export { AnimatedCounter } from './AnimatedCounter'
|
|
@@ -3,7 +3,7 @@ import * as React from 'react'
|
|
|
3
3
|
import { useMemo } from 'react'
|
|
4
4
|
import PropTypes from 'prop-types'
|
|
5
5
|
import { Helmet } from 'react-helmet'
|
|
6
|
-
import {
|
|
6
|
+
import { useApp } from 'ui/a'
|
|
7
7
|
|
|
8
8
|
const helmetMap = [
|
|
9
9
|
{
|
|
@@ -163,7 +163,7 @@ const PageHelmet = ({
|
|
|
163
163
|
...props
|
|
164
164
|
}) => {
|
|
165
165
|
// const intl = useIntl()
|
|
166
|
-
const context =
|
|
166
|
+
const context = useApp()
|
|
167
167
|
|
|
168
168
|
const HelmetContent = useMemo(() => helmetMap.reduce(
|
|
169
169
|
/* eslint-disable no-unused-vars -- TODO add test or ssr mode */
|
|
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types'
|
|
|
7
7
|
|
|
8
8
|
import styleNames from '@pareto-engineering/bem'
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { useApp } from 'ui/a'
|
|
11
11
|
|
|
12
12
|
// Local Definitions
|
|
13
13
|
|
|
@@ -37,7 +37,7 @@ const defaultsMap = {
|
|
|
37
37
|
/**
|
|
38
38
|
* This is the component description.
|
|
39
39
|
* This component takes `y` as the default color and `x` as the hover color.
|
|
40
|
-
* This components needs to be wrapped within a `
|
|
40
|
+
* This components needs to be wrapped within a `AppContextProvider`.
|
|
41
41
|
*/
|
|
42
42
|
const SocialMediaButton = ({
|
|
43
43
|
id,
|
|
@@ -50,14 +50,14 @@ const SocialMediaButton = ({
|
|
|
50
50
|
isTransparent,
|
|
51
51
|
...otherProps
|
|
52
52
|
}) => {
|
|
53
|
-
const
|
|
53
|
+
const applicationContext = useApp()
|
|
54
54
|
|
|
55
55
|
useLayoutEffect(() => {
|
|
56
56
|
import('./styles.scss')
|
|
57
57
|
}, [])
|
|
58
58
|
|
|
59
59
|
const content = type && defaultsMap[type]
|
|
60
|
-
const href = link ||
|
|
60
|
+
const href = link || applicationContext?.SOCIAL?.[content.link]
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
63
|
<a href={href} target="_blank" rel="noreferrer">
|
|
@@ -4,7 +4,7 @@ import { useLayoutEffect, useCallback } from 'react'
|
|
|
4
4
|
import PropTypes from 'prop-types'
|
|
5
5
|
import styleNames from '@pareto-engineering/bem'
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useApp } from 'ui/a'
|
|
8
8
|
|
|
9
9
|
// Local Definitions
|
|
10
10
|
|
|
@@ -27,7 +27,7 @@ const ThemeSelector = ({
|
|
|
27
27
|
const {
|
|
28
28
|
userTheme,
|
|
29
29
|
setPreferredTheme,
|
|
30
|
-
} =
|
|
30
|
+
} = useApp()
|
|
31
31
|
|
|
32
32
|
useLayoutEffect(() => {
|
|
33
33
|
import('./styles.scss')
|
|
@@ -3,6 +3,8 @@ import * as React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { useLayoutEffect } from 'react'
|
|
5
5
|
|
|
6
|
+
import { useField } from 'formik'
|
|
7
|
+
|
|
6
8
|
import PropTypes from 'prop-types'
|
|
7
9
|
|
|
8
10
|
import styleNames from '@pareto-engineering/bem'
|
|
@@ -20,8 +22,8 @@ const Description = ({
|
|
|
20
22
|
id,
|
|
21
23
|
className:userClassName,
|
|
22
24
|
style,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
description,
|
|
26
|
+
name,
|
|
25
27
|
color,
|
|
26
28
|
// ...otherProps
|
|
27
29
|
}) => {
|
|
@@ -29,25 +31,27 @@ const Description = ({
|
|
|
29
31
|
import('./styles.scss')
|
|
30
32
|
}, [])
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
const [field, meta] = useField(name)
|
|
35
|
+
|
|
36
|
+
if (description || ((meta.touched || field.value) && meta.error)) {
|
|
37
|
+
return (
|
|
38
|
+
<div
|
|
39
|
+
id={id}
|
|
40
|
+
className={[
|
|
41
|
+
baseClassName,
|
|
42
|
+
componentClassName,
|
|
43
|
+
userClassName,
|
|
44
|
+
meta.error ? 'x-error' : `x-${color}`,
|
|
45
|
+
]
|
|
46
|
+
.filter((e) => e)
|
|
47
|
+
.join(' ')}
|
|
48
|
+
style={style}
|
|
49
|
+
>
|
|
50
|
+
{ meta.error || description}
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
return null
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
Description.propTypes = {
|
|
@@ -67,22 +71,23 @@ Description.propTypes = {
|
|
|
67
71
|
style:PropTypes.objectOf(PropTypes.string),
|
|
68
72
|
|
|
69
73
|
/**
|
|
70
|
-
*
|
|
74
|
+
* The base color for the description
|
|
71
75
|
*/
|
|
72
|
-
|
|
76
|
+
color:PropTypes.string,
|
|
77
|
+
|
|
73
78
|
/**
|
|
74
|
-
*
|
|
79
|
+
* Input description - extra description to guide a use in filling the input
|
|
75
80
|
*/
|
|
76
|
-
|
|
81
|
+
description:PropTypes.string,
|
|
82
|
+
|
|
77
83
|
/**
|
|
78
|
-
*
|
|
84
|
+
* The input name (html - and Formik state)
|
|
79
85
|
*/
|
|
80
|
-
|
|
86
|
+
name:PropTypes.string.isRequired,
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
Description.defaultProps = {
|
|
84
|
-
|
|
85
|
-
color :'metadata',
|
|
90
|
+
color:'metadata',
|
|
86
91
|
}
|
|
87
92
|
|
|
88
93
|
export default Description
|
|
@@ -43,7 +43,7 @@ const QueryCombobox = ({
|
|
|
43
43
|
|
|
44
44
|
const { setValue, setError } = helpers
|
|
45
45
|
|
|
46
|
-
const {
|
|
46
|
+
const { value } = meta
|
|
47
47
|
|
|
48
48
|
const environment = useRelayEnvironment()
|
|
49
49
|
|
|
@@ -101,7 +101,6 @@ const QueryCombobox = ({
|
|
|
101
101
|
label,
|
|
102
102
|
description,
|
|
103
103
|
setValue,
|
|
104
|
-
error,
|
|
105
104
|
value,
|
|
106
105
|
color,
|
|
107
106
|
isFetching,
|
|
@@ -33,7 +33,6 @@ const Combobox = ({
|
|
|
33
33
|
options:items,
|
|
34
34
|
getOptions,
|
|
35
35
|
setValue,
|
|
36
|
-
error,
|
|
37
36
|
description,
|
|
38
37
|
value,
|
|
39
38
|
color,
|
|
@@ -121,11 +120,7 @@ const Combobox = ({
|
|
|
121
120
|
/>
|
|
122
121
|
</Popover>
|
|
123
122
|
|
|
124
|
-
{
|
|
125
|
-
<FormDescription isError={!!error}>
|
|
126
|
-
{ error || description }
|
|
127
|
-
</FormDescription>
|
|
128
|
-
)}
|
|
123
|
+
<FormDescription className="v50 mt-v s-1" description={description} name={name} />
|
|
129
124
|
</div>
|
|
130
125
|
)
|
|
131
126
|
}
|
|
@@ -181,11 +176,6 @@ Combobox.propTypes = {
|
|
|
181
176
|
*/
|
|
182
177
|
description:PropTypes.string,
|
|
183
178
|
|
|
184
|
-
/**
|
|
185
|
-
* The error object
|
|
186
|
-
*/
|
|
187
|
-
error:PropTypes.objectOf(PropTypes.string),
|
|
188
|
-
|
|
189
179
|
/**
|
|
190
180
|
* The value of the custom select input
|
|
191
181
|
*/
|
|
@@ -46,7 +46,6 @@ const MultipleCombobox = ({
|
|
|
46
46
|
options:items,
|
|
47
47
|
getOptions,
|
|
48
48
|
setValue,
|
|
49
|
-
error,
|
|
50
49
|
description,
|
|
51
50
|
value,
|
|
52
51
|
color,
|
|
@@ -213,11 +212,7 @@ const MultipleCombobox = ({
|
|
|
213
212
|
/>
|
|
214
213
|
</Popover>
|
|
215
214
|
|
|
216
|
-
{
|
|
217
|
-
<FormDescription isError={!!error}>
|
|
218
|
-
{ error || description }
|
|
219
|
-
</FormDescription>
|
|
220
|
-
)}
|
|
215
|
+
<FormDescription className="v50 mt-v s-1" description={description} name={name} />
|
|
221
216
|
|
|
222
217
|
</div>
|
|
223
218
|
)
|
|
@@ -274,11 +269,6 @@ MultipleCombobox.propTypes = {
|
|
|
274
269
|
*/
|
|
275
270
|
description:PropTypes.string,
|
|
276
271
|
|
|
277
|
-
/**
|
|
278
|
-
* The error object
|
|
279
|
-
*/
|
|
280
|
-
error:PropTypes.objectOf(PropTypes.string),
|
|
281
|
-
|
|
282
272
|
/**
|
|
283
273
|
* The value of the custom select input
|
|
284
274
|
*/
|