@teseor/css 1.4.0 → 1.6.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 +22 -0
- package/package.json +1 -1
- package/src/04-components/actions/close-button/close-button-visual.png +0 -0
- package/src/04-components/actions/close-button/close-button.api.json +71 -0
- package/src/04-components/actions/close-button/close-button.docs.json +264 -0
- package/src/04-components/actions/close-button/close-button.visual.spec.ts +14 -0
- package/src/04-components/actions/close-button/index.scss +101 -0
- package/src/04-components/data-display/image/image-visual.png +0 -0
- package/src/04-components/data-display/image/image.api.json +76 -0
- package/src/04-components/data-display/image/image.docs.json +337 -0
- package/src/04-components/data-display/image/image.visual.spec.ts +14 -0
- package/src/04-components/data-display/image/index.scss +103 -0
- package/src/04-components/feedback/progress-circle/index.scss +92 -0
- package/src/04-components/feedback/progress-circle/progress-circle-visual.png +0 -0
- package/src/04-components/feedback/progress-circle/progress-circle.api.json +53 -0
- package/src/04-components/feedback/progress-circle/progress-circle.docs.json +377 -0
- package/src/04-components/feedback/progress-circle/progress-circle.visual.spec.ts +14 -0
- 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/fieldset/fieldset-visual.png +0 -0
- package/src/04-components/forms/fieldset/fieldset.api.json +49 -0
- package/src/04-components/forms/fieldset/fieldset.docs.json +520 -0
- package/src/04-components/forms/fieldset/fieldset.visual.spec.ts +14 -0
- package/src/04-components/forms/fieldset/index.scss +69 -0
- package/src/04-components/forms/form/form-visual.png +0 -0
- package/src/04-components/forms/form/form.api.json +38 -0
- package/src/04-components/forms/form/form.docs.json +482 -0
- package/src/04-components/forms/form/form.visual.spec.ts +14 -0
- package/src/04-components/forms/form/index.scss +62 -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 +11 -0
- package/src/04-components/typography/code-block/code-block-visual.png +0 -0
- package/src/04-components/typography/code-block/code-block.api.json +56 -0
- package/src/04-components/typography/code-block/code-block.docs.json +289 -0
- package/src/04-components/typography/code-block/code-block.visual.spec.ts +14 -0
- package/src/04-components/typography/code-block/index.scss +87 -0
- package/src/04-components/typography/list/index.scss +65 -0
- package/src/04-components/typography/list/list-visual.png +0 -0
- package/src/04-components/typography/list/list.api.json +33 -0
- package/src/04-components/typography/list/list.docs.json +293 -0
- package/src/04-components/typography/list/list.visual.spec.ts +14 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "radio-group",
|
|
3
|
+
"element": "fieldset",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"horizontal": {
|
|
6
|
+
"type": "boolean"
|
|
7
|
+
},
|
|
8
|
+
"compact": {
|
|
9
|
+
"type": "boolean"
|
|
10
|
+
},
|
|
11
|
+
"error": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"elements": {
|
|
16
|
+
"legend": {},
|
|
17
|
+
"items": {},
|
|
18
|
+
"item": {}
|
|
19
|
+
},
|
|
20
|
+
"cssVars": [
|
|
21
|
+
{
|
|
22
|
+
"name": "--ui-radio-group-spacing",
|
|
23
|
+
"default": "var(--ui-space-1)"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "--ui-radio-group-spacing-compact",
|
|
27
|
+
"default": "0"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "--ui-radio-group-legend-size",
|
|
31
|
+
"default": "var(--ui-font-size-sm)"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "--ui-radio-group-legend-weight",
|
|
35
|
+
"default": "var(--ui-weight-medium)"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "--ui-radio-group-legend-color",
|
|
39
|
+
"default": "var(--ui-color-text)"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "--ui-radio-group-legend-spacing",
|
|
43
|
+
"default": "var(--ui-space-1)"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "--ui-radio-group-item-gap",
|
|
47
|
+
"default": "var(--ui-space-1)"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "--ui-radio-group-error-color",
|
|
51
|
+
"default": "var(--ui-color-danger)"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "radio-group",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Radio Group",
|
|
5
|
+
"description": "Groups related radio buttons with a legend for single selection. Built on native fieldset semantics.",
|
|
6
|
+
"api": "./radio-group.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "fieldset",
|
|
15
|
+
"class": "ui-radio-group",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"tag": "legend",
|
|
19
|
+
"class": "ui-radio-group__legend",
|
|
20
|
+
"text": "Payment method"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"tag": "div",
|
|
24
|
+
"class": "ui-radio-group__items",
|
|
25
|
+
"children": [
|
|
26
|
+
{
|
|
27
|
+
"tag": "label",
|
|
28
|
+
"class": "ui-radio-group__item",
|
|
29
|
+
"children": [
|
|
30
|
+
{
|
|
31
|
+
"tag": "input",
|
|
32
|
+
"class": "ui-radio",
|
|
33
|
+
"attrs": { "type": "radio", "name": "payment", "checked": "" }
|
|
34
|
+
},
|
|
35
|
+
{ "tag": "span", "text": "Credit card" }
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"tag": "label",
|
|
40
|
+
"class": "ui-radio-group__item",
|
|
41
|
+
"children": [
|
|
42
|
+
{
|
|
43
|
+
"tag": "input",
|
|
44
|
+
"class": "ui-radio",
|
|
45
|
+
"attrs": { "type": "radio", "name": "payment" }
|
|
46
|
+
},
|
|
47
|
+
{ "tag": "span", "text": "Debit card" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"tag": "label",
|
|
52
|
+
"class": "ui-radio-group__item",
|
|
53
|
+
"children": [
|
|
54
|
+
{
|
|
55
|
+
"tag": "input",
|
|
56
|
+
"class": "ui-radio",
|
|
57
|
+
"attrs": { "type": "radio", "name": "payment" }
|
|
58
|
+
},
|
|
59
|
+
{ "tag": "span", "text": "Bank transfer" }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"code": "<fieldset class=\"ui-radio-group\">\n <legend class=\"ui-radio-group__legend\">Payment method</legend>\n <div class=\"ui-radio-group__items\">\n <label class=\"ui-radio-group__item\">\n <input type=\"radio\" class=\"ui-radio\" name=\"payment\" checked>\n <span>Credit card</span>\n </label>\n ...\n </div>\n</fieldset>"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"title": "Horizontal",
|
|
73
|
+
"examples": [
|
|
74
|
+
{
|
|
75
|
+
"items": [
|
|
76
|
+
{
|
|
77
|
+
"tag": "fieldset",
|
|
78
|
+
"class": "ui-radio-group ui-radio-group--horizontal",
|
|
79
|
+
"children": [
|
|
80
|
+
{
|
|
81
|
+
"tag": "legend",
|
|
82
|
+
"class": "ui-radio-group__legend",
|
|
83
|
+
"text": "Size"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"tag": "div",
|
|
87
|
+
"class": "ui-radio-group__items",
|
|
88
|
+
"children": [
|
|
89
|
+
{
|
|
90
|
+
"tag": "label",
|
|
91
|
+
"class": "ui-radio-group__item",
|
|
92
|
+
"children": [
|
|
93
|
+
{
|
|
94
|
+
"tag": "input",
|
|
95
|
+
"class": "ui-radio",
|
|
96
|
+
"attrs": { "type": "radio", "name": "size", "checked": "" }
|
|
97
|
+
},
|
|
98
|
+
{ "tag": "span", "text": "Small" }
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"tag": "label",
|
|
103
|
+
"class": "ui-radio-group__item",
|
|
104
|
+
"children": [
|
|
105
|
+
{
|
|
106
|
+
"tag": "input",
|
|
107
|
+
"class": "ui-radio",
|
|
108
|
+
"attrs": { "type": "radio", "name": "size" }
|
|
109
|
+
},
|
|
110
|
+
{ "tag": "span", "text": "Medium" }
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"tag": "label",
|
|
115
|
+
"class": "ui-radio-group__item",
|
|
116
|
+
"children": [
|
|
117
|
+
{
|
|
118
|
+
"tag": "input",
|
|
119
|
+
"class": "ui-radio",
|
|
120
|
+
"attrs": { "type": "radio", "name": "size" }
|
|
121
|
+
},
|
|
122
|
+
{ "tag": "span", "text": "Large" }
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"code": "<fieldset class=\"ui-radio-group ui-radio-group--horizontal\">\n <legend class=\"ui-radio-group__legend\">Size</legend>\n ...\n</fieldset>"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"title": "Compact",
|
|
136
|
+
"examples": [
|
|
137
|
+
{
|
|
138
|
+
"items": [
|
|
139
|
+
{
|
|
140
|
+
"tag": "fieldset",
|
|
141
|
+
"class": "ui-radio-group ui-radio-group--compact",
|
|
142
|
+
"children": [
|
|
143
|
+
{
|
|
144
|
+
"tag": "legend",
|
|
145
|
+
"class": "ui-radio-group__legend",
|
|
146
|
+
"text": "Priority"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"tag": "div",
|
|
150
|
+
"class": "ui-radio-group__items",
|
|
151
|
+
"children": [
|
|
152
|
+
{
|
|
153
|
+
"tag": "label",
|
|
154
|
+
"class": "ui-radio-group__item",
|
|
155
|
+
"children": [
|
|
156
|
+
{
|
|
157
|
+
"tag": "input",
|
|
158
|
+
"class": "ui-radio",
|
|
159
|
+
"attrs": { "type": "radio", "name": "priority", "checked": "" }
|
|
160
|
+
},
|
|
161
|
+
{ "tag": "span", "text": "Low" }
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"tag": "label",
|
|
166
|
+
"class": "ui-radio-group__item",
|
|
167
|
+
"children": [
|
|
168
|
+
{
|
|
169
|
+
"tag": "input",
|
|
170
|
+
"class": "ui-radio",
|
|
171
|
+
"attrs": { "type": "radio", "name": "priority" }
|
|
172
|
+
},
|
|
173
|
+
{ "tag": "span", "text": "Medium" }
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"tag": "label",
|
|
178
|
+
"class": "ui-radio-group__item",
|
|
179
|
+
"children": [
|
|
180
|
+
{
|
|
181
|
+
"tag": "input",
|
|
182
|
+
"class": "ui-radio",
|
|
183
|
+
"attrs": { "type": "radio", "name": "priority" }
|
|
184
|
+
},
|
|
185
|
+
{ "tag": "span", "text": "High" }
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"code": "<fieldset class=\"ui-radio-group ui-radio-group--compact\">\n ...\n</fieldset>"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"title": "Error State",
|
|
199
|
+
"examples": [
|
|
200
|
+
{
|
|
201
|
+
"items": [
|
|
202
|
+
{
|
|
203
|
+
"tag": "fieldset",
|
|
204
|
+
"class": "ui-radio-group ui-radio-group--error",
|
|
205
|
+
"children": [
|
|
206
|
+
{
|
|
207
|
+
"tag": "legend",
|
|
208
|
+
"class": "ui-radio-group__legend",
|
|
209
|
+
"text": "Shipping"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"tag": "div",
|
|
213
|
+
"class": "ui-radio-group__items",
|
|
214
|
+
"children": [
|
|
215
|
+
{
|
|
216
|
+
"tag": "label",
|
|
217
|
+
"class": "ui-radio-group__item",
|
|
218
|
+
"children": [
|
|
219
|
+
{
|
|
220
|
+
"tag": "input",
|
|
221
|
+
"class": "ui-radio ui-radio--error",
|
|
222
|
+
"attrs": { "type": "radio", "name": "shipping" }
|
|
223
|
+
},
|
|
224
|
+
{ "tag": "span", "text": "Standard" }
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"tag": "label",
|
|
229
|
+
"class": "ui-radio-group__item",
|
|
230
|
+
"children": [
|
|
231
|
+
{
|
|
232
|
+
"tag": "input",
|
|
233
|
+
"class": "ui-radio ui-radio--error",
|
|
234
|
+
"attrs": { "type": "radio", "name": "shipping" }
|
|
235
|
+
},
|
|
236
|
+
{ "tag": "span", "text": "Express" }
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"tag": "span",
|
|
243
|
+
"class": "ui-form-error",
|
|
244
|
+
"text": "Please select a shipping method"
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"code": "<fieldset class=\"ui-radio-group ui-radio-group--error\">\n <legend class=\"ui-radio-group__legend\">Shipping</legend>\n <div class=\"ui-radio-group__items\">\n <label class=\"ui-radio-group__item\">\n <input type=\"radio\" class=\"ui-radio ui-radio--error\" name=\"shipping\">\n <span>Standard</span>\n </label>\n ...\n </div>\n <span class=\"ui-form-error\">Please select a shipping method</span>\n</fieldset>"
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"title": "Disabled",
|
|
255
|
+
"examples": [
|
|
256
|
+
{
|
|
257
|
+
"items": [
|
|
258
|
+
{
|
|
259
|
+
"tag": "fieldset",
|
|
260
|
+
"class": "ui-radio-group",
|
|
261
|
+
"attrs": { "disabled": "" },
|
|
262
|
+
"children": [
|
|
263
|
+
{
|
|
264
|
+
"tag": "legend",
|
|
265
|
+
"class": "ui-radio-group__legend",
|
|
266
|
+
"text": "Plan (locked)"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"tag": "div",
|
|
270
|
+
"class": "ui-radio-group__items",
|
|
271
|
+
"children": [
|
|
272
|
+
{
|
|
273
|
+
"tag": "label",
|
|
274
|
+
"class": "ui-radio-group__item",
|
|
275
|
+
"children": [
|
|
276
|
+
{
|
|
277
|
+
"tag": "input",
|
|
278
|
+
"class": "ui-radio",
|
|
279
|
+
"attrs": { "type": "radio", "name": "plan", "checked": "" }
|
|
280
|
+
},
|
|
281
|
+
{ "tag": "span", "text": "Free" }
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"tag": "label",
|
|
286
|
+
"class": "ui-radio-group__item",
|
|
287
|
+
"children": [
|
|
288
|
+
{
|
|
289
|
+
"tag": "input",
|
|
290
|
+
"class": "ui-radio",
|
|
291
|
+
"attrs": { "type": "radio", "name": "plan" }
|
|
292
|
+
},
|
|
293
|
+
{ "tag": "span", "text": "Pro" }
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"tag": "label",
|
|
298
|
+
"class": "ui-radio-group__item",
|
|
299
|
+
"children": [
|
|
300
|
+
{
|
|
301
|
+
"tag": "input",
|
|
302
|
+
"class": "ui-radio",
|
|
303
|
+
"attrs": { "type": "radio", "name": "plan" }
|
|
304
|
+
},
|
|
305
|
+
{ "tag": "span", "text": "Enterprise" }
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
"code": "<fieldset class=\"ui-radio-group\" disabled>\n ...\n</fieldset>"
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
"customization": [
|
|
319
|
+
{
|
|
320
|
+
"token": "--ui-radio-group-spacing",
|
|
321
|
+
"default": "var(--ui-space-1)",
|
|
322
|
+
"description": "Gap between radio items"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"token": "--ui-radio-group-legend-size",
|
|
326
|
+
"default": "var(--ui-font-size-sm)",
|
|
327
|
+
"description": "Legend font size"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"token": "--ui-radio-group-legend-weight",
|
|
331
|
+
"default": "var(--ui-weight-medium)",
|
|
332
|
+
"description": "Legend font weight"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"token": "--ui-radio-group-legend-color",
|
|
336
|
+
"default": "var(--ui-color-text)",
|
|
337
|
+
"description": "Legend text color"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"token": "--ui-radio-group-item-gap",
|
|
341
|
+
"default": "var(--ui-space-1)",
|
|
342
|
+
"description": "Gap between radio and label text"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"token": "--ui-radio-group-error-color",
|
|
346
|
+
"default": "var(--ui-color-danger)",
|
|
347
|
+
"description": "Legend color in error state"
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
}
|
|
@@ -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, 'radio-group.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('radio-group visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'radio-group');
|
|
11
|
+
await saveForLostPixel(page, 'radio-group');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('radio-group.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// @component search-input
|
|
4
|
+
// @element div
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.search-input {
|
|
8
|
+
--_height: var(--ui-search-input-height, var(--ui-row-2, #{t.$row-2}));
|
|
9
|
+
--_padding-x: var(--ui-search-input-padding-x, var(--ui-space-1, #{t.$space-1}));
|
|
10
|
+
--_font-size: var(--ui-search-input-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
|
|
11
|
+
--_radius: var(--ui-search-input-radius, var(--ui-radius-md, #{t.$radius-md}));
|
|
12
|
+
--_bg: var(--ui-search-input-bg, var(--ui-color-bg, #{t.$color-bg}));
|
|
13
|
+
--_border-color: var(--ui-search-input-border-color, var(--ui-color-border-strong, #{t.$color-border-strong}));
|
|
14
|
+
--_border-color-focus: var(--ui-search-input-border-color-focus, var(--ui-color-primary, #{t.$color-primary}));
|
|
15
|
+
--_text: var(--ui-search-input-text, var(--ui-color-text, #{t.$color-text}));
|
|
16
|
+
--_placeholder: var(--ui-search-input-placeholder, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
17
|
+
--_icon-color: var(--ui-search-input-icon-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
18
|
+
--_icon-size: var(--ui-search-input-icon-size, var(--ui-size-md, #{t.size(md)}));
|
|
19
|
+
--_clear-color: var(--ui-search-input-clear-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
20
|
+
--_clear-hover-bg: var(--ui-search-input-clear-hover-bg, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// @modifier size
|
|
24
|
+
.search-input--sm {
|
|
25
|
+
--_height: var(--ui-search-input-height-sm, calc(#{t.$row} * 1.5));
|
|
26
|
+
--_font-size: var(--ui-search-input-font-size-sm, var(--ui-font-size-xs, #{t.$font-size-xs}));
|
|
27
|
+
--_icon-size: var(--ui-search-input-icon-size-sm, var(--ui-size-sm, #{t.size(sm)}));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.search-input--lg {
|
|
31
|
+
--_height: var(--ui-search-input-height-lg, calc(#{t.$row} * 2.5));
|
|
32
|
+
--_padding-x: var(--ui-search-input-padding-x-lg, var(--ui-space-2, #{t.$space-2}));
|
|
33
|
+
--_font-size: var(--ui-search-input-font-size-lg, var(--ui-font-size-md, #{t.$font-size-md}));
|
|
34
|
+
--_icon-size: var(--ui-search-input-icon-size-lg, var(--ui-size-lg, #{t.size(lg)}));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@layer components.styles {
|
|
39
|
+
.search-input {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
|
|
43
|
+
block-size: var(--_height);
|
|
44
|
+
|
|
45
|
+
background: var(--_bg);
|
|
46
|
+
border: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
|
|
47
|
+
border-radius: var(--_radius);
|
|
48
|
+
|
|
49
|
+
transition:
|
|
50
|
+
border-color var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease),
|
|
51
|
+
box-shadow var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
|
|
52
|
+
|
|
53
|
+
// Focus via inner field
|
|
54
|
+
&:focus-within,
|
|
55
|
+
&--focus {
|
|
56
|
+
border-color: var(--_border-color-focus);
|
|
57
|
+
box-shadow: 0 0 0 var(--ui-border-width-md, #{t.$border-width-md}) var(--ui-color-focus, #{t.$color-focus});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Full width
|
|
61
|
+
&--block {
|
|
62
|
+
inline-size: 100%;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Disabled
|
|
66
|
+
&--disabled,
|
|
67
|
+
&:has(.search-input__field:disabled) {
|
|
68
|
+
opacity: 0.5;
|
|
69
|
+
cursor: not-allowed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Search icon
|
|
74
|
+
.search-input__icon {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
|
|
80
|
+
inline-size: var(--_height);
|
|
81
|
+
|
|
82
|
+
color: var(--_icon-color);
|
|
83
|
+
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
|
|
86
|
+
svg {
|
|
87
|
+
block-size: var(--_icon-size);
|
|
88
|
+
inline-size: var(--_icon-size);
|
|
89
|
+
|
|
90
|
+
fill: none;
|
|
91
|
+
stroke: currentcolor;
|
|
92
|
+
stroke-width: 2;
|
|
93
|
+
stroke-linecap: round;
|
|
94
|
+
stroke-linejoin: round;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Native search input
|
|
99
|
+
.search-input__field {
|
|
100
|
+
flex: 1;
|
|
101
|
+
|
|
102
|
+
block-size: 100%;
|
|
103
|
+
min-inline-size: 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
padding-inline-end: var(--_padding-x);
|
|
106
|
+
|
|
107
|
+
font-family: inherit;
|
|
108
|
+
font-size: var(--_font-size);
|
|
109
|
+
line-height: 1;
|
|
110
|
+
color: var(--_text);
|
|
111
|
+
|
|
112
|
+
background: transparent;
|
|
113
|
+
border: none;
|
|
114
|
+
outline: none;
|
|
115
|
+
|
|
116
|
+
&::placeholder {
|
|
117
|
+
color: var(--_placeholder);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Suppress native webkit cancel button
|
|
121
|
+
&::-webkit-search-cancel-button,
|
|
122
|
+
&::-webkit-search-decoration {
|
|
123
|
+
appearance: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Field padding when clear button present
|
|
128
|
+
.search-input--has-clear .search-input__field {
|
|
129
|
+
padding-inline-end: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Clear button
|
|
133
|
+
.search-input__clear {
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-shrink: 0;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
|
|
139
|
+
block-size: calc(var(--_height) - var(--ui-space-half, #{t.$space-0}) * 2);
|
|
140
|
+
inline-size: calc(var(--_height) - var(--ui-space-half, #{t.$space-0}) * 2);
|
|
141
|
+
margin-inline-end: calc(var(--ui-space-half, #{t.$space-0}));
|
|
142
|
+
|
|
143
|
+
color: var(--_clear-color);
|
|
144
|
+
|
|
145
|
+
background: transparent;
|
|
146
|
+
border: none;
|
|
147
|
+
border-radius: var(--ui-radius-sm, #{t.$radius-sm});
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
|
|
150
|
+
transition: background var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
|
|
151
|
+
|
|
152
|
+
&:hover {
|
|
153
|
+
background: var(--_clear-hover-bg);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&:focus-visible {
|
|
157
|
+
outline: 2px solid var(--ui-color-focus, #{t.$color-focus});
|
|
158
|
+
outline-offset: -2px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
svg {
|
|
162
|
+
block-size: var(--_icon-size);
|
|
163
|
+
inline-size: var(--_icon-size);
|
|
164
|
+
|
|
165
|
+
fill: none;
|
|
166
|
+
stroke: currentcolor;
|
|
167
|
+
stroke-width: 2;
|
|
168
|
+
stroke-linecap: round;
|
|
169
|
+
stroke-linejoin: round;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "search-input",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm", "lg"]
|
|
7
|
+
},
|
|
8
|
+
"has-clear": {
|
|
9
|
+
"type": "boolean"
|
|
10
|
+
},
|
|
11
|
+
"block": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
},
|
|
14
|
+
"disabled": {
|
|
15
|
+
"type": "boolean"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"elements": {
|
|
19
|
+
"icon": {},
|
|
20
|
+
"field": {},
|
|
21
|
+
"clear": {}
|
|
22
|
+
},
|
|
23
|
+
"cssVars": [
|
|
24
|
+
{
|
|
25
|
+
"name": "--ui-search-input-height",
|
|
26
|
+
"default": "var(--ui-row-2)"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "--ui-search-input-height-sm",
|
|
30
|
+
"default": "calc(var(--ui-row) * 1.5)"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "--ui-search-input-height-lg",
|
|
34
|
+
"default": "calc(var(--ui-row) * 2.5)"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "--ui-search-input-padding-x",
|
|
38
|
+
"default": "var(--ui-space-1)"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "--ui-search-input-font-size",
|
|
42
|
+
"default": "var(--ui-font-size-sm)"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "--ui-search-input-radius",
|
|
46
|
+
"default": "var(--ui-radius-md)"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "--ui-search-input-bg",
|
|
50
|
+
"default": "var(--ui-color-bg)"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "--ui-search-input-border-color",
|
|
54
|
+
"default": "var(--ui-color-border-strong)"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "--ui-search-input-border-color-focus",
|
|
58
|
+
"default": "var(--ui-color-primary)"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "--ui-search-input-text",
|
|
62
|
+
"default": "var(--ui-color-text)"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "--ui-search-input-placeholder",
|
|
66
|
+
"default": "var(--ui-color-text-muted)"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "--ui-search-input-icon-color",
|
|
70
|
+
"default": "var(--ui-color-text-muted)"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "--ui-search-input-icon-size",
|
|
74
|
+
"default": "var(--ui-size-md)"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "--ui-search-input-clear-color",
|
|
78
|
+
"default": "var(--ui-color-text-muted)"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "--ui-search-input-clear-hover-bg",
|
|
82
|
+
"default": "var(--ui-color-bg-muted)"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|