@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.
Files changed (359) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +236 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +7 -0
  4. package/dist/chunks/cacheKey.d.ts +1 -0
  5. package/dist/chunks/cacheKey.js +70 -0
  6. package/dist/chunks/cacheKey.js.map +1 -0
  7. package/dist/chunks/cacheKey.mjs +70 -0
  8. package/dist/chunks/cacheKey.mjs.map +1 -0
  9. package/dist/chunks/definitions.d.ts +37 -0
  10. package/dist/chunks/definitions.js +260 -0
  11. package/dist/chunks/definitions.js.map +1 -0
  12. package/dist/chunks/definitions.mjs +260 -0
  13. package/dist/chunks/definitions.mjs.map +1 -0
  14. package/dist/chunks/index.d.ts +3 -0
  15. package/dist/chunks/renderChunk.d.ts +2 -0
  16. package/dist/chunks/renderChunk.js +61 -0
  17. package/dist/chunks/renderChunk.js.map +1 -0
  18. package/dist/chunks/renderChunk.mjs +61 -0
  19. package/dist/chunks/renderChunk.mjs.map +1 -0
  20. package/dist/config.d.ts +279 -0
  21. package/dist/config.js +400 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/config.mjs +231 -0
  24. package/dist/config.mjs.map +1 -0
  25. package/dist/css-writer.d.mts +45 -0
  26. package/dist/css-writer.mjs +74 -0
  27. package/dist/css-writer.mjs.map +1 -0
  28. package/dist/debug.d.ts +204 -0
  29. package/dist/debug.js +733 -0
  30. package/dist/debug.js.map +1 -0
  31. package/dist/extractor.d.mts +24 -0
  32. package/dist/extractor.mjs +150 -0
  33. package/dist/extractor.mjs.map +1 -0
  34. package/dist/hooks/index.d.ts +5 -0
  35. package/dist/hooks/useGlobalStyles.d.ts +27 -0
  36. package/dist/hooks/useGlobalStyles.js +56 -0
  37. package/dist/hooks/useGlobalStyles.js.map +1 -0
  38. package/dist/hooks/useKeyframes.d.ts +56 -0
  39. package/dist/hooks/useKeyframes.js +54 -0
  40. package/dist/hooks/useKeyframes.js.map +1 -0
  41. package/dist/hooks/useProperty.d.ts +79 -0
  42. package/dist/hooks/useProperty.js +91 -0
  43. package/dist/hooks/useProperty.js.map +1 -0
  44. package/dist/hooks/useRawCSS.d.ts +53 -0
  45. package/dist/hooks/useRawCSS.js +28 -0
  46. package/dist/hooks/useRawCSS.js.map +1 -0
  47. package/dist/hooks/useStyles.d.ts +40 -0
  48. package/dist/hooks/useStyles.js +169 -0
  49. package/dist/hooks/useStyles.js.map +1 -0
  50. package/dist/index.d.ts +38 -0
  51. package/dist/index.js +30 -0
  52. package/dist/injector/index.d.ts +157 -0
  53. package/dist/injector/index.js +154 -0
  54. package/dist/injector/index.js.map +1 -0
  55. package/dist/injector/injector.d.ts +139 -0
  56. package/dist/injector/injector.js +404 -0
  57. package/dist/injector/injector.js.map +1 -0
  58. package/dist/injector/injector.mjs +404 -0
  59. package/dist/injector/injector.mjs.map +1 -0
  60. package/dist/injector/sheet-manager.d.ts +127 -0
  61. package/dist/injector/sheet-manager.js +714 -0
  62. package/dist/injector/sheet-manager.js.map +1 -0
  63. package/dist/injector/sheet-manager.mjs +714 -0
  64. package/dist/injector/sheet-manager.mjs.map +1 -0
  65. package/dist/injector/types.d.mts +18 -0
  66. package/dist/injector/types.d.ts +135 -0
  67. package/dist/keyframes/index.js +206 -0
  68. package/dist/keyframes/index.js.map +1 -0
  69. package/dist/keyframes/index.mjs +156 -0
  70. package/dist/keyframes/index.mjs.map +1 -0
  71. package/dist/parser/classify.js +319 -0
  72. package/dist/parser/classify.js.map +1 -0
  73. package/dist/parser/classify.mjs +319 -0
  74. package/dist/parser/classify.mjs.map +1 -0
  75. package/dist/parser/const.js +33 -0
  76. package/dist/parser/const.js.map +1 -0
  77. package/dist/parser/const.mjs +33 -0
  78. package/dist/parser/const.mjs.map +1 -0
  79. package/dist/parser/lru.js +109 -0
  80. package/dist/parser/lru.js.map +1 -0
  81. package/dist/parser/lru.mjs +109 -0
  82. package/dist/parser/lru.mjs.map +1 -0
  83. package/dist/parser/parser.d.ts +25 -0
  84. package/dist/parser/parser.js +116 -0
  85. package/dist/parser/parser.js.map +1 -0
  86. package/dist/parser/parser.mjs +116 -0
  87. package/dist/parser/parser.mjs.map +1 -0
  88. package/dist/parser/tokenizer.js +69 -0
  89. package/dist/parser/tokenizer.js.map +1 -0
  90. package/dist/parser/tokenizer.mjs +69 -0
  91. package/dist/parser/tokenizer.mjs.map +1 -0
  92. package/dist/parser/types.d.mts +37 -0
  93. package/dist/parser/types.d.ts +46 -0
  94. package/dist/parser/types.js +46 -0
  95. package/dist/parser/types.js.map +1 -0
  96. package/dist/parser/types.mjs +46 -0
  97. package/dist/parser/types.mjs.map +1 -0
  98. package/dist/pipeline/conditions.js +377 -0
  99. package/dist/pipeline/conditions.js.map +1 -0
  100. package/dist/pipeline/conditions.mjs +377 -0
  101. package/dist/pipeline/conditions.mjs.map +1 -0
  102. package/dist/pipeline/exclusive.d.ts +1 -0
  103. package/dist/pipeline/exclusive.js +231 -0
  104. package/dist/pipeline/exclusive.js.map +1 -0
  105. package/dist/pipeline/exclusive.mjs +231 -0
  106. package/dist/pipeline/exclusive.mjs.map +1 -0
  107. package/dist/pipeline/index.d.ts +53 -0
  108. package/dist/pipeline/index.js +641 -0
  109. package/dist/pipeline/index.js.map +1 -0
  110. package/dist/pipeline/index.mjs +635 -0
  111. package/dist/pipeline/index.mjs.map +1 -0
  112. package/dist/pipeline/materialize.js +821 -0
  113. package/dist/pipeline/materialize.js.map +1 -0
  114. package/dist/pipeline/materialize.mjs +821 -0
  115. package/dist/pipeline/materialize.mjs.map +1 -0
  116. package/dist/pipeline/parseStateKey.d.ts +1 -0
  117. package/dist/pipeline/parseStateKey.js +418 -0
  118. package/dist/pipeline/parseStateKey.js.map +1 -0
  119. package/dist/pipeline/parseStateKey.mjs +418 -0
  120. package/dist/pipeline/parseStateKey.mjs.map +1 -0
  121. package/dist/pipeline/simplify.js +557 -0
  122. package/dist/pipeline/simplify.js.map +1 -0
  123. package/dist/pipeline/simplify.mjs +557 -0
  124. package/dist/pipeline/simplify.mjs.map +1 -0
  125. package/dist/plugins/index.d.ts +2 -0
  126. package/dist/plugins/okhsl-plugin.d.ts +35 -0
  127. package/dist/plugins/okhsl-plugin.js +371 -0
  128. package/dist/plugins/okhsl-plugin.js.map +1 -0
  129. package/dist/plugins/okhsl-plugin.mjs +345 -0
  130. package/dist/plugins/okhsl-plugin.mjs.map +1 -0
  131. package/dist/plugins/types.d.mts +49 -0
  132. package/dist/plugins/types.d.ts +69 -0
  133. package/dist/properties/index.js +158 -0
  134. package/dist/properties/index.js.map +1 -0
  135. package/dist/properties/index.mjs +141 -0
  136. package/dist/properties/index.mjs.map +1 -0
  137. package/dist/states/index.d.ts +45 -0
  138. package/dist/states/index.js +389 -0
  139. package/dist/states/index.js.map +1 -0
  140. package/dist/states/index.mjs +161 -0
  141. package/dist/states/index.mjs.map +1 -0
  142. package/dist/static/index.d.ts +5 -0
  143. package/dist/static/index.js +5 -0
  144. package/dist/static/tastyStatic.d.ts +46 -0
  145. package/dist/static/tastyStatic.js +31 -0
  146. package/dist/static/tastyStatic.js.map +1 -0
  147. package/dist/static/types.d.ts +49 -0
  148. package/dist/static/types.js +24 -0
  149. package/dist/static/types.js.map +1 -0
  150. package/dist/styles/align.d.ts +15 -0
  151. package/dist/styles/align.js +14 -0
  152. package/dist/styles/align.js.map +1 -0
  153. package/dist/styles/align.mjs +14 -0
  154. package/dist/styles/align.mjs.map +1 -0
  155. package/dist/styles/border.d.ts +25 -0
  156. package/dist/styles/border.js +114 -0
  157. package/dist/styles/border.js.map +1 -0
  158. package/dist/styles/border.mjs +114 -0
  159. package/dist/styles/border.mjs.map +1 -0
  160. package/dist/styles/color.d.ts +14 -0
  161. package/dist/styles/color.js +23 -0
  162. package/dist/styles/color.js.map +1 -0
  163. package/dist/styles/color.mjs +23 -0
  164. package/dist/styles/color.mjs.map +1 -0
  165. package/dist/styles/createStyle.js +77 -0
  166. package/dist/styles/createStyle.js.map +1 -0
  167. package/dist/styles/createStyle.mjs +77 -0
  168. package/dist/styles/createStyle.mjs.map +1 -0
  169. package/dist/styles/dimension.js +97 -0
  170. package/dist/styles/dimension.js.map +1 -0
  171. package/dist/styles/dimension.mjs +97 -0
  172. package/dist/styles/dimension.mjs.map +1 -0
  173. package/dist/styles/display.d.ts +37 -0
  174. package/dist/styles/display.js +67 -0
  175. package/dist/styles/display.js.map +1 -0
  176. package/dist/styles/display.mjs +67 -0
  177. package/dist/styles/display.mjs.map +1 -0
  178. package/dist/styles/fade.d.ts +15 -0
  179. package/dist/styles/fade.js +58 -0
  180. package/dist/styles/fade.js.map +1 -0
  181. package/dist/styles/fade.mjs +58 -0
  182. package/dist/styles/fade.mjs.map +1 -0
  183. package/dist/styles/fill.d.ts +44 -0
  184. package/dist/styles/fill.js +51 -0
  185. package/dist/styles/fill.js.map +1 -0
  186. package/dist/styles/fill.mjs +51 -0
  187. package/dist/styles/fill.mjs.map +1 -0
  188. package/dist/styles/flow.d.ts +16 -0
  189. package/dist/styles/flow.js +12 -0
  190. package/dist/styles/flow.js.map +1 -0
  191. package/dist/styles/flow.mjs +12 -0
  192. package/dist/styles/flow.mjs.map +1 -0
  193. package/dist/styles/gap.d.ts +31 -0
  194. package/dist/styles/gap.js +37 -0
  195. package/dist/styles/gap.js.map +1 -0
  196. package/dist/styles/gap.mjs +37 -0
  197. package/dist/styles/gap.mjs.map +1 -0
  198. package/dist/styles/height.d.ts +17 -0
  199. package/dist/styles/height.js +20 -0
  200. package/dist/styles/height.js.map +1 -0
  201. package/dist/styles/height.mjs +20 -0
  202. package/dist/styles/height.mjs.map +1 -0
  203. package/dist/styles/index.d.ts +2 -0
  204. package/dist/styles/index.js +9 -0
  205. package/dist/styles/index.js.map +1 -0
  206. package/dist/styles/index.mjs +9 -0
  207. package/dist/styles/index.mjs.map +1 -0
  208. package/dist/styles/inset.d.ts +50 -0
  209. package/dist/styles/inset.js +142 -0
  210. package/dist/styles/inset.js.map +1 -0
  211. package/dist/styles/inset.mjs +142 -0
  212. package/dist/styles/inset.mjs.map +1 -0
  213. package/dist/styles/justify.d.ts +15 -0
  214. package/dist/styles/justify.js +14 -0
  215. package/dist/styles/justify.js.map +1 -0
  216. package/dist/styles/justify.mjs +14 -0
  217. package/dist/styles/justify.mjs.map +1 -0
  218. package/dist/styles/list.d.ts +16 -0
  219. package/dist/styles/list.js +98 -0
  220. package/dist/styles/list.js.map +1 -0
  221. package/dist/styles/margin.d.ts +28 -0
  222. package/dist/styles/margin.js +96 -0
  223. package/dist/styles/margin.js.map +1 -0
  224. package/dist/styles/margin.mjs +96 -0
  225. package/dist/styles/margin.mjs.map +1 -0
  226. package/dist/styles/outline.d.ts +29 -0
  227. package/dist/styles/outline.js +65 -0
  228. package/dist/styles/outline.js.map +1 -0
  229. package/dist/styles/outline.mjs +65 -0
  230. package/dist/styles/outline.mjs.map +1 -0
  231. package/dist/styles/padding.d.ts +28 -0
  232. package/dist/styles/padding.js +96 -0
  233. package/dist/styles/padding.js.map +1 -0
  234. package/dist/styles/padding.mjs +96 -0
  235. package/dist/styles/padding.mjs.map +1 -0
  236. package/dist/styles/predefined.d.ts +74 -0
  237. package/dist/styles/predefined.js +241 -0
  238. package/dist/styles/predefined.js.map +1 -0
  239. package/dist/styles/predefined.mjs +232 -0
  240. package/dist/styles/predefined.mjs.map +1 -0
  241. package/dist/styles/preset.d.ts +47 -0
  242. package/dist/styles/preset.js +126 -0
  243. package/dist/styles/preset.js.map +1 -0
  244. package/dist/styles/preset.mjs +126 -0
  245. package/dist/styles/preset.mjs.map +1 -0
  246. package/dist/styles/radius.d.ts +14 -0
  247. package/dist/styles/radius.js +51 -0
  248. package/dist/styles/radius.js.map +1 -0
  249. package/dist/styles/radius.mjs +51 -0
  250. package/dist/styles/radius.mjs.map +1 -0
  251. package/dist/styles/scrollbar.d.ts +21 -0
  252. package/dist/styles/scrollbar.js +105 -0
  253. package/dist/styles/scrollbar.js.map +1 -0
  254. package/dist/styles/scrollbar.mjs +105 -0
  255. package/dist/styles/scrollbar.mjs.map +1 -0
  256. package/dist/styles/shadow.d.ts +14 -0
  257. package/dist/styles/shadow.js +24 -0
  258. package/dist/styles/shadow.js.map +1 -0
  259. package/dist/styles/shadow.mjs +24 -0
  260. package/dist/styles/shadow.mjs.map +1 -0
  261. package/dist/styles/styledScrollbar.d.ts +47 -0
  262. package/dist/styles/styledScrollbar.js +38 -0
  263. package/dist/styles/styledScrollbar.js.map +1 -0
  264. package/dist/styles/styledScrollbar.mjs +38 -0
  265. package/dist/styles/styledScrollbar.mjs.map +1 -0
  266. package/dist/styles/transition.d.ts +14 -0
  267. package/dist/styles/transition.js +138 -0
  268. package/dist/styles/transition.js.map +1 -0
  269. package/dist/styles/transition.mjs +138 -0
  270. package/dist/styles/transition.mjs.map +1 -0
  271. package/dist/styles/types.d.mts +492 -0
  272. package/dist/styles/types.d.ts +496 -0
  273. package/dist/styles/width.d.ts +17 -0
  274. package/dist/styles/width.js +20 -0
  275. package/dist/styles/width.js.map +1 -0
  276. package/dist/styles/width.mjs +20 -0
  277. package/dist/styles/width.mjs.map +1 -0
  278. package/dist/tasty.d.ts +983 -0
  279. package/dist/tasty.js +191 -0
  280. package/dist/tasty.js.map +1 -0
  281. package/dist/tokens/typography.d.ts +19 -0
  282. package/dist/tokens/typography.js +237 -0
  283. package/dist/tokens/typography.js.map +1 -0
  284. package/dist/types.d.ts +182 -0
  285. package/dist/utils/cache-wrapper.js +26 -0
  286. package/dist/utils/cache-wrapper.js.map +1 -0
  287. package/dist/utils/cache-wrapper.mjs +26 -0
  288. package/dist/utils/cache-wrapper.mjs.map +1 -0
  289. package/dist/utils/case-converter.js +8 -0
  290. package/dist/utils/case-converter.js.map +1 -0
  291. package/dist/utils/case-converter.mjs +8 -0
  292. package/dist/utils/case-converter.mjs.map +1 -0
  293. package/dist/utils/colors.d.ts +5 -0
  294. package/dist/utils/colors.js +9 -0
  295. package/dist/utils/colors.js.map +1 -0
  296. package/dist/utils/dotize.d.ts +26 -0
  297. package/dist/utils/dotize.js +122 -0
  298. package/dist/utils/dotize.js.map +1 -0
  299. package/dist/utils/filter-base-props.d.ts +15 -0
  300. package/dist/utils/filter-base-props.js +45 -0
  301. package/dist/utils/filter-base-props.js.map +1 -0
  302. package/dist/utils/get-display-name.d.ts +7 -0
  303. package/dist/utils/get-display-name.js +10 -0
  304. package/dist/utils/get-display-name.js.map +1 -0
  305. package/dist/utils/hsl-to-rgb.js +38 -0
  306. package/dist/utils/hsl-to-rgb.js.map +1 -0
  307. package/dist/utils/hsl-to-rgb.mjs +38 -0
  308. package/dist/utils/hsl-to-rgb.mjs.map +1 -0
  309. package/dist/utils/is-dev-env.js +19 -0
  310. package/dist/utils/is-dev-env.js.map +1 -0
  311. package/dist/utils/is-dev-env.mjs +19 -0
  312. package/dist/utils/is-dev-env.mjs.map +1 -0
  313. package/dist/utils/merge-styles.d.ts +7 -0
  314. package/dist/utils/merge-styles.js +146 -0
  315. package/dist/utils/merge-styles.js.map +1 -0
  316. package/dist/utils/merge-styles.mjs +146 -0
  317. package/dist/utils/merge-styles.mjs.map +1 -0
  318. package/dist/utils/mod-attrs.d.ts +8 -0
  319. package/dist/utils/mod-attrs.js +21 -0
  320. package/dist/utils/mod-attrs.js.map +1 -0
  321. package/dist/utils/okhsl-to-rgb.js +296 -0
  322. package/dist/utils/okhsl-to-rgb.js.map +1 -0
  323. package/dist/utils/okhsl-to-rgb.mjs +296 -0
  324. package/dist/utils/okhsl-to-rgb.mjs.map +1 -0
  325. package/dist/utils/process-tokens.d.ts +31 -0
  326. package/dist/utils/process-tokens.js +171 -0
  327. package/dist/utils/process-tokens.js.map +1 -0
  328. package/dist/utils/process-tokens.mjs +28 -0
  329. package/dist/utils/process-tokens.mjs.map +1 -0
  330. package/dist/utils/resolve-recipes.d.ts +17 -0
  331. package/dist/utils/resolve-recipes.js +143 -0
  332. package/dist/utils/resolve-recipes.js.map +1 -0
  333. package/dist/utils/resolve-recipes.mjs +143 -0
  334. package/dist/utils/resolve-recipes.mjs.map +1 -0
  335. package/dist/utils/string.js +8 -0
  336. package/dist/utils/string.js.map +1 -0
  337. package/dist/utils/string.mjs +8 -0
  338. package/dist/utils/string.mjs.map +1 -0
  339. package/dist/utils/styles.d.mts +18 -0
  340. package/dist/utils/styles.d.ts +183 -0
  341. package/dist/utils/styles.js +585 -0
  342. package/dist/utils/styles.js.map +1 -0
  343. package/dist/utils/styles.mjs +346 -0
  344. package/dist/utils/styles.mjs.map +1 -0
  345. package/dist/utils/typography.d.ts +36 -0
  346. package/dist/utils/typography.js +53 -0
  347. package/dist/utils/typography.js.map +1 -0
  348. package/dist/utils/warnings.d.ts +16 -0
  349. package/dist/utils/warnings.js +16 -0
  350. package/dist/utils/warnings.js.map +1 -0
  351. package/dist/zero/babel.d.mts +108 -0
  352. package/dist/zero/babel.mjs +282 -0
  353. package/dist/zero/babel.mjs.map +1 -0
  354. package/dist/zero/index.d.mts +3 -0
  355. package/dist/zero/index.mjs +4 -0
  356. package/dist/zero/next.d.mts +60 -0
  357. package/dist/zero/next.mjs +78 -0
  358. package/dist/zero/next.mjs.map +1 -0
  359. 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