@apo100l/ace-ui-kit 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/dist/ace-compat.css +1 -1
- package/dist/ace-ui-kit.css +1 -1
- package/dist/ace-ui-kit.js +311 -20
- package/dist/ace-ui-kit.js.map +1 -1
- package/dist/icons.svg +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/js/dialog.d.ts +3 -0
- package/dist/js/file.d.ts +1 -0
- package/dist/js/init.d.ts +4 -2
- package/dist/js/menu.d.ts +1 -0
- package/dist/js/sidebar.d.ts +1 -0
- package/dist/js/stepper.d.ts +2 -0
- package/dist/js/tabs.d.ts +3 -0
- package/dist/js/toast.d.ts +16 -0
- package/dist/js/tooltip.d.ts +1 -0
- package/package.json +1 -1
- package/src/icons/icons.json +306 -53
- package/src/scss/compat/_base.scss +24 -45
- package/src/scss/compat/_feedback.scss +23 -34
- package/src/scss/compat/_forms.scss +14 -35
- package/src/scss/compat/_layout.scss +7 -5
- package/src/scss/compat/_navigation.scss +6 -28
- package/src/scss/compat/_plugins.scss +5 -0
- package/src/scss/compat/_tables.scss +4 -16
- package/src/scss/compat/_widgets.scss +8 -18
- package/src/scss/components/_badge.scss +48 -0
- package/src/scss/components/_card.scss +66 -0
- package/src/scss/components/_feedback.scss +219 -0
- package/src/scss/components/_form.scss +336 -0
- package/src/scss/components/_overlay.scss +174 -0
- package/src/scss/components/_shell.scss +326 -0
- package/src/scss/components/_table.scss +301 -0
- package/src/scss/components/_tabs.scss +56 -0
- package/src/scss/index.scss +8 -0
- package/src/scss/mixins/_badge.scss +59 -0
- package/src/scss/mixins/_card.scss +40 -0
- package/src/scss/mixins/_form.scss +76 -0
- package/src/scss/mixins/_menu.scss +53 -0
- package/src/scss/mixins/_table.scss +23 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
@use '../mixins/form';
|
|
2
|
+
|
|
3
|
+
// Form controls (docs/PRINCIPLES.md §6).
|
|
4
|
+
//
|
|
5
|
+
// <div class="ak-field">
|
|
6
|
+
// <label class="ak-label" for="url">URL <span class="ak-label__hint">необязательно</span></label>
|
|
7
|
+
// <input class="ak-input" id="url" aria-describedby="url-hint url-error" aria-invalid="true">
|
|
8
|
+
// <p class="ak-hint" id="url-hint">Латиница и дефис</p>
|
|
9
|
+
// <p class="ak-error" id="url-error">URL уже занят страницей «Контакты»</p>
|
|
10
|
+
// </div>
|
|
11
|
+
//
|
|
12
|
+
// .ak-input | .ak-textarea | .ak-select > select — 40px in forms; .ak-input--sm 32px in toolbars
|
|
13
|
+
// .ak-input-group > .ak-input + .ak-input-group__addon | .ak-btn
|
|
14
|
+
// .ak-check (checkbox / radio row) · .ak-switch (input[type=checkbox][role=switch])
|
|
15
|
+
// .ak-stepper > button[data-ak-step="-1"] + input[type=number] + button[data-ak-step="1"]
|
|
16
|
+
// .ak-form — vertical rhythm: 16px between fields, 24px between sections
|
|
17
|
+
|
|
18
|
+
.ak-form {
|
|
19
|
+
display: grid;
|
|
20
|
+
gap: var(--ak-space-4);
|
|
21
|
+
|
|
22
|
+
> fieldset {
|
|
23
|
+
display: grid;
|
|
24
|
+
gap: var(--ak-space-4);
|
|
25
|
+
}
|
|
26
|
+
> fieldset + fieldset {
|
|
27
|
+
margin-top: var(--ak-space-2);
|
|
28
|
+
padding-top: var(--ak-space-6);
|
|
29
|
+
border-top: 1px solid var(--ak-color-border);
|
|
30
|
+
}
|
|
31
|
+
legend {
|
|
32
|
+
margin-bottom: var(--ak-space-1);
|
|
33
|
+
padding: 0;
|
|
34
|
+
font-size: var(--ak-font-size-lg);
|
|
35
|
+
font-weight: var(--ak-font-weight-semibold);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ak-field {
|
|
40
|
+
display: grid;
|
|
41
|
+
gap: var(--ak-space-2);
|
|
42
|
+
align-content: start;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
|
|
45
|
+
> .ak-hint,
|
|
46
|
+
> .ak-error {
|
|
47
|
+
margin-top: calc(-1 * var(--ak-space-1));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ak-label {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: baseline;
|
|
54
|
+
gap: var(--ak-space-2);
|
|
55
|
+
margin: 0;
|
|
56
|
+
color: var(--ak-color-text);
|
|
57
|
+
font-size: var(--ak-font-size-md);
|
|
58
|
+
font-weight: var(--ak-font-weight-medium);
|
|
59
|
+
|
|
60
|
+
&__hint {
|
|
61
|
+
color: var(--ak-color-muted);
|
|
62
|
+
font-size: var(--ak-font-size-sm);
|
|
63
|
+
font-weight: var(--ak-font-weight-regular);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ak-hint,
|
|
68
|
+
.ak-error {
|
|
69
|
+
margin: 0;
|
|
70
|
+
font-size: var(--ak-font-size-sm);
|
|
71
|
+
line-height: var(--ak-line-height-tight);
|
|
72
|
+
}
|
|
73
|
+
.ak-hint {
|
|
74
|
+
color: var(--ak-color-muted);
|
|
75
|
+
}
|
|
76
|
+
.ak-error {
|
|
77
|
+
color: var(--ak-color-negative);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ---- text inputs
|
|
81
|
+
.ak-input {
|
|
82
|
+
@include form.control-frame;
|
|
83
|
+
display: block;
|
|
84
|
+
height: var(--ak-control-height-lg);
|
|
85
|
+
padding: 0 var(--ak-space-3);
|
|
86
|
+
|
|
87
|
+
&--sm {
|
|
88
|
+
height: var(--ak-control-height);
|
|
89
|
+
font-size: var(--ak-font-size-sm);
|
|
90
|
+
}
|
|
91
|
+
&[type='number'],
|
|
92
|
+
&--num {
|
|
93
|
+
font-variant-numeric: tabular-nums;
|
|
94
|
+
}
|
|
95
|
+
&[type='search'] {
|
|
96
|
+
-webkit-appearance: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ak-textarea {
|
|
101
|
+
@include form.control-frame;
|
|
102
|
+
display: block;
|
|
103
|
+
min-height: 96px;
|
|
104
|
+
padding: var(--ak-space-2) var(--ak-space-3);
|
|
105
|
+
resize: vertical;
|
|
106
|
+
field-sizing: content; // grows with its content where supported
|
|
107
|
+
max-height: 480px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// ---- select: native <select> inside a wrapper that draws the chevron (no data: URIs — CSP)
|
|
111
|
+
.ak-select {
|
|
112
|
+
position: relative;
|
|
113
|
+
display: block;
|
|
114
|
+
|
|
115
|
+
> select {
|
|
116
|
+
@include form.control-frame;
|
|
117
|
+
display: block;
|
|
118
|
+
height: var(--ak-control-height-lg);
|
|
119
|
+
padding: 0 var(--ak-space-8) 0 var(--ak-space-3);
|
|
120
|
+
appearance: none;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
}
|
|
123
|
+
&::after {
|
|
124
|
+
position: absolute;
|
|
125
|
+
top: 50%;
|
|
126
|
+
right: 14px;
|
|
127
|
+
width: 7px;
|
|
128
|
+
height: 7px;
|
|
129
|
+
margin-top: -5px;
|
|
130
|
+
border-right: 1.5px solid var(--ak-color-muted);
|
|
131
|
+
border-bottom: 1.5px solid var(--ak-color-muted);
|
|
132
|
+
transform: rotate(45deg);
|
|
133
|
+
content: '';
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
}
|
|
136
|
+
&--sm > select {
|
|
137
|
+
height: var(--ak-control-height);
|
|
138
|
+
font-size: var(--ak-font-size-sm);
|
|
139
|
+
}
|
|
140
|
+
> select[multiple] {
|
|
141
|
+
height: auto;
|
|
142
|
+
min-height: 96px;
|
|
143
|
+
padding: var(--ak-space-1);
|
|
144
|
+
}
|
|
145
|
+
&:has(select[multiple])::after {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ---- input group: input + addon / button sharing one border
|
|
151
|
+
.ak-input-group {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: stretch;
|
|
154
|
+
width: 100%;
|
|
155
|
+
|
|
156
|
+
> .ak-input,
|
|
157
|
+
> .ak-select {
|
|
158
|
+
flex: 1 1 auto;
|
|
159
|
+
width: 1%;
|
|
160
|
+
}
|
|
161
|
+
> * + * {
|
|
162
|
+
margin-left: -1px;
|
|
163
|
+
}
|
|
164
|
+
> :not(:first-child),
|
|
165
|
+
> :not(:first-child) > select {
|
|
166
|
+
border-top-left-radius: 0;
|
|
167
|
+
border-bottom-left-radius: 0;
|
|
168
|
+
}
|
|
169
|
+
> :not(:last-child),
|
|
170
|
+
> :not(:last-child) > select {
|
|
171
|
+
border-top-right-radius: 0;
|
|
172
|
+
border-bottom-right-radius: 0;
|
|
173
|
+
}
|
|
174
|
+
> .ak-btn {
|
|
175
|
+
height: auto;
|
|
176
|
+
}
|
|
177
|
+
> :focus,
|
|
178
|
+
> :focus-within {
|
|
179
|
+
z-index: 1;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
.ak-input-group__addon {
|
|
183
|
+
display: flex;
|
|
184
|
+
flex: none;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: var(--ak-space-1);
|
|
187
|
+
padding: 0 var(--ak-space-3);
|
|
188
|
+
border: 1px solid var(--ak-color-control);
|
|
189
|
+
border-radius: var(--ak-radius-control);
|
|
190
|
+
background: var(--ak-color-raised);
|
|
191
|
+
color: var(--ak-color-muted);
|
|
192
|
+
font-size: var(--ak-font-size-md);
|
|
193
|
+
white-space: nowrap;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// ---- checkbox / radio rows: native controls in the primary colour
|
|
197
|
+
.ak-check {
|
|
198
|
+
display: inline-flex;
|
|
199
|
+
align-items: flex-start;
|
|
200
|
+
gap: var(--ak-space-2);
|
|
201
|
+
color: var(--ak-color-text);
|
|
202
|
+
font-size: var(--ak-font-size-md);
|
|
203
|
+
line-height: var(--ak-line-height);
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
|
|
206
|
+
> input {
|
|
207
|
+
flex: none;
|
|
208
|
+
width: 16px;
|
|
209
|
+
height: 16px;
|
|
210
|
+
margin: 2px 0 0;
|
|
211
|
+
accent-color: var(--ak-color-primary);
|
|
212
|
+
cursor: inherit;
|
|
213
|
+
}
|
|
214
|
+
&:has(input:disabled) {
|
|
215
|
+
color: var(--ak-color-faint);
|
|
216
|
+
cursor: not-allowed;
|
|
217
|
+
}
|
|
218
|
+
> span > small,
|
|
219
|
+
.ak-check__hint {
|
|
220
|
+
display: block;
|
|
221
|
+
color: var(--ak-color-muted);
|
|
222
|
+
font-size: var(--ak-font-size-sm);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
.ak-check-group {
|
|
226
|
+
display: grid;
|
|
227
|
+
gap: var(--ak-space-2);
|
|
228
|
+
margin: 0;
|
|
229
|
+
padding: 0;
|
|
230
|
+
border: 0;
|
|
231
|
+
|
|
232
|
+
&--inline {
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-wrap: wrap;
|
|
235
|
+
gap: var(--ak-space-2) var(--ak-space-5);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// ---- switch: <label class="ak-switch"><input type="checkbox" role="switch"> Публиковать</label>
|
|
240
|
+
// On is near-black (or the theme primary), not the accent (docs/PRINCIPLES.md §6).
|
|
241
|
+
.ak-switch {
|
|
242
|
+
display: inline-flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
gap: var(--ak-space-2);
|
|
245
|
+
color: var(--ak-color-text);
|
|
246
|
+
font-size: var(--ak-font-size-md);
|
|
247
|
+
cursor: pointer;
|
|
248
|
+
|
|
249
|
+
> input {
|
|
250
|
+
position: relative;
|
|
251
|
+
flex: none;
|
|
252
|
+
width: 32px;
|
|
253
|
+
height: 18px;
|
|
254
|
+
margin: 0;
|
|
255
|
+
border: 0;
|
|
256
|
+
border-radius: var(--ak-radius-full);
|
|
257
|
+
background: var(--ak-color-control);
|
|
258
|
+
appearance: none;
|
|
259
|
+
cursor: inherit;
|
|
260
|
+
transition: background-color var(--ak-duration-fast) ease;
|
|
261
|
+
|
|
262
|
+
&::before {
|
|
263
|
+
position: absolute;
|
|
264
|
+
top: 2px;
|
|
265
|
+
left: 2px;
|
|
266
|
+
width: 14px;
|
|
267
|
+
height: 14px;
|
|
268
|
+
border-radius: 50%;
|
|
269
|
+
background: var(--ak-color-surface);
|
|
270
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
|
|
271
|
+
content: '';
|
|
272
|
+
transition: transform var(--ak-duration-fast) var(--ak-ease-out);
|
|
273
|
+
}
|
|
274
|
+
&:checked {
|
|
275
|
+
background: var(--ak-color-primary);
|
|
276
|
+
}
|
|
277
|
+
&:checked::before {
|
|
278
|
+
transform: translateX(14px);
|
|
279
|
+
}
|
|
280
|
+
&:focus-visible {
|
|
281
|
+
outline: none;
|
|
282
|
+
box-shadow: var(--ak-focus-ring);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
&:has(input:disabled) {
|
|
286
|
+
color: var(--ak-color-faint);
|
|
287
|
+
cursor: not-allowed;
|
|
288
|
+
|
|
289
|
+
> input {
|
|
290
|
+
opacity: 0.5;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// ---- stepper: [−][ 0 ][+]
|
|
296
|
+
.ak-stepper {
|
|
297
|
+
display: inline-flex;
|
|
298
|
+
align-items: stretch;
|
|
299
|
+
height: var(--ak-control-height);
|
|
300
|
+
|
|
301
|
+
> input {
|
|
302
|
+
@include form.control-frame;
|
|
303
|
+
width: 72px;
|
|
304
|
+
height: 100%;
|
|
305
|
+
margin: 0 -1px;
|
|
306
|
+
padding: 0 var(--ak-space-2);
|
|
307
|
+
border-radius: 0;
|
|
308
|
+
font-variant-numeric: tabular-nums;
|
|
309
|
+
text-align: center;
|
|
310
|
+
-moz-appearance: textfield;
|
|
311
|
+
|
|
312
|
+
&::-webkit-inner-spin-button,
|
|
313
|
+
&::-webkit-outer-spin-button {
|
|
314
|
+
margin: 0;
|
|
315
|
+
-webkit-appearance: none;
|
|
316
|
+
}
|
|
317
|
+
&:focus {
|
|
318
|
+
position: relative;
|
|
319
|
+
z-index: 1;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
> .ak-btn {
|
|
323
|
+
width: var(--ak-control-height);
|
|
324
|
+
height: 100%;
|
|
325
|
+
padding: 0;
|
|
326
|
+
|
|
327
|
+
&:first-child {
|
|
328
|
+
border-top-right-radius: 0;
|
|
329
|
+
border-bottom-right-radius: 0;
|
|
330
|
+
}
|
|
331
|
+
&:last-child {
|
|
332
|
+
border-top-left-radius: 0;
|
|
333
|
+
border-bottom-left-radius: 0;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
@use '../mixins/menu';
|
|
2
|
+
|
|
3
|
+
// Floating layers: dialog (native <dialog>), menu (Popover API). The only things with shadows.
|
|
4
|
+
|
|
5
|
+
// ---------------------------------------------------------------- dialog
|
|
6
|
+
// <button class="ak-btn" data-ak-dialog-open="del-1">Удалить</button>
|
|
7
|
+
// <dialog class="ak-dialog" id="del-1" aria-labelledby="del-1-title">
|
|
8
|
+
// <form method="dialog">
|
|
9
|
+
// <header class="ak-dialog__header"><h2 class="ak-dialog__title" id="del-1-title">…</h2>
|
|
10
|
+
// <button class="ak-btn ak-btn--ghost ak-btn--icon" value="cancel" aria-label="Закрыть">×</button></header>
|
|
11
|
+
// <div class="ak-dialog__body">…</div>
|
|
12
|
+
// <footer class="ak-dialog__footer"><button class="ak-btn" value="cancel">Отмена</button> …</footer>
|
|
13
|
+
// </form>
|
|
14
|
+
// </dialog>
|
|
15
|
+
// Sizes: --sm (400) · default (560) · --lg (800). data-ak-static: no close on backdrop click.
|
|
16
|
+
|
|
17
|
+
.ak-dialog {
|
|
18
|
+
width: min(560px, calc(100vw - 2 * var(--ak-space-4)));
|
|
19
|
+
max-height: calc(100dvh - 2 * var(--ak-space-8));
|
|
20
|
+
margin: auto;
|
|
21
|
+
padding: 0;
|
|
22
|
+
overflow: auto;
|
|
23
|
+
border: 1px solid var(--ak-color-border);
|
|
24
|
+
border-radius: var(--ak-radius-card);
|
|
25
|
+
background: var(--ak-color-surface);
|
|
26
|
+
color: var(--ak-color-text);
|
|
27
|
+
box-shadow: var(--ak-shadow-dialog);
|
|
28
|
+
|
|
29
|
+
&::backdrop {
|
|
30
|
+
background: var(--ak-color-overlay);
|
|
31
|
+
}
|
|
32
|
+
&[open] {
|
|
33
|
+
animation: ak-dialog-in var(--ak-duration-slow) var(--ak-ease-out);
|
|
34
|
+
}
|
|
35
|
+
&[open]::backdrop {
|
|
36
|
+
animation: ak-fade-in var(--ak-duration-slow) ease;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--sm {
|
|
40
|
+
width: min(400px, calc(100vw - 2 * var(--ak-space-4)));
|
|
41
|
+
}
|
|
42
|
+
&--lg {
|
|
43
|
+
width: min(800px, calc(100vw - 2 * var(--ak-space-4)));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
> form {
|
|
47
|
+
display: contents;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.ak-dialog__header {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: var(--ak-space-3);
|
|
54
|
+
padding: var(--ak-space-4) var(--ak-space-5);
|
|
55
|
+
border-bottom: 1px solid var(--ak-color-border);
|
|
56
|
+
|
|
57
|
+
> .ak-btn:last-child {
|
|
58
|
+
margin-right: calc(-1 * var(--ak-space-2));
|
|
59
|
+
margin-left: auto;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
.ak-dialog__title {
|
|
63
|
+
margin: 0;
|
|
64
|
+
font-size: var(--ak-font-size-lg);
|
|
65
|
+
font-weight: var(--ak-font-weight-semibold);
|
|
66
|
+
line-height: var(--ak-line-height-tight);
|
|
67
|
+
}
|
|
68
|
+
.ak-dialog__body {
|
|
69
|
+
padding: var(--ak-space-5);
|
|
70
|
+
|
|
71
|
+
> p:first-child {
|
|
72
|
+
margin-top: 0;
|
|
73
|
+
}
|
|
74
|
+
> :last-child {
|
|
75
|
+
margin-bottom: 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
.ak-dialog__footer {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
justify-content: flex-end;
|
|
82
|
+
gap: var(--ak-space-2);
|
|
83
|
+
padding: var(--ak-space-3) var(--ak-space-5);
|
|
84
|
+
border-top: 1px solid var(--ak-color-border);
|
|
85
|
+
}
|
|
86
|
+
.ak-dialog-open {
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@keyframes ak-dialog-in {
|
|
91
|
+
from {
|
|
92
|
+
opacity: 0;
|
|
93
|
+
transform: scale(0.97);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
@keyframes ak-fade-in {
|
|
97
|
+
from {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ---------------------------------------------------------------- menu
|
|
103
|
+
// <button class="ak-btn" popovertarget="row-menu" aria-haspopup="menu">Ещё</button>
|
|
104
|
+
// <div class="ak-menu" id="row-menu" popover role="menu">
|
|
105
|
+
// <a class="ak-menu__item" role="menuitem" href="…"><svg class="ak-icon">…</svg> Редактировать</a>
|
|
106
|
+
// <hr class="ak-menu__divider">
|
|
107
|
+
// <button class="ak-menu__item ak-menu__item--danger" role="menuitem">Удалить</button>
|
|
108
|
+
// </div>
|
|
109
|
+
// Positioned under its trigger by CSS anchor positioning, with a JS fallback (init()).
|
|
110
|
+
// .ak-menu--end aligns the menu's right edge with the trigger.
|
|
111
|
+
|
|
112
|
+
.ak-menu {
|
|
113
|
+
@include menu.panel;
|
|
114
|
+
max-width: 320px;
|
|
115
|
+
max-height: min(400px, 70vh);
|
|
116
|
+
overflow-y: auto;
|
|
117
|
+
|
|
118
|
+
// popover UA styles centre it in the viewport: undo, then anchor to the trigger
|
|
119
|
+
&[popover] {
|
|
120
|
+
inset: auto;
|
|
121
|
+
position-area: block-end span-inline-end;
|
|
122
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
123
|
+
margin-block: 4px;
|
|
124
|
+
}
|
|
125
|
+
&--end[popover] {
|
|
126
|
+
position-area: block-end span-inline-start;
|
|
127
|
+
}
|
|
128
|
+
&:popover-open {
|
|
129
|
+
animation: ak-menu-in var(--ak-duration-base) var(--ak-ease-out);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.ak-menu__item {
|
|
133
|
+
@include menu.item;
|
|
134
|
+
|
|
135
|
+
> .ak-icon {
|
|
136
|
+
color: var(--ak-color-muted);
|
|
137
|
+
}
|
|
138
|
+
&[aria-current='true'],
|
|
139
|
+
&[aria-checked='true'] {
|
|
140
|
+
@include menu.item-current;
|
|
141
|
+
}
|
|
142
|
+
&--danger,
|
|
143
|
+
&--danger > .ak-icon {
|
|
144
|
+
color: var(--ak-color-negative);
|
|
145
|
+
}
|
|
146
|
+
&:disabled,
|
|
147
|
+
&[aria-disabled='true'] {
|
|
148
|
+
color: var(--ak-color-faint);
|
|
149
|
+
pointer-events: none;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
.ak-menu__divider {
|
|
153
|
+
@include menu.divider;
|
|
154
|
+
}
|
|
155
|
+
.ak-menu__label {
|
|
156
|
+
padding: var(--ak-space-2) var(--ak-space-3) var(--ak-space-1);
|
|
157
|
+
color: var(--ak-color-muted);
|
|
158
|
+
font-size: var(--ak-font-size-sm);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@keyframes ak-menu-in {
|
|
162
|
+
from {
|
|
163
|
+
opacity: 0;
|
|
164
|
+
transform: scale(0.97) translateY(-2px);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@media (prefers-reduced-motion: reduce) {
|
|
169
|
+
.ak-dialog[open],
|
|
170
|
+
.ak-dialog[open]::backdrop,
|
|
171
|
+
.ak-menu:popover-open {
|
|
172
|
+
animation: none;
|
|
173
|
+
}
|
|
174
|
+
}
|