@apo100l/ace-ui-kit 0.1.0 → 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 (38) hide show
  1. package/README.md +10 -1
  2. package/dist/ace-compat.css +1 -1
  3. package/dist/ace-ui-kit.css +1 -1
  4. package/dist/ace-ui-kit.js +311 -20
  5. package/dist/ace-ui-kit.js.map +1 -1
  6. package/dist/icons.svg +2 -0
  7. package/dist/index.d.ts +5 -0
  8. package/dist/js/dialog.d.ts +3 -0
  9. package/dist/js/file.d.ts +1 -0
  10. package/dist/js/init.d.ts +4 -2
  11. package/dist/js/menu.d.ts +1 -0
  12. package/dist/js/sidebar.d.ts +1 -0
  13. package/dist/js/stepper.d.ts +2 -0
  14. package/dist/js/tabs.d.ts +3 -0
  15. package/dist/js/toast.d.ts +16 -0
  16. package/dist/js/tooltip.d.ts +1 -0
  17. package/package.json +1 -1
  18. package/src/icons/icons.json +306 -53
  19. package/src/scss/compat/_base.scss +24 -45
  20. package/src/scss/compat/_feedback.scss +11 -34
  21. package/src/scss/compat/_forms.scss +14 -35
  22. package/src/scss/compat/_navigation.scss +6 -28
  23. package/src/scss/compat/_tables.scss +4 -16
  24. package/src/scss/compat/_widgets.scss +8 -18
  25. package/src/scss/components/_badge.scss +48 -0
  26. package/src/scss/components/_card.scss +66 -0
  27. package/src/scss/components/_feedback.scss +219 -0
  28. package/src/scss/components/_form.scss +336 -0
  29. package/src/scss/components/_overlay.scss +174 -0
  30. package/src/scss/components/_shell.scss +326 -0
  31. package/src/scss/components/_table.scss +301 -0
  32. package/src/scss/components/_tabs.scss +56 -0
  33. package/src/scss/index.scss +8 -0
  34. package/src/scss/mixins/_badge.scss +59 -0
  35. package/src/scss/mixins/_card.scss +40 -0
  36. package/src/scss/mixins/_form.scss +76 -0
  37. package/src/scss/mixins/_menu.scss +53 -0
  38. package/src/scss/mixins/_table.scss +23 -0
@@ -1,3 +1,5 @@
1
+ @use '../mixins/menu';
2
+
1
3
  // Dropdowns, tabs and breadcrumbs. Open state is the Bootstrap 3 contract: `.open` on the parent
2
4
  // (toggled by the compat JS — no bootstrap.js needed).
3
5
 
@@ -8,20 +10,13 @@
8
10
  }
9
11
 
10
12
  .dropdown-menu {
13
+ @include menu.panel;
11
14
  position: absolute;
12
15
  top: 100%;
13
16
  left: 0;
14
17
  z-index: var(--ak-z-dropdown);
15
18
  display: none;
16
- min-width: 180px;
17
19
  margin: var(--ak-space-1) 0 0;
18
- padding: var(--ak-space-1);
19
- border: 1px solid var(--ak-color-border);
20
- border-radius: var(--ak-radius-card);
21
- background: var(--ak-color-surface);
22
- box-shadow: var(--ak-shadow-float);
23
- list-style: none;
24
- text-align: left;
25
20
  transform-origin: top left;
26
21
 
27
22
  .open > & {
@@ -37,22 +32,8 @@
37
32
  }
38
33
 
39
34
  > li > a {
40
- display: flex;
41
- align-items: center;
42
- gap: var(--ak-space-2);
43
- min-height: var(--ak-control-height);
44
- padding: 0 var(--ak-space-3);
45
- border-radius: var(--ak-radius-control);
46
- color: var(--ak-color-text);
47
- font-size: var(--ak-font-size-md);
48
- white-space: nowrap;
49
- text-decoration: none;
35
+ @include menu.item;
50
36
 
51
- &:hover,
52
- &:focus-visible {
53
- background: var(--ak-color-raised);
54
- outline: none;
55
- }
56
37
  .fa {
57
38
  width: 16px;
58
39
  color: var(--ak-color-muted);
@@ -60,17 +41,14 @@
60
41
  }
61
42
  }
62
43
  > .active > a {
63
- background: var(--ak-color-active);
64
- font-weight: var(--ak-font-weight-medium);
44
+ @include menu.item-current;
65
45
  }
66
46
  > .disabled > a {
67
47
  color: var(--ak-color-faint);
68
48
  pointer-events: none;
69
49
  }
70
50
  .divider {
71
- height: 1px;
72
- margin: var(--ak-space-1) calc(-1 * var(--ak-space-1));
73
- background: var(--ak-color-border);
51
+ @include menu.divider;
74
52
  }
75
53
  .dropdown-header {
76
54
  padding: var(--ak-space-2) var(--ak-space-3) var(--ak-space-1);
@@ -1,3 +1,5 @@
1
+ @use '../mixins/table';
2
+
1
3
  // Tables: 12px grey sentence-case header with no band, rules between rows, no zebra
2
4
  // (docs/PRINCIPLES.md §5). Legacy markup often uses <thead><td> instead of <th>.
3
5
 
@@ -15,27 +17,13 @@
15
17
 
16
18
  > thead > tr > th,
17
19
  > 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;
20
+ @include table.header-cell;
30
21
  }
31
22
 
32
23
  > tbody > tr > td,
33
24
  > tbody > tr > th,
34
25
  > 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;
26
+ @include table.body-cell;
39
27
  }
40
28
  > tbody > tr:first-child > td,
41
29
  > tbody > tr:first-child > th {
@@ -1,12 +1,12 @@
1
+ @use '../mixins/card';
2
+
1
3
  // Ace widget-box → a flat card: 1px border, no shadow, a header row with title and toolbar.
2
4
  // .widget-box > .widget-header(.header-color-*) > h4|h5 + .widget-toolbar
3
5
  // > .widget-body > .widget-main(.no-padding)
4
6
 
5
7
  .widget-box {
8
+ @include card.frame;
6
9
  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
10
 
11
11
  &.no-border {
12
12
  border: 0;
@@ -18,14 +18,10 @@
18
18
  }
19
19
 
20
20
  .widget-header {
21
- display: flex;
22
- flex-wrap: wrap;
23
- align-items: center;
21
+ @include card.header;
24
22
  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);
23
+ padding-right: var(--ak-space-4);
24
+ padding-left: var(--ak-space-4);
29
25
  border-radius: var(--ak-radius-card) var(--ak-radius-card) 0 0;
30
26
  background: none; // header-color-* carried Ace's blue bar: chrome stays neutral
31
27
  color: var(--ak-color-text);
@@ -33,13 +29,7 @@
33
29
  > h4,
34
30
  > h5,
35
31
  > .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);
32
+ @include card.title;
43
33
 
44
34
  > .fa,
45
35
  > [class^='icon-'] {
@@ -80,7 +70,7 @@
80
70
  border-radius: 0 0 var(--ak-radius-card) var(--ak-radius-card);
81
71
  }
82
72
  .widget-main {
83
- padding: var(--ak-space-5);
73
+ @include card.body;
84
74
 
85
75
  &.no-padding {
86
76
  padding: 0;
@@ -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
+ }
@@ -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
+ }