@pareto-engineering/design-system 4.0.0-alpha.34 → 4.0.0-alpha.36

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 (89) hide show
  1. package/dist/cjs/f/common/InputWrapper/InputWrapper.js +74 -0
  2. package/dist/cjs/f/common/InputWrapper/index.js +13 -0
  3. package/dist/cjs/f/common/InputWrapper/styles.scss +13 -0
  4. package/dist/cjs/f/common/Label/Label.js +18 -4
  5. package/dist/cjs/f/common/Label/styles.scss +8 -2
  6. package/dist/cjs/f/common/index.js +8 -1
  7. package/dist/cjs/f/fields/Checkbox/Checkbox.js +40 -10
  8. package/dist/cjs/f/fields/Checkbox/styles.scss +6 -8
  9. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +42 -20
  10. package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
  11. package/dist/cjs/f/fields/ChoicesInput/styles.scss +50 -35
  12. package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +26 -2
  13. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +35 -5
  14. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +41 -14
  15. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +33 -23
  16. package/dist/cjs/f/fields/QueryCombobox/styles.scss +58 -28
  17. package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +17 -3
  18. package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +41 -19
  19. package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +3 -3
  20. package/dist/cjs/f/fields/RatingsInput/styles.scss +6 -13
  21. package/dist/cjs/f/fields/SelectInput/SelectInput.js +45 -15
  22. package/dist/cjs/f/fields/SelectInput/styles.scss +40 -18
  23. package/dist/cjs/f/fields/TextInput/TextInput.js +38 -16
  24. package/dist/cjs/f/fields/TextInput/styles.scss +28 -22
  25. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +42 -21
  26. package/dist/cjs/f/fields/TextareaInput/styles.scss +42 -27
  27. package/dist/es/f/common/InputWrapper/InputWrapper.js +66 -0
  28. package/dist/es/f/common/InputWrapper/index.js +2 -0
  29. package/dist/es/f/common/InputWrapper/styles.scss +13 -0
  30. package/dist/es/f/common/Label/Label.js +18 -4
  31. package/dist/es/f/common/Label/styles.scss +8 -2
  32. package/dist/es/f/common/index.js +2 -1
  33. package/dist/es/f/fields/Checkbox/Checkbox.js +41 -11
  34. package/dist/es/f/fields/Checkbox/styles.scss +6 -8
  35. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +43 -21
  36. package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
  37. package/dist/es/f/fields/ChoicesInput/styles.scss +50 -35
  38. package/dist/es/f/fields/QueryChoices/QueryChoices.js +26 -2
  39. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +35 -5
  40. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +41 -14
  41. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +33 -23
  42. package/dist/es/f/fields/QueryCombobox/styles.scss +58 -28
  43. package/dist/es/f/fields/QuerySelect/QuerySelect.js +17 -3
  44. package/dist/es/f/fields/RatingsInput/RatingsInput.js +42 -20
  45. package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +3 -3
  46. package/dist/es/f/fields/RatingsInput/styles.scss +6 -13
  47. package/dist/es/f/fields/SelectInput/SelectInput.js +46 -16
  48. package/dist/es/f/fields/SelectInput/styles.scss +40 -18
  49. package/dist/es/f/fields/TextInput/TextInput.js +39 -17
  50. package/dist/es/f/fields/TextInput/styles.scss +28 -22
  51. package/dist/es/f/fields/TextareaInput/TextareaInput.js +43 -22
  52. package/dist/es/f/fields/TextareaInput/styles.scss +42 -27
  53. package/package.json +3 -3
  54. package/src/stories/f/Checkbox.stories.jsx +22 -7
  55. package/src/stories/f/ChoicesInput.stories.jsx +21 -7
  56. package/src/stories/f/QueryChoices.stories.jsx +20 -4
  57. package/src/stories/f/QueryCombobox.stories.jsx +25 -13
  58. package/src/stories/f/QuerySelect.stories.jsx +20 -5
  59. package/src/stories/f/RatingsInput.stories.jsx +16 -2
  60. package/src/stories/f/SelectInput.stories.jsx +20 -5
  61. package/src/stories/f/TextInput.stories.jsx +23 -9
  62. package/src/stories/f/TextareaInput.stories.jsx +16 -2
  63. package/src/ui/f/common/InputWrapper/InputWrapper.jsx +89 -0
  64. package/src/ui/f/common/InputWrapper/index.js +2 -0
  65. package/src/ui/f/common/InputWrapper/styles.scss +13 -0
  66. package/src/ui/f/common/Label/Label.jsx +18 -2
  67. package/src/ui/f/common/Label/styles.scss +8 -2
  68. package/src/ui/f/common/index.js +1 -0
  69. package/src/ui/f/fields/Checkbox/Checkbox.jsx +65 -27
  70. package/src/ui/f/fields/Checkbox/styles.scss +6 -8
  71. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +75 -47
  72. package/src/ui/f/fields/ChoicesInput/common/Choice/Choice.jsx +10 -3
  73. package/src/ui/f/fields/ChoicesInput/styles.scss +50 -35
  74. package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +28 -0
  75. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +37 -2
  76. package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +67 -38
  77. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +81 -66
  78. package/src/ui/f/fields/QueryCombobox/styles.scss +58 -28
  79. package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +16 -1
  80. package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +55 -28
  81. package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +3 -3
  82. package/src/ui/f/fields/RatingsInput/styles.scss +6 -13
  83. package/src/ui/f/fields/SelectInput/SelectInput.jsx +88 -49
  84. package/src/ui/f/fields/SelectInput/styles.scss +40 -18
  85. package/src/ui/f/fields/TextInput/TextInput.jsx +52 -29
  86. package/src/ui/f/fields/TextInput/styles.scss +28 -22
  87. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +65 -43
  88. package/src/ui/f/fields/TextareaInput/styles.scss +42 -27
  89. package/tests/__snapshots__/Storyshots.test.js.snap +4698 -3122
@@ -8,6 +8,7 @@ import { useCombobox, useMultipleSelection } from 'downshift';
8
8
  import { Button } from "../../../../../b";
9
9
  import { Popover, LoadingCircle } from "../../../../../a";
10
10
  import { FormDescription, FormLabel } from "../../../..";
11
+ import { InputWrapper } from "../../../../common";
11
12
 
12
13
  // Local Definitions
13
14
 
@@ -31,6 +32,7 @@ const MultipleCombobox = ({
31
32
  className: userClassName,
32
33
  style,
33
34
  label,
35
+ labelColor,
34
36
  name,
35
37
  optional,
36
38
  options: items,
@@ -42,7 +44,11 @@ const MultipleCombobox = ({
42
44
  isFetching,
43
45
  minLength,
44
46
  transformSearch,
45
- disabled
47
+ disabled,
48
+ labelSpan,
49
+ desktopLabelSpan,
50
+ inputSpan,
51
+ desktopInputSpan
46
52
  // ...otherProps
47
53
  }) => {
48
54
  const [searchInputValue, setSearchInputValue] = useState('');
@@ -137,14 +143,22 @@ const MultipleCombobox = ({
137
143
  }, [value]);
138
144
  const parentRef = useRef(null);
139
145
  const resetInputValue = () => setInputValue('');
140
- return /*#__PURE__*/React.createElement("div", {
141
- id: id,
142
- className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
143
- style: style
144
- }, /*#__PURE__*/React.createElement(FormLabel, _extends({}, getLabelProps(), {
146
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, _extends({
147
+ className: [baseClassName, componentClassName].filter(e => e).join(' ')
148
+ }, getLabelProps(), {
145
149
  name: name,
146
- optional: optional
147
- }), label), selectedItems?.length > 0 && /*#__PURE__*/React.createElement("div", {
150
+ optional: optional,
151
+ color: labelColor,
152
+ columnSpan: labelSpan,
153
+ desktopColumnSpan: desktopLabelSpan
154
+ }), label), /*#__PURE__*/React.createElement(InputWrapper, _extends({
155
+ id: id,
156
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
157
+ style: style,
158
+ ref: parentRef,
159
+ columnSpan: inputSpan,
160
+ desktopColumnSpan: desktopInputSpan
161
+ }, getComboboxProps()), selectedItems?.length > 0 && /*#__PURE__*/React.createElement("div", {
148
162
  className: "selected-items"
149
163
  }, selectedItems.map((selectedItem, index) => /*#__PURE__*/React.createElement("div", _extends({
150
164
  key: selectedItem.label
@@ -159,41 +173,37 @@ const MultipleCombobox = ({
159
173
  removeSelectedItem(selectedItem);
160
174
  },
161
175
  isCompact: true,
162
- isSimple: true,
163
176
  color: color
164
- }, /*#__PURE__*/React.createElement("span", {
165
- className: "v25 mr-v"
166
- }, selectedItem.label), /*#__PURE__*/React.createElement("span", {
177
+ }, /*#__PURE__*/React.createElement("span", null, selectedItem.label), /*#__PURE__*/React.createElement("span", {
167
178
  className: "icon close"
168
- }, "Y"))))), /*#__PURE__*/React.createElement("div", _extends({}, getComboboxProps(), {
169
- className: "input-wrapper"
170
- }), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(getDropdownProps({
179
+ }, "Y"))))), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(getDropdownProps({
171
180
  preventKeyAction: isOpen
172
181
  })), {
173
182
  className: "input",
174
183
  disabled: disabled
175
184
  })), isFetching && /*#__PURE__*/React.createElement(LoadingCircle, {
176
- className: "x-main2"
185
+ className: "x-main"
177
186
  }), inputValue.length > minLength && !isFetching && /*#__PURE__*/React.createElement(Button, {
178
187
  isSimple: true,
179
188
  isCompact: true,
180
- color: "main2",
189
+ color: "interactive",
181
190
  onClick: resetInputValue
182
191
  }, /*#__PURE__*/React.createElement("span", {
183
192
  className: "icon"
184
- }, "Y"))), /*#__PURE__*/React.createElement(Popover, {
193
+ }, "Y")), /*#__PURE__*/React.createElement(FormDescription, {
194
+ className: "s-1",
195
+ description: description,
196
+ name: name
197
+ }), /*#__PURE__*/React.createElement(Popover, {
185
198
  isOpen: isOpen,
186
199
  parentRef: parentRef
187
200
  }, /*#__PURE__*/React.createElement(Menu, _extends({
201
+ className: `y-${color}`,
188
202
  isOpen: isOpen,
189
203
  getItemProps: getItemProps,
190
204
  highlightedIndex: highlightedIndex,
191
205
  items: getFilteredItems()
192
- }, getMenuProps()))), /*#__PURE__*/React.createElement(FormDescription, {
193
- className: "v50 mt-v s-1",
194
- description: description,
195
- name: name
196
- }));
206
+ }, getMenuProps())))));
197
207
  };
198
208
  MultipleCombobox.propTypes = {
199
209
  /**
@@ -1,23 +1,29 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* stylelint-disable max-nesting-depth -- needed here */
3
+ /* stylelint-disable selector-max-compound-selectors -- needed here */
2
4
 
3
5
  @use "@pareto-engineering/bem";
4
- @use "sass:math";
6
+ @use "@pareto-engineering/styles/src/mixins";
7
+ @use "@pareto-engineering/styles/src/globals" as *;
5
8
 
6
- $default-input-padding: .75em .75em .55em;
7
- $default-padding: 1em;
8
- $default-margin: 1em;
9
- $default-gap: 1em;
9
+ $default-input-padding: .55em .75em;
10
+ $default-gap: var(--gap);
10
11
  $default-loading-circle-displacement: .5em;
12
+ $default-input-border-radius: var(--theme-default-input-border-radius);
13
+ $default-border: var(--theme-default-input-border);
14
+ $hover-border: var(--theme-hover-input-border);
15
+ $focus-border: var(--theme-focus-input-border);
16
+ $default-background: var(--theme-default-input-background);
17
+ $disabled-background: var(--theme-disabled-input-background);
11
18
 
12
19
  .#{bem.$base}.combobox,
13
20
  .#{bem.$base}.multiple-combobox {
21
+ outline: none;
14
22
  position: relative;
15
23
 
16
- .#{bem.$base}.label {
17
- margin-bottom: $default-margin;
18
- }
19
-
20
24
  .#{bem.$base}.popover {
25
+ border: $default-border;
26
+ border-radius: $default-input-border-radius;
21
27
  width: 100%;
22
28
 
23
29
  >.menu {
@@ -27,47 +33,68 @@ $default-loading-circle-displacement: .5em;
27
33
  padding: 0;
28
34
 
29
35
  >.item {
30
- padding: math.div($default-padding, 2);
36
+ border-radius: $default-input-border-radius;
37
+ padding: $default-input-padding;
38
+
39
+ > p {
40
+ margin: 0;
41
+ }
31
42
 
32
43
  &.#{bem.$modifier-active} {
33
- background-color: var(--hard-y);
44
+ background-color: var(--y);
45
+
46
+ > p {
47
+ color: var(--on-y);
48
+ }
34
49
  }
35
50
  }
36
51
  }
37
52
  }
38
53
 
39
- >.input-wrapper {
54
+ &.#{bem.$base}.input-wrapper {
55
+ display: flex;
56
+ flex-direction: column;
40
57
  position: relative;
41
58
 
42
59
  >.#{bem.$base}.loading-circle,
43
60
  >.#{bem.$base}.button {
44
61
  position: absolute;
45
- right: calc(2 * $default-loading-circle-displacement);
62
+ right: $default-loading-circle-displacement;
63
+ }
64
+
65
+ >.#{bem.$base}.loading-circle {
66
+ top: calc($default-loading-circle-displacement * 1.5);
67
+ }
68
+
69
+ >.#{bem.$base}.button {
46
70
  top: $default-loading-circle-displacement;
47
71
  }
48
72
 
49
- >.input {
50
- background: var(--soft-y);
51
- border: var(--theme-default-border-style) var(--hard-y);
73
+ > .input {
74
+ background: $default-background;
75
+ border: $default-border;
52
76
  border-radius: calc(var(--theme-default-border-radius) / 2);
53
77
  color: var(--on-y);
78
+ outline: none;
54
79
  padding: $default-input-padding;
55
- width: 100%;
56
80
 
57
81
  &::placeholder {
58
82
  color: var(--metadata);
59
83
  }
60
84
 
61
- &:not(:disabled):hover {
62
- border: var(--theme-default-border-style) var(--hard-y);
63
- }
64
-
65
85
  &:disabled {
66
- background-color: var(--hard-y);
86
+ background-color: $disabled-background;
67
87
  }
68
88
 
69
- &:focus {
70
- border: var(--theme-default-border-style) var(--hard-y);
89
+ &:not(:disabled) {
90
+ &:hover,
91
+ &:active {
92
+ border: $hover-border;
93
+ }
94
+
95
+ &:focus {
96
+ border: $focus-border;
97
+ }
71
98
  }
72
99
  }
73
100
  }
@@ -78,12 +105,15 @@ $default-loading-circle-displacement: .5em;
78
105
  >.selected-items {
79
106
  display: flex;
80
107
  flex-wrap: wrap;
81
- gap: math.div($default-gap, 2);
82
- margin-bottom: math.div($default-margin, 2);
108
+ gap: calc($default-gap / 2);
109
+ margin-bottom: calc($default-gap / 2);
83
110
 
84
111
  >.item {
85
- background-color: var(--main);
86
- padding: math.div($default-padding, 4);
112
+ >.#{bem.$base}.button {
113
+ align-items: center;
114
+ display: flex;
115
+ gap: calc($default-gap / 2);
116
+ }
87
117
 
88
118
  .close {
89
119
  font-size: calc(var(--s-3) * 1em);
@@ -18,6 +18,7 @@ const QuerySelect = ({
18
18
  style,
19
19
  name,
20
20
  label,
21
+ labelColor,
21
22
  optional,
22
23
  query,
23
24
  variables,
@@ -27,7 +28,11 @@ const QuerySelect = ({
27
28
  color,
28
29
  loadingOption,
29
30
  defaultOption,
30
- validate
31
+ validate,
32
+ labelSpan,
33
+ desktopLabelSpan,
34
+ inputSpan,
35
+ desktopInputSpan
31
36
  // ...otherProps
32
37
  }) => {
33
38
  const [,, helpers] = useField({
@@ -79,10 +84,15 @@ const QuerySelect = ({
79
84
  label: label,
80
85
  optional: optional,
81
86
  color: color,
87
+ labelColor: labelColor,
82
88
  description: description,
83
89
  disabled: isFetching || disabled,
84
90
  options: options,
85
- isLoading: isFetching
91
+ isLoading: isFetching,
92
+ labelSpan: labelSpan,
93
+ desktopLabelSpan: desktopLabelSpan,
94
+ inputSpan: inputSpan,
95
+ desktopInputSpan: desktopInputSpan
86
96
  });
87
97
  };
88
98
  QuerySelect.propTypes = {
@@ -118,6 +128,10 @@ QuerySelect.propTypes = {
118
128
  * The base color of the custom select input
119
129
  */
120
130
  color: PropTypes.string,
131
+ /**
132
+ * The label color of the custom select input
133
+ */
134
+ labelColor: PropTypes.string,
121
135
  /**
122
136
  * The graphql query to fetch the options and the accessor to destructure the results from
123
137
  */
@@ -165,7 +179,7 @@ QuerySelect.propTypes = {
165
179
  };
166
180
  QuerySelect.defaultProps = {
167
181
  disabled: false,
168
- color: 'background-far',
182
+ color: 'paragraph',
169
183
  defaultOption: {
170
184
  value: '',
171
185
  label: 'Select an option',
@@ -7,7 +7,7 @@ import styleNames from '@pareto-engineering/bem/exports';
7
7
  // Local Definitions
8
8
 
9
9
  import { Rating } from "./common";
10
- import { FormLabel } from "../../common";
10
+ import { FormLabel, InputWrapper } from "../../common";
11
11
  const baseClassName = styleNames.base;
12
12
  const componentClassName = 'ratings-input';
13
13
 
@@ -21,32 +21,38 @@ const RatingsInput = ({
21
21
  name,
22
22
  ratingCount,
23
23
  showRatingValue,
24
- oneInputLabel,
24
+ color,
25
25
  label,
26
26
  labelColor,
27
27
  labelMax,
28
28
  labelMin,
29
29
  displayRatingsLabel,
30
- optional
30
+ optional,
31
+ labelSpan,
32
+ desktopLabelSpan,
33
+ inputSpan,
34
+ desktopInputSpan
31
35
  // ...otherProps
32
36
  }) => {
33
37
  useInsertionEffect(() => {
34
38
  import("./styles.scss");
35
39
  }, []);
36
40
  const [hover, setHover] = useState(null);
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, {
42
- className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
41
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
43
42
  name: name,
44
43
  color: labelColor,
45
- optional: optional
46
- }, label), /*#__PURE__*/React.createElement("div", {
47
- className: "stars"
44
+ optional: optional,
45
+ columnSpan: labelSpan,
46
+ desktopColumnSpan: desktopLabelSpan
47
+ // {...otherProps}
48
+ }, label), /*#__PURE__*/React.createElement(InputWrapper, {
49
+ id: id,
50
+ className: [baseClassName, componentClassName, userClassName, 'stars'].filter(e => e).join(' '),
51
+ style: style,
52
+ columnSpan: inputSpan,
53
+ desktopColumnSpan: desktopInputSpan
48
54
  }, displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
49
- className: "label-text md-s-1 s-2 x-metadata c-x"
55
+ className: "label-text s-2 x-metadata c-x"
50
56
  }, labelMin), [...Array(ratingCount)].map((_, index) => {
51
57
  const ratingValue = index + 1;
52
58
  return /*#__PURE__*/React.createElement(Rating, {
@@ -56,10 +62,11 @@ const RatingsInput = ({
56
62
  name: name,
57
63
  hover: hover,
58
64
  setHover: setHover,
59
- showRatingValue: showRatingValue
65
+ showRatingValue: showRatingValue,
66
+ activeBackgroundColor: color
60
67
  });
61
68
  }), displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
62
- className: "label-text md-s-1 s-2 x-metadata c-x"
69
+ className: "label-text s-2 x-metadata c-x"
63
70
  }, labelMax)));
64
71
  };
65
72
  RatingsInput.propTypes = {
@@ -108,17 +115,32 @@ RatingsInput.propTypes = {
108
115
  */
109
116
  optional: PropTypes.bool,
110
117
  /**
111
- * If the slide will only have one input
118
+ * The color of the stars
112
119
  */
113
- oneInputLabel: PropTypes.bool,
120
+ color: PropTypes.string,
114
121
  /**
115
122
  * String that will represent color for the label
116
123
  */
117
- labelColor: PropTypes.string
124
+ labelColor: PropTypes.string,
125
+ /**
126
+ * The number of columns the label should span
127
+ */
128
+ labelSpan: PropTypes.number,
129
+ /**
130
+ * The number of columns the input should span
131
+ */
132
+ inputSpan: PropTypes.number,
133
+ /**
134
+ * The number of columns the label should span on desktop
135
+ */
136
+ desktopLabelSpan: PropTypes.number,
137
+ /**
138
+ * The number of columns the input should span on desktop
139
+ */
140
+ desktopInputSpan: PropTypes.number
118
141
  };
119
142
  RatingsInput.defaultProps = {
120
143
  labelMin: 'not satisfied.',
121
- labelMax: 'very satisfied.',
122
- labelColor: 'main2'
144
+ labelMax: 'very satisfied.'
123
145
  };
124
146
  export default /*#__PURE__*/memo(RatingsInput);
@@ -41,7 +41,7 @@ const Rating = ({
41
41
  onMouseEnter: () => setHover(value),
42
42
  onMouseLeave: () => setHover(null)
43
43
  }, showRatingValue && /*#__PURE__*/React.createElement("span", {
44
- className: "v25 mb-v md-s-1 s-2 x-metadata c-x"
44
+ className: "s-2 x-metadata c-x"
45
45
  }, value), /*#__PURE__*/React.createElement("span", {
46
46
  className: ['icon', value <= (hover || Number(field.value)) ? 'c-x' : 'c-hard-y'].filter(e => e).join(' ')
47
47
  }, "[")), /*#__PURE__*/React.createElement("input", _extends({}, field, {
@@ -102,8 +102,8 @@ Rating.propTypes = {
102
102
  validate: PropTypes.func
103
103
  };
104
104
  Rating.defaultProps = {
105
- activeBackgroundColor: 'main',
106
- inactiveBackgroundColor: 'background-far',
105
+ activeBackgroundColor: 'interactive',
106
+ inactiveBackgroundColor: 'background-inputs',
107
107
  showRatingValue: false
108
108
  };
109
109
  export default Rating;
@@ -1,37 +1,32 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
 
3
3
  @use "@pareto-engineering/bem";
4
+ @use "@pareto-engineering/styles/src/mixins";
5
+ @use "@pareto-engineering/styles/src/globals" as *;
4
6
 
5
7
  $default-rating-icon-margin: .5em;
6
8
  $default-padding: .2em;
7
9
  $default-transition: all .2s;
8
10
 
9
11
  .#{bem.$base}.ratings-input {
10
- display: flex;
11
- flex-direction: column;
12
-
13
- p {
14
- padding: $default-padding;
15
- }
16
-
17
- .stars {
12
+ &.stars {
18
13
  display: flex;
19
14
 
20
15
  >:not(:last-child) {
21
16
  margin-right: $default-rating-icon-margin;
22
17
  }
23
18
 
24
- .#{bem.$base}.rating {
19
+ > .#{bem.$base}.rating {
25
20
  display: flex;
26
21
 
27
- input {
22
+ > input {
28
23
  opacity: 0;
29
24
  position: absolute;
30
25
  visibility: none;
31
26
  z-index: -1;
32
27
  }
33
28
 
34
- label {
29
+ > label {
35
30
  align-items: center;
36
31
  cursor: pointer;
37
32
  display: flex;
@@ -47,5 +42,3 @@ $default-transition: all .2s;
47
42
  }
48
43
  }
49
44
  }
50
-
51
-
@@ -6,7 +6,7 @@ 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 } from "../../common";
9
+ import { FormLabel, FormDescription, InputWrapper } from "../../common";
10
10
 
11
11
  // Local Definitions
12
12
 
@@ -22,6 +22,7 @@ const SelectInput = ({
22
22
  style,
23
23
  name,
24
24
  label,
25
+ labelColor,
25
26
  color,
26
27
  options,
27
28
  validate,
@@ -29,7 +30,11 @@ const SelectInput = ({
29
30
  description,
30
31
  disabled,
31
32
  isLoading,
32
- autoComplete
33
+ autoComplete,
34
+ labelSpan,
35
+ desktopLabelSpan,
36
+ inputSpan,
37
+ desktopInputSpan
33
38
  // ...otherProps
34
39
  }) => {
35
40
  useInsertionEffect(() => {
@@ -39,18 +44,23 @@ const SelectInput = ({
39
44
  name,
40
45
  validate
41
46
  });
42
- return /*#__PURE__*/React.createElement("div", {
43
- id: id,
44
- className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
45
- style: style
46
- // {...otherProps}
47
- }, /*#__PURE__*/React.createElement(FormLabel, {
47
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
48
48
  name: name,
49
- optional: optional
50
- }, label), /*#__PURE__*/React.createElement("div", {
51
- className: "select-wrapper with-faded-border"
49
+ color: labelColor,
50
+ optional: optional,
51
+ columnSpan: labelSpan,
52
+ desktopColumnSpan: desktopLabelSpan
53
+ // {...otherProps}
54
+ }, label), /*#__PURE__*/React.createElement(InputWrapper, {
55
+ id: id,
56
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
57
+ style: style,
58
+ columnSpan: inputSpan,
59
+ desktopColumnSpan: desktopInputSpan
60
+ }, /*#__PURE__*/React.createElement("div", {
61
+ className: `select-wrapper${disabled ? ' disabled' : ''}`
52
62
  }, /*#__PURE__*/React.createElement("select", _extends({
53
- className: "input"
63
+ className: `input y-${color}`
54
64
  }, field, {
55
65
  value: field.value || '',
56
66
  id: name,
@@ -68,12 +78,12 @@ const SelectInput = ({
68
78
  disabled: newOption?.disabled || false
69
79
  }, newOption.label);
70
80
  })), isLoading && /*#__PURE__*/React.createElement(LoadingCircle, {
71
- className: "x-main2"
81
+ className: "x-main"
72
82
  })), /*#__PURE__*/React.createElement(FormDescription, {
73
- className: "v50 mt-v s-1",
83
+ className: "s-1",
74
84
  description: description,
75
85
  name: name
76
- }));
86
+ })));
77
87
  };
78
88
  SelectInput.propTypes = {
79
89
  /**
@@ -120,6 +130,10 @@ SelectInput.propTypes = {
120
130
  * The color of the select input
121
131
  */
122
132
  color: PropTypes.string,
133
+ /**
134
+ * The color of the select input label
135
+ */
136
+ labelColor: PropTypes.string,
123
137
  /*
124
138
  * Whether the query that is fetching the select options is still in flight
125
139
  */
@@ -129,12 +143,28 @@ SelectInput.propTypes = {
129
143
  */
130
144
  autoComplete: PropTypes.string,
131
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,
161
+ /**
132
162
  * Whether the input is optional or not
133
163
  */
134
164
  optional: PropTypes.bool
135
165
  };
136
166
  SelectInput.defaultProps = {
137
167
  disabled: false,
138
- color: 'interactive'
168
+ color: 'paragraph'
139
169
  };
140
170
  export default /*#__PURE__*/memo(SelectInput);