@tenphi/tasty 0.1.0
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/LICENSE +21 -0
- package/README.md +236 -0
- package/dist/_virtual/_rolldown/runtime.mjs +7 -0
- package/dist/chunks/cacheKey.d.ts +1 -0
- package/dist/chunks/cacheKey.js +70 -0
- package/dist/chunks/cacheKey.js.map +1 -0
- package/dist/chunks/cacheKey.mjs +70 -0
- package/dist/chunks/cacheKey.mjs.map +1 -0
- package/dist/chunks/definitions.d.ts +37 -0
- package/dist/chunks/definitions.js +260 -0
- package/dist/chunks/definitions.js.map +1 -0
- package/dist/chunks/definitions.mjs +260 -0
- package/dist/chunks/definitions.mjs.map +1 -0
- package/dist/chunks/index.d.ts +3 -0
- package/dist/chunks/renderChunk.d.ts +2 -0
- package/dist/chunks/renderChunk.js +61 -0
- package/dist/chunks/renderChunk.js.map +1 -0
- package/dist/chunks/renderChunk.mjs +61 -0
- package/dist/chunks/renderChunk.mjs.map +1 -0
- package/dist/config.d.ts +279 -0
- package/dist/config.js +400 -0
- package/dist/config.js.map +1 -0
- package/dist/config.mjs +231 -0
- package/dist/config.mjs.map +1 -0
- package/dist/css-writer.d.mts +45 -0
- package/dist/css-writer.mjs +74 -0
- package/dist/css-writer.mjs.map +1 -0
- package/dist/debug.d.ts +204 -0
- package/dist/debug.js +733 -0
- package/dist/debug.js.map +1 -0
- package/dist/extractor.d.mts +24 -0
- package/dist/extractor.mjs +150 -0
- package/dist/extractor.mjs.map +1 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useGlobalStyles.d.ts +27 -0
- package/dist/hooks/useGlobalStyles.js +56 -0
- package/dist/hooks/useGlobalStyles.js.map +1 -0
- package/dist/hooks/useKeyframes.d.ts +56 -0
- package/dist/hooks/useKeyframes.js +54 -0
- package/dist/hooks/useKeyframes.js.map +1 -0
- package/dist/hooks/useProperty.d.ts +79 -0
- package/dist/hooks/useProperty.js +91 -0
- package/dist/hooks/useProperty.js.map +1 -0
- package/dist/hooks/useRawCSS.d.ts +53 -0
- package/dist/hooks/useRawCSS.js +28 -0
- package/dist/hooks/useRawCSS.js.map +1 -0
- package/dist/hooks/useStyles.d.ts +40 -0
- package/dist/hooks/useStyles.js +169 -0
- package/dist/hooks/useStyles.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +30 -0
- package/dist/injector/index.d.ts +157 -0
- package/dist/injector/index.js +154 -0
- package/dist/injector/index.js.map +1 -0
- package/dist/injector/injector.d.ts +139 -0
- package/dist/injector/injector.js +404 -0
- package/dist/injector/injector.js.map +1 -0
- package/dist/injector/injector.mjs +404 -0
- package/dist/injector/injector.mjs.map +1 -0
- package/dist/injector/sheet-manager.d.ts +127 -0
- package/dist/injector/sheet-manager.js +714 -0
- package/dist/injector/sheet-manager.js.map +1 -0
- package/dist/injector/sheet-manager.mjs +714 -0
- package/dist/injector/sheet-manager.mjs.map +1 -0
- package/dist/injector/types.d.mts +18 -0
- package/dist/injector/types.d.ts +135 -0
- package/dist/keyframes/index.js +206 -0
- package/dist/keyframes/index.js.map +1 -0
- package/dist/keyframes/index.mjs +156 -0
- package/dist/keyframes/index.mjs.map +1 -0
- package/dist/parser/classify.js +319 -0
- package/dist/parser/classify.js.map +1 -0
- package/dist/parser/classify.mjs +319 -0
- package/dist/parser/classify.mjs.map +1 -0
- package/dist/parser/const.js +33 -0
- package/dist/parser/const.js.map +1 -0
- package/dist/parser/const.mjs +33 -0
- package/dist/parser/const.mjs.map +1 -0
- package/dist/parser/lru.js +109 -0
- package/dist/parser/lru.js.map +1 -0
- package/dist/parser/lru.mjs +109 -0
- package/dist/parser/lru.mjs.map +1 -0
- package/dist/parser/parser.d.ts +25 -0
- package/dist/parser/parser.js +116 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/parser.mjs +116 -0
- package/dist/parser/parser.mjs.map +1 -0
- package/dist/parser/tokenizer.js +69 -0
- package/dist/parser/tokenizer.js.map +1 -0
- package/dist/parser/tokenizer.mjs +69 -0
- package/dist/parser/tokenizer.mjs.map +1 -0
- package/dist/parser/types.d.mts +37 -0
- package/dist/parser/types.d.ts +46 -0
- package/dist/parser/types.js +46 -0
- package/dist/parser/types.js.map +1 -0
- package/dist/parser/types.mjs +46 -0
- package/dist/parser/types.mjs.map +1 -0
- package/dist/pipeline/conditions.js +377 -0
- package/dist/pipeline/conditions.js.map +1 -0
- package/dist/pipeline/conditions.mjs +377 -0
- package/dist/pipeline/conditions.mjs.map +1 -0
- package/dist/pipeline/exclusive.d.ts +1 -0
- package/dist/pipeline/exclusive.js +231 -0
- package/dist/pipeline/exclusive.js.map +1 -0
- package/dist/pipeline/exclusive.mjs +231 -0
- package/dist/pipeline/exclusive.mjs.map +1 -0
- package/dist/pipeline/index.d.ts +53 -0
- package/dist/pipeline/index.js +641 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/index.mjs +635 -0
- package/dist/pipeline/index.mjs.map +1 -0
- package/dist/pipeline/materialize.js +821 -0
- package/dist/pipeline/materialize.js.map +1 -0
- package/dist/pipeline/materialize.mjs +821 -0
- package/dist/pipeline/materialize.mjs.map +1 -0
- package/dist/pipeline/parseStateKey.d.ts +1 -0
- package/dist/pipeline/parseStateKey.js +418 -0
- package/dist/pipeline/parseStateKey.js.map +1 -0
- package/dist/pipeline/parseStateKey.mjs +418 -0
- package/dist/pipeline/parseStateKey.mjs.map +1 -0
- package/dist/pipeline/simplify.js +557 -0
- package/dist/pipeline/simplify.js.map +1 -0
- package/dist/pipeline/simplify.mjs +557 -0
- package/dist/pipeline/simplify.mjs.map +1 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/okhsl-plugin.d.ts +35 -0
- package/dist/plugins/okhsl-plugin.js +371 -0
- package/dist/plugins/okhsl-plugin.js.map +1 -0
- package/dist/plugins/okhsl-plugin.mjs +345 -0
- package/dist/plugins/okhsl-plugin.mjs.map +1 -0
- package/dist/plugins/types.d.mts +49 -0
- package/dist/plugins/types.d.ts +69 -0
- package/dist/properties/index.js +158 -0
- package/dist/properties/index.js.map +1 -0
- package/dist/properties/index.mjs +141 -0
- package/dist/properties/index.mjs.map +1 -0
- package/dist/states/index.d.ts +45 -0
- package/dist/states/index.js +389 -0
- package/dist/states/index.js.map +1 -0
- package/dist/states/index.mjs +161 -0
- package/dist/states/index.mjs.map +1 -0
- package/dist/static/index.d.ts +5 -0
- package/dist/static/index.js +5 -0
- package/dist/static/tastyStatic.d.ts +46 -0
- package/dist/static/tastyStatic.js +31 -0
- package/dist/static/tastyStatic.js.map +1 -0
- package/dist/static/types.d.ts +49 -0
- package/dist/static/types.js +24 -0
- package/dist/static/types.js.map +1 -0
- package/dist/styles/align.d.ts +15 -0
- package/dist/styles/align.js +14 -0
- package/dist/styles/align.js.map +1 -0
- package/dist/styles/align.mjs +14 -0
- package/dist/styles/align.mjs.map +1 -0
- package/dist/styles/border.d.ts +25 -0
- package/dist/styles/border.js +114 -0
- package/dist/styles/border.js.map +1 -0
- package/dist/styles/border.mjs +114 -0
- package/dist/styles/border.mjs.map +1 -0
- package/dist/styles/color.d.ts +14 -0
- package/dist/styles/color.js +23 -0
- package/dist/styles/color.js.map +1 -0
- package/dist/styles/color.mjs +23 -0
- package/dist/styles/color.mjs.map +1 -0
- package/dist/styles/createStyle.js +77 -0
- package/dist/styles/createStyle.js.map +1 -0
- package/dist/styles/createStyle.mjs +77 -0
- package/dist/styles/createStyle.mjs.map +1 -0
- package/dist/styles/dimension.js +97 -0
- package/dist/styles/dimension.js.map +1 -0
- package/dist/styles/dimension.mjs +97 -0
- package/dist/styles/dimension.mjs.map +1 -0
- package/dist/styles/display.d.ts +37 -0
- package/dist/styles/display.js +67 -0
- package/dist/styles/display.js.map +1 -0
- package/dist/styles/display.mjs +67 -0
- package/dist/styles/display.mjs.map +1 -0
- package/dist/styles/fade.d.ts +15 -0
- package/dist/styles/fade.js +58 -0
- package/dist/styles/fade.js.map +1 -0
- package/dist/styles/fade.mjs +58 -0
- package/dist/styles/fade.mjs.map +1 -0
- package/dist/styles/fill.d.ts +44 -0
- package/dist/styles/fill.js +51 -0
- package/dist/styles/fill.js.map +1 -0
- package/dist/styles/fill.mjs +51 -0
- package/dist/styles/fill.mjs.map +1 -0
- package/dist/styles/flow.d.ts +16 -0
- package/dist/styles/flow.js +12 -0
- package/dist/styles/flow.js.map +1 -0
- package/dist/styles/flow.mjs +12 -0
- package/dist/styles/flow.mjs.map +1 -0
- package/dist/styles/gap.d.ts +31 -0
- package/dist/styles/gap.js +37 -0
- package/dist/styles/gap.js.map +1 -0
- package/dist/styles/gap.mjs +37 -0
- package/dist/styles/gap.mjs.map +1 -0
- package/dist/styles/height.d.ts +17 -0
- package/dist/styles/height.js +20 -0
- package/dist/styles/height.js.map +1 -0
- package/dist/styles/height.mjs +20 -0
- package/dist/styles/height.mjs.map +1 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/index.js +9 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/index.mjs +9 -0
- package/dist/styles/index.mjs.map +1 -0
- package/dist/styles/inset.d.ts +50 -0
- package/dist/styles/inset.js +142 -0
- package/dist/styles/inset.js.map +1 -0
- package/dist/styles/inset.mjs +142 -0
- package/dist/styles/inset.mjs.map +1 -0
- package/dist/styles/justify.d.ts +15 -0
- package/dist/styles/justify.js +14 -0
- package/dist/styles/justify.js.map +1 -0
- package/dist/styles/justify.mjs +14 -0
- package/dist/styles/justify.mjs.map +1 -0
- package/dist/styles/list.d.ts +16 -0
- package/dist/styles/list.js +98 -0
- package/dist/styles/list.js.map +1 -0
- package/dist/styles/margin.d.ts +28 -0
- package/dist/styles/margin.js +96 -0
- package/dist/styles/margin.js.map +1 -0
- package/dist/styles/margin.mjs +96 -0
- package/dist/styles/margin.mjs.map +1 -0
- package/dist/styles/outline.d.ts +29 -0
- package/dist/styles/outline.js +65 -0
- package/dist/styles/outline.js.map +1 -0
- package/dist/styles/outline.mjs +65 -0
- package/dist/styles/outline.mjs.map +1 -0
- package/dist/styles/padding.d.ts +28 -0
- package/dist/styles/padding.js +96 -0
- package/dist/styles/padding.js.map +1 -0
- package/dist/styles/padding.mjs +96 -0
- package/dist/styles/padding.mjs.map +1 -0
- package/dist/styles/predefined.d.ts +74 -0
- package/dist/styles/predefined.js +241 -0
- package/dist/styles/predefined.js.map +1 -0
- package/dist/styles/predefined.mjs +232 -0
- package/dist/styles/predefined.mjs.map +1 -0
- package/dist/styles/preset.d.ts +47 -0
- package/dist/styles/preset.js +126 -0
- package/dist/styles/preset.js.map +1 -0
- package/dist/styles/preset.mjs +126 -0
- package/dist/styles/preset.mjs.map +1 -0
- package/dist/styles/radius.d.ts +14 -0
- package/dist/styles/radius.js +51 -0
- package/dist/styles/radius.js.map +1 -0
- package/dist/styles/radius.mjs +51 -0
- package/dist/styles/radius.mjs.map +1 -0
- package/dist/styles/scrollbar.d.ts +21 -0
- package/dist/styles/scrollbar.js +105 -0
- package/dist/styles/scrollbar.js.map +1 -0
- package/dist/styles/scrollbar.mjs +105 -0
- package/dist/styles/scrollbar.mjs.map +1 -0
- package/dist/styles/shadow.d.ts +14 -0
- package/dist/styles/shadow.js +24 -0
- package/dist/styles/shadow.js.map +1 -0
- package/dist/styles/shadow.mjs +24 -0
- package/dist/styles/shadow.mjs.map +1 -0
- package/dist/styles/styledScrollbar.d.ts +47 -0
- package/dist/styles/styledScrollbar.js +38 -0
- package/dist/styles/styledScrollbar.js.map +1 -0
- package/dist/styles/styledScrollbar.mjs +38 -0
- package/dist/styles/styledScrollbar.mjs.map +1 -0
- package/dist/styles/transition.d.ts +14 -0
- package/dist/styles/transition.js +138 -0
- package/dist/styles/transition.js.map +1 -0
- package/dist/styles/transition.mjs +138 -0
- package/dist/styles/transition.mjs.map +1 -0
- package/dist/styles/types.d.mts +492 -0
- package/dist/styles/types.d.ts +496 -0
- package/dist/styles/width.d.ts +17 -0
- package/dist/styles/width.js +20 -0
- package/dist/styles/width.js.map +1 -0
- package/dist/styles/width.mjs +20 -0
- package/dist/styles/width.mjs.map +1 -0
- package/dist/tasty.d.ts +983 -0
- package/dist/tasty.js +191 -0
- package/dist/tasty.js.map +1 -0
- package/dist/tokens/typography.d.ts +19 -0
- package/dist/tokens/typography.js +237 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/types.d.ts +182 -0
- package/dist/utils/cache-wrapper.js +26 -0
- package/dist/utils/cache-wrapper.js.map +1 -0
- package/dist/utils/cache-wrapper.mjs +26 -0
- package/dist/utils/cache-wrapper.mjs.map +1 -0
- package/dist/utils/case-converter.js +8 -0
- package/dist/utils/case-converter.js.map +1 -0
- package/dist/utils/case-converter.mjs +8 -0
- package/dist/utils/case-converter.mjs.map +1 -0
- package/dist/utils/colors.d.ts +5 -0
- package/dist/utils/colors.js +9 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/dotize.d.ts +26 -0
- package/dist/utils/dotize.js +122 -0
- package/dist/utils/dotize.js.map +1 -0
- package/dist/utils/filter-base-props.d.ts +15 -0
- package/dist/utils/filter-base-props.js +45 -0
- package/dist/utils/filter-base-props.js.map +1 -0
- package/dist/utils/get-display-name.d.ts +7 -0
- package/dist/utils/get-display-name.js +10 -0
- package/dist/utils/get-display-name.js.map +1 -0
- package/dist/utils/hsl-to-rgb.js +38 -0
- package/dist/utils/hsl-to-rgb.js.map +1 -0
- package/dist/utils/hsl-to-rgb.mjs +38 -0
- package/dist/utils/hsl-to-rgb.mjs.map +1 -0
- package/dist/utils/is-dev-env.js +19 -0
- package/dist/utils/is-dev-env.js.map +1 -0
- package/dist/utils/is-dev-env.mjs +19 -0
- package/dist/utils/is-dev-env.mjs.map +1 -0
- package/dist/utils/merge-styles.d.ts +7 -0
- package/dist/utils/merge-styles.js +146 -0
- package/dist/utils/merge-styles.js.map +1 -0
- package/dist/utils/merge-styles.mjs +146 -0
- package/dist/utils/merge-styles.mjs.map +1 -0
- package/dist/utils/mod-attrs.d.ts +8 -0
- package/dist/utils/mod-attrs.js +21 -0
- package/dist/utils/mod-attrs.js.map +1 -0
- package/dist/utils/okhsl-to-rgb.js +296 -0
- package/dist/utils/okhsl-to-rgb.js.map +1 -0
- package/dist/utils/okhsl-to-rgb.mjs +296 -0
- package/dist/utils/okhsl-to-rgb.mjs.map +1 -0
- package/dist/utils/process-tokens.d.ts +31 -0
- package/dist/utils/process-tokens.js +171 -0
- package/dist/utils/process-tokens.js.map +1 -0
- package/dist/utils/process-tokens.mjs +28 -0
- package/dist/utils/process-tokens.mjs.map +1 -0
- package/dist/utils/resolve-recipes.d.ts +17 -0
- package/dist/utils/resolve-recipes.js +143 -0
- package/dist/utils/resolve-recipes.js.map +1 -0
- package/dist/utils/resolve-recipes.mjs +143 -0
- package/dist/utils/resolve-recipes.mjs.map +1 -0
- package/dist/utils/string.js +8 -0
- package/dist/utils/string.js.map +1 -0
- package/dist/utils/string.mjs +8 -0
- package/dist/utils/string.mjs.map +1 -0
- package/dist/utils/styles.d.mts +18 -0
- package/dist/utils/styles.d.ts +183 -0
- package/dist/utils/styles.js +585 -0
- package/dist/utils/styles.js.map +1 -0
- package/dist/utils/styles.mjs +346 -0
- package/dist/utils/styles.mjs.map +1 -0
- package/dist/utils/typography.d.ts +36 -0
- package/dist/utils/typography.js +53 -0
- package/dist/utils/typography.js.map +1 -0
- package/dist/utils/warnings.d.ts +16 -0
- package/dist/utils/warnings.js +16 -0
- package/dist/utils/warnings.js.map +1 -0
- package/dist/zero/babel.d.mts +108 -0
- package/dist/zero/babel.mjs +282 -0
- package/dist/zero/babel.mjs.map +1 -0
- package/dist/zero/index.d.mts +3 -0
- package/dist/zero/index.mjs +4 -0
- package/dist/zero/next.d.mts +60 -0
- package/dist/zero/next.mjs +78 -0
- package/dist/zero/next.mjs.map +1 -0
- package/package.json +127 -0
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { StyleValue, StyleValueStateMap } from "../utils/styles.mjs";
|
|
2
|
+
import { KeyframesSteps, PropertyDefinition } from "../injector/types.mjs";
|
|
3
|
+
import { CSSProperties } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/styles/types.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Extensible interface for named color tokens.
|
|
8
|
+
* Augment this interface to register project-specific color names
|
|
9
|
+
* for autocomplete in `fill`, `color`, `svgFill`, and other color style props.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* declare module '@tenphi/tasty' {
|
|
14
|
+
* interface TastyNamedColors {
|
|
15
|
+
* primary: true;
|
|
16
|
+
* danger: true;
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
interface TastyNamedColors {}
|
|
22
|
+
type NamedColorKey = Extract<keyof TastyNamedColors, string>;
|
|
23
|
+
type NamedColor = [NamedColorKey] extends [never] ? string : NamedColorKey;
|
|
24
|
+
/**
|
|
25
|
+
* Extensible interface for typography preset names.
|
|
26
|
+
* Augment this interface to register project-specific preset names for autocomplete.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* declare module '@tenphi/tasty' {
|
|
31
|
+
* interface TastyPresetNames {
|
|
32
|
+
* h1: true;
|
|
33
|
+
* t3: true;
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
interface TastyPresetNames {}
|
|
39
|
+
type PresetNameKey = Extract<keyof TastyPresetNames, string>;
|
|
40
|
+
type PresetName = [PresetNameKey] extends [never] ? string : PresetNameKey;
|
|
41
|
+
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
42
|
+
type OpaquePercentage = '' | `.${Digit}` | `.${Digit}${Digit}` | '.100';
|
|
43
|
+
interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'border' | 'transition' | 'placeContent' | 'placeItems'> {
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use `flow` style instead.
|
|
46
|
+
*/
|
|
47
|
+
flexDirection: CSSProperties['flexDirection'];
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Use `placeContent`, `placeItems`, `gridColumns`, `gridRows`, and `gridTemplate` styles instead.
|
|
50
|
+
*/
|
|
51
|
+
grid: CSSProperties['grid'];
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Use `flexShrink`, `flexGrow`, and `flexBasis` styles instead.
|
|
54
|
+
*/
|
|
55
|
+
flex: CSSProperties['flex'];
|
|
56
|
+
/**
|
|
57
|
+
* Set the background color of the element. Shortcut for `background-color` with enhanced support for Tasty color tokens and syntaxes.
|
|
58
|
+
*
|
|
59
|
+
* Examples:
|
|
60
|
+
* - `fill="#purple.10"` // purple background with 10% opacity
|
|
61
|
+
* - `fill="#danger"` // danger theme color
|
|
62
|
+
* - `fill="rgb(255 128 0)"` // custom RGB color
|
|
63
|
+
* - `fill={true}` // default fill color
|
|
64
|
+
*/
|
|
65
|
+
fill?: `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `rgba(${string})` | boolean | (string & {});
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use `fill` instead.
|
|
68
|
+
*/
|
|
69
|
+
backgroundColor?: CSSProperties['backgroundColor'];
|
|
70
|
+
/**
|
|
71
|
+
* Set the background image of the element. Shortcut for `background-image` with enhanced support for Tasty tokens.
|
|
72
|
+
*
|
|
73
|
+
* Examples:
|
|
74
|
+
* - `image="url(/path/to/image.png)"` // image from URL
|
|
75
|
+
* - `image="linear-gradient(to right, #purple, #danger)"` // gradient
|
|
76
|
+
*/
|
|
77
|
+
image?: CSSProperties['backgroundImage'];
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Use `image` instead.
|
|
80
|
+
*/
|
|
81
|
+
backgroundImage?: CSSProperties['backgroundImage'];
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Use separate background styles (`fill`, `image`, `backgroundSize`, etc.) instead.
|
|
84
|
+
* When set, overrides all other background-related styles.
|
|
85
|
+
*/
|
|
86
|
+
background?: CSSProperties['background'];
|
|
87
|
+
/**
|
|
88
|
+
* Set the fill color of SVG elements. Outputs the native CSS `fill` property with enhanced support for Tasty color tokens and syntaxes.
|
|
89
|
+
*
|
|
90
|
+
* Examples:
|
|
91
|
+
* - `svgFill="#purple.10"` // purple fill with 10% opacity
|
|
92
|
+
* - `svgFill="#danger"` // danger theme color
|
|
93
|
+
* - `svgFill="rgb(255 128 0)"` // custom RGB color
|
|
94
|
+
* - `svgFill="currentColor"` // inherit from parent color
|
|
95
|
+
*/
|
|
96
|
+
svgFill?: `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `rgba(${string})` | (string & {});
|
|
97
|
+
/**
|
|
98
|
+
* Set the text (current) color of the element. Shortcut for `color` with enhanced support for Tasty color tokens and syntaxes.
|
|
99
|
+
*
|
|
100
|
+
* Examples:
|
|
101
|
+
* - `color="#purple"` // purple text color
|
|
102
|
+
* - `color="#danger.6"` // danger color with 60% opacity
|
|
103
|
+
* - `color="red"` // CSS color name
|
|
104
|
+
* - `color={true}` // currentColor
|
|
105
|
+
*/
|
|
106
|
+
color?: `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `rgba(${string})` | boolean | string;
|
|
107
|
+
/**
|
|
108
|
+
* The fade style applies gradient-based fading masks to the edges of an element. Replaces complex CSS mask gradients with a simple, declarative API.
|
|
109
|
+
*
|
|
110
|
+
* Syntax: `[width] [directions] [#from-color] [#to-color]`
|
|
111
|
+
*
|
|
112
|
+
* Multiple groups can be separated by commas to specify different colors per direction.
|
|
113
|
+
*
|
|
114
|
+
* Color tokens (optional):
|
|
115
|
+
* - First color: transparent start of gradient (default: `rgb(0 0 0 / 0)`)
|
|
116
|
+
* - Second color: opaque end of gradient (default: `rgb(0 0 0 / 1)`)
|
|
117
|
+
*
|
|
118
|
+
* Examples:
|
|
119
|
+
* - `fade="top"` // fade only top edge with default width
|
|
120
|
+
* - `fade="2x left right"` // fade left and right edges with 2x width
|
|
121
|
+
* - `fade="1x top"` // fade only top edge with 1x width
|
|
122
|
+
* - `fade="3x 1x top bottom"` // top: 3x width, bottom: 1x width
|
|
123
|
+
* - `fade="2x #transparent #dark"` // custom colors for gradient mask
|
|
124
|
+
* - `fade="1x top #clear #solid"` // top edge with custom mask colors
|
|
125
|
+
* - `fade="top #red #blue, bottom #green #yellow"` // different colors per direction
|
|
126
|
+
* - `fade="2x top #a #b, 1x bottom #c #d"` // different widths and colors per direction
|
|
127
|
+
*/
|
|
128
|
+
fade?: 'top' | 'right' | 'bottom' | 'left' | string;
|
|
129
|
+
/**
|
|
130
|
+
* @deprecated Use `scrollbar` style instead.
|
|
131
|
+
* Whether the element has styled scrollbar.
|
|
132
|
+
*/
|
|
133
|
+
styledScrollbar?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The scrollbar style provides a powerful and flexible way to control the appearance and behavior of scrollbars across browsers. It supports custom sizing, color, visibility, and advanced modifiers for modern UI needs.
|
|
136
|
+
*
|
|
137
|
+
* Syntax: `[modifiers] [size] [color1] [color2] [color3]`
|
|
138
|
+
*
|
|
139
|
+
* Modifiers: `thin`, `none`, `auto`, `stable`, `both-edges`, `always`, `styled`
|
|
140
|
+
*
|
|
141
|
+
* Examples:
|
|
142
|
+
* - `scrollbar={true}` // thin scrollbar, default color
|
|
143
|
+
* - `scrollbar="thin 10px #purple.40 #dark.04"`
|
|
144
|
+
* - `scrollbar="styled 12px #purple.40 #dark.04 #white.10"`
|
|
145
|
+
* - `scrollbar="none"`
|
|
146
|
+
* - `scrollbar="always 8px #primary.50 #white.02"`
|
|
147
|
+
*/
|
|
148
|
+
scrollbar?: string | boolean | number;
|
|
149
|
+
/**
|
|
150
|
+
* Set font weight for bold texts.
|
|
151
|
+
*/
|
|
152
|
+
boldFontWeight?: number;
|
|
153
|
+
/**
|
|
154
|
+
* The gap style is a powerful, cross-layout shorthand for spacing between child elements. Works with flex, grid, and block layouts.
|
|
155
|
+
*
|
|
156
|
+
* For flex/grid: sets native `gap` property
|
|
157
|
+
* For block layouts: emulated using margin on children
|
|
158
|
+
*
|
|
159
|
+
* Examples:
|
|
160
|
+
* - `gap="2x"` // gap: 2x (or margin-bottom: 2x for block)
|
|
161
|
+
* - `gap="1x 2x"` // row gap: 1x, column gap: 2x
|
|
162
|
+
* - `gap={true}` // default gap (1x)
|
|
163
|
+
*/
|
|
164
|
+
gap?: CSSProperties['gap'] | string | boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Shorthand for element padding. Supports custom units, directional modifiers, and design-system-driven defaults.
|
|
167
|
+
*
|
|
168
|
+
* Examples:
|
|
169
|
+
* - `padding="2x 1x"` // top/bottom: 2x, left/right: 1x
|
|
170
|
+
* - `padding="2x top"` // only top padding: 2x
|
|
171
|
+
* - `padding="1x left right"` // left and right padding: 1x
|
|
172
|
+
* - `padding={true}` // default padding on all sides
|
|
173
|
+
*/
|
|
174
|
+
padding?: CSSProperties['padding'] | string | boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Shorthand for element margin. Supports custom units, directional modifiers, and design-system-driven defaults.
|
|
177
|
+
*
|
|
178
|
+
* Examples:
|
|
179
|
+
* - `margin="2x 1x"` // top/bottom: 2x, left/right: 1x
|
|
180
|
+
* - `margin="2x top"` // only top margin: 2x
|
|
181
|
+
* - `margin="1x left right"` // left and right margin: 1x
|
|
182
|
+
* - `margin={true}` // default margin on all sides
|
|
183
|
+
*/
|
|
184
|
+
margin?: CSSProperties['margin'] | string | boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Concise shorthand for setting element width, including min-width and max-width. Supports custom units and advanced sizing keywords.
|
|
187
|
+
*
|
|
188
|
+
* Syntax: `[value]` | `[min max]` | `[min value max]` | `[modifier value]`
|
|
189
|
+
*
|
|
190
|
+
* Modifiers: `min`, `max`
|
|
191
|
+
* Keywords: `stretch`, `max-content`, `min-content`, `fit-content`
|
|
192
|
+
*
|
|
193
|
+
* Examples:
|
|
194
|
+
* - `width="10x"` // width: 10x
|
|
195
|
+
* - `width="1x 10x"` // min-width: 1x; max-width: 10x
|
|
196
|
+
* - `width="min 2x"` // min-width: 2x
|
|
197
|
+
* - `width="stretch"` // width: stretch (fill-available)
|
|
198
|
+
* - `width={true}` // width: auto
|
|
199
|
+
*/
|
|
200
|
+
width?: CSSProperties['width'] | string | boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Concise shorthand for setting element height, including min-height and max-height. Supports custom units and advanced sizing keywords.
|
|
203
|
+
*
|
|
204
|
+
* Syntax: `[value]` | `[min max]` | `[min value max]` | `[modifier value]`
|
|
205
|
+
*
|
|
206
|
+
* Modifiers: `min`, `max`
|
|
207
|
+
* Keywords: `stretch`, `max-content`, `min-content`, `fit-content`
|
|
208
|
+
*
|
|
209
|
+
* Examples:
|
|
210
|
+
* - `height="100px"` // height: 100px
|
|
211
|
+
* - `height="1x 5x 10x"` // min-height: 1x; height: 5x; max-height: 10x
|
|
212
|
+
* - `height="min 2x"` // min-height: 2x
|
|
213
|
+
* - `height={true}` // height: auto
|
|
214
|
+
*/
|
|
215
|
+
height?: CSSProperties['height'] | string | boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Shorthand for border width, style, and color. Supports directional modifiers and design-system defaults.
|
|
218
|
+
*
|
|
219
|
+
* Syntax: `[width] [style] [color] [directions]` | `[directions]` | `true`
|
|
220
|
+
*
|
|
221
|
+
* Multiple groups can be separated by commas. Later groups override earlier groups for conflicting directions.
|
|
222
|
+
*
|
|
223
|
+
* Examples:
|
|
224
|
+
* - `border={true}` // default border on all sides (1bw solid)
|
|
225
|
+
* - `border="2bw dashed #purple"` // 2bw dashed purple border
|
|
226
|
+
* - `border="2bw top"` // only top border: 2bw solid
|
|
227
|
+
* - `border="dotted #danger left right"` // left/right: 1bw dotted danger
|
|
228
|
+
* - `border="1bw #red, 2bw #blue top"` // all sides red 1bw, top overridden to blue 2bw
|
|
229
|
+
* - `border="1bw, dashed top bottom, #purple left right"` // base 1bw, dashed on top/bottom, purple on left/right
|
|
230
|
+
*/
|
|
231
|
+
border?: CSSProperties['border'] | string | boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Powerful shorthand for CSS transitions using semantic names and design tokens. Supports grouped transitions for common UI effects.
|
|
234
|
+
*
|
|
235
|
+
* Semantic names: `fade`, `fill`, `border`, `radius`, `shadow`, `preset`, `gap`, `theme`
|
|
236
|
+
* Multiple transitions: separated by commas
|
|
237
|
+
*
|
|
238
|
+
* Examples:
|
|
239
|
+
* - `transition="fill 0.2s, radius 0.3s"` // transitions background-color and border-radius
|
|
240
|
+
* - `transition="fade 0.15s ease-in"` // transitions mask with easing
|
|
241
|
+
* - `transition="theme 0.3s"` // transitions all theme-related properties
|
|
242
|
+
* - `transition="preset 0.2s"` // transitions typography properties
|
|
243
|
+
*/
|
|
244
|
+
transition?: CSSProperties['transition'] | string;
|
|
245
|
+
/**
|
|
246
|
+
* Whether the element is hidden using `display: none`. Boolean shortcut for conditional element visibility.
|
|
247
|
+
*
|
|
248
|
+
* Examples:
|
|
249
|
+
* - `hide={true}` // display: none
|
|
250
|
+
* - `hide={false}` // element remains visible
|
|
251
|
+
*/
|
|
252
|
+
hide?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* The shadow style adds shadow effects around an element's frame. Supports multiple effects separated by commas with X/Y offsets, blur, spread radius, and color.
|
|
255
|
+
*
|
|
256
|
+
* Examples:
|
|
257
|
+
* - `shadow="1x .5x .5x #dark.50"` // custom shadow with Tasty units and colors
|
|
258
|
+
* - `shadow="0 1x 2x #dark.20"` // standard shadow syntax
|
|
259
|
+
* - `shadow={true}` // default shadow from design system
|
|
260
|
+
*/
|
|
261
|
+
shadow?: string | boolean;
|
|
262
|
+
/**
|
|
263
|
+
* The radius style rounds the corners of an element's outer border edge. Supports custom units, advanced shapes, and directional modifiers.
|
|
264
|
+
*
|
|
265
|
+
* Syntax: `[value] [modifiers]` | `[shape]` | `true`
|
|
266
|
+
*
|
|
267
|
+
* Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric)
|
|
268
|
+
* Directional modifiers: `top`, `right`, `bottom`, `left`
|
|
269
|
+
*
|
|
270
|
+
* Examples:
|
|
271
|
+
* - `radius="2r"` // border-radius: calc(var(--radius) * 2)
|
|
272
|
+
* - `radius={true}` // default radius (1r)
|
|
273
|
+
* - `radius="round"` // fully rounded (9999rem)
|
|
274
|
+
* - `radius="leaf"` // asymmetric leaf shape
|
|
275
|
+
* - `radius="1r top"` // round only top corners
|
|
276
|
+
*/
|
|
277
|
+
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | string | true;
|
|
278
|
+
/**
|
|
279
|
+
* The flow style is a unified shorthand for controlling layout direction and wrapping in both flex and grid containers. Replaces `flexDirection` and `gridAutoFlow`.
|
|
280
|
+
*
|
|
281
|
+
* For flex: sets `flex-flow` (direction + wrapping)
|
|
282
|
+
* For grid: sets `grid-auto-flow` (direction + density)
|
|
283
|
+
* For block: determines gap direction (row/column)
|
|
284
|
+
*
|
|
285
|
+
* Syntax: `[direction] [wrap|dense]`
|
|
286
|
+
*
|
|
287
|
+
* Examples:
|
|
288
|
+
* - `flow="row wrap"` // flex-flow: row wrap
|
|
289
|
+
* - `flow="column dense"` // grid-auto-flow: column dense
|
|
290
|
+
* - `flow="row"` // primary axis direction
|
|
291
|
+
*/
|
|
292
|
+
flow?: CSSProperties['flexFlow'] | CSSProperties['gridAutoFlow'] | string;
|
|
293
|
+
/**
|
|
294
|
+
* The gridAreas style specifies named grid areas, establishing cells in the grid and assigning them names.
|
|
295
|
+
*
|
|
296
|
+
* Examples:
|
|
297
|
+
* - `gridAreas='"header header" "sidebar content" "footer footer"'`
|
|
298
|
+
*/
|
|
299
|
+
gridAreas?: CSSProperties['gridTemplateAreas'];
|
|
300
|
+
/**
|
|
301
|
+
* The gridColumns style defines line names and track sizing functions of grid columns.
|
|
302
|
+
*
|
|
303
|
+
* Examples:
|
|
304
|
+
* - `gridColumns="1fr 2fr 1fr"` // three columns with flex ratios
|
|
305
|
+
* - `gridColumns={3}` // three equal columns (shorthand)
|
|
306
|
+
* - `gridColumns="repeat(auto-fit, minmax(200px, 1fr))"` // responsive columns
|
|
307
|
+
*/
|
|
308
|
+
gridColumns?: CSSProperties['gridTemplateColumns'] | number;
|
|
309
|
+
/**
|
|
310
|
+
* The gridRows style defines line names and track sizing functions of grid rows.
|
|
311
|
+
*
|
|
312
|
+
* Examples:
|
|
313
|
+
* - `gridRows="auto 1fr auto"` // header, content, footer layout
|
|
314
|
+
* - `gridRows={4}` // four equal rows (shorthand)
|
|
315
|
+
* - `gridRows="repeat(3, 100px)"` // three 100px rows
|
|
316
|
+
*/
|
|
317
|
+
gridRows?: CSSProperties['gridTemplateRows'] | number;
|
|
318
|
+
/**
|
|
319
|
+
* The gridTemplate style is a shorthand property for defining grid columns, rows, and areas simultaneously.
|
|
320
|
+
*
|
|
321
|
+
* Examples:
|
|
322
|
+
* - `gridTemplate='"header header" auto "content sidebar" 1fr / 2fr 1fr'`
|
|
323
|
+
*/
|
|
324
|
+
gridTemplate?: CSSProperties['gridTemplate'];
|
|
325
|
+
/**
|
|
326
|
+
* The font style specifies a prioritized list of font family names with design-system-driven defaults and fallbacks.
|
|
327
|
+
*
|
|
328
|
+
* Examples:
|
|
329
|
+
* - `font="monospace"` // monospace font stack
|
|
330
|
+
* - `font="Helvetica, Arial, sans-serif"` // custom font list
|
|
331
|
+
* - `font={true}` // default design system font
|
|
332
|
+
*/
|
|
333
|
+
font?: CSSProperties['fontFamily'] | boolean;
|
|
334
|
+
/**
|
|
335
|
+
* The outline style sets the outline for the element.
|
|
336
|
+
*
|
|
337
|
+
* Syntax: `[width] [style] [color] / [offset]` | `true`
|
|
338
|
+
*
|
|
339
|
+
* Examples:
|
|
340
|
+
* - `outline="2ow dashed #purple"` // 2ow dashed purple outline
|
|
341
|
+
* - `outline="2ow #danger / 1x"` // 2ow solid danger outline, 1x offset
|
|
342
|
+
* - `outline={true}` // default outline (1ow solid)
|
|
343
|
+
*/
|
|
344
|
+
outline?: string | boolean;
|
|
345
|
+
/**
|
|
346
|
+
* The outline offset style sets the offset of the outline.
|
|
347
|
+
*
|
|
348
|
+
* Examples:
|
|
349
|
+
* - `outlineOffset="4px"` // 4px offset
|
|
350
|
+
* - `outlineOffset="1x"` // 1x (8px) offset
|
|
351
|
+
*/
|
|
352
|
+
outlineOffset?: string | number;
|
|
353
|
+
/**
|
|
354
|
+
* The preset style sets base text settings according to named presets. Affects `font-size`, `line-height`, `letter-spacing`, `font-weight`, and `text-transform`.
|
|
355
|
+
*
|
|
356
|
+
* Preset names are project-specific. Augment `TastyPresetNames` to register them for autocomplete.
|
|
357
|
+
*
|
|
358
|
+
* Examples:
|
|
359
|
+
* - `preset="h1"` // heading 1 typography
|
|
360
|
+
* - `preset="h2 strong"` // bold heading 2
|
|
361
|
+
* - `preset="t3"` // text size 3
|
|
362
|
+
*/
|
|
363
|
+
preset?: PresetName | (string & {});
|
|
364
|
+
/**
|
|
365
|
+
* Shorthand for `align-items` and `align-content`. Sets both properties for unified vertical alignment in flex/grid layouts.
|
|
366
|
+
*
|
|
367
|
+
* Examples:
|
|
368
|
+
* - `align="center"` // align-items: center; align-content: center
|
|
369
|
+
* - `align="flex-start"` // align both to start
|
|
370
|
+
* - `align="space-between"` // distribute space between items
|
|
371
|
+
*/
|
|
372
|
+
align?: CSSProperties['alignItems'] | CSSProperties['alignContent'];
|
|
373
|
+
/**
|
|
374
|
+
* Shorthand for `justify-items` and `justify-content`. Sets both properties for unified horizontal alignment in flex/grid layouts.
|
|
375
|
+
*
|
|
376
|
+
* Examples:
|
|
377
|
+
* - `justify="center"` // justify-items: center; justify-content: center
|
|
378
|
+
* - `justify="space-between"` // distribute space between items
|
|
379
|
+
* - `justify="flex-end"` // align both to end
|
|
380
|
+
*/
|
|
381
|
+
justify?: CSSProperties['justifyItems'] | CSSProperties['justifyContent'];
|
|
382
|
+
/**
|
|
383
|
+
* Shorthand for `place-items` and `place-content`. Sets both properties for unified alignment of both axes in grid/flex layouts.
|
|
384
|
+
*
|
|
385
|
+
* Examples:
|
|
386
|
+
* - `place="center"` // place-items: center; place-content: center
|
|
387
|
+
* - `place="start end"` // place-items: start; place-content: end
|
|
388
|
+
* - `place="stretch"` // place both to stretch
|
|
389
|
+
*/
|
|
390
|
+
place?: CSSProperties['placeItems'] | CSSProperties['placeContent'] | string;
|
|
391
|
+
/**
|
|
392
|
+
* Sets `place-content` property for aligning and distributing content in grid/flex containers.
|
|
393
|
+
*
|
|
394
|
+
* Examples:
|
|
395
|
+
* - `placeContent="center"` // center content in both axes
|
|
396
|
+
* - `placeContent="space-between"` // distribute content with space between
|
|
397
|
+
*/
|
|
398
|
+
placeContent?: CSSProperties['placeContent'];
|
|
399
|
+
/**
|
|
400
|
+
* Sets `place-items` property for aligning items in grid/flex containers.
|
|
401
|
+
*
|
|
402
|
+
* Examples:
|
|
403
|
+
* - `placeItems="center"` // center items in both axes
|
|
404
|
+
* - `placeItems="start end"` // start on block axis, end on inline axis
|
|
405
|
+
*/
|
|
406
|
+
placeItems?: CSSProperties['placeItems'];
|
|
407
|
+
/**
|
|
408
|
+
* Shorthand for `top`, `right`, `bottom`, and `left` offsets. Supports custom units, directional modifiers, and positioning.
|
|
409
|
+
*
|
|
410
|
+
* Examples:
|
|
411
|
+
* - `inset="0"` // all sides: 0
|
|
412
|
+
* - `inset="2x top"` // only top offset: 2x
|
|
413
|
+
* - `inset="1x left right"` // left and right offsets: 1x
|
|
414
|
+
* - `inset={true}` // all sides: 0
|
|
415
|
+
*/
|
|
416
|
+
inset?: 'top' | 'right' | 'bottom' | 'left' | string | CSSProperties['inset'];
|
|
417
|
+
/**
|
|
418
|
+
* Local keyframes definitions for this component.
|
|
419
|
+
* Keys are animation names, values are keyframes step definitions.
|
|
420
|
+
* Local keyframes override global keyframes with the same name.
|
|
421
|
+
*
|
|
422
|
+
* Examples:
|
|
423
|
+
* - `'@keyframes': { fadeIn: { from: { opacity: 0 }, to: { opacity: 1 } } }`
|
|
424
|
+
* - `'@keyframes': { pulse: { '0%, 100%': { transform: 'scale(1)' }, '50%': { transform: 'scale(1.05)' } } }`
|
|
425
|
+
*/
|
|
426
|
+
'@keyframes'?: Record<string, KeyframesSteps>;
|
|
427
|
+
/**
|
|
428
|
+
* CSS @property definitions for custom properties using tasty token syntax.
|
|
429
|
+
* Properties are registered once and are permanent (never removed).
|
|
430
|
+
*
|
|
431
|
+
* Token formats:
|
|
432
|
+
* - `$name` for regular properties → `--name` (requires syntax to be specified)
|
|
433
|
+
* - `#name` for color properties → `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
|
|
434
|
+
*
|
|
435
|
+
* Examples:
|
|
436
|
+
* - `'@properties': { '$rotation': { syntax: '<angle>', inherits: false, initialValue: '45deg' } }`
|
|
437
|
+
* - `'@properties': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
|
|
438
|
+
*/
|
|
439
|
+
'@properties'?: Record<string, PropertyDefinition>;
|
|
440
|
+
/**
|
|
441
|
+
* Apply one or more predefined style recipes by name.
|
|
442
|
+
* Recipes are defined globally via `configure({ recipes: { ... } })`.
|
|
443
|
+
* Multiple recipes are space-separated. Use `|` to separate base recipes
|
|
444
|
+
* (applied before component styles) from post recipes (applied after, via mergeStyles).
|
|
445
|
+
*
|
|
446
|
+
* Examples:
|
|
447
|
+
* - `recipe: 'card'` // Apply the 'card' recipe
|
|
448
|
+
* - `recipe: 'card elevated'` // Apply 'card' then 'elevated', then component styles
|
|
449
|
+
* - `recipe: 'reset input | input-autofill'` // Base recipes, then post recipe
|
|
450
|
+
* - `recipe: ''` // Clear recipes from base styles when extending
|
|
451
|
+
*/
|
|
452
|
+
recipe?: string;
|
|
453
|
+
}
|
|
454
|
+
/** Special style keys that should not be wrapped in StyleValue/StyleValueStateMap */
|
|
455
|
+
type SpecialStyleKeys = '@keyframes' | '@properties' | 'recipe';
|
|
456
|
+
type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> };
|
|
457
|
+
/**
|
|
458
|
+
* Index signature for recipe-specific arbitrary keys.
|
|
459
|
+
* Supports local predefined states (`@name`), vendor-prefixed CSS properties (`-webkit-*`),
|
|
460
|
+
* CSS custom properties (`$name`), and color tokens (`#name`).
|
|
461
|
+
* Unlike StylesIndexSignature, does NOT allow sub-element selectors (recipes are flat).
|
|
462
|
+
*/
|
|
463
|
+
type RecipeIndexSignature = Record<string, StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined>>;
|
|
464
|
+
/**
|
|
465
|
+
* Style type for recipe definitions.
|
|
466
|
+
* Like StylesWithoutSelectors but also allows `@keyframes`, `@properties`,
|
|
467
|
+
* local predefined states, and vendor-prefixed CSS properties.
|
|
468
|
+
* Excludes `recipe` to prevent recursive references.
|
|
469
|
+
*/
|
|
470
|
+
type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
|
|
471
|
+
'@keyframes'?: StylesInterface['@keyframes'];
|
|
472
|
+
'@properties'?: StylesInterface['@properties'];
|
|
473
|
+
};
|
|
474
|
+
/** Special properties that are not regular style values */
|
|
475
|
+
interface SpecialStyleProperties {
|
|
476
|
+
'@keyframes'?: StylesInterface['@keyframes'];
|
|
477
|
+
'@properties'?: StylesInterface['@properties'];
|
|
478
|
+
recipe?: StylesInterface['recipe'];
|
|
479
|
+
}
|
|
480
|
+
/** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
|
|
481
|
+
interface StylesIndexSignature {
|
|
482
|
+
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@properties'];
|
|
483
|
+
/**
|
|
484
|
+
* Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
|
|
485
|
+
* Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
|
|
486
|
+
*/
|
|
487
|
+
$?: string;
|
|
488
|
+
}
|
|
489
|
+
type Styles = StylesWithoutSelectors & SpecialStyleProperties & StylesIndexSignature;
|
|
490
|
+
//#endregion
|
|
491
|
+
export { RecipeStyles, Styles };
|
|
492
|
+
//# sourceMappingURL=types.d.mts.map
|