@pareto-engineering/design-system 2.0.0-alpha.52 → 2.0.0-alpha.55

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 (70) hide show
  1. package/dist/cjs/a/AppContext/Context.js +16 -0
  2. package/dist/cjs/a/AppContext/ContextProvider.js +96 -0
  3. package/dist/cjs/a/AppContext/index.js +39 -0
  4. package/dist/cjs/a/AppContext/useApp.js +16 -0
  5. package/dist/cjs/a/AppContext/useTheme.js +45 -0
  6. package/dist/cjs/a/index.js +8 -8
  7. package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +1 -1
  8. package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +4 -4
  9. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +1 -1
  10. package/dist/cjs/f/FormInput/FormInput.js +1 -1
  11. package/dist/cjs/f/common/Description/Description.js +20 -14
  12. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +0 -2
  13. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
  14. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
  15. package/dist/cjs/f/fields/SelectInput/SelectInput.js +16 -8
  16. package/dist/cjs/f/fields/TextInput/TextInput.js +18 -9
  17. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +16 -8
  18. package/dist/es/a/AppContext/Context.js +2 -0
  19. package/dist/es/a/AppContext/ContextProvider.js +78 -0
  20. package/dist/es/a/AppContext/index.js +5 -0
  21. package/dist/es/a/AppContext/useApp.js +3 -0
  22. package/dist/es/a/AppContext/useTheme.js +34 -0
  23. package/dist/es/a/index.js +1 -1
  24. package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +2 -2
  25. package/dist/es/b/SocialMediaButton/SocialMediaButton.js +5 -5
  26. package/dist/es/b/ThemeSelector/ThemeSelector.js +2 -2
  27. package/dist/es/f/FormInput/FormInput.js +1 -1
  28. package/dist/es/f/common/Description/Description.js +19 -14
  29. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +0 -2
  30. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
  31. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
  32. package/dist/es/f/fields/SelectInput/SelectInput.js +16 -8
  33. package/dist/es/f/fields/TextInput/TextInput.js +18 -9
  34. package/dist/es/f/fields/TextareaInput/TextareaInput.js +16 -8
  35. package/package.json +1 -1
  36. package/src/__snapshots__/Storyshots.test.js.snap +1528 -1385
  37. package/src/stories/a/{SiteContext.stories.jsx → AppContext.stories.jsx} +8 -8
  38. package/src/stories/a/DotInfo.stories.jsx +12 -12
  39. package/src/stories/a/ProgressBar.stories.jsx +12 -6
  40. package/src/stories/a/Timestamp.stories.jsx +32 -38
  41. package/src/stories/b/Logo.stories.jsx +13 -13
  42. package/src/stories/b/QuestionDropdown.stories.jsx +17 -30
  43. package/src/stories/b/SocialMediaButton.stories.jsx +34 -52
  44. package/src/stories/b/ThemeSelector.stories.jsx +5 -5
  45. package/src/stories/b/Title.stories.jsx +11 -13
  46. package/src/stories/c/ContentSlides.stories.jsx +30 -300
  47. package/src/stories/f/ChoicesInput.stories.jsx +62 -129
  48. package/src/stories/f/Description.stories.jsx +12 -2
  49. package/src/stories/f/RatingsInput.stories.jsx +21 -22
  50. package/src/stories/f/SelectInput.stories.jsx +35 -75
  51. package/src/stories/f/TextInput.stories.jsx +55 -52
  52. package/src/stories/f/TextareaInput.stories.jsx +31 -46
  53. package/src/ui/a/{SiteContext → AppContext}/Context.js +0 -0
  54. package/src/ui/a/{SiteContext → AppContext}/ContextProvider.jsx +8 -7
  55. package/src/ui/a/AppContext/index.js +5 -0
  56. package/src/ui/a/{SiteContext/useSite.js → AppContext/useApp.js} +0 -0
  57. package/src/ui/a/{SiteContext → AppContext}/useTheme.js +0 -0
  58. package/src/ui/a/index.js +4 -4
  59. package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +2 -2
  60. package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +4 -4
  61. package/src/ui/b/ThemeSelector/ThemeSelector.jsx +2 -2
  62. package/src/ui/f/FormInput/FormInput.jsx +1 -0
  63. package/src/ui/f/common/Description/Description.jsx +34 -29
  64. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +1 -2
  65. package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +1 -11
  66. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +1 -11
  67. package/src/ui/f/fields/SelectInput/SelectInput.jsx +16 -9
  68. package/src/ui/f/fields/TextInput/TextInput.jsx +13 -7
  69. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +9 -8
  70. package/src/ui/a/SiteContext/index.js +0 -5
@@ -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, meta] = useField({ name, validate })
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 className="input" {...field} value={field.value || ''} id={name} disabled={disabled}>
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
- {(description || (meta.touched && meta.error))
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, meta] = useField({ name, validate })
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
- {(description || (meta.touched && meta.error))
79
- && (
80
- <FormDescription isError={!!meta.error} className="v50 mt-v s-1">
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, meta] = useField({ name, validate })
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
- {(description || (meta.touched && meta.error))
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 = {
@@ -1,5 +0,0 @@
1
- /* @pareto-engineering/generator-front 0.2.3 */
2
- export { default as SiteContext } from './Context'
3
- export { default as SiteContextProvider } from './ContextProvider'
4
- export { default as useSite } from './useSite'
5
- export { default as useTheme } from './useTheme'