@tenphi/tasty 0.0.0-snapshot.01d8a9e → 0.0.0-snapshot.047dfbb
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 +13 -8
- package/dist/{ssr/async-storage.js → async-storage-DKK-wTD4.js} +2 -2
- package/dist/async-storage-DKK-wTD4.js.map +1 -0
- package/dist/{ssr/collector.d.ts → collector-CddJZDOr.d.ts} +17 -3
- package/dist/{ssr/collector.js → collector-J6LwZR0N.js} +53 -43
- package/dist/collector-J6LwZR0N.js.map +1 -0
- package/dist/config-C3F4Ogo1.js +10993 -0
- package/dist/config-C3F4Ogo1.js.map +1 -0
- package/dist/config-C3SKYuxY.d.ts +945 -0
- package/dist/{ssr/context.js → context-CA8YKeMn.js} +11 -3
- package/dist/context-CA8YKeMn.js.map +1 -0
- package/dist/core/index.d.ts +5 -34
- package/dist/core/index.js +6 -27
- package/dist/core-DxHmF6S9.js +1598 -0
- package/dist/core-DxHmF6S9.js.map +1 -0
- package/dist/{zero/extractor.js → css-writer-IC7tdnIf.js} +98 -13
- package/dist/css-writer-IC7tdnIf.js.map +1 -0
- package/dist/{ssr/format-global-rules.js → format-global-rules-DklyaXv-.js} +2 -2
- package/dist/format-global-rules-DklyaXv-.js.map +1 -0
- package/dist/format-rules-DTLY39Hm.js +143 -0
- package/dist/format-rules-DTLY39Hm.js.map +1 -0
- package/dist/{ssr/hydrate.js → hydrate-8Zglgy_C.js} +3 -3
- package/dist/hydrate-8Zglgy_C.js.map +1 -0
- package/dist/index-ByBYTH9l.d.ts +1778 -0
- package/dist/index-C5owZ15q.d.ts +1293 -0
- package/dist/index.d.ts +5 -51
- package/dist/index.js +732 -36
- package/dist/index.js.map +1 -0
- package/dist/keyframes-DgGkipNK.js +595 -0
- package/dist/keyframes-DgGkipNK.js.map +1 -0
- package/dist/{utils/merge-styles.js → merge-styles-CAdKaHxh.js} +3 -4
- package/dist/merge-styles-CAdKaHxh.js.map +1 -0
- package/dist/{utils/merge-styles.d.ts → merge-styles-CvUi7SOD.d.ts} +3 -3
- package/dist/{utils/resolve-recipes.js → resolve-recipes-BQNdunBd.js} +4 -6
- package/dist/resolve-recipes-BQNdunBd.js.map +1 -0
- package/dist/ssr/astro-client.js +1 -1
- package/dist/ssr/astro-client.js.map +1 -1
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +1 -12
- package/dist/ssr/astro.js +7 -9
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/index.d.ts +44 -4
- package/dist/ssr/index.js +4 -4
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next.d.ts +2 -3
- package/dist/ssr/next.js +6 -6
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +91 -5
- package/dist/static/index.js +49 -3
- package/dist/static/index.js.map +1 -0
- package/dist/static/inject.js.map +1 -1
- package/dist/zero/babel.d.ts +2 -3
- package/dist/zero/babel.js +22 -10
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +67 -3
- package/dist/zero/index.js +1 -2
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +2 -2
- package/docs/configuration.md +44 -0
- package/docs/debug.md +11 -9
- package/docs/dsl.md +124 -13
- package/docs/injector.md +2 -2
- package/docs/methodology.md +26 -0
- package/docs/pipeline.md +744 -0
- package/docs/react-api.md +24 -0
- package/docs/ssr.md +5 -3
- package/docs/styles.md +25 -8
- package/docs/tasty-static.md +15 -0
- package/package.json +22 -12
- package/tasty.config.ts +2 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/chunks/cacheKey.d.ts +0 -1
- package/dist/chunks/cacheKey.js +0 -77
- package/dist/chunks/cacheKey.js.map +0 -1
- package/dist/chunks/definitions.d.ts +0 -37
- package/dist/chunks/definitions.js +0 -258
- package/dist/chunks/definitions.js.map +0 -1
- package/dist/chunks/index.d.ts +0 -1
- package/dist/chunks/renderChunk.d.ts +0 -1
- package/dist/chunks/renderChunk.js +0 -59
- package/dist/chunks/renderChunk.js.map +0 -1
- package/dist/compute-styles.d.ts +0 -31
- package/dist/compute-styles.js +0 -336
- package/dist/compute-styles.js.map +0 -1
- package/dist/config.d.ts +0 -407
- package/dist/config.js +0 -591
- package/dist/config.js.map +0 -1
- package/dist/counter-style/index.js +0 -51
- package/dist/counter-style/index.js.map +0 -1
- package/dist/debug.d.ts +0 -89
- package/dist/debug.js +0 -453
- package/dist/debug.js.map +0 -1
- package/dist/font-face/index.js +0 -63
- package/dist/font-face/index.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/useCounterStyle.d.ts +0 -36
- package/dist/hooks/useCounterStyle.js +0 -65
- package/dist/hooks/useCounterStyle.js.map +0 -1
- package/dist/hooks/useFontFace.d.ts +0 -45
- package/dist/hooks/useFontFace.js +0 -66
- package/dist/hooks/useFontFace.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -46
- package/dist/hooks/useGlobalStyles.js +0 -88
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -58
- package/dist/hooks/useKeyframes.js +0 -55
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -81
- package/dist/hooks/useProperty.js +0 -96
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -22
- package/dist/hooks/useRawCSS.js +0 -103
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -40
- package/dist/hooks/useStyles.js +0 -31
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -182
- package/dist/injector/index.js +0 -185
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -198
- package/dist/injector/injector.js +0 -651
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -132
- package/dist/injector/sheet-manager.js +0 -699
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -235
- package/dist/keyframes/index.js +0 -206
- package/dist/keyframes/index.js.map +0 -1
- package/dist/parser/classify.js +0 -319
- package/dist/parser/classify.js.map +0 -1
- package/dist/parser/const.js +0 -60
- package/dist/parser/const.js.map +0 -1
- package/dist/parser/lru.js +0 -109
- package/dist/parser/lru.js.map +0 -1
- package/dist/parser/parser.d.ts +0 -25
- package/dist/parser/parser.js +0 -115
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/tokenizer.js +0 -69
- package/dist/parser/tokenizer.js.map +0 -1
- package/dist/parser/types.d.ts +0 -51
- package/dist/parser/types.js +0 -46
- package/dist/parser/types.js.map +0 -1
- package/dist/pipeline/conditions.d.ts +0 -134
- package/dist/pipeline/conditions.js +0 -406
- package/dist/pipeline/conditions.js.map +0 -1
- package/dist/pipeline/exclusive.js +0 -283
- package/dist/pipeline/exclusive.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -55
- package/dist/pipeline/index.js +0 -708
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -1157
- package/dist/pipeline/materialize.js.map +0 -1
- package/dist/pipeline/parseStateKey.d.ts +0 -15
- package/dist/pipeline/parseStateKey.js +0 -446
- package/dist/pipeline/parseStateKey.js.map +0 -1
- package/dist/pipeline/simplify.js +0 -690
- package/dist/pipeline/simplify.js.map +0 -1
- package/dist/pipeline/warnings.js +0 -18
- package/dist/pipeline/warnings.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -2
- package/dist/plugins/okhsl-plugin.d.ts +0 -35
- package/dist/plugins/okhsl-plugin.js +0 -97
- package/dist/plugins/okhsl-plugin.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -87
- package/dist/properties/index.js +0 -222
- package/dist/properties/index.js.map +0 -1
- package/dist/properties/property-type-resolver.d.ts +0 -24
- package/dist/properties/property-type-resolver.js +0 -90
- package/dist/properties/property-type-resolver.js.map +0 -1
- package/dist/rsc-cache.js +0 -79
- package/dist/rsc-cache.js.map +0 -1
- package/dist/ssr/async-storage.d.ts +0 -17
- package/dist/ssr/async-storage.js.map +0 -1
- package/dist/ssr/collect-auto-properties.js +0 -58
- package/dist/ssr/collect-auto-properties.js.map +0 -1
- package/dist/ssr/collector.js.map +0 -1
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/format-global-rules.js.map +0 -1
- package/dist/ssr/format-keyframes.js +0 -69
- package/dist/ssr/format-keyframes.js.map +0 -1
- package/dist/ssr/format-property.js +0 -49
- package/dist/ssr/format-property.js.map +0 -1
- package/dist/ssr/format-rules.js +0 -73
- package/dist/ssr/format-rules.js.map +0 -1
- package/dist/ssr/hydrate.d.ts +0 -29
- package/dist/ssr/hydrate.js.map +0 -1
- package/dist/ssr/ssr-collector-ref.js +0 -29
- package/dist/ssr/ssr-collector-ref.js.map +0 -1
- package/dist/states/index.d.ts +0 -49
- package/dist/states/index.js +0 -170
- package/dist/states/index.js.map +0 -1
- package/dist/static/tastyStatic.d.ts +0 -46
- package/dist/static/tastyStatic.js +0 -30
- package/dist/static/tastyStatic.js.map +0 -1
- package/dist/static/types.d.ts +0 -49
- package/dist/static/types.js +0 -24
- package/dist/static/types.js.map +0 -1
- package/dist/styles/border.d.ts +0 -25
- package/dist/styles/border.js +0 -120
- package/dist/styles/border.js.map +0 -1
- package/dist/styles/color.d.ts +0 -14
- package/dist/styles/color.js +0 -26
- package/dist/styles/color.js.map +0 -1
- package/dist/styles/const.js +0 -17
- package/dist/styles/const.js.map +0 -1
- package/dist/styles/createStyle.js +0 -79
- package/dist/styles/createStyle.js.map +0 -1
- package/dist/styles/dimension.js +0 -109
- package/dist/styles/dimension.js.map +0 -1
- package/dist/styles/directional.js +0 -133
- package/dist/styles/directional.js.map +0 -1
- package/dist/styles/display.d.ts +0 -30
- package/dist/styles/display.js +0 -73
- package/dist/styles/display.js.map +0 -1
- package/dist/styles/fade.d.ts +0 -15
- package/dist/styles/fade.js +0 -62
- package/dist/styles/fade.js.map +0 -1
- package/dist/styles/fill.d.ts +0 -42
- package/dist/styles/fill.js +0 -51
- package/dist/styles/fill.js.map +0 -1
- package/dist/styles/flow.d.ts +0 -16
- package/dist/styles/flow.js +0 -12
- package/dist/styles/flow.js.map +0 -1
- package/dist/styles/gap.d.ts +0 -31
- package/dist/styles/gap.js +0 -38
- package/dist/styles/gap.js.map +0 -1
- package/dist/styles/height.d.ts +0 -17
- package/dist/styles/height.js +0 -19
- package/dist/styles/height.js.map +0 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +0 -8
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/inset.d.ts +0 -24
- package/dist/styles/inset.js +0 -34
- package/dist/styles/inset.js.map +0 -1
- package/dist/styles/list.d.ts +0 -16
- package/dist/styles/list.js +0 -100
- package/dist/styles/list.js.map +0 -1
- package/dist/styles/margin.d.ts +0 -24
- package/dist/styles/margin.js +0 -32
- package/dist/styles/margin.js.map +0 -1
- package/dist/styles/outline.d.ts +0 -29
- package/dist/styles/outline.js +0 -55
- package/dist/styles/outline.js.map +0 -1
- package/dist/styles/padding.d.ts +0 -24
- package/dist/styles/padding.js +0 -32
- package/dist/styles/padding.js.map +0 -1
- package/dist/styles/placement.d.ts +0 -37
- package/dist/styles/placement.js +0 -74
- package/dist/styles/placement.js.map +0 -1
- package/dist/styles/predefined.d.ts +0 -71
- package/dist/styles/predefined.js +0 -237
- package/dist/styles/predefined.js.map +0 -1
- package/dist/styles/preset.d.ts +0 -52
- package/dist/styles/preset.js +0 -127
- package/dist/styles/preset.js.map +0 -1
- package/dist/styles/radius.d.ts +0 -12
- package/dist/styles/radius.js +0 -83
- package/dist/styles/radius.js.map +0 -1
- package/dist/styles/scrollMargin.d.ts +0 -24
- package/dist/styles/scrollMargin.js +0 -32
- package/dist/styles/scrollMargin.js.map +0 -1
- package/dist/styles/scrollbar.d.ts +0 -25
- package/dist/styles/scrollbar.js +0 -51
- package/dist/styles/scrollbar.js.map +0 -1
- package/dist/styles/shadow.d.ts +0 -14
- package/dist/styles/shadow.js +0 -25
- package/dist/styles/shadow.js.map +0 -1
- package/dist/styles/shared.js +0 -17
- package/dist/styles/shared.js.map +0 -1
- package/dist/styles/transition.d.ts +0 -14
- package/dist/styles/transition.js +0 -159
- package/dist/styles/transition.js.map +0 -1
- package/dist/styles/types.d.ts +0 -564
- package/dist/styles/width.d.ts +0 -17
- package/dist/styles/width.js +0 -19
- package/dist/styles/width.js.map +0 -1
- package/dist/tasty.d.ts +0 -134
- package/dist/tasty.js +0 -248
- package/dist/tasty.js.map +0 -1
- package/dist/types.d.ts +0 -184
- package/dist/utils/cache-wrapper.js +0 -21
- package/dist/utils/cache-wrapper.js.map +0 -1
- package/dist/utils/case-converter.js +0 -8
- package/dist/utils/case-converter.js.map +0 -1
- package/dist/utils/color-math.d.ts +0 -46
- package/dist/utils/color-math.js +0 -749
- package/dist/utils/color-math.js.map +0 -1
- package/dist/utils/color-space.d.ts +0 -5
- package/dist/utils/color-space.js +0 -228
- package/dist/utils/color-space.js.map +0 -1
- package/dist/utils/colors.d.ts +0 -5
- package/dist/utils/colors.js +0 -10
- package/dist/utils/colors.js.map +0 -1
- package/dist/utils/css-types.d.ts +0 -7
- package/dist/utils/deps-equal.js +0 -15
- package/dist/utils/deps-equal.js.map +0 -1
- package/dist/utils/dotize.d.ts +0 -26
- package/dist/utils/dotize.js +0 -122
- package/dist/utils/dotize.js.map +0 -1
- package/dist/utils/filter-base-props.d.ts +0 -15
- package/dist/utils/filter-base-props.js +0 -45
- package/dist/utils/filter-base-props.js.map +0 -1
- package/dist/utils/get-display-name.d.ts +0 -7
- package/dist/utils/get-display-name.js +0 -10
- package/dist/utils/get-display-name.js.map +0 -1
- package/dist/utils/has-keys.js +0 -13
- package/dist/utils/has-keys.js.map +0 -1
- package/dist/utils/hash.js +0 -14
- package/dist/utils/hash.js.map +0 -1
- package/dist/utils/is-dev-env.js +0 -19
- package/dist/utils/is-dev-env.js.map +0 -1
- package/dist/utils/is-valid-element-type.js +0 -15
- package/dist/utils/is-valid-element-type.js.map +0 -1
- package/dist/utils/merge-styles.js.map +0 -1
- package/dist/utils/mod-attrs.d.ts +0 -6
- package/dist/utils/mod-attrs.js +0 -20
- package/dist/utils/mod-attrs.js.map +0 -1
- package/dist/utils/process-tokens.d.ts +0 -17
- package/dist/utils/process-tokens.js +0 -83
- package/dist/utils/process-tokens.js.map +0 -1
- package/dist/utils/resolve-recipes.d.ts +0 -17
- package/dist/utils/resolve-recipes.js.map +0 -1
- package/dist/utils/selector-transform.js +0 -32
- package/dist/utils/selector-transform.js.map +0 -1
- package/dist/utils/string.js +0 -8
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -99
- package/dist/utils/styles.js +0 -220
- package/dist/utils/styles.js.map +0 -1
- package/dist/utils/typography.d.ts +0 -58
- package/dist/utils/typography.js +0 -51
- package/dist/utils/typography.js.map +0 -1
- package/dist/utils/warnings.d.ts +0 -16
- package/dist/utils/warnings.js +0 -16
- package/dist/utils/warnings.js.map +0 -1
- package/dist/zero/css-writer.d.ts +0 -45
- package/dist/zero/css-writer.js +0 -73
- package/dist/zero/css-writer.js.map +0 -1
- package/dist/zero/extractor.d.ts +0 -24
- package/dist/zero/extractor.js.map +0 -1
- package/docs/PIPELINE.md +0 -519
package/docs/react-api.md
CHANGED
|
@@ -42,6 +42,30 @@ const PrimaryButton = tasty(Button, {
|
|
|
42
42
|
|
|
43
43
|
Style maps merge intelligently — see [Style DSL — Extending vs. Replacing State Maps](dsl.md#extending-vs-replacing-state-maps) for extend mode, replace mode, `@inherit`, `null`, and `false` tombstones.
|
|
44
44
|
|
|
45
|
+
`tasty(Component, ...)` always wraps `Component` and forwards every prop to it, so `Component` must be Tasty-aware (i.e. it accepts `styles`, `mods`, `qa`, etc. and renders them through its own Tasty pipeline). To apply styles to a third-party component or a string DOM tag via `className`, use the options-only form with `as`:
|
|
46
|
+
|
|
47
|
+
```jsx
|
|
48
|
+
import NextLink from 'next/link';
|
|
49
|
+
|
|
50
|
+
const Link = tasty({
|
|
51
|
+
as: NextLink,
|
|
52
|
+
styles: {
|
|
53
|
+
color: { '': '#accent-text', ':hover': '#text' },
|
|
54
|
+
textDecoration: 'underline',
|
|
55
|
+
},
|
|
56
|
+
styleProps: ['padding'],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const Span = tasty({
|
|
60
|
+
as: 'span',
|
|
61
|
+
styles: { fontWeight: 'bold' },
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
<Link href="/blog" padding="1x">Blog</Link>;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The wrapped component only needs to forward `className` (and ideally `style`/`ref`). Tasty-specific props (`qa`, `qaVal`, `mods`, `tokens`, `styleProps`, `modProps`, `tokenProps`) are consumed by Tasty and never leak to the DOM.
|
|
68
|
+
|
|
45
69
|
---
|
|
46
70
|
|
|
47
71
|
## Style Props
|
package/docs/ssr.md
CHANGED
|
@@ -358,16 +358,18 @@ const stream = await runWithCollector(collector, () =>
|
|
|
358
358
|
|
|
359
359
|
Server-safe style collector. One instance per request.
|
|
360
360
|
|
|
361
|
+
Constructor: `new ServerStyleCollector(namePrefix?)`. The optional `namePrefix` overrides the value from `configure({ namePrefix })`; in normal usage you pass nothing and let the global config drive it. See [Configuration: Name prefix](configuration.md#name-prefix).
|
|
362
|
+
|
|
361
363
|
| Method | Description |
|
|
362
364
|
|---|---|
|
|
363
|
-
| `allocateClassName(cacheKey)` | Allocate a
|
|
365
|
+
| `allocateClassName(cacheKey)` | Allocate a deterministic, content-hashed class name for a cache key (e.g. `t1a2b3` with the default prefix). The same `cacheKey` always produces the same class name on server and client when both share the same `namePrefix`. Returns `{ className, isNewAllocation }`. |
|
|
364
366
|
| `collectChunk(cacheKey, className, rules)` | Record CSS rules for a chunk. Deduplicated by `cacheKey`. |
|
|
365
367
|
| `collectKeyframes(name, css)` | Record a `@keyframes` rule. Deduplicated by name. |
|
|
366
|
-
| `allocateKeyframeName(providedName?)` | Allocate a keyframe name. Returns `providedName` if given, otherwise generates one (`
|
|
368
|
+
| `allocateKeyframeName(providedName?)` | Allocate a keyframe name. Returns `providedName` if given, otherwise generates one using `${namePrefix}k${counter}` (e.g. `tk0`, `tk1`, ...). |
|
|
367
369
|
| `collectProperty(name, css)` | Record a `@property` rule. Deduplicated by name. |
|
|
368
370
|
| `collectFontFace(key, css)` | Record a `@font-face` rule. Deduplicated by content hash. |
|
|
369
371
|
| `collectCounterStyle(name, css)` | Record a `@counter-style` rule. Deduplicated by name. |
|
|
370
|
-
| `allocateCounterStyleName(providedName?)` | Allocate a counter-style name. Returns `providedName` if given, otherwise generates one (`
|
|
372
|
+
| `allocateCounterStyleName(providedName?)` | Allocate a counter-style name. Returns `providedName` if given, otherwise generates one using `${namePrefix}c${counter}` (e.g. `tc0`, `tc1`, ...). |
|
|
371
373
|
| `collectGlobalStyles(key, css)` | Record global styles (from `useGlobalStyles`). Deduplicated by key. |
|
|
372
374
|
| `collectRawCSS(key, css)` | Record raw CSS text (from `useRawCSS`). Deduplicated by key. |
|
|
373
375
|
| `collectInternals()` | Collect internal `@property` rules, `:root` token defaults, `@font-face`, and `@counter-style` rules from the global config. Called automatically on first chunk collection; idempotent. |
|
package/docs/styles.md
CHANGED
|
@@ -195,6 +195,10 @@ Positioning offsets with directional modifiers and multi-group support. Same dir
|
|
|
195
195
|
|
|
196
196
|
**Direction modifiers:** `top`, `right`, `bottom`, `left`
|
|
197
197
|
|
|
198
|
+
**`dock` modifier:** pins the named edge and spans its full length, by also applying the value
|
|
199
|
+
to the two perpendicular sides. `inset: 'bottom dock'` gives `inset: auto 0 0 0` — anchored to
|
|
200
|
+
the bottom, full width. Without a direction, `dock` fills every side.
|
|
201
|
+
|
|
198
202
|
**Output modifier:** `longhand` — forces output as individual CSS properties (`top`, `right`, `bottom`, `left`) instead of the `inset` shorthand.
|
|
199
203
|
|
|
200
204
|
| Value | Effect |
|
|
@@ -205,6 +209,10 @@ Positioning offsets with directional modifiers and multi-group support. Same dir
|
|
|
205
209
|
| `"0, 2x top"` | All sides `0`, then top overridden to `2x` |
|
|
206
210
|
| `"0 longhand"` | All sides `0`, output as individual `top`/`right`/`bottom`/`left` |
|
|
207
211
|
| `true` | All sides `0` |
|
|
212
|
+
| `"bottom dock"` | Bottom/left/right `0`, top `auto` — bottom-anchored, full width |
|
|
213
|
+
| `"right dock"` | Right/top/bottom `0`, left `auto` — right-anchored, full height |
|
|
214
|
+
| `"2x bottom dock"` | Bottom/left/right `2x`, top `auto` |
|
|
215
|
+
| `"dock"` | All sides `0` |
|
|
208
216
|
|
|
209
217
|
Later comma-separated groups override earlier groups for conflicting directions.
|
|
210
218
|
|
|
@@ -319,7 +327,11 @@ Border radius with shape presets and directional modifiers.
|
|
|
319
327
|
| `"backleaf"` | Asymmetric: round, sharp, round, sharp |
|
|
320
328
|
| `"inherit"` | Inherit border-radius from parent |
|
|
321
329
|
|
|
322
|
-
**
|
|
330
|
+
**Edge modifiers:** `top`, `right`, `bottom`, `left` — rounds the *pair* of corners along that edge.
|
|
331
|
+
|
|
332
|
+
**Corner modifiers:** `top-left`, `top-right`, `bottom-right`, `bottom-left` — rounds a single corner.
|
|
333
|
+
Use these when an edge modifier would round one corner too many. Edge and corner modifiers combine
|
|
334
|
+
(`radius: 'top bottom-right'`).
|
|
323
335
|
|
|
324
336
|
**Output modifier:** `longhand` — forces output as individual CSS longhand properties (`border-top-left-radius`, `border-top-right-radius`, `border-bottom-right-radius`, `border-bottom-left-radius`) instead of the `border-radius` shorthand. Useful when children need to selectively inherit individual corners via `radius: 'inherit left'`.
|
|
325
337
|
|
|
@@ -334,6 +346,9 @@ Border radius with shape presets and directional modifiers.
|
|
|
334
346
|
| `"1r longhand"` | All corners `1r`, output as 4 individual `border-*-radius` properties |
|
|
335
347
|
| `"inherit"` | All corners inherit from parent (`border-radius: inherit`) |
|
|
336
348
|
| `"inherit right"` | Right corners inherit from parent (uses longhand properties) |
|
|
349
|
+
| `"top-right"` | Top-right corner `1r`, every other corner `0` |
|
|
350
|
+
| `"4px top-left"` | Top-left corner `4px`, every other corner `0` |
|
|
351
|
+
| `"top bottom-right"` | Both top corners and bottom-right `1r`, bottom-left `0` |
|
|
337
352
|
|
|
338
353
|
### `outline`
|
|
339
354
|
|
|
@@ -378,11 +393,11 @@ Multiple shadows: `shadow="1x 1x 2x #dark.20, inset 0 0 4x #dark.10"`
|
|
|
378
393
|
|
|
379
394
|
Typography preset that sets font-size, line-height, letter-spacing, font-weight, font-style, and text-transform from named design tokens.
|
|
380
395
|
|
|
381
|
-
**Syntax:** `name`, `name / modifier
|
|
396
|
+
**Syntax:** `name`, `name / modifier...`, or `modifier...` (shorthand)
|
|
382
397
|
|
|
383
398
|
Preset names are project-specific (e.g. `h1`–`h6`, `t1`–`t4`, `p1`–`p4`). Register them for autocomplete by augmenting `TastyPresetNames`.
|
|
384
399
|
|
|
385
|
-
Use `/` to separate the preset name from
|
|
400
|
+
Use `/` to separate the preset name from one or more space-separated modifiers. When modifiers are used alone (without a name), the preset name defaults to `inherit`. Modifiers can be combined freely because they target different properties.
|
|
386
401
|
|
|
387
402
|
**Modifiers:**
|
|
388
403
|
|
|
@@ -394,11 +409,13 @@ Use `/` to separate the preset name from a modifier. When a modifier is used alo
|
|
|
394
409
|
| `tight` | Sets line-height equal to font-size |
|
|
395
410
|
|
|
396
411
|
```jsx
|
|
397
|
-
preset="h1"
|
|
398
|
-
preset="h2 / strong"
|
|
399
|
-
preset="
|
|
400
|
-
preset="
|
|
401
|
-
preset="
|
|
412
|
+
preset="h1" // heading 1
|
|
413
|
+
preset="h2 / strong" // bold heading 2
|
|
414
|
+
preset="h2 / strong italic" // bold + italic heading 2
|
|
415
|
+
preset="t3 / italic" // italic text 3
|
|
416
|
+
preset="t2 / strong tight" // bold text 2 with tight line-height
|
|
417
|
+
preset="bold" // inherit preset with bold (shorthand)
|
|
418
|
+
preset="bold italic" // inherit preset with bold + italic (shorthand)
|
|
402
419
|
```
|
|
403
420
|
|
|
404
421
|
Individual typography props (`fontSize`, `lineHeight`, `letterSpacing`, `fontWeight`, `fontStyle`, `textTransform`) can be used alongside `preset` to override specific values, but using `preset` alone is recommended.
|
package/docs/tasty-static.md
CHANGED
|
@@ -178,6 +178,21 @@ module.exports = {
|
|
|
178
178
|
| `config.globalStyles` | `Record<string, Styles>` | — | Global Tasty styles keyed by CSS selector. Supports the full style syntax. |
|
|
179
179
|
| `config.autoPropertyTypes` | `boolean` | `true` | Automatically infer and register CSS `@property` declarations from values |
|
|
180
180
|
| `config.parserCacheSize` | `number` | `1000` | Parser LRU cache size. Larger values improve performance for builds with many unique style values |
|
|
181
|
+
| `config.namePrefix` | `string` | `'ts'` | Prefix prepended to every generated identifier. Defaults to `'ts'` so static classes never collide with runtime (`'t'`) classes. See [Configuration: Name prefix](configuration.md#name-prefix). |
|
|
182
|
+
|
|
183
|
+
### Coexisting with runtime tasty
|
|
184
|
+
|
|
185
|
+
When a page mixes `tastyStatic` with runtime `tasty`, both must use **different** `namePrefix` values. The defaults handle this automatically (`'t'` for runtime, `'ts'` for zero-runtime). If you customize one, customize the other:
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
// tasty-zero.config.ts (Babel plugin)
|
|
189
|
+
export default { namePrefix: 'mbs' };
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
// app entry (runtime configure)
|
|
194
|
+
configure({ namePrefix: 'mb' });
|
|
195
|
+
```
|
|
181
196
|
|
|
182
197
|
---
|
|
183
198
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/tasty",
|
|
3
|
-
"version": "0.0.0-snapshot.
|
|
3
|
+
"version": "0.0.0-snapshot.047dfbb",
|
|
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",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"changeset": "changeset",
|
|
95
95
|
"version": "changeset version",
|
|
96
96
|
"release": "changeset publish",
|
|
97
|
+
"knip": "knip",
|
|
97
98
|
"hygiene": "pnpm lint && pnpm format:check && pnpm typecheck",
|
|
98
99
|
"hygiene:fix": "pnpm lint:fix && pnpm format && pnpm typecheck"
|
|
99
100
|
},
|
|
@@ -123,6 +124,7 @@
|
|
|
123
124
|
"@babel/helper-plugin-utils": "^7.24.0",
|
|
124
125
|
"@babel/types": "^7.24.0",
|
|
125
126
|
"jiti": "^2.6.1",
|
|
127
|
+
"next": ">=14.0.0",
|
|
126
128
|
"react": "^18.0.0 || ^19.0.0"
|
|
127
129
|
},
|
|
128
130
|
"peerDependenciesMeta": {
|
|
@@ -140,6 +142,9 @@
|
|
|
140
142
|
},
|
|
141
143
|
"jiti": {
|
|
142
144
|
"optional": true
|
|
145
|
+
},
|
|
146
|
+
"next": {
|
|
147
|
+
"optional": true
|
|
143
148
|
}
|
|
144
149
|
},
|
|
145
150
|
"dependencies": {
|
|
@@ -147,7 +152,9 @@
|
|
|
147
152
|
},
|
|
148
153
|
"devDependencies": {
|
|
149
154
|
"@babel/core": "^7.24.0",
|
|
150
|
-
"@
|
|
155
|
+
"@babel/helper-plugin-utils": "^7.24.0",
|
|
156
|
+
"@babel/types": "^7.24.0",
|
|
157
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
151
158
|
"@changesets/cli": "^2.29.8",
|
|
152
159
|
"@eslint/js": "^10.0.1",
|
|
153
160
|
"@size-limit/esbuild": "^12.0.0",
|
|
@@ -158,15 +165,18 @@
|
|
|
158
165
|
"@types/babel__helper-plugin-utils": "^7.10.3",
|
|
159
166
|
"@types/node": "^25.3.2",
|
|
160
167
|
"@types/react": "^19.0.0",
|
|
161
|
-
"@vitest/runner": "^4.0.18",
|
|
162
168
|
"eslint": "^10.0.0",
|
|
163
169
|
"eslint-config-prettier": "^10.1.8",
|
|
164
|
-
"
|
|
170
|
+
"happy-dom": "^20.9.0",
|
|
171
|
+
"jiti": "^2.6.1",
|
|
172
|
+
"jsdom": "^29.0.2",
|
|
173
|
+
"knip": "^5.61.3",
|
|
174
|
+
"next": "^16.0.0",
|
|
165
175
|
"prettier": "^3.8.1",
|
|
166
176
|
"react": "^19.0.0",
|
|
167
177
|
"size-limit": "^12.0.0",
|
|
168
|
-
"tsdown": "^0.
|
|
169
|
-
"typescript": "^
|
|
178
|
+
"tsdown": "^0.22.0",
|
|
179
|
+
"typescript": "^6.0.2",
|
|
170
180
|
"typescript-eslint": "^8.56.0",
|
|
171
181
|
"vitest": "^4.0.18"
|
|
172
182
|
},
|
|
@@ -175,25 +185,25 @@
|
|
|
175
185
|
"esbuild"
|
|
176
186
|
]
|
|
177
187
|
},
|
|
178
|
-
"packageManager": "pnpm@
|
|
188
|
+
"packageManager": "pnpm@11.0.8",
|
|
179
189
|
"size-limit": [
|
|
180
190
|
{
|
|
181
191
|
"name": "main (import *)",
|
|
182
192
|
"path": "dist/index.js",
|
|
183
193
|
"import": "*",
|
|
184
|
-
"limit": "
|
|
194
|
+
"limit": "53 kB"
|
|
185
195
|
},
|
|
186
196
|
{
|
|
187
197
|
"name": "core (import *)",
|
|
188
198
|
"path": "dist/core/index.js",
|
|
189
199
|
"import": "*",
|
|
190
|
-
"limit": "
|
|
200
|
+
"limit": "50.5 kB"
|
|
191
201
|
},
|
|
192
202
|
{
|
|
193
203
|
"name": "static",
|
|
194
204
|
"path": "dist/static/index.js",
|
|
195
205
|
"import": "*",
|
|
196
|
-
"limit": "
|
|
206
|
+
"limit": "17 kB"
|
|
197
207
|
},
|
|
198
208
|
{
|
|
199
209
|
"name": "zero",
|
|
@@ -204,7 +214,7 @@
|
|
|
204
214
|
"path",
|
|
205
215
|
"crypto"
|
|
206
216
|
],
|
|
207
|
-
"limit": "
|
|
217
|
+
"limit": "32 kB"
|
|
208
218
|
},
|
|
209
219
|
{
|
|
210
220
|
"name": "babel-plugin",
|
|
@@ -215,7 +225,7 @@
|
|
|
215
225
|
"path",
|
|
216
226
|
"crypto"
|
|
217
227
|
],
|
|
218
|
-
"limit": "
|
|
228
|
+
"limit": "46.65 kB"
|
|
219
229
|
}
|
|
220
230
|
]
|
|
221
231
|
}
|
package/tasty.config.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
3
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
4
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
-
});
|
|
6
|
-
//#endregion
|
|
7
|
-
export { __require };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/chunks/cacheKey.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { extractLocalPredefinedStates, extractPredefinedStateRefs } from "../states/index.js";
|
|
2
|
-
//#region src/chunks/cacheKey.ts
|
|
3
|
-
/**
|
|
4
|
-
* Chunk-specific cache key generation.
|
|
5
|
-
*
|
|
6
|
-
* Generates cache keys that only include styles relevant to a specific chunk,
|
|
7
|
-
* enabling more granular caching and reuse.
|
|
8
|
-
*
|
|
9
|
-
* Enhanced to support predefined states:
|
|
10
|
-
* - Global predefined states don't affect cache keys (constant across app)
|
|
11
|
-
* - Local predefined states only affect cache keys if referenced in the chunk
|
|
12
|
-
*/
|
|
13
|
-
const _stableStringifyCache = /* @__PURE__ */ new WeakMap();
|
|
14
|
-
/**
|
|
15
|
-
* Recursively serialize a value with sorted keys for stable output.
|
|
16
|
-
* This ensures that {a: 1, b: 2} and {b: 2, a: 1} produce the same string.
|
|
17
|
-
* Uses a WeakMap cache for object values to avoid re-serializing the same references.
|
|
18
|
-
*/
|
|
19
|
-
function stableStringify(value) {
|
|
20
|
-
if (value === null) return "null";
|
|
21
|
-
if (value === void 0) return "undefined";
|
|
22
|
-
if (typeof value !== "object") return JSON.stringify(value);
|
|
23
|
-
const cached = _stableStringifyCache.get(value);
|
|
24
|
-
if (cached !== void 0) return cached;
|
|
25
|
-
let result;
|
|
26
|
-
if (Array.isArray(value)) result = "[" + value.map(stableStringify).join(",") + "]";
|
|
27
|
-
else {
|
|
28
|
-
const obj = value;
|
|
29
|
-
const sortedKeys = Object.keys(obj).sort();
|
|
30
|
-
const parts = [];
|
|
31
|
-
for (const key of sortedKeys) if (obj[key] !== void 0) parts.push(`${JSON.stringify(key)}:${stableStringify(obj[key])}`);
|
|
32
|
-
result = "{" + parts.join(",") + "}";
|
|
33
|
-
}
|
|
34
|
-
_stableStringifyCache.set(value, result);
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Generate a cache key for a specific chunk.
|
|
39
|
-
*
|
|
40
|
-
* Only includes the styles that belong to this chunk, allowing
|
|
41
|
-
* chunks to be cached independently.
|
|
42
|
-
*
|
|
43
|
-
* Also includes relevant local predefined states that are referenced
|
|
44
|
-
* by this chunk's styles.
|
|
45
|
-
*
|
|
46
|
-
* @param styles - The full styles object
|
|
47
|
-
* @param chunkName - Name of the chunk
|
|
48
|
-
* @param styleKeys - Keys of styles belonging to this chunk
|
|
49
|
-
* @returns A stable cache key string
|
|
50
|
-
*/
|
|
51
|
-
function generateChunkCacheKey(styles, chunkName, styleKeys) {
|
|
52
|
-
const parts = [chunkName];
|
|
53
|
-
let chunkStylesStr = "";
|
|
54
|
-
for (const key of styleKeys) {
|
|
55
|
-
const value = styles[key];
|
|
56
|
-
if (value !== void 0) {
|
|
57
|
-
const serialized = stableStringify(value);
|
|
58
|
-
parts.push(`${key}:${serialized}`);
|
|
59
|
-
chunkStylesStr += serialized;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const localStates = extractLocalPredefinedStates(styles);
|
|
63
|
-
if (Object.keys(localStates).length > 0) {
|
|
64
|
-
const referencedStates = extractPredefinedStateRefs(chunkStylesStr);
|
|
65
|
-
const relevantLocalStates = [];
|
|
66
|
-
for (const stateName of referencedStates) if (localStates[stateName]) relevantLocalStates.push(`${stateName}=${localStates[stateName]}`);
|
|
67
|
-
if (relevantLocalStates.length > 0) {
|
|
68
|
-
relevantLocalStates.sort();
|
|
69
|
-
parts.unshift(`[states:${relevantLocalStates.join("|")}]`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return parts.join("\0");
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { generateChunkCacheKey };
|
|
76
|
-
|
|
77
|
-
//# sourceMappingURL=cacheKey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cacheKey.js","names":[],"sources":["../../src/chunks/cacheKey.ts"],"sourcesContent":["/**\n * Chunk-specific cache key generation.\n *\n * Generates cache keys that only include styles relevant to a specific chunk,\n * enabling more granular caching and reuse.\n *\n * Enhanced to support predefined states:\n * - Global predefined states don't affect cache keys (constant across app)\n * - Local predefined states only affect cache keys if referenced in the chunk\n */\n\nimport {\n extractLocalPredefinedStates,\n extractPredefinedStateRefs,\n} from '../states';\nimport type { Styles } from '../styles/types';\n\nconst _stableStringifyCache = new WeakMap<object, string>();\n\n/**\n * Recursively serialize a value with sorted keys for stable output.\n * This ensures that {a: 1, b: 2} and {b: 2, a: 1} produce the same string.\n * Uses a WeakMap cache for object values to avoid re-serializing the same references.\n */\nfunction stableStringify(value: unknown): string {\n if (value === null) {\n return 'null';\n }\n if (value === undefined) {\n return 'undefined';\n }\n if (typeof value !== 'object') {\n return JSON.stringify(value);\n }\n\n const cached = _stableStringifyCache.get(value as object);\n if (cached !== undefined) return cached;\n\n let result: string;\n if (Array.isArray(value)) {\n result = '[' + value.map(stableStringify).join(',') + ']';\n } else {\n const obj = value as Record<string, unknown>;\n const sortedKeys = Object.keys(obj).sort();\n const parts: string[] = [];\n for (const key of sortedKeys) {\n if (obj[key] !== undefined) {\n parts.push(`${JSON.stringify(key)}:${stableStringify(obj[key])}`);\n }\n }\n result = '{' + parts.join(',') + '}';\n }\n\n _stableStringifyCache.set(value as object, result);\n return result;\n}\n\n/**\n * Generate a cache key for a specific chunk.\n *\n * Only includes the styles that belong to this chunk, allowing\n * chunks to be cached independently.\n *\n * Also includes relevant local predefined states that are referenced\n * by this chunk's styles.\n *\n * @param styles - The full styles object\n * @param chunkName - Name of the chunk\n * @param styleKeys - Keys of styles belonging to this chunk\n * @returns A stable cache key string\n */\nexport function generateChunkCacheKey(\n styles: Styles,\n chunkName: string,\n styleKeys: string[],\n): string {\n // Start with chunk name for namespace separation\n const parts: string[] = [chunkName];\n\n // styleKeys are already sorted by categorizeStyleKeys\n let chunkStylesStr = '';\n\n for (const key of styleKeys) {\n const value = styles[key];\n if (value !== undefined) {\n // Use stable stringify for consistent serialization regardless of key order\n const serialized = stableStringify(value);\n parts.push(`${key}:${serialized}`);\n chunkStylesStr += serialized;\n }\n }\n\n // Extract local predefined states from the full styles object\n const localStates = extractLocalPredefinedStates(styles);\n\n // Only include local predefined states that are actually referenced in this chunk\n if (Object.keys(localStates).length > 0) {\n const referencedStates = extractPredefinedStateRefs(chunkStylesStr);\n const relevantLocalStates: string[] = [];\n\n for (const stateName of referencedStates) {\n if (localStates[stateName]) {\n relevantLocalStates.push(`${stateName}=${localStates[stateName]}`);\n }\n }\n\n // Add relevant local states to the cache key (sorted for stability)\n if (relevantLocalStates.length > 0) {\n relevantLocalStates.sort();\n parts.unshift(`[states:${relevantLocalStates.join('|')}]`);\n }\n }\n\n // Use null character as separator (safe, not in JSON output)\n return parts.join('\\0');\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAM,wCAAwB,IAAI,SAAyB;;;;;;AAO3D,SAAS,gBAAgB,OAAwB;AAC/C,KAAI,UAAU,KACZ,QAAO;AAET,KAAI,UAAU,KAAA,EACZ,QAAO;AAET,KAAI,OAAO,UAAU,SACnB,QAAO,KAAK,UAAU,MAAM;CAG9B,MAAM,SAAS,sBAAsB,IAAI,MAAgB;AACzD,KAAI,WAAW,KAAA,EAAW,QAAO;CAEjC,IAAI;AACJ,KAAI,MAAM,QAAQ,MAAM,CACtB,UAAS,MAAM,MAAM,IAAI,gBAAgB,CAAC,KAAK,IAAI,GAAG;MACjD;EACL,MAAM,MAAM;EACZ,MAAM,aAAa,OAAO,KAAK,IAAI,CAAC,MAAM;EAC1C,MAAM,QAAkB,EAAE;AAC1B,OAAK,MAAM,OAAO,WAChB,KAAI,IAAI,SAAS,KAAA,EACf,OAAM,KAAK,GAAG,KAAK,UAAU,IAAI,CAAC,GAAG,gBAAgB,IAAI,KAAK,GAAG;AAGrE,WAAS,MAAM,MAAM,KAAK,IAAI,GAAG;;AAGnC,uBAAsB,IAAI,OAAiB,OAAO;AAClD,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,sBACd,QACA,WACA,WACQ;CAER,MAAM,QAAkB,CAAC,UAAU;CAGnC,IAAI,iBAAiB;AAErB,MAAK,MAAM,OAAO,WAAW;EAC3B,MAAM,QAAQ,OAAO;AACrB,MAAI,UAAU,KAAA,GAAW;GAEvB,MAAM,aAAa,gBAAgB,MAAM;AACzC,SAAM,KAAK,GAAG,IAAI,GAAG,aAAa;AAClC,qBAAkB;;;CAKtB,MAAM,cAAc,6BAA6B,OAAO;AAGxD,KAAI,OAAO,KAAK,YAAY,CAAC,SAAS,GAAG;EACvC,MAAM,mBAAmB,2BAA2B,eAAe;EACnE,MAAM,sBAAgC,EAAE;AAExC,OAAK,MAAM,aAAa,iBACtB,KAAI,YAAY,WACd,qBAAoB,KAAK,GAAG,UAAU,GAAG,YAAY,aAAa;AAKtE,MAAI,oBAAoB,SAAS,GAAG;AAClC,uBAAoB,MAAM;AAC1B,SAAM,QAAQ,WAAW,oBAAoB,KAAK,IAAI,CAAC,GAAG;;;AAK9D,QAAO,MAAM,KAAK,KAAK"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
//#region src/chunks/definitions.d.ts
|
|
2
|
-
declare const CHUNK_NAMES: {
|
|
3
|
-
/** Special chunk for styles that cannot be split */readonly COMBINED: "combined";
|
|
4
|
-
readonly SUBCOMPONENTS: "subcomponents";
|
|
5
|
-
readonly APPEARANCE: "appearance";
|
|
6
|
-
readonly FONT: "font";
|
|
7
|
-
readonly DIMENSION: "dimension";
|
|
8
|
-
readonly DISPLAY: "display";
|
|
9
|
-
readonly LAYOUT: "layout";
|
|
10
|
-
readonly POSITION: "position";
|
|
11
|
-
readonly MISC: "misc";
|
|
12
|
-
};
|
|
13
|
-
type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];
|
|
14
|
-
/**
|
|
15
|
-
* Pre-computed map for O(1) style-to-chunk lookup.
|
|
16
|
-
* Built once at module load time.
|
|
17
|
-
*/
|
|
18
|
-
declare const STYLE_TO_CHUNK: Map<string, ChunkName>;
|
|
19
|
-
interface ChunkInfo {
|
|
20
|
-
/** Name of the chunk */
|
|
21
|
-
name: ChunkName | string;
|
|
22
|
-
/** Style keys belonging to this chunk */
|
|
23
|
-
styleKeys: string[];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Categorize style keys into chunks.
|
|
27
|
-
*
|
|
28
|
-
* Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
|
|
29
|
-
* of the order of keys in the input styles object.
|
|
30
|
-
*
|
|
31
|
-
* @param styles - The styles object to categorize
|
|
32
|
-
* @returns Map of chunk name to array of style keys in that chunk (in priority order)
|
|
33
|
-
*/
|
|
34
|
-
declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<string, string[]>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { CHUNK_NAMES, ChunkInfo, ChunkName, STYLE_TO_CHUNK, categorizeStyleKeys };
|
|
37
|
-
//# sourceMappingURL=definitions.d.ts.map
|