@pareto-engineering/design-system 2.0.0-alpha.53 → 2.0.0-alpha.56
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/Alert/Alert.js +141 -0
- package/dist/cjs/a/Alert/index.js +15 -0
- package/dist/cjs/a/Alert/styles.scss +74 -0
- package/dist/cjs/a/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 +9 -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/FormInput/FormInput.js +1 -1
- package/dist/cjs/f/common/Description/Description.js +20 -14
- package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +105 -0
- package/dist/cjs/f/fields/CheckboxInput/index.js +15 -0
- package/dist/cjs/f/fields/CheckboxInput/styles.scss +28 -0
- package/dist/cjs/f/fields/IntlTelInput/IntlTelInput.js +170 -0
- package/dist/cjs/f/fields/IntlTelInput/index.js +15 -0
- package/dist/cjs/f/fields/IntlTelInput/styles.scss +37 -0
- package/dist/cjs/f/fields/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/RadioInput/RadioInput.js +110 -0
- package/dist/cjs/f/fields/RadioInput/index.js +15 -0
- package/dist/cjs/f/fields/RadioInput/styles.scss +26 -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 +131 -0
- package/dist/cjs/f/fields/TaskRecommendationInput/index.js +15 -0
- package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +41 -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/Alert/Alert.js +118 -0
- package/dist/es/a/Alert/index.js +2 -0
- package/dist/es/a/Alert/styles.scss +74 -0
- package/dist/es/a/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 +2 -1
- 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/FormInput/FormInput.js +1 -1
- package/dist/es/f/common/Description/Description.js +19 -14
- package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +85 -0
- package/dist/es/f/fields/CheckboxInput/index.js +2 -0
- package/dist/es/f/fields/CheckboxInput/styles.scss +28 -0
- package/dist/es/f/fields/IntlTelInput/IntlTelInput.js +152 -0
- package/dist/es/f/fields/IntlTelInput/index.js +2 -0
- package/dist/es/f/fields/IntlTelInput/styles.scss +37 -0
- package/dist/es/f/fields/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/RadioInput/RadioInput.js +90 -0
- package/dist/es/f/fields/RadioInput/index.js +2 -0
- package/dist/es/f/fields/RadioInput/styles.scss +26 -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 +111 -0
- package/dist/es/f/fields/TaskRecommendationInput/index.js +2 -0
- package/dist/es/f/fields/TaskRecommendationInput/styles.scss +41 -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 +2 -2
- package/src/__snapshots__/Storyshots.test.js.snap +1864 -1423
- package/src/stories/a/Alert.stories.jsx +75 -0
- package/src/stories/a/DotInfo.stories.jsx +14 -13
- package/src/stories/a/ProgressBar.stories.jsx +16 -7
- package/src/stories/a/Timestamp.stories.jsx +35 -39
- package/src/stories/b/Logo.stories.jsx +13 -12
- package/src/stories/b/QuestionDropdown.stories.jsx +20 -30
- package/src/stories/b/SocialMediaButton.stories.jsx +34 -51
- package/src/stories/b/Title.stories.jsx +13 -15
- package/src/stories/c/ContentSlides.stories.jsx +27 -295
- package/src/stories/c/Shortener.stories.jsx +9 -3
- package/src/stories/c/SocialMediaShareButton.stories.jsx +14 -6
- package/src/stories/f/ChoicesInput.stories.jsx +66 -130
- package/src/stories/f/Description.stories.jsx +22 -4
- package/src/stories/f/QueryCombobox.stories.jsx +2 -1
- package/src/stories/f/QuerySelect.stories.jsx +2 -1
- package/src/stories/f/RatingsInput.stories.jsx +29 -23
- package/src/stories/f/SelectInput.stories.jsx +37 -76
- package/src/stories/f/TextInput.stories.jsx +62 -53
- package/src/stories/f/TextareaInput.stories.jsx +37 -47
- package/src/ui/a/Alert/Alert.jsx +144 -0
- package/src/ui/a/Alert/index.js +2 -0
- package/src/ui/a/Alert/styles.scss +74 -0
- package/src/ui/a/index.js +1 -0
- package/src/ui/f/FormInput/FormInput.jsx +1 -0
- 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
|
@@ -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
|
*/
|
|
@@ -34,13 +34,14 @@ const SelectInput = ({
|
|
|
34
34
|
description,
|
|
35
35
|
disabled,
|
|
36
36
|
isLoading,
|
|
37
|
+
autoComplete,
|
|
37
38
|
// ...otherProps
|
|
38
39
|
}) => {
|
|
39
40
|
useLayoutEffect(() => {
|
|
40
41
|
import('./styles.scss')
|
|
41
42
|
}, [])
|
|
42
43
|
|
|
43
|
-
const [field
|
|
44
|
+
const [field] = useField({ name, validate })
|
|
44
45
|
|
|
45
46
|
return (
|
|
46
47
|
<div
|
|
@@ -60,7 +61,14 @@ const SelectInput = ({
|
|
|
60
61
|
>
|
|
61
62
|
<FormLabel name={name}>{label}</FormLabel>
|
|
62
63
|
<div className="select-wrapper">
|
|
63
|
-
<select
|
|
64
|
+
<select
|
|
65
|
+
className="input"
|
|
66
|
+
{...field}
|
|
67
|
+
value={field.value || ''}
|
|
68
|
+
id={name}
|
|
69
|
+
disabled={disabled}
|
|
70
|
+
autoComplete={autoComplete}
|
|
71
|
+
>
|
|
64
72
|
{
|
|
65
73
|
options.map((option) => {
|
|
66
74
|
// i.e if option is a string like "blah", return { value: "blah", label: "blah" }
|
|
@@ -82,12 +90,7 @@ const SelectInput = ({
|
|
|
82
90
|
<LoadingCircle className="x-main2" />
|
|
83
91
|
)}
|
|
84
92
|
</div>
|
|
85
|
-
{
|
|
86
|
-
&& (
|
|
87
|
-
<FormDescription isError={!!meta.error} className="v50 mt-v s-1">
|
|
88
|
-
{ meta.error || description }
|
|
89
|
-
</FormDescription>
|
|
90
|
-
)}
|
|
93
|
+
<FormDescription className="v50 mt-v s-1" description={description} name={name} />
|
|
91
94
|
</div>
|
|
92
95
|
)
|
|
93
96
|
}
|
|
@@ -154,7 +157,11 @@ SelectInput.propTypes = {
|
|
|
154
157
|
/*
|
|
155
158
|
* Whether the query that is fetching the select options is still in flight
|
|
156
159
|
*/
|
|
157
|
-
isLoading:PropTypes.bool,
|
|
160
|
+
isLoading :PropTypes.bool,
|
|
161
|
+
/**
|
|
162
|
+
* The autoComplete value that the browser should watch for the input
|
|
163
|
+
*/
|
|
164
|
+
autoComplete:PropTypes.string,
|
|
158
165
|
}
|
|
159
166
|
|
|
160
167
|
SelectInput.defaultProps = {
|
|
@@ -35,13 +35,14 @@ const TextInput = ({
|
|
|
35
35
|
disabled,
|
|
36
36
|
placeholder,
|
|
37
37
|
optional,
|
|
38
|
+
autoComplete,
|
|
38
39
|
// ...otherProps
|
|
39
40
|
}) => {
|
|
40
41
|
useLayoutEffect(() => {
|
|
41
42
|
import('./styles.scss')
|
|
42
43
|
}, [])
|
|
43
44
|
|
|
44
|
-
const [field
|
|
45
|
+
const [field] = useField({ name, validate })
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
48
|
<div
|
|
@@ -73,14 +74,12 @@ const TextInput = ({
|
|
|
73
74
|
type={type}
|
|
74
75
|
disabled={disabled}
|
|
75
76
|
placeholder={placeholder}
|
|
77
|
+
autoComplete={autoComplete}
|
|
76
78
|
{...field}
|
|
77
79
|
/>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{ meta.error || description }
|
|
82
|
-
</FormDescription>
|
|
83
|
-
)}
|
|
80
|
+
|
|
81
|
+
<FormDescription className="v50 mt-v s-1" description={description} name={name} />
|
|
82
|
+
|
|
84
83
|
</div>
|
|
85
84
|
)
|
|
86
85
|
}
|
|
@@ -130,6 +129,7 @@ TextInput.propTypes = {
|
|
|
130
129
|
'month',
|
|
131
130
|
'tel',
|
|
132
131
|
'hidden',
|
|
132
|
+
'url',
|
|
133
133
|
]),
|
|
134
134
|
|
|
135
135
|
/**
|
|
@@ -163,6 +163,12 @@ TextInput.propTypes = {
|
|
|
163
163
|
* Whether the input is optional or not
|
|
164
164
|
*/
|
|
165
165
|
optional:PropTypes.bool,
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The autoComplete value that the browser should watch for the input
|
|
169
|
+
* `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
|
|
170
|
+
*/
|
|
171
|
+
autoComplete:PropTypes.string,
|
|
166
172
|
}
|
|
167
173
|
|
|
168
174
|
TextInput.defaultProps = {
|
|
@@ -35,13 +35,14 @@ const TextareaInput = ({
|
|
|
35
35
|
description,
|
|
36
36
|
disabled,
|
|
37
37
|
placeholder,
|
|
38
|
+
autoComplete,
|
|
38
39
|
// ...otherProps
|
|
39
40
|
}) => {
|
|
40
41
|
useLayoutEffect(() => {
|
|
41
42
|
import('./styles.scss')
|
|
42
43
|
}, [])
|
|
43
44
|
|
|
44
|
-
const [field
|
|
45
|
+
const [field] = useField({ name, validate })
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
48
|
<div
|
|
@@ -75,17 +76,12 @@ const TextareaInput = ({
|
|
|
75
76
|
placeholder={placeholder}
|
|
76
77
|
rows={rows}
|
|
77
78
|
disabled={disabled}
|
|
79
|
+
autoComplete={autoComplete}
|
|
78
80
|
>
|
|
79
81
|
{/* It was a dark and stormy night... */}
|
|
80
82
|
</textarea>
|
|
81
83
|
|
|
82
|
-
{
|
|
83
|
-
&& (
|
|
84
|
-
<FormDescription isError={!!meta.error} className="v50 mt-v s-1">
|
|
85
|
-
{ meta.error || description }
|
|
86
|
-
</FormDescription>
|
|
87
|
-
)}
|
|
88
|
-
{' '}
|
|
84
|
+
<FormDescription className="v50 mt-v s-1" description={description} name={name} />
|
|
89
85
|
</div>
|
|
90
86
|
)
|
|
91
87
|
}
|
|
@@ -159,6 +155,11 @@ TextareaInput.propTypes = {
|
|
|
159
155
|
* The textarea placeholder text
|
|
160
156
|
*/
|
|
161
157
|
placeholder:PropTypes.string,
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The autoComplete value that the browser should watch for the input
|
|
161
|
+
*/
|
|
162
|
+
autoComplete:PropTypes.string,
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
TextareaInput.defaultProps = {
|