@pareto-engineering/design-system 4.0.0-alpha.35 → 4.0.0-alpha.37

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 +41 -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 +41 -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 +2 -2
  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 +41 -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
@@ -15,6 +15,8 @@ import { Popover, LoadingCircle } from 'ui/a'
15
15
 
16
16
  import { FormDescription, FormLabel } from 'ui/f'
17
17
 
18
+ import { InputWrapper } from '../../../../common'
19
+
18
20
  // Local Definitions
19
21
 
20
22
  import { Menu } from '../Menu'
@@ -42,6 +44,7 @@ const MultipleCombobox = ({
42
44
  className:userClassName,
43
45
  style,
44
46
  label,
47
+ labelColor,
45
48
  name,
46
49
  optional,
47
50
  options:items,
@@ -54,6 +57,10 @@ const MultipleCombobox = ({
54
57
  minLength,
55
58
  transformSearch,
56
59
  disabled,
60
+ labelSpan,
61
+ desktopLabelSpan,
62
+ inputSpan,
63
+ desktopInputSpan,
57
64
  // ...otherProps
58
65
  }) => {
59
66
  const [searchInputValue, setSearchInputValue] = useState('')
@@ -150,54 +157,63 @@ const MultipleCombobox = ({
150
157
  const resetInputValue = () => setInputValue('')
151
158
 
152
159
  return (
153
- <div
154
- id={id}
155
- className={[
156
-
157
- baseClassName,
158
-
159
- componentClassName,
160
- userClassName,
161
- `y-${color}`,
162
- ]
163
- .filter((e) => e)
164
- .join(' ')}
165
- style={style}
166
- >
167
-
160
+ <>
168
161
  <FormLabel
162
+ className={[
163
+ baseClassName,
164
+ componentClassName,
165
+ ]
166
+ .filter((e) => e)
167
+ .join(' ')}
169
168
  {...getLabelProps()}
170
169
  name={name}
171
170
  optional={optional}
171
+ color={labelColor}
172
+ columnSpan={labelSpan}
173
+ desktopColumnSpan={desktopLabelSpan}
172
174
  >
173
175
  {label}
174
176
  </FormLabel>
175
177
 
176
- {selectedItems?.length > 0 && (
177
- <div className="selected-items">
178
- {selectedItems.map((selectedItem, index) => (
179
- <div
180
- key={selectedItem.label}
181
- {...getSelectedItemProps({ selectedItem, index })}
182
- className="item"
183
- >
184
- <Button
185
- onClick={(e) => {
186
- e.stopPropagation()
187
- removeSelectedItem(selectedItem)
188
- }}
189
- isCompact
190
- isSimple
191
- color={color}
192
- >
193
- <span className="v25 mr-v">{selectedItem.label}</span>
194
- <span className="icon close">Y</span>
195
- </Button>
178
+ <InputWrapper
179
+ id={id}
180
+ className={[
181
+ baseClassName,
182
+ componentClassName,
183
+ userClassName,
184
+ ]
185
+ .filter((e) => e)
186
+ .join(' ')}
187
+ style={style}
188
+ ref={parentRef}
189
+ columnSpan={inputSpan}
190
+ desktopColumnSpan={desktopInputSpan}
191
+ {...getComboboxProps()}
192
+ >
193
+ {selectedItems?.length > 0 && (
194
+ <div className="selected-items">
195
+ {selectedItems.map((selectedItem, index) => (
196
+ <div
197
+ key={selectedItem.label}
198
+ {...getSelectedItemProps({ selectedItem, index })}
199
+ className="item"
200
+ >
201
+ <Button
202
+ onClick={(e) => {
203
+ e.stopPropagation()
204
+ removeSelectedItem(selectedItem)
205
+ }}
206
+ isCompact
207
+ color={color}
208
+ >
209
+ <span>{selectedItem.label}</span>
210
+ <span className="icon close">Y</span>
211
+ </Button>
212
+ </div>
213
+ ))}
196
214
  </div>
197
- ))}
198
- </div>
199
- )}
200
- <div {...getComboboxProps()} className="input-wrapper">
215
+ )}
216
+
201
217
  <input
202
218
  {...getInputProps(
203
219
  getDropdownProps({ preventKeyAction: isOpen }),
@@ -206,38 +222,37 @@ const MultipleCombobox = ({
206
222
  disabled={disabled}
207
223
  />
208
224
  {isFetching && (
209
- <LoadingCircle className="x-main2" />
225
+ <LoadingCircle className="x-main" />
210
226
  )}
211
227
  {inputValue.length > minLength && !isFetching && (
212
- <Button
213
- isSimple
214
- isCompact
215
- color="main2"
216
- onClick={resetInputValue}
217
- >
218
- <span className="icon">
219
- Y
220
- </span>
221
- </Button>
228
+ <Button
229
+ isSimple
230
+ isCompact
231
+ color="interactive"
232
+ onClick={resetInputValue}
233
+ >
234
+ <span className="icon">
235
+ Y
236
+ </span>
237
+ </Button>
222
238
  )}
223
- </div>
224
239
 
225
- <Popover
226
- isOpen={isOpen}
227
- parentRef={parentRef}
228
- >
229
- <Menu
240
+ <FormDescription className="s-1" description={description} name={name} />
241
+ <Popover
230
242
  isOpen={isOpen}
231
- getItemProps={getItemProps}
232
- highlightedIndex={highlightedIndex}
233
- items={getFilteredItems()}
234
- {...getMenuProps()}
235
- />
236
- </Popover>
237
-
238
- <FormDescription className="v50 mt-v s-1" description={description} name={name} />
239
-
240
- </div>
243
+ parentRef={parentRef}
244
+ >
245
+ <Menu
246
+ className={`y-${color}`}
247
+ isOpen={isOpen}
248
+ getItemProps={getItemProps}
249
+ highlightedIndex={highlightedIndex}
250
+ items={getFilteredItems()}
251
+ {...getMenuProps()}
252
+ />
253
+ </Popover>
254
+ </InputWrapper>
255
+ </>
241
256
  )
242
257
  }
243
258
 
@@ -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(--background-inputs);
17
+ $disabled-background: var(--background-inputs-30);
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);
@@ -22,6 +22,7 @@ const QuerySelect = ({
22
22
  style,
23
23
  name,
24
24
  label,
25
+ labelColor,
25
26
  optional,
26
27
  query,
27
28
  variables,
@@ -32,6 +33,10 @@ const QuerySelect = ({
32
33
  loadingOption,
33
34
  defaultOption,
34
35
  validate,
36
+ labelSpan,
37
+ desktopLabelSpan,
38
+ inputSpan,
39
+ desktopInputSpan,
35
40
  // ...otherProps
36
41
  }) => {
37
42
  const [, , helpers] = useField({ name, validate })
@@ -91,10 +96,15 @@ const QuerySelect = ({
91
96
  label={label}
92
97
  optional={optional}
93
98
  color={color}
99
+ labelColor={labelColor}
94
100
  description={description}
95
101
  disabled={isFetching || disabled}
96
102
  options={options}
97
103
  isLoading={isFetching}
104
+ labelSpan={labelSpan}
105
+ desktopLabelSpan={desktopLabelSpan}
106
+ inputSpan={inputSpan}
107
+ desktopInputSpan={desktopInputSpan}
98
108
  />
99
109
  )
100
110
  }
@@ -140,6 +150,11 @@ QuerySelect.propTypes = {
140
150
  */
141
151
  color:PropTypes.string,
142
152
 
153
+ /**
154
+ * The label color of the custom select input
155
+ */
156
+ labelColor:PropTypes.string,
157
+
143
158
  /**
144
159
  * The graphql query to fetch the options and the accessor to destructure the results from
145
160
  */
@@ -197,7 +212,7 @@ QuerySelect.propTypes = {
197
212
 
198
213
  QuerySelect.defaultProps = {
199
214
  disabled :false,
200
- color :'background-far',
215
+ color :'paragraph',
201
216
  defaultOption:{
202
217
  value :'',
203
218
  label :'Select an option',
@@ -10,7 +10,7 @@ import styleNames from '@pareto-engineering/bem/exports'
10
10
  // Local Definitions
11
11
 
12
12
  import { Rating } from './common'
13
- import { FormLabel } from '../../common'
13
+ import { FormLabel, InputWrapper } from '../../common'
14
14
 
15
15
  const baseClassName = styleNames.base
16
16
 
@@ -26,13 +26,17 @@ const RatingsInput = ({
26
26
  name,
27
27
  ratingCount,
28
28
  showRatingValue,
29
- oneInputLabel,
29
+ color,
30
30
  label,
31
31
  labelColor,
32
32
  labelMax,
33
33
  labelMin,
34
34
  displayRatingsLabel,
35
35
  optional,
36
+ labelSpan,
37
+ desktopLabelSpan,
38
+ inputSpan,
39
+ desktopInputSpan,
36
40
  // ...otherProps
37
41
  }) => {
38
42
  useInsertionEffect(() => {
@@ -42,30 +46,32 @@ const RatingsInput = ({
42
46
  const [hover, setHover] = useState(null)
43
47
 
44
48
  return (
45
- <div
46
- id={id}
47
- className={[
48
- baseClassName,
49
- componentClassName,
50
- userClassName,
51
- ]
52
- .filter((e) => e)
53
- .join(' ')}
54
- style={style}
55
- >
49
+ <>
56
50
  <FormLabel
57
- className={[
58
- 'input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
59
- .filter((e) => e)
60
- .join(' ')}
61
51
  name={name}
62
52
  color={labelColor}
63
53
  optional={optional}
54
+ columnSpan={labelSpan}
55
+ desktopColumnSpan={desktopLabelSpan}
56
+ // {...otherProps}
64
57
  >
65
- { label }
58
+ {label}
66
59
  </FormLabel>
67
- <div className="stars">
68
- {displayRatingsLabel && <p className="label-text md-s-1 s-2 x-metadata c-x">{labelMin}</p>}
60
+ <InputWrapper
61
+ id={id}
62
+ className={[
63
+ baseClassName,
64
+ componentClassName,
65
+ userClassName,
66
+ 'stars',
67
+ ]
68
+ .filter((e) => e)
69
+ .join(' ')}
70
+ style={style}
71
+ columnSpan={inputSpan}
72
+ desktopColumnSpan={desktopInputSpan}
73
+ >
74
+ {displayRatingsLabel && <p className="label-text s-2 x-metadata c-x">{labelMin}</p>}
69
75
  {[...Array(ratingCount)].map((_, index) => {
70
76
  const ratingValue = index + 1
71
77
  return (
@@ -77,12 +83,13 @@ const RatingsInput = ({
77
83
  hover={hover}
78
84
  setHover={setHover}
79
85
  showRatingValue={showRatingValue}
86
+ activeBackgroundColor={color}
80
87
  />
81
88
  )
82
89
  })}
83
- {displayRatingsLabel && <p className="label-text md-s-1 s-2 x-metadata c-x">{labelMax}</p>}
84
- </div>
85
- </div>
90
+ {displayRatingsLabel && <p className="label-text s-2 x-metadata c-x">{labelMax}</p>}
91
+ </InputWrapper>
92
+ </>
86
93
  )
87
94
  }
88
95
 
@@ -134,21 +141,41 @@ RatingsInput.propTypes = {
134
141
  * Whether the input is optional or not
135
142
  */
136
143
  optional :PropTypes.bool,
144
+
137
145
  /**
138
- * If the slide will only have one input
146
+ * The color of the stars
139
147
  */
140
- oneInputLabel :PropTypes.bool,
148
+ color:PropTypes.string,
141
149
 
142
150
  /**
143
151
  * String that will represent color for the label
144
152
  */
145
153
  labelColor:PropTypes.string,
154
+
155
+ /**
156
+ * The number of columns the label should span
157
+ */
158
+ labelSpan:PropTypes.number,
159
+
160
+ /**
161
+ * The number of columns the input should span
162
+ */
163
+ inputSpan:PropTypes.number,
164
+
165
+ /**
166
+ * The number of columns the label should span on desktop
167
+ */
168
+ desktopLabelSpan:PropTypes.number,
169
+
170
+ /**
171
+ * The number of columns the input should span on desktop
172
+ */
173
+ desktopInputSpan:PropTypes.number,
146
174
  }
147
175
 
148
176
  RatingsInput.defaultProps = {
149
- labelMin :'not satisfied.',
150
- labelMax :'very satisfied.',
151
- labelColor:'main2',
177
+ labelMin:'not satisfied.',
178
+ labelMax:'very satisfied.',
152
179
  }
153
180
 
154
181
  export default memo(RatingsInput)
@@ -53,7 +53,7 @@ const Rating = ({
53
53
  onMouseLeave={() => setHover(null)}
54
54
  >
55
55
  {showRatingValue && (
56
- <span className="v25 mb-v md-s-1 s-2 x-metadata c-x">
56
+ <span className="s-2 x-metadata c-x">
57
57
  {value}
58
58
  </span>
59
59
  )}
@@ -134,8 +134,8 @@ Rating.propTypes = {
134
134
  }
135
135
 
136
136
  Rating.defaultProps = {
137
- activeBackgroundColor :'main',
138
- inactiveBackgroundColor:'background-far',
137
+ activeBackgroundColor :'interactive',
138
+ inactiveBackgroundColor:'background-inputs',
139
139
  showRatingValue :false,
140
140
  }
141
141
 
@@ -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
-