@pareto-engineering/design-system 4.0.0-alpha.62 → 4.0.0-alpha.64

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 (100) hide show
  1. package/dist/cjs/f/common/Description/Description.js +6 -5
  2. package/dist/cjs/f/common/Label/Label.js +9 -22
  3. package/dist/cjs/f/common/Label/styles.scss +0 -5
  4. package/dist/cjs/f/common/index.js +1 -9
  5. package/dist/cjs/f/fields/Checkbox/Checkbox.js +16 -21
  6. package/dist/cjs/f/fields/Checkbox/styles.scss +7 -5
  7. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +13 -23
  8. package/dist/cjs/f/fields/ChoicesInput/styles.scss +44 -41
  9. package/dist/cjs/f/fields/EditorInput/EditorInput.js +11 -39
  10. package/dist/cjs/f/fields/EditorInput/styles.scss +92 -90
  11. package/dist/cjs/f/fields/LinkInput/LinkInput.js +14 -20
  12. package/dist/cjs/f/fields/LinkInput/styles.scss +52 -51
  13. package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +2 -26
  14. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +4 -30
  15. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +7 -16
  16. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +9 -17
  17. package/dist/cjs/f/fields/QueryCombobox/styles.scss +38 -37
  18. package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +2 -10
  19. package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +14 -38
  20. package/dist/cjs/f/fields/RatingsInput/styles.scss +5 -1
  21. package/dist/cjs/f/fields/SelectInput/SelectInput.js +14 -36
  22. package/dist/cjs/f/fields/SelectInput/styles.scss +5 -2
  23. package/dist/cjs/f/fields/TextInput/TextInput.js +19 -37
  24. package/dist/cjs/f/fields/TextInput/styles.scss +37 -30
  25. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -37
  26. package/dist/cjs/f/fields/TextareaInput/styles.scss +30 -27
  27. package/dist/es/f/common/Description/Description.js +4 -1
  28. package/dist/es/f/common/Label/Label.js +15 -24
  29. package/dist/es/f/common/Label/styles.scss +0 -5
  30. package/dist/es/f/common/index.js +0 -1
  31. package/dist/es/f/fields/Checkbox/Checkbox.js +14 -19
  32. package/dist/es/f/fields/Checkbox/styles.scss +7 -5
  33. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +31 -39
  34. package/dist/es/f/fields/ChoicesInput/styles.scss +44 -41
  35. package/dist/es/f/fields/EditorInput/EditorInput.js +12 -35
  36. package/dist/es/f/fields/EditorInput/styles.scss +92 -90
  37. package/dist/es/f/fields/LinkInput/LinkInput.js +14 -20
  38. package/dist/es/f/fields/LinkInput/styles.scss +52 -51
  39. package/dist/es/f/fields/QueryChoices/QueryChoices.js +2 -26
  40. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +4 -26
  41. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +8 -17
  42. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +10 -18
  43. package/dist/es/f/fields/QueryCombobox/styles.scss +38 -37
  44. package/dist/es/f/fields/QuerySelect/QuerySelect.js +2 -10
  45. package/dist/es/f/fields/RatingsInput/RatingsInput.js +15 -35
  46. package/dist/es/f/fields/RatingsInput/styles.scss +5 -1
  47. package/dist/es/f/fields/SelectInput/SelectInput.js +14 -36
  48. package/dist/es/f/fields/SelectInput/styles.scss +5 -2
  49. package/dist/es/f/fields/TextInput/TextInput.js +19 -37
  50. package/dist/es/f/fields/TextInput/styles.scss +37 -30
  51. package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -37
  52. package/dist/es/f/fields/TextareaInput/styles.scss +30 -27
  53. package/package.json +3 -3
  54. package/src/stories/f/Checkbox.stories.jsx +13 -21
  55. package/src/stories/f/ChoicesInput.stories.jsx +12 -27
  56. package/src/stories/f/EditorInput.stories.jsx +7 -14
  57. package/src/stories/f/LinkInput.stories.jsx +15 -22
  58. package/src/stories/f/QueryChoices.stories.jsx +12 -19
  59. package/src/stories/f/QueryCombobox.stories.jsx +16 -24
  60. package/src/stories/f/QuerySelect.stories.jsx +12 -19
  61. package/src/stories/f/RatingsInput.stories.jsx +7 -14
  62. package/src/stories/f/SelectInput.stories.jsx +12 -19
  63. package/src/stories/f/TextInput.stories.jsx +16 -23
  64. package/src/stories/f/TextareaInput.stories.jsx +7 -14
  65. package/src/ui/f/common/Description/Description.jsx +6 -2
  66. package/src/ui/f/common/Label/Label.jsx +27 -37
  67. package/src/ui/f/common/Label/styles.scss +0 -5
  68. package/src/ui/f/common/index.js +0 -1
  69. package/src/ui/f/fields/Checkbox/Checkbox.jsx +27 -33
  70. package/src/ui/f/fields/Checkbox/styles.scss +7 -5
  71. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +29 -38
  72. package/src/ui/f/fields/ChoicesInput/styles.scss +44 -41
  73. package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -41
  74. package/src/ui/f/fields/EditorInput/styles.scss +92 -90
  75. package/src/ui/f/fields/LinkInput/LinkInput.jsx +38 -45
  76. package/src/ui/f/fields/LinkInput/styles.scss +52 -51
  77. package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +0 -28
  78. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +5 -31
  79. package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +35 -46
  80. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +63 -73
  81. package/src/ui/f/fields/QueryCombobox/styles.scss +38 -37
  82. package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +0 -8
  83. package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +20 -47
  84. package/src/ui/f/fields/RatingsInput/styles.scss +5 -1
  85. package/src/ui/f/fields/SelectInput/SelectInput.jsx +33 -61
  86. package/src/ui/f/fields/SelectInput/styles.scss +5 -2
  87. package/src/ui/f/fields/TextInput/TextInput.jsx +27 -50
  88. package/src/ui/f/fields/TextInput/styles.scss +37 -30
  89. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +32 -59
  90. package/src/ui/f/fields/TextareaInput/styles.scss +30 -27
  91. package/tests/__snapshots__/Storyshots.test.js.snap +5909 -0
  92. package/dist/cjs/f/common/InputWrapper/InputWrapper.js +0 -73
  93. package/dist/cjs/f/common/InputWrapper/index.js +0 -13
  94. package/dist/cjs/f/common/InputWrapper/styles.scss +0 -13
  95. package/dist/es/f/common/InputWrapper/InputWrapper.js +0 -61
  96. package/dist/es/f/common/InputWrapper/index.js +0 -2
  97. package/dist/es/f/common/InputWrapper/styles.scss +0 -13
  98. package/src/ui/f/common/InputWrapper/InputWrapper.jsx +0 -83
  99. package/src/ui/f/common/InputWrapper/index.js +0 -2
  100. package/src/ui/f/common/InputWrapper/styles.scss +0 -13
@@ -1,7 +1,7 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { memo } from 'react'
4
+ import { useInsertionEffect, memo } from 'react'
5
5
 
6
6
  import PropTypes from 'prop-types'
7
7
 
@@ -11,9 +11,7 @@ import { useField } from 'formik'
11
11
 
12
12
  // Local Definitions
13
13
 
14
- import { FormLabel, FormDescription, InputWrapper } from '../../common'
15
-
16
- import './styles.scss'
14
+ import { FormLabel, FormDescription } from '../../common'
17
15
 
18
16
  const baseClassName = styleNames.base
19
17
 
@@ -38,55 +36,50 @@ const TextareaInput = ({
38
36
  placeholder,
39
37
  autoComplete,
40
38
  resize,
41
- labelSpan,
42
- desktopLabelSpan,
43
- inputSpan,
44
- desktopInputSpan,
45
39
  // ...otherProps
46
40
  }) => {
41
+ useInsertionEffect(() => {
42
+ import('./styles.scss')
43
+ }, [])
44
+
47
45
  const [field] = useField({ name, validate })
48
46
 
49
47
  return (
50
- <>
48
+ <div
49
+ id={id}
50
+ className={[
51
+ baseClassName,
52
+ componentClassName,
53
+ userClassName,
54
+ `y-${color}`,
55
+ ]
56
+ .filter((e) => e)
57
+ .join(' ')}
58
+ style={style}
59
+ >
51
60
  <FormLabel
52
61
  name={name}
53
62
  color={labelColor}
54
63
  optional={optional}
55
- columnSpan={labelSpan}
56
- desktopColumnSpan={desktopLabelSpan}
57
64
  // {...otherProps}
58
65
  >
59
66
  {label}
60
67
  </FormLabel>
61
- <InputWrapper
62
- id={id}
63
- className={[
64
- baseClassName,
65
- componentClassName,
66
- userClassName,
67
- `y-${color}`,
68
- ]
69
- .filter((e) => e)
70
- .join(' ')}
71
- style={style}
72
- columnSpan={inputSpan}
73
- desktopColumnSpan={desktopInputSpan}
68
+
69
+ <textarea
70
+ id={name}
71
+ className="textarea"
72
+ {...field}
73
+ style={{ resize }}
74
+ placeholder={placeholder}
75
+ rows={rows}
76
+ disabled={disabled}
77
+ autoComplete={autoComplete}
74
78
  >
75
- <textarea
76
- id={name}
77
- className="textarea"
78
- {...field}
79
- style={{ resize }}
80
- placeholder={placeholder}
81
- rows={rows}
82
- disabled={disabled}
83
- autoComplete={autoComplete}
84
- >
85
- {/* It was a dark and stormy night... */}
86
- </textarea>
87
- <FormDescription className="s-1" description={description} name={name} />
88
- </InputWrapper>
89
- </>
79
+ {/* It was a dark and stormy night... */}
80
+ </textarea>
81
+ <FormDescription className="s-1" description={description} name={name} />
82
+ </div>
90
83
  )
91
84
  }
92
85
 
@@ -175,26 +168,6 @@ TextareaInput.propTypes = {
175
168
  * Whether the input is optional or not
176
169
  */
177
170
  optional:PropTypes.bool,
178
-
179
- /**
180
- * The number of columns the label should span
181
- */
182
- labelSpan:PropTypes.number,
183
-
184
- /**
185
- * The number of columns the input should span
186
- */
187
- inputSpan:PropTypes.number,
188
-
189
- /**
190
- * The number of columns the label should span on desktop
191
- */
192
- desktopLabelSpan:PropTypes.number,
193
-
194
- /**
195
- * The number of columns the input should span on desktop
196
- */
197
- desktopInputSpan:PropTypes.number,
198
171
  }
199
172
 
200
173
  TextareaInput.defaultProps = {
@@ -14,36 +14,39 @@ $default-background: var(--background-inputs);
14
14
  $disabled-background: var(--background-inputs-30);
15
15
 
16
16
  .#{bem.$base}.text-area-input {
17
- &.#{bem.$base}.input-wrapper {
18
- display: flex;
19
- flex-direction: column;
20
-
21
- > .textarea {
22
- background: $default-background;
23
- border: $default-border;
24
- border-radius: $default-input-border-radius;
25
- color: var(--y);
26
- outline: none;
27
- padding: $default-padding;
28
- width: 100%;
29
-
30
- &::placeholder {
31
- color: var(--metadata);
32
- }
17
+ display: flex;
18
+ flex-direction: column;
33
19
 
34
- &:disabled {
35
- background-color: $disabled-background;
36
- }
20
+ > .#{bem.$base}.form-label {
21
+ margin-bottom: var(--gap);
22
+ }
23
+
24
+
25
+ > .textarea {
26
+ background: $default-background;
27
+ border: $default-border;
28
+ border-radius: $default-input-border-radius;
29
+ color: var(--y);
30
+ outline: none;
31
+ padding: $default-padding;
32
+ width: 100%;
37
33
 
38
- &:not(:disabled) {
39
- &:hover,
40
- &:active {
41
- border: $hover-border;
42
- }
34
+ &::placeholder {
35
+ color: var(--metadata);
36
+ }
37
+
38
+ &:disabled {
39
+ background-color: $disabled-background;
40
+ }
41
+
42
+ &:not(:disabled) {
43
+ &:hover,
44
+ &:active {
45
+ border: $hover-border;
46
+ }
43
47
 
44
- &:focus {
45
- border: $focus-border;
46
- }
48
+ &:focus {
49
+ border: $focus-border;
47
50
  }
48
51
  }
49
52
  }