@tenphi/tasty 0.0.0-snapshot.bbd10c7 → 0.0.0-snapshot.bbfcd75
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 +196 -140
- package/dist/babel-Zs1Q03qt.d.ts +83 -0
- package/dist/chunks/async-storage-CG5HnUT5.js +20 -0
- package/dist/chunks/async-storage-CG5HnUT5.js.map +1 -0
- package/dist/chunks/build-config-CUQVwdWF.js +42 -0
- package/dist/chunks/build-config-CUQVwdWF.js.map +1 -0
- package/dist/chunks/collector-B0LTHw6Z.js +208 -0
- package/dist/chunks/collector-B0LTHw6Z.js.map +1 -0
- package/dist/chunks/config-engine-C3pF9EK9.js +267 -0
- package/dist/chunks/config-engine-C3pF9EK9.js.map +1 -0
- package/dist/chunks/css-definitions-D_it4XZH.js +875 -0
- package/dist/chunks/css-definitions-D_it4XZH.js.map +1 -0
- package/dist/chunks/css-resources-BN8apgxt.js +142 -0
- package/dist/chunks/css-resources-BN8apgxt.js.map +1 -0
- package/dist/{debug.js → chunks/debug-C9LeNVoJ.js} +187 -139
- package/dist/chunks/debug-C9LeNVoJ.js.map +1 -0
- package/dist/chunks/dsl-C5yuAn41.js +1373 -0
- package/dist/chunks/dsl-C5yuAn41.js.map +1 -0
- package/dist/chunks/hydration-TRcz5vnk.js +41 -0
- package/dist/chunks/hydration-TRcz5vnk.js.map +1 -0
- package/dist/chunks/react-runtime-O-OUrKLH.js +557 -0
- package/dist/chunks/react-runtime-O-OUrKLH.js.map +1 -0
- package/dist/chunks/runtime-engine-DvnE2g-E.js +2437 -0
- package/dist/chunks/runtime-engine-DvnE2g-E.js.map +1 -0
- package/dist/chunks/runtime-state-BTDqSYBk.js +127 -0
- package/dist/chunks/runtime-state-BTDqSYBk.js.map +1 -0
- package/dist/{utils/merge-styles.js → chunks/shared-utils-DWA4LjIa.js} +55 -55
- package/dist/chunks/shared-utils-DWA4LjIa.js.map +1 -0
- package/dist/chunks/style-engine-C1ECBZxR.js +5131 -0
- package/dist/chunks/style-engine-C1ECBZxR.js.map +1 -0
- package/dist/{zero/extractor.js → chunks/zero-engine-B6EnYcXY.js} +89 -82
- package/dist/chunks/zero-engine-B6EnYcXY.js.map +1 -0
- package/dist/collector-hl5KNH7k.d.ts +165 -0
- package/dist/config-DWL1ZYue.d.ts +1358 -0
- package/dist/core/index.d.ts +5 -34
- package/dist/core/index.js +9 -27
- package/dist/index-D9N9GV24.d.ts +1947 -0
- package/dist/index.d.ts +5 -51
- package/dist/index.js +11 -36
- package/dist/{utils/merge-styles.d.ts → merge-styles-C_oMoJVd.d.ts} +3 -3
- package/dist/ssr/astro-client.js +6 -0
- package/dist/ssr/astro-client.js.map +1 -0
- package/dist/ssr/astro-middleware-extract-static.d.ts +11 -0
- package/dist/ssr/astro-middleware-extract-static.js +9 -0
- package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
- package/dist/ssr/astro-middleware-extract.d.ts +11 -0
- package/dist/ssr/astro-middleware-extract.js +9 -0
- package/dist/ssr/astro-middleware-extract.js.map +1 -0
- package/dist/ssr/astro-middleware-static.d.ts +18 -0
- package/dist/ssr/astro-middleware-static.js +7 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +19 -0
- package/dist/ssr/astro-middleware.js +7 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +117 -11
- package/dist/ssr/astro.js +204 -48
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/index.d.ts +37 -4
- package/dist/ssr/index.js +6 -6
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next-config.d.ts +66 -0
- package/dist/ssr/next-config.js +124 -0
- package/dist/ssr/next-config.js.map +1 -0
- package/dist/ssr/next.d.ts +14 -5
- package/dist/ssr/next.js +31 -46
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +91 -5
- package/dist/static/index.js +31 -3
- package/dist/static/index.js.map +1 -0
- package/dist/static/inject.js.map +1 -1
- package/dist/types-jKZNpias.d.ts +1616 -0
- package/dist/zero/babel.d.ts +2 -182
- package/dist/zero/babel.js +82 -113
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +81 -3
- package/dist/zero/index.js +2 -3
- package/dist/zero/next.d.ts +1 -1
- package/dist/zero/next.js +0 -31
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +20 -12
- package/docs/adoption.md +59 -32
- package/docs/ai-agents.md +229 -0
- package/docs/comparison.md +76 -48
- package/docs/configuration.md +566 -69
- package/docs/debug.md +37 -23
- package/docs/design-system.md +63 -32
- package/docs/dsl.md +527 -179
- package/docs/getting-started.md +62 -41
- package/docs/injector.md +157 -51
- package/docs/methodology.md +69 -37
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +744 -0
- package/docs/plugins.md +353 -0
- package/docs/{runtime.md → react-api.md} +176 -67
- package/docs/runtime-benchmarks.md +377 -0
- package/docs/ssr.md +350 -94
- package/docs/styles.md +108 -27
- package/docs/tasty-static.md +149 -87
- package/package.json +121 -23
- package/tasty.config.ts +6 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- 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 -356
- package/dist/compute-styles.js.map +0 -1
- package/dist/config.d.ts +0 -372
- package/dist/config.js +0 -507
- 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.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 -50
- package/dist/hooks/useCounterStyle.js +0 -45
- package/dist/hooks/useCounterStyle.js.map +0 -1
- package/dist/hooks/useFontFace.d.ts +0 -43
- package/dist/hooks/useFontFace.js +0 -69
- package/dist/hooks/useFontFace.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -30
- package/dist/hooks/useGlobalStyles.js +0 -77
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -56
- package/dist/hooks/useKeyframes.js +0 -63
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -79
- package/dist/hooks/useProperty.js +0 -108
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -53
- package/dist/hooks/useRawCSS.js +0 -34
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -40
- package/dist/hooks/useStyles.js +0 -29
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -166
- package/dist/injector/index.js +0 -166
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -166
- package/dist/injector/injector.js +0 -464
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -136
- package/dist/injector/sheet-manager.js +0 -733
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -204
- 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 -230
- 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 -1103
- 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 -515
- 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 -76
- 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/ssr/async-storage.d.ts +0 -17
- package/dist/ssr/async-storage.js +0 -34
- package/dist/ssr/async-storage.js.map +0 -1
- package/dist/ssr/collect-auto-properties.js +0 -39
- package/dist/ssr/collect-auto-properties.js.map +0 -1
- package/dist/ssr/collector.d.ts +0 -102
- package/dist/ssr/collector.js +0 -219
- package/dist/ssr/collector.js.map +0 -1
- package/dist/ssr/format-global-rules.js +0 -22
- 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 -22
- package/dist/ssr/hydrate.js +0 -49
- package/dist/ssr/hydrate.js.map +0 -1
- package/dist/ssr/ssr-collector-ref.js +0 -12
- 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 -240
- 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/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/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 +0 -146
- 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 -47
- 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/dist/{chunks/cacheKey.d.ts → ssr/astro-client.d.ts} +0 -0
|
@@ -0,0 +1,1616 @@
|
|
|
1
|
+
import { Properties } from "csstype";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/css-types.d.ts
|
|
4
|
+
interface CSSProperties extends Properties<string | number> {}
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/parser/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* A part within a group, representing a slash-separated segment.
|
|
9
|
+
* For example, in `'2px solid #red / 4px'`, there are two parts:
|
|
10
|
+
* - Part 0: `2px solid #red`
|
|
11
|
+
* - Part 1: `4px`
|
|
12
|
+
*/
|
|
13
|
+
interface StyleDetailsPart {
|
|
14
|
+
mods: string[];
|
|
15
|
+
values: string[];
|
|
16
|
+
colors: string[];
|
|
17
|
+
all: string[];
|
|
18
|
+
output: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A group of style details, representing a comma-separated segment.
|
|
22
|
+
* Contains aggregated values from all parts for backward compatibility,
|
|
23
|
+
* plus the structured `parts` array for handlers that need slash separation.
|
|
24
|
+
*/
|
|
25
|
+
interface StyleDetails {
|
|
26
|
+
input: string;
|
|
27
|
+
output: string;
|
|
28
|
+
/** Aggregated mods from all parts (backward compatible) */
|
|
29
|
+
mods: string[];
|
|
30
|
+
/** Aggregated values from all parts (backward compatible) */
|
|
31
|
+
values: string[];
|
|
32
|
+
/** Aggregated colors from all parts (backward compatible) */
|
|
33
|
+
colors: string[];
|
|
34
|
+
/** Aggregated all tokens from all parts (backward compatible) */
|
|
35
|
+
all: string[];
|
|
36
|
+
/** Slash-separated parts within this group */
|
|
37
|
+
parts: StyleDetailsPart[];
|
|
38
|
+
}
|
|
39
|
+
interface ProcessedStyle {
|
|
40
|
+
output: string;
|
|
41
|
+
groups: StyleDetails[];
|
|
42
|
+
}
|
|
43
|
+
type UnitHandler = (scalar: number) => string;
|
|
44
|
+
interface ParserOptions {
|
|
45
|
+
functions?: Record<string, (parsed: StyleDetails[]) => string>;
|
|
46
|
+
units?: Record<string, string | UnitHandler>;
|
|
47
|
+
cacheSize?: number;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/parser/parser.d.ts
|
|
51
|
+
declare class StyleParser {
|
|
52
|
+
private opts;
|
|
53
|
+
private cache;
|
|
54
|
+
constructor(opts?: ParserOptions);
|
|
55
|
+
process(src: string): ProcessedStyle;
|
|
56
|
+
setFunctions(functions: Required<ParserOptions>['functions']): void;
|
|
57
|
+
setUnits(units: Required<ParserOptions>['units']): void;
|
|
58
|
+
updateOptions(patch: Partial<ParserOptions>): void;
|
|
59
|
+
/**
|
|
60
|
+
* Clear the parser cache.
|
|
61
|
+
* Call this when external state that affects parsing results has changed
|
|
62
|
+
* (e.g., predefined tokens).
|
|
63
|
+
*/
|
|
64
|
+
clearCache(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Get the current units configuration.
|
|
67
|
+
*/
|
|
68
|
+
getUnits(): ParserOptions['units'];
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/utils/color-math.d.ts
|
|
72
|
+
/**
|
|
73
|
+
* Consolidated color conversion math.
|
|
74
|
+
*
|
|
75
|
+
* Single source of truth for all color space conversions used across the
|
|
76
|
+
* library: sRGB gamma, HSL, OKLab, OKLCH, OKHSL, hex parsing, named
|
|
77
|
+
* colors, and CSS string converters.
|
|
78
|
+
*
|
|
79
|
+
* This module has zero internal imports — it is a leaf dependency.
|
|
80
|
+
*
|
|
81
|
+
* Reference: https://bottosson.github.io/posts/oklab/
|
|
82
|
+
*/
|
|
83
|
+
type Vec3 = [number, number, number];
|
|
84
|
+
/**
|
|
85
|
+
* sRGB gamma to linear. Only the sRGB-to-OKLab direction needs it, so this is
|
|
86
|
+
* test-only for the same reason as {@link srgbToOkhsl} — the forward path goes
|
|
87
|
+
* through {@link srgbLinearToGamma} instead.
|
|
88
|
+
*/
|
|
89
|
+
/**
|
|
90
|
+
* HSL to RGB.
|
|
91
|
+
* Algorithm from CSS Color 4 spec.
|
|
92
|
+
*
|
|
93
|
+
* @param h - Hue in degrees (0-360)
|
|
94
|
+
* @param s - Saturation (0-1)
|
|
95
|
+
* @param l - Lightness (0-1)
|
|
96
|
+
* @returns RGB values in 0-255 range (may have fractional values)
|
|
97
|
+
*/
|
|
98
|
+
declare function hslToRgbValues(h: number, s: number, l: number): Vec3;
|
|
99
|
+
declare function getNamedColorHex(): Map<string, string>;
|
|
100
|
+
/**
|
|
101
|
+
* Convert hex color string to `rgb()` CSS string.
|
|
102
|
+
* Supports 3, 4, 6, and 8 character hex values (with or without `#`).
|
|
103
|
+
*/
|
|
104
|
+
declare function hexToRgb(hex: string): string | null;
|
|
105
|
+
/**
|
|
106
|
+
* Extract RGB values from an `rgb()`/`rgba()` string.
|
|
107
|
+
* Supports comma-separated, space-separated, fractional, percentage,
|
|
108
|
+
* and slash alpha notation.
|
|
109
|
+
*
|
|
110
|
+
* @returns Array of RGB values (0-255 range), converting percentages as needed.
|
|
111
|
+
*/
|
|
112
|
+
declare function getRgbValuesFromRgbaString(str: string): number[];
|
|
113
|
+
/**
|
|
114
|
+
* Convert any recognized color string to an `rgb()` CSS string.
|
|
115
|
+
* Handles hex, `okhsl()`, `okhst()`, `hsl()`/`hsla()`, named CSS colors,
|
|
116
|
+
* and `rgb()`/`rgba()` pass-through.
|
|
117
|
+
*/
|
|
118
|
+
declare function strToRgb(color: string, _ignoreAlpha?: boolean): string | null | undefined;
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/utils/styles.d.ts
|
|
121
|
+
type StyleValue<T = string> = T | boolean | number | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Normalize a color token value.
|
|
124
|
+
* - Boolean `true` is converted to `'transparent'`
|
|
125
|
+
* - Boolean `false` returns `null` (signals the token should be skipped)
|
|
126
|
+
* - Other values are returned as-is
|
|
127
|
+
*
|
|
128
|
+
* @param value - The raw token value
|
|
129
|
+
* @returns Normalized value or null if the token should be skipped
|
|
130
|
+
*/
|
|
131
|
+
declare function normalizeColorTokenValue<T>(value: T | boolean): T | 'transparent' | null;
|
|
132
|
+
type StyleValueStateMap<T = string> = Record<string, StyleValue<T> | '@inherit'>;
|
|
133
|
+
/**
|
|
134
|
+
* Combined type for style values that can be either a direct value or a state map.
|
|
135
|
+
* Use this for component props that accept style values.
|
|
136
|
+
*/
|
|
137
|
+
type StylePropValue<T = string> = StyleValue<T> | StyleValueStateMap<T>;
|
|
138
|
+
/**
|
|
139
|
+
* One dependency value as a style handler receives it: already resolved for a
|
|
140
|
+
* single state, but still the **raw authored DSL string** (`'2x'`, `'#purple.5'`).
|
|
141
|
+
* Handlers parse it themselves via {@link parseStyle} / {@link parseColor}.
|
|
142
|
+
*/
|
|
143
|
+
type ResolvedStyleValue = StyleValue<string>;
|
|
144
|
+
/**
|
|
145
|
+
* The dependency map a handler receives — one resolved value per style name in
|
|
146
|
+
* its `__lookupStyles`.
|
|
147
|
+
*/
|
|
148
|
+
type StyleHandlerProps<TDeps extends string = string> = Partial<Record<TDeps, ResolvedStyleValue>>;
|
|
149
|
+
/**
|
|
150
|
+
* One set of CSS declarations returned by a style handler.
|
|
151
|
+
*
|
|
152
|
+
* Keys are **kebab-case** CSS property names (`'background-color'`, not
|
|
153
|
+
* `backgroundColor`) or `--custom-property` names. Values are stringified, so
|
|
154
|
+
* numbers are accepted. `$` is reserved as a selector suffix.
|
|
155
|
+
*/
|
|
156
|
+
type CSSMap = {
|
|
157
|
+
/** Selector suffix (or suffixes) these declarations apply to, e.g. `'& > *'`. */$?: string | string[];
|
|
158
|
+
} & Record<string, string | number | (string | number)[] | undefined>;
|
|
159
|
+
type StyleHandlerResult = CSSMap | CSSMap[] | null | void;
|
|
160
|
+
type RawStyleHandler<TProps extends object = StyleHandlerProps> = (props: TProps) => StyleHandlerResult;
|
|
161
|
+
type StyleHandler<TProps extends object = StyleHandlerProps> = RawStyleHandler<TProps> & {
|
|
162
|
+
__lookupStyles: string[];
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* The handler type used by the registry (`STYLE_HANDLER_MAP`), with parameter
|
|
166
|
+
* variance erased.
|
|
167
|
+
*
|
|
168
|
+
* Handlers declare narrow, hand-written dependency types — `({ fill }: { fill?:
|
|
169
|
+
* string }) => …` — which under `strictFunctionTypes` are not assignable to a
|
|
170
|
+
* wider parameter type. The registry stores handlers of many different dependency
|
|
171
|
+
* shapes together, so it needs the erased form. Prefer {@link StyleHandler} (or
|
|
172
|
+
* {@link defineHandler}) when writing a handler; this type is for code that
|
|
173
|
+
* inspects the registry.
|
|
174
|
+
*/
|
|
175
|
+
type AnyStyleHandler = ((props: any) => StyleHandlerResult) & {
|
|
176
|
+
__lookupStyles: string[];
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Handler definition forms for configure() and plugins.
|
|
180
|
+
* - Function only: lookup styles inferred from key name
|
|
181
|
+
* - Single property tuple: ['styleName', handler]
|
|
182
|
+
* - Multi-property tuple: [['style1', 'style2'], handler]
|
|
183
|
+
*
|
|
184
|
+
* Use {@link defineHandler} to have the dependency names inferred into the
|
|
185
|
+
* handler's parameter type instead of annotating it by hand.
|
|
186
|
+
*/
|
|
187
|
+
type StyleHandlerDefinition<TDeps extends string = string> = RawStyleHandler<StyleHandlerProps<TDeps>> | [TDeps, RawStyleHandler<StyleHandlerProps<TDeps>>] | [readonly TDeps[], RawStyleHandler<StyleHandlerProps<TDeps>>];
|
|
188
|
+
interface ParsedColor {
|
|
189
|
+
color?: string;
|
|
190
|
+
name?: string;
|
|
191
|
+
opacity?: number;
|
|
192
|
+
}
|
|
193
|
+
type StyleMap = Record<string, StyleValue | StyleValueStateMap>;
|
|
194
|
+
declare const CUSTOM_UNITS: {
|
|
195
|
+
r: string;
|
|
196
|
+
cr: string;
|
|
197
|
+
bw: string;
|
|
198
|
+
ow: string;
|
|
199
|
+
x: string;
|
|
200
|
+
sf: (num: number) => string;
|
|
201
|
+
};
|
|
202
|
+
declare const DIRECTIONS: string[];
|
|
203
|
+
/**
|
|
204
|
+
* Get the global StyleParser instance.
|
|
205
|
+
* Used by configure() to apply parser configuration.
|
|
206
|
+
*/
|
|
207
|
+
declare function getGlobalParser(): StyleParser;
|
|
208
|
+
/**
|
|
209
|
+
* Get the current global predefined tokens.
|
|
210
|
+
* Returns null if no tokens are configured.
|
|
211
|
+
*/
|
|
212
|
+
declare function getGlobalPredefinedTokens(): Record<string, string> | null;
|
|
213
|
+
/**
|
|
214
|
+
*
|
|
215
|
+
* @param {String} value
|
|
216
|
+
* @param {Number} mode
|
|
217
|
+
* @returns {Object<String,String|Array>}
|
|
218
|
+
*/
|
|
219
|
+
declare function parseStyle(value: StyleValue): ProcessedStyle;
|
|
220
|
+
/**
|
|
221
|
+
* Parse color. Find it value, name and opacity.
|
|
222
|
+
* Optimized to avoid heavy parseStyle calls for simple color patterns.
|
|
223
|
+
*/
|
|
224
|
+
declare function parseColor(val: string, ignoreError?: boolean): ParsedColor;
|
|
225
|
+
declare function filterMods(mods: string[], allowedMods: readonly string[]): string[];
|
|
226
|
+
declare function stringifyStyles(styles: unknown): string;
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/styles/types.d.ts
|
|
229
|
+
/**
|
|
230
|
+
* Extensible interface for named color tokens.
|
|
231
|
+
* Augment this interface to register project-specific color names
|
|
232
|
+
* for autocomplete in `fill`, `color`, `svgFill`, and other color style props.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```typescript
|
|
236
|
+
* declare module '@tenphi/tasty' {
|
|
237
|
+
* interface TastyNamedColors {
|
|
238
|
+
* primary: true;
|
|
239
|
+
* danger: true;
|
|
240
|
+
* }
|
|
241
|
+
* }
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
interface TastyNamedColors {}
|
|
245
|
+
type NamedColorKey = Extract<keyof TastyNamedColors, string>;
|
|
246
|
+
type NamedColor = [NamedColorKey] extends [never] ? string : NamedColorKey;
|
|
247
|
+
/**
|
|
248
|
+
* Extensible interface for typography preset names.
|
|
249
|
+
* Augment this interface to register project-specific preset names for autocomplete.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```typescript
|
|
253
|
+
* declare module '@tenphi/tasty' {
|
|
254
|
+
* interface TastyPresetNames {
|
|
255
|
+
* h1: true;
|
|
256
|
+
* t3: true;
|
|
257
|
+
* }
|
|
258
|
+
* }
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
interface TastyPresetNames {}
|
|
262
|
+
type PresetNameKey = Extract<keyof TastyPresetNames, string>;
|
|
263
|
+
type PresetName = [PresetNameKey] extends [never] ? string : PresetNameKey;
|
|
264
|
+
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
265
|
+
type OpaquePercentage = '' | `.${Digit}` | `.${Digit}${Digit}` | '.100';
|
|
266
|
+
type ColorValue = `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `hsl(${string})` | `okhsl(${string})` | `oklch(${string})` | (string & {});
|
|
267
|
+
type NoType = false | null | undefined;
|
|
268
|
+
interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'blockSize' | 'inlineSize' | 'border' | 'transition' | 'placeContent' | 'placeItems' | 'scrollMargin' | 'scrollMarginTop' | 'scrollMarginRight' | 'scrollMarginBottom' | 'scrollMarginLeft' | 'scrollPadding' | 'scrollPaddingTop' | 'scrollPaddingRight' | 'scrollPaddingBottom' | 'scrollPaddingLeft'> {
|
|
269
|
+
/**
|
|
270
|
+
* @deprecated Use `flow` style instead.
|
|
271
|
+
*/
|
|
272
|
+
flexDirection: CSSProperties['flexDirection'];
|
|
273
|
+
/**
|
|
274
|
+
* @deprecated Use `placeContent`, `placeItems`, `gridColumns`, `gridRows`, and `gridTemplate` styles instead.
|
|
275
|
+
*/
|
|
276
|
+
grid: CSSProperties['grid'];
|
|
277
|
+
/**
|
|
278
|
+
* @deprecated Use `flexShrink`, `flexGrow`, and `flexBasis` styles instead.
|
|
279
|
+
*/
|
|
280
|
+
flex: CSSProperties['flex'];
|
|
281
|
+
/**
|
|
282
|
+
* Set the background color of the element. Shortcut for `background-color` with enhanced support for Tasty color tokens and syntaxes.
|
|
283
|
+
*
|
|
284
|
+
* Supports double-color syntax: the second color is applied as a foreground overlay via a CSS custom property.
|
|
285
|
+
*
|
|
286
|
+
* Examples:
|
|
287
|
+
* - `fill="#purple.10"` // purple background with 10% opacity
|
|
288
|
+
* - `fill="#danger"` // danger theme color
|
|
289
|
+
* - `fill="rgb(255 128 0)"` // custom RGB color
|
|
290
|
+
* - `fill="rgb(255 128 0 / 0.5)"` // RGB with opacity
|
|
291
|
+
* - `fill="hsl(200 100% 50%)"` // HSL color
|
|
292
|
+
* - `fill="okhsl(200 100% 50%)"` // perceptually uniform OKHSL color
|
|
293
|
+
* - `fill="oklch(0.7 0.15 200)"` // OKLCH color
|
|
294
|
+
* - `fill="#primary #secondary"` // double color (second as foreground overlay)
|
|
295
|
+
* - `fill={true}` // default fill color
|
|
296
|
+
*/
|
|
297
|
+
fill?: ColorValue | boolean;
|
|
298
|
+
/**
|
|
299
|
+
* @deprecated Use `fill` instead.
|
|
300
|
+
*/
|
|
301
|
+
backgroundColor?: CSSProperties['backgroundColor'];
|
|
302
|
+
/**
|
|
303
|
+
* Set the background image of the element. Shortcut for `background-image` with enhanced support for Tasty tokens.
|
|
304
|
+
*
|
|
305
|
+
* Examples:
|
|
306
|
+
* - `image="url(/path/to/image.png)"` // image from URL
|
|
307
|
+
* - `image="linear-gradient(to right, #purple, #danger)"` // gradient
|
|
308
|
+
*/
|
|
309
|
+
image?: CSSProperties['backgroundImage'];
|
|
310
|
+
/**
|
|
311
|
+
* @deprecated Use `image` instead.
|
|
312
|
+
*/
|
|
313
|
+
backgroundImage?: CSSProperties['backgroundImage'];
|
|
314
|
+
/**
|
|
315
|
+
* @deprecated Use separate background styles (`fill`, `image`, `backgroundSize`, etc.) instead.
|
|
316
|
+
* When set, overrides all other background-related styles.
|
|
317
|
+
*/
|
|
318
|
+
background?: CSSProperties['background'];
|
|
319
|
+
/**
|
|
320
|
+
* Set the fill color of SVG elements. Outputs the native CSS `fill` property with enhanced support for Tasty color tokens and syntaxes.
|
|
321
|
+
*
|
|
322
|
+
* Examples:
|
|
323
|
+
* - `svgFill="#purple.10"` // purple fill with 10% opacity
|
|
324
|
+
* - `svgFill="#danger"` // danger theme color
|
|
325
|
+
* - `svgFill="rgb(255 128 0)"` // custom RGB color
|
|
326
|
+
* - `svgFill="hsl(200 100% 50%)"` // HSL color
|
|
327
|
+
* - `svgFill="okhsl(200 100% 50%)"` // OKHSL color
|
|
328
|
+
* - `svgFill="oklch(0.7 0.15 200)"` // OKLCH color
|
|
329
|
+
* - `svgFill="currentColor"` // inherit from parent color
|
|
330
|
+
*/
|
|
331
|
+
svgFill?: ColorValue;
|
|
332
|
+
/**
|
|
333
|
+
* Set the text (current) color of the element. Shortcut for `color` with enhanced support for Tasty color tokens and syntaxes.
|
|
334
|
+
*
|
|
335
|
+
* Examples:
|
|
336
|
+
* - `color="#purple"` // purple text color
|
|
337
|
+
* - `color="#danger.6"` // danger color with 60% opacity
|
|
338
|
+
* - `color="rgb(255 128 0)"` // custom RGB color
|
|
339
|
+
* - `color="hsl(200 100% 50%)"` // HSL color
|
|
340
|
+
* - `color="okhsl(200 100% 50%)"` // OKHSL color
|
|
341
|
+
* - `color="oklch(0.7 0.15 200)"` // OKLCH color
|
|
342
|
+
* - `color="red"` // CSS color name
|
|
343
|
+
* - `color={true}` // currentColor
|
|
344
|
+
*/
|
|
345
|
+
color?: ColorValue | boolean;
|
|
346
|
+
/**
|
|
347
|
+
* The fade style applies gradient-based fading masks to the edges of an element. Replaces complex CSS mask gradients with a simple, declarative API.
|
|
348
|
+
*
|
|
349
|
+
* Syntax: `[width] [direction...] [#from-color] [#to-color]`
|
|
350
|
+
*
|
|
351
|
+
* Multiple groups can be separated by commas to specify different widths and
|
|
352
|
+
* colors per direction. A group that names edges takes a single width, applied
|
|
353
|
+
* to every edge it names; a group that names none covers all four edges and
|
|
354
|
+
* keeps plain CSS shorthand order.
|
|
355
|
+
*
|
|
356
|
+
* Color tokens (optional):
|
|
357
|
+
* - First color: transparent start of gradient (default: `rgb(0 0 0 / 0)`)
|
|
358
|
+
* - Second color: opaque end of gradient (default: `rgb(0 0 0 / 1)`)
|
|
359
|
+
*
|
|
360
|
+
* Examples:
|
|
361
|
+
* - `fade="top"` // fade only top edge with default width
|
|
362
|
+
* - `fade="2x left right"` // fade left and right edges with 2x width
|
|
363
|
+
* - `fade={true}` // all edges at the design-system default width
|
|
364
|
+
* - `fade="1x top"` // fade only top edge with 1x width
|
|
365
|
+
* - `fade="3x 1x"` // all edges: top/bottom 3x, left/right 1x
|
|
366
|
+
* - `fade="3x top, 1x bottom"` // top: 3x width, bottom: 1x width
|
|
367
|
+
* - `fade="2x #transparent #dark"` // custom colors for gradient mask
|
|
368
|
+
* - `fade="1x top #clear #solid"` // top edge with custom mask colors
|
|
369
|
+
* - `fade="top #red #blue, bottom #green #yellow"` // different colors per direction
|
|
370
|
+
* - `fade="2x top #a #b, 1x bottom #c #d"` // different widths and colors per direction
|
|
371
|
+
*/
|
|
372
|
+
fade?: 'top' | 'right' | 'bottom' | 'left' | string | boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Scrollbar styling using standard CSS properties (`scrollbar-width`, `scrollbar-color`, `scrollbar-gutter`).
|
|
375
|
+
*
|
|
376
|
+
* Syntax: `[width] [modifiers...] [thumb-color] [track-color]`
|
|
377
|
+
*
|
|
378
|
+
* Width values: `thin` (default), `auto`, `none`
|
|
379
|
+
* Modifiers: `stable`, `both-edges`, `always`
|
|
380
|
+
*
|
|
381
|
+
* Examples:
|
|
382
|
+
* - `scrollbar={true}` // thin scrollbar, default colors
|
|
383
|
+
* - `scrollbar="thin #purple.40 #dark.04"`
|
|
384
|
+
* - `scrollbar="auto #red #blue"`
|
|
385
|
+
* - `scrollbar="none"`
|
|
386
|
+
* - `scrollbar="always #primary.50 #white.02"`
|
|
387
|
+
* - `scrollbar="thin stable #red #blue"`
|
|
388
|
+
*/
|
|
389
|
+
scrollbar?: string | boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Set font weight for bold texts.
|
|
392
|
+
*/
|
|
393
|
+
boldFontWeight?: number;
|
|
394
|
+
/**
|
|
395
|
+
* The gap style is a powerful, cross-layout shorthand for spacing between child elements. Works with flex, grid, and block layouts.
|
|
396
|
+
*
|
|
397
|
+
* For flex/grid: sets native `gap` property
|
|
398
|
+
* For block layouts: emulated using margin on children
|
|
399
|
+
*
|
|
400
|
+
* Examples:
|
|
401
|
+
* - `gap="2x"` // gap: 2x (or margin-bottom: 2x for block)
|
|
402
|
+
* - `gap="1x 2x"` // row gap: 1x, column gap: 2x
|
|
403
|
+
* - `gap={true}` // default gap (1x)
|
|
404
|
+
*/
|
|
405
|
+
gap?: CSSProperties['gap'] | string | boolean;
|
|
406
|
+
/**
|
|
407
|
+
* Shorthand for element padding. Supports custom units, directional modifiers, and design-system-driven defaults.
|
|
408
|
+
*
|
|
409
|
+
* A group that names directions takes a single value, applied to every
|
|
410
|
+
* direction it names — use comma groups for per-side values.
|
|
411
|
+
*
|
|
412
|
+
* Examples:
|
|
413
|
+
* - `padding="2x 1x"` // top/bottom: 2x, left/right: 1x
|
|
414
|
+
* - `padding="2x top"` // only top padding: 2x
|
|
415
|
+
* - `padding="1x left right"` // left and right padding: 1x
|
|
416
|
+
* - `padding="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: 0
|
|
417
|
+
* - `padding={true}` // default padding on all sides
|
|
418
|
+
*/
|
|
419
|
+
padding?: CSSProperties['padding'] | string | boolean;
|
|
420
|
+
/** Logical block-axis padding with `start`/`end` modifiers. */
|
|
421
|
+
blockPadding?: CSSProperties['paddingBlock'] | string | boolean;
|
|
422
|
+
/** Logical inline-axis padding with `start`/`end` modifiers. */
|
|
423
|
+
inlinePadding?: CSSProperties['paddingInline'] | string | boolean;
|
|
424
|
+
/**
|
|
425
|
+
* Shorthand for element margin. Supports custom units, directional modifiers, and design-system-driven defaults.
|
|
426
|
+
*
|
|
427
|
+
* A group that names directions takes a single value, applied to every
|
|
428
|
+
* direction it names — use comma groups for per-side values.
|
|
429
|
+
*
|
|
430
|
+
* Examples:
|
|
431
|
+
* - `margin="2x 1x"` // top/bottom: 2x, left/right: 1x
|
|
432
|
+
* - `margin="2x top"` // only top margin: 2x
|
|
433
|
+
* - `margin="1x left right"` // left and right margin: 1x
|
|
434
|
+
* - `margin="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: 0
|
|
435
|
+
* - `margin={true}` // default margin on all sides
|
|
436
|
+
*/
|
|
437
|
+
margin?: CSSProperties['margin'] | string | boolean;
|
|
438
|
+
/** Logical block-axis margin with `start`/`end` modifiers. */
|
|
439
|
+
blockMargin?: CSSProperties['marginBlock'] | string | boolean;
|
|
440
|
+
/** Logical inline-axis margin with `start`/`end` modifiers. */
|
|
441
|
+
inlineMargin?: CSSProperties['marginInline'] | string | boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Concise shorthand for setting element width, including min-width and max-width. Supports custom units and advanced sizing keywords.
|
|
444
|
+
*
|
|
445
|
+
* Syntax: `[value]` | `[min max]` | `[min value max]` | `[modifier value]`
|
|
446
|
+
*
|
|
447
|
+
* Modifiers: `min`, `max`
|
|
448
|
+
* Keywords: `stretch`, `max-content`, `min-content`, `fit-content`
|
|
449
|
+
*
|
|
450
|
+
* Examples:
|
|
451
|
+
* - `width="10x"` // width: 10x
|
|
452
|
+
* - `width="1x 10x"` // min-width: 1x; max-width: 10x
|
|
453
|
+
* - `width="min 2x"` // min-width: 2x
|
|
454
|
+
* - `width="stretch"` // width: stretch (fill-available)
|
|
455
|
+
* - `width={true}` // width: auto
|
|
456
|
+
*/
|
|
457
|
+
width?: CSSProperties['width'] | string | boolean;
|
|
458
|
+
/**
|
|
459
|
+
* Concise shorthand for setting element height, including min-height and max-height. Supports custom units and advanced sizing keywords.
|
|
460
|
+
*
|
|
461
|
+
* Syntax: `[value]` | `[min max]` | `[min value max]` | `[modifier value]`
|
|
462
|
+
*
|
|
463
|
+
* Modifiers: `min`, `max`
|
|
464
|
+
* Keywords: `stretch`, `max-content`, `min-content`, `fit-content`
|
|
465
|
+
*
|
|
466
|
+
* Examples:
|
|
467
|
+
* - `height="100px"` // height: 100px
|
|
468
|
+
* - `height="1x 5x 10x"` // min-height: 1x; height: 5x; max-height: 10x
|
|
469
|
+
* - `height="min 2x"` // min-height: 2x
|
|
470
|
+
* - `height={true}` // height: auto
|
|
471
|
+
*/
|
|
472
|
+
height?: CSSProperties['height'] | string | boolean;
|
|
473
|
+
/**
|
|
474
|
+
* Logical block size with the same enhanced min/max/fixed syntax as `width`.
|
|
475
|
+
* Emits native `block-size`, `min-block-size`, and `max-block-size` declarations.
|
|
476
|
+
*/
|
|
477
|
+
blockSize?: CSSProperties['blockSize'] | string | boolean;
|
|
478
|
+
/**
|
|
479
|
+
* Logical inline size with the same enhanced min/max/fixed syntax as `width`.
|
|
480
|
+
* Emits native `inline-size`, `min-inline-size`, and `max-inline-size` declarations.
|
|
481
|
+
*/
|
|
482
|
+
inlineSize?: CSSProperties['inlineSize'] | string | boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Shorthand for border width, style, and color. Supports directional modifiers and design-system defaults.
|
|
485
|
+
*
|
|
486
|
+
* Syntax: `[width] [style] [color] [directions]` | `[directions]` | `true`
|
|
487
|
+
*
|
|
488
|
+
* Multiple groups can be separated by commas. Later groups override earlier groups for conflicting directions.
|
|
489
|
+
*
|
|
490
|
+
* Examples:
|
|
491
|
+
* - `border={true}` // default border on all sides (1bw solid)
|
|
492
|
+
* - `border="2bw dashed #purple"` // 2bw dashed purple border
|
|
493
|
+
* - `border="2bw top"` // only top border: 2bw solid
|
|
494
|
+
* - `border="dotted #danger left right"` // left/right: 1bw dotted danger
|
|
495
|
+
* - `border="1bw #red, 2bw #blue top"` // all sides red 1bw, top overridden to blue 2bw
|
|
496
|
+
* - `border="1bw, dashed top bottom, #purple left right"` // base 1bw, dashed on top/bottom, purple on left/right
|
|
497
|
+
* - `border="1bw $my-style"` // custom property in the style slot
|
|
498
|
+
*
|
|
499
|
+
* A `$name` reference fills the first free slot — width, then style, then
|
|
500
|
+
* color. Colors are authored as `#name`; to point the color slot at a raw
|
|
501
|
+
* custom property directly, name it `$name-color`.
|
|
502
|
+
*/
|
|
503
|
+
border?: CSSProperties['border'] | string | boolean;
|
|
504
|
+
/** Logical block-axis border with `start`/`end` modifiers. */
|
|
505
|
+
blockBorder?: CSSProperties['borderBlock'] | string | boolean;
|
|
506
|
+
/** Logical inline-axis border with `start`/`end` modifiers. */
|
|
507
|
+
inlineBorder?: CSSProperties['borderInline'] | string | boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Powerful shorthand for CSS transitions using semantic names and design tokens. Supports grouped transitions for common UI effects.
|
|
510
|
+
*
|
|
511
|
+
* Semantic names: `fade`, `fill`, `border`, `radius`, `shadow`, `preset`, `gap`, `theme`
|
|
512
|
+
* Multiple transitions: separated by commas
|
|
513
|
+
*
|
|
514
|
+
* Examples:
|
|
515
|
+
* - `transition="fill 0.2s, radius 0.3s"` // transitions background-color and border-radius
|
|
516
|
+
* - `transition="fade 0.15s ease-in"` // transitions mask with easing
|
|
517
|
+
* - `transition="theme 0.3s"` // transitions all theme-related properties
|
|
518
|
+
* - `transition="preset 0.2s"` // transitions typography properties
|
|
519
|
+
*/
|
|
520
|
+
transition?: CSSProperties['transition'] | string;
|
|
521
|
+
/**
|
|
522
|
+
* Whether the element is hidden using `display: none`. Boolean shortcut for conditional element visibility.
|
|
523
|
+
*
|
|
524
|
+
* Examples:
|
|
525
|
+
* - `hide={true}` // display: none
|
|
526
|
+
* - `hide={false}` // element remains visible
|
|
527
|
+
*/
|
|
528
|
+
hide?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* The shadow style adds shadow effects around an element's frame. Supports multiple effects separated by commas with X/Y offsets, blur, spread radius, and color.
|
|
531
|
+
*
|
|
532
|
+
* Examples:
|
|
533
|
+
* - `shadow="1x .5x .5x #dark.50"` // custom shadow with Tasty units and colors
|
|
534
|
+
* - `shadow="0 1x 2x #dark.20"` // standard shadow syntax
|
|
535
|
+
* - `shadow={true}` // default shadow from design system
|
|
536
|
+
*/
|
|
537
|
+
shadow?: string | boolean;
|
|
538
|
+
/**
|
|
539
|
+
* The radius style rounds the corners of an element's outer border edge. Supports custom units, advanced shapes, and directional modifiers.
|
|
540
|
+
*
|
|
541
|
+
* Syntax: `[value] [modifiers]` | `[shape]` | `true`
|
|
542
|
+
*
|
|
543
|
+
* Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric), `inherit` (inherit from parent)
|
|
544
|
+
* Edge modifiers: `top`, `right`, `bottom`, `left` — the corner pair along that edge
|
|
545
|
+
* Corner modifiers: `top-left`, `top-right`, `bottom-right`, `bottom-left` — a single corner
|
|
546
|
+
*
|
|
547
|
+
* Examples:
|
|
548
|
+
* - `radius="2r"` // border-radius: calc(var(--radius) * 2)
|
|
549
|
+
* - `radius={true}` // default radius (1r)
|
|
550
|
+
* - `radius="round"` // fully rounded (9999rem)
|
|
551
|
+
* - `radius="leaf"` // asymmetric leaf shape
|
|
552
|
+
* - `radius="1r top"` // round both top corners
|
|
553
|
+
* - `radius="top-right"` // round only the top-right corner (1r)
|
|
554
|
+
* - `radius="4px top-left"` // round only the top-left corner
|
|
555
|
+
* - `radius="inherit"` // inherit border-radius from parent
|
|
556
|
+
* - `radius="inherit right"` // inherit only right corners (uses longhand properties)
|
|
557
|
+
*/
|
|
558
|
+
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | 'inherit' | string | true;
|
|
559
|
+
/**
|
|
560
|
+
* The flow style is a unified shorthand for controlling layout direction and wrapping in both flex and grid containers. Replaces `flexDirection` and `gridAutoFlow`.
|
|
561
|
+
*
|
|
562
|
+
* For flex: sets `flex-flow` (direction + wrapping)
|
|
563
|
+
* For grid: sets `grid-auto-flow` (direction + density)
|
|
564
|
+
* For block: determines gap direction (row/column)
|
|
565
|
+
*
|
|
566
|
+
* Syntax: `[direction] [wrap|dense]`
|
|
567
|
+
*
|
|
568
|
+
* Examples:
|
|
569
|
+
* - `flow="row wrap"` // flex-flow: row wrap
|
|
570
|
+
* - `flow="column dense"` // grid-auto-flow: column dense
|
|
571
|
+
* - `flow="row"` // primary axis direction
|
|
572
|
+
*/
|
|
573
|
+
flow?: CSSProperties['flexFlow'] | CSSProperties['gridAutoFlow'] | string;
|
|
574
|
+
/**
|
|
575
|
+
* The gridAreas style specifies named grid areas, establishing cells in the grid and assigning them names.
|
|
576
|
+
*
|
|
577
|
+
* Examples:
|
|
578
|
+
* - `gridAreas='"header header" "sidebar content" "footer footer"'`
|
|
579
|
+
*/
|
|
580
|
+
gridAreas?: CSSProperties['gridTemplateAreas'];
|
|
581
|
+
/**
|
|
582
|
+
* The gridColumns style defines line names and track sizing functions of grid columns.
|
|
583
|
+
*
|
|
584
|
+
* Examples:
|
|
585
|
+
* - `gridColumns="1fr 2fr 1fr"` // three columns with flex ratios
|
|
586
|
+
* - `gridColumns={3}` // three equal columns (shorthand)
|
|
587
|
+
* - `gridColumns="repeat(auto-fit, minmax(200px, 1fr))"` // responsive columns
|
|
588
|
+
*/
|
|
589
|
+
gridColumns?: CSSProperties['gridTemplateColumns'] | number;
|
|
590
|
+
/**
|
|
591
|
+
* The gridRows style defines line names and track sizing functions of grid rows.
|
|
592
|
+
*
|
|
593
|
+
* Examples:
|
|
594
|
+
* - `gridRows="auto 1fr auto"` // header, content, footer layout
|
|
595
|
+
* - `gridRows={4}` // four equal rows (shorthand)
|
|
596
|
+
* - `gridRows="repeat(3, 100px)"` // three 100px rows
|
|
597
|
+
*/
|
|
598
|
+
gridRows?: CSSProperties['gridTemplateRows'] | number;
|
|
599
|
+
/**
|
|
600
|
+
* The gridTemplate style is a shorthand property for defining grid columns, rows, and areas simultaneously.
|
|
601
|
+
*
|
|
602
|
+
* Examples:
|
|
603
|
+
* - `gridTemplate='"header header" auto "content sidebar" 1fr / 2fr 1fr'`
|
|
604
|
+
*/
|
|
605
|
+
gridTemplate?: CSSProperties['gridTemplate'];
|
|
606
|
+
/**
|
|
607
|
+
* The font style specifies a prioritized list of font family names with design-system-driven defaults and fallbacks.
|
|
608
|
+
*
|
|
609
|
+
* Examples:
|
|
610
|
+
* - `font="monospace"` // monospace font stack
|
|
611
|
+
* - `font="Helvetica, Arial, sans-serif"` // custom font list
|
|
612
|
+
* - `font={true}` // default design system font
|
|
613
|
+
*/
|
|
614
|
+
font?: CSSProperties['fontFamily'] | boolean;
|
|
615
|
+
/**
|
|
616
|
+
* The outline style sets the outline for the element.
|
|
617
|
+
*
|
|
618
|
+
* Syntax: `[width] [style] [color] / [offset]` | `true`
|
|
619
|
+
*
|
|
620
|
+
* Examples:
|
|
621
|
+
* - `outline="2ow dashed #purple"` // 2ow dashed purple outline
|
|
622
|
+
* - `outline="2ow #danger / 1x"` // 2ow solid danger outline, 1x offset
|
|
623
|
+
* - `outline={true}` // default outline (1ow solid)
|
|
624
|
+
* - `outline="2ow $my-style"` // custom property in the style slot
|
|
625
|
+
*
|
|
626
|
+
* A `$name` reference fills the first free slot — width, then style, then
|
|
627
|
+
* color. Colors are authored as `#name`; to point the color slot at a raw
|
|
628
|
+
* custom property directly, name it `$name-color`.
|
|
629
|
+
*/
|
|
630
|
+
outline?: string | boolean;
|
|
631
|
+
/**
|
|
632
|
+
* The outline offset style sets the offset of the outline.
|
|
633
|
+
*
|
|
634
|
+
* Examples:
|
|
635
|
+
* - `outlineOffset="4px"` // 4px offset
|
|
636
|
+
* - `outlineOffset="1x"` // 1x (8px) offset
|
|
637
|
+
*/
|
|
638
|
+
outlineOffset?: string | number;
|
|
639
|
+
/**
|
|
640
|
+
* The preset style sets base text settings according to named presets. Affects `font-size`, `line-height`, `letter-spacing`, `font-weight`, and `text-transform`.
|
|
641
|
+
*
|
|
642
|
+
* Syntax: `name`, `name / modifier...`, or `modifier...` (shorthand, name defaults to `inherit`).
|
|
643
|
+
* Multiple modifiers are space-separated and combine freely (e.g. `strong italic tight`).
|
|
644
|
+
* Preset names are project-specific. Augment `TastyPresetNames` to register them for autocomplete.
|
|
645
|
+
*
|
|
646
|
+
* Examples:
|
|
647
|
+
* - `preset="h1"` // heading 1 typography
|
|
648
|
+
* - `preset="h2 / strong"` // bold heading 2
|
|
649
|
+
* - `preset="h2 / strong italic"` // bold + italic heading 2
|
|
650
|
+
* - `preset="t2 / strong tight"` // bold text 2 with tight line-height
|
|
651
|
+
* - `preset="bold"` // inherit with bold (shorthand)
|
|
652
|
+
* - `preset="bold italic"` // inherit with bold + italic (shorthand)
|
|
653
|
+
* - `preset="t3"` // text size 3
|
|
654
|
+
*/
|
|
655
|
+
preset?: PresetName | (string & {});
|
|
656
|
+
/**
|
|
657
|
+
* Shorthand for `align-items` and `align-content`. Sets both properties for unified vertical alignment in flex/grid layouts.
|
|
658
|
+
*
|
|
659
|
+
* Examples:
|
|
660
|
+
* - `align="center"` // align-items: center; align-content: center
|
|
661
|
+
* - `align="flex-start"` // align both to start
|
|
662
|
+
* - `align="space-between"` // distribute space between items
|
|
663
|
+
*/
|
|
664
|
+
align?: CSSProperties['alignItems'] | CSSProperties['alignContent'];
|
|
665
|
+
/**
|
|
666
|
+
* Shorthand for `justify-items` and `justify-content`. Sets both properties for unified horizontal alignment in flex/grid layouts.
|
|
667
|
+
*
|
|
668
|
+
* Examples:
|
|
669
|
+
* - `justify="center"` // justify-items: center; justify-content: center
|
|
670
|
+
* - `justify="space-between"` // distribute space between items
|
|
671
|
+
* - `justify="flex-end"` // align both to end
|
|
672
|
+
*/
|
|
673
|
+
justify?: CSSProperties['justifyItems'] | CSSProperties['justifyContent'];
|
|
674
|
+
/**
|
|
675
|
+
* Shorthand for all placement properties. Sets all 4 longhands: align-items, justify-items, align-content, justify-content.
|
|
676
|
+
*
|
|
677
|
+
* Examples:
|
|
678
|
+
* - `place="center"` // all 4 longhands: center
|
|
679
|
+
* - `place="start end"` // align-*: start; justify-*: end
|
|
680
|
+
* - `place="stretch"` // all 4 longhands: stretch
|
|
681
|
+
*/
|
|
682
|
+
place?: CSSProperties['placeItems'] | CSSProperties['placeContent'] | string;
|
|
683
|
+
/**
|
|
684
|
+
* Sets `place-content` property for aligning and distributing content in grid/flex containers.
|
|
685
|
+
*
|
|
686
|
+
* Examples:
|
|
687
|
+
* - `placeContent="center"` // center content in both axes
|
|
688
|
+
* - `placeContent="space-between"` // distribute content with space between
|
|
689
|
+
*/
|
|
690
|
+
placeContent?: CSSProperties['placeContent'];
|
|
691
|
+
/**
|
|
692
|
+
* Sets `place-items` property for aligning items in grid/flex containers.
|
|
693
|
+
*
|
|
694
|
+
* Examples:
|
|
695
|
+
* - `placeItems="center"` // center items in both axes
|
|
696
|
+
* - `placeItems="start end"` // start on block axis, end on inline axis
|
|
697
|
+
*/
|
|
698
|
+
placeItems?: CSSProperties['placeItems'];
|
|
699
|
+
/**
|
|
700
|
+
* Shorthand for scroll-margin on all sides. Supports custom units and directional modifiers.
|
|
701
|
+
*
|
|
702
|
+
* Examples:
|
|
703
|
+
* - `scrollMargin="2x"` // scroll-margin on all sides: 2x
|
|
704
|
+
* - `scrollMargin="2x top"` // only top scroll-margin: 2x
|
|
705
|
+
* - `scrollMargin="2x top, 4x bottom"` // top: 2x, bottom: 4x
|
|
706
|
+
* - `scrollMargin={true}` // default scroll-margin on all sides
|
|
707
|
+
*/
|
|
708
|
+
scrollMargin?: CSSProperties['scrollMargin'] | string | boolean;
|
|
709
|
+
scrollMarginTop?: string | number | boolean;
|
|
710
|
+
scrollMarginRight?: string | number | boolean;
|
|
711
|
+
scrollMarginBottom?: string | number | boolean;
|
|
712
|
+
scrollMarginLeft?: string | number | boolean;
|
|
713
|
+
/** Logical block-axis scroll margin with `start`/`end` modifiers. */
|
|
714
|
+
blockScrollMargin?: CSSProperties['scrollMarginBlock'] | string | boolean;
|
|
715
|
+
/** Logical inline-axis scroll margin with `start`/`end` modifiers. */
|
|
716
|
+
inlineScrollMargin?: CSSProperties['scrollMarginInline'] | string | boolean;
|
|
717
|
+
/**
|
|
718
|
+
* Shorthand for physical scroll padding. Supports custom units and the same
|
|
719
|
+
* physical direction modifiers as `padding`.
|
|
720
|
+
*/
|
|
721
|
+
scrollPadding?: CSSProperties['scrollPadding'] | string | boolean;
|
|
722
|
+
scrollPaddingTop?: string | number | boolean;
|
|
723
|
+
scrollPaddingRight?: string | number | boolean;
|
|
724
|
+
scrollPaddingBottom?: string | number | boolean;
|
|
725
|
+
scrollPaddingLeft?: string | number | boolean;
|
|
726
|
+
/** Logical block-axis scroll padding with `start`/`end` modifiers. */
|
|
727
|
+
blockScrollPadding?: CSSProperties['scrollPaddingBlock'] | string | boolean;
|
|
728
|
+
/** Logical inline-axis scroll padding with `start`/`end` modifiers. */
|
|
729
|
+
inlineScrollPadding?: CSSProperties['scrollPaddingInline'] | string | boolean;
|
|
730
|
+
/**
|
|
731
|
+
* Shorthand for `top`, `right`, `bottom`, and `left` offsets. Supports custom units, directional modifiers, and positioning.
|
|
732
|
+
*
|
|
733
|
+
* Examples:
|
|
734
|
+
* - `inset="0"` // all sides: 0
|
|
735
|
+
* - `inset="2x top"` // only top offset: 2x
|
|
736
|
+
* - `inset="1x left right"` // left and right offsets: 1x
|
|
737
|
+
* - `inset="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: auto
|
|
738
|
+
* - `inset="bottom dock"` // bottom-anchored, full width: auto 0 0 0
|
|
739
|
+
* - `inset={true}` // all sides: 0
|
|
740
|
+
*
|
|
741
|
+
* A group that names directions takes a single value, applied to every
|
|
742
|
+
* direction it names — use comma groups for per-side values.
|
|
743
|
+
*
|
|
744
|
+
* The `dock` modifier pins the named edge and spans its full length, applying
|
|
745
|
+
* the value to the two perpendicular sides as well. `dock` is the one case
|
|
746
|
+
* where a directional group takes two values: the second applies to those
|
|
747
|
+
* spanned sides, so `inset="2x 4x bottom dock"` pins the bottom at `2x` and
|
|
748
|
+
* insets the sides by `4x`. Without `dock` a second value is ignored.
|
|
749
|
+
*/
|
|
750
|
+
inset?: 'top' | 'right' | 'bottom' | 'left' | 'dock' | string | CSSProperties['inset'];
|
|
751
|
+
/** Logical block-axis inset with `start`/`end` modifiers. */
|
|
752
|
+
blockInset?: CSSProperties['insetBlock'] | string | boolean;
|
|
753
|
+
/** Logical inline-axis inset with `start`/`end` modifiers. */
|
|
754
|
+
inlineInset?: CSSProperties['insetInline'] | string | boolean;
|
|
755
|
+
/**
|
|
756
|
+
* Local keyframes definitions for this component.
|
|
757
|
+
* Keys are animation names, values are keyframes step definitions.
|
|
758
|
+
* Local keyframes override global keyframes with the same name.
|
|
759
|
+
*
|
|
760
|
+
* Examples:
|
|
761
|
+
* - `'@keyframes': { fadeIn: { from: { opacity: 0 }, to: { opacity: 1 } } }`
|
|
762
|
+
* - `'@keyframes': { pulse: { '0%, 100%': { transform: 'scale(1)' }, '50%': { transform: 'scale(1.05)' } } }`
|
|
763
|
+
*/
|
|
764
|
+
'@keyframes'?: Record<string, KeyframesSteps>;
|
|
765
|
+
/**
|
|
766
|
+
* CSS @property definitions for custom properties using tasty token syntax.
|
|
767
|
+
* Properties are registered once and are permanent (never removed).
|
|
768
|
+
*
|
|
769
|
+
* Token formats:
|
|
770
|
+
* - `$name` for regular properties → `--name` (requires syntax to be specified)
|
|
771
|
+
* - `#name` for color properties → `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
|
|
772
|
+
*
|
|
773
|
+
* Examples:
|
|
774
|
+
* - `'@property': { '$rotation': { syntax: '<angle>', inherits: false, initialValue: '45deg' } }`
|
|
775
|
+
* - `'@property': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
|
|
776
|
+
*/
|
|
777
|
+
'@property'?: Record<string, PropertyDefinition>;
|
|
778
|
+
/**
|
|
779
|
+
* Local @font-face definitions for this component.
|
|
780
|
+
* Keys are font-family names, values are descriptors or arrays of descriptors
|
|
781
|
+
* (for multiple weights/styles of the same family).
|
|
782
|
+
*
|
|
783
|
+
* Examples:
|
|
784
|
+
* - `'@font-face': { Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' } }`
|
|
785
|
+
* - `'@font-face': { 'Brand Sans': [{ src: '...', fontWeight: 400 }, { src: '...', fontWeight: 700 }] }`
|
|
786
|
+
*/
|
|
787
|
+
'@font-face'?: Record<string, FontFaceInput>;
|
|
788
|
+
/**
|
|
789
|
+
* Local @counter-style definitions for this component.
|
|
790
|
+
* Keys are counter-style names, values are descriptor objects.
|
|
791
|
+
*
|
|
792
|
+
* Examples:
|
|
793
|
+
* - `'@counter-style': { thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' } }`
|
|
794
|
+
*/
|
|
795
|
+
'@counter-style'?: Record<string, CounterStyleDescriptors>;
|
|
796
|
+
/**
|
|
797
|
+
* Local @function definitions (CSS custom functions) for this component.
|
|
798
|
+
* Keys are function names using `$$name` (the literal callable `--name`),
|
|
799
|
+
* matching the call site `$$name(...)`. Values are function definitions.
|
|
800
|
+
*
|
|
801
|
+
* Local variables are declared directly as `$name` keys on the descriptor;
|
|
802
|
+
* `result`, local-var values, and parameter defaults are parsed through the
|
|
803
|
+
* Tasty DSL (units, color tokens, auto-calc, fallbacks).
|
|
804
|
+
*
|
|
805
|
+
* Examples:
|
|
806
|
+
* - `'@function': { '$$negative': { args: ['$value'], result: '(-1 * $value)' } }`
|
|
807
|
+
* - `'@function': { '$$shadow': { args: { '$color': { syntax: '<color>', default: 'inherit' } }, returns: '<color>', '$offset': '2px', result: '$offset $offset ($color, black)' } }`
|
|
808
|
+
*/
|
|
809
|
+
'@function'?: Record<string, FunctionDefinition>;
|
|
810
|
+
/**
|
|
811
|
+
* Apply one or more predefined style recipes by name.
|
|
812
|
+
* Recipes are defined globally via `configure({ recipes: { ... } })`.
|
|
813
|
+
* Multiple recipes are space-separated. Use `/` to separate base recipes
|
|
814
|
+
* (applied before component styles) from post recipes (applied after, via mergeStyles).
|
|
815
|
+
* Use `none` to explicitly skip base recipes.
|
|
816
|
+
*
|
|
817
|
+
* Examples:
|
|
818
|
+
* - `recipe: 'card'` // Apply the 'card' recipe
|
|
819
|
+
* - `recipe: 'card elevated'` // Apply 'card' then 'elevated', then component styles
|
|
820
|
+
* - `recipe: 'reset input / input-autofill'` // Base recipes, then post recipe
|
|
821
|
+
* - `recipe: 'none / disabled'` // No base recipes, only post recipe
|
|
822
|
+
* - `recipe: ''` // Clear recipes from base styles when extending
|
|
823
|
+
*/
|
|
824
|
+
recipe?: string;
|
|
825
|
+
}
|
|
826
|
+
type SuffixForSelector = '&' | '.' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
|
827
|
+
type Selector = `${SuffixForSelector}${string}`;
|
|
828
|
+
type NotSelector = Exclude<string, Selector | keyof StylesInterface>;
|
|
829
|
+
/** Special style keys that should not be wrapped in StyleValue/StyleValueStateMap */
|
|
830
|
+
type SpecialStyleKeys = '@keyframes' | '@property' | '@font-face' | '@counter-style' | '@function' | 'recipe';
|
|
831
|
+
type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> };
|
|
832
|
+
/**
|
|
833
|
+
* Index signature for recipe-specific arbitrary keys.
|
|
834
|
+
* Supports local predefined states (`@name`), vendor-prefixed CSS properties (`-webkit-*`),
|
|
835
|
+
* CSS custom properties (`$name`), and color tokens (`#name`).
|
|
836
|
+
* Unlike StylesIndexSignature, does NOT allow sub-element selectors (recipes are flat).
|
|
837
|
+
*/
|
|
838
|
+
type RecipeIndexSignature = Record<string, StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined>>;
|
|
839
|
+
/**
|
|
840
|
+
* Style type for recipe definitions.
|
|
841
|
+
* Like StylesWithoutSelectors but also allows `@keyframes`, `@property`,
|
|
842
|
+
* local predefined states, and vendor-prefixed CSS properties.
|
|
843
|
+
* Excludes `recipe` to prevent recursive references.
|
|
844
|
+
*/
|
|
845
|
+
type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
|
|
846
|
+
'@keyframes'?: StylesInterface['@keyframes'];
|
|
847
|
+
'@property'?: StylesInterface['@property'];
|
|
848
|
+
'@font-face'?: StylesInterface['@font-face'];
|
|
849
|
+
'@counter-style'?: StylesInterface['@counter-style'];
|
|
850
|
+
'@function'?: StylesInterface['@function'];
|
|
851
|
+
};
|
|
852
|
+
/** Special properties that are not regular style values */
|
|
853
|
+
interface SpecialStyleProperties {
|
|
854
|
+
'@keyframes'?: StylesInterface['@keyframes'];
|
|
855
|
+
'@property'?: StylesInterface['@property'];
|
|
856
|
+
'@font-face'?: StylesInterface['@font-face'];
|
|
857
|
+
'@counter-style'?: StylesInterface['@counter-style'];
|
|
858
|
+
'@function'?: StylesInterface['@function'];
|
|
859
|
+
recipe?: StylesInterface['recipe'];
|
|
860
|
+
}
|
|
861
|
+
/** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
|
|
862
|
+
interface StylesIndexSignature {
|
|
863
|
+
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@property'] | StylesInterface['@font-face'] | StylesInterface['@counter-style'] | StylesInterface['@function'];
|
|
864
|
+
/**
|
|
865
|
+
* Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
|
|
866
|
+
* Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
|
|
867
|
+
*/
|
|
868
|
+
$?: string;
|
|
869
|
+
}
|
|
870
|
+
type Styles = StylesWithoutSelectors & SpecialStyleProperties & StylesIndexSignature;
|
|
871
|
+
/**
|
|
872
|
+
* Value type for design tokens passed to `configure({ tokens })`.
|
|
873
|
+
* Can be a direct value or a state map for responsive/theme-aware tokens.
|
|
874
|
+
*/
|
|
875
|
+
type ConfigTokenValue = string | number | boolean | Record<string, string | number | boolean | undefined | null | '@inherit'>;
|
|
876
|
+
/**
|
|
877
|
+
* Design tokens injected as CSS custom properties on `:root`.
|
|
878
|
+
* Keys must start with `$` (value tokens) or `#` (color tokens).
|
|
879
|
+
*
|
|
880
|
+
* - `$name` keys become `--name` CSS custom properties
|
|
881
|
+
* - `#name` keys become `--name-color` properties
|
|
882
|
+
*/
|
|
883
|
+
type ConfigTokens = Record<`$${string}` | `#${string}`, ConfigTokenValue>;
|
|
884
|
+
//#endregion
|
|
885
|
+
//#region src/utils/is-selector.d.ts
|
|
886
|
+
/** Check whether a style-object key identifies a nested CSS selector. */
|
|
887
|
+
declare function isSelector(key: string): boolean;
|
|
888
|
+
//#endregion
|
|
889
|
+
//#region src/pipeline/conditions.d.ts
|
|
890
|
+
/**
|
|
891
|
+
* ConditionNode Types and Helpers
|
|
892
|
+
*
|
|
893
|
+
* Core data structures for representing style conditions as an abstract syntax tree.
|
|
894
|
+
* Used throughout the pipeline for parsing, simplification, and CSS generation.
|
|
895
|
+
*/
|
|
896
|
+
/**
|
|
897
|
+
* Base interface for all state conditions (leaf nodes)
|
|
898
|
+
*/
|
|
899
|
+
interface BaseStateCondition {
|
|
900
|
+
kind: 'state';
|
|
901
|
+
negated: boolean;
|
|
902
|
+
raw: string;
|
|
903
|
+
uniqueId: string;
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Modifier condition: [data-attr] or [data-attr="value"]
|
|
907
|
+
*/
|
|
908
|
+
interface ModifierCondition extends BaseStateCondition {
|
|
909
|
+
type: 'modifier';
|
|
910
|
+
attribute: string;
|
|
911
|
+
value?: string;
|
|
912
|
+
operator?: '=' | '^=' | '$=' | '*=';
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Pseudo-class condition: :hover, :focus-visible
|
|
916
|
+
*/
|
|
917
|
+
interface PseudoCondition extends BaseStateCondition {
|
|
918
|
+
type: 'pseudo';
|
|
919
|
+
pseudo: string;
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* Numeric bound for dimension queries
|
|
923
|
+
*/
|
|
924
|
+
interface NumericBound {
|
|
925
|
+
value: string;
|
|
926
|
+
valueNumeric: number | null;
|
|
927
|
+
inclusive: boolean;
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Media query condition
|
|
931
|
+
*/
|
|
932
|
+
interface MediaCondition extends BaseStateCondition {
|
|
933
|
+
type: 'media';
|
|
934
|
+
subtype: 'dimension' | 'feature' | 'type';
|
|
935
|
+
dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
|
|
936
|
+
lowerBound?: NumericBound;
|
|
937
|
+
upperBound?: NumericBound;
|
|
938
|
+
feature?: string;
|
|
939
|
+
featureValue?: string;
|
|
940
|
+
mediaType?: 'print' | 'screen' | 'all' | 'speech';
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Container query condition
|
|
944
|
+
*/
|
|
945
|
+
interface ContainerCondition extends BaseStateCondition {
|
|
946
|
+
type: 'container';
|
|
947
|
+
subtype: 'dimension' | 'style' | 'raw';
|
|
948
|
+
containerName?: string;
|
|
949
|
+
dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
|
|
950
|
+
lowerBound?: NumericBound;
|
|
951
|
+
upperBound?: NumericBound;
|
|
952
|
+
property?: string;
|
|
953
|
+
propertyValue?: string;
|
|
954
|
+
rawCondition?: string;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Root state condition: @root(theme=dark)
|
|
958
|
+
*/
|
|
959
|
+
interface RootCondition extends BaseStateCondition {
|
|
960
|
+
type: 'root';
|
|
961
|
+
innerCondition: ConditionNode;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Parent state condition: @parent(hovered), @parent(theme=dark, >)
|
|
965
|
+
*/
|
|
966
|
+
interface ParentCondition extends BaseStateCondition {
|
|
967
|
+
type: 'parent';
|
|
968
|
+
innerCondition: ConditionNode;
|
|
969
|
+
direct: boolean;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Own state condition: @own(hovered)
|
|
973
|
+
*/
|
|
974
|
+
interface OwnCondition extends BaseStateCondition {
|
|
975
|
+
type: 'own';
|
|
976
|
+
innerCondition: ConditionNode;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Starting style condition: @starting
|
|
980
|
+
*/
|
|
981
|
+
interface StartingCondition extends BaseStateCondition {
|
|
982
|
+
type: 'starting';
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Supports query condition: @supports(display: grid), @supports($, :has(*))
|
|
986
|
+
*/
|
|
987
|
+
interface SupportsCondition extends BaseStateCondition {
|
|
988
|
+
type: 'supports';
|
|
989
|
+
subtype: 'feature' | 'selector';
|
|
990
|
+
condition: string;
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Union of all state condition types
|
|
994
|
+
*/
|
|
995
|
+
type StateCondition = ModifierCondition | PseudoCondition | MediaCondition | ContainerCondition | RootCondition | ParentCondition | OwnCondition | StartingCondition | SupportsCondition;
|
|
996
|
+
/**
|
|
997
|
+
* Compound node: combines conditions with AND/OR
|
|
998
|
+
*/
|
|
999
|
+
interface CompoundCondition {
|
|
1000
|
+
kind: 'compound';
|
|
1001
|
+
operator: 'AND' | 'OR';
|
|
1002
|
+
children: ConditionNode[];
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* True condition (matches everything)
|
|
1006
|
+
*/
|
|
1007
|
+
interface TrueCondition {
|
|
1008
|
+
kind: 'true';
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* False condition (matches nothing - skip this rule)
|
|
1012
|
+
*/
|
|
1013
|
+
interface FalseCondition {
|
|
1014
|
+
kind: 'false';
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Union of all condition node types
|
|
1018
|
+
*/
|
|
1019
|
+
type ConditionNode = StateCondition | CompoundCondition | TrueCondition | FalseCondition;
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region src/states/index.d.ts
|
|
1022
|
+
/**
|
|
1023
|
+
* Parsed advanced state information
|
|
1024
|
+
*/
|
|
1025
|
+
interface ParsedAdvancedState {
|
|
1026
|
+
type: 'media' | 'container' | 'root' | 'parent' | 'own' | 'starting' | 'predefined' | 'modifier';
|
|
1027
|
+
condition: string;
|
|
1028
|
+
containerName?: string;
|
|
1029
|
+
raw: string;
|
|
1030
|
+
mediaType?: string;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Context for state parsing operations
|
|
1034
|
+
*/
|
|
1035
|
+
interface StateParserContext {
|
|
1036
|
+
localPredefinedStates: Record<string, string>;
|
|
1037
|
+
globalPredefinedStates: Record<string, string>;
|
|
1038
|
+
isSubElement?: boolean;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* At-rule context for CSS generation
|
|
1042
|
+
*/
|
|
1043
|
+
interface AtRuleContext {
|
|
1044
|
+
media?: string[];
|
|
1045
|
+
container?: {
|
|
1046
|
+
name?: string;
|
|
1047
|
+
condition: string;
|
|
1048
|
+
}[];
|
|
1049
|
+
startingStyle?: boolean;
|
|
1050
|
+
rootStates?: string[];
|
|
1051
|
+
negatedRootStates?: string[];
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Configure global predefined states
|
|
1055
|
+
*/
|
|
1056
|
+
declare function setGlobalPredefinedStates(states: Record<string, string>): void;
|
|
1057
|
+
/**
|
|
1058
|
+
* Get global predefined states
|
|
1059
|
+
*/
|
|
1060
|
+
declare function getGlobalPredefinedStates(): Record<string, string>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Create a state parser context from styles
|
|
1063
|
+
*/
|
|
1064
|
+
declare function createStateParserContext(styles?: Styles, isSubElement?: boolean): StateParserContext;
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region src/pipeline/parseStateKey.d.ts
|
|
1067
|
+
interface ParseStateKeyOptions {
|
|
1068
|
+
context?: StateParserContext;
|
|
1069
|
+
isSubElement?: boolean;
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Parse a state key string into a ConditionNode
|
|
1073
|
+
*/
|
|
1074
|
+
declare function parseStateKey(stateKey: string, options?: ParseStateKeyOptions): ConditionNode;
|
|
1075
|
+
//#endregion
|
|
1076
|
+
//#region src/pipeline/index.d.ts
|
|
1077
|
+
/**
|
|
1078
|
+
* Matches the old StyleResult interface for backward compatibility
|
|
1079
|
+
*/
|
|
1080
|
+
interface StyleResult {
|
|
1081
|
+
selector: string;
|
|
1082
|
+
declarations: string;
|
|
1083
|
+
atRules?: string[];
|
|
1084
|
+
needsClassName?: boolean;
|
|
1085
|
+
rootPrefix?: string;
|
|
1086
|
+
/** When true, declarations are wrapped in @starting-style { ... } inside the selector rule */
|
|
1087
|
+
startingStyle?: boolean;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Matches the old RenderResult interface for backward compatibility
|
|
1091
|
+
*/
|
|
1092
|
+
interface RenderResult {
|
|
1093
|
+
rules: StyleResult[];
|
|
1094
|
+
className?: string;
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Options for renderStyles when using direct selector mode.
|
|
1098
|
+
*/
|
|
1099
|
+
interface RenderStylesOptions {
|
|
1100
|
+
/**
|
|
1101
|
+
* Whether to double the class selector for increased specificity.
|
|
1102
|
+
* When true, `.myClass` becomes `.myClass.myClass` for higher specificity.
|
|
1103
|
+
*
|
|
1104
|
+
* @default false - User-provided selectors are not doubled.
|
|
1105
|
+
*
|
|
1106
|
+
* Note: This only applies when a classNameOrSelector is provided.
|
|
1107
|
+
* When renderStyles returns RenderResult with needsClassName=true,
|
|
1108
|
+
* the injector handles doubling automatically.
|
|
1109
|
+
*/
|
|
1110
|
+
doubleSelector?: boolean;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* Render styles to CSS rules.
|
|
1114
|
+
*
|
|
1115
|
+
* When called without classNameOrSelector, returns RenderResult with needsClassName=true.
|
|
1116
|
+
* When called with a selector/className string, returns StyleResult[] for direct injection.
|
|
1117
|
+
*/
|
|
1118
|
+
declare function renderStyles(styles?: Styles, classNameOrSelector?: undefined, options?: undefined, pipelineCacheKey?: string): RenderResult;
|
|
1119
|
+
declare function renderStyles(styles: Styles | undefined, classNameOrSelector: string, options?: RenderStylesOptions): StyleResult[];
|
|
1120
|
+
//#endregion
|
|
1121
|
+
//#region src/properties/property-type-resolver.d.ts
|
|
1122
|
+
/**
|
|
1123
|
+
* PropertyTypeResolver
|
|
1124
|
+
*
|
|
1125
|
+
* Automatically infers CSS @property types from custom property values.
|
|
1126
|
+
* Supports deferred resolution for var() reference chains of arbitrary depth.
|
|
1127
|
+
*/
|
|
1128
|
+
declare class PropertyTypeResolver {
|
|
1129
|
+
/** propName → the prop it depends on */
|
|
1130
|
+
private pendingDeps;
|
|
1131
|
+
/** propName → list of props waiting on it */
|
|
1132
|
+
private reverseDeps;
|
|
1133
|
+
/**
|
|
1134
|
+
* Scan CSS declarations and auto-register @property for custom properties
|
|
1135
|
+
* whose types can be inferred from their values.
|
|
1136
|
+
*/
|
|
1137
|
+
scanDeclarations(declarations: string, isPropertyDefined: (name: string) => boolean, registerProperty: (name: string, syntax: string, initialValue: string) => void): void;
|
|
1138
|
+
private addDependency;
|
|
1139
|
+
private resolve;
|
|
1140
|
+
private isComplexValue;
|
|
1141
|
+
}
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region src/injector/batch.d.ts
|
|
1144
|
+
/**
|
|
1145
|
+
* Deferred CSSOM writes ("batched injection").
|
|
1146
|
+
*
|
|
1147
|
+
* Every `insertRule()` on a live stylesheet invalidates style for the sheet's
|
|
1148
|
+
* scope, so Blink recalculates style the next time anything reads layout or
|
|
1149
|
+
* computed style. When components inject during React's render phase and other
|
|
1150
|
+
* components read layout in the same pass, the two interleave:
|
|
1151
|
+
*
|
|
1152
|
+
* inject -> read (forced recalc) -> inject -> read (forced recalc) -> ...
|
|
1153
|
+
*
|
|
1154
|
+
* Batching moves every sheet write out from between those reads. Writes are
|
|
1155
|
+
* queued in FIFO order and drained in one go, so the tree is invalidated once
|
|
1156
|
+
* per flush instead of once per component.
|
|
1157
|
+
*
|
|
1158
|
+
* ## Ordering
|
|
1159
|
+
*
|
|
1160
|
+
* A single queue holds *all* writes — component rules, global rules, keyframes,
|
|
1161
|
+
* `@property`, `@font-face`, `@counter-style`, `@function` and raw CSS. Draining
|
|
1162
|
+
* it in insertion order keeps the sheet byte-identical to unbatched output,
|
|
1163
|
+
* which matters because equal-specificity rules resolve by document order.
|
|
1164
|
+
*
|
|
1165
|
+
* ## Batch windows — why queuing is safe
|
|
1166
|
+
*
|
|
1167
|
+
* Deferring a write past React's layout phase would let a `useLayoutEffect`
|
|
1168
|
+
* measure an element whose rules are not in the sheet yet, reading the unstyled
|
|
1169
|
+
* box. `<TastyBatchProvider>` closes that hole by opening a *window* during its
|
|
1170
|
+
* render and closing it — flushing — in its `useInsertionEffect`, which React
|
|
1171
|
+
* runs in the mutation phase, before any layout effect:
|
|
1172
|
+
*
|
|
1173
|
+
* provider renders -> window OPEN
|
|
1174
|
+
* children render -> injections queued
|
|
1175
|
+
* provider insertionEffect -> FLUSH, window CLOSED
|
|
1176
|
+
* layout effects run -> rules are in the sheet
|
|
1177
|
+
*
|
|
1178
|
+
* So in the default (`batchInjection: true`) mode a write is only ever queued
|
|
1179
|
+
* inside a commit whose flush is already guaranteed by that same commit. Every
|
|
1180
|
+
* injection outside a window — a deep update the provider did not re-render
|
|
1181
|
+
* for, a `useLayoutEffect` that injects, an event handler, an async callback —
|
|
1182
|
+
* is written straight through, exactly as with batching off.
|
|
1183
|
+
*
|
|
1184
|
+
* `batchInjection: 'always'` opts out of the gate and queues unconditionally.
|
|
1185
|
+
* That wins on more commits, at the cost of the measurement hazard above.
|
|
1186
|
+
*
|
|
1187
|
+
* ## Flush points (earliest wins)
|
|
1188
|
+
*
|
|
1189
|
+
* 1. `<TastyBatchProvider>`'s `useInsertionEffect` — closes the window.
|
|
1190
|
+
* 2. A microtask — a backstop for a render that was aborted or suspended and
|
|
1191
|
+
* therefore never reached its insertion effect. An aborted render mounts
|
|
1192
|
+
* nothing, so nothing can measure what it queued. Microtasks also always
|
|
1193
|
+
* drain before paint, so styles are never visually missing.
|
|
1194
|
+
* 3. `flushStyles()` — explicit, and called internally by every injector read
|
|
1195
|
+
* API (`getCSSText`, `cleanup`, `gc`, `destroy`, ...).
|
|
1196
|
+
*/
|
|
1197
|
+
interface QueuedWrite {
|
|
1198
|
+
/** Perform the deferred sheet write. */
|
|
1199
|
+
run: () => void;
|
|
1200
|
+
/** Set when the owner disposed before the write happened. */
|
|
1201
|
+
cancelled: boolean;
|
|
1202
|
+
/** Set once the write has been applied (or skipped as cancelled). */
|
|
1203
|
+
done: boolean;
|
|
1204
|
+
}
|
|
1205
|
+
/** Whether any write is still waiting to hit a stylesheet. */
|
|
1206
|
+
declare function hasPendingStyleWrites(): boolean;
|
|
1207
|
+
/**
|
|
1208
|
+
* Drain every pending sheet write, in insertion order.
|
|
1209
|
+
*
|
|
1210
|
+
* Safe to call when the queue is empty (the common case, so the guard comes
|
|
1211
|
+
* first) and safe to call re-entrantly: a nested `flushStyles()` is a no-op,
|
|
1212
|
+
* and work a draining write triggers is written in place by
|
|
1213
|
+
* `enqueueStyleWrite` rather than queued behind the rest of the batch.
|
|
1214
|
+
*/
|
|
1215
|
+
declare function flushStyles(): void;
|
|
1216
|
+
/**
|
|
1217
|
+
* Drop every pending write without applying it. Test helper — production code
|
|
1218
|
+
* should call `flushStyles()` instead.
|
|
1219
|
+
*/
|
|
1220
|
+
declare function resetStyleBatch(): void;
|
|
1221
|
+
//#endregion
|
|
1222
|
+
//#region src/injector/types.d.ts
|
|
1223
|
+
declare global {
|
|
1224
|
+
interface Window {
|
|
1225
|
+
__TASTY__?: string[];
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
interface InjectResult {
|
|
1229
|
+
className: string;
|
|
1230
|
+
dispose: () => void;
|
|
1231
|
+
}
|
|
1232
|
+
interface GlobalInjectResult {
|
|
1233
|
+
dispose: () => void;
|
|
1234
|
+
}
|
|
1235
|
+
type DisposeFunction = () => void;
|
|
1236
|
+
interface StyleInjectorConfig {
|
|
1237
|
+
nonce?: string;
|
|
1238
|
+
maxRulesPerSheet?: number;
|
|
1239
|
+
forceTextInjection?: boolean;
|
|
1240
|
+
/** Enable development mode features: performance metrics and debug information storage */
|
|
1241
|
+
devMode?: boolean;
|
|
1242
|
+
/**
|
|
1243
|
+
* Global predefined states for advanced state mapping.
|
|
1244
|
+
* These are state aliases that can be used in any component.
|
|
1245
|
+
* Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
|
|
1246
|
+
*/
|
|
1247
|
+
states?: Record<string, string>;
|
|
1248
|
+
/**
|
|
1249
|
+
* Automatically infer and register CSS @property declarations
|
|
1250
|
+
* from custom property values. When false, only explicit @property are used.
|
|
1251
|
+
* @default true
|
|
1252
|
+
*/
|
|
1253
|
+
autoPropertyTypes?: boolean;
|
|
1254
|
+
/** Garbage collection configuration for unused styles */
|
|
1255
|
+
gc?: GCConfig;
|
|
1256
|
+
/**
|
|
1257
|
+
* Prefix prepended to every generated identifier.
|
|
1258
|
+
* Mirrors the `namePrefix` field on the public `TastyConfig` so that
|
|
1259
|
+
* standalone injector consumers can configure it directly.
|
|
1260
|
+
* @default 't'
|
|
1261
|
+
*/
|
|
1262
|
+
namePrefix?: string;
|
|
1263
|
+
/**
|
|
1264
|
+
* Defer stylesheet writes and apply them in one batch instead of one
|
|
1265
|
+
* `insertRule()` per component. Mirrors `batchInjection` on the public
|
|
1266
|
+
* `TastyConfig`.
|
|
1267
|
+
* @default false
|
|
1268
|
+
*/
|
|
1269
|
+
batchInjection?: boolean | 'always';
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Per-className usage tracking for GC.
|
|
1273
|
+
*/
|
|
1274
|
+
/**
|
|
1275
|
+
* @deprecated Nothing reads this any more. Collection asks the DOM what is
|
|
1276
|
+
* rendered rather than tracking usage per class, so there is no usage record
|
|
1277
|
+
* to describe. Kept so existing imports keep type-checking.
|
|
1278
|
+
*/
|
|
1279
|
+
interface StyleUsage {
|
|
1280
|
+
lastTouchedAt: number;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Configuration for the style garbage collector.
|
|
1284
|
+
*
|
|
1285
|
+
* GC is triggered by touch count rather than timers: every `touchInterval`
|
|
1286
|
+
* touches, an idle callback is scheduled to evict unused styles above
|
|
1287
|
+
* `capacity`, oldest first.
|
|
1288
|
+
*/
|
|
1289
|
+
interface GCConfig {
|
|
1290
|
+
/**
|
|
1291
|
+
* How long a class is left alone after collection first notices nothing is
|
|
1292
|
+
* carrying it, in milliseconds (default 10,000).
|
|
1293
|
+
*
|
|
1294
|
+
* Rendering is not commit-aware: a render can resolve a class and commit it a
|
|
1295
|
+
* little later, and in between nothing on the page carries it. Rather than
|
|
1296
|
+
* try to tell that apart from a class that is finished — which cannot be done
|
|
1297
|
+
* from outside React — collection simply does not touch anything that was in
|
|
1298
|
+
* use recently. A render would have to stay pending for the whole window to
|
|
1299
|
+
* lose its rules, and it gets them back on its next render.
|
|
1300
|
+
*/
|
|
1301
|
+
grace?: number;
|
|
1302
|
+
/**
|
|
1303
|
+
* Number of touch events between automatic GC cycles.
|
|
1304
|
+
* @default 1000
|
|
1305
|
+
*/
|
|
1306
|
+
touchInterval?: number;
|
|
1307
|
+
/**
|
|
1308
|
+
* Maximum number of unused styles to retain.
|
|
1309
|
+
* GC evicts the oldest unused styles when this limit is exceeded.
|
|
1310
|
+
* Pinned styles and DOM-live styles
|
|
1311
|
+
* do not count against this limit.
|
|
1312
|
+
* @default 1000
|
|
1313
|
+
*/
|
|
1314
|
+
capacity?: number;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Per-call options for inject().
|
|
1318
|
+
*/
|
|
1319
|
+
interface InjectOptions {
|
|
1320
|
+
root?: Document | ShadowRoot;
|
|
1321
|
+
/** Reuse the class already injected for this key instead of writing again. */
|
|
1322
|
+
cacheKey?: string;
|
|
1323
|
+
/**
|
|
1324
|
+
* Pin the injected class (default `true`). A pinned class is never evicted by
|
|
1325
|
+
* `gc()`, and the returned `dispose()` releases the pin. Pass `false` when the
|
|
1326
|
+
* caller keeps no handle and the DOM is the only record that the class is in
|
|
1327
|
+
* use — the render path does this, because a hook-free render has no unmount
|
|
1328
|
+
* signal to dispose on.
|
|
1329
|
+
*/
|
|
1330
|
+
pin?: boolean;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Per-call options for gc().
|
|
1334
|
+
*/
|
|
1335
|
+
interface GCOptions {
|
|
1336
|
+
root?: Document | ShadowRoot;
|
|
1337
|
+
/** Bypass capacity threshold and remove ALL unused styles. */
|
|
1338
|
+
force?: boolean;
|
|
1339
|
+
}
|
|
1340
|
+
interface RuleInfo {
|
|
1341
|
+
className: string;
|
|
1342
|
+
ruleIndex: number;
|
|
1343
|
+
sheetIndex: number;
|
|
1344
|
+
/** Dev-only: full CSS texts inserted for this class; omitted in production */
|
|
1345
|
+
cssText?: string[];
|
|
1346
|
+
/** Inclusive end index of the contiguous block of inserted rules for this className */
|
|
1347
|
+
endRuleIndex?: number;
|
|
1348
|
+
/** NEW: exact indices of all inserted rules for this className */
|
|
1349
|
+
indices?: number[];
|
|
1350
|
+
}
|
|
1351
|
+
type InjectionMode = 'style-element' | 'adopted';
|
|
1352
|
+
interface SheetInfo {
|
|
1353
|
+
/** HTMLStyleElement used in style-element mode; null in adopted mode. */
|
|
1354
|
+
sheet: HTMLStyleElement | null;
|
|
1355
|
+
/** Constructable CSSStyleSheet used in adopted mode (ShadowRoot targets) */
|
|
1356
|
+
constructableSheet?: CSSStyleSheet;
|
|
1357
|
+
ruleCount: number;
|
|
1358
|
+
holes: number[];
|
|
1359
|
+
/**
|
|
1360
|
+
* True when this sheet is written through `textContent` instead of CSSOM.
|
|
1361
|
+
* Decided once at sheet creation so a sheet is never half CSSOM / half text.
|
|
1362
|
+
*/
|
|
1363
|
+
textMode?: boolean;
|
|
1364
|
+
/**
|
|
1365
|
+
* Inserted rule texts in rule-index order. Maintained only in text mode —
|
|
1366
|
+
* it is what makes deletion possible there, since `textContent` cannot be
|
|
1367
|
+
* edited rule-by-rule and has to be rebuilt.
|
|
1368
|
+
*/
|
|
1369
|
+
textRules?: string[];
|
|
1370
|
+
}
|
|
1371
|
+
interface CleanupStats {
|
|
1372
|
+
timestamp: number;
|
|
1373
|
+
classesDeleted: number;
|
|
1374
|
+
cssSize: number;
|
|
1375
|
+
rulesDeleted: number;
|
|
1376
|
+
}
|
|
1377
|
+
interface CacheMetrics {
|
|
1378
|
+
hits: number;
|
|
1379
|
+
misses: number;
|
|
1380
|
+
bulkCleanups: number;
|
|
1381
|
+
totalInsertions: number;
|
|
1382
|
+
totalUnused: number;
|
|
1383
|
+
stylesCleanedUp: number;
|
|
1384
|
+
cleanupHistory: CleanupStats[];
|
|
1385
|
+
startTime: number;
|
|
1386
|
+
unusedHits?: number;
|
|
1387
|
+
}
|
|
1388
|
+
interface RootRegistry {
|
|
1389
|
+
sheets: SheetInfo[];
|
|
1390
|
+
/** className -> outstanding `inject()` references; 0 means nobody holds a handle */
|
|
1391
|
+
pinCounts: Map<string, number>;
|
|
1392
|
+
rules: Map<string, RuleInfo>;
|
|
1393
|
+
/** Cache key to className mapping to avoid dual storage of RuleInfo objects */
|
|
1394
|
+
cacheKeyToClassName: Map<string, string>;
|
|
1395
|
+
/** Deduplication set of fully materialized CSS rules inserted into sheets */
|
|
1396
|
+
ruleTextSet: Set<string>;
|
|
1397
|
+
/** Performance metrics (optional) */
|
|
1398
|
+
metrics?: CacheMetrics;
|
|
1399
|
+
/** Keyframes cache by content hash -> entry */
|
|
1400
|
+
keyframesCache: Map<string, KeyframesCacheEntry>;
|
|
1401
|
+
/** Keyframes name to content hash mapping for collision detection */
|
|
1402
|
+
keyframesNameToContent: Map<string, string>;
|
|
1403
|
+
/** Counter for generating keyframes names like k0, k1, k2... */
|
|
1404
|
+
keyframesCounter: number;
|
|
1405
|
+
/** Map of injected @property names to their normalized declarations for tracking */
|
|
1406
|
+
injectedProperties: Map<string, string>;
|
|
1407
|
+
/** Content hashes of injected @font-face rules for deduplication */
|
|
1408
|
+
injectedFontFaces: Set<string>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Injected @counter-style rules. Maps the name to whether it was injected
|
|
1411
|
+
* "strong" (`true`, the default — overrides) or "weak" (`false`, global
|
|
1412
|
+
* `configure()` definitions that never clobber an existing rule).
|
|
1413
|
+
*/
|
|
1414
|
+
injectedCounterStyles: Map<string, boolean>;
|
|
1415
|
+
/**
|
|
1416
|
+
* Injected @function rules. Maps the CSS function name to whether it was
|
|
1417
|
+
* injected "strong" (`true`, the default — overrides) or "weak" (`false`,
|
|
1418
|
+
* global `configure()` definitions that never clobber an existing rule).
|
|
1419
|
+
*/
|
|
1420
|
+
injectedFunctions: Map<string, boolean>;
|
|
1421
|
+
/** Global rules tracking for index adjustment */
|
|
1422
|
+
globalRules: Map<string, RuleInfo>;
|
|
1423
|
+
/** Resolver for auto-inferring @property types from declaration values */
|
|
1424
|
+
propertyTypeResolver: PropertyTypeResolver;
|
|
1425
|
+
/**
|
|
1426
|
+
* className -> when the class was first noticed to be carrying nothing:
|
|
1427
|
+
* injection, or the first sweep that looked and did not find it on an
|
|
1428
|
+
* element. Cleared the moment a sweep finds it rendered again.
|
|
1429
|
+
*
|
|
1430
|
+
* Deliberately "when it was noticed", not "when it stopped being rendered".
|
|
1431
|
+
* Nothing observes the moment an element leaves, so a class that unmounted
|
|
1432
|
+
* just before a sweep and one that unmounted just after the previous sweep
|
|
1433
|
+
* would otherwise be treated differently — and the first would lose its
|
|
1434
|
+
* grace window entirely. Starting the clock at the sighting gives every
|
|
1435
|
+
* class the same full window, whenever it actually went.
|
|
1436
|
+
*
|
|
1437
|
+
* Written only by the sweep's own DOM scan and at injection, so rendering
|
|
1438
|
+
* never pays for it.
|
|
1439
|
+
*/
|
|
1440
|
+
unusedSince: Map<string, number>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Local `@keyframes` a class animates, by the name they were authored under.
|
|
1443
|
+
*
|
|
1444
|
+
* One reference is held per distinct set of steps, however many renders ask
|
|
1445
|
+
* for it, and the classes that animate it own that reference between them.
|
|
1446
|
+
* The last of them to be deleted releases it, so keyframes cannot outlive
|
|
1447
|
+
* every rule that referred to them, and repeat renders cannot pile up
|
|
1448
|
+
* references nobody gives back.
|
|
1449
|
+
*/
|
|
1450
|
+
localKeyframes: Map<string, {
|
|
1451
|
+
name: string;
|
|
1452
|
+
dispose: () => void;
|
|
1453
|
+
owners: Set<string>;
|
|
1454
|
+
}>;
|
|
1455
|
+
/** Renders since the last scheduled sweep (per-root) */
|
|
1456
|
+
touchCount: number;
|
|
1457
|
+
/** How many entries from `window.__TASTY__` have been synced into this registry */
|
|
1458
|
+
serverClassSyncIndex: number;
|
|
1459
|
+
/** Whether `<style data-tasty-rsc>` tags have been scanned for class names */
|
|
1460
|
+
rscStylesScanned: boolean;
|
|
1461
|
+
/** Whether this root uses adoptedStyleSheets or <style> elements */
|
|
1462
|
+
injectionMode: InjectionMode;
|
|
1463
|
+
/**
|
|
1464
|
+
* Lazy feature-test for `@property` support, cached per registry.
|
|
1465
|
+
* - `undefined`: not yet probed.
|
|
1466
|
+
* - `true`: engine supports `@property`; rejections indicate user-authored
|
|
1467
|
+
* invalid rules and should warn.
|
|
1468
|
+
* - `false`: engine doesn't support `@property` (e.g., jsdom); rejections
|
|
1469
|
+
* are expected and warnings are suppressed.
|
|
1470
|
+
*/
|
|
1471
|
+
atPropertySupported?: boolean;
|
|
1472
|
+
}
|
|
1473
|
+
type StyleRule = StyleResult;
|
|
1474
|
+
interface KeyframesInfo {
|
|
1475
|
+
name: string;
|
|
1476
|
+
sheetIndex: number;
|
|
1477
|
+
ruleIndex: number;
|
|
1478
|
+
/** Dev-only: full CSS text of the @keyframes rule; omitted in production */
|
|
1479
|
+
cssText?: string;
|
|
1480
|
+
}
|
|
1481
|
+
type KeyframeStep = string | Record<string, string | number>;
|
|
1482
|
+
type KeyframesSteps = Record<string, KeyframeStep>;
|
|
1483
|
+
interface KeyframesResult {
|
|
1484
|
+
toString(): string;
|
|
1485
|
+
dispose: () => void;
|
|
1486
|
+
}
|
|
1487
|
+
interface KeyframesCacheEntry {
|
|
1488
|
+
name: string;
|
|
1489
|
+
refCount: number;
|
|
1490
|
+
info: KeyframesInfo;
|
|
1491
|
+
/**
|
|
1492
|
+
* Queued sheet write, when `batchInjection` deferred the insertion. Present
|
|
1493
|
+
* only between `keyframes()` and the flush; disposing in that window cancels
|
|
1494
|
+
* the write instead of deleting a rule that was never inserted.
|
|
1495
|
+
*/
|
|
1496
|
+
pending?: QueuedWrite;
|
|
1497
|
+
}
|
|
1498
|
+
/**
|
|
1499
|
+
* Definition for a CSS @property at-rule.
|
|
1500
|
+
* Used to define custom property syntax, inheritance, and initial value.
|
|
1501
|
+
*/
|
|
1502
|
+
interface PropertyDefinition {
|
|
1503
|
+
/** CSS syntax string (e.g., '<color>', '<angle>', '<number>') */
|
|
1504
|
+
syntax?: string;
|
|
1505
|
+
/** Whether the property inherits (default: true) */
|
|
1506
|
+
inherits?: boolean;
|
|
1507
|
+
/** Initial value for the property */
|
|
1508
|
+
initialValue?: string | number;
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Options for registering a CSS `@property`.
|
|
1512
|
+
* Extends {@link PropertyDefinition} with an optional injection root.
|
|
1513
|
+
*/
|
|
1514
|
+
interface PropertyOptions extends PropertyDefinition {
|
|
1515
|
+
/** Shadow root or document to inject into */
|
|
1516
|
+
root?: Document | ShadowRoot;
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* A single parameter for a CSS @function at-rule.
|
|
1520
|
+
*
|
|
1521
|
+
* - `true` — a bare parameter with no type or default.
|
|
1522
|
+
* - `string` — a CSS type shorthand (e.g. `'<length>'`, `'<color>'`).
|
|
1523
|
+
* - object — full form with optional `syntax` (type) and `default` value.
|
|
1524
|
+
*/
|
|
1525
|
+
type FunctionParameter = true | string | {
|
|
1526
|
+
syntax?: string;
|
|
1527
|
+
default?: string | number;
|
|
1528
|
+
};
|
|
1529
|
+
/**
|
|
1530
|
+
* Definition for a CSS @function at-rule (custom function).
|
|
1531
|
+
*
|
|
1532
|
+
* The descriptor body reads like a mini styles object: any `$name` key declares
|
|
1533
|
+
* a local variable (`--name`) whose value is parsed through the Tasty DSL.
|
|
1534
|
+
* `result` is the only required field.
|
|
1535
|
+
*
|
|
1536
|
+
* @example
|
|
1537
|
+
* ```ts
|
|
1538
|
+
* // @function --negative(--value) { result: calc(-1 * var(--value)); }
|
|
1539
|
+
* { args: ['$value'], result: '(-1 * $value)' }
|
|
1540
|
+
* ```
|
|
1541
|
+
*/
|
|
1542
|
+
interface FunctionDefinition {
|
|
1543
|
+
/**
|
|
1544
|
+
* Ordered parameters. Array form lists bare parameter names (`['$value']`);
|
|
1545
|
+
* object form maps each parameter name to its type/default.
|
|
1546
|
+
*/
|
|
1547
|
+
args?: string[] | Record<string, FunctionParameter>;
|
|
1548
|
+
/** Optional return type, e.g. `'<color>'`. */
|
|
1549
|
+
returns?: string;
|
|
1550
|
+
/** The `result:` descriptor value (parsed through the Tasty DSL). Required. */
|
|
1551
|
+
result: string;
|
|
1552
|
+
/** Local variables: any `$name` key declares `--name` in the body. */
|
|
1553
|
+
[localVar: `$${string}`]: string | number | undefined;
|
|
1554
|
+
}
|
|
1555
|
+
/**
|
|
1556
|
+
* Descriptors for a CSS @font-face at-rule.
|
|
1557
|
+
*/
|
|
1558
|
+
interface FontFaceDescriptors {
|
|
1559
|
+
/** Required. URL(s) to the font file(s). */
|
|
1560
|
+
src: string;
|
|
1561
|
+
/** Font weight or range. Default: 'normal'. */
|
|
1562
|
+
fontWeight?: string | number;
|
|
1563
|
+
/** Font style. Default: 'normal'. */
|
|
1564
|
+
fontStyle?: 'normal' | 'italic' | 'oblique' | (string & {});
|
|
1565
|
+
/** Font stretch. Default: 'normal'. */
|
|
1566
|
+
fontStretch?: string;
|
|
1567
|
+
/** Loading behavior. Default: 'auto'. */
|
|
1568
|
+
fontDisplay?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
1569
|
+
/** Unicode range to cover. */
|
|
1570
|
+
unicodeRange?: string;
|
|
1571
|
+
/** Ascent metric override. */
|
|
1572
|
+
ascentOverride?: string;
|
|
1573
|
+
/** Descent metric override. */
|
|
1574
|
+
descentOverride?: string;
|
|
1575
|
+
/** Line gap metric override. */
|
|
1576
|
+
lineGapOverride?: string;
|
|
1577
|
+
/** Size adjustment factor. */
|
|
1578
|
+
sizeAdjust?: string;
|
|
1579
|
+
/** OpenType feature settings. */
|
|
1580
|
+
fontFeatureSettings?: string;
|
|
1581
|
+
/** Font variation axis settings. */
|
|
1582
|
+
fontVariationSettings?: string;
|
|
1583
|
+
}
|
|
1584
|
+
/** Single descriptor or array of descriptors for multiple weights/styles. */
|
|
1585
|
+
type FontFaceInput = FontFaceDescriptors | FontFaceDescriptors[];
|
|
1586
|
+
/**
|
|
1587
|
+
* Descriptors for a CSS @counter-style at-rule.
|
|
1588
|
+
*/
|
|
1589
|
+
interface CounterStyleDescriptors {
|
|
1590
|
+
/** Required. Numbering algorithm. */
|
|
1591
|
+
system: 'cyclic' | 'numeric' | 'alphabetic' | 'symbolic' | 'additive' | 'fixed' | (string & {});
|
|
1592
|
+
/** Symbols for non-additive systems. */
|
|
1593
|
+
symbols?: string;
|
|
1594
|
+
/** Symbol-value pairs for additive system. */
|
|
1595
|
+
additiveSymbols?: string;
|
|
1596
|
+
/** String prepended to the marker. Default: "". */
|
|
1597
|
+
prefix?: string;
|
|
1598
|
+
/** String appended to the marker. Default: ". ". */
|
|
1599
|
+
suffix?: string;
|
|
1600
|
+
/** Negative-value wrapping (e.g., '"(" ")"'). */
|
|
1601
|
+
negative?: string;
|
|
1602
|
+
/** Counter range (e.g., 'infinite infinite'). */
|
|
1603
|
+
range?: string;
|
|
1604
|
+
/** Minimum marker width and pad symbol (e.g., '3 "0"'). */
|
|
1605
|
+
pad?: string;
|
|
1606
|
+
/** Fallback counter style name. */
|
|
1607
|
+
fallback?: string;
|
|
1608
|
+
/** Speech synthesis hint. */
|
|
1609
|
+
speakAs?: string;
|
|
1610
|
+
}
|
|
1611
|
+
interface RawCSSResult {
|
|
1612
|
+
dispose: () => void;
|
|
1613
|
+
}
|
|
1614
|
+
//#endregion
|
|
1615
|
+
export { SuffixForSelector as $, resetStyleBatch as A, ParserOptions as At, getGlobalPredefinedStates as B, SheetInfo as C, stringifyStyles as Ct, QueuedWrite as D, hslToRgbValues as Dt, StyleUsage as E, hexToRgb as Et, parseStateKey as F, CSSProperties as Ft, ConfigTokens as G, ConditionNode as H, AtRuleContext as I, RecipeStyles as J, NoType as K, ParsedAdvancedState as L, StyleResult as M, StyleDetails as Mt, renderStyles as N, StyleDetailsPart as Nt, flushStyles as O, strToRgb as Ot, ParseStateKeyOptions as P, UnitHandler as Pt, StylesWithoutSelectors as Q, StateParserContext as R, RuleInfo as S, parseStyle as St, StyleRule as T, getRgbValuesFromRgbaString as Tt, isSelector as U, setGlobalPredefinedStates as V, ConfigTokenValue as W, Styles as X, Selector as Y, StylesInterface as Z, KeyframesSteps as _, filterMods as _t, FontFaceInput as a, DIRECTIONS as at, RawCSSResult as b, normalizeColorTokenValue as bt, GCConfig as c, ResolvedStyleValue as ct, InjectOptions as d, StyleHandlerProps as dt, TastyNamedColors as et, InjectResult as f, StyleHandlerResult as ft, KeyframesResult as g, StyleValueStateMap as gt, KeyframesInfo as h, StyleValue as ht, FontFaceDescriptors as i, CUSTOM_UNITS as it, RenderResult as j, ProcessedStyle as jt, hasPendingStyleWrites as k, StyleParser as kt, GCOptions as l, StyleHandler as lt, KeyframesCacheEntry as m, StylePropValue as mt, CounterStyleDescriptors as n, AnyStyleHandler as nt, FunctionDefinition as o, ParsedColor as ot, InjectionMode as p, StyleMap as pt, NotSelector as q, DisposeFunction as r, CSSMap as rt, FunctionParameter as s, RawStyleHandler as st, CacheMetrics as t, TastyPresetNames as tt, GlobalInjectResult as u, StyleHandlerDefinition as ut, PropertyDefinition as v, getGlobalParser as vt, StyleInjectorConfig as w, getNamedColorHex as wt, RootRegistry as x, parseColor as xt, PropertyOptions as y, getGlobalPredefinedTokens as yt, createStateParserContext as z };
|
|
1616
|
+
//# sourceMappingURL=types-jKZNpias.d.ts.map
|