@tenphi/tasty 3.3.0 → 3.3.1

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.
Files changed (31) hide show
  1. package/dist/{collector-BNQJyxFh.js → collector-BKqNBmzA.js} +3 -3
  2. package/dist/{collector-BNQJyxFh.js.map → collector-BKqNBmzA.js.map} +1 -1
  3. package/dist/{config-zkrtb424.js → config-BCdCTIED.js} +5 -4
  4. package/dist/config-BCdCTIED.js.map +1 -0
  5. package/dist/core/index.js +5 -5
  6. package/dist/{core-Bf48Z1I-.js → core-wxP3GHQu.js} +5 -5
  7. package/dist/{core-Bf48Z1I-.js.map → core-wxP3GHQu.js.map} +1 -1
  8. package/dist/{css-writer-B-SvwNbq.js → css-writer-D64NY9AX.js} +3 -3
  9. package/dist/{css-writer-B-SvwNbq.js.map → css-writer-D64NY9AX.js.map} +1 -1
  10. package/dist/{format-rules-Co21uwA3.js → format-rules-Bo_e2u7r.js} +2 -2
  11. package/dist/{format-rules-Co21uwA3.js.map → format-rules-Bo_e2u7r.js.map} +1 -1
  12. package/dist/{hydrate-D38TyhAG.js → hydrate-CMKOuKAx.js} +2 -2
  13. package/dist/{hydrate-D38TyhAG.js.map → hydrate-CMKOuKAx.js.map} +1 -1
  14. package/dist/index.js +6 -6
  15. package/dist/{keyframes-mDAB6pLf.js → keyframes-D737PShJ.js} +2 -2
  16. package/dist/{keyframes-mDAB6pLf.js.map → keyframes-D737PShJ.js.map} +1 -1
  17. package/dist/{merge-styles-CFwtEHzv.js → merge-styles-CUIQcs5v.js} +2 -2
  18. package/dist/{merge-styles-CFwtEHzv.js.map → merge-styles-CUIQcs5v.js.map} +1 -1
  19. package/dist/{resolve-recipes-B8pIVinB.js → resolve-recipes-Df1Ta-Q0.js} +3 -3
  20. package/dist/{resolve-recipes-B8pIVinB.js.map → resolve-recipes-Df1Ta-Q0.js.map} +1 -1
  21. package/dist/ssr/astro-client.js +1 -1
  22. package/dist/ssr/astro.js +3 -3
  23. package/dist/ssr/index.js +3 -3
  24. package/dist/ssr/next.js +4 -4
  25. package/dist/static/index.js +1 -1
  26. package/dist/zero/babel.js +4 -4
  27. package/dist/zero/index.js +1 -1
  28. package/docs/dsl.md +28 -15
  29. package/docs/styles.md +8 -6
  30. package/package.json +1 -1
  31. package/dist/config-zkrtb424.js.map +0 -1
package/dist/ssr/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { a as registerSSRCollectorGetterGlobal } from "../format-rules-Co21uwA3.js";
2
- import { n as createServerStyleCollector, t as ServerStyleCollector } from "../collector-BNQJyxFh.js";
1
+ import { a as registerSSRCollectorGetterGlobal } from "../format-rules-Bo_e2u7r.js";
2
+ import { n as createServerStyleCollector, t as ServerStyleCollector } from "../collector-BKqNBmzA.js";
3
3
  import { n as runWithCollector, t as getSSRCollector } from "../async-storage-DKK-wTD4.js";
4
- import { t as hydrateTastyClasses } from "../hydrate-D38TyhAG.js";
4
+ import { t as hydrateTastyClasses } from "../hydrate-CMKOuKAx.js";
5
5
  //#region src/ssr/index.ts
6
6
  registerSSRCollectorGetterGlobal(getSSRCollector);
7
7
  //#endregion
package/dist/ssr/next.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { n as getConfig } from "../config-zkrtb424.js";
3
- import { i as registerSSRCollectorGetter } from "../format-rules-Co21uwA3.js";
2
+ import { n as getConfig } from "../config-BCdCTIED.js";
3
+ import { i as registerSSRCollectorGetter } from "../format-rules-Bo_e2u7r.js";
4
4
  import { t as getTastySSRContext } from "../context-CA8YKeMn.js";
5
- import { t as ServerStyleCollector } from "../collector-BNQJyxFh.js";
6
- import { t as hydrateTastyClasses } from "../hydrate-D38TyhAG.js";
5
+ import { t as ServerStyleCollector } from "../collector-BKqNBmzA.js";
6
+ import { t as hydrateTastyClasses } from "../hydrate-CMKOuKAx.js";
7
7
  import { Fragment, createElement, useState } from "react";
8
8
  import { useServerInsertedHTML } from "next/navigation";
9
9
  //#region src/ssr/next.ts
@@ -1,4 +1,4 @@
1
- import { t as mergeStyles } from "../merge-styles-CFwtEHzv.js";
1
+ import { t as mergeStyles } from "../merge-styles-CUIQcs5v.js";
2
2
  //#region src/static/types.ts
3
3
  /**
4
4
  * Create a StaticStyle object.
@@ -1,7 +1,7 @@
1
- import { b as resetConfig, d as getGlobalStyles, i as getGlobalConfigTokens, s as getGlobalFunctions, t as configure } from "../config-zkrtb424.js";
2
- import { t as mergeStyles } from "../merge-styles-CFwtEHzv.js";
3
- import { t as resolveRecipes } from "../resolve-recipes-B8pIVinB.js";
4
- import { a as extractFunctionsFromStyles, c as extractStylesForSelector, i as extractFontFaceFromStyles, l as extractStylesWithChunks, o as extractKeyframesFromStyles, r as extractCounterStyleFromStyles, s as extractPropertiesFromStyles, t as CSSWriter, u as setExtractorNamePrefix } from "../css-writer-B-SvwNbq.js";
1
+ import { b as resetConfig, d as getGlobalStyles, i as getGlobalConfigTokens, s as getGlobalFunctions, t as configure } from "../config-BCdCTIED.js";
2
+ import { t as mergeStyles } from "../merge-styles-CUIQcs5v.js";
3
+ import { t as resolveRecipes } from "../resolve-recipes-Df1Ta-Q0.js";
4
+ import { a as extractFunctionsFromStyles, c as extractStylesForSelector, i as extractFontFaceFromStyles, l as extractStylesWithChunks, o as extractKeyframesFromStyles, r as extractCounterStyleFromStyles, s as extractPropertiesFromStyles, t as CSSWriter, u as setExtractorNamePrefix } from "../css-writer-D64NY9AX.js";
5
5
  import * as fs from "fs";
6
6
  import * as path from "path";
7
7
  import { declare } from "@babel/helper-plugin-utils";
@@ -1,2 +1,2 @@
1
- import { c as extractStylesForSelector, l as extractStylesWithChunks, n as createCSSWriter, t as CSSWriter } from "../css-writer-B-SvwNbq.js";
1
+ import { c as extractStylesForSelector, l as extractStylesWithChunks, n as createCSSWriter, t as CSSWriter } from "../css-writer-D64NY9AX.js";
2
2
  export { CSSWriter, createCSSWriter, extractStylesForSelector, extractStylesWithChunks };
package/docs/dsl.md CHANGED
@@ -134,7 +134,7 @@ color: '#purple', // Full opacity
134
134
  color: '#purple.5', // 50% opacity
135
135
  color: '#purple.05', // 5% opacity
136
136
  color: '#purple.$fade', // Opacity from a custom property
137
- fill: '#current', // → var(--current-color)
137
+ fill: '#current', // → currentcolor
138
138
  color: '(#primary, #secondary)', // Fallback syntax
139
139
  ```
140
140
 
@@ -163,27 +163,40 @@ Two properties follow from writing the alpha slot rather than compositing:
163
163
  `/ var(--fade)` unchanged, so it works whether `$fade` holds `.5` or `50%` —
164
164
  which is what `--*-opacity` properties are registered to accept.
165
165
 
166
- ### Why `#current` is a variable
166
+ ### `#current` is the keyword
167
167
 
168
- `#current` emits `var(--current-color)`, not the `currentcolor` keyword. The
169
- `color` style publishes `--current-color` alongside every color it sets, and the
170
- property is registered with `initial-value: currentcolor` so where nothing has
171
- published it, the variable resolves against each element's own inherited color
172
- and is indistinguishable from the keyword.
168
+ `#current` emits the `currentcolor` keyword, so it resolves against the element
169
+ that reads it. That is what lets it follow a color an ancestor faded — a ramp
170
+ that expresses its disabled state once, in `color`, fades everything painted from
171
+ `#current` below it with no further declarations.
173
172
 
174
- The difference shows when a token is *defined* as `#current` and then faded:
173
+ The `color` style also publishes `--current-color` beside every color it sets,
174
+ for anything that needs the inherited color *as a color* rather than as the
175
+ keyword — hand-authored CSS, or a place the keyword will not do. Read it as
176
+ `$current-color`. It is registered with `initial-value: currentcolor`, so where
177
+ nothing published it, it still resolves against each element's own color:
178
+
179
+ ```jsx
180
+ fill: '$current-color'; // → var(--current-color)
181
+ ```
182
+
183
+ A color that already reads the color it inherits — `#current`, a `#current` fade
184
+ — is not published into it: resolving such a value a second time at a descendant
185
+ would fade it twice.
186
+
187
+ One case needs the wider floor to be considered. A token *defined* as `#current`
188
+ and then faded gives relative color syntax a `currentcolor` origin, which Safari
189
+ supports only from 18:
175
190
 
176
191
  ```jsx
177
192
  { '#ink': '#current', fill: '#ink.5' }
178
- // --ink-color: var(--current-color) → a concrete color where one was published
179
- // fill: oklch(from var(--ink-color) l c h / .5)
193
+ // --ink-color: currentcolor
194
+ // fill: oklch(from currentcolor l c h / .5) → Chrome, Firefox, Safari 18+
180
195
  ```
181
196
 
182
- Relative color syntax accepts a concrete origin from Safari 16.4, while
183
- `oklch(from currentcolor …)` needs Safari 18. Resolving through the variable is
184
- what keeps that token fadeable on the wider floor. Where no `color` style
185
- published the variable, the origin is the keyword again and the Safari 18 floor
186
- applies to that case alone.
197
+ Put the fade in the token instead `{ '#ink': '#current.5' }` — and it goes
198
+ through `color-mix()`, which works from Safari 16.2 and composes like every other
199
+ `#current` fade.
187
200
 
188
201
  ### `#current` composes instead
189
202
 
package/docs/styles.md CHANGED
@@ -290,12 +290,14 @@ Text color with design token support.
290
290
  | `"light-dark(#dark, #light)"` | CSS color function — see [CSS Color Functions](dsl.md#css-color-functions) |
291
291
  | `true` | `currentColor` |
292
292
 
293
- Also sets `$current-color` to the same color, which is what `#current` resolves
294
- through. Every color publishes it, not just a named token, so a descendant's
295
- `#current` always reads the nearest `color` rather than the nearest *token*
296
- color. A value that already reads the inherited color — `#current` itself, a
297
- `#current` fade, a bare `currentColor` — is not republished: that would be a
298
- self-reference, or would resolve a second time one level down.
293
+ Also sets `$current-color` to the same color, for anything that needs the
294
+ inherited color as a color rather than as the `currentcolor` keyword. Every color
295
+ publishes it, not just a named token, so a reader below always takes the nearest
296
+ `color` rather than the nearest *token* color. A value that already reads the
297
+ inherited color — `#current` itself, a `#current` fade, a bare `currentColor` —
298
+ is not republished: resolving it a second time one level down would fade it
299
+ twice, and the variable into itself is a self-reference. `#current` does not go
300
+ through it; it is the keyword.
299
301
 
300
302
  ### `svgFill`
301
303
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/tasty",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "A design-system-integrated styling system and DSL for concise, state-aware UI styling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",