@tenphi/tasty 0.0.0-snapshot.2dc73be → 0.0.0-snapshot.2ea241d

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 (326) hide show
  1. package/README.md +298 -250
  2. package/dist/{ssr/async-storage.js → async-storage-B7_o6FKt.js} +17 -8
  3. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  4. package/dist/collector-Crs9kGJW.js +243 -0
  5. package/dist/collector-Crs9kGJW.js.map +1 -0
  6. package/dist/{ssr/collector.d.ts → collector-osfWTeRd.d.ts} +38 -15
  7. package/dist/config-BaxtQMS3.js +10464 -0
  8. package/dist/config-BaxtQMS3.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-CmxaoZ-N.js +1598 -0
  15. package/dist/core-CmxaoZ-N.js.map +1 -0
  16. package/dist/{zero/extractor.js → css-writer-CPy_cbFJ.js} +149 -13
  17. package/dist/css-writer-CPy_cbFJ.js.map +1 -0
  18. package/dist/{ssr/format-global-rules.js → format-global-rules-Dbc_1tc3.js} +3 -3
  19. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  20. package/dist/format-rules-CPirO_Mj.js +143 -0
  21. package/dist/format-rules-CPirO_Mj.js.map +1 -0
  22. package/dist/hydrate-CVn-A_3y.js +45 -0
  23. package/dist/hydrate-CVn-A_3y.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-vpzoVdUR.js +588 -0
  30. package/dist/keyframes-vpzoVdUR.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-BzQutdAK.js} +4 -6
  33. package/dist/merge-styles-BzQutdAK.js.map +1 -0
  34. package/dist/{utils/resolve-recipes.js → resolve-recipes-DgH8A3Nn.js} +5 -8
  35. package/dist/resolve-recipes-DgH8A3Nn.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 +78 -10
  43. package/dist/ssr/astro.js +116 -32
  44. package/dist/ssr/astro.js.map +1 -1
  45. package/dist/ssr/index.d.ts +44 -5
  46. package/dist/ssr/index.js +7 -9
  47. package/dist/ssr/index.js.map +1 -1
  48. package/dist/ssr/next.d.ts +7 -6
  49. package/dist/ssr/next.js +18 -14
  50. package/dist/ssr/next.js.map +1 -1
  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 +49 -95
  58. package/dist/zero/babel.js +203 -48
  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 +28 -1
  63. package/dist/zero/next.js +70 -15
  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 +239 -12
  69. package/docs/debug.md +155 -340
  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 +45 -29
  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 +156 -84
  78. package/docs/styles.md +50 -26
  79. package/docs/tasty-static.md +194 -23
  80. package/package.json +30 -14
  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 -259
  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 -288
  91. package/dist/config.js +0 -417
  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 -30
  97. package/dist/hooks/useGlobalStyles.js +0 -83
  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 -69
  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 -114
  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 -40
  107. package/dist/hooks/useRawCSS.js.map +0 -1
  108. package/dist/hooks/useStyles.d.ts +0 -45
  109. package/dist/hooks/useStyles.js +0 -248
  110. package/dist/hooks/useStyles.js.map +0 -1
  111. package/dist/injector/index.d.ts +0 -165
  112. package/dist/injector/index.js +0 -162
  113. package/dist/injector/index.js.map +0 -1
  114. package/dist/injector/injector.d.ts +0 -148
  115. package/dist/injector/injector.js +0 -436
  116. package/dist/injector/injector.js.map +0 -1
  117. package/dist/injector/sheet-manager.d.ts +0 -136
  118. package/dist/injector/sheet-manager.js +0 -729
  119. package/dist/injector/sheet-manager.js.map +0 -1
  120. package/dist/injector/types.d.ts +0 -144
  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 -856
  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 -451
  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 -236
  159. package/dist/properties/index.js.map +0 -1
  160. package/dist/properties/property-type-resolver.d.ts +0 -24
  161. package/dist/properties/property-type-resolver.js +0 -87
  162. package/dist/properties/property-type-resolver.js.map +0 -1
  163. package/dist/ssr/async-storage.d.ts +0 -17
  164. package/dist/ssr/async-storage.js.map +0 -1
  165. package/dist/ssr/collect-auto-properties.js +0 -40
  166. package/dist/ssr/collect-auto-properties.js.map +0 -1
  167. package/dist/ssr/collector.js +0 -173
  168. package/dist/ssr/collector.js.map +0 -1
  169. package/dist/ssr/context.d.ts +0 -8
  170. package/dist/ssr/context.js +0 -14
  171. package/dist/ssr/context.js.map +0 -1
  172. package/dist/ssr/format-global-rules.js.map +0 -1
  173. package/dist/ssr/format-keyframes.js +0 -70
  174. package/dist/ssr/format-keyframes.js.map +0 -1
  175. package/dist/ssr/format-property.js +0 -48
  176. package/dist/ssr/format-property.js.map +0 -1
  177. package/dist/ssr/format-rules.js +0 -70
  178. package/dist/ssr/format-rules.js.map +0 -1
  179. package/dist/ssr/hydrate.d.ts +0 -22
  180. package/dist/ssr/hydrate.js +0 -50
  181. package/dist/ssr/hydrate.js.map +0 -1
  182. package/dist/ssr/ssr-collector-ref.js +0 -12
  183. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  184. package/dist/states/index.d.ts +0 -49
  185. package/dist/states/index.js +0 -416
  186. package/dist/states/index.js.map +0 -1
  187. package/dist/static/tastyStatic.d.ts +0 -46
  188. package/dist/static/tastyStatic.js +0 -31
  189. package/dist/static/tastyStatic.js.map +0 -1
  190. package/dist/static/types.d.ts +0 -49
  191. package/dist/static/types.js +0 -24
  192. package/dist/static/types.js.map +0 -1
  193. package/dist/styles/align.d.ts +0 -15
  194. package/dist/styles/align.js +0 -14
  195. package/dist/styles/align.js.map +0 -1
  196. package/dist/styles/border.d.ts +0 -25
  197. package/dist/styles/border.js +0 -114
  198. package/dist/styles/border.js.map +0 -1
  199. package/dist/styles/color.d.ts +0 -14
  200. package/dist/styles/color.js +0 -23
  201. package/dist/styles/color.js.map +0 -1
  202. package/dist/styles/createStyle.js +0 -77
  203. package/dist/styles/createStyle.js.map +0 -1
  204. package/dist/styles/dimension.js +0 -97
  205. package/dist/styles/dimension.js.map +0 -1
  206. package/dist/styles/display.d.ts +0 -37
  207. package/dist/styles/display.js +0 -67
  208. package/dist/styles/display.js.map +0 -1
  209. package/dist/styles/fade.d.ts +0 -15
  210. package/dist/styles/fade.js +0 -58
  211. package/dist/styles/fade.js.map +0 -1
  212. package/dist/styles/fill.d.ts +0 -42
  213. package/dist/styles/fill.js +0 -52
  214. package/dist/styles/fill.js.map +0 -1
  215. package/dist/styles/flow.d.ts +0 -16
  216. package/dist/styles/flow.js +0 -12
  217. package/dist/styles/flow.js.map +0 -1
  218. package/dist/styles/gap.d.ts +0 -31
  219. package/dist/styles/gap.js +0 -37
  220. package/dist/styles/gap.js.map +0 -1
  221. package/dist/styles/height.d.ts +0 -17
  222. package/dist/styles/height.js +0 -20
  223. package/dist/styles/height.js.map +0 -1
  224. package/dist/styles/index.d.ts +0 -2
  225. package/dist/styles/index.js +0 -9
  226. package/dist/styles/index.js.map +0 -1
  227. package/dist/styles/inset.d.ts +0 -52
  228. package/dist/styles/inset.js +0 -150
  229. package/dist/styles/inset.js.map +0 -1
  230. package/dist/styles/justify.d.ts +0 -15
  231. package/dist/styles/justify.js +0 -14
  232. package/dist/styles/justify.js.map +0 -1
  233. package/dist/styles/list.d.ts +0 -16
  234. package/dist/styles/list.js +0 -98
  235. package/dist/styles/list.js.map +0 -1
  236. package/dist/styles/margin.d.ts +0 -24
  237. package/dist/styles/margin.js +0 -104
  238. package/dist/styles/margin.js.map +0 -1
  239. package/dist/styles/outline.d.ts +0 -29
  240. package/dist/styles/outline.js +0 -65
  241. package/dist/styles/outline.js.map +0 -1
  242. package/dist/styles/padding.d.ts +0 -24
  243. package/dist/styles/padding.js +0 -104
  244. package/dist/styles/padding.js.map +0 -1
  245. package/dist/styles/predefined.d.ts +0 -71
  246. package/dist/styles/predefined.js +0 -238
  247. package/dist/styles/predefined.js.map +0 -1
  248. package/dist/styles/preset.d.ts +0 -47
  249. package/dist/styles/preset.js +0 -126
  250. package/dist/styles/preset.js.map +0 -1
  251. package/dist/styles/radius.d.ts +0 -14
  252. package/dist/styles/radius.js +0 -51
  253. package/dist/styles/radius.js.map +0 -1
  254. package/dist/styles/scrollbar.d.ts +0 -25
  255. package/dist/styles/scrollbar.js +0 -48
  256. package/dist/styles/scrollbar.js.map +0 -1
  257. package/dist/styles/shadow.d.ts +0 -14
  258. package/dist/styles/shadow.js +0 -24
  259. package/dist/styles/shadow.js.map +0 -1
  260. package/dist/styles/transition.d.ts +0 -14
  261. package/dist/styles/transition.js +0 -158
  262. package/dist/styles/transition.js.map +0 -1
  263. package/dist/styles/types.d.ts +0 -495
  264. package/dist/styles/width.d.ts +0 -17
  265. package/dist/styles/width.js +0 -20
  266. package/dist/styles/width.js.map +0 -1
  267. package/dist/tasty.d.ts +0 -981
  268. package/dist/tasty.js +0 -206
  269. package/dist/tasty.js.map +0 -1
  270. package/dist/tokens/typography.d.ts +0 -19
  271. package/dist/tokens/typography.js +0 -237
  272. package/dist/tokens/typography.js.map +0 -1
  273. package/dist/types.d.ts +0 -184
  274. package/dist/utils/cache-wrapper.js +0 -26
  275. package/dist/utils/cache-wrapper.js.map +0 -1
  276. package/dist/utils/case-converter.js +0 -8
  277. package/dist/utils/case-converter.js.map +0 -1
  278. package/dist/utils/colors.d.ts +0 -5
  279. package/dist/utils/colors.js +0 -9
  280. package/dist/utils/colors.js.map +0 -1
  281. package/dist/utils/css-types.d.ts +0 -7
  282. package/dist/utils/dotize.d.ts +0 -26
  283. package/dist/utils/dotize.js +0 -122
  284. package/dist/utils/dotize.js.map +0 -1
  285. package/dist/utils/filter-base-props.d.ts +0 -15
  286. package/dist/utils/filter-base-props.js +0 -45
  287. package/dist/utils/filter-base-props.js.map +0 -1
  288. package/dist/utils/get-display-name.d.ts +0 -7
  289. package/dist/utils/get-display-name.js +0 -10
  290. package/dist/utils/get-display-name.js.map +0 -1
  291. package/dist/utils/hsl-to-rgb.js +0 -38
  292. package/dist/utils/hsl-to-rgb.js.map +0 -1
  293. package/dist/utils/is-dev-env.js +0 -19
  294. package/dist/utils/is-dev-env.js.map +0 -1
  295. package/dist/utils/is-valid-element-type.js +0 -15
  296. package/dist/utils/is-valid-element-type.js.map +0 -1
  297. package/dist/utils/merge-styles.js.map +0 -1
  298. package/dist/utils/mod-attrs.d.ts +0 -8
  299. package/dist/utils/mod-attrs.js +0 -21
  300. package/dist/utils/mod-attrs.js.map +0 -1
  301. package/dist/utils/okhsl-to-rgb.js +0 -296
  302. package/dist/utils/okhsl-to-rgb.js.map +0 -1
  303. package/dist/utils/process-tokens.d.ts +0 -31
  304. package/dist/utils/process-tokens.js +0 -171
  305. package/dist/utils/process-tokens.js.map +0 -1
  306. package/dist/utils/resolve-recipes.d.ts +0 -17
  307. package/dist/utils/resolve-recipes.js.map +0 -1
  308. package/dist/utils/selector-transform.js +0 -32
  309. package/dist/utils/selector-transform.js.map +0 -1
  310. package/dist/utils/string.js +0 -8
  311. package/dist/utils/string.js.map +0 -1
  312. package/dist/utils/styles.d.ts +0 -177
  313. package/dist/utils/styles.js +0 -730
  314. package/dist/utils/styles.js.map +0 -1
  315. package/dist/utils/typography.d.ts +0 -36
  316. package/dist/utils/typography.js +0 -53
  317. package/dist/utils/typography.js.map +0 -1
  318. package/dist/utils/warnings.d.ts +0 -16
  319. package/dist/utils/warnings.js +0 -16
  320. package/dist/utils/warnings.js.map +0 -1
  321. package/dist/zero/css-writer.d.ts +0 -45
  322. package/dist/zero/css-writer.js +0 -74
  323. package/dist/zero/css-writer.js.map +0 -1
  324. package/dist/zero/extractor.d.ts +0 -24
  325. package/dist/zero/extractor.js.map +0 -1
  326. package/docs/usage.md +0 -695
@@ -1,730 +0,0 @@
1
- import { StyleParser } from "../parser/parser.js";
2
- import { okhslFunc } from "../plugins/okhsl-plugin.js";
3
- import { createStateParserContext, parseAdvancedState } from "../states/index.js";
4
- import { cacheWrapper } from "./cache-wrapper.js";
5
- import { camelToKebab } from "./case-converter.js";
6
- import { okhslToRgb } from "./okhsl-to-rgb.js";
7
- import { hslToRgb } from "./hsl-to-rgb.js";
8
-
9
- //#region src/utils/styles.ts
10
- /**
11
- * Normalize a color token value.
12
- * - Boolean `true` is converted to `'transparent'`
13
- * - Boolean `false` returns `null` (signals the token should be skipped)
14
- * - Other values are returned as-is
15
- *
16
- * @param value - The raw token value
17
- * @returns Normalized value or null if the token should be skipped
18
- */
19
- function normalizeColorTokenValue(value) {
20
- if (value === true) return "transparent";
21
- if (value === false) return null;
22
- return value;
23
- }
24
- const COLOR_VAR_PATTERN = /var\(--([a-z0-9-]+)-color/;
25
- const COLOR_VAR_RGB_PATTERN = /var\(--([a-z0-9-]+)-color-rgb/;
26
- const RGB_ALPHA_PATTERN = /\/\s*([0-9.]+)\)/;
27
- const SIMPLE_COLOR_PATTERNS = [
28
- /^#[0-9a-fA-F]{3,8}$/,
29
- /^rgb\(/,
30
- /^hsl\(/,
31
- /^lch\(/,
32
- /^oklch\(/,
33
- /^okhsl\(/,
34
- /^var\(--[a-z0-9-]+-color/,
35
- /^currentColor$/,
36
- /^transparent$/
37
- ];
38
- let colorWarningCount = 0;
39
- const MAX_COLOR_WARNINGS = 10;
40
- const CUSTOM_UNITS = {
41
- r: "6px",
42
- cr: "10px",
43
- bw: "1px",
44
- ow: "3px",
45
- x: "8px",
46
- fs: "var(--font-size)",
47
- lh: "var(--line-height)",
48
- sf: function sf(num) {
49
- return `minmax(0, ${num}fr)`;
50
- }
51
- };
52
- const DIRECTIONS = [
53
- "top",
54
- "right",
55
- "bottom",
56
- "left"
57
- ];
58
- let __tastyParser = null;
59
- function getOrCreateParser() {
60
- if (!__tastyParser) {
61
- __tastyParser = new StyleParser({ units: CUSTOM_UNITS });
62
- __tastyParser.setFuncs(__tastyFuncs);
63
- }
64
- return __tastyParser;
65
- }
66
- const __tastyFuncs = { okhsl: okhslFunc };
67
- function customFunc(name, fn) {
68
- __tastyFuncs[name] = fn;
69
- getOrCreateParser().setFuncs(__tastyFuncs);
70
- }
71
- /**
72
- * Get the global StyleParser instance.
73
- * Used by configure() to apply parser configuration.
74
- */
75
- function getGlobalParser() {
76
- return getOrCreateParser();
77
- }
78
- /**
79
- * Get the current custom functions registry.
80
- * Used by configure() to merge with new functions.
81
- */
82
- function getGlobalFuncs() {
83
- return __tastyFuncs;
84
- }
85
- /**
86
- * Storage for predefined tokens that are replaced during style parsing.
87
- * Keys are token names (with $ or # prefix), values are pre-processed CSS values.
88
- */
89
- let __globalPredefinedTokens = null;
90
- /**
91
- * Set global predefined tokens.
92
- * Called from configure() after processing token values.
93
- * Merges with existing tokens (new tokens override existing ones with same key).
94
- * Keys are normalized to lowercase (parser lowercases input before classification).
95
- * @internal
96
- */
97
- function setGlobalPredefinedTokens(tokens) {
98
- const normalizedTokens = {};
99
- for (const [key, value] of Object.entries(tokens)) {
100
- const lowerKey = key.toLowerCase();
101
- const lowerValue = value.toLowerCase();
102
- if (lowerKey.startsWith("#") && lowerValue === "#current") {
103
- console.warn(`Tasty: Using #current to define color token "${key}" is not supported. The #current token represents currentcolor which cannot be used as a base for other tokens.`);
104
- continue;
105
- }
106
- normalizedTokens[lowerKey] = value;
107
- }
108
- __globalPredefinedTokens = __globalPredefinedTokens ? {
109
- ...__globalPredefinedTokens,
110
- ...normalizedTokens
111
- } : normalizedTokens;
112
- getOrCreateParser().clearCache();
113
- }
114
- /**
115
- * Get the current global predefined tokens.
116
- * Returns null if no tokens are configured.
117
- */
118
- function getGlobalPredefinedTokens() {
119
- return __globalPredefinedTokens;
120
- }
121
- /**
122
- * Reset global predefined tokens.
123
- * Used for testing.
124
- * @internal
125
- */
126
- function resetGlobalPredefinedTokens() {
127
- __globalPredefinedTokens = null;
128
- getOrCreateParser().clearCache();
129
- }
130
- /**
131
- *
132
- * @param {String} value
133
- * @param {Number} mode
134
- * @returns {Object<String,String|Array>}
135
- */
136
- function parseStyle(value) {
137
- let str;
138
- if (typeof value === "string") str = value;
139
- else if (typeof value === "number") str = String(value);
140
- else str = "";
141
- return getOrCreateParser().process(str);
142
- }
143
- /**
144
- * Parse color. Find it value, name and opacity.
145
- * Optimized to avoid heavy parseStyle calls for simple color patterns.
146
- */
147
- function parseColor(val, ignoreError = false) {
148
- if (typeof val !== "string") val = String(val ?? "");
149
- val = val.trim();
150
- if (!val) return {};
151
- const isSimpleColor = SIMPLE_COLOR_PATTERNS.some((pattern) => pattern.test(val));
152
- let firstColor;
153
- if (isSimpleColor) firstColor = val;
154
- else {
155
- const extractedColor = parseStyle(val).groups.find((g) => g.colors.length)?.colors[0];
156
- if (!extractedColor) {
157
- if (!ignoreError && colorWarningCount < MAX_COLOR_WARNINGS) {
158
- console.warn("CubeUIKit: unable to parse color:", val);
159
- colorWarningCount++;
160
- if (colorWarningCount === MAX_COLOR_WARNINGS) console.warn("CubeUIKit: color parsing warnings will be suppressed from now on");
161
- }
162
- return {};
163
- }
164
- firstColor = extractedColor;
165
- }
166
- let nameMatch = firstColor.match(COLOR_VAR_PATTERN);
167
- if (!nameMatch) nameMatch = firstColor.match(COLOR_VAR_RGB_PATTERN);
168
- let opacity;
169
- if (firstColor.startsWith("rgb") || firstColor.startsWith("hsl") || firstColor.startsWith("lch") || firstColor.startsWith("oklch") || firstColor.startsWith("okhsl")) {
170
- const alphaMatch = firstColor.match(RGB_ALPHA_PATTERN);
171
- if (alphaMatch) {
172
- const v = parseFloat(alphaMatch[1]);
173
- if (!isNaN(v)) opacity = v * 100;
174
- }
175
- }
176
- return {
177
- color: firstColor,
178
- name: nameMatch ? nameMatch[1] : void 0,
179
- opacity
180
- };
181
- }
182
- /**
183
- * CSS named color keywords → hex values.
184
- * Lazy-initialized on first use to avoid up-front cost.
185
- */
186
- let _namedColorHex = null;
187
- function getNamedColorHex() {
188
- if (_namedColorHex) return _namedColorHex;
189
- _namedColorHex = new Map([
190
- ["aliceblue", "#f0f8ff"],
191
- ["antiquewhite", "#faebd7"],
192
- ["aqua", "#00ffff"],
193
- ["aquamarine", "#7fffd4"],
194
- ["azure", "#f0ffff"],
195
- ["beige", "#f5f5dc"],
196
- ["bisque", "#ffe4c4"],
197
- ["black", "#000000"],
198
- ["blanchedalmond", "#ffebcd"],
199
- ["blue", "#0000ff"],
200
- ["blueviolet", "#8a2be2"],
201
- ["brown", "#a52a2a"],
202
- ["burlywood", "#deb887"],
203
- ["cadetblue", "#5f9ea0"],
204
- ["chartreuse", "#7fff00"],
205
- ["chocolate", "#d2691e"],
206
- ["coral", "#ff7f50"],
207
- ["cornflowerblue", "#6495ed"],
208
- ["cornsilk", "#fff8dc"],
209
- ["crimson", "#dc143c"],
210
- ["cyan", "#00ffff"],
211
- ["darkblue", "#00008b"],
212
- ["darkcyan", "#008b8b"],
213
- ["darkgoldenrod", "#b8860b"],
214
- ["darkgray", "#a9a9a9"],
215
- ["darkgreen", "#006400"],
216
- ["darkgrey", "#a9a9a9"],
217
- ["darkkhaki", "#bdb76b"],
218
- ["darkmagenta", "#8b008b"],
219
- ["darkolivegreen", "#556b2f"],
220
- ["darkorange", "#ff8c00"],
221
- ["darkorchid", "#9932cc"],
222
- ["darkred", "#8b0000"],
223
- ["darksalmon", "#e9967a"],
224
- ["darkseagreen", "#8fbc8f"],
225
- ["darkslateblue", "#483d8b"],
226
- ["darkslategray", "#2f4f4f"],
227
- ["darkslategrey", "#2f4f4f"],
228
- ["darkturquoise", "#00ced1"],
229
- ["darkviolet", "#9400d3"],
230
- ["deeppink", "#ff1493"],
231
- ["deepskyblue", "#00bfff"],
232
- ["dimgray", "#696969"],
233
- ["dimgrey", "#696969"],
234
- ["dodgerblue", "#1e90ff"],
235
- ["firebrick", "#b22222"],
236
- ["floralwhite", "#fffaf0"],
237
- ["forestgreen", "#228b22"],
238
- ["fuchsia", "#ff00ff"],
239
- ["gainsboro", "#dcdcdc"],
240
- ["ghostwhite", "#f8f8ff"],
241
- ["gold", "#ffd700"],
242
- ["goldenrod", "#daa520"],
243
- ["gray", "#808080"],
244
- ["green", "#008000"],
245
- ["greenyellow", "#adff2f"],
246
- ["grey", "#808080"],
247
- ["honeydew", "#f0fff0"],
248
- ["hotpink", "#ff69b4"],
249
- ["indianred", "#cd5c5c"],
250
- ["indigo", "#4b0082"],
251
- ["ivory", "#fffff0"],
252
- ["khaki", "#f0e68c"],
253
- ["lavender", "#e6e6fa"],
254
- ["lavenderblush", "#fff0f5"],
255
- ["lawngreen", "#7cfc00"],
256
- ["lemonchiffon", "#fffacd"],
257
- ["lightblue", "#add8e6"],
258
- ["lightcoral", "#f08080"],
259
- ["lightcyan", "#e0ffff"],
260
- ["lightgoldenrodyellow", "#fafad2"],
261
- ["lightgray", "#d3d3d3"],
262
- ["lightgreen", "#90ee90"],
263
- ["lightgrey", "#d3d3d3"],
264
- ["lightpink", "#ffb6c1"],
265
- ["lightsalmon", "#ffa07a"],
266
- ["lightseagreen", "#20b2aa"],
267
- ["lightskyblue", "#87cefa"],
268
- ["lightslategray", "#778899"],
269
- ["lightslategrey", "#778899"],
270
- ["lightsteelblue", "#b0c4de"],
271
- ["lightyellow", "#ffffe0"],
272
- ["lime", "#00ff00"],
273
- ["limegreen", "#32cd32"],
274
- ["linen", "#faf0e6"],
275
- ["magenta", "#ff00ff"],
276
- ["maroon", "#800000"],
277
- ["mediumaquamarine", "#66cdaa"],
278
- ["mediumblue", "#0000cd"],
279
- ["mediumorchid", "#ba55d3"],
280
- ["mediumpurple", "#9370db"],
281
- ["mediumseagreen", "#3cb371"],
282
- ["mediumslateblue", "#7b68ee"],
283
- ["mediumspringgreen", "#00fa9a"],
284
- ["mediumturquoise", "#48d1cc"],
285
- ["mediumvioletred", "#c71585"],
286
- ["midnightblue", "#191970"],
287
- ["mintcream", "#f5fffa"],
288
- ["mistyrose", "#ffe4e1"],
289
- ["moccasin", "#ffe4b5"],
290
- ["navajowhite", "#ffdead"],
291
- ["navy", "#000080"],
292
- ["oldlace", "#fdf5e6"],
293
- ["olive", "#808000"],
294
- ["olivedrab", "#6b8e23"],
295
- ["orange", "#ffa500"],
296
- ["orangered", "#ff4500"],
297
- ["orchid", "#da70d6"],
298
- ["palegoldenrod", "#eee8aa"],
299
- ["palegreen", "#98fb98"],
300
- ["paleturquoise", "#afeeee"],
301
- ["palevioletred", "#db7093"],
302
- ["papayawhip", "#ffefd5"],
303
- ["peachpuff", "#ffdab9"],
304
- ["peru", "#cd853f"],
305
- ["pink", "#ffc0cb"],
306
- ["plum", "#dda0dd"],
307
- ["powderblue", "#b0e0e6"],
308
- ["purple", "#800080"],
309
- ["rebeccapurple", "#663399"],
310
- ["red", "#ff0000"],
311
- ["rosybrown", "#bc8f8f"],
312
- ["royalblue", "#4169e1"],
313
- ["saddlebrown", "#8b4513"],
314
- ["salmon", "#fa8072"],
315
- ["sandybrown", "#f4a460"],
316
- ["seagreen", "#2e8b57"],
317
- ["seashell", "#fff5ee"],
318
- ["sienna", "#a0522d"],
319
- ["silver", "#c0c0c0"],
320
- ["skyblue", "#87ceeb"],
321
- ["slateblue", "#6a5acd"],
322
- ["slategray", "#708090"],
323
- ["slategrey", "#708090"],
324
- ["snow", "#fffafa"],
325
- ["springgreen", "#00ff7f"],
326
- ["steelblue", "#4682b4"],
327
- ["tan", "#d2b48c"],
328
- ["teal", "#008080"],
329
- ["thistle", "#d8bfd8"],
330
- ["tomato", "#ff6347"],
331
- ["turquoise", "#40e0d0"],
332
- ["violet", "#ee82ee"],
333
- ["wheat", "#f5deb3"],
334
- ["white", "#ffffff"],
335
- ["whitesmoke", "#f5f5f5"],
336
- ["yellow", "#ffff00"],
337
- ["yellowgreen", "#9acd32"]
338
- ]);
339
- return _namedColorHex;
340
- }
341
- function strToRgb(color, _ignoreAlpha = false) {
342
- if (!color) return void 0;
343
- if (color.startsWith("rgb")) return color;
344
- if (color.startsWith("#")) return hexToRgb(color);
345
- if (color.startsWith("okhsl(")) return okhslToRgb(color);
346
- if (color.startsWith("hsl")) return hslToRgb(color);
347
- const namedHex = getNamedColorHex().get(color.toLowerCase());
348
- if (namedHex) return hexToRgb(namedHex);
349
- return null;
350
- }
351
- /**
352
- * Extract RGB values from an rgb()/rgba() string.
353
- * Supports all modern CSS syntax variations:
354
- * - Comma-separated: rgb(255, 128, 0)
355
- * - Space-separated: rgb(255 128 0)
356
- * - Fractional: rgb(128.5, 64.3, 32.1)
357
- * - Percentages: rgb(50%, 25%, 75%)
358
- * - Slash alpha notation: rgb(255 128 0 / 0.5)
359
- *
360
- * Returns array of RGB values (0-255 range), converting percentages as needed.
361
- */
362
- function getRgbValuesFromRgbaString(str) {
363
- const match = str.match(/rgba?\(([^)]+)\)/i);
364
- if (!match) return [];
365
- const [colorPart] = match[1].trim().split("/");
366
- return colorPart.trim().split(/[,\s]+/).filter(Boolean).slice(0, 3).map((part) => {
367
- part = part.trim();
368
- if (part.endsWith("%")) return parseFloat(part) / 100 * 255;
369
- return parseFloat(part);
370
- });
371
- }
372
- function hexToRgb(hex) {
373
- const matched = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (_m, r, g, b) => "#" + r + r + g + g + b + b).substring(1).match(/.{2}/g);
374
- if (!matched) return null;
375
- const rgba = matched.map((x, i) => parseInt(x, 16) * (i === 3 ? 1 / 255 : 1));
376
- if (rgba.some((v) => Number.isNaN(v))) return null;
377
- if (rgba.length >= 3) return `rgb(${rgba.slice(0, 3).join(" ")}${rgba.length > 3 ? ` / ${rgba[3]}` : ""})`;
378
- return null;
379
- }
380
- function filterMods(mods, allowedMods) {
381
- return mods.filter((mod) => allowedMods.includes(mod));
382
- }
383
- function extendStyles(defaultStyles, newStyles) {
384
- let styles = {};
385
- if (!defaultStyles) {
386
- if (!newStyles) return styles;
387
- } else styles = Object.assign({}, defaultStyles);
388
- if (newStyles) Object.keys(newStyles).forEach((key) => {
389
- if (newStyles[key] != null) styles[key] = newStyles[key];
390
- });
391
- return styles;
392
- }
393
- /**
394
- * Split properties into style and non-style properties.
395
- * @param props - Component prop map.
396
- * @param [styleList] - List of all style properties.
397
- * @param [defaultStyles] - Default style map of the component.
398
- * @param [propMap] - Props to style alias map.
399
- * @param [ignoreList] - A list of properties to ignore.
400
- */
401
- function extractStyles(props, styleList = [], defaultStyles, propMap, ignoreList = []) {
402
- const styles = {
403
- ...defaultStyles,
404
- ...ignoreList.includes("styles") ? void 0 : props.styles && typeof props.styles === "object" ? props.styles : void 0
405
- };
406
- Object.keys(props).forEach((prop) => {
407
- const propName = propMap ? propMap[prop] || prop : prop;
408
- const value = props[prop];
409
- if (ignoreList && ignoreList.includes(prop)) {} else if (styleList.includes(propName)) styles[propName] = value;
410
- }, {});
411
- return styles;
412
- }
413
- const STATES_REGEXP = /([&|!^])|([()])|(@media:[a-z]+)|(@media\([^)]+\))|(@root\([^)]+\))|(@own\([^)]+\))|(@\([^)]+\))|(@starting)|(@[A-Za-z][A-Za-z0-9-]*)|([a-z][a-z0-9-]+=(?:"[^"]*"|'[^']*'|[^\s&|!^()]+))|([a-z][a-z0-9-]+)|(:[a-z][a-z0-9-]+\([^)]+\)|:[a-z][a-z0-9-]+)|(\.[a-z][a-z0-9-]+)|(\[[^\]]+])/gi;
414
- /**
415
- * Check if a token is an advanced state (starts with @)
416
- */
417
- function isAdvancedStateToken(token) {
418
- return token.startsWith("@") || token.startsWith("!@");
419
- }
420
- const STATE_OPERATORS = {
421
- NOT: "!",
422
- AND: "&",
423
- OR: "|",
424
- XOR: "^"
425
- };
426
- const STATE_OPERATOR_LIST = [
427
- "!",
428
- "&",
429
- "|",
430
- "^"
431
- ];
432
- /**
433
- * Convert state notation tokens to a compute model (string, or nested [op, lhs, rhs]).
434
- */
435
- function convertTokensToComputeUnits(tokens) {
436
- if (tokens.length === 1) return tokens[0];
437
- const hasLength = (x) => typeof x === "string" || Array.isArray(x);
438
- STATE_OPERATOR_LIST.forEach((operator) => {
439
- let i;
440
- while ((i = tokens.indexOf(operator)) !== -1) {
441
- const token = tokens[i];
442
- if (token === "!") {
443
- const next = tokens[i + 1];
444
- if (next !== void 0 && hasLength(next) && next.length !== 1) tokens.splice(i, 2, ["!", next]);
445
- else tokens.splice(i, 1);
446
- } else {
447
- const prev = tokens[i - 1];
448
- const next = tokens[i + 1];
449
- if (prev !== void 0 && next !== void 0 && hasLength(prev) && hasLength(next) && prev.length !== 1 && next.length !== 1) tokens.splice(i - 1, 3, [
450
- token,
451
- prev,
452
- next
453
- ]);
454
- else tokens.splice(i, 1);
455
- }
456
- }
457
- });
458
- return tokens.length === 1 ? tokens[0] : tokens;
459
- }
460
- /**
461
- * Replace commas with | only outside of parentheses.
462
- * This preserves commas in advanced states like @(card, w < 600px)
463
- */
464
- function replaceCommasOutsideParens(str) {
465
- let result = "";
466
- let depth = 0;
467
- for (const char of str) if (char === "(") {
468
- depth++;
469
- result += char;
470
- } else if (char === ")") {
471
- depth--;
472
- result += char;
473
- } else if (char === "," && depth === 0) result += "|";
474
- else result += char;
475
- return result;
476
- }
477
- /**
478
- * Parse state notation and return tokens, modifiers and compute model.
479
- */
480
- function parseStateNotationInner(notation, value) {
481
- const tokens = replaceCommasOutsideParens(notation).match(STATES_REGEXP);
482
- if (!tokens || !tokens.length) return {
483
- model: void 0,
484
- mods: [],
485
- notMods: [],
486
- tokens: [],
487
- value
488
- };
489
- else if (tokens.length === 1) return {
490
- model: tokens[0],
491
- mods: tokens.slice(0),
492
- notMods: [],
493
- tokens,
494
- value
495
- };
496
- const mods = [];
497
- const operations = [[]];
498
- let list = operations[0];
499
- let position = 0;
500
- let operation;
501
- tokens.forEach((token) => {
502
- switch (token) {
503
- case "(":
504
- operation = [];
505
- position++;
506
- list = operations[position] = operation;
507
- break;
508
- case ")":
509
- position--;
510
- operations[position].push(convertTokensToComputeUnits(list));
511
- list = operations[position];
512
- break;
513
- default:
514
- if (token.length > 1) {
515
- if (!mods.includes(token)) mods.push(token);
516
- }
517
- list.push(token);
518
- }
519
- });
520
- while (position) {
521
- position--;
522
- operations[position].push(convertTokensToComputeUnits(list));
523
- list = operations[position];
524
- }
525
- return {
526
- tokens,
527
- mods,
528
- notMods: [],
529
- model: convertTokensToComputeUnits(operations[0]),
530
- value
531
- };
532
- }
533
- const parseStateNotation = cacheWrapper(parseStateNotationInner);
534
- /**
535
- * Build an AtRuleContext from parsed advanced states
536
- */
537
- function buildAtRuleContext(advancedStates, negatedStates) {
538
- if (advancedStates.length === 0) return void 0;
539
- const ctx = {};
540
- for (const state of advancedStates) {
541
- const isNegated = negatedStates.has(state.raw);
542
- switch (state.type) {
543
- case "media": {
544
- if (!ctx.media) ctx.media = [];
545
- let mediaCondition = "";
546
- if (state.mediaType) mediaCondition = state.mediaType;
547
- else if (state.condition) mediaCondition = `(${state.condition})`;
548
- if (mediaCondition) if (isNegated) ctx.media.push(`not ${mediaCondition}`);
549
- else ctx.media.push(mediaCondition);
550
- break;
551
- }
552
- case "container": {
553
- if (!ctx.container) ctx.container = [];
554
- let condition = state.condition;
555
- if (isNegated) condition = `not (${condition})`;
556
- ctx.container.push({
557
- name: state.containerName,
558
- condition
559
- });
560
- break;
561
- }
562
- case "root": {
563
- if (!ctx.rootStates) ctx.rootStates = [];
564
- const rootSelector = buildRootSelector(state.condition, isNegated);
565
- ctx.rootStates.push(rootSelector);
566
- break;
567
- }
568
- case "starting":
569
- if (!isNegated) ctx.startingStyle = true;
570
- break;
571
- }
572
- }
573
- if (!ctx.media?.length && !ctx.container?.length && !ctx.rootStates?.length && !ctx.startingStyle) return;
574
- return ctx;
575
- }
576
- /**
577
- * Build a root state selector from a condition
578
- */
579
- function buildRootSelector(condition, isNegated) {
580
- let selector;
581
- if (condition.startsWith(".")) selector = condition;
582
- else if (condition.startsWith("[")) selector = condition;
583
- else if (condition.includes("=")) {
584
- const [key, value] = condition.split("=");
585
- selector = `[data-${camelToKebab(key.trim())}="${value.trim()}"]`;
586
- } else selector = `[data-${camelToKebab(condition)}]`;
587
- if (isNegated) return `:not(${selector})`;
588
- return selector;
589
- }
590
- /**
591
- * Parse state notation and return tokens, modifiers and compute model.
592
- * Enhanced to detect and extract advanced states.
593
- */
594
- function styleStateMapToStyleStateDataList(styleStateMap, parserContext) {
595
- if (typeof styleStateMap !== "object" || !styleStateMap) return {
596
- states: [{
597
- model: void 0,
598
- mods: [],
599
- notMods: [],
600
- value: styleStateMap
601
- }],
602
- mods: [],
603
- hasAdvancedStates: false
604
- };
605
- const stateDataList = [];
606
- let hasAdvancedStates = false;
607
- Object.keys(styleStateMap).forEach((stateNotation) => {
608
- const state = parseStateNotation(stateNotation, styleStateMap[stateNotation]);
609
- const advancedStates = [];
610
- const negatedAdvancedStates = /* @__PURE__ */ new Set();
611
- const regularMods = [];
612
- const ownMods = [];
613
- const negatedOwnMods = [];
614
- if (state.tokens) {
615
- let isNegated = false;
616
- for (const token of state.tokens) {
617
- if (token === "!") {
618
- isNegated = true;
619
- continue;
620
- }
621
- if (isAdvancedStateToken(token)) {
622
- hasAdvancedStates = true;
623
- const parsed = parseAdvancedState(token, parserContext || createStateParserContext(void 0));
624
- advancedStates.push(parsed);
625
- if (parsed.type === "own" && parsed.condition) if (isNegated) negatedOwnMods.push(parsed.condition);
626
- else ownMods.push(parsed.condition);
627
- else if (isNegated) negatedAdvancedStates.add(token);
628
- isNegated = false;
629
- } else if (token.length > 1 && ![
630
- "&",
631
- "|",
632
- "^",
633
- "(",
634
- ")"
635
- ].includes(token)) {
636
- regularMods.push(token);
637
- isNegated = false;
638
- } else isNegated = false;
639
- }
640
- }
641
- if (advancedStates.length > 0) {
642
- state.advancedStates = advancedStates;
643
- state.atRuleContext = buildAtRuleContext(advancedStates, negatedAdvancedStates);
644
- state.mods = regularMods;
645
- }
646
- if (ownMods.length > 0) state.ownMods = ownMods;
647
- if (negatedOwnMods.length > 0) state.negatedOwnMods = negatedOwnMods;
648
- stateDataList.push(state);
649
- });
650
- stateDataList.reverse();
651
- let initialState;
652
- const allMods = stateDataList.reduce((all, state) => {
653
- if (!state.mods.length && !state.advancedStates?.length) initialState = state;
654
- else state.mods.forEach((mod) => {
655
- if (!all.includes(mod)) all.push(mod);
656
- });
657
- return all;
658
- }, []);
659
- if (!initialState) stateDataList.push({
660
- mods: [],
661
- notMods: allMods,
662
- value: true
663
- });
664
- return {
665
- states: stateDataList,
666
- mods: allMods,
667
- hasAdvancedStates
668
- };
669
- }
670
- const COMPUTE_FUNC_MAP = {
671
- "!": (a) => !a,
672
- "^": (a, b) => a && !b || !a && b,
673
- "|": (a, b) => a || b,
674
- "&": (a, b) => a && b
675
- };
676
- /**
677
- * Compute a result based on a model and incoming map.
678
- */
679
- function computeState(computeModel, valueMap) {
680
- if (!computeModel) return true;
681
- const map = valueMap;
682
- if (!Array.isArray(computeModel)) if (typeof valueMap === "function") return !!valueMap(computeModel);
683
- else return !!map[computeModel];
684
- const func = COMPUTE_FUNC_MAP[computeModel[0]];
685
- if (!func) console.warn("CubeUIKit: unexpected compute method in the model", computeModel);
686
- let a = computeModel[1];
687
- if (typeof a === "object") a = !!computeState(a, valueMap);
688
- else if (typeof valueMap === "function") a = !!valueMap(a);
689
- else a = !!map[a];
690
- if (computeModel.length === 2) return func(a);
691
- let b = computeModel[2];
692
- if (typeof b === "object") b = !!computeState(b, valueMap);
693
- else if (typeof valueMap === "function") b = !!valueMap(b);
694
- else b = !!map[b];
695
- return !!func(a, b);
696
- }
697
- const _innerCache = /* @__PURE__ */ new WeakMap();
698
- function stringifyStyles(styles) {
699
- if (styles == null || typeof styles !== "object") return "";
700
- const obj = styles;
701
- const keys = Object.keys(obj).sort();
702
- const parts = [];
703
- for (const k of keys) {
704
- const v = obj[k];
705
- if (v === void 0 || typeof v === "function" || typeof v === "symbol") continue;
706
- const c0 = k.charCodeAt(0);
707
- const needsInnerSort = (c0 >= 65 && c0 <= 90 || c0 === 38) && v && typeof v === "object" && !Array.isArray(v);
708
- let sv;
709
- if (needsInnerSort) {
710
- sv = _innerCache.get(v);
711
- if (sv === void 0) {
712
- const innerObj = v;
713
- const innerKeys = Object.keys(innerObj).sort();
714
- const innerParts = [];
715
- for (const ik of innerKeys) {
716
- const ivs = JSON.stringify(innerObj[ik]);
717
- if (ivs !== void 0) innerParts.push(JSON.stringify(ik) + ":" + ivs);
718
- }
719
- sv = "{" + innerParts.join(",") + "}";
720
- _innerCache.set(v, sv);
721
- }
722
- } else sv = JSON.stringify(v);
723
- parts.push(JSON.stringify(k) + ":" + sv);
724
- }
725
- return "{" + parts.join(",") + "}";
726
- }
727
-
728
- //#endregion
729
- export { COMPUTE_FUNC_MAP, CUSTOM_UNITS, DIRECTIONS, STATE_OPERATORS, STATE_OPERATOR_LIST, buildAtRuleContext, computeState, customFunc, extendStyles, extractStyles, filterMods, getGlobalFuncs, getGlobalParser, getGlobalPredefinedTokens, getRgbValuesFromRgbaString, hexToRgb, isAdvancedStateToken, normalizeColorTokenValue, parseColor, parseStateNotation, parseStyle, resetGlobalPredefinedTokens, setGlobalPredefinedTokens, strToRgb, stringifyStyles, styleStateMapToStyleStateDataList };
730
- //# sourceMappingURL=styles.js.map