@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
|
@@ -23,35 +23,41 @@ export default {
|
|
|
23
23
|
),
|
|
24
24
|
],
|
|
25
25
|
argTypes:{
|
|
26
|
-
backgroundColor:{ control: 'color' },
|
|
26
|
+
// backgroundColor:{ control: 'color' },
|
|
27
|
+
ratingCount :{ control: 'number' },
|
|
28
|
+
name :{ control: 'text' },
|
|
29
|
+
label :{ control: 'text' },
|
|
30
|
+
showRatingValue :{ control: 'boolean' },
|
|
31
|
+
displayRatingsLabel:{ control: 'boolean' },
|
|
32
|
+
labelMax :{ control: 'text' },
|
|
33
|
+
labelMin :{ control: 'text' },
|
|
27
34
|
},
|
|
28
35
|
}
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
const Template = (args) => (
|
|
31
38
|
<>
|
|
32
|
-
<RatingsInput
|
|
39
|
+
<RatingsInput {...args} />
|
|
33
40
|
<FormDebugger />
|
|
34
41
|
</>
|
|
35
42
|
)
|
|
36
43
|
|
|
37
|
-
export const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
export const Base = Template.bind({})
|
|
45
|
+
Base.args = {
|
|
46
|
+
ratingCount:5,
|
|
47
|
+
name :'ratings',
|
|
48
|
+
label :'Your Rating',
|
|
49
|
+
}
|
|
43
50
|
|
|
44
|
-
export const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
)
|
|
51
|
+
export const Numbers = Template.bind({})
|
|
52
|
+
Numbers.args = {
|
|
53
|
+
...Base.args,
|
|
54
|
+
showRatingValue:true,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Labels = Template.bind({})
|
|
58
|
+
Labels.args = {
|
|
59
|
+
...Numbers.args,
|
|
60
|
+
labelMax :'very satisfied.',
|
|
61
|
+
labelMin :'not satisfied.',
|
|
62
|
+
displayRatingsLabel:true,
|
|
63
|
+
}
|
|
@@ -22,91 +22,52 @@ export default {
|
|
|
22
22
|
),
|
|
23
23
|
],
|
|
24
24
|
argTypes:{
|
|
25
|
-
backgroundColor:{ control: 'color' },
|
|
25
|
+
// backgroundColor:{ control: 'color' },
|
|
26
|
+
disabled:{ control: 'boolean' },
|
|
26
27
|
},
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
const Template = (args) => (
|
|
30
31
|
<>
|
|
31
|
-
<SelectInput
|
|
32
|
-
name="workType"
|
|
33
|
-
label="Work Type"
|
|
34
|
-
options={[{ value: '', label: 'Select an option', disabled: true }, 'Work', 'Managing', 'Training']}
|
|
35
|
-
/>
|
|
32
|
+
<SelectInput {...args} />
|
|
36
33
|
<FormDebugger />
|
|
37
34
|
</>
|
|
38
35
|
)
|
|
39
36
|
|
|
40
|
-
export const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
export const Base = Template.bind({})
|
|
38
|
+
Base.args = {
|
|
39
|
+
name :'workType',
|
|
40
|
+
label :'Work Type',
|
|
41
|
+
options:[
|
|
42
|
+
{ value: '', label: 'Select an option', disabled: true },
|
|
43
|
+
{ value: 'Work', label: 'Work' },
|
|
44
|
+
{ value: 'Managing', label: 'Managing' },
|
|
45
|
+
{ value: 'Training', label: 'Training' },
|
|
46
|
+
],
|
|
47
|
+
}
|
|
49
48
|
|
|
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
|
-
)
|
|
49
|
+
export const StringAndObjects = Template.bind({})
|
|
50
|
+
StringAndObjects.args = {
|
|
51
|
+
...Base.args,
|
|
52
|
+
options:[...Base.args.options, 'Option1', 'Option2', 'Option3'],
|
|
65
53
|
}
|
|
66
54
|
|
|
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
|
-
)
|
|
55
|
+
const requiredInput = (inputValue) => {
|
|
56
|
+
let error = ''
|
|
81
57
|
|
|
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
|
-
)
|
|
58
|
+
if (!inputValue || !inputValue?.length === 0) {
|
|
59
|
+
error = 'This information is required'
|
|
60
|
+
}
|
|
61
|
+
return error
|
|
62
|
+
}
|
|
63
|
+
export const Required = Template.bind({})
|
|
64
|
+
Required.args = {
|
|
65
|
+
...Base.args,
|
|
66
|
+
validate:requiredInput,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const DisabledSelectInput = Template.bind({})
|
|
70
|
+
DisabledSelectInput.args = {
|
|
71
|
+
...Base.args,
|
|
72
|
+
disabled:true,
|
|
73
|
+
}
|
|
@@ -26,65 +26,74 @@ export default {
|
|
|
26
26
|
),
|
|
27
27
|
],
|
|
28
28
|
argTypes:{
|
|
29
|
-
backgroundColor:{ control: 'color' },
|
|
29
|
+
// backgroundColor:{ control: 'color' },
|
|
30
|
+
placeholder :{ control: 'text' },
|
|
31
|
+
autoComplete:{ control: 'select', options: ['off', 'on'] },
|
|
32
|
+
disabled :{ control: 'boolean' },
|
|
33
|
+
type :{ control: 'text' },
|
|
34
|
+
name :{ control: 'text' },
|
|
35
|
+
label :{ control: 'text' },
|
|
30
36
|
},
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
// eslint-disable-next-line react/prop-types
|
|
40
|
+
const Template = (args) => (
|
|
41
|
+
<div className=" u2 pb-u">
|
|
42
|
+
<TextInput {...args} />
|
|
43
|
+
<FormDebugger />
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
export const Base = Template.bind({})
|
|
48
|
+
Base.args = {
|
|
49
|
+
name :'firstName',
|
|
50
|
+
label:"What's your first name ?",
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const validate = (value) => {
|
|
54
|
+
let errorMessage = ''
|
|
55
|
+
const isValid = value.length > 3
|
|
37
56
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
return errorMessage
|
|
57
|
+
if (!isValid) {
|
|
58
|
+
errorMessage = 'Value should be greater than 3 characters'
|
|
42
59
|
}
|
|
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
|
-
)
|
|
60
|
+
return errorMessage
|
|
53
61
|
}
|
|
54
62
|
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
placeholder="First Name"
|
|
61
|
-
/>
|
|
62
|
-
<FormDebugger />
|
|
63
|
-
</div>
|
|
64
|
-
)
|
|
63
|
+
export const WithValidation = Template.bind({})
|
|
64
|
+
WithValidation.args = {
|
|
65
|
+
...Base.args,
|
|
66
|
+
validate,
|
|
67
|
+
}
|
|
65
68
|
|
|
66
|
-
export const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
disabled
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
)
|
|
69
|
+
export const WithPlaceholder = Template.bind({})
|
|
70
|
+
WithPlaceholder.args = {
|
|
71
|
+
...Base.args,
|
|
72
|
+
placeholder:'First Name',
|
|
73
|
+
}
|
|
75
74
|
|
|
76
|
-
export const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
export const WithAutoCompleteOff = Template.bind({})
|
|
76
|
+
WithAutoCompleteOff.args = {
|
|
77
|
+
...Base.args,
|
|
78
|
+
autoComplete:'off',
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const WithDisabled = Template.bind({})
|
|
82
|
+
WithDisabled.args = {
|
|
83
|
+
...Base.args,
|
|
84
|
+
disabled:true,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const Date = Template.bind({})
|
|
88
|
+
Date.args = {
|
|
89
|
+
type :'date',
|
|
90
|
+
name :'date',
|
|
91
|
+
label:'Select date',
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const Time = Template.bind({})
|
|
95
|
+
Time.args = {
|
|
96
|
+
type :'time',
|
|
97
|
+
name :'time',
|
|
98
|
+
label:'Select time',
|
|
99
|
+
}
|
|
@@ -24,62 +24,52 @@ export default {
|
|
|
24
24
|
),
|
|
25
25
|
],
|
|
26
26
|
argTypes:{
|
|
27
|
-
backgroundColor:{ control: 'color' },
|
|
27
|
+
// backgroundColor:{ control: 'color' },
|
|
28
|
+
name :{ control: 'text' },
|
|
29
|
+
label :{ control: 'text' },
|
|
30
|
+
placeholder :{ control: 'text' },
|
|
31
|
+
disabled :{ control: 'boolean' },
|
|
32
|
+
labelAsDescription:{ control: 'boolean' },
|
|
28
33
|
},
|
|
29
34
|
}
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<TextareaInput
|
|
34
|
-
name="feedback"
|
|
35
|
-
label="What can we improve on?"
|
|
36
|
-
/>
|
|
36
|
+
const Template = (args) => (
|
|
37
|
+
<>
|
|
38
|
+
<TextareaInput {...args} />
|
|
37
39
|
<FormDebugger />
|
|
38
|
-
|
|
40
|
+
</>
|
|
39
41
|
)
|
|
40
42
|
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
export const Base = Template.bind({})
|
|
44
|
+
Base.args = {
|
|
45
|
+
name :'feedback',
|
|
46
|
+
label:'What can we improve on?',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Placeholder = Template.bind({})
|
|
50
|
+
Placeholder.args = {
|
|
51
|
+
...Base.args,
|
|
52
|
+
placeholder:'Type your feedback here...',
|
|
53
|
+
}
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const isValid = value.length > 3
|
|
55
|
+
const validate = (value) => {
|
|
56
|
+
let errorMessage = ''
|
|
57
|
+
const isValid = value.length > 3
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return errorMessage
|
|
59
|
+
if (!isValid) {
|
|
60
|
+
errorMessage = 'Value should be greater than 3 characters'
|
|
61
61
|
}
|
|
62
|
+
return errorMessage
|
|
63
|
+
}
|
|
62
64
|
|
|
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
|
-
)
|
|
65
|
+
export const Validation = Template.bind({})
|
|
66
|
+
Validation.args = {
|
|
67
|
+
...Base.args,
|
|
68
|
+
validate,
|
|
74
69
|
}
|
|
75
70
|
|
|
76
|
-
export const Disabled = ()
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
disabled
|
|
82
|
-
/>
|
|
83
|
-
<FormDebugger />
|
|
84
|
-
</div>
|
|
85
|
-
)
|
|
71
|
+
export const Disabled = Template.bind({})
|
|
72
|
+
Disabled.args = {
|
|
73
|
+
...Base.args,
|
|
74
|
+
disabled:true,
|
|
75
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useState, useEffect, useLayoutEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import { Button } from 'ui/b'
|
|
9
|
+
|
|
10
|
+
import styleNames from '@pareto-engineering/bem'
|
|
11
|
+
|
|
12
|
+
// Local Definitions
|
|
13
|
+
|
|
14
|
+
const baseClassName = styleNames.base
|
|
15
|
+
|
|
16
|
+
const componentClassName = 'alert'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This is the component description.
|
|
20
|
+
*/
|
|
21
|
+
const Alert = ({
|
|
22
|
+
id,
|
|
23
|
+
className:userClassName,
|
|
24
|
+
style,
|
|
25
|
+
children,
|
|
26
|
+
type,
|
|
27
|
+
withCloseIcon,
|
|
28
|
+
primaryPosition,
|
|
29
|
+
secondaryPosition,
|
|
30
|
+
autoCloseMs,
|
|
31
|
+
width,
|
|
32
|
+
// ...otherProps
|
|
33
|
+
}) => {
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
import('./styles.scss')
|
|
36
|
+
}, [])
|
|
37
|
+
|
|
38
|
+
const [hideAlert, setHideAlert] = useState(false)
|
|
39
|
+
|
|
40
|
+
const handleCloseAlert = () => setHideAlert(true)
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (autoCloseMs) {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
setHideAlert(true)
|
|
46
|
+
}, autoCloseMs)
|
|
47
|
+
}
|
|
48
|
+
}, [autoCloseMs])
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
id={id}
|
|
53
|
+
className={[
|
|
54
|
+
|
|
55
|
+
baseClassName,
|
|
56
|
+
|
|
57
|
+
componentClassName,
|
|
58
|
+
userClassName,
|
|
59
|
+
`x-${type}`,
|
|
60
|
+
hideAlert && 'hide',
|
|
61
|
+
primaryPosition,
|
|
62
|
+
secondaryPosition,
|
|
63
|
+
]
|
|
64
|
+
.filter((e) => e)
|
|
65
|
+
.join(' ')}
|
|
66
|
+
style={{
|
|
67
|
+
...style,
|
|
68
|
+
'--width':width,
|
|
69
|
+
}}
|
|
70
|
+
// {...otherProps}
|
|
71
|
+
>
|
|
72
|
+
<div className="bar" />
|
|
73
|
+
{withCloseIcon && (
|
|
74
|
+
<div className="close">
|
|
75
|
+
<Button isSimple color="heading" onClick={handleCloseAlert}>
|
|
76
|
+
<span className="f-icons">Y</span>
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
)}
|
|
80
|
+
<div className="content">
|
|
81
|
+
{children}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Alert.propTypes = {
|
|
88
|
+
/**
|
|
89
|
+
* The HTML id for this element
|
|
90
|
+
*/
|
|
91
|
+
id:PropTypes.string,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The HTML class names for this element
|
|
95
|
+
*/
|
|
96
|
+
className:PropTypes.string,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The React-written, css properties for this element.
|
|
100
|
+
*/
|
|
101
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The children JSX
|
|
105
|
+
*/
|
|
106
|
+
children:PropTypes.node,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Whether the alert should have a close Icon
|
|
110
|
+
*/
|
|
111
|
+
withCloseIcon:PropTypes.bool,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The primary position of the alert
|
|
115
|
+
*/
|
|
116
|
+
primaryPosition:PropTypes.oneOf(['top', 'bottom', 'center']),
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The secondary position of the alert
|
|
120
|
+
*/
|
|
121
|
+
secondaryPosition:PropTypes.oneOf(['left', 'right']),
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The number milisseconds to wait for before closing the alert
|
|
125
|
+
*/
|
|
126
|
+
autoCloseMs:PropTypes.number,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The type of the alert
|
|
130
|
+
*/
|
|
131
|
+
type:PropTypes.oneOf(['success', 'warning', 'error']),
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The width of the alert
|
|
135
|
+
*/
|
|
136
|
+
width:PropTypes.number,
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
Alert.defaultProps = {
|
|
140
|
+
withCloseIcon :true,
|
|
141
|
+
primaryPosition:'top',
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default Alert
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
@use "@aztlan/stylebook/src/mixins";
|
|
4
|
+
@use "@aztlan/stylebook/src/globals" as *;
|
|
5
|
+
|
|
6
|
+
$default-padding: 1em;
|
|
7
|
+
$default-bar-height: .3em;
|
|
8
|
+
$default-alert-desktop-width: var(--width, 30em);
|
|
9
|
+
|
|
10
|
+
.#{bem.$base}.alert {
|
|
11
|
+
border: var(--theme-border);
|
|
12
|
+
padding-bottom: $default-padding * 1.5;
|
|
13
|
+
width: 100%;
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 1;
|
|
16
|
+
|
|
17
|
+
&.center {
|
|
18
|
+
top: 50%;
|
|
19
|
+
left: 50%;
|
|
20
|
+
transform: translate(-50%, -50%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.top {
|
|
24
|
+
top: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.bottom {
|
|
28
|
+
bottom: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.right {
|
|
32
|
+
right: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.left {
|
|
36
|
+
left: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.hide {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
>.bar {
|
|
44
|
+
background-color: var(--x);
|
|
45
|
+
height: $default-bar-height;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
>.close {
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
|
|
52
|
+
span {
|
|
53
|
+
padding: $default-padding / 2;
|
|
54
|
+
font-size: calc(var(--s-2) * 1em);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bar+.content {
|
|
59
|
+
padding-top: $default-padding * 1.5;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
>.content {
|
|
63
|
+
padding-inline: $default-padding;
|
|
64
|
+
|
|
65
|
+
.icon {
|
|
66
|
+
color: var(--x)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Desktop styles
|
|
71
|
+
@include mixins.media($from: $sm-md) {
|
|
72
|
+
width: $default-alert-desktop-width;
|
|
73
|
+
}
|
|
74
|
+
}
|
package/src/ui/a/index.js
CHANGED