@tenphi/tasty 0.0.0-snapshot.27699f6 → 0.0.0-snapshot.27b6708
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/README.md +171 -107
- package/dist/{async-storage-B7_o6FKt.js → async-storage-DKK-wTD4.js} +1 -1
- package/dist/{async-storage-B7_o6FKt.js.map → async-storage-DKK-wTD4.js.map} +1 -1
- package/dist/babel-BUQGeOXA.d.ts +83 -0
- package/dist/{collector-QwpPODsy.js → collector-DTahQUiV.js} +97 -23
- package/dist/collector-DTahQUiV.js.map +1 -0
- package/dist/{collector-LuU1vZ68.d.ts → collector-DUaHCcTS.d.ts} +54 -7
- package/dist/{config-rrijM-U2.js → config-B5kHzuNz.js} +5144 -3012
- package/dist/config-B5kHzuNz.js.map +1 -0
- package/dist/{config-vuCRkBWX.d.ts → config-YsxGv4tq.d.ts} +412 -33
- package/dist/{context-CkSg-kDT.js → context-CA8YKeMn.js} +1 -1
- package/dist/{context-CkSg-kDT.js.map → context-CA8YKeMn.js.map} +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +6 -6
- package/dist/{core-BvTG0J_M.js → core-Dr4u1NVD.js} +162 -188
- package/dist/core-Dr4u1NVD.js.map +1 -0
- package/dist/{css-writer-C7HJGEmN.js → css-writer-B-J87ncv.js} +78 -17
- package/dist/css-writer-B-J87ncv.js.map +1 -0
- package/dist/{format-global-rules-Dbc_1tc3.js → format-global-rules-DklyaXv-.js} +1 -1
- package/dist/{format-global-rules-Dbc_1tc3.js.map → format-global-rules-DklyaXv-.js.map} +1 -1
- package/dist/{format-rules-BvokPr1L.js → format-rules-DKOA-6qu.js} +4 -17
- package/dist/format-rules-DKOA-6qu.js.map +1 -0
- package/dist/{hydrate-Dsv7Pwon.js → hydrate-OeMX99We.js} +3 -11
- package/dist/{hydrate-Dsv7Pwon.js.map → hydrate-OeMX99We.js.map} +1 -1
- package/dist/{index-dUtwpOux.d.ts → index-Cd45t5NM.d.ts} +319 -64
- package/dist/{index-ZRxZWzlj.d.ts → index-PqN-DIpn.d.ts} +498 -189
- package/dist/index.d.ts +5 -5
- package/dist/index.js +253 -63
- package/dist/index.js.map +1 -1
- package/dist/{keyframes-DDqRjwa9.js → keyframes-CV8azJf3.js} +97 -191
- package/dist/keyframes-CV8azJf3.js.map +1 -0
- package/dist/{merge-styles-CtDJMhpJ.d.ts → merge-styles-CU7JbEwg.d.ts} +2 -2
- package/dist/{merge-styles-B8jV6zu3.js → merge-styles-oklji0KB.js} +2 -2
- package/dist/{merge-styles-B8jV6zu3.js.map → merge-styles-oklji0KB.js.map} +1 -1
- package/dist/{resolve-recipes-BnTZz2I_.js → resolve-recipes-DTG81rzl.js} +3 -3
- package/dist/{resolve-recipes-BnTZz2I_.js.map → resolve-recipes-DTG81rzl.js.map} +1 -1
- package/dist/ssr/astro-client.js +1 -1
- package/dist/ssr/astro-client.js.map +1 -1
- package/dist/ssr/astro-middleware-static.d.ts +16 -0
- package/dist/ssr/astro-middleware-static.js +18 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +8 -6
- package/dist/ssr/astro-middleware.js +10 -10
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +2 -17
- package/dist/ssr/astro.js +29 -21
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -9
- package/dist/ssr/index.js +5 -5
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next.d.ts +2 -3
- package/dist/ssr/next.js +6 -7
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +2 -2
- package/dist/static/index.js +4 -4
- package/dist/static/index.js.map +1 -1
- package/dist/static/inject.js.map +1 -1
- package/dist/zero/babel.d.ts +2 -81
- package/dist/zero/babel.js +39 -27
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +16 -2
- package/dist/zero/index.js +2 -2
- package/dist/zero/next.d.ts +1 -1
- package/dist/zero/next.js +1 -1
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +12 -6
- package/docs/adoption.md +53 -28
- package/docs/ai-agents.md +224 -0
- package/docs/comparison.md +59 -30
- package/docs/configuration.md +498 -69
- package/docs/debug.md +7 -7
- package/docs/design-system.md +43 -24
- package/docs/dsl.md +510 -178
- package/docs/getting-started.md +55 -34
- package/docs/injector.md +58 -5
- package/docs/methodology.md +68 -36
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +93 -25
- package/docs/plugins.md +349 -0
- package/docs/react-api.md +162 -38
- package/docs/ssr.md +45 -35
- package/docs/styles.md +65 -16
- package/docs/tasty-static.md +25 -8
- package/package.json +43 -21
- package/tasty.config.ts +6 -0
- package/dist/collector-QwpPODsy.js.map +0 -1
- package/dist/config-rrijM-U2.js.map +0 -1
- package/dist/core-BvTG0J_M.js.map +0 -1
- package/dist/css-writer-C7HJGEmN.js.map +0 -1
- package/dist/format-rules-BvokPr1L.js.map +0 -1
- package/dist/keyframes-DDqRjwa9.js.map +0 -1
package/docs/debug.md
CHANGED
|
@@ -79,7 +79,7 @@ Retrieves CSS text for a given target. Logs the result with rule count and size.
|
|
|
79
79
|
**Extra options:**
|
|
80
80
|
|
|
81
81
|
```typescript
|
|
82
|
-
interface
|
|
82
|
+
interface CSSOptions extends DebugOptions {
|
|
83
83
|
prettify?: boolean; // Format output (default: true)
|
|
84
84
|
source?: boolean; // Read original CSS instead of live CSSOM (default: false, dev-mode only)
|
|
85
85
|
}
|
|
@@ -111,14 +111,14 @@ Inspects a DOM element and returns detailed information about its tasty styles,
|
|
|
111
111
|
```typescript
|
|
112
112
|
interface InspectResult {
|
|
113
113
|
element?: Element | null;
|
|
114
|
-
classes: string[];
|
|
115
|
-
chunks:
|
|
116
|
-
css: string;
|
|
117
|
-
size: number;
|
|
118
|
-
rules: number;
|
|
114
|
+
classes: string[]; // Tasty classes on the element
|
|
115
|
+
chunks: DebugChunkInfo[]; // Chunk assignment per class
|
|
116
|
+
css: string; // Prettified CSS
|
|
117
|
+
size: number; // CSS size in characters
|
|
118
|
+
rules: number; // Number of CSS rule blocks
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
interface
|
|
121
|
+
interface DebugChunkInfo {
|
|
122
122
|
className: string;
|
|
123
123
|
chunkName: string | null; // e.g., 'appearance', 'font', 'dimension'
|
|
124
124
|
}
|
package/docs/design-system.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Building a Design System
|
|
2
2
|
|
|
3
|
-
This guide
|
|
3
|
+
This guide shows how to build shared React components whose styles stay predictable as states, variants, themes, and responsive rules accumulate. You will define tokens, state aliases, recipes, primitive APIs, and compound components with sub-elements.
|
|
4
4
|
|
|
5
|
-
It assumes you have already decided to adopt Tasty. The goal is not
|
|
5
|
+
It assumes you have already decided to adopt Tasty. The goal is not only to centralize values, but to give your design system one state model and a governed component-facing styling API. For evaluation criteria and incremental rollout, see the [Adoption Guide](adoption.md). For the recommended component architecture, see [Methodology](methodology.md).
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -43,8 +43,8 @@ configure({
|
|
|
43
43
|
'#border': '#e0e0e0',
|
|
44
44
|
|
|
45
45
|
// Unit values
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
$gap: '8px',
|
|
47
|
+
$radius: '4px',
|
|
48
48
|
'$border-width': '1px',
|
|
49
49
|
'$outline-width': '2px',
|
|
50
50
|
},
|
|
@@ -91,8 +91,18 @@ import { configure } from '@tenphi/tasty';
|
|
|
91
91
|
|
|
92
92
|
configure({
|
|
93
93
|
presets: {
|
|
94
|
-
h1: {
|
|
95
|
-
|
|
94
|
+
h1: {
|
|
95
|
+
fontSize: '2rem',
|
|
96
|
+
lineHeight: '1.2',
|
|
97
|
+
letterSpacing: '-0.02em',
|
|
98
|
+
fontWeight: 700,
|
|
99
|
+
},
|
|
100
|
+
t2: {
|
|
101
|
+
fontSize: '0.875rem',
|
|
102
|
+
lineHeight: '1.5',
|
|
103
|
+
letterSpacing: 'normal',
|
|
104
|
+
fontWeight: 400,
|
|
105
|
+
},
|
|
96
106
|
},
|
|
97
107
|
});
|
|
98
108
|
```
|
|
@@ -117,14 +127,22 @@ Then use `preset: 'h1'` or `preset: 't2'` in any component's styles.
|
|
|
117
127
|
|
|
118
128
|
### Registering brand fonts
|
|
119
129
|
|
|
120
|
-
Register your design system's custom fonts via `configure({
|
|
130
|
+
Register your design system's custom fonts via `configure({ fontFaces })` so every component can reference them:
|
|
121
131
|
|
|
122
132
|
```ts
|
|
123
133
|
configure({
|
|
124
|
-
|
|
134
|
+
fontFaces: {
|
|
125
135
|
'Brand Sans': [
|
|
126
|
-
{
|
|
127
|
-
|
|
136
|
+
{
|
|
137
|
+
src: 'url("/fonts/brand-regular.woff2") format("woff2")',
|
|
138
|
+
fontWeight: 400,
|
|
139
|
+
fontDisplay: 'swap',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
src: 'url("/fonts/brand-bold.woff2") format("woff2")',
|
|
143
|
+
fontWeight: 700,
|
|
144
|
+
fontDisplay: 'swap',
|
|
145
|
+
},
|
|
128
146
|
],
|
|
129
147
|
},
|
|
130
148
|
});
|
|
@@ -144,7 +162,8 @@ configure({
|
|
|
144
162
|
'@mobile': '@media(w < 768px)',
|
|
145
163
|
'@tablet': '@media(768px <= w < 1024px)',
|
|
146
164
|
'@desktop': '@media(w >= 1024px)',
|
|
147
|
-
'@dark':
|
|
165
|
+
'@dark':
|
|
166
|
+
'@root(schema=dark) | (!@root(schema) & @media(prefers-color-scheme: dark))',
|
|
148
167
|
'@reduced-motion': '@media(prefers-reduced-motion: reduce)',
|
|
149
168
|
},
|
|
150
169
|
});
|
|
@@ -185,7 +204,7 @@ configure({
|
|
|
185
204
|
'input-reset': {
|
|
186
205
|
border: 'none',
|
|
187
206
|
outline: 'none',
|
|
188
|
-
fill: '
|
|
207
|
+
fill: '#clear',
|
|
189
208
|
font: true,
|
|
190
209
|
preset: 't3',
|
|
191
210
|
},
|
|
@@ -211,7 +230,7 @@ const ProfileCard = tasty({
|
|
|
211
230
|
});
|
|
212
231
|
```
|
|
213
232
|
|
|
214
|
-
Use the `/` separator when a recipe should be applied
|
|
233
|
+
Use the `/` separator when a recipe should be applied _after_ local styles (post-merge), so recipe states take priority:
|
|
215
234
|
|
|
216
235
|
```tsx
|
|
217
236
|
const Input = tasty({
|
|
@@ -283,12 +302,12 @@ Product engineers use these to compose layouts without writing CSS:
|
|
|
283
302
|
|
|
284
303
|
Match the prop set to the component's role:
|
|
285
304
|
|
|
286
|
-
| Component category
|
|
287
|
-
|
|
288
|
-
| Layout containers (`Space`, `Box`, `Grid`) | `FLOW_STYLES` — flow, gap, align, justify, padding, fill
|
|
289
|
-
| Positioned elements (`Button`, `Badge`)
|
|
290
|
-
| Text elements
|
|
291
|
-
| Compound components
|
|
305
|
+
| Component category | Recommended styleProps |
|
|
306
|
+
| ------------------------------------------ | -------------------------------------------------------------- |
|
|
307
|
+
| Layout containers (`Space`, `Box`, `Grid`) | `FLOW_STYLES` — flow, gap, align, justify, padding, fill |
|
|
308
|
+
| Positioned elements (`Button`, `Badge`) | `POSITION_STYLES` — placeSelf, gridArea, order |
|
|
309
|
+
| Text elements | `['preset', 'color']` or a custom subset |
|
|
310
|
+
| Compound components | Typically none — styling happens via sub-elements and wrapping |
|
|
292
311
|
|
|
293
312
|
Exposing too many props weakens the design system's constraints. See [Methodology — styleProps as the public API](methodology.md#styleprops-as-the-public-api) for the rationale.
|
|
294
313
|
|
|
@@ -335,9 +354,7 @@ Usage:
|
|
|
335
354
|
```tsx
|
|
336
355
|
<Card>
|
|
337
356
|
<Card.Title>Monthly Revenue</Card.Title>
|
|
338
|
-
<Card.Content>
|
|
339
|
-
$1.2M — up 12% from last month.
|
|
340
|
-
</Card.Content>
|
|
357
|
+
<Card.Content>$1.2M — up 12% from last month.</Card.Content>
|
|
341
358
|
<Card.Footer>
|
|
342
359
|
<Button>Details</Button>
|
|
343
360
|
</Card.Footer>
|
|
@@ -365,13 +382,15 @@ A design system works best when the rules for customization are explicit. Tasty
|
|
|
365
382
|
2. **Use modProps** — control component states through typed props instead of `mods`:
|
|
366
383
|
|
|
367
384
|
```tsx
|
|
368
|
-
<Button isLoading size="large">
|
|
385
|
+
<Button isLoading size="large">
|
|
386
|
+
Submit
|
|
387
|
+
</Button>
|
|
369
388
|
```
|
|
370
389
|
|
|
371
390
|
3. **Pass tokens** — inject runtime values through the `tokens` prop for per-instance customization:
|
|
372
391
|
|
|
373
392
|
```tsx
|
|
374
|
-
<ProgressBar tokens={{
|
|
393
|
+
<ProgressBar tokens={{ $progress: `${percent}%` }} />
|
|
375
394
|
```
|
|
376
395
|
|
|
377
396
|
4. **Create styled wrappers** — extend a component's styles with `tasty(Base, { styles })`:
|