@mmb-digital/design-system-web 0.1.4 → 0.1.5
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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/design-system-web_2023-02-07.iml +8 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/modules.xml +8 -0
- package/.idea/php.xml +19 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/package.json +1 -1
- package/src/@types/json.d.ts +0 -5
- package/src/@types/styledComponentCssProps.d.ts +0 -11
- package/src/@types/styledComponentTheme.d.ts +0 -9
- package/src/components/button/button.stories.tsx +0 -97
- package/src/components/button/button.styles.ts +0 -162
- package/src/components/button/button.test.tsx +0 -25
- package/src/components/button/button.tsx +0 -31
- package/src/components/button/button.types.ts +0 -33
- package/src/components/button/index.ts +0 -3
- package/src/components/form/hint/formHint.style.ts +0 -10
- package/src/components/form/hint/formHint.tsx +0 -13
- package/src/components/form/hint/formHint.types.ts +0 -5
- package/src/components/slider/slider/slider.stories.tsx +0 -176
- package/src/components/slider/slider/slider.style.ts +0 -29
- package/src/components/slider/slider/slider.tsx +0 -136
- package/src/components/slider/slider/slider.types.ts +0 -58
- package/src/components/slider/slider/sliderFunction/default/sliderFunctionDefault.ts +0 -21
- package/src/components/slider/slider/sliderFunction/default/sliderStep.test.ts +0 -90
- package/src/components/slider/slider/sliderFunction/default/sliderStep.ts +0 -18
- package/src/components/slider/slider/sliderFunction/linearVisualSteps/sliderFunctionLinearVisualSteps.ts +0 -28
- package/src/components/slider/slider/sliderFunction/linearVisualSteps/sliderMax.test.ts +0 -83
- package/src/components/slider/slider/sliderFunction/linearVisualSteps/sliderMax.ts +0 -34
- package/src/components/slider/slider/sliderFunction/linearVisualSteps/sliderValueByValue.test.ts +0 -249
- package/src/components/slider/slider/sliderFunction/linearVisualSteps/sliderValueByValue.ts +0 -41
- package/src/components/slider/slider/sliderFunction/linearVisualSteps/valueBySliderValue.test.ts +0 -204
- package/src/components/slider/slider/sliderFunction/linearVisualSteps/valueBySliderValue.ts +0 -35
- package/src/components/slider/slider/sliderHandleSvgHandler.ts +0 -26
- package/src/components/storeButton/assets/androidSvg.tsx +0 -159
- package/src/components/storeButton/assets/appleSvg.tsx +0 -31
- package/src/components/storeButton/storeButton.stories.tsx +0 -67
- package/src/components/storeButton/storeButton.styles.ts +0 -36
- package/src/components/storeButton/storeButton.test.tsx +0 -22
- package/src/components/storeButton/storeButton.tsx +0 -30
- package/src/components/storeButton/storeButton.types.tsx +0 -15
- package/src/icons/systemIcon.tsx +0 -26
- package/src/index.ts +0 -2
- package/src/provider/storybook/storybookProvider.tsx +0 -11
- package/src/provider/storybook/storybookProvider.types.ts +0 -5
- package/src/provider/styledComponents/theme/styledComponentsThemeProvider.tsx +0 -14
- package/src/provider/styledComponents/theme/styledComponentsThemeProvider.types..ts +0 -5
- package/src/style/styledComponents/mmb_variables-5224.json +0 -958
- package/src/style/styledComponents/theme.ts +0 -450
package/src/components/slider/slider/sliderFunction/linearVisualSteps/sliderValueByValue.test.ts
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { getSliderValueByValue } from '@/components/slider/slider/sliderFunction/linearVisualSteps/sliderValueByValue';
|
|
2
|
-
import { SliderSteps } from '@/components/slider/slider/slider.types';
|
|
3
|
-
|
|
4
|
-
describe('Running Test for slider linear visual step sliderValue', () => {
|
|
5
|
-
test('linear step', () => {
|
|
6
|
-
const steps: SliderSteps = {
|
|
7
|
-
baseStep: 1,
|
|
8
|
-
breakpointList: [],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
expect(
|
|
12
|
-
getSliderValueByValue({
|
|
13
|
-
min: 10,
|
|
14
|
-
max: 20,
|
|
15
|
-
steps: steps,
|
|
16
|
-
value: 10,
|
|
17
|
-
}),
|
|
18
|
-
).toBe(10);
|
|
19
|
-
|
|
20
|
-
expect(
|
|
21
|
-
getSliderValueByValue({
|
|
22
|
-
min: 10,
|
|
23
|
-
max: 20,
|
|
24
|
-
steps: steps,
|
|
25
|
-
value: 15,
|
|
26
|
-
}),
|
|
27
|
-
).toBe(15);
|
|
28
|
-
|
|
29
|
-
expect(
|
|
30
|
-
getSliderValueByValue({
|
|
31
|
-
min: 10,
|
|
32
|
-
max: 20,
|
|
33
|
-
steps: steps,
|
|
34
|
-
value: 20,
|
|
35
|
-
}),
|
|
36
|
-
).toBe(20);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('multiple step 1', () => {
|
|
40
|
-
const steps: SliderSteps = {
|
|
41
|
-
baseStep: 1,
|
|
42
|
-
breakpointList: [
|
|
43
|
-
{
|
|
44
|
-
step: 2,
|
|
45
|
-
bottomBreakpoint: 20,
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
expect(
|
|
51
|
-
getSliderValueByValue({
|
|
52
|
-
min: 10,
|
|
53
|
-
max: 30,
|
|
54
|
-
steps: steps,
|
|
55
|
-
value: 10,
|
|
56
|
-
}),
|
|
57
|
-
).toBe(10);
|
|
58
|
-
|
|
59
|
-
expect(
|
|
60
|
-
getSliderValueByValue({
|
|
61
|
-
min: 10,
|
|
62
|
-
max: 30,
|
|
63
|
-
steps: steps,
|
|
64
|
-
value: 20,
|
|
65
|
-
}),
|
|
66
|
-
).toBe(20);
|
|
67
|
-
|
|
68
|
-
expect(
|
|
69
|
-
getSliderValueByValue({
|
|
70
|
-
min: 10,
|
|
71
|
-
max: 30,
|
|
72
|
-
steps: steps,
|
|
73
|
-
value: 22,
|
|
74
|
-
}),
|
|
75
|
-
).toBe(21);
|
|
76
|
-
|
|
77
|
-
expect(
|
|
78
|
-
getSliderValueByValue({
|
|
79
|
-
min: 10,
|
|
80
|
-
max: 30,
|
|
81
|
-
steps: steps,
|
|
82
|
-
value: 30,
|
|
83
|
-
}),
|
|
84
|
-
).toBe(25);
|
|
85
|
-
|
|
86
|
-
expect(
|
|
87
|
-
getSliderValueByValue({
|
|
88
|
-
min: 10,
|
|
89
|
-
max: 30,
|
|
90
|
-
steps: steps,
|
|
91
|
-
value: 28,
|
|
92
|
-
}),
|
|
93
|
-
).toBe(24);
|
|
94
|
-
|
|
95
|
-
expect(
|
|
96
|
-
getSliderValueByValue({
|
|
97
|
-
min: 10,
|
|
98
|
-
max: 30,
|
|
99
|
-
steps: steps,
|
|
100
|
-
value: 27,
|
|
101
|
-
}),
|
|
102
|
-
).toBe(24);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
test('multiple step 2', () => {
|
|
106
|
-
const steps: SliderSteps = {
|
|
107
|
-
baseStep: 1,
|
|
108
|
-
breakpointList: [
|
|
109
|
-
{
|
|
110
|
-
step: 2,
|
|
111
|
-
bottomBreakpoint: 20,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
step: 3,
|
|
115
|
-
bottomBreakpoint: 30,
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
expect(
|
|
121
|
-
getSliderValueByValue({
|
|
122
|
-
min: 10,
|
|
123
|
-
max: 40,
|
|
124
|
-
steps: steps,
|
|
125
|
-
value: 30,
|
|
126
|
-
}),
|
|
127
|
-
).toBe(25);
|
|
128
|
-
|
|
129
|
-
expect(
|
|
130
|
-
getSliderValueByValue({
|
|
131
|
-
min: 10,
|
|
132
|
-
max: 40,
|
|
133
|
-
steps: steps,
|
|
134
|
-
value: 33,
|
|
135
|
-
}),
|
|
136
|
-
).toBe(26);
|
|
137
|
-
|
|
138
|
-
expect(
|
|
139
|
-
getSliderValueByValue({
|
|
140
|
-
min: 10,
|
|
141
|
-
max: 40,
|
|
142
|
-
steps: steps,
|
|
143
|
-
value: 34,
|
|
144
|
-
}),
|
|
145
|
-
).toBe(27);
|
|
146
|
-
|
|
147
|
-
expect(
|
|
148
|
-
getSliderValueByValue({
|
|
149
|
-
min: 10,
|
|
150
|
-
max: 40,
|
|
151
|
-
steps: steps,
|
|
152
|
-
value: 36,
|
|
153
|
-
}),
|
|
154
|
-
).toBe(27);
|
|
155
|
-
|
|
156
|
-
expect(
|
|
157
|
-
getSliderValueByValue({
|
|
158
|
-
min: 10,
|
|
159
|
-
max: 40,
|
|
160
|
-
steps: steps,
|
|
161
|
-
value: 39,
|
|
162
|
-
}),
|
|
163
|
-
).toBe(28);
|
|
164
|
-
|
|
165
|
-
expect(
|
|
166
|
-
getSliderValueByValue({
|
|
167
|
-
min: 10,
|
|
168
|
-
max: 40,
|
|
169
|
-
steps: steps,
|
|
170
|
-
value: 40,
|
|
171
|
-
}),
|
|
172
|
-
).toBe(29);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
test('multiple step 3', () => {
|
|
176
|
-
const steps: SliderSteps = {
|
|
177
|
-
baseStep: 3,
|
|
178
|
-
breakpointList: [
|
|
179
|
-
{
|
|
180
|
-
step: 4,
|
|
181
|
-
bottomBreakpoint: 20,
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
expect(
|
|
187
|
-
getSliderValueByValue({
|
|
188
|
-
min: 10,
|
|
189
|
-
max: 50,
|
|
190
|
-
steps: steps,
|
|
191
|
-
value: 19,
|
|
192
|
-
}),
|
|
193
|
-
).toBe(13);
|
|
194
|
-
|
|
195
|
-
expect(
|
|
196
|
-
getSliderValueByValue({
|
|
197
|
-
min: 10,
|
|
198
|
-
max: 50,
|
|
199
|
-
steps: steps,
|
|
200
|
-
value: 20,
|
|
201
|
-
}),
|
|
202
|
-
).toBe(14);
|
|
203
|
-
|
|
204
|
-
expect(
|
|
205
|
-
getSliderValueByValue({
|
|
206
|
-
min: 10,
|
|
207
|
-
max: 50,
|
|
208
|
-
steps: steps,
|
|
209
|
-
value: 21,
|
|
210
|
-
}),
|
|
211
|
-
).toBe(15);
|
|
212
|
-
|
|
213
|
-
expect(
|
|
214
|
-
getSliderValueByValue({
|
|
215
|
-
min: 10,
|
|
216
|
-
max: 50,
|
|
217
|
-
steps: steps,
|
|
218
|
-
value: 22,
|
|
219
|
-
}),
|
|
220
|
-
).toBe(15);
|
|
221
|
-
|
|
222
|
-
expect(
|
|
223
|
-
getSliderValueByValue({
|
|
224
|
-
min: 10,
|
|
225
|
-
max: 50,
|
|
226
|
-
steps: steps,
|
|
227
|
-
value: 23,
|
|
228
|
-
}),
|
|
229
|
-
).toBe(15);
|
|
230
|
-
|
|
231
|
-
expect(
|
|
232
|
-
getSliderValueByValue({
|
|
233
|
-
min: 10,
|
|
234
|
-
max: 50,
|
|
235
|
-
steps: steps,
|
|
236
|
-
value: 24,
|
|
237
|
-
}),
|
|
238
|
-
).toBe(15);
|
|
239
|
-
|
|
240
|
-
expect(
|
|
241
|
-
getSliderValueByValue({
|
|
242
|
-
min: 10,
|
|
243
|
-
max: 50,
|
|
244
|
-
steps: steps,
|
|
245
|
-
value: 25,
|
|
246
|
-
}),
|
|
247
|
-
).toBe(16);
|
|
248
|
-
});
|
|
249
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { SliderBreakpoint, SliderSteps } from '@/components/slider/slider/slider.types';
|
|
2
|
-
|
|
3
|
-
interface GetSliderValueByValueParam {
|
|
4
|
-
readonly max: number;
|
|
5
|
-
readonly min: number;
|
|
6
|
-
readonly steps: SliderSteps;
|
|
7
|
-
readonly value: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const getSliderValueByValue = (param: GetSliderValueByValueParam): number => {
|
|
11
|
-
const { max, min, steps, value } = param;
|
|
12
|
-
|
|
13
|
-
const breakpoints: SliderBreakpoint[] = [{ step: steps.baseStep, bottomBreakpoint: min }, ...steps.breakpointList];
|
|
14
|
-
|
|
15
|
-
let sliderValue = min;
|
|
16
|
-
|
|
17
|
-
outerCycle: for (const [breakpointIndex, breakpoint] of breakpoints.entries()) {
|
|
18
|
-
const { bottomBreakpoint: currenBottomBreakpoint, step } = breakpoint;
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
20
|
-
const nextBreakpoint = breakpoints[breakpointIndex + 1]?.bottomBreakpoint === undefined ? max : breakpoints[breakpointIndex + 1].bottomBreakpoint;
|
|
21
|
-
|
|
22
|
-
let i: number = currenBottomBreakpoint;
|
|
23
|
-
if (value <= currenBottomBreakpoint) {
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
while (i + step < nextBreakpoint) {
|
|
27
|
-
i = i + step;
|
|
28
|
-
sliderValue = sliderValue + 1;
|
|
29
|
-
|
|
30
|
-
if (i === value || (i > value && i < value + step)) {
|
|
31
|
-
break outerCycle;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (i < nextBreakpoint) {
|
|
36
|
-
sliderValue = sliderValue + 1;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return sliderValue;
|
|
41
|
-
};
|
package/src/components/slider/slider/sliderFunction/linearVisualSteps/valueBySliderValue.test.ts
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { SliderSteps } from '@/components/slider/slider/slider.types';
|
|
2
|
-
import { getValueBySliderValue } from '@/components/slider/slider/sliderFunction/linearVisualSteps/valueBySliderValue';
|
|
3
|
-
|
|
4
|
-
describe('Running Test for slider linear visual step value', () => {
|
|
5
|
-
test('linear step', () => {
|
|
6
|
-
const steps: SliderSteps = {
|
|
7
|
-
baseStep: 1,
|
|
8
|
-
breakpointList: [],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
expect(
|
|
12
|
-
getValueBySliderValue({
|
|
13
|
-
min: 10,
|
|
14
|
-
max: 20,
|
|
15
|
-
steps: steps,
|
|
16
|
-
sliderValue: 10,
|
|
17
|
-
}),
|
|
18
|
-
).toBe(10);
|
|
19
|
-
|
|
20
|
-
expect(
|
|
21
|
-
getValueBySliderValue({
|
|
22
|
-
min: 10,
|
|
23
|
-
max: 20,
|
|
24
|
-
steps: steps,
|
|
25
|
-
sliderValue: 15,
|
|
26
|
-
}),
|
|
27
|
-
).toBe(15);
|
|
28
|
-
|
|
29
|
-
expect(
|
|
30
|
-
getValueBySliderValue({
|
|
31
|
-
min: 10,
|
|
32
|
-
max: 20,
|
|
33
|
-
steps: steps,
|
|
34
|
-
sliderValue: 20,
|
|
35
|
-
}),
|
|
36
|
-
).toBe(20);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('multiple step 1', () => {
|
|
40
|
-
const steps: SliderSteps = {
|
|
41
|
-
baseStep: 1,
|
|
42
|
-
breakpointList: [
|
|
43
|
-
{
|
|
44
|
-
step: 2,
|
|
45
|
-
bottomBreakpoint: 20,
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
expect(
|
|
51
|
-
getValueBySliderValue({
|
|
52
|
-
min: 10,
|
|
53
|
-
max: 30,
|
|
54
|
-
steps: steps,
|
|
55
|
-
sliderValue: 10,
|
|
56
|
-
}),
|
|
57
|
-
).toBe(10);
|
|
58
|
-
|
|
59
|
-
expect(
|
|
60
|
-
getValueBySliderValue({
|
|
61
|
-
min: 10,
|
|
62
|
-
max: 30,
|
|
63
|
-
steps: steps,
|
|
64
|
-
sliderValue: 20,
|
|
65
|
-
}),
|
|
66
|
-
).toBe(20);
|
|
67
|
-
|
|
68
|
-
expect(
|
|
69
|
-
getValueBySliderValue({
|
|
70
|
-
min: 10,
|
|
71
|
-
max: 30,
|
|
72
|
-
steps: steps,
|
|
73
|
-
sliderValue: 21,
|
|
74
|
-
}),
|
|
75
|
-
).toBe(22);
|
|
76
|
-
|
|
77
|
-
expect(
|
|
78
|
-
getValueBySliderValue({
|
|
79
|
-
min: 10,
|
|
80
|
-
max: 30,
|
|
81
|
-
steps: steps,
|
|
82
|
-
sliderValue: 25,
|
|
83
|
-
}),
|
|
84
|
-
).toBe(30);
|
|
85
|
-
|
|
86
|
-
expect(
|
|
87
|
-
getValueBySliderValue({
|
|
88
|
-
min: 10,
|
|
89
|
-
max: 30,
|
|
90
|
-
steps: steps,
|
|
91
|
-
sliderValue: 24,
|
|
92
|
-
}),
|
|
93
|
-
).toBe(28);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
test('multiple step 2', () => {
|
|
97
|
-
const steps: SliderSteps = {
|
|
98
|
-
baseStep: 1,
|
|
99
|
-
breakpointList: [
|
|
100
|
-
{
|
|
101
|
-
step: 2,
|
|
102
|
-
bottomBreakpoint: 20,
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
step: 3,
|
|
106
|
-
bottomBreakpoint: 30,
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
expect(
|
|
112
|
-
getValueBySliderValue({
|
|
113
|
-
min: 10,
|
|
114
|
-
max: 40,
|
|
115
|
-
steps: steps,
|
|
116
|
-
sliderValue: 25,
|
|
117
|
-
}),
|
|
118
|
-
).toBe(30);
|
|
119
|
-
|
|
120
|
-
expect(
|
|
121
|
-
getValueBySliderValue({
|
|
122
|
-
min: 10,
|
|
123
|
-
max: 40,
|
|
124
|
-
steps: steps,
|
|
125
|
-
sliderValue: 26,
|
|
126
|
-
}),
|
|
127
|
-
).toBe(33);
|
|
128
|
-
|
|
129
|
-
expect(
|
|
130
|
-
getValueBySliderValue({
|
|
131
|
-
min: 10,
|
|
132
|
-
max: 40,
|
|
133
|
-
steps: steps,
|
|
134
|
-
sliderValue: 27,
|
|
135
|
-
}),
|
|
136
|
-
).toBe(36);
|
|
137
|
-
|
|
138
|
-
expect(
|
|
139
|
-
getValueBySliderValue({
|
|
140
|
-
min: 10,
|
|
141
|
-
max: 40,
|
|
142
|
-
steps: steps,
|
|
143
|
-
sliderValue: 28,
|
|
144
|
-
}),
|
|
145
|
-
).toBe(39);
|
|
146
|
-
|
|
147
|
-
expect(
|
|
148
|
-
getValueBySliderValue({
|
|
149
|
-
min: 10,
|
|
150
|
-
max: 40,
|
|
151
|
-
steps: steps,
|
|
152
|
-
sliderValue: 30,
|
|
153
|
-
}),
|
|
154
|
-
).toBe(40);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
test('multiple step 3', () => {
|
|
158
|
-
const steps: SliderSteps = {
|
|
159
|
-
baseStep: 3,
|
|
160
|
-
breakpointList: [
|
|
161
|
-
{
|
|
162
|
-
step: 4,
|
|
163
|
-
bottomBreakpoint: 20,
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
expect(
|
|
169
|
-
getValueBySliderValue({
|
|
170
|
-
min: 10,
|
|
171
|
-
max: 50,
|
|
172
|
-
steps: steps,
|
|
173
|
-
sliderValue: 13,
|
|
174
|
-
}),
|
|
175
|
-
).toBe(19);
|
|
176
|
-
|
|
177
|
-
expect(
|
|
178
|
-
getValueBySliderValue({
|
|
179
|
-
min: 10,
|
|
180
|
-
max: 50,
|
|
181
|
-
steps: steps,
|
|
182
|
-
sliderValue: 14,
|
|
183
|
-
}),
|
|
184
|
-
).toBe(20);
|
|
185
|
-
|
|
186
|
-
expect(
|
|
187
|
-
getValueBySliderValue({
|
|
188
|
-
min: 10,
|
|
189
|
-
max: 50,
|
|
190
|
-
steps: steps,
|
|
191
|
-
sliderValue: 15,
|
|
192
|
-
}),
|
|
193
|
-
).toBe(24);
|
|
194
|
-
|
|
195
|
-
expect(
|
|
196
|
-
getValueBySliderValue({
|
|
197
|
-
min: 10,
|
|
198
|
-
max: 50,
|
|
199
|
-
steps: steps,
|
|
200
|
-
sliderValue: 16,
|
|
201
|
-
}),
|
|
202
|
-
).toBe(28);
|
|
203
|
-
});
|
|
204
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { SliderBreakpoint, SliderMapOnChangeFunction } from '@/components/slider/slider/slider.types';
|
|
2
|
-
|
|
3
|
-
export const getValueBySliderValue: SliderMapOnChangeFunction = (param): number => {
|
|
4
|
-
const { max, min, sliderValue, steps } = param;
|
|
5
|
-
|
|
6
|
-
const breakpoints: SliderBreakpoint[] = [{ step: steps.baseStep, bottomBreakpoint: min }, ...steps.breakpointList];
|
|
7
|
-
|
|
8
|
-
let currentSliderValue = min;
|
|
9
|
-
let currentValue = min;
|
|
10
|
-
|
|
11
|
-
while (currentSliderValue < sliderValue) {
|
|
12
|
-
let breakpointIndexFound = 0;
|
|
13
|
-
let breakpointFound: SliderBreakpoint = breakpoints[breakpointIndexFound];
|
|
14
|
-
|
|
15
|
-
for (const [currentBreakpointIndex, currentBreakpoint] of breakpoints.entries()) {
|
|
16
|
-
if (currentBreakpoint.bottomBreakpoint > currentValue) {
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
breakpointIndexFound = currentBreakpointIndex;
|
|
21
|
-
breakpointFound = currentBreakpoint;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const breakpointFoundStep = breakpointFound.step;
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
27
|
-
const nextBreakpoint = breakpoints[breakpointIndexFound + 1]?.bottomBreakpoint === undefined ? max : breakpoints[breakpointIndexFound + 1].bottomBreakpoint;
|
|
28
|
-
|
|
29
|
-
const nextValue = currentValue + breakpointFoundStep;
|
|
30
|
-
currentValue = nextValue < nextBreakpoint ? nextValue : nextBreakpoint;
|
|
31
|
-
currentSliderValue = currentSliderValue + 1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return currentValue;
|
|
35
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { theme } from '@/style/styledComponents/theme';
|
|
2
|
-
import { encode as encodeBase64 } from 'base-64';
|
|
3
|
-
|
|
4
|
-
export const getSliderHandleBackgroundSvg = (disable: boolean) => {
|
|
5
|
-
if (disable) {
|
|
6
|
-
return `
|
|
7
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
8
|
-
<circle cx="12" cy="12" r="11" stroke="${theme.colors.fg.disabled.light}" stroke-width="2"/>
|
|
9
|
-
</svg>`;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return `
|
|
13
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
14
|
-
<circle cx="12" cy="12" r="11" stroke="url(#paint0_linear_1206_76209)" stroke-width="2" />
|
|
15
|
-
<defs>
|
|
16
|
-
<linearGradient id="paint0_linear_1206_76209" x1="24" y1="0" x2="0" y2="24" gradientUnits="userSpaceOnUse">
|
|
17
|
-
<stop offset="0.0677083" stop-color="${theme.palette.pink600}"/>
|
|
18
|
-
<stop offset="1" stop-color="${theme.palette.blue600}"/>
|
|
19
|
-
</linearGradient>
|
|
20
|
-
</defs>
|
|
21
|
-
</svg>`;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const getSliderHandleBackgroundSvgBase64 = (disable: boolean) => {
|
|
25
|
-
return encodeBase64(getSliderHandleBackgroundSvg(disable));
|
|
26
|
-
};
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface Props {
|
|
4
|
-
className?: string;
|
|
5
|
-
height?: string;
|
|
6
|
-
width?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const AndroidSvg: React.FC<Props> = ({ className, height = '29', width = '116' }) => (
|
|
10
|
-
<svg
|
|
11
|
-
className={className}
|
|
12
|
-
fill="none"
|
|
13
|
-
height={height}
|
|
14
|
-
viewBox="0 0 116 29"
|
|
15
|
-
width={width}
|
|
16
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
-
>
|
|
18
|
-
<path
|
|
19
|
-
d="M58.1 16.8C55.7 16.8 53.8 18.6 53.8 21.1C53.8 23.5 55.7 25.4 58.1 25.4C60.5 25.4 62.4 23.6 62.4 21.1C62.4 18.5 60.5 16.8 58.1 16.8ZM58.1 23.6C56.8 23.6 55.7 22.5 55.7 21C55.7 19.5 56.8 18.4 58.1 18.4C59.4 18.4 60.5 19.4 60.5 21C60.5 22.5 59.4 23.6 58.1 23.6ZM48.8 16.8C46.4 16.8 44.5 18.6 44.5 21.1C44.5 23.5 46.4 25.4 48.8 25.4C51.2 25.4 53.1 23.6 53.1 21.1C53.1 18.5 51.2 16.8 48.8 16.8ZM48.8 23.6C47.5 23.6 46.4 22.5 46.4 21C46.4 19.5 47.5 18.4 48.8 18.4C50.1 18.4 51.2 19.4 51.2 21C51.2 22.5 50.1 23.6 48.8 23.6ZM37.7 18.1V19.9H42C41.9 20.9 41.5 21.7 41 22.2C40.4 22.8 39.4 23.5 37.7 23.5C35 23.5 33 21.4 33 18.7C33 16 35.1 13.9 37.7 13.9C39.1 13.9 40.2 14.5 41 15.2L42.3 13.9C41.2 12.9 39.8 12.1 37.8 12.1C34.2 12.1 31.1 15.1 31.1 18.7C31.1 22.3 34.2 25.3 37.8 25.3C39.8 25.3 41.2 24.7 42.4 23.4C43.6 22.2 44 20.5 44 19.2C44 18.8 44 18.4 43.9 18.1H37.7ZM83.1 19.5C82.7 18.5 81.7 16.8 79.5 16.8C77.3 16.8 75.5 18.5 75.5 21.1C75.5 23.5 77.3 25.4 79.7 25.4C81.6 25.4 82.8 24.2 83.2 23.5L81.8 22.5C81.3 23.2 80.7 23.7 79.7 23.7C78.7 23.7 78.1 23.3 77.6 22.4L83.3 20L83.1 19.5ZM77.3 20.9C77.3 19.3 78.6 18.4 79.5 18.4C80.2 18.4 80.9 18.8 81.1 19.3L77.3 20.9ZM72.6 25H74.5V12.5H72.6V25ZM69.6 17.7C69.1 17.2 68.3 16.7 67.3 16.7C65.2 16.7 63.2 18.6 63.2 21C63.2 23.4 65.1 25.2 67.3 25.2C68.3 25.2 69.1 24.7 69.5 24.2H69.6V24.8C69.6 26.4 68.7 27.3 67.3 27.3C66.2 27.3 65.4 26.5 65.2 25.8L63.6 26.5C64.1 27.6 65.3 29 67.4 29C69.6 29 71.4 27.7 71.4 24.6V17H69.6V17.7ZM67.4 23.6C66.1 23.6 65 22.5 65 21C65 19.5 66.1 18.4 67.4 18.4C68.7 18.4 69.7 19.5 69.7 21C69.7 22.5 68.7 23.6 67.4 23.6ZM91.8 12.5H87.3V25H89.2V20.3H91.8C93.9 20.3 95.9 18.8 95.9 16.4C95.9 14 93.9 12.5 91.8 12.5ZM91.9 18.5H89.2V14.2H91.9C93.3 14.2 94.1 15.4 94.1 16.3C94 17.4 93.2 18.5 91.9 18.5ZM103.4 16.7C102 16.7 100.6 17.3 100.1 18.6L101.8 19.3C102.2 18.6 102.8 18.4 103.5 18.4C104.5 18.4 105.4 19 105.5 20V20.1C105.2 19.9 104.4 19.6 103.6 19.6C101.8 19.6 100 20.6 100 22.4C100 24.1 101.5 25.2 103.1 25.2C104.4 25.2 105 24.6 105.5 24H105.6V25H107.4V20.2C107.2 18 105.5 16.7 103.4 16.7ZM103.2 23.6C102.6 23.6 101.7 23.3 101.7 22.5C101.7 21.5 102.8 21.2 103.7 21.2C104.5 21.2 104.9 21.4 105.4 21.6C105.2 22.8 104.2 23.6 103.2 23.6ZM113.7 17L111.6 22.4H111.5L109.3 17H107.3L110.6 24.6L108.7 28.8H110.6L115.7 17H113.7ZM96.9 25H98.8V12.5H96.9V25Z"
|
|
20
|
-
fill="white"
|
|
21
|
-
/>
|
|
22
|
-
<path
|
|
23
|
-
d="M0.4 2.5C0.0999999 2.8 0 3.3 0 3.9V26C0 26.6 0.2 27.1 0.5 27.4L0.6 27.5L13 15.1V14.9L0.4 2.5Z"
|
|
24
|
-
fill="url(#paint0_linear_2551_76392)"
|
|
25
|
-
/>
|
|
26
|
-
<path
|
|
27
|
-
d="M17 19.3L12.9 15.2V14.9L17 10.8L17.1 10.9L22 13.7C23.4 14.5 23.4 15.8 22 16.6L17 19.3Z"
|
|
28
|
-
fill="url(#paint1_linear_2551_76392)"
|
|
29
|
-
/>
|
|
30
|
-
<path
|
|
31
|
-
d="M17.1 19.2L12.9 15L0.400024 27.5C0.900024 28 1.60002 28 2.50002 27.6L17.1 19.2Z"
|
|
32
|
-
fill="url(#paint2_linear_2551_76392)"
|
|
33
|
-
/>
|
|
34
|
-
<path
|
|
35
|
-
d="M17.1 10.8L2.50002 2.49999C1.60002 1.99999 0.900024 2.09999 0.400024 2.59999L12.9 15L17.1 10.8Z"
|
|
36
|
-
fill="url(#paint3_linear_2551_76392)"
|
|
37
|
-
/>
|
|
38
|
-
<path
|
|
39
|
-
d="M17 19.1L2.50002 27.3C1.70002 27.8 1.00003 27.7 0.500025 27.3L0.400024 27.4L0.500025 27.5C1.00003 27.9 1.70002 28 2.50002 27.5L17 19.1Z"
|
|
40
|
-
fill="black"
|
|
41
|
-
opacity="0.2"
|
|
42
|
-
/>
|
|
43
|
-
<path
|
|
44
|
-
d="M0.399999 27.3C0.0999995 27 0 26.5 0 25.9V26C0 26.6 0.2 27.1 0.5 27.4V27.3H0.399999Z"
|
|
45
|
-
fill="black"
|
|
46
|
-
opacity="0.12"
|
|
47
|
-
/>
|
|
48
|
-
<path
|
|
49
|
-
d="M22 16.3L17 19.1L17.1 19.2L22 16.4C22.7 16 23 15.5 23 15C23 15.5 22.6 15.9 22 16.3Z"
|
|
50
|
-
fill="black"
|
|
51
|
-
opacity="0.12"
|
|
52
|
-
/>
|
|
53
|
-
<path
|
|
54
|
-
d="M2.5 2.60003L22 13.7C22.6 14.1 23 14.5 23 15C23 14.5 22.7 14 22 13.6L2.5 2.50003C1.1 1.70003 0 2.30003 0 3.90003V4.00003C0 2.50003 1.1 1.80003 2.5 2.60003Z"
|
|
55
|
-
fill="white"
|
|
56
|
-
opacity="0.25"
|
|
57
|
-
/>
|
|
58
|
-
<path
|
|
59
|
-
d="M31.3 8V2H32.2L35.1 6.7V2H36V8H35.2L32.1 3.1V8H31.3ZM39.6 8H38.8V5.2L36.8 2H37.7L39.2 4.4L40.7 2H41.6L39.6 5.2V8ZM42.5 8V2H43.4001L46.3 6.7V2H47.1V8H46.3L43.2 3.1V8H42.5ZM48.5 8V2H49.3001V8H48.5ZM49.2 1.5H48.5L49.0001 0.5H49.8001L49.2 1.5ZM52.6001 8V2H53.5L56.4 6.7V2H57.2V8H56.4L53.3 3.1V8H52.6001ZM58.1 8L60.4001 2H61.3L63.6 8H62.7L62.1 6.4H59.6L59.0001 8H58.1ZM59.8001 5.7H61.8001L60.8 3L59.8001 5.7Z"
|
|
60
|
-
fill="white"
|
|
61
|
-
stroke="white"
|
|
62
|
-
strokeWidth="0.138889"
|
|
63
|
-
/>
|
|
64
|
-
<defs>
|
|
65
|
-
<linearGradient
|
|
66
|
-
gradientUnits="userSpaceOnUse"
|
|
67
|
-
id="paint0_linear_2551_76392"
|
|
68
|
-
x1="7.93299"
|
|
69
|
-
x2="-2.72718"
|
|
70
|
-
y1="3.70975"
|
|
71
|
-
y2="14.3701"
|
|
72
|
-
>
|
|
73
|
-
<stop stopColor="#00A0FF" />
|
|
74
|
-
<stop
|
|
75
|
-
offset="0.00657"
|
|
76
|
-
stopColor="#00A1FF"
|
|
77
|
-
/>
|
|
78
|
-
<stop
|
|
79
|
-
offset="0.2601"
|
|
80
|
-
stopColor="#00BEFF"
|
|
81
|
-
/>
|
|
82
|
-
<stop
|
|
83
|
-
offset="0.5122"
|
|
84
|
-
stopColor="#00D2FF"
|
|
85
|
-
/>
|
|
86
|
-
<stop
|
|
87
|
-
offset="0.7604"
|
|
88
|
-
stopColor="#00DFFF"
|
|
89
|
-
/>
|
|
90
|
-
<stop
|
|
91
|
-
offset="1"
|
|
92
|
-
stopColor="#00E3FF"
|
|
93
|
-
/>
|
|
94
|
-
</linearGradient>
|
|
95
|
-
<linearGradient
|
|
96
|
-
gradientUnits="userSpaceOnUse"
|
|
97
|
-
id="paint1_linear_2551_76392"
|
|
98
|
-
x1="23.8343"
|
|
99
|
-
x2="-0.362575"
|
|
100
|
-
y1="15.0017"
|
|
101
|
-
y2="15.0017"
|
|
102
|
-
>
|
|
103
|
-
<stop stopColor="#FFE000" />
|
|
104
|
-
<stop
|
|
105
|
-
offset="0.4087"
|
|
106
|
-
stopColor="#FFBD00"
|
|
107
|
-
/>
|
|
108
|
-
<stop
|
|
109
|
-
offset="0.7754"
|
|
110
|
-
stopColor="#FFA500"
|
|
111
|
-
/>
|
|
112
|
-
<stop
|
|
113
|
-
offset="1"
|
|
114
|
-
stopColor="#FF9C00"
|
|
115
|
-
/>
|
|
116
|
-
</linearGradient>
|
|
117
|
-
<linearGradient
|
|
118
|
-
gradientUnits="userSpaceOnUse"
|
|
119
|
-
id="paint2_linear_2551_76392"
|
|
120
|
-
x1="14.827"
|
|
121
|
-
x2="-3.33"
|
|
122
|
-
y1="18.9735"
|
|
123
|
-
y2="37.1305"
|
|
124
|
-
>
|
|
125
|
-
<stop stopColor="#FF3A44" />
|
|
126
|
-
<stop
|
|
127
|
-
offset="1"
|
|
128
|
-
stopColor="#C31162"
|
|
129
|
-
/>
|
|
130
|
-
</linearGradient>
|
|
131
|
-
<linearGradient
|
|
132
|
-
gradientUnits="userSpaceOnUse"
|
|
133
|
-
id="paint3_linear_2551_76392"
|
|
134
|
-
x1="-2.70284"
|
|
135
|
-
x2="5.37702"
|
|
136
|
-
y1="0.672613"
|
|
137
|
-
y2="8.75243"
|
|
138
|
-
>
|
|
139
|
-
<stop stopColor="#32A071" />
|
|
140
|
-
<stop
|
|
141
|
-
offset="0.0685"
|
|
142
|
-
stopColor="#2DA771"
|
|
143
|
-
/>
|
|
144
|
-
<stop
|
|
145
|
-
offset="0.4762"
|
|
146
|
-
stopColor="#15CF74"
|
|
147
|
-
/>
|
|
148
|
-
<stop
|
|
149
|
-
offset="0.8009"
|
|
150
|
-
stopColor="#06E775"
|
|
151
|
-
/>
|
|
152
|
-
<stop
|
|
153
|
-
offset="1"
|
|
154
|
-
stopColor="#00F076"
|
|
155
|
-
/>
|
|
156
|
-
</linearGradient>
|
|
157
|
-
</defs>
|
|
158
|
-
</svg>
|
|
159
|
-
);
|