@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.
Files changed (57) hide show
  1. package/README.md +58 -5
  2. package/dist/ace-compat.css +1 -1
  3. package/dist/ace-compat.js +189 -0
  4. package/dist/ace-compat.js.map +1 -0
  5. package/dist/ace-ui-kit.css +1 -1
  6. package/dist/ace-ui-kit.js +312 -8
  7. package/dist/ace-ui-kit.js.map +1 -1
  8. package/dist/compat.d.ts +14 -0
  9. package/dist/icons.svg +58 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/js/compat/ace.d.ts +2 -0
  12. package/dist/js/compat/bootstrap.d.ts +9 -0
  13. package/dist/js/dialog.d.ts +3 -0
  14. package/dist/js/file.d.ts +1 -0
  15. package/dist/js/icon.d.ts +13 -0
  16. package/dist/js/init.d.ts +4 -2
  17. package/dist/js/menu.d.ts +1 -0
  18. package/dist/js/sidebar.d.ts +1 -0
  19. package/dist/js/stepper.d.ts +2 -0
  20. package/dist/js/tabs.d.ts +3 -0
  21. package/dist/js/toast.d.ts +16 -0
  22. package/dist/js/tooltip.d.ts +1 -0
  23. package/package.json +20 -7
  24. package/src/icons/icons.json +311 -0
  25. package/src/scss/_breakpoints.scss +32 -0
  26. package/src/scss/_tokens.scss +175 -33
  27. package/src/scss/compat/_base.scss +144 -0
  28. package/src/scss/compat/_buttons.scss +100 -0
  29. package/src/scss/compat/_feedback.scss +187 -0
  30. package/src/scss/compat/_forms.scss +232 -0
  31. package/src/scss/compat/_grid.scss +107 -0
  32. package/src/scss/compat/_layout.scss +427 -0
  33. package/src/scss/compat/_navigation.scss +159 -0
  34. package/src/scss/compat/_plugins.scss +105 -0
  35. package/src/scss/compat/_tables.scss +105 -0
  36. package/src/scss/compat/_utilities.scss +160 -0
  37. package/src/scss/compat/_widgets.scss +126 -0
  38. package/src/scss/compat/index.scss +18 -10
  39. package/src/scss/components/_alert.scss +21 -22
  40. package/src/scss/components/_badge.scss +48 -0
  41. package/src/scss/components/_button.scss +34 -33
  42. package/src/scss/components/_card.scss +66 -0
  43. package/src/scss/components/_feedback.scss +219 -0
  44. package/src/scss/components/_form.scss +336 -0
  45. package/src/scss/components/_icon.scss +29 -0
  46. package/src/scss/components/_overlay.scss +174 -0
  47. package/src/scss/components/_shell.scss +326 -0
  48. package/src/scss/components/_table.scss +301 -0
  49. package/src/scss/components/_tabs.scss +56 -0
  50. package/src/scss/index.scss +10 -0
  51. package/src/scss/mixins/_alert.scss +65 -0
  52. package/src/scss/mixins/_badge.scss +59 -0
  53. package/src/scss/mixins/_button.scss +102 -0
  54. package/src/scss/mixins/_card.scss +40 -0
  55. package/src/scss/mixins/_form.scss +76 -0
  56. package/src/scss/mixins/_menu.scss +53 -0
  57. package/src/scss/mixins/_table.scss +23 -0
@@ -0,0 +1,105 @@
1
+ // Skins for the jQuery plugins legacy admins still load, so they sit with the kit's controls.
2
+ // Plugin CSS files stay loaded; these rules only align heights, borders and colours.
3
+
4
+ // ---- Select2 v4 (default theme)
5
+ .select2-container {
6
+ width: 100% !important;
7
+ font-size: var(--ak-font-size-md);
8
+ }
9
+ .select2-container--default {
10
+ .select2-selection--single,
11
+ .select2-selection--multiple {
12
+ min-height: var(--ak-control-height-lg);
13
+ border: 1px solid var(--ak-color-control);
14
+ border-radius: var(--ak-radius-control);
15
+ background: var(--ak-color-surface);
16
+ }
17
+ .select2-selection--single {
18
+ height: var(--ak-control-height-lg);
19
+
20
+ .select2-selection__rendered {
21
+ padding: 0 var(--ak-space-8) 0 var(--ak-space-3);
22
+ color: var(--ak-color-text);
23
+ line-height: calc(var(--ak-control-height-lg) - 2px);
24
+ }
25
+ .select2-selection__arrow {
26
+ height: calc(var(--ak-control-height-lg) - 2px);
27
+ right: var(--ak-space-2);
28
+ }
29
+ .select2-selection__placeholder {
30
+ color: var(--ak-color-faint);
31
+ }
32
+ }
33
+ .select2-selection--multiple {
34
+ padding: 3px var(--ak-space-1);
35
+
36
+ .select2-selection__choice {
37
+ margin: 3px;
38
+ padding: 2px var(--ak-space-2);
39
+ border: 1px solid var(--ak-color-border);
40
+ border-radius: var(--ak-radius-chip);
41
+ background: var(--ak-color-raised);
42
+ color: var(--ak-color-text);
43
+ }
44
+ }
45
+ &.select2-container--focus,
46
+ &.select2-container--open {
47
+ .select2-selection--single,
48
+ .select2-selection--multiple {
49
+ border-color: var(--ak-color-accent);
50
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--ak-color-accent) 22%, transparent);
51
+ }
52
+ }
53
+ .select2-results__option--highlighted[aria-selected] {
54
+ background: var(--ak-color-active);
55
+ color: var(--ak-color-text);
56
+ }
57
+ .select2-results__option[aria-selected='true'] {
58
+ background: var(--ak-color-raised);
59
+ font-weight: var(--ak-font-weight-medium);
60
+ }
61
+ .select2-search--dropdown .select2-search__field {
62
+ border: 1px solid var(--ak-color-control);
63
+ border-radius: var(--ak-radius-control);
64
+ }
65
+ }
66
+ .select2-dropdown {
67
+ overflow: hidden;
68
+ border: 1px solid var(--ak-color-border);
69
+ border-radius: var(--ak-radius-card);
70
+ background: var(--ak-color-surface);
71
+ box-shadow: var(--ak-shadow-float);
72
+ z-index: var(--ak-z-popover);
73
+ }
74
+
75
+ // ---- bootstrap-datepicker / vanillajs-datepicker: above modals, kit colours
76
+ .datepicker,
77
+ .datepicker-dropdown {
78
+ z-index: var(--ak-z-popover) !important;
79
+ border: 1px solid var(--ak-color-border);
80
+ border-radius: var(--ak-radius-card);
81
+ background: var(--ak-color-surface);
82
+ box-shadow: var(--ak-shadow-float);
83
+ font-variant-numeric: tabular-nums;
84
+
85
+ td.active,
86
+ td.active:hover,
87
+ .datepicker-cell.selected {
88
+ background: var(--ak-color-primary) !important;
89
+ color: var(--ak-color-on-primary) !important;
90
+ }
91
+ }
92
+
93
+ // ---- CodeMirror 5: framed like an input
94
+ .CodeMirror {
95
+ height: 240px; // fixed: the editor scrolls inside instead of stretching the page
96
+
97
+ border: 1px solid var(--ak-color-control);
98
+ border-radius: var(--ak-radius-control);
99
+ font-family: var(--ak-font-mono);
100
+ font-size: var(--ak-font-size-sm);
101
+ }
102
+ .CodeMirror-gutters {
103
+ border-right: 1px solid var(--ak-color-rule);
104
+ background: var(--ak-color-raised);
105
+ }
@@ -0,0 +1,105 @@
1
+ @use '../mixins/table';
2
+
3
+ // Tables: 12px grey sentence-case header with no band, rules between rows, no zebra
4
+ // (docs/PRINCIPLES.md §5). Legacy markup often uses <thead><td> instead of <th>.
5
+
6
+ .table-responsive {
7
+ width: 100%;
8
+ overflow-x: auto;
9
+ }
10
+
11
+ .table {
12
+ width: 100%;
13
+ max-width: 100%;
14
+ margin: 0;
15
+ background: var(--ak-color-surface);
16
+ font-size: var(--ak-font-size-md);
17
+
18
+ > thead > tr > th,
19
+ > thead > tr > td {
20
+ @include table.header-cell;
21
+ }
22
+
23
+ > tbody > tr > td,
24
+ > tbody > tr > th,
25
+ > tfoot > tr > td {
26
+ @include table.body-cell;
27
+ }
28
+ > tbody > tr:first-child > td,
29
+ > tbody > tr:first-child > th {
30
+ border-top: 0;
31
+ }
32
+
33
+ // the action column (last cell) stays on one line, right-aligned
34
+ > tbody > tr > td:last-child:has(.btn, form) {
35
+ width: 1%;
36
+ text-align: right;
37
+ white-space: nowrap;
38
+ }
39
+
40
+ // numbers line up digit for digit
41
+ td.right,
42
+ td.text-right,
43
+ th.text-right {
44
+ text-align: right;
45
+ font-variant-numeric: tabular-nums;
46
+ }
47
+
48
+ &.table-striped > tbody > tr:nth-child(odd) {
49
+ background: none; // no zebra
50
+ }
51
+ &.table-bordered {
52
+ border: 1px solid var(--ak-color-border);
53
+ }
54
+ &.table-hover > tbody > tr:hover {
55
+ background: var(--ak-color-raised);
56
+ }
57
+ &.table-condensed > tbody > tr > td {
58
+ height: 36px;
59
+ padding-top: var(--ak-space-1);
60
+ padding-bottom: var(--ak-space-1);
61
+ }
62
+ }
63
+
64
+ .pagination {
65
+ display: inline-flex;
66
+ gap: var(--ak-space-1);
67
+ margin: var(--ak-space-4) 0;
68
+ padding: 0;
69
+ list-style: none;
70
+
71
+ > li > a,
72
+ > li > span {
73
+ display: inline-flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ min-width: var(--ak-control-height);
77
+ height: var(--ak-control-height);
78
+ padding: 0 var(--ak-space-2);
79
+ border: 1px solid var(--ak-color-control);
80
+ border-radius: var(--ak-radius-control);
81
+ background: var(--ak-color-surface);
82
+ color: var(--ak-color-text);
83
+ font-variant-numeric: tabular-nums;
84
+ text-decoration: none;
85
+ }
86
+ > li > a:hover {
87
+ background: var(--ak-color-raised);
88
+ }
89
+ > .active > a,
90
+ > .active > span {
91
+ border-color: transparent;
92
+ background: var(--ak-color-active);
93
+ font-weight: var(--ak-font-weight-semibold);
94
+ }
95
+ > .disabled > a,
96
+ > .disabled > span {
97
+ color: var(--ak-color-faint);
98
+ pointer-events: none;
99
+ }
100
+ }
101
+
102
+ // row actions sit side by side with a small gap (a link next to a delete <form>, button groups…)
103
+ .table td > :is(.btn, .btn-group, form) + :is(.btn, .btn-group, form) {
104
+ margin-left: var(--ak-space-1);
105
+ }
@@ -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,126 @@
1
+ @use '../mixins/card';
2
+
3
+ // Ace widget-box → a flat card: 1px border, no shadow, a header row with title and toolbar.
4
+ // .widget-box > .widget-header(.header-color-*) > h4|h5 + .widget-toolbar
5
+ // > .widget-body > .widget-main(.no-padding)
6
+
7
+ .widget-box {
8
+ @include card.frame;
9
+ margin: 0 0 var(--ak-space-4);
10
+
11
+ &.no-border {
12
+ border: 0;
13
+ }
14
+ &.transparent {
15
+ border: 0;
16
+ background: none;
17
+ }
18
+ }
19
+
20
+ .widget-header {
21
+ @include card.header;
22
+ justify-content: space-between;
23
+ padding-right: var(--ak-space-4);
24
+ padding-left: var(--ak-space-4);
25
+ border-radius: var(--ak-radius-card) var(--ak-radius-card) 0 0;
26
+ background: none; // header-color-* carried Ace's blue bar: chrome stays neutral
27
+ color: var(--ak-color-text);
28
+
29
+ > h4,
30
+ > h5,
31
+ > .widget-title {
32
+ @include card.title;
33
+
34
+ > .fa,
35
+ > [class^='icon-'] {
36
+ color: var(--ak-color-muted);
37
+ font-size: 15px;
38
+ }
39
+ }
40
+ &.text-left {
41
+ justify-content: space-between;
42
+ }
43
+ }
44
+
45
+ .widget-toolbar {
46
+ display: flex;
47
+ flex-wrap: wrap;
48
+ align-items: center;
49
+ gap: var(--ak-space-2);
50
+ margin-left: auto;
51
+
52
+ > a:not(.btn) {
53
+ display: inline-grid;
54
+ place-items: center;
55
+ width: var(--ak-control-height-sm);
56
+ height: var(--ak-control-height-sm);
57
+ border-radius: var(--ak-radius-control);
58
+ color: var(--ak-color-muted);
59
+ cursor: pointer;
60
+
61
+ &:hover {
62
+ background: var(--ak-color-raised);
63
+ color: var(--ak-color-text);
64
+ text-decoration: none;
65
+ }
66
+ }
67
+ }
68
+
69
+ .widget-body {
70
+ border-radius: 0 0 var(--ak-radius-card) var(--ak-radius-card);
71
+ }
72
+ .widget-main {
73
+ @include card.body;
74
+
75
+ &.no-padding {
76
+ padding: 0;
77
+ }
78
+ &.padding-4 {
79
+ padding: var(--ak-space-1);
80
+ }
81
+ &.padding-8 {
82
+ padding: var(--ak-space-2);
83
+ }
84
+ }
85
+ // A full-width submit button right after the card body is the panel's Save: bottom right, auto width
86
+ .widget-box > .btn-block,
87
+ .widget-box > form > .btn-block,
88
+ .widget-body > .btn-block {
89
+ display: flex;
90
+ width: fit-content;
91
+ margin: 0 var(--ak-space-5) var(--ak-space-5) auto;
92
+ padding: 0 var(--ak-space-4);
93
+ }
94
+
95
+ // A primary button inside a form field (e.g. "Превью", "Выбрать файл") is a secondary action:
96
+ // the screen keeps one primary — Save.
97
+ .widget-main .form-group .btn-primary {
98
+ --_bg: var(--ak-color-surface);
99
+ --_bg-hover: var(--ak-color-raised);
100
+ --_fg: var(--ak-color-text);
101
+ --_border: var(--ak-color-control);
102
+ }
103
+ .widget-toolbox {
104
+ padding: var(--ak-space-3) var(--ak-space-4);
105
+ border-top: 1px solid var(--ak-color-border);
106
+ }
107
+
108
+ // A full-width button as the last row inside a list card ("Добавить" under a table) repeats the toolbar
109
+ // action — it becomes a quiet add row with a rule above it, not a second filled primary.
110
+ .widget-main.no-padding > .row:last-child > [class*='col-'] > .btn-block:only-child:not(.modal *) {
111
+ --_bg: transparent;
112
+ --_bg-hover: var(--ak-color-raised);
113
+ --_fg: var(--ak-color-link);
114
+ --_border: transparent;
115
+ --_h: 44px;
116
+ border-top: 1px solid var(--ak-color-border);
117
+ border-radius: 0 0 var(--ak-radius-card) var(--ak-radius-card);
118
+ font-size: var(--ak-font-size-md);
119
+ }
120
+ .widget-main.no-padding > .row:last-child:not(.modal *) {
121
+ margin: 0;
122
+
123
+ > [class*='col-']:has(> .btn-block:only-child) {
124
+ padding: 0;
125
+ }
126
+ }
@@ -1,11 +1,19 @@
1
- // Compatibility layer: restyles legacy Ace 1.x / Bootstrap 3 class names with kit tokens,
2
- // so an existing admin can drop ace.min.css (and later bootstrap.min.css) without
3
- // rewriting its templates at once. Filled component by component — see docs/ROADMAP.md.
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
- .widget-box {
7
- margin: var(--ak-space-3) 0;
8
- border: 1px solid var(--ak-color-border);
9
- border-radius: var(--ak-radius);
10
- background: var(--ak-color-surface);
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
- // .ak-alert [.ak-alert--success|info|warning|danger], close button: [data-ak-dismiss]
1
+ @use '../mixins/alert' as alert;
2
2
 
3
- .ak-alert {
4
- --_accent: var(--ak-color-info);
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
- position: relative;
7
- padding: var(--ak-space-3) var(--ak-space-4);
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
- @each $name in success, info, warning, danger {
15
- &--#{$name} { --_accent: var(--ak-color-#{$name}); }
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
- position: absolute;
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
  }
@@ -0,0 +1,48 @@
1
+ @use '../mixins/badge';
2
+
3
+ // .ak-badge — a status pill: pale tint + dark ink of the same hue, 20px, never squeezed.
4
+ // --positive | --negative | --warning | --info (default: neutral)
5
+ // --dot a 6px dot before an ink label — for statuses that repeat on many rows
6
+ // --code an identifier / shortcode in the mono face
7
+ // --count a number on a queue that needs action (round, tabular)
8
+ // One status mark per row (docs/PRINCIPLES.md §5).
9
+
10
+ .ak-badge {
11
+ @include badge.base;
12
+
13
+ &--positive {
14
+ @include badge.tone(positive);
15
+ }
16
+ &--negative {
17
+ @include badge.tone(negative);
18
+ }
19
+ &--warning {
20
+ @include badge.tone(warning);
21
+ }
22
+ &--info {
23
+ @include badge.tone(info);
24
+ }
25
+
26
+ &--dot {
27
+ padding: 0;
28
+ background: none;
29
+ color: var(--ak-color-text);
30
+ font-weight: var(--ak-font-weight-regular);
31
+
32
+ &::before {
33
+ width: 6px;
34
+ height: 6px;
35
+ border-radius: 50%;
36
+ background: var(--_dot);
37
+ content: '';
38
+ }
39
+ }
40
+
41
+ &--code {
42
+ @include badge.code;
43
+ }
44
+
45
+ &--count {
46
+ @include badge.count;
47
+ }
48
+ }
@@ -1,38 +1,39 @@
1
- // .ak-btn [.ak-btn--primary|success|info|warning|danger] [.ak-btn--sm|lg] [.ak-btn--block]
1
+ @use '../mixins/button' as btn;
2
2
 
3
- .ak-btn {
4
- --_bg: var(--ak-color-surface-muted);
5
- --_fg: var(--ak-color-text);
6
-
7
- display: inline-flex;
8
- align-items: center;
9
- justify-content: center;
10
- gap: var(--ak-space-1);
11
- padding: var(--ak-space-1) var(--ak-space-3);
12
- border: 1px solid transparent;
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
- &:hover { filter: brightness(0.95); }
24
- &:focus-visible { outline: none; box-shadow: var(--ak-focus-ring); }
25
- &:disabled,
26
- &[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; filter: none; }
14
+ .ak-btn {
15
+ @include btn.base;
27
16
 
28
- @each $name in primary, success, info, warning, danger {
29
- &--#{$name} {
30
- --_bg: var(--ak-color-#{$name});
31
- --_fg: var(--ak-color-on-accent);
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
  }