@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
@@ -20,9 +20,16 @@ $on-disabled-background: var(--on-background-inputs-30);
20
20
 
21
21
  .#{bem.$base}.combobox,
22
22
  .#{bem.$base}.multiple-combobox {
23
+ display: flex;
24
+ flex-direction: column;
23
25
  outline: none;
24
26
  position: relative;
25
27
 
28
+ > .#{bem.$base}.form-label {
29
+ margin-bottom: var(--gap);
30
+ }
31
+
32
+
26
33
  .#{bem.$base}.popover {
27
34
  border: $default-border;
28
35
  border-radius: $default-input-border-radius;
@@ -53,51 +60,45 @@ $on-disabled-background: var(--on-background-inputs-30);
53
60
  }
54
61
  }
55
62
 
56
- &.#{bem.$base}.input-wrapper {
57
- display: flex;
58
- flex-direction: column;
59
- position: relative;
63
+ >.#{bem.$base}.loading-circle,
64
+ >.#{bem.$base}.button {
65
+ position: absolute;
66
+ right: $default-loading-circle-displacement;
67
+ }
60
68
 
61
- >.#{bem.$base}.loading-circle,
62
- >.#{bem.$base}.button {
63
- position: absolute;
64
- right: $default-loading-circle-displacement;
65
- }
69
+ >.#{bem.$base}.loading-circle {
70
+ top: calc($default-loading-circle-displacement * 1.5);
71
+ }
66
72
 
67
- >.#{bem.$base}.loading-circle {
68
- top: calc($default-loading-circle-displacement * 1.5);
69
- }
73
+ >.#{bem.$base}.button {
74
+ top: $default-loading-circle-displacement;
75
+ }
70
76
 
71
- >.#{bem.$base}.button {
72
- top: $default-loading-circle-displacement;
73
- }
77
+ > .input {
78
+ background: $default-background;
79
+ border: $default-border;
80
+ border-radius: calc(var(--theme-default-border-radius) / 2);
81
+ color: $on-default-background;
82
+ outline: none;
83
+ padding: $default-input-padding;
74
84
 
75
- > .input {
76
- background: $default-background;
77
- border: $default-border;
78
- border-radius: calc(var(--theme-default-border-radius) / 2);
79
- color: $on-default-background;
80
- outline: none;
81
- padding: $default-input-padding;
85
+ &::placeholder {
86
+ color: var(--metadata);
87
+ }
82
88
 
83
- &::placeholder {
84
- color: var(--metadata);
85
- }
89
+ &:disabled {
90
+ background-color: $disabled-background;
91
+ color: $on-disabled-background;
92
+ }
86
93
 
87
- &:disabled {
88
- background-color: $disabled-background;
89
- color: $on-disabled-background;
94
+ &:not(:disabled) {
95
+ &:hover,
96
+ &:active {
97
+ border: $hover-border;
90
98
  }
91
99
 
92
- &:not(:disabled) {
93
- &:hover,
94
- &:active {
95
- border: $hover-border;
96
- }
97
-
98
- &:focus {
99
- border: $focus-border;
100
- }
100
+ &:focus {
101
+ border: $focus-border;
101
102
  }
102
103
  }
103
104
  }
@@ -28,11 +28,7 @@ const QuerySelect = ({
28
28
  color,
29
29
  loadingOption,
30
30
  defaultOption,
31
- validate,
32
- labelSpan,
33
- desktopLabelSpan,
34
- inputSpan,
35
- desktopInputSpan
31
+ validate
36
32
  // ...otherProps
37
33
  }) => {
38
34
  const [,, helpers] = useField({
@@ -88,11 +84,7 @@ const QuerySelect = ({
88
84
  description: description,
89
85
  disabled: isFetching || disabled,
90
86
  options: options,
91
- isLoading: isFetching,
92
- labelSpan: labelSpan,
93
- desktopLabelSpan: desktopLabelSpan,
94
- inputSpan: inputSpan,
95
- desktopInputSpan: desktopInputSpan
87
+ isLoading: isFetching
96
88
  });
97
89
  };
98
90
  QuerySelect.propTypes = {
@@ -1,14 +1,13 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react';
3
- import { useState, memo } from 'react';
3
+ import { useState, useInsertionEffect, memo } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import styleNames from '@pareto-engineering/bem/exports';
6
6
 
7
7
  // Local Definitions
8
8
 
9
9
  import { Rating } from "./common";
10
- import { FormLabel, InputWrapper } from "../../common";
11
- import "./styles.scss";
10
+ import { FormLabel } from "../../common";
12
11
  const baseClassName = styleNames.base;
13
12
  const componentClassName = 'ratings-input';
14
13
 
@@ -28,27 +27,24 @@ const RatingsInput = ({
28
27
  labelMax,
29
28
  labelMin,
30
29
  displayRatingsLabel,
31
- optional,
32
- labelSpan,
33
- desktopLabelSpan,
34
- inputSpan,
35
- desktopInputSpan
30
+ optional
36
31
  // ...otherProps
37
32
  }) => {
33
+ useInsertionEffect(() => {
34
+ import("./styles.scss");
35
+ }, []);
38
36
  const [hover, setHover] = useState(null);
39
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
37
+ return /*#__PURE__*/React.createElement("div", {
38
+ id: id,
39
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
40
+ style: style
41
+ }, /*#__PURE__*/React.createElement(FormLabel, {
40
42
  name: name,
41
43
  color: labelColor,
42
- optional: optional,
43
- columnSpan: labelSpan,
44
- desktopColumnSpan: desktopLabelSpan
44
+ optional: optional
45
45
  // {...otherProps}
46
- }, label), /*#__PURE__*/React.createElement(InputWrapper, {
47
- id: id,
48
- className: [baseClassName, componentClassName, userClassName, 'stars'].filter(e => e).join(' '),
49
- style: style,
50
- columnSpan: inputSpan,
51
- desktopColumnSpan: desktopInputSpan
46
+ }, label), /*#__PURE__*/React.createElement("div", {
47
+ className: "stars"
52
48
  }, displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
53
49
  className: "label-text s-2 x-metadata c-x"
54
50
  }, labelMin), [...Array(ratingCount)].map((_, index) => {
@@ -119,23 +115,7 @@ RatingsInput.propTypes = {
119
115
  /**
120
116
  * String that will represent color for the label
121
117
  */
122
- labelColor: PropTypes.string,
123
- /**
124
- * The number of columns the label should span
125
- */
126
- labelSpan: PropTypes.number,
127
- /**
128
- * The number of columns the input should span
129
- */
130
- inputSpan: PropTypes.number,
131
- /**
132
- * The number of columns the label should span on desktop
133
- */
134
- desktopLabelSpan: PropTypes.number,
135
- /**
136
- * The number of columns the input should span on desktop
137
- */
138
- desktopInputSpan: PropTypes.number
118
+ labelColor: PropTypes.string
139
119
  };
140
120
  RatingsInput.defaultProps = {
141
121
  labelMin: 'not satisfied.',
@@ -9,7 +9,11 @@ $default-padding: .2em;
9
9
  $default-transition: all .2s;
10
10
 
11
11
  .#{bem.$base}.ratings-input {
12
- &.stars {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: var(--gap);
15
+
16
+ >.stars {
13
17
  display: flex;
14
18
 
15
19
  >:not(:last-child) {
@@ -1,13 +1,12 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { memo } from 'react';
4
+ import { useInsertionEffect, memo } from 'react';
5
5
  import { useField } from 'formik';
6
6
  import PropTypes from 'prop-types';
7
7
  import styleNames from '@pareto-engineering/bem/exports';
8
8
  import { LoadingCircle } from "../../../a";
9
- import { FormLabel, FormDescription, InputWrapper } from "../../common";
10
- import "./styles.scss";
9
+ import { FormLabel, FormDescription } from "../../common";
11
10
 
12
11
  // Local Definitions
13
12
 
@@ -31,31 +30,26 @@ const SelectInput = ({
31
30
  description,
32
31
  disabled,
33
32
  isLoading,
34
- autoComplete,
35
- labelSpan,
36
- desktopLabelSpan,
37
- inputSpan,
38
- desktopInputSpan
33
+ autoComplete
39
34
  // ...otherProps
40
35
  }) => {
36
+ useInsertionEffect(() => {
37
+ import("./styles.scss");
38
+ }, []);
41
39
  const [field] = useField({
42
40
  name,
43
41
  validate
44
42
  });
45
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ id: id,
45
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
46
+ style: style
47
+ }, /*#__PURE__*/React.createElement(FormLabel, {
46
48
  name: name,
47
49
  color: labelColor,
48
- optional: optional,
49
- columnSpan: labelSpan,
50
- desktopColumnSpan: desktopLabelSpan
50
+ optional: optional
51
51
  // {...otherProps}
52
- }, label), /*#__PURE__*/React.createElement(InputWrapper, {
53
- id: id,
54
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
55
- style: style,
56
- columnSpan: inputSpan,
57
- desktopColumnSpan: desktopInputSpan
58
- }, /*#__PURE__*/React.createElement("div", {
52
+ }, label), /*#__PURE__*/React.createElement("div", {
59
53
  className: `select-wrapper${disabled ? ' disabled' : ''}`
60
54
  }, /*#__PURE__*/React.createElement("select", _extends({
61
55
  className: `input y-${color}`
@@ -81,7 +75,7 @@ const SelectInput = ({
81
75
  className: "s-1",
82
76
  description: description,
83
77
  name: name
84
- })));
78
+ }));
85
79
  };
86
80
  SelectInput.propTypes = {
87
81
  /**
@@ -141,22 +135,6 @@ SelectInput.propTypes = {
141
135
  */
142
136
  autoComplete: PropTypes.string,
143
137
  /**
144
- * The number of columns the label should span
145
- */
146
- labelSpan: PropTypes.number,
147
- /**
148
- * The number of columns the input should span
149
- */
150
- inputSpan: PropTypes.number,
151
- /**
152
- * The number of columns the label should span on desktop
153
- */
154
- desktopLabelSpan: PropTypes.number,
155
- /**
156
- * The number of columns the input should span on desktop
157
- */
158
- desktopInputSpan: PropTypes.number,
159
- /**
160
138
  * Whether the input is optional or not
161
139
  */
162
140
  optional: PropTypes.bool
@@ -16,8 +16,11 @@ $default-background: var(--background-inputs);
16
16
  $disabled-background: var(--background-inputs-30);
17
17
 
18
18
  .#{bem.$base}.select-input {
19
- &.#{bem.$base}.label {
20
- margin-bottom: $default-spacing-size;
19
+ display: flex;
20
+ flex-direction: column;
21
+
22
+ > .#{bem.$base}.form-label {
23
+ margin-bottom: var(--gap);
21
24
  }
22
25
 
23
26
  .select-wrapper {
@@ -1,12 +1,11 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { memo } from 'react';
4
+ import { useInsertionEffect, memo } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import styleNames from '@pareto-engineering/bem/exports';
7
7
  import { useField } from 'formik';
8
- import { FormLabel, FormDescription, InputWrapper } from "../../common";
9
- import "./styles.scss";
8
+ import { FormLabel, FormDescription } from "../../common";
10
9
 
11
10
  // Local Definitions
12
11
 
@@ -31,13 +30,12 @@ const TextInput = ({
31
30
  placeholder,
32
31
  optional,
33
32
  autoComplete,
34
- labelSpan,
35
- desktopLabelSpan,
36
- inputSpan,
37
- desktopInputSpan,
38
33
  symbol,
39
34
  ...otherProps
40
35
  }) => {
36
+ useInsertionEffect(() => {
37
+ import("./styles.scss");
38
+ }, []);
41
39
  const [field] = useField({
42
40
  name,
43
41
  validate
@@ -45,34 +43,34 @@ const TextInput = ({
45
43
  const symbolStyle = symbol ? {
46
44
  '--symbol': symbol
47
45
  } : {};
48
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
49
- name: name,
50
- color: labelColor,
51
- optional: optional,
52
- columnSpan: labelSpan,
53
- desktopColumnSpan: desktopLabelSpan
54
- // {...otherProps}
55
- }, label), /*#__PURE__*/React.createElement(InputWrapper, {
46
+ const InputWrapper = symbol ? 'div' : React.Fragment;
47
+ const inputWrapperProps = symbol ? {
48
+ className: 'input-wrapper'
49
+ } : {};
50
+ return /*#__PURE__*/React.createElement("div", {
56
51
  id: id,
57
52
  className: [baseClassName, componentClassName, userClassName, `y-${color} ${symbol ? 'has-symbol' : ''}`].filter(e => e).join(' '),
58
53
  style: {
59
54
  ...symbolStyle,
60
55
  ...style
61
- },
62
- columnSpan: inputSpan,
63
- desktopColumnSpan: desktopInputSpan
64
- }, /*#__PURE__*/React.createElement("input", _extends({
56
+ }
57
+ }, /*#__PURE__*/React.createElement(FormLabel, {
58
+ name: name,
59
+ color: labelColor,
60
+ optional: optional
61
+ // {...otherProps}
62
+ }, label), /*#__PURE__*/React.createElement(InputWrapper, inputWrapperProps, /*#__PURE__*/React.createElement("input", _extends({
65
63
  id: name,
66
64
  className: "input",
67
65
  type: type,
68
66
  disabled: disabled,
69
67
  placeholder: placeholder,
70
68
  autoComplete: autoComplete
71
- }, field, otherProps)), /*#__PURE__*/React.createElement(FormDescription, {
69
+ }, field, otherProps))), /*#__PURE__*/React.createElement(FormDescription, {
72
70
  className: "s-1",
73
71
  description: description,
74
72
  name: name
75
- })));
73
+ }));
76
74
  };
77
75
  TextInput.propTypes = {
78
76
  /**
@@ -136,22 +134,6 @@ TextInput.propTypes = {
136
134
  * `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
137
135
  */
138
136
  autoComplete: PropTypes.string,
139
- /**
140
- * The number of columns the label should span
141
- */
142
- labelSpan: PropTypes.number,
143
- /**
144
- * The number of columns the input should span
145
- */
146
- inputSpan: PropTypes.number,
147
- /**
148
- * The number of columns the label should span on desktop
149
- */
150
- desktopLabelSpan: PropTypes.number,
151
- /**
152
- * The number of columns the input should span on desktop
153
- */
154
- desktopInputSpan: PropTypes.number,
155
137
  /**
156
138
  * A symbol to be set inside the input field
157
139
  */
@@ -19,12 +19,18 @@ $default-background: var(--background-inputs);
19
19
  $disabled-background: var(--background-inputs-30);
20
20
 
21
21
  .#{bem.$base}.text-input {
22
- &.#{bem.$base}.input-wrapper {
23
- display: flex;
24
- flex-direction: column;
25
- position: relative;
22
+ display: flex;
23
+ flex-direction: column;
24
+
25
+ > .#{bem.$base}.form-label {
26
+ margin-bottom: var(--gap);
27
+ }
28
+
29
+
30
+ &.has-symbol {
31
+ > .input-wrapper {
32
+ position: relative;
26
33
 
27
- &.has-symbol {
28
34
  &::before {
29
35
  color: var(--y);
30
36
  content: var(--symbol);
@@ -33,39 +39,40 @@ $disabled-background: var(--background-inputs-30);
33
39
  top: 50%;
34
40
  transform: translate(-50%, -50%);
35
41
  }
42
+ }
36
43
 
37
- input {
38
- padding: $default-padding-with-symbol;
39
- }
44
+ input {
45
+ padding: $default-padding-with-symbol;
40
46
  }
47
+ }
41
48
 
42
- > input {
43
- background-color: $default-background;
44
- border: $default-border;
45
- border-radius: $default-input-border-radius;
46
- color: var(--y);
47
- outline: none;
48
- padding: $default-padding;
49
- width: 100%;
49
+ .input {
50
+ background-color: $default-background;
51
+ border: $default-border;
52
+ border-radius: $default-input-border-radius;
53
+ color: var(--y);
54
+ outline: none;
55
+ padding: $default-padding;
56
+ width: 100%;
50
57
 
51
- &::placeholder {
52
- color: var(--metadata);
53
- }
58
+ &::placeholder {
59
+ color: var(--metadata);
60
+ }
54
61
 
55
- &:disabled {
56
- background-color: $disabled-background;
57
- }
62
+ &:disabled {
63
+ background-color: $disabled-background;
64
+ }
58
65
 
59
- &:not(:disabled) {
60
- &:hover,
61
- &:active {
62
- border: $hover-border;
63
- }
66
+ &:not(:disabled) {
67
+ &:hover,
68
+ &:active {
69
+ border: $hover-border;
70
+ }
64
71
 
65
- &:focus {
66
- border: $focus-border;
67
- }
72
+ &:focus {
73
+ border: $focus-border;
68
74
  }
69
75
  }
70
76
  }
71
77
  }
78
+
@@ -1,15 +1,14 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { memo } from 'react';
4
+ import { useInsertionEffect, memo } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import styleNames from '@pareto-engineering/bem/exports';
7
7
  import { useField } from 'formik';
8
8
 
9
9
  // Local Definitions
10
10
 
11
- import { FormLabel, FormDescription, InputWrapper } from "../../common";
12
- import "./styles.scss";
11
+ import { FormLabel, FormDescription } from "../../common";
13
12
  const baseClassName = styleNames.base;
14
13
  const componentClassName = 'text-area-input';
15
14
 
@@ -31,31 +30,26 @@ const TextareaInput = ({
31
30
  disabled,
32
31
  placeholder,
33
32
  autoComplete,
34
- resize,
35
- labelSpan,
36
- desktopLabelSpan,
37
- inputSpan,
38
- desktopInputSpan
33
+ resize
39
34
  // ...otherProps
40
35
  }) => {
36
+ useInsertionEffect(() => {
37
+ import("./styles.scss");
38
+ }, []);
41
39
  const [field] = useField({
42
40
  name,
43
41
  validate
44
42
  });
45
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ id: id,
45
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
46
+ style: style
47
+ }, /*#__PURE__*/React.createElement(FormLabel, {
46
48
  name: name,
47
49
  color: labelColor,
48
- optional: optional,
49
- columnSpan: labelSpan,
50
- desktopColumnSpan: desktopLabelSpan
50
+ optional: optional
51
51
  // {...otherProps}
52
- }, label), /*#__PURE__*/React.createElement(InputWrapper, {
53
- id: id,
54
- className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
55
- style: style,
56
- columnSpan: inputSpan,
57
- desktopColumnSpan: desktopInputSpan
58
- }, /*#__PURE__*/React.createElement("textarea", _extends({
52
+ }, label), /*#__PURE__*/React.createElement("textarea", _extends({
59
53
  id: name,
60
54
  className: "textarea"
61
55
  }, field, {
@@ -70,7 +64,7 @@ const TextareaInput = ({
70
64
  className: "s-1",
71
65
  description: description,
72
66
  name: name
73
- })));
67
+ }));
74
68
  };
75
69
  TextareaInput.propTypes = {
76
70
  /**
@@ -141,23 +135,7 @@ TextareaInput.propTypes = {
141
135
  /**
142
136
  * Whether the input is optional or not
143
137
  */
144
- optional: PropTypes.bool,
145
- /**
146
- * The number of columns the label should span
147
- */
148
- labelSpan: PropTypes.number,
149
- /**
150
- * The number of columns the input should span
151
- */
152
- inputSpan: PropTypes.number,
153
- /**
154
- * The number of columns the label should span on desktop
155
- */
156
- desktopLabelSpan: PropTypes.number,
157
- /**
158
- * The number of columns the input should span on desktop
159
- */
160
- desktopInputSpan: PropTypes.number
138
+ optional: PropTypes.bool
161
139
  };
162
140
  TextareaInput.defaultProps = {
163
141
  rows: 10,
@@ -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
  }