@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.
@@ -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
+ }