@apo100l/ace-ui-kit 0.0.2 → 0.2.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/README.md +58 -5
- package/dist/ace-compat.css +1 -1
- package/dist/ace-compat.js +189 -0
- package/dist/ace-compat.js.map +1 -0
- package/dist/ace-ui-kit.css +1 -1
- package/dist/ace-ui-kit.js +312 -8
- package/dist/ace-ui-kit.js.map +1 -1
- package/dist/compat.d.ts +14 -0
- package/dist/icons.svg +58 -0
- package/dist/index.d.ts +7 -0
- package/dist/js/compat/ace.d.ts +2 -0
- package/dist/js/compat/bootstrap.d.ts +9 -0
- package/dist/js/dialog.d.ts +3 -0
- package/dist/js/file.d.ts +1 -0
- package/dist/js/icon.d.ts +13 -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 +20 -7
- package/src/icons/icons.json +311 -0
- package/src/scss/_breakpoints.scss +32 -0
- package/src/scss/_tokens.scss +175 -33
- package/src/scss/compat/_base.scss +144 -0
- package/src/scss/compat/_buttons.scss +100 -0
- package/src/scss/compat/_feedback.scss +187 -0
- package/src/scss/compat/_forms.scss +232 -0
- package/src/scss/compat/_grid.scss +107 -0
- package/src/scss/compat/_layout.scss +427 -0
- package/src/scss/compat/_navigation.scss +159 -0
- package/src/scss/compat/_plugins.scss +105 -0
- package/src/scss/compat/_tables.scss +105 -0
- package/src/scss/compat/_utilities.scss +160 -0
- package/src/scss/compat/_widgets.scss +126 -0
- package/src/scss/compat/index.scss +18 -10
- package/src/scss/components/_alert.scss +21 -22
- package/src/scss/components/_badge.scss +48 -0
- package/src/scss/components/_button.scss +34 -33
- 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/_icon.scss +29 -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 +10 -0
- package/src/scss/mixins/_alert.scss +65 -0
- package/src/scss/mixins/_badge.scss +59 -0
- package/src/scss/mixins/_button.scss +102 -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,301 @@
|
|
|
1
|
+
@use '../mixins/table';
|
|
2
|
+
|
|
3
|
+
// Tables (docs/PRINCIPLES.md §5): 12px grey sentence-case header with no band, rules between rows,
|
|
4
|
+
// no zebra, numbers right-aligned in tabular figures, one action column on the right.
|
|
5
|
+
//
|
|
6
|
+
// <div class="ak-table-wrap"> scrolls horizontally; --sticky keeps the header in view
|
|
7
|
+
// <table class="ak-table">
|
|
8
|
+
// <thead><tr><th>Название</th><th class="ak-num">Позиция</th><th class="ak-table__actions"><span class="ak-sr-only">Действия</span></th></tr></thead>
|
|
9
|
+
// <tbody><tr><td class="ak-table__primary"><a href="…">О компании</a></td><td class="ak-num">−1</td><td class="ak-table__actions">…</td></tr></tbody>
|
|
10
|
+
// </table>
|
|
11
|
+
// </div>
|
|
12
|
+
// th[aria-sort] shows the sort direction (active column only). tr[aria-selected="true"] = selected row.
|
|
13
|
+
// .ak-table--compact: 36px rows. .ak-muted / .ak-dash for secondary text and missing values.
|
|
14
|
+
|
|
15
|
+
.ak-table-wrap {
|
|
16
|
+
width: 100%;
|
|
17
|
+
overflow-x: auto;
|
|
18
|
+
|
|
19
|
+
&--sticky {
|
|
20
|
+
max-height: var(--ak-table-max-height, 70vh);
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
|
|
23
|
+
thead th {
|
|
24
|
+
position: sticky;
|
|
25
|
+
top: 0;
|
|
26
|
+
z-index: 1;
|
|
27
|
+
background: var(--ak-color-surface);
|
|
28
|
+
box-shadow: inset 0 -1px 0 var(--ak-color-border);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ak-table {
|
|
34
|
+
width: 100%;
|
|
35
|
+
border-collapse: collapse;
|
|
36
|
+
border-spacing: 0;
|
|
37
|
+
color: var(--ak-color-text);
|
|
38
|
+
font-size: var(--ak-font-size-md);
|
|
39
|
+
|
|
40
|
+
th,
|
|
41
|
+
td {
|
|
42
|
+
padding: var(--ak-space-2) var(--ak-space-4);
|
|
43
|
+
text-align: left;
|
|
44
|
+
vertical-align: middle;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
thead th {
|
|
48
|
+
@include table.header-cell;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
tbody td,
|
|
52
|
+
tbody th {
|
|
53
|
+
@include table.body-cell;
|
|
54
|
+
}
|
|
55
|
+
tbody tr:first-child > * {
|
|
56
|
+
border-top: 0;
|
|
57
|
+
}
|
|
58
|
+
tbody th {
|
|
59
|
+
font-weight: var(--ak-font-weight-regular);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
tr[aria-selected='true'] > * {
|
|
63
|
+
background: var(--ak-color-active);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// sortable headers: a button inside the th, the glyph only on the active column
|
|
67
|
+
th > button {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 4px;
|
|
71
|
+
margin: 0;
|
|
72
|
+
padding: 0;
|
|
73
|
+
border: 0;
|
|
74
|
+
background: none;
|
|
75
|
+
color: inherit;
|
|
76
|
+
font: inherit;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
color: var(--ak-color-text);
|
|
81
|
+
}
|
|
82
|
+
&:focus-visible {
|
|
83
|
+
outline: 2px solid var(--ak-color-accent);
|
|
84
|
+
outline-offset: 2px;
|
|
85
|
+
border-radius: 2px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
th[aria-sort='ascending'] > button::after,
|
|
89
|
+
th[aria-sort='descending'] > button::after {
|
|
90
|
+
width: 0;
|
|
91
|
+
height: 0;
|
|
92
|
+
border-right: 4px solid transparent;
|
|
93
|
+
border-left: 4px solid transparent;
|
|
94
|
+
content: '';
|
|
95
|
+
}
|
|
96
|
+
th[aria-sort='ascending'] > button::after {
|
|
97
|
+
border-bottom: 5px solid currentColor;
|
|
98
|
+
}
|
|
99
|
+
th[aria-sort='descending'] > button::after {
|
|
100
|
+
border-top: 5px solid currentColor;
|
|
101
|
+
}
|
|
102
|
+
th[aria-sort] {
|
|
103
|
+
color: var(--ak-color-text);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&--compact tbody td,
|
|
107
|
+
&--compact tbody th {
|
|
108
|
+
height: 36px;
|
|
109
|
+
padding-top: var(--ak-space-1);
|
|
110
|
+
padding-bottom: var(--ak-space-1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// columns
|
|
115
|
+
.ak-num {
|
|
116
|
+
text-align: right !important;
|
|
117
|
+
font-variant-numeric: tabular-nums;
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
}
|
|
120
|
+
.ak-table__primary {
|
|
121
|
+
font-weight: var(--ak-font-weight-medium);
|
|
122
|
+
|
|
123
|
+
a {
|
|
124
|
+
color: var(--ak-color-text);
|
|
125
|
+
text-decoration: none;
|
|
126
|
+
|
|
127
|
+
&:hover {
|
|
128
|
+
color: var(--ak-color-link);
|
|
129
|
+
text-decoration: underline;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
small {
|
|
133
|
+
display: block;
|
|
134
|
+
margin-top: 2px;
|
|
135
|
+
color: var(--ak-color-muted);
|
|
136
|
+
font-size: var(--ak-font-size-sm);
|
|
137
|
+
font-weight: var(--ak-font-weight-regular);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.ak-table__check {
|
|
141
|
+
width: 40px;
|
|
142
|
+
padding-right: 0 !important;
|
|
143
|
+
|
|
144
|
+
input {
|
|
145
|
+
width: 16px;
|
|
146
|
+
height: 16px;
|
|
147
|
+
margin: 0;
|
|
148
|
+
vertical-align: middle;
|
|
149
|
+
accent-color: var(--ak-color-primary);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
.ak-table__actions {
|
|
153
|
+
width: 1%;
|
|
154
|
+
text-align: right !important;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
|
|
157
|
+
> * + * {
|
|
158
|
+
margin-left: var(--ak-space-1);
|
|
159
|
+
}
|
|
160
|
+
> form {
|
|
161
|
+
display: inline;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ak-muted {
|
|
166
|
+
color: var(--ak-color-muted);
|
|
167
|
+
}
|
|
168
|
+
.ak-dash::before {
|
|
169
|
+
color: var(--ak-color-faint);
|
|
170
|
+
content: '—';
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// toolbar above a table: total · search · filters … per-page
|
|
174
|
+
.ak-table-toolbar {
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-wrap: wrap;
|
|
177
|
+
align-items: center;
|
|
178
|
+
gap: var(--ak-space-2) var(--ak-space-3);
|
|
179
|
+
padding: var(--ak-space-3) var(--ak-space-4);
|
|
180
|
+
border-bottom: 1px solid var(--ak-color-border);
|
|
181
|
+
|
|
182
|
+
> .ak-input,
|
|
183
|
+
> .ak-select {
|
|
184
|
+
width: auto;
|
|
185
|
+
min-width: 240px;
|
|
186
|
+
}
|
|
187
|
+
&__end {
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
gap: var(--ak-space-2);
|
|
191
|
+
margin-left: auto;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
.ak-total {
|
|
195
|
+
color: var(--ak-color-muted);
|
|
196
|
+
font-size: var(--ak-font-size-sm);
|
|
197
|
+
font-variant-numeric: tabular-nums;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// footer under a table: range · pagination
|
|
201
|
+
.ak-table-footer {
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-wrap: wrap;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: space-between;
|
|
206
|
+
gap: var(--ak-space-2);
|
|
207
|
+
padding: var(--ak-space-3) var(--ak-space-4);
|
|
208
|
+
border-top: 1px solid var(--ak-color-border);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ak-pagination {
|
|
212
|
+
display: inline-flex;
|
|
213
|
+
flex-wrap: wrap;
|
|
214
|
+
gap: var(--ak-space-1);
|
|
215
|
+
margin: 0;
|
|
216
|
+
padding: 0;
|
|
217
|
+
list-style: none;
|
|
218
|
+
|
|
219
|
+
a,
|
|
220
|
+
span {
|
|
221
|
+
display: inline-flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
justify-content: center;
|
|
224
|
+
min-width: var(--ak-control-height);
|
|
225
|
+
height: var(--ak-control-height);
|
|
226
|
+
padding: 0 var(--ak-space-2);
|
|
227
|
+
border-radius: var(--ak-radius-control);
|
|
228
|
+
color: var(--ak-color-text);
|
|
229
|
+
font-size: var(--ak-font-size-md);
|
|
230
|
+
font-variant-numeric: tabular-nums;
|
|
231
|
+
text-decoration: none;
|
|
232
|
+
}
|
|
233
|
+
a:hover {
|
|
234
|
+
background: var(--ak-color-raised);
|
|
235
|
+
}
|
|
236
|
+
a:focus-visible {
|
|
237
|
+
outline: none;
|
|
238
|
+
box-shadow: var(--ak-focus-ring);
|
|
239
|
+
}
|
|
240
|
+
[aria-current='page'] {
|
|
241
|
+
background: var(--ak-color-active);
|
|
242
|
+
font-weight: var(--ak-font-weight-semibold);
|
|
243
|
+
}
|
|
244
|
+
[aria-disabled='true'] {
|
|
245
|
+
color: var(--ak-color-faint);
|
|
246
|
+
pointer-events: none;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// empty state: keeps the block's frame, one sentence across, then the first action
|
|
251
|
+
.ak-empty {
|
|
252
|
+
display: grid;
|
|
253
|
+
justify-items: center;
|
|
254
|
+
gap: var(--ak-space-3);
|
|
255
|
+
padding: var(--ak-space-10) var(--ak-space-5);
|
|
256
|
+
color: var(--ak-color-muted);
|
|
257
|
+
font-size: var(--ak-font-size-md);
|
|
258
|
+
text-align: center;
|
|
259
|
+
|
|
260
|
+
> .ak-icon {
|
|
261
|
+
--ak-icon-size: 24px;
|
|
262
|
+
color: var(--ak-color-faint);
|
|
263
|
+
}
|
|
264
|
+
> p {
|
|
265
|
+
max-width: 420px;
|
|
266
|
+
margin: 0;
|
|
267
|
+
}
|
|
268
|
+
td > & {
|
|
269
|
+
padding-top: var(--ak-space-8);
|
|
270
|
+
padding-bottom: var(--ak-space-8);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
.ak-table td:has(> .ak-empty) {
|
|
274
|
+
height: auto;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.ak-sr-only {
|
|
278
|
+
position: absolute !important;
|
|
279
|
+
width: 1px;
|
|
280
|
+
height: 1px;
|
|
281
|
+
margin: -1px;
|
|
282
|
+
padding: 0;
|
|
283
|
+
overflow: hidden;
|
|
284
|
+
clip: rect(0, 0, 0, 0);
|
|
285
|
+
white-space: nowrap;
|
|
286
|
+
border: 0;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// loading: the final layout with flat grey bars at the real size — no shimmer, no layout shift
|
|
290
|
+
.ak-skeleton {
|
|
291
|
+
display: inline-block;
|
|
292
|
+
width: var(--w, 8em);
|
|
293
|
+
max-width: 100%;
|
|
294
|
+
height: 0.9em;
|
|
295
|
+
border-radius: var(--ak-radius-chip);
|
|
296
|
+
background: var(--ak-color-raised);
|
|
297
|
+
vertical-align: middle;
|
|
298
|
+
}
|
|
299
|
+
[aria-busy='true'] .ak-skeleton {
|
|
300
|
+
cursor: progress;
|
|
301
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Tabs (WAI-ARIA tabs pattern, wired by init()):
|
|
2
|
+
// <div class="ak-tabs">
|
|
3
|
+
// <div class="ak-tabs__list" role="tablist" aria-label="Страница">
|
|
4
|
+
// <button class="ak-tabs__tab" role="tab" id="tab-main" aria-controls="panel-main" aria-selected="true">Основное</button>
|
|
5
|
+
// <button class="ak-tabs__tab" role="tab" id="tab-seo" aria-controls="panel-seo" aria-selected="false">SEO <span class="ak-badge ak-badge--count">2</span></button>
|
|
6
|
+
// </div>
|
|
7
|
+
// <div class="ak-tabs__panel" role="tabpanel" id="panel-main" aria-labelledby="tab-main">…</div>
|
|
8
|
+
// <div class="ak-tabs__panel" role="tabpanel" id="panel-seo" aria-labelledby="tab-seo" hidden>…</div>
|
|
9
|
+
// </div>
|
|
10
|
+
// The selected tab is marked by an ink underline, not a coloured pill (colour stays on data).
|
|
11
|
+
|
|
12
|
+
.ak-tabs__list {
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: var(--ak-space-1);
|
|
15
|
+
overflow-x: auto;
|
|
16
|
+
border-bottom: 1px solid var(--ak-color-border);
|
|
17
|
+
scrollbar-width: none;
|
|
18
|
+
}
|
|
19
|
+
.ak-tabs__tab {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
flex: none;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--ak-space-2);
|
|
24
|
+
height: 40px;
|
|
25
|
+
margin: 0 0 -1px;
|
|
26
|
+
padding: 0 var(--ak-space-3);
|
|
27
|
+
border: 0;
|
|
28
|
+
border-bottom: 2px solid transparent;
|
|
29
|
+
background: none;
|
|
30
|
+
color: var(--ak-color-muted);
|
|
31
|
+
font: inherit;
|
|
32
|
+
font-size: var(--ak-font-size-md);
|
|
33
|
+
font-weight: var(--ak-font-weight-medium);
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
color: var(--ak-color-text);
|
|
39
|
+
}
|
|
40
|
+
&[aria-selected='true'] {
|
|
41
|
+
border-bottom-color: var(--ak-color-text);
|
|
42
|
+
color: var(--ak-color-text);
|
|
43
|
+
}
|
|
44
|
+
&:focus-visible {
|
|
45
|
+
outline: 2px solid var(--ak-color-accent);
|
|
46
|
+
outline-offset: -2px;
|
|
47
|
+
border-radius: var(--ak-radius-control) var(--ak-radius-control) 0 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.ak-tabs__panel {
|
|
51
|
+
padding-top: var(--ak-space-5);
|
|
52
|
+
|
|
53
|
+
&:focus-visible {
|
|
54
|
+
outline: none;
|
|
55
|
+
}
|
|
56
|
+
}
|
package/src/scss/index.scss
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
// Public kit stylesheet. All component classes use the `ak-` prefix so the kit
|
|
2
2
|
// can live next to legacy Ace/Bootstrap 3 CSS on the same page during migration.
|
|
3
|
+
// Rules behind every value: docs/PRINCIPLES.md.
|
|
3
4
|
@use 'tokens';
|
|
5
|
+
@use 'components/icon';
|
|
4
6
|
@use 'components/button';
|
|
7
|
+
@use 'components/badge';
|
|
5
8
|
@use 'components/alert';
|
|
9
|
+
@use 'components/card';
|
|
10
|
+
@use 'components/form';
|
|
11
|
+
@use 'components/table';
|
|
12
|
+
@use 'components/tabs';
|
|
13
|
+
@use 'components/overlay';
|
|
14
|
+
@use 'components/shell';
|
|
15
|
+
@use 'components/feedback';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Mixins for alert — shared by .ak-alert and the compat layer. No CSS output.
|
|
2
|
+
|
|
3
|
+
@mixin base {
|
|
4
|
+
--_bg: var(--ak-color-info-bg);
|
|
5
|
+
--_fg: var(--ak-color-info-ink);
|
|
6
|
+
--_border: transparent;
|
|
7
|
+
|
|
8
|
+
position: relative;
|
|
9
|
+
margin: 0 0 var(--ak-space-4);
|
|
10
|
+
padding: var(--ak-space-3) var(--ak-space-4);
|
|
11
|
+
border: 1px solid var(--_border);
|
|
12
|
+
border-radius: var(--ak-radius-card);
|
|
13
|
+
background: var(--_bg);
|
|
14
|
+
color: var(--_fg);
|
|
15
|
+
font-size: var(--ak-font-size-md);
|
|
16
|
+
line-height: var(--ak-line-height);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin tone($name) {
|
|
20
|
+
@if $name == positive {
|
|
21
|
+
--_bg: var(--ak-color-positive-bg);
|
|
22
|
+
--_fg: var(--ak-color-positive-ink);
|
|
23
|
+
--_border: transparent;
|
|
24
|
+
} @else if $name == warning {
|
|
25
|
+
--_bg: var(--ak-color-warning-bg);
|
|
26
|
+
--_fg: var(--ak-color-warning-ink);
|
|
27
|
+
--_border: var(--ak-color-warning-border);
|
|
28
|
+
} @else if $name == negative {
|
|
29
|
+
--_bg: var(--ak-color-negative-bg);
|
|
30
|
+
--_fg: var(--ak-color-negative-ink);
|
|
31
|
+
--_border: transparent;
|
|
32
|
+
} @else {
|
|
33
|
+
--_bg: var(--ak-color-info-bg);
|
|
34
|
+
--_fg: var(--ak-color-info-ink);
|
|
35
|
+
--_border: transparent;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@mixin close-button {
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 50%;
|
|
42
|
+
right: var(--ak-space-2);
|
|
43
|
+
display: inline-grid;
|
|
44
|
+
place-items: center;
|
|
45
|
+
width: var(--ak-control-height-sm);
|
|
46
|
+
height: var(--ak-control-height-sm);
|
|
47
|
+
margin-top: calc(var(--ak-control-height-sm) / -2);
|
|
48
|
+
padding: 0;
|
|
49
|
+
border: 0;
|
|
50
|
+
border-radius: var(--ak-radius-control);
|
|
51
|
+
background: none;
|
|
52
|
+
color: inherit;
|
|
53
|
+
font-size: var(--ak-font-size-lg);
|
|
54
|
+
line-height: 1;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
opacity: 0.75;
|
|
57
|
+
|
|
58
|
+
&:hover {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
}
|
|
61
|
+
&:focus-visible {
|
|
62
|
+
outline: none;
|
|
63
|
+
box-shadow: var(--ak-focus-ring);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Mixins for status badges — shared by .ak-badge and the compat layer (.label, .badge). No CSS output.
|
|
2
|
+
|
|
3
|
+
@mixin base {
|
|
4
|
+
--_bg: var(--ak-color-raised);
|
|
5
|
+
--_fg: var(--ak-color-text);
|
|
6
|
+
--_dot: var(--ak-color-faint);
|
|
7
|
+
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
flex: none;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
height: 20px;
|
|
13
|
+
padding: 0 var(--ak-space-2);
|
|
14
|
+
border-radius: var(--ak-radius-chip);
|
|
15
|
+
background: var(--_bg);
|
|
16
|
+
color: var(--_fg);
|
|
17
|
+
font-size: var(--ak-font-size-sm);
|
|
18
|
+
font-weight: var(--ak-font-weight-medium);
|
|
19
|
+
line-height: 1;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin tone($name) {
|
|
25
|
+
@if $name == positive {
|
|
26
|
+
--_bg: var(--ak-color-positive-bg);
|
|
27
|
+
--_fg: var(--ak-color-positive-ink);
|
|
28
|
+
--_dot: var(--ak-color-positive);
|
|
29
|
+
} @else if $name == negative {
|
|
30
|
+
--_bg: var(--ak-color-negative-bg);
|
|
31
|
+
--_fg: var(--ak-color-negative-ink);
|
|
32
|
+
--_dot: var(--ak-color-negative);
|
|
33
|
+
} @else if $name == warning {
|
|
34
|
+
--_bg: var(--ak-color-warning-bg);
|
|
35
|
+
--_fg: var(--ak-color-warning-ink);
|
|
36
|
+
--_dot: var(--ak-color-warning);
|
|
37
|
+
} @else if $name == info {
|
|
38
|
+
--_bg: var(--ak-color-info-bg);
|
|
39
|
+
--_fg: var(--ak-color-info-ink);
|
|
40
|
+
--_dot: var(--ak-color-accent);
|
|
41
|
+
} @else if $name == muted {
|
|
42
|
+
--_bg: var(--ak-color-raised);
|
|
43
|
+
--_fg: var(--ak-color-muted);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@mixin code {
|
|
48
|
+
border: 1px solid var(--ak-color-border);
|
|
49
|
+
font-family: var(--ak-font-mono);
|
|
50
|
+
font-weight: var(--ak-font-weight-regular);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@mixin count {
|
|
54
|
+
justify-content: center;
|
|
55
|
+
min-width: 20px;
|
|
56
|
+
padding: 0 6px;
|
|
57
|
+
border-radius: var(--ak-radius-full);
|
|
58
|
+
font-variant-numeric: tabular-nums;
|
|
59
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@use '../breakpoints' as bp;
|
|
2
|
+
|
|
3
|
+
// Mixins for button — shared by .ak-btn and the compat layer. No CSS output.
|
|
4
|
+
|
|
5
|
+
@mixin base {
|
|
6
|
+
--_bg: var(--ak-color-surface);
|
|
7
|
+
--_bg-hover: var(--ak-color-raised);
|
|
8
|
+
--_fg: var(--ak-color-text);
|
|
9
|
+
--_border: var(--ak-color-control);
|
|
10
|
+
--_h: var(--ak-control-height);
|
|
11
|
+
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
flex: none;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: var(--ak-space-2);
|
|
17
|
+
height: var(--_h);
|
|
18
|
+
padding: 0 var(--ak-space-3);
|
|
19
|
+
border: 1px solid var(--_border);
|
|
20
|
+
border-radius: var(--ak-radius-control);
|
|
21
|
+
background: var(--_bg);
|
|
22
|
+
color: var(--_fg);
|
|
23
|
+
font: inherit;
|
|
24
|
+
font-size: var(--ak-font-size-md);
|
|
25
|
+
font-weight: var(--ak-font-weight-medium);
|
|
26
|
+
line-height: 1;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
vertical-align: middle;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
user-select: none;
|
|
32
|
+
-webkit-tap-highlight-color: transparent;
|
|
33
|
+
transition:
|
|
34
|
+
background-color var(--ak-duration-fast) ease,
|
|
35
|
+
border-color var(--ak-duration-fast) ease,
|
|
36
|
+
transform var(--ak-duration-press) var(--ak-ease-out);
|
|
37
|
+
|
|
38
|
+
@include bp.hover {
|
|
39
|
+
background: var(--_bg-hover);
|
|
40
|
+
color: var(--_fg);
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
}
|
|
43
|
+
&:active:not(:disabled, [aria-disabled='true'], [aria-busy='true']) {
|
|
44
|
+
transform: scale(var(--ak-press-scale));
|
|
45
|
+
}
|
|
46
|
+
&:focus-visible {
|
|
47
|
+
outline: none;
|
|
48
|
+
box-shadow: var(--ak-focus-ring);
|
|
49
|
+
}
|
|
50
|
+
&:disabled,
|
|
51
|
+
&[aria-disabled='true'] {
|
|
52
|
+
// stays legible (>= 3:1); say why it is disabled next to it
|
|
53
|
+
--_bg: var(--ak-color-raised);
|
|
54
|
+
--_bg-hover: var(--ak-color-raised);
|
|
55
|
+
--_fg: var(--ak-color-faint);
|
|
56
|
+
--_border: var(--ak-color-border);
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
|
+
&[aria-busy='true'] {
|
|
60
|
+
cursor: progress;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@mixin variant($name) {
|
|
66
|
+
@if $name == primary {
|
|
67
|
+
--_bg: var(--ak-color-primary);
|
|
68
|
+
--_bg-hover: var(--ak-color-primary-hover);
|
|
69
|
+
--_fg: var(--ak-color-on-primary);
|
|
70
|
+
--_border: transparent;
|
|
71
|
+
} @else if $name == ghost {
|
|
72
|
+
--_bg: transparent;
|
|
73
|
+
--_bg-hover: var(--ak-color-raised);
|
|
74
|
+
--_border: transparent;
|
|
75
|
+
} @else if $name == danger {
|
|
76
|
+
--_bg: var(--ak-color-surface);
|
|
77
|
+
--_bg-hover: var(--ak-color-negative-bg);
|
|
78
|
+
--_fg: var(--ak-color-negative);
|
|
79
|
+
--_border: var(--ak-color-control);
|
|
80
|
+
} @else if $name == secondary {
|
|
81
|
+
--_bg: var(--ak-color-surface);
|
|
82
|
+
--_bg-hover: var(--ak-color-raised);
|
|
83
|
+
--_fg: var(--ak-color-text);
|
|
84
|
+
--_border: var(--ak-color-control);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@mixin size($name) {
|
|
89
|
+
@if $name == sm {
|
|
90
|
+
--_h: var(--ak-control-height-sm);
|
|
91
|
+
padding: 0 var(--ak-space-2);
|
|
92
|
+
font-size: var(--ak-font-size-sm);
|
|
93
|
+
} @else if $name == lg {
|
|
94
|
+
--_h: var(--ak-control-height-lg);
|
|
95
|
+
padding: 0 var(--ak-space-4);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@mixin block {
|
|
100
|
+
display: flex;
|
|
101
|
+
width: 100%;
|
|
102
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Mixins for cards — shared by .ak-card and the compat layer (.widget-box). No CSS output.
|
|
2
|
+
|
|
3
|
+
@mixin frame {
|
|
4
|
+
border: 1px solid var(--ak-color-border);
|
|
5
|
+
border-radius: var(--ak-radius-card);
|
|
6
|
+
background: var(--ak-color-surface);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin header {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--ak-space-2) var(--ak-space-3);
|
|
14
|
+
min-height: 52px;
|
|
15
|
+
padding: var(--ak-space-2) var(--ak-space-5);
|
|
16
|
+
border-bottom: 1px solid var(--ak-color-border);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin title {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--ak-space-2);
|
|
23
|
+
margin: 0;
|
|
24
|
+
color: var(--ak-color-text);
|
|
25
|
+
font-size: var(--ak-font-size-lg);
|
|
26
|
+
font-weight: var(--ak-font-weight-semibold);
|
|
27
|
+
line-height: var(--ak-line-height-tight);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@mixin actions {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: var(--ak-space-2);
|
|
35
|
+
margin-left: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin body {
|
|
39
|
+
padding: var(--ak-space-5);
|
|
40
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Mixins for form controls — shared by .ak-input/.ak-select/.ak-textarea/.ak-label and the compat
|
|
2
|
+
// layer (.form-control, .control-label, .help-block). No CSS output.
|
|
3
|
+
|
|
4
|
+
@mixin control-frame {
|
|
5
|
+
width: 100%;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
border: 1px solid var(--ak-color-control);
|
|
8
|
+
border-radius: var(--ak-radius-control);
|
|
9
|
+
background: var(--ak-color-surface);
|
|
10
|
+
color: var(--ak-color-text);
|
|
11
|
+
font: inherit;
|
|
12
|
+
font-size: var(--ak-font-size-md);
|
|
13
|
+
line-height: var(--ak-line-height);
|
|
14
|
+
transition:
|
|
15
|
+
border-color var(--ak-duration-fast) ease,
|
|
16
|
+
box-shadow var(--ak-duration-fast) ease;
|
|
17
|
+
|
|
18
|
+
&::placeholder {
|
|
19
|
+
color: var(--ak-color-faint);
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
&:focus,
|
|
23
|
+
&:focus-within {
|
|
24
|
+
border-color: var(--ak-color-accent);
|
|
25
|
+
outline: none;
|
|
26
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ak-color-accent) 22%, transparent);
|
|
27
|
+
}
|
|
28
|
+
&[aria-invalid='true'],
|
|
29
|
+
&:has([aria-invalid='true']) {
|
|
30
|
+
border-color: var(--ak-color-negative);
|
|
31
|
+
}
|
|
32
|
+
&[aria-invalid='true']:focus,
|
|
33
|
+
&:has([aria-invalid='true']:focus) {
|
|
34
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ak-color-negative) 20%, transparent);
|
|
35
|
+
}
|
|
36
|
+
&:disabled,
|
|
37
|
+
&:has(:disabled),
|
|
38
|
+
&[readonly] {
|
|
39
|
+
background: var(--ak-color-raised);
|
|
40
|
+
color: var(--ak-color-muted);
|
|
41
|
+
}
|
|
42
|
+
&:disabled,
|
|
43
|
+
&:has(:disabled) {
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@mixin input {
|
|
49
|
+
@include control-frame;
|
|
50
|
+
display: block;
|
|
51
|
+
height: var(--ak-control-height-lg);
|
|
52
|
+
padding: 0 var(--ak-space-3);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin textarea {
|
|
56
|
+
@include control-frame;
|
|
57
|
+
display: block;
|
|
58
|
+
height: auto;
|
|
59
|
+
min-height: 96px;
|
|
60
|
+
padding: var(--ak-space-2) var(--ak-space-3);
|
|
61
|
+
resize: vertical;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@mixin label {
|
|
65
|
+
margin: 0;
|
|
66
|
+
color: var(--ak-color-text);
|
|
67
|
+
font-size: var(--ak-font-size-md);
|
|
68
|
+
font-weight: var(--ak-font-weight-medium);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@mixin hint {
|
|
72
|
+
margin: 0;
|
|
73
|
+
color: var(--ak-color-muted);
|
|
74
|
+
font-size: var(--ak-font-size-sm);
|
|
75
|
+
line-height: var(--ak-line-height-tight);
|
|
76
|
+
}
|