@tenphi/tasty 0.0.0-snapshot.da430e1 → 0.0.0-snapshot.db2ef70
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 +408 -385
- package/dist/babel-types-Dc5zghyE.d.ts +18 -0
- package/dist/chunks/async-storage-f9j9JRtq.js +37 -0
- package/dist/chunks/async-storage-f9j9JRtq.js.map +1 -0
- package/dist/chunks/build-config-D9Iq8QQm.js +60 -0
- package/dist/chunks/build-config-D9Iq8QQm.js.map +1 -0
- package/dist/{collector-BevHh16N.js → chunks/collector-Cb8ah2JF.js} +10 -127
- package/dist/chunks/collector-Cb8ah2JF.js.map +1 -0
- package/dist/chunks/config-engine-CMYFZYQh.js +272 -0
- package/dist/chunks/config-engine-CMYFZYQh.js.map +1 -0
- package/dist/chunks/config-file-DlZXJMj8.js +25 -0
- package/dist/chunks/config-file-DlZXJMj8.js.map +1 -0
- package/dist/chunks/css-definitions-B4aWBkH3.js +910 -0
- package/dist/chunks/css-definitions-B4aWBkH3.js.map +1 -0
- package/dist/chunks/css-resources-P7IBUUZs.js +142 -0
- package/dist/chunks/css-resources-P7IBUUZs.js.map +1 -0
- package/dist/chunks/debug-D2Pu7Xhy.js +502 -0
- package/dist/chunks/debug-D2Pu7Xhy.js.map +1 -0
- package/dist/chunks/dsl-CsFl9LGn.js +1458 -0
- package/dist/chunks/dsl-CsFl9LGn.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-DHiopXCu.js +691 -0
- package/dist/chunks/react-runtime-DHiopXCu.js.map +1 -0
- package/dist/chunks/runtime-engine-NGCofNXy.js +2435 -0
- package/dist/chunks/runtime-engine-NGCofNXy.js.map +1 -0
- package/dist/chunks/runtime-state-lZjMbvwV.js +152 -0
- package/dist/chunks/runtime-state-lZjMbvwV.js.map +1 -0
- package/dist/{merge-styles-BKfagXfV.js → chunks/shared-utils-y-HjvPN4.js} +60 -55
- package/dist/chunks/shared-utils-y-HjvPN4.js.map +1 -0
- package/dist/chunks/style-engine-DnkV_4Jg.js +5602 -0
- package/dist/chunks/style-engine-DnkV_4Jg.js.map +1 -0
- package/dist/{css-writer-BDPmetHV.js → chunks/zero-engine-DcwaCvFs.js} +65 -145
- package/dist/chunks/zero-engine-DcwaCvFs.js.map +1 -0
- package/dist/{collector-CLVr5_p3.d.ts → collector-D2OT6I2G.d.ts} +6 -5
- package/dist/{config-YsxGv4tq.d.ts → config-C4ftFxgI.d.ts} +181 -77
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +9 -6
- package/dist/hydrate-CRyjjAyl.d.ts +22 -0
- package/dist/{index-CBK778ne.d.ts → index-DxQNRj50.d.ts} +308 -255
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -922
- package/dist/{merge-styles-CU7JbEwg.d.ts → merge-styles-D39qBtox.d.ts} +2 -3
- package/dist/ssr/astro-client.d.ts +1 -1
- package/dist/ssr/astro-client.js +1 -14
- package/dist/ssr/astro-client.js.map +1 -1
- package/dist/ssr/astro-middleware-extract-static.d.ts +1 -2
- package/dist/ssr/astro-middleware-extract-static.js +1 -1
- package/dist/ssr/astro-middleware-extract.d.ts +1 -2
- package/dist/ssr/astro-middleware-extract.js +1 -1
- package/dist/ssr/astro-middleware-static.d.ts +1 -2
- package/dist/ssr/astro-middleware-static.js +1 -12
- package/dist/ssr/astro-middleware-static.js.map +1 -1
- package/dist/ssr/astro-middleware.d.ts +1 -2
- package/dist/ssr/astro-middleware.js +1 -13
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +17 -17
- package/dist/ssr/astro.js +220 -1
- package/dist/ssr/astro.js.map +1 -0
- package/dist/ssr/client.d.ts +2 -0
- package/dist/ssr/client.js +2 -0
- package/dist/ssr/index.d.ts +5 -25
- package/dist/ssr/index.js +5 -5
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next-config.d.ts +64 -0
- package/dist/ssr/next-config.js +123 -0
- package/dist/ssr/next-config.js.map +1 -0
- package/dist/ssr/next.d.ts +9 -8
- package/dist/ssr/next.js +29 -43
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +8 -9
- package/dist/static/index.js +4 -22
- package/dist/static/index.js.map +1 -1
- package/dist/static/inject.d.ts +1 -2
- package/dist/{index-Cd45t5NM.d.ts → types-CYQIhUg1.d.ts} +868 -820
- package/dist/zero/babel.d.ts +73 -2
- package/dist/zero/babel.js +81 -144
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +63 -8
- package/dist/zero/index.js +25 -2
- package/dist/zero/index.js.map +1 -0
- package/dist/zero/next.d.ts +4 -5
- package/dist/zero/next.js +3 -38
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +4 -1
- package/docs/adoption.md +25 -17
- package/docs/ai-agents.md +68 -33
- package/docs/comparison.md +9 -8
- package/docs/configuration.md +204 -70
- package/docs/debug.md +21 -8
- package/docs/design-system.md +117 -15
- package/docs/dsl.md +307 -117
- package/docs/getting-started.md +81 -22
- package/docs/injector.md +105 -67
- package/docs/methodology.md +48 -23
- package/docs/migration-v3.md +3 -3
- package/docs/pipeline.md +54 -27
- package/docs/plugins.md +22 -42
- package/docs/react-api.md +76 -11
- package/docs/runtime-benchmarks.md +282 -110
- package/docs/ssr.md +226 -80
- package/docs/styles.md +169 -33
- package/docs/tasty-static.md +176 -58
- package/package.json +108 -44
- package/tasty.config.ts +1 -0
- package/dist/astro-C_by9qPq.js +0 -307
- package/dist/astro-C_by9qPq.js.map +0 -1
- package/dist/async-storage-DKK-wTD4.js +0 -44
- package/dist/async-storage-DKK-wTD4.js.map +0 -1
- package/dist/babel-BUQGeOXA.d.ts +0 -83
- package/dist/collector-BevHh16N.js.map +0 -1
- package/dist/config-NcdqU9PC.js +0 -12269
- package/dist/config-NcdqU9PC.js.map +0 -1
- package/dist/context-CA8YKeMn.js +0 -24
- package/dist/context-CA8YKeMn.js.map +0 -1
- package/dist/core-D7s7u-k1.js +0 -1566
- package/dist/core-D7s7u-k1.js.map +0 -1
- package/dist/css-writer-BDPmetHV.js.map +0 -1
- package/dist/format-global-rules-DklyaXv-.js +0 -22
- package/dist/format-global-rules-DklyaXv-.js.map +0 -1
- package/dist/format-rules-BQCn7JZH.js +0 -130
- package/dist/format-rules-BQCn7JZH.js.map +0 -1
- package/dist/hydrate-C3cfqlaQ.js +0 -37
- package/dist/hydrate-C3cfqlaQ.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keyframes-ByhOtsXB.js +0 -493
- package/dist/keyframes-ByhOtsXB.js.map +0 -1
- package/dist/merge-styles-BKfagXfV.js.map +0 -1
- package/dist/resolve-recipes-vvygrWLw.js +0 -144
- package/dist/resolve-recipes-vvygrWLw.js.map +0 -1
|
@@ -1,8 +1,64 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { Et as StyleDetails, G as NoType, M as StyleResult, X as StylesInterface, Y as Styles, _ as KeyframesSteps, a as FontFaceInput, ct as StyleHandler, d as InjectOptions, dt as StyleHandlerResult, f as InjectResult, g as KeyframesResult, ht as StyleValueStateMap, i as FontFaceDescriptors, kt as CSSProperties$1, l as GCOptions, mt as StyleValue, n as CounterStyleDescriptors, nt as CSSMap, o as FunctionDefinition, ot as RawStyleHandler, pt as StylePropValue, st as ResolvedStyleValue, t as CacheMetrics, u as GlobalInjectResult, w as StyleInjectorConfig, y as PropertyOptions } from "./types-CYQIhUg1.js";
|
|
2
|
+
import { f as TastyPluginFactory, y as StyleInjector } from "./config-C4ftFxgI.js";
|
|
3
|
+
import { t as ServerStyleCollector } from "./collector-D2OT6I2G.js";
|
|
4
|
+
import "./merge-styles-D39qBtox.js";
|
|
5
|
+
import React, { AllHTMLAttributes, CSSProperties, ComponentType, ElementType, ForwardRefExoticComponent, JSX, PropsWithoutRef, ReactNode, RefAttributes } from "react";
|
|
6
|
+
//#region src/utils/color-math.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Consolidated color conversion math.
|
|
9
|
+
*
|
|
10
|
+
* Single source of truth for all color space conversions used across the
|
|
11
|
+
* library: sRGB gamma, HSL, OKLab, OKLCH, OKHSL, hex parsing, named
|
|
12
|
+
* colors, and CSS string converters.
|
|
13
|
+
*
|
|
14
|
+
* This module has zero internal imports — it is a leaf dependency.
|
|
15
|
+
*
|
|
16
|
+
* Reference: https://bottosson.github.io/posts/oklab/
|
|
17
|
+
*/
|
|
18
|
+
type Vec3 = [number, number, number];
|
|
19
|
+
/**
|
|
20
|
+
* HSL to RGB.
|
|
21
|
+
* Algorithm from CSS Color 4 spec.
|
|
22
|
+
*
|
|
23
|
+
* @param h - Hue in degrees (0-360)
|
|
24
|
+
* @param s - Saturation (0-1)
|
|
25
|
+
* @param l - Lightness (0-1)
|
|
26
|
+
* @returns RGB values in 0-255 range (may have fractional values)
|
|
27
|
+
*/
|
|
28
|
+
declare function hslToRgbValues(h: number, s: number, l: number): Vec3;
|
|
29
|
+
declare function getNamedColorHex(): Map<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Convert hex color string to `rgb()` CSS string.
|
|
32
|
+
* Supports 3, 4, 6, and 8 character hex values (with or without `#`).
|
|
33
|
+
*/
|
|
34
|
+
declare function hexToRgb(hex: string): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Extract RGB values from an `rgb()`/`rgba()` string.
|
|
37
|
+
* Supports comma-separated, space-separated, fractional, percentage,
|
|
38
|
+
* and slash alpha notation.
|
|
39
|
+
*
|
|
40
|
+
* @returns Array of RGB values (0-255 range), converting percentages as needed.
|
|
41
|
+
*/
|
|
42
|
+
declare function getRgbValuesFromRgbaString(str: string): number[];
|
|
43
|
+
/**
|
|
44
|
+
* Convert any recognized color string to an `rgb()` CSS string.
|
|
45
|
+
* Handles hex, `okhsl()`, `okhst()`, `hsl()`/`hsla()`, named CSS colors,
|
|
46
|
+
* and `rgb()`/`rgba()` pass-through.
|
|
47
|
+
*/
|
|
48
|
+
declare function strToRgb(color: string, _ignoreAlpha?: boolean): string | null | undefined;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/utils/is-selector.d.ts
|
|
51
|
+
/** Check whether a style-object key identifies a nested CSS selector. */
|
|
52
|
+
declare function isSelector(key: string): boolean;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/config-state.d.ts
|
|
55
|
+
/**
|
|
56
|
+
* Minimal configuration state shared by the style engine, zero-runtime
|
|
57
|
+
* extractor, and runtime configuration module. Keeping it independent
|
|
58
|
+
* prevents pure rendering code from importing the full injector graph.
|
|
59
|
+
*/
|
|
60
|
+
declare function hasStylesGenerated(): boolean;
|
|
61
|
+
//#endregion
|
|
6
62
|
//#region src/utils/name-prefix.d.ts
|
|
7
63
|
/**
|
|
8
64
|
* Name prefix utilities for generated identifiers.
|
|
@@ -31,17 +87,17 @@ declare const DEFAULT_ZERO_NAME_PREFIX = "ts";
|
|
|
31
87
|
//#endregion
|
|
32
88
|
//#region src/styles/list.d.ts
|
|
33
89
|
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", "inset", "position", "scrollMargin"];
|
|
35
|
-
declare const BLOCK_INNER_STYLES: readonly ["padding", "
|
|
36
|
-
declare const BLOCK_OUTER_STYLES: readonly ["border", "radius", "shadow", "outline"];
|
|
37
|
-
declare const BLOCK_STYLES: readonly ["padding", "
|
|
90
|
+
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"];
|
|
91
|
+
declare const BLOCK_INNER_STYLES: readonly ["padding", "blockPadding", "inlinePadding", "overflow", "scrollbar", "textAlign"];
|
|
92
|
+
declare const BLOCK_OUTER_STYLES: readonly ["border", "blockBorder", "inlineBorder", "radius", "shadow", "outline"];
|
|
93
|
+
declare const BLOCK_STYLES: readonly ["padding", "blockPadding", "inlinePadding", "overflow", "scrollbar", "textAlign", "border", "blockBorder", "inlineBorder", "radius", "shadow", "outline"];
|
|
38
94
|
declare const COLOR_STYLES: readonly ["color", "fill", "fade", "image"];
|
|
39
95
|
declare const TEXT_STYLES: readonly ["textTransform", "fontWeight", "fontStyle"];
|
|
40
|
-
declare const DIMENSION_STYLES: readonly ["width", "height", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
96
|
+
declare const DIMENSION_STYLES: readonly ["width", "height", "blockSize", "inlineSize", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
41
97
|
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", "flexBasis", "flexGrow", "flexShrink", "flex", "gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin", "padding", "
|
|
43
|
-
declare const OUTER_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "border", "radius", "shadow", "outline"];
|
|
44
|
-
declare const INNER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "padding", "
|
|
98
|
+
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"];
|
|
99
|
+
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"];
|
|
100
|
+
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
101
|
//#endregion
|
|
46
102
|
//#region src/types.d.ts
|
|
47
103
|
/**
|
|
@@ -96,7 +152,7 @@ interface TastyBaseStylePropNames {}
|
|
|
96
152
|
* it names. Intersecting with `keyof StylesInterface` makes a name that isn't a
|
|
97
153
|
* real style inert rather than `never`-typed.
|
|
98
154
|
*/
|
|
99
|
-
type ExtraBaseStyleProps = { [key in keyof TastyBaseStylePropNames & keyof StylesInterface]?: StylePropValue<StylesInterface[key]
|
|
155
|
+
type ExtraBaseStyleProps = { [key in keyof TastyBaseStylePropNames & keyof StylesInterface]?: StylePropValue<StylesInterface[key]>; };
|
|
100
156
|
/** Allowed mod value types */
|
|
101
157
|
type ModValue = boolean | string | number | undefined | null;
|
|
102
158
|
/**
|
|
@@ -247,7 +303,7 @@ interface TastyExtensionConfig {
|
|
|
247
303
|
}
|
|
248
304
|
//#endregion
|
|
249
305
|
//#region src/tasty.d.ts
|
|
250
|
-
type StyleList = readonly (keyof { [key in keyof StylesInterface]: StylesInterface[key] })[];
|
|
306
|
+
type StyleList = readonly (keyof { [key in keyof StylesInterface]: StylesInterface[key]; })[];
|
|
251
307
|
/** Type descriptor for a single mod prop: a JS constructor or an enum array. */
|
|
252
308
|
type ModPropDef = BooleanConstructor | StringConstructor | NumberConstructor | readonly string[];
|
|
253
309
|
/** Array form: list of mod key names (types default to ModValue). */
|
|
@@ -259,7 +315,7 @@ type ModPropsInput = ModPropsList | ModPropsMap;
|
|
|
259
315
|
/** Resolve a single ModPropDef to its TypeScript type. */
|
|
260
316
|
type ResolveModPropDef<T> = T extends BooleanConstructor ? boolean : T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends readonly (infer U)[] ? U : ModValue;
|
|
261
317
|
/** 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]
|
|
318
|
+
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
319
|
/** A token key with `$` or `#` prefix. */
|
|
264
320
|
type TokenPropKey = `$${string}` | `#${string}`;
|
|
265
321
|
/** Array form: list of prop names. Names ending in `Color` map to `#` color tokens. */
|
|
@@ -301,13 +357,15 @@ type ResolveElementTag<T extends SubElementDefinition<any>> = T extends string ?
|
|
|
301
357
|
} ? Tag extends keyof JSX.IntrinsicElements ? Tag : 'div' : 'div';
|
|
302
358
|
/**
|
|
303
359
|
* Props for sub-element components.
|
|
304
|
-
* Combines HTML attributes with tasty-specific props (qa, qaVal, mods, tokens, isDisabled, etc.)
|
|
360
|
+
* Combines HTML attributes with tasty-specific props (qa, qaVal, mods, tokens, theme, isDisabled, etc.)
|
|
305
361
|
*/
|
|
306
362
|
type SubElementProps<Tag extends keyof JSX.IntrinsicElements = 'div'> = Omit<JSX.IntrinsicElements[Tag], 'ref' | 'color' | 'content' | 'translate'> & {
|
|
307
363
|
qa?: string;
|
|
308
364
|
qaVal?: string | number;
|
|
309
365
|
mods?: Mods;
|
|
310
366
|
tokens?: Tokens;
|
|
367
|
+
/** User-defined theme for the element. Mapped to `data-theme` attribute. */
|
|
368
|
+
theme?: BaseProps['theme'];
|
|
311
369
|
isDisabled?: boolean;
|
|
312
370
|
isHidden?: boolean;
|
|
313
371
|
isChecked?: boolean;
|
|
@@ -315,24 +373,43 @@ type SubElementProps<Tag extends keyof JSX.IntrinsicElements = 'div'> = Omit<JSX
|
|
|
315
373
|
/**
|
|
316
374
|
* Generates the sub-element component types from an ElementsDefinition
|
|
317
375
|
*/
|
|
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
|
|
376
|
+
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
377
|
/**
|
|
320
378
|
* Base type containing common properties shared between TastyProps and TastyElementOptions.
|
|
321
379
|
* Separated to avoid code duplication while allowing different type constraints.
|
|
322
380
|
*/
|
|
323
381
|
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. */
|
|
325
|
-
|
|
326
|
-
|
|
382
|
+
/** Default styles of the element. */
|
|
383
|
+
styles?: Styles;
|
|
384
|
+
/** The list of styles that can be provided by props */
|
|
385
|
+
styleProps?: K;
|
|
386
|
+
/** Modifier keys exposed as top-level component props (array or typed object form). */
|
|
387
|
+
modProps?: M;
|
|
388
|
+
/** Token keys exposed as top-level component props (array or typed object form). */
|
|
327
389
|
tokenProps?: TP;
|
|
328
390
|
element?: BaseProps['element'];
|
|
329
|
-
variants?: V;
|
|
330
|
-
|
|
391
|
+
variants?: V;
|
|
392
|
+
/** Default tokens for inline CSS custom properties */
|
|
393
|
+
tokens?: Tokens;
|
|
394
|
+
/** Sub-element definitions for compound components */
|
|
331
395
|
elements?: E;
|
|
332
|
-
} & Pick<BaseProps, 'qa' | 'qaVal'
|
|
396
|
+
} & Pick<BaseProps, 'qa' | 'qaVal'>;
|
|
397
|
+
/**
|
|
398
|
+
* The names the `variant` option of `tasty(Base, options)` accepts: the
|
|
399
|
+
* extension's own variants and the base's, as its `variant` prop does. A
|
|
400
|
+
* union, not an intersection of the two, so an extension can default to a
|
|
401
|
+
* variant only one of them defines.
|
|
402
|
+
*/
|
|
403
|
+
type ExtensionVariantName<V extends VariantMap, Props> = string extends keyof V ? 'variant' extends keyof Props ? NonNullable<Props['variant' & keyof Props]> : keyof V : keyof V | ('variant' extends keyof Props ? NonNullable<Props['variant' & keyof Props]> : never);
|
|
333
404
|
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. */
|
|
335
|
-
|
|
405
|
+
/** The tag name of the element or a React component. */
|
|
406
|
+
as?: string | ComponentType<any>;
|
|
407
|
+
/**
|
|
408
|
+
* The variant applied when the `variant` prop is omitted or names no
|
|
409
|
+
* variant: one of `variants`, or one of the base component's.
|
|
410
|
+
*/
|
|
411
|
+
variant?: ExtensionVariantName<V, DefaultProps>;
|
|
412
|
+
} & Partial<Omit<DefaultProps, 'as' | 'styles' | 'styleProps' | 'modProps' | 'tokenProps' | 'tokens' | 'variant'>>;
|
|
336
413
|
/**
|
|
337
414
|
* Resolves the props of a polymorphic `as` value (intrinsic tag or component).
|
|
338
415
|
* - For intrinsic tags (`'div'`, `'button'`, ...): returns `JSX.IntrinsicElements[Tag]`.
|
|
@@ -349,15 +426,16 @@ type ResolveAsProps<AsType extends ElementType> = AsType extends keyof JSX.Intri
|
|
|
349
426
|
* Note: Uses a separate index signature with `unknown` instead of an `any`
|
|
350
427
|
* record to ensure strict type checking for styles.
|
|
351
428
|
*/
|
|
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. */
|
|
429
|
+
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> & WithVariant<V> & {
|
|
430
|
+
/** The tag name of the element or a React component. */
|
|
431
|
+
as?: AsType;
|
|
354
432
|
} & 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]
|
|
433
|
+
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
434
|
/**
|
|
357
|
-
*
|
|
358
|
-
*
|
|
435
|
+
* Props consumed by Tasty rather than forwarded to the `as` component.
|
|
436
|
+
* Event handlers are resolved from JSX.IntrinsicElements or the component's own props.
|
|
359
437
|
*/
|
|
360
|
-
type TastySpecificKeys = 'as' | 'qa' | 'qaVal' | 'element' | 'styles' | 'mods' | 'isHidden' | 'isDisabled' | 'isChecked' | 'style' | 'theme' | 'tokens' | 'ref'
|
|
438
|
+
type TastySpecificKeys = keyof BaseStyleProps | 'as' | 'qa' | 'qaVal' | 'element' | 'styles' | 'mods' | 'isHidden' | 'isDisabled' | 'isChecked' | 'style' | 'theme' | 'tokens' | 'ref';
|
|
361
439
|
/** Extract prop key names from a ModPropsInput (array elements or object keys). */
|
|
362
440
|
type ModPropsKeys<M extends ModPropsInput> = M extends readonly (infer K)[] ? K & string : keyof M & string;
|
|
363
441
|
/** Extract prop key names from a TokenPropsInput (array elements or object keys). */
|
|
@@ -379,7 +457,24 @@ type TokenPropsKeys<TP extends TokenPropsInput> = TP extends readonly (infer K)[
|
|
|
379
457
|
* is a component type with a narrower prop API.
|
|
380
458
|
*/
|
|
381
459
|
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
|
-
|
|
460
|
+
/** Statics React itself reads, as a type (see `REACT_STATICS`). */
|
|
461
|
+
type ReactStaticKey = '$$typeof' | 'render' | 'type' | 'compare' | 'displayName' | 'defaultProps' | 'propTypes' | 'contextType' | 'contextTypes' | 'childContextTypes' | 'getDerivedStateFromProps' | 'getDerivedStateFromError';
|
|
462
|
+
/**
|
|
463
|
+
* The statics of a component that are components themselves — a `tasty()`
|
|
464
|
+
* base's sub-elements (`Card.Title`) — which its extension keeps.
|
|
465
|
+
*/
|
|
466
|
+
type ComponentStatics<C> = { [Key in keyof C as Key extends ReactStaticKey ? never : C[Key] extends string ? never : C[Key] extends ElementType ? Key : never]: C[Key]; };
|
|
467
|
+
/** Prop names the extension form's own options claim from the base's props. */
|
|
468
|
+
type ExtensionClaimedKeys<K extends StyleList, V extends VariantMap, M extends ModPropsInput, TP extends TokenPropsInput> = K[number] | ModPropsKeys<M> | TokenPropsKeys<TP> | (string extends keyof V ? never : 'variant');
|
|
469
|
+
/**
|
|
470
|
+
* Props of a `tasty(Component, options)` extension: the base's props, plus
|
|
471
|
+
* whatever its own `styleProps`, `modProps`, `tokenProps` and `variants` add.
|
|
472
|
+
* Its variants extend the base's: `variant` accepts either set.
|
|
473
|
+
*/
|
|
474
|
+
type TastyExtensionProps<Props extends PropsWithStyles, DefaultProps extends Partial<Props>, K extends StyleList = readonly never[], V extends VariantMap = VariantMap, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = [ExtensionClaimedKeys<K, V, M, TP>] extends [never] ? TastyComponentPropsWithDefaults<Props, DefaultProps> : Omit<TastyComponentPropsWithDefaults<Props, DefaultProps>, ExtensionClaimedKeys<K, V, M, TP>> & { [key in K[number]]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]>; } & ResolveModProps<M> & ResolveTokenProps<TP> & (string extends keyof V ? unknown : {
|
|
475
|
+
variant?: keyof V | ('variant' extends keyof Props ? NonNullable<Props['variant']> : never);
|
|
476
|
+
});
|
|
477
|
+
type TastyComponentPropsWithDefaults<Props extends PropsWithStyles, DefaultProps extends Partial<Props>> = keyof DefaultProps extends never ? Props : keyof Props extends keyof DefaultProps ? Partial<Props> : { [key in Extract<keyof Props, keyof DefaultProps>]?: Props[key]; } & { [key in keyof Omit<Props, keyof DefaultProps>]: Props[key]; };
|
|
383
478
|
/**
|
|
384
479
|
* The component type returned by the `tasty(options)` element-factory overload.
|
|
385
480
|
*
|
|
@@ -394,9 +489,9 @@ type TastyComponentPropsWithDefaults<Props extends PropsWithStyles, DefaultProps
|
|
|
394
489
|
* `SomeComponent`; create another `tasty({ as: SomeComponent })` for that.
|
|
395
490
|
*/
|
|
396
491
|
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<
|
|
399
|
-
declare const Element$1: TastyPolymorphicComponent<"div",
|
|
492
|
+
declare function tasty<K extends StyleList = readonly never[], V extends VariantMap = 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>;
|
|
493
|
+
declare function tasty<Props extends PropsWithStyles, DefaultProps extends Partial<Props> = Partial<Props>, K extends StyleList = readonly never[], V extends VariantMap = VariantMap, const E extends ElementsDefinition = Record<string, never>, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[], C extends ComponentType<Props> = ComponentType<Props>>(Component: C & ComponentType<Props>, options?: TastyProps<K, V, E, Props, M, TP>): ComponentType<TastyExtensionProps<Props, DefaultProps, K, V, M, TP>> & ComponentStatics<C> & (string extends keyof E ? unknown : SubElementComponents<E>);
|
|
494
|
+
declare const Element$1: TastyPolymorphicComponent<"div", readonly never[], VariantMap, readonly never[], readonly never[]> & SubElementComponents<Record<string, never>>;
|
|
400
495
|
//#endregion
|
|
401
496
|
//#region src/hooks/useStyles.d.ts
|
|
402
497
|
interface UseStylesResult {
|
|
@@ -412,7 +507,9 @@ interface UseStylesResult {
|
|
|
412
507
|
* Thin wrapper around `computeStyles()` that adds React context-based
|
|
413
508
|
* SSR collector discovery for backward compatibility with TastyRegistry.
|
|
414
509
|
*
|
|
415
|
-
*
|
|
510
|
+
* Works in Server Components too. There, like the other style functions, it
|
|
511
|
+
* cannot emit CSS itself: the next `tasty()` element in the tree emits it, so
|
|
512
|
+
* render one after it.
|
|
416
513
|
*
|
|
417
514
|
* @example
|
|
418
515
|
* ```tsx
|
|
@@ -777,11 +874,14 @@ interface TastyBatchProviderProps {
|
|
|
777
874
|
* );
|
|
778
875
|
* ```
|
|
779
876
|
*/
|
|
780
|
-
declare function TastyBatchProvider({
|
|
781
|
-
children
|
|
782
|
-
}: TastyBatchProviderProps): ReactNode;
|
|
877
|
+
declare function TastyBatchProvider({ children }: TastyBatchProviderProps): React.ReactNode;
|
|
783
878
|
//#endregion
|
|
784
879
|
//#region src/utils/get-display-name.d.ts
|
|
880
|
+
/**
|
|
881
|
+
* A readable name for a component: its `displayName`, else its function name,
|
|
882
|
+
* looking through `forwardRef()` and `memo()` to the component they wrap. A
|
|
883
|
+
* tag name names itself. Falls back to `fallbackName` when there is none.
|
|
884
|
+
*/
|
|
785
885
|
declare function getDisplayName<T>(Component: ElementType<T>, fallbackName?: string): string;
|
|
786
886
|
//#endregion
|
|
787
887
|
//#region src/index.d.ts
|
|
@@ -887,8 +987,8 @@ declare function resolveFunctionColor(str: string): string | null;
|
|
|
887
987
|
/**
|
|
888
988
|
* Chunk names, the built-in chunk style lists, and the style→chunk lookup.
|
|
889
989
|
*
|
|
890
|
-
* This
|
|
891
|
-
* `definitions.ts` for two reasons:
|
|
990
|
+
* This module only imports data-only style-name lists. It exists separately
|
|
991
|
+
* from `definitions.ts` for two reasons:
|
|
892
992
|
*
|
|
893
993
|
* 1. The style handler registry (`styles/predefined.ts`) needs to assign chunk
|
|
894
994
|
* membership for custom handlers. Reaching for `definitions.ts` would create an
|
|
@@ -901,7 +1001,8 @@ declare function resolveFunctionColor(str: string): string | null;
|
|
|
901
1001
|
* public API surface are unchanged.
|
|
902
1002
|
*/
|
|
903
1003
|
declare const CHUNK_NAMES: {
|
|
904
|
-
/** Special chunk for styles that cannot be split */
|
|
1004
|
+
/** Special chunk for styles that cannot be split */
|
|
1005
|
+
readonly COMBINED: "combined";
|
|
905
1006
|
readonly SUBCOMPONENTS: "subcomponents";
|
|
906
1007
|
readonly APPEARANCE: "appearance";
|
|
907
1008
|
readonly FONT: "font";
|
|
@@ -913,11 +1014,15 @@ declare const CHUNK_NAMES: {
|
|
|
913
1014
|
};
|
|
914
1015
|
type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];
|
|
915
1016
|
/**
|
|
916
|
-
* Appearance chunk - visual styling
|
|
1017
|
+
* Appearance chunk - visual styling
|
|
1018
|
+
*
|
|
1019
|
+
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
1020
|
+
* ⚠️ fillStyle: fill, backgroundColor, image, backgroundImage,
|
|
1021
|
+
* backgroundPosition/Size/Repeat/Attachment/Origin/Clip, background
|
|
917
1022
|
*
|
|
918
1023
|
* @public
|
|
919
1024
|
*/
|
|
920
|
-
declare const APPEARANCE_CHUNK_STYLES: readonly ["fill", "color", "opacity", "border", "radius", "outline", "outlineOffset", "shadow", "fade"];
|
|
1025
|
+
declare const APPEARANCE_CHUNK_STYLES: readonly ["fill", "backgroundColor", "image", "backgroundImage", "backgroundPosition", "backgroundSize", "backgroundRepeat", "backgroundAttachment", "backgroundOrigin", "backgroundClip", "background", "color", "opacity", "border", "blockBorder", "inlineBorder", "radius", "outline", "outlineOffset", "shadow", "fade"];
|
|
921
1026
|
/**
|
|
922
1027
|
* Font chunk - typography styles
|
|
923
1028
|
*
|
|
@@ -931,13 +1036,15 @@ declare const FONT_CHUNK_STYLES: readonly ["preset", "font", "fontWeight", "font
|
|
|
931
1036
|
* Dimension chunk - sizing and spacing
|
|
932
1037
|
*
|
|
933
1038
|
* 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
|
|
1039
|
+
* ⚠️ paddingStyle: padding, paddingTop/Right/Bottom/Left
|
|
1040
|
+
* ⚠️ marginStyle: margin, marginTop/Right/Bottom/Left
|
|
936
1041
|
* ⚠️ widthStyle: width, minWidth, maxWidth
|
|
937
1042
|
* ⚠️ heightStyle: height, minHeight, maxHeight
|
|
1043
|
+
* ⚠️ blockSizeStyle: blockSize, minBlockSize, maxBlockSize
|
|
1044
|
+
* ⚠️ inlineSizeStyle: inlineSize, minInlineSize, maxInlineSize
|
|
938
1045
|
*/
|
|
939
1046
|
/** @public */
|
|
940
|
-
declare const DIMENSION_CHUNK_STYLES: readonly ["padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "
|
|
1047
|
+
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"];
|
|
941
1048
|
/**
|
|
942
1049
|
* Display chunk - display mode, layout flow, text overflow, and scrollbar
|
|
943
1050
|
*
|
|
@@ -961,10 +1068,10 @@ declare const LAYOUT_CHUNK_STYLES: readonly ["placeItems", "placeContent", "alig
|
|
|
961
1068
|
* Position chunk - element positioning
|
|
962
1069
|
*
|
|
963
1070
|
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
964
|
-
* ⚠️ insetStyle: inset,
|
|
1071
|
+
* ⚠️ insetStyle: inset, top, right, bottom, left
|
|
965
1072
|
*/
|
|
966
1073
|
/** @public */
|
|
967
|
-
declare const POSITION_CHUNK_STYLES: readonly ["position", "inset", "
|
|
1074
|
+
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"];
|
|
968
1075
|
/**
|
|
969
1076
|
* Map for O(1) style-to-chunk lookup. Seeded with the built-in lists above and
|
|
970
1077
|
* extended by {@link assignStyleChunk} when a custom handler declares style names
|
|
@@ -1004,19 +1111,25 @@ declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<strin
|
|
|
1004
1111
|
*
|
|
1005
1112
|
* Later groups override earlier groups for conflicting directions.
|
|
1006
1113
|
*/
|
|
1007
|
-
declare function borderStyle({
|
|
1008
|
-
border
|
|
1009
|
-
}: {
|
|
1114
|
+
declare function borderStyle({ border }: {
|
|
1010
1115
|
border?: string | number | boolean;
|
|
1011
1116
|
}): Record<string, string> | null;
|
|
1012
1117
|
declare namespace borderStyle {
|
|
1013
1118
|
var __lookupStyles: string[];
|
|
1014
1119
|
}
|
|
1015
1120
|
//#endregion
|
|
1121
|
+
//#region src/styles/blockSize.d.ts
|
|
1122
|
+
declare function blockSizeStyle({ blockSize, minBlockSize, maxBlockSize }: {
|
|
1123
|
+
blockSize?: string | number | boolean;
|
|
1124
|
+
minBlockSize?: string | number | boolean;
|
|
1125
|
+
maxBlockSize?: string | number | boolean;
|
|
1126
|
+
}): Record<string, string | string[]> | null;
|
|
1127
|
+
declare namespace blockSizeStyle {
|
|
1128
|
+
var __lookupStyles: ("blockSize" | "maxBlockSize" | "minBlockSize")[];
|
|
1129
|
+
}
|
|
1130
|
+
//#endregion
|
|
1016
1131
|
//#region src/styles/color.d.ts
|
|
1017
|
-
declare function colorStyle({
|
|
1018
|
-
color
|
|
1019
|
-
}: {
|
|
1132
|
+
declare function colorStyle({ color }: {
|
|
1020
1133
|
color?: string | boolean;
|
|
1021
1134
|
}): Record<string, string> | null;
|
|
1022
1135
|
declare namespace colorStyle {
|
|
@@ -1040,21 +1153,13 @@ interface DisplayStyleProps {
|
|
|
1040
1153
|
* 3. Single-line `textOverflow` defaults white-space to nowrap
|
|
1041
1154
|
* 4. Explicit `whiteSpace` overrides the default from `textOverflow`
|
|
1042
1155
|
*/
|
|
1043
|
-
declare function displayStyle({
|
|
1044
|
-
display,
|
|
1045
|
-
hide,
|
|
1046
|
-
textOverflow,
|
|
1047
|
-
overflow,
|
|
1048
|
-
whiteSpace
|
|
1049
|
-
}: DisplayStyleProps): Record<string, string | number> | null;
|
|
1156
|
+
declare function displayStyle({ display, hide, textOverflow, overflow, whiteSpace }: DisplayStyleProps): Record<string, string | number> | null;
|
|
1050
1157
|
declare namespace displayStyle {
|
|
1051
1158
|
var __lookupStyles: string[];
|
|
1052
1159
|
}
|
|
1053
1160
|
//#endregion
|
|
1054
1161
|
//#region src/styles/fade.d.ts
|
|
1055
|
-
declare function fadeStyle({
|
|
1056
|
-
fade
|
|
1057
|
-
}: {
|
|
1162
|
+
declare function fadeStyle({ fade }: {
|
|
1058
1163
|
fade?: string;
|
|
1059
1164
|
}): {
|
|
1060
1165
|
mask: string;
|
|
@@ -1065,20 +1170,8 @@ declare namespace fadeStyle {
|
|
|
1065
1170
|
}
|
|
1066
1171
|
//#endregion
|
|
1067
1172
|
//#region src/styles/fill.d.ts
|
|
1068
|
-
declare function fillStyle({
|
|
1069
|
-
fill
|
|
1070
|
-
backgroundColor,
|
|
1071
|
-
image,
|
|
1072
|
-
backgroundImage,
|
|
1073
|
-
backgroundPosition,
|
|
1074
|
-
backgroundSize,
|
|
1075
|
-
backgroundRepeat,
|
|
1076
|
-
backgroundAttachment,
|
|
1077
|
-
backgroundOrigin,
|
|
1078
|
-
backgroundClip,
|
|
1079
|
-
background
|
|
1080
|
-
}: {
|
|
1081
|
-
fill?: string;
|
|
1173
|
+
declare function fillStyle({ fill, backgroundColor, image, backgroundImage, backgroundPosition, backgroundSize, backgroundRepeat, backgroundAttachment, backgroundOrigin, backgroundClip, background }: {
|
|
1174
|
+
fill?: string | boolean;
|
|
1082
1175
|
backgroundColor?: string;
|
|
1083
1176
|
image?: string;
|
|
1084
1177
|
backgroundImage?: string;
|
|
@@ -1093,9 +1186,7 @@ declare function fillStyle({
|
|
|
1093
1186
|
declare namespace fillStyle {
|
|
1094
1187
|
var __lookupStyles: string[];
|
|
1095
1188
|
}
|
|
1096
|
-
declare function svgFillStyle({
|
|
1097
|
-
svgFill
|
|
1098
|
-
}: {
|
|
1189
|
+
declare function svgFillStyle({ svgFill }: {
|
|
1099
1190
|
svgFill?: string;
|
|
1100
1191
|
}): {
|
|
1101
1192
|
fill: string;
|
|
@@ -1105,12 +1196,9 @@ declare namespace svgFillStyle {
|
|
|
1105
1196
|
}
|
|
1106
1197
|
//#endregion
|
|
1107
1198
|
//#region src/styles/flow.d.ts
|
|
1108
|
-
declare function flowStyle({
|
|
1109
|
-
display
|
|
1110
|
-
flow
|
|
1111
|
-
}: {
|
|
1112
|
-
display?: string;
|
|
1113
|
-
flow?: string;
|
|
1199
|
+
declare function flowStyle({ display, flow }: {
|
|
1200
|
+
display?: string | NoType;
|
|
1201
|
+
flow?: string | NoType;
|
|
1114
1202
|
}): {
|
|
1115
1203
|
[x: string]: string;
|
|
1116
1204
|
} | null;
|
|
@@ -1119,14 +1207,10 @@ declare namespace flowStyle {
|
|
|
1119
1207
|
}
|
|
1120
1208
|
//#endregion
|
|
1121
1209
|
//#region src/styles/gap.d.ts
|
|
1122
|
-
declare function gapStyle({
|
|
1123
|
-
display
|
|
1124
|
-
flow
|
|
1125
|
-
gap
|
|
1126
|
-
}: {
|
|
1127
|
-
display?: string;
|
|
1128
|
-
flow?: string;
|
|
1129
|
-
gap?: string | number | boolean;
|
|
1210
|
+
declare function gapStyle({ display, flow, gap }: {
|
|
1211
|
+
display?: string | NoType;
|
|
1212
|
+
flow?: string | NoType;
|
|
1213
|
+
gap?: string | number | boolean | NoType;
|
|
1130
1214
|
}): {
|
|
1131
1215
|
gap: string;
|
|
1132
1216
|
$?: undefined;
|
|
@@ -1153,28 +1237,14 @@ interface HeightStyleProps {
|
|
|
1153
1237
|
minHeight?: string | number | boolean;
|
|
1154
1238
|
maxHeight?: string | number | boolean;
|
|
1155
1239
|
}
|
|
1156
|
-
declare function heightStyle({
|
|
1157
|
-
height,
|
|
1158
|
-
minHeight,
|
|
1159
|
-
maxHeight
|
|
1160
|
-
}: HeightStyleProps): Record<string, string | string[]> | null;
|
|
1240
|
+
declare function heightStyle({ height, minHeight, maxHeight }: HeightStyleProps): Record<string, string | string[]> | null;
|
|
1161
1241
|
declare namespace heightStyle {
|
|
1162
1242
|
var __lookupStyles: string[];
|
|
1163
1243
|
}
|
|
1164
1244
|
//#endregion
|
|
1165
1245
|
//#region src/styles/inset.d.ts
|
|
1166
|
-
declare function insetStyle({
|
|
1167
|
-
inset,
|
|
1168
|
-
insetBlock,
|
|
1169
|
-
insetInline,
|
|
1170
|
-
top,
|
|
1171
|
-
right,
|
|
1172
|
-
bottom,
|
|
1173
|
-
left
|
|
1174
|
-
}: {
|
|
1246
|
+
declare function insetStyle({ inset, top, right, bottom, left }: {
|
|
1175
1247
|
inset?: string | number | boolean;
|
|
1176
|
-
insetBlock?: string | number | boolean;
|
|
1177
|
-
insetInline?: string | number | boolean;
|
|
1178
1248
|
top?: string | number | boolean;
|
|
1179
1249
|
right?: string | number | boolean;
|
|
1180
1250
|
bottom?: string | number | boolean;
|
|
@@ -1184,19 +1254,19 @@ declare namespace insetStyle {
|
|
|
1184
1254
|
var __lookupStyles: string[];
|
|
1185
1255
|
}
|
|
1186
1256
|
//#endregion
|
|
1257
|
+
//#region src/styles/inlineSize.d.ts
|
|
1258
|
+
declare function inlineSizeStyle({ inlineSize, minInlineSize, maxInlineSize }: {
|
|
1259
|
+
inlineSize?: string | number | boolean;
|
|
1260
|
+
minInlineSize?: string | number | boolean;
|
|
1261
|
+
maxInlineSize?: string | number | boolean;
|
|
1262
|
+
}): Record<string, string | string[]> | null;
|
|
1263
|
+
declare namespace inlineSizeStyle {
|
|
1264
|
+
var __lookupStyles: ("inlineSize" | "maxInlineSize" | "minInlineSize")[];
|
|
1265
|
+
}
|
|
1266
|
+
//#endregion
|
|
1187
1267
|
//#region src/styles/margin.d.ts
|
|
1188
|
-
declare function marginStyle({
|
|
1189
|
-
margin,
|
|
1190
|
-
marginBlock,
|
|
1191
|
-
marginInline,
|
|
1192
|
-
marginTop,
|
|
1193
|
-
marginRight,
|
|
1194
|
-
marginBottom,
|
|
1195
|
-
marginLeft
|
|
1196
|
-
}: {
|
|
1268
|
+
declare function marginStyle({ margin, marginTop, marginRight, marginBottom, marginLeft }: {
|
|
1197
1269
|
margin?: string | number | boolean;
|
|
1198
|
-
marginBlock?: string | number | boolean;
|
|
1199
|
-
marginInline?: string | number | boolean;
|
|
1200
1270
|
marginTop?: string | number | boolean;
|
|
1201
1271
|
marginRight?: string | number | boolean;
|
|
1202
1272
|
marginBottom?: string | number | boolean;
|
|
@@ -1209,7 +1279,7 @@ declare namespace marginStyle {
|
|
|
1209
1279
|
//#region src/styles/outline.d.ts
|
|
1210
1280
|
interface OutlineStyleProps {
|
|
1211
1281
|
outline?: string | boolean | number;
|
|
1212
|
-
outlineOffset?: string | number;
|
|
1282
|
+
outlineOffset?: string | number | boolean;
|
|
1213
1283
|
}
|
|
1214
1284
|
/**
|
|
1215
1285
|
* Generates CSS for outline property with optional offset.
|
|
@@ -1225,27 +1295,14 @@ interface OutlineStyleProps {
|
|
|
1225
1295
|
*
|
|
1226
1296
|
* @return CSS properties for outline and optionally outline-offset
|
|
1227
1297
|
*/
|
|
1228
|
-
declare function outlineStyle({
|
|
1229
|
-
outline,
|
|
1230
|
-
outlineOffset
|
|
1231
|
-
}: OutlineStyleProps): Record<string, string> | null;
|
|
1298
|
+
declare function outlineStyle({ outline, outlineOffset }: OutlineStyleProps): Record<string, string> | null;
|
|
1232
1299
|
declare namespace outlineStyle {
|
|
1233
1300
|
var __lookupStyles: string[];
|
|
1234
1301
|
}
|
|
1235
1302
|
//#endregion
|
|
1236
1303
|
//#region src/styles/padding.d.ts
|
|
1237
|
-
declare function paddingStyle({
|
|
1238
|
-
padding,
|
|
1239
|
-
paddingBlock,
|
|
1240
|
-
paddingInline,
|
|
1241
|
-
paddingTop,
|
|
1242
|
-
paddingRight,
|
|
1243
|
-
paddingBottom,
|
|
1244
|
-
paddingLeft
|
|
1245
|
-
}: {
|
|
1304
|
+
declare function paddingStyle({ padding, paddingTop, paddingRight, paddingBottom, paddingLeft }: {
|
|
1246
1305
|
padding?: string | number | boolean;
|
|
1247
|
-
paddingBlock?: string | number | boolean;
|
|
1248
|
-
paddingInline?: string | number | boolean;
|
|
1249
1306
|
paddingTop?: string | number | boolean;
|
|
1250
1307
|
paddingRight?: string | number | boolean;
|
|
1251
1308
|
paddingBottom?: string | number | boolean;
|
|
@@ -1275,17 +1332,7 @@ interface PlacementStyleProps {
|
|
|
1275
1332
|
* 2. placeItems, placeContent, align, justify (medium) — each sets 2 longhands
|
|
1276
1333
|
* 3. alignItems, alignContent, justifyItems, justifyContent (highest) — each sets 1 longhand
|
|
1277
1334
|
*/
|
|
1278
|
-
declare function placementStyle({
|
|
1279
|
-
place,
|
|
1280
|
-
placeItems,
|
|
1281
|
-
placeContent,
|
|
1282
|
-
align,
|
|
1283
|
-
justify,
|
|
1284
|
-
alignItems,
|
|
1285
|
-
alignContent,
|
|
1286
|
-
justifyItems,
|
|
1287
|
-
justifyContent
|
|
1288
|
-
}: PlacementStyleProps): Record<string, string> | null;
|
|
1335
|
+
declare function placementStyle({ place, placeItems, placeContent, align, justify, alignItems, alignContent, justifyItems, justifyContent }: PlacementStyleProps): Record<string, string> | null;
|
|
1289
1336
|
declare namespace placementStyle {
|
|
1290
1337
|
var __lookupStyles: string[];
|
|
1291
1338
|
}
|
|
@@ -1326,25 +1373,13 @@ interface PresetStyleProps {
|
|
|
1326
1373
|
* - `font` is the recommended prop with special handling (monospace, boolean, fallback)
|
|
1327
1374
|
* - `fontFamily` is a direct value without special handling
|
|
1328
1375
|
*/
|
|
1329
|
-
declare function presetStyle({
|
|
1330
|
-
preset,
|
|
1331
|
-
fontSize,
|
|
1332
|
-
lineHeight,
|
|
1333
|
-
textTransform,
|
|
1334
|
-
letterSpacing,
|
|
1335
|
-
fontWeight,
|
|
1336
|
-
fontStyle,
|
|
1337
|
-
fontFamily,
|
|
1338
|
-
font
|
|
1339
|
-
}: PresetStyleProps): CSSMap | null;
|
|
1376
|
+
declare function presetStyle({ preset, fontSize, lineHeight, textTransform, letterSpacing, fontWeight, fontStyle, fontFamily, font }: PresetStyleProps): CSSMap | null;
|
|
1340
1377
|
declare namespace presetStyle {
|
|
1341
1378
|
var __lookupStyles: string[];
|
|
1342
1379
|
}
|
|
1343
1380
|
//#endregion
|
|
1344
1381
|
//#region src/styles/radius.d.ts
|
|
1345
|
-
declare function radiusStyle({
|
|
1346
|
-
radius
|
|
1347
|
-
}: {
|
|
1382
|
+
declare function radiusStyle({ radius }: {
|
|
1348
1383
|
radius?: string | number | boolean;
|
|
1349
1384
|
}): Record<string, string> | null;
|
|
1350
1385
|
declare namespace radiusStyle {
|
|
@@ -1352,18 +1387,8 @@ declare namespace radiusStyle {
|
|
|
1352
1387
|
}
|
|
1353
1388
|
//#endregion
|
|
1354
1389
|
//#region src/styles/scrollMargin.d.ts
|
|
1355
|
-
declare function scrollMarginStyle({
|
|
1356
|
-
scrollMargin,
|
|
1357
|
-
scrollMarginBlock,
|
|
1358
|
-
scrollMarginInline,
|
|
1359
|
-
scrollMarginTop,
|
|
1360
|
-
scrollMarginRight,
|
|
1361
|
-
scrollMarginBottom,
|
|
1362
|
-
scrollMarginLeft
|
|
1363
|
-
}: {
|
|
1390
|
+
declare function scrollMarginStyle({ scrollMargin, scrollMarginTop, scrollMarginRight, scrollMarginBottom, scrollMarginLeft }: {
|
|
1364
1391
|
scrollMargin?: string | number | boolean;
|
|
1365
|
-
scrollMarginBlock?: string | number | boolean;
|
|
1366
|
-
scrollMarginInline?: string | number | boolean;
|
|
1367
1392
|
scrollMarginTop?: string | number | boolean;
|
|
1368
1393
|
scrollMarginRight?: string | number | boolean;
|
|
1369
1394
|
scrollMarginBottom?: string | number | boolean;
|
|
@@ -1373,6 +1398,18 @@ declare namespace scrollMarginStyle {
|
|
|
1373
1398
|
var __lookupStyles: string[];
|
|
1374
1399
|
}
|
|
1375
1400
|
//#endregion
|
|
1401
|
+
//#region src/styles/scrollPadding.d.ts
|
|
1402
|
+
declare function scrollPaddingStyle({ scrollPadding, scrollPaddingTop, scrollPaddingRight, scrollPaddingBottom, scrollPaddingLeft }: {
|
|
1403
|
+
scrollPadding?: string | number | boolean;
|
|
1404
|
+
scrollPaddingTop?: string | number | boolean;
|
|
1405
|
+
scrollPaddingRight?: string | number | boolean;
|
|
1406
|
+
scrollPaddingBottom?: string | number | boolean;
|
|
1407
|
+
scrollPaddingLeft?: string | number | boolean;
|
|
1408
|
+
}): Record<string, string> | null;
|
|
1409
|
+
declare namespace scrollPaddingStyle {
|
|
1410
|
+
var __lookupStyles: string[];
|
|
1411
|
+
}
|
|
1412
|
+
//#endregion
|
|
1376
1413
|
//#region src/styles/scrollbar.d.ts
|
|
1377
1414
|
interface ScrollbarStyleProps {
|
|
1378
1415
|
scrollbar?: string | boolean;
|
|
@@ -1388,18 +1425,13 @@ interface ScrollbarStyleProps {
|
|
|
1388
1425
|
* Note: `auto` is classified as a VALUE_KEYWORD by the parser, so it lands
|
|
1389
1426
|
* in `values` rather than `mods`. Both locations are checked for robustness.
|
|
1390
1427
|
*/
|
|
1391
|
-
declare function scrollbarStyle({
|
|
1392
|
-
scrollbar,
|
|
1393
|
-
overflow
|
|
1394
|
-
}: ScrollbarStyleProps): Record<string, string> | null;
|
|
1428
|
+
declare function scrollbarStyle({ scrollbar, overflow }: ScrollbarStyleProps): Record<string, string> | null;
|
|
1395
1429
|
declare namespace scrollbarStyle {
|
|
1396
1430
|
var __lookupStyles: string[];
|
|
1397
1431
|
}
|
|
1398
1432
|
//#endregion
|
|
1399
1433
|
//#region src/styles/shadow.d.ts
|
|
1400
|
-
declare function shadowStyle({
|
|
1401
|
-
shadow
|
|
1402
|
-
}: {
|
|
1434
|
+
declare function shadowStyle({ shadow }: {
|
|
1403
1435
|
shadow?: string | boolean;
|
|
1404
1436
|
}): {
|
|
1405
1437
|
'box-shadow': string;
|
|
@@ -1409,9 +1441,7 @@ declare namespace shadowStyle {
|
|
|
1409
1441
|
}
|
|
1410
1442
|
//#endregion
|
|
1411
1443
|
//#region src/styles/transition.d.ts
|
|
1412
|
-
declare function transitionStyle({
|
|
1413
|
-
transition
|
|
1414
|
-
}: {
|
|
1444
|
+
declare function transitionStyle({ transition }: {
|
|
1415
1445
|
transition?: string;
|
|
1416
1446
|
}): {
|
|
1417
1447
|
transition: string;
|
|
@@ -1426,11 +1456,7 @@ interface WidthStyleProps {
|
|
|
1426
1456
|
minWidth?: string | number | boolean;
|
|
1427
1457
|
maxWidth?: string | number | boolean;
|
|
1428
1458
|
}
|
|
1429
|
-
declare function widthStyle({
|
|
1430
|
-
width,
|
|
1431
|
-
minWidth,
|
|
1432
|
-
maxWidth
|
|
1433
|
-
}: WidthStyleProps): Record<string, string | string[]> | null;
|
|
1459
|
+
declare function widthStyle({ width, minWidth, maxWidth }: WidthStyleProps): Record<string, string | string[]> | null;
|
|
1434
1460
|
declare namespace widthStyle {
|
|
1435
1461
|
var __lookupStyles: string[];
|
|
1436
1462
|
}
|
|
@@ -1460,16 +1486,6 @@ declare namespace widthStyle {
|
|
|
1460
1486
|
* ```
|
|
1461
1487
|
*/
|
|
1462
1488
|
declare const styleHandlers: {
|
|
1463
|
-
readonly border: typeof borderStyle;
|
|
1464
|
-
readonly color: typeof colorStyle;
|
|
1465
|
-
readonly display: typeof displayStyle;
|
|
1466
|
-
readonly fade: typeof fadeStyle;
|
|
1467
|
-
readonly fill: typeof fillStyle;
|
|
1468
|
-
readonly svgFill: typeof svgFillStyle;
|
|
1469
|
-
readonly flow: typeof flowStyle;
|
|
1470
|
-
readonly gap: typeof gapStyle;
|
|
1471
|
-
readonly height: typeof heightStyle;
|
|
1472
|
-
readonly inset: typeof insetStyle;
|
|
1473
1489
|
readonly margin: typeof marginStyle;
|
|
1474
1490
|
readonly outline: typeof outlineStyle;
|
|
1475
1491
|
readonly padding: typeof paddingStyle;
|
|
@@ -1477,10 +1493,35 @@ declare const styleHandlers: {
|
|
|
1477
1493
|
readonly preset: typeof presetStyle;
|
|
1478
1494
|
readonly radius: typeof radiusStyle;
|
|
1479
1495
|
readonly scrollMargin: typeof scrollMarginStyle;
|
|
1496
|
+
readonly scrollPadding: typeof scrollPaddingStyle;
|
|
1480
1497
|
readonly scrollbar: typeof scrollbarStyle;
|
|
1481
1498
|
readonly shadow: typeof shadowStyle;
|
|
1482
1499
|
readonly transition: typeof transitionStyle;
|
|
1483
1500
|
readonly width: typeof widthStyle;
|
|
1501
|
+
readonly blockBorder: StyleHandler<Partial<Record<"blockBorder", string | number | boolean | undefined>>>;
|
|
1502
|
+
readonly inlineBorder: StyleHandler<Partial<Record<"inlineBorder", string | number | boolean | undefined>>>;
|
|
1503
|
+
readonly blockScrollPadding: StyleHandler<Partial<Record<"blockScrollPadding", string | number | boolean | undefined>>>;
|
|
1504
|
+
readonly inlineScrollPadding: StyleHandler<Partial<Record<"inlineScrollPadding", string | number | boolean | undefined>>>;
|
|
1505
|
+
readonly blockScrollMargin: StyleHandler<Partial<Record<"blockScrollMargin", string | number | boolean | undefined>>>;
|
|
1506
|
+
readonly inlineScrollMargin: StyleHandler<Partial<Record<"inlineScrollMargin", string | number | boolean | undefined>>>;
|
|
1507
|
+
readonly blockInset: StyleHandler<Partial<Record<"blockInset", string | number | boolean | undefined>>>;
|
|
1508
|
+
readonly inlineInset: StyleHandler<Partial<Record<"inlineInset", string | number | boolean | undefined>>>;
|
|
1509
|
+
readonly blockMargin: StyleHandler<Partial<Record<"blockMargin", string | number | boolean | undefined>>>;
|
|
1510
|
+
readonly inlineMargin: StyleHandler<Partial<Record<"inlineMargin", string | number | boolean | undefined>>>;
|
|
1511
|
+
readonly blockPadding: StyleHandler<Partial<Record<"blockPadding", string | number | boolean | undefined>>>;
|
|
1512
|
+
readonly inlinePadding: StyleHandler<Partial<Record<"inlinePadding", string | number | boolean | undefined>>>;
|
|
1513
|
+
readonly blockSize: typeof blockSizeStyle;
|
|
1514
|
+
readonly border: typeof borderStyle;
|
|
1515
|
+
readonly color: typeof colorStyle;
|
|
1516
|
+
readonly display: typeof displayStyle;
|
|
1517
|
+
readonly fade: typeof fadeStyle;
|
|
1518
|
+
readonly fill: typeof fillStyle;
|
|
1519
|
+
readonly svgFill: typeof svgFillStyle;
|
|
1520
|
+
readonly flow: typeof flowStyle;
|
|
1521
|
+
readonly gap: typeof gapStyle;
|
|
1522
|
+
readonly height: typeof heightStyle;
|
|
1523
|
+
readonly inset: typeof insetStyle;
|
|
1524
|
+
readonly inlineSize: typeof inlineSizeStyle;
|
|
1484
1525
|
};
|
|
1485
1526
|
//#endregion
|
|
1486
1527
|
//#region src/styles/define-handler.d.ts
|
|
@@ -1587,10 +1628,7 @@ declare const chunkSheetRegistry: ChunkSheetRegistry;
|
|
|
1587
1628
|
/**
|
|
1588
1629
|
* Inject styles and return className with dispose function
|
|
1589
1630
|
*/
|
|
1590
|
-
declare function inject(rules: StyleResult[], options?:
|
|
1591
|
-
root?: Document | ShadowRoot;
|
|
1592
|
-
cacheKey?: string;
|
|
1593
|
-
}): InjectResult;
|
|
1631
|
+
declare function inject(rules: StyleResult[], options?: InjectOptions): InjectResult;
|
|
1594
1632
|
/**
|
|
1595
1633
|
* Inject global rules that should not reserve tasty class names
|
|
1596
1634
|
*/
|
|
@@ -1708,7 +1746,9 @@ declare function func(name: string, definition: FunctionDefinition, options?: {
|
|
|
1708
1746
|
weak?: boolean;
|
|
1709
1747
|
}): void;
|
|
1710
1748
|
/**
|
|
1711
|
-
* Get CSS text
|
|
1749
|
+
* Get the CSS text of every sheet the injector holds. Reads the live
|
|
1750
|
+
* stylesheets, so it needs a DOM: on the server, collect CSS with
|
|
1751
|
+
* `ServerStyleCollector` from `@tenphi/tasty/ssr` instead.
|
|
1712
1752
|
*/
|
|
1713
1753
|
declare function getCSSText(options?: {
|
|
1714
1754
|
root?: Document | ShadowRoot;
|
|
@@ -1721,21 +1761,40 @@ declare function getCSSTextForNode(node: ParentNode | Element | DocumentFragment
|
|
|
1721
1761
|
root?: Document | ShadowRoot;
|
|
1722
1762
|
}): string;
|
|
1723
1763
|
/**
|
|
1724
|
-
*
|
|
1764
|
+
* Take a reference on local `@keyframes` under the deterministic names the
|
|
1765
|
+
* caller resolved, and report which entry holds each. Pair with
|
|
1766
|
+
* `ownKeyframes()` once the rules exist to inspect.
|
|
1767
|
+
*/
|
|
1768
|
+
declare function holdKeyframes(steps: Record<string, KeyframesSteps>, names: Map<string, string>, options?: {
|
|
1769
|
+
root?: Document | ShadowRoot;
|
|
1770
|
+
}): Map<string, string>;
|
|
1771
|
+
/**
|
|
1772
|
+
* Record that a class animates these keyframes, so the reference is released
|
|
1773
|
+
* when the last such class is collected.
|
|
1774
|
+
*/
|
|
1775
|
+
declare function ownKeyframes(key: string, className: string, options?: {
|
|
1776
|
+
root?: Document | ShadowRoot;
|
|
1777
|
+
}): void;
|
|
1778
|
+
/**
|
|
1779
|
+
* Remove every injected rule that is neither in the DOM nor held by an
|
|
1780
|
+
* outstanding `inject()` handle. Equivalent to `gc({ force: true })`.
|
|
1725
1781
|
*/
|
|
1726
1782
|
declare function cleanup(root?: Document | ShadowRoot): void;
|
|
1727
1783
|
/**
|
|
1728
|
-
*
|
|
1729
|
-
* Used internally by computeStyles and tasty()
|
|
1730
|
-
*
|
|
1784
|
+
* Count a render, so that a collection pass is scheduled every
|
|
1785
|
+
* `gc.touchInterval` of them. Used internally by computeStyles and tasty().
|
|
1786
|
+
*
|
|
1787
|
+
* @deprecated The class name is ignored — collection asks the DOM what is
|
|
1788
|
+
* rendered rather than recording usage per class. The argument is kept so
|
|
1789
|
+
* existing calls still compile.
|
|
1731
1790
|
*/
|
|
1732
1791
|
declare function touch(className: string, options?: {
|
|
1733
1792
|
root?: Document | ShadowRoot;
|
|
1734
1793
|
}): void;
|
|
1735
1794
|
/**
|
|
1736
|
-
* Synchronous garbage collection of unused styles
|
|
1737
|
-
* Evicts the oldest
|
|
1738
|
-
* With `{ force: true }`, removes
|
|
1795
|
+
* Synchronous garbage collection of unused styles — those no element carries
|
|
1796
|
+
* and no `inject()` handle references. Evicts the oldest ones once they exceed
|
|
1797
|
+
* capacity. With `{ force: true }`, removes all of them regardless of capacity.
|
|
1739
1798
|
*
|
|
1740
1799
|
* @returns Number of styles evicted.
|
|
1741
1800
|
*/
|
|
@@ -1756,59 +1815,47 @@ declare function destroy(root?: Document | ShadowRoot): void;
|
|
|
1756
1815
|
declare function createInjector(config?: Partial<StyleInjectorConfig>): StyleInjector;
|
|
1757
1816
|
//#endregion
|
|
1758
1817
|
//#region src/utils/filter-base-props.d.ts
|
|
1818
|
+
declare const basePropNames: readonly ["role", "title", "inert", "as", "element", "css", "qa", "mods", "qaVal", "hidden", "isHidden", "disabled", "isDisabled", "isChecked", "children", "style", "tokens", "theme", "className", "href", "target", "tabIndex"];
|
|
1819
|
+
declare const ignoredEventPropNames: readonly ["onPress", "onHoverStart", "onHoverEnd", "onPressStart", "onPressEnd"];
|
|
1759
1820
|
interface PropsFilterOptions {
|
|
1760
1821
|
labelable?: boolean;
|
|
1761
|
-
propNames?:
|
|
1822
|
+
propNames?: ReadonlySet<string>;
|
|
1762
1823
|
eventProps?: boolean;
|
|
1763
1824
|
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1825
|
+
type ExplicitPropName<O> = O extends {
|
|
1826
|
+
propNames?: ReadonlySet<infer P>;
|
|
1827
|
+
} ? Extract<P, string> : never;
|
|
1828
|
+
type EventPropsEnabled<O> = O extends {
|
|
1829
|
+
eventProps?: infer E;
|
|
1830
|
+
} ? Extract<E, boolean> : never;
|
|
1831
|
+
type Characters<S extends string> = S extends `${infer First}${infer Rest}` ? First | Characters<Rest> : never;
|
|
1832
|
+
/** Models DOM-style event keys and the runtime's ignored event names. */
|
|
1833
|
+
type EventPropName<K extends string> = string extends K ? `on${Characters<'ABCDEFGHIJKLMNOPQRSTUVWXYZ'>}${string}` : K extends `on${infer Initial}${infer Rest}` ? 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' extends `${string}${Initial}${string}` ? Rest extends '' ? never : Exclude<K, (typeof ignoredEventPropNames)[number]> : never : never;
|
|
1834
|
+
type ExplicitNumericPropName<K, O> = K extends number ? `${K}` extends ExplicitPropName<O> ? K : never : never;
|
|
1835
|
+
type RetainedPropName<T, O> = 'id' | (typeof basePropNames)[number] | `aria-${string}` | `data-${string}` | ExplicitPropName<O> | (true extends EventPropsEnabled<O> ? EventPropName<Extract<keyof T, string>> : never);
|
|
1836
|
+
type FilteredProps<T extends object, O> = T extends unknown ? Partial<Pick<T, Extract<keyof T, RetainedPropName<T, O>> | Extract<RetainedPropName<T, O>, keyof T> | ExplicitNumericPropName<keyof T, O>>> : never;
|
|
1837
|
+
/**
|
|
1838
|
+
* Keeps the built-in base props, ARIA/data attributes, and explicitly allowed props.
|
|
1839
|
+
* DOM-style event names are kept only with `eventProps: true`, except the ignored
|
|
1840
|
+
* interaction events (which can still be allowed explicitly via `propNames`).
|
|
1841
|
+
* The return type preserves the input value types only for potentially retained
|
|
1842
|
+
* keys. Props remain optional because only own enumerable string keys are copied.
|
|
1843
|
+
* Use a literal union (e.g. `new Set(['name', 'type'] as const)`) for `propNames`
|
|
1844
|
+
* to keep precise types; a `Set<string>` can potentially retain any string key.
|
|
1766
1845
|
* @param props - The component props to be filtered.
|
|
1767
|
-
* @param opts -
|
|
1846
|
+
* @param opts - Additional prop names and event forwarding options.
|
|
1768
1847
|
*/
|
|
1769
|
-
declare function filterBaseProps<T extends object>(props: T, opts?:
|
|
1848
|
+
declare function filterBaseProps<T extends object>(props: T, opts?: undefined): FilteredProps<T, undefined>;
|
|
1849
|
+
declare function filterBaseProps<T extends object, O extends PropsFilterOptions | undefined = PropsFilterOptions>(props: T, opts: O): FilteredProps<T, O>;
|
|
1770
1850
|
//#endregion
|
|
1771
1851
|
//#region src/utils/colors.d.ts
|
|
1772
1852
|
declare function color$1(name: string, opacity?: number): string;
|
|
1773
1853
|
//#endregion
|
|
1774
1854
|
//#region src/utils/mod-attrs.d.ts
|
|
1775
|
-
declare
|
|
1776
|
-
//#endregion
|
|
1777
|
-
//#region src/utils/dotize.d.ts
|
|
1778
|
-
declare const dotize: {
|
|
1779
|
-
valTypes: {
|
|
1780
|
-
none: string;
|
|
1781
|
-
primitive: string;
|
|
1782
|
-
object: string;
|
|
1783
|
-
array: string;
|
|
1784
|
-
};
|
|
1785
|
-
getValType: (val: any) => string | undefined;
|
|
1786
|
-
getPathType: (arrPath: any) => string[];
|
|
1787
|
-
isUndefined: (obj: any) => obj is undefined;
|
|
1788
|
-
isNumber: (f: any) => boolean;
|
|
1789
|
-
isEmptyObj: (obj: any) => boolean;
|
|
1790
|
-
isPlainObject: (obj: any) => boolean;
|
|
1791
|
-
isNotObject: (obj: any) => boolean;
|
|
1792
|
-
isEmptyArray: (arr: any) => boolean;
|
|
1793
|
-
isNotArray: (arr: any) => boolean;
|
|
1794
|
-
removeEmptyArrayItem: (arr: any) => any;
|
|
1795
|
-
getFieldName: (field: any, prefix: any, isRoot: any, isArrayItem: any, isArray: any) => string;
|
|
1796
|
-
startsWith: (val: any, valToSearch: any) => boolean;
|
|
1797
|
-
convert: (obj: any, prefix?: string) => any;
|
|
1798
|
-
backward: (obj: any, prefix: any) => any;
|
|
1799
|
-
};
|
|
1855
|
+
declare function modAttrs(map: AllBaseProps['mods']): Record<string, string> | null;
|
|
1800
1856
|
//#endregion
|
|
1801
1857
|
//#region src/utils/resolve-recipes.d.ts
|
|
1802
|
-
/**
|
|
1803
|
-
* Resolve all `recipe` style properties in a styles object.
|
|
1804
|
-
*
|
|
1805
|
-
* Handles both top-level and sub-element recipe references.
|
|
1806
|
-
* Returns the same object reference if no recipes are present anywhere
|
|
1807
|
-
* (zero overhead for the common case).
|
|
1808
|
-
*
|
|
1809
|
-
* @param styles - The styles object potentially containing `recipe` keys
|
|
1810
|
-
* @returns Resolved styles with recipe values merged in, or the original object if unchanged
|
|
1811
|
-
*/
|
|
1858
|
+
/** Resolve recipe references against the globally configured recipe map. */
|
|
1812
1859
|
declare function resolveRecipes(styles: Styles): Styles;
|
|
1813
1860
|
//#endregion
|
|
1814
1861
|
//#region src/utils/process-tokens.d.ts
|
|
@@ -1870,7 +1917,13 @@ interface ChunkBreakdown {
|
|
|
1870
1917
|
}
|
|
1871
1918
|
interface Summary {
|
|
1872
1919
|
activeClasses: string[];
|
|
1920
|
+
/** Classes `gc({ force: true })` would delete right now. */
|
|
1873
1921
|
unusedClasses: string[];
|
|
1922
|
+
/**
|
|
1923
|
+
* Held but in neither list: nothing renders them, yet collection will not
|
|
1924
|
+
* take them — inside the grace window, or pinned by an `inject()` handle.
|
|
1925
|
+
*/
|
|
1926
|
+
hotClasses: string[];
|
|
1874
1927
|
totalStyledClasses: string[];
|
|
1875
1928
|
activeCSSSize: number;
|
|
1876
1929
|
unusedCSSSize: number;
|
|
@@ -1907,5 +1960,5 @@ declare const tastyDebug: {
|
|
|
1907
1960
|
install(): void;
|
|
1908
1961
|
};
|
|
1909
1962
|
//#endregion
|
|
1910
|
-
export {
|
|
1911
|
-
//# sourceMappingURL=index-
|
|
1963
|
+
export { createColorFunc as $, ModValue as $t, keyframes as A, hexToRgb as An, TastyComponentPropsWithDefaults as At, styleHandlers as B, AllBaseProps as Bt, getRawCSSText as C, TEXT_STYLES as Cn, ModPropsInput as Ct, injectRawCSS as D, isSelector as Dn, ResolveTokenProps as Dt, injectGlobal as E, hasStylesGenerated as En, ResolveModProps as Et, chunkSheetRegistry as F, TastyProps as Ft, ChunkName as G, BlockOuterStyleProps as Gt, categorizeStyleKeys as H, BasePropsWithoutChildren as Ht, ComputeStylesOptions as I, TokenPropsInput as It, FONT_CHUNK_STYLES as J, ContainerStyleProps as Jt, DIMENSION_CHUNK_STYLES as K, BlockStyleProps as Kt, ComputeStylesResult as L, VariantMap as Lt, property as M, strToRgb as Mn, TastyElementProps as Mt, touch as N, TastyExtensionProps as Nt, injector as O, getNamedColorHex as On, SubElementDefinition as Ot, ChunkSheetRegistry as P, TastyPolymorphicComponent as Pt, resolveFunctionColor as Q, InnerStyleProps as Qt, computeStyles as R, WithVariant as Rt, getCSSTextForNode as S, POSITION_STYLES as Sn, ModPropDef as St, inject as T, DEFAULT_ZERO_NAME_PREFIX as Tn, ResolveModPropDef as Tt, APPEARANCE_CHUNK_STYLES as U, BaseStyleProps as Ut, ChunkInfo as V, BaseProps as Vt, CHUNK_NAMES as W, BlockInnerStyleProps as Wt, POSITION_CHUNK_STYLES as X, ExtraBaseStyleProps as Xt, LAYOUT_CHUNK_STYLES as Y, DimensionStyleProps as Yt, STYLE_TO_CHUNK as Z, FlowStyleProps as Zt, destroy as _, CONTAINER_STYLES as _n, useStyles as _t, DebugOptions as a, TastyBaseStylePropNames as an, TastyBatchProvider as at, gc as b, INNER_STYLES as bn, Element$1 as bt, tastyDebug as c, TastyThemeNames as cn, useFunction as ct, modAttrs as d, Tokens as dn, UsePropertyOptions as dt, Mods as en, okhstFunction as et, color$1 as f, BASE_STYLES as fn, useProperty as ft, createInjector as g, COLOR_STYLES as gn, UseStylesResult as gt, counterStyle as h, BLOCK_STYLES as hn, useGlobalStyles as ht, DebugChunkInfo as i, TagName as in, getDisplayName as it, ownKeyframes as j, hslToRgbValues as jn, TastyElementOptions as jt, isPropertyDefined as k, getRgbValuesFromRgbaString as kn, SubElementProps as kt, processTokens as l, TextStyleProps as ln, useCounterStyle as lt, cleanup as m, BLOCK_OUTER_STYLES as mn, useRawCSS as mt, CacheStatus as n, PositionStyleProps as nn, okhslFunction as nt, InspectResult as o, TastyCustomProps as on, TastyBatchProviderProps as ot, filterBaseProps as p, BLOCK_INNER_STYLES as pn, useKeyframes as pt, DISPLAY_CHUNK_STYLES as q, ColorStyleProps as qt, ChunkBreakdown as r, ShortGridStyles as rn, okhslPlugin as rt, Summary as s, TastyExtensionConfig as sn, UseFunctionOptions as st, CSSOptions as t, OuterStyleProps as tn, okhstPlugin as tt, resolveRecipes as u, TokenValue as un, useFontFace as ut, fontFace as v, DIMENSION_STYLES as vn, AllBasePropsWithMods as vt, holdKeyframes as w, DEFAULT_NAME_PREFIX as wn, ResolveAsProps as wt, getCSSText as x, OUTER_STYLES as xn, ElementsDefinition as xt, func as y, FLOW_STYLES as yn, ComponentStatics as yt, defineHandler as z, tasty as zt };
|
|
1964
|
+
//# sourceMappingURL=index-DxQNRj50.d.ts.map
|