@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.
Files changed (225) hide show
  1. package/dist/cjs/a/Alert/Alert.js +141 -0
  2. package/dist/cjs/a/Alert/index.js +15 -0
  3. package/dist/cjs/a/Alert/styles.scss +74 -0
  4. package/dist/cjs/a/GradientBackground/GradientBackground.js +140 -0
  5. package/dist/cjs/a/GradientBackground/index.js +15 -0
  6. package/dist/cjs/a/GradientBackground/styles.scss +191 -0
  7. package/dist/cjs/a/Popover/common/Divider/Divider.js +67 -0
  8. package/dist/cjs/a/Popover/common/Divider/index.js +15 -0
  9. package/dist/cjs/a/Popover/common/Item/Item.js +67 -0
  10. package/dist/cjs/a/Popover/common/Item/index.js +15 -0
  11. package/dist/cjs/a/Popover/common/index.js +21 -0
  12. package/dist/cjs/a/index.js +9 -1
  13. package/dist/cjs/c/AcceptCookies/AcceptCookies.js +134 -0
  14. package/dist/cjs/c/AcceptCookies/index.js +15 -0
  15. package/dist/cjs/c/AcceptCookies/styles.scss +49 -0
  16. package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +95 -0
  17. package/dist/cjs/c/BlogCategoryButton/index.js +15 -0
  18. package/dist/cjs/c/BlogContext/BlogContextProvider.js +63 -0
  19. package/dist/cjs/c/BlogContext/Context.js +16 -0
  20. package/dist/cjs/c/BlogContext/ContextProvider.js +63 -0
  21. package/dist/cjs/c/BlogContext/index.js +31 -0
  22. package/dist/cjs/c/BlogContext/useBlog.js +16 -0
  23. package/dist/cjs/c/BlogPost/BlogPost.js +147 -0
  24. package/dist/cjs/c/BlogPost/index.js +15 -0
  25. package/dist/cjs/c/BlogPost/styles.scss +33 -0
  26. package/dist/cjs/c/BlogPostsList/BlogPostsList.js +73 -0
  27. package/dist/cjs/c/BlogPostsList/common/Card/Card.js +170 -0
  28. package/dist/cjs/c/BlogPostsList/common/Card/index.js +15 -0
  29. package/dist/cjs/c/BlogPostsList/common/index.js +13 -0
  30. package/dist/cjs/c/BlogPostsList/index.js +15 -0
  31. package/dist/cjs/c/BlogPostsList/styles.scss +72 -0
  32. package/dist/cjs/c/SiteFooter/SiteFooter.js +73 -0
  33. package/dist/cjs/c/SiteFooter/common/Section/Section.js +95 -0
  34. package/dist/cjs/c/SiteFooter/common/Section/index.js +15 -0
  35. package/dist/cjs/c/SiteFooter/common/index.js +13 -0
  36. package/dist/cjs/c/SiteFooter/index.js +15 -0
  37. package/dist/cjs/c/SiteFooter/styles.scss +34 -0
  38. package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +108 -0
  39. package/dist/cjs/c/SiteHeaderCTA/index.js +15 -0
  40. package/dist/cjs/c/SiteHeaderCTA/styles.scss +44 -0
  41. package/dist/cjs/c/SiteMission/SiteMission.js +113 -0
  42. package/dist/cjs/c/SiteMission/index.js +15 -0
  43. package/dist/cjs/c/SiteMission/styles.scss +30 -0
  44. package/dist/cjs/c/SiteNavigation/SiteNavigation.js +130 -0
  45. package/dist/cjs/c/SiteNavigation/index.js +15 -0
  46. package/dist/cjs/c/SiteNavigation/styles.scss +118 -0
  47. package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +98 -0
  48. package/dist/cjs/c/SiteOnboardingStep/index.js +15 -0
  49. package/dist/cjs/c/SiteOnboardingStep/styles.scss +51 -0
  50. package/dist/cjs/c/SitePricing/SitePricing.js +108 -0
  51. package/dist/cjs/c/SitePricing/index.js +15 -0
  52. package/dist/cjs/c/SitePricing/styles.scss +73 -0
  53. package/dist/cjs/c/SiteServices/SiteServices.js +211 -0
  54. package/dist/cjs/c/SiteServices/index.js +15 -0
  55. package/dist/cjs/c/SiteServices/styles.scss +138 -0
  56. package/dist/cjs/c/TeamGallery/TeamGallery.js +80 -0
  57. package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +84 -0
  58. package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +15 -0
  59. package/dist/cjs/c/TeamGallery/common/index.js +13 -0
  60. package/dist/cjs/c/TeamGallery/index.js +15 -0
  61. package/dist/cjs/c/TeamGallery/styles.scss +100 -0
  62. package/dist/cjs/c/Testimonials/Testimonials.js +119 -0
  63. package/dist/cjs/c/Testimonials/index.js +15 -0
  64. package/dist/cjs/c/Testimonials/styles.scss +112 -0
  65. package/dist/cjs/experimental/GradientBackground/GradientBackground.js +98 -0
  66. package/dist/cjs/experimental/GradientBackground/index.js +15 -0
  67. package/dist/cjs/experimental/GradientBackground/styles.scss +64 -0
  68. package/dist/cjs/experimental/index.js +13 -0
  69. package/dist/cjs/f/FormInput/FormInput.js +1 -1
  70. package/dist/cjs/f/common/Description/Description.js +20 -14
  71. package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +105 -0
  72. package/dist/cjs/f/fields/CheckboxInput/index.js +15 -0
  73. package/dist/cjs/f/fields/CheckboxInput/styles.scss +28 -0
  74. package/dist/cjs/f/fields/IntlTelInput/IntlTelInput.js +170 -0
  75. package/dist/cjs/f/fields/IntlTelInput/index.js +15 -0
  76. package/dist/cjs/f/fields/IntlTelInput/styles.scss +37 -0
  77. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +0 -2
  78. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
  79. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
  80. package/dist/cjs/f/fields/QuerySelect/styles.scss +21 -0
  81. package/dist/cjs/f/fields/RadioInput/RadioInput.js +110 -0
  82. package/dist/cjs/f/fields/RadioInput/index.js +15 -0
  83. package/dist/cjs/f/fields/RadioInput/styles.scss +26 -0
  84. package/dist/cjs/f/fields/SelectInput/SelectInput.js +16 -8
  85. package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +129 -0
  86. package/dist/cjs/f/fields/TaskRecommendation/index.js +15 -0
  87. package/dist/cjs/f/fields/TaskRecommendation/styles.scss +37 -0
  88. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +131 -0
  89. package/dist/cjs/f/fields/TaskRecommendationInput/index.js +15 -0
  90. package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +41 -0
  91. package/dist/cjs/f/fields/TextArea/TextArea.js +141 -0
  92. package/dist/cjs/f/fields/TextArea/index.js +15 -0
  93. package/dist/cjs/f/fields/TextArea/styles.scss +19 -0
  94. package/dist/cjs/f/fields/TextInput/TextInput.js +18 -9
  95. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +16 -8
  96. package/dist/cjs/test/QueryLoader/styles.scss +9 -0
  97. package/dist/es/a/Alert/Alert.js +118 -0
  98. package/dist/es/a/Alert/index.js +2 -0
  99. package/dist/es/a/Alert/styles.scss +74 -0
  100. package/dist/es/a/GradientBackground/GradientBackground.js +118 -0
  101. package/dist/es/a/GradientBackground/index.js +2 -0
  102. package/dist/es/a/GradientBackground/styles.scss +191 -0
  103. package/dist/es/a/Popover/common/Divider/Divider.js +47 -0
  104. package/dist/es/a/Popover/common/Divider/index.js +2 -0
  105. package/dist/es/a/Popover/common/Item/Item.js +47 -0
  106. package/dist/es/a/Popover/common/Item/index.js +2 -0
  107. package/dist/es/a/Popover/common/index.js +2 -0
  108. package/dist/es/a/index.js +2 -1
  109. package/dist/es/c/AcceptCookies/AcceptCookies.js +117 -0
  110. package/dist/es/c/AcceptCookies/index.js +2 -0
  111. package/dist/es/c/AcceptCookies/styles.scss +49 -0
  112. package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +68 -0
  113. package/dist/es/c/BlogCategoryButton/index.js +2 -0
  114. package/dist/es/c/BlogContext/BlogContextProvider.js +45 -0
  115. package/dist/es/c/BlogContext/Context.js +2 -0
  116. package/dist/es/c/BlogContext/ContextProvider.js +45 -0
  117. package/dist/es/c/BlogContext/index.js +4 -0
  118. package/dist/es/c/BlogContext/useBlog.js +3 -0
  119. package/dist/es/c/BlogPost/BlogPost.js +128 -0
  120. package/dist/es/c/BlogPost/index.js +2 -0
  121. package/dist/es/c/BlogPost/styles.scss +33 -0
  122. package/dist/es/c/BlogPostsList/BlogPostsList.js +56 -0
  123. package/dist/es/c/BlogPostsList/common/Card/Card.js +143 -0
  124. package/dist/es/c/BlogPostsList/common/Card/index.js +2 -0
  125. package/dist/es/c/BlogPostsList/common/index.js +1 -0
  126. package/dist/es/c/BlogPostsList/index.js +2 -0
  127. package/dist/es/c/BlogPostsList/styles.scss +72 -0
  128. package/dist/es/c/SiteFooter/SiteFooter.js +56 -0
  129. package/dist/es/c/SiteFooter/common/Section/Section.js +73 -0
  130. package/dist/es/c/SiteFooter/common/Section/index.js +2 -0
  131. package/dist/es/c/SiteFooter/common/index.js +1 -0
  132. package/dist/es/c/SiteFooter/index.js +2 -0
  133. package/dist/es/c/SiteFooter/styles.scss +34 -0
  134. package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +92 -0
  135. package/dist/es/c/SiteHeaderCTA/index.js +2 -0
  136. package/dist/es/c/SiteHeaderCTA/styles.scss +44 -0
  137. package/dist/es/c/SiteMission/SiteMission.js +96 -0
  138. package/dist/es/c/SiteMission/index.js +2 -0
  139. package/dist/es/c/SiteMission/styles.scss +30 -0
  140. package/dist/es/c/SiteNavigation/SiteNavigation.js +111 -0
  141. package/dist/es/c/SiteNavigation/index.js +2 -0
  142. package/dist/es/c/SiteNavigation/styles.scss +118 -0
  143. package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +81 -0
  144. package/dist/es/c/SiteOnboardingStep/index.js +2 -0
  145. package/dist/es/c/SiteOnboardingStep/styles.scss +51 -0
  146. package/dist/es/c/SitePricing/SitePricing.js +91 -0
  147. package/dist/es/c/SitePricing/index.js +2 -0
  148. package/dist/es/c/SitePricing/styles.scss +73 -0
  149. package/dist/es/c/SiteServices/SiteServices.js +195 -0
  150. package/dist/es/c/SiteServices/index.js +2 -0
  151. package/dist/es/c/SiteServices/styles.scss +138 -0
  152. package/dist/es/c/TeamGallery/TeamGallery.js +64 -0
  153. package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +64 -0
  154. package/dist/es/c/TeamGallery/common/PersonCard/index.js +2 -0
  155. package/dist/es/c/TeamGallery/common/index.js +1 -0
  156. package/dist/es/c/TeamGallery/index.js +2 -0
  157. package/dist/es/c/TeamGallery/styles.scss +100 -0
  158. package/dist/es/c/Testimonials/Testimonials.js +99 -0
  159. package/dist/es/c/Testimonials/index.js +2 -0
  160. package/dist/es/c/Testimonials/styles.scss +112 -0
  161. package/dist/es/experimental/GradientBackground/GradientBackground.js +76 -0
  162. package/dist/es/experimental/GradientBackground/index.js +2 -0
  163. package/dist/es/experimental/GradientBackground/styles.scss +64 -0
  164. package/dist/es/experimental/index.js +1 -0
  165. package/dist/es/f/FormInput/FormInput.js +1 -1
  166. package/dist/es/f/common/Description/Description.js +19 -14
  167. package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +85 -0
  168. package/dist/es/f/fields/CheckboxInput/index.js +2 -0
  169. package/dist/es/f/fields/CheckboxInput/styles.scss +28 -0
  170. package/dist/es/f/fields/IntlTelInput/IntlTelInput.js +152 -0
  171. package/dist/es/f/fields/IntlTelInput/index.js +2 -0
  172. package/dist/es/f/fields/IntlTelInput/styles.scss +37 -0
  173. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +0 -2
  174. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
  175. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
  176. package/dist/es/f/fields/QuerySelect/styles.scss +21 -0
  177. package/dist/es/f/fields/RadioInput/RadioInput.js +90 -0
  178. package/dist/es/f/fields/RadioInput/index.js +2 -0
  179. package/dist/es/f/fields/RadioInput/styles.scss +26 -0
  180. package/dist/es/f/fields/SelectInput/SelectInput.js +16 -8
  181. package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +111 -0
  182. package/dist/es/f/fields/TaskRecommendation/index.js +2 -0
  183. package/dist/es/f/fields/TaskRecommendation/styles.scss +37 -0
  184. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +111 -0
  185. package/dist/es/f/fields/TaskRecommendationInput/index.js +2 -0
  186. package/dist/es/f/fields/TaskRecommendationInput/styles.scss +41 -0
  187. package/dist/es/f/fields/TextArea/TextArea.js +124 -0
  188. package/dist/es/f/fields/TextArea/index.js +2 -0
  189. package/dist/es/f/fields/TextArea/styles.scss +19 -0
  190. package/dist/es/f/fields/TextInput/TextInput.js +18 -9
  191. package/dist/es/f/fields/TextareaInput/TextareaInput.js +16 -8
  192. package/dist/es/test/QueryLoader/styles.scss +9 -0
  193. package/package.json +2 -2
  194. package/src/__snapshots__/Storyshots.test.js.snap +1864 -1423
  195. package/src/stories/a/Alert.stories.jsx +75 -0
  196. package/src/stories/a/DotInfo.stories.jsx +14 -13
  197. package/src/stories/a/ProgressBar.stories.jsx +16 -7
  198. package/src/stories/a/Timestamp.stories.jsx +35 -39
  199. package/src/stories/b/Logo.stories.jsx +13 -12
  200. package/src/stories/b/QuestionDropdown.stories.jsx +20 -30
  201. package/src/stories/b/SocialMediaButton.stories.jsx +34 -51
  202. package/src/stories/b/Title.stories.jsx +13 -15
  203. package/src/stories/c/ContentSlides.stories.jsx +27 -295
  204. package/src/stories/c/Shortener.stories.jsx +9 -3
  205. package/src/stories/c/SocialMediaShareButton.stories.jsx +14 -6
  206. package/src/stories/f/ChoicesInput.stories.jsx +66 -130
  207. package/src/stories/f/Description.stories.jsx +22 -4
  208. package/src/stories/f/QueryCombobox.stories.jsx +2 -1
  209. package/src/stories/f/QuerySelect.stories.jsx +2 -1
  210. package/src/stories/f/RatingsInput.stories.jsx +29 -23
  211. package/src/stories/f/SelectInput.stories.jsx +37 -76
  212. package/src/stories/f/TextInput.stories.jsx +62 -53
  213. package/src/stories/f/TextareaInput.stories.jsx +37 -47
  214. package/src/ui/a/Alert/Alert.jsx +144 -0
  215. package/src/ui/a/Alert/index.js +2 -0
  216. package/src/ui/a/Alert/styles.scss +74 -0
  217. package/src/ui/a/index.js +1 -0
  218. package/src/ui/f/FormInput/FormInput.jsx +1 -0
  219. package/src/ui/f/common/Description/Description.jsx +34 -29
  220. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +1 -2
  221. package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +1 -11
  222. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +1 -11
  223. package/src/ui/f/fields/SelectInput/SelectInput.jsx +16 -9
  224. package/src/ui/f/fields/TextInput/TextInput.jsx +13 -7
  225. 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
- export const Base = () => (
37
+ const Template = (args) => (
31
38
  <>
32
- <RatingsInput ratingCount={5} name="ratings" label="Your Rating" />
39
+ <RatingsInput {...args} />
33
40
  <FormDebugger />
34
41
  </>
35
42
  )
36
43
 
37
- export const Numbers = () => (
38
- <>
39
- <RatingsInput ratingCount={10} name="ratings" showRatingValue label="Your Rating" />
40
- <FormDebugger />
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 Labels = () => (
45
- <>
46
- <RatingsInput
47
- label="Your Rating"
48
- labelMax="very satisfied."
49
- labelMin="not satisfied."
50
- ratingCount={10}
51
- name="ratings"
52
- showRatingValue
53
- displayRatingsLabel
54
- />
55
- <FormDebugger />
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
- export const Base = () => (
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 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
- }
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
- 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
- )
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
- export const Objects = () => (
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
- export const StringAndObjects = () => (
83
- <>
84
- <SelectInput
85
- name="workType"
86
- label="Work Type"
87
- options={[
88
- { value: '', label: 'Select an option', disabled: true },
89
- 'Work', 'Managing', 'Training',
90
- { value: '20th Aug 2020 to 19th Sept, 2020', label: '20th Aug 2020 to 19th Sept, 2020' },
91
- { value: '20th Sept 2020 to 19th Oct, 2020', label: '20th Sept 2020 to 19th Oct, 2020' },
92
- ]}
93
- />
94
- <FormDebugger />
95
- </>
96
- )
97
- export const DisabledSelectInput = () => (
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
- export const Base = () => {
34
- const validate = (value) => {
35
- let errorMessage = ''
36
- const isValid = value.length > 3
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
- if (!isValid) {
39
- errorMessage = 'Value should be greater than 3 characters'
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 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
- )
63
+ export const WithValidation = Template.bind({})
64
+ WithValidation.args = {
65
+ ...Base.args,
66
+ validate,
67
+ }
65
68
 
66
- export const Disabled = () => (
67
- <div className="u2 pb-u">
68
- <TextInput
69
- name="firstName"
70
- label="What's your first name ?"
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 DateTime = () => (
77
- <div>
78
- <TextInput
79
- name="date"
80
- label="Select date"
81
- type="date"
82
- />
83
- <TextInput
84
- name="time"
85
- label="Select time"
86
- type="time"
87
- />
88
- <FormDebugger />
89
- </div>
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
- export const Base = () => (
32
- <div>
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
- </div>
40
+ </>
39
41
  )
40
42
 
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
- )
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
- export const Validation = () => {
53
- const validate = (value) => {
54
- let errorMessage = ''
55
- const isValid = value.length > 3
55
+ const validate = (value) => {
56
+ let errorMessage = ''
57
+ const isValid = value.length > 3
56
58
 
57
- if (!isValid) {
58
- errorMessage = 'Value should be greater than 3 characters'
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
- 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
- )
65
+ export const Validation = Template.bind({})
66
+ Validation.args = {
67
+ ...Base.args,
68
+ validate,
74
69
  }
75
70
 
76
- export const Disabled = () => (
77
- <div>
78
- <TextareaInput
79
- name="feedback"
80
- label="What can we improve on?"
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,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Alert } from './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
@@ -29,3 +29,4 @@ export { SnapScroller } from './SnapScroller'
29
29
  export { BackgroundGradient } from './BackgroundGradient'
30
30
  export { ContentTree } from './ContentTree'
31
31
  export { Popover } from './Popover'
32
+ export { Alert } from './Alert'
@@ -127,6 +127,7 @@ FormInput.propTypes = {
127
127
  'choices',
128
128
  'textarea',
129
129
  'query-combobox',
130
+ 'url',
130
131
  // to be removed
131
132
  'extendedTypeInput',
132
133
  ]),