@tenphi/tasty 0.0.0-snapshot.08a6610

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