@warmio/design 1.10.1 → 1.11.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,93 @@
1
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
package/README.md CHANGED
@@ -1,30 +1,35 @@
1
1
  # @warmio/design
2
2
 
3
3
  Warm's public design contract: CSS tokens (fonts, colors, spacing, radii, shadows, motion,
4
- reduced-motion, marketing surfaces + dot patterns) and Button/Logo primitives.
4
+ reduced-motion, marketing surfaces + dot patterns) and the Logo primitive.
5
5
 
6
6
  ```css
7
7
  @import '@warmio/design/globals.css';
8
8
  ```
9
9
 
10
- Import primitives directly:
10
+ Import the Logo primitive directly:
11
11
 
12
12
  ```ts
13
- import { Button, ButtonLink } from '@warmio/design/button';
14
13
  import { Logo, WarmLogoIcon } from '@warmio/design/logo';
15
14
  ```
16
15
 
17
- The product UI uses Inter from Google Fonts. JetBrains Mono remains for
18
- numbers, code, and measurements. The interface uses regular (400) and medium (500) weights.
16
+ The product UI uses Inter, self-hosted from `fonts/` as wght variable latin and
17
+ latin-ext subsets (normal and italic, Inter 4.001 from `@fontsource-variable/inter`
18
+ 5.3.0, OFL in `LICENSES/inter-OFL-1.1.txt`). No font loads from Google.
19
+ JetBrains Mono remains for numbers, code, and measurements. The interface uses regular (400) and medium (500) weights.
19
20
 
20
21
  `--accent-solid` / `--accent-solid-text` are the chromatic accent for links,
21
22
  badges, and highlights. They derive from `--brand-accent-solid` in `themes.css`.
22
23
 
23
- Package ships `components.css` (token-only styles for the primitives) and `dist/` (ESM + .d.ts). `dependencies` and `devDependencies` are empty.
24
+ Package ships `logo.css` (token-only Logo styles) and `dist/` (ESM + .d.ts). `dependencies` and `devDependencies` are empty.
24
25
  `peerDependencies.react` is `^19.0.0`. No root JS export.
25
26
 
26
27
  ## Releases
27
28
 
29
+ The next release is `1.11.0`. It adds the 18px `--type-size-large` token for
30
+ large body copy, self-hosts Inter instead of importing it from Google Fonts, and
31
+ removes the `./button` and `./components.css` exports (Button now lives in `@warm/ui`).
32
+
28
33
  The `1.10.0` release adds the `tableHeaderLink` Button presentation for
29
34
  borderless, underlined sortable table headers. The `1.9.1` release updated the
30
35
  light default button shadow and white-to-gray gradient. Version `1.9.0`
package/fonts.css CHANGED
@@ -1,8 +1,48 @@
1
- /*
2
- * Inter is the shared Google Fonts UI family.
3
- * JetBrains Mono remains local for financial values, code, and measurements.
4
- */
5
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');
1
+ @font-face {
2
+ font-family: 'Inter';
3
+ font-style: normal;
4
+ font-display: swap;
5
+ font-weight: 100 900;
6
+ src: url('./fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
7
+ unicode-range:
8
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
9
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
10
+ U+A720-A7FF;
11
+ }
12
+
13
+ @font-face {
14
+ font-family: 'Inter';
15
+ font-style: normal;
16
+ font-display: swap;
17
+ font-weight: 100 900;
18
+ src: url('./fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
19
+ unicode-range:
20
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
21
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
22
+ }
23
+
24
+ @font-face {
25
+ font-family: 'Inter';
26
+ font-style: italic;
27
+ font-display: swap;
28
+ font-weight: 100 900;
29
+ src: url('./fonts/inter-latin-ext-wght-italic.woff2') format('woff2-variations');
30
+ unicode-range:
31
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
32
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
33
+ U+A720-A7FF;
34
+ }
35
+
36
+ @font-face {
37
+ font-family: 'Inter';
38
+ font-style: italic;
39
+ font-display: swap;
40
+ font-weight: 100 900;
41
+ src: url('./fonts/inter-latin-wght-italic.woff2') format('woff2-variations');
42
+ unicode-range:
43
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
44
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
45
+ }
6
46
 
7
47
  @font-face {
8
48
  font-family: 'JetBrains Mono';
package/globals.css CHANGED
@@ -2,4 +2,4 @@
2
2
  @import './theme.css';
3
3
  @import './base.css';
4
4
  @import './interfaces.css';
5
- @import './components.css';
5
+ @import './logo.css';
package/logo.css ADDED
@@ -0,0 +1,39 @@
1
+ /* 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 */
2
+ [data-warm-logo] {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ gap: var(--logo-gap);
6
+ }
7
+ [data-warm-logo] > span {
8
+ font-size: var(--logo-font-size);
9
+ font-weight: 500;
10
+ letter-spacing: var(--logo-letter-spacing);
11
+ }
12
+ svg[data-warm-logo] {
13
+ display: block;
14
+ fill: currentColor;
15
+ flex-shrink: 0;
16
+ }
17
+ [data-warm-logo][data-size='badge'] svg[data-warm-logo] {
18
+ width: var(--logo-size-badge);
19
+ height: var(--logo-size-badge);
20
+ }
21
+ [data-warm-logo][data-size='default'] svg[data-warm-logo] {
22
+ width: var(--logo-size-default);
23
+ height: var(--logo-size-default);
24
+ }
25
+ [data-warm-logo][data-size='feature'] svg[data-warm-logo] {
26
+ width: var(--logo-size-feature);
27
+ height: var(--logo-size-feature);
28
+ }
29
+ [data-warm-logo][data-size='hero'] svg[data-warm-logo] {
30
+ width: var(--logo-size-hero);
31
+ height: var(--logo-size-hero);
32
+ }
33
+
34
+ [data-warm-logo][data-tone='foreground'] {
35
+ color: var(--foreground);
36
+ }
37
+ [data-warm-logo][data-tone='sidebar'] {
38
+ color: var(--sidebar-foreground);
39
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@warmio/design",
3
- "version": "1.10.1",
4
- "description": "Warm's public design contract: CSS tokens and Button/Logo primitives.",
3
+ "version": "1.11.0",
4
+ "description": "Warm's public design contract: CSS tokens and the Logo primitive.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": [
@@ -23,7 +23,7 @@
23
23
  "interfaces.css",
24
24
  "theme.css",
25
25
  "themes.css",
26
- "components.css",
26
+ "logo.css",
27
27
  "fonts",
28
28
  "dist",
29
29
  "LICENSES"
@@ -35,11 +35,7 @@
35
35
  "./theme.css": "./theme.css",
36
36
  "./themes.css": "./themes.css",
37
37
  "./interfaces.css": "./interfaces.css",
38
- "./components.css": "./components.css",
39
- "./button": {
40
- "types": "./dist/button.d.ts",
41
- "import": "./dist/button.js"
42
- },
38
+ "./logo.css": "./logo.css",
43
39
  "./logo": {
44
40
  "types": "./dist/logo.d.ts",
45
41
  "import": "./dist/logo.js"
package/theme.css CHANGED
@@ -71,10 +71,11 @@
71
71
  --border: oklch(0.922 0 0);
72
72
  --input: var(--border);
73
73
 
74
- /* Type scale: caption 12px, label 13px, body 14px, display 24px. */
74
+ /* Type scale: caption 12px, label 13px, body 14px, large body 18px, display 24px. */
75
75
  --type-size-caption: 0.75rem;
76
76
  --type-size-label: 0.8125rem;
77
77
  --type-size-body: 0.875rem;
78
+ --type-size-large: 1.125rem;
78
79
  --type-size-display: 1.5rem;
79
80
 
80
81
  /* Alternating section backgrounds for marketing pages */
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 };