@tenphi/tasty 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +236 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +7 -0
  4. package/dist/chunks/cacheKey.d.ts +1 -0
  5. package/dist/chunks/cacheKey.js +70 -0
  6. package/dist/chunks/cacheKey.js.map +1 -0
  7. package/dist/chunks/cacheKey.mjs +70 -0
  8. package/dist/chunks/cacheKey.mjs.map +1 -0
  9. package/dist/chunks/definitions.d.ts +37 -0
  10. package/dist/chunks/definitions.js +260 -0
  11. package/dist/chunks/definitions.js.map +1 -0
  12. package/dist/chunks/definitions.mjs +260 -0
  13. package/dist/chunks/definitions.mjs.map +1 -0
  14. package/dist/chunks/index.d.ts +3 -0
  15. package/dist/chunks/renderChunk.d.ts +2 -0
  16. package/dist/chunks/renderChunk.js +61 -0
  17. package/dist/chunks/renderChunk.js.map +1 -0
  18. package/dist/chunks/renderChunk.mjs +61 -0
  19. package/dist/chunks/renderChunk.mjs.map +1 -0
  20. package/dist/config.d.ts +279 -0
  21. package/dist/config.js +400 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/config.mjs +231 -0
  24. package/dist/config.mjs.map +1 -0
  25. package/dist/css-writer.d.mts +45 -0
  26. package/dist/css-writer.mjs +74 -0
  27. package/dist/css-writer.mjs.map +1 -0
  28. package/dist/debug.d.ts +204 -0
  29. package/dist/debug.js +733 -0
  30. package/dist/debug.js.map +1 -0
  31. package/dist/extractor.d.mts +24 -0
  32. package/dist/extractor.mjs +150 -0
  33. package/dist/extractor.mjs.map +1 -0
  34. package/dist/hooks/index.d.ts +5 -0
  35. package/dist/hooks/useGlobalStyles.d.ts +27 -0
  36. package/dist/hooks/useGlobalStyles.js +56 -0
  37. package/dist/hooks/useGlobalStyles.js.map +1 -0
  38. package/dist/hooks/useKeyframes.d.ts +56 -0
  39. package/dist/hooks/useKeyframes.js +54 -0
  40. package/dist/hooks/useKeyframes.js.map +1 -0
  41. package/dist/hooks/useProperty.d.ts +79 -0
  42. package/dist/hooks/useProperty.js +91 -0
  43. package/dist/hooks/useProperty.js.map +1 -0
  44. package/dist/hooks/useRawCSS.d.ts +53 -0
  45. package/dist/hooks/useRawCSS.js +28 -0
  46. package/dist/hooks/useRawCSS.js.map +1 -0
  47. package/dist/hooks/useStyles.d.ts +40 -0
  48. package/dist/hooks/useStyles.js +169 -0
  49. package/dist/hooks/useStyles.js.map +1 -0
  50. package/dist/index.d.ts +38 -0
  51. package/dist/index.js +30 -0
  52. package/dist/injector/index.d.ts +157 -0
  53. package/dist/injector/index.js +154 -0
  54. package/dist/injector/index.js.map +1 -0
  55. package/dist/injector/injector.d.ts +139 -0
  56. package/dist/injector/injector.js +404 -0
  57. package/dist/injector/injector.js.map +1 -0
  58. package/dist/injector/injector.mjs +404 -0
  59. package/dist/injector/injector.mjs.map +1 -0
  60. package/dist/injector/sheet-manager.d.ts +127 -0
  61. package/dist/injector/sheet-manager.js +714 -0
  62. package/dist/injector/sheet-manager.js.map +1 -0
  63. package/dist/injector/sheet-manager.mjs +714 -0
  64. package/dist/injector/sheet-manager.mjs.map +1 -0
  65. package/dist/injector/types.d.mts +18 -0
  66. package/dist/injector/types.d.ts +135 -0
  67. package/dist/keyframes/index.js +206 -0
  68. package/dist/keyframes/index.js.map +1 -0
  69. package/dist/keyframes/index.mjs +156 -0
  70. package/dist/keyframes/index.mjs.map +1 -0
  71. package/dist/parser/classify.js +319 -0
  72. package/dist/parser/classify.js.map +1 -0
  73. package/dist/parser/classify.mjs +319 -0
  74. package/dist/parser/classify.mjs.map +1 -0
  75. package/dist/parser/const.js +33 -0
  76. package/dist/parser/const.js.map +1 -0
  77. package/dist/parser/const.mjs +33 -0
  78. package/dist/parser/const.mjs.map +1 -0
  79. package/dist/parser/lru.js +109 -0
  80. package/dist/parser/lru.js.map +1 -0
  81. package/dist/parser/lru.mjs +109 -0
  82. package/dist/parser/lru.mjs.map +1 -0
  83. package/dist/parser/parser.d.ts +25 -0
  84. package/dist/parser/parser.js +116 -0
  85. package/dist/parser/parser.js.map +1 -0
  86. package/dist/parser/parser.mjs +116 -0
  87. package/dist/parser/parser.mjs.map +1 -0
  88. package/dist/parser/tokenizer.js +69 -0
  89. package/dist/parser/tokenizer.js.map +1 -0
  90. package/dist/parser/tokenizer.mjs +69 -0
  91. package/dist/parser/tokenizer.mjs.map +1 -0
  92. package/dist/parser/types.d.mts +37 -0
  93. package/dist/parser/types.d.ts +46 -0
  94. package/dist/parser/types.js +46 -0
  95. package/dist/parser/types.js.map +1 -0
  96. package/dist/parser/types.mjs +46 -0
  97. package/dist/parser/types.mjs.map +1 -0
  98. package/dist/pipeline/conditions.js +377 -0
  99. package/dist/pipeline/conditions.js.map +1 -0
  100. package/dist/pipeline/conditions.mjs +377 -0
  101. package/dist/pipeline/conditions.mjs.map +1 -0
  102. package/dist/pipeline/exclusive.d.ts +1 -0
  103. package/dist/pipeline/exclusive.js +231 -0
  104. package/dist/pipeline/exclusive.js.map +1 -0
  105. package/dist/pipeline/exclusive.mjs +231 -0
  106. package/dist/pipeline/exclusive.mjs.map +1 -0
  107. package/dist/pipeline/index.d.ts +53 -0
  108. package/dist/pipeline/index.js +641 -0
  109. package/dist/pipeline/index.js.map +1 -0
  110. package/dist/pipeline/index.mjs +635 -0
  111. package/dist/pipeline/index.mjs.map +1 -0
  112. package/dist/pipeline/materialize.js +821 -0
  113. package/dist/pipeline/materialize.js.map +1 -0
  114. package/dist/pipeline/materialize.mjs +821 -0
  115. package/dist/pipeline/materialize.mjs.map +1 -0
  116. package/dist/pipeline/parseStateKey.d.ts +1 -0
  117. package/dist/pipeline/parseStateKey.js +418 -0
  118. package/dist/pipeline/parseStateKey.js.map +1 -0
  119. package/dist/pipeline/parseStateKey.mjs +418 -0
  120. package/dist/pipeline/parseStateKey.mjs.map +1 -0
  121. package/dist/pipeline/simplify.js +557 -0
  122. package/dist/pipeline/simplify.js.map +1 -0
  123. package/dist/pipeline/simplify.mjs +557 -0
  124. package/dist/pipeline/simplify.mjs.map +1 -0
  125. package/dist/plugins/index.d.ts +2 -0
  126. package/dist/plugins/okhsl-plugin.d.ts +35 -0
  127. package/dist/plugins/okhsl-plugin.js +371 -0
  128. package/dist/plugins/okhsl-plugin.js.map +1 -0
  129. package/dist/plugins/okhsl-plugin.mjs +345 -0
  130. package/dist/plugins/okhsl-plugin.mjs.map +1 -0
  131. package/dist/plugins/types.d.mts +49 -0
  132. package/dist/plugins/types.d.ts +69 -0
  133. package/dist/properties/index.js +158 -0
  134. package/dist/properties/index.js.map +1 -0
  135. package/dist/properties/index.mjs +141 -0
  136. package/dist/properties/index.mjs.map +1 -0
  137. package/dist/states/index.d.ts +45 -0
  138. package/dist/states/index.js +389 -0
  139. package/dist/states/index.js.map +1 -0
  140. package/dist/states/index.mjs +161 -0
  141. package/dist/states/index.mjs.map +1 -0
  142. package/dist/static/index.d.ts +5 -0
  143. package/dist/static/index.js +5 -0
  144. package/dist/static/tastyStatic.d.ts +46 -0
  145. package/dist/static/tastyStatic.js +31 -0
  146. package/dist/static/tastyStatic.js.map +1 -0
  147. package/dist/static/types.d.ts +49 -0
  148. package/dist/static/types.js +24 -0
  149. package/dist/static/types.js.map +1 -0
  150. package/dist/styles/align.d.ts +15 -0
  151. package/dist/styles/align.js +14 -0
  152. package/dist/styles/align.js.map +1 -0
  153. package/dist/styles/align.mjs +14 -0
  154. package/dist/styles/align.mjs.map +1 -0
  155. package/dist/styles/border.d.ts +25 -0
  156. package/dist/styles/border.js +114 -0
  157. package/dist/styles/border.js.map +1 -0
  158. package/dist/styles/border.mjs +114 -0
  159. package/dist/styles/border.mjs.map +1 -0
  160. package/dist/styles/color.d.ts +14 -0
  161. package/dist/styles/color.js +23 -0
  162. package/dist/styles/color.js.map +1 -0
  163. package/dist/styles/color.mjs +23 -0
  164. package/dist/styles/color.mjs.map +1 -0
  165. package/dist/styles/createStyle.js +77 -0
  166. package/dist/styles/createStyle.js.map +1 -0
  167. package/dist/styles/createStyle.mjs +77 -0
  168. package/dist/styles/createStyle.mjs.map +1 -0
  169. package/dist/styles/dimension.js +97 -0
  170. package/dist/styles/dimension.js.map +1 -0
  171. package/dist/styles/dimension.mjs +97 -0
  172. package/dist/styles/dimension.mjs.map +1 -0
  173. package/dist/styles/display.d.ts +37 -0
  174. package/dist/styles/display.js +67 -0
  175. package/dist/styles/display.js.map +1 -0
  176. package/dist/styles/display.mjs +67 -0
  177. package/dist/styles/display.mjs.map +1 -0
  178. package/dist/styles/fade.d.ts +15 -0
  179. package/dist/styles/fade.js +58 -0
  180. package/dist/styles/fade.js.map +1 -0
  181. package/dist/styles/fade.mjs +58 -0
  182. package/dist/styles/fade.mjs.map +1 -0
  183. package/dist/styles/fill.d.ts +44 -0
  184. package/dist/styles/fill.js +51 -0
  185. package/dist/styles/fill.js.map +1 -0
  186. package/dist/styles/fill.mjs +51 -0
  187. package/dist/styles/fill.mjs.map +1 -0
  188. package/dist/styles/flow.d.ts +16 -0
  189. package/dist/styles/flow.js +12 -0
  190. package/dist/styles/flow.js.map +1 -0
  191. package/dist/styles/flow.mjs +12 -0
  192. package/dist/styles/flow.mjs.map +1 -0
  193. package/dist/styles/gap.d.ts +31 -0
  194. package/dist/styles/gap.js +37 -0
  195. package/dist/styles/gap.js.map +1 -0
  196. package/dist/styles/gap.mjs +37 -0
  197. package/dist/styles/gap.mjs.map +1 -0
  198. package/dist/styles/height.d.ts +17 -0
  199. package/dist/styles/height.js +20 -0
  200. package/dist/styles/height.js.map +1 -0
  201. package/dist/styles/height.mjs +20 -0
  202. package/dist/styles/height.mjs.map +1 -0
  203. package/dist/styles/index.d.ts +2 -0
  204. package/dist/styles/index.js +9 -0
  205. package/dist/styles/index.js.map +1 -0
  206. package/dist/styles/index.mjs +9 -0
  207. package/dist/styles/index.mjs.map +1 -0
  208. package/dist/styles/inset.d.ts +50 -0
  209. package/dist/styles/inset.js +142 -0
  210. package/dist/styles/inset.js.map +1 -0
  211. package/dist/styles/inset.mjs +142 -0
  212. package/dist/styles/inset.mjs.map +1 -0
  213. package/dist/styles/justify.d.ts +15 -0
  214. package/dist/styles/justify.js +14 -0
  215. package/dist/styles/justify.js.map +1 -0
  216. package/dist/styles/justify.mjs +14 -0
  217. package/dist/styles/justify.mjs.map +1 -0
  218. package/dist/styles/list.d.ts +16 -0
  219. package/dist/styles/list.js +98 -0
  220. package/dist/styles/list.js.map +1 -0
  221. package/dist/styles/margin.d.ts +28 -0
  222. package/dist/styles/margin.js +96 -0
  223. package/dist/styles/margin.js.map +1 -0
  224. package/dist/styles/margin.mjs +96 -0
  225. package/dist/styles/margin.mjs.map +1 -0
  226. package/dist/styles/outline.d.ts +29 -0
  227. package/dist/styles/outline.js +65 -0
  228. package/dist/styles/outline.js.map +1 -0
  229. package/dist/styles/outline.mjs +65 -0
  230. package/dist/styles/outline.mjs.map +1 -0
  231. package/dist/styles/padding.d.ts +28 -0
  232. package/dist/styles/padding.js +96 -0
  233. package/dist/styles/padding.js.map +1 -0
  234. package/dist/styles/padding.mjs +96 -0
  235. package/dist/styles/padding.mjs.map +1 -0
  236. package/dist/styles/predefined.d.ts +74 -0
  237. package/dist/styles/predefined.js +241 -0
  238. package/dist/styles/predefined.js.map +1 -0
  239. package/dist/styles/predefined.mjs +232 -0
  240. package/dist/styles/predefined.mjs.map +1 -0
  241. package/dist/styles/preset.d.ts +47 -0
  242. package/dist/styles/preset.js +126 -0
  243. package/dist/styles/preset.js.map +1 -0
  244. package/dist/styles/preset.mjs +126 -0
  245. package/dist/styles/preset.mjs.map +1 -0
  246. package/dist/styles/radius.d.ts +14 -0
  247. package/dist/styles/radius.js +51 -0
  248. package/dist/styles/radius.js.map +1 -0
  249. package/dist/styles/radius.mjs +51 -0
  250. package/dist/styles/radius.mjs.map +1 -0
  251. package/dist/styles/scrollbar.d.ts +21 -0
  252. package/dist/styles/scrollbar.js +105 -0
  253. package/dist/styles/scrollbar.js.map +1 -0
  254. package/dist/styles/scrollbar.mjs +105 -0
  255. package/dist/styles/scrollbar.mjs.map +1 -0
  256. package/dist/styles/shadow.d.ts +14 -0
  257. package/dist/styles/shadow.js +24 -0
  258. package/dist/styles/shadow.js.map +1 -0
  259. package/dist/styles/shadow.mjs +24 -0
  260. package/dist/styles/shadow.mjs.map +1 -0
  261. package/dist/styles/styledScrollbar.d.ts +47 -0
  262. package/dist/styles/styledScrollbar.js +38 -0
  263. package/dist/styles/styledScrollbar.js.map +1 -0
  264. package/dist/styles/styledScrollbar.mjs +38 -0
  265. package/dist/styles/styledScrollbar.mjs.map +1 -0
  266. package/dist/styles/transition.d.ts +14 -0
  267. package/dist/styles/transition.js +138 -0
  268. package/dist/styles/transition.js.map +1 -0
  269. package/dist/styles/transition.mjs +138 -0
  270. package/dist/styles/transition.mjs.map +1 -0
  271. package/dist/styles/types.d.mts +492 -0
  272. package/dist/styles/types.d.ts +496 -0
  273. package/dist/styles/width.d.ts +17 -0
  274. package/dist/styles/width.js +20 -0
  275. package/dist/styles/width.js.map +1 -0
  276. package/dist/styles/width.mjs +20 -0
  277. package/dist/styles/width.mjs.map +1 -0
  278. package/dist/tasty.d.ts +983 -0
  279. package/dist/tasty.js +191 -0
  280. package/dist/tasty.js.map +1 -0
  281. package/dist/tokens/typography.d.ts +19 -0
  282. package/dist/tokens/typography.js +237 -0
  283. package/dist/tokens/typography.js.map +1 -0
  284. package/dist/types.d.ts +182 -0
  285. package/dist/utils/cache-wrapper.js +26 -0
  286. package/dist/utils/cache-wrapper.js.map +1 -0
  287. package/dist/utils/cache-wrapper.mjs +26 -0
  288. package/dist/utils/cache-wrapper.mjs.map +1 -0
  289. package/dist/utils/case-converter.js +8 -0
  290. package/dist/utils/case-converter.js.map +1 -0
  291. package/dist/utils/case-converter.mjs +8 -0
  292. package/dist/utils/case-converter.mjs.map +1 -0
  293. package/dist/utils/colors.d.ts +5 -0
  294. package/dist/utils/colors.js +9 -0
  295. package/dist/utils/colors.js.map +1 -0
  296. package/dist/utils/dotize.d.ts +26 -0
  297. package/dist/utils/dotize.js +122 -0
  298. package/dist/utils/dotize.js.map +1 -0
  299. package/dist/utils/filter-base-props.d.ts +15 -0
  300. package/dist/utils/filter-base-props.js +45 -0
  301. package/dist/utils/filter-base-props.js.map +1 -0
  302. package/dist/utils/get-display-name.d.ts +7 -0
  303. package/dist/utils/get-display-name.js +10 -0
  304. package/dist/utils/get-display-name.js.map +1 -0
  305. package/dist/utils/hsl-to-rgb.js +38 -0
  306. package/dist/utils/hsl-to-rgb.js.map +1 -0
  307. package/dist/utils/hsl-to-rgb.mjs +38 -0
  308. package/dist/utils/hsl-to-rgb.mjs.map +1 -0
  309. package/dist/utils/is-dev-env.js +19 -0
  310. package/dist/utils/is-dev-env.js.map +1 -0
  311. package/dist/utils/is-dev-env.mjs +19 -0
  312. package/dist/utils/is-dev-env.mjs.map +1 -0
  313. package/dist/utils/merge-styles.d.ts +7 -0
  314. package/dist/utils/merge-styles.js +146 -0
  315. package/dist/utils/merge-styles.js.map +1 -0
  316. package/dist/utils/merge-styles.mjs +146 -0
  317. package/dist/utils/merge-styles.mjs.map +1 -0
  318. package/dist/utils/mod-attrs.d.ts +8 -0
  319. package/dist/utils/mod-attrs.js +21 -0
  320. package/dist/utils/mod-attrs.js.map +1 -0
  321. package/dist/utils/okhsl-to-rgb.js +296 -0
  322. package/dist/utils/okhsl-to-rgb.js.map +1 -0
  323. package/dist/utils/okhsl-to-rgb.mjs +296 -0
  324. package/dist/utils/okhsl-to-rgb.mjs.map +1 -0
  325. package/dist/utils/process-tokens.d.ts +31 -0
  326. package/dist/utils/process-tokens.js +171 -0
  327. package/dist/utils/process-tokens.js.map +1 -0
  328. package/dist/utils/process-tokens.mjs +28 -0
  329. package/dist/utils/process-tokens.mjs.map +1 -0
  330. package/dist/utils/resolve-recipes.d.ts +17 -0
  331. package/dist/utils/resolve-recipes.js +143 -0
  332. package/dist/utils/resolve-recipes.js.map +1 -0
  333. package/dist/utils/resolve-recipes.mjs +143 -0
  334. package/dist/utils/resolve-recipes.mjs.map +1 -0
  335. package/dist/utils/string.js +8 -0
  336. package/dist/utils/string.js.map +1 -0
  337. package/dist/utils/string.mjs +8 -0
  338. package/dist/utils/string.mjs.map +1 -0
  339. package/dist/utils/styles.d.mts +18 -0
  340. package/dist/utils/styles.d.ts +183 -0
  341. package/dist/utils/styles.js +585 -0
  342. package/dist/utils/styles.js.map +1 -0
  343. package/dist/utils/styles.mjs +346 -0
  344. package/dist/utils/styles.mjs.map +1 -0
  345. package/dist/utils/typography.d.ts +36 -0
  346. package/dist/utils/typography.js +53 -0
  347. package/dist/utils/typography.js.map +1 -0
  348. package/dist/utils/warnings.d.ts +16 -0
  349. package/dist/utils/warnings.js +16 -0
  350. package/dist/utils/warnings.js.map +1 -0
  351. package/dist/zero/babel.d.mts +108 -0
  352. package/dist/zero/babel.mjs +282 -0
  353. package/dist/zero/babel.mjs.map +1 -0
  354. package/dist/zero/index.d.mts +3 -0
  355. package/dist/zero/index.mjs +4 -0
  356. package/dist/zero/next.d.mts +60 -0
  357. package/dist/zero/next.mjs +78 -0
  358. package/dist/zero/next.mjs.map +1 -0
  359. package/package.json +127 -0
@@ -0,0 +1,182 @@
1
+ import { Styles } from "./styles/types.js";
2
+ import { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES } from "./styles/list.js";
3
+ import { AllHTMLAttributes, CSSProperties, ComponentType } from "react";
4
+
5
+ //#region src/types.d.ts
6
+ interface GlobalStyledProps {
7
+ breakpoints?: number[];
8
+ }
9
+ /**
10
+ * Extensible interface for theme names.
11
+ * Augment this interface to register project-specific theme names for autocomplete.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * declare module '@tenphi/tasty' {
16
+ * interface TastyThemeNames {
17
+ * danger: true;
18
+ * success: true;
19
+ * }
20
+ * }
21
+ * ```
22
+ */
23
+ interface TastyThemeNames {}
24
+ type ThemeNameKey = Extract<keyof TastyThemeNames, string>;
25
+ type ThemeName = [ThemeNameKey] extends [never] ? string : ThemeNameKey;
26
+ /** Allowed mod value types */
27
+ type ModValue = boolean | string | number | undefined | null;
28
+ /**
29
+ * Type for element modifiers (mods prop).
30
+ * Can be used as a generic to define known modifiers with autocomplete:
31
+ * @example
32
+ * type ButtonMods = Mods<{
33
+ * loading?: boolean;
34
+ * selected?: boolean;
35
+ * }>;
36
+ */
37
+ type Mods<T extends Record<string, ModValue> = Record<string, ModValue>> = T & Record<string, ModValue>;
38
+ /**
39
+ * Token value: string or number (processed), boolean for special handling, undefined/null (skipped).
40
+ * For color tokens (#name), boolean `true` is converted to `transparent`.
41
+ * For non-color tokens ($name), boolean `true` results in an empty string value.
42
+ * Boolean `false` results in no CSS output (token is skipped).
43
+ */
44
+ type TokenValue = string | number | boolean | undefined | null;
45
+ /**
46
+ * Tokens definition for inline CSS custom properties.
47
+ * - `$name` keys become `--name` CSS properties
48
+ * - `#name` keys become `--name-color` and `--name-color-rgb` CSS properties
49
+ */
50
+ type Tokens = Record<`$${string}` | `#${string}`, TokenValue>;
51
+ 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';
52
+ interface BasePropsWithoutChildren<K extends TagName = TagName> extends Pick<AllHTMLAttributes<HTMLElement>, 'className' | 'role' | 'id'> {
53
+ /** The HTML tag or React component to render as */
54
+ as?: K | ComponentType<any>;
55
+ /** QA ID for e2e testing. An alias for `data-qa` attribute. */
56
+ qa?: string;
57
+ /** QA value for e2e testing. An alias for `data-qaval` attribute. */
58
+ qaVal?: string | number;
59
+ /** Inner element name */
60
+ element?: `${Caps}${string}`;
61
+ /** The style map */
62
+ styles?: Styles;
63
+ /** The list of responsive points in pixels */
64
+ breakpoints?: number[];
65
+ /** Whether the element has the block layout outside */
66
+ block?: boolean;
67
+ /** Whether the element has the inline layout outside */
68
+ inline?: boolean;
69
+ /** The list of element modifiers **/
70
+ mods?: Mods;
71
+ /** Whether the element is hidden (`hidden` attribute is set) */
72
+ isHidden?: boolean;
73
+ /** Whether the element is disabled (`disabled` attribute is set) */
74
+ isDisabled?: boolean;
75
+ /** Plain css for the element */
76
+ css?: string;
77
+ /** The CSS style map */
78
+ style?: CSSProperties | (CSSProperties & Record<string, string | number | null | undefined>);
79
+ /** User-defined theme for the element. Mapped to `data-theme` attribute. Augment `TastyThemeNames` to register project-specific themes for autocomplete. */
80
+ theme?: ThemeName | (string & {});
81
+ /** CSS custom property tokens rendered as inline styles */
82
+ tokens?: Tokens;
83
+ }
84
+ interface BaseProps<K extends TagName = TagName> extends BasePropsWithoutChildren<K>, Pick<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'children'> {}
85
+ 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'> {}
86
+ type BaseStyleProps = Pick<Styles, (typeof BASE_STYLES)[number]>;
87
+ type PositionStyleProps = Pick<Styles, (typeof POSITION_STYLES)[number]>;
88
+ type BlockStyleProps = Pick<Styles, (typeof BLOCK_STYLES)[number]>;
89
+ type BlockInnerStyleProps = Pick<Styles, (typeof BLOCK_INNER_STYLES)[number]>;
90
+ type BlockOuterStyleProps = Pick<Styles, (typeof BLOCK_OUTER_STYLES)[number]>;
91
+ type ColorStyleProps = Pick<Styles, (typeof COLOR_STYLES)[number]>;
92
+ type TextStyleProps = Pick<Styles, (typeof TEXT_STYLES)[number]>;
93
+ type DimensionStyleProps = Pick<Styles, (typeof DIMENSION_STYLES)[number]>;
94
+ type FlowStyleProps = Pick<Styles, (typeof FLOW_STYLES)[number]>;
95
+ type ContainerStyleProps = Pick<Styles, (typeof CONTAINER_STYLES)[number]>;
96
+ type OuterStyleProps = Pick<Styles, (typeof OUTER_STYLES)[number]>;
97
+ interface ShortGridStyles {
98
+ template?: Styles['gridTemplate'];
99
+ columns?: Styles['gridColumns'];
100
+ rows?: Styles['gridRows'];
101
+ areas?: Styles['gridAreas'];
102
+ }
103
+ type Props = Record<string, any>;
104
+ type TagName = keyof HTMLElementTagNameMap;
105
+ /**
106
+ * Configuration type for tasty.config.ts files.
107
+ * Used by the Tasty VSCode extension for validation and autocomplete.
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * import type { TastyExtensionConfig } from '@tenphi/tasty';
112
+ *
113
+ * const config: TastyExtensionConfig = {
114
+ * tokens: ['#primary', '#danger', '$spacing'],
115
+ * units: ['x', 'r', 'bw'],
116
+ * states: ['@mobile', '@tablet', '@dark'],
117
+ * presets: ['h1', 'h2', 't1', 't2'],
118
+ * };
119
+ *
120
+ * export default config;
121
+ * ```
122
+ */
123
+ interface TastyExtensionConfig {
124
+ /**
125
+ * Extend another config file. Path is relative to this config file.
126
+ * The extended config is merged first, then this config's values are added.
127
+ * @example '../tasty.config.ts'
128
+ */
129
+ extends?: string;
130
+ /**
131
+ * Valid token names for validation and autocomplete.
132
+ * Use # prefix for colors, $ prefix for custom properties.
133
+ * Set to `false` to disable token validation (overrides parent).
134
+ * @example ['#primary', '#danger', '$spacing', '$gap']
135
+ */
136
+ tokens?: false | string[];
137
+ /**
138
+ * Valid custom unit names.
139
+ * Set to `false` to disable unit validation (overrides parent).
140
+ * @example ['x', 'r', 'bw', 'cols']
141
+ */
142
+ units?: false | string[];
143
+ /**
144
+ * Valid custom function names.
145
+ * Set to `false` to disable function validation (overrides parent).
146
+ * @example ['clamp', 'double']
147
+ */
148
+ funcs?: false | string[];
149
+ /**
150
+ * State alias names for autocomplete.
151
+ * Must start with @ prefix.
152
+ * @example ['@mobile', '@tablet', '@dark']
153
+ */
154
+ states?: string[];
155
+ /**
156
+ * Valid preset names for the `preset` style property.
157
+ * Tasty has no built-in presets - they are project-specific.
158
+ * @example ['h1', 'h2', 'h3', 't1', 't2', 't3', 'tag']
159
+ */
160
+ presets?: string[];
161
+ /**
162
+ * Custom style property names added via configure({ handlers }).
163
+ * Suppresses "unknown property" warnings for these names.
164
+ * @example ['myGradient', 'customLayout', 'brandBorder']
165
+ */
166
+ styles?: string[];
167
+ /**
168
+ * Descriptions for presets, shown on hover in the extension.
169
+ * Maps preset names to human-readable descriptions.
170
+ * @example { h1: 'Heading 1 (36px/44px, semibold)', t1: 'Text large (18px/24px)' }
171
+ */
172
+ presetDescriptions?: Record<string, string>;
173
+ /**
174
+ * Descriptions for state aliases, shown on hover in the extension.
175
+ * Maps state names to human-readable descriptions.
176
+ * @example { '@mobile': 'Mobile viewport (width < 768px)' }
177
+ */
178
+ stateDescriptions?: Record<string, string>;
179
+ }
180
+ //#endregion
181
+ export { AllBaseProps, BaseProps, BasePropsWithoutChildren, BaseStyleProps, BlockInnerStyleProps, BlockOuterStyleProps, BlockStyleProps, ColorStyleProps, ContainerStyleProps, DimensionStyleProps, FlowStyleProps, GlobalStyledProps, ModValue, Mods, OuterStyleProps, PositionStyleProps, Props, ShortGridStyles, TagName, TastyExtensionConfig, TastyThemeNames, TextStyleProps, TokenValue, Tokens };
182
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,26 @@
1
+ //#region src/utils/cache-wrapper.ts
2
+ /**
3
+ * Create a function that caches the result up to the limit.
4
+ */
5
+ function cacheWrapper(handler, limit = 1e3) {
6
+ const cache = /* @__PURE__ */ new Map();
7
+ let count = 0;
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
+ if (count > limit) {
13
+ cache.clear();
14
+ count = 0;
15
+ }
16
+ count++;
17
+ result = secondArg == null ? handler(firstArg) : handler(firstArg, secondArg);
18
+ cache.set(key, result);
19
+ }
20
+ return result;
21
+ };
22
+ }
23
+
24
+ //#endregion
25
+ export { cacheWrapper };
26
+ //# sourceMappingURL=cache-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-wrapper.js","names":[],"sources":["../../src/utils/cache-wrapper.ts"],"sourcesContent":["/**\n * Create a function that caches the result up to the limit.\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 Map<string, R>();\n let count = 0;\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 if (count > limit) {\n cache.clear();\n count = 0;\n }\n count++;\n result =\n secondArg == null ? handler(firstArg) : handler(firstArg, secondArg);\n cache.set(key, result);\n }\n return result;\n };\n}\n"],"mappings":";;;;AAGA,SAAgB,aACd,SACA,QAAQ,KAC2B;CACnC,MAAM,wBAAQ,IAAI,KAAgB;CAClC,IAAI,QAAQ;AAEZ,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,QAAW;AACxB,OAAI,QAAQ,OAAO;AACjB,UAAM,OAAO;AACb,YAAQ;;AAEV;AACA,YACE,aAAa,OAAO,QAAQ,SAAS,GAAG,QAAQ,UAAU,UAAU;AACtE,SAAM,IAAI,KAAK,OAAO;;AAExB,SAAO"}
@@ -0,0 +1,26 @@
1
+ //#region src/utils/cache-wrapper.ts
2
+ /**
3
+ * Create a function that caches the result up to the limit.
4
+ */
5
+ function cacheWrapper(handler, limit = 1e3) {
6
+ const cache = /* @__PURE__ */ new Map();
7
+ let count = 0;
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
+ if (count > limit) {
13
+ cache.clear();
14
+ count = 0;
15
+ }
16
+ count++;
17
+ result = secondArg == null ? handler(firstArg) : handler(firstArg, secondArg);
18
+ cache.set(key, result);
19
+ }
20
+ return result;
21
+ };
22
+ }
23
+
24
+ //#endregion
25
+ export { cacheWrapper };
26
+ //# sourceMappingURL=cache-wrapper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-wrapper.mjs","names":[],"sources":["../../src/utils/cache-wrapper.ts"],"sourcesContent":["/**\n * Create a function that caches the result up to the limit.\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 Map<string, R>();\n let count = 0;\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 if (count > limit) {\n cache.clear();\n count = 0;\n }\n count++;\n result =\n secondArg == null ? handler(firstArg) : handler(firstArg, secondArg);\n cache.set(key, result);\n }\n return result;\n };\n}\n"],"mappings":";;;;AAGA,SAAgB,aACd,SACA,QAAQ,KAC2B;CACnC,MAAM,wBAAQ,IAAI,KAAgB;CAClC,IAAI,QAAQ;AAEZ,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,QAAW;AACxB,OAAI,QAAQ,OAAO;AACjB,UAAM,OAAO;AACb,YAAQ;;AAEV;AACA,YACE,aAAa,OAAO,QAAQ,SAAS,GAAG,QAAQ,UAAU,UAAU;AACtE,SAAM,IAAI,KAAK,OAAO;;AAExB,SAAO"}
@@ -0,0 +1,8 @@
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
+
6
+ //#endregion
7
+ export { camelToKebab };
8
+ //# sourceMappingURL=case-converter.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,8 @@
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
+
6
+ //#endregion
7
+ export { camelToKebab };
8
+ //# sourceMappingURL=case-converter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case-converter.mjs","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"}
@@ -0,0 +1,5 @@
1
+ //#region src/utils/colors.d.ts
2
+ declare function color(name: any, opacity?: number): string;
3
+ //#endregion
4
+ export { color };
5
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1,9 @@
1
+ //#region src/utils/colors.ts
2
+ function color(name, opacity = 1) {
3
+ if (opacity !== 1) return `rgb(var(--${name}-color-rgb) / ${opacity})`;
4
+ return `var(--${name}-color)`;
5
+ }
6
+
7
+ //#endregion
8
+ export { color };
9
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","names":[],"sources":["../../src/utils/colors.ts"],"sourcesContent":["export function color(name, opacity = 1) {\n if (opacity !== 1) {\n return `rgb(var(--${name}-color-rgb) / ${opacity})`;\n }\n\n return `var(--${name}-color)`;\n}\n"],"mappings":";AAAA,SAAgB,MAAM,MAAM,UAAU,GAAG;AACvC,KAAI,YAAY,EACd,QAAO,aAAa,KAAK,gBAAgB,QAAQ;AAGnD,QAAO,SAAS,KAAK"}
@@ -0,0 +1,26 @@
1
+ //#region src/utils/dotize.d.ts
2
+ declare const dotize: {
3
+ valTypes: {
4
+ none: string;
5
+ primitive: string;
6
+ object: string;
7
+ array: string;
8
+ };
9
+ getValType: (val: any) => string | undefined;
10
+ getPathType: (arrPath: any) => never[];
11
+ isUndefined: (obj: any) => obj is undefined;
12
+ isNumber: (f: any) => boolean;
13
+ isEmptyObj: (obj: any) => boolean;
14
+ isPlainObject: (obj: any) => boolean;
15
+ isNotObject: (obj: any) => boolean;
16
+ isEmptyArray: (arr: any) => boolean;
17
+ isNotArray: (arr: any) => boolean;
18
+ removeEmptyArrayItem: (arr: any) => any;
19
+ getFieldName: (field: any, prefix: any, isRoot: any, isArrayItem: any, isArray: any) => string;
20
+ startsWith: (val: any, valToSearch: any) => boolean;
21
+ convert: (obj: any, prefix?: string) => any;
22
+ backward: (obj: any, prefix: any) => any;
23
+ };
24
+ //#endregion
25
+ export { dotize };
26
+ //# sourceMappingURL=dotize.d.ts.map
@@ -0,0 +1,122 @@
1
+ //#region src/utils/dotize.ts
2
+ const dotize = {
3
+ valTypes: {
4
+ none: "NONE",
5
+ primitive: "PRIM",
6
+ object: "OBJECT",
7
+ array: "ARRAY"
8
+ },
9
+ getValType: function(val) {
10
+ if (!val || typeof val != "object" || Array.isArray(val)) return dotize.valTypes.primitive;
11
+ if (typeof val == "object") return dotize.valTypes.object;
12
+ },
13
+ getPathType: function(arrPath) {
14
+ const arrPathTypes = [];
15
+ for (const path in arrPath) {
16
+ const pathVal = arrPath[path];
17
+ if (!pathVal) arrPathTypes.push(dotize.valTypes.none);
18
+ else if (dotize.isNumber(pathVal)) arrPathTypes.push(dotize.valTypes.array);
19
+ else arrPathTypes.push(dotize.valTypes.object);
20
+ }
21
+ return arrPathTypes;
22
+ },
23
+ isUndefined: function(obj) {
24
+ return typeof obj == "undefined";
25
+ },
26
+ isNumber: function(f) {
27
+ return !isNaN(parseInt(f));
28
+ },
29
+ isEmptyObj: function(obj) {
30
+ for (const prop in obj) if (Object.hasOwnProperty.call(obj, prop)) return false;
31
+ return JSON.stringify(obj) === JSON.stringify({});
32
+ },
33
+ isPlainObject: function(obj) {
34
+ if (typeof obj !== "object" || obj === null) return false;
35
+ return Object.getPrototypeOf(obj) === Object.prototype;
36
+ },
37
+ isNotObject: function(obj) {
38
+ return !obj || !this.isPlainObject(obj);
39
+ },
40
+ isEmptyArray: function(arr) {
41
+ return Array.isArray(arr) && arr.length == 0;
42
+ },
43
+ isNotArray: function(arr) {
44
+ return Array.isArray(arr) == false;
45
+ },
46
+ removeEmptyArrayItem: function(arr) {
47
+ return arr.filter(function(el) {
48
+ return el != null && el != "";
49
+ });
50
+ },
51
+ getFieldName: function(field, prefix, isRoot, isArrayItem, isArray) {
52
+ if (isArray) return (prefix ? prefix : "") + (dotize.isNumber(field) ? "[" + field + "]" : (isRoot && !prefix ? "" : ".") + field);
53
+ else if (isArrayItem) return (prefix ? prefix : "") + "[" + field + "]";
54
+ else return (prefix ? prefix + "." : "") + field;
55
+ },
56
+ startsWith: function(val, valToSearch) {
57
+ return val.indexOf(valToSearch) == 0;
58
+ },
59
+ convert: function(obj, prefix = "") {
60
+ let newObj = {};
61
+ if (dotize.isNotObject(obj)) if (prefix) {
62
+ newObj[prefix] = obj;
63
+ return newObj;
64
+ } else return obj;
65
+ return (function recurse(o, p, isRoot) {
66
+ const isArrayItem = Array.isArray(o);
67
+ for (const f in o) {
68
+ const currentProp = o[f];
69
+ if (currentProp && typeof currentProp === "object" && !Array.isArray(currentProp) && dotize.isPlainObject(currentProp)) {
70
+ if (isArrayItem && dotize.isEmptyObj(currentProp) == false) newObj = recurse(currentProp, dotize.getFieldName(f, p, isRoot, true));
71
+ else if (dotize.isEmptyObj(currentProp) == false) newObj = recurse(currentProp, dotize.getFieldName(f, p, isRoot));
72
+ else if (dotize.isEmptyObj(currentProp)) newObj[dotize.getFieldName(f, p, isRoot, isArrayItem)] = currentProp;
73
+ } else if (isArrayItem || dotize.isNumber(f)) newObj[dotize.getFieldName(f, p, isRoot, true)] = currentProp;
74
+ else newObj[dotize.getFieldName(f, p, isRoot)] = currentProp;
75
+ }
76
+ return newObj;
77
+ })(obj, prefix, true);
78
+ },
79
+ backward: function(obj, prefix) {
80
+ let newObj = {};
81
+ const arStartRegex = /\[(\d+)\]/g;
82
+ if (dotize.isNotObject(obj) && dotize.isNotArray(obj)) if (prefix) return obj[prefix];
83
+ else return obj;
84
+ for (let tProp in obj) {
85
+ const tPropVal = obj[tProp];
86
+ if (prefix) {
87
+ const prefixRegex = new RegExp("^" + prefix);
88
+ tProp = tProp.replace(prefixRegex, "");
89
+ }
90
+ tProp = tProp.replace(arStartRegex, ".$1");
91
+ if (dotize.startsWith(tProp, ".")) tProp = tProp.replace(/^\./, "");
92
+ const arrPath = tProp.split(".");
93
+ const arrPathTypes = dotize.getPathType(arrPath);
94
+ if (!dotize.isUndefined(arrPathTypes) && arrPathTypes[0] == dotize.valTypes.array && Array.isArray(newObj) == false) newObj = [];
95
+ (function recurse(rPropVal, rObj, rPropValPrev, rObjPrev) {
96
+ let currentPath = arrPath.shift();
97
+ const currentPathType = arrPathTypes.shift();
98
+ if (typeof currentPath == "undefined" || currentPath == "") {
99
+ newObj = rPropVal;
100
+ return;
101
+ }
102
+ const isArray = currentPathType == dotize.valTypes.array;
103
+ if (dotize.isNumber(currentPath)) currentPath = parseInt(currentPath);
104
+ if (arrPath.length > 0) {
105
+ if (typeof rObj[currentPath] == "undefined") if (isArray) rObj[currentPath] = [];
106
+ else rObj[currentPath] = {};
107
+ recurse(rPropVal, rObj[currentPath], currentPath, rObj);
108
+ return;
109
+ }
110
+ if (currentPathType == dotize.valTypes.array && rPropValPrev && rObjPrev) {
111
+ if (Array.isArray(rObjPrev[rPropValPrev]) == false) rObjPrev[rPropValPrev] = [];
112
+ rObjPrev[rPropValPrev].push(rPropVal);
113
+ } else rObj[currentPath] = rPropVal;
114
+ })(tPropVal, newObj);
115
+ }
116
+ return newObj;
117
+ }
118
+ };
119
+
120
+ //#endregion
121
+ export { dotize };
122
+ //# sourceMappingURL=dotize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dotize.js","names":[],"sources":["../../src/utils/dotize.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n// Convert complex js object to dot notation js object\n// url: https://github.com/vardars/dotize\n// author: vardars\n\nexport const dotize = {\n valTypes: {\n none: 'NONE',\n primitive: 'PRIM',\n object: 'OBJECT',\n array: 'ARRAY',\n },\n\n getValType: function (val) {\n if (!val || typeof val != 'object' || Array.isArray(val))\n return dotize.valTypes.primitive;\n if (typeof val == 'object') return dotize.valTypes.object;\n },\n\n getPathType: function (arrPath) {\n const arrPathTypes = [];\n for (const path in arrPath) {\n const pathVal = arrPath[path];\n if (!pathVal) arrPathTypes.push(dotize.valTypes.none);\n else if (dotize.isNumber(pathVal))\n arrPathTypes.push(dotize.valTypes.array);\n else arrPathTypes.push(dotize.valTypes.object);\n }\n return arrPathTypes;\n },\n\n isUndefined: function (obj) {\n return typeof obj == 'undefined';\n },\n\n isNumber: function (f) {\n return !isNaN(parseInt(f));\n },\n\n isEmptyObj: function (obj) {\n for (const prop in obj) {\n if (Object.hasOwnProperty.call(obj, prop)) return false;\n }\n\n return JSON.stringify(obj) === JSON.stringify({});\n },\n\n isPlainObject: function (obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n\n return Object.getPrototypeOf(obj) === Object.prototype;\n },\n\n isNotObject: function (obj) {\n return !obj || !this.isPlainObject(obj);\n },\n\n isEmptyArray: function (arr) {\n return Array.isArray(arr) && arr.length == 0;\n },\n\n isNotArray: function (arr) {\n return Array.isArray(arr) == false;\n },\n\n removeEmptyArrayItem: function (arr) {\n return arr.filter(function (el) {\n return el != null && el != '';\n });\n },\n\n getFieldName: function (field, prefix, isRoot, isArrayItem, isArray) {\n if (isArray)\n return (\n (prefix ? prefix : '') +\n (dotize.isNumber(field)\n ? '[' + field + ']'\n : (isRoot && !prefix ? '' : '.') + field)\n );\n else if (isArrayItem) return (prefix ? prefix : '') + '[' + field + ']';\n else return (prefix ? prefix + '.' : '') + field;\n },\n\n startsWith: function (val, valToSearch) {\n return val.indexOf(valToSearch) == 0;\n },\n\n convert: function (obj, prefix = '') {\n let newObj = {};\n\n // primitives\n if (dotize.isNotObject(obj)) {\n if (prefix) {\n newObj[prefix] = obj;\n return newObj;\n } else {\n return obj;\n }\n }\n\n return (function recurse(o, p, isRoot) {\n const isArrayItem = Array.isArray(o);\n for (const f in o) {\n const currentProp = o[f];\n if (\n currentProp &&\n typeof currentProp === 'object' &&\n !Array.isArray(currentProp) &&\n dotize.isPlainObject(currentProp)\n ) {\n if (isArrayItem && dotize.isEmptyObj(currentProp) == false) {\n newObj = recurse(\n currentProp,\n dotize.getFieldName(f, p, isRoot, true),\n ); // array item object\n } else if (dotize.isEmptyObj(currentProp) == false) {\n newObj = recurse(currentProp, dotize.getFieldName(f, p, isRoot)); // object\n } else if (dotize.isEmptyObj(currentProp)) {\n newObj[dotize.getFieldName(f, p, isRoot, isArrayItem)] =\n currentProp;\n }\n } else {\n if (isArrayItem || dotize.isNumber(f)) {\n newObj[dotize.getFieldName(f, p, isRoot, true)] = currentProp; // array item primitive\n } else {\n newObj[dotize.getFieldName(f, p, isRoot)] = currentProp; // primitive\n }\n }\n }\n\n return newObj;\n })(obj, prefix, true);\n },\n\n backward: function (obj, prefix) {\n let newObj = {};\n const arStartRegex = /\\[(\\d+)\\]/g;\n\n // primitives\n if (dotize.isNotObject(obj) && dotize.isNotArray(obj)) {\n if (prefix) {\n return obj[prefix];\n } else {\n return obj;\n }\n }\n\n for (let tProp in obj) {\n const tPropVal = obj[tProp];\n\n if (prefix) {\n const prefixRegex = new RegExp('^' + prefix);\n tProp = tProp.replace(prefixRegex, '');\n }\n\n tProp = tProp.replace(arStartRegex, '.$1');\n\n if (dotize.startsWith(tProp, '.')) tProp = tProp.replace(/^\\./, '');\n\n const arrPath = tProp.split('.');\n const arrPathTypes = dotize.getPathType(arrPath);\n\n // has array on root\n if (\n !dotize.isUndefined(arrPathTypes) &&\n arrPathTypes[0] == dotize.valTypes.array &&\n Array.isArray(newObj) == false\n ) {\n newObj = [];\n }\n\n (function recurse(rPropVal, rObj, rPropValPrev, rObjPrev) {\n let currentPath = arrPath.shift();\n const currentPathType = arrPathTypes.shift();\n\n if (typeof currentPath == 'undefined' || currentPath == '') {\n newObj = rPropVal;\n return;\n }\n\n const isArray = currentPathType == dotize.valTypes.array;\n\n if (dotize.isNumber(currentPath)) currentPath = parseInt(currentPath);\n\n // has multiple levels\n if (arrPath.length > 0) {\n // is not assigned before\n if (typeof rObj[currentPath] == 'undefined') {\n if (isArray) {\n rObj[currentPath] = [];\n } else {\n rObj[currentPath] = {};\n }\n }\n\n recurse(rPropVal, rObj[currentPath], currentPath, rObj);\n return;\n }\n\n if (\n currentPathType == dotize.valTypes.array &&\n rPropValPrev &&\n rObjPrev\n ) {\n if (Array.isArray(rObjPrev[rPropValPrev]) == false)\n rObjPrev[rPropValPrev] = [];\n rObjPrev[rPropValPrev].push(rPropVal);\n } else {\n rObj[currentPath] = rPropVal;\n }\n })(tPropVal, newObj);\n }\n\n return newObj;\n },\n};\n"],"mappings":"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"}
@@ -0,0 +1,15 @@
1
+ //#region src/utils/filter-base-props.d.ts
2
+ interface PropsFilterOptions {
3
+ labelable?: boolean;
4
+ propNames?: Set<string>;
5
+ eventProps?: boolean;
6
+ }
7
+ /**
8
+ * Filters out all props that aren't valid DOM props or defined via override prop obj.
9
+ * @param props - The component props to be filtered.
10
+ * @param opts - Props to override.
11
+ */
12
+ declare function filterBaseProps(props: Record<string, unknown>, opts?: PropsFilterOptions): Record<string, unknown>;
13
+ //#endregion
14
+ export { filterBaseProps };
15
+ //# sourceMappingURL=filter-base-props.d.ts.map
@@ -0,0 +1,45 @@
1
+ //#region src/utils/filter-base-props.ts
2
+ const DOMPropNames = new Set(["id"]);
3
+ const BasePropNames = new Set([
4
+ "role",
5
+ "as",
6
+ "element",
7
+ "css",
8
+ "qa",
9
+ "mods",
10
+ "qaVal",
11
+ "hidden",
12
+ "isHidden",
13
+ "disabled",
14
+ "isDisabled",
15
+ "children",
16
+ "style",
17
+ "className",
18
+ "href",
19
+ "target",
20
+ "tabIndex"
21
+ ]);
22
+ const ignoreEventPropsNames = new Set([
23
+ "onPress",
24
+ "onHoverStart",
25
+ "onHoverEnd",
26
+ "onPressStart",
27
+ "onPressEnd"
28
+ ]);
29
+ const propRe = /^((data-).*)$/;
30
+ const eventRe = /^on[A-Z].+$/;
31
+ /**
32
+ * Filters out all props that aren't valid DOM props or defined via override prop obj.
33
+ * @param props - The component props to be filtered.
34
+ * @param opts - Props to override.
35
+ */
36
+ function filterBaseProps(props, opts = {}) {
37
+ const { propNames, eventProps } = opts;
38
+ const filteredProps = {};
39
+ for (const prop in props) if (Object.prototype.hasOwnProperty.call(props, prop) && (DOMPropNames.has(prop) || BasePropNames.has(prop) || prop.startsWith("aria-") || eventProps && eventRe.test(prop) && !ignoreEventPropsNames.has(prop) || propNames?.has(prop) || propRe.test(prop))) filteredProps[prop] = props[prop];
40
+ return filteredProps;
41
+ }
42
+
43
+ //#endregion
44
+ export { filterBaseProps };
45
+ //# sourceMappingURL=filter-base-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-base-props.js","names":[],"sources":["../../src/utils/filter-base-props.ts"],"sourcesContent":["const DOMPropNames = new Set(['id']);\n\nconst BasePropNames = new Set([\n 'role',\n 'as',\n 'element',\n 'css',\n 'qa',\n 'mods',\n 'qaVal',\n 'hidden',\n 'isHidden',\n 'disabled',\n 'isDisabled',\n 'children',\n 'style',\n 'className',\n 'href',\n 'target',\n 'tabIndex',\n]);\n\nconst ignoreEventPropsNames = new Set([\n 'onPress',\n 'onHoverStart',\n 'onHoverEnd',\n 'onPressStart',\n 'onPressEnd',\n]);\n\nconst propRe = /^((data-).*)$/;\nconst eventRe = /^on[A-Z].+$/;\n\ninterface PropsFilterOptions {\n // @deprecated\n labelable?: boolean;\n propNames?: Set<string>;\n eventProps?: boolean;\n}\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterBaseProps(\n props: Record<string, unknown>,\n opts: PropsFilterOptions = {},\n): Record<string, unknown> {\n const { propNames, eventProps } = opts;\n const filteredProps: Record<string, unknown> = {};\n\n for (const prop in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, prop) &&\n (DOMPropNames.has(prop) ||\n BasePropNames.has(prop) ||\n // Always preserve any ARIA attributes to maintain accessibility support.\n prop.startsWith('aria-') ||\n (eventProps &&\n eventRe.test(prop) &&\n !ignoreEventPropsNames.has(prop)) ||\n propNames?.has(prop) ||\n propRe.test(prop))\n ) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n"],"mappings":";AAAA,MAAM,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC;AAEpC,MAAM,gBAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,wBAAwB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,SAAS;AACf,MAAM,UAAU;;;;;;AAchB,SAAgB,gBACd,OACA,OAA2B,EAAE,EACJ;CACzB,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,gBAAyC,EAAE;AAEjD,MAAK,MAAM,QAAQ,MACjB,KACE,OAAO,UAAU,eAAe,KAAK,OAAO,KAAK,KAChD,aAAa,IAAI,KAAK,IACrB,cAAc,IAAI,KAAK,IAEvB,KAAK,WAAW,QAAQ,IACvB,cACC,QAAQ,KAAK,KAAK,IAClB,CAAC,sBAAsB,IAAI,KAAK,IAClC,WAAW,IAAI,KAAK,IACpB,OAAO,KAAK,KAAK,EAEnB,eAAc,QAAQ,MAAM;AAIhC,QAAO"}
@@ -0,0 +1,7 @@
1
+ import { ElementType } from "react";
2
+
3
+ //#region src/utils/get-display-name.d.ts
4
+ declare function getDisplayName<T>(Component: ElementType<T>, fallbackName?: string): string;
5
+ //#endregion
6
+ export { getDisplayName };
7
+ //# sourceMappingURL=get-display-name.d.ts.map
@@ -0,0 +1,10 @@
1
+ //#region src/utils/get-display-name.ts
2
+ const DEFAULT_NAME = "Anonymous";
3
+ function getDisplayName(Component, fallbackName = DEFAULT_NAME) {
4
+ if (typeof Component === "function") return Component.displayName ?? Component.name ?? fallbackName;
5
+ return fallbackName;
6
+ }
7
+
8
+ //#endregion
9
+ export { getDisplayName };
10
+ //# sourceMappingURL=get-display-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-display-name.js","names":[],"sources":["../../src/utils/get-display-name.ts"],"sourcesContent":["import type { ElementType } from 'react';\n\nconst DEFAULT_NAME = 'Anonymous';\n\nexport function getDisplayName<T>(\n Component: ElementType<T>,\n fallbackName = DEFAULT_NAME,\n): string {\n if (typeof Component === 'function') {\n return Component.displayName ?? Component.name ?? fallbackName;\n }\n\n return fallbackName;\n}\n"],"mappings":";AAEA,MAAM,eAAe;AAErB,SAAgB,eACd,WACA,eAAe,cACP;AACR,KAAI,OAAO,cAAc,WACvB,QAAO,UAAU,eAAe,UAAU,QAAQ;AAGpD,QAAO"}
@@ -0,0 +1,38 @@
1
+ import { hslToRgbValues } from "./process-tokens.js";
2
+
3
+ //#region src/utils/hsl-to-rgb.ts
4
+ /**
5
+ * Convert HSL color string to RGB.
6
+ * Supports:
7
+ * - Modern: hsl(h s% l%), hsl(h s% l% / a)
8
+ * - Legacy: hsl(h, s%, l%), hsla(h, s%, l%, a)
9
+ */
10
+ function hslToRgb(hslStr) {
11
+ const match = hslStr.match(/hsla?\(([^)]+)\)/i);
12
+ if (!match) return null;
13
+ const [colorPart, slashAlpha] = match[1].trim().split("/");
14
+ const parts = colorPart.trim().split(/[,\s]+/).filter(Boolean);
15
+ if (parts.length < 3) return null;
16
+ const alphaPart = slashAlpha?.trim() || (parts.length >= 4 ? parts[3] : null);
17
+ let h = parseFloat(parts[0]);
18
+ const hueStr = parts[0].toLowerCase();
19
+ if (hueStr.endsWith("turn")) h = parseFloat(hueStr) * 360;
20
+ else if (hueStr.endsWith("rad")) h = parseFloat(hueStr) * 180 / Math.PI;
21
+ h = (h % 360 + 360) % 360;
22
+ const parsePercent = (val) => {
23
+ const num = parseFloat(val);
24
+ return val.includes("%") ? num / 100 : num;
25
+ };
26
+ const s = Math.max(0, Math.min(1, parsePercent(parts[1])));
27
+ const l = Math.max(0, Math.min(1, parsePercent(parts[2])));
28
+ const [r, g, b] = hslToRgbValues(h, s, l);
29
+ if (alphaPart) {
30
+ const alpha = parseFloat(alphaPart.trim());
31
+ return `rgba(${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)}, ${alpha})`;
32
+ }
33
+ return `rgb(${Math.round(r)} ${Math.round(g)} ${Math.round(b)})`;
34
+ }
35
+
36
+ //#endregion
37
+ export { hslToRgb };
38
+ //# sourceMappingURL=hsl-to-rgb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hsl-to-rgb.js","names":[],"sources":["../../src/utils/hsl-to-rgb.ts"],"sourcesContent":["import { hslToRgbValues } from './process-tokens';\n\n/**\n * Convert HSL color string to RGB.\n * Supports:\n * - Modern: hsl(h s% l%), hsl(h s% l% / a)\n * - Legacy: hsl(h, s%, l%), hsla(h, s%, l%, a)\n */\nexport function hslToRgb(hslStr: string): string | null {\n const match = hslStr.match(/hsla?\\(([^)]+)\\)/i);\n if (!match) return null;\n\n const inner = match[1].trim();\n const [colorPart, slashAlpha] = inner.split('/');\n const parts = colorPart\n .trim()\n .split(/[,\\s]+/)\n .filter(Boolean);\n\n if (parts.length < 3) return null;\n\n // Alpha can come from slash notation (modern) or 4th part (legacy comma syntax)\n const alphaPart = slashAlpha?.trim() || (parts.length >= 4 ? parts[3] : null);\n\n // Parse hue\n let h = parseFloat(parts[0]);\n const hueStr = parts[0].toLowerCase();\n if (hueStr.endsWith('turn')) h = parseFloat(hueStr) * 360;\n else if (hueStr.endsWith('rad')) h = (parseFloat(hueStr) * 180) / Math.PI;\n h = ((h % 360) + 360) % 360;\n\n // Parse saturation and lightness\n const parsePercent = (val: string): number => {\n const num = parseFloat(val);\n return val.includes('%') ? num / 100 : num;\n };\n const s = Math.max(0, Math.min(1, parsePercent(parts[1])));\n const l = Math.max(0, Math.min(1, parsePercent(parts[2])));\n\n // Use shared HSL to RGB conversion\n const [r, g, b] = hslToRgbValues(h, s, l);\n\n if (alphaPart) {\n const alpha = parseFloat(alphaPart.trim());\n return `rgba(${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)}, ${alpha})`;\n }\n\n return `rgb(${Math.round(r)} ${Math.round(g)} ${Math.round(b)})`;\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,SAAS,QAA+B;CACtD,MAAM,QAAQ,OAAO,MAAM,oBAAoB;AAC/C,KAAI,CAAC,MAAO,QAAO;CAGnB,MAAM,CAAC,WAAW,cADJ,MAAM,GAAG,MAAM,CACS,MAAM,IAAI;CAChD,MAAM,QAAQ,UACX,MAAM,CACN,MAAM,SAAS,CACf,OAAO,QAAQ;AAElB,KAAI,MAAM,SAAS,EAAG,QAAO;CAG7B,MAAM,YAAY,YAAY,MAAM,KAAK,MAAM,UAAU,IAAI,MAAM,KAAK;CAGxE,IAAI,IAAI,WAAW,MAAM,GAAG;CAC5B,MAAM,SAAS,MAAM,GAAG,aAAa;AACrC,KAAI,OAAO,SAAS,OAAO,CAAE,KAAI,WAAW,OAAO,GAAG;UAC7C,OAAO,SAAS,MAAM,CAAE,KAAK,WAAW,OAAO,GAAG,MAAO,KAAK;AACvE,MAAM,IAAI,MAAO,OAAO;CAGxB,MAAM,gBAAgB,QAAwB;EAC5C,MAAM,MAAM,WAAW,IAAI;AAC3B,SAAO,IAAI,SAAS,IAAI,GAAG,MAAM,MAAM;;CAEzC,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC;CAC1D,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC;CAG1D,MAAM,CAAC,GAAG,GAAG,KAAK,eAAe,GAAG,GAAG,EAAE;AAEzC,KAAI,WAAW;EACb,MAAM,QAAQ,WAAW,UAAU,MAAM,CAAC;AAC1C,SAAO,QAAQ,KAAK,MAAM,EAAE,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,IAAI,MAAM;;AAG7E,QAAO,OAAO,KAAK,MAAM,EAAE,CAAC,GAAG,KAAK,MAAM,EAAE,CAAC,GAAG,KAAK,MAAM,EAAE,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { hslToRgbValues } from "./process-tokens.mjs";
2
+
3
+ //#region src/utils/hsl-to-rgb.ts
4
+ /**
5
+ * Convert HSL color string to RGB.
6
+ * Supports:
7
+ * - Modern: hsl(h s% l%), hsl(h s% l% / a)
8
+ * - Legacy: hsl(h, s%, l%), hsla(h, s%, l%, a)
9
+ */
10
+ function hslToRgb(hslStr) {
11
+ const match = hslStr.match(/hsla?\(([^)]+)\)/i);
12
+ if (!match) return null;
13
+ const [colorPart, slashAlpha] = match[1].trim().split("/");
14
+ const parts = colorPart.trim().split(/[,\s]+/).filter(Boolean);
15
+ if (parts.length < 3) return null;
16
+ const alphaPart = slashAlpha?.trim() || (parts.length >= 4 ? parts[3] : null);
17
+ let h = parseFloat(parts[0]);
18
+ const hueStr = parts[0].toLowerCase();
19
+ if (hueStr.endsWith("turn")) h = parseFloat(hueStr) * 360;
20
+ else if (hueStr.endsWith("rad")) h = parseFloat(hueStr) * 180 / Math.PI;
21
+ h = (h % 360 + 360) % 360;
22
+ const parsePercent = (val) => {
23
+ const num = parseFloat(val);
24
+ return val.includes("%") ? num / 100 : num;
25
+ };
26
+ const s = Math.max(0, Math.min(1, parsePercent(parts[1])));
27
+ const l = Math.max(0, Math.min(1, parsePercent(parts[2])));
28
+ const [r, g, b] = hslToRgbValues(h, s, l);
29
+ if (alphaPart) {
30
+ const alpha = parseFloat(alphaPart.trim());
31
+ return `rgba(${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)}, ${alpha})`;
32
+ }
33
+ return `rgb(${Math.round(r)} ${Math.round(g)} ${Math.round(b)})`;
34
+ }
35
+
36
+ //#endregion
37
+ export { hslToRgb };
38
+ //# sourceMappingURL=hsl-to-rgb.mjs.map