@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,1947 @@
|
|
|
1
|
+
import { Ft as CSSProperties$1, M as StyleResult, Mt as StyleDetails, X as Styles, Z as StylesInterface, _ as KeyframesSteps, a as FontFaceInput, ct as ResolvedStyleValue, d as InjectOptions, f as InjectResult, ft as StyleHandlerResult, g as KeyframesResult, gt as StyleValueStateMap, ht as StyleValue, i as FontFaceDescriptors, l as GCOptions, lt as StyleHandler, mt as StylePropValue, n as CounterStyleDescriptors, o as FunctionDefinition, rt as CSSMap, st as RawStyleHandler, t as CacheMetrics, u as GlobalInjectResult, w as StyleInjectorConfig, y as PropertyOptions } from "./types-jKZNpias.js";
|
|
2
|
+
import { m as TastyPluginFactory, x as StyleInjector } from "./config-DWL1ZYue.js";
|
|
3
|
+
import { t as ServerStyleCollector } from "./collector-hl5KNH7k.js";
|
|
4
|
+
import { AllHTMLAttributes, CSSProperties, ComponentType, ElementType, ForwardRefExoticComponent, JSX, PropsWithoutRef, ReactNode, RefAttributes } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/utils/name-prefix.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Name prefix utilities for generated identifiers.
|
|
9
|
+
*
|
|
10
|
+
* Tasty generates three kinds of identifiers from content hashes:
|
|
11
|
+
* - class names (used in DOM `class` attribute)
|
|
12
|
+
* - keyframe names (used in CSS `animation`)
|
|
13
|
+
* - counter-style names (used in CSS `list-style-type`)
|
|
14
|
+
*
|
|
15
|
+
* All three derive from a single configurable prefix so that an app
|
|
16
|
+
* can namespace every identifier under one string. Discriminator letters
|
|
17
|
+
* (`k`, `c`) keep the three kinds visually distinct in devtools — they
|
|
18
|
+
* are not required for correctness (CSS keeps these in separate
|
|
19
|
+
* namespaces), only for readability.
|
|
20
|
+
*
|
|
21
|
+
* The runtime / SSR / RSC paths must agree on the prefix; otherwise the
|
|
22
|
+
* client-side hash for a given style will not match the server-rendered
|
|
23
|
+
* class and hydration breaks. The zero-runtime build path uses a
|
|
24
|
+
* different default (`'ts'`) so its classes can't collide with runtime
|
|
25
|
+
* (`'t'`) classes when both are loaded on the same page.
|
|
26
|
+
*/
|
|
27
|
+
/** Default prefix used by the runtime / SSR / RSC paths. */
|
|
28
|
+
declare const DEFAULT_NAME_PREFIX = "t";
|
|
29
|
+
/** Default prefix used by the zero-runtime (`tastyStatic`) build path. */
|
|
30
|
+
declare const DEFAULT_ZERO_NAME_PREFIX = "ts";
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/styles/list.d.ts
|
|
33
|
+
declare const BASE_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition"];
|
|
34
|
+
declare const POSITION_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "blockMargin", "inlineMargin", "inset", "blockInset", "inlineInset", "position", "scrollMargin", "blockScrollMargin", "inlineScrollMargin", "scrollPadding", "blockScrollPadding", "inlineScrollPadding"];
|
|
35
|
+
declare const BLOCK_INNER_STYLES: readonly ["padding", "blockPadding", "inlinePadding", "overflow", "scrollbar", "textAlign"];
|
|
36
|
+
declare const BLOCK_OUTER_STYLES: readonly ["border", "blockBorder", "inlineBorder", "radius", "shadow", "outline"];
|
|
37
|
+
declare const BLOCK_STYLES: readonly ["padding", "blockPadding", "inlinePadding", "overflow", "scrollbar", "textAlign", "border", "blockBorder", "inlineBorder", "radius", "shadow", "outline"];
|
|
38
|
+
declare const COLOR_STYLES: readonly ["color", "fill", "fade", "image"];
|
|
39
|
+
declare const TEXT_STYLES: readonly ["textTransform", "fontWeight", "fontStyle"];
|
|
40
|
+
declare const DIMENSION_STYLES: readonly ["width", "height", "blockSize", "inlineSize", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
41
|
+
declare const FLOW_STYLES: readonly ["flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
42
|
+
declare const CONTAINER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "width", "height", "blockSize", "inlineSize", "flexBasis", "flexGrow", "flexShrink", "flex", "gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "blockMargin", "inlineMargin", "inset", "blockInset", "inlineInset", "position", "scrollMargin", "blockScrollMargin", "inlineScrollMargin", "scrollPadding", "blockScrollPadding", "inlineScrollPadding", "padding", "blockPadding", "inlinePadding", "overflow", "scrollbar", "textAlign", "border", "blockBorder", "inlineBorder", "radius", "shadow", "outline", "flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
43
|
+
declare const OUTER_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "blockMargin", "inlineMargin", "inset", "blockInset", "inlineInset", "position", "scrollMargin", "blockScrollMargin", "inlineScrollMargin", "scrollPadding", "blockScrollPadding", "inlineScrollPadding", "width", "height", "blockSize", "inlineSize", "flexBasis", "flexGrow", "flexShrink", "flex", "border", "blockBorder", "inlineBorder", "radius", "shadow", "outline"];
|
|
44
|
+
declare const INNER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "padding", "blockPadding", "inlinePadding", "overflow", "scrollbar", "textAlign", "flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/types.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* Extensible interface for theme names.
|
|
49
|
+
* Augment this interface to register project-specific theme names for autocomplete.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* declare module '@tenphi/tasty' {
|
|
54
|
+
* interface TastyThemeNames {
|
|
55
|
+
* danger: true;
|
|
56
|
+
* success: true;
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
interface TastyThemeNames {}
|
|
62
|
+
type ThemeNameKey = Extract<keyof TastyThemeNames, string>;
|
|
63
|
+
type ThemeName = [ThemeNameKey] extends [never] ? string : ThemeNameKey;
|
|
64
|
+
/**
|
|
65
|
+
* Extensible interface for custom props added via `configure({ propHandlers })`.
|
|
66
|
+
* Augment it to type those props on every tasty component.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* declare module '@tenphi/tasty' {
|
|
71
|
+
* interface TastyCustomProps {
|
|
72
|
+
* glaze: 'soft' | 'strong' | { tone: string; intensity?: number };
|
|
73
|
+
* }
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
interface TastyCustomProps {}
|
|
78
|
+
/**
|
|
79
|
+
* Extensible interface for style names promoted via
|
|
80
|
+
* `configure({ baseStyleProps })`. Set each name to `true`; the prop is then typed
|
|
81
|
+
* exactly like the style it names.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* declare module '@tenphi/tasty' {
|
|
86
|
+
* interface TastyBaseStylePropNames {
|
|
87
|
+
* radius: true;
|
|
88
|
+
* shadow: true;
|
|
89
|
+
* }
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
interface TastyBaseStylePropNames {}
|
|
94
|
+
/**
|
|
95
|
+
* Props contributed by `configure({ baseStyleProps })`, each typed like the style
|
|
96
|
+
* it names. Intersecting with `keyof StylesInterface` makes a name that isn't a
|
|
97
|
+
* real style inert rather than `never`-typed.
|
|
98
|
+
*/
|
|
99
|
+
type ExtraBaseStyleProps = { [key in keyof TastyBaseStylePropNames & keyof StylesInterface]?: StylePropValue<StylesInterface[key]> };
|
|
100
|
+
/** Allowed mod value types */
|
|
101
|
+
type ModValue = boolean | string | number | undefined | null;
|
|
102
|
+
/**
|
|
103
|
+
* Type for element modifiers (mods prop).
|
|
104
|
+
* Can be used as a generic to define known modifiers with autocomplete:
|
|
105
|
+
* @example
|
|
106
|
+
* type ButtonMods = Mods<{
|
|
107
|
+
* loading?: boolean;
|
|
108
|
+
* selected?: boolean;
|
|
109
|
+
* }>;
|
|
110
|
+
*/
|
|
111
|
+
type Mods<T extends Record<string, ModValue> = Record<string, ModValue>> = T & Record<string, ModValue>;
|
|
112
|
+
/**
|
|
113
|
+
* Token value: string or number (processed), boolean for special handling, undefined/null (skipped).
|
|
114
|
+
* For color tokens (#name), boolean `true` is converted to `transparent`.
|
|
115
|
+
* For non-color tokens ($name), boolean `true` results in an empty string value.
|
|
116
|
+
* Boolean `false` results in no CSS output (token is skipped).
|
|
117
|
+
*/
|
|
118
|
+
type TokenValue = string | number | boolean | undefined | null;
|
|
119
|
+
/**
|
|
120
|
+
* Tokens definition for inline CSS custom properties.
|
|
121
|
+
* - `$name` keys become `--name` CSS properties
|
|
122
|
+
* - `#name` keys become `--name-color` CSS properties
|
|
123
|
+
*/
|
|
124
|
+
type Tokens = Record<`$${string}` | `#${string}`, TokenValue>;
|
|
125
|
+
type Caps = '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';
|
|
126
|
+
interface BasePropsWithoutChildren<K extends TagName = TagName> extends Pick<AllHTMLAttributes<HTMLElement>, 'className' | 'role' | 'id'> {
|
|
127
|
+
/** The HTML tag or React component to render as */
|
|
128
|
+
as?: K | ComponentType<any>;
|
|
129
|
+
/** QA ID for e2e testing. An alias for `data-qa` attribute. */
|
|
130
|
+
qa?: string;
|
|
131
|
+
/** QA value for e2e testing. An alias for `data-qaval` attribute. */
|
|
132
|
+
qaVal?: string | number;
|
|
133
|
+
/** Inner element name */
|
|
134
|
+
element?: `${Caps}${string}`;
|
|
135
|
+
/** The style map */
|
|
136
|
+
styles?: Styles;
|
|
137
|
+
/** The list of element modifiers **/
|
|
138
|
+
mods?: Mods;
|
|
139
|
+
/** Whether the element is hidden (`hidden` attribute is set) */
|
|
140
|
+
isHidden?: boolean;
|
|
141
|
+
/** Whether the element is disabled (`disabled` attribute is set) */
|
|
142
|
+
isDisabled?: boolean;
|
|
143
|
+
/** Whether the element is checked (`checked` attribute is set) */
|
|
144
|
+
isChecked?: boolean;
|
|
145
|
+
/** The CSS style map */
|
|
146
|
+
style?: CSSProperties$1 | (CSSProperties$1 & Record<string, string | number | null | undefined>);
|
|
147
|
+
/** User-defined theme for the element. Mapped to `data-theme` attribute. Augment `TastyThemeNames` to register project-specific themes for autocomplete. */
|
|
148
|
+
theme?: ThemeName | (string & {});
|
|
149
|
+
/** CSS custom property tokens rendered as inline styles */
|
|
150
|
+
tokens?: Tokens;
|
|
151
|
+
}
|
|
152
|
+
interface BaseProps<K extends TagName = TagName> extends BasePropsWithoutChildren<K>, Pick<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'children'> {}
|
|
153
|
+
interface AllBaseProps<K extends TagName = TagName> extends BaseProps<K>, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style' | 'disabled' | 'hidden' | 'css' | 'content' | 'translate' | 'as' | 'form' | 'bgcolor' | 'background' | 'align' | 'border' | 'color' | 'height' | 'size' | 'width' | 'prefix'> {}
|
|
154
|
+
type BaseStyleProps = Pick<Styles, (typeof BASE_STYLES)[number]>;
|
|
155
|
+
type PositionStyleProps = Pick<Styles, (typeof POSITION_STYLES)[number]>;
|
|
156
|
+
type BlockStyleProps = Pick<Styles, (typeof BLOCK_STYLES)[number]>;
|
|
157
|
+
type BlockInnerStyleProps = Pick<Styles, (typeof BLOCK_INNER_STYLES)[number]>;
|
|
158
|
+
type BlockOuterStyleProps = Pick<Styles, (typeof BLOCK_OUTER_STYLES)[number]>;
|
|
159
|
+
type ColorStyleProps = Pick<Styles, (typeof COLOR_STYLES)[number]>;
|
|
160
|
+
type TextStyleProps = Pick<Styles, (typeof TEXT_STYLES)[number]>;
|
|
161
|
+
type DimensionStyleProps = Pick<Styles, (typeof DIMENSION_STYLES)[number]>;
|
|
162
|
+
type FlowStyleProps = Pick<Styles, (typeof FLOW_STYLES)[number]>;
|
|
163
|
+
type ContainerStyleProps = Pick<Styles, (typeof CONTAINER_STYLES)[number]>;
|
|
164
|
+
type OuterStyleProps = Pick<Styles, (typeof OUTER_STYLES)[number]>;
|
|
165
|
+
type InnerStyleProps = Pick<Styles, (typeof INNER_STYLES)[number]>;
|
|
166
|
+
interface ShortGridStyles {
|
|
167
|
+
template?: Styles['gridTemplate'];
|
|
168
|
+
columns?: Styles['gridColumns'];
|
|
169
|
+
rows?: Styles['gridRows'];
|
|
170
|
+
areas?: Styles['gridAreas'];
|
|
171
|
+
}
|
|
172
|
+
type TagName = keyof HTMLElementTagNameMap;
|
|
173
|
+
/**
|
|
174
|
+
* Configuration type for tasty.config.ts files.
|
|
175
|
+
* Used by the Tasty VSCode extension for validation and autocomplete.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* import type { TastyExtensionConfig } from '@tenphi/tasty';
|
|
180
|
+
*
|
|
181
|
+
* const config: TastyExtensionConfig = {
|
|
182
|
+
* tokens: ['#primary', '#danger', '$spacing'],
|
|
183
|
+
* units: ['x', 'r', 'bw'],
|
|
184
|
+
* states: ['@mobile', '@tablet', '@dark'],
|
|
185
|
+
* presets: ['h1', 'h2', 't1', 't2'],
|
|
186
|
+
* };
|
|
187
|
+
*
|
|
188
|
+
* export default config;
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
interface TastyExtensionConfig {
|
|
192
|
+
/**
|
|
193
|
+
* Extend another config file. Path is relative to this config file.
|
|
194
|
+
* The extended config is merged first, then this config's values are added.
|
|
195
|
+
* @example '../tasty.config.ts'
|
|
196
|
+
*/
|
|
197
|
+
extends?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Valid token names for validation and autocomplete.
|
|
200
|
+
* Use # prefix for colors, $ prefix for custom properties.
|
|
201
|
+
* Set to `false` to disable token validation (overrides parent).
|
|
202
|
+
* @example ['#primary', '#danger', '$spacing', '$gap']
|
|
203
|
+
*/
|
|
204
|
+
tokens?: false | string[];
|
|
205
|
+
/**
|
|
206
|
+
* Valid custom unit names.
|
|
207
|
+
* Set to `false` to disable unit validation (overrides parent).
|
|
208
|
+
* @example ['x', 'r', 'bw', 'cols']
|
|
209
|
+
*/
|
|
210
|
+
units?: false | string[];
|
|
211
|
+
/**
|
|
212
|
+
* Valid custom function names.
|
|
213
|
+
* Set to `false` to disable function validation (overrides parent).
|
|
214
|
+
* @example ['clamp', 'double']
|
|
215
|
+
*/
|
|
216
|
+
functions?: false | string[];
|
|
217
|
+
/**
|
|
218
|
+
* State alias names for autocomplete.
|
|
219
|
+
* Must start with @ prefix.
|
|
220
|
+
* @example ['@mobile', '@tablet', '@dark']
|
|
221
|
+
*/
|
|
222
|
+
states?: string[];
|
|
223
|
+
/**
|
|
224
|
+
* Valid preset names for the `preset` style property.
|
|
225
|
+
* Tasty has no built-in presets - they are project-specific.
|
|
226
|
+
* @example ['h1', 'h2', 'h3', 't1', 't2', 't3', 'tag']
|
|
227
|
+
*/
|
|
228
|
+
presets?: string[];
|
|
229
|
+
/**
|
|
230
|
+
* Custom style property names added via configure({ handlers }).
|
|
231
|
+
* Suppresses "unknown property" warnings for these names.
|
|
232
|
+
* @example ['myGradient', 'customLayout', 'brandBorder']
|
|
233
|
+
*/
|
|
234
|
+
styles?: string[];
|
|
235
|
+
/**
|
|
236
|
+
* Descriptions for presets, shown on hover in the extension.
|
|
237
|
+
* Maps preset names to human-readable descriptions.
|
|
238
|
+
* @example { h1: 'Heading 1 (36px/44px, semibold)', t1: 'Text large (18px/24px)' }
|
|
239
|
+
*/
|
|
240
|
+
presetDescriptions?: Record<string, string>;
|
|
241
|
+
/**
|
|
242
|
+
* Descriptions for state aliases, shown on hover in the extension.
|
|
243
|
+
* Maps state names to human-readable descriptions.
|
|
244
|
+
* @example { '@mobile': 'Mobile viewport (width < 768px)' }
|
|
245
|
+
*/
|
|
246
|
+
stateDescriptions?: Record<string, string>;
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/tasty.d.ts
|
|
250
|
+
type StyleList = readonly (keyof { [key in keyof StylesInterface]: StylesInterface[key] })[];
|
|
251
|
+
/** Type descriptor for a single mod prop: a JS constructor or an enum array. */
|
|
252
|
+
type ModPropDef = BooleanConstructor | StringConstructor | NumberConstructor | readonly string[];
|
|
253
|
+
/** Array form: list of mod key names (types default to ModValue). */
|
|
254
|
+
type ModPropsList = readonly string[];
|
|
255
|
+
/** Object form: map of mod key names to type descriptors. */
|
|
256
|
+
type ModPropsMap = Readonly<Record<string, ModPropDef>>;
|
|
257
|
+
/** Either array or object form accepted by `modProps` option. */
|
|
258
|
+
type ModPropsInput = ModPropsList | ModPropsMap;
|
|
259
|
+
/** Resolve a single ModPropDef to its TypeScript type. */
|
|
260
|
+
type ResolveModPropDef<T> = T extends BooleanConstructor ? boolean : T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends readonly (infer U)[] ? U : ModValue;
|
|
261
|
+
/** Resolve an entire `modProps` definition to the component prop types it adds. */
|
|
262
|
+
type ResolveModProps<M extends ModPropsInput> = M extends readonly (infer K)[] ? Partial<Record<K & string, ModValue>> : M extends Record<string, ModPropDef> ? { [key in keyof M & string]?: ResolveModPropDef<M[key]> } : {};
|
|
263
|
+
/** A token key with `$` or `#` prefix. */
|
|
264
|
+
type TokenPropKey = `$${string}` | `#${string}`;
|
|
265
|
+
/** Array form: list of prop names. Names ending in `Color` map to `#` color tokens. */
|
|
266
|
+
type TokenPropsList = readonly string[];
|
|
267
|
+
/** Object form: prop name -> token key with explicit `$`/`#` prefix. */
|
|
268
|
+
type TokenPropsMap = Readonly<Record<string, TokenPropKey>>;
|
|
269
|
+
/** Either array or object form accepted by `tokenProps` option. */
|
|
270
|
+
type TokenPropsInput = TokenPropsList | TokenPropsMap;
|
|
271
|
+
/** Resolve a `tokenProps` definition to the component prop types it adds. */
|
|
272
|
+
type ResolveTokenProps<TP extends TokenPropsInput> = TP extends readonly (infer K)[] ? Partial<Record<K & string, TokenValue>> : TP extends Record<string, TokenPropKey> ? Partial<Record<keyof TP & string, TokenValue>> : {};
|
|
273
|
+
type AnyProps = Record<string, any>;
|
|
274
|
+
type PropsWithStyles = {
|
|
275
|
+
styles?: Styles;
|
|
276
|
+
} & Omit<Record<string, any>, 'styles'>;
|
|
277
|
+
type VariantMap = Record<string, Styles>;
|
|
278
|
+
interface WithVariant<V extends VariantMap> {
|
|
279
|
+
variant?: keyof V;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Definition for a sub-element. Can be either:
|
|
283
|
+
* - A tag name string (e.g., 'div', 'span')
|
|
284
|
+
* - An object with configuration options
|
|
285
|
+
*/
|
|
286
|
+
type SubElementDefinition<Tag extends keyof JSX.IntrinsicElements = 'div'> = Tag | {
|
|
287
|
+
as?: Tag;
|
|
288
|
+
qa?: string;
|
|
289
|
+
qaVal?: string | number;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Map of sub-element definitions.
|
|
293
|
+
* Keys become the sub-component names (e.g., { Icon: 'span' } -> Component.Icon)
|
|
294
|
+
*/
|
|
295
|
+
type ElementsDefinition = Record<string, SubElementDefinition<keyof JSX.IntrinsicElements>>;
|
|
296
|
+
/**
|
|
297
|
+
* Resolves the tag from a SubElementDefinition
|
|
298
|
+
*/
|
|
299
|
+
type ResolveElementTag<T extends SubElementDefinition<any>> = T extends string ? T : T extends {
|
|
300
|
+
as?: infer Tag;
|
|
301
|
+
} ? Tag extends keyof JSX.IntrinsicElements ? Tag : 'div' : 'div';
|
|
302
|
+
/**
|
|
303
|
+
* Props for sub-element components.
|
|
304
|
+
* Combines HTML attributes with tasty-specific props (qa, qaVal, mods, tokens, isDisabled, etc.)
|
|
305
|
+
*/
|
|
306
|
+
type SubElementProps<Tag extends keyof JSX.IntrinsicElements = 'div'> = Omit<JSX.IntrinsicElements[Tag], 'ref' | 'color' | 'content' | 'translate'> & {
|
|
307
|
+
qa?: string;
|
|
308
|
+
qaVal?: string | number;
|
|
309
|
+
mods?: Mods;
|
|
310
|
+
tokens?: Tokens;
|
|
311
|
+
isDisabled?: boolean;
|
|
312
|
+
isHidden?: boolean;
|
|
313
|
+
isChecked?: boolean;
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Generates the sub-element component types from an ElementsDefinition
|
|
317
|
+
*/
|
|
318
|
+
type SubElementComponents<E extends ElementsDefinition> = { [K in keyof E]: ForwardRefExoticComponent<PropsWithoutRef<SubElementProps<ResolveElementTag<E[K]>>> & RefAttributes<ResolveElementTag<E[K]> extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[ResolveElementTag<E[K]>] : Element$1>> };
|
|
319
|
+
/**
|
|
320
|
+
* Base type containing common properties shared between TastyProps and TastyElementOptions.
|
|
321
|
+
* Separated to avoid code duplication while allowing different type constraints.
|
|
322
|
+
*/
|
|
323
|
+
type TastyBaseProps<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = {
|
|
324
|
+
/** Default styles of the element. */styles?: Styles; /** The list of styles that can be provided by props */
|
|
325
|
+
styleProps?: K; /** Modifier keys exposed as top-level component props (array or typed object form). */
|
|
326
|
+
modProps?: M; /** Token keys exposed as top-level component props (array or typed object form). */
|
|
327
|
+
tokenProps?: TP;
|
|
328
|
+
element?: BaseProps['element'];
|
|
329
|
+
variants?: V; /** Default tokens for inline CSS custom properties */
|
|
330
|
+
tokens?: Tokens; /** Sub-element definitions for compound components */
|
|
331
|
+
elements?: E;
|
|
332
|
+
} & Pick<BaseProps, 'qa' | 'qaVal'> & WithVariant<V>;
|
|
333
|
+
type TastyProps<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, DefaultProps = AnyProps, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = TastyBaseProps<K, V, E, M, TP> & {
|
|
334
|
+
/** The tag name of the element or a React component. */as?: string | ComponentType<any>;
|
|
335
|
+
} & Partial<Omit<DefaultProps, 'as' | 'styles' | 'styleProps' | 'modProps' | 'tokenProps' | 'tokens'>>;
|
|
336
|
+
/**
|
|
337
|
+
* Resolves the props of a polymorphic `as` value (intrinsic tag or component).
|
|
338
|
+
* - For intrinsic tags (`'div'`, `'button'`, ...): returns `JSX.IntrinsicElements[Tag]`.
|
|
339
|
+
* - For React component types: returns the component's own props.
|
|
340
|
+
* - Falls back to an empty record for anything else.
|
|
341
|
+
*/
|
|
342
|
+
type ResolveAsProps<AsType extends ElementType> = AsType extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[AsType] : AsType extends ComponentType<infer P> ? P : Record<string, never>;
|
|
343
|
+
/**
|
|
344
|
+
* TastyElementOptions is used for the element-creation overload of tasty().
|
|
345
|
+
* It includes an `AsType` generic that allows TypeScript to infer the correct
|
|
346
|
+
* element type from the `as` prop — both for intrinsic tags and for React
|
|
347
|
+
* components (so the wrapped component's prop API is preserved).
|
|
348
|
+
*
|
|
349
|
+
* Note: Uses a separate index signature with `unknown` instead of an `any`
|
|
350
|
+
* record to ensure strict type checking for styles.
|
|
351
|
+
*/
|
|
352
|
+
type TastyElementOptions<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, AsType extends ElementType = 'div', M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = TastyBaseProps<K, V, E, M, TP> & {
|
|
353
|
+
/** The tag name of the element or a React component. */as?: AsType;
|
|
354
|
+
} & Record<string, unknown>;
|
|
355
|
+
type AllBasePropsWithMods<K extends StyleList, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = AllBaseProps & { [key in K[number]]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> } & BaseStyleProps & ExtraBaseStyleProps & Partial<TastyCustomProps> & ResolveModProps<M> & ResolveTokenProps<TP>;
|
|
356
|
+
/**
|
|
357
|
+
* Keys from BasePropsWithoutChildren that should be omitted from HTML attributes.
|
|
358
|
+
* This excludes event handlers so they can be properly typed from JSX.IntrinsicElements.
|
|
359
|
+
*/
|
|
360
|
+
type TastySpecificKeys = 'as' | 'qa' | 'qaVal' | 'element' | 'styles' | 'mods' | 'isHidden' | 'isDisabled' | 'isChecked' | 'style' | 'theme' | 'tokens' | 'ref' | 'color';
|
|
361
|
+
/** Extract prop key names from a ModPropsInput (array elements or object keys). */
|
|
362
|
+
type ModPropsKeys<M extends ModPropsInput> = M extends readonly (infer K)[] ? K & string : keyof M & string;
|
|
363
|
+
/** Extract prop key names from a TokenPropsInput (array elements or object keys). */
|
|
364
|
+
type TokenPropsKeys<TP extends TokenPropsInput> = TP extends readonly (infer K)[] ? K & string : keyof TP & string;
|
|
365
|
+
/**
|
|
366
|
+
* Props type for tasty elements that combines:
|
|
367
|
+
* - AllBasePropsWithMods for style props with strict tokens type
|
|
368
|
+
* - HTML attributes for flexibility (properly typed based on `as`)
|
|
369
|
+
* - Variant support
|
|
370
|
+
*
|
|
371
|
+
* AllBasePropsWithMods carries generic AllHTMLAttributes which can conflict
|
|
372
|
+
* with element-specific types (e.g. `src` is `string` in AllHTMLAttributes but
|
|
373
|
+
* `string | Blob` in ImgHTMLAttributes, or the custom props on a third-party
|
|
374
|
+
* component like Next.js `Link`). To avoid intersection-narrowing, we Omit
|
|
375
|
+
* element-specific keys from AllBasePropsWithMods (keeping TastySpecificKeys,
|
|
376
|
+
* style props, mod props, and token props) and let the resolved `as` props
|
|
377
|
+
* supply the authoritative attribute types. The `AllHTMLAttributes<HTMLElement>`
|
|
378
|
+
* baseline is preserved so generic HTML attributes still work even when `as`
|
|
379
|
+
* is a component type with a narrower prop API.
|
|
380
|
+
*/
|
|
381
|
+
type TastyElementProps<K extends StyleList, V extends VariantMap, AsType extends ElementType = 'div', M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = Omit<AllBasePropsWithMods<K, M, TP>, Exclude<keyof ResolveAsProps<AsType>, TastySpecificKeys | keyof TastyCustomProps | keyof ExtraBaseStyleProps | K[number] | ModPropsKeys<M> | TokenPropsKeys<TP>>> & WithVariant<V> & Omit<Omit<AllHTMLAttributes<HTMLElement>, keyof ResolveAsProps<AsType>> & ResolveAsProps<AsType>, TastySpecificKeys | keyof TastyCustomProps | keyof ExtraBaseStyleProps | K[number] | ModPropsKeys<M> | TokenPropsKeys<TP>>;
|
|
382
|
+
type TastyComponentPropsWithDefaults<Props extends PropsWithStyles, DefaultProps extends Partial<Props>> = keyof DefaultProps extends never ? Props : { [key in Extract<keyof Props, keyof DefaultProps>]?: Props[key] } & { [key in keyof Omit<Props, keyof DefaultProps>]: Props[key] };
|
|
383
|
+
/**
|
|
384
|
+
* The component type returned by the `tasty(options)` element-factory overload.
|
|
385
|
+
*
|
|
386
|
+
* It's a regular React forward-ref component whose props are typed from the
|
|
387
|
+
* factory-time `as` value. Polymorphism is at factory time: each call to
|
|
388
|
+
* `tasty({ as: X })` produces a component whose prop API includes `X`'s own
|
|
389
|
+
* props (so `tasty({ as: NextLink })` exposes `href`, `replace`, `prefetch`,
|
|
390
|
+
* etc.) alongside the Tasty-specific props (`mods`, `tokens`, `styleProps`,
|
|
391
|
+
* `modProps`, `tokenProps`).
|
|
392
|
+
*
|
|
393
|
+
* Note: a render-time `<X as={SomeComponent} />` does not re-infer props from
|
|
394
|
+
* `SomeComponent`; create another `tasty({ as: SomeComponent })` for that.
|
|
395
|
+
*/
|
|
396
|
+
type TastyPolymorphicComponent<DefaultAs extends ElementType, K extends StyleList, V extends VariantMap, M extends ModPropsInput, TP extends TokenPropsInput> = ForwardRefExoticComponent<PropsWithoutRef<TastyElementProps<K, V, DefaultAs, M, TP>> & RefAttributes<unknown>>;
|
|
397
|
+
declare function tasty<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, AsType extends ElementType = 'div', M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]>(options: TastyElementOptions<K, V, E, AsType, M, TP>, secondArg?: never): TastyPolymorphicComponent<AsType, K, V, M, TP> & SubElementComponents<E>;
|
|
398
|
+
declare function tasty<Props extends PropsWithStyles, DefaultProps extends Partial<Props> = Partial<Props>, K extends StyleList = readonly never[], V extends VariantMap = VariantMap, E extends ElementsDefinition = Record<string, never>, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]>(Component: ComponentType<Props>, options?: TastyProps<K, V, E, Props, M, TP>): ComponentType<TastyComponentPropsWithDefaults<Props, DefaultProps>>;
|
|
399
|
+
declare const Element$1: TastyPolymorphicComponent<"div", StyleList, VariantMap, readonly never[], readonly never[]> & SubElementComponents<Record<string, never>>;
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/hooks/useStyles.d.ts
|
|
402
|
+
interface UseStylesResult {
|
|
403
|
+
/**
|
|
404
|
+
* Generated className(s) to apply to the element.
|
|
405
|
+
* Can be empty string if no styles are provided.
|
|
406
|
+
* With chunking enabled, may contain multiple space-separated class names.
|
|
407
|
+
*/
|
|
408
|
+
className: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Hook to generate CSS classes from Tasty styles.
|
|
412
|
+
* Thin wrapper around `computeStyles()` that adds React context-based
|
|
413
|
+
* SSR collector discovery for backward compatibility with TastyRegistry.
|
|
414
|
+
*
|
|
415
|
+
* For hook-free usage (e.g. in server components), use `computeStyles()` directly.
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```tsx
|
|
419
|
+
* function MyComponent() {
|
|
420
|
+
* const { className } = useStyles({
|
|
421
|
+
* padding: '2x',
|
|
422
|
+
* fill: '#purple',
|
|
423
|
+
* radius: '1r',
|
|
424
|
+
* });
|
|
425
|
+
*
|
|
426
|
+
* return <div className={className}>Styled content</div>;
|
|
427
|
+
* }
|
|
428
|
+
* ```
|
|
429
|
+
*/
|
|
430
|
+
declare function useStyles(styles: Styles | undefined, options?: {
|
|
431
|
+
root?: Document | ShadowRoot;
|
|
432
|
+
}): UseStylesResult;
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/hooks/useGlobalStyles.d.ts
|
|
435
|
+
interface UseGlobalStylesOptions {
|
|
436
|
+
/**
|
|
437
|
+
* Stable identifier for update tracking (client-only). When provided,
|
|
438
|
+
* changing the styles will dispose the previous injection and inject the
|
|
439
|
+
* new one. Without an id, the selector is used as the slot key.
|
|
440
|
+
* In RSC mode, renders are single-pass so update tracking does not apply.
|
|
441
|
+
*/
|
|
442
|
+
id?: string;
|
|
443
|
+
/** Shadow root or document to inject into (client only). */
|
|
444
|
+
root?: Document | ShadowRoot;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Inject global styles for a given selector.
|
|
448
|
+
* Useful for styling elements by selector without generating classNames.
|
|
449
|
+
*
|
|
450
|
+
* SSR-aware: when a ServerStyleCollector is available, CSS is collected
|
|
451
|
+
* during the render phase instead of being injected into the DOM.
|
|
452
|
+
*
|
|
453
|
+
* Works in all environments: client, SSR with collector, and React Server Components.
|
|
454
|
+
*
|
|
455
|
+
* Injected styles are permanent — they are not cleaned up on component unmount.
|
|
456
|
+
* Use the `id` option for update tracking when styles change over the
|
|
457
|
+
* component lifecycle.
|
|
458
|
+
*
|
|
459
|
+
* Update tracking is per-slot and per-root: a slot (`id`, or the selector when
|
|
460
|
+
* no `id` is given) holds exactly one injection per `root`. Changing the styles
|
|
461
|
+
* replaces it; rendering styles that produce no CSS clears it.
|
|
462
|
+
*
|
|
463
|
+
* @param selector - CSS selector to apply styles to (e.g., '.my-class', ':root', 'body')
|
|
464
|
+
* @param styles - Tasty styles object
|
|
465
|
+
* @param options - Optional settings including `id` for update tracking
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```tsx
|
|
469
|
+
* function MyComponent() {
|
|
470
|
+
* useGlobalStyles('.card', {
|
|
471
|
+
* padding: '2x',
|
|
472
|
+
* radius: '1r',
|
|
473
|
+
* fill: '#white',
|
|
474
|
+
* });
|
|
475
|
+
*
|
|
476
|
+
* return <div className="card">Content</div>;
|
|
477
|
+
* }
|
|
478
|
+
* ```
|
|
479
|
+
*/
|
|
480
|
+
declare function useGlobalStyles(selector: string, styles?: Styles, options?: UseGlobalStylesOptions): void;
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/hooks/useRawCSS.d.ts
|
|
483
|
+
interface UseRawCSSOptions {
|
|
484
|
+
/**
|
|
485
|
+
* Shadow root or document to inject into. Update tracking is per-root: the
|
|
486
|
+
* same id in two roots holds a separate injection in each.
|
|
487
|
+
*/
|
|
488
|
+
root?: Document | ShadowRoot;
|
|
489
|
+
/**
|
|
490
|
+
* Stable identifier for update tracking (client-only). When provided,
|
|
491
|
+
* changing the CSS content will dispose the previous injection and inject
|
|
492
|
+
* the new one. Without an id, deduplication is purely content-based (same
|
|
493
|
+
* CSS is injected only once). In RSC mode, renders are single-pass so
|
|
494
|
+
* update tracking does not apply.
|
|
495
|
+
*/
|
|
496
|
+
id?: string;
|
|
497
|
+
}
|
|
498
|
+
declare function useRawCSS(css: string, options?: UseRawCSSOptions): void;
|
|
499
|
+
declare function useRawCSS(factory: () => string, deps: readonly unknown[], options?: UseRawCSSOptions): void;
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/hooks/useKeyframes.d.ts
|
|
502
|
+
interface UseKeyframesOptions {
|
|
503
|
+
name?: string;
|
|
504
|
+
root?: Document | ShadowRoot;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Inject CSS @keyframes and return the generated animation name.
|
|
508
|
+
* Deduplicates by content — identical steps always return the same name.
|
|
509
|
+
*
|
|
510
|
+
* Works in all environments: client, SSR with collector, and React Server Components.
|
|
511
|
+
*
|
|
512
|
+
* Passing `name` claims a slot owned by that one call site (like `useRawCSS`'s
|
|
513
|
+
* `id`): when its steps change, the previous injection is disposed and the name
|
|
514
|
+
* is reused, so the rules don't accumulate. Anonymous keyframes are permanent
|
|
515
|
+
* and shared by content.
|
|
516
|
+
*
|
|
517
|
+
* @example Basic usage - steps object is the dependency
|
|
518
|
+
* ```tsx
|
|
519
|
+
* function MyComponent() {
|
|
520
|
+
* const bounce = useKeyframes({
|
|
521
|
+
* '0%': { transform: 'scale(1)' },
|
|
522
|
+
* '50%': { transform: 'scale(1.1)' },
|
|
523
|
+
* '100%': { transform: 'scale(1)' },
|
|
524
|
+
* });
|
|
525
|
+
*
|
|
526
|
+
* return <div style={{ animation: `${bounce} 1s infinite` }}>Bouncing</div>;
|
|
527
|
+
* }
|
|
528
|
+
* ```
|
|
529
|
+
*
|
|
530
|
+
* @example With custom name
|
|
531
|
+
* ```tsx
|
|
532
|
+
* function MyComponent() {
|
|
533
|
+
* const fadeIn = useKeyframes(
|
|
534
|
+
* { from: { opacity: 0 }, to: { opacity: 1 } },
|
|
535
|
+
* { name: 'fadeIn' }
|
|
536
|
+
* );
|
|
537
|
+
*
|
|
538
|
+
* return <div style={{ animation: `${fadeIn} 0.3s ease-out` }}>Fading in</div>;
|
|
539
|
+
* }
|
|
540
|
+
* ```
|
|
541
|
+
*
|
|
542
|
+
* @example Factory function with dependencies
|
|
543
|
+
* ```tsx
|
|
544
|
+
* function MyComponent({ scale }: { scale: number }) {
|
|
545
|
+
* const pulse = useKeyframes(
|
|
546
|
+
* () => ({
|
|
547
|
+
* '0%': { transform: 'scale(1)' },
|
|
548
|
+
* '100%': { transform: `scale(${scale})` },
|
|
549
|
+
* }),
|
|
550
|
+
* [scale]
|
|
551
|
+
* );
|
|
552
|
+
*
|
|
553
|
+
* return <div style={{ animation: `${pulse} 1s infinite` }}>Pulsing</div>;
|
|
554
|
+
* }
|
|
555
|
+
* ```
|
|
556
|
+
*/
|
|
557
|
+
declare function useKeyframes(steps: KeyframesSteps, options?: UseKeyframesOptions): string;
|
|
558
|
+
declare function useKeyframes(factory: () => KeyframesSteps, deps: readonly unknown[], options?: UseKeyframesOptions): string;
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region src/hooks/useProperty.d.ts
|
|
561
|
+
/**
|
|
562
|
+
* Options for {@link useProperty}. Extends the shared {@link PropertyOptions}
|
|
563
|
+
* (which is `PropertyDefinition` plus an optional injection `root`).
|
|
564
|
+
*/
|
|
565
|
+
type UsePropertyOptions = PropertyOptions;
|
|
566
|
+
/**
|
|
567
|
+
* Register a CSS @property custom property.
|
|
568
|
+
* This enables advanced features like animating custom properties.
|
|
569
|
+
*
|
|
570
|
+
* Note: @property rules are global and persistent once defined.
|
|
571
|
+
* The function ensures the property is only registered once per root.
|
|
572
|
+
*
|
|
573
|
+
* Accepts tasty token syntax for the property name:
|
|
574
|
+
* - `$name` → defines `--name`
|
|
575
|
+
* - `#name` → defines `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
|
|
576
|
+
* - `--name` → defines `--name` (legacy format)
|
|
577
|
+
*
|
|
578
|
+
* Works in all environments: client, SSR with collector, and React Server Components.
|
|
579
|
+
*
|
|
580
|
+
* @param name - The property token ($name, #name) or CSS property name (--name)
|
|
581
|
+
* @param options - Property configuration
|
|
582
|
+
*
|
|
583
|
+
* @example Basic property with token syntax
|
|
584
|
+
* ```tsx
|
|
585
|
+
* function Spinner() {
|
|
586
|
+
* useProperty('$rotation', {
|
|
587
|
+
* syntax: '<angle>',
|
|
588
|
+
* inherits: false,
|
|
589
|
+
* initialValue: '0deg',
|
|
590
|
+
* });
|
|
591
|
+
*
|
|
592
|
+
* return <div className="spinner" />;
|
|
593
|
+
* }
|
|
594
|
+
* ```
|
|
595
|
+
*
|
|
596
|
+
* @example Color property with token syntax (auto-sets syntax)
|
|
597
|
+
* ```tsx
|
|
598
|
+
* function MyComponent() {
|
|
599
|
+
* useProperty('#theme', {
|
|
600
|
+
* initialValue: 'red', // syntax: '<color>' is auto-set
|
|
601
|
+
* });
|
|
602
|
+
*
|
|
603
|
+
* // Now --theme-color can be animated with CSS transitions
|
|
604
|
+
* return <div style={{ '--theme-color': 'blue' } as React.CSSProperties}>Colored</div>;
|
|
605
|
+
* }
|
|
606
|
+
* ```
|
|
607
|
+
*
|
|
608
|
+
* @example Legacy format (still supported)
|
|
609
|
+
* ```tsx
|
|
610
|
+
* function ResizableBox() {
|
|
611
|
+
* useProperty('--box-size', {
|
|
612
|
+
* syntax: '<length>',
|
|
613
|
+
* initialValue: '100px',
|
|
614
|
+
* });
|
|
615
|
+
*
|
|
616
|
+
* return <div style={{ width: 'var(--box-size)' }} />;
|
|
617
|
+
* }
|
|
618
|
+
* ```
|
|
619
|
+
*/
|
|
620
|
+
declare function useProperty(name: string, options?: UsePropertyOptions): void;
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/hooks/useFontFace.d.ts
|
|
623
|
+
interface UseFontFaceOptions {
|
|
624
|
+
root?: Document | ShadowRoot;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Inject CSS @font-face rules.
|
|
628
|
+
* Permanent — no cleanup on unmount. Deduplicates by content hash.
|
|
629
|
+
*
|
|
630
|
+
* Works in all environments: client, SSR with collector, and React Server Components.
|
|
631
|
+
*
|
|
632
|
+
* @param family - The font-family name
|
|
633
|
+
* @param input - Single descriptor object or array of descriptors (for multiple weights/styles)
|
|
634
|
+
* @param options - Optional settings (e.g. Shadow DOM root)
|
|
635
|
+
*
|
|
636
|
+
* @example Single weight
|
|
637
|
+
* ```tsx
|
|
638
|
+
* function App() {
|
|
639
|
+
* useFontFace('Brand Sans', {
|
|
640
|
+
* src: 'url("/fonts/brand-sans.woff2") format("woff2")',
|
|
641
|
+
* fontWeight: '400 700',
|
|
642
|
+
* fontDisplay: 'swap',
|
|
643
|
+
* });
|
|
644
|
+
*
|
|
645
|
+
* return <div style={{ fontFamily: '"Brand Sans", sans-serif' }}>Hello</div>;
|
|
646
|
+
* }
|
|
647
|
+
* ```
|
|
648
|
+
*
|
|
649
|
+
* @example Multiple weights
|
|
650
|
+
* ```tsx
|
|
651
|
+
* function App() {
|
|
652
|
+
* useFontFace('Brand Sans', [
|
|
653
|
+
* { src: 'url("/fonts/brand-regular.woff2") format("woff2")', fontWeight: 400, fontDisplay: 'swap' },
|
|
654
|
+
* { src: 'url("/fonts/brand-bold.woff2") format("woff2")', fontWeight: 700, fontDisplay: 'swap' },
|
|
655
|
+
* ]);
|
|
656
|
+
*
|
|
657
|
+
* return <div style={{ fontFamily: '"Brand Sans", sans-serif' }}>Hello</div>;
|
|
658
|
+
* }
|
|
659
|
+
* ```
|
|
660
|
+
*/
|
|
661
|
+
declare function useFontFace(family: string, input: FontFaceInput, options?: UseFontFaceOptions): void;
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region src/hooks/useCounterStyle.d.ts
|
|
664
|
+
interface UseCounterStyleOptions {
|
|
665
|
+
name?: string;
|
|
666
|
+
root?: Document | ShadowRoot;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Inject a CSS @counter-style rule and return the generated name.
|
|
670
|
+
* Permanent — no cleanup on unmount. Deduplicates by name.
|
|
671
|
+
*
|
|
672
|
+
* Works in all environments: client, SSR with collector, and React Server Components.
|
|
673
|
+
*
|
|
674
|
+
* @example Basic usage
|
|
675
|
+
* ```tsx
|
|
676
|
+
* function EmojiList() {
|
|
677
|
+
* const styleName = useCounterStyle({
|
|
678
|
+
* system: 'cyclic',
|
|
679
|
+
* symbols: '"👍"',
|
|
680
|
+
* suffix: '" "',
|
|
681
|
+
* }, { name: 'thumbs' });
|
|
682
|
+
*
|
|
683
|
+
* return (
|
|
684
|
+
* <ol style={{ listStyleType: styleName }}>
|
|
685
|
+
* <li>First</li>
|
|
686
|
+
* <li>Second</li>
|
|
687
|
+
* </ol>
|
|
688
|
+
* );
|
|
689
|
+
* }
|
|
690
|
+
* ```
|
|
691
|
+
*
|
|
692
|
+
*/
|
|
693
|
+
declare function useCounterStyle(descriptors: CounterStyleDescriptors, options?: UseCounterStyleOptions): string;
|
|
694
|
+
//#endregion
|
|
695
|
+
//#region src/hooks/useFunction.d.ts
|
|
696
|
+
interface UseFunctionOptions {
|
|
697
|
+
/** Shadow root or document to inject into. */
|
|
698
|
+
root?: Document | ShadowRoot;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Register a CSS @function (custom function).
|
|
702
|
+
*
|
|
703
|
+
* @function rules are global and persistent once defined. The hook ensures the
|
|
704
|
+
* function is only registered once per root (deduplicated by function name).
|
|
705
|
+
*
|
|
706
|
+
* Accepts tasty token syntax for the function name:
|
|
707
|
+
* - `$$name` → defines `--name` (matches the call site `$$name(...)`)
|
|
708
|
+
* - `$name` / `--name` → also accepted
|
|
709
|
+
*
|
|
710
|
+
* Works in all environments: client, SSR with collector, and React Server Components.
|
|
711
|
+
*
|
|
712
|
+
* @param name - The function name token (`$$name`, `$name`, or `--name`)
|
|
713
|
+
* @param definition - Function definition (args, returns, result, local vars)
|
|
714
|
+
*
|
|
715
|
+
* Call the function through the Tasty DSL, not a raw `style` prop: an inline
|
|
716
|
+
* `style` value reaches the browser unparsed, so the `$$name(...)` sugar is never
|
|
717
|
+
* expanded and `polyfills.functions` cannot rewrite it either.
|
|
718
|
+
*
|
|
719
|
+
* @example
|
|
720
|
+
* ```tsx
|
|
721
|
+
* const Box = tasty({ styles: { marginTop: '$$negative(10px)' } });
|
|
722
|
+
*
|
|
723
|
+
* function Layout() {
|
|
724
|
+
* useFunction('$$negative', { args: ['$value'], result: '(-1 * $value)' });
|
|
725
|
+
* return <Box />;
|
|
726
|
+
* }
|
|
727
|
+
* ```
|
|
728
|
+
*/
|
|
729
|
+
declare function useFunction(name: string, definition: FunctionDefinition, options?: UseFunctionOptions): void;
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region src/batch-provider.d.ts
|
|
732
|
+
interface TastyBatchProviderProps {
|
|
733
|
+
children?: ReactNode;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Opens a *batch window* for the commit it renders in, so `batchInjection`
|
|
737
|
+
* can defer stylesheet writes without ever letting a layout effect measure an
|
|
738
|
+
* unstyled element.
|
|
739
|
+
*
|
|
740
|
+
* Every `insertRule()` on a live sheet invalidates style for that sheet's
|
|
741
|
+
* scope. When components inject during React's render phase while others read
|
|
742
|
+
* layout in the same pass, the two interleave and the browser recalculates
|
|
743
|
+
* style between every injection. Batching collapses that into one invalidation
|
|
744
|
+
* per flush — but only if the flush happens before anything can measure.
|
|
745
|
+
*
|
|
746
|
+
* ```
|
|
747
|
+
* provider renders -> window OPEN
|
|
748
|
+
* children render -> injections queued
|
|
749
|
+
* provider insertionEffect -> FLUSH, window CLOSED
|
|
750
|
+
* layout effects run -> rules are in the sheet
|
|
751
|
+
* ```
|
|
752
|
+
*
|
|
753
|
+
* `useInsertionEffect` runs in React's mutation phase, after every render in
|
|
754
|
+
* the commit and before any `useLayoutEffect` — which is exactly why React
|
|
755
|
+
* added it for CSS-in-JS libraries. Effects fire child-first, so this
|
|
756
|
+
* provider's runs after every descendant's and still before all layout
|
|
757
|
+
* effects.
|
|
758
|
+
*
|
|
759
|
+
* A commit that does not re-render this provider gets no window, and those
|
|
760
|
+
* injections are written synchronously instead. That is the point: turning
|
|
761
|
+
* `batchInjection: true` on can only ever make injection cheaper, never make a
|
|
762
|
+
* measurement wrong. It also means batching applies to commits this provider
|
|
763
|
+
* takes part in, so mount it as high in the tree as you can.
|
|
764
|
+
*
|
|
765
|
+
* Requires `configure({ batchInjection: true })`; without it this component
|
|
766
|
+
* only renders its children. `batchInjection: 'always'` does not need the
|
|
767
|
+
* provider at all — see that option's docs for the trade-off it accepts.
|
|
768
|
+
*
|
|
769
|
+
* @example
|
|
770
|
+
* ```tsx
|
|
771
|
+
* configure({ batchInjection: true });
|
|
772
|
+
*
|
|
773
|
+
* createRoot(el).render(
|
|
774
|
+
* <TastyBatchProvider>
|
|
775
|
+
* <App />
|
|
776
|
+
* </TastyBatchProvider>,
|
|
777
|
+
* );
|
|
778
|
+
* ```
|
|
779
|
+
*/
|
|
780
|
+
declare function TastyBatchProvider({
|
|
781
|
+
children
|
|
782
|
+
}: TastyBatchProviderProps): ReactNode;
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/utils/get-display-name.d.ts
|
|
785
|
+
declare function getDisplayName<T>(Component: ElementType<T>, fallbackName?: string): string;
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/index.d.ts
|
|
788
|
+
declare module './utils/css-types' {
|
|
789
|
+
interface CSSProperties extends CSSProperties {}
|
|
790
|
+
}
|
|
791
|
+
//#endregion
|
|
792
|
+
//#region src/plugins/okhsl-plugin.d.ts
|
|
793
|
+
/**
|
|
794
|
+
* The okhsl function handler for tasty parser.
|
|
795
|
+
* Receives parsed style groups and returns an RGB color string.
|
|
796
|
+
*/
|
|
797
|
+
declare const okhslFunction: (groups: StyleDetails[]) => string;
|
|
798
|
+
/**
|
|
799
|
+
* OKHSL Plugin for Tasty.
|
|
800
|
+
*
|
|
801
|
+
* Adds support for the `okhsl()` color function in tasty styles.
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* ```ts
|
|
805
|
+
* import { configure } from '@tenphi/tasty';
|
|
806
|
+
* import { okhslPlugin } from '@tenphi/tasty';
|
|
807
|
+
*
|
|
808
|
+
* configure({
|
|
809
|
+
* plugins: [okhslPlugin()],
|
|
810
|
+
* });
|
|
811
|
+
*
|
|
812
|
+
* // Now you can use okhsl in styles:
|
|
813
|
+
* const Box = tasty({
|
|
814
|
+
* styles: {
|
|
815
|
+
* fill: 'okhsl(240 50% 50%)',
|
|
816
|
+
* },
|
|
817
|
+
* });
|
|
818
|
+
* ```
|
|
819
|
+
*/
|
|
820
|
+
declare const okhslPlugin: TastyPluginFactory;
|
|
821
|
+
//#endregion
|
|
822
|
+
//#region src/plugins/okhst-plugin.d.ts
|
|
823
|
+
/**
|
|
824
|
+
* The okhst function handler for tasty parser.
|
|
825
|
+
* Receives parsed style groups and returns an RGB color string.
|
|
826
|
+
*/
|
|
827
|
+
declare const okhstFunction: (groups: StyleDetails[]) => string;
|
|
828
|
+
/**
|
|
829
|
+
* OKHST Plugin for Tasty.
|
|
830
|
+
*
|
|
831
|
+
* Adds support for the `okhst()` color function in tasty styles.
|
|
832
|
+
*
|
|
833
|
+
* @example
|
|
834
|
+
* ```ts
|
|
835
|
+
* import { configure } from '@tenphi/tasty';
|
|
836
|
+
* import { okhstPlugin } from '@tenphi/tasty';
|
|
837
|
+
*
|
|
838
|
+
* configure({
|
|
839
|
+
* plugins: [okhstPlugin()],
|
|
840
|
+
* });
|
|
841
|
+
*
|
|
842
|
+
* // Now you can use okhst in styles:
|
|
843
|
+
* const Box = tasty({
|
|
844
|
+
* styles: {
|
|
845
|
+
* fill: 'okhst(240 50% 50%)',
|
|
846
|
+
* },
|
|
847
|
+
* });
|
|
848
|
+
* ```
|
|
849
|
+
*/
|
|
850
|
+
declare const okhstPlugin: TastyPluginFactory;
|
|
851
|
+
//#endregion
|
|
852
|
+
//#region src/plugins/color-func.d.ts
|
|
853
|
+
/**
|
|
854
|
+
* Creates a color function handler for the tasty parser.
|
|
855
|
+
*
|
|
856
|
+
* A color function is a custom `functions` entry that converts its arguments
|
|
857
|
+
* to an `rgb(...)` string (an already-supported color), so it needs no special
|
|
858
|
+
* core integration — registering it as a parse function is enough.
|
|
859
|
+
*
|
|
860
|
+
* @param name The name of the color function (e.g., 'okhsl', 'okhst')
|
|
861
|
+
* @param convert Converts the parsed first three channel values (after angle/
|
|
862
|
+
* percent normalization) to sRGB `[r, g, b]` in the 0-1 range
|
|
863
|
+
* @param label Optional diagnostic label shown in dev warnings when the wrong
|
|
864
|
+
* number of arguments is supplied (e.g., 'H S L'). Has no effect on parsing
|
|
865
|
+
* or output.
|
|
866
|
+
*/
|
|
867
|
+
declare function createColorFunc(name: string, convert: (h: number, c2: number, c3: number) => [number, number, number], label?: string): (groups: StyleDetails[]) => string;
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region src/utils/function-color.d.ts
|
|
870
|
+
/**
|
|
871
|
+
* Resolve a `name(...)` value produced by a registered custom parse function
|
|
872
|
+
* into its concrete color output.
|
|
873
|
+
*
|
|
874
|
+
* A color function is just a `functions` entry whose output is an already
|
|
875
|
+
* supported color (`rgb`, `hsl`, `#…`, `oklch`, …). This helper delegates the
|
|
876
|
+
* value to the global parser (which already runs the registered parse function)
|
|
877
|
+
* and returns the result only when it looks like a color. Returns `null` when
|
|
878
|
+
* `str` is not a registered custom function or its output is not a color.
|
|
879
|
+
*
|
|
880
|
+
* This is the generic replacement for the previously hardcoded okhsl/okhst
|
|
881
|
+
* conversion branches scattered across `strToRgb`, `resolveToRgbaValues`, and
|
|
882
|
+
* the `#token.alpha` injection path.
|
|
883
|
+
*/
|
|
884
|
+
declare function resolveFunctionColor(str: string): string | null;
|
|
885
|
+
//#endregion
|
|
886
|
+
//#region src/chunks/style-chunk-map.d.ts
|
|
887
|
+
/**
|
|
888
|
+
* Chunk names, the built-in chunk style lists, and the style→chunk lookup.
|
|
889
|
+
*
|
|
890
|
+
* This module only imports data-only style-name lists. It exists separately
|
|
891
|
+
* from `definitions.ts` for two reasons:
|
|
892
|
+
*
|
|
893
|
+
* 1. The style handler registry (`styles/predefined.ts`) needs to assign chunk
|
|
894
|
+
* membership for custom handlers. Reaching for `definitions.ts` would create an
|
|
895
|
+
* import cycle (`definitions` -> `pipeline` -> `styles` -> `predefined`).
|
|
896
|
+
* 2. `STYLE_TO_CHUNK` is populated as a side effect of module load, so it must be
|
|
897
|
+
* populated by the module that *owns* it. Otherwise an importer that only pulls
|
|
898
|
+
* in this module would see an empty map and misclassify every style as `misc`.
|
|
899
|
+
*
|
|
900
|
+
* `definitions.ts` re-exports everything here, so existing import paths and the
|
|
901
|
+
* public API surface are unchanged.
|
|
902
|
+
*/
|
|
903
|
+
declare const CHUNK_NAMES: {
|
|
904
|
+
/** Special chunk for styles that cannot be split */readonly COMBINED: "combined";
|
|
905
|
+
readonly SUBCOMPONENTS: "subcomponents";
|
|
906
|
+
readonly APPEARANCE: "appearance";
|
|
907
|
+
readonly FONT: "font";
|
|
908
|
+
readonly DIMENSION: "dimension";
|
|
909
|
+
readonly DISPLAY: "display";
|
|
910
|
+
readonly LAYOUT: "layout";
|
|
911
|
+
readonly POSITION: "position";
|
|
912
|
+
readonly MISC: "misc";
|
|
913
|
+
};
|
|
914
|
+
type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];
|
|
915
|
+
/**
|
|
916
|
+
* Appearance chunk - visual styling with independent handlers
|
|
917
|
+
*
|
|
918
|
+
* @public
|
|
919
|
+
*/
|
|
920
|
+
declare const APPEARANCE_CHUNK_STYLES: readonly ["fill", "color", "opacity", "border", "blockBorder", "inlineBorder", "radius", "outline", "outlineOffset", "shadow", "fade"];
|
|
921
|
+
/**
|
|
922
|
+
* Font chunk - typography styles
|
|
923
|
+
*
|
|
924
|
+
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
925
|
+
* ⚠️ presetStyle: preset, fontSize, lineHeight, letterSpacing, textTransform,
|
|
926
|
+
* fontWeight, fontStyle, font
|
|
927
|
+
*/
|
|
928
|
+
/** @public */
|
|
929
|
+
declare const FONT_CHUNK_STYLES: readonly ["preset", "font", "fontWeight", "fontStyle", "fontSize", "lineHeight", "letterSpacing", "textTransform", "fontFamily", "textAlign", "textDecoration", "wordBreak", "wordWrap", "boldFontWeight"];
|
|
930
|
+
/**
|
|
931
|
+
* Dimension chunk - sizing and spacing
|
|
932
|
+
*
|
|
933
|
+
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
934
|
+
* ⚠️ paddingStyle: padding, paddingTop/Right/Bottom/Left
|
|
935
|
+
* ⚠️ marginStyle: margin, marginTop/Right/Bottom/Left
|
|
936
|
+
* ⚠️ widthStyle: width, minWidth, maxWidth
|
|
937
|
+
* ⚠️ heightStyle: height, minHeight, maxHeight
|
|
938
|
+
* ⚠️ blockSizeStyle: blockSize, minBlockSize, maxBlockSize
|
|
939
|
+
* ⚠️ inlineSizeStyle: inlineSize, minInlineSize, maxInlineSize
|
|
940
|
+
*/
|
|
941
|
+
/** @public */
|
|
942
|
+
declare const DIMENSION_CHUNK_STYLES: readonly ["padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "blockPadding", "inlinePadding", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "blockMargin", "inlineMargin", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "blockSize", "minBlockSize", "maxBlockSize", "inlineSize", "minInlineSize", "maxInlineSize", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
943
|
+
/**
|
|
944
|
+
* Display chunk - display mode, layout flow, text overflow, and scrollbar
|
|
945
|
+
*
|
|
946
|
+
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
947
|
+
* ⚠️ displayStyle: display, hide, textOverflow, overflow, whiteSpace
|
|
948
|
+
* ⚠️ flowStyle: display, flow
|
|
949
|
+
* ⚠️ gapStyle: display, flow, gap
|
|
950
|
+
* ⚠️ scrollbarStyle: scrollbar, overflow
|
|
951
|
+
*/
|
|
952
|
+
/** @public */
|
|
953
|
+
declare const DISPLAY_CHUNK_STYLES: readonly ["display", "hide", "textOverflow", "overflow", "whiteSpace", "flow", "gap", "scrollbar"];
|
|
954
|
+
/**
|
|
955
|
+
* Layout chunk - flex/grid alignment and grid templates
|
|
956
|
+
*
|
|
957
|
+
* Note: flow and gap are in DISPLAY chunk due to handler dependencies
|
|
958
|
+
* (flowStyle and gapStyle both require 'display' prop).
|
|
959
|
+
*/
|
|
960
|
+
/** @public */
|
|
961
|
+
declare const LAYOUT_CHUNK_STYLES: readonly ["placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "place", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas", "gridAutoFlow", "gridAutoColumns", "gridAutoRows"];
|
|
962
|
+
/**
|
|
963
|
+
* Position chunk - element positioning
|
|
964
|
+
*
|
|
965
|
+
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
966
|
+
* ⚠️ insetStyle: inset, top, right, bottom, left
|
|
967
|
+
*/
|
|
968
|
+
/** @public */
|
|
969
|
+
declare const POSITION_CHUNK_STYLES: readonly ["position", "inset", "blockInset", "inlineInset", "top", "right", "bottom", "left", "blockScrollMargin", "inlineScrollMargin", "blockScrollPadding", "inlineScrollPadding", "zIndex", "gridArea", "gridColumn", "gridRow", "order", "placeSelf", "alignSelf", "justifySelf", "transform", "transition", "animation"];
|
|
970
|
+
/**
|
|
971
|
+
* Map for O(1) style-to-chunk lookup. Seeded with the built-in lists above and
|
|
972
|
+
* extended by {@link assignStyleChunk} when a custom handler declares style names
|
|
973
|
+
* the built-in lists don't know.
|
|
974
|
+
*/
|
|
975
|
+
declare const STYLE_TO_CHUNK: Map<string, ChunkName>;
|
|
976
|
+
//#endregion
|
|
977
|
+
//#region src/chunks/definitions.d.ts
|
|
978
|
+
interface ChunkInfo {
|
|
979
|
+
/** Name of the chunk */
|
|
980
|
+
name: ChunkName | string;
|
|
981
|
+
/** Style keys belonging to this chunk */
|
|
982
|
+
styleKeys: string[];
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Categorize style keys into chunks.
|
|
986
|
+
*
|
|
987
|
+
* Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
|
|
988
|
+
* of the order of keys in the input styles object.
|
|
989
|
+
*
|
|
990
|
+
* @param styles - The styles object to categorize
|
|
991
|
+
* @returns Map of chunk name to array of style keys in that chunk (in priority order)
|
|
992
|
+
*/
|
|
993
|
+
declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<string, string[]>;
|
|
994
|
+
//#endregion
|
|
995
|
+
//#region src/styles/border.d.ts
|
|
996
|
+
/**
|
|
997
|
+
* Border style handler with multi-group support.
|
|
998
|
+
*
|
|
999
|
+
* Single group (backward compatible):
|
|
1000
|
+
* - `border="1bw solid #red"` - all sides
|
|
1001
|
+
* - `border="1bw solid #red top left"` - only top and left
|
|
1002
|
+
*
|
|
1003
|
+
* Multi-group (new):
|
|
1004
|
+
* - `border="1bw #red, 2bw #blue top"` - all sides red 1bw, then top overridden to blue 2bw
|
|
1005
|
+
* - `border="1bw, dashed top bottom, #purple left right"` - base 1bw, dashed on top/bottom, purple on left/right
|
|
1006
|
+
*
|
|
1007
|
+
* Later groups override earlier groups for conflicting directions.
|
|
1008
|
+
*/
|
|
1009
|
+
declare function borderStyle({
|
|
1010
|
+
border
|
|
1011
|
+
}: {
|
|
1012
|
+
border?: string | number | boolean;
|
|
1013
|
+
}): Record<string, string> | null;
|
|
1014
|
+
declare namespace borderStyle {
|
|
1015
|
+
var __lookupStyles: string[];
|
|
1016
|
+
}
|
|
1017
|
+
//#endregion
|
|
1018
|
+
//#region src/styles/blockSize.d.ts
|
|
1019
|
+
declare function blockSizeStyle({
|
|
1020
|
+
blockSize,
|
|
1021
|
+
minBlockSize,
|
|
1022
|
+
maxBlockSize
|
|
1023
|
+
}: {
|
|
1024
|
+
blockSize?: string | number | boolean;
|
|
1025
|
+
minBlockSize?: string | number | boolean;
|
|
1026
|
+
maxBlockSize?: string | number | boolean;
|
|
1027
|
+
}): Record<string, string | string[]> | null;
|
|
1028
|
+
declare namespace blockSizeStyle {
|
|
1029
|
+
var __lookupStyles: ("blockSize" | "maxBlockSize" | "minBlockSize")[];
|
|
1030
|
+
}
|
|
1031
|
+
//#endregion
|
|
1032
|
+
//#region src/styles/color.d.ts
|
|
1033
|
+
declare function colorStyle({
|
|
1034
|
+
color
|
|
1035
|
+
}: {
|
|
1036
|
+
color?: string | boolean;
|
|
1037
|
+
}): Record<string, string> | null;
|
|
1038
|
+
declare namespace colorStyle {
|
|
1039
|
+
var __lookupStyles: string[];
|
|
1040
|
+
}
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region src/styles/display.d.ts
|
|
1043
|
+
interface DisplayStyleProps {
|
|
1044
|
+
display?: string;
|
|
1045
|
+
hide?: boolean;
|
|
1046
|
+
textOverflow?: string | boolean;
|
|
1047
|
+
overflow?: string;
|
|
1048
|
+
whiteSpace?: string;
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* Handles display, hide, textOverflow, overflow, and whiteSpace styles.
|
|
1052
|
+
*
|
|
1053
|
+
* Priority:
|
|
1054
|
+
* 1. `hide` takes precedence (display: none)
|
|
1055
|
+
* 2. Multi-line `textOverflow` forces display: -webkit-box
|
|
1056
|
+
* 3. Single-line `textOverflow` defaults white-space to nowrap
|
|
1057
|
+
* 4. Explicit `whiteSpace` overrides the default from `textOverflow`
|
|
1058
|
+
*/
|
|
1059
|
+
declare function displayStyle({
|
|
1060
|
+
display,
|
|
1061
|
+
hide,
|
|
1062
|
+
textOverflow,
|
|
1063
|
+
overflow,
|
|
1064
|
+
whiteSpace
|
|
1065
|
+
}: DisplayStyleProps): Record<string, string | number> | null;
|
|
1066
|
+
declare namespace displayStyle {
|
|
1067
|
+
var __lookupStyles: string[];
|
|
1068
|
+
}
|
|
1069
|
+
//#endregion
|
|
1070
|
+
//#region src/styles/fade.d.ts
|
|
1071
|
+
declare function fadeStyle({
|
|
1072
|
+
fade
|
|
1073
|
+
}: {
|
|
1074
|
+
fade?: string;
|
|
1075
|
+
}): {
|
|
1076
|
+
mask: string;
|
|
1077
|
+
'mask-composite': string;
|
|
1078
|
+
} | null;
|
|
1079
|
+
declare namespace fadeStyle {
|
|
1080
|
+
var __lookupStyles: string[];
|
|
1081
|
+
}
|
|
1082
|
+
//#endregion
|
|
1083
|
+
//#region src/styles/fill.d.ts
|
|
1084
|
+
declare function fillStyle({
|
|
1085
|
+
fill,
|
|
1086
|
+
backgroundColor,
|
|
1087
|
+
image,
|
|
1088
|
+
backgroundImage,
|
|
1089
|
+
backgroundPosition,
|
|
1090
|
+
backgroundSize,
|
|
1091
|
+
backgroundRepeat,
|
|
1092
|
+
backgroundAttachment,
|
|
1093
|
+
backgroundOrigin,
|
|
1094
|
+
backgroundClip,
|
|
1095
|
+
background
|
|
1096
|
+
}: {
|
|
1097
|
+
fill?: string;
|
|
1098
|
+
backgroundColor?: string;
|
|
1099
|
+
image?: string;
|
|
1100
|
+
backgroundImage?: string;
|
|
1101
|
+
backgroundPosition?: string;
|
|
1102
|
+
backgroundSize?: string;
|
|
1103
|
+
backgroundRepeat?: string;
|
|
1104
|
+
backgroundAttachment?: string;
|
|
1105
|
+
backgroundOrigin?: string;
|
|
1106
|
+
backgroundClip?: string;
|
|
1107
|
+
background?: string;
|
|
1108
|
+
}): Record<string, string> | null;
|
|
1109
|
+
declare namespace fillStyle {
|
|
1110
|
+
var __lookupStyles: string[];
|
|
1111
|
+
}
|
|
1112
|
+
declare function svgFillStyle({
|
|
1113
|
+
svgFill
|
|
1114
|
+
}: {
|
|
1115
|
+
svgFill?: string;
|
|
1116
|
+
}): {
|
|
1117
|
+
fill: string;
|
|
1118
|
+
} | null;
|
|
1119
|
+
declare namespace svgFillStyle {
|
|
1120
|
+
var __lookupStyles: string[];
|
|
1121
|
+
}
|
|
1122
|
+
//#endregion
|
|
1123
|
+
//#region src/styles/flow.d.ts
|
|
1124
|
+
declare function flowStyle({
|
|
1125
|
+
display,
|
|
1126
|
+
flow
|
|
1127
|
+
}: {
|
|
1128
|
+
display?: string;
|
|
1129
|
+
flow?: string;
|
|
1130
|
+
}): {
|
|
1131
|
+
[x: string]: string;
|
|
1132
|
+
} | null;
|
|
1133
|
+
declare namespace flowStyle {
|
|
1134
|
+
var __lookupStyles: string[];
|
|
1135
|
+
}
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region src/styles/gap.d.ts
|
|
1138
|
+
declare function gapStyle({
|
|
1139
|
+
display,
|
|
1140
|
+
flow,
|
|
1141
|
+
gap
|
|
1142
|
+
}: {
|
|
1143
|
+
display?: string;
|
|
1144
|
+
flow?: string;
|
|
1145
|
+
gap?: string | number | boolean;
|
|
1146
|
+
}): {
|
|
1147
|
+
gap: string;
|
|
1148
|
+
$?: undefined;
|
|
1149
|
+
} | ({
|
|
1150
|
+
'margin-right': string;
|
|
1151
|
+
'margin-bottom': string;
|
|
1152
|
+
$?: undefined;
|
|
1153
|
+
} | {
|
|
1154
|
+
$: string;
|
|
1155
|
+
'margin-right': string;
|
|
1156
|
+
'margin-bottom': string;
|
|
1157
|
+
})[] | {
|
|
1158
|
+
[x: string]: string;
|
|
1159
|
+
$: string;
|
|
1160
|
+
gap?: undefined;
|
|
1161
|
+
} | null;
|
|
1162
|
+
declare namespace gapStyle {
|
|
1163
|
+
var __lookupStyles: string[];
|
|
1164
|
+
}
|
|
1165
|
+
//#endregion
|
|
1166
|
+
//#region src/styles/height.d.ts
|
|
1167
|
+
interface HeightStyleProps {
|
|
1168
|
+
height?: string | number | boolean;
|
|
1169
|
+
minHeight?: string | number | boolean;
|
|
1170
|
+
maxHeight?: string | number | boolean;
|
|
1171
|
+
}
|
|
1172
|
+
declare function heightStyle({
|
|
1173
|
+
height,
|
|
1174
|
+
minHeight,
|
|
1175
|
+
maxHeight
|
|
1176
|
+
}: HeightStyleProps): Record<string, string | string[]> | null;
|
|
1177
|
+
declare namespace heightStyle {
|
|
1178
|
+
var __lookupStyles: string[];
|
|
1179
|
+
}
|
|
1180
|
+
//#endregion
|
|
1181
|
+
//#region src/styles/inset.d.ts
|
|
1182
|
+
declare function insetStyle({
|
|
1183
|
+
inset,
|
|
1184
|
+
top,
|
|
1185
|
+
right,
|
|
1186
|
+
bottom,
|
|
1187
|
+
left
|
|
1188
|
+
}: {
|
|
1189
|
+
inset?: string | number | boolean;
|
|
1190
|
+
top?: string | number | boolean;
|
|
1191
|
+
right?: string | number | boolean;
|
|
1192
|
+
bottom?: string | number | boolean;
|
|
1193
|
+
left?: string | number | boolean;
|
|
1194
|
+
}): Record<string, string> | null;
|
|
1195
|
+
declare namespace insetStyle {
|
|
1196
|
+
var __lookupStyles: string[];
|
|
1197
|
+
}
|
|
1198
|
+
//#endregion
|
|
1199
|
+
//#region src/styles/inlineSize.d.ts
|
|
1200
|
+
declare function inlineSizeStyle({
|
|
1201
|
+
inlineSize,
|
|
1202
|
+
minInlineSize,
|
|
1203
|
+
maxInlineSize
|
|
1204
|
+
}: {
|
|
1205
|
+
inlineSize?: string | number | boolean;
|
|
1206
|
+
minInlineSize?: string | number | boolean;
|
|
1207
|
+
maxInlineSize?: string | number | boolean;
|
|
1208
|
+
}): Record<string, string | string[]> | null;
|
|
1209
|
+
declare namespace inlineSizeStyle {
|
|
1210
|
+
var __lookupStyles: ("inlineSize" | "maxInlineSize" | "minInlineSize")[];
|
|
1211
|
+
}
|
|
1212
|
+
//#endregion
|
|
1213
|
+
//#region src/styles/margin.d.ts
|
|
1214
|
+
declare function marginStyle({
|
|
1215
|
+
margin,
|
|
1216
|
+
marginTop,
|
|
1217
|
+
marginRight,
|
|
1218
|
+
marginBottom,
|
|
1219
|
+
marginLeft
|
|
1220
|
+
}: {
|
|
1221
|
+
margin?: string | number | boolean;
|
|
1222
|
+
marginTop?: string | number | boolean;
|
|
1223
|
+
marginRight?: string | number | boolean;
|
|
1224
|
+
marginBottom?: string | number | boolean;
|
|
1225
|
+
marginLeft?: string | number | boolean;
|
|
1226
|
+
}): Record<string, string> | null;
|
|
1227
|
+
declare namespace marginStyle {
|
|
1228
|
+
var __lookupStyles: string[];
|
|
1229
|
+
}
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/styles/outline.d.ts
|
|
1232
|
+
interface OutlineStyleProps {
|
|
1233
|
+
outline?: string | boolean | number;
|
|
1234
|
+
outlineOffset?: string | number;
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Generates CSS for outline property with optional offset.
|
|
1238
|
+
*
|
|
1239
|
+
* Syntax:
|
|
1240
|
+
* - `outline="2px solid #red"` - outline only
|
|
1241
|
+
* - `outline="2px solid #red / 4px"` - outline with offset (slash separator)
|
|
1242
|
+
* - `outline="2px / 4px"` - width with offset (simpler form)
|
|
1243
|
+
* - `outline={true}` - default 1ow solid outline
|
|
1244
|
+
* - `outlineOffset="4px"` - offset as separate prop (can be combined with outline)
|
|
1245
|
+
*
|
|
1246
|
+
* Priority: slash syntax in outline takes precedence over outlineOffset prop
|
|
1247
|
+
*
|
|
1248
|
+
* @return CSS properties for outline and optionally outline-offset
|
|
1249
|
+
*/
|
|
1250
|
+
declare function outlineStyle({
|
|
1251
|
+
outline,
|
|
1252
|
+
outlineOffset
|
|
1253
|
+
}: OutlineStyleProps): Record<string, string> | null;
|
|
1254
|
+
declare namespace outlineStyle {
|
|
1255
|
+
var __lookupStyles: string[];
|
|
1256
|
+
}
|
|
1257
|
+
//#endregion
|
|
1258
|
+
//#region src/styles/padding.d.ts
|
|
1259
|
+
declare function paddingStyle({
|
|
1260
|
+
padding,
|
|
1261
|
+
paddingTop,
|
|
1262
|
+
paddingRight,
|
|
1263
|
+
paddingBottom,
|
|
1264
|
+
paddingLeft
|
|
1265
|
+
}: {
|
|
1266
|
+
padding?: string | number | boolean;
|
|
1267
|
+
paddingTop?: string | number | boolean;
|
|
1268
|
+
paddingRight?: string | number | boolean;
|
|
1269
|
+
paddingBottom?: string | number | boolean;
|
|
1270
|
+
paddingLeft?: string | number | boolean;
|
|
1271
|
+
}): Record<string, string> | null;
|
|
1272
|
+
declare namespace paddingStyle {
|
|
1273
|
+
var __lookupStyles: string[];
|
|
1274
|
+
}
|
|
1275
|
+
//#endregion
|
|
1276
|
+
//#region src/styles/placement.d.ts
|
|
1277
|
+
interface PlacementStyleProps {
|
|
1278
|
+
place?: string | boolean;
|
|
1279
|
+
placeItems?: string | boolean;
|
|
1280
|
+
placeContent?: string | boolean;
|
|
1281
|
+
align?: string | boolean;
|
|
1282
|
+
justify?: string | boolean;
|
|
1283
|
+
alignItems?: string | boolean;
|
|
1284
|
+
alignContent?: string | boolean;
|
|
1285
|
+
justifyItems?: string | boolean;
|
|
1286
|
+
justifyContent?: string | boolean;
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Unified placement handler replacing align, justify, and place.
|
|
1290
|
+
*
|
|
1291
|
+
* Priority (later overrides earlier):
|
|
1292
|
+
* 1. place (lowest) — sets all 4 longhands
|
|
1293
|
+
* 2. placeItems, placeContent, align, justify (medium) — each sets 2 longhands
|
|
1294
|
+
* 3. alignItems, alignContent, justifyItems, justifyContent (highest) — each sets 1 longhand
|
|
1295
|
+
*/
|
|
1296
|
+
declare function placementStyle({
|
|
1297
|
+
place,
|
|
1298
|
+
placeItems,
|
|
1299
|
+
placeContent,
|
|
1300
|
+
align,
|
|
1301
|
+
justify,
|
|
1302
|
+
alignItems,
|
|
1303
|
+
alignContent,
|
|
1304
|
+
justifyItems,
|
|
1305
|
+
justifyContent
|
|
1306
|
+
}: PlacementStyleProps): Record<string, string> | null;
|
|
1307
|
+
declare namespace placementStyle {
|
|
1308
|
+
var __lookupStyles: string[];
|
|
1309
|
+
}
|
|
1310
|
+
//#endregion
|
|
1311
|
+
//#region src/styles/preset.d.ts
|
|
1312
|
+
interface PresetStyleProps {
|
|
1313
|
+
preset?: string | boolean;
|
|
1314
|
+
fontSize?: string | number;
|
|
1315
|
+
lineHeight?: string | number;
|
|
1316
|
+
textTransform?: string;
|
|
1317
|
+
letterSpacing?: string | number;
|
|
1318
|
+
fontWeight?: string | number;
|
|
1319
|
+
fontStyle?: string | boolean;
|
|
1320
|
+
fontFamily?: string;
|
|
1321
|
+
/** Alias for fontFamily with special handling for 'monospace' and boolean */
|
|
1322
|
+
font?: string | boolean;
|
|
1323
|
+
}
|
|
1324
|
+
/**
|
|
1325
|
+
* Handles typography preset and individual font properties.
|
|
1326
|
+
*
|
|
1327
|
+
* Preset syntax uses `/` to separate the name from one or more
|
|
1328
|
+
* space-separated modifiers:
|
|
1329
|
+
* - `preset="h1"` — name only
|
|
1330
|
+
* - `preset="h2 / strong"` — name + modifier
|
|
1331
|
+
* - `preset="h2 / strong italic"` — name + multiple modifiers
|
|
1332
|
+
* - `preset="bold"` — modifier-only shorthand (name defaults to `inherit`)
|
|
1333
|
+
* - `preset="bold italic"` — modifier-only shorthand with multiple modifiers
|
|
1334
|
+
*
|
|
1335
|
+
* When `preset` is defined, it sets up CSS custom properties for typography.
|
|
1336
|
+
* Individual font props can be used with or without `preset`:
|
|
1337
|
+
* - With `preset`: overrides the preset value for that property
|
|
1338
|
+
* - Without `preset`: outputs the CSS directly
|
|
1339
|
+
*
|
|
1340
|
+
* Number values are converted to pixels for fontSize, lineHeight, letterSpacing.
|
|
1341
|
+
* fontWeight accepts numbers directly (e.g., 400, 700).
|
|
1342
|
+
*
|
|
1343
|
+
* font vs fontFamily:
|
|
1344
|
+
* - `font` is the recommended prop with special handling (monospace, boolean, fallback)
|
|
1345
|
+
* - `fontFamily` is a direct value without special handling
|
|
1346
|
+
*/
|
|
1347
|
+
declare function presetStyle({
|
|
1348
|
+
preset,
|
|
1349
|
+
fontSize,
|
|
1350
|
+
lineHeight,
|
|
1351
|
+
textTransform,
|
|
1352
|
+
letterSpacing,
|
|
1353
|
+
fontWeight,
|
|
1354
|
+
fontStyle,
|
|
1355
|
+
fontFamily,
|
|
1356
|
+
font
|
|
1357
|
+
}: PresetStyleProps): CSSMap | null;
|
|
1358
|
+
declare namespace presetStyle {
|
|
1359
|
+
var __lookupStyles: string[];
|
|
1360
|
+
}
|
|
1361
|
+
//#endregion
|
|
1362
|
+
//#region src/styles/radius.d.ts
|
|
1363
|
+
declare function radiusStyle({
|
|
1364
|
+
radius
|
|
1365
|
+
}: {
|
|
1366
|
+
radius?: string | number | boolean;
|
|
1367
|
+
}): Record<string, string> | null;
|
|
1368
|
+
declare namespace radiusStyle {
|
|
1369
|
+
var __lookupStyles: string[];
|
|
1370
|
+
}
|
|
1371
|
+
//#endregion
|
|
1372
|
+
//#region src/styles/scrollMargin.d.ts
|
|
1373
|
+
declare function scrollMarginStyle({
|
|
1374
|
+
scrollMargin,
|
|
1375
|
+
scrollMarginTop,
|
|
1376
|
+
scrollMarginRight,
|
|
1377
|
+
scrollMarginBottom,
|
|
1378
|
+
scrollMarginLeft
|
|
1379
|
+
}: {
|
|
1380
|
+
scrollMargin?: string | number | boolean;
|
|
1381
|
+
scrollMarginTop?: string | number | boolean;
|
|
1382
|
+
scrollMarginRight?: string | number | boolean;
|
|
1383
|
+
scrollMarginBottom?: string | number | boolean;
|
|
1384
|
+
scrollMarginLeft?: string | number | boolean;
|
|
1385
|
+
}): Record<string, string> | null;
|
|
1386
|
+
declare namespace scrollMarginStyle {
|
|
1387
|
+
var __lookupStyles: string[];
|
|
1388
|
+
}
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/styles/scrollPadding.d.ts
|
|
1391
|
+
declare function scrollPaddingStyle({
|
|
1392
|
+
scrollPadding,
|
|
1393
|
+
scrollPaddingTop,
|
|
1394
|
+
scrollPaddingRight,
|
|
1395
|
+
scrollPaddingBottom,
|
|
1396
|
+
scrollPaddingLeft
|
|
1397
|
+
}: {
|
|
1398
|
+
scrollPadding?: string | number | boolean;
|
|
1399
|
+
scrollPaddingTop?: string | number | boolean;
|
|
1400
|
+
scrollPaddingRight?: string | number | boolean;
|
|
1401
|
+
scrollPaddingBottom?: string | number | boolean;
|
|
1402
|
+
scrollPaddingLeft?: string | number | boolean;
|
|
1403
|
+
}): Record<string, string> | null;
|
|
1404
|
+
declare namespace scrollPaddingStyle {
|
|
1405
|
+
var __lookupStyles: string[];
|
|
1406
|
+
}
|
|
1407
|
+
//#endregion
|
|
1408
|
+
//#region src/styles/scrollbar.d.ts
|
|
1409
|
+
interface ScrollbarStyleProps {
|
|
1410
|
+
scrollbar?: string | boolean;
|
|
1411
|
+
overflow?: string;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Standard CSS scrollbar styling via `scrollbar-width`, `scrollbar-color`,
|
|
1415
|
+
* and `scrollbar-gutter`.
|
|
1416
|
+
*
|
|
1417
|
+
* Width values: `thin` (default), `auto`, `none`
|
|
1418
|
+
* Modifiers: `stable`, `both-edges`, `always`
|
|
1419
|
+
*
|
|
1420
|
+
* Note: `auto` is classified as a VALUE_KEYWORD by the parser, so it lands
|
|
1421
|
+
* in `values` rather than `mods`. Both locations are checked for robustness.
|
|
1422
|
+
*/
|
|
1423
|
+
declare function scrollbarStyle({
|
|
1424
|
+
scrollbar,
|
|
1425
|
+
overflow
|
|
1426
|
+
}: ScrollbarStyleProps): Record<string, string> | null;
|
|
1427
|
+
declare namespace scrollbarStyle {
|
|
1428
|
+
var __lookupStyles: string[];
|
|
1429
|
+
}
|
|
1430
|
+
//#endregion
|
|
1431
|
+
//#region src/styles/shadow.d.ts
|
|
1432
|
+
declare function shadowStyle({
|
|
1433
|
+
shadow
|
|
1434
|
+
}: {
|
|
1435
|
+
shadow?: string | boolean;
|
|
1436
|
+
}): {
|
|
1437
|
+
'box-shadow': string;
|
|
1438
|
+
} | null;
|
|
1439
|
+
declare namespace shadowStyle {
|
|
1440
|
+
var __lookupStyles: string[];
|
|
1441
|
+
}
|
|
1442
|
+
//#endregion
|
|
1443
|
+
//#region src/styles/transition.d.ts
|
|
1444
|
+
declare function transitionStyle({
|
|
1445
|
+
transition
|
|
1446
|
+
}: {
|
|
1447
|
+
transition?: string;
|
|
1448
|
+
}): {
|
|
1449
|
+
transition: string;
|
|
1450
|
+
} | null;
|
|
1451
|
+
declare namespace transitionStyle {
|
|
1452
|
+
var __lookupStyles: string[];
|
|
1453
|
+
}
|
|
1454
|
+
//#endregion
|
|
1455
|
+
//#region src/styles/width.d.ts
|
|
1456
|
+
interface WidthStyleProps {
|
|
1457
|
+
width?: string | number | boolean;
|
|
1458
|
+
minWidth?: string | number | boolean;
|
|
1459
|
+
maxWidth?: string | number | boolean;
|
|
1460
|
+
}
|
|
1461
|
+
declare function widthStyle({
|
|
1462
|
+
width,
|
|
1463
|
+
minWidth,
|
|
1464
|
+
maxWidth
|
|
1465
|
+
}: WidthStyleProps): Record<string, string | string[]> | null;
|
|
1466
|
+
declare namespace widthStyle {
|
|
1467
|
+
var __lookupStyles: string[];
|
|
1468
|
+
}
|
|
1469
|
+
//#endregion
|
|
1470
|
+
//#region src/styles/predefined.d.ts
|
|
1471
|
+
/**
|
|
1472
|
+
* Exported object containing wrapped predefined style handlers.
|
|
1473
|
+
* Users can import and call these to extend or delegate to built-in behavior.
|
|
1474
|
+
*
|
|
1475
|
+
* Internal handlers use *Style suffix for searchability.
|
|
1476
|
+
* External API uses short names for convenience.
|
|
1477
|
+
*
|
|
1478
|
+
* @example
|
|
1479
|
+
* ```ts
|
|
1480
|
+
* import { styleHandlers, configure } from '@tenphi/tasty';
|
|
1481
|
+
*
|
|
1482
|
+
* configure({
|
|
1483
|
+
* handlers: {
|
|
1484
|
+
* fill: ({ fill }) => {
|
|
1485
|
+
* if (fill?.startsWith('gradient:')) {
|
|
1486
|
+
* return { background: fill.slice(9) };
|
|
1487
|
+
* }
|
|
1488
|
+
* return styleHandlers.fill({ fill });
|
|
1489
|
+
* },
|
|
1490
|
+
* },
|
|
1491
|
+
* });
|
|
1492
|
+
* ```
|
|
1493
|
+
*/
|
|
1494
|
+
declare const styleHandlers: {
|
|
1495
|
+
readonly margin: typeof marginStyle;
|
|
1496
|
+
readonly outline: typeof outlineStyle;
|
|
1497
|
+
readonly padding: typeof paddingStyle;
|
|
1498
|
+
readonly placement: typeof placementStyle;
|
|
1499
|
+
readonly preset: typeof presetStyle;
|
|
1500
|
+
readonly radius: typeof radiusStyle;
|
|
1501
|
+
readonly scrollMargin: typeof scrollMarginStyle;
|
|
1502
|
+
readonly scrollPadding: typeof scrollPaddingStyle;
|
|
1503
|
+
readonly scrollbar: typeof scrollbarStyle;
|
|
1504
|
+
readonly shadow: typeof shadowStyle;
|
|
1505
|
+
readonly transition: typeof transitionStyle;
|
|
1506
|
+
readonly width: typeof widthStyle;
|
|
1507
|
+
readonly blockBorder: StyleHandler<Partial<Record<"blockBorder", string | number | boolean | undefined>>>;
|
|
1508
|
+
readonly inlineBorder: StyleHandler<Partial<Record<"inlineBorder", string | number | boolean | undefined>>>;
|
|
1509
|
+
readonly blockScrollPadding: StyleHandler<Partial<Record<"blockScrollPadding", string | number | boolean | undefined>>>;
|
|
1510
|
+
readonly inlineScrollPadding: StyleHandler<Partial<Record<"inlineScrollPadding", string | number | boolean | undefined>>>;
|
|
1511
|
+
readonly blockScrollMargin: StyleHandler<Partial<Record<"blockScrollMargin", string | number | boolean | undefined>>>;
|
|
1512
|
+
readonly inlineScrollMargin: StyleHandler<Partial<Record<"inlineScrollMargin", string | number | boolean | undefined>>>;
|
|
1513
|
+
readonly blockInset: StyleHandler<Partial<Record<"blockInset", string | number | boolean | undefined>>>;
|
|
1514
|
+
readonly inlineInset: StyleHandler<Partial<Record<"inlineInset", string | number | boolean | undefined>>>;
|
|
1515
|
+
readonly blockMargin: StyleHandler<Partial<Record<"blockMargin", string | number | boolean | undefined>>>;
|
|
1516
|
+
readonly inlineMargin: StyleHandler<Partial<Record<"inlineMargin", string | number | boolean | undefined>>>;
|
|
1517
|
+
readonly blockPadding: StyleHandler<Partial<Record<"blockPadding", string | number | boolean | undefined>>>;
|
|
1518
|
+
readonly inlinePadding: StyleHandler<Partial<Record<"inlinePadding", string | number | boolean | undefined>>>;
|
|
1519
|
+
readonly blockSize: typeof blockSizeStyle;
|
|
1520
|
+
readonly border: typeof borderStyle;
|
|
1521
|
+
readonly color: typeof colorStyle;
|
|
1522
|
+
readonly display: typeof displayStyle;
|
|
1523
|
+
readonly fade: typeof fadeStyle;
|
|
1524
|
+
readonly fill: typeof fillStyle;
|
|
1525
|
+
readonly svgFill: typeof svgFillStyle;
|
|
1526
|
+
readonly flow: typeof flowStyle;
|
|
1527
|
+
readonly gap: typeof gapStyle;
|
|
1528
|
+
readonly height: typeof heightStyle;
|
|
1529
|
+
readonly inset: typeof insetStyle;
|
|
1530
|
+
readonly inlineSize: typeof inlineSizeStyle;
|
|
1531
|
+
};
|
|
1532
|
+
//#endregion
|
|
1533
|
+
//#region src/styles/define-handler.d.ts
|
|
1534
|
+
/**
|
|
1535
|
+
* Declare a multi-dependency style handler with its dependency names inferred
|
|
1536
|
+
* into the handler's parameter type.
|
|
1537
|
+
*
|
|
1538
|
+
* Without it, the multi-dependency tuple form needs a hand-written parameter
|
|
1539
|
+
* annotation that can silently drift from the dependency list:
|
|
1540
|
+
*
|
|
1541
|
+
* ```ts
|
|
1542
|
+
* // Annotation and dependency list are maintained separately.
|
|
1543
|
+
* handlers: {
|
|
1544
|
+
* spacing: [['gap', 'padding'], ({ gap, padding }: { gap?: string; padding?: string }) => …],
|
|
1545
|
+
* }
|
|
1546
|
+
*
|
|
1547
|
+
* // Both come from the same array; a typo in the destructure is a type error.
|
|
1548
|
+
* handlers: {
|
|
1549
|
+
* spacing: defineHandler(['gap', 'padding'], ({ gap, padding }) => …),
|
|
1550
|
+
* }
|
|
1551
|
+
* ```
|
|
1552
|
+
*
|
|
1553
|
+
* Values arrive **state-resolved but unparsed** — the raw authored DSL string
|
|
1554
|
+
* (`'2x'`, `'#purple.5'`), so call `parseStyle()` / `parseColor()` as needed. The
|
|
1555
|
+
* result is a kebab-case CSS declaration map (or an array of them); the reserved
|
|
1556
|
+
* `$` key applies the declarations to a nested selector.
|
|
1557
|
+
*
|
|
1558
|
+
* All names must belong to the same chunk. Names the built-in chunk lists don't
|
|
1559
|
+
* know are pulled into their handler's chunk automatically at registration.
|
|
1560
|
+
*/
|
|
1561
|
+
declare function defineHandler<const TDeps extends readonly string[]>(deps: TDeps, handler: (props: Partial<Record<TDeps[number], ResolvedStyleValue>>) => StyleHandlerResult): [readonly string[], RawStyleHandler];
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region src/compute-styles.d.ts
|
|
1564
|
+
interface ComputeStylesResult {
|
|
1565
|
+
className: string;
|
|
1566
|
+
/** CSS text to emit as an inline <style> tag (RSC mode only). */
|
|
1567
|
+
css?: string;
|
|
1568
|
+
}
|
|
1569
|
+
interface ComputeStylesOptions {
|
|
1570
|
+
ssrCollector?: ServerStyleCollector | null;
|
|
1571
|
+
/** Target root for style injection (client only). Defaults to `document`. */
|
|
1572
|
+
root?: Document | ShadowRoot;
|
|
1573
|
+
/**
|
|
1574
|
+
* Set when `styles` outlives this call and will be passed in again — a
|
|
1575
|
+
* `tasty()` factory's own styles object rather than a per-render merge.
|
|
1576
|
+
* It lets chunk cache keys be memoized on the object, which is worth the
|
|
1577
|
+
* bookkeeping only when there is a next render to spend it on.
|
|
1578
|
+
*/
|
|
1579
|
+
stableStyles?: boolean;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Synchronous, hook-free style computation.
|
|
1583
|
+
*
|
|
1584
|
+
* Resolves recipes, categorizes style keys into chunks, renders CSS rules,
|
|
1585
|
+
* allocates class names, and injects / collects / returns the CSS.
|
|
1586
|
+
*
|
|
1587
|
+
* Three code paths:
|
|
1588
|
+
* 1. SSR collector — discovered via ALS or passed explicitly; CSS collected
|
|
1589
|
+
* 2. RSC inline — no collector and no `document`; CSS returned as `result.css`
|
|
1590
|
+
* for the caller to emit as an inline `<style>` tag
|
|
1591
|
+
* 3. Client inject — CSS injected synchronously into the DOM (idempotent)
|
|
1592
|
+
*
|
|
1593
|
+
* @param styles - Tasty styles object (or undefined for no styles)
|
|
1594
|
+
* @param options - Optional SSR collector override
|
|
1595
|
+
*/
|
|
1596
|
+
declare function computeStyles(styles: Styles | undefined, options?: ComputeStylesOptions): ComputeStylesResult;
|
|
1597
|
+
//#endregion
|
|
1598
|
+
//#region src/injector/chunk-sheet-registry.d.ts
|
|
1599
|
+
/**
|
|
1600
|
+
* Global registry mapping CSS content hashes to shared constructable
|
|
1601
|
+
* CSSStyleSheet objects with reference counting.
|
|
1602
|
+
*
|
|
1603
|
+
* Multiple shadow roots adopting the same chunk share a single underlying
|
|
1604
|
+
* stylesheet object — parse once, adopt everywhere.
|
|
1605
|
+
*/
|
|
1606
|
+
declare class ChunkSheetRegistry {
|
|
1607
|
+
private sheets;
|
|
1608
|
+
private sheetToHash;
|
|
1609
|
+
/**
|
|
1610
|
+
* Get or create a CSSStyleSheet for the given CSS text.
|
|
1611
|
+
* Increments refCount. Uses content hash as the dedup key.
|
|
1612
|
+
*/
|
|
1613
|
+
acquire(cssText: string): CSSStyleSheet;
|
|
1614
|
+
/**
|
|
1615
|
+
* Decrement refCount for a sheet. When refCount reaches 0,
|
|
1616
|
+
* the sheet is removed from the registry.
|
|
1617
|
+
*/
|
|
1618
|
+
release(sheet: CSSStyleSheet): void;
|
|
1619
|
+
/**
|
|
1620
|
+
* Bulk acquire — returns an array of CSSStyleSheet in the same order.
|
|
1621
|
+
*/
|
|
1622
|
+
acquireAll(cssTexts: string[]): CSSStyleSheet[];
|
|
1623
|
+
/**
|
|
1624
|
+
* Bulk release — decrements refCount for each sheet.
|
|
1625
|
+
*/
|
|
1626
|
+
releaseAll(sheets: CSSStyleSheet[]): void;
|
|
1627
|
+
/** Number of unique sheets currently held. */
|
|
1628
|
+
get size(): number;
|
|
1629
|
+
}
|
|
1630
|
+
/** Module-level singleton shared across the entire application. */
|
|
1631
|
+
declare const chunkSheetRegistry: ChunkSheetRegistry;
|
|
1632
|
+
//#endregion
|
|
1633
|
+
//#region src/injector/index.d.ts
|
|
1634
|
+
/**
|
|
1635
|
+
* Inject styles and return className with dispose function
|
|
1636
|
+
*/
|
|
1637
|
+
declare function inject(rules: StyleResult[], options?: InjectOptions): InjectResult;
|
|
1638
|
+
/**
|
|
1639
|
+
* Inject global rules that should not reserve tasty class names
|
|
1640
|
+
*/
|
|
1641
|
+
declare function injectGlobal(rules: StyleResult[], options?: {
|
|
1642
|
+
root?: Document | ShadowRoot;
|
|
1643
|
+
}): GlobalInjectResult;
|
|
1644
|
+
/**
|
|
1645
|
+
* Inject raw CSS text directly without parsing
|
|
1646
|
+
* This is a low-overhead method for injecting raw CSS that doesn't need tasty processing.
|
|
1647
|
+
* The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking.
|
|
1648
|
+
*
|
|
1649
|
+
* @example
|
|
1650
|
+
* ```tsx
|
|
1651
|
+
* // Inject raw CSS
|
|
1652
|
+
* const { dispose } = injectRawCSS(`
|
|
1653
|
+
* body { margin: 0; padding: 0; }
|
|
1654
|
+
* .my-class { color: red; }
|
|
1655
|
+
* `);
|
|
1656
|
+
*
|
|
1657
|
+
* // Later, remove the injected CSS
|
|
1658
|
+
* dispose();
|
|
1659
|
+
* ```
|
|
1660
|
+
*/
|
|
1661
|
+
declare function injectRawCSS(css: string, options?: {
|
|
1662
|
+
root?: Document | ShadowRoot;
|
|
1663
|
+
}): {
|
|
1664
|
+
dispose: () => void;
|
|
1665
|
+
};
|
|
1666
|
+
/**
|
|
1667
|
+
* Get raw CSS text for SSR
|
|
1668
|
+
*/
|
|
1669
|
+
declare function getRawCSSText(options?: {
|
|
1670
|
+
root?: Document | ShadowRoot;
|
|
1671
|
+
}): string;
|
|
1672
|
+
/**
|
|
1673
|
+
* Inject keyframes and return object with toString() and dispose()
|
|
1674
|
+
*/
|
|
1675
|
+
declare function keyframes(steps: KeyframesSteps, nameOrOptions?: string | {
|
|
1676
|
+
root?: Document | ShadowRoot;
|
|
1677
|
+
name?: string;
|
|
1678
|
+
}): KeyframesResult;
|
|
1679
|
+
/**
|
|
1680
|
+
* Define a CSS @property custom property.
|
|
1681
|
+
* This enables advanced features like animating custom properties.
|
|
1682
|
+
*
|
|
1683
|
+
* Note: @property rules are global and persistent once defined.
|
|
1684
|
+
* Re-registering the same property name is a no-op.
|
|
1685
|
+
*
|
|
1686
|
+
* @param name - The custom property name (must start with --)
|
|
1687
|
+
* @param options - Property configuration
|
|
1688
|
+
*
|
|
1689
|
+
* @example
|
|
1690
|
+
* ```ts
|
|
1691
|
+
* // Define a color property that can be animated
|
|
1692
|
+
* property('--my-color', {
|
|
1693
|
+
* syntax: '<color>',
|
|
1694
|
+
* initialValue: 'red',
|
|
1695
|
+
* });
|
|
1696
|
+
*
|
|
1697
|
+
* // Define an angle property
|
|
1698
|
+
* property('--rotation', {
|
|
1699
|
+
* syntax: '<angle>',
|
|
1700
|
+
* inherits: false,
|
|
1701
|
+
* initialValue: '0deg',
|
|
1702
|
+
* });
|
|
1703
|
+
* ```
|
|
1704
|
+
*/
|
|
1705
|
+
declare function property(name: string, options?: PropertyOptions): void;
|
|
1706
|
+
/**
|
|
1707
|
+
* Check if a CSS @property has already been defined
|
|
1708
|
+
*
|
|
1709
|
+
* @param name - The custom property name to check
|
|
1710
|
+
* @param options - Options including root
|
|
1711
|
+
*/
|
|
1712
|
+
declare function isPropertyDefined(name: string, options?: {
|
|
1713
|
+
root?: Document | ShadowRoot;
|
|
1714
|
+
}): boolean;
|
|
1715
|
+
/**
|
|
1716
|
+
* Inject a CSS @font-face rule.
|
|
1717
|
+
*
|
|
1718
|
+
* Permanent and global — no dispose or ref-counting.
|
|
1719
|
+
* Deduplicates by content hash (family + descriptors).
|
|
1720
|
+
*/
|
|
1721
|
+
declare function fontFace(family: string, descriptors: FontFaceDescriptors, options?: {
|
|
1722
|
+
root?: Document | ShadowRoot;
|
|
1723
|
+
}): void;
|
|
1724
|
+
/**
|
|
1725
|
+
* Inject a CSS @counter-style rule.
|
|
1726
|
+
*
|
|
1727
|
+
* Permanent and global — no dispose or ref-counting. Deduplicates by name and
|
|
1728
|
+
* overrides an existing rule by default. Pass `weak: true` for global
|
|
1729
|
+
* `configure()` definitions, which never clobber an existing rule.
|
|
1730
|
+
*/
|
|
1731
|
+
declare function counterStyle(name: string, descriptors: CounterStyleDescriptors, options?: {
|
|
1732
|
+
root?: Document | ShadowRoot;
|
|
1733
|
+
weak?: boolean;
|
|
1734
|
+
}): void;
|
|
1735
|
+
/**
|
|
1736
|
+
* Inject a CSS @function rule (custom function).
|
|
1737
|
+
*
|
|
1738
|
+
* Permanent and global — no dispose or ref-counting. Deduplicates by function
|
|
1739
|
+
* name and overrides an existing rule by default. Pass `weak: true` for global
|
|
1740
|
+
* `configure()` definitions, which never clobber an existing rule.
|
|
1741
|
+
*
|
|
1742
|
+
* @param name - The function name (`$$name`, `$name`, or `--name`)
|
|
1743
|
+
* @param definition - Function definition (args, returns, result, local vars)
|
|
1744
|
+
*
|
|
1745
|
+
* @example
|
|
1746
|
+
* ```ts
|
|
1747
|
+
* func('$$negative', { args: ['$value'], result: '(-1 * $value)' });
|
|
1748
|
+
* ```
|
|
1749
|
+
*/
|
|
1750
|
+
declare function func(name: string, definition: FunctionDefinition, options?: {
|
|
1751
|
+
root?: Document | ShadowRoot;
|
|
1752
|
+
weak?: boolean;
|
|
1753
|
+
}): void;
|
|
1754
|
+
/**
|
|
1755
|
+
* Get CSS text from all sheets (for SSR)
|
|
1756
|
+
*/
|
|
1757
|
+
declare function getCSSText(options?: {
|
|
1758
|
+
root?: Document | ShadowRoot;
|
|
1759
|
+
}): string;
|
|
1760
|
+
/**
|
|
1761
|
+
* Collect only CSS used by a rendered subtree (like jest-styled-components).
|
|
1762
|
+
* Pass the container returned by render(...).
|
|
1763
|
+
*/
|
|
1764
|
+
declare function getCSSTextForNode(node: ParentNode | Element | DocumentFragment, options?: {
|
|
1765
|
+
root?: Document | ShadowRoot;
|
|
1766
|
+
}): string;
|
|
1767
|
+
/**
|
|
1768
|
+
* Take a reference on local `@keyframes` under the deterministic names the
|
|
1769
|
+
* caller resolved, and report which entry holds each. Pair with
|
|
1770
|
+
* `ownKeyframes()` once the rules exist to inspect.
|
|
1771
|
+
*/
|
|
1772
|
+
declare function holdKeyframes(steps: Record<string, KeyframesSteps>, names: Map<string, string>, options?: {
|
|
1773
|
+
root?: Document | ShadowRoot;
|
|
1774
|
+
}): Map<string, string>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Record that a class animates these keyframes, so the reference is released
|
|
1777
|
+
* when the last such class is collected.
|
|
1778
|
+
*/
|
|
1779
|
+
declare function ownKeyframes(key: string, className: string, options?: {
|
|
1780
|
+
root?: Document | ShadowRoot;
|
|
1781
|
+
}): void;
|
|
1782
|
+
/**
|
|
1783
|
+
* Remove every injected rule that is neither in the DOM nor held by an
|
|
1784
|
+
* outstanding `inject()` handle. Equivalent to `gc({ force: true })`.
|
|
1785
|
+
*/
|
|
1786
|
+
declare function cleanup(root?: Document | ShadowRoot): void;
|
|
1787
|
+
/**
|
|
1788
|
+
* Count a render, so that a collection pass is scheduled every
|
|
1789
|
+
* `gc.touchInterval` of them. Used internally by computeStyles and tasty().
|
|
1790
|
+
*
|
|
1791
|
+
* @deprecated The class name is ignored — collection asks the DOM what is
|
|
1792
|
+
* rendered rather than recording usage per class. The argument is kept so
|
|
1793
|
+
* existing calls still compile.
|
|
1794
|
+
*/
|
|
1795
|
+
declare function touch(className: string, options?: {
|
|
1796
|
+
root?: Document | ShadowRoot;
|
|
1797
|
+
}): void;
|
|
1798
|
+
/**
|
|
1799
|
+
* Synchronous garbage collection of unused styles — those no element carries
|
|
1800
|
+
* and no `inject()` handle references. Evicts the oldest ones once they exceed
|
|
1801
|
+
* capacity. With `{ force: true }`, removes all of them regardless of capacity.
|
|
1802
|
+
*
|
|
1803
|
+
* @returns Number of styles evicted.
|
|
1804
|
+
*/
|
|
1805
|
+
declare function gc(options?: GCOptions): number;
|
|
1806
|
+
/**
|
|
1807
|
+
* Get the global injector instance for debugging
|
|
1808
|
+
*/
|
|
1809
|
+
declare const injector: {
|
|
1810
|
+
readonly instance: StyleInjector;
|
|
1811
|
+
};
|
|
1812
|
+
/**
|
|
1813
|
+
* Destroy all resources and clean up
|
|
1814
|
+
*/
|
|
1815
|
+
declare function destroy(root?: Document | ShadowRoot): void;
|
|
1816
|
+
/**
|
|
1817
|
+
* Create a new isolated injector instance
|
|
1818
|
+
*/
|
|
1819
|
+
declare function createInjector(config?: Partial<StyleInjectorConfig>): StyleInjector;
|
|
1820
|
+
//#endregion
|
|
1821
|
+
//#region src/utils/filter-base-props.d.ts
|
|
1822
|
+
interface PropsFilterOptions {
|
|
1823
|
+
labelable?: boolean;
|
|
1824
|
+
propNames?: Set<string>;
|
|
1825
|
+
eventProps?: boolean;
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Filters out all props that aren't valid DOM props or defined via override prop obj.
|
|
1829
|
+
* @param props - The component props to be filtered.
|
|
1830
|
+
* @param opts - Props to override.
|
|
1831
|
+
*/
|
|
1832
|
+
declare function filterBaseProps<T extends object>(props: T, opts?: PropsFilterOptions): Partial<T>;
|
|
1833
|
+
//#endregion
|
|
1834
|
+
//#region src/utils/colors.d.ts
|
|
1835
|
+
declare function color$1(name: string, opacity?: number): string;
|
|
1836
|
+
//#endregion
|
|
1837
|
+
//#region src/utils/mod-attrs.d.ts
|
|
1838
|
+
declare function modAttrs(map: AllBaseProps['mods']): Record<string, string> | null;
|
|
1839
|
+
//#endregion
|
|
1840
|
+
//#region src/utils/resolve-recipes.d.ts
|
|
1841
|
+
/** Resolve recipe references against the globally configured recipe map. */
|
|
1842
|
+
declare function resolveRecipes(styles: Styles): Styles;
|
|
1843
|
+
//#endregion
|
|
1844
|
+
//#region src/utils/process-tokens.d.ts
|
|
1845
|
+
/**
|
|
1846
|
+
* Process tokens object into inline style properties.
|
|
1847
|
+
* - `$name` -> `--name` with the parsed value
|
|
1848
|
+
* - `#name` -> `--name-color` with the parsed value
|
|
1849
|
+
*
|
|
1850
|
+
* @param tokens - The tokens object to process
|
|
1851
|
+
* @returns CSSProperties object or undefined if no tokens to process
|
|
1852
|
+
*/
|
|
1853
|
+
declare function processTokens(tokens: Tokens | undefined): CSSProperties$1 | undefined;
|
|
1854
|
+
//#endregion
|
|
1855
|
+
//#region src/debug.d.ts
|
|
1856
|
+
declare global {
|
|
1857
|
+
interface Window {
|
|
1858
|
+
tastyDebug?: typeof tastyDebug;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
type CSSTarget = 'all' | 'global' | 'active' | 'unused' | 'page' | string | string[] | Element;
|
|
1862
|
+
interface DebugOptions {
|
|
1863
|
+
root?: Document | ShadowRoot;
|
|
1864
|
+
/** Suppress console logging and return data only (default: false) */
|
|
1865
|
+
raw?: boolean;
|
|
1866
|
+
}
|
|
1867
|
+
interface CSSOptions extends DebugOptions {
|
|
1868
|
+
prettify?: boolean;
|
|
1869
|
+
/** Read from stored source CSS (dev-mode only) instead of live CSSOM */
|
|
1870
|
+
source?: boolean;
|
|
1871
|
+
}
|
|
1872
|
+
interface DebugChunkInfo {
|
|
1873
|
+
className: string;
|
|
1874
|
+
chunkName: string | null;
|
|
1875
|
+
}
|
|
1876
|
+
interface InspectResult {
|
|
1877
|
+
element?: Element | null;
|
|
1878
|
+
classes: string[];
|
|
1879
|
+
chunks: DebugChunkInfo[];
|
|
1880
|
+
css: string;
|
|
1881
|
+
size: number;
|
|
1882
|
+
rules: number;
|
|
1883
|
+
}
|
|
1884
|
+
interface CacheStatus {
|
|
1885
|
+
classes: {
|
|
1886
|
+
active: string[];
|
|
1887
|
+
unused: string[];
|
|
1888
|
+
all: string[];
|
|
1889
|
+
};
|
|
1890
|
+
metrics: CacheMetrics | null;
|
|
1891
|
+
}
|
|
1892
|
+
interface ChunkBreakdown {
|
|
1893
|
+
byChunk: Record<string, {
|
|
1894
|
+
classes: string[];
|
|
1895
|
+
cssSize: number;
|
|
1896
|
+
ruleCount: number;
|
|
1897
|
+
}>;
|
|
1898
|
+
totalChunkTypes: number;
|
|
1899
|
+
totalClasses: number;
|
|
1900
|
+
}
|
|
1901
|
+
interface Summary {
|
|
1902
|
+
activeClasses: string[];
|
|
1903
|
+
/** Classes `gc({ force: true })` would delete right now. */
|
|
1904
|
+
unusedClasses: string[];
|
|
1905
|
+
/**
|
|
1906
|
+
* Held but in neither list: nothing renders them, yet collection will not
|
|
1907
|
+
* take them — inside the grace window, or pinned by an `inject()` handle.
|
|
1908
|
+
*/
|
|
1909
|
+
hotClasses: string[];
|
|
1910
|
+
totalStyledClasses: string[];
|
|
1911
|
+
activeCSSSize: number;
|
|
1912
|
+
unusedCSSSize: number;
|
|
1913
|
+
globalCSSSize: number;
|
|
1914
|
+
rawCSSSize: number;
|
|
1915
|
+
keyframesCSSSize: number;
|
|
1916
|
+
propertyCSSSize: number;
|
|
1917
|
+
totalCSSSize: number;
|
|
1918
|
+
activeRuleCount: number;
|
|
1919
|
+
unusedRuleCount: number;
|
|
1920
|
+
globalRuleCount: number;
|
|
1921
|
+
rawRuleCount: number;
|
|
1922
|
+
keyframesRuleCount: number;
|
|
1923
|
+
propertyRuleCount: number;
|
|
1924
|
+
totalRuleCount: number;
|
|
1925
|
+
metrics: CacheMetrics | null;
|
|
1926
|
+
definedProperties: string[];
|
|
1927
|
+
definedKeyframes: {
|
|
1928
|
+
name: string;
|
|
1929
|
+
refCount: number;
|
|
1930
|
+
}[];
|
|
1931
|
+
chunkBreakdown: ChunkBreakdown;
|
|
1932
|
+
}
|
|
1933
|
+
declare const tastyDebug: {
|
|
1934
|
+
css(target: CSSTarget, opts?: CSSOptions): string;
|
|
1935
|
+
inspect(target: string | Element, opts?: DebugOptions): InspectResult;
|
|
1936
|
+
summary(opts?: DebugOptions): Summary;
|
|
1937
|
+
chunks(opts?: DebugOptions): ChunkBreakdown;
|
|
1938
|
+
cache(opts?: DebugOptions): CacheStatus;
|
|
1939
|
+
cleanup(opts?: {
|
|
1940
|
+
root?: Document | ShadowRoot;
|
|
1941
|
+
}): void;
|
|
1942
|
+
help(): void;
|
|
1943
|
+
install(): void;
|
|
1944
|
+
};
|
|
1945
|
+
//#endregion
|
|
1946
|
+
export { createColorFunc as $, OuterStyleProps as $t, keyframes as A, TastyElementOptions as At, styleHandlers as B, BasePropsWithoutChildren as Bt, getRawCSSText as C, DEFAULT_ZERO_NAME_PREFIX as Cn, ResolveAsProps as Ct, injectRawCSS as D, SubElementDefinition as Dt, injectGlobal as E, ResolveTokenProps as Et, chunkSheetRegistry as F, VariantMap as Ft, ChunkName as G, ColorStyleProps as Gt, categorizeStyleKeys as H, BlockInnerStyleProps as Ht, ComputeStylesOptions as I, WithVariant as It, FONT_CHUNK_STYLES as J, ExtraBaseStyleProps as Jt, DIMENSION_CHUNK_STYLES as K, ContainerStyleProps as Kt, ComputeStylesResult as L, tasty as Lt, property as M, TastyPolymorphicComponent as Mt, touch as N, TastyProps as Nt, injector as O, SubElementProps as Ot, ChunkSheetRegistry as P, TokenPropsInput as Pt, resolveFunctionColor as Q, Mods as Qt, computeStyles as R, AllBaseProps as Rt, getCSSTextForNode as S, DEFAULT_NAME_PREFIX as Sn, ModPropsInput as St, inject as T, ResolveModProps as Tt, APPEARANCE_CHUNK_STYLES as U, BlockOuterStyleProps as Ut, ChunkInfo as V, BaseStyleProps as Vt, CHUNK_NAMES as W, BlockStyleProps as Wt, POSITION_CHUNK_STYLES as X, InnerStyleProps as Xt, LAYOUT_CHUNK_STYLES as Y, FlowStyleProps as Yt, STYLE_TO_CHUNK as Z, ModValue as Zt, destroy as _, FLOW_STYLES as _n, useStyles as _t, DebugOptions as a, TastyExtensionConfig as an, TastyBatchProvider as at, gc as b, POSITION_STYLES as bn, ElementsDefinition as bt, tastyDebug as c, TokenValue as cn, useFunction as ct, modAttrs as d, BLOCK_INNER_STYLES as dn, UsePropertyOptions as dt, PositionStyleProps as en, okhstFunction as et, color$1 as f, BLOCK_OUTER_STYLES as fn, useProperty as ft, createInjector as g, DIMENSION_STYLES as gn, UseStylesResult as gt, counterStyle as h, CONTAINER_STYLES as hn, useGlobalStyles as ht, DebugChunkInfo as i, TastyCustomProps as in, getDisplayName as it, ownKeyframes as j, TastyElementProps as jt, isPropertyDefined as k, TastyComponentPropsWithDefaults as kt, processTokens as l, Tokens as ln, useCounterStyle as lt, cleanup as m, COLOR_STYLES as mn, useRawCSS as mt, CacheStatus as n, TagName as nn, okhslFunction as nt, InspectResult as o, TastyThemeNames as on, TastyBatchProviderProps as ot, filterBaseProps as p, BLOCK_STYLES as pn, useKeyframes as pt, DISPLAY_CHUNK_STYLES as q, DimensionStyleProps as qt, ChunkBreakdown as r, TastyBaseStylePropNames as rn, okhslPlugin as rt, Summary as s, TextStyleProps as sn, UseFunctionOptions as st, CSSOptions as t, ShortGridStyles as tn, okhstPlugin as tt, resolveRecipes as u, BASE_STYLES as un, useFontFace as ut, fontFace as v, INNER_STYLES as vn, AllBasePropsWithMods as vt, holdKeyframes as w, ResolveModPropDef as wt, getCSSText as x, TEXT_STYLES as xn, ModPropDef as xt, func as y, OUTER_STYLES as yn, Element$1 as yt, defineHandler as z, BaseProps as zt };
|
|
1947
|
+
//# sourceMappingURL=index-D9N9GV24.d.ts.map
|