@alfalab/core-components-slider-input 7.1.22 → 7.2.1

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.
package/Component.d.ts CHANGED
@@ -85,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
85
85
  */
86
86
  dataTestId?: string;
87
87
  };
88
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "bottomAddons" | "max" | "min"> & {
88
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "max" | "min" | "bottomAddons"> & {
89
89
  /**
90
90
  * Мин. допустимое число
91
91
  */
package/Component.js CHANGED
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
15
15
 
16
- var styles = {"component":"slider-input__component_1cxc9","block":"slider-input__block_1cxc9","slider":"slider-input__slider_1cxc9","xl":"slider-input__xl_1cxc9","hidePips":"slider-input__hidePips_1cxc9","field":"slider-input__field_1cxc9","s":"slider-input__s_1cxc9","m":"slider-input__m_1cxc9","l":"slider-input__l_1cxc9","input":"slider-input__input_1cxc9","steps":"slider-input__steps_1cxc9","info":"slider-input__info_1cxc9","hasLabel":"slider-input__hasLabel_1cxc9","focused":"slider-input__focused_1cxc9","filled":"slider-input__filled_1cxc9"};
16
+ var styles = {"component":"slider-input__component_dxuku","block":"slider-input__block_dxuku","slider":"slider-input__slider_dxuku","xl":"slider-input__xl_dxuku","hidePips":"slider-input__hidePips_dxuku","field":"slider-input__field_dxuku","s":"slider-input__s_dxuku","m":"slider-input__m_dxuku","l":"slider-input__l_dxuku","input":"slider-input__input_dxuku","steps":"slider-input__steps_dxuku","info":"slider-input__info_dxuku","hasLabel":"slider-input__hasLabel_dxuku","focused":"slider-input__focused_dxuku","filled":"slider-input__filled_dxuku"};
17
17
  require('./index.css')
18
18
 
19
19
  var SliderInput = React.forwardRef(function (_a, ref) {
@@ -85,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
85
85
  */
86
86
  dataTestId?: string;
87
87
  };
88
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "bottomAddons" | "max" | "min"> & {
88
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "max" | "min" | "bottomAddons"> & {
89
89
  /**
90
90
  * Мин. допустимое число
91
91
  */
@@ -48,6 +48,22 @@
48
48
  /* font */
49
49
 
50
50
  /* border-radius */
51
+
52
+ /* paddings mobile */
53
+
54
+ /* border-radius mobile */
55
+
56
+ /* color mobile */
57
+
58
+ /* disabled mobile */
59
+
60
+ /* hover mobile */
61
+
62
+ /* focus mobile */
63
+
64
+ /* error mobile */
65
+
66
+ /* border-bottom mobile */
51
67
  } :root {
52
68
  --slider-input-steps-color: var(--color-light-text-secondary);
53
69
  --slider-input-info-color: var(--color-light-text-secondary);
@@ -85,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
85
85
  */
86
86
  dataTestId?: string;
87
87
  };
88
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "bottomAddons" | "max" | "min"> & {
88
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "max" | "min" | "bottomAddons"> & {
89
89
  /**
90
90
  * Мин. допустимое число
91
91
  */
package/esm/Component.js CHANGED
@@ -4,7 +4,7 @@ import cn from 'classnames';
4
4
  import { Input } from '@alfalab/core-components-input/esm';
5
5
  import { Slider } from '@alfalab/core-components-slider/esm';
6
6
 
7
- var styles = {"component":"slider-input__component_1cxc9","block":"slider-input__block_1cxc9","slider":"slider-input__slider_1cxc9","xl":"slider-input__xl_1cxc9","hidePips":"slider-input__hidePips_1cxc9","field":"slider-input__field_1cxc9","s":"slider-input__s_1cxc9","m":"slider-input__m_1cxc9","l":"slider-input__l_1cxc9","input":"slider-input__input_1cxc9","steps":"slider-input__steps_1cxc9","info":"slider-input__info_1cxc9","hasLabel":"slider-input__hasLabel_1cxc9","focused":"slider-input__focused_1cxc9","filled":"slider-input__filled_1cxc9"};
7
+ var styles = {"component":"slider-input__component_dxuku","block":"slider-input__block_dxuku","slider":"slider-input__slider_dxuku","xl":"slider-input__xl_dxuku","hidePips":"slider-input__hidePips_dxuku","field":"slider-input__field_dxuku","s":"slider-input__s_dxuku","m":"slider-input__m_dxuku","l":"slider-input__l_dxuku","input":"slider-input__input_dxuku","steps":"slider-input__steps_dxuku","info":"slider-input__info_dxuku","hasLabel":"slider-input__hasLabel_dxuku","focused":"slider-input__focused_dxuku","filled":"slider-input__filled_dxuku"};
8
8
  require('./index.css')
9
9
 
10
10
  var SliderInput = forwardRef(function (_a, ref) {
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 3snc1 */
1
+ /* hash: axnid */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-secondary: #86868a;
@@ -49,6 +49,22 @@
49
49
  /* font */
50
50
 
51
51
  /* border-radius */
52
+
53
+ /* paddings mobile */
54
+
55
+ /* border-radius mobile */
56
+
57
+ /* color mobile */
58
+
59
+ /* disabled mobile */
60
+
61
+ /* hover mobile */
62
+
63
+ /* focus mobile */
64
+
65
+ /* error mobile */
66
+
67
+ /* border-bottom mobile */
52
68
  } :root {
53
69
  --slider-input-steps-color: var(--color-light-text-secondary);
54
70
  --slider-input-info-color: var(--color-light-text-secondary);
@@ -64,58 +80,57 @@
64
80
  --slider-input-progress-hover-bg-color: var(--color-light-graphic-secondary);
65
81
  --slider-input-origin-width: calc(100% - 16px);
66
82
  --slider-input-origin-right: 8px;
67
- } .slider-input__component_1cxc9 {
83
+ } .slider-input__component_dxuku {
68
84
  position: relative;
69
85
  display: inline-block;
70
- } .slider-input__block_1cxc9 {
86
+ } .slider-input__block_dxuku {
71
87
  display: block;
72
- } .slider-input__slider_1cxc9 {
88
+ } .slider-input__slider_dxuku {
73
89
  width: calc(100% - var(--slider-input-progress-margin-horizontal) * 2);
74
90
  margin-left: var(--slider-input-progress-margin-horizontal);
75
91
  margin-right: var(--slider-input-progress-margin-horizontal);
76
92
  margin-top: calc(var(--slider-progress-s-height) / -2);
77
93
  transform: translateY(-1px)
78
- } .slider-input__slider_1cxc9.slider-input__xl_1cxc9 {
94
+ } .slider-input__slider_dxuku.slider-input__xl_dxuku {
79
95
  width: calc(100% - var(--slider-input-xl-progress-margin-horizontal) * 2);
80
96
  margin-left: var(--slider-input-xl-progress-margin-horizontal);
81
97
  margin-right: var(--slider-input-xl-progress-margin-horizontal);
82
- } .slider-input__slider_1cxc9 .noUi-base {
98
+ } .slider-input__slider_dxuku .noUi-base {
83
99
  border-radius: var(--slider-input-progress-border-radius);
84
- } .slider-input__slider_1cxc9 .noUi-base:hover > .noUi-connects {
100
+ } .slider-input__slider_dxuku .noUi-base:hover > .noUi-connects {
85
101
  background-color: var(--slider-input-progress-hover-bg-color);
86
- } .slider-input__slider_1cxc9 .noUi-connects {
102
+ } .slider-input__slider_dxuku .noUi-connects {
87
103
  border-radius: var(--slider-input-progress-border-radius);
88
104
  background-color: var(--slider-input-progress-bg-color);
89
- } .slider-input__slider_1cxc9 .noUi-origin {
105
+ } .slider-input__slider_dxuku .noUi-origin {
90
106
  width: var(--slider-input-origin-width);
91
107
  right: var(--slider-input-origin-right);
92
- } .slider-input__slider_1cxc9 {
108
+ } .slider-input__slider_dxuku {
93
109
 
94
110
  /* TODO исправить на 6px когда слайдеру добавят position: absolute */
95
- } .slider-input__slider_1cxc9 + * {
111
+ } .slider-input__slider_dxuku + * {
96
112
  margin-top: 5px;
97
- } .slider-input__hidePips_1cxc9 .noUi-pips {
113
+ } .slider-input__hidePips_dxuku .noUi-pips {
98
114
  display: none;
99
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__s_1cxc9 {
115
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__s_dxuku {
100
116
  border-bottom-left-radius: var(--slider-input-s-border-bottom-radius);
101
117
  border-bottom-right-radius: var(--slider-input-s-border-bottom-radius);
102
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__m_1cxc9 {
118
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__m_dxuku {
103
119
  border-bottom-left-radius: var(--slider-input-m-border-bottom-radius);
104
120
  border-bottom-right-radius: var(--slider-input-m-border-bottom-radius);
105
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__l_1cxc9 {
121
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__l_dxuku {
106
122
  border-bottom-left-radius: var(--slider-input-l-border-bottom-radius);
107
123
  border-bottom-right-radius: var(--slider-input-l-border-bottom-radius);
108
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__xl_1cxc9 {
124
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__xl_dxuku {
109
125
  border-bottom-left-radius: var(--slider-input-xl-border-bottom-radius);
110
126
  border-bottom-right-radius: var(--slider-input-xl-border-bottom-radius);
111
- } .slider-input__input_1cxc9 input,
112
- .slider-input__input_1cxc9 input + div {
127
+ } .slider-input__input_dxuku input,
128
+ .slider-input__input_dxuku input + div {
113
129
  font-weight: var(--slider-input-font-weight);
114
- font-feature-settings: "tnum";
115
130
  font-variant-numeric: tabular-nums;
116
- } .slider-input__input_1cxc9 input::placeholder {
131
+ } .slider-input__input_dxuku input::placeholder {
117
132
  font-weight: 400;
118
- } .slider-input__steps_1cxc9 {
133
+ } .slider-input__steps_dxuku {
119
134
  font-size: 14px;
120
135
  line-height: 18px;
121
136
  font-weight: 400;
@@ -124,7 +139,7 @@
124
139
  justify-content: space-between;
125
140
  margin-top: var(--gap-xs);
126
141
  color: var(--slider-input-steps-color);
127
- } .slider-input__info_1cxc9 {
142
+ } .slider-input__info_dxuku {
128
143
  font-size: 16px;
129
144
  line-height: 20px;
130
145
  font-weight: 400;
@@ -134,24 +149,24 @@
134
149
  opacity: 0;
135
150
  transition: 0.2s ease;
136
151
  visibility: hidden;
137
- } .slider-input__s_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
152
+ } .slider-input__s_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
138
153
  padding: var(--form-control-labeled-s-paddings);
139
154
  padding-left: 0;
140
155
  padding-right: 0;
141
- } .slider-input__m_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
156
+ } .slider-input__m_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
142
157
  padding: var(--form-control-labeled-m-paddings);
143
158
  padding-left: 0;
144
159
  padding-right: 0;
145
- } .slider-input__l_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
160
+ } .slider-input__l_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
146
161
  padding: var(--form-control-labeled-l-paddings);
147
162
  padding-left: 0;
148
163
  padding-right: 0;
149
- } .slider-input__xl_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
164
+ } .slider-input__xl_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
150
165
  padding: var(--form-control-labeled-xl-paddings);
151
166
  padding-left: 0;
152
167
  padding-right: 0;
153
- } .slider-input__focused_1cxc9 .slider-input__info_1cxc9,
154
- .slider-input__filled_1cxc9 .slider-input__info_1cxc9 {
168
+ } .slider-input__focused_dxuku .slider-input__info_dxuku,
169
+ .slider-input__filled_dxuku .slider-input__info_dxuku {
155
170
  visibility: visible;
156
171
  opacity: 1;
157
172
  }
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 3snc1 */
1
+ /* hash: axnid */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-secondary: #86868a;
@@ -49,6 +49,22 @@
49
49
  /* font */
50
50
 
51
51
  /* border-radius */
52
+
53
+ /* paddings mobile */
54
+
55
+ /* border-radius mobile */
56
+
57
+ /* color mobile */
58
+
59
+ /* disabled mobile */
60
+
61
+ /* hover mobile */
62
+
63
+ /* focus mobile */
64
+
65
+ /* error mobile */
66
+
67
+ /* border-bottom mobile */
52
68
  } :root {
53
69
  --slider-input-steps-color: var(--color-light-text-secondary);
54
70
  --slider-input-info-color: var(--color-light-text-secondary);
@@ -64,58 +80,57 @@
64
80
  --slider-input-progress-hover-bg-color: var(--color-light-graphic-secondary);
65
81
  --slider-input-origin-width: calc(100% - 16px);
66
82
  --slider-input-origin-right: 8px;
67
- } .slider-input__component_1cxc9 {
83
+ } .slider-input__component_dxuku {
68
84
  position: relative;
69
85
  display: inline-block;
70
- } .slider-input__block_1cxc9 {
86
+ } .slider-input__block_dxuku {
71
87
  display: block;
72
- } .slider-input__slider_1cxc9 {
88
+ } .slider-input__slider_dxuku {
73
89
  width: calc(100% - var(--slider-input-progress-margin-horizontal) * 2);
74
90
  margin-left: var(--slider-input-progress-margin-horizontal);
75
91
  margin-right: var(--slider-input-progress-margin-horizontal);
76
92
  margin-top: calc(var(--slider-progress-s-height) / -2);
77
93
  transform: translateY(-1px)
78
- } .slider-input__slider_1cxc9.slider-input__xl_1cxc9 {
94
+ } .slider-input__slider_dxuku.slider-input__xl_dxuku {
79
95
  width: calc(100% - var(--slider-input-xl-progress-margin-horizontal) * 2);
80
96
  margin-left: var(--slider-input-xl-progress-margin-horizontal);
81
97
  margin-right: var(--slider-input-xl-progress-margin-horizontal);
82
- } .slider-input__slider_1cxc9 .noUi-base {
98
+ } .slider-input__slider_dxuku .noUi-base {
83
99
  border-radius: var(--slider-input-progress-border-radius);
84
- } .slider-input__slider_1cxc9 .noUi-base:hover > .noUi-connects {
100
+ } .slider-input__slider_dxuku .noUi-base:hover > .noUi-connects {
85
101
  background-color: var(--slider-input-progress-hover-bg-color);
86
- } .slider-input__slider_1cxc9 .noUi-connects {
102
+ } .slider-input__slider_dxuku .noUi-connects {
87
103
  border-radius: var(--slider-input-progress-border-radius);
88
104
  background-color: var(--slider-input-progress-bg-color);
89
- } .slider-input__slider_1cxc9 .noUi-origin {
105
+ } .slider-input__slider_dxuku .noUi-origin {
90
106
  width: var(--slider-input-origin-width);
91
107
  right: var(--slider-input-origin-right);
92
- } .slider-input__slider_1cxc9 {
108
+ } .slider-input__slider_dxuku {
93
109
 
94
110
  /* TODO исправить на 6px когда слайдеру добавят position: absolute */
95
- } .slider-input__slider_1cxc9 + * {
111
+ } .slider-input__slider_dxuku + * {
96
112
  margin-top: 5px;
97
- } .slider-input__hidePips_1cxc9 .noUi-pips {
113
+ } .slider-input__hidePips_dxuku .noUi-pips {
98
114
  display: none;
99
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__s_1cxc9 {
115
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__s_dxuku {
100
116
  border-bottom-left-radius: var(--slider-input-s-border-bottom-radius);
101
117
  border-bottom-right-radius: var(--slider-input-s-border-bottom-radius);
102
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__m_1cxc9 {
118
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__m_dxuku {
103
119
  border-bottom-left-radius: var(--slider-input-m-border-bottom-radius);
104
120
  border-bottom-right-radius: var(--slider-input-m-border-bottom-radius);
105
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__l_1cxc9 {
121
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__l_dxuku {
106
122
  border-bottom-left-radius: var(--slider-input-l-border-bottom-radius);
107
123
  border-bottom-right-radius: var(--slider-input-l-border-bottom-radius);
108
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__xl_1cxc9 {
124
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__xl_dxuku {
109
125
  border-bottom-left-radius: var(--slider-input-xl-border-bottom-radius);
110
126
  border-bottom-right-radius: var(--slider-input-xl-border-bottom-radius);
111
- } .slider-input__input_1cxc9 input,
112
- .slider-input__input_1cxc9 input + div {
127
+ } .slider-input__input_dxuku input,
128
+ .slider-input__input_dxuku input + div {
113
129
  font-weight: var(--slider-input-font-weight);
114
- font-feature-settings: "tnum";
115
130
  font-variant-numeric: tabular-nums;
116
- } .slider-input__input_1cxc9 input::placeholder {
131
+ } .slider-input__input_dxuku input::placeholder {
117
132
  font-weight: 400;
118
- } .slider-input__steps_1cxc9 {
133
+ } .slider-input__steps_dxuku {
119
134
  font-size: 14px;
120
135
  line-height: 18px;
121
136
  font-weight: 400;
@@ -124,7 +139,7 @@
124
139
  justify-content: space-between;
125
140
  margin-top: var(--gap-xs);
126
141
  color: var(--slider-input-steps-color);
127
- } .slider-input__info_1cxc9 {
142
+ } .slider-input__info_dxuku {
128
143
  font-size: 16px;
129
144
  line-height: 20px;
130
145
  font-weight: 400;
@@ -134,24 +149,24 @@
134
149
  opacity: 0;
135
150
  transition: 0.2s ease;
136
151
  visibility: hidden;
137
- } .slider-input__s_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
152
+ } .slider-input__s_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
138
153
  padding: var(--form-control-labeled-s-paddings);
139
154
  padding-left: 0;
140
155
  padding-right: 0;
141
- } .slider-input__m_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
156
+ } .slider-input__m_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
142
157
  padding: var(--form-control-labeled-m-paddings);
143
158
  padding-left: 0;
144
159
  padding-right: 0;
145
- } .slider-input__l_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
160
+ } .slider-input__l_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
146
161
  padding: var(--form-control-labeled-l-paddings);
147
162
  padding-left: 0;
148
163
  padding-right: 0;
149
- } .slider-input__xl_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
164
+ } .slider-input__xl_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
150
165
  padding: var(--form-control-labeled-xl-paddings);
151
166
  padding-left: 0;
152
167
  padding-right: 0;
153
- } .slider-input__focused_1cxc9 .slider-input__info_1cxc9,
154
- .slider-input__filled_1cxc9 .slider-input__info_1cxc9 {
168
+ } .slider-input__focused_dxuku .slider-input__info_dxuku,
169
+ .slider-input__filled_dxuku .slider-input__info_dxuku {
155
170
  visibility: visible;
156
171
  opacity: 1;
157
172
  }
@@ -85,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
85
85
  */
86
86
  dataTestId?: string;
87
87
  };
88
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "bottomAddons" | "max" | "min"> & {
88
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "step" | "max" | "min" | "bottomAddons"> & {
89
89
  /**
90
90
  * Мин. допустимое число
91
91
  */
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { Input } from '@alfalab/core-components-input/modern';
4
4
  import { Slider } from '@alfalab/core-components-slider/modern';
5
5
 
6
- const styles = {"component":"slider-input__component_1cxc9","block":"slider-input__block_1cxc9","slider":"slider-input__slider_1cxc9","xl":"slider-input__xl_1cxc9","hidePips":"slider-input__hidePips_1cxc9","field":"slider-input__field_1cxc9","s":"slider-input__s_1cxc9","m":"slider-input__m_1cxc9","l":"slider-input__l_1cxc9","input":"slider-input__input_1cxc9","steps":"slider-input__steps_1cxc9","info":"slider-input__info_1cxc9","hasLabel":"slider-input__hasLabel_1cxc9","focused":"slider-input__focused_1cxc9","filled":"slider-input__filled_1cxc9"};
6
+ const styles = {"component":"slider-input__component_dxuku","block":"slider-input__block_dxuku","slider":"slider-input__slider_dxuku","xl":"slider-input__xl_dxuku","hidePips":"slider-input__hidePips_dxuku","field":"slider-input__field_dxuku","s":"slider-input__s_dxuku","m":"slider-input__m_dxuku","l":"slider-input__l_dxuku","input":"slider-input__input_dxuku","steps":"slider-input__steps_dxuku","info":"slider-input__info_dxuku","hasLabel":"slider-input__hasLabel_dxuku","focused":"slider-input__focused_dxuku","filled":"slider-input__filled_dxuku"};
7
7
  require('./index.css')
8
8
 
9
9
  const SliderInput = forwardRef(({ className, inputClassName, sliderClassName, stepsClassName, focusedClassName, fieldClassName, value = '', min = 0, max = 100, step = 1, block, steps = [], sliderValue = +value, size = 's', label, info, disabled, readOnly, onChange, onInputChange, onSliderChange, rightAddons, Input: Input$1 = Input, customInputProps = {}, error, hint, pips, range, dataTestId, ...restProps }, ref) => {
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 3snc1 */
1
+ /* hash: axnid */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-graphic-secondary: #86868a;
@@ -49,6 +49,22 @@
49
49
  /* font */
50
50
 
51
51
  /* border-radius */
52
+
53
+ /* paddings mobile */
54
+
55
+ /* border-radius mobile */
56
+
57
+ /* color mobile */
58
+
59
+ /* disabled mobile */
60
+
61
+ /* hover mobile */
62
+
63
+ /* focus mobile */
64
+
65
+ /* error mobile */
66
+
67
+ /* border-bottom mobile */
52
68
  } :root {
53
69
  --slider-input-steps-color: var(--color-light-text-secondary);
54
70
  --slider-input-info-color: var(--color-light-text-secondary);
@@ -64,58 +80,57 @@
64
80
  --slider-input-progress-hover-bg-color: var(--color-light-graphic-secondary);
65
81
  --slider-input-origin-width: calc(100% - 16px);
66
82
  --slider-input-origin-right: 8px;
67
- } .slider-input__component_1cxc9 {
83
+ } .slider-input__component_dxuku {
68
84
  position: relative;
69
85
  display: inline-block;
70
- } .slider-input__block_1cxc9 {
86
+ } .slider-input__block_dxuku {
71
87
  display: block;
72
- } .slider-input__slider_1cxc9 {
88
+ } .slider-input__slider_dxuku {
73
89
  width: calc(100% - var(--slider-input-progress-margin-horizontal) * 2);
74
90
  margin-left: var(--slider-input-progress-margin-horizontal);
75
91
  margin-right: var(--slider-input-progress-margin-horizontal);
76
92
  margin-top: calc(var(--slider-progress-s-height) / -2);
77
93
  transform: translateY(-1px)
78
- } .slider-input__slider_1cxc9.slider-input__xl_1cxc9 {
94
+ } .slider-input__slider_dxuku.slider-input__xl_dxuku {
79
95
  width: calc(100% - var(--slider-input-xl-progress-margin-horizontal) * 2);
80
96
  margin-left: var(--slider-input-xl-progress-margin-horizontal);
81
97
  margin-right: var(--slider-input-xl-progress-margin-horizontal);
82
- } .slider-input__slider_1cxc9 .noUi-base {
98
+ } .slider-input__slider_dxuku .noUi-base {
83
99
  border-radius: var(--slider-input-progress-border-radius);
84
- } .slider-input__slider_1cxc9 .noUi-base:hover > .noUi-connects {
100
+ } .slider-input__slider_dxuku .noUi-base:hover > .noUi-connects {
85
101
  background-color: var(--slider-input-progress-hover-bg-color);
86
- } .slider-input__slider_1cxc9 .noUi-connects {
102
+ } .slider-input__slider_dxuku .noUi-connects {
87
103
  border-radius: var(--slider-input-progress-border-radius);
88
104
  background-color: var(--slider-input-progress-bg-color);
89
- } .slider-input__slider_1cxc9 .noUi-origin {
105
+ } .slider-input__slider_dxuku .noUi-origin {
90
106
  width: var(--slider-input-origin-width);
91
107
  right: var(--slider-input-origin-right);
92
- } .slider-input__slider_1cxc9 {
108
+ } .slider-input__slider_dxuku {
93
109
 
94
110
  /* TODO исправить на 6px когда слайдеру добавят position: absolute */
95
- } .slider-input__slider_1cxc9 + * {
111
+ } .slider-input__slider_dxuku + * {
96
112
  margin-top: 5px;
97
- } .slider-input__hidePips_1cxc9 .noUi-pips {
113
+ } .slider-input__hidePips_dxuku .noUi-pips {
98
114
  display: none;
99
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__s_1cxc9 {
115
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__s_dxuku {
100
116
  border-bottom-left-radius: var(--slider-input-s-border-bottom-radius);
101
117
  border-bottom-right-radius: var(--slider-input-s-border-bottom-radius);
102
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__m_1cxc9 {
118
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__m_dxuku {
103
119
  border-bottom-left-radius: var(--slider-input-m-border-bottom-radius);
104
120
  border-bottom-right-radius: var(--slider-input-m-border-bottom-radius);
105
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__l_1cxc9 {
121
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__l_dxuku {
106
122
  border-bottom-left-radius: var(--slider-input-l-border-bottom-radius);
107
123
  border-bottom-right-radius: var(--slider-input-l-border-bottom-radius);
108
- } .slider-input__component_1cxc9 .slider-input__field_1cxc9.slider-input__xl_1cxc9 {
124
+ } .slider-input__component_dxuku .slider-input__field_dxuku.slider-input__xl_dxuku {
109
125
  border-bottom-left-radius: var(--slider-input-xl-border-bottom-radius);
110
126
  border-bottom-right-radius: var(--slider-input-xl-border-bottom-radius);
111
- } .slider-input__input_1cxc9 input,
112
- .slider-input__input_1cxc9 input + div {
127
+ } .slider-input__input_dxuku input,
128
+ .slider-input__input_dxuku input + div {
113
129
  font-weight: var(--slider-input-font-weight);
114
- font-feature-settings: "tnum";
115
130
  font-variant-numeric: tabular-nums;
116
- } .slider-input__input_1cxc9 input::placeholder {
131
+ } .slider-input__input_dxuku input::placeholder {
117
132
  font-weight: 400;
118
- } .slider-input__steps_1cxc9 {
133
+ } .slider-input__steps_dxuku {
119
134
  font-size: 14px;
120
135
  line-height: 18px;
121
136
  font-weight: 400;
@@ -124,7 +139,7 @@
124
139
  justify-content: space-between;
125
140
  margin-top: var(--gap-xs);
126
141
  color: var(--slider-input-steps-color);
127
- } .slider-input__info_1cxc9 {
142
+ } .slider-input__info_dxuku {
128
143
  font-size: 16px;
129
144
  line-height: 20px;
130
145
  font-weight: 400;
@@ -134,24 +149,24 @@
134
149
  opacity: 0;
135
150
  transition: 0.2s ease;
136
151
  visibility: hidden;
137
- } .slider-input__s_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
152
+ } .slider-input__s_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
138
153
  padding: var(--form-control-labeled-s-paddings);
139
154
  padding-left: 0;
140
155
  padding-right: 0;
141
- } .slider-input__m_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
156
+ } .slider-input__m_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
142
157
  padding: var(--form-control-labeled-m-paddings);
143
158
  padding-left: 0;
144
159
  padding-right: 0;
145
- } .slider-input__l_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
160
+ } .slider-input__l_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
146
161
  padding: var(--form-control-labeled-l-paddings);
147
162
  padding-left: 0;
148
163
  padding-right: 0;
149
- } .slider-input__xl_1cxc9.slider-input__hasLabel_1cxc9 .slider-input__info_1cxc9:first-child {
164
+ } .slider-input__xl_dxuku.slider-input__hasLabel_dxuku .slider-input__info_dxuku:first-child {
150
165
  padding: var(--form-control-labeled-xl-paddings);
151
166
  padding-left: 0;
152
167
  padding-right: 0;
153
- } .slider-input__focused_1cxc9 .slider-input__info_1cxc9,
154
- .slider-input__filled_1cxc9 .slider-input__info_1cxc9 {
168
+ } .slider-input__focused_dxuku .slider-input__info_dxuku,
169
+ .slider-input__filled_dxuku .slider-input__info_dxuku {
155
170
  visibility: visible;
156
171
  opacity: 1;
157
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-slider-input",
3
- "version": "7.1.22",
3
+ "version": "7.2.1",
4
4
  "description": "Slider input component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -15,8 +15,8 @@
15
15
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@alfalab/core-components-input": "^11.1.18",
19
- "@alfalab/core-components-slider": "^4.2.2",
18
+ "@alfalab/core-components-input": "^12.0.1",
19
+ "@alfalab/core-components-slider": "^4.3.0",
20
20
  "classnames": "^2.3.1",
21
21
  "tslib": "^2.4.0"
22
22
  }
@@ -0,0 +1,261 @@
1
+ import React, {
2
+ ChangeEvent,
3
+ cloneElement,
4
+ FC,
5
+ forwardRef,
6
+ Fragment,
7
+ isValidElement,
8
+ ReactNode,
9
+ useCallback,
10
+ } from 'react';
11
+ import cn from 'classnames';
12
+
13
+ import { Input as DefaultInput, InputProps } from '@alfalab/core-components-input';
14
+ import { Slider, SliderProps } from '@alfalab/core-components-slider';
15
+
16
+ import styles from './index.module.css';
17
+
18
+ export type SliderInputProps = Omit<
19
+ InputProps,
20
+ 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons'
21
+ > & {
22
+ /**
23
+ * Мин. допустимое число
24
+ */
25
+ min?: number;
26
+
27
+ /**
28
+ * Макс. допустимое число
29
+ */
30
+ max?: number;
31
+
32
+ /**
33
+ * Массив подписей к слайдеру
34
+ */
35
+ steps?: ReactNode[];
36
+
37
+ /**
38
+ * Шаг (должен нацело делить отрезок между мин и макс)
39
+ */
40
+ step?: number;
41
+
42
+ /**
43
+ * Отображение подписей
44
+ * https://refreshless.com/nouislider/pips/
45
+ */
46
+ pips?: SliderProps['pips'];
47
+
48
+ /**
49
+ * Настройка шагов
50
+ * https://refreshless.com/nouislider/pips/#section-range
51
+ */
52
+ range?: SliderProps['range'];
53
+
54
+ /**
55
+ * Значение инпута
56
+ */
57
+ value?: number | string;
58
+
59
+ /**
60
+ * Значение слайдера
61
+ */
62
+ sliderValue?: number;
63
+
64
+ /**
65
+ * Дополнительная информация в правой части поля
66
+ */
67
+ info?: ReactNode;
68
+
69
+ /**
70
+ * Компонент поля ввода
71
+ */
72
+ Input?: FC<Omit<InputProps, 'onChange' | 'value'>>;
73
+
74
+ /**
75
+ * Кастомные пропсы для поля ввода
76
+ */
77
+ customInputProps?: Record<string, unknown>;
78
+
79
+ /**
80
+ * Класс для инпута
81
+ */
82
+ inputClassName?: string;
83
+
84
+ /**
85
+ * Класс для слайдера
86
+ */
87
+ sliderClassName?: string;
88
+
89
+ /**
90
+ * Класс для шагов
91
+ */
92
+ stepsClassName?: string;
93
+
94
+ /**
95
+ * Обработчик изменения значения через слайдер или поле ввода
96
+ */
97
+ onChange?: (
98
+ event: ChangeEvent<HTMLInputElement> | null,
99
+ payload: { value: number | '' },
100
+ ) => void;
101
+
102
+ /**
103
+ * Обработчик ввода
104
+ */
105
+ onInputChange?: (event: ChangeEvent<HTMLInputElement>, payload: { value: number | '' }) => void;
106
+
107
+ /**
108
+ * Обработчик изменения слайдера
109
+ */
110
+ onSliderChange?: (payload: { value: number }) => void;
111
+
112
+ /**
113
+ * Идентификатор для систем автоматизированного тестирования
114
+ */
115
+ dataTestId?: string;
116
+ };
117
+
118
+ export const SliderInput = forwardRef<HTMLInputElement, SliderInputProps>(
119
+ (
120
+ {
121
+ className,
122
+ inputClassName,
123
+ sliderClassName,
124
+ stepsClassName,
125
+ focusedClassName,
126
+ fieldClassName,
127
+ value = '',
128
+ min = 0,
129
+ max = 100,
130
+ step = 1,
131
+ block,
132
+ steps = [],
133
+ sliderValue = +value,
134
+ size = 's',
135
+ label,
136
+ info,
137
+ disabled,
138
+ readOnly,
139
+ onChange,
140
+ onInputChange,
141
+ onSliderChange,
142
+ rightAddons,
143
+ Input = DefaultInput,
144
+ customInputProps = {},
145
+ error,
146
+ hint,
147
+ pips,
148
+ range,
149
+ dataTestId,
150
+ ...restProps
151
+ },
152
+ ref,
153
+ ) => {
154
+ const getValidInputValue = useCallback((inputValue: string | number) => {
155
+ const number = parseInt(inputValue?.toString().replace(/\s/g, ''), 10);
156
+
157
+ return inputValue === '' || Number.isNaN(number) ? '' : Math.abs(number);
158
+ }, []);
159
+
160
+ const handleSliderChange = useCallback(
161
+ (payload: { value: number }) => {
162
+ if (onChange) onChange(null, payload);
163
+ if (onSliderChange) onSliderChange(payload);
164
+ },
165
+ [onChange, onSliderChange],
166
+ );
167
+
168
+ const handleInputChange = useCallback(
169
+ (event: ChangeEvent<HTMLInputElement>, payload: { value: string | number }) => {
170
+ if (onChange) onChange(event, { value: getValidInputValue(payload.value) });
171
+ if (onInputChange)
172
+ onInputChange(event, { value: getValidInputValue(payload.value) });
173
+ },
174
+ [getValidInputValue, onChange, onInputChange],
175
+ );
176
+
177
+ return (
178
+ <div
179
+ className={cn(
180
+ styles.component,
181
+ {
182
+ [styles.block]: block,
183
+ [styles.filled]: Boolean(value),
184
+ [styles.hasLabel]: label,
185
+ [styles.hasError]: Boolean(error),
186
+ },
187
+ styles[size],
188
+ className,
189
+ )}
190
+ data-test-id={dataTestId}
191
+ >
192
+ <Input
193
+ {...restProps}
194
+ {...customInputProps}
195
+ ref={ref}
196
+ value={value.toString()}
197
+ onChange={handleInputChange}
198
+ block={true}
199
+ size={size}
200
+ label={label}
201
+ disabled={disabled}
202
+ readOnly={readOnly}
203
+ className={cn(inputClassName, styles.input)}
204
+ focusedClassName={cn(focusedClassName, styles.focused)}
205
+ fieldClassName={cn(
206
+ fieldClassName,
207
+ styles.field,
208
+ { [styles.disabled]: disabled },
209
+ styles[size],
210
+ )}
211
+ inputMode='numeric'
212
+ pattern='[0-9]*'
213
+ error={error}
214
+ hint={hint}
215
+ bottomAddons={
216
+ !disabled && (
217
+ <Slider
218
+ min={min}
219
+ max={max}
220
+ step={step}
221
+ onChange={handleSliderChange}
222
+ value={
223
+ Number.isNaN(sliderValue) || !sliderValue ? min : sliderValue
224
+ }
225
+ disabled={disabled || readOnly}
226
+ className={cn(
227
+ styles.slider,
228
+ styles[size],
229
+ { [styles.hidePips]: error || hint },
230
+ sliderClassName,
231
+ )}
232
+ pips={pips}
233
+ range={range}
234
+ />
235
+ )
236
+ }
237
+ rightAddons={
238
+ (info || rightAddons) && (
239
+ <Fragment>
240
+ {info && <span className={styles.info}>{info}</span>}
241
+ {rightAddons}
242
+ </Fragment>
243
+ )
244
+ }
245
+ />
246
+ {/* eslint-disable react/no-array-index-key */}
247
+ {steps.length > 0 && !error && (
248
+ <div className={cn(styles.steps, stepsClassName)}>
249
+ {steps.map((stepLabel, i) =>
250
+ isValidElement(stepLabel) ? (
251
+ cloneElement(stepLabel, { key: i })
252
+ ) : (
253
+ <span key={i.toString()}>{stepLabel}</span>
254
+ ),
255
+ )}
256
+ </div>
257
+ )}
258
+ </div>
259
+ );
260
+ },
261
+ );
@@ -0,0 +1,157 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+ @import '@alfalab/core-components-slider/src/vars.css';
3
+ @import '@alfalab/core-components-form-control/src/vars.css';
4
+
5
+ :root {
6
+ --slider-input-steps-color: var(--color-light-text-secondary);
7
+ --slider-input-info-color: var(--color-light-text-secondary);
8
+ --slider-input-font-weight: 700;
9
+ --slider-input-s-border-bottom-radius: var(--border-radius-m);
10
+ --slider-input-m-border-bottom-radius: var(--border-radius-m);
11
+ --slider-input-l-border-bottom-radius: var(--border-radius-m);
12
+ --slider-input-xl-border-bottom-radius: var(--border-radius-l);
13
+ --slider-input-progress-margin-horizontal: var(--gap-s);
14
+ --slider-input-xl-progress-margin-horizontal: var(--gap-m);
15
+ --slider-input-progress-border-radius: var(--border-radius-s);
16
+ --slider-input-progress-bg-color: var(--color-light-graphic-secondary);
17
+ --slider-input-progress-hover-bg-color: var(--color-light-graphic-secondary);
18
+ --slider-input-origin-width: calc(100% - 16px);
19
+ --slider-input-origin-right: 8px;
20
+ }
21
+
22
+ .component {
23
+ position: relative;
24
+ display: inline-block;
25
+ }
26
+
27
+ .block {
28
+ display: block;
29
+ }
30
+
31
+ .slider {
32
+ width: calc(100% - var(--slider-input-progress-margin-horizontal) * 2);
33
+ margin-left: var(--slider-input-progress-margin-horizontal);
34
+ margin-right: var(--slider-input-progress-margin-horizontal);
35
+ margin-top: calc(var(--slider-progress-s-height) / -2);
36
+ transform: translateY(-1px);
37
+
38
+ &.xl {
39
+ width: calc(100% - var(--slider-input-xl-progress-margin-horizontal) * 2);
40
+ margin-left: var(--slider-input-xl-progress-margin-horizontal);
41
+ margin-right: var(--slider-input-xl-progress-margin-horizontal);
42
+ }
43
+
44
+ & :global(.noUi-base) {
45
+ border-radius: var(--slider-input-progress-border-radius);
46
+ }
47
+
48
+ & :global(.noUi-base):hover {
49
+ & > :global(.noUi-connects) {
50
+ background-color: var(--slider-input-progress-hover-bg-color);
51
+ }
52
+ }
53
+
54
+ & :global(.noUi-connects) {
55
+ border-radius: var(--slider-input-progress-border-radius);
56
+ background-color: var(--slider-input-progress-bg-color);
57
+ }
58
+
59
+ & :global(.noUi-origin) {
60
+ width: var(--slider-input-origin-width);
61
+ right: var(--slider-input-origin-right);
62
+ }
63
+
64
+ /* TODO исправить на 6px когда слайдеру добавят position: absolute */
65
+ & + * {
66
+ margin-top: 5px;
67
+ }
68
+ }
69
+
70
+ .hidePips {
71
+ & :global(.noUi-pips) {
72
+ display: none;
73
+ }
74
+ }
75
+
76
+ .component .field {
77
+ &.s {
78
+ border-bottom-left-radius: var(--slider-input-s-border-bottom-radius);
79
+ border-bottom-right-radius: var(--slider-input-s-border-bottom-radius);
80
+ }
81
+
82
+ &.m {
83
+ border-bottom-left-radius: var(--slider-input-m-border-bottom-radius);
84
+ border-bottom-right-radius: var(--slider-input-m-border-bottom-radius);
85
+ }
86
+
87
+ &.l {
88
+ border-bottom-left-radius: var(--slider-input-l-border-bottom-radius);
89
+ border-bottom-right-radius: var(--slider-input-l-border-bottom-radius);
90
+ }
91
+
92
+ &.xl {
93
+ border-bottom-left-radius: var(--slider-input-xl-border-bottom-radius);
94
+ border-bottom-right-radius: var(--slider-input-xl-border-bottom-radius);
95
+ }
96
+ }
97
+
98
+ .input {
99
+ & input,
100
+ & input + div {
101
+ font-weight: var(--slider-input-font-weight);
102
+ font-variant-numeric: tabular-nums;
103
+ }
104
+
105
+ & input::placeholder {
106
+ font-weight: 400;
107
+ }
108
+ }
109
+
110
+ .steps {
111
+ @mixin paragraph_component_secondary;
112
+
113
+ display: flex;
114
+ justify-content: space-between;
115
+ margin-top: var(--gap-xs);
116
+ color: var(--slider-input-steps-color);
117
+ }
118
+
119
+ .info {
120
+ @mixin paragraph_component;
121
+
122
+ color: var(--slider-input-info-color);
123
+ box-sizing: border-box;
124
+ opacity: 0;
125
+ transition: 0.2s ease;
126
+ visibility: hidden;
127
+ }
128
+
129
+ .s.hasLabel .info:first-child {
130
+ padding: var(--form-control-labeled-s-paddings);
131
+ padding-left: 0;
132
+ padding-right: 0;
133
+ }
134
+
135
+ .m.hasLabel .info:first-child {
136
+ padding: var(--form-control-labeled-m-paddings);
137
+ padding-left: 0;
138
+ padding-right: 0;
139
+ }
140
+
141
+ .l.hasLabel .info:first-child {
142
+ padding: var(--form-control-labeled-l-paddings);
143
+ padding-left: 0;
144
+ padding-right: 0;
145
+ }
146
+
147
+ .xl.hasLabel .info:first-child {
148
+ padding: var(--form-control-labeled-xl-paddings);
149
+ padding-left: 0;
150
+ padding-right: 0;
151
+ }
152
+
153
+ .focused .info,
154
+ .filled .info {
155
+ visibility: visible;
156
+ opacity: 1;
157
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './Component';