@auronui/styles 1.0.17 → 1.0.19
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/components/button.css +97 -82
- package/components/modal.css +18 -6
- package/package.json +1 -1
- package/src/components/button/button.styles.ts +24 -11
package/components/button.css
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
/* Default tokens (fallback behavior) */
|
|
21
21
|
--button-bg: transparent;
|
|
22
22
|
--button-bg-hover: var(--button-bg);
|
|
23
|
-
|
|
23
|
+
/* Pressed is slightly darker than hover for tactile contrast */
|
|
24
|
+
--button-bg-pressed: color-mix(in oklab, var(--button-bg-hover) 82%, black);
|
|
24
25
|
--button-fg: currentColor;
|
|
25
26
|
|
|
26
27
|
background-color: var(--button-bg);
|
|
@@ -43,11 +44,12 @@
|
|
|
43
44
|
@apply status-pending;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
/* Active / pressed */
|
|
47
|
+
/* Active / pressed — snap down fast (60ms), spring back slow (300ms from base) */
|
|
47
48
|
&:active,
|
|
48
49
|
&[data-pressed="true"] {
|
|
49
50
|
background-color: var(--button-bg-pressed);
|
|
50
|
-
transform: scale(0.
|
|
51
|
+
transform: scale(0.95);
|
|
52
|
+
transition-duration: 60ms;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
/* Selected / toggle-on state */
|
|
@@ -78,11 +80,6 @@
|
|
|
78
80
|
& svg:not([data-slot="spinner"] svg, [data-slot="link-icon"] svg) {
|
|
79
81
|
@apply size-3.5;
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
&:active,
|
|
83
|
-
&[data-pressed="true"] {
|
|
84
|
-
transform: scale(0.98);
|
|
85
|
-
}
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
.button--sm {
|
|
@@ -91,11 +88,6 @@
|
|
|
91
88
|
& svg:not([data-slot="spinner"] svg, [data-slot="link-icon"] svg) {
|
|
92
89
|
@apply size-3.5;
|
|
93
90
|
}
|
|
94
|
-
|
|
95
|
-
&:active,
|
|
96
|
-
&[data-pressed="true"] {
|
|
97
|
-
transform: scale(0.98);
|
|
98
|
-
}
|
|
99
91
|
}
|
|
100
92
|
|
|
101
93
|
.button--md {
|
|
@@ -113,58 +105,115 @@
|
|
|
113
105
|
@apply size-5;
|
|
114
106
|
}
|
|
115
107
|
|
|
116
|
-
&:active,
|
|
117
|
-
&[data-pressed="true"] {
|
|
118
|
-
transform: scale(0.96);
|
|
119
|
-
}
|
|
120
108
|
}
|
|
121
109
|
|
|
122
|
-
/*
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
--button-bg-hover: var(--color-accent-hover);
|
|
126
|
-
--button-bg-pressed: var(--color-accent-hover);
|
|
127
|
-
--button-fg: var(--color-accent-foreground);
|
|
128
|
-
}
|
|
110
|
+
/* ============================================================
|
|
111
|
+
Variant classes — visual behavior (structural)
|
|
112
|
+
============================================================ */
|
|
129
113
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
--button-bg
|
|
133
|
-
--button-bg-
|
|
134
|
-
--button-fg: var(--color-
|
|
114
|
+
/* solid: filled background from color palette */
|
|
115
|
+
.button--solid {
|
|
116
|
+
--button-bg: var(--btn-solid-bg, var(--color-default));
|
|
117
|
+
--button-bg-hover: var(--btn-solid-bg-hover, var(--color-default-hover));
|
|
118
|
+
--button-fg: var(--btn-solid-fg, var(--color-default-foreground));
|
|
135
119
|
}
|
|
136
120
|
|
|
137
|
-
|
|
121
|
+
/* default (tertiary): neutral bg, text tinted by color */
|
|
122
|
+
.button--default {
|
|
138
123
|
--button-bg: var(--color-default);
|
|
139
124
|
--button-bg-hover: var(--color-default-hover);
|
|
140
|
-
--button-bg-pressed: var(--color-default-hover);
|
|
125
|
+
--button-bg-pressed: color-mix(in oklab, var(--color-default-hover) 72%, black);
|
|
126
|
+
--button-fg: var(--btn-tint-fg, var(--color-default-foreground));
|
|
141
127
|
}
|
|
142
128
|
|
|
143
|
-
|
|
144
|
-
.button--
|
|
129
|
+
/* ghost: transparent bg — hover is a light tint, pressed steps up to the stronger tint */
|
|
130
|
+
.button--ghost {
|
|
145
131
|
--button-bg: transparent;
|
|
146
|
-
--button-bg-hover: var(--color-default);
|
|
147
|
-
--button-bg-pressed: var(--color-default);
|
|
148
|
-
--button-fg: var(--color-default-foreground);
|
|
132
|
+
--button-bg-hover: var(--btn-tint-bg, var(--color-default));
|
|
133
|
+
--button-bg-pressed: var(--btn-tint-bg-hover, var(--color-default-hover));
|
|
134
|
+
--button-fg: var(--btn-tint-fg, var(--color-default-foreground));
|
|
149
135
|
}
|
|
150
136
|
|
|
137
|
+
/* outline: same press logic as ghost */
|
|
151
138
|
.button--outline {
|
|
152
|
-
|
|
153
|
-
--button-bg-hover:
|
|
139
|
+
--button-bg: transparent;
|
|
140
|
+
--button-bg-hover: var(--btn-tint-bg, var(--color-default));
|
|
141
|
+
--button-bg-pressed: var(--btn-tint-bg-hover, var(--color-default-hover));
|
|
142
|
+
--button-fg: var(--btn-tint-fg, var(--color-default-foreground));
|
|
143
|
+
@apply border;
|
|
144
|
+
border-color: currentColor;
|
|
154
145
|
}
|
|
155
146
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
--button-bg
|
|
159
|
-
--button-bg-
|
|
160
|
-
--button-
|
|
147
|
+
/* soft: muted palette — darken more aggressively than solid */
|
|
148
|
+
.button--soft {
|
|
149
|
+
--button-bg: var(--btn-soft-bg, var(--color-default));
|
|
150
|
+
--button-bg-hover: var(--btn-soft-bg-hover, var(--color-default-hover));
|
|
151
|
+
--button-bg-pressed: color-mix(in oklab, var(--btn-soft-bg-hover, var(--color-default-hover)) 72%, black);
|
|
152
|
+
--button-fg: var(--btn-soft-fg, var(--color-default-foreground));
|
|
161
153
|
}
|
|
162
154
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
155
|
+
/* ============================================================
|
|
156
|
+
Color classes — palette values consumed by variant classes
|
|
157
|
+
============================================================ */
|
|
158
|
+
|
|
159
|
+
.button--color-default {
|
|
160
|
+
--btn-solid-bg: var(--color-default);
|
|
161
|
+
--btn-solid-bg-hover: var(--color-default-hover);
|
|
162
|
+
--btn-solid-fg: var(--color-default-foreground);
|
|
163
|
+
--btn-soft-bg: var(--color-default);
|
|
164
|
+
--btn-soft-bg-hover: var(--color-default-hover);
|
|
165
|
+
--btn-soft-fg: var(--color-default-foreground);
|
|
166
|
+
--btn-tint-bg: var(--color-default);
|
|
167
|
+
--btn-tint-bg-hover: var(--color-default-hover);
|
|
168
|
+
--btn-tint-fg: var(--color-default-foreground);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.button--color-primary {
|
|
172
|
+
--btn-solid-bg: var(--color-accent);
|
|
173
|
+
--btn-solid-bg-hover: var(--color-accent-hover);
|
|
174
|
+
--btn-solid-fg: var(--color-accent-foreground);
|
|
175
|
+
--btn-soft-bg: var(--color-accent-soft);
|
|
176
|
+
--btn-soft-bg-hover: var(--color-accent-soft-hover);
|
|
177
|
+
--btn-soft-fg: var(--color-accent-soft-foreground);
|
|
178
|
+
--btn-tint-bg: color-mix(in oklab, var(--color-accent) 12%, transparent);
|
|
179
|
+
--btn-tint-bg-hover: color-mix(in oklab, var(--color-accent) 18%, transparent);
|
|
180
|
+
--btn-tint-fg: var(--color-accent);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.button--color-success {
|
|
184
|
+
--btn-solid-bg: var(--color-success);
|
|
185
|
+
--btn-solid-bg-hover: var(--color-success-hover);
|
|
186
|
+
--btn-solid-fg: var(--color-success-foreground);
|
|
187
|
+
--btn-soft-bg: var(--color-success-soft);
|
|
188
|
+
--btn-soft-bg-hover: var(--color-success-soft-hover);
|
|
189
|
+
--btn-soft-fg: var(--color-success-soft-foreground);
|
|
190
|
+
--btn-tint-bg: color-mix(in oklab, var(--color-success) 12%, transparent);
|
|
191
|
+
--btn-tint-bg-hover: color-mix(in oklab, var(--color-success) 18%, transparent);
|
|
192
|
+
--btn-tint-fg: var(--color-success);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.button--color-warning {
|
|
196
|
+
--btn-solid-bg: var(--color-warning);
|
|
197
|
+
--btn-solid-bg-hover: var(--color-warning-hover);
|
|
198
|
+
--btn-solid-fg: var(--color-warning-foreground);
|
|
199
|
+
--btn-soft-bg: var(--color-warning-soft);
|
|
200
|
+
--btn-soft-bg-hover: var(--color-warning-soft-hover);
|
|
201
|
+
--btn-soft-fg: var(--color-warning-soft-foreground);
|
|
202
|
+
--btn-tint-bg: color-mix(in oklab, var(--color-warning) 12%, transparent);
|
|
203
|
+
--btn-tint-bg-hover: color-mix(in oklab, var(--color-warning) 18%, transparent);
|
|
204
|
+
--btn-tint-fg: var(--color-warning);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.button--color-danger {
|
|
208
|
+
--btn-solid-bg: var(--color-danger);
|
|
209
|
+
--btn-solid-bg-hover: var(--color-danger-hover);
|
|
210
|
+
--btn-solid-fg: var(--color-danger-foreground);
|
|
211
|
+
--btn-soft-bg: var(--color-danger-soft);
|
|
212
|
+
--btn-soft-bg-hover: var(--color-danger-soft-hover);
|
|
213
|
+
--btn-soft-fg: var(--color-danger-soft-foreground);
|
|
214
|
+
--btn-tint-bg: color-mix(in oklab, var(--color-danger) 12%, transparent);
|
|
215
|
+
--btn-tint-bg-hover: color-mix(in oklab, var(--color-danger) 18%, transparent);
|
|
216
|
+
--btn-tint-fg: var(--color-danger);
|
|
168
217
|
}
|
|
169
218
|
|
|
170
219
|
/* Radius modifiers - compound selector wins over base/size rounding */
|
|
@@ -214,40 +263,6 @@
|
|
|
214
263
|
@apply w-full;
|
|
215
264
|
}
|
|
216
265
|
|
|
217
|
-
/* ============================================================
|
|
218
|
-
Button — Phase 2 extensions (02-01-STYLES)
|
|
219
|
-
============================================================ */
|
|
220
|
-
|
|
221
|
-
/* --- New color variants --- */
|
|
222
|
-
|
|
223
|
-
.button--success {
|
|
224
|
-
--button-bg: var(--color-success);
|
|
225
|
-
--button-bg-hover: var(--color-success-hover);
|
|
226
|
-
--button-bg-pressed: var(--color-success-hover);
|
|
227
|
-
--button-fg: var(--color-success-foreground);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.button--success-soft {
|
|
231
|
-
--button-bg: var(--color-success-soft);
|
|
232
|
-
--button-bg-hover: var(--color-success-soft-hover);
|
|
233
|
-
--button-bg-pressed: var(--color-success-soft-hover);
|
|
234
|
-
--button-fg: var(--color-success-soft-foreground);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.button--warning {
|
|
238
|
-
--button-bg: var(--color-warning);
|
|
239
|
-
--button-bg-hover: var(--color-warning-hover);
|
|
240
|
-
--button-bg-pressed: var(--color-warning-hover);
|
|
241
|
-
--button-fg: var(--color-warning-foreground);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.button--warning-soft {
|
|
245
|
-
--button-bg: var(--color-warning-soft);
|
|
246
|
-
--button-bg-hover: var(--color-warning-soft-hover);
|
|
247
|
-
--button-bg-pressed: var(--color-warning-soft-hover);
|
|
248
|
-
--button-fg: var(--color-warning-soft-foreground);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
266
|
/* --- Loading state --- */
|
|
252
267
|
|
|
253
268
|
/* Root button in loading state: pointer-events off, cursor change */
|
package/components/modal.css
CHANGED
|
@@ -38,12 +38,28 @@
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Element: portal - stacking context wrapper for each modal instance.
|
|
43
|
+
* Wrapping backdrop + container in a single fixed element means each modal
|
|
44
|
+
* occupies its own stacking context. Later-opened modals render after this
|
|
45
|
+
* element in the DOM, so at equal z-index their entire portal (backdrop
|
|
46
|
+
* included) paints on top of the previous one, fixing the issue where the
|
|
47
|
+
* second modal's backdrop would appear behind the first modal's content.
|
|
48
|
+
*/
|
|
49
|
+
.modal__portal {
|
|
50
|
+
position: fixed;
|
|
51
|
+
inset: 0;
|
|
52
|
+
z-index: var(--z-modal);
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
41
56
|
/**
|
|
42
57
|
* Element: backdrop - the overlay behind the dialog
|
|
43
58
|
*/
|
|
44
59
|
.modal__backdrop {
|
|
45
60
|
@apply fixed inset-0;
|
|
46
61
|
z-index: var(--z-modal-backdrop);
|
|
62
|
+
pointer-events: auto;
|
|
47
63
|
@apply flex flex-row items-center justify-center;
|
|
48
64
|
@apply h-(--visual-viewport-height) w-full;
|
|
49
65
|
|
|
@@ -173,7 +189,6 @@
|
|
|
173
189
|
@apply relative;
|
|
174
190
|
@apply flex w-full flex-col;
|
|
175
191
|
@apply rounded-3xl bg-overlay shadow-overlay outline-none;
|
|
176
|
-
@apply p-6;
|
|
177
192
|
@apply pointer-events-auto;
|
|
178
193
|
|
|
179
194
|
&[data-placement="auto"] {
|
|
@@ -256,8 +271,7 @@
|
|
|
256
271
|
* Element: header - the top section with the title
|
|
257
272
|
*/
|
|
258
273
|
.modal__header {
|
|
259
|
-
@apply flex flex-col gap-3;
|
|
260
|
-
@apply mb-0;
|
|
274
|
+
@apply flex flex-col gap-3 mb-0 p-5;
|
|
261
275
|
|
|
262
276
|
/* When header contains icon, use flex-col layout with gap */
|
|
263
277
|
& > .modal__icon {
|
|
@@ -286,9 +300,7 @@
|
|
|
286
300
|
* Element: body - the main content area
|
|
287
301
|
*/
|
|
288
302
|
.modal__body {
|
|
289
|
-
@apply min-h-0 flex-1;
|
|
290
|
-
@apply text-sm leading-[1.43] text-muted;
|
|
291
|
-
@apply my-0;
|
|
303
|
+
@apply min-h-0 flex-1 text-sm leading-[1.43] text-muted my-0 p-5 pt-0;
|
|
292
304
|
}
|
|
293
305
|
|
|
294
306
|
/**
|
package/package.json
CHANGED
|
@@ -14,7 +14,8 @@ export const buttonVariants = tv({
|
|
|
14
14
|
isIconOnly: false,
|
|
15
15
|
isLoading: false,
|
|
16
16
|
size: "md",
|
|
17
|
-
variant: "
|
|
17
|
+
variant: "solid",
|
|
18
|
+
color: "primary",
|
|
18
19
|
},
|
|
19
20
|
variants: {
|
|
20
21
|
fullWidth: {
|
|
@@ -47,17 +48,29 @@ export const buttonVariants = tv({
|
|
|
47
48
|
xs: { base: "button--xs" },
|
|
48
49
|
},
|
|
49
50
|
variant: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// Current API
|
|
52
|
+
solid: { base: "button--solid" },
|
|
53
|
+
default: { base: "button--default" },
|
|
53
54
|
outline: { base: "button--outline" },
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
ghost: { base: "button--ghost" },
|
|
56
|
+
soft: { base: "button--soft" },
|
|
57
|
+
// Legacy aliases — resolved to new variant+color in Button.vue
|
|
58
|
+
primary: { base: "button--solid" },
|
|
59
|
+
secondary: { base: "button--default" },
|
|
60
|
+
tertiary: { base: "button--default" },
|
|
61
|
+
danger: { base: "button--solid" },
|
|
62
|
+
"danger-soft": { base: "button--soft" },
|
|
63
|
+
success: { base: "button--solid" },
|
|
64
|
+
"success-soft": { base: "button--soft" },
|
|
65
|
+
warning: { base: "button--solid" },
|
|
66
|
+
"warning-soft": { base: "button--soft" },
|
|
67
|
+
},
|
|
68
|
+
color: {
|
|
69
|
+
default: { base: "button--color-default" },
|
|
70
|
+
primary: { base: "button--color-primary" },
|
|
71
|
+
success: { base: "button--color-success" },
|
|
72
|
+
warning: { base: "button--color-warning" },
|
|
73
|
+
danger: { base: "button--color-danger" },
|
|
61
74
|
},
|
|
62
75
|
},
|
|
63
76
|
});
|