@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,272 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "dropdown-menu",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Dropdown Menu",
|
|
5
|
+
"description": "Trigger button with floating menu panel. Reuses the menu component for consistent item styling.",
|
|
6
|
+
"api": "./dropdown-menu.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "div",
|
|
15
|
+
"class": "ui-dropdown-menu ui-dropdown-menu--open",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"tag": "button",
|
|
19
|
+
"class": "ui-dropdown-menu__trigger ui-button",
|
|
20
|
+
"attrs": { "type": "button" },
|
|
21
|
+
"children": [
|
|
22
|
+
{ "tag": "span", "text": "Actions" },
|
|
23
|
+
{ "tag": "span", "class": "ui-dropdown-menu__trigger-icon", "text": "\u25BE" }
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"tag": "div",
|
|
28
|
+
"class": "ui-dropdown-menu__panel",
|
|
29
|
+
"attrs": { "role": "menu" },
|
|
30
|
+
"children": [
|
|
31
|
+
{
|
|
32
|
+
"tag": "div",
|
|
33
|
+
"class": "ui-menu",
|
|
34
|
+
"children": [
|
|
35
|
+
{
|
|
36
|
+
"tag": "ul",
|
|
37
|
+
"class": "ui-menu__group",
|
|
38
|
+
"children": [
|
|
39
|
+
{
|
|
40
|
+
"tag": "li",
|
|
41
|
+
"children": [
|
|
42
|
+
{
|
|
43
|
+
"tag": "button",
|
|
44
|
+
"class": "ui-menu__item",
|
|
45
|
+
"attrs": { "role": "menuitem" },
|
|
46
|
+
"text": "Edit"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"tag": "li",
|
|
52
|
+
"children": [
|
|
53
|
+
{
|
|
54
|
+
"tag": "button",
|
|
55
|
+
"class": "ui-menu__item",
|
|
56
|
+
"attrs": { "role": "menuitem" },
|
|
57
|
+
"text": "Duplicate"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"tag": "li",
|
|
63
|
+
"children": [
|
|
64
|
+
{
|
|
65
|
+
"tag": "button",
|
|
66
|
+
"class": "ui-menu__item ui-menu__item--danger",
|
|
67
|
+
"attrs": { "role": "menuitem" },
|
|
68
|
+
"text": "Delete"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"code": "<div class=\"ui-dropdown-menu ui-dropdown-menu--open\">\n <button class=\"ui-dropdown-menu__trigger ui-button\">Actions \u25BE</button>\n <div class=\"ui-dropdown-menu__panel\" role=\"menu\">\n <div class=\"ui-menu\">...</div>\n </div>\n</div>"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"title": "With Separator",
|
|
87
|
+
"examples": [
|
|
88
|
+
{
|
|
89
|
+
"items": [
|
|
90
|
+
{
|
|
91
|
+
"tag": "div",
|
|
92
|
+
"class": "ui-dropdown-menu ui-dropdown-menu--open",
|
|
93
|
+
"children": [
|
|
94
|
+
{
|
|
95
|
+
"tag": "button",
|
|
96
|
+
"class": "ui-dropdown-menu__trigger ui-button ui-button--secondary",
|
|
97
|
+
"attrs": { "type": "button" },
|
|
98
|
+
"text": "File"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"tag": "div",
|
|
102
|
+
"class": "ui-dropdown-menu__panel",
|
|
103
|
+
"attrs": { "role": "menu" },
|
|
104
|
+
"children": [
|
|
105
|
+
{
|
|
106
|
+
"tag": "div",
|
|
107
|
+
"class": "ui-menu",
|
|
108
|
+
"children": [
|
|
109
|
+
{
|
|
110
|
+
"tag": "ul",
|
|
111
|
+
"class": "ui-menu__group",
|
|
112
|
+
"children": [
|
|
113
|
+
{
|
|
114
|
+
"tag": "li",
|
|
115
|
+
"children": [
|
|
116
|
+
{
|
|
117
|
+
"tag": "button",
|
|
118
|
+
"class": "ui-menu__item",
|
|
119
|
+
"attrs": { "role": "menuitem" },
|
|
120
|
+
"text": "New"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"tag": "li",
|
|
126
|
+
"children": [
|
|
127
|
+
{
|
|
128
|
+
"tag": "button",
|
|
129
|
+
"class": "ui-menu__item",
|
|
130
|
+
"attrs": { "role": "menuitem" },
|
|
131
|
+
"text": "Open"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"tag": "li",
|
|
137
|
+
"children": [
|
|
138
|
+
{
|
|
139
|
+
"tag": "button",
|
|
140
|
+
"class": "ui-menu__item",
|
|
141
|
+
"attrs": { "role": "menuitem" },
|
|
142
|
+
"text": "Save"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"tag": "li",
|
|
148
|
+
"children": [{ "tag": "hr", "class": "ui-menu__separator" }]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"tag": "li",
|
|
152
|
+
"children": [
|
|
153
|
+
{
|
|
154
|
+
"tag": "button",
|
|
155
|
+
"class": "ui-menu__item ui-menu__item--danger",
|
|
156
|
+
"attrs": { "role": "menuitem" },
|
|
157
|
+
"text": "Close"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"code": "<div class=\"ui-dropdown-menu ui-dropdown-menu--open\">\n <button class=\"ui-dropdown-menu__trigger ui-button ui-button--secondary\">File</button>\n <div class=\"ui-dropdown-menu__panel\" role=\"menu\">\n <div class=\"ui-menu\">\n <ul class=\"ui-menu__group\">\n <li><button class=\"ui-menu__item\">New</button></li>\n <li><hr class=\"ui-menu__separator\"></li>\n <li><button class=\"ui-menu__item--danger\">Close</button></li>\n </ul>\n </div>\n </div>\n</div>"
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"title": "Align End",
|
|
176
|
+
"examples": [
|
|
177
|
+
{
|
|
178
|
+
"items": [
|
|
179
|
+
{
|
|
180
|
+
"tag": "div",
|
|
181
|
+
"style": { "display": "flex", "justify-content": "flex-end" },
|
|
182
|
+
"children": [
|
|
183
|
+
{
|
|
184
|
+
"tag": "div",
|
|
185
|
+
"class": "ui-dropdown-menu ui-dropdown-menu--open ui-dropdown-menu--align-end",
|
|
186
|
+
"children": [
|
|
187
|
+
{
|
|
188
|
+
"tag": "button",
|
|
189
|
+
"class": "ui-dropdown-menu__trigger ui-button ui-button--ghost",
|
|
190
|
+
"attrs": { "type": "button" },
|
|
191
|
+
"text": "\u22EE"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"tag": "div",
|
|
195
|
+
"class": "ui-dropdown-menu__panel",
|
|
196
|
+
"attrs": { "role": "menu" },
|
|
197
|
+
"children": [
|
|
198
|
+
{
|
|
199
|
+
"tag": "div",
|
|
200
|
+
"class": "ui-menu",
|
|
201
|
+
"children": [
|
|
202
|
+
{
|
|
203
|
+
"tag": "ul",
|
|
204
|
+
"class": "ui-menu__group",
|
|
205
|
+
"children": [
|
|
206
|
+
{
|
|
207
|
+
"tag": "li",
|
|
208
|
+
"children": [
|
|
209
|
+
{
|
|
210
|
+
"tag": "button",
|
|
211
|
+
"class": "ui-menu__item",
|
|
212
|
+
"attrs": { "role": "menuitem" },
|
|
213
|
+
"text": "View"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"tag": "li",
|
|
219
|
+
"children": [
|
|
220
|
+
{
|
|
221
|
+
"tag": "button",
|
|
222
|
+
"class": "ui-menu__item",
|
|
223
|
+
"attrs": { "role": "menuitem" },
|
|
224
|
+
"text": "Share"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"tag": "li",
|
|
230
|
+
"children": [
|
|
231
|
+
{
|
|
232
|
+
"tag": "button",
|
|
233
|
+
"class": "ui-menu__item ui-menu__item--danger",
|
|
234
|
+
"attrs": { "role": "menuitem" },
|
|
235
|
+
"text": "Remove"
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
"code": "<div class=\"ui-dropdown-menu ui-dropdown-menu--open ui-dropdown-menu--align-end\">\n <button class=\"ui-dropdown-menu__trigger ui-button ui-button--ghost\">\u22EE</button>\n <div class=\"ui-dropdown-menu__panel\" role=\"menu\">\n <div class=\"ui-menu\">...</div>\n </div>\n</div>"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"customization": [
|
|
256
|
+
{
|
|
257
|
+
"token": "--ui-dropdown-menu-z",
|
|
258
|
+
"default": "200",
|
|
259
|
+
"description": "Z-index for floating panel"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"token": "--ui-dropdown-menu-panel-offset",
|
|
263
|
+
"default": "var(--ui-space-1)",
|
|
264
|
+
"description": "Gap between trigger and panel"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"token": "--ui-dropdown-menu-panel-min-width",
|
|
268
|
+
"default": "auto",
|
|
269
|
+
"description": "Minimum panel width"
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
}
|
|
@@ -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, 'dropdown-menu.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('dropdown-menu visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'dropdown-menu');
|
|
11
|
+
await saveForLostPixel(page, 'dropdown-menu');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('dropdown-menu-visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// @component dropdown-menu
|
|
4
|
+
// @element div
|
|
5
|
+
// Composite: trigger button + floating menu panel
|
|
6
|
+
|
|
7
|
+
@layer components.tokens {
|
|
8
|
+
.dropdown-menu {
|
|
9
|
+
--_z: var(--ui-dropdown-menu-z, 200);
|
|
10
|
+
--_panel-offset: var(--ui-dropdown-menu-panel-offset, var(--ui-space-1, #{t.$space-1}));
|
|
11
|
+
--_panel-min-width: var(--ui-dropdown-menu-panel-min-width, auto);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@layer components.styles {
|
|
16
|
+
.dropdown-menu {
|
|
17
|
+
display: inline-block;
|
|
18
|
+
position: relative;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.dropdown-menu__trigger {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: var(--ui-space-0, #{t.$space-0});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dropdown-menu__trigger-icon {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
|
|
30
|
+
font-size: 0.6em;
|
|
31
|
+
|
|
32
|
+
transition: transform var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.dropdown-menu--open .dropdown-menu__trigger-icon {
|
|
36
|
+
transform: rotate(180deg);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dropdown-menu__panel {
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset-block-start: calc(100% + var(--_panel-offset));
|
|
42
|
+
inset-inline-start: 0;
|
|
43
|
+
z-index: var(--_z);
|
|
44
|
+
|
|
45
|
+
min-inline-size: var(--_panel-min-width);
|
|
46
|
+
|
|
47
|
+
opacity: 0;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
transform: translateY(calc(#{t.$unit} * -1));
|
|
50
|
+
|
|
51
|
+
transition:
|
|
52
|
+
opacity var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease),
|
|
53
|
+
transform var(--ui-duration-fast, 150ms) var(--ui-ease-default, ease);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dropdown-menu--open .dropdown-menu__panel {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
pointer-events: auto;
|
|
59
|
+
transform: translateY(0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Position above trigger
|
|
63
|
+
.dropdown-menu--top .dropdown-menu__panel {
|
|
64
|
+
inset-block-start: auto;
|
|
65
|
+
inset-block-end: calc(100% + var(--_panel-offset));
|
|
66
|
+
|
|
67
|
+
transform: translateY(#{t.$unit});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.dropdown-menu--top.dropdown-menu--open .dropdown-menu__panel {
|
|
71
|
+
transform: translateY(0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Align to end edge
|
|
75
|
+
.dropdown-menu--align-end .dropdown-menu__panel {
|
|
76
|
+
inset-inline-start: auto;
|
|
77
|
+
inset-inline-end: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Full-width panel matches trigger width
|
|
81
|
+
.dropdown-menu--full-width .dropdown-menu__panel {
|
|
82
|
+
min-inline-size: 100%;
|
|
83
|
+
}
|
|
84
|
+
}
|