@tenphi/tasty 0.0.0-snapshot.fafcbfe → 0.0.0-snapshot.ffe00e9
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 +315 -159
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/chunks/cacheKey.d.ts +1 -0
- package/dist/chunks/cacheKey.js +17 -10
- package/dist/chunks/cacheKey.js.map +1 -1
- package/dist/chunks/definitions.d.ts +1 -1
- package/dist/chunks/definitions.js +3 -5
- package/dist/chunks/definitions.js.map +1 -1
- package/dist/chunks/index.d.ts +1 -0
- package/dist/chunks/renderChunk.d.ts +1 -0
- package/dist/chunks/renderChunk.js +32 -34
- package/dist/chunks/renderChunk.js.map +1 -1
- package/dist/compute-styles.d.ts +31 -0
- package/dist/compute-styles.js +357 -0
- package/dist/compute-styles.js.map +1 -0
- package/dist/config.d.ts +116 -30
- package/dist/config.js +144 -45
- package/dist/config.js.map +1 -1
- package/dist/core/index.d.ts +12 -11
- package/dist/core/index.js +11 -10
- package/dist/counter-style/index.js +51 -0
- package/dist/counter-style/index.js.map +1 -0
- package/dist/debug.d.ts +26 -141
- package/dist/debug.js +357 -637
- package/dist/debug.js.map +1 -1
- package/dist/font-face/index.js +63 -0
- package/dist/font-face/index.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useCounterStyle.d.ts +50 -0
- package/dist/hooks/useCounterStyle.js +45 -0
- package/dist/hooks/useCounterStyle.js.map +1 -0
- package/dist/hooks/useFontFace.d.ts +43 -0
- package/dist/hooks/useFontFace.js +69 -0
- package/dist/hooks/useFontFace.js.map +1 -0
- package/dist/hooks/useGlobalStyles.d.ts +3 -0
- package/dist/hooks/useGlobalStyles.js +23 -2
- package/dist/hooks/useGlobalStyles.js.map +1 -1
- package/dist/hooks/useKeyframes.js +13 -4
- package/dist/hooks/useKeyframes.js.map +1 -1
- package/dist/hooks/useProperty.js +31 -14
- package/dist/hooks/useProperty.js.map +1 -1
- package/dist/hooks/useRawCSS.js +8 -2
- package/dist/hooks/useRawCSS.js.map +1 -1
- package/dist/hooks/useStyles.d.ts +4 -4
- package/dist/hooks/useStyles.js +7 -147
- package/dist/hooks/useStyles.js.map +1 -1
- package/dist/index.d.ts +23 -12
- package/dist/index.js +14 -11
- package/dist/injector/index.d.ts +41 -11
- package/dist/injector/index.js +48 -11
- package/dist/injector/index.js.map +1 -1
- package/dist/injector/injector.d.ts +58 -3
- package/dist/injector/injector.js +204 -41
- package/dist/injector/injector.js.map +1 -1
- package/dist/injector/sheet-manager.d.ts +18 -17
- package/dist/injector/sheet-manager.js +45 -73
- package/dist/injector/sheet-manager.js.map +1 -1
- package/dist/injector/types.d.ts +119 -19
- package/dist/keyframes/index.js +1 -1
- package/dist/parser/classify.js +6 -6
- package/dist/parser/classify.js.map +1 -1
- package/dist/parser/const.js +30 -3
- package/dist/parser/const.js.map +1 -1
- package/dist/parser/lru.js +1 -1
- package/dist/parser/lru.js.map +1 -1
- package/dist/parser/parser.js +2 -3
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/tokenizer.js +1 -1
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/parser/types.js +1 -1
- package/dist/parser/types.js.map +1 -1
- package/dist/pipeline/conditions.js +15 -9
- package/dist/pipeline/conditions.js.map +1 -1
- package/dist/pipeline/exclusive.js +1 -2
- package/dist/pipeline/exclusive.js.map +1 -1
- package/dist/pipeline/index.d.ts +3 -1
- package/dist/pipeline/index.js +139 -72
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/materialize.js +405 -210
- package/dist/pipeline/materialize.js.map +1 -1
- package/dist/pipeline/parseStateKey.d.ts +1 -1
- package/dist/pipeline/parseStateKey.js +38 -22
- package/dist/pipeline/parseStateKey.js.map +1 -1
- package/dist/pipeline/simplify.js +112 -154
- package/dist/pipeline/simplify.js.map +1 -1
- package/dist/pipeline/warnings.js +18 -0
- package/dist/pipeline/warnings.js.map +1 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/okhsl-plugin.js +3 -277
- package/dist/plugins/okhsl-plugin.js.map +1 -1
- package/dist/plugins/types.d.ts +9 -2
- package/dist/properties/index.js +83 -19
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/property-type-resolver.d.ts +24 -0
- package/dist/properties/property-type-resolver.js +90 -0
- package/dist/properties/property-type-resolver.js.map +1 -0
- package/dist/ssr/astro.d.ts +29 -0
- package/dist/ssr/astro.js +64 -0
- package/dist/ssr/astro.js.map +1 -0
- package/dist/ssr/async-storage.d.ts +17 -0
- package/dist/ssr/async-storage.js +34 -0
- package/dist/ssr/async-storage.js.map +1 -0
- package/dist/ssr/collect-auto-properties.js +39 -0
- package/dist/ssr/collect-auto-properties.js.map +1 -0
- package/dist/ssr/collector.d.ts +102 -0
- package/dist/ssr/collector.js +219 -0
- package/dist/ssr/collector.js.map +1 -0
- package/dist/ssr/format-global-rules.js +22 -0
- package/dist/ssr/format-global-rules.js.map +1 -0
- package/dist/ssr/format-keyframes.js +69 -0
- package/dist/ssr/format-keyframes.js.map +1 -0
- package/dist/ssr/format-property.js +49 -0
- package/dist/ssr/format-property.js.map +1 -0
- package/dist/ssr/format-rules.js +73 -0
- package/dist/ssr/format-rules.js.map +1 -0
- package/dist/ssr/hydrate.d.ts +22 -0
- package/dist/ssr/hydrate.js +49 -0
- package/dist/ssr/hydrate.js.map +1 -0
- package/dist/ssr/index.d.ts +4 -0
- package/dist/ssr/index.js +10 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/next.d.ts +43 -0
- package/dist/ssr/next.js +74 -0
- package/dist/ssr/next.js.map +1 -0
- package/dist/ssr/ssr-collector-ref.js +12 -0
- package/dist/ssr/ssr-collector-ref.js.map +1 -0
- package/dist/states/index.js +13 -259
- package/dist/states/index.js.map +1 -1
- package/dist/static/index.js +1 -2
- package/dist/static/inject.d.ts +5 -0
- package/dist/static/inject.js +17 -0
- package/dist/static/inject.js.map +1 -0
- package/dist/static/tastyStatic.js +1 -2
- package/dist/static/tastyStatic.js.map +1 -1
- package/dist/static/types.js +1 -1
- package/dist/styles/border.d.ts +2 -2
- package/dist/styles/border.js +30 -24
- package/dist/styles/border.js.map +1 -1
- package/dist/styles/color.d.ts +3 -3
- package/dist/styles/color.js +11 -8
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/const.js +17 -0
- package/dist/styles/const.js.map +1 -0
- package/dist/styles/createStyle.js +29 -27
- package/dist/styles/createStyle.js.map +1 -1
- package/dist/styles/dimension.js +15 -3
- package/dist/styles/dimension.js.map +1 -1
- package/dist/styles/directional.js +133 -0
- package/dist/styles/directional.js.map +1 -0
- package/dist/styles/display.d.ts +3 -10
- package/dist/styles/display.js +45 -39
- package/dist/styles/display.js.map +1 -1
- package/dist/styles/fade.d.ts +2 -2
- package/dist/styles/fade.js +9 -5
- package/dist/styles/fade.js.map +1 -1
- package/dist/styles/fill.d.ts +15 -17
- package/dist/styles/fill.js +9 -9
- package/dist/styles/fill.js.map +1 -1
- package/dist/styles/flow.d.ts +3 -3
- package/dist/styles/flow.js +1 -1
- package/dist/styles/flow.js.map +1 -1
- package/dist/styles/gap.d.ts +1 -1
- package/dist/styles/gap.js +4 -3
- package/dist/styles/gap.js.map +1 -1
- package/dist/styles/height.d.ts +1 -1
- package/dist/styles/height.js +1 -2
- package/dist/styles/height.js.map +1 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +3 -4
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/inset.d.ts +1 -29
- package/dist/styles/inset.js +19 -135
- package/dist/styles/inset.js.map +1 -1
- package/dist/styles/list.d.ts +5 -5
- package/dist/styles/list.js +4 -2
- package/dist/styles/list.js.map +1 -1
- package/dist/styles/margin.d.ts +1 -1
- package/dist/styles/margin.js +17 -89
- package/dist/styles/margin.js.map +1 -1
- package/dist/styles/outline.d.ts +1 -1
- package/dist/styles/outline.js +6 -16
- package/dist/styles/outline.js.map +1 -1
- package/dist/styles/padding.d.ts +1 -1
- package/dist/styles/padding.js +17 -89
- package/dist/styles/padding.js.map +1 -1
- package/dist/styles/placement.d.ts +37 -0
- package/dist/styles/placement.js +74 -0
- package/dist/styles/placement.js.map +1 -0
- package/dist/styles/predefined.d.ts +4 -6
- package/dist/styles/predefined.js +9 -13
- package/dist/styles/predefined.js.map +1 -1
- package/dist/styles/preset.d.ts +6 -1
- package/dist/styles/preset.js +54 -53
- package/dist/styles/preset.js.map +1 -1
- package/dist/styles/radius.d.ts +2 -4
- package/dist/styles/radius.js +38 -6
- package/dist/styles/radius.js.map +1 -1
- package/dist/styles/scrollMargin.d.ts +24 -0
- package/dist/styles/scrollMargin.js +32 -0
- package/dist/styles/scrollMargin.js.map +1 -0
- package/dist/styles/scrollbar.d.ts +9 -5
- package/dist/styles/scrollbar.js +31 -85
- package/dist/styles/scrollbar.js.map +1 -1
- package/dist/styles/shadow.d.ts +3 -3
- package/dist/styles/shadow.js +4 -3
- package/dist/styles/shadow.js.map +1 -1
- package/dist/styles/shared.js +17 -0
- package/dist/styles/shared.js.map +1 -0
- package/dist/styles/transition.d.ts +2 -2
- package/dist/styles/transition.js +6 -5
- package/dist/styles/transition.js.map +1 -1
- package/dist/styles/types.d.ts +94 -28
- package/dist/styles/width.d.ts +1 -1
- package/dist/styles/width.js +1 -2
- package/dist/styles/width.js.map +1 -1
- package/dist/tasty.d.ts +46 -894
- package/dist/tasty.js +112 -60
- package/dist/tasty.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/utils/cache-wrapper.js +4 -9
- package/dist/utils/cache-wrapper.js.map +1 -1
- package/dist/utils/case-converter.js +1 -1
- package/dist/utils/color-math.d.ts +46 -0
- package/dist/utils/color-math.js +749 -0
- package/dist/utils/color-math.js.map +1 -0
- package/dist/utils/color-space.d.ts +5 -0
- package/dist/utils/color-space.js +228 -0
- package/dist/utils/color-space.js.map +1 -0
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/colors.js +3 -2
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/css-types.d.ts +1 -1
- package/dist/utils/dotize.d.ts +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/dotize.js.map +1 -1
- package/dist/utils/filter-base-props.js +1 -1
- package/dist/utils/get-display-name.js +1 -1
- package/dist/utils/has-keys.js +13 -0
- package/dist/utils/has-keys.js.map +1 -0
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/is-dev-env.js.map +1 -1
- package/dist/utils/is-valid-element-type.js +1 -1
- package/dist/utils/merge-styles.js +1 -2
- package/dist/utils/merge-styles.js.map +1 -1
- package/dist/utils/mod-attrs.d.ts +0 -2
- package/dist/utils/mod-attrs.js +3 -4
- package/dist/utils/mod-attrs.js.map +1 -1
- package/dist/utils/process-tokens.d.ts +3 -17
- package/dist/utils/process-tokens.js +19 -107
- package/dist/utils/process-tokens.js.map +1 -1
- package/dist/utils/resolve-recipes.js +1 -2
- package/dist/utils/resolve-recipes.js.map +1 -1
- package/dist/utils/selector-transform.js +32 -0
- package/dist/utils/selector-transform.js.map +1 -0
- package/dist/utils/string.js +1 -1
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/styles.d.ts +5 -89
- package/dist/utils/styles.js +35 -400
- package/dist/utils/styles.js.map +1 -1
- package/dist/utils/typography.d.ts +24 -13
- package/dist/utils/typography.js +15 -17
- package/dist/utils/typography.js.map +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/zero/babel.d.ts +84 -10
- package/dist/zero/babel.js +193 -37
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/css-writer.js +1 -2
- package/dist/zero/css-writer.js.map +1 -1
- package/dist/zero/extractor.js +119 -3
- package/dist/zero/extractor.js.map +1 -1
- package/dist/zero/index.js +1 -2
- package/dist/zero/next.d.ts +56 -30
- package/dist/zero/next.js +105 -40
- package/dist/zero/next.js.map +1 -1
- package/docs/PIPELINE.md +519 -0
- package/docs/README.md +31 -0
- package/docs/adoption.md +296 -0
- package/docs/comparison.md +420 -0
- package/docs/configuration.md +326 -0
- package/docs/debug.md +318 -0
- package/docs/design-system.md +424 -0
- package/docs/dsl.md +673 -0
- package/docs/getting-started.md +217 -0
- package/docs/injector.md +543 -0
- package/docs/methodology.md +616 -0
- package/docs/runtime.md +572 -0
- package/docs/ssr.md +354 -0
- package/docs/styles.md +596 -0
- package/docs/tasty-static.md +520 -0
- package/package.json +106 -31
- package/dist/styles/align.d.ts +0 -15
- package/dist/styles/align.js +0 -14
- package/dist/styles/align.js.map +0 -1
- package/dist/styles/justify.d.ts +0 -15
- package/dist/styles/justify.js +0 -14
- package/dist/styles/justify.js.map +0 -1
- package/dist/styles/styledScrollbar.d.ts +0 -47
- package/dist/styles/styledScrollbar.js +0 -38
- package/dist/styles/styledScrollbar.js.map +0 -1
- package/dist/tokens/typography.d.ts +0 -19
- package/dist/tokens/typography.js +0 -237
- package/dist/tokens/typography.js.map +0 -1
- package/dist/utils/hsl-to-rgb.js +0 -38
- package/dist/utils/hsl-to-rgb.js.map +0 -1
- package/dist/utils/okhsl-to-rgb.js +0 -296
- package/dist/utils/okhsl-to-rgb.js.map +0 -1
package/dist/styles/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyframesSteps, PropertyDefinition } from "../injector/types.js";
|
|
1
|
+
import { CounterStyleDescriptors, FontFaceInput, KeyframesSteps, PropertyDefinition } from "../injector/types.js";
|
|
2
2
|
import { CSSProperties } from "../utils/css-types.js";
|
|
3
3
|
import { StyleValue, StyleValueStateMap } from "../utils/styles.js";
|
|
4
4
|
|
|
@@ -40,8 +40,9 @@ type PresetNameKey = Extract<keyof TastyPresetNames, string>;
|
|
|
40
40
|
type PresetName = [PresetNameKey] extends [never] ? string : PresetNameKey;
|
|
41
41
|
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
42
42
|
type OpaquePercentage = '' | `.${Digit}` | `.${Digit}${Digit}` | '.100';
|
|
43
|
+
type ColorValue = `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `hsl(${string})` | `okhsl(${string})` | `oklch(${string})` | (string & {});
|
|
43
44
|
type NoType = false | null | undefined;
|
|
44
|
-
interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'border' | 'transition' | 'placeContent' | 'placeItems'> {
|
|
45
|
+
interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'border' | 'transition' | 'placeContent' | 'placeItems' | 'scrollMargin' | 'scrollMarginTop' | 'scrollMarginRight' | 'scrollMarginBottom' | 'scrollMarginLeft' | 'scrollMarginBlock' | 'scrollMarginInline'> {
|
|
45
46
|
/**
|
|
46
47
|
* @deprecated Use `flow` style instead.
|
|
47
48
|
*/
|
|
@@ -57,13 +58,20 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
57
58
|
/**
|
|
58
59
|
* Set the background color of the element. Shortcut for `background-color` with enhanced support for Tasty color tokens and syntaxes.
|
|
59
60
|
*
|
|
61
|
+
* Supports double-color syntax: the second color is applied as a foreground overlay via a CSS custom property.
|
|
62
|
+
*
|
|
60
63
|
* Examples:
|
|
61
64
|
* - `fill="#purple.10"` // purple background with 10% opacity
|
|
62
65
|
* - `fill="#danger"` // danger theme color
|
|
63
66
|
* - `fill="rgb(255 128 0)"` // custom RGB color
|
|
67
|
+
* - `fill="rgb(255 128 0 / 0.5)"` // RGB with opacity
|
|
68
|
+
* - `fill="hsl(200 100% 50%)"` // HSL color
|
|
69
|
+
* - `fill="okhsl(200 100% 50%)"` // perceptually uniform OKHSL color
|
|
70
|
+
* - `fill="oklch(0.7 0.15 200)"` // OKLCH color
|
|
71
|
+
* - `fill="#primary #secondary"` // double color (second as foreground overlay)
|
|
64
72
|
* - `fill={true}` // default fill color
|
|
65
73
|
*/
|
|
66
|
-
fill?:
|
|
74
|
+
fill?: ColorValue | boolean;
|
|
67
75
|
/**
|
|
68
76
|
* @deprecated Use `fill` instead.
|
|
69
77
|
*/
|
|
@@ -92,19 +100,26 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
92
100
|
* - `svgFill="#purple.10"` // purple fill with 10% opacity
|
|
93
101
|
* - `svgFill="#danger"` // danger theme color
|
|
94
102
|
* - `svgFill="rgb(255 128 0)"` // custom RGB color
|
|
103
|
+
* - `svgFill="hsl(200 100% 50%)"` // HSL color
|
|
104
|
+
* - `svgFill="okhsl(200 100% 50%)"` // OKHSL color
|
|
105
|
+
* - `svgFill="oklch(0.7 0.15 200)"` // OKLCH color
|
|
95
106
|
* - `svgFill="currentColor"` // inherit from parent color
|
|
96
107
|
*/
|
|
97
|
-
svgFill?:
|
|
108
|
+
svgFill?: ColorValue;
|
|
98
109
|
/**
|
|
99
110
|
* Set the text (current) color of the element. Shortcut for `color` with enhanced support for Tasty color tokens and syntaxes.
|
|
100
111
|
*
|
|
101
112
|
* Examples:
|
|
102
113
|
* - `color="#purple"` // purple text color
|
|
103
114
|
* - `color="#danger.6"` // danger color with 60% opacity
|
|
115
|
+
* - `color="rgb(255 128 0)"` // custom RGB color
|
|
116
|
+
* - `color="hsl(200 100% 50%)"` // HSL color
|
|
117
|
+
* - `color="okhsl(200 100% 50%)"` // OKHSL color
|
|
118
|
+
* - `color="oklch(0.7 0.15 200)"` // OKLCH color
|
|
104
119
|
* - `color="red"` // CSS color name
|
|
105
120
|
* - `color={true}` // currentColor
|
|
106
121
|
*/
|
|
107
|
-
color?:
|
|
122
|
+
color?: ColorValue | boolean;
|
|
108
123
|
/**
|
|
109
124
|
* The fade style applies gradient-based fading masks to the edges of an element. Replaces complex CSS mask gradients with a simple, declarative API.
|
|
110
125
|
*
|
|
@@ -128,25 +143,22 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
128
143
|
*/
|
|
129
144
|
fade?: 'top' | 'right' | 'bottom' | 'left' | string;
|
|
130
145
|
/**
|
|
131
|
-
*
|
|
132
|
-
* Whether the element has styled scrollbar.
|
|
133
|
-
*/
|
|
134
|
-
styledScrollbar?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* 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.
|
|
146
|
+
* Scrollbar styling using standard CSS properties (`scrollbar-width`, `scrollbar-color`, `scrollbar-gutter`).
|
|
137
147
|
*
|
|
138
|
-
* Syntax: `[
|
|
148
|
+
* Syntax: `[width] [modifiers...] [thumb-color] [track-color]`
|
|
139
149
|
*
|
|
140
|
-
*
|
|
150
|
+
* Width values: `thin` (default), `auto`, `none`
|
|
151
|
+
* Modifiers: `stable`, `both-edges`, `always`
|
|
141
152
|
*
|
|
142
153
|
* Examples:
|
|
143
|
-
* - `scrollbar={true}` // thin scrollbar, default
|
|
144
|
-
* - `scrollbar="thin
|
|
145
|
-
* - `scrollbar="
|
|
154
|
+
* - `scrollbar={true}` // thin scrollbar, default colors
|
|
155
|
+
* - `scrollbar="thin #purple.40 #dark.04"`
|
|
156
|
+
* - `scrollbar="auto #red #blue"`
|
|
146
157
|
* - `scrollbar="none"`
|
|
147
|
-
* - `scrollbar="always
|
|
158
|
+
* - `scrollbar="always #primary.50 #white.02"`
|
|
159
|
+
* - `scrollbar="thin stable #red #blue"`
|
|
148
160
|
*/
|
|
149
|
-
scrollbar?: string | boolean
|
|
161
|
+
scrollbar?: string | boolean;
|
|
150
162
|
/**
|
|
151
163
|
* Set font weight for bold texts.
|
|
152
164
|
*/
|
|
@@ -265,7 +277,7 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
265
277
|
*
|
|
266
278
|
* Syntax: `[value] [modifiers]` | `[shape]` | `true`
|
|
267
279
|
*
|
|
268
|
-
* Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric)
|
|
280
|
+
* Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric), `inherit` (inherit from parent)
|
|
269
281
|
* Directional modifiers: `top`, `right`, `bottom`, `left`
|
|
270
282
|
*
|
|
271
283
|
* Examples:
|
|
@@ -274,8 +286,10 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
274
286
|
* - `radius="round"` // fully rounded (9999rem)
|
|
275
287
|
* - `radius="leaf"` // asymmetric leaf shape
|
|
276
288
|
* - `radius="1r top"` // round only top corners
|
|
289
|
+
* - `radius="inherit"` // inherit border-radius from parent
|
|
290
|
+
* - `radius="inherit right"` // inherit only right corners (uses longhand properties)
|
|
277
291
|
*/
|
|
278
|
-
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | string | true;
|
|
292
|
+
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | 'inherit' | string | true;
|
|
279
293
|
/**
|
|
280
294
|
* The flow style is a unified shorthand for controlling layout direction and wrapping in both flex and grid containers. Replaces `flexDirection` and `gridAutoFlow`.
|
|
281
295
|
*
|
|
@@ -354,11 +368,13 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
354
368
|
/**
|
|
355
369
|
* The preset style sets base text settings according to named presets. Affects `font-size`, `line-height`, `letter-spacing`, `font-weight`, and `text-transform`.
|
|
356
370
|
*
|
|
371
|
+
* Syntax: `name`, `name / modifier`, or `modifier` (shorthand, name defaults to `inherit`).
|
|
357
372
|
* Preset names are project-specific. Augment `TastyPresetNames` to register them for autocomplete.
|
|
358
373
|
*
|
|
359
374
|
* Examples:
|
|
360
375
|
* - `preset="h1"` // heading 1 typography
|
|
361
|
-
* - `preset="h2 strong"` // bold heading 2
|
|
376
|
+
* - `preset="h2 / strong"` // bold heading 2
|
|
377
|
+
* - `preset="bold"` // inherit with bold (shorthand)
|
|
362
378
|
* - `preset="t3"` // text size 3
|
|
363
379
|
*/
|
|
364
380
|
preset?: PresetName | (string & {});
|
|
@@ -381,12 +397,12 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
381
397
|
*/
|
|
382
398
|
justify?: CSSProperties['justifyItems'] | CSSProperties['justifyContent'];
|
|
383
399
|
/**
|
|
384
|
-
* Shorthand for
|
|
400
|
+
* Shorthand for all placement properties. Sets all 4 longhands: align-items, justify-items, align-content, justify-content.
|
|
385
401
|
*
|
|
386
402
|
* Examples:
|
|
387
|
-
* - `place="center"` //
|
|
388
|
-
* - `place="start end"` //
|
|
389
|
-
* - `place="stretch"` //
|
|
403
|
+
* - `place="center"` // all 4 longhands: center
|
|
404
|
+
* - `place="start end"` // align-*: start; justify-*: end
|
|
405
|
+
* - `place="stretch"` // all 4 longhands: stretch
|
|
390
406
|
*/
|
|
391
407
|
place?: CSSProperties['placeItems'] | CSSProperties['placeContent'] | string;
|
|
392
408
|
/**
|
|
@@ -405,6 +421,21 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
405
421
|
* - `placeItems="start end"` // start on block axis, end on inline axis
|
|
406
422
|
*/
|
|
407
423
|
placeItems?: CSSProperties['placeItems'];
|
|
424
|
+
/**
|
|
425
|
+
* Shorthand for scroll-margin on all sides. Supports custom units and directional modifiers.
|
|
426
|
+
*
|
|
427
|
+
* Examples:
|
|
428
|
+
* - `scrollMargin="2x"` // scroll-margin on all sides: 2x
|
|
429
|
+
* - `scrollMargin="2x top"` // only top scroll-margin: 2x
|
|
430
|
+
* - `scrollMargin={true}` // default scroll-margin on all sides
|
|
431
|
+
*/
|
|
432
|
+
scrollMargin?: CSSProperties['scrollMargin'] | string | boolean;
|
|
433
|
+
scrollMarginTop?: string | number | boolean;
|
|
434
|
+
scrollMarginRight?: string | number | boolean;
|
|
435
|
+
scrollMarginBottom?: string | number | boolean;
|
|
436
|
+
scrollMarginLeft?: string | number | boolean;
|
|
437
|
+
scrollMarginBlock?: string | number | boolean;
|
|
438
|
+
scrollMarginInline?: string | number | boolean;
|
|
408
439
|
/**
|
|
409
440
|
* Shorthand for `top`, `right`, `bottom`, and `left` offsets. Supports custom units, directional modifiers, and positioning.
|
|
410
441
|
*
|
|
@@ -438,6 +469,24 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
438
469
|
* - `'@properties': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
|
|
439
470
|
*/
|
|
440
471
|
'@properties'?: Record<string, PropertyDefinition>;
|
|
472
|
+
/**
|
|
473
|
+
* Local @font-face definitions for this component.
|
|
474
|
+
* Keys are font-family names, values are descriptors or arrays of descriptors
|
|
475
|
+
* (for multiple weights/styles of the same family).
|
|
476
|
+
*
|
|
477
|
+
* Examples:
|
|
478
|
+
* - `'@fontFace': { Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' } }`
|
|
479
|
+
* - `'@fontFace': { 'Brand Sans': [{ src: '...', fontWeight: 400 }, { src: '...', fontWeight: 700 }] }`
|
|
480
|
+
*/
|
|
481
|
+
'@fontFace'?: Record<string, FontFaceInput>;
|
|
482
|
+
/**
|
|
483
|
+
* Local @counter-style definitions for this component.
|
|
484
|
+
* Keys are counter-style names, values are descriptor objects.
|
|
485
|
+
*
|
|
486
|
+
* Examples:
|
|
487
|
+
* - `'@counterStyle': { thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' } }`
|
|
488
|
+
*/
|
|
489
|
+
'@counterStyle'?: Record<string, CounterStyleDescriptors>;
|
|
441
490
|
/**
|
|
442
491
|
* Apply one or more predefined style recipes by name.
|
|
443
492
|
* Recipes are defined globally via `configure({ recipes: { ... } })`.
|
|
@@ -458,7 +507,7 @@ type SuffixForSelector = '&' | '.' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | '
|
|
|
458
507
|
type Selector = `${SuffixForSelector}${string}`;
|
|
459
508
|
type NotSelector = Exclude<string, Selector | keyof StylesInterface>;
|
|
460
509
|
/** Special style keys that should not be wrapped in StyleValue/StyleValueStateMap */
|
|
461
|
-
type SpecialStyleKeys = '@keyframes' | '@properties' | 'recipe';
|
|
510
|
+
type SpecialStyleKeys = '@keyframes' | '@properties' | '@fontFace' | '@counterStyle' | 'recipe';
|
|
462
511
|
type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> };
|
|
463
512
|
/**
|
|
464
513
|
* Index signature for recipe-specific arbitrary keys.
|
|
@@ -476,16 +525,20 @@ type RecipeIndexSignature = Record<string, StyleValue<string | number | boolean
|
|
|
476
525
|
type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
|
|
477
526
|
'@keyframes'?: StylesInterface['@keyframes'];
|
|
478
527
|
'@properties'?: StylesInterface['@properties'];
|
|
528
|
+
'@fontFace'?: StylesInterface['@fontFace'];
|
|
529
|
+
'@counterStyle'?: StylesInterface['@counterStyle'];
|
|
479
530
|
};
|
|
480
531
|
/** Special properties that are not regular style values */
|
|
481
532
|
interface SpecialStyleProperties {
|
|
482
533
|
'@keyframes'?: StylesInterface['@keyframes'];
|
|
483
534
|
'@properties'?: StylesInterface['@properties'];
|
|
535
|
+
'@fontFace'?: StylesInterface['@fontFace'];
|
|
536
|
+
'@counterStyle'?: StylesInterface['@counterStyle'];
|
|
484
537
|
recipe?: StylesInterface['recipe'];
|
|
485
538
|
}
|
|
486
539
|
/** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
|
|
487
540
|
interface StylesIndexSignature {
|
|
488
|
-
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@properties'];
|
|
541
|
+
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@properties'] | StylesInterface['@fontFace'] | StylesInterface['@counterStyle'];
|
|
489
542
|
/**
|
|
490
543
|
* Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
|
|
491
544
|
* Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
|
|
@@ -493,6 +546,19 @@ interface StylesIndexSignature {
|
|
|
493
546
|
$?: string;
|
|
494
547
|
}
|
|
495
548
|
type Styles = StylesWithoutSelectors & SpecialStyleProperties & StylesIndexSignature;
|
|
549
|
+
/**
|
|
550
|
+
* Value type for design tokens passed to `configure({ tokens })`.
|
|
551
|
+
* Can be a direct value or a state map for responsive/theme-aware tokens.
|
|
552
|
+
*/
|
|
553
|
+
type ConfigTokenValue = string | number | boolean | Record<string, string | number | boolean | undefined | null | '@inherit'>;
|
|
554
|
+
/**
|
|
555
|
+
* Design tokens injected as CSS custom properties on `:root`.
|
|
556
|
+
* Keys must start with `$` (value tokens) or `#` (color tokens).
|
|
557
|
+
*
|
|
558
|
+
* - `$name` keys become `--name` CSS custom properties
|
|
559
|
+
* - `#name` keys become `--name-color` and `--name-color-{colorSpace}` properties
|
|
560
|
+
*/
|
|
561
|
+
type ConfigTokens = Record<`$${string}` | `#${string}`, ConfigTokenValue>;
|
|
496
562
|
//#endregion
|
|
497
|
-
export { NoType, NotSelector, RecipeStyles, Selector, Styles, StylesInterface, StylesWithoutSelectors, SuffixForSelector, TastyNamedColors, TastyPresetNames };
|
|
563
|
+
export { ConfigTokenValue, ConfigTokens, NoType, NotSelector, RecipeStyles, Selector, Styles, StylesInterface, StylesWithoutSelectors, SuffixForSelector, TastyNamedColors, TastyPresetNames };
|
|
498
564
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/styles/width.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare function widthStyle({
|
|
|
8
8
|
width,
|
|
9
9
|
minWidth,
|
|
10
10
|
maxWidth
|
|
11
|
-
}: WidthStyleProps): Record<string, string | string[]> |
|
|
11
|
+
}: WidthStyleProps): Record<string, string | string[]> | null;
|
|
12
12
|
declare namespace widthStyle {
|
|
13
13
|
var __lookupStyles: string[];
|
|
14
14
|
}
|
package/dist/styles/width.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { dimensionStyle } from "./dimension.js";
|
|
2
|
-
|
|
3
2
|
//#region src/styles/width.ts
|
|
4
3
|
const dimension = dimensionStyle("width");
|
|
5
4
|
function widthStyle({ width, minWidth, maxWidth }) {
|
|
@@ -14,7 +13,7 @@ widthStyle.__lookupStyles = [
|
|
|
14
13
|
"minWidth",
|
|
15
14
|
"maxWidth"
|
|
16
15
|
];
|
|
17
|
-
|
|
18
16
|
//#endregion
|
|
19
17
|
export { widthStyle };
|
|
18
|
+
|
|
20
19
|
//# sourceMappingURL=width.js.map
|
package/dist/styles/width.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"width.js","names":[],"sources":["../../src/styles/width.ts"],"sourcesContent":["import { dimensionStyle } from './dimension';\n\nconst dimension = dimensionStyle('width');\n\ninterface WidthStyleProps {\n width?: string | number | boolean;\n minWidth?: string | number | boolean;\n maxWidth?: string | number | boolean;\n}\n\nexport function widthStyle({ width, minWidth, maxWidth }: WidthStyleProps) {\n return dimension({ value: width, min: minWidth, max: maxWidth });\n}\n\nwidthStyle.__lookupStyles = ['width', 'minWidth', 'maxWidth'];\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"width.js","names":[],"sources":["../../src/styles/width.ts"],"sourcesContent":["import { dimensionStyle } from './dimension';\n\nconst dimension = dimensionStyle('width');\n\ninterface WidthStyleProps {\n width?: string | number | boolean;\n minWidth?: string | number | boolean;\n maxWidth?: string | number | boolean;\n}\n\nexport function widthStyle({ width, minWidth, maxWidth }: WidthStyleProps) {\n return dimension({ value: width, min: minWidth, max: maxWidth });\n}\n\nwidthStyle.__lookupStyles = ['width', 'minWidth', 'maxWidth'];\n"],"mappings":";;AAEA,MAAM,YAAY,eAAe,QAAQ;AAQzC,SAAgB,WAAW,EAAE,OAAO,UAAU,YAA6B;AACzE,QAAO,UAAU;EAAE,OAAO;EAAO,KAAK;EAAU,KAAK;EAAU,CAAC;;AAGlE,WAAW,iBAAiB;CAAC;CAAS;CAAY;CAAW"}
|