@teseor/css 1.5.0 → 1.7.0
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/dist/compiled.css +1 -1
- package/dist/index.css +16 -0
- package/package.json +1 -1
- package/src/04-components/forms/checkbox-group/checkbox-group-visual.png +0 -0
- package/src/04-components/forms/checkbox-group/checkbox-group.api.json +54 -0
- package/src/04-components/forms/checkbox-group/checkbox-group.docs.json +338 -0
- package/src/04-components/forms/checkbox-group/checkbox-group.visual.spec.ts +14 -0
- package/src/04-components/forms/checkbox-group/index.scss +84 -0
- package/src/04-components/forms/number-input/index.scss +153 -0
- package/src/04-components/forms/number-input/number-input-visual.png +0 -0
- package/src/04-components/forms/number-input/number-input.api.json +74 -0
- package/src/04-components/forms/number-input/number-input.docs.json +262 -0
- package/src/04-components/forms/number-input/number-input.visual.spec.ts +14 -0
- package/src/04-components/forms/password-input/index.scss +138 -0
- package/src/04-components/forms/password-input/password-input-visual.png +0 -0
- package/src/04-components/forms/password-input/password-input.api.json +84 -0
- package/src/04-components/forms/password-input/password-input.docs.json +276 -0
- package/src/04-components/forms/password-input/password-input.visual.spec.ts +14 -0
- package/src/04-components/forms/radio-group/index.scss +84 -0
- package/src/04-components/forms/radio-group/radio-group-visual.png +0 -0
- package/src/04-components/forms/radio-group/radio-group.api.json +54 -0
- package/src/04-components/forms/radio-group/radio-group.docs.json +350 -0
- package/src/04-components/forms/radio-group/radio-group.visual.spec.ts +14 -0
- package/src/04-components/forms/search-input/index.scss +172 -0
- package/src/04-components/forms/search-input/search-input-visual.png +0 -0
- package/src/04-components/forms/search-input/search-input.api.json +85 -0
- package/src/04-components/forms/search-input/search-input.docs.json +257 -0
- package/src/04-components/forms/search-input/search-input.visual.spec.ts +14 -0
- package/src/04-components/forms/slider/index.scss +153 -0
- package/src/04-components/forms/slider/slider-visual.png +0 -0
- package/src/04-components/forms/slider/slider.api.json +70 -0
- package/src/04-components/forms/slider/slider.docs.json +144 -0
- package/src/04-components/forms/slider/slider.visual.spec.ts +14 -0
- package/src/04-components/index.scss +8 -0
- package/src/04-components/layout/scroll-area/index.scss +92 -0
- package/src/04-components/layout/scroll-area/scroll-area-visual.png +0 -0
- package/src/04-components/layout/scroll-area/scroll-area.api.json +63 -0
- package/src/04-components/layout/scroll-area/scroll-area.docs.json +204 -0
- package/src/04-components/layout/scroll-area/scroll-area.visual.spec.ts +14 -0
- package/src/04-components/navigation/dropdown-menu/dropdown-menu-visual.png +0 -0
- package/src/04-components/navigation/dropdown-menu/dropdown-menu.api.json +37 -0
- package/src/04-components/navigation/dropdown-menu/dropdown-menu.docs.json +272 -0
- package/src/04-components/navigation/dropdown-menu/dropdown-menu.visual.spec.ts +14 -0
- package/src/04-components/navigation/dropdown-menu/index.scss +84 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "search-input",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Search Input",
|
|
5
|
+
"description": "Search field with built-in search icon and optional clear button.",
|
|
6
|
+
"api": "./search-input.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "div",
|
|
15
|
+
"class": "ui-search-input",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"tag": "span",
|
|
19
|
+
"class": "ui-search-input__icon",
|
|
20
|
+
"children": [
|
|
21
|
+
{
|
|
22
|
+
"tag": "svg",
|
|
23
|
+
"attrs": { "viewBox": "0 0 24 24" },
|
|
24
|
+
"children": [
|
|
25
|
+
{ "tag": "circle", "attrs": { "cx": "11", "cy": "11", "r": "8" } },
|
|
26
|
+
{ "tag": "path", "attrs": { "d": "m21 21-4.3-4.3" } }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"tag": "input",
|
|
33
|
+
"class": "ui-search-input__field",
|
|
34
|
+
"attrs": { "type": "search", "placeholder": "Search..." }
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"code": "<div class=\"ui-search-input\">\n <span class=\"ui-search-input__icon\"><svg>...</svg></span>\n <input class=\"ui-search-input__field\" type=\"search\" placeholder=\"Search...\">\n</div>"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"title": "With Clear Button",
|
|
45
|
+
"examples": [
|
|
46
|
+
{
|
|
47
|
+
"items": [
|
|
48
|
+
{
|
|
49
|
+
"tag": "div",
|
|
50
|
+
"class": "ui-search-input ui-search-input--has-clear",
|
|
51
|
+
"children": [
|
|
52
|
+
{
|
|
53
|
+
"tag": "span",
|
|
54
|
+
"class": "ui-search-input__icon",
|
|
55
|
+
"children": [
|
|
56
|
+
{
|
|
57
|
+
"tag": "svg",
|
|
58
|
+
"attrs": { "viewBox": "0 0 24 24" },
|
|
59
|
+
"children": [
|
|
60
|
+
{ "tag": "circle", "attrs": { "cx": "11", "cy": "11", "r": "8" } },
|
|
61
|
+
{ "tag": "path", "attrs": { "d": "m21 21-4.3-4.3" } }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"tag": "input",
|
|
68
|
+
"class": "ui-search-input__field",
|
|
69
|
+
"attrs": { "type": "search", "value": "Design tokens" }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"tag": "button",
|
|
73
|
+
"class": "ui-search-input__clear",
|
|
74
|
+
"attrs": { "type": "button", "aria-label": "Clear search" },
|
|
75
|
+
"children": [
|
|
76
|
+
{
|
|
77
|
+
"tag": "svg",
|
|
78
|
+
"attrs": { "viewBox": "0 0 24 24" },
|
|
79
|
+
"children": [
|
|
80
|
+
{ "tag": "path", "attrs": { "d": "M18 6 6 18" } },
|
|
81
|
+
{ "tag": "path", "attrs": { "d": "m6 6 12 12" } }
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"code": "<div class=\"ui-search-input ui-search-input--has-clear\">\n <span class=\"ui-search-input__icon\"><svg>...</svg></span>\n <input class=\"ui-search-input__field\" type=\"search\" value=\"Design tokens\">\n <button class=\"ui-search-input__clear\" aria-label=\"Clear search\"><svg>...</svg></button>\n</div>"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"title": "Sizes",
|
|
95
|
+
"examples": [
|
|
96
|
+
{
|
|
97
|
+
"layout": "stack",
|
|
98
|
+
"items": [
|
|
99
|
+
{
|
|
100
|
+
"tag": "div",
|
|
101
|
+
"class": "ui-search-input ui-search-input--sm",
|
|
102
|
+
"children": [
|
|
103
|
+
{
|
|
104
|
+
"tag": "span",
|
|
105
|
+
"class": "ui-search-input__icon",
|
|
106
|
+
"children": [
|
|
107
|
+
{
|
|
108
|
+
"tag": "svg",
|
|
109
|
+
"attrs": { "viewBox": "0 0 24 24" },
|
|
110
|
+
"children": [
|
|
111
|
+
{ "tag": "circle", "attrs": { "cx": "11", "cy": "11", "r": "8" } },
|
|
112
|
+
{ "tag": "path", "attrs": { "d": "m21 21-4.3-4.3" } }
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"tag": "input",
|
|
119
|
+
"class": "ui-search-input__field",
|
|
120
|
+
"attrs": { "type": "search", "placeholder": "Small" }
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"tag": "div",
|
|
126
|
+
"class": "ui-search-input",
|
|
127
|
+
"children": [
|
|
128
|
+
{
|
|
129
|
+
"tag": "span",
|
|
130
|
+
"class": "ui-search-input__icon",
|
|
131
|
+
"children": [
|
|
132
|
+
{
|
|
133
|
+
"tag": "svg",
|
|
134
|
+
"attrs": { "viewBox": "0 0 24 24" },
|
|
135
|
+
"children": [
|
|
136
|
+
{ "tag": "circle", "attrs": { "cx": "11", "cy": "11", "r": "8" } },
|
|
137
|
+
{ "tag": "path", "attrs": { "d": "m21 21-4.3-4.3" } }
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"tag": "input",
|
|
144
|
+
"class": "ui-search-input__field",
|
|
145
|
+
"attrs": { "type": "search", "placeholder": "Default" }
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"tag": "div",
|
|
151
|
+
"class": "ui-search-input ui-search-input--lg",
|
|
152
|
+
"children": [
|
|
153
|
+
{
|
|
154
|
+
"tag": "span",
|
|
155
|
+
"class": "ui-search-input__icon",
|
|
156
|
+
"children": [
|
|
157
|
+
{
|
|
158
|
+
"tag": "svg",
|
|
159
|
+
"attrs": { "viewBox": "0 0 24 24" },
|
|
160
|
+
"children": [
|
|
161
|
+
{ "tag": "circle", "attrs": { "cx": "11", "cy": "11", "r": "8" } },
|
|
162
|
+
{ "tag": "path", "attrs": { "d": "m21 21-4.3-4.3" } }
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"tag": "input",
|
|
169
|
+
"class": "ui-search-input__field",
|
|
170
|
+
"attrs": { "type": "search", "placeholder": "Large" }
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"code": "<div class=\"ui-search-input ui-search-input--sm\">...</div>\n<div class=\"ui-search-input\">...</div>\n<div class=\"ui-search-input ui-search-input--lg\">...</div>"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"title": "Disabled",
|
|
181
|
+
"examples": [
|
|
182
|
+
{
|
|
183
|
+
"items": [
|
|
184
|
+
{
|
|
185
|
+
"tag": "div",
|
|
186
|
+
"class": "ui-search-input ui-search-input--disabled",
|
|
187
|
+
"children": [
|
|
188
|
+
{
|
|
189
|
+
"tag": "span",
|
|
190
|
+
"class": "ui-search-input__icon",
|
|
191
|
+
"children": [
|
|
192
|
+
{
|
|
193
|
+
"tag": "svg",
|
|
194
|
+
"attrs": { "viewBox": "0 0 24 24" },
|
|
195
|
+
"children": [
|
|
196
|
+
{ "tag": "circle", "attrs": { "cx": "11", "cy": "11", "r": "8" } },
|
|
197
|
+
{ "tag": "path", "attrs": { "d": "m21 21-4.3-4.3" } }
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"tag": "input",
|
|
204
|
+
"class": "ui-search-input__field",
|
|
205
|
+
"attrs": { "type": "search", "placeholder": "Disabled", "disabled": "" }
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"code": "<div class=\"ui-search-input ui-search-input--disabled\">\n <span class=\"ui-search-input__icon\"><svg>...</svg></span>\n <input class=\"ui-search-input__field\" type=\"search\" disabled>\n</div>"
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
"customization": [
|
|
216
|
+
{
|
|
217
|
+
"token": "--ui-search-input-height",
|
|
218
|
+
"default": "var(--ui-row-2)",
|
|
219
|
+
"description": "Default height"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"token": "--ui-search-input-height-sm",
|
|
223
|
+
"default": "calc(var(--ui-row) * 1.5)",
|
|
224
|
+
"description": "Small height"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"token": "--ui-search-input-height-lg",
|
|
228
|
+
"default": "calc(var(--ui-row) * 2.5)",
|
|
229
|
+
"description": "Large height"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"token": "--ui-search-input-bg",
|
|
233
|
+
"default": "var(--ui-color-bg)",
|
|
234
|
+
"description": "Background color"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"token": "--ui-search-input-border-color",
|
|
238
|
+
"default": "var(--ui-color-border-strong)",
|
|
239
|
+
"description": "Border color"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"token": "--ui-search-input-border-color-focus",
|
|
243
|
+
"default": "var(--ui-color-primary)",
|
|
244
|
+
"description": "Focus border color"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"token": "--ui-search-input-icon-color",
|
|
248
|
+
"default": "var(--ui-color-text-muted)",
|
|
249
|
+
"description": "Search icon color"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"token": "--ui-search-input-clear-color",
|
|
253
|
+
"default": "var(--ui-color-text-muted)",
|
|
254
|
+
"description": "Clear button color"
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import { saveForLostPixel, setupVisualTestFromDocs, validateGridRhythm } from '../../../testing';
|
|
4
|
+
|
|
5
|
+
const DOCS_PATH = resolve(__dirname, 'search-input.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('search-input visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'search-input');
|
|
11
|
+
await saveForLostPixel(page, 'search-input');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('search-input.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// @component slider
|
|
4
|
+
// @element input[type="range"]
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.slider {
|
|
8
|
+
--_height: var(--ui-slider-height, var(--ui-row-2, #{t.$row-2}));
|
|
9
|
+
--_track-height: var(--ui-slider-track-height, #{t.$unit});
|
|
10
|
+
--_track-bg: var(--ui-slider-track-bg, var(--ui-color-bg-subtle, rgb(0 0 0 / 0.1)));
|
|
11
|
+
--_track-fill: var(--ui-slider-track-fill, var(--ui-color-primary));
|
|
12
|
+
--_track-radius: var(--ui-slider-track-radius, var(--ui-radius-full, #{t.$radius-full}));
|
|
13
|
+
--_thumb-size: var(--ui-slider-thumb-size, calc(#{t.$unit} * 2.5));
|
|
14
|
+
--_thumb-bg: var(--ui-slider-thumb-bg, var(--ui-color-bg, #{t.$color-bg}));
|
|
15
|
+
--_thumb-border-color: var(--ui-slider-thumb-border-color, var(--ui-color-primary));
|
|
16
|
+
--_thumb-border-width: var(--ui-slider-thumb-border-width, var(--ui-border-width-md, #{t.$border-width-md}));
|
|
17
|
+
--_thumb-radius: var(--ui-slider-thumb-radius, var(--ui-radius-full, #{t.$radius-full}));
|
|
18
|
+
--_thumb-shadow: var(--ui-slider-thumb-shadow, 0 1px 3px rgb(0 0 0 / 0.2));
|
|
19
|
+
--_focus-ring: var(--ui-slider-focus-ring, var(--ui-color-focus, #{t.$color-focus}));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// @modifier size
|
|
23
|
+
.slider--sm {
|
|
24
|
+
--_height: var(--ui-slider-height-sm, calc(#{t.$row} * 1.5));
|
|
25
|
+
--_track-height: calc(#{t.$unit} * 0.5);
|
|
26
|
+
--_thumb-size: calc(#{t.$unit} * 2);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.slider--lg {
|
|
30
|
+
--_height: var(--ui-slider-height-lg, calc(#{t.$row} * 2.5));
|
|
31
|
+
--_track-height: calc(#{t.$unit} * 1.5);
|
|
32
|
+
--_thumb-size: calc(#{t.$unit} * 3);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// @modifier color
|
|
36
|
+
.slider--success {
|
|
37
|
+
--_track-fill: var(--ui-color-success);
|
|
38
|
+
--_thumb-border-color: var(--ui-color-success);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.slider--warning {
|
|
42
|
+
--_track-fill: var(--ui-color-warning);
|
|
43
|
+
--_thumb-border-color: var(--ui-color-warning);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.slider--danger {
|
|
47
|
+
--_track-fill: var(--ui-color-danger);
|
|
48
|
+
--_thumb-border-color: var(--ui-color-danger);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@layer components.styles {
|
|
53
|
+
.slider {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
|
|
57
|
+
block-size: var(--_height);
|
|
58
|
+
inline-size: 100%;
|
|
59
|
+
padding: 0;
|
|
60
|
+
margin: 0;
|
|
61
|
+
|
|
62
|
+
background: transparent;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
appearance: none;
|
|
65
|
+
|
|
66
|
+
// Webkit track
|
|
67
|
+
&::-webkit-slider-runnable-track {
|
|
68
|
+
block-size: var(--_track-height);
|
|
69
|
+
|
|
70
|
+
background: var(--_track-bg);
|
|
71
|
+
border-radius: var(--_track-radius);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Firefox track
|
|
75
|
+
&::-moz-range-track {
|
|
76
|
+
block-size: var(--_track-height);
|
|
77
|
+
|
|
78
|
+
background: var(--_track-bg);
|
|
79
|
+
border: none;
|
|
80
|
+
border-radius: var(--_track-radius);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Firefox filled portion
|
|
84
|
+
&::-moz-range-progress {
|
|
85
|
+
block-size: var(--_track-height);
|
|
86
|
+
|
|
87
|
+
background: var(--_track-fill);
|
|
88
|
+
border-radius: var(--_track-radius);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Webkit thumb
|
|
92
|
+
&::-webkit-slider-thumb {
|
|
93
|
+
block-size: var(--_thumb-size);
|
|
94
|
+
inline-size: var(--_thumb-size);
|
|
95
|
+
margin-block-start: calc((var(--_track-height) - var(--_thumb-size)) / 2);
|
|
96
|
+
|
|
97
|
+
background: var(--_thumb-bg);
|
|
98
|
+
border: var(--_thumb-border-width) solid var(--_thumb-border-color);
|
|
99
|
+
border-radius: var(--_thumb-radius);
|
|
100
|
+
box-shadow: var(--_thumb-shadow);
|
|
101
|
+
appearance: none;
|
|
102
|
+
|
|
103
|
+
transition:
|
|
104
|
+
box-shadow var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease),
|
|
105
|
+
transform var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Firefox thumb
|
|
109
|
+
&::-moz-range-thumb {
|
|
110
|
+
block-size: var(--_thumb-size);
|
|
111
|
+
inline-size: var(--_thumb-size);
|
|
112
|
+
|
|
113
|
+
background: var(--_thumb-bg);
|
|
114
|
+
border: var(--_thumb-border-width) solid var(--_thumb-border-color);
|
|
115
|
+
border-radius: var(--_thumb-radius);
|
|
116
|
+
box-shadow: var(--_thumb-shadow);
|
|
117
|
+
|
|
118
|
+
transition:
|
|
119
|
+
box-shadow var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease),
|
|
120
|
+
transform var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Focus state
|
|
124
|
+
&:focus-visible {
|
|
125
|
+
outline: none;
|
|
126
|
+
|
|
127
|
+
&::-webkit-slider-thumb {
|
|
128
|
+
box-shadow: 0 0 0 var(--ui-border-width-md, #{t.$border-width-md}) var(--_focus-ring);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&::-moz-range-thumb {
|
|
132
|
+
box-shadow: 0 0 0 var(--ui-border-width-md, #{t.$border-width-md}) var(--_focus-ring);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Hover state
|
|
137
|
+
&:hover:not(:disabled) {
|
|
138
|
+
&::-webkit-slider-thumb {
|
|
139
|
+
transform: scale(1.1);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&::-moz-range-thumb {
|
|
143
|
+
transform: scale(1.1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Disabled state
|
|
148
|
+
&:disabled {
|
|
149
|
+
opacity: 0.5;
|
|
150
|
+
cursor: not-allowed;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "slider",
|
|
3
|
+
"element": "input",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm", "lg"]
|
|
7
|
+
},
|
|
8
|
+
"color": {
|
|
9
|
+
"values": ["success", "warning", "danger"]
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"cssVars": [
|
|
13
|
+
{
|
|
14
|
+
"name": "--ui-slider-height",
|
|
15
|
+
"default": "var(--ui-row-2)"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "--ui-slider-height-sm",
|
|
19
|
+
"default": "calc(var(--ui-row) * 1.5)"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "--ui-slider-height-lg",
|
|
23
|
+
"default": "calc(var(--ui-row) * 2.5)"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "--ui-slider-track-height",
|
|
27
|
+
"default": "var(--ui-unit)"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "--ui-slider-track-bg",
|
|
31
|
+
"default": "var(--ui-color-bg-subtle)"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "--ui-slider-track-fill",
|
|
35
|
+
"default": "var(--ui-color-primary)"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "--ui-slider-track-radius",
|
|
39
|
+
"default": "var(--ui-radius-full)"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "--ui-slider-thumb-size",
|
|
43
|
+
"default": "calc(var(--ui-unit) * 2.5)"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "--ui-slider-thumb-bg",
|
|
47
|
+
"default": "var(--ui-color-bg)"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "--ui-slider-thumb-border-color",
|
|
51
|
+
"default": "var(--ui-color-primary)"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "--ui-slider-thumb-border-width",
|
|
55
|
+
"default": "var(--ui-border-width-md)"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "--ui-slider-thumb-radius",
|
|
59
|
+
"default": "var(--ui-radius-full)"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "--ui-slider-thumb-shadow",
|
|
63
|
+
"default": "0 1px 3px rgb(0 0 0 / 0.2)"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "--ui-slider-focus-ring",
|
|
67
|
+
"default": "var(--ui-color-focus)"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "slider",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Slider",
|
|
5
|
+
"description": "Range value selection. Styles the native range input cross-browser for track and thumb.",
|
|
6
|
+
"api": "./slider.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "input",
|
|
15
|
+
"class": "ui-slider",
|
|
16
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "50" }
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"code": "<input type=\"range\" class=\"ui-slider\" min=\"0\" max=\"100\" value=\"50\">"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"title": "Sizes",
|
|
25
|
+
"examples": [
|
|
26
|
+
{
|
|
27
|
+
"layout": "stack",
|
|
28
|
+
"items": [
|
|
29
|
+
{
|
|
30
|
+
"tag": "input",
|
|
31
|
+
"class": "ui-slider ui-slider--sm",
|
|
32
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "30" }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"tag": "input",
|
|
36
|
+
"class": "ui-slider",
|
|
37
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "50" }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"tag": "input",
|
|
41
|
+
"class": "ui-slider ui-slider--lg",
|
|
42
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "70" }
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"code": "<input type=\"range\" class=\"ui-slider ui-slider--sm\" value=\"30\">\n<input type=\"range\" class=\"ui-slider\" value=\"50\">\n<input type=\"range\" class=\"ui-slider ui-slider--lg\" value=\"70\">"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"title": "Colors",
|
|
51
|
+
"examples": [
|
|
52
|
+
{
|
|
53
|
+
"layout": "stack",
|
|
54
|
+
"items": [
|
|
55
|
+
{
|
|
56
|
+
"tag": "input",
|
|
57
|
+
"class": "ui-slider",
|
|
58
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "50" }
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"tag": "input",
|
|
62
|
+
"class": "ui-slider ui-slider--success",
|
|
63
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "80" }
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"tag": "input",
|
|
67
|
+
"class": "ui-slider ui-slider--warning",
|
|
68
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "60" }
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"tag": "input",
|
|
72
|
+
"class": "ui-slider ui-slider--danger",
|
|
73
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "25" }
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"code": "<input type=\"range\" class=\"ui-slider\" value=\"50\">\n<input type=\"range\" class=\"ui-slider ui-slider--success\" value=\"80\">\n<input type=\"range\" class=\"ui-slider ui-slider--warning\" value=\"60\">\n<input type=\"range\" class=\"ui-slider ui-slider--danger\" value=\"25\">"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"title": "Disabled",
|
|
82
|
+
"examples": [
|
|
83
|
+
{
|
|
84
|
+
"layout": "stack",
|
|
85
|
+
"items": [
|
|
86
|
+
{
|
|
87
|
+
"tag": "input",
|
|
88
|
+
"class": "ui-slider",
|
|
89
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "40", "disabled": "" }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"tag": "input",
|
|
93
|
+
"class": "ui-slider ui-slider--success",
|
|
94
|
+
"attrs": { "type": "range", "min": "0", "max": "100", "value": "70", "disabled": "" }
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"code": "<input type=\"range\" class=\"ui-slider\" value=\"40\" disabled>\n<input type=\"range\" class=\"ui-slider ui-slider--success\" value=\"70\" disabled>"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"customization": [
|
|
103
|
+
{
|
|
104
|
+
"token": "--ui-slider-height",
|
|
105
|
+
"default": "var(--ui-row-2)",
|
|
106
|
+
"description": "Component height (clickable area)"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"token": "--ui-slider-track-height",
|
|
110
|
+
"default": "var(--ui-unit)",
|
|
111
|
+
"description": "Track bar height"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"token": "--ui-slider-track-bg",
|
|
115
|
+
"default": "var(--ui-color-bg-subtle)",
|
|
116
|
+
"description": "Track background"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"token": "--ui-slider-track-fill",
|
|
120
|
+
"default": "var(--ui-color-primary)",
|
|
121
|
+
"description": "Filled portion color (Firefox)"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"token": "--ui-slider-thumb-size",
|
|
125
|
+
"default": "calc(var(--ui-unit) * 2.5)",
|
|
126
|
+
"description": "Thumb diameter"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"token": "--ui-slider-thumb-bg",
|
|
130
|
+
"default": "var(--ui-color-bg)",
|
|
131
|
+
"description": "Thumb background"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"token": "--ui-slider-thumb-border-color",
|
|
135
|
+
"default": "var(--ui-color-primary)",
|
|
136
|
+
"description": "Thumb border color"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"token": "--ui-slider-focus-ring",
|
|
140
|
+
"default": "var(--ui-color-focus)",
|
|
141
|
+
"description": "Focus ring color"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import { saveForLostPixel, setupVisualTestFromDocs, validateGridRhythm } from '../../../testing';
|
|
4
|
+
|
|
5
|
+
const DOCS_PATH = resolve(__dirname, 'slider.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('slider visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'slider');
|
|
11
|
+
await saveForLostPixel(page, 'slider');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('slider.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
@forward './feedback/spinner/index';
|
|
21
21
|
@forward './feedback/toast/index';
|
|
22
22
|
@forward './forms/checkbox/index';
|
|
23
|
+
@forward './forms/checkbox-group/index';
|
|
23
24
|
@forward './forms/field/index';
|
|
24
25
|
@forward './forms/fieldset/index';
|
|
25
26
|
@forward './forms/form/index';
|
|
@@ -27,13 +28,20 @@
|
|
|
27
28
|
@forward './forms/form-helper/index';
|
|
28
29
|
@forward './forms/input/index';
|
|
29
30
|
@forward './forms/label/index';
|
|
31
|
+
@forward './forms/number-input/index';
|
|
32
|
+
@forward './forms/password-input/index';
|
|
30
33
|
@forward './forms/radio/index';
|
|
34
|
+
@forward './forms/radio-group/index';
|
|
35
|
+
@forward './forms/search-input/index';
|
|
31
36
|
@forward './forms/select/index';
|
|
37
|
+
@forward './forms/slider/index';
|
|
32
38
|
@forward './forms/textarea/index';
|
|
33
39
|
@forward './forms/toggle/index';
|
|
34
40
|
@forward './layout/divider/index';
|
|
41
|
+
@forward './layout/scroll-area/index';
|
|
35
42
|
@forward './layout/spacer/index';
|
|
36
43
|
@forward './navigation/breadcrumb/index';
|
|
44
|
+
@forward './navigation/dropdown-menu/index';
|
|
37
45
|
@forward './navigation/menu/index';
|
|
38
46
|
@forward './navigation/nav/index';
|
|
39
47
|
@forward './navigation/pagination/index';
|