@tenphi/tasty 0.0.0-snapshot.c8bdaeb → 0.0.0-snapshot.cae4fee

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 (303) hide show
  1. package/README.md +314 -159
  2. package/dist/async-storage-B7_o6FKt.js +44 -0
  3. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  4. package/dist/collector-C-keQH9m.js +243 -0
  5. package/dist/collector-C-keQH9m.js.map +1 -0
  6. package/dist/collector-osfWTeRd.d.ts +108 -0
  7. package/dist/config-BBiyxMCe.js +10559 -0
  8. package/dist/config-BBiyxMCe.js.map +1 -0
  9. package/dist/config-BoZDUHW5.d.ts +945 -0
  10. package/dist/context-CkSg-kDT.js +24 -0
  11. package/dist/context-CkSg-kDT.js.map +1 -0
  12. package/dist/core/index.d.ts +5 -33
  13. package/dist/core/index.js +6 -26
  14. package/dist/core-BO4319td.js +1598 -0
  15. package/dist/core-BO4319td.js.map +1 -0
  16. package/dist/css-writer-BWvwQzz0.js +351 -0
  17. package/dist/css-writer-BWvwQzz0.js.map +1 -0
  18. package/dist/format-global-rules-Dbc_1tc3.js +22 -0
  19. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  20. package/dist/format-rules-BSjeH4Z7.js +143 -0
  21. package/dist/format-rules-BSjeH4Z7.js.map +1 -0
  22. package/dist/hydrate-CcvrP4qJ.js +45 -0
  23. package/dist/hydrate-CcvrP4qJ.js.map +1 -0
  24. package/dist/index-B_k47mc_.d.ts +1655 -0
  25. package/dist/index-tcHuMPFt.d.ts +1286 -0
  26. package/dist/index.d.ts +5 -48
  27. package/dist/index.js +731 -32
  28. package/dist/index.js.map +1 -0
  29. package/dist/keyframes-BUQhdOSJ.js +588 -0
  30. package/dist/keyframes-BUQhdOSJ.js.map +1 -0
  31. package/dist/{utils/merge-styles.d.ts → merge-styles-BMWcH6MF.d.ts} +3 -3
  32. package/dist/{utils/merge-styles.js → merge-styles-Cd2vBl9b.js} +4 -6
  33. package/dist/merge-styles-Cd2vBl9b.js.map +1 -0
  34. package/dist/{utils/resolve-recipes.js → resolve-recipes-C1nrvnYh.js} +5 -8
  35. package/dist/resolve-recipes-C1nrvnYh.js.map +1 -0
  36. package/dist/ssr/astro-client.d.ts +1 -0
  37. package/dist/ssr/astro-client.js +19 -0
  38. package/dist/ssr/astro-client.js.map +1 -0
  39. package/dist/ssr/astro-middleware.d.ts +15 -0
  40. package/dist/ssr/astro-middleware.js +19 -0
  41. package/dist/ssr/astro-middleware.js.map +1 -0
  42. package/dist/ssr/astro.d.ts +97 -0
  43. package/dist/ssr/astro.js +149 -0
  44. package/dist/ssr/astro.js.map +1 -0
  45. package/dist/ssr/index.d.ts +44 -0
  46. package/dist/ssr/index.js +10 -0
  47. package/dist/ssr/index.js.map +1 -0
  48. package/dist/ssr/next.d.ts +46 -0
  49. package/dist/ssr/next.js +75 -0
  50. package/dist/ssr/next.js.map +1 -0
  51. package/dist/static/index.d.ts +91 -5
  52. package/dist/static/index.js +49 -4
  53. package/dist/static/index.js.map +1 -0
  54. package/dist/static/inject.d.ts +5 -0
  55. package/dist/static/inject.js +17 -0
  56. package/dist/static/inject.js.map +1 -0
  57. package/dist/zero/babel.d.ts +57 -84
  58. package/dist/zero/babel.js +232 -40
  59. package/dist/zero/babel.js.map +1 -1
  60. package/dist/zero/index.d.ts +67 -3
  61. package/dist/zero/index.js +2 -4
  62. package/dist/zero/next.d.ts +56 -30
  63. package/dist/zero/next.js +105 -40
  64. package/dist/zero/next.js.map +1 -1
  65. package/docs/README.md +31 -0
  66. package/docs/adoption.md +298 -0
  67. package/docs/comparison.md +419 -0
  68. package/docs/configuration.md +438 -0
  69. package/docs/debug.md +320 -0
  70. package/docs/design-system.md +436 -0
  71. package/docs/dsl.md +690 -0
  72. package/docs/getting-started.md +217 -0
  73. package/docs/injector.md +544 -0
  74. package/docs/methodology.md +642 -0
  75. package/docs/pipeline.md +699 -0
  76. package/docs/react-api.md +581 -0
  77. package/docs/ssr.md +444 -0
  78. package/docs/styles.md +598 -0
  79. package/docs/tasty-static.md +547 -0
  80. package/package.json +70 -37
  81. package/tasty.config.ts +1 -0
  82. package/dist/_virtual/_rolldown/runtime.js +0 -8
  83. package/dist/chunks/cacheKey.js +0 -70
  84. package/dist/chunks/cacheKey.js.map +0 -1
  85. package/dist/chunks/definitions.d.ts +0 -37
  86. package/dist/chunks/definitions.js +0 -260
  87. package/dist/chunks/definitions.js.map +0 -1
  88. package/dist/chunks/renderChunk.js +0 -61
  89. package/dist/chunks/renderChunk.js.map +0 -1
  90. package/dist/config.d.ts +0 -280
  91. package/dist/config.js +0 -403
  92. package/dist/config.js.map +0 -1
  93. package/dist/debug.d.ts +0 -204
  94. package/dist/debug.js +0 -733
  95. package/dist/debug.js.map +0 -1
  96. package/dist/hooks/useGlobalStyles.d.ts +0 -27
  97. package/dist/hooks/useGlobalStyles.js +0 -56
  98. package/dist/hooks/useGlobalStyles.js.map +0 -1
  99. package/dist/hooks/useKeyframes.d.ts +0 -56
  100. package/dist/hooks/useKeyframes.js +0 -54
  101. package/dist/hooks/useKeyframes.js.map +0 -1
  102. package/dist/hooks/useProperty.d.ts +0 -79
  103. package/dist/hooks/useProperty.js +0 -91
  104. package/dist/hooks/useProperty.js.map +0 -1
  105. package/dist/hooks/useRawCSS.d.ts +0 -53
  106. package/dist/hooks/useRawCSS.js +0 -28
  107. package/dist/hooks/useRawCSS.js.map +0 -1
  108. package/dist/hooks/useStyles.d.ts +0 -40
  109. package/dist/hooks/useStyles.js +0 -169
  110. package/dist/hooks/useStyles.js.map +0 -1
  111. package/dist/injector/index.d.ts +0 -157
  112. package/dist/injector/index.js +0 -154
  113. package/dist/injector/index.js.map +0 -1
  114. package/dist/injector/injector.d.ts +0 -139
  115. package/dist/injector/injector.js +0 -404
  116. package/dist/injector/injector.js.map +0 -1
  117. package/dist/injector/sheet-manager.d.ts +0 -127
  118. package/dist/injector/sheet-manager.js +0 -714
  119. package/dist/injector/sheet-manager.js.map +0 -1
  120. package/dist/injector/types.d.ts +0 -135
  121. package/dist/keyframes/index.js +0 -206
  122. package/dist/keyframes/index.js.map +0 -1
  123. package/dist/parser/classify.js +0 -319
  124. package/dist/parser/classify.js.map +0 -1
  125. package/dist/parser/const.js +0 -33
  126. package/dist/parser/const.js.map +0 -1
  127. package/dist/parser/lru.js +0 -109
  128. package/dist/parser/lru.js.map +0 -1
  129. package/dist/parser/parser.d.ts +0 -25
  130. package/dist/parser/parser.js +0 -116
  131. package/dist/parser/parser.js.map +0 -1
  132. package/dist/parser/tokenizer.js +0 -69
  133. package/dist/parser/tokenizer.js.map +0 -1
  134. package/dist/parser/types.d.ts +0 -51
  135. package/dist/parser/types.js +0 -46
  136. package/dist/parser/types.js.map +0 -1
  137. package/dist/pipeline/conditions.d.ts +0 -134
  138. package/dist/pipeline/conditions.js +0 -406
  139. package/dist/pipeline/conditions.js.map +0 -1
  140. package/dist/pipeline/exclusive.js +0 -231
  141. package/dist/pipeline/exclusive.js.map +0 -1
  142. package/dist/pipeline/index.d.ts +0 -53
  143. package/dist/pipeline/index.js +0 -660
  144. package/dist/pipeline/index.js.map +0 -1
  145. package/dist/pipeline/materialize.js +0 -844
  146. package/dist/pipeline/materialize.js.map +0 -1
  147. package/dist/pipeline/parseStateKey.d.ts +0 -15
  148. package/dist/pipeline/parseStateKey.js +0 -438
  149. package/dist/pipeline/parseStateKey.js.map +0 -1
  150. package/dist/pipeline/simplify.js +0 -516
  151. package/dist/pipeline/simplify.js.map +0 -1
  152. package/dist/pipeline/warnings.js +0 -18
  153. package/dist/pipeline/warnings.js.map +0 -1
  154. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  155. package/dist/plugins/okhsl-plugin.js +0 -371
  156. package/dist/plugins/okhsl-plugin.js.map +0 -1
  157. package/dist/plugins/types.d.ts +0 -69
  158. package/dist/properties/index.js +0 -158
  159. package/dist/properties/index.js.map +0 -1
  160. package/dist/states/index.d.ts +0 -49
  161. package/dist/states/index.js +0 -416
  162. package/dist/states/index.js.map +0 -1
  163. package/dist/static/tastyStatic.d.ts +0 -46
  164. package/dist/static/tastyStatic.js +0 -31
  165. package/dist/static/tastyStatic.js.map +0 -1
  166. package/dist/static/types.d.ts +0 -49
  167. package/dist/static/types.js +0 -24
  168. package/dist/static/types.js.map +0 -1
  169. package/dist/styles/align.d.ts +0 -15
  170. package/dist/styles/align.js +0 -14
  171. package/dist/styles/align.js.map +0 -1
  172. package/dist/styles/border.d.ts +0 -25
  173. package/dist/styles/border.js +0 -114
  174. package/dist/styles/border.js.map +0 -1
  175. package/dist/styles/color.d.ts +0 -14
  176. package/dist/styles/color.js +0 -23
  177. package/dist/styles/color.js.map +0 -1
  178. package/dist/styles/createStyle.js +0 -77
  179. package/dist/styles/createStyle.js.map +0 -1
  180. package/dist/styles/dimension.js +0 -97
  181. package/dist/styles/dimension.js.map +0 -1
  182. package/dist/styles/display.d.ts +0 -37
  183. package/dist/styles/display.js +0 -67
  184. package/dist/styles/display.js.map +0 -1
  185. package/dist/styles/fade.d.ts +0 -15
  186. package/dist/styles/fade.js +0 -58
  187. package/dist/styles/fade.js.map +0 -1
  188. package/dist/styles/fill.d.ts +0 -42
  189. package/dist/styles/fill.js +0 -51
  190. package/dist/styles/fill.js.map +0 -1
  191. package/dist/styles/flow.d.ts +0 -16
  192. package/dist/styles/flow.js +0 -12
  193. package/dist/styles/flow.js.map +0 -1
  194. package/dist/styles/gap.d.ts +0 -31
  195. package/dist/styles/gap.js +0 -37
  196. package/dist/styles/gap.js.map +0 -1
  197. package/dist/styles/height.d.ts +0 -17
  198. package/dist/styles/height.js +0 -20
  199. package/dist/styles/height.js.map +0 -1
  200. package/dist/styles/index.d.ts +0 -2
  201. package/dist/styles/index.js +0 -9
  202. package/dist/styles/index.js.map +0 -1
  203. package/dist/styles/inset.d.ts +0 -52
  204. package/dist/styles/inset.js +0 -150
  205. package/dist/styles/inset.js.map +0 -1
  206. package/dist/styles/justify.d.ts +0 -15
  207. package/dist/styles/justify.js +0 -14
  208. package/dist/styles/justify.js.map +0 -1
  209. package/dist/styles/list.d.ts +0 -16
  210. package/dist/styles/list.js +0 -98
  211. package/dist/styles/list.js.map +0 -1
  212. package/dist/styles/margin.d.ts +0 -24
  213. package/dist/styles/margin.js +0 -104
  214. package/dist/styles/margin.js.map +0 -1
  215. package/dist/styles/outline.d.ts +0 -29
  216. package/dist/styles/outline.js +0 -65
  217. package/dist/styles/outline.js.map +0 -1
  218. package/dist/styles/padding.d.ts +0 -24
  219. package/dist/styles/padding.js +0 -104
  220. package/dist/styles/padding.js.map +0 -1
  221. package/dist/styles/predefined.d.ts +0 -73
  222. package/dist/styles/predefined.js +0 -241
  223. package/dist/styles/predefined.js.map +0 -1
  224. package/dist/styles/preset.d.ts +0 -47
  225. package/dist/styles/preset.js +0 -126
  226. package/dist/styles/preset.js.map +0 -1
  227. package/dist/styles/radius.d.ts +0 -14
  228. package/dist/styles/radius.js +0 -51
  229. package/dist/styles/radius.js.map +0 -1
  230. package/dist/styles/scrollbar.d.ts +0 -21
  231. package/dist/styles/scrollbar.js +0 -112
  232. package/dist/styles/scrollbar.js.map +0 -1
  233. package/dist/styles/shadow.d.ts +0 -14
  234. package/dist/styles/shadow.js +0 -24
  235. package/dist/styles/shadow.js.map +0 -1
  236. package/dist/styles/styledScrollbar.d.ts +0 -47
  237. package/dist/styles/styledScrollbar.js +0 -38
  238. package/dist/styles/styledScrollbar.js.map +0 -1
  239. package/dist/styles/transition.d.ts +0 -14
  240. package/dist/styles/transition.js +0 -158
  241. package/dist/styles/transition.js.map +0 -1
  242. package/dist/styles/types.d.ts +0 -498
  243. package/dist/styles/width.d.ts +0 -17
  244. package/dist/styles/width.js +0 -20
  245. package/dist/styles/width.js.map +0 -1
  246. package/dist/tasty.d.ts +0 -982
  247. package/dist/tasty.js +0 -206
  248. package/dist/tasty.js.map +0 -1
  249. package/dist/tokens/typography.d.ts +0 -19
  250. package/dist/tokens/typography.js +0 -237
  251. package/dist/tokens/typography.js.map +0 -1
  252. package/dist/types.d.ts +0 -184
  253. package/dist/utils/cache-wrapper.js +0 -26
  254. package/dist/utils/cache-wrapper.js.map +0 -1
  255. package/dist/utils/case-converter.js +0 -8
  256. package/dist/utils/case-converter.js.map +0 -1
  257. package/dist/utils/colors.d.ts +0 -5
  258. package/dist/utils/colors.js +0 -9
  259. package/dist/utils/colors.js.map +0 -1
  260. package/dist/utils/css-types.d.ts +0 -7
  261. package/dist/utils/dotize.d.ts +0 -26
  262. package/dist/utils/dotize.js +0 -122
  263. package/dist/utils/dotize.js.map +0 -1
  264. package/dist/utils/filter-base-props.d.ts +0 -15
  265. package/dist/utils/filter-base-props.js +0 -45
  266. package/dist/utils/filter-base-props.js.map +0 -1
  267. package/dist/utils/get-display-name.d.ts +0 -7
  268. package/dist/utils/get-display-name.js +0 -10
  269. package/dist/utils/get-display-name.js.map +0 -1
  270. package/dist/utils/hsl-to-rgb.js +0 -38
  271. package/dist/utils/hsl-to-rgb.js.map +0 -1
  272. package/dist/utils/is-dev-env.js +0 -19
  273. package/dist/utils/is-dev-env.js.map +0 -1
  274. package/dist/utils/is-valid-element-type.js +0 -15
  275. package/dist/utils/is-valid-element-type.js.map +0 -1
  276. package/dist/utils/merge-styles.js.map +0 -1
  277. package/dist/utils/mod-attrs.d.ts +0 -8
  278. package/dist/utils/mod-attrs.js +0 -21
  279. package/dist/utils/mod-attrs.js.map +0 -1
  280. package/dist/utils/okhsl-to-rgb.js +0 -296
  281. package/dist/utils/okhsl-to-rgb.js.map +0 -1
  282. package/dist/utils/process-tokens.d.ts +0 -31
  283. package/dist/utils/process-tokens.js +0 -171
  284. package/dist/utils/process-tokens.js.map +0 -1
  285. package/dist/utils/resolve-recipes.d.ts +0 -17
  286. package/dist/utils/resolve-recipes.js.map +0 -1
  287. package/dist/utils/string.js +0 -8
  288. package/dist/utils/string.js.map +0 -1
  289. package/dist/utils/styles.d.ts +0 -178
  290. package/dist/utils/styles.js +0 -590
  291. package/dist/utils/styles.js.map +0 -1
  292. package/dist/utils/typography.d.ts +0 -36
  293. package/dist/utils/typography.js +0 -53
  294. package/dist/utils/typography.js.map +0 -1
  295. package/dist/utils/warnings.d.ts +0 -16
  296. package/dist/utils/warnings.js +0 -16
  297. package/dist/utils/warnings.js.map +0 -1
  298. package/dist/zero/css-writer.d.ts +0 -45
  299. package/dist/zero/css-writer.js +0 -74
  300. package/dist/zero/css-writer.js.map +0 -1
  301. package/dist/zero/extractor.d.ts +0 -24
  302. package/dist/zero/extractor.js +0 -150
  303. package/dist/zero/extractor.js.map +0 -1
@@ -0,0 +1,1655 @@
1
+ import { Dt as StyleInjectorConfig, I as StyleValue, L as StyleValueStateMap, b as Styles, bt as KeyframesResult, ct as CacheMetrics, dt as FontFaceDescriptors, ft as FontFaceInput, gt as InjectResult, ht as GlobalInjectResult, it as StyleDetails, lt as CounterStyleDescriptors, mt as GCOptions, n as StyleResult, st as CSSProperties$1, x as StylesInterface, xt as KeyframesSteps } from "./index-tcHuMPFt.js";
2
+ import { g as TastyPluginFactory, x as StyleInjector } from "./config-BoZDUHW5.js";
3
+ import { t as ServerStyleCollector } from "./collector-osfWTeRd.js";
4
+ import { AllHTMLAttributes, CSSProperties, ComponentType, ElementType, ForwardRefExoticComponent, JSX, PropsWithoutRef, RefAttributes } from "react";
5
+
6
+ //#region src/utils/name-prefix.d.ts
7
+ /**
8
+ * Name prefix utilities for generated identifiers.
9
+ *
10
+ * Tasty generates three kinds of identifiers from content hashes:
11
+ * - class names (used in DOM `class` attribute)
12
+ * - keyframe names (used in CSS `animation`)
13
+ * - counter-style names (used in CSS `list-style-type`)
14
+ *
15
+ * All three derive from a single configurable prefix so that an app
16
+ * can namespace every identifier under one string. Discriminator letters
17
+ * (`k`, `c`) keep the three kinds visually distinct in devtools — they
18
+ * are not required for correctness (CSS keeps these in separate
19
+ * namespaces), only for readability.
20
+ *
21
+ * The runtime / SSR / RSC paths must agree on the prefix; otherwise the
22
+ * client-side hash for a given style will not match the server-rendered
23
+ * class and hydration breaks. The zero-runtime build path uses a
24
+ * different default (`'ts'`) so its classes can't collide with runtime
25
+ * (`'t'`) classes when both are loaded on the same page.
26
+ */
27
+ /** Default prefix used by the runtime / SSR / RSC paths. */
28
+ declare const DEFAULT_NAME_PREFIX = "t";
29
+ /** Default prefix used by the zero-runtime (`tastyStatic`) build path. */
30
+ declare const DEFAULT_ZERO_NAME_PREFIX = "ts";
31
+ //#endregion
32
+ //#region src/plugins/okhsl-plugin.d.ts
33
+ /**
34
+ * The okhsl function handler for tasty parser.
35
+ * Receives parsed style groups and returns an RGB color string.
36
+ */
37
+ declare const okhslFunc: (groups: StyleDetails[]) => string;
38
+ /**
39
+ * OKHSL Plugin for Tasty.
40
+ *
41
+ * Adds support for the `okhsl()` color function in tasty styles.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * import { configure } from '@tenphi/tasty';
46
+ * import { okhslPlugin } from '@tenphi/tasty';
47
+ *
48
+ * configure({
49
+ * plugins: [okhslPlugin()],
50
+ * });
51
+ *
52
+ * // Now you can use okhsl in styles:
53
+ * const Box = tasty({
54
+ * styles: {
55
+ * fill: 'okhsl(240 50% 50%)',
56
+ * },
57
+ * });
58
+ * ```
59
+ */
60
+ declare const okhslPlugin: TastyPluginFactory;
61
+ //#endregion
62
+ //#region src/chunks/definitions.d.ts
63
+ declare const CHUNK_NAMES: {
64
+ /** Special chunk for styles that cannot be split */readonly COMBINED: "combined";
65
+ readonly SUBCOMPONENTS: "subcomponents";
66
+ readonly APPEARANCE: "appearance";
67
+ readonly FONT: "font";
68
+ readonly DIMENSION: "dimension";
69
+ readonly DISPLAY: "display";
70
+ readonly LAYOUT: "layout";
71
+ readonly POSITION: "position";
72
+ readonly MISC: "misc";
73
+ };
74
+ type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];
75
+ /**
76
+ * Pre-computed map for O(1) style-to-chunk lookup.
77
+ * Built once at module load time.
78
+ */
79
+ declare const STYLE_TO_CHUNK: Map<string, ChunkName>;
80
+ interface ChunkInfo$1 {
81
+ /** Name of the chunk */
82
+ name: ChunkName | string;
83
+ /** Style keys belonging to this chunk */
84
+ styleKeys: string[];
85
+ }
86
+ /**
87
+ * Categorize style keys into chunks.
88
+ *
89
+ * Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
90
+ * of the order of keys in the input styles object.
91
+ *
92
+ * @param styles - The styles object to categorize
93
+ * @returns Map of chunk name to array of style keys in that chunk (in priority order)
94
+ */
95
+ declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<string, string[]>;
96
+ //#endregion
97
+ //#region src/styles/list.d.ts
98
+ declare const BASE_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition"];
99
+ declare const POSITION_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin"];
100
+ declare const BLOCK_INNER_STYLES: readonly ["padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign"];
101
+ declare const BLOCK_OUTER_STYLES: readonly ["border", "radius", "shadow", "outline"];
102
+ declare const BLOCK_STYLES: readonly ["padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "border", "radius", "shadow", "outline"];
103
+ declare const COLOR_STYLES: readonly ["color", "fill", "fade", "image"];
104
+ declare const TEXT_STYLES: readonly ["textTransform", "fontWeight", "fontStyle"];
105
+ declare const DIMENSION_STYLES: readonly ["width", "height", "flexBasis", "flexGrow", "flexShrink", "flex"];
106
+ declare const FLOW_STYLES: readonly ["flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
107
+ declare const CONTAINER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin", "padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "border", "radius", "shadow", "outline", "flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
108
+ declare const OUTER_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "border", "radius", "shadow", "outline"];
109
+ declare const INNER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
110
+ //#endregion
111
+ //#region src/types.d.ts
112
+ interface GlobalStyledProps {
113
+ breakpoints?: number[];
114
+ }
115
+ /**
116
+ * Extensible interface for theme names.
117
+ * Augment this interface to register project-specific theme names for autocomplete.
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * declare module '@tenphi/tasty' {
122
+ * interface TastyThemeNames {
123
+ * danger: true;
124
+ * success: true;
125
+ * }
126
+ * }
127
+ * ```
128
+ */
129
+ interface TastyThemeNames {}
130
+ type ThemeNameKey = Extract<keyof TastyThemeNames, string>;
131
+ type ThemeName = [ThemeNameKey] extends [never] ? string : ThemeNameKey;
132
+ /** Allowed mod value types */
133
+ type ModValue = boolean | string | number | undefined | null;
134
+ /**
135
+ * Type for element modifiers (mods prop).
136
+ * Can be used as a generic to define known modifiers with autocomplete:
137
+ * @example
138
+ * type ButtonMods = Mods<{
139
+ * loading?: boolean;
140
+ * selected?: boolean;
141
+ * }>;
142
+ */
143
+ type Mods<T extends Record<string, ModValue> = Record<string, ModValue>> = T & Record<string, ModValue>;
144
+ /**
145
+ * Token value: string or number (processed), boolean for special handling, undefined/null (skipped).
146
+ * For color tokens (#name), boolean `true` is converted to `transparent`.
147
+ * For non-color tokens ($name), boolean `true` results in an empty string value.
148
+ * Boolean `false` results in no CSS output (token is skipped).
149
+ */
150
+ type TokenValue = string | number | boolean | undefined | null;
151
+ /**
152
+ * Tokens definition for inline CSS custom properties.
153
+ * - `$name` keys become `--name` CSS properties
154
+ * - `#name` keys become `--name-color` and `--name-color-{colorSpace}` CSS properties
155
+ */
156
+ type Tokens = Record<`$${string}` | `#${string}`, TokenValue>;
157
+ type Caps = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
158
+ interface BasePropsWithoutChildren<K extends TagName = TagName> extends Pick<AllHTMLAttributes<HTMLElement>, 'className' | 'role' | 'id'> {
159
+ /** The HTML tag or React component to render as */
160
+ as?: K | ComponentType<any>;
161
+ /** QA ID for e2e testing. An alias for `data-qa` attribute. */
162
+ qa?: string;
163
+ /** QA value for e2e testing. An alias for `data-qaval` attribute. */
164
+ qaVal?: string | number;
165
+ /** Inner element name */
166
+ element?: `${Caps}${string}`;
167
+ /** The style map */
168
+ styles?: Styles;
169
+ /** The list of responsive points in pixels */
170
+ breakpoints?: number[];
171
+ /** Whether the element has the block layout outside */
172
+ block?: boolean;
173
+ /** Whether the element has the inline layout outside */
174
+ inline?: boolean;
175
+ /** The list of element modifiers **/
176
+ mods?: Mods;
177
+ /** Whether the element is hidden (`hidden` attribute is set) */
178
+ isHidden?: boolean;
179
+ /** Whether the element is disabled (`disabled` attribute is set) */
180
+ isDisabled?: boolean;
181
+ /** Plain css for the element */
182
+ css?: string;
183
+ /** The CSS style map */
184
+ style?: CSSProperties$1 | (CSSProperties$1 & Record<string, string | number | null | undefined>);
185
+ /** User-defined theme for the element. Mapped to `data-theme` attribute. Augment `TastyThemeNames` to register project-specific themes for autocomplete. */
186
+ theme?: ThemeName | (string & {});
187
+ /** CSS custom property tokens rendered as inline styles */
188
+ tokens?: Tokens;
189
+ }
190
+ interface BaseProps<K extends TagName = TagName> extends BasePropsWithoutChildren<K>, Pick<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'children'> {}
191
+ interface AllBaseProps<K extends TagName = TagName> extends BaseProps<K>, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style' | 'disabled' | 'hidden' | 'css' | 'content' | 'translate' | 'as' | 'form' | 'bgcolor' | 'background' | 'align' | 'border' | 'color' | 'height' | 'size' | 'width' | 'prefix'> {}
192
+ type BaseStyleProps = Pick<Styles, (typeof BASE_STYLES)[number]>;
193
+ type PositionStyleProps = Pick<Styles, (typeof POSITION_STYLES)[number]>;
194
+ type BlockStyleProps = Pick<Styles, (typeof BLOCK_STYLES)[number]>;
195
+ type BlockInnerStyleProps = Pick<Styles, (typeof BLOCK_INNER_STYLES)[number]>;
196
+ type BlockOuterStyleProps = Pick<Styles, (typeof BLOCK_OUTER_STYLES)[number]>;
197
+ type ColorStyleProps = Pick<Styles, (typeof COLOR_STYLES)[number]>;
198
+ type TextStyleProps = Pick<Styles, (typeof TEXT_STYLES)[number]>;
199
+ type DimensionStyleProps = Pick<Styles, (typeof DIMENSION_STYLES)[number]>;
200
+ type FlowStyleProps = Pick<Styles, (typeof FLOW_STYLES)[number]>;
201
+ type ContainerStyleProps = Pick<Styles, (typeof CONTAINER_STYLES)[number]>;
202
+ type OuterStyleProps = Pick<Styles, (typeof OUTER_STYLES)[number]>;
203
+ type InnerStyleProps = Pick<Styles, (typeof INNER_STYLES)[number]>;
204
+ interface ShortGridStyles {
205
+ template?: Styles['gridTemplate'];
206
+ columns?: Styles['gridColumns'];
207
+ rows?: Styles['gridRows'];
208
+ areas?: Styles['gridAreas'];
209
+ }
210
+ type Props = Record<string, any>;
211
+ type TagName = keyof HTMLElementTagNameMap;
212
+ /**
213
+ * Configuration type for tasty.config.ts files.
214
+ * Used by the Tasty VSCode extension for validation and autocomplete.
215
+ *
216
+ * @example
217
+ * ```typescript
218
+ * import type { TastyExtensionConfig } from '@tenphi/tasty';
219
+ *
220
+ * const config: TastyExtensionConfig = {
221
+ * tokens: ['#primary', '#danger', '$spacing'],
222
+ * units: ['x', 'r', 'bw'],
223
+ * states: ['@mobile', '@tablet', '@dark'],
224
+ * presets: ['h1', 'h2', 't1', 't2'],
225
+ * };
226
+ *
227
+ * export default config;
228
+ * ```
229
+ */
230
+ interface TastyExtensionConfig {
231
+ /**
232
+ * Extend another config file. Path is relative to this config file.
233
+ * The extended config is merged first, then this config's values are added.
234
+ * @example '../tasty.config.ts'
235
+ */
236
+ extends?: string;
237
+ /**
238
+ * Valid token names for validation and autocomplete.
239
+ * Use # prefix for colors, $ prefix for custom properties.
240
+ * Set to `false` to disable token validation (overrides parent).
241
+ * @example ['#primary', '#danger', '$spacing', '$gap']
242
+ */
243
+ tokens?: false | string[];
244
+ /**
245
+ * Valid custom unit names.
246
+ * Set to `false` to disable unit validation (overrides parent).
247
+ * @example ['x', 'r', 'bw', 'cols']
248
+ */
249
+ units?: false | string[];
250
+ /**
251
+ * Valid custom function names.
252
+ * Set to `false` to disable function validation (overrides parent).
253
+ * @example ['clamp', 'double']
254
+ */
255
+ funcs?: false | string[];
256
+ /**
257
+ * State alias names for autocomplete.
258
+ * Must start with @ prefix.
259
+ * @example ['@mobile', '@tablet', '@dark']
260
+ */
261
+ states?: string[];
262
+ /**
263
+ * Valid preset names for the `preset` style property.
264
+ * Tasty has no built-in presets - they are project-specific.
265
+ * @example ['h1', 'h2', 'h3', 't1', 't2', 't3', 'tag']
266
+ */
267
+ presets?: string[];
268
+ /**
269
+ * Custom style property names added via configure({ handlers }).
270
+ * Suppresses "unknown property" warnings for these names.
271
+ * @example ['myGradient', 'customLayout', 'brandBorder']
272
+ */
273
+ styles?: string[];
274
+ /**
275
+ * Descriptions for presets, shown on hover in the extension.
276
+ * Maps preset names to human-readable descriptions.
277
+ * @example { h1: 'Heading 1 (36px/44px, semibold)', t1: 'Text large (18px/24px)' }
278
+ */
279
+ presetDescriptions?: Record<string, string>;
280
+ /**
281
+ * Descriptions for state aliases, shown on hover in the extension.
282
+ * Maps state names to human-readable descriptions.
283
+ * @example { '@mobile': 'Mobile viewport (width < 768px)' }
284
+ */
285
+ stateDescriptions?: Record<string, string>;
286
+ }
287
+ //#endregion
288
+ //#region src/tasty.d.ts
289
+ type StyleList = readonly (keyof { [key in keyof StylesInterface]: StylesInterface[key] })[];
290
+ /** Type descriptor for a single mod prop: a JS constructor or an enum array. */
291
+ type ModPropDef = BooleanConstructor | StringConstructor | NumberConstructor | readonly string[];
292
+ /** Array form: list of mod key names (types default to ModValue). */
293
+ type ModPropsList = readonly string[];
294
+ /** Object form: map of mod key names to type descriptors. */
295
+ type ModPropsMap = Readonly<Record<string, ModPropDef>>;
296
+ /** Either array or object form accepted by `modProps` option. */
297
+ type ModPropsInput = ModPropsList | ModPropsMap;
298
+ /** Resolve a single ModPropDef to its TypeScript type. */
299
+ type ResolveModPropDef<T> = T extends BooleanConstructor ? boolean : T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends readonly (infer U)[] ? U : ModValue;
300
+ /** Resolve an entire `modProps` definition to the component prop types it adds. */
301
+ type ResolveModProps<M extends ModPropsInput> = M extends readonly (infer K)[] ? Partial<Record<K & string, ModValue>> : M extends Record<string, ModPropDef> ? { [key in keyof M & string]?: ResolveModPropDef<M[key]> } : {};
302
+ /** A token key with `$` or `#` prefix. */
303
+ type TokenPropKey = `$${string}` | `#${string}`;
304
+ /** Array form: list of prop names. Names ending in `Color` map to `#` color tokens. */
305
+ type TokenPropsList = readonly string[];
306
+ /** Object form: prop name -> token key with explicit `$`/`#` prefix. */
307
+ type TokenPropsMap = Readonly<Record<string, TokenPropKey>>;
308
+ /** Either array or object form accepted by `tokenProps` option. */
309
+ type TokenPropsInput = TokenPropsList | TokenPropsMap;
310
+ /** Resolve a `tokenProps` definition to the component prop types it adds. */
311
+ type ResolveTokenProps<TP extends TokenPropsInput> = TP extends readonly (infer K)[] ? Partial<Record<K & string, TokenValue>> : TP extends Record<string, TokenPropKey> ? Partial<Record<keyof TP & string, TokenValue>> : {};
312
+ type PropsWithStyles = {
313
+ styles?: Styles;
314
+ } & Omit<Props, 'styles'>;
315
+ type VariantMap = Record<string, Styles>;
316
+ interface WithVariant<V extends VariantMap> {
317
+ variant?: keyof V;
318
+ }
319
+ /**
320
+ * Definition for a sub-element. Can be either:
321
+ * - A tag name string (e.g., 'div', 'span')
322
+ * - An object with configuration options
323
+ */
324
+ type SubElementDefinition<Tag extends keyof JSX.IntrinsicElements = 'div'> = Tag | {
325
+ as?: Tag;
326
+ qa?: string;
327
+ qaVal?: string | number;
328
+ };
329
+ /**
330
+ * Map of sub-element definitions.
331
+ * Keys become the sub-component names (e.g., { Icon: 'span' } -> Component.Icon)
332
+ */
333
+ type ElementsDefinition = Record<string, SubElementDefinition<keyof JSX.IntrinsicElements>>;
334
+ /**
335
+ * Resolves the tag from a SubElementDefinition
336
+ */
337
+ type ResolveElementTag<T extends SubElementDefinition<any>> = T extends string ? T : T extends {
338
+ as?: infer Tag;
339
+ } ? Tag extends keyof JSX.IntrinsicElements ? Tag : 'div' : 'div';
340
+ /**
341
+ * Props for sub-element components.
342
+ * Combines HTML attributes with tasty-specific props (qa, qaVal, mods, tokens, isDisabled, etc.)
343
+ */
344
+ type SubElementProps<Tag extends keyof JSX.IntrinsicElements = 'div'> = Omit<JSX.IntrinsicElements[Tag], 'ref' | 'color' | 'content' | 'translate'> & {
345
+ qa?: string;
346
+ qaVal?: string | number;
347
+ mods?: Mods;
348
+ tokens?: Tokens;
349
+ isDisabled?: boolean;
350
+ isHidden?: boolean;
351
+ isChecked?: boolean;
352
+ };
353
+ /**
354
+ * Generates the sub-element component types from an ElementsDefinition
355
+ */
356
+ type SubElementComponents<E extends ElementsDefinition> = { [K in keyof E]: ForwardRefExoticComponent<PropsWithoutRef<SubElementProps<ResolveElementTag<E[K]>>> & RefAttributes<ResolveElementTag<E[K]> extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[ResolveElementTag<E[K]>] : Element$1>> };
357
+ /**
358
+ * Base type containing common properties shared between TastyProps and TastyElementOptions.
359
+ * Separated to avoid code duplication while allowing different type constraints.
360
+ */
361
+ type TastyBaseProps<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = {
362
+ /** Default styles of the element. */styles?: Styles; /** The list of styles that can be provided by props */
363
+ styleProps?: K; /** Modifier keys exposed as top-level component props (array or typed object form). */
364
+ modProps?: M; /** Token keys exposed as top-level component props (array or typed object form). */
365
+ tokenProps?: TP;
366
+ element?: BaseProps['element'];
367
+ variants?: V; /** Default tokens for inline CSS custom properties */
368
+ tokens?: Tokens; /** Sub-element definitions for compound components */
369
+ elements?: E;
370
+ } & Pick<BaseProps, 'qa' | 'qaVal'> & WithVariant<V>;
371
+ type TastyProps<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, DefaultProps = Props, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = TastyBaseProps<K, V, E, M, TP> & {
372
+ /** The tag name of the element or a React component. */as?: string | ComponentType<any>;
373
+ } & Partial<Omit<DefaultProps, 'as' | 'styles' | 'styleProps' | 'modProps' | 'tokenProps' | 'tokens'>>;
374
+ /**
375
+ * Resolves the props of a polymorphic `as` value (intrinsic tag or component).
376
+ * - For intrinsic tags (`'div'`, `'button'`, ...): returns `JSX.IntrinsicElements[Tag]`.
377
+ * - For React component types: returns the component's own props.
378
+ * - Falls back to an empty record for anything else.
379
+ */
380
+ type ResolveAsProps<AsType extends ElementType> = AsType extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[AsType] : AsType extends ComponentType<infer P> ? P : Record<string, never>;
381
+ /**
382
+ * TastyElementOptions is used for the element-creation overload of tasty().
383
+ * It includes an `AsType` generic that allows TypeScript to infer the correct
384
+ * element type from the `as` prop — both for intrinsic tags and for React
385
+ * components (so the wrapped component's prop API is preserved).
386
+ *
387
+ * Note: Uses a separate index signature with `unknown` instead of inheriting
388
+ * from Props (which has `any`) to ensure strict type checking for styles.
389
+ */
390
+ type TastyElementOptions<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, AsType extends ElementType = 'div', M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = TastyBaseProps<K, V, E, M, TP> & {
391
+ /** The tag name of the element or a React component. */as?: AsType;
392
+ } & Record<string, unknown>;
393
+ type AllBasePropsWithMods<K extends StyleList, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = AllBaseProps & { [key in K[number]]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> } & BaseStyleProps & ResolveModProps<M> & ResolveTokenProps<TP>;
394
+ /**
395
+ * Keys from BasePropsWithoutChildren that should be omitted from HTML attributes.
396
+ * This excludes event handlers so they can be properly typed from JSX.IntrinsicElements.
397
+ */
398
+ type TastySpecificKeys = 'as' | 'qa' | 'qaVal' | 'element' | 'styles' | 'breakpoints' | 'block' | 'inline' | 'mods' | 'isHidden' | 'isDisabled' | 'css' | 'style' | 'theme' | 'tokens' | 'ref' | 'color';
399
+ /** Extract prop key names from a ModPropsInput (array elements or object keys). */
400
+ type ModPropsKeys<M extends ModPropsInput> = M extends readonly (infer K)[] ? K & string : keyof M & string;
401
+ /** Extract prop key names from a TokenPropsInput (array elements or object keys). */
402
+ type TokenPropsKeys<TP extends TokenPropsInput> = TP extends readonly (infer K)[] ? K & string : keyof TP & string;
403
+ /**
404
+ * Props type for tasty elements that combines:
405
+ * - AllBasePropsWithMods for style props with strict tokens type
406
+ * - HTML attributes for flexibility (properly typed based on `as`)
407
+ * - Variant support
408
+ *
409
+ * AllBasePropsWithMods carries generic AllHTMLAttributes which can conflict
410
+ * with element-specific types (e.g. `src` is `string` in AllHTMLAttributes but
411
+ * `string | Blob` in ImgHTMLAttributes, or the custom props on a third-party
412
+ * component like Next.js `Link`). To avoid intersection-narrowing, we Omit
413
+ * element-specific keys from AllBasePropsWithMods (keeping TastySpecificKeys,
414
+ * style props, mod props, and token props) and let the resolved `as` props
415
+ * supply the authoritative attribute types. The `AllHTMLAttributes<HTMLElement>`
416
+ * baseline is preserved so generic HTML attributes still work even when `as`
417
+ * is a component type with a narrower prop API.
418
+ */
419
+ type TastyElementProps<K extends StyleList, V extends VariantMap, AsType extends ElementType = 'div', M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]> = Omit<AllBasePropsWithMods<K, M, TP>, Exclude<keyof ResolveAsProps<AsType>, TastySpecificKeys | K[number] | ModPropsKeys<M> | TokenPropsKeys<TP>>> & WithVariant<V> & Omit<Omit<AllHTMLAttributes<HTMLElement>, keyof ResolveAsProps<AsType>> & ResolveAsProps<AsType>, TastySpecificKeys | K[number] | ModPropsKeys<M> | TokenPropsKeys<TP>>;
420
+ type TastyComponentPropsWithDefaults<Props extends PropsWithStyles, DefaultProps extends Partial<Props>> = keyof DefaultProps extends never ? Props : { [key in Extract<keyof Props, keyof DefaultProps>]?: Props[key] } & { [key in keyof Omit<Props, keyof DefaultProps>]: Props[key] };
421
+ /**
422
+ * The component type returned by the `tasty(options)` element-factory overload.
423
+ *
424
+ * It's a regular React forward-ref component whose props are typed from the
425
+ * factory-time `as` value. Polymorphism is at factory time: each call to
426
+ * `tasty({ as: X })` produces a component whose prop API includes `X`'s own
427
+ * props (so `tasty({ as: NextLink })` exposes `href`, `replace`, `prefetch`,
428
+ * etc.) alongside the Tasty-specific props (`mods`, `tokens`, `styleProps`,
429
+ * `modProps`, `tokenProps`).
430
+ *
431
+ * Note: a render-time `<X as={SomeComponent} />` does not re-infer props from
432
+ * `SomeComponent`; create another `tasty({ as: SomeComponent })` for that.
433
+ */
434
+ type TastyPolymorphicComponent<DefaultAs extends ElementType, K extends StyleList, V extends VariantMap, M extends ModPropsInput, TP extends TokenPropsInput> = ForwardRefExoticComponent<PropsWithoutRef<TastyElementProps<K, V, DefaultAs, M, TP>> & RefAttributes<unknown>>;
435
+ declare function tasty<K extends StyleList, V extends VariantMap, E extends ElementsDefinition = Record<string, never>, AsType extends ElementType = 'div', M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]>(options: TastyElementOptions<K, V, E, AsType, M, TP>, secondArg?: never): TastyPolymorphicComponent<AsType, K, V, M, TP> & SubElementComponents<E>;
436
+ declare function tasty<Props extends PropsWithStyles, DefaultProps extends Partial<Props> = Partial<Props>, K extends StyleList = readonly never[], V extends VariantMap = VariantMap, E extends ElementsDefinition = Record<string, never>, M extends ModPropsInput = readonly never[], TP extends TokenPropsInput = readonly never[]>(Component: ComponentType<Props>, options?: TastyProps<K, V, E, Props, M, TP>): ComponentType<TastyComponentPropsWithDefaults<Props, DefaultProps>>;
437
+ declare const Element$1: TastyPolymorphicComponent<"div", StyleList, VariantMap, readonly never[], readonly never[]> & SubElementComponents<Record<string, never>>;
438
+ //#endregion
439
+ //#region src/hooks/useStyles.d.ts
440
+ /**
441
+ * Tasty styles object to generate CSS classes for.
442
+ * Can be undefined or empty object for no styles.
443
+ */
444
+ type UseStylesOptions = Styles | undefined;
445
+ interface UseStylesResult {
446
+ /**
447
+ * Generated className(s) to apply to the element.
448
+ * Can be empty string if no styles are provided.
449
+ * With chunking enabled, may contain multiple space-separated class names.
450
+ */
451
+ className: string;
452
+ }
453
+ /**
454
+ * Hook to generate CSS classes from Tasty styles.
455
+ * Thin wrapper around `computeStyles()` that adds React context-based
456
+ * SSR collector discovery for backward compatibility with TastyRegistry.
457
+ *
458
+ * For hook-free usage (e.g. in server components), use `computeStyles()` directly.
459
+ *
460
+ * @example
461
+ * ```tsx
462
+ * function MyComponent() {
463
+ * const { className } = useStyles({
464
+ * padding: '2x',
465
+ * fill: '#purple',
466
+ * radius: '1r',
467
+ * });
468
+ *
469
+ * return <div className={className}>Styled content</div>;
470
+ * }
471
+ * ```
472
+ */
473
+ declare function useStyles(styles: UseStylesOptions, options?: {
474
+ root?: Document | ShadowRoot;
475
+ }): UseStylesResult;
476
+ //#endregion
477
+ //#region src/hooks/useGlobalStyles.d.ts
478
+ interface UseGlobalStylesOptions {
479
+ /**
480
+ * Stable identifier for update tracking (client-only). When provided,
481
+ * changing the styles will dispose the previous injection and inject the
482
+ * new one. Without an id, the selector is used as the slot key.
483
+ * In RSC mode, renders are single-pass so update tracking does not apply.
484
+ */
485
+ id?: string;
486
+ /** Shadow root or document to inject into (client only). */
487
+ root?: Document | ShadowRoot;
488
+ }
489
+ /**
490
+ * Inject global styles for a given selector.
491
+ * Useful for styling elements by selector without generating classNames.
492
+ *
493
+ * SSR-aware: when a ServerStyleCollector is available, CSS is collected
494
+ * during the render phase instead of being injected into the DOM.
495
+ *
496
+ * Works in all environments: client, SSR with collector, and React Server Components.
497
+ *
498
+ * Injected styles are permanent — they are not cleaned up on component unmount.
499
+ * Use the `id` option for update tracking when styles change over the
500
+ * component lifecycle.
501
+ *
502
+ * @param selector - CSS selector to apply styles to (e.g., '.my-class', ':root', 'body')
503
+ * @param styles - Tasty styles object
504
+ * @param options - Optional settings including `id` for update tracking
505
+ *
506
+ * @example
507
+ * ```tsx
508
+ * function MyComponent() {
509
+ * useGlobalStyles('.card', {
510
+ * padding: '2x',
511
+ * radius: '1r',
512
+ * fill: '#white',
513
+ * });
514
+ *
515
+ * return <div className="card">Content</div>;
516
+ * }
517
+ * ```
518
+ */
519
+ declare function useGlobalStyles(selector: string, styles?: Styles, options?: UseGlobalStylesOptions): void;
520
+ //#endregion
521
+ //#region src/hooks/useRawCSS.d.ts
522
+ interface UseRawCSSOptions {
523
+ /**
524
+ * Shadow root or document to inject into.
525
+ * Note: `root` is not part of the update-tracking comparison — changing
526
+ * only the root for the same id/content will not re-inject.
527
+ */
528
+ root?: Document | ShadowRoot;
529
+ /**
530
+ * Stable identifier for update tracking (client-only). When provided,
531
+ * changing the CSS content will dispose the previous injection and inject
532
+ * the new one. Without an id, deduplication is purely content-based (same
533
+ * CSS is injected only once). In RSC mode, renders are single-pass so
534
+ * update tracking does not apply.
535
+ */
536
+ id?: string;
537
+ }
538
+ declare function useRawCSS(css: string, options?: UseRawCSSOptions): void;
539
+ declare function useRawCSS(factory: () => string, deps: readonly unknown[], options?: UseRawCSSOptions): void;
540
+ //#endregion
541
+ //#region src/hooks/useKeyframes.d.ts
542
+ interface UseKeyframesOptions {
543
+ name?: string;
544
+ root?: Document | ShadowRoot;
545
+ }
546
+ /**
547
+ * Inject CSS @keyframes and return the generated animation name.
548
+ * Deduplicates by content — identical steps always return the same name.
549
+ *
550
+ * Works in all environments: client, SSR with collector, and React Server Components.
551
+ *
552
+ * @example Basic usage - steps object is the dependency
553
+ * ```tsx
554
+ * function MyComponent() {
555
+ * const bounce = useKeyframes({
556
+ * '0%': { transform: 'scale(1)' },
557
+ * '50%': { transform: 'scale(1.1)' },
558
+ * '100%': { transform: 'scale(1)' },
559
+ * });
560
+ *
561
+ * return <div style={{ animation: `${bounce} 1s infinite` }}>Bouncing</div>;
562
+ * }
563
+ * ```
564
+ *
565
+ * @example With custom name
566
+ * ```tsx
567
+ * function MyComponent() {
568
+ * const fadeIn = useKeyframes(
569
+ * { from: { opacity: 0 }, to: { opacity: 1 } },
570
+ * { name: 'fadeIn' }
571
+ * );
572
+ *
573
+ * return <div style={{ animation: `${fadeIn} 0.3s ease-out` }}>Fading in</div>;
574
+ * }
575
+ * ```
576
+ *
577
+ * @example Factory function with dependencies
578
+ * ```tsx
579
+ * function MyComponent({ scale }: { scale: number }) {
580
+ * const pulse = useKeyframes(
581
+ * () => ({
582
+ * '0%': { transform: 'scale(1)' },
583
+ * '100%': { transform: `scale(${scale})` },
584
+ * }),
585
+ * [scale]
586
+ * );
587
+ *
588
+ * return <div style={{ animation: `${pulse} 1s infinite` }}>Pulsing</div>;
589
+ * }
590
+ * ```
591
+ */
592
+ declare function useKeyframes(steps: KeyframesSteps, options?: UseKeyframesOptions): string;
593
+ declare function useKeyframes(factory: () => KeyframesSteps, deps: readonly unknown[], options?: UseKeyframesOptions): string;
594
+ //#endregion
595
+ //#region src/hooks/useProperty.d.ts
596
+ interface UsePropertyOptions {
597
+ /**
598
+ * CSS syntax string for the property (e.g., '<color>', '<length>', '<angle>').
599
+ * For color tokens (#name), this is auto-set to '<color>' and cannot be overridden.
600
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
601
+ */
602
+ syntax?: string;
603
+ /**
604
+ * Whether the property inherits from parent elements
605
+ * @default true
606
+ */
607
+ inherits?: boolean;
608
+ /**
609
+ * Initial value for the property.
610
+ * For color tokens (#name), this defaults to 'transparent' if not specified.
611
+ */
612
+ initialValue?: string | number;
613
+ /**
614
+ * Shadow root or document to inject into
615
+ */
616
+ root?: Document | ShadowRoot;
617
+ }
618
+ /**
619
+ * Register a CSS @property custom property.
620
+ * This enables advanced features like animating custom properties.
621
+ *
622
+ * Note: @property rules are global and persistent once defined.
623
+ * The function ensures the property is only registered once per root.
624
+ *
625
+ * Accepts tasty token syntax for the property name:
626
+ * - `$name` → defines `--name`
627
+ * - `#name` → defines `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
628
+ * - `--name` → defines `--name` (legacy format)
629
+ *
630
+ * Works in all environments: client, SSR with collector, and React Server Components.
631
+ *
632
+ * @param name - The property token ($name, #name) or CSS property name (--name)
633
+ * @param options - Property configuration
634
+ *
635
+ * @example Basic property with token syntax
636
+ * ```tsx
637
+ * function Spinner() {
638
+ * useProperty('$rotation', {
639
+ * syntax: '<angle>',
640
+ * inherits: false,
641
+ * initialValue: '0deg',
642
+ * });
643
+ *
644
+ * return <div className="spinner" />;
645
+ * }
646
+ * ```
647
+ *
648
+ * @example Color property with token syntax (auto-sets syntax)
649
+ * ```tsx
650
+ * function MyComponent() {
651
+ * useProperty('#theme', {
652
+ * initialValue: 'red', // syntax: '<color>' is auto-set
653
+ * });
654
+ *
655
+ * // Now --theme-color can be animated with CSS transitions
656
+ * return <div style={{ '--theme-color': 'blue' } as React.CSSProperties}>Colored</div>;
657
+ * }
658
+ * ```
659
+ *
660
+ * @example Legacy format (still supported)
661
+ * ```tsx
662
+ * function ResizableBox() {
663
+ * useProperty('--box-size', {
664
+ * syntax: '<length>',
665
+ * initialValue: '100px',
666
+ * });
667
+ *
668
+ * return <div style={{ width: 'var(--box-size)' }} />;
669
+ * }
670
+ * ```
671
+ */
672
+ declare function useProperty(name: string, options?: UsePropertyOptions): void;
673
+ //#endregion
674
+ //#region src/hooks/useFontFace.d.ts
675
+ interface UseFontFaceOptions {
676
+ root?: Document | ShadowRoot;
677
+ }
678
+ /**
679
+ * Inject CSS @font-face rules.
680
+ * Permanent — no cleanup on unmount. Deduplicates by content hash.
681
+ *
682
+ * Works in all environments: client, SSR with collector, and React Server Components.
683
+ *
684
+ * @param family - The font-family name
685
+ * @param input - Single descriptor object or array of descriptors (for multiple weights/styles)
686
+ * @param options - Optional settings (e.g. Shadow DOM root)
687
+ *
688
+ * @example Single weight
689
+ * ```tsx
690
+ * function App() {
691
+ * useFontFace('Brand Sans', {
692
+ * src: 'url("/fonts/brand-sans.woff2") format("woff2")',
693
+ * fontWeight: '400 700',
694
+ * fontDisplay: 'swap',
695
+ * });
696
+ *
697
+ * return <div style={{ fontFamily: '"Brand Sans", sans-serif' }}>Hello</div>;
698
+ * }
699
+ * ```
700
+ *
701
+ * @example Multiple weights
702
+ * ```tsx
703
+ * function App() {
704
+ * useFontFace('Brand Sans', [
705
+ * { src: 'url("/fonts/brand-regular.woff2") format("woff2")', fontWeight: 400, fontDisplay: 'swap' },
706
+ * { src: 'url("/fonts/brand-bold.woff2") format("woff2")', fontWeight: 700, fontDisplay: 'swap' },
707
+ * ]);
708
+ *
709
+ * return <div style={{ fontFamily: '"Brand Sans", sans-serif' }}>Hello</div>;
710
+ * }
711
+ * ```
712
+ */
713
+ declare function useFontFace(family: string, input: FontFaceInput, options?: UseFontFaceOptions): void;
714
+ //#endregion
715
+ //#region src/hooks/useCounterStyle.d.ts
716
+ interface UseCounterStyleOptions {
717
+ name?: string;
718
+ root?: Document | ShadowRoot;
719
+ }
720
+ /**
721
+ * Inject a CSS @counter-style rule and return the generated name.
722
+ * Permanent — no cleanup on unmount. Deduplicates by name.
723
+ *
724
+ * Works in all environments: client, SSR with collector, and React Server Components.
725
+ *
726
+ * @example Basic usage
727
+ * ```tsx
728
+ * function EmojiList() {
729
+ * const styleName = useCounterStyle({
730
+ * system: 'cyclic',
731
+ * symbols: '"👍"',
732
+ * suffix: '" "',
733
+ * }, { name: 'thumbs' });
734
+ *
735
+ * return (
736
+ * <ol style={{ listStyleType: styleName }}>
737
+ * <li>First</li>
738
+ * <li>Second</li>
739
+ * </ol>
740
+ * );
741
+ * }
742
+ * ```
743
+ *
744
+ */
745
+ declare function useCounterStyle(descriptors: CounterStyleDescriptors, options?: UseCounterStyleOptions): string;
746
+ //#endregion
747
+ //#region src/utils/get-display-name.d.ts
748
+ declare function getDisplayName<T>(Component: ElementType<T>, fallbackName?: string): string;
749
+ //#endregion
750
+ //#region src/index.d.ts
751
+ declare module './utils/css-types' {
752
+ interface CSSProperties extends CSSProperties {}
753
+ }
754
+ //#endregion
755
+ //#region src/styles/border.d.ts
756
+ /**
757
+ * Border style handler with multi-group support.
758
+ *
759
+ * Single group (backward compatible):
760
+ * - `border="1bw solid #red"` - all sides
761
+ * - `border="1bw solid #red top left"` - only top and left
762
+ *
763
+ * Multi-group (new):
764
+ * - `border="1bw #red, 2bw #blue top"` - all sides red 1bw, then top overridden to blue 2bw
765
+ * - `border="1bw, dashed top bottom, #purple left right"` - base 1bw, dashed on top/bottom, purple on left/right
766
+ *
767
+ * Later groups override earlier groups for conflicting directions.
768
+ */
769
+ declare function borderStyle({
770
+ border
771
+ }: {
772
+ border?: string | number | boolean;
773
+ }): Record<string, string> | null;
774
+ declare namespace borderStyle {
775
+ var __lookupStyles: string[];
776
+ }
777
+ //#endregion
778
+ //#region src/styles/color.d.ts
779
+ declare function colorStyle({
780
+ color
781
+ }: {
782
+ color?: string | boolean;
783
+ }): {
784
+ color: string;
785
+ } | null;
786
+ declare namespace colorStyle {
787
+ var __lookupStyles: string[];
788
+ }
789
+ //#endregion
790
+ //#region src/styles/display.d.ts
791
+ interface DisplayStyleProps {
792
+ display?: string;
793
+ hide?: boolean;
794
+ textOverflow?: string | boolean;
795
+ overflow?: string;
796
+ whiteSpace?: string;
797
+ }
798
+ /**
799
+ * Handles display, hide, textOverflow, overflow, and whiteSpace styles.
800
+ *
801
+ * Priority:
802
+ * 1. `hide` takes precedence (display: none)
803
+ * 2. Multi-line `textOverflow` forces display: -webkit-box
804
+ * 3. Single-line `textOverflow` defaults white-space to nowrap
805
+ * 4. Explicit `whiteSpace` overrides the default from `textOverflow`
806
+ */
807
+ declare function displayStyle({
808
+ display,
809
+ hide,
810
+ textOverflow,
811
+ overflow,
812
+ whiteSpace
813
+ }: DisplayStyleProps): Record<string, string | number> | null;
814
+ declare namespace displayStyle {
815
+ var __lookupStyles: string[];
816
+ }
817
+ //#endregion
818
+ //#region src/styles/fade.d.ts
819
+ declare function fadeStyle({
820
+ fade
821
+ }: {
822
+ fade?: string;
823
+ }): {
824
+ mask: string;
825
+ 'mask-composite': string;
826
+ } | null;
827
+ declare namespace fadeStyle {
828
+ var __lookupStyles: string[];
829
+ }
830
+ //#endregion
831
+ //#region src/styles/fill.d.ts
832
+ declare function fillStyle({
833
+ fill,
834
+ backgroundColor,
835
+ image,
836
+ backgroundImage,
837
+ backgroundPosition,
838
+ backgroundSize,
839
+ backgroundRepeat,
840
+ backgroundAttachment,
841
+ backgroundOrigin,
842
+ backgroundClip,
843
+ background
844
+ }: {
845
+ fill?: string;
846
+ backgroundColor?: string;
847
+ image?: string;
848
+ backgroundImage?: string;
849
+ backgroundPosition?: string;
850
+ backgroundSize?: string;
851
+ backgroundRepeat?: string;
852
+ backgroundAttachment?: string;
853
+ backgroundOrigin?: string;
854
+ backgroundClip?: string;
855
+ background?: string;
856
+ }): Record<string, string> | null;
857
+ declare namespace fillStyle {
858
+ var __lookupStyles: string[];
859
+ }
860
+ declare function svgFillStyle({
861
+ svgFill
862
+ }: {
863
+ svgFill?: string;
864
+ }): {
865
+ fill: string;
866
+ } | null;
867
+ declare namespace svgFillStyle {
868
+ var __lookupStyles: string[];
869
+ }
870
+ //#endregion
871
+ //#region src/styles/flow.d.ts
872
+ declare function flowStyle({
873
+ display,
874
+ flow
875
+ }: {
876
+ display?: string;
877
+ flow?: string;
878
+ }): {
879
+ [x: string]: string | undefined;
880
+ } | null;
881
+ declare namespace flowStyle {
882
+ var __lookupStyles: string[];
883
+ }
884
+ //#endregion
885
+ //#region src/styles/gap.d.ts
886
+ declare function gapStyle({
887
+ display,
888
+ flow,
889
+ gap
890
+ }: {
891
+ display?: string;
892
+ flow?: string;
893
+ gap?: string | number | boolean;
894
+ }): {
895
+ gap: string;
896
+ $?: undefined;
897
+ } | ({
898
+ 'margin-right': string;
899
+ 'margin-bottom': string;
900
+ $?: undefined;
901
+ } | {
902
+ $: string;
903
+ 'margin-right': string;
904
+ 'margin-bottom': string;
905
+ })[] | {
906
+ [x: string]: string;
907
+ $: string;
908
+ gap?: undefined;
909
+ } | null;
910
+ declare namespace gapStyle {
911
+ var __lookupStyles: string[];
912
+ }
913
+ //#endregion
914
+ //#region src/styles/height.d.ts
915
+ interface HeightStyleProps {
916
+ height?: string | number | boolean;
917
+ minHeight?: string | number | boolean;
918
+ maxHeight?: string | number | boolean;
919
+ }
920
+ declare function heightStyle({
921
+ height,
922
+ minHeight,
923
+ maxHeight
924
+ }: HeightStyleProps): Record<string, string | string[]> | null;
925
+ declare namespace heightStyle {
926
+ var __lookupStyles: string[];
927
+ }
928
+ //#endregion
929
+ //#region src/styles/inset.d.ts
930
+ declare function insetStyle({
931
+ inset,
932
+ insetBlock,
933
+ insetInline,
934
+ top,
935
+ right,
936
+ bottom,
937
+ left
938
+ }: {
939
+ inset?: string | number | boolean;
940
+ insetBlock?: string | number | boolean;
941
+ insetInline?: string | number | boolean;
942
+ top?: string | number | boolean;
943
+ right?: string | number | boolean;
944
+ bottom?: string | number | boolean;
945
+ left?: string | number | boolean;
946
+ }): Record<string, string> | null;
947
+ declare namespace insetStyle {
948
+ var __lookupStyles: string[];
949
+ }
950
+ //#endregion
951
+ //#region src/styles/margin.d.ts
952
+ declare function marginStyle({
953
+ margin,
954
+ marginBlock,
955
+ marginInline,
956
+ marginTop,
957
+ marginRight,
958
+ marginBottom,
959
+ marginLeft
960
+ }: {
961
+ margin?: string | number | boolean;
962
+ marginBlock?: string | number | boolean;
963
+ marginInline?: string | number | boolean;
964
+ marginTop?: string | number | boolean;
965
+ marginRight?: string | number | boolean;
966
+ marginBottom?: string | number | boolean;
967
+ marginLeft?: string | number | boolean;
968
+ }): Record<string, string> | null;
969
+ declare namespace marginStyle {
970
+ var __lookupStyles: string[];
971
+ }
972
+ //#endregion
973
+ //#region src/styles/outline.d.ts
974
+ interface OutlineStyleProps {
975
+ outline?: string | boolean | number;
976
+ outlineOffset?: string | number;
977
+ }
978
+ /**
979
+ * Generates CSS for outline property with optional offset.
980
+ *
981
+ * Syntax:
982
+ * - `outline="2px solid #red"` - outline only
983
+ * - `outline="2px solid #red / 4px"` - outline with offset (slash separator)
984
+ * - `outline="2px / 4px"` - width with offset (simpler form)
985
+ * - `outline={true}` - default 1ow solid outline
986
+ * - `outlineOffset="4px"` - offset as separate prop (can be combined with outline)
987
+ *
988
+ * Priority: slash syntax in outline takes precedence over outlineOffset prop
989
+ *
990
+ * @return CSS properties for outline and optionally outline-offset
991
+ */
992
+ declare function outlineStyle({
993
+ outline,
994
+ outlineOffset
995
+ }: OutlineStyleProps): Record<string, string> | null;
996
+ declare namespace outlineStyle {
997
+ var __lookupStyles: string[];
998
+ }
999
+ //#endregion
1000
+ //#region src/styles/padding.d.ts
1001
+ declare function paddingStyle({
1002
+ padding,
1003
+ paddingBlock,
1004
+ paddingInline,
1005
+ paddingTop,
1006
+ paddingRight,
1007
+ paddingBottom,
1008
+ paddingLeft
1009
+ }: {
1010
+ padding?: string | number | boolean;
1011
+ paddingBlock?: string | number | boolean;
1012
+ paddingInline?: string | number | boolean;
1013
+ paddingTop?: string | number | boolean;
1014
+ paddingRight?: string | number | boolean;
1015
+ paddingBottom?: string | number | boolean;
1016
+ paddingLeft?: string | number | boolean;
1017
+ }): Record<string, string> | null;
1018
+ declare namespace paddingStyle {
1019
+ var __lookupStyles: string[];
1020
+ }
1021
+ //#endregion
1022
+ //#region src/styles/placement.d.ts
1023
+ interface PlacementStyleProps {
1024
+ place?: string | boolean;
1025
+ placeItems?: string | boolean;
1026
+ placeContent?: string | boolean;
1027
+ align?: string | boolean;
1028
+ justify?: string | boolean;
1029
+ alignItems?: string | boolean;
1030
+ alignContent?: string | boolean;
1031
+ justifyItems?: string | boolean;
1032
+ justifyContent?: string | boolean;
1033
+ }
1034
+ /**
1035
+ * Unified placement handler replacing align, justify, and place.
1036
+ *
1037
+ * Priority (later overrides earlier):
1038
+ * 1. place (lowest) — sets all 4 longhands
1039
+ * 2. placeItems, placeContent, align, justify (medium) — each sets 2 longhands
1040
+ * 3. alignItems, alignContent, justifyItems, justifyContent (highest) — each sets 1 longhand
1041
+ */
1042
+ declare function placementStyle({
1043
+ place,
1044
+ placeItems,
1045
+ placeContent,
1046
+ align,
1047
+ justify,
1048
+ alignItems,
1049
+ alignContent,
1050
+ justifyItems,
1051
+ justifyContent
1052
+ }: PlacementStyleProps): Record<string, string> | null;
1053
+ declare namespace placementStyle {
1054
+ var __lookupStyles: string[];
1055
+ }
1056
+ //#endregion
1057
+ //#region src/styles/preset.d.ts
1058
+ interface PresetStyleProps {
1059
+ preset?: string | boolean;
1060
+ fontSize?: string | number;
1061
+ lineHeight?: string | number;
1062
+ textTransform?: string;
1063
+ letterSpacing?: string | number;
1064
+ fontWeight?: string | number;
1065
+ fontStyle?: string | boolean;
1066
+ fontFamily?: string;
1067
+ /** Alias for fontFamily with special handling for 'monospace' and boolean */
1068
+ font?: string | boolean;
1069
+ }
1070
+ /**
1071
+ * Handles typography preset and individual font properties.
1072
+ *
1073
+ * Preset syntax uses `/` to separate the name from one or more
1074
+ * space-separated modifiers:
1075
+ * - `preset="h1"` — name only
1076
+ * - `preset="h2 / strong"` — name + modifier
1077
+ * - `preset="h2 / strong italic"` — name + multiple modifiers
1078
+ * - `preset="bold"` — modifier-only shorthand (name defaults to `inherit`)
1079
+ * - `preset="bold italic"` — modifier-only shorthand with multiple modifiers
1080
+ *
1081
+ * When `preset` is defined, it sets up CSS custom properties for typography.
1082
+ * Individual font props can be used with or without `preset`:
1083
+ * - With `preset`: overrides the preset value for that property
1084
+ * - Without `preset`: outputs the CSS directly
1085
+ *
1086
+ * Number values are converted to pixels for fontSize, lineHeight, letterSpacing.
1087
+ * fontWeight accepts numbers directly (e.g., 400, 700).
1088
+ *
1089
+ * font vs fontFamily:
1090
+ * - `font` is the recommended prop with special handling (monospace, boolean, fallback)
1091
+ * - `fontFamily` is a direct value without special handling
1092
+ */
1093
+ declare function presetStyle({
1094
+ preset,
1095
+ fontSize,
1096
+ lineHeight,
1097
+ textTransform,
1098
+ letterSpacing,
1099
+ fontWeight,
1100
+ fontStyle,
1101
+ fontFamily,
1102
+ font
1103
+ }: PresetStyleProps): Styles | null;
1104
+ declare namespace presetStyle {
1105
+ var __lookupStyles: string[];
1106
+ }
1107
+ //#endregion
1108
+ //#region src/styles/radius.d.ts
1109
+ declare function radiusStyle({
1110
+ radius
1111
+ }: {
1112
+ radius?: string | number | boolean;
1113
+ }): Record<string, string> | null;
1114
+ declare namespace radiusStyle {
1115
+ var __lookupStyles: string[];
1116
+ }
1117
+ //#endregion
1118
+ //#region src/styles/scrollMargin.d.ts
1119
+ declare function scrollMarginStyle({
1120
+ scrollMargin,
1121
+ scrollMarginBlock,
1122
+ scrollMarginInline,
1123
+ scrollMarginTop,
1124
+ scrollMarginRight,
1125
+ scrollMarginBottom,
1126
+ scrollMarginLeft
1127
+ }: {
1128
+ scrollMargin?: string | number | boolean;
1129
+ scrollMarginBlock?: string | number | boolean;
1130
+ scrollMarginInline?: string | number | boolean;
1131
+ scrollMarginTop?: string | number | boolean;
1132
+ scrollMarginRight?: string | number | boolean;
1133
+ scrollMarginBottom?: string | number | boolean;
1134
+ scrollMarginLeft?: string | number | boolean;
1135
+ }): Record<string, string> | null;
1136
+ declare namespace scrollMarginStyle {
1137
+ var __lookupStyles: string[];
1138
+ }
1139
+ //#endregion
1140
+ //#region src/styles/scrollbar.d.ts
1141
+ interface ScrollbarStyleProps {
1142
+ scrollbar?: string | boolean;
1143
+ overflow?: string;
1144
+ }
1145
+ /**
1146
+ * Standard CSS scrollbar styling via `scrollbar-width`, `scrollbar-color`,
1147
+ * and `scrollbar-gutter`.
1148
+ *
1149
+ * Width values: `thin` (default), `auto`, `none`
1150
+ * Modifiers: `stable`, `both-edges`, `always`
1151
+ *
1152
+ * Note: `auto` is classified as a VALUE_KEYWORD by the parser, so it lands
1153
+ * in `values` rather than `mods`. Both locations are checked for robustness.
1154
+ */
1155
+ declare function scrollbarStyle({
1156
+ scrollbar,
1157
+ overflow
1158
+ }: ScrollbarStyleProps): Record<string, string> | null;
1159
+ declare namespace scrollbarStyle {
1160
+ var __lookupStyles: string[];
1161
+ }
1162
+ //#endregion
1163
+ //#region src/styles/shadow.d.ts
1164
+ declare function shadowStyle({
1165
+ shadow
1166
+ }: {
1167
+ shadow?: string | boolean;
1168
+ }): {
1169
+ 'box-shadow': string;
1170
+ } | null;
1171
+ declare namespace shadowStyle {
1172
+ var __lookupStyles: string[];
1173
+ }
1174
+ //#endregion
1175
+ //#region src/styles/transition.d.ts
1176
+ declare function transitionStyle({
1177
+ transition
1178
+ }: {
1179
+ transition?: string;
1180
+ }): {
1181
+ transition: string;
1182
+ } | null;
1183
+ declare namespace transitionStyle {
1184
+ var __lookupStyles: string[];
1185
+ }
1186
+ //#endregion
1187
+ //#region src/styles/width.d.ts
1188
+ interface WidthStyleProps {
1189
+ width?: string | number | boolean;
1190
+ minWidth?: string | number | boolean;
1191
+ maxWidth?: string | number | boolean;
1192
+ }
1193
+ declare function widthStyle({
1194
+ width,
1195
+ minWidth,
1196
+ maxWidth
1197
+ }: WidthStyleProps): Record<string, string | string[]> | null;
1198
+ declare namespace widthStyle {
1199
+ var __lookupStyles: string[];
1200
+ }
1201
+ //#endregion
1202
+ //#region src/styles/predefined.d.ts
1203
+ /**
1204
+ * Exported object containing wrapped predefined style handlers.
1205
+ * Users can import and call these to extend or delegate to built-in behavior.
1206
+ *
1207
+ * Internal handlers use *Style suffix for searchability.
1208
+ * External API uses short names for convenience.
1209
+ *
1210
+ * @example
1211
+ * ```ts
1212
+ * import { styleHandlers, configure } from '@tenphi/tasty';
1213
+ *
1214
+ * configure({
1215
+ * handlers: {
1216
+ * fill: ({ fill }) => {
1217
+ * if (fill?.startsWith('gradient:')) {
1218
+ * return { background: fill.slice(9) };
1219
+ * }
1220
+ * return styleHandlers.fill({ fill });
1221
+ * },
1222
+ * },
1223
+ * });
1224
+ * ```
1225
+ */
1226
+ declare const styleHandlers: {
1227
+ readonly border: typeof borderStyle;
1228
+ readonly color: typeof colorStyle;
1229
+ readonly display: typeof displayStyle;
1230
+ readonly fade: typeof fadeStyle;
1231
+ readonly fill: typeof fillStyle;
1232
+ readonly svgFill: typeof svgFillStyle;
1233
+ readonly flow: typeof flowStyle;
1234
+ readonly gap: typeof gapStyle;
1235
+ readonly height: typeof heightStyle;
1236
+ readonly inset: typeof insetStyle;
1237
+ readonly margin: typeof marginStyle;
1238
+ readonly outline: typeof outlineStyle;
1239
+ readonly padding: typeof paddingStyle;
1240
+ readonly placement: typeof placementStyle;
1241
+ readonly preset: typeof presetStyle;
1242
+ readonly radius: typeof radiusStyle;
1243
+ readonly scrollMargin: typeof scrollMarginStyle;
1244
+ readonly scrollbar: typeof scrollbarStyle;
1245
+ readonly shadow: typeof shadowStyle;
1246
+ readonly transition: typeof transitionStyle;
1247
+ readonly width: typeof widthStyle;
1248
+ };
1249
+ //#endregion
1250
+ //#region src/compute-styles.d.ts
1251
+ interface ComputeStylesResult {
1252
+ className: string;
1253
+ /** CSS text to emit as an inline <style> tag (RSC mode only). */
1254
+ css?: string;
1255
+ }
1256
+ interface ComputeStylesOptions {
1257
+ ssrCollector?: ServerStyleCollector | null;
1258
+ /** Target root for style injection (client only). Defaults to `document`. */
1259
+ root?: Document | ShadowRoot;
1260
+ }
1261
+ /**
1262
+ * Synchronous, hook-free style computation.
1263
+ *
1264
+ * Resolves recipes, categorizes style keys into chunks, renders CSS rules,
1265
+ * allocates class names, and injects / collects / returns the CSS.
1266
+ *
1267
+ * Three code paths:
1268
+ * 1. SSR collector — discovered via ALS or passed explicitly; CSS collected
1269
+ * 2. RSC inline — no collector and no `document`; CSS returned as `result.css`
1270
+ * for the caller to emit as an inline `<style>` tag
1271
+ * 3. Client inject — CSS injected synchronously into the DOM (idempotent)
1272
+ *
1273
+ * @param styles - Tasty styles object (or undefined for no styles)
1274
+ * @param options - Optional SSR collector override
1275
+ */
1276
+ declare function computeStyles(styles: Styles | undefined, options?: ComputeStylesOptions): ComputeStylesResult;
1277
+ //#endregion
1278
+ //#region src/injector/chunk-sheet-registry.d.ts
1279
+ /**
1280
+ * Global registry mapping CSS content hashes to shared constructable
1281
+ * CSSStyleSheet objects with reference counting.
1282
+ *
1283
+ * Multiple shadow roots adopting the same chunk share a single underlying
1284
+ * stylesheet object — parse once, adopt everywhere.
1285
+ */
1286
+ declare class ChunkSheetRegistry {
1287
+ private sheets;
1288
+ private sheetToHash;
1289
+ /**
1290
+ * Get or create a CSSStyleSheet for the given CSS text.
1291
+ * Increments refCount. Uses content hash as the dedup key.
1292
+ */
1293
+ acquire(cssText: string): CSSStyleSheet;
1294
+ /**
1295
+ * Decrement refCount for a sheet. When refCount reaches 0,
1296
+ * the sheet is removed from the registry.
1297
+ */
1298
+ release(sheet: CSSStyleSheet): void;
1299
+ /**
1300
+ * Bulk acquire — returns an array of CSSStyleSheet in the same order.
1301
+ */
1302
+ acquireAll(cssTexts: string[]): CSSStyleSheet[];
1303
+ /**
1304
+ * Bulk release — decrements refCount for each sheet.
1305
+ */
1306
+ releaseAll(sheets: CSSStyleSheet[]): void;
1307
+ /** Number of unique sheets currently held. */
1308
+ get size(): number;
1309
+ }
1310
+ /** Module-level singleton shared across the entire application. */
1311
+ declare const chunkSheetRegistry: ChunkSheetRegistry;
1312
+ //#endregion
1313
+ //#region src/injector/index.d.ts
1314
+ /**
1315
+ * Inject styles and return className with dispose function
1316
+ */
1317
+ declare function inject(rules: StyleResult[], options?: {
1318
+ root?: Document | ShadowRoot;
1319
+ cacheKey?: string;
1320
+ }): InjectResult;
1321
+ /**
1322
+ * Inject global rules that should not reserve tasty class names
1323
+ */
1324
+ declare function injectGlobal(rules: StyleResult[], options?: {
1325
+ root?: Document | ShadowRoot;
1326
+ }): GlobalInjectResult;
1327
+ /**
1328
+ * Inject raw CSS text directly without parsing
1329
+ * This is a low-overhead method for injecting raw CSS that doesn't need tasty processing.
1330
+ * The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking.
1331
+ *
1332
+ * @example
1333
+ * ```tsx
1334
+ * // Inject raw CSS
1335
+ * const { dispose } = injectRawCSS(`
1336
+ * body { margin: 0; padding: 0; }
1337
+ * .my-class { color: red; }
1338
+ * `);
1339
+ *
1340
+ * // Later, remove the injected CSS
1341
+ * dispose();
1342
+ * ```
1343
+ */
1344
+ declare function injectRawCSS(css: string, options?: {
1345
+ root?: Document | ShadowRoot;
1346
+ }): {
1347
+ dispose: () => void;
1348
+ };
1349
+ /**
1350
+ * Get raw CSS text for SSR
1351
+ */
1352
+ declare function getRawCSSText(options?: {
1353
+ root?: Document | ShadowRoot;
1354
+ }): string;
1355
+ /**
1356
+ * Inject keyframes and return object with toString() and dispose()
1357
+ */
1358
+ declare function keyframes(steps: KeyframesSteps, nameOrOptions?: string | {
1359
+ root?: Document | ShadowRoot;
1360
+ name?: string;
1361
+ }): KeyframesResult;
1362
+ interface PropertyOptions {
1363
+ /**
1364
+ * CSS syntax string for the property (e.g., '<color>', '<length>', '<angle>')
1365
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
1366
+ */
1367
+ syntax?: string;
1368
+ /**
1369
+ * Whether the property inherits from parent elements
1370
+ * @default true
1371
+ */
1372
+ inherits?: boolean;
1373
+ /**
1374
+ * Initial value for the property
1375
+ */
1376
+ initialValue?: string | number;
1377
+ /**
1378
+ * Shadow root or document to inject into
1379
+ */
1380
+ root?: Document | ShadowRoot;
1381
+ }
1382
+ /**
1383
+ * Define a CSS @property custom property.
1384
+ * This enables advanced features like animating custom properties.
1385
+ *
1386
+ * Note: @property rules are global and persistent once defined.
1387
+ * Re-registering the same property name is a no-op.
1388
+ *
1389
+ * @param name - The custom property name (must start with --)
1390
+ * @param options - Property configuration
1391
+ *
1392
+ * @example
1393
+ * ```ts
1394
+ * // Define a color property that can be animated
1395
+ * property('--my-color', {
1396
+ * syntax: '<color>',
1397
+ * initialValue: 'red',
1398
+ * });
1399
+ *
1400
+ * // Define an angle property
1401
+ * property('--rotation', {
1402
+ * syntax: '<angle>',
1403
+ * inherits: false,
1404
+ * initialValue: '0deg',
1405
+ * });
1406
+ * ```
1407
+ */
1408
+ declare function property$1(name: string, options?: PropertyOptions): void;
1409
+ /**
1410
+ * Check if a CSS @property has already been defined
1411
+ *
1412
+ * @param name - The custom property name to check
1413
+ * @param options - Options including root
1414
+ */
1415
+ declare function isPropertyDefined(name: string, options?: {
1416
+ root?: Document | ShadowRoot;
1417
+ }): boolean;
1418
+ /**
1419
+ * Inject a CSS @font-face rule.
1420
+ *
1421
+ * Permanent and global — no dispose or ref-counting.
1422
+ * Deduplicates by content hash (family + descriptors).
1423
+ */
1424
+ declare function fontFace(family: string, descriptors: FontFaceDescriptors, options?: {
1425
+ root?: Document | ShadowRoot;
1426
+ }): void;
1427
+ /**
1428
+ * Inject a CSS @counter-style rule.
1429
+ *
1430
+ * Permanent and global — no dispose or ref-counting.
1431
+ * Deduplicates by name (first definition wins).
1432
+ */
1433
+ declare function counterStyle(name: string, descriptors: CounterStyleDescriptors, options?: {
1434
+ root?: Document | ShadowRoot;
1435
+ }): void;
1436
+ /**
1437
+ * Get CSS text from all sheets (for SSR)
1438
+ */
1439
+ declare function getCssText(options?: {
1440
+ root?: Document | ShadowRoot;
1441
+ }): string;
1442
+ /**
1443
+ * Collect only CSS used by a rendered subtree (like jest-styled-components).
1444
+ * Pass the container returned by render(...).
1445
+ */
1446
+ declare function getCssTextForNode(node: ParentNode | Element | DocumentFragment, options?: {
1447
+ root?: Document | ShadowRoot;
1448
+ }): string;
1449
+ /**
1450
+ * Force cleanup of unused rules
1451
+ */
1452
+ declare function cleanup(root?: Document | ShadowRoot): void;
1453
+ /**
1454
+ * Record a render-time usage hit for one or more classNames.
1455
+ * Used internally by computeStyles and tasty() to track usage for GC.
1456
+ * When the global touch counter reaches `touchInterval`, schedules GC.
1457
+ */
1458
+ declare function touch(className: string, options?: {
1459
+ root?: Document | ShadowRoot;
1460
+ }): void;
1461
+ /**
1462
+ * Synchronous garbage collection of unused styles.
1463
+ * Evicts the oldest unused styles when usageMap exceeds capacity.
1464
+ * With `{ force: true }`, removes ALL unused styles regardless of capacity.
1465
+ *
1466
+ * @returns Number of styles evicted.
1467
+ */
1468
+ declare function gc(options?: GCOptions): number;
1469
+ /**
1470
+ * Check if we're currently running in a test environment
1471
+ */
1472
+ declare function getIsTestEnvironment(): boolean;
1473
+ /**
1474
+ * Get the global injector instance for debugging
1475
+ */
1476
+ declare const injector: {
1477
+ readonly instance: StyleInjector;
1478
+ };
1479
+ /**
1480
+ * Destroy all resources and clean up
1481
+ */
1482
+ declare function destroy(root?: Document | ShadowRoot): void;
1483
+ /**
1484
+ * Create a new isolated injector instance
1485
+ */
1486
+ declare function createInjector(config?: Partial<StyleInjectorConfig>): StyleInjector;
1487
+ //#endregion
1488
+ //#region src/utils/filter-base-props.d.ts
1489
+ interface PropsFilterOptions {
1490
+ labelable?: boolean;
1491
+ propNames?: Set<string>;
1492
+ eventProps?: boolean;
1493
+ }
1494
+ /**
1495
+ * Filters out all props that aren't valid DOM props or defined via override prop obj.
1496
+ * @param props - The component props to be filtered.
1497
+ * @param opts - Props to override.
1498
+ */
1499
+ declare function filterBaseProps<T extends object>(props: T, opts?: PropsFilterOptions): Partial<T>;
1500
+ //#endregion
1501
+ //#region src/utils/colors.d.ts
1502
+ declare function color$1(name: string, opacity?: number): string;
1503
+ //#endregion
1504
+ //#region src/utils/mod-attrs.d.ts
1505
+ declare const _modAttrs: (firstArg: Record<string, ModValue> | undefined, secondArg?: unknown) => Record<string, string> | null;
1506
+ //#endregion
1507
+ //#region src/utils/dotize.d.ts
1508
+ declare const dotize: {
1509
+ valTypes: {
1510
+ none: string;
1511
+ primitive: string;
1512
+ object: string;
1513
+ array: string;
1514
+ };
1515
+ getValType: (val: any) => string | undefined;
1516
+ getPathType: (arrPath: any) => string[];
1517
+ isUndefined: (obj: any) => obj is undefined;
1518
+ isNumber: (f: any) => boolean;
1519
+ isEmptyObj: (obj: any) => boolean;
1520
+ isPlainObject: (obj: any) => boolean;
1521
+ isNotObject: (obj: any) => boolean;
1522
+ isEmptyArray: (arr: any) => boolean;
1523
+ isNotArray: (arr: any) => boolean;
1524
+ removeEmptyArrayItem: (arr: any) => any;
1525
+ getFieldName: (field: any, prefix: any, isRoot: any, isArrayItem: any, isArray: any) => string;
1526
+ startsWith: (val: any, valToSearch: any) => boolean;
1527
+ convert: (obj: any, prefix?: string) => any;
1528
+ backward: (obj: any, prefix: any) => any;
1529
+ };
1530
+ //#endregion
1531
+ //#region src/utils/resolve-recipes.d.ts
1532
+ /**
1533
+ * Resolve all `recipe` style properties in a styles object.
1534
+ *
1535
+ * Handles both top-level and sub-element recipe references.
1536
+ * Returns the same object reference if no recipes are present anywhere
1537
+ * (zero overhead for the common case).
1538
+ *
1539
+ * @param styles - The styles object potentially containing `recipe` keys
1540
+ * @returns Resolved styles with recipe values merged in, or the original object if unchanged
1541
+ */
1542
+ declare function resolveRecipes(styles: Styles): Styles;
1543
+ //#endregion
1544
+ //#region src/utils/warnings.d.ts
1545
+ declare function warn(...args: unknown[]): void;
1546
+ declare function deprecationWarning(condition: unknown, {
1547
+ property,
1548
+ name,
1549
+ betterAlternative,
1550
+ reason
1551
+ }: {
1552
+ property: string;
1553
+ name: string;
1554
+ betterAlternative: (() => string) | string;
1555
+ reason?: (() => string) | string;
1556
+ }): void;
1557
+ //#endregion
1558
+ //#region src/utils/process-tokens.d.ts
1559
+ /**
1560
+ * Process tokens object into inline style properties.
1561
+ * - $name -> --name with parsed value
1562
+ * - #name -> --name-color AND --name-color-{colorSpace} with parsed values
1563
+ *
1564
+ * @param tokens - The tokens object to process
1565
+ * @returns CSSProperties object or undefined if no tokens to process
1566
+ */
1567
+ declare function processTokens(tokens: Tokens | undefined): CSSProperties$1 | undefined;
1568
+ //#endregion
1569
+ //#region src/debug.d.ts
1570
+ declare global {
1571
+ interface Window {
1572
+ tastyDebug?: typeof tastyDebug;
1573
+ }
1574
+ }
1575
+ type CSSTarget = 'all' | 'global' | 'active' | 'unused' | 'page' | string | string[] | Element;
1576
+ interface DebugOptions {
1577
+ root?: Document | ShadowRoot;
1578
+ /** Suppress console logging and return data only (default: false) */
1579
+ raw?: boolean;
1580
+ }
1581
+ interface CssOptions extends DebugOptions {
1582
+ prettify?: boolean;
1583
+ /** Read from stored source CSS (dev-mode only) instead of live CSSOM */
1584
+ source?: boolean;
1585
+ }
1586
+ interface ChunkInfo {
1587
+ className: string;
1588
+ chunkName: string | null;
1589
+ }
1590
+ interface InspectResult {
1591
+ element?: Element | null;
1592
+ classes: string[];
1593
+ chunks: ChunkInfo[];
1594
+ css: string;
1595
+ size: number;
1596
+ rules: number;
1597
+ }
1598
+ interface CacheStatus {
1599
+ classes: {
1600
+ active: string[];
1601
+ unused: string[];
1602
+ all: string[];
1603
+ };
1604
+ metrics: CacheMetrics | null;
1605
+ }
1606
+ interface ChunkBreakdown {
1607
+ byChunk: Record<string, {
1608
+ classes: string[];
1609
+ cssSize: number;
1610
+ ruleCount: number;
1611
+ }>;
1612
+ totalChunkTypes: number;
1613
+ totalClasses: number;
1614
+ }
1615
+ interface Summary {
1616
+ activeClasses: string[];
1617
+ unusedClasses: string[];
1618
+ totalStyledClasses: string[];
1619
+ activeCSSSize: number;
1620
+ unusedCSSSize: number;
1621
+ globalCSSSize: number;
1622
+ rawCSSSize: number;
1623
+ keyframesCSSSize: number;
1624
+ propertyCSSSize: number;
1625
+ totalCSSSize: number;
1626
+ activeRuleCount: number;
1627
+ unusedRuleCount: number;
1628
+ globalRuleCount: number;
1629
+ rawRuleCount: number;
1630
+ keyframesRuleCount: number;
1631
+ propertyRuleCount: number;
1632
+ totalRuleCount: number;
1633
+ metrics: CacheMetrics | null;
1634
+ definedProperties: string[];
1635
+ definedKeyframes: {
1636
+ name: string;
1637
+ refCount: number;
1638
+ }[];
1639
+ chunkBreakdown: ChunkBreakdown;
1640
+ }
1641
+ declare const tastyDebug: {
1642
+ css(target: CSSTarget, opts?: CssOptions): string;
1643
+ inspect(target: string | Element, opts?: DebugOptions): InspectResult;
1644
+ summary(opts?: DebugOptions): Summary;
1645
+ chunks(opts?: DebugOptions): ChunkBreakdown;
1646
+ cache(opts?: DebugOptions): CacheStatus;
1647
+ cleanup(opts?: {
1648
+ root?: Document | ShadowRoot;
1649
+ }): void;
1650
+ help(): void;
1651
+ install(): void;
1652
+ };
1653
+ //#endregion
1654
+ export { ResolveModProps as $, okhslFunc as $t, chunkSheetRegistry as A, TagName as At, useKeyframes as B, COLOR_STYLES as Bt, injectRawCSS as C, InnerStyleProps as Ct, property$1 as D, PositionStyleProps as Dt, keyframes as E, OuterStyleProps as Et, getDisplayName as F, Tokens as Ft, useStyles as G, OUTER_STYLES as Gt, useGlobalStyles as H, DIMENSION_STYLES as Ht, useCounterStyle as I, BASE_STYLES as It, ElementsDefinition as J, CHUNK_NAMES as Jt, AllBasePropsWithMods as K, POSITION_STYLES as Kt, useFontFace as L, BLOCK_INNER_STYLES as Lt, ComputeStylesResult as M, TastyThemeNames as Mt, computeStyles as N, TextStyleProps as Nt, touch as O, Props as Ot, styleHandlers as P, TokenValue as Pt, ResolveModPropDef as Q, categorizeStyleKeys as Qt, UsePropertyOptions as R, BLOCK_OUTER_STYLES as Rt, injectGlobal as S, GlobalStyledProps as St, isPropertyDefined as T, Mods as Tt, UseStylesOptions as U, FLOW_STYLES as Ut, useRawCSS as V, CONTAINER_STYLES as Vt, UseStylesResult as W, INNER_STYLES as Wt, ModPropsInput as X, ChunkName as Xt, ModPropDef as Y, ChunkInfo$1 as Yt, ResolveAsProps as Z, STYLE_TO_CHUNK as Zt, getCssText as _, BlockStyleProps as _t, resolveRecipes as a, TastyPolymorphicComponent as at, getRawCSSText as b, DimensionStyleProps as bt, color$1 as c, VariantMap as ct, cleanup as d, AllBaseProps as dt, okhslPlugin as en, ResolveTokenProps as et, counterStyle as f, BaseProps as ft, gc as g, BlockOuterStyleProps as gt, fontFace as h, BlockInnerStyleProps as ht, warn as i, TastyElementProps as it, ComputeStylesOptions as j, TastyExtensionConfig as jt, ChunkSheetRegistry as k, ShortGridStyles as kt, filterBaseProps as l, WithVariant as lt, destroy as m, BaseStyleProps as mt, processTokens as n, DEFAULT_ZERO_NAME_PREFIX as nn, SubElementProps as nt, dotize as o, TastyProps as ot, createInjector as p, BasePropsWithoutChildren as pt, Element$1 as q, TEXT_STYLES as qt, deprecationWarning as r, TastyElementOptions as rt, _modAttrs as s, TokenPropsInput as st, tastyDebug as t, DEFAULT_NAME_PREFIX as tn, SubElementDefinition as tt, PropertyOptions as u, tasty as ut, getCssTextForNode as v, ColorStyleProps as vt, injector as w, ModValue as wt, inject as x, FlowStyleProps as xt, getIsTestEnvironment as y, ContainerStyleProps as yt, useProperty as z, BLOCK_STYLES as zt };
1655
+ //# sourceMappingURL=index-B_k47mc_.d.ts.map