@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,66 @@
|
|
|
1
|
+
@use '../mixins/card';
|
|
2
|
+
|
|
3
|
+
// .ak-card — a flat panel: 1px border, no shadow (docs/PRINCIPLES.md §3).
|
|
4
|
+
// .ak-card__header > .ak-card__title (+ .ak-card__meta) + .ak-card__actions
|
|
5
|
+
// .ak-card__body (.ak-card__body--flush for a table or list that runs edge to edge)
|
|
6
|
+
// .ak-card__footer (.ak-card__footer--end: the panel's Save at the bottom right)
|
|
7
|
+
// .ak-card--muted — a raised well instead of a white panel.
|
|
8
|
+
|
|
9
|
+
.ak-card {
|
|
10
|
+
@include card.frame;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
|
|
15
|
+
&--muted {
|
|
16
|
+
border-color: transparent;
|
|
17
|
+
background: var(--ak-color-raised);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ak-card__header {
|
|
22
|
+
@include card.header;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ak-card__title {
|
|
26
|
+
@include card.title;
|
|
27
|
+
|
|
28
|
+
> .ak-icon {
|
|
29
|
+
color: var(--ak-color-muted);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ak-card__meta {
|
|
34
|
+
color: var(--ak-color-muted);
|
|
35
|
+
font-size: var(--ak-font-size-sm);
|
|
36
|
+
font-variant-numeric: tabular-nums;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ak-card__actions {
|
|
40
|
+
@include card.actions;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ak-card__body {
|
|
44
|
+
@include card.body;
|
|
45
|
+
flex: 1 1 auto;
|
|
46
|
+
|
|
47
|
+
&--flush {
|
|
48
|
+
padding: 0;
|
|
49
|
+
}
|
|
50
|
+
> :last-child {
|
|
51
|
+
margin-bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ak-card__footer {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--ak-space-2);
|
|
60
|
+
padding: var(--ak-space-3) var(--ak-space-5);
|
|
61
|
+
border-top: 1px solid var(--ak-color-border);
|
|
62
|
+
|
|
63
|
+
&--end {
|
|
64
|
+
justify-content: flex-end;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
@use '../breakpoints' as bp;
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------- toast
|
|
4
|
+
// Created by toast() / [data-ak-toast]; see src/js/toast.ts. Bottom right, newest at the bottom.
|
|
5
|
+
|
|
6
|
+
.ak-toaster {
|
|
7
|
+
position: fixed;
|
|
8
|
+
right: var(--ak-space-4);
|
|
9
|
+
bottom: var(--ak-space-4);
|
|
10
|
+
z-index: var(--ak-z-toast);
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--ak-space-2);
|
|
14
|
+
width: min(380px, calc(100vw - 2 * var(--ak-space-4)));
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
|
|
17
|
+
@include bp.down(sm) {
|
|
18
|
+
right: var(--ak-space-2);
|
|
19
|
+
bottom: var(--ak-space-2);
|
|
20
|
+
width: calc(100vw - 2 * var(--ak-space-2));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ak-toast {
|
|
25
|
+
--_accent: transparent;
|
|
26
|
+
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--ak-space-2);
|
|
30
|
+
min-height: 48px;
|
|
31
|
+
padding: var(--ak-space-2) var(--ak-space-2) var(--ak-space-2) var(--ak-space-4);
|
|
32
|
+
border: 1px solid var(--ak-color-border);
|
|
33
|
+
border-left: 3px solid var(--_accent);
|
|
34
|
+
border-radius: var(--ak-radius-card);
|
|
35
|
+
background: var(--ak-color-surface);
|
|
36
|
+
color: var(--ak-color-text);
|
|
37
|
+
font-size: var(--ak-font-size-md);
|
|
38
|
+
box-shadow: var(--ak-shadow-float);
|
|
39
|
+
pointer-events: auto;
|
|
40
|
+
// enter and exit from the same side; transitions so a new toast can interrupt
|
|
41
|
+
opacity: 0;
|
|
42
|
+
transform: translateY(8px) scale(0.98);
|
|
43
|
+
transition:
|
|
44
|
+
opacity var(--ak-duration-base) var(--ak-ease-out),
|
|
45
|
+
transform var(--ak-duration-base) var(--ak-ease-out);
|
|
46
|
+
|
|
47
|
+
&[data-shown] {
|
|
48
|
+
opacity: 1;
|
|
49
|
+
transform: none;
|
|
50
|
+
}
|
|
51
|
+
&[data-leaving] {
|
|
52
|
+
transition-duration: var(--ak-duration-fast);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--positive {
|
|
56
|
+
--_accent: var(--ak-color-positive);
|
|
57
|
+
}
|
|
58
|
+
&--negative {
|
|
59
|
+
--_accent: var(--ak-color-negative);
|
|
60
|
+
}
|
|
61
|
+
&--warning {
|
|
62
|
+
--_accent: var(--ak-color-warning-border);
|
|
63
|
+
}
|
|
64
|
+
&--info {
|
|
65
|
+
--_accent: var(--ak-color-accent);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.ak-toast__text {
|
|
69
|
+
flex: 1 1 auto;
|
|
70
|
+
margin: 0;
|
|
71
|
+
line-height: var(--ak-line-height-tight);
|
|
72
|
+
}
|
|
73
|
+
.ak-toast__action {
|
|
74
|
+
flex: none;
|
|
75
|
+
height: var(--ak-control-height-sm);
|
|
76
|
+
padding: 0 var(--ak-space-2);
|
|
77
|
+
border: 0;
|
|
78
|
+
border-radius: var(--ak-radius-control);
|
|
79
|
+
background: none;
|
|
80
|
+
color: var(--ak-color-link);
|
|
81
|
+
font: inherit;
|
|
82
|
+
font-weight: var(--ak-font-weight-medium);
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
|
|
85
|
+
&:hover {
|
|
86
|
+
background: var(--ak-color-raised);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
.ak-toast__close {
|
|
90
|
+
display: inline-grid;
|
|
91
|
+
flex: none;
|
|
92
|
+
place-items: center;
|
|
93
|
+
width: var(--ak-control-height-sm);
|
|
94
|
+
height: var(--ak-control-height-sm);
|
|
95
|
+
border: 0;
|
|
96
|
+
border-radius: var(--ak-radius-control);
|
|
97
|
+
background: none;
|
|
98
|
+
color: var(--ak-color-muted);
|
|
99
|
+
font-size: var(--ak-font-size-lg);
|
|
100
|
+
line-height: 1;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
|
|
103
|
+
&:hover {
|
|
104
|
+
background: var(--ak-color-raised);
|
|
105
|
+
color: var(--ak-color-text);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
.ak-toast__action,
|
|
109
|
+
.ak-toast__close {
|
|
110
|
+
&:focus-visible {
|
|
111
|
+
outline: none;
|
|
112
|
+
box-shadow: var(--ak-focus-ring);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ---------------------------------------------------------------- tooltip
|
|
117
|
+
// One shared bubble created by the tooltip behaviour; see src/js/tooltip.ts.
|
|
118
|
+
|
|
119
|
+
.ak-tooltip {
|
|
120
|
+
position: fixed;
|
|
121
|
+
top: 0;
|
|
122
|
+
left: 0;
|
|
123
|
+
z-index: var(--ak-z-tooltip);
|
|
124
|
+
max-width: 260px;
|
|
125
|
+
padding: var(--ak-space-1) var(--ak-space-2);
|
|
126
|
+
border-radius: var(--ak-radius-control);
|
|
127
|
+
background: var(--ak-color-primary);
|
|
128
|
+
color: var(--ak-color-on-primary);
|
|
129
|
+
font-size: var(--ak-font-size-sm);
|
|
130
|
+
line-height: var(--ak-line-height-tight);
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
opacity: 0;
|
|
133
|
+
transform: scale(0.97);
|
|
134
|
+
transform-origin: bottom center;
|
|
135
|
+
transition:
|
|
136
|
+
opacity var(--ak-duration-fast) var(--ak-ease-out),
|
|
137
|
+
transform var(--ak-duration-fast) var(--ak-ease-out);
|
|
138
|
+
visibility: hidden;
|
|
139
|
+
|
|
140
|
+
&[data-side='bottom'] {
|
|
141
|
+
transform-origin: top center;
|
|
142
|
+
}
|
|
143
|
+
&[data-open] {
|
|
144
|
+
opacity: 1;
|
|
145
|
+
transform: none;
|
|
146
|
+
visibility: visible;
|
|
147
|
+
}
|
|
148
|
+
&[data-instant] {
|
|
149
|
+
transition-duration: 0ms;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ---------------------------------------------------------------- file drop zone
|
|
154
|
+
// <label class="ak-file"><input type="file"> <span class="ak-file__prompt">…</span> <span class="ak-file__list"></span></label>
|
|
155
|
+
|
|
156
|
+
.ak-file {
|
|
157
|
+
position: relative;
|
|
158
|
+
display: grid;
|
|
159
|
+
justify-items: center;
|
|
160
|
+
gap: var(--ak-space-2);
|
|
161
|
+
padding: var(--ak-space-6) var(--ak-space-4);
|
|
162
|
+
border: 1px dashed var(--ak-color-control);
|
|
163
|
+
border-radius: var(--ak-radius-card);
|
|
164
|
+
background: var(--ak-color-surface);
|
|
165
|
+
color: var(--ak-color-muted);
|
|
166
|
+
font-size: var(--ak-font-size-md);
|
|
167
|
+
text-align: center;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
transition:
|
|
170
|
+
border-color var(--ak-duration-fast) ease,
|
|
171
|
+
background-color var(--ak-duration-fast) ease;
|
|
172
|
+
|
|
173
|
+
> input[type='file'] {
|
|
174
|
+
position: absolute;
|
|
175
|
+
width: 1px;
|
|
176
|
+
height: 1px;
|
|
177
|
+
opacity: 0;
|
|
178
|
+
}
|
|
179
|
+
&:hover,
|
|
180
|
+
&[data-dragover] {
|
|
181
|
+
border-color: var(--ak-color-accent);
|
|
182
|
+
background: color-mix(in srgb, var(--ak-color-accent) 5%, var(--ak-color-surface));
|
|
183
|
+
}
|
|
184
|
+
&:has(input:focus-visible) {
|
|
185
|
+
box-shadow: var(--ak-focus-ring);
|
|
186
|
+
}
|
|
187
|
+
&:has(input:disabled) {
|
|
188
|
+
background: var(--ak-color-raised);
|
|
189
|
+
cursor: not-allowed;
|
|
190
|
+
}
|
|
191
|
+
u {
|
|
192
|
+
color: var(--ak-color-link);
|
|
193
|
+
text-decoration: none;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
.ak-file__list {
|
|
197
|
+
display: grid;
|
|
198
|
+
gap: var(--ak-space-1);
|
|
199
|
+
justify-items: center;
|
|
200
|
+
|
|
201
|
+
&:empty {
|
|
202
|
+
display: none;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
.ak-file__item {
|
|
206
|
+
color: var(--ak-color-text);
|
|
207
|
+
font-size: var(--ak-font-size-sm);
|
|
208
|
+
font-variant-numeric: tabular-nums;
|
|
209
|
+
|
|
210
|
+
&[data-invalid] {
|
|
211
|
+
color: var(--ak-color-negative);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@media (prefers-reduced-motion: reduce) {
|
|
216
|
+
.ak-toast {
|
|
217
|
+
transform: none !important;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -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,29 @@
|
|
|
1
|
+
// <svg class="ak-icon" aria-hidden="true"><use href="/path/to/icons.svg#save"></use></svg>
|
|
2
|
+
// Outline icons (Lucide), one set, inheriting the text colour. Decorative by default (aria-hidden);
|
|
3
|
+
// an icon-only control carries aria-label on the control itself.
|
|
4
|
+
// .ak-icon--sm (12px) | --lg (20px) · .ak-icon--end — after the label
|
|
5
|
+
|
|
6
|
+
.ak-icon {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
flex: none;
|
|
9
|
+
width: var(--ak-icon-size);
|
|
10
|
+
height: var(--ak-icon-size);
|
|
11
|
+
vertical-align: -0.2em;
|
|
12
|
+
fill: none;
|
|
13
|
+
stroke: currentColor;
|
|
14
|
+
stroke-width: var(--ak-icon-stroke);
|
|
15
|
+
stroke-linecap: round;
|
|
16
|
+
stroke-linejoin: round;
|
|
17
|
+
|
|
18
|
+
&--sm {
|
|
19
|
+
--ak-icon-size: 12px;
|
|
20
|
+
--ak-icon-stroke: 2;
|
|
21
|
+
}
|
|
22
|
+
&--lg {
|
|
23
|
+
--ak-icon-size: 20px;
|
|
24
|
+
--ak-icon-stroke: 1.5;
|
|
25
|
+
}
|
|
26
|
+
&--end {
|
|
27
|
+
order: 1;
|
|
28
|
+
}
|
|
29
|
+
}
|