@tenphi/tasty 0.0.0-snapshot.27699f6 → 0.0.0-snapshot.27b6708
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 +171 -107
- package/dist/{async-storage-B7_o6FKt.js → async-storage-DKK-wTD4.js} +1 -1
- package/dist/{async-storage-B7_o6FKt.js.map → async-storage-DKK-wTD4.js.map} +1 -1
- package/dist/babel-BUQGeOXA.d.ts +83 -0
- package/dist/{collector-QwpPODsy.js → collector-DTahQUiV.js} +97 -23
- package/dist/collector-DTahQUiV.js.map +1 -0
- package/dist/{collector-LuU1vZ68.d.ts → collector-DUaHCcTS.d.ts} +54 -7
- package/dist/{config-rrijM-U2.js → config-B5kHzuNz.js} +5144 -3012
- package/dist/config-B5kHzuNz.js.map +1 -0
- package/dist/{config-vuCRkBWX.d.ts → config-YsxGv4tq.d.ts} +412 -33
- package/dist/{context-CkSg-kDT.js → context-CA8YKeMn.js} +1 -1
- package/dist/{context-CkSg-kDT.js.map → context-CA8YKeMn.js.map} +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +6 -6
- package/dist/{core-BvTG0J_M.js → core-Dr4u1NVD.js} +162 -188
- package/dist/core-Dr4u1NVD.js.map +1 -0
- package/dist/{css-writer-C7HJGEmN.js → css-writer-B-J87ncv.js} +78 -17
- package/dist/css-writer-B-J87ncv.js.map +1 -0
- package/dist/{format-global-rules-Dbc_1tc3.js → format-global-rules-DklyaXv-.js} +1 -1
- package/dist/{format-global-rules-Dbc_1tc3.js.map → format-global-rules-DklyaXv-.js.map} +1 -1
- package/dist/{format-rules-BvokPr1L.js → format-rules-DKOA-6qu.js} +4 -17
- package/dist/format-rules-DKOA-6qu.js.map +1 -0
- package/dist/{hydrate-Dsv7Pwon.js → hydrate-OeMX99We.js} +3 -11
- package/dist/{hydrate-Dsv7Pwon.js.map → hydrate-OeMX99We.js.map} +1 -1
- package/dist/{index-dUtwpOux.d.ts → index-Cd45t5NM.d.ts} +319 -64
- package/dist/{index-ZRxZWzlj.d.ts → index-PqN-DIpn.d.ts} +498 -189
- package/dist/index.d.ts +5 -5
- package/dist/index.js +253 -63
- package/dist/index.js.map +1 -1
- package/dist/{keyframes-DDqRjwa9.js → keyframes-CV8azJf3.js} +97 -191
- package/dist/keyframes-CV8azJf3.js.map +1 -0
- package/dist/{merge-styles-CtDJMhpJ.d.ts → merge-styles-CU7JbEwg.d.ts} +2 -2
- package/dist/{merge-styles-B8jV6zu3.js → merge-styles-oklji0KB.js} +2 -2
- package/dist/{merge-styles-B8jV6zu3.js.map → merge-styles-oklji0KB.js.map} +1 -1
- package/dist/{resolve-recipes-BnTZz2I_.js → resolve-recipes-DTG81rzl.js} +3 -3
- package/dist/{resolve-recipes-BnTZz2I_.js.map → resolve-recipes-DTG81rzl.js.map} +1 -1
- package/dist/ssr/astro-client.js +1 -1
- package/dist/ssr/astro-client.js.map +1 -1
- package/dist/ssr/astro-middleware-static.d.ts +16 -0
- package/dist/ssr/astro-middleware-static.js +18 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +8 -6
- package/dist/ssr/astro-middleware.js +10 -10
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +2 -17
- package/dist/ssr/astro.js +29 -21
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -9
- package/dist/ssr/index.js +5 -5
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next.d.ts +2 -3
- package/dist/ssr/next.js +6 -7
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +2 -2
- package/dist/static/index.js +4 -4
- package/dist/static/index.js.map +1 -1
- package/dist/static/inject.js.map +1 -1
- package/dist/zero/babel.d.ts +2 -81
- package/dist/zero/babel.js +39 -27
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +16 -2
- package/dist/zero/index.js +2 -2
- package/dist/zero/next.d.ts +1 -1
- package/dist/zero/next.js +1 -1
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +12 -6
- package/docs/adoption.md +53 -28
- package/docs/ai-agents.md +224 -0
- package/docs/comparison.md +59 -30
- package/docs/configuration.md +498 -69
- package/docs/debug.md +7 -7
- package/docs/design-system.md +43 -24
- package/docs/dsl.md +510 -178
- package/docs/getting-started.md +55 -34
- package/docs/injector.md +58 -5
- package/docs/methodology.md +68 -36
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +93 -25
- package/docs/plugins.md +349 -0
- package/docs/react-api.md +162 -38
- package/docs/ssr.md +45 -35
- package/docs/styles.md +65 -16
- package/docs/tasty-static.md +25 -8
- package/package.json +43 -21
- package/tasty.config.ts +6 -0
- package/dist/collector-QwpPODsy.js.map +0 -1
- package/dist/config-rrijM-U2.js.map +0 -1
- package/dist/core-BvTG0J_M.js.map +0 -1
- package/dist/css-writer-C7HJGEmN.js.map +0 -1
- package/dist/format-rules-BvokPr1L.js.map +0 -1
- package/dist/keyframes-DDqRjwa9.js.map +0 -1
|
@@ -1,73 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as
|
|
3
|
-
import { t as ServerStyleCollector } from "./collector-
|
|
4
|
-
import
|
|
5
|
-
import { AllHTMLAttributes, CSSProperties, ComponentType, ElementType, ForwardRefExoticComponent, JSX, PropsWithoutRef, RefAttributes } from "react";
|
|
1
|
+
import { _ as TastyPluginFactory, w as StyleInjector } from "./config-YsxGv4tq.js";
|
|
2
|
+
import { B as StyleValueStateMap, Ct as PropertyOptions, D as CSSMap, I as StyleHandlerResult, M as ResolvedStyleValue, Ot as StyleInjectorConfig, R as StylePropValue, at as CSSProperties$1, b as Styles, bt as KeyframesResult, dt as FunctionDefinition, gt as InjectResult, ht as GlobalInjectResult, j as RawStyleHandler, lt as FontFaceDescriptors, mt as GCOptions, n as StyleResult, nt as StyleDetails, ot as CacheMetrics, st as CounterStyleDescriptors, ut as FontFaceInput, x as StylesInterface, xt as KeyframesSteps, z as StyleValue } from "./index-Cd45t5NM.js";
|
|
3
|
+
import { t as ServerStyleCollector } from "./collector-DUaHCcTS.js";
|
|
4
|
+
import { AllHTMLAttributes, CSSProperties, ComponentType, ElementType, ForwardRefExoticComponent, JSX, PropsWithoutRef, ReactNode, RefAttributes } from "react";
|
|
6
5
|
|
|
7
|
-
//#region src/
|
|
8
|
-
/**
|
|
9
|
-
* The okhsl function handler for tasty parser.
|
|
10
|
-
* Receives parsed style groups and returns an RGB color string.
|
|
11
|
-
*/
|
|
12
|
-
declare const okhslFunc: (groups: StyleDetails[]) => string;
|
|
13
|
-
/**
|
|
14
|
-
* OKHSL Plugin for Tasty.
|
|
15
|
-
*
|
|
16
|
-
* Adds support for the `okhsl()` color function in tasty styles.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* import { configure } from '@tenphi/tasty';
|
|
21
|
-
* import { okhslPlugin } from '@tenphi/tasty';
|
|
22
|
-
*
|
|
23
|
-
* configure({
|
|
24
|
-
* plugins: [okhslPlugin()],
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* // Now you can use okhsl in styles:
|
|
28
|
-
* const Box = tasty({
|
|
29
|
-
* styles: {
|
|
30
|
-
* fill: 'okhsl(240 50% 50%)',
|
|
31
|
-
* },
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
declare const okhslPlugin: TastyPluginFactory;
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/chunks/definitions.d.ts
|
|
38
|
-
declare const CHUNK_NAMES: {
|
|
39
|
-
/** Special chunk for styles that cannot be split */readonly COMBINED: "combined";
|
|
40
|
-
readonly SUBCOMPONENTS: "subcomponents";
|
|
41
|
-
readonly APPEARANCE: "appearance";
|
|
42
|
-
readonly FONT: "font";
|
|
43
|
-
readonly DIMENSION: "dimension";
|
|
44
|
-
readonly DISPLAY: "display";
|
|
45
|
-
readonly LAYOUT: "layout";
|
|
46
|
-
readonly POSITION: "position";
|
|
47
|
-
readonly MISC: "misc";
|
|
48
|
-
};
|
|
49
|
-
type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];
|
|
6
|
+
//#region src/utils/name-prefix.d.ts
|
|
50
7
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
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.
|
|
53
26
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/** Style keys belonging to this chunk */
|
|
59
|
-
styleKeys: string[];
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Categorize style keys into chunks.
|
|
63
|
-
*
|
|
64
|
-
* Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
|
|
65
|
-
* of the order of keys in the input styles object.
|
|
66
|
-
*
|
|
67
|
-
* @param styles - The styles object to categorize
|
|
68
|
-
* @returns Map of chunk name to array of style keys in that chunk (in priority order)
|
|
69
|
-
*/
|
|
70
|
-
declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<string, string[]>;
|
|
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";
|
|
71
31
|
//#endregion
|
|
72
32
|
//#region src/styles/list.d.ts
|
|
73
33
|
declare const BASE_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition"];
|
|
@@ -84,9 +44,6 @@ declare const OUTER_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRo
|
|
|
84
44
|
declare const INNER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
85
45
|
//#endregion
|
|
86
46
|
//#region src/types.d.ts
|
|
87
|
-
interface GlobalStyledProps {
|
|
88
|
-
breakpoints?: number[];
|
|
89
|
-
}
|
|
90
47
|
/**
|
|
91
48
|
* Extensible interface for theme names.
|
|
92
49
|
* Augment this interface to register project-specific theme names for autocomplete.
|
|
@@ -104,6 +61,42 @@ interface GlobalStyledProps {
|
|
|
104
61
|
interface TastyThemeNames {}
|
|
105
62
|
type ThemeNameKey = Extract<keyof TastyThemeNames, string>;
|
|
106
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]> };
|
|
107
100
|
/** Allowed mod value types */
|
|
108
101
|
type ModValue = boolean | string | number | undefined | null;
|
|
109
102
|
/**
|
|
@@ -126,7 +119,7 @@ type TokenValue = string | number | boolean | undefined | null;
|
|
|
126
119
|
/**
|
|
127
120
|
* Tokens definition for inline CSS custom properties.
|
|
128
121
|
* - `$name` keys become `--name` CSS properties
|
|
129
|
-
* - `#name` keys become `--name-color`
|
|
122
|
+
* - `#name` keys become `--name-color` CSS properties
|
|
130
123
|
*/
|
|
131
124
|
type Tokens = Record<`$${string}` | `#${string}`, TokenValue>;
|
|
132
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';
|
|
@@ -141,20 +134,14 @@ interface BasePropsWithoutChildren<K extends TagName = TagName> extends Pick<All
|
|
|
141
134
|
element?: `${Caps}${string}`;
|
|
142
135
|
/** The style map */
|
|
143
136
|
styles?: Styles;
|
|
144
|
-
/** The list of responsive points in pixels */
|
|
145
|
-
breakpoints?: number[];
|
|
146
|
-
/** Whether the element has the block layout outside */
|
|
147
|
-
block?: boolean;
|
|
148
|
-
/** Whether the element has the inline layout outside */
|
|
149
|
-
inline?: boolean;
|
|
150
137
|
/** The list of element modifiers **/
|
|
151
138
|
mods?: Mods;
|
|
152
139
|
/** Whether the element is hidden (`hidden` attribute is set) */
|
|
153
140
|
isHidden?: boolean;
|
|
154
141
|
/** Whether the element is disabled (`disabled` attribute is set) */
|
|
155
142
|
isDisabled?: boolean;
|
|
156
|
-
/**
|
|
157
|
-
|
|
143
|
+
/** Whether the element is checked (`checked` attribute is set) */
|
|
144
|
+
isChecked?: boolean;
|
|
158
145
|
/** The CSS style map */
|
|
159
146
|
style?: CSSProperties$1 | (CSSProperties$1 & Record<string, string | number | null | undefined>);
|
|
160
147
|
/** User-defined theme for the element. Mapped to `data-theme` attribute. Augment `TastyThemeNames` to register project-specific themes for autocomplete. */
|
|
@@ -182,7 +169,6 @@ interface ShortGridStyles {
|
|
|
182
169
|
rows?: Styles['gridRows'];
|
|
183
170
|
areas?: Styles['gridAreas'];
|
|
184
171
|
}
|
|
185
|
-
type Props = Record<string, any>;
|
|
186
172
|
type TagName = keyof HTMLElementTagNameMap;
|
|
187
173
|
/**
|
|
188
174
|
* Configuration type for tasty.config.ts files.
|
|
@@ -227,7 +213,7 @@ interface TastyExtensionConfig {
|
|
|
227
213
|
* Set to `false` to disable function validation (overrides parent).
|
|
228
214
|
* @example ['clamp', 'double']
|
|
229
215
|
*/
|
|
230
|
-
|
|
216
|
+
functions?: false | string[];
|
|
231
217
|
/**
|
|
232
218
|
* State alias names for autocomplete.
|
|
233
219
|
* Must start with @ prefix.
|
|
@@ -284,9 +270,10 @@ type TokenPropsMap = Readonly<Record<string, TokenPropKey>>;
|
|
|
284
270
|
type TokenPropsInput = TokenPropsList | TokenPropsMap;
|
|
285
271
|
/** Resolve a `tokenProps` definition to the component prop types it adds. */
|
|
286
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>;
|
|
287
274
|
type PropsWithStyles = {
|
|
288
275
|
styles?: Styles;
|
|
289
|
-
} & Omit<
|
|
276
|
+
} & Omit<Record<string, any>, 'styles'>;
|
|
290
277
|
type VariantMap = Record<string, Styles>;
|
|
291
278
|
interface WithVariant<V extends VariantMap> {
|
|
292
279
|
variant?: keyof V;
|
|
@@ -343,26 +330,34 @@ type TastyBaseProps<K extends StyleList, V extends VariantMap, E extends Element
|
|
|
343
330
|
tokens?: Tokens; /** Sub-element definitions for compound components */
|
|
344
331
|
elements?: E;
|
|
345
332
|
} & Pick<BaseProps, 'qa' | 'qaVal'> & WithVariant<V>;
|
|
346
|
-
type TastyProps<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, DefaultProps =
|
|
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> & {
|
|
347
334
|
/** The tag name of the element or a React component. */as?: string | ComponentType<any>;
|
|
348
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>;
|
|
349
343
|
/**
|
|
350
344
|
* TastyElementOptions is used for the element-creation overload of tasty().
|
|
351
|
-
* It includes
|
|
352
|
-
*
|
|
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).
|
|
353
348
|
*
|
|
354
|
-
* Note: Uses a separate index signature with `unknown` instead of
|
|
355
|
-
*
|
|
349
|
+
* Note: Uses a separate index signature with `unknown` instead of an `any`
|
|
350
|
+
* record to ensure strict type checking for styles.
|
|
356
351
|
*/
|
|
357
|
-
type TastyElementOptions<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>,
|
|
358
|
-
/** The tag name of the element or a React component. */as?:
|
|
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;
|
|
359
354
|
} & Record<string, unknown>;
|
|
360
|
-
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 & ResolveModProps<M> & ResolveTokenProps<TP>;
|
|
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>;
|
|
361
356
|
/**
|
|
362
357
|
* Keys from BasePropsWithoutChildren that should be omitted from HTML attributes.
|
|
363
358
|
* This excludes event handlers so they can be properly typed from JSX.IntrinsicElements.
|
|
364
359
|
*/
|
|
365
|
-
type TastySpecificKeys = 'as' | 'qa' | 'qaVal' | 'element' | 'styles' | '
|
|
360
|
+
type TastySpecificKeys = 'as' | 'qa' | 'qaVal' | 'element' | 'styles' | 'mods' | 'isHidden' | 'isDisabled' | 'isChecked' | 'style' | 'theme' | 'tokens' | 'ref' | 'color';
|
|
366
361
|
/** Extract prop key names from a ModPropsInput (array elements or object keys). */
|
|
367
362
|
type ModPropsKeys<M extends ModPropsInput> = M extends readonly (infer K)[] ? K & string : keyof M & string;
|
|
368
363
|
/** Extract prop key names from a TokenPropsInput (array elements or object keys). */
|
|
@@ -370,28 +365,40 @@ type TokenPropsKeys<TP extends TokenPropsInput> = TP extends readonly (infer K)[
|
|
|
370
365
|
/**
|
|
371
366
|
* Props type for tasty elements that combines:
|
|
372
367
|
* - AllBasePropsWithMods for style props with strict tokens type
|
|
373
|
-
* - HTML attributes for flexibility (properly typed based on
|
|
368
|
+
* - HTML attributes for flexibility (properly typed based on `as`)
|
|
374
369
|
* - Variant support
|
|
375
370
|
*
|
|
376
371
|
* AllBasePropsWithMods carries generic AllHTMLAttributes which can conflict
|
|
377
|
-
* with
|
|
378
|
-
*
|
|
379
|
-
* intersection-narrowing, we Omit
|
|
380
|
-
*
|
|
381
|
-
*
|
|
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.
|
|
382
380
|
*/
|
|
383
|
-
type TastyElementProps<K extends StyleList, V extends VariantMap,
|
|
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>>;
|
|
384
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] };
|
|
385
|
-
declare function tasty<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, Tag extends keyof JSX.IntrinsicElements = 'div', M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]>(options: TastyElementOptions<K, V, E, Tag, M, TP>, secondArg?: never): ForwardRefExoticComponent<PropsWithoutRef<TastyElementProps<K, V, Tag, M, TP>> & RefAttributes<unknown>> & SubElementComponents<E>;
|
|
386
|
-
declare function tasty<Props extends PropsWithStyles, DefaultProps extends Partial<Props> = Partial<Props>>(Component: ComponentType<Props>, options?: TastyProps<never, never, Record<string, never>, Props>): ComponentType<TastyComponentPropsWithDefaults<Props, DefaultProps>>;
|
|
387
|
-
declare const Element$1: ForwardRefExoticComponent<Omit<AllBasePropsWithMods<StyleList, readonly never[], readonly never[]>, "slot" | "title" | "children" | "className" | "role" | "id" | "hidden" | "prefix" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "key"> & WithVariant<VariantMap> & Omit<Omit<AllHTMLAttributes<HTMLElement>, keyof _$react.ClassAttributes<HTMLDivElement> | keyof _$react.HTMLAttributes<HTMLDivElement>> & _$react.ClassAttributes<HTMLDivElement> & _$react.HTMLAttributes<HTMLDivElement>, "style" | "clipPath" | "filter" | "image" | "marker" | "mask" | "fill" | "display" | "font" | "preset" | "hide" | "whiteSpace" | "opacity" | "transition" | "gridArea" | "order" | "gridColumn" | "gridRow" | "placeSelf" | "alignSelf" | "justifySelf" | "zIndex" | "margin" | "inset" | "position" | "scrollMargin" | "padding" | "paddingInline" | "paddingBlock" | "overflow" | "scrollbar" | "textAlign" | "border" | "radius" | "shadow" | "outline" | "color" | "fade" | "textTransform" | "fontWeight" | "fontStyle" | "width" | "height" | "flexBasis" | "flexGrow" | "flexShrink" | "flex" | "flow" | "place" | "placeItems" | "placeContent" | "alignItems" | "alignContent" | "justifyItems" | "justifyContent" | "align" | "justify" | "gap" | "columnGap" | "rowGap" | "gridColumns" | "gridRows" | "gridTemplate" | "gridAreas" | "top" | "right" | "bottom" | "left" | "mods" | "css" | "content" | "translate" | "as" | "background" | "all" | "page" | "qa" | "qaVal" | "scrollMarginTop" | "scrollMarginRight" | "scrollMarginBottom" | "scrollMarginLeft" | "scrollMarginBlock" | "scrollMarginInline" | "accentColor" | "alignTracks" | "alignmentBaseline" | "anchorName" | "anchorScope" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationRangeEnd" | "animationRangeStart" | "animationTimeline" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "baselineShift" | "blockSize" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipRule" | "colorAdjust" | "colorInterpolationFilters" | "colorScheme" | "columnCount" | "columnFill" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "containerName" | "containerType" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "cx" | "cy" | "d" | "direction" | "dominantBaseline" | "emptyCells" | "fieldSizing" | "fillOpacity" | "fillRule" | "flexDirection" | "flexWrap" | "float" | "floodColor" | "floodOpacity" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontPalette" | "fontSize" | "fontSizeAdjust" | "fontSmooth" | "fontSynthesis" | "fontSynthesisPosition" | "fontSynthesisSmallCaps" | "fontSynthesisStyle" | "fontSynthesisWeight" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantEmoji" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "fontWidth" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "hyphenateCharacter" | "hyphenateLimitChars" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "interpolateSize" | "isolation" | "justifyTracks" | "letterSpacing" | "lightingColor" | "lineBreak" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "markerEnd" | "markerMid" | "markerStart" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "motionDistance" | "motionPath" | "motionRotation" | "objectFit" | "objectPosition" | "objectViewBox" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "offsetRotation" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflowAnchor" | "overflowBlock" | "overflowClipBox" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overlay" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "positionAnchor" | "positionArea" | "positionTryFallbacks" | "positionTryOrder" | "positionVisibility" | "printColorAdjust" | "quotes" | "r" | "resize" | "rotate" | "rubyAlign" | "rubyMerge" | "rubyOverhang" | "rubyPosition" | "rx" | "ry" | "scale" | "scrollBehavior" | "scrollInitialTarget" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapMarginBottom" | "scrollSnapMarginLeft" | "scrollSnapMarginRight" | "scrollSnapMarginTop" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "shapeRendering" | "speakAs" | "stopColor" | "stopOpacity" | "stroke" | "strokeColor" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "tabSize" | "tableLayout" | "textAlignLast" | "textAnchor" | "textAutospace" | "textBox" | "textBoxEdge" | "textBoxTrim" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textSpacingTrim" | "textUnderlineOffset" | "textUnderlinePosition" | "textWrapMode" | "textWrapStyle" | "timelineScope" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionBehavior" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "unicodeBidi" | "userSelect" | "vectorEffect" | "verticalAlign" | "viewTimelineAxis" | "viewTimelineInset" | "viewTimelineName" | "viewTransitionClass" | "viewTransitionName" | "visibility" | "whiteSpaceCollapse" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "x" | "y" | "zoom" | "animation" | "animationRange" | "backgroundPosition" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockStart" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderColor" | "borderImage" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineStart" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "caret" | "columnRule" | "columns" | "containIntrinsicSize" | "container" | "flexFlow" | "grid" | "insetBlock" | "insetInline" | "lineClamp" | "listStyle" | "marginBlock" | "marginInline" | "maskBorder" | "motion" | "offset" | "overscrollBehavior" | "positionTry" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingInline" | "scrollSnapMargin" | "scrollTimeline" | "textDecoration" | "textEmphasis" | "textWrap" | "viewTimeline" | "MozAnimationDelay" | "MozAnimationDirection" | "MozAnimationDuration" | "MozAnimationFillMode" | "MozAnimationIterationCount" | "MozAnimationName" | "MozAnimationPlayState" | "MozAnimationTimingFunction" | "MozAppearance" | "MozBackfaceVisibility" | "MozBinding" | "MozBorderBottomColors" | "MozBorderEndColor" | "MozBorderEndStyle" | "MozBorderEndWidth" | "MozBorderLeftColors" | "MozBorderRightColors" | "MozBorderStartColor" | "MozBorderStartStyle" | "MozBorderTopColors" | "MozBoxSizing" | "MozColumnRuleColor" | "MozColumnRuleStyle" | "MozColumnRuleWidth" | "MozColumnWidth" | "MozContextProperties" | "MozFontFeatureSettings" | "MozFontLanguageOverride" | "MozHyphens" | "MozMarginEnd" | "MozMarginStart" | "MozOrient" | "MozOsxFontSmoothing" | "MozOutlineRadiusBottomleft" | "MozOutlineRadiusBottomright" | "MozOutlineRadiusTopleft" | "MozOutlineRadiusTopright" | "MozPaddingEnd" | "MozPaddingStart" | "MozPerspective" | "MozPerspectiveOrigin" | "MozStackSizing" | "MozTabSize" | "MozTextBlink" | "MozTextSizeAdjust" | "MozTransform" | "MozTransformOrigin" | "MozTransformStyle" | "MozUserModify" | "MozUserSelect" | "MozWindowDragging" | "MozWindowShadow" | "msAccelerator" | "msBlockProgression" | "msContentZoomChaining" | "msContentZoomLimitMax" | "msContentZoomLimitMin" | "msContentZoomSnapPoints" | "msContentZoomSnapType" | "msContentZooming" | "msFilter" | "msFlexDirection" | "msFlexPositive" | "msFlowFrom" | "msFlowInto" | "msGridColumns" | "msGridRows" | "msHighContrastAdjust" | "msHyphenateLimitChars" | "msHyphenateLimitLines" | "msHyphenateLimitZone" | "msHyphens" | "msImeAlign" | "msLineBreak" | "msOrder" | "msOverflowStyle" | "msOverflowX" | "msOverflowY" | "msScrollChaining" | "msScrollLimitXMax" | "msScrollLimitXMin" | "msScrollLimitYMax" | "msScrollLimitYMin" | "msScrollRails" | "msScrollSnapPointsX" | "msScrollSnapPointsY" | "msScrollSnapType" | "msScrollTranslation" | "msScrollbar3dlightColor" | "msScrollbarArrowColor" | "msScrollbarBaseColor" | "msScrollbarDarkshadowColor" | "msScrollbarFaceColor" | "msScrollbarHighlightColor" | "msScrollbarShadowColor" | "msScrollbarTrackColor" | "msTextAutospace" | "msTextCombineHorizontal" | "msTextOverflow" | "msTouchAction" | "msTouchSelect" | "msTransform" | "msTransformOrigin" | "msTransitionDelay" | "msTransitionDuration" | "msTransitionProperty" | "msTransitionTimingFunction" | "msUserSelect" | "msWordBreak" | "msWrapFlow" | "msWrapMargin" | "msWrapThrough" | "msWritingMode" | "WebkitAlignContent" | "WebkitAlignItems" | "WebkitAlignSelf" | "WebkitAnimationDelay" | "WebkitAnimationDirection" | "WebkitAnimationDuration" | "WebkitAnimationFillMode" | "WebkitAnimationIterationCount" | "WebkitAnimationName" | "WebkitAnimationPlayState" | "WebkitAnimationTimingFunction" | "WebkitAppearance" | "WebkitBackdropFilter" | "WebkitBackfaceVisibility" | "WebkitBackgroundClip" | "WebkitBackgroundOrigin" | "WebkitBackgroundSize" | "WebkitBorderBeforeColor" | "WebkitBorderBeforeStyle" | "WebkitBorderBeforeWidth" | "WebkitBorderBottomLeftRadius" | "WebkitBorderBottomRightRadius" | "WebkitBorderImageSlice" | "WebkitBorderTopLeftRadius" | "WebkitBorderTopRightRadius" | "WebkitBoxDecorationBreak" | "WebkitBoxReflect" | "WebkitBoxShadow" | "WebkitBoxSizing" | "WebkitClipPath" | "WebkitColumnCount" | "WebkitColumnFill" | "WebkitColumnRuleColor" | "WebkitColumnRuleStyle" | "WebkitColumnRuleWidth" | "WebkitColumnSpan" | "WebkitColumnWidth" | "WebkitFilter" | "WebkitFlexBasis" | "WebkitFlexDirection" | "WebkitFlexGrow" | "WebkitFlexShrink" | "WebkitFlexWrap" | "WebkitFontFeatureSettings" | "WebkitFontKerning" | "WebkitFontSmoothing" | "WebkitFontVariantLigatures" | "WebkitHyphenateCharacter" | "WebkitHyphens" | "WebkitInitialLetter" | "WebkitJustifyContent" | "WebkitLineBreak" | "WebkitLineClamp" | "WebkitLogicalHeight" | "WebkitLogicalWidth" | "WebkitMarginEnd" | "WebkitMarginStart" | "WebkitMaskAttachment" | "WebkitMaskBoxImageOutset" | "WebkitMaskBoxImageRepeat" | "WebkitMaskBoxImageSlice" | "WebkitMaskBoxImageSource" | "WebkitMaskBoxImageWidth" | "WebkitMaskClip" | "WebkitMaskComposite" | "WebkitMaskImage" | "WebkitMaskOrigin" | "WebkitMaskPosition" | "WebkitMaskPositionX" | "WebkitMaskPositionY" | "WebkitMaskRepeat" | "WebkitMaskRepeatX" | "WebkitMaskRepeatY" | "WebkitMaskSize" | "WebkitMaxInlineSize" | "WebkitOrder" | "WebkitOverflowScrolling" | "WebkitPaddingEnd" | "WebkitPaddingStart" | "WebkitPerspective" | "WebkitPerspectiveOrigin" | "WebkitPrintColorAdjust" | "WebkitRubyPosition" | "WebkitScrollSnapType" | "WebkitShapeMargin" | "WebkitTapHighlightColor" | "WebkitTextCombine" | "WebkitTextDecorationColor" | "WebkitTextDecorationLine" | "WebkitTextDecorationSkip" | "WebkitTextDecorationStyle" | "WebkitTextEmphasisColor" | "WebkitTextEmphasisPosition" | "WebkitTextEmphasisStyle" | "WebkitTextFillColor" | "WebkitTextOrientation" | "WebkitTextSizeAdjust" | "WebkitTextStrokeColor" | "WebkitTextStrokeWidth" | "WebkitTextUnderlinePosition" | "WebkitTouchCallout" | "WebkitTransform" | "WebkitTransformOrigin" | "WebkitTransformStyle" | "WebkitTransitionDelay" | "WebkitTransitionDuration" | "WebkitTransitionProperty" | "WebkitTransitionTimingFunction" | "WebkitUserModify" | "WebkitUserSelect" | "WebkitWritingMode" | "MozAnimation" | "MozBorderImage" | "MozColumnRule" | "MozColumns" | "MozOutlineRadius" | "MozTransition" | "msContentZoomLimit" | "msContentZoomSnap" | "msFlex" | "msScrollLimit" | "msScrollSnapX" | "msScrollSnapY" | "msTransition" | "WebkitAnimation" | "WebkitBorderBefore" | "WebkitBorderImage" | "WebkitBorderRadius" | "WebkitColumnRule" | "WebkitColumns" | "WebkitFlex" | "WebkitFlexFlow" | "WebkitMask" | "WebkitMaskBoxImage" | "WebkitTextEmphasis" | "WebkitTextStroke" | "WebkitTransition" | "boxAlign" | "boxDirection" | "boxFlex" | "boxFlexGroup" | "boxLines" | "boxOrdinalGroup" | "boxOrient" | "boxPack" | "clip" | "fontStretch" | "gridColumnGap" | "gridGap" | "gridRowGap" | "imeMode" | "insetArea" | "offsetBlock" | "offsetBlockEnd" | "offsetBlockStart" | "offsetInline" | "offsetInlineEnd" | "offsetInlineStart" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "positionTryOptions" | "scrollSnapCoordinate" | "scrollSnapDestination" | "scrollSnapPointsX" | "scrollSnapPointsY" | "scrollSnapTypeX" | "scrollSnapTypeY" | "KhtmlBoxAlign" | "KhtmlBoxDirection" | "KhtmlBoxFlex" | "KhtmlBoxFlexGroup" | "KhtmlBoxLines" | "KhtmlBoxOrdinalGroup" | "KhtmlBoxOrient" | "KhtmlBoxPack" | "KhtmlLineBreak" | "KhtmlOpacity" | "KhtmlUserSelect" | "MozBackgroundClip" | "MozBackgroundOrigin" | "MozBackgroundSize" | "MozBorderRadius" | "MozBorderRadiusBottomleft" | "MozBorderRadiusBottomright" | "MozBorderRadiusTopleft" | "MozBorderRadiusTopright" | "MozBoxAlign" | "MozBoxDirection" | "MozBoxFlex" | "MozBoxOrdinalGroup" | "MozBoxOrient" | "MozBoxPack" | "MozBoxShadow" | "MozColumnCount" | "MozColumnFill" | "MozFloatEdge" | "MozForceBrokenImageIcon" | "MozOpacity" | "MozOutline" | "MozOutlineColor" | "MozOutlineStyle" | "MozOutlineWidth" | "MozTextAlignLast" | "MozTextDecorationColor" | "MozTextDecorationLine" | "MozTextDecorationStyle" | "MozTransitionDelay" | "MozTransitionDuration" | "MozTransitionProperty" | "MozTransitionTimingFunction" | "MozUserFocus" | "MozUserInput" | "msImeMode" | "OAnimation" | "OAnimationDelay" | "OAnimationDirection" | "OAnimationDuration" | "OAnimationFillMode" | "OAnimationIterationCount" | "OAnimationName" | "OAnimationPlayState" | "OAnimationTimingFunction" | "OBackgroundSize" | "OBorderImage" | "OObjectFit" | "OObjectPosition" | "OTabSize" | "OTextOverflow" | "OTransform" | "OTransformOrigin" | "OTransition" | "OTransitionDelay" | "OTransitionDuration" | "OTransitionProperty" | "OTransitionTimingFunction" | "WebkitBoxAlign" | "WebkitBoxDirection" | "WebkitBoxFlex" | "WebkitBoxFlexGroup" | "WebkitBoxLines" | "WebkitBoxOrdinalGroup" | "WebkitBoxOrient" | "WebkitBoxPack" | "colorInterpolation" | "colorRendering" | "glyphOrientationVertical" | "svgFill" | "boldFontWeight" | "@keyframes" | "@properties" | "@fontFace" | "@counterStyle" | "recipe" | "element" | "styles" | "breakpoints" | "block" | "inline" | "isHidden" | "isDisabled" | "theme" | "tokens" | "ref"> & RefAttributes<unknown>> & SubElementComponents<Record<string, never>>;
|
|
388
|
-
//#endregion
|
|
389
|
-
//#region src/hooks/useStyles.d.ts
|
|
390
383
|
/**
|
|
391
|
-
*
|
|
392
|
-
*
|
|
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.
|
|
393
395
|
*/
|
|
394
|
-
type
|
|
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
|
|
395
402
|
interface UseStylesResult {
|
|
396
403
|
/**
|
|
397
404
|
* Generated className(s) to apply to the element.
|
|
@@ -420,7 +427,7 @@ interface UseStylesResult {
|
|
|
420
427
|
* }
|
|
421
428
|
* ```
|
|
422
429
|
*/
|
|
423
|
-
declare function useStyles(styles:
|
|
430
|
+
declare function useStyles(styles: Styles | undefined, options?: {
|
|
424
431
|
root?: Document | ShadowRoot;
|
|
425
432
|
}): UseStylesResult;
|
|
426
433
|
//#endregion
|
|
@@ -449,6 +456,10 @@ interface UseGlobalStylesOptions {
|
|
|
449
456
|
* Use the `id` option for update tracking when styles change over the
|
|
450
457
|
* component lifecycle.
|
|
451
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
|
+
*
|
|
452
463
|
* @param selector - CSS selector to apply styles to (e.g., '.my-class', ':root', 'body')
|
|
453
464
|
* @param styles - Tasty styles object
|
|
454
465
|
* @param options - Optional settings including `id` for update tracking
|
|
@@ -471,9 +482,8 @@ declare function useGlobalStyles(selector: string, styles?: Styles, options?: Us
|
|
|
471
482
|
//#region src/hooks/useRawCSS.d.ts
|
|
472
483
|
interface UseRawCSSOptions {
|
|
473
484
|
/**
|
|
474
|
-
* Shadow root or document to inject into.
|
|
475
|
-
*
|
|
476
|
-
* only the root for the same id/content will not re-inject.
|
|
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.
|
|
477
487
|
*/
|
|
478
488
|
root?: Document | ShadowRoot;
|
|
479
489
|
/**
|
|
@@ -499,6 +509,11 @@ interface UseKeyframesOptions {
|
|
|
499
509
|
*
|
|
500
510
|
* Works in all environments: client, SSR with collector, and React Server Components.
|
|
501
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
|
+
*
|
|
502
517
|
* @example Basic usage - steps object is the dependency
|
|
503
518
|
* ```tsx
|
|
504
519
|
* function MyComponent() {
|
|
@@ -543,28 +558,11 @@ declare function useKeyframes(steps: KeyframesSteps, options?: UseKeyframesOptio
|
|
|
543
558
|
declare function useKeyframes(factory: () => KeyframesSteps, deps: readonly unknown[], options?: UseKeyframesOptions): string;
|
|
544
559
|
//#endregion
|
|
545
560
|
//#region src/hooks/useProperty.d.ts
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
*/
|
|
552
|
-
syntax?: string;
|
|
553
|
-
/**
|
|
554
|
-
* Whether the property inherits from parent elements
|
|
555
|
-
* @default true
|
|
556
|
-
*/
|
|
557
|
-
inherits?: boolean;
|
|
558
|
-
/**
|
|
559
|
-
* Initial value for the property.
|
|
560
|
-
* For color tokens (#name), this defaults to 'transparent' if not specified.
|
|
561
|
-
*/
|
|
562
|
-
initialValue?: string | number;
|
|
563
|
-
/**
|
|
564
|
-
* Shadow root or document to inject into
|
|
565
|
-
*/
|
|
566
|
-
root?: Document | ShadowRoot;
|
|
567
|
-
}
|
|
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;
|
|
568
566
|
/**
|
|
569
567
|
* Register a CSS @property custom property.
|
|
570
568
|
* This enables advanced features like animating custom properties.
|
|
@@ -694,6 +692,95 @@ interface UseCounterStyleOptions {
|
|
|
694
692
|
*/
|
|
695
693
|
declare function useCounterStyle(descriptors: CounterStyleDescriptors, options?: UseCounterStyleOptions): string;
|
|
696
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
|
|
697
784
|
//#region src/utils/get-display-name.d.ts
|
|
698
785
|
declare function getDisplayName<T>(Component: ElementType<T>, fallbackName?: string): string;
|
|
699
786
|
//#endregion
|
|
@@ -702,6 +789,207 @@ declare module './utils/css-types' {
|
|
|
702
789
|
interface CSSProperties extends CSSProperties {}
|
|
703
790
|
}
|
|
704
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 is a **leaf module with no imports**. It exists separately from
|
|
891
|
+
* `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", "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, paddingBlock/Inline
|
|
935
|
+
* ⚠️ marginStyle: margin, marginTop/Right/Bottom/Left, marginBlock/Inline
|
|
936
|
+
* ⚠️ widthStyle: width, minWidth, maxWidth
|
|
937
|
+
* ⚠️ heightStyle: height, minHeight, maxHeight
|
|
938
|
+
*/
|
|
939
|
+
/** @public */
|
|
940
|
+
declare const DIMENSION_CHUNK_STYLES: readonly ["padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingBlock", "paddingInline", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginBlock", "marginInline", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
941
|
+
/**
|
|
942
|
+
* Display chunk - display mode, layout flow, text overflow, and scrollbar
|
|
943
|
+
*
|
|
944
|
+
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
945
|
+
* ⚠️ displayStyle: display, hide, textOverflow, overflow, whiteSpace
|
|
946
|
+
* ⚠️ flowStyle: display, flow
|
|
947
|
+
* ⚠️ gapStyle: display, flow, gap
|
|
948
|
+
* ⚠️ scrollbarStyle: scrollbar, overflow
|
|
949
|
+
*/
|
|
950
|
+
/** @public */
|
|
951
|
+
declare const DISPLAY_CHUNK_STYLES: readonly ["display", "hide", "textOverflow", "overflow", "whiteSpace", "flow", "gap", "scrollbar"];
|
|
952
|
+
/**
|
|
953
|
+
* Layout chunk - flex/grid alignment and grid templates
|
|
954
|
+
*
|
|
955
|
+
* Note: flow and gap are in DISPLAY chunk due to handler dependencies
|
|
956
|
+
* (flowStyle and gapStyle both require 'display' prop).
|
|
957
|
+
*/
|
|
958
|
+
/** @public */
|
|
959
|
+
declare const LAYOUT_CHUNK_STYLES: readonly ["placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "place", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas", "gridAutoFlow", "gridAutoColumns", "gridAutoRows"];
|
|
960
|
+
/**
|
|
961
|
+
* Position chunk - element positioning
|
|
962
|
+
*
|
|
963
|
+
* Handler dependencies (all styles in each handler MUST stay in this chunk):
|
|
964
|
+
* ⚠️ insetStyle: inset, insetBlock, insetInline, top, right, bottom, left
|
|
965
|
+
*/
|
|
966
|
+
/** @public */
|
|
967
|
+
declare const POSITION_CHUNK_STYLES: readonly ["position", "inset", "insetBlock", "insetInline", "top", "right", "bottom", "left", "zIndex", "gridArea", "gridColumn", "gridRow", "order", "placeSelf", "alignSelf", "justifySelf", "transform", "transition", "animation"];
|
|
968
|
+
/**
|
|
969
|
+
* Map for O(1) style-to-chunk lookup. Seeded with the built-in lists above and
|
|
970
|
+
* extended by {@link assignStyleChunk} when a custom handler declares style names
|
|
971
|
+
* the built-in lists don't know.
|
|
972
|
+
*/
|
|
973
|
+
declare const STYLE_TO_CHUNK: Map<string, ChunkName>;
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region src/chunks/definitions.d.ts
|
|
976
|
+
interface ChunkInfo {
|
|
977
|
+
/** Name of the chunk */
|
|
978
|
+
name: ChunkName | string;
|
|
979
|
+
/** Style keys belonging to this chunk */
|
|
980
|
+
styleKeys: string[];
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Categorize style keys into chunks.
|
|
984
|
+
*
|
|
985
|
+
* Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
|
|
986
|
+
* of the order of keys in the input styles object.
|
|
987
|
+
*
|
|
988
|
+
* @param styles - The styles object to categorize
|
|
989
|
+
* @returns Map of chunk name to array of style keys in that chunk (in priority order)
|
|
990
|
+
*/
|
|
991
|
+
declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<string, string[]>;
|
|
992
|
+
//#endregion
|
|
705
993
|
//#region src/styles/border.d.ts
|
|
706
994
|
/**
|
|
707
995
|
* Border style handler with multi-group support.
|
|
@@ -730,9 +1018,7 @@ declare function colorStyle({
|
|
|
730
1018
|
color
|
|
731
1019
|
}: {
|
|
732
1020
|
color?: string | boolean;
|
|
733
|
-
}):
|
|
734
|
-
color: string;
|
|
735
|
-
} | null;
|
|
1021
|
+
}): Record<string, string> | null;
|
|
736
1022
|
declare namespace colorStyle {
|
|
737
1023
|
var __lookupStyles: string[];
|
|
738
1024
|
}
|
|
@@ -826,7 +1112,7 @@ declare function flowStyle({
|
|
|
826
1112
|
display?: string;
|
|
827
1113
|
flow?: string;
|
|
828
1114
|
}): {
|
|
829
|
-
[x: string]: string
|
|
1115
|
+
[x: string]: string;
|
|
830
1116
|
} | null;
|
|
831
1117
|
declare namespace flowStyle {
|
|
832
1118
|
var __lookupStyles: string[];
|
|
@@ -1020,10 +1306,13 @@ interface PresetStyleProps {
|
|
|
1020
1306
|
/**
|
|
1021
1307
|
* Handles typography preset and individual font properties.
|
|
1022
1308
|
*
|
|
1023
|
-
* Preset syntax uses `/` to separate name from
|
|
1309
|
+
* Preset syntax uses `/` to separate the name from one or more
|
|
1310
|
+
* space-separated modifiers:
|
|
1024
1311
|
* - `preset="h1"` — name only
|
|
1025
1312
|
* - `preset="h2 / strong"` — name + modifier
|
|
1313
|
+
* - `preset="h2 / strong italic"` — name + multiple modifiers
|
|
1026
1314
|
* - `preset="bold"` — modifier-only shorthand (name defaults to `inherit`)
|
|
1315
|
+
* - `preset="bold italic"` — modifier-only shorthand with multiple modifiers
|
|
1027
1316
|
*
|
|
1028
1317
|
* When `preset` is defined, it sets up CSS custom properties for typography.
|
|
1029
1318
|
* Individual font props can be used with or without `preset`:
|
|
@@ -1047,7 +1336,7 @@ declare function presetStyle({
|
|
|
1047
1336
|
fontStyle,
|
|
1048
1337
|
fontFamily,
|
|
1049
1338
|
font
|
|
1050
|
-
}: PresetStyleProps):
|
|
1339
|
+
}: PresetStyleProps): CSSMap | null;
|
|
1051
1340
|
declare namespace presetStyle {
|
|
1052
1341
|
var __lookupStyles: string[];
|
|
1053
1342
|
}
|
|
@@ -1194,6 +1483,36 @@ declare const styleHandlers: {
|
|
|
1194
1483
|
readonly width: typeof widthStyle;
|
|
1195
1484
|
};
|
|
1196
1485
|
//#endregion
|
|
1486
|
+
//#region src/styles/define-handler.d.ts
|
|
1487
|
+
/**
|
|
1488
|
+
* Declare a multi-dependency style handler with its dependency names inferred
|
|
1489
|
+
* into the handler's parameter type.
|
|
1490
|
+
*
|
|
1491
|
+
* Without it, the multi-dependency tuple form needs a hand-written parameter
|
|
1492
|
+
* annotation that can silently drift from the dependency list:
|
|
1493
|
+
*
|
|
1494
|
+
* ```ts
|
|
1495
|
+
* // Annotation and dependency list are maintained separately.
|
|
1496
|
+
* handlers: {
|
|
1497
|
+
* spacing: [['gap', 'padding'], ({ gap, padding }: { gap?: string; padding?: string }) => …],
|
|
1498
|
+
* }
|
|
1499
|
+
*
|
|
1500
|
+
* // Both come from the same array; a typo in the destructure is a type error.
|
|
1501
|
+
* handlers: {
|
|
1502
|
+
* spacing: defineHandler(['gap', 'padding'], ({ gap, padding }) => …),
|
|
1503
|
+
* }
|
|
1504
|
+
* ```
|
|
1505
|
+
*
|
|
1506
|
+
* Values arrive **state-resolved but unparsed** — the raw authored DSL string
|
|
1507
|
+
* (`'2x'`, `'#purple.5'`), so call `parseStyle()` / `parseColor()` as needed. The
|
|
1508
|
+
* result is a kebab-case CSS declaration map (or an array of them); the reserved
|
|
1509
|
+
* `$` key applies the declarations to a nested selector.
|
|
1510
|
+
*
|
|
1511
|
+
* All names must belong to the same chunk. Names the built-in chunk lists don't
|
|
1512
|
+
* know are pulled into their handler's chunk automatically at registration.
|
|
1513
|
+
*/
|
|
1514
|
+
declare function defineHandler<const TDeps extends readonly string[]>(deps: TDeps, handler: (props: Partial<Record<TDeps[number], ResolvedStyleValue>>) => StyleHandlerResult): [readonly string[], RawStyleHandler];
|
|
1515
|
+
//#endregion
|
|
1197
1516
|
//#region src/compute-styles.d.ts
|
|
1198
1517
|
interface ComputeStylesResult {
|
|
1199
1518
|
className: string;
|
|
@@ -1204,6 +1523,13 @@ interface ComputeStylesOptions {
|
|
|
1204
1523
|
ssrCollector?: ServerStyleCollector | null;
|
|
1205
1524
|
/** Target root for style injection (client only). Defaults to `document`. */
|
|
1206
1525
|
root?: Document | ShadowRoot;
|
|
1526
|
+
/**
|
|
1527
|
+
* Set when `styles` outlives this call and will be passed in again — a
|
|
1528
|
+
* `tasty()` factory's own styles object rather than a per-render merge.
|
|
1529
|
+
* It lets chunk cache keys be memoized on the object, which is worth the
|
|
1530
|
+
* bookkeeping only when there is a next render to spend it on.
|
|
1531
|
+
*/
|
|
1532
|
+
stableStyles?: boolean;
|
|
1207
1533
|
}
|
|
1208
1534
|
/**
|
|
1209
1535
|
* Synchronous, hook-free style computation.
|
|
@@ -1306,26 +1632,6 @@ declare function keyframes(steps: KeyframesSteps, nameOrOptions?: string | {
|
|
|
1306
1632
|
root?: Document | ShadowRoot;
|
|
1307
1633
|
name?: string;
|
|
1308
1634
|
}): KeyframesResult;
|
|
1309
|
-
interface PropertyOptions {
|
|
1310
|
-
/**
|
|
1311
|
-
* CSS syntax string for the property (e.g., '<color>', '<length>', '<angle>')
|
|
1312
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
|
|
1313
|
-
*/
|
|
1314
|
-
syntax?: string;
|
|
1315
|
-
/**
|
|
1316
|
-
* Whether the property inherits from parent elements
|
|
1317
|
-
* @default true
|
|
1318
|
-
*/
|
|
1319
|
-
inherits?: boolean;
|
|
1320
|
-
/**
|
|
1321
|
-
* Initial value for the property
|
|
1322
|
-
*/
|
|
1323
|
-
initialValue?: string | number;
|
|
1324
|
-
/**
|
|
1325
|
-
* Shadow root or document to inject into
|
|
1326
|
-
*/
|
|
1327
|
-
root?: Document | ShadowRoot;
|
|
1328
|
-
}
|
|
1329
1635
|
/**
|
|
1330
1636
|
* Define a CSS @property custom property.
|
|
1331
1637
|
* This enables advanced features like animating custom properties.
|
|
@@ -1352,7 +1658,7 @@ interface PropertyOptions {
|
|
|
1352
1658
|
* });
|
|
1353
1659
|
* ```
|
|
1354
1660
|
*/
|
|
1355
|
-
declare function property
|
|
1661
|
+
declare function property(name: string, options?: PropertyOptions): void;
|
|
1356
1662
|
/**
|
|
1357
1663
|
* Check if a CSS @property has already been defined
|
|
1358
1664
|
*
|
|
@@ -1374,23 +1680,44 @@ declare function fontFace(family: string, descriptors: FontFaceDescriptors, opti
|
|
|
1374
1680
|
/**
|
|
1375
1681
|
* Inject a CSS @counter-style rule.
|
|
1376
1682
|
*
|
|
1377
|
-
* Permanent and global — no dispose or ref-counting.
|
|
1378
|
-
*
|
|
1683
|
+
* Permanent and global — no dispose or ref-counting. Deduplicates by name and
|
|
1684
|
+
* overrides an existing rule by default. Pass `weak: true` for global
|
|
1685
|
+
* `configure()` definitions, which never clobber an existing rule.
|
|
1379
1686
|
*/
|
|
1380
1687
|
declare function counterStyle(name: string, descriptors: CounterStyleDescriptors, options?: {
|
|
1381
1688
|
root?: Document | ShadowRoot;
|
|
1689
|
+
weak?: boolean;
|
|
1690
|
+
}): void;
|
|
1691
|
+
/**
|
|
1692
|
+
* Inject a CSS @function rule (custom function).
|
|
1693
|
+
*
|
|
1694
|
+
* Permanent and global — no dispose or ref-counting. Deduplicates by function
|
|
1695
|
+
* name and overrides an existing rule by default. Pass `weak: true` for global
|
|
1696
|
+
* `configure()` definitions, which never clobber an existing rule.
|
|
1697
|
+
*
|
|
1698
|
+
* @param name - The function name (`$$name`, `$name`, or `--name`)
|
|
1699
|
+
* @param definition - Function definition (args, returns, result, local vars)
|
|
1700
|
+
*
|
|
1701
|
+
* @example
|
|
1702
|
+
* ```ts
|
|
1703
|
+
* func('$$negative', { args: ['$value'], result: '(-1 * $value)' });
|
|
1704
|
+
* ```
|
|
1705
|
+
*/
|
|
1706
|
+
declare function func(name: string, definition: FunctionDefinition, options?: {
|
|
1707
|
+
root?: Document | ShadowRoot;
|
|
1708
|
+
weak?: boolean;
|
|
1382
1709
|
}): void;
|
|
1383
1710
|
/**
|
|
1384
1711
|
* Get CSS text from all sheets (for SSR)
|
|
1385
1712
|
*/
|
|
1386
|
-
declare function
|
|
1713
|
+
declare function getCSSText(options?: {
|
|
1387
1714
|
root?: Document | ShadowRoot;
|
|
1388
1715
|
}): string;
|
|
1389
1716
|
/**
|
|
1390
1717
|
* Collect only CSS used by a rendered subtree (like jest-styled-components).
|
|
1391
1718
|
* Pass the container returned by render(...).
|
|
1392
1719
|
*/
|
|
1393
|
-
declare function
|
|
1720
|
+
declare function getCSSTextForNode(node: ParentNode | Element | DocumentFragment, options?: {
|
|
1394
1721
|
root?: Document | ShadowRoot;
|
|
1395
1722
|
}): string;
|
|
1396
1723
|
/**
|
|
@@ -1413,10 +1740,6 @@ declare function touch(className: string, options?: {
|
|
|
1413
1740
|
* @returns Number of styles evicted.
|
|
1414
1741
|
*/
|
|
1415
1742
|
declare function gc(options?: GCOptions): number;
|
|
1416
|
-
/**
|
|
1417
|
-
* Check if we're currently running in a test environment
|
|
1418
|
-
*/
|
|
1419
|
-
declare function getIsTestEnvironment(): boolean;
|
|
1420
1743
|
/**
|
|
1421
1744
|
* Get the global injector instance for debugging
|
|
1422
1745
|
*/
|
|
@@ -1488,25 +1811,11 @@ declare const dotize: {
|
|
|
1488
1811
|
*/
|
|
1489
1812
|
declare function resolveRecipes(styles: Styles): Styles;
|
|
1490
1813
|
//#endregion
|
|
1491
|
-
//#region src/utils/warnings.d.ts
|
|
1492
|
-
declare function warn(...args: unknown[]): void;
|
|
1493
|
-
declare function deprecationWarning(condition: unknown, {
|
|
1494
|
-
property,
|
|
1495
|
-
name,
|
|
1496
|
-
betterAlternative,
|
|
1497
|
-
reason
|
|
1498
|
-
}: {
|
|
1499
|
-
property: string;
|
|
1500
|
-
name: string;
|
|
1501
|
-
betterAlternative: (() => string) | string;
|
|
1502
|
-
reason?: (() => string) | string;
|
|
1503
|
-
}): void;
|
|
1504
|
-
//#endregion
|
|
1505
1814
|
//#region src/utils/process-tokens.d.ts
|
|
1506
1815
|
/**
|
|
1507
1816
|
* Process tokens object into inline style properties.
|
|
1508
|
-
* -
|
|
1509
|
-
* -
|
|
1817
|
+
* - `$name` -> `--name` with the parsed value
|
|
1818
|
+
* - `#name` -> `--name-color` with the parsed value
|
|
1510
1819
|
*
|
|
1511
1820
|
* @param tokens - The tokens object to process
|
|
1512
1821
|
* @returns CSSProperties object or undefined if no tokens to process
|
|
@@ -1525,19 +1834,19 @@ interface DebugOptions {
|
|
|
1525
1834
|
/** Suppress console logging and return data only (default: false) */
|
|
1526
1835
|
raw?: boolean;
|
|
1527
1836
|
}
|
|
1528
|
-
interface
|
|
1837
|
+
interface CSSOptions extends DebugOptions {
|
|
1529
1838
|
prettify?: boolean;
|
|
1530
1839
|
/** Read from stored source CSS (dev-mode only) instead of live CSSOM */
|
|
1531
1840
|
source?: boolean;
|
|
1532
1841
|
}
|
|
1533
|
-
interface
|
|
1842
|
+
interface DebugChunkInfo {
|
|
1534
1843
|
className: string;
|
|
1535
1844
|
chunkName: string | null;
|
|
1536
1845
|
}
|
|
1537
1846
|
interface InspectResult {
|
|
1538
1847
|
element?: Element | null;
|
|
1539
1848
|
classes: string[];
|
|
1540
|
-
chunks:
|
|
1849
|
+
chunks: DebugChunkInfo[];
|
|
1541
1850
|
css: string;
|
|
1542
1851
|
size: number;
|
|
1543
1852
|
rules: number;
|
|
@@ -1586,7 +1895,7 @@ interface Summary {
|
|
|
1586
1895
|
chunkBreakdown: ChunkBreakdown;
|
|
1587
1896
|
}
|
|
1588
1897
|
declare const tastyDebug: {
|
|
1589
|
-
css(target: CSSTarget, opts?:
|
|
1898
|
+
css(target: CSSTarget, opts?: CSSOptions): string;
|
|
1590
1899
|
inspect(target: string | Element, opts?: DebugOptions): InspectResult;
|
|
1591
1900
|
summary(opts?: DebugOptions): Summary;
|
|
1592
1901
|
chunks(opts?: DebugOptions): ChunkBreakdown;
|
|
@@ -1598,5 +1907,5 @@ declare const tastyDebug: {
|
|
|
1598
1907
|
install(): void;
|
|
1599
1908
|
};
|
|
1600
1909
|
//#endregion
|
|
1601
|
-
export {
|
|
1602
|
-
//# sourceMappingURL=index-
|
|
1910
|
+
export { okhstFunction as $, PositionStyleProps as $t, keyframes as A, TastyElementProps as At, ChunkInfo as B, BaseStyleProps as Bt, getCSSTextForNode as C, ResolveModPropDef as Ct, injectRawCSS as D, SubElementProps as Dt, injectGlobal as E, SubElementDefinition as Et, ComputeStylesOptions as F, WithVariant as Ft, DIMENSION_CHUNK_STYLES as G, ContainerStyleProps as Gt, APPEARANCE_CHUNK_STYLES as H, BlockOuterStyleProps as Ht, ComputeStylesResult as I, tasty as It, LAYOUT_CHUNK_STYLES as J, FlowStyleProps as Jt, DISPLAY_CHUNK_STYLES as K, DimensionStyleProps as Kt, computeStyles as L, AllBaseProps as Lt, touch as M, TastyProps as Mt, ChunkSheetRegistry as N, TokenPropsInput as Nt, injector as O, TastyComponentPropsWithDefaults as Ot, chunkSheetRegistry as P, VariantMap as Pt, createColorFunc as Q, OuterStyleProps as Qt, defineHandler as R, BaseProps as Rt, getCSSText as S, DEFAULT_ZERO_NAME_PREFIX as Sn, ResolveAsProps as St, inject as T, ResolveTokenProps as Tt, CHUNK_NAMES as U, BlockStyleProps as Ut, categorizeStyleKeys as V, BlockInnerStyleProps as Vt, ChunkName as W, ColorStyleProps as Wt, STYLE_TO_CHUNK as X, ModValue as Xt, POSITION_CHUNK_STYLES as Y, InnerStyleProps as Yt, resolveFunctionColor as Z, Mods as Zt, createInjector as _, INNER_STYLES as _n, AllBasePropsWithMods as _t, DebugOptions as a, TastyThemeNames as an, TastyBatchProviderProps as at, func as b, TEXT_STYLES as bn, ModPropDef as bt, tastyDebug as c, Tokens as cn, useCounterStyle as ct, dotize as d, BLOCK_OUTER_STYLES as dn, useProperty as dt, ShortGridStyles as en, okhstPlugin as et, _modAttrs as f, BLOCK_STYLES as fn, useKeyframes as ft, counterStyle as g, FLOW_STYLES as gn, useStyles as gt, cleanup as h, DIMENSION_STYLES as hn, UseStylesResult as ht, DebugChunkInfo as i, TastyExtensionConfig as in, TastyBatchProvider as it, property as j, TastyPolymorphicComponent as jt, isPropertyDefined as k, TastyElementOptions as kt, processTokens as l, BASE_STYLES as ln, useFontFace as lt, filterBaseProps as m, CONTAINER_STYLES as mn, useGlobalStyles as mt, CacheStatus as n, TastyBaseStylePropNames as nn, okhslPlugin as nt, InspectResult as o, TextStyleProps as on, UseFunctionOptions as ot, color$1 as p, COLOR_STYLES as pn, useRawCSS as pt, FONT_CHUNK_STYLES as q, ExtraBaseStyleProps as qt, ChunkBreakdown as r, TastyCustomProps as rn, getDisplayName as rt, Summary as s, TokenValue as sn, useFunction as st, CSSOptions as t, TagName as tn, okhslFunction as tt, resolveRecipes as u, BLOCK_INNER_STYLES as un, UsePropertyOptions as ut, destroy as v, OUTER_STYLES as vn, Element$1 as vt, getRawCSSText as w, ResolveModProps as wt, gc as x, DEFAULT_NAME_PREFIX as xn, ModPropsInput as xt, fontFace as y, POSITION_STYLES as yn, ElementsDefinition as yt, styleHandlers as z, BasePropsWithoutChildren as zt };
|
|
1911
|
+
//# sourceMappingURL=index-PqN-DIpn.d.ts.map
|