@warmio/design 1.10.1 → 2.0.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/LICENSES/inter-OFL-1.1.txt +93 -0
- package/README.md +23 -9
- package/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/fonts.css +45 -12
- package/globals.css +1 -1
- package/interfaces.css +5 -5
- package/logo.css +39 -0
- package/package.json +4 -10
- package/theme.css +245 -632
- package/components.css +0 -586
- package/dist/button.d.ts +0 -49
- package/dist/button.js +0 -61
- package/themes.css +0 -51
package/components.css
DELETED
|
@@ -1,586 +0,0 @@
|
|
|
1
|
-
/* @warmio/design components.css - Warm Button/Logo recipes.
|
|
2
|
-
* Colors, typography, geometry, and edges remain Warm-owned.
|
|
3
|
-
* Surface-only press feedback adapted from Fluid Functionalism (MIT):
|
|
4
|
-
* https://www.fluidfunctionalism.com/r/base/button.json
|
|
5
|
-
* Native CSS keeps the published primitive free of a motion runtime.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
[data-warm-button] {
|
|
9
|
-
position: relative;
|
|
10
|
-
isolation: isolate;
|
|
11
|
-
/* Strip native button chrome when this stylesheet is used without preflight.
|
|
12
|
-
* `appearance` is deliberately left at its UA default (matches the
|
|
13
|
-
* pre-migration PrimitiveButton/buttonVariants recipe, which never applied
|
|
14
|
-
* `appearance-none`): every other property below already fully overrides
|
|
15
|
-
* native border/background/padding rendering, and resetting `appearance`
|
|
16
|
-
* here would diverge from the origin recipe's actual computed style. */
|
|
17
|
-
border: 0 solid;
|
|
18
|
-
background: transparent;
|
|
19
|
-
background-clip: padding-box;
|
|
20
|
-
padding: 0;
|
|
21
|
-
margin: 0;
|
|
22
|
-
font: inherit;
|
|
23
|
-
color: inherit;
|
|
24
|
-
display: inline-flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
border-radius: var(--radius-full);
|
|
28
|
-
font-size: var(--button-font-size);
|
|
29
|
-
font-weight: 400;
|
|
30
|
-
line-height: var(--button-line-height);
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
transition-property: var(--button-transition-property);
|
|
33
|
-
/* Exact legacy duration (200ms), derived from the locked motion scale
|
|
34
|
-
(fast=100ms) rather than a literal: fast x 2 = 200ms exactly, and it
|
|
35
|
-
zeroes correctly under reduced motion since `--motion-duration-fast`
|
|
36
|
-
itself is zeroed there (see the reduced-motion block below). */
|
|
37
|
-
transition-duration: calc(var(--motion-duration-fast) * 2);
|
|
38
|
-
transition-timing-function: ease-out;
|
|
39
|
-
outline: none;
|
|
40
|
-
user-select: none;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
flex-shrink: 0;
|
|
43
|
-
/* border handled by variant shadows/tokens; no default regression border */
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Move only the painted surface, never the label or the hit target. Fluid's
|
|
47
|
-
* fixed 1px-per-edge collapse avoids width-dependent scaling of wide buttons.
|
|
48
|
-
* Warm gradients and edge shadows stay on this layer at their original bounds. */
|
|
49
|
-
[data-warm-button]::before {
|
|
50
|
-
content: '';
|
|
51
|
-
position: absolute;
|
|
52
|
-
z-index: -1;
|
|
53
|
-
inset: 0;
|
|
54
|
-
border-radius: inherit;
|
|
55
|
-
background-color: transparent;
|
|
56
|
-
background-image: none;
|
|
57
|
-
background-clip: inherit;
|
|
58
|
-
box-shadow: none;
|
|
59
|
-
pointer-events: none;
|
|
60
|
-
transition-property: var(--button-surface-transition-property);
|
|
61
|
-
transition-duration:
|
|
62
|
-
calc(var(--motion-duration-fast) * 1.8), calc(var(--motion-duration-fast) * 0.8),
|
|
63
|
-
calc(var(--motion-duration-fast) * 1.8);
|
|
64
|
-
transition-timing-function: var(--button-press-easing);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
[data-warm-button]:focus-visible {
|
|
68
|
-
box-shadow: 0 0 0 var(--button-focus-ring)
|
|
69
|
-
color-mix(in oklab, var(--ring) var(--button-mix-50), transparent);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
[data-warm-button][data-width='full'] {
|
|
73
|
-
width: var(--button-width-full);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
[data-warm-button]:not(:disabled):not([aria-disabled='true']):hover {
|
|
77
|
-
filter: brightness(var(--button-hover-brightness));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
[data-slot='toggle-group'][data-appearance='segmented']:has(
|
|
81
|
-
[data-slot='toggle-group-item'][data-pressed]:hover:not(:disabled):not([aria-disabled='true'])
|
|
82
|
-
)
|
|
83
|
-
[data-slot='toggle-group-indicator'] {
|
|
84
|
-
filter: brightness(var(--button-hover-brightness));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
[data-warm-button]:not(:disabled):not([aria-disabled='true']):not(
|
|
88
|
-
[data-variant='arrow']
|
|
89
|
-
):active::before {
|
|
90
|
-
inset: var(--button-press-inset);
|
|
91
|
-
transition-duration: calc(var(--motion-duration-fast) * 0.8);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@media (prefers-reduced-motion: reduce) {
|
|
95
|
-
[data-warm-button],
|
|
96
|
-
[data-warm-button]::before {
|
|
97
|
-
transition: none;
|
|
98
|
-
}
|
|
99
|
-
[data-warm-button]:not(:disabled):not([aria-disabled='true']):not(
|
|
100
|
-
[data-variant='arrow']
|
|
101
|
-
):active::before {
|
|
102
|
-
inset: 0;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* Variants (from cva + overrides + edge; tokens for color/shadow/radius) */
|
|
107
|
-
[data-warm-button][data-variant='default'] {
|
|
108
|
-
color: var(--button-primary-foreground);
|
|
109
|
-
}
|
|
110
|
-
[data-warm-button][data-variant='default']::before {
|
|
111
|
-
background-color: var(--button-primary-bg);
|
|
112
|
-
background-image: var(--button-primary-gradient);
|
|
113
|
-
box-shadow: var(--button-primary-shadow);
|
|
114
|
-
/* no explicit border to avoid regression; shadow provides chrome */
|
|
115
|
-
}
|
|
116
|
-
[data-warm-button][data-variant='default']:hover::before {
|
|
117
|
-
background-color: var(--button-primary-hover);
|
|
118
|
-
background-image: var(--button-primary-gradient-hover);
|
|
119
|
-
}
|
|
120
|
-
[data-warm-button][data-variant='default']:active::before {
|
|
121
|
-
background-color: var(--button-primary-active);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
[data-warm-button][data-variant='outline'] {
|
|
125
|
-
border-style: none;
|
|
126
|
-
color: var(--background);
|
|
127
|
-
}
|
|
128
|
-
[data-warm-button][data-variant='outline']::before {
|
|
129
|
-
background-color: var(--background);
|
|
130
|
-
background-image: var(--button-outline-fill-image);
|
|
131
|
-
box-shadow: var(--button-outline-shadow);
|
|
132
|
-
}
|
|
133
|
-
[data-warm-button][data-variant='outline']:hover {
|
|
134
|
-
color: var(--background);
|
|
135
|
-
}
|
|
136
|
-
[data-warm-button][data-variant='outline']:hover::before {
|
|
137
|
-
background-color: var(--muted);
|
|
138
|
-
background-image: var(--button-outline-fill-image-hover);
|
|
139
|
-
}
|
|
140
|
-
[data-warm-button][data-variant='outline']:active::before {
|
|
141
|
-
background-color: var(--muted);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
[data-warm-button][data-variant='ghost']::before {
|
|
145
|
-
background-color: transparent;
|
|
146
|
-
box-shadow: var(--button-ghost-shadow);
|
|
147
|
-
}
|
|
148
|
-
[data-warm-button][data-variant='ghost']:hover {
|
|
149
|
-
color: var(--foreground);
|
|
150
|
-
}
|
|
151
|
-
[data-warm-button][data-variant='ghost']:hover::before {
|
|
152
|
-
background-color: var(--muted);
|
|
153
|
-
}
|
|
154
|
-
.dark [data-warm-button][data-variant='ghost']:hover::before {
|
|
155
|
-
background-color: color-mix(in oklab, var(--muted) var(--button-mix-50), transparent);
|
|
156
|
-
}
|
|
157
|
-
[data-warm-button][data-variant='destructive'] {
|
|
158
|
-
color: var(--destructive);
|
|
159
|
-
}
|
|
160
|
-
[data-warm-button][data-variant='destructive']::before {
|
|
161
|
-
background-color: color-mix(in oklab, var(--destructive) var(--button-mix-10), transparent);
|
|
162
|
-
}
|
|
163
|
-
[data-warm-button][data-variant='destructive']:hover::before {
|
|
164
|
-
background-color: color-mix(in oklab, var(--destructive) var(--button-mix-20), transparent);
|
|
165
|
-
}
|
|
166
|
-
.dark [data-warm-button][data-variant='destructive']::before {
|
|
167
|
-
background-color: color-mix(in oklab, var(--destructive) var(--button-mix-20), transparent);
|
|
168
|
-
}
|
|
169
|
-
.dark [data-warm-button][data-variant='destructive']:hover::before {
|
|
170
|
-
background-color: color-mix(in oklab, var(--destructive) var(--button-mix-30), transparent);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
[data-warm-button][data-variant='apple'] {
|
|
174
|
-
/* Apple buttons use one flat color in both themes and never cast a shadow. */
|
|
175
|
-
color: var(--apple-button-foreground) !important;
|
|
176
|
-
}
|
|
177
|
-
[data-warm-button][data-variant='apple']::before {
|
|
178
|
-
background-color: var(--apple-button-background) !important;
|
|
179
|
-
box-shadow: none;
|
|
180
|
-
}
|
|
181
|
-
button[data-warm-button][data-variant='apple'] {
|
|
182
|
-
appearance: button;
|
|
183
|
-
background-clip: padding-box;
|
|
184
|
-
}
|
|
185
|
-
[data-warm-button][data-variant='apple']:hover {
|
|
186
|
-
color: var(--apple-button-foreground);
|
|
187
|
-
}
|
|
188
|
-
[data-warm-button][data-variant='apple']:hover::before {
|
|
189
|
-
background-color: var(--apple-button-background) !important;
|
|
190
|
-
}
|
|
191
|
-
[data-warm-button][data-variant='arrow'] {
|
|
192
|
-
border-width: 0;
|
|
193
|
-
text-decoration: underline;
|
|
194
|
-
}
|
|
195
|
-
[data-warm-button][data-variant='arrow'] svg {
|
|
196
|
-
width: var(--button-icon-size);
|
|
197
|
-
height: var(--button-icon-size);
|
|
198
|
-
transition: transform calc(var(--motion-duration-fast) * 2);
|
|
199
|
-
}
|
|
200
|
-
[data-warm-button][data-variant='arrow']:hover svg {
|
|
201
|
-
transform: translate(
|
|
202
|
-
calc(var(--motion-distance-sm) / 2),
|
|
203
|
-
calc(-1 * var(--motion-distance-sm) / 2)
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
@media (prefers-reduced-motion: reduce) {
|
|
207
|
-
[data-warm-button][data-variant='arrow']:hover svg {
|
|
208
|
-
transform: none;
|
|
209
|
-
transition: none;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/* Sizes (public only; presentation overrides suppressed by explicit size via data attr, matches old resolveButton) */
|
|
214
|
-
[data-warm-button][data-size='compact'] {
|
|
215
|
-
height: var(--button-size-md);
|
|
216
|
-
padding-left: var(--button-padding-x-md);
|
|
217
|
-
padding-right: var(--button-padding-x-md);
|
|
218
|
-
gap: var(--button-gap);
|
|
219
|
-
}
|
|
220
|
-
[data-warm-button][data-size='default'] {
|
|
221
|
-
height: var(--button-height-default);
|
|
222
|
-
padding-left: var(--button-padding-x);
|
|
223
|
-
padding-right: var(--button-padding-x);
|
|
224
|
-
gap: var(--button-gap);
|
|
225
|
-
}
|
|
226
|
-
[data-warm-button][data-size='jumbo'] {
|
|
227
|
-
height: var(--button-height-jumbo);
|
|
228
|
-
padding-left: var(--button-padding-x-lg);
|
|
229
|
-
padding-right: var(--button-padding-x-lg);
|
|
230
|
-
font-size: var(--button-font-size-jumbo);
|
|
231
|
-
font-weight: 500;
|
|
232
|
-
line-height: var(--button-line-height-jumbo);
|
|
233
|
-
gap: var(--button-gap);
|
|
234
|
-
}
|
|
235
|
-
[data-warm-button][data-size='icon'] {
|
|
236
|
-
width: var(--button-height-icon);
|
|
237
|
-
height: var(--button-height-icon);
|
|
238
|
-
}
|
|
239
|
-
/* Explicit-size 'default' gets an extra vertical inset (legacy
|
|
240
|
-
buttonInputAlignmentClasses.default = 'bg-clip-border py-2'); this only
|
|
241
|
-
applies when the caller passes size="default" explicitly, never when
|
|
242
|
-
'default' is reached through presentation-driven implicit sizing. */
|
|
243
|
-
[data-warm-button][data-size='default'][data-explicit-size] {
|
|
244
|
-
padding-top: var(--button-padding-y-md);
|
|
245
|
-
padding-bottom: var(--button-padding-y-md);
|
|
246
|
-
background-clip: border-box;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/* Presentations: private legacy maps drive resolve to public data-size; geometry only when !data-explicit-size. Exact from old buttonPresentationClasses + primitive sizes (icon-round=36px etc) + edge + variants. */
|
|
250
|
-
[data-warm-button][data-presentation='assistantIcon']:not([data-explicit-size]) {
|
|
251
|
-
width: var(--button-size-xs);
|
|
252
|
-
height: var(--button-size-xs);
|
|
253
|
-
padding: var(--button-padding-y-md);
|
|
254
|
-
}
|
|
255
|
-
[data-warm-button][data-presentation='assistantRoundIcon']:not([data-explicit-size]) {
|
|
256
|
-
/* old icon-round 36px */
|
|
257
|
-
width: var(--button-height-icon);
|
|
258
|
-
height: var(--button-height-icon);
|
|
259
|
-
}
|
|
260
|
-
[data-warm-button][data-presentation='composerIcon']:not([data-explicit-size]) {
|
|
261
|
-
width: var(--button-size-sm);
|
|
262
|
-
height: var(--button-size-sm);
|
|
263
|
-
padding: var(--button-padding-y-md);
|
|
264
|
-
}
|
|
265
|
-
[data-warm-button][data-presentation='editPill']:not([data-explicit-size]) {
|
|
266
|
-
/* old sm 32px */
|
|
267
|
-
height: var(--button-size-md);
|
|
268
|
-
padding-left: var(--button-padding-x);
|
|
269
|
-
padding-right: var(--button-padding-x);
|
|
270
|
-
}
|
|
271
|
-
[data-warm-button][data-presentation='hero']:not([data-explicit-size]) {
|
|
272
|
-
height: var(--button-size-lg);
|
|
273
|
-
padding-left: var(--button-padding-x);
|
|
274
|
-
padding-right: var(--button-padding-x);
|
|
275
|
-
padding-top: var(--button-padding-y-md);
|
|
276
|
-
padding-bottom: var(--button-padding-y-md);
|
|
277
|
-
font-size: var(--button-font-size-base);
|
|
278
|
-
font-weight: 500;
|
|
279
|
-
line-height: var(--button-line-height-base);
|
|
280
|
-
background-clip: border-box;
|
|
281
|
-
}
|
|
282
|
-
[data-warm-button][data-presentation='promptCategory']:not([data-explicit-size]) {
|
|
283
|
-
height: var(--button-height-default);
|
|
284
|
-
gap: var(--button-gap);
|
|
285
|
-
padding-left: var(--button-padding-x);
|
|
286
|
-
padding-right: var(--button-padding-x);
|
|
287
|
-
font-size: var(--button-font-size);
|
|
288
|
-
font-weight: 400;
|
|
289
|
-
color: var(--foreground);
|
|
290
|
-
transition-property: var(--button-transition-property-colors);
|
|
291
|
-
}
|
|
292
|
-
[data-warm-button][data-presentation='promptCategory']:not([data-explicit-size])::before {
|
|
293
|
-
background-color: var(--background);
|
|
294
|
-
}
|
|
295
|
-
/* legacy's `getButtonEdgeClassName` applies `shadow-xs!` (Tailwind's `!`
|
|
296
|
-
important modifier) to every `default`-variant promptCategory button
|
|
297
|
-
regardless of explicit/implicit sizing, overriding the default variant's
|
|
298
|
-
own gradient shadow unconditionally; mirror that with `!important` here. */
|
|
299
|
-
[data-warm-button][data-presentation='promptCategory'][data-variant='default']::before {
|
|
300
|
-
box-shadow: var(--shadow-xs) !important;
|
|
301
|
-
}
|
|
302
|
-
/* buttonPresentationClasses.promptCategory's own (non-!important) `shadow-xs`
|
|
303
|
-
utility: only present in implicit mode (resolveLegacyButton's `!size`
|
|
304
|
-
branch), and only survives the cascade for variants without their own
|
|
305
|
-
later shadow override — arrow forces `shadow-none` and must keep winning;
|
|
306
|
-
default is already covered, unconditionally, by the rule above. */
|
|
307
|
-
[data-warm-button][data-presentation='promptCategory']:not([data-explicit-size]):not(
|
|
308
|
-
[data-variant='arrow']
|
|
309
|
-
)::before {
|
|
310
|
-
box-shadow: var(--shadow-xs) !important;
|
|
311
|
-
}
|
|
312
|
-
[data-warm-button][data-presentation='promptCategory']:hover::before {
|
|
313
|
-
background-color: var(--muted);
|
|
314
|
-
}
|
|
315
|
-
[data-warm-button][data-presentation='promptOption']:not([data-explicit-size]) {
|
|
316
|
-
height: auto;
|
|
317
|
-
min-height: var(--button-min-height-option);
|
|
318
|
-
align-items: flex-start;
|
|
319
|
-
justify-content: flex-start;
|
|
320
|
-
gap: var(--button-gap);
|
|
321
|
-
padding: var(--button-padding-x);
|
|
322
|
-
font-size: var(--button-font-size);
|
|
323
|
-
}
|
|
324
|
-
[data-warm-button][data-presentation='sidebarIcon']:not([data-explicit-size]) {
|
|
325
|
-
color: var(--sidebar-foreground);
|
|
326
|
-
background-clip: border-box;
|
|
327
|
-
}
|
|
328
|
-
[data-warm-button][data-presentation='sidebarIcon']:hover {
|
|
329
|
-
color: var(--sidebar-accent-foreground);
|
|
330
|
-
}
|
|
331
|
-
[data-warm-button][data-presentation='sidebarIcon']:hover::before {
|
|
332
|
-
background-color: var(--sidebar-accent);
|
|
333
|
-
}
|
|
334
|
-
[data-warm-button][data-presentation='tableHeader']:not([data-explicit-size]) {
|
|
335
|
-
height: auto;
|
|
336
|
-
min-height: 0;
|
|
337
|
-
width: var(--button-width-full);
|
|
338
|
-
justify-content: flex-start;
|
|
339
|
-
gap: var(--button-gap);
|
|
340
|
-
padding: 0;
|
|
341
|
-
font-weight: 400;
|
|
342
|
-
/* text-sm's line-height: tableHeader is the only non-arrow presentation
|
|
343
|
-
relying on `height: auto` with real text content, so the base rule's
|
|
344
|
-
`line-height: 1` (matching cva's other fixed-height presentations,
|
|
345
|
-
where line-height is irrelevant) would otherwise under-measure it. */
|
|
346
|
-
line-height: var(--button-line-height);
|
|
347
|
-
color: var(--muted-foreground);
|
|
348
|
-
}
|
|
349
|
-
[data-warm-button][data-presentation='tableHeader']:hover {
|
|
350
|
-
color: var(--foreground);
|
|
351
|
-
}
|
|
352
|
-
[data-warm-button][data-presentation='tableHeader']:hover::before {
|
|
353
|
-
background-color: transparent;
|
|
354
|
-
}
|
|
355
|
-
[data-warm-button][data-presentation='tableHeaderLink']:not([data-explicit-size]) {
|
|
356
|
-
height: auto;
|
|
357
|
-
min-height: 0;
|
|
358
|
-
width: var(--button-width-full);
|
|
359
|
-
justify-content: flex-start;
|
|
360
|
-
gap: var(--button-gap);
|
|
361
|
-
padding: 0;
|
|
362
|
-
border-radius: 0;
|
|
363
|
-
font-weight: 400;
|
|
364
|
-
line-height: var(--button-line-height);
|
|
365
|
-
color: var(--muted-foreground);
|
|
366
|
-
text-decoration: underline;
|
|
367
|
-
text-decoration-thickness: var(--button-underline-thickness);
|
|
368
|
-
text-underline-offset: var(--button-underline-offset);
|
|
369
|
-
}
|
|
370
|
-
[data-warm-button][data-presentation='tableHeaderLink']::before {
|
|
371
|
-
background-image: none;
|
|
372
|
-
background-color: transparent;
|
|
373
|
-
box-shadow: none;
|
|
374
|
-
}
|
|
375
|
-
[data-warm-button][data-presentation='tableHeaderLink']:focus-visible {
|
|
376
|
-
box-shadow: none;
|
|
377
|
-
}
|
|
378
|
-
[data-warm-button][data-presentation='tableHeaderLink']:hover {
|
|
379
|
-
color: var(--foreground);
|
|
380
|
-
}
|
|
381
|
-
[data-warm-button][data-presentation='tableHeaderLink']:hover::before {
|
|
382
|
-
background-image: none;
|
|
383
|
-
background-color: transparent;
|
|
384
|
-
box-shadow: none;
|
|
385
|
-
}
|
|
386
|
-
[data-warm-button][data-presentation='touch']:not([data-explicit-size]) {
|
|
387
|
-
min-height: var(--button-min-height-touch);
|
|
388
|
-
}
|
|
389
|
-
[data-warm-button][data-presentation='headerAction']:not([data-explicit-size]) {
|
|
390
|
-
width: auto;
|
|
391
|
-
height: var(--button-size-xs);
|
|
392
|
-
padding-left: var(--button-padding-x-md);
|
|
393
|
-
padding-right: var(--button-padding-x-md);
|
|
394
|
-
}
|
|
395
|
-
[data-warm-button][data-presentation='threadMore']:not([data-explicit-size]) {
|
|
396
|
-
width: var(--button-size-xs);
|
|
397
|
-
height: var(--button-size-xs);
|
|
398
|
-
padding: 0;
|
|
399
|
-
}
|
|
400
|
-
[data-warm-button][data-presentation='threadNew']:not([data-explicit-size]) {
|
|
401
|
-
height: var(--button-size-md);
|
|
402
|
-
justify-content: flex-start;
|
|
403
|
-
gap: var(--button-gap);
|
|
404
|
-
padding-left: var(--button-padding-x-sm);
|
|
405
|
-
padding-right: var(--button-padding-x-sm);
|
|
406
|
-
font-size: var(--button-font-size);
|
|
407
|
-
font-weight: 400;
|
|
408
|
-
}
|
|
409
|
-
[data-warm-button][data-presentation='threadNew']:hover::before {
|
|
410
|
-
background-color: var(--muted);
|
|
411
|
-
}
|
|
412
|
-
[data-warm-button][data-presentation='compact']:not([data-explicit-size]) {
|
|
413
|
-
height: var(--button-size-md);
|
|
414
|
-
padding-left: var(--button-padding-x-md);
|
|
415
|
-
padding-right: var(--button-padding-x-md);
|
|
416
|
-
}
|
|
417
|
-
/* 'default' and 'controlPeer' both resolve to private size 'default' with no
|
|
418
|
-
own `buttonPresentationClasses` entry, so origin's `resolveLegacyButton`
|
|
419
|
-
falls through to `buttonInputAlignmentClasses.default = 'bg-clip-border
|
|
420
|
-
py-2'` even with no explicit size passed. Mirror that here (the explicit
|
|
421
|
-
`[data-size="default"][data-explicit-size]` rule below only fires once a
|
|
422
|
-
caller passes size="default" explicitly, so implicit 'default'/'controlPeer'
|
|
423
|
-
need their own copy of the same two properties). */
|
|
424
|
-
[data-warm-button][data-presentation='default']:not([data-explicit-size]),
|
|
425
|
-
[data-warm-button][data-presentation='controlPeer']:not([data-explicit-size]) {
|
|
426
|
-
padding-top: var(--button-padding-y-md);
|
|
427
|
-
padding-bottom: var(--button-padding-y-md);
|
|
428
|
-
background-clip: border-box;
|
|
429
|
-
}
|
|
430
|
-
[data-warm-button][data-presentation='menuOption']:not([data-explicit-size]) {
|
|
431
|
-
/* old option min-height/auto 64px */
|
|
432
|
-
height: auto;
|
|
433
|
-
min-height: var(--button-min-height-option);
|
|
434
|
-
align-items: flex-start;
|
|
435
|
-
justify-content: flex-start;
|
|
436
|
-
gap: var(--button-gap);
|
|
437
|
-
padding: var(--button-padding-x);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/* Arrow overrides any presentation-driven box geometry declared above it:
|
|
441
|
-
legacy's cn(presentationClassName, variantClassName, ...) always merges the
|
|
442
|
-
arrow variant classes last, so arrow's box reset wins whenever it conflicts
|
|
443
|
-
with a presentation, and height is always content-driven (verified against
|
|
444
|
-
the real compiled legacy recipe: every presentation x size combination
|
|
445
|
-
renders the same auto height once variant="arrow"). Width is intentionally
|
|
446
|
-
left alone everywhere: arrow's own recipe never sets it, so an explicit
|
|
447
|
-
public size's fixed width (e.g. `[data-size="icon"]`) or a presentation's
|
|
448
|
-
own private width (e.g. assistantIcon's 1.5rem) still applies underneath
|
|
449
|
-
it. The selector repeats `[data-variant="arrow"]` to match the (0,3,0)
|
|
450
|
-
specificity of the `:not([data-explicit-size])` presentation rules and the
|
|
451
|
-
`[data-size][data-explicit-size]` size rule above, so this later rule wins
|
|
452
|
-
the cascade instead of losing on specificity. */
|
|
453
|
-
[data-warm-button][data-variant='arrow'][data-variant='arrow'] {
|
|
454
|
-
height: auto;
|
|
455
|
-
padding: 0;
|
|
456
|
-
gap: var(--button-gap);
|
|
457
|
-
border-radius: 0;
|
|
458
|
-
color: var(--foreground);
|
|
459
|
-
font-size: var(--button-font-size-base);
|
|
460
|
-
/* text-base's line-height (verified to win over any competing presentation
|
|
461
|
-
or size text utility, e.g. jumbo's text-lg, in the real compiled legacy
|
|
462
|
-
recipe). Only affects buttons with a real text node: an icon-only arrow
|
|
463
|
-
button has no inline content to lay out a line box for, so this is a
|
|
464
|
-
no-op there and height still resolves from the icon's own box (verified:
|
|
465
|
-
icon-only arrow buttons measure 16/20px tall matching their glyph, never
|
|
466
|
-
the 24px text strut). */
|
|
467
|
-
line-height: var(--button-line-height-base);
|
|
468
|
-
font-weight: 500;
|
|
469
|
-
}
|
|
470
|
-
[data-warm-button][data-variant='arrow'][data-variant='arrow']::before {
|
|
471
|
-
background-color: transparent;
|
|
472
|
-
background-image: none;
|
|
473
|
-
box-shadow: none;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/* SVG rules (from cva) */
|
|
477
|
-
[data-warm-button] svg {
|
|
478
|
-
pointer-events: none;
|
|
479
|
-
flex-shrink: 0;
|
|
480
|
-
}
|
|
481
|
-
[data-warm-button] svg:not([class*='size-']) {
|
|
482
|
-
width: var(--button-icon-size);
|
|
483
|
-
height: var(--button-icon-size);
|
|
484
|
-
}
|
|
485
|
-
[data-warm-button][data-size='jumbo'] svg:not([class*='size-']) {
|
|
486
|
-
width: var(--button-icon-size-jumbo);
|
|
487
|
-
height: var(--button-icon-size-jumbo);
|
|
488
|
-
}
|
|
489
|
-
/* `hero`'s private size (`lg`) publicly maps to the same `data-size="jumbo"`
|
|
490
|
-
bucket as the genuine cva `jumbo` size (both being the "larger" public
|
|
491
|
-
size per `resolveButton`), but legacy's real `lg` primitive size carries no
|
|
492
|
-
svg-shrink/grow override at all, unlike `jumbo`'s own `size-5`. Restore the
|
|
493
|
-
unscaled glyph for `hero` specifically so it doesn't inherit jumbo's larger
|
|
494
|
-
icon. Gated to implicit sizing only: if the caller explicitly passes
|
|
495
|
-
`size="jumbo"` on a hero-presentation button, that is a real request for
|
|
496
|
-
the genuine cva `jumbo` size (own `size-5` icon included), not hero's
|
|
497
|
-
private `lg` behavior. `:not([data-explicit-size])` also raises this rule's
|
|
498
|
-
specificity above the plain jumbo rule above, so it wins unconditionally
|
|
499
|
-
whenever it matches. */
|
|
500
|
-
[data-warm-button][data-presentation='hero']:not([data-explicit-size]) svg:not([class*='size-']) {
|
|
501
|
-
width: var(--button-icon-size);
|
|
502
|
-
height: var(--button-icon-size);
|
|
503
|
-
}
|
|
504
|
-
/* Arrow's own icon size (legacy `[&_svg]:size-4`) wins over the base and
|
|
505
|
-
default-size svg rules above via source order, but intentionally has lower
|
|
506
|
-
specificity than the jumbo icon rule below: legacy's own jumbo svg rule
|
|
507
|
-
(`[&_svg:not([class*='size-'])]:size-5`) carries one more selector
|
|
508
|
-
component than arrow's (`[&_svg]:size-4`), so jumbo's larger glyph size
|
|
509
|
-
wins whenever both apply (verified against the real compiled recipe). */
|
|
510
|
-
[data-warm-button][data-variant='arrow'] svg {
|
|
511
|
-
width: var(--button-icon-size);
|
|
512
|
-
height: var(--button-icon-size);
|
|
513
|
-
}
|
|
514
|
-
/* icon-xs primitive size (assistantIcon, threadMore) shrinks the icon glyph;
|
|
515
|
-
suppressed when the caller passes an explicit public size. */
|
|
516
|
-
[data-warm-button][data-presentation='assistantIcon']:not([data-explicit-size])
|
|
517
|
-
svg:not([class*='size-']),
|
|
518
|
-
[data-warm-button][data-presentation='threadMore']:not([data-explicit-size])
|
|
519
|
-
svg:not([class*='size-']) {
|
|
520
|
-
width: var(--button-icon-size-xs);
|
|
521
|
-
height: var(--button-icon-size-xs);
|
|
522
|
-
}
|
|
523
|
-
/* Aria states (from cva aria-invalid + aria-expanded + dark) */
|
|
524
|
-
[data-warm-button][aria-invalid] {
|
|
525
|
-
box-shadow: 0 0 0 var(--button-focus-ring)
|
|
526
|
-
color-mix(in oklab, var(--destructive) var(--button-mix-20), transparent);
|
|
527
|
-
}
|
|
528
|
-
.dark [data-warm-button][aria-invalid] {
|
|
529
|
-
box-shadow: 0 0 0 var(--button-focus-ring)
|
|
530
|
-
color-mix(in oklab, var(--destructive) var(--button-mix-40), transparent);
|
|
531
|
-
}
|
|
532
|
-
[data-warm-button][data-variant='ghost'][aria-expanded='true'] {
|
|
533
|
-
color: var(--foreground);
|
|
534
|
-
}
|
|
535
|
-
[data-warm-button][data-variant='ghost'][aria-expanded='true']::before {
|
|
536
|
-
background-color: var(--muted);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/* Disabled base + variant overrides (keep full shadow/border for some) */
|
|
540
|
-
[data-warm-button]:disabled {
|
|
541
|
-
pointer-events: none;
|
|
542
|
-
opacity: 0.5;
|
|
543
|
-
}
|
|
544
|
-
[data-warm-button][data-variant='apple']:disabled {
|
|
545
|
-
opacity: 1;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/* Logo - keep data-warm-logo on wrapper div AND svg; unambiguous element selectors + data to avoid sizing wrapper or constraining width; wrapper inline-flex (not inline-block); preserve gap/text/typography/tone/icon sizes from old */
|
|
549
|
-
[data-warm-logo] {
|
|
550
|
-
display: inline-flex;
|
|
551
|
-
align-items: center;
|
|
552
|
-
gap: var(--logo-gap);
|
|
553
|
-
}
|
|
554
|
-
[data-warm-logo] > span {
|
|
555
|
-
font-size: var(--logo-font-size);
|
|
556
|
-
font-weight: 500;
|
|
557
|
-
letter-spacing: var(--logo-letter-spacing);
|
|
558
|
-
}
|
|
559
|
-
svg[data-warm-logo] {
|
|
560
|
-
display: block;
|
|
561
|
-
fill: currentColor;
|
|
562
|
-
flex-shrink: 0;
|
|
563
|
-
}
|
|
564
|
-
[data-warm-logo][data-size='badge'] svg[data-warm-logo] {
|
|
565
|
-
width: var(--logo-size-badge);
|
|
566
|
-
height: var(--logo-size-badge);
|
|
567
|
-
}
|
|
568
|
-
[data-warm-logo][data-size='default'] svg[data-warm-logo] {
|
|
569
|
-
width: var(--logo-size-default);
|
|
570
|
-
height: var(--logo-size-default);
|
|
571
|
-
}
|
|
572
|
-
[data-warm-logo][data-size='feature'] svg[data-warm-logo] {
|
|
573
|
-
width: var(--logo-size-feature);
|
|
574
|
-
height: var(--logo-size-feature);
|
|
575
|
-
}
|
|
576
|
-
[data-warm-logo][data-size='hero'] svg[data-warm-logo] {
|
|
577
|
-
width: var(--logo-size-hero);
|
|
578
|
-
height: var(--logo-size-hero);
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
[data-warm-logo][data-tone='foreground'] {
|
|
582
|
-
color: var(--foreground);
|
|
583
|
-
}
|
|
584
|
-
[data-warm-logo][data-tone='sidebar'] {
|
|
585
|
-
color: var(--sidebar-foreground);
|
|
586
|
-
}
|
package/dist/button.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export type ButtonPresentation = 'assistantIcon' | 'assistantRoundIcon' | 'composerIcon' | 'default' | 'headerAction' | 'compact' | 'controlPeer' | 'editPill' | 'hero' | 'menuOption' | 'promptCategory' | 'promptOption' | 'sidebarIcon' | 'tableHeader' | 'tableHeaderLink' | 'threadMore' | 'threadNew' | 'touch';
|
|
3
|
-
export type ButtonVariant = 'default' | 'outline' | 'ghost' | 'destructive' | 'apple' | 'arrow';
|
|
4
|
-
export type ButtonSize = 'compact' | 'default' | 'jumbo' | 'icon';
|
|
5
|
-
export type ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'style'> & {
|
|
6
|
-
asChild?: never;
|
|
7
|
-
className?: never;
|
|
8
|
-
presentation?: ButtonPresentation;
|
|
9
|
-
render?: never;
|
|
10
|
-
size?: ButtonSize;
|
|
11
|
-
style?: never;
|
|
12
|
-
variant?: ButtonVariant;
|
|
13
|
-
width?: 'full';
|
|
14
|
-
};
|
|
15
|
-
export type ButtonLinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'disabled' | 'style'> & {
|
|
16
|
-
href: string;
|
|
17
|
-
presentation?: ButtonPresentation;
|
|
18
|
-
size?: ButtonSize;
|
|
19
|
-
variant?: ButtonVariant;
|
|
20
|
-
width?: 'full';
|
|
21
|
-
asChild?: never;
|
|
22
|
-
className?: never;
|
|
23
|
-
disabled?: never;
|
|
24
|
-
render?: never;
|
|
25
|
-
style?: never;
|
|
26
|
-
};
|
|
27
|
-
declare const Button: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> & {
|
|
28
|
-
asChild?: never;
|
|
29
|
-
className?: never;
|
|
30
|
-
presentation?: ButtonPresentation;
|
|
31
|
-
render?: never;
|
|
32
|
-
size?: ButtonSize;
|
|
33
|
-
style?: never;
|
|
34
|
-
variant?: ButtonVariant;
|
|
35
|
-
width?: 'full';
|
|
36
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
-
declare const ButtonLink: React.ForwardRefExoticComponent<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "className" | "disabled" | "style"> & {
|
|
38
|
-
href: string;
|
|
39
|
-
presentation?: ButtonPresentation;
|
|
40
|
-
size?: ButtonSize;
|
|
41
|
-
variant?: ButtonVariant;
|
|
42
|
-
width?: 'full';
|
|
43
|
-
asChild?: never;
|
|
44
|
-
className?: never;
|
|
45
|
-
disabled?: never;
|
|
46
|
-
render?: never;
|
|
47
|
-
style?: never;
|
|
48
|
-
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
49
|
-
export { Button, ButtonLink };
|
package/dist/button.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
const presentationToPrivateSize = {
|
|
4
|
-
assistantIcon: 'icon-xs',
|
|
5
|
-
assistantRoundIcon: 'icon-round',
|
|
6
|
-
composerIcon: 'icon-sm',
|
|
7
|
-
default: 'default',
|
|
8
|
-
headerAction: 'icon-xs',
|
|
9
|
-
compact: 'sm',
|
|
10
|
-
controlPeer: 'default',
|
|
11
|
-
editPill: 'sm',
|
|
12
|
-
hero: 'lg',
|
|
13
|
-
menuOption: 'option',
|
|
14
|
-
promptCategory: 'default',
|
|
15
|
-
promptOption: 'option',
|
|
16
|
-
sidebarIcon: 'icon',
|
|
17
|
-
tableHeader: 'default',
|
|
18
|
-
tableHeaderLink: 'default',
|
|
19
|
-
threadMore: 'icon-xs',
|
|
20
|
-
threadNew: 'sm',
|
|
21
|
-
touch: 'default',
|
|
22
|
-
};
|
|
23
|
-
const presentationAliases = {
|
|
24
|
-
controlPeer: 'default',
|
|
25
|
-
menuOption: 'promptOption',
|
|
26
|
-
touch: 'default',
|
|
27
|
-
};
|
|
28
|
-
function resolvePresentation(presentation) {
|
|
29
|
-
return presentationAliases[presentation] ?? presentation;
|
|
30
|
-
}
|
|
31
|
-
function resolveButton(presentation, size) {
|
|
32
|
-
const privateSize = presentationToPrivateSize[presentation];
|
|
33
|
-
const resolvedSize = size ??
|
|
34
|
-
(privateSize === 'lg'
|
|
35
|
-
? 'jumbo'
|
|
36
|
-
: privateSize === 'sm'
|
|
37
|
-
? 'compact'
|
|
38
|
-
: privateSize === 'icon' ||
|
|
39
|
-
privateSize === 'icon-round' ||
|
|
40
|
-
privateSize === 'icon-sm' ||
|
|
41
|
-
privateSize === 'icon-xs'
|
|
42
|
-
? 'icon'
|
|
43
|
-
: 'default');
|
|
44
|
-
return { resolvedSize, explicitSize: size ? resolvedSize : undefined };
|
|
45
|
-
}
|
|
46
|
-
function withArrow(variant, children) {
|
|
47
|
-
if (variant !== 'arrow')
|
|
48
|
-
return children;
|
|
49
|
-
return (_jsxs(_Fragment, { children: [children, _jsxs("svg", { "aria-hidden": "true", "data-icon": "inline-end", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M7 7h10v10" }), _jsx("path", { d: "M7 17L17 7" })] })] }));
|
|
50
|
-
}
|
|
51
|
-
const Button = React.forwardRef(function Button({ children, className: _className, presentation = 'default', render: _render, size, style: _style, type, variant = 'default', width, asChild: _asChild, ...props }, ref) {
|
|
52
|
-
const { resolvedSize, explicitSize } = resolveButton(presentation, size);
|
|
53
|
-
return (_jsx("button", { ...props, ref: ref, type: type ?? 'button', "data-warm-button": "", "data-slot": "button", "data-presentation": resolvePresentation(presentation), "data-variant": variant, "data-size": resolvedSize, "data-explicit-size": explicitSize, "data-width": width, children: withArrow(variant, children) }));
|
|
54
|
-
});
|
|
55
|
-
Button.displayName = 'WarmButton';
|
|
56
|
-
const ButtonLink = React.forwardRef(function ButtonLink({ children, className: _className, disabled: _disabled, presentation = 'default', render: _render, size, style: _style, variant = 'default', width, asChild: _asChild, ...props }, ref) {
|
|
57
|
-
const { resolvedSize, explicitSize } = resolveButton(presentation, size);
|
|
58
|
-
return (_jsx("a", { ...props, ref: ref, "data-warm-button": "", "data-slot": "button", "data-presentation": resolvePresentation(presentation), "data-variant": variant, "data-size": resolvedSize, "data-explicit-size": explicitSize, "data-width": width, children: withArrow(variant, children) }));
|
|
59
|
-
});
|
|
60
|
-
ButtonLink.displayName = 'WarmButtonLink';
|
|
61
|
-
export { Button, ButtonLink };
|