@apo100l/ace-ui-kit 0.0.1 → 0.1.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 +49 -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 +22 -9
- package/dist/ace-ui-kit.js.map +1 -1
- package/dist/compat.d.ts +14 -0
- package/dist/icons.svg +56 -0
- package/dist/index.d.ts +2 -0
- package/dist/js/compat/ace.d.ts +2 -0
- package/dist/js/compat/bootstrap.d.ts +9 -0
- package/dist/js/icon.d.ts +13 -0
- package/package.json +35 -8
- package/src/icons/icons.json +58 -0
- package/src/scss/_breakpoints.scss +32 -0
- package/src/scss/_tokens.scss +175 -33
- package/src/scss/compat/_base.scss +165 -0
- package/src/scss/compat/_buttons.scss +100 -0
- package/src/scss/compat/_feedback.scss +210 -0
- package/src/scss/compat/_forms.scss +253 -0
- package/src/scss/compat/_grid.scss +107 -0
- package/src/scss/compat/_layout.scss +427 -0
- package/src/scss/compat/_navigation.scss +181 -0
- package/src/scss/compat/_plugins.scss +105 -0
- package/src/scss/compat/_tables.scss +117 -0
- package/src/scss/compat/_utilities.scss +160 -0
- package/src/scss/compat/_widgets.scss +136 -0
- package/src/scss/compat/index.scss +18 -10
- package/src/scss/components/_alert.scss +21 -22
- package/src/scss/components/_button.scss +34 -33
- package/src/scss/components/_icon.scss +29 -0
- package/src/scss/index.scss +2 -0
- package/src/scss/mixins/_alert.scss +65 -0
- package/src/scss/mixins/_button.scss +102 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Tables: 12px grey sentence-case header with no band, rules between rows, no zebra
|
|
2
|
+
// (docs/PRINCIPLES.md §5). Legacy markup often uses <thead><td> instead of <th>.
|
|
3
|
+
|
|
4
|
+
.table-responsive {
|
|
5
|
+
width: 100%;
|
|
6
|
+
overflow-x: auto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.table {
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
margin: 0;
|
|
13
|
+
background: var(--ak-color-surface);
|
|
14
|
+
font-size: var(--ak-font-size-md);
|
|
15
|
+
|
|
16
|
+
> thead > tr > th,
|
|
17
|
+
> thead > tr > td {
|
|
18
|
+
height: 40px;
|
|
19
|
+
padding: var(--ak-space-2) var(--ak-space-4);
|
|
20
|
+
border-bottom: 1px solid var(--ak-color-border);
|
|
21
|
+
background: none;
|
|
22
|
+
color: var(--ak-color-muted);
|
|
23
|
+
font-size: var(--ak-font-size-sm);
|
|
24
|
+
font-weight: var(--ak-font-weight-regular);
|
|
25
|
+
text-align: left;
|
|
26
|
+
text-transform: none;
|
|
27
|
+
letter-spacing: 0;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
vertical-align: bottom;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
> tbody > tr > td,
|
|
33
|
+
> tbody > tr > th,
|
|
34
|
+
> tfoot > tr > td {
|
|
35
|
+
height: var(--ak-row-height);
|
|
36
|
+
padding: var(--ak-space-2) var(--ak-space-4);
|
|
37
|
+
border-top: 1px solid var(--ak-color-rule);
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
}
|
|
40
|
+
> tbody > tr:first-child > td,
|
|
41
|
+
> tbody > tr:first-child > th {
|
|
42
|
+
border-top: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// the action column (last cell) stays on one line, right-aligned
|
|
46
|
+
> tbody > tr > td:last-child:has(.btn, form) {
|
|
47
|
+
width: 1%;
|
|
48
|
+
text-align: right;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// numbers line up digit for digit
|
|
53
|
+
td.right,
|
|
54
|
+
td.text-right,
|
|
55
|
+
th.text-right {
|
|
56
|
+
text-align: right;
|
|
57
|
+
font-variant-numeric: tabular-nums;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.table-striped > tbody > tr:nth-child(odd) {
|
|
61
|
+
background: none; // no zebra
|
|
62
|
+
}
|
|
63
|
+
&.table-bordered {
|
|
64
|
+
border: 1px solid var(--ak-color-border);
|
|
65
|
+
}
|
|
66
|
+
&.table-hover > tbody > tr:hover {
|
|
67
|
+
background: var(--ak-color-raised);
|
|
68
|
+
}
|
|
69
|
+
&.table-condensed > tbody > tr > td {
|
|
70
|
+
height: 36px;
|
|
71
|
+
padding-top: var(--ak-space-1);
|
|
72
|
+
padding-bottom: var(--ak-space-1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pagination {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
gap: var(--ak-space-1);
|
|
79
|
+
margin: var(--ak-space-4) 0;
|
|
80
|
+
padding: 0;
|
|
81
|
+
list-style: none;
|
|
82
|
+
|
|
83
|
+
> li > a,
|
|
84
|
+
> li > span {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
min-width: var(--ak-control-height);
|
|
89
|
+
height: var(--ak-control-height);
|
|
90
|
+
padding: 0 var(--ak-space-2);
|
|
91
|
+
border: 1px solid var(--ak-color-control);
|
|
92
|
+
border-radius: var(--ak-radius-control);
|
|
93
|
+
background: var(--ak-color-surface);
|
|
94
|
+
color: var(--ak-color-text);
|
|
95
|
+
font-variant-numeric: tabular-nums;
|
|
96
|
+
text-decoration: none;
|
|
97
|
+
}
|
|
98
|
+
> li > a:hover {
|
|
99
|
+
background: var(--ak-color-raised);
|
|
100
|
+
}
|
|
101
|
+
> .active > a,
|
|
102
|
+
> .active > span {
|
|
103
|
+
border-color: transparent;
|
|
104
|
+
background: var(--ak-color-active);
|
|
105
|
+
font-weight: var(--ak-font-weight-semibold);
|
|
106
|
+
}
|
|
107
|
+
> .disabled > a,
|
|
108
|
+
> .disabled > span {
|
|
109
|
+
color: var(--ak-color-faint);
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// row actions sit side by side with a small gap (a link next to a delete <form>, button groups…)
|
|
115
|
+
.table td > :is(.btn, .btn-group, form) + :is(.btn, .btn-group, form) {
|
|
116
|
+
margin-left: var(--ak-space-1);
|
|
117
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Ace / Bootstrap 3 helper classes. Ace's colour words map onto status/text tokens; size words onto
|
|
2
|
+
// the type scale. These exist only so legacy markup keeps working — new markup uses kit components.
|
|
3
|
+
|
|
4
|
+
// text alignment
|
|
5
|
+
.center,
|
|
6
|
+
.text-center {
|
|
7
|
+
text-align: center !important;
|
|
8
|
+
}
|
|
9
|
+
.text-left,
|
|
10
|
+
.left {
|
|
11
|
+
text-align: left !important;
|
|
12
|
+
}
|
|
13
|
+
.text-right,
|
|
14
|
+
.right {
|
|
15
|
+
text-align: right !important;
|
|
16
|
+
}
|
|
17
|
+
.text-nowrap {
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
}
|
|
20
|
+
.align-middle,
|
|
21
|
+
.middle {
|
|
22
|
+
vertical-align: middle !important;
|
|
23
|
+
}
|
|
24
|
+
.align-top {
|
|
25
|
+
vertical-align: top !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// text colours (Bootstrap)
|
|
29
|
+
.text-muted {
|
|
30
|
+
color: var(--ak-color-muted) !important;
|
|
31
|
+
}
|
|
32
|
+
.text-primary,
|
|
33
|
+
.text-info {
|
|
34
|
+
color: var(--ak-color-link) !important;
|
|
35
|
+
}
|
|
36
|
+
.text-success {
|
|
37
|
+
color: var(--ak-color-positive) !important;
|
|
38
|
+
}
|
|
39
|
+
.text-warning {
|
|
40
|
+
color: var(--ak-color-warning) !important;
|
|
41
|
+
}
|
|
42
|
+
.text-danger {
|
|
43
|
+
color: var(--ak-color-negative) !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Ace colour words
|
|
47
|
+
.green {
|
|
48
|
+
color: var(--ak-color-positive) !important;
|
|
49
|
+
}
|
|
50
|
+
.red {
|
|
51
|
+
color: var(--ak-color-negative) !important;
|
|
52
|
+
}
|
|
53
|
+
.orange {
|
|
54
|
+
color: var(--ak-color-warning) !important;
|
|
55
|
+
}
|
|
56
|
+
.blue,
|
|
57
|
+
.light-blue {
|
|
58
|
+
color: var(--ak-color-link) !important;
|
|
59
|
+
}
|
|
60
|
+
.grey,
|
|
61
|
+
.light-grey,
|
|
62
|
+
.color-gray {
|
|
63
|
+
color: var(--ak-color-muted) !important;
|
|
64
|
+
}
|
|
65
|
+
.dark {
|
|
66
|
+
color: var(--ak-color-text) !important;
|
|
67
|
+
}
|
|
68
|
+
.white {
|
|
69
|
+
color: var(--ak-color-surface) !important;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Ace size words
|
|
73
|
+
.bigger {
|
|
74
|
+
font-size: var(--ak-font-size-lg) !important;
|
|
75
|
+
}
|
|
76
|
+
.smaller {
|
|
77
|
+
font-size: var(--ak-font-size-sm) !important;
|
|
78
|
+
}
|
|
79
|
+
@each $n in 110, 120, 125, 130, 140, 150 {
|
|
80
|
+
.bigger-#{$n} {
|
|
81
|
+
font-size: #{$n * 1%} !important;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
@each $n in 50, 60, 70, 75, 80, 90 {
|
|
85
|
+
.smaller-#{$n} {
|
|
86
|
+
font-size: #{$n * 1%} !important;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
.lighter {
|
|
90
|
+
font-weight: var(--ak-font-weight-semibold); // Ace's thin titles become regular card titles
|
|
91
|
+
}
|
|
92
|
+
.bolder {
|
|
93
|
+
font-weight: var(--ak-font-weight-semibold) !important;
|
|
94
|
+
}
|
|
95
|
+
.normal {
|
|
96
|
+
font-weight: var(--ak-font-weight-regular) !important;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// box helpers
|
|
100
|
+
.no-border {
|
|
101
|
+
border: 0 !important;
|
|
102
|
+
}
|
|
103
|
+
.no-padding {
|
|
104
|
+
padding: 0 !important;
|
|
105
|
+
}
|
|
106
|
+
.no-margin {
|
|
107
|
+
margin: 0 !important;
|
|
108
|
+
}
|
|
109
|
+
@each $n in 4, 8, 12, 16 {
|
|
110
|
+
.padding-#{$n} {
|
|
111
|
+
padding: #{$n}px !important;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
@each $n in 25, 50, 75, 80, 100 {
|
|
115
|
+
.width-#{$n} {
|
|
116
|
+
width: #{$n * 1%} !important;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
.width-auto {
|
|
120
|
+
width: auto !important;
|
|
121
|
+
}
|
|
122
|
+
.block {
|
|
123
|
+
display: block !important;
|
|
124
|
+
}
|
|
125
|
+
.inline {
|
|
126
|
+
display: inline-block !important;
|
|
127
|
+
}
|
|
128
|
+
.position-relative {
|
|
129
|
+
position: relative !important;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// vertical spacers
|
|
133
|
+
.space,
|
|
134
|
+
.space-4,
|
|
135
|
+
.space-6,
|
|
136
|
+
.space-8,
|
|
137
|
+
.space-12,
|
|
138
|
+
.space-16 {
|
|
139
|
+
display: block;
|
|
140
|
+
max-height: 1px;
|
|
141
|
+
margin: var(--ak-space-1) 0 0;
|
|
142
|
+
}
|
|
143
|
+
.space-6 {
|
|
144
|
+
margin-top: var(--ak-space-2);
|
|
145
|
+
}
|
|
146
|
+
.space-8 {
|
|
147
|
+
margin-top: var(--ak-space-3);
|
|
148
|
+
}
|
|
149
|
+
.space,
|
|
150
|
+
.space-12 {
|
|
151
|
+
margin-top: var(--ak-space-4);
|
|
152
|
+
}
|
|
153
|
+
.space-16 {
|
|
154
|
+
margin-top: var(--ak-space-5);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Font Awesome helper used by Ace for icons after a label
|
|
158
|
+
.fa-on-right {
|
|
159
|
+
margin-left: var(--ak-space-1);
|
|
160
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Ace widget-box → a flat card: 1px border, no shadow, a header row with title and toolbar.
|
|
2
|
+
// .widget-box > .widget-header(.header-color-*) > h4|h5 + .widget-toolbar
|
|
3
|
+
// > .widget-body > .widget-main(.no-padding)
|
|
4
|
+
|
|
5
|
+
.widget-box {
|
|
6
|
+
margin: 0 0 var(--ak-space-4);
|
|
7
|
+
border: 1px solid var(--ak-color-border);
|
|
8
|
+
border-radius: var(--ak-radius-card);
|
|
9
|
+
background: var(--ak-color-surface);
|
|
10
|
+
|
|
11
|
+
&.no-border {
|
|
12
|
+
border: 0;
|
|
13
|
+
}
|
|
14
|
+
&.transparent {
|
|
15
|
+
border: 0;
|
|
16
|
+
background: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.widget-header {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-wrap: wrap;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
gap: var(--ak-space-2) var(--ak-space-3);
|
|
26
|
+
min-height: 52px;
|
|
27
|
+
padding: var(--ak-space-2) var(--ak-space-4);
|
|
28
|
+
border-bottom: 1px solid var(--ak-color-border);
|
|
29
|
+
border-radius: var(--ak-radius-card) var(--ak-radius-card) 0 0;
|
|
30
|
+
background: none; // header-color-* carried Ace's blue bar: chrome stays neutral
|
|
31
|
+
color: var(--ak-color-text);
|
|
32
|
+
|
|
33
|
+
> h4,
|
|
34
|
+
> h5,
|
|
35
|
+
> .widget-title {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: var(--ak-space-2);
|
|
39
|
+
margin: 0;
|
|
40
|
+
font-size: var(--ak-font-size-lg);
|
|
41
|
+
font-weight: var(--ak-font-weight-semibold);
|
|
42
|
+
line-height: var(--ak-line-height-tight);
|
|
43
|
+
|
|
44
|
+
> .fa,
|
|
45
|
+
> [class^='icon-'] {
|
|
46
|
+
color: var(--ak-color-muted);
|
|
47
|
+
font-size: 15px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
&.text-left {
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.widget-toolbar {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--ak-space-2);
|
|
60
|
+
margin-left: auto;
|
|
61
|
+
|
|
62
|
+
> a:not(.btn) {
|
|
63
|
+
display: inline-grid;
|
|
64
|
+
place-items: center;
|
|
65
|
+
width: var(--ak-control-height-sm);
|
|
66
|
+
height: var(--ak-control-height-sm);
|
|
67
|
+
border-radius: var(--ak-radius-control);
|
|
68
|
+
color: var(--ak-color-muted);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
|
|
71
|
+
&:hover {
|
|
72
|
+
background: var(--ak-color-raised);
|
|
73
|
+
color: var(--ak-color-text);
|
|
74
|
+
text-decoration: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.widget-body {
|
|
80
|
+
border-radius: 0 0 var(--ak-radius-card) var(--ak-radius-card);
|
|
81
|
+
}
|
|
82
|
+
.widget-main {
|
|
83
|
+
padding: var(--ak-space-5);
|
|
84
|
+
|
|
85
|
+
&.no-padding {
|
|
86
|
+
padding: 0;
|
|
87
|
+
}
|
|
88
|
+
&.padding-4 {
|
|
89
|
+
padding: var(--ak-space-1);
|
|
90
|
+
}
|
|
91
|
+
&.padding-8 {
|
|
92
|
+
padding: var(--ak-space-2);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// A full-width submit button right after the card body is the panel's Save: bottom right, auto width
|
|
96
|
+
.widget-box > .btn-block,
|
|
97
|
+
.widget-box > form > .btn-block,
|
|
98
|
+
.widget-body > .btn-block {
|
|
99
|
+
display: flex;
|
|
100
|
+
width: fit-content;
|
|
101
|
+
margin: 0 var(--ak-space-5) var(--ak-space-5) auto;
|
|
102
|
+
padding: 0 var(--ak-space-4);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// A primary button inside a form field (e.g. "Превью", "Выбрать файл") is a secondary action:
|
|
106
|
+
// the screen keeps one primary — Save.
|
|
107
|
+
.widget-main .form-group .btn-primary {
|
|
108
|
+
--_bg: var(--ak-color-surface);
|
|
109
|
+
--_bg-hover: var(--ak-color-raised);
|
|
110
|
+
--_fg: var(--ak-color-text);
|
|
111
|
+
--_border: var(--ak-color-control);
|
|
112
|
+
}
|
|
113
|
+
.widget-toolbox {
|
|
114
|
+
padding: var(--ak-space-3) var(--ak-space-4);
|
|
115
|
+
border-top: 1px solid var(--ak-color-border);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// A full-width button as the last row inside a list card ("Добавить" under a table) repeats the toolbar
|
|
119
|
+
// action — it becomes a quiet add row with a rule above it, not a second filled primary.
|
|
120
|
+
.widget-main.no-padding > .row:last-child > [class*='col-'] > .btn-block:only-child:not(.modal *) {
|
|
121
|
+
--_bg: transparent;
|
|
122
|
+
--_bg-hover: var(--ak-color-raised);
|
|
123
|
+
--_fg: var(--ak-color-link);
|
|
124
|
+
--_border: transparent;
|
|
125
|
+
--_h: 44px;
|
|
126
|
+
border-top: 1px solid var(--ak-color-border);
|
|
127
|
+
border-radius: 0 0 var(--ak-radius-card) var(--ak-radius-card);
|
|
128
|
+
font-size: var(--ak-font-size-md);
|
|
129
|
+
}
|
|
130
|
+
.widget-main.no-padding > .row:last-child:not(.modal *) {
|
|
131
|
+
margin: 0;
|
|
132
|
+
|
|
133
|
+
> [class*='col-']:has(> .btn-block:only-child) {
|
|
134
|
+
padding: 0;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
// Compatibility layer: restyles legacy Ace 1.x / Bootstrap 3
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// Compatibility layer: restyles legacy Ace 1.x / Bootstrap 3 markup with kit tokens, so an admin can
|
|
2
|
+
// drop ace.min.css, ace-skins.min.css and bootstrap.min.css without rewriting its templates at once.
|
|
3
|
+
// Ported from the Tailwind layer in apo100l.cms (develop: @frontend/admin/src/styles/admin-*.scss)
|
|
4
|
+
// and extended with the classes found by the smart-ek inventory. Rules: docs/PRINCIPLES.md.
|
|
5
|
+
//
|
|
6
|
+
// Load it after the kit CSS and instead of (not next to) ace*.css / bootstrap.min.css.
|
|
7
|
+
// Pair with the compat JS (`@apo100l/ace-ui-kit/compat`) to replace bootstrap.js.
|
|
4
8
|
@use '../tokens';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
@use 'base';
|
|
10
|
+
@use 'buttons';
|
|
11
|
+
@use 'forms';
|
|
12
|
+
@use 'grid'; // after forms: col-* widths win over .input-group / .ace-spinner widths
|
|
13
|
+
@use 'tables';
|
|
14
|
+
@use 'navigation';
|
|
15
|
+
@use 'feedback';
|
|
16
|
+
@use 'widgets';
|
|
17
|
+
@use 'layout';
|
|
18
|
+
@use 'utilities';
|
|
19
|
+
@use 'plugins';
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
@use '../mixins/alert' as alert;
|
|
2
2
|
|
|
3
|
-
.ak-alert
|
|
4
|
-
|
|
3
|
+
// .ak-alert [.ak-alert--positive|info|warning|negative] — a pale tint with dark ink of the same hue.
|
|
4
|
+
// Inline, inside the block it is about. role="status" (or role="alert" for errors).
|
|
5
|
+
// Close button: [data-ak-dismiss] (wired by init()/dismissible()).
|
|
6
|
+
// 0.0.x names --success / --danger are kept as aliases. Mixins are shared with compat (.alert).
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
border: 1px solid var(--ak-color-border);
|
|
9
|
-
border-left: 3px solid var(--_accent);
|
|
10
|
-
border-radius: var(--ak-radius);
|
|
11
|
-
background: var(--ak-color-surface);
|
|
12
|
-
color: var(--ak-color-text);
|
|
8
|
+
.ak-alert {
|
|
9
|
+
@include alert.base;
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
&:has([data-ak-dismiss]) {
|
|
12
|
+
padding-right: var(--ak-space-10);
|
|
13
|
+
}
|
|
14
|
+
&--positive,
|
|
15
|
+
&--success {
|
|
16
|
+
@include alert.tone(positive);
|
|
17
|
+
}
|
|
18
|
+
&--warning {
|
|
19
|
+
@include alert.tone(warning);
|
|
20
|
+
}
|
|
21
|
+
&--negative,
|
|
22
|
+
&--danger {
|
|
23
|
+
@include alert.tone(negative);
|
|
16
24
|
}
|
|
17
|
-
|
|
18
25
|
[data-ak-dismiss] {
|
|
19
|
-
|
|
20
|
-
top: var(--ak-space-2);
|
|
21
|
-
right: var(--ak-space-2);
|
|
22
|
-
border: 0;
|
|
23
|
-
background: none;
|
|
24
|
-
color: var(--ak-color-text-muted);
|
|
25
|
-
font-size: var(--ak-font-size-lg);
|
|
26
|
-
line-height: 1;
|
|
27
|
-
cursor: pointer;
|
|
26
|
+
@include alert.close-button;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
@use '../mixins/button' as btn;
|
|
2
2
|
|
|
3
|
-
.ak-btn
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
border-radius: var(--ak-radius);
|
|
14
|
-
background: var(--_bg);
|
|
15
|
-
color: var(--_fg);
|
|
16
|
-
font: inherit;
|
|
17
|
-
font-size: var(--ak-font-size);
|
|
18
|
-
line-height: var(--ak-line-height);
|
|
19
|
-
text-decoration: none;
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
transition: filter var(--ak-transition), box-shadow var(--ak-transition);
|
|
3
|
+
// .ak-btn secondary (default): surface + control border
|
|
4
|
+
// .ak-btn--primary the one filled action per screen (near-black, or the theme's)
|
|
5
|
+
// .ak-btn--ghost tertiary: text only
|
|
6
|
+
// .ak-btn--danger destructive: negative colour, outlined
|
|
7
|
+
// .ak-btn--sm | --lg 28 / 32 / 40px; controls in one row share one height
|
|
8
|
+
// .ak-btn--block full width
|
|
9
|
+
// .ak-btn--icon square, icon only — needs aria-label
|
|
10
|
+
// [aria-busy="true"] loading: keeps its width, blocks clicks
|
|
11
|
+
//
|
|
12
|
+
// The mixins are shared with the compat layer (legacy .btn).
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
&:disabled,
|
|
26
|
-
&[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; filter: none; }
|
|
14
|
+
.ak-btn {
|
|
15
|
+
@include btn.base;
|
|
27
16
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
&--primary {
|
|
18
|
+
@include btn.variant(primary);
|
|
19
|
+
}
|
|
20
|
+
&--ghost {
|
|
21
|
+
@include btn.variant(ghost);
|
|
22
|
+
}
|
|
23
|
+
&--danger {
|
|
24
|
+
@include btn.variant(danger);
|
|
25
|
+
}
|
|
26
|
+
&--sm {
|
|
27
|
+
@include btn.size(sm);
|
|
28
|
+
}
|
|
29
|
+
&--lg {
|
|
30
|
+
@include btn.size(lg);
|
|
31
|
+
}
|
|
32
|
+
&--block {
|
|
33
|
+
@include btn.block;
|
|
34
|
+
}
|
|
35
|
+
&--icon {
|
|
36
|
+
width: var(--_h);
|
|
37
|
+
padding: 0;
|
|
33
38
|
}
|
|
34
|
-
|
|
35
|
-
&--sm { padding: 2px var(--ak-space-2); font-size: var(--ak-font-size-sm); }
|
|
36
|
-
&--lg { padding: var(--ak-space-2) var(--ak-space-4); font-size: var(--ak-font-size-lg); }
|
|
37
|
-
&--block { display: flex; width: 100%; }
|
|
38
39
|
}
|
|
@@ -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
|
+
}
|
package/src/scss/index.scss
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
5
7
|
@use 'components/alert';
|
|
@@ -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
|
+
}
|