@eduardoalvarez/arrecife 0.5.1 → 0.6.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/CHANGELOG.md +45 -0
- package/README.md +706 -470
- package/dist/brand/index.cjs +112 -95
- package/dist/brand/index.d.cts +40 -39
- package/dist/brand/index.d.ts +40 -39
- package/dist/brand/index.js +5 -4
- package/dist/catalog-D13txprv.d.cts +78 -0
- package/dist/catalog-D13txprv.d.ts +78 -0
- package/dist/chart/index.cjs +100 -83
- package/dist/chart/index.d.cts +66 -66
- package/dist/chart/index.d.ts +66 -66
- package/dist/chart/index.js +14 -12
- package/dist/chunk-25YNFCIF.js +141 -0
- package/dist/{chunk-YZ2SDOVZ.js → chunk-6O3KWB6P.js} +30 -30
- package/dist/chunk-CKRSQPTX.js +36 -0
- package/dist/{chunk-ZEOQKRQ7.js → chunk-DKCN7BAL.js} +1 -1
- package/dist/chunk-GCRII2KQ.js +86 -0
- package/dist/chunk-JMOOFZ3B.js +42 -0
- package/dist/chunk-O4TAH7YJ.js +276 -0
- package/dist/chunk-ODBFN44D.js +45 -0
- package/dist/{chunk-VPT32GPG.js → chunk-PMN7NR3G.js} +2 -2
- package/dist/chunk-XKYHTOUJ.js +27 -0
- package/dist/form/index.cjs +109 -92
- package/dist/form/index.d.cts +43 -42
- package/dist/form/index.d.ts +43 -42
- package/dist/form/index.js +25 -23
- package/dist/index.cjs +1047 -914
- package/dist/index.d.cts +769 -777
- package/dist/index.d.ts +769 -777
- package/dist/index.js +608 -660
- package/dist/{label-DuTvJGxD.d.ts → label-MgHFKnFy.d.cts} +3 -3
- package/dist/{label-DuTvJGxD.d.cts → label-MgHFKnFy.d.ts} +3 -3
- package/dist/og/index.cjs +130 -130
- package/dist/og/index.d.cts +93 -89
- package/dist/og/index.d.ts +93 -89
- package/dist/og/index.js +106 -106
- package/dist/shiki/index.cjs +28 -30
- package/dist/shiki/index.d.cts +4 -4
- package/dist/shiki/index.d.ts +4 -4
- package/dist/shiki/index.js +12 -12
- package/dist/theme/index.cjs +97 -0
- package/dist/theme/index.d.cts +144 -0
- package/dist/theme/index.d.ts +144 -0
- package/dist/theme/index.js +2 -0
- package/dist/tokens/index.cjs +133 -86
- package/dist/tokens/index.d.cts +246 -161
- package/dist/tokens/index.d.ts +246 -161
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/theme.css +133 -98
- package/dist/variants/index.cjs +192 -0
- package/dist/variants/index.d.cts +192 -0
- package/dist/variants/index.d.ts +192 -0
- package/dist/variants/index.js +3 -0
- package/llms.txt +810 -744
- package/package.json +20 -11
- package/dist/catalogo-Du5ID-Hi.d.cts +0 -77
- package/dist/catalogo-Du5ID-Hi.d.ts +0 -77
- package/dist/chunk-E3OMP2DL.js +0 -36
- package/dist/chunk-KPZNNMV5.js +0 -83
- package/dist/chunk-NHS7ETKJ.js +0 -27
- package/dist/chunk-TSPJOM6K.js +0 -229
- package/dist/chunk-UOWIDFCB.js +0 -81
- package/dist/tema/index.cjs +0 -94
- package/dist/tema/index.d.cts +0 -110
- package/dist/tema/index.d.ts +0 -110
- package/dist/tema/index.js +0 -2
package/dist/tokens/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { tokens } from '../chunk-
|
|
2
|
-
export { brand, colors, control, dark, fonts, gradient, light, limits, motion, naming, radius, series, shadow,
|
|
1
|
+
export { tokens } from '../chunk-PMN7NR3G.js';
|
|
2
|
+
export { brand, colors, control, dark, fonts, gradient, light, limits, motion, naming, radius, series, shadow, size, spacing, syntax, tagline, typeScale } from '../chunk-O4TAH7YJ.js';
|
|
3
3
|
import '../chunk-MLKGABMK.js';
|
package/dist/tokens/theme.css
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* GENERATED by scripts/build-tokens.mjs from src/tokens/tokens.ts.
|
|
3
|
+
* Do not edit by hand: it is regenerated on every build.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Usage in a Tailwind v4 project:
|
|
6
6
|
* @import "tailwindcss";
|
|
7
7
|
* @import "@eduardoalvarez/arrecife/tokens/theme.css";
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Dark is the primary mode and the default. A project in light mode
|
|
10
|
+
* declares data-theme="light" on <html>.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Font families are declared by name: the project loads Bricolage
|
|
13
|
+
* Grotesque, Geist and JetBrains Mono however it prefers.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
/*
|
|
17
|
-
|
|
16
|
+
/* The mode is chosen with data-theme. Dark is primary, so it is the default:
|
|
17
|
+
a light project declares data-theme="light" on <html>. */
|
|
18
18
|
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
|
|
19
19
|
@custom-variant light (&:where([data-theme="light"], [data-theme="light"] *));
|
|
20
20
|
|
|
21
21
|
@theme {
|
|
22
|
-
/* --- color ·
|
|
22
|
+
/* --- color · dark mode (default) ------------------------------------- */
|
|
23
23
|
--color-background: #091319;
|
|
24
24
|
--color-surface: #10202B;
|
|
25
25
|
--color-surface-raised: #17303E;
|
|
@@ -38,19 +38,22 @@
|
|
|
38
38
|
--color-success: #4FB477;
|
|
39
39
|
--color-warning: #E8A33D;
|
|
40
40
|
--color-error: #E15757;
|
|
41
|
+
--color-danger: #F4736B;
|
|
42
|
+
--color-danger-hover: #F78D86;
|
|
43
|
+
--color-danger-on: #2B0A08;
|
|
41
44
|
|
|
42
|
-
/* ---
|
|
45
|
+
/* --- brand · identical in both modes ----------------------------------- */
|
|
43
46
|
--color-brand-body: #3E7CB1;
|
|
44
47
|
--color-brand-spots: #C2D7E7;
|
|
45
48
|
--color-brand-hull: #0B1524;
|
|
46
49
|
|
|
47
|
-
/* --- series
|
|
48
|
-
--color-
|
|
49
|
-
--color-
|
|
50
|
-
--color-
|
|
51
|
-
--color-
|
|
50
|
+
/* --- chart series · dark mode (default) -------------------------------- */
|
|
51
|
+
--color-series-1: #35D6C0;
|
|
52
|
+
--color-series-2: #F2A65A;
|
|
53
|
+
--color-series-3: #3E7CB1;
|
|
54
|
+
--color-series-4: #71919C;
|
|
52
55
|
|
|
53
|
-
/* ---
|
|
56
|
+
/* --- typography --------------------------------------------------------- */
|
|
54
57
|
--font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
|
|
55
58
|
--font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
|
|
56
59
|
--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
@@ -99,7 +102,7 @@
|
|
|
99
102
|
--text-eyebrow: 12px;
|
|
100
103
|
--text-eyebrow--letter-spacing: 0.12em;
|
|
101
104
|
|
|
102
|
-
/* ---
|
|
105
|
+
/* --- shape and rhythm --------------------------------------------------- */
|
|
103
106
|
--radius-chip: 6px;
|
|
104
107
|
--radius-control: 10px;
|
|
105
108
|
--radius-card: 14px;
|
|
@@ -117,6 +120,7 @@
|
|
|
117
120
|
--spacing-control-md: 22px;
|
|
118
121
|
--spacing-control-lg: 30px;
|
|
119
122
|
--spacing-control-icon: 42px;
|
|
123
|
+
--spacing-control-icon-sm: 32px;
|
|
120
124
|
|
|
121
125
|
--spacing-nav: 64px;
|
|
122
126
|
--container-content: 760px;
|
|
@@ -128,17 +132,17 @@
|
|
|
128
132
|
--duration-standard: 150ms;
|
|
129
133
|
--ease-standard: ease-out;
|
|
130
134
|
|
|
131
|
-
/* ---
|
|
135
|
+
/* --- gradients · dark mode (default) ----------------------------------- */
|
|
132
136
|
--gradient-hero: linear-gradient(160deg, #091319 60%, #0D2129 100%);
|
|
133
|
-
--gradient-
|
|
137
|
+
--gradient-section: linear-gradient(150deg, #10202B 0%, #0D2129 100%);
|
|
134
138
|
--gradient-og: linear-gradient(145deg, #091319 55%, #0D2129 100%);
|
|
135
139
|
}
|
|
136
140
|
|
|
137
|
-
/* --- color
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
/* --- color per mode, nestable ----------------------------------------------
|
|
142
|
+
Both modes are emitted as their own blocks, not just light. That way a subtree
|
|
143
|
+
can declare the opposite mode to the page and everything inside honours it:
|
|
144
|
+
which is what a code block needs, since it sits on hull in both themes and
|
|
145
|
+
therefore always carries light ink on top. */
|
|
142
146
|
[data-theme='dark'] {
|
|
143
147
|
--color-background: #091319;
|
|
144
148
|
--color-surface: #10202B;
|
|
@@ -158,14 +162,17 @@
|
|
|
158
162
|
--color-success: #4FB477;
|
|
159
163
|
--color-warning: #E8A33D;
|
|
160
164
|
--color-error: #E15757;
|
|
165
|
+
--color-danger: #F4736B;
|
|
166
|
+
--color-danger-hover: #F78D86;
|
|
167
|
+
--color-danger-on: #2B0A08;
|
|
161
168
|
|
|
162
|
-
--color-
|
|
163
|
-
--color-
|
|
164
|
-
--color-
|
|
165
|
-
--color-
|
|
169
|
+
--color-series-1: #35D6C0;
|
|
170
|
+
--color-series-2: #F2A65A;
|
|
171
|
+
--color-series-3: #3E7CB1;
|
|
172
|
+
--color-series-4: #71919C;
|
|
166
173
|
|
|
167
174
|
--gradient-hero: linear-gradient(160deg, #091319 60%, #0D2129 100%);
|
|
168
|
-
--gradient-
|
|
175
|
+
--gradient-section: linear-gradient(150deg, #10202B 0%, #0D2129 100%);
|
|
169
176
|
--gradient-og: linear-gradient(145deg, #091319 55%, #0D2129 100%);
|
|
170
177
|
}
|
|
171
178
|
|
|
@@ -188,34 +195,39 @@
|
|
|
188
195
|
--color-success: #0F6B52;
|
|
189
196
|
--color-warning: #8D6111;
|
|
190
197
|
--color-error: #C0392B;
|
|
198
|
+
--color-danger: #C0392B;
|
|
199
|
+
--color-danger-hover: #A32F22;
|
|
200
|
+
--color-danger-on: #FFF6F4;
|
|
191
201
|
|
|
192
|
-
--color-
|
|
193
|
-
--color-
|
|
194
|
-
--color-
|
|
195
|
-
--color-
|
|
202
|
+
--color-series-1: #0D7C6F;
|
|
203
|
+
--color-series-2: #A65B27;
|
|
204
|
+
--color-series-3: #3E7CB1;
|
|
205
|
+
--color-series-4: #626A75;
|
|
196
206
|
|
|
197
207
|
--gradient-hero: linear-gradient(160deg, #F6F2EA 60%, #EFE9DE 100%);
|
|
198
|
-
--gradient-
|
|
208
|
+
--gradient-section: linear-gradient(150deg, #FFFFFF 0%, #EFE9DE 100%);
|
|
199
209
|
--gradient-og: linear-gradient(145deg, #F6F2EA 55%, #EFE9DE 100%);
|
|
200
210
|
}
|
|
201
211
|
|
|
202
|
-
/* ---
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
212
|
+
/* --- the system's two gradients, as utilities -------------------------------
|
|
213
|
+
They are the only two blocks with a gradient: the hero and the section panel.
|
|
214
|
+
Making them utilities rather than arbitrary classes is what stops each project
|
|
215
|
+
from writing its own angle. They follow the mode because they read the custom
|
|
216
|
+
property. */
|
|
217
|
+
@utility gradient-hero {
|
|
207
218
|
background-image: var(--gradient-hero);
|
|
208
219
|
}
|
|
209
|
-
@utility
|
|
210
|
-
background-image: var(--gradient-
|
|
220
|
+
@utility gradient-section {
|
|
221
|
+
background-image: var(--gradient-section);
|
|
211
222
|
}
|
|
212
223
|
|
|
213
|
-
/* ---
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
224
|
+
/* --- the third motion exception: the skeleton shimmer -----------------------
|
|
225
|
+
The system does not animate, and this is the third exception, alongside the
|
|
226
|
+
button spinner and the side panel. All of them are feedback about PROGRESS,
|
|
227
|
+
not about state: a block that is still and a block that will never load look
|
|
228
|
+
identical.
|
|
217
229
|
|
|
218
|
-
1.4s
|
|
230
|
+
1.4s linear, from the document. It sits behind motion-safe in the component. */
|
|
219
231
|
@keyframes arrecife-shimmer {
|
|
220
232
|
from { background-position: 200% 0; }
|
|
221
233
|
to { background-position: -200% 0; }
|
|
@@ -232,76 +244,99 @@
|
|
|
232
244
|
animation: arrecife-shimmer 1.4s linear infinite;
|
|
233
245
|
}
|
|
234
246
|
|
|
235
|
-
/* ---
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
+
/* --- the fifth exception: the caret of the CLI signature --------------------
|
|
248
|
+
A terminal prompt with a caret that does not blink is a terminal that has
|
|
249
|
+
hung. The caret is the one piece of the footer that says the signature is a
|
|
250
|
+
prompt and not a decorative string, and a still block reads as a typo.
|
|
251
|
+
|
|
252
|
+
step-end and not a fade: a real caret is on or off, and easing it turns a
|
|
253
|
+
terminal into a pulsing dot. 1.06s is the cadence of a VT100 and of the site
|
|
254
|
+
this comes from.
|
|
255
|
+
|
|
256
|
+
It is the only exception that is not feedback about progress, and it earns its
|
|
257
|
+
place on the other half of the criterion the other four share: it is not
|
|
258
|
+
decoration, it is what makes the piece legible as what it is. Behind
|
|
259
|
+
motion-safe, where the caret stays solid — which is a caret at rest, not a
|
|
260
|
+
missing one. See docs/decisions.md § 23. */
|
|
261
|
+
@keyframes arrecife-caret {
|
|
262
|
+
0%, 50% { opacity: 1; }
|
|
263
|
+
50.01%, 100% { opacity: 0; }
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@utility caret {
|
|
267
|
+
animation: arrecife-caret 1.06s step-end infinite;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* --- the accordion exception -----------------------------------------------
|
|
271
|
+
The fourth one and, like the other three, it is not «it looks better»: a
|
|
272
|
+
disclosure that reveals content with no transition makes everything below it
|
|
273
|
+
JUMP, and whoever just clicked loses their place on the page. It is the same
|
|
274
|
+
category as the side panel — a panel entering from an edge slides by
|
|
275
|
+
definition — and not an entrance animation, which is what the system rejects:
|
|
276
|
+
nothing new appears on screen here, a gap opens.
|
|
277
|
+
|
|
278
|
+
Radix publishes the height as --radix-accordion-content-height. It lasts as
|
|
279
|
+
long as everything else and uses the same curve, so it introduces no new
|
|
280
|
+
timing. In the component it sits behind motion-safe. */
|
|
281
|
+
@keyframes arrecife-expand {
|
|
247
282
|
from { height: 0; }
|
|
248
283
|
to { height: var(--radix-accordion-content-height); }
|
|
249
284
|
}
|
|
250
|
-
@keyframes arrecife-
|
|
285
|
+
@keyframes arrecife-collapse {
|
|
251
286
|
from { height: var(--radix-accordion-content-height); }
|
|
252
287
|
to { height: 0; }
|
|
253
288
|
}
|
|
254
289
|
|
|
255
|
-
@utility
|
|
256
|
-
animation: arrecife-
|
|
290
|
+
@utility expand {
|
|
291
|
+
animation: arrecife-expand var(--duration-standard) var(--ease-standard);
|
|
257
292
|
}
|
|
258
|
-
@utility
|
|
259
|
-
animation: arrecife-
|
|
293
|
+
@utility collapse {
|
|
294
|
+
animation: arrecife-collapse var(--duration-standard) var(--ease-standard);
|
|
260
295
|
}
|
|
261
296
|
|
|
262
|
-
/* ---
|
|
263
|
-
|
|
264
|
-
modal
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
@keyframes arrecife-
|
|
270
|
-
@keyframes arrecife-
|
|
271
|
-
@keyframes arrecife-
|
|
272
|
-
@keyframes arrecife-
|
|
273
|
-
@keyframes arrecife-
|
|
274
|
-
@keyframes arrecife-
|
|
275
|
-
@keyframes arrecife-
|
|
276
|
-
@keyframes arrecife-
|
|
277
|
-
|
|
278
|
-
@utility
|
|
279
|
-
animation: arrecife-
|
|
297
|
+
/* --- the side panel exception ----------------------------------------------
|
|
298
|
+
A panel entering from an edge slides by definition: held still it would be an
|
|
299
|
+
off-centre modal. It is the second exception to "no displacement", and it was
|
|
300
|
+
approved knowingly.
|
|
301
|
+
|
|
302
|
+
It lasts as long as everything else and uses the same curve, so it introduces
|
|
303
|
+
no new timing. In the component it sits behind motion-safe. */
|
|
304
|
+
@keyframes arrecife-slide-in-right { from { translate: 100% 0; } }
|
|
305
|
+
@keyframes arrecife-slide-out-right { to { translate: 100% 0; } }
|
|
306
|
+
@keyframes arrecife-slide-in-left { from { translate: -100% 0; } }
|
|
307
|
+
@keyframes arrecife-slide-out-left { to { translate: -100% 0; } }
|
|
308
|
+
@keyframes arrecife-slide-in-top { from { translate: 0 -100%; } }
|
|
309
|
+
@keyframes arrecife-slide-out-top { to { translate: 0 -100%; } }
|
|
310
|
+
@keyframes arrecife-slide-in-bottom { from { translate: 0 100%; } }
|
|
311
|
+
@keyframes arrecife-slide-out-bottom { to { translate: 0 100%; } }
|
|
312
|
+
|
|
313
|
+
@utility slide-in-right {
|
|
314
|
+
animation: arrecife-slide-in-right var(--duration-standard) var(--ease-standard);
|
|
280
315
|
}
|
|
281
|
-
@utility
|
|
282
|
-
animation: arrecife-
|
|
316
|
+
@utility slide-out-right {
|
|
317
|
+
animation: arrecife-slide-out-right var(--duration-standard) var(--ease-standard);
|
|
283
318
|
}
|
|
284
|
-
@utility
|
|
285
|
-
animation: arrecife-
|
|
319
|
+
@utility slide-in-left {
|
|
320
|
+
animation: arrecife-slide-in-left var(--duration-standard) var(--ease-standard);
|
|
286
321
|
}
|
|
287
|
-
@utility
|
|
288
|
-
animation: arrecife-
|
|
322
|
+
@utility slide-out-left {
|
|
323
|
+
animation: arrecife-slide-out-left var(--duration-standard) var(--ease-standard);
|
|
289
324
|
}
|
|
290
|
-
@utility
|
|
291
|
-
animation: arrecife-
|
|
325
|
+
@utility slide-in-top {
|
|
326
|
+
animation: arrecife-slide-in-top var(--duration-standard) var(--ease-standard);
|
|
292
327
|
}
|
|
293
|
-
@utility
|
|
294
|
-
animation: arrecife-
|
|
328
|
+
@utility slide-out-top {
|
|
329
|
+
animation: arrecife-slide-out-top var(--duration-standard) var(--ease-standard);
|
|
295
330
|
}
|
|
296
|
-
@utility
|
|
297
|
-
animation: arrecife-
|
|
331
|
+
@utility slide-in-bottom {
|
|
332
|
+
animation: arrecife-slide-in-bottom var(--duration-standard) var(--ease-standard);
|
|
298
333
|
}
|
|
299
|
-
@utility
|
|
300
|
-
animation: arrecife-
|
|
334
|
+
@utility slide-out-bottom {
|
|
335
|
+
animation: arrecife-slide-out-bottom var(--duration-standard) var(--ease-standard);
|
|
301
336
|
}
|
|
302
337
|
|
|
303
|
-
/*
|
|
304
|
-
|
|
338
|
+
/* The system's only transition, as a utility. States are communicated with
|
|
339
|
+
border and color, not with movement: this class cannot animate anything else. */
|
|
305
340
|
@utility transition-standard {
|
|
306
341
|
transition-property: color, background-color, border-color, fill, stroke;
|
|
307
342
|
transition-duration: var(--duration-standard);
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
4
|
+
|
|
5
|
+
// src/variants/button.ts
|
|
6
|
+
var button = classVarianceAuthority.cva(
|
|
7
|
+
[
|
|
8
|
+
"inline-flex cursor-pointer items-center justify-center gap-step-xs whitespace-nowrap select-none",
|
|
9
|
+
"rounded-control font-sans font-medium",
|
|
10
|
+
"transition-standard",
|
|
11
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",
|
|
12
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
13
|
+
"[&_svg]:shrink-0"
|
|
14
|
+
],
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
primary: [
|
|
19
|
+
"bg-accent text-accent-on hover:bg-accent-hover",
|
|
20
|
+
"light:bg-brand-hull light:text-accent-on light:hover:bg-text-secondary"
|
|
21
|
+
],
|
|
22
|
+
conversion: "bg-warm text-warm-on hover:bg-warm-hover",
|
|
23
|
+
secondary: [
|
|
24
|
+
"border-hairline-hover border bg-transparent text-text-primary",
|
|
25
|
+
"hover:border-accent hover:text-accent"
|
|
26
|
+
],
|
|
27
|
+
tertiary: [
|
|
28
|
+
"bg-transparent font-mono font-normal text-text-secondary",
|
|
29
|
+
"hover:text-accent hover:underline hover:underline-offset-4"
|
|
30
|
+
],
|
|
31
|
+
/** Irreversible only. Never for «cancel» on a form. */
|
|
32
|
+
destructive: "bg-danger text-danger-on hover:bg-danger-hover",
|
|
33
|
+
destructiveOutline: [
|
|
34
|
+
"border-danger text-danger border bg-transparent",
|
|
35
|
+
"hover:bg-danger hover:text-danger-on"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
sm: "h-8 px-control-sm text-label",
|
|
40
|
+
md: "h-10 px-control-md text-ui",
|
|
41
|
+
lg: "h-12 px-control-lg text-lead",
|
|
42
|
+
/** A 42×42 square, no text. `aria-label` is mandatory on it. */
|
|
43
|
+
icon: "size-control-icon p-0",
|
|
44
|
+
/** 32×32, for a table row. Same height as `sm`, and same mandatory `aria-label`. */
|
|
45
|
+
"icon-sm": "size-control-icon-sm p-0"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
compoundVariants: [
|
|
49
|
+
/**
|
|
50
|
+
* The tertiary has no box: neither horizontal padding nor control height.
|
|
51
|
+
* It goes here rather than as `px-0` on the variant so it beats the size's
|
|
52
|
+
* `px-*` without depending on the order cva concatenates classes in.
|
|
53
|
+
*/
|
|
54
|
+
{ variant: "tertiary", size: ["sm", "md", "lg"], class: "h-auto px-0" }
|
|
55
|
+
],
|
|
56
|
+
defaultVariants: { variant: "primary", size: "md" }
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
var badge = classVarianceAuthority.cva(
|
|
60
|
+
["inline-flex items-center gap-step-xs", "rounded-chip px-step-xs py-0.5", "font-sans text-tag", "transition-standard"],
|
|
61
|
+
{
|
|
62
|
+
variants: {
|
|
63
|
+
variant: {
|
|
64
|
+
neutral: "bg-surface-raised text-text-secondary",
|
|
65
|
+
accent: "bg-accent/8 text-text-primary",
|
|
66
|
+
warm: "bg-warm/8 text-text-primary",
|
|
67
|
+
success: "bg-success/8 text-text-primary",
|
|
68
|
+
warning: "bg-warning/8 text-text-primary",
|
|
69
|
+
error: "bg-error/8 text-text-primary"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: { variant: "neutral" }
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
var category = classVarianceAuthority.cva(
|
|
76
|
+
[
|
|
77
|
+
"inline-flex items-center gap-step-xs",
|
|
78
|
+
"rounded-pill px-step-sm py-0.5",
|
|
79
|
+
"font-mono text-chip",
|
|
80
|
+
"border transition-standard"
|
|
81
|
+
],
|
|
82
|
+
{
|
|
83
|
+
variants: {
|
|
84
|
+
active: {
|
|
85
|
+
false: "border-warm/28 bg-transparent text-warm",
|
|
86
|
+
true: "border-warm bg-warm text-warm-on"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
defaultVariants: { active: false }
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
var metric = ["inline-flex items-center gap-step-xs", "rounded-pill", "font-mono text-chip text-text-muted"];
|
|
93
|
+
var text = classVarianceAuthority.cva("", {
|
|
94
|
+
variants: {
|
|
95
|
+
variant: {
|
|
96
|
+
display: "text-display font-display",
|
|
97
|
+
// Large metrics: 46px of display. It is the only scale designed for a
|
|
98
|
+
// number, which is why its line height is 1.
|
|
99
|
+
stat: "text-stat font-display",
|
|
100
|
+
h1: "text-h1 font-display",
|
|
101
|
+
h2: "text-h2 font-display",
|
|
102
|
+
h3: "text-h3 font-display",
|
|
103
|
+
body: "text-body font-sans",
|
|
104
|
+
// 17px: the deck on interior pages and the large button.
|
|
105
|
+
lead: "text-lead font-sans",
|
|
106
|
+
ui: "text-ui font-sans",
|
|
107
|
+
label: "text-label font-sans",
|
|
108
|
+
// The two badge scales. `tag` is status (sans 12.5/500) and `chip` is
|
|
109
|
+
// category and metric (mono 11.5). Neither transforms the text.
|
|
110
|
+
tag: "text-tag font-sans",
|
|
111
|
+
chip: "text-chip font-mono",
|
|
112
|
+
// Mono with NO transform: dates, paths, versions, file names and the
|
|
113
|
+
// footer signature. It is the step that was missing, and the reason every
|
|
114
|
+
// call site ended up writing `variant="eyebrow" className="normal-case"`.
|
|
115
|
+
meta: "text-meta font-mono",
|
|
116
|
+
// `uppercase` does not fit in a size token: text-transform is not a
|
|
117
|
+
// modifier of --text-*. Which is why the variant sets it, not theme.css.
|
|
118
|
+
eyebrow: "text-eyebrow font-mono uppercase"
|
|
119
|
+
},
|
|
120
|
+
tone: {
|
|
121
|
+
primary: "text-text-primary",
|
|
122
|
+
secondary: "text-text-secondary",
|
|
123
|
+
muted: "text-text-muted",
|
|
124
|
+
accent: "text-accent",
|
|
125
|
+
warm: "text-warm",
|
|
126
|
+
success: "text-success",
|
|
127
|
+
warning: "text-warning",
|
|
128
|
+
error: "text-error"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
defaultVariants: { variant: "body", tone: "primary" }
|
|
132
|
+
});
|
|
133
|
+
var alert = classVarianceAuthority.cva("w-full rounded-card border p-step-md font-sans text-ui", {
|
|
134
|
+
variants: {
|
|
135
|
+
variant: {
|
|
136
|
+
accent: "text-text-secondary",
|
|
137
|
+
success: "text-text-secondary",
|
|
138
|
+
warning: "text-text-secondary",
|
|
139
|
+
error: "text-text-secondary"
|
|
140
|
+
},
|
|
141
|
+
emphasis: {
|
|
142
|
+
subtle: "",
|
|
143
|
+
strong: ""
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
compoundVariants: [
|
|
147
|
+
{ variant: "accent", emphasis: "subtle", class: "border-accent/22 bg-accent/8" },
|
|
148
|
+
{ variant: "success", emphasis: "subtle", class: "border-success/22 bg-success/8" },
|
|
149
|
+
{ variant: "warning", emphasis: "subtle", class: "border-warning/22 bg-warning/8" },
|
|
150
|
+
{ variant: "error", emphasis: "subtle", class: "border-error/22 bg-error/8" },
|
|
151
|
+
{ variant: "accent", emphasis: "strong", class: "border-accent bg-accent/10" },
|
|
152
|
+
{ variant: "success", emphasis: "strong", class: "border-success bg-success/10" },
|
|
153
|
+
{ variant: "warning", emphasis: "strong", class: "border-warning bg-warning/10" },
|
|
154
|
+
{ variant: "error", emphasis: "strong", class: "border-error bg-error/10" }
|
|
155
|
+
],
|
|
156
|
+
defaultVariants: { variant: "accent", emphasis: "subtle" }
|
|
157
|
+
});
|
|
158
|
+
var avatar = classVarianceAuthority.cva(
|
|
159
|
+
"relative flex shrink-0 overflow-hidden rounded-pill bg-surface-raised border border-hairline",
|
|
160
|
+
{
|
|
161
|
+
variants: {
|
|
162
|
+
size: {
|
|
163
|
+
sm: "size-8",
|
|
164
|
+
md: "size-10",
|
|
165
|
+
lg: "size-14",
|
|
166
|
+
xl: "size-24"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
defaultVariants: { size: "md" }
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
// src/variants/card.ts
|
|
174
|
+
var CARD_SURFACE = "rounded-card border-hairline bg-surface border";
|
|
175
|
+
var CARD_HOVER = "transition-standard hover:border-hairline-hover";
|
|
176
|
+
var CARD = [
|
|
177
|
+
"group block cursor-pointer",
|
|
178
|
+
CARD_SURFACE,
|
|
179
|
+
CARD_HOVER,
|
|
180
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
|
|
181
|
+
];
|
|
182
|
+
|
|
183
|
+
exports.CARD = CARD;
|
|
184
|
+
exports.CARD_HOVER = CARD_HOVER;
|
|
185
|
+
exports.CARD_SURFACE = CARD_SURFACE;
|
|
186
|
+
exports.alertVariants = alert;
|
|
187
|
+
exports.avatarVariants = avatar;
|
|
188
|
+
exports.badgeVariants = badge;
|
|
189
|
+
exports.buttonVariants = button;
|
|
190
|
+
exports.categoryBadgeVariants = category;
|
|
191
|
+
exports.metricBadgeVariants = metric;
|
|
192
|
+
exports.textVariants = text;
|