@tenphi/tasty 0.0.0-snapshot.01d8a9e → 0.0.0-snapshot.047dfbb

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 (342) hide show
  1. package/README.md +13 -8
  2. package/dist/{ssr/async-storage.js → async-storage-DKK-wTD4.js} +2 -2
  3. package/dist/async-storage-DKK-wTD4.js.map +1 -0
  4. package/dist/{ssr/collector.d.ts → collector-CddJZDOr.d.ts} +17 -3
  5. package/dist/{ssr/collector.js → collector-J6LwZR0N.js} +53 -43
  6. package/dist/collector-J6LwZR0N.js.map +1 -0
  7. package/dist/config-C3F4Ogo1.js +10993 -0
  8. package/dist/config-C3F4Ogo1.js.map +1 -0
  9. package/dist/config-C3SKYuxY.d.ts +945 -0
  10. package/dist/{ssr/context.js → context-CA8YKeMn.js} +11 -3
  11. package/dist/context-CA8YKeMn.js.map +1 -0
  12. package/dist/core/index.d.ts +5 -34
  13. package/dist/core/index.js +6 -27
  14. package/dist/core-DxHmF6S9.js +1598 -0
  15. package/dist/core-DxHmF6S9.js.map +1 -0
  16. package/dist/{zero/extractor.js → css-writer-IC7tdnIf.js} +98 -13
  17. package/dist/css-writer-IC7tdnIf.js.map +1 -0
  18. package/dist/{ssr/format-global-rules.js → format-global-rules-DklyaXv-.js} +2 -2
  19. package/dist/format-global-rules-DklyaXv-.js.map +1 -0
  20. package/dist/format-rules-DTLY39Hm.js +143 -0
  21. package/dist/format-rules-DTLY39Hm.js.map +1 -0
  22. package/dist/{ssr/hydrate.js → hydrate-8Zglgy_C.js} +3 -3
  23. package/dist/hydrate-8Zglgy_C.js.map +1 -0
  24. package/dist/index-ByBYTH9l.d.ts +1778 -0
  25. package/dist/index-C5owZ15q.d.ts +1293 -0
  26. package/dist/index.d.ts +5 -51
  27. package/dist/index.js +732 -36
  28. package/dist/index.js.map +1 -0
  29. package/dist/keyframes-DgGkipNK.js +595 -0
  30. package/dist/keyframes-DgGkipNK.js.map +1 -0
  31. package/dist/{utils/merge-styles.js → merge-styles-CAdKaHxh.js} +3 -4
  32. package/dist/merge-styles-CAdKaHxh.js.map +1 -0
  33. package/dist/{utils/merge-styles.d.ts → merge-styles-CvUi7SOD.d.ts} +3 -3
  34. package/dist/{utils/resolve-recipes.js → resolve-recipes-BQNdunBd.js} +4 -6
  35. package/dist/resolve-recipes-BQNdunBd.js.map +1 -0
  36. package/dist/ssr/astro-client.js +1 -1
  37. package/dist/ssr/astro-client.js.map +1 -1
  38. package/dist/ssr/astro-middleware.js.map +1 -1
  39. package/dist/ssr/astro.d.ts +1 -12
  40. package/dist/ssr/astro.js +7 -9
  41. package/dist/ssr/astro.js.map +1 -1
  42. package/dist/ssr/index.d.ts +44 -4
  43. package/dist/ssr/index.js +4 -4
  44. package/dist/ssr/index.js.map +1 -1
  45. package/dist/ssr/next.d.ts +2 -3
  46. package/dist/ssr/next.js +6 -6
  47. package/dist/ssr/next.js.map +1 -1
  48. package/dist/static/index.d.ts +91 -5
  49. package/dist/static/index.js +49 -3
  50. package/dist/static/index.js.map +1 -0
  51. package/dist/static/inject.js.map +1 -1
  52. package/dist/zero/babel.d.ts +2 -3
  53. package/dist/zero/babel.js +22 -10
  54. package/dist/zero/babel.js.map +1 -1
  55. package/dist/zero/index.d.ts +67 -3
  56. package/dist/zero/index.js +1 -2
  57. package/dist/zero/next.js.map +1 -1
  58. package/docs/README.md +2 -2
  59. package/docs/configuration.md +44 -0
  60. package/docs/debug.md +11 -9
  61. package/docs/dsl.md +124 -13
  62. package/docs/injector.md +2 -2
  63. package/docs/methodology.md +26 -0
  64. package/docs/pipeline.md +744 -0
  65. package/docs/react-api.md +24 -0
  66. package/docs/ssr.md +5 -3
  67. package/docs/styles.md +25 -8
  68. package/docs/tasty-static.md +15 -0
  69. package/package.json +22 -12
  70. package/tasty.config.ts +2 -0
  71. package/dist/_virtual/_rolldown/runtime.js +0 -7
  72. package/dist/chunks/cacheKey.d.ts +0 -1
  73. package/dist/chunks/cacheKey.js +0 -77
  74. package/dist/chunks/cacheKey.js.map +0 -1
  75. package/dist/chunks/definitions.d.ts +0 -37
  76. package/dist/chunks/definitions.js +0 -258
  77. package/dist/chunks/definitions.js.map +0 -1
  78. package/dist/chunks/index.d.ts +0 -1
  79. package/dist/chunks/renderChunk.d.ts +0 -1
  80. package/dist/chunks/renderChunk.js +0 -59
  81. package/dist/chunks/renderChunk.js.map +0 -1
  82. package/dist/compute-styles.d.ts +0 -31
  83. package/dist/compute-styles.js +0 -336
  84. package/dist/compute-styles.js.map +0 -1
  85. package/dist/config.d.ts +0 -407
  86. package/dist/config.js +0 -591
  87. package/dist/config.js.map +0 -1
  88. package/dist/counter-style/index.js +0 -51
  89. package/dist/counter-style/index.js.map +0 -1
  90. package/dist/debug.d.ts +0 -89
  91. package/dist/debug.js +0 -453
  92. package/dist/debug.js.map +0 -1
  93. package/dist/font-face/index.js +0 -63
  94. package/dist/font-face/index.js.map +0 -1
  95. package/dist/hooks/index.d.ts +0 -7
  96. package/dist/hooks/useCounterStyle.d.ts +0 -36
  97. package/dist/hooks/useCounterStyle.js +0 -65
  98. package/dist/hooks/useCounterStyle.js.map +0 -1
  99. package/dist/hooks/useFontFace.d.ts +0 -45
  100. package/dist/hooks/useFontFace.js +0 -66
  101. package/dist/hooks/useFontFace.js.map +0 -1
  102. package/dist/hooks/useGlobalStyles.d.ts +0 -46
  103. package/dist/hooks/useGlobalStyles.js +0 -88
  104. package/dist/hooks/useGlobalStyles.js.map +0 -1
  105. package/dist/hooks/useKeyframes.d.ts +0 -58
  106. package/dist/hooks/useKeyframes.js +0 -55
  107. package/dist/hooks/useKeyframes.js.map +0 -1
  108. package/dist/hooks/useProperty.d.ts +0 -81
  109. package/dist/hooks/useProperty.js +0 -96
  110. package/dist/hooks/useProperty.js.map +0 -1
  111. package/dist/hooks/useRawCSS.d.ts +0 -22
  112. package/dist/hooks/useRawCSS.js +0 -103
  113. package/dist/hooks/useRawCSS.js.map +0 -1
  114. package/dist/hooks/useStyles.d.ts +0 -40
  115. package/dist/hooks/useStyles.js +0 -31
  116. package/dist/hooks/useStyles.js.map +0 -1
  117. package/dist/injector/index.d.ts +0 -182
  118. package/dist/injector/index.js +0 -185
  119. package/dist/injector/index.js.map +0 -1
  120. package/dist/injector/injector.d.ts +0 -198
  121. package/dist/injector/injector.js +0 -651
  122. package/dist/injector/injector.js.map +0 -1
  123. package/dist/injector/sheet-manager.d.ts +0 -132
  124. package/dist/injector/sheet-manager.js +0 -699
  125. package/dist/injector/sheet-manager.js.map +0 -1
  126. package/dist/injector/types.d.ts +0 -235
  127. package/dist/keyframes/index.js +0 -206
  128. package/dist/keyframes/index.js.map +0 -1
  129. package/dist/parser/classify.js +0 -319
  130. package/dist/parser/classify.js.map +0 -1
  131. package/dist/parser/const.js +0 -60
  132. package/dist/parser/const.js.map +0 -1
  133. package/dist/parser/lru.js +0 -109
  134. package/dist/parser/lru.js.map +0 -1
  135. package/dist/parser/parser.d.ts +0 -25
  136. package/dist/parser/parser.js +0 -115
  137. package/dist/parser/parser.js.map +0 -1
  138. package/dist/parser/tokenizer.js +0 -69
  139. package/dist/parser/tokenizer.js.map +0 -1
  140. package/dist/parser/types.d.ts +0 -51
  141. package/dist/parser/types.js +0 -46
  142. package/dist/parser/types.js.map +0 -1
  143. package/dist/pipeline/conditions.d.ts +0 -134
  144. package/dist/pipeline/conditions.js +0 -406
  145. package/dist/pipeline/conditions.js.map +0 -1
  146. package/dist/pipeline/exclusive.js +0 -283
  147. package/dist/pipeline/exclusive.js.map +0 -1
  148. package/dist/pipeline/index.d.ts +0 -55
  149. package/dist/pipeline/index.js +0 -708
  150. package/dist/pipeline/index.js.map +0 -1
  151. package/dist/pipeline/materialize.js +0 -1157
  152. package/dist/pipeline/materialize.js.map +0 -1
  153. package/dist/pipeline/parseStateKey.d.ts +0 -15
  154. package/dist/pipeline/parseStateKey.js +0 -446
  155. package/dist/pipeline/parseStateKey.js.map +0 -1
  156. package/dist/pipeline/simplify.js +0 -690
  157. package/dist/pipeline/simplify.js.map +0 -1
  158. package/dist/pipeline/warnings.js +0 -18
  159. package/dist/pipeline/warnings.js.map +0 -1
  160. package/dist/plugins/index.d.ts +0 -2
  161. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  162. package/dist/plugins/okhsl-plugin.js +0 -97
  163. package/dist/plugins/okhsl-plugin.js.map +0 -1
  164. package/dist/plugins/types.d.ts +0 -87
  165. package/dist/properties/index.js +0 -222
  166. package/dist/properties/index.js.map +0 -1
  167. package/dist/properties/property-type-resolver.d.ts +0 -24
  168. package/dist/properties/property-type-resolver.js +0 -90
  169. package/dist/properties/property-type-resolver.js.map +0 -1
  170. package/dist/rsc-cache.js +0 -79
  171. package/dist/rsc-cache.js.map +0 -1
  172. package/dist/ssr/async-storage.d.ts +0 -17
  173. package/dist/ssr/async-storage.js.map +0 -1
  174. package/dist/ssr/collect-auto-properties.js +0 -58
  175. package/dist/ssr/collect-auto-properties.js.map +0 -1
  176. package/dist/ssr/collector.js.map +0 -1
  177. package/dist/ssr/context.js.map +0 -1
  178. package/dist/ssr/format-global-rules.js.map +0 -1
  179. package/dist/ssr/format-keyframes.js +0 -69
  180. package/dist/ssr/format-keyframes.js.map +0 -1
  181. package/dist/ssr/format-property.js +0 -49
  182. package/dist/ssr/format-property.js.map +0 -1
  183. package/dist/ssr/format-rules.js +0 -73
  184. package/dist/ssr/format-rules.js.map +0 -1
  185. package/dist/ssr/hydrate.d.ts +0 -29
  186. package/dist/ssr/hydrate.js.map +0 -1
  187. package/dist/ssr/ssr-collector-ref.js +0 -29
  188. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  189. package/dist/states/index.d.ts +0 -49
  190. package/dist/states/index.js +0 -170
  191. package/dist/states/index.js.map +0 -1
  192. package/dist/static/tastyStatic.d.ts +0 -46
  193. package/dist/static/tastyStatic.js +0 -30
  194. package/dist/static/tastyStatic.js.map +0 -1
  195. package/dist/static/types.d.ts +0 -49
  196. package/dist/static/types.js +0 -24
  197. package/dist/static/types.js.map +0 -1
  198. package/dist/styles/border.d.ts +0 -25
  199. package/dist/styles/border.js +0 -120
  200. package/dist/styles/border.js.map +0 -1
  201. package/dist/styles/color.d.ts +0 -14
  202. package/dist/styles/color.js +0 -26
  203. package/dist/styles/color.js.map +0 -1
  204. package/dist/styles/const.js +0 -17
  205. package/dist/styles/const.js.map +0 -1
  206. package/dist/styles/createStyle.js +0 -79
  207. package/dist/styles/createStyle.js.map +0 -1
  208. package/dist/styles/dimension.js +0 -109
  209. package/dist/styles/dimension.js.map +0 -1
  210. package/dist/styles/directional.js +0 -133
  211. package/dist/styles/directional.js.map +0 -1
  212. package/dist/styles/display.d.ts +0 -30
  213. package/dist/styles/display.js +0 -73
  214. package/dist/styles/display.js.map +0 -1
  215. package/dist/styles/fade.d.ts +0 -15
  216. package/dist/styles/fade.js +0 -62
  217. package/dist/styles/fade.js.map +0 -1
  218. package/dist/styles/fill.d.ts +0 -42
  219. package/dist/styles/fill.js +0 -51
  220. package/dist/styles/fill.js.map +0 -1
  221. package/dist/styles/flow.d.ts +0 -16
  222. package/dist/styles/flow.js +0 -12
  223. package/dist/styles/flow.js.map +0 -1
  224. package/dist/styles/gap.d.ts +0 -31
  225. package/dist/styles/gap.js +0 -38
  226. package/dist/styles/gap.js.map +0 -1
  227. package/dist/styles/height.d.ts +0 -17
  228. package/dist/styles/height.js +0 -19
  229. package/dist/styles/height.js.map +0 -1
  230. package/dist/styles/index.d.ts +0 -1
  231. package/dist/styles/index.js +0 -8
  232. package/dist/styles/index.js.map +0 -1
  233. package/dist/styles/inset.d.ts +0 -24
  234. package/dist/styles/inset.js +0 -34
  235. package/dist/styles/inset.js.map +0 -1
  236. package/dist/styles/list.d.ts +0 -16
  237. package/dist/styles/list.js +0 -100
  238. package/dist/styles/list.js.map +0 -1
  239. package/dist/styles/margin.d.ts +0 -24
  240. package/dist/styles/margin.js +0 -32
  241. package/dist/styles/margin.js.map +0 -1
  242. package/dist/styles/outline.d.ts +0 -29
  243. package/dist/styles/outline.js +0 -55
  244. package/dist/styles/outline.js.map +0 -1
  245. package/dist/styles/padding.d.ts +0 -24
  246. package/dist/styles/padding.js +0 -32
  247. package/dist/styles/padding.js.map +0 -1
  248. package/dist/styles/placement.d.ts +0 -37
  249. package/dist/styles/placement.js +0 -74
  250. package/dist/styles/placement.js.map +0 -1
  251. package/dist/styles/predefined.d.ts +0 -71
  252. package/dist/styles/predefined.js +0 -237
  253. package/dist/styles/predefined.js.map +0 -1
  254. package/dist/styles/preset.d.ts +0 -52
  255. package/dist/styles/preset.js +0 -127
  256. package/dist/styles/preset.js.map +0 -1
  257. package/dist/styles/radius.d.ts +0 -12
  258. package/dist/styles/radius.js +0 -83
  259. package/dist/styles/radius.js.map +0 -1
  260. package/dist/styles/scrollMargin.d.ts +0 -24
  261. package/dist/styles/scrollMargin.js +0 -32
  262. package/dist/styles/scrollMargin.js.map +0 -1
  263. package/dist/styles/scrollbar.d.ts +0 -25
  264. package/dist/styles/scrollbar.js +0 -51
  265. package/dist/styles/scrollbar.js.map +0 -1
  266. package/dist/styles/shadow.d.ts +0 -14
  267. package/dist/styles/shadow.js +0 -25
  268. package/dist/styles/shadow.js.map +0 -1
  269. package/dist/styles/shared.js +0 -17
  270. package/dist/styles/shared.js.map +0 -1
  271. package/dist/styles/transition.d.ts +0 -14
  272. package/dist/styles/transition.js +0 -159
  273. package/dist/styles/transition.js.map +0 -1
  274. package/dist/styles/types.d.ts +0 -564
  275. package/dist/styles/width.d.ts +0 -17
  276. package/dist/styles/width.js +0 -19
  277. package/dist/styles/width.js.map +0 -1
  278. package/dist/tasty.d.ts +0 -134
  279. package/dist/tasty.js +0 -248
  280. package/dist/tasty.js.map +0 -1
  281. package/dist/types.d.ts +0 -184
  282. package/dist/utils/cache-wrapper.js +0 -21
  283. package/dist/utils/cache-wrapper.js.map +0 -1
  284. package/dist/utils/case-converter.js +0 -8
  285. package/dist/utils/case-converter.js.map +0 -1
  286. package/dist/utils/color-math.d.ts +0 -46
  287. package/dist/utils/color-math.js +0 -749
  288. package/dist/utils/color-math.js.map +0 -1
  289. package/dist/utils/color-space.d.ts +0 -5
  290. package/dist/utils/color-space.js +0 -228
  291. package/dist/utils/color-space.js.map +0 -1
  292. package/dist/utils/colors.d.ts +0 -5
  293. package/dist/utils/colors.js +0 -10
  294. package/dist/utils/colors.js.map +0 -1
  295. package/dist/utils/css-types.d.ts +0 -7
  296. package/dist/utils/deps-equal.js +0 -15
  297. package/dist/utils/deps-equal.js.map +0 -1
  298. package/dist/utils/dotize.d.ts +0 -26
  299. package/dist/utils/dotize.js +0 -122
  300. package/dist/utils/dotize.js.map +0 -1
  301. package/dist/utils/filter-base-props.d.ts +0 -15
  302. package/dist/utils/filter-base-props.js +0 -45
  303. package/dist/utils/filter-base-props.js.map +0 -1
  304. package/dist/utils/get-display-name.d.ts +0 -7
  305. package/dist/utils/get-display-name.js +0 -10
  306. package/dist/utils/get-display-name.js.map +0 -1
  307. package/dist/utils/has-keys.js +0 -13
  308. package/dist/utils/has-keys.js.map +0 -1
  309. package/dist/utils/hash.js +0 -14
  310. package/dist/utils/hash.js.map +0 -1
  311. package/dist/utils/is-dev-env.js +0 -19
  312. package/dist/utils/is-dev-env.js.map +0 -1
  313. package/dist/utils/is-valid-element-type.js +0 -15
  314. package/dist/utils/is-valid-element-type.js.map +0 -1
  315. package/dist/utils/merge-styles.js.map +0 -1
  316. package/dist/utils/mod-attrs.d.ts +0 -6
  317. package/dist/utils/mod-attrs.js +0 -20
  318. package/dist/utils/mod-attrs.js.map +0 -1
  319. package/dist/utils/process-tokens.d.ts +0 -17
  320. package/dist/utils/process-tokens.js +0 -83
  321. package/dist/utils/process-tokens.js.map +0 -1
  322. package/dist/utils/resolve-recipes.d.ts +0 -17
  323. package/dist/utils/resolve-recipes.js.map +0 -1
  324. package/dist/utils/selector-transform.js +0 -32
  325. package/dist/utils/selector-transform.js.map +0 -1
  326. package/dist/utils/string.js +0 -8
  327. package/dist/utils/string.js.map +0 -1
  328. package/dist/utils/styles.d.ts +0 -99
  329. package/dist/utils/styles.js +0 -220
  330. package/dist/utils/styles.js.map +0 -1
  331. package/dist/utils/typography.d.ts +0 -58
  332. package/dist/utils/typography.js +0 -51
  333. package/dist/utils/typography.js.map +0 -1
  334. package/dist/utils/warnings.d.ts +0 -16
  335. package/dist/utils/warnings.js +0 -16
  336. package/dist/utils/warnings.js.map +0 -1
  337. package/dist/zero/css-writer.d.ts +0 -45
  338. package/dist/zero/css-writer.js +0 -73
  339. package/dist/zero/css-writer.js.map +0 -1
  340. package/dist/zero/extractor.d.ts +0 -24
  341. package/dist/zero/extractor.js.map +0 -1
  342. package/docs/PIPELINE.md +0 -519
package/dist/types.d.ts DELETED
@@ -1,184 +0,0 @@
1
- import { CSSProperties as CSSProperties$1 } from "./utils/css-types.js";
2
- import { Styles } from "./styles/types.js";
3
- import { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES } from "./styles/list.js";
4
- import { AllHTMLAttributes, ComponentType } from "react";
5
-
6
- //#region src/types.d.ts
7
- interface GlobalStyledProps {
8
- breakpoints?: number[];
9
- }
10
- /**
11
- * Extensible interface for theme names.
12
- * Augment this interface to register project-specific theme names for autocomplete.
13
- *
14
- * @example
15
- * ```typescript
16
- * declare module '@tenphi/tasty' {
17
- * interface TastyThemeNames {
18
- * danger: true;
19
- * success: true;
20
- * }
21
- * }
22
- * ```
23
- */
24
- interface TastyThemeNames {}
25
- type ThemeNameKey = Extract<keyof TastyThemeNames, string>;
26
- type ThemeName = [ThemeNameKey] extends [never] ? string : ThemeNameKey;
27
- /** Allowed mod value types */
28
- type ModValue = boolean | string | number | undefined | null;
29
- /**
30
- * Type for element modifiers (mods prop).
31
- * Can be used as a generic to define known modifiers with autocomplete:
32
- * @example
33
- * type ButtonMods = Mods<{
34
- * loading?: boolean;
35
- * selected?: boolean;
36
- * }>;
37
- */
38
- type Mods<T extends Record<string, ModValue> = Record<string, ModValue>> = T & Record<string, ModValue>;
39
- /**
40
- * Token value: string or number (processed), boolean for special handling, undefined/null (skipped).
41
- * For color tokens (#name), boolean `true` is converted to `transparent`.
42
- * For non-color tokens ($name), boolean `true` results in an empty string value.
43
- * Boolean `false` results in no CSS output (token is skipped).
44
- */
45
- type TokenValue = string | number | boolean | undefined | null;
46
- /**
47
- * Tokens definition for inline CSS custom properties.
48
- * - `$name` keys become `--name` CSS properties
49
- * - `#name` keys become `--name-color` and `--name-color-{colorSpace}` CSS properties
50
- */
51
- type Tokens = Record<`$${string}` | `#${string}`, TokenValue>;
52
- 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';
53
- interface BasePropsWithoutChildren<K extends TagName = TagName> extends Pick<AllHTMLAttributes<HTMLElement>, 'className' | 'role' | 'id'> {
54
- /** The HTML tag or React component to render as */
55
- as?: K | ComponentType<any>;
56
- /** QA ID for e2e testing. An alias for `data-qa` attribute. */
57
- qa?: string;
58
- /** QA value for e2e testing. An alias for `data-qaval` attribute. */
59
- qaVal?: string | number;
60
- /** Inner element name */
61
- element?: `${Caps}${string}`;
62
- /** The style map */
63
- styles?: Styles;
64
- /** The list of responsive points in pixels */
65
- breakpoints?: number[];
66
- /** Whether the element has the block layout outside */
67
- block?: boolean;
68
- /** Whether the element has the inline layout outside */
69
- inline?: boolean;
70
- /** The list of element modifiers **/
71
- mods?: Mods;
72
- /** Whether the element is hidden (`hidden` attribute is set) */
73
- isHidden?: boolean;
74
- /** Whether the element is disabled (`disabled` attribute is set) */
75
- isDisabled?: boolean;
76
- /** Plain css for the element */
77
- css?: string;
78
- /** The CSS style map */
79
- style?: CSSProperties$1 | (CSSProperties$1 & Record<string, string | number | null | undefined>);
80
- /** User-defined theme for the element. Mapped to `data-theme` attribute. Augment `TastyThemeNames` to register project-specific themes for autocomplete. */
81
- theme?: ThemeName | (string & {});
82
- /** CSS custom property tokens rendered as inline styles */
83
- tokens?: Tokens;
84
- }
85
- interface BaseProps<K extends TagName = TagName> extends BasePropsWithoutChildren<K>, Pick<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'children'> {}
86
- 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'> {}
87
- type BaseStyleProps = Pick<Styles, (typeof BASE_STYLES)[number]>;
88
- type PositionStyleProps = Pick<Styles, (typeof POSITION_STYLES)[number]>;
89
- type BlockStyleProps = Pick<Styles, (typeof BLOCK_STYLES)[number]>;
90
- type BlockInnerStyleProps = Pick<Styles, (typeof BLOCK_INNER_STYLES)[number]>;
91
- type BlockOuterStyleProps = Pick<Styles, (typeof BLOCK_OUTER_STYLES)[number]>;
92
- type ColorStyleProps = Pick<Styles, (typeof COLOR_STYLES)[number]>;
93
- type TextStyleProps = Pick<Styles, (typeof TEXT_STYLES)[number]>;
94
- type DimensionStyleProps = Pick<Styles, (typeof DIMENSION_STYLES)[number]>;
95
- type FlowStyleProps = Pick<Styles, (typeof FLOW_STYLES)[number]>;
96
- type ContainerStyleProps = Pick<Styles, (typeof CONTAINER_STYLES)[number]>;
97
- type OuterStyleProps = Pick<Styles, (typeof OUTER_STYLES)[number]>;
98
- type InnerStyleProps = Pick<Styles, (typeof INNER_STYLES)[number]>;
99
- interface ShortGridStyles {
100
- template?: Styles['gridTemplate'];
101
- columns?: Styles['gridColumns'];
102
- rows?: Styles['gridRows'];
103
- areas?: Styles['gridAreas'];
104
- }
105
- type Props = Record<string, any>;
106
- type TagName = keyof HTMLElementTagNameMap;
107
- /**
108
- * Configuration type for tasty.config.ts files.
109
- * Used by the Tasty VSCode extension for validation and autocomplete.
110
- *
111
- * @example
112
- * ```typescript
113
- * import type { TastyExtensionConfig } from '@tenphi/tasty';
114
- *
115
- * const config: TastyExtensionConfig = {
116
- * tokens: ['#primary', '#danger', '$spacing'],
117
- * units: ['x', 'r', 'bw'],
118
- * states: ['@mobile', '@tablet', '@dark'],
119
- * presets: ['h1', 'h2', 't1', 't2'],
120
- * };
121
- *
122
- * export default config;
123
- * ```
124
- */
125
- interface TastyExtensionConfig {
126
- /**
127
- * Extend another config file. Path is relative to this config file.
128
- * The extended config is merged first, then this config's values are added.
129
- * @example '../tasty.config.ts'
130
- */
131
- extends?: string;
132
- /**
133
- * Valid token names for validation and autocomplete.
134
- * Use # prefix for colors, $ prefix for custom properties.
135
- * Set to `false` to disable token validation (overrides parent).
136
- * @example ['#primary', '#danger', '$spacing', '$gap']
137
- */
138
- tokens?: false | string[];
139
- /**
140
- * Valid custom unit names.
141
- * Set to `false` to disable unit validation (overrides parent).
142
- * @example ['x', 'r', 'bw', 'cols']
143
- */
144
- units?: false | string[];
145
- /**
146
- * Valid custom function names.
147
- * Set to `false` to disable function validation (overrides parent).
148
- * @example ['clamp', 'double']
149
- */
150
- funcs?: false | string[];
151
- /**
152
- * State alias names for autocomplete.
153
- * Must start with @ prefix.
154
- * @example ['@mobile', '@tablet', '@dark']
155
- */
156
- states?: string[];
157
- /**
158
- * Valid preset names for the `preset` style property.
159
- * Tasty has no built-in presets - they are project-specific.
160
- * @example ['h1', 'h2', 'h3', 't1', 't2', 't3', 'tag']
161
- */
162
- presets?: string[];
163
- /**
164
- * Custom style property names added via configure({ handlers }).
165
- * Suppresses "unknown property" warnings for these names.
166
- * @example ['myGradient', 'customLayout', 'brandBorder']
167
- */
168
- styles?: string[];
169
- /**
170
- * Descriptions for presets, shown on hover in the extension.
171
- * Maps preset names to human-readable descriptions.
172
- * @example { h1: 'Heading 1 (36px/44px, semibold)', t1: 'Text large (18px/24px)' }
173
- */
174
- presetDescriptions?: Record<string, string>;
175
- /**
176
- * Descriptions for state aliases, shown on hover in the extension.
177
- * Maps state names to human-readable descriptions.
178
- * @example { '@mobile': 'Mobile viewport (width < 768px)' }
179
- */
180
- stateDescriptions?: Record<string, string>;
181
- }
182
- //#endregion
183
- export { AllBaseProps, BaseProps, BasePropsWithoutChildren, BaseStyleProps, BlockInnerStyleProps, BlockOuterStyleProps, BlockStyleProps, ColorStyleProps, ContainerStyleProps, DimensionStyleProps, FlowStyleProps, GlobalStyledProps, InnerStyleProps, ModValue, Mods, OuterStyleProps, PositionStyleProps, Props, ShortGridStyles, TagName, TastyExtensionConfig, TastyThemeNames, TextStyleProps, TokenValue, Tokens };
184
- //# sourceMappingURL=types.d.ts.map
@@ -1,21 +0,0 @@
1
- import { Lru } from "../parser/lru.js";
2
- //#region src/utils/cache-wrapper.ts
3
- /**
4
- * Create a function that caches the result with LRU eviction.
5
- */
6
- function cacheWrapper(handler, limit = 1e3) {
7
- const cache = new Lru(limit);
8
- return (firstArg, secondArg) => {
9
- const key = typeof firstArg === "string" && secondArg == null ? firstArg : JSON.stringify([firstArg, secondArg]);
10
- let result = cache.get(key);
11
- if (result === void 0) {
12
- result = secondArg == null ? handler(firstArg) : handler(firstArg, secondArg);
13
- cache.set(key, result);
14
- }
15
- return result;
16
- };
17
- }
18
- //#endregion
19
- export { cacheWrapper };
20
-
21
- //# sourceMappingURL=cache-wrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache-wrapper.js","names":[],"sources":["../../src/utils/cache-wrapper.ts"],"sourcesContent":["import { Lru } from '../parser/lru';\n\n/**\n * Create a function that caches the result with LRU eviction.\n */\nexport function cacheWrapper<A, B, R>(\n handler: (firstArg: A, secondArg?: B) => R,\n limit = 1000,\n): (firstArg: A, secondArg?: B) => R {\n const cache = new Lru<string, R>(limit);\n\n return (firstArg: A, secondArg?: B) => {\n const key =\n typeof firstArg === 'string' && secondArg == null\n ? firstArg\n : JSON.stringify([firstArg, secondArg]);\n\n let result = cache.get(key);\n if (result === undefined) {\n result =\n secondArg == null ? handler(firstArg) : handler(firstArg, secondArg);\n cache.set(key, result);\n }\n return result;\n };\n}\n"],"mappings":";;;;;AAKA,SAAgB,aACd,SACA,QAAQ,KAC2B;CACnC,MAAM,QAAQ,IAAI,IAAe,MAAM;AAEvC,SAAQ,UAAa,cAAkB;EACrC,MAAM,MACJ,OAAO,aAAa,YAAY,aAAa,OACzC,WACA,KAAK,UAAU,CAAC,UAAU,UAAU,CAAC;EAE3C,IAAI,SAAS,MAAM,IAAI,IAAI;AAC3B,MAAI,WAAW,KAAA,GAAW;AACxB,YACE,aAAa,OAAO,QAAQ,SAAS,GAAG,QAAQ,UAAU,UAAU;AACtE,SAAM,IAAI,KAAK,OAAO;;AAExB,SAAO"}
@@ -1,8 +0,0 @@
1
- //#region src/utils/case-converter.ts
2
- function camelToKebab(str) {
3
- return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
4
- }
5
- //#endregion
6
- export { camelToKebab };
7
-
8
- //# sourceMappingURL=case-converter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"case-converter.js","names":[],"sources":["../../src/utils/case-converter.ts"],"sourcesContent":["export function camelToKebab(str: string): string {\n return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n}\n"],"mappings":";AAAA,SAAgB,aAAa,KAAqB;AAChD,QAAO,IAAI,QAAQ,sBAAsB,QAAQ,CAAC,aAAa"}
@@ -1,46 +0,0 @@
1
- //#region src/utils/color-math.d.ts
2
- /**
3
- * Consolidated color conversion math.
4
- *
5
- * Single source of truth for all color space conversions used across the
6
- * library: sRGB gamma, HSL, OKLab, OKLCH, OKHSL, hex parsing, named
7
- * colors, and CSS string converters.
8
- *
9
- * This module has zero internal imports — it is a leaf dependency.
10
- *
11
- * Reference: https://bottosson.github.io/posts/oklab/
12
- */
13
- type Vec3 = [number, number, number];
14
- /**
15
- * HSL to RGB.
16
- * Algorithm from CSS Color 4 spec.
17
- *
18
- * @param h - Hue in degrees (0-360)
19
- * @param s - Saturation (0-1)
20
- * @param l - Lightness (0-1)
21
- * @returns RGB values in 0-255 range (may have fractional values)
22
- */
23
- declare function hslToRgbValues(h: number, s: number, l: number): Vec3;
24
- declare function getNamedColorHex(): Map<string, string>;
25
- /**
26
- * Convert hex color string to `rgb()` CSS string.
27
- * Supports 3, 4, 6, and 8 character hex values (with or without `#`).
28
- */
29
- declare function hexToRgb(hex: string): string | null;
30
- /**
31
- * Extract RGB values from an `rgb()`/`rgba()` string.
32
- * Supports comma-separated, space-separated, fractional, percentage,
33
- * and slash alpha notation.
34
- *
35
- * @returns Array of RGB values (0-255 range), converting percentages as needed.
36
- */
37
- declare function getRgbValuesFromRgbaString(str: string): number[];
38
- /**
39
- * Convert any recognized color string to an `rgb()` CSS string.
40
- * Handles hex, `okhsl()`, `hsl()`/`hsla()`, named CSS colors,
41
- * and `rgb()`/`rgba()` pass-through.
42
- */
43
- declare function strToRgb(color: string, _ignoreAlpha?: boolean): string | null | undefined;
44
- //#endregion
45
- export { getNamedColorHex, getRgbValuesFromRgbaString, hexToRgb, hslToRgbValues, strToRgb };
46
- //# sourceMappingURL=color-math.d.ts.map