@tenphi/tasty 0.0.0-snapshot.db103fd → 0.0.0-snapshot.dd9840e

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 (334) hide show
  1. package/README.md +29 -23
  2. package/dist/{ssr/async-storage.js → async-storage-B7_o6FKt.js} +16 -6
  3. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  4. package/dist/{ssr/collector.js → collector-DrgDE7QB.js} +36 -32
  5. package/dist/collector-DrgDE7QB.js.map +1 -0
  6. package/dist/{ssr/collector.d.ts → collector-LuU1vZ68.d.ts} +11 -15
  7. package/dist/config-_aQ_PZ-P.js +10131 -0
  8. package/dist/config-_aQ_PZ-P.js.map +1 -0
  9. package/dist/config-vuCRkBWX.d.ts +884 -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-BqO8pplb.js +1592 -0
  15. package/dist/core-BqO8pplb.js.map +1 -0
  16. package/dist/{zero/extractor.js → css-writer-D--REwtp.js} +74 -11
  17. package/dist/css-writer-D--REwtp.js.map +1 -0
  18. package/dist/{ssr/format-global-rules.js → format-global-rules-Dbc_1tc3.js} +2 -2
  19. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  20. package/dist/format-rules-xwteB7a1.js +143 -0
  21. package/dist/format-rules-xwteB7a1.js.map +1 -0
  22. package/dist/hydrate-BvPT4ndL.js +45 -0
  23. package/dist/hydrate-BvPT4ndL.js.map +1 -0
  24. package/dist/index-dUtwpOux.d.ts +1266 -0
  25. package/dist/index-h0MibUBL.d.ts +1602 -0
  26. package/dist/index.d.ts +5 -50
  27. package/dist/index.js +732 -35
  28. package/dist/index.js.map +1 -0
  29. package/dist/keyframes-ClPFWy33.js +587 -0
  30. package/dist/keyframes-ClPFWy33.js.map +1 -0
  31. package/dist/{utils/merge-styles.js → merge-styles-BUQsEpbv.js} +3 -4
  32. package/dist/merge-styles-BUQsEpbv.js.map +1 -0
  33. package/dist/{utils/merge-styles.d.ts → merge-styles-CtDJMhpJ.d.ts} +3 -3
  34. package/dist/{utils/resolve-recipes.js → resolve-recipes-C0-AMzCz.js} +4 -6
  35. package/dist/resolve-recipes-C0-AMzCz.js.map +1 -0
  36. package/dist/ssr/astro-client.js +19 -0
  37. package/dist/ssr/astro-client.js.map +1 -0
  38. package/dist/ssr/astro-middleware.d.ts +15 -0
  39. package/dist/ssr/astro-middleware.js +19 -0
  40. package/dist/ssr/astro-middleware.js.map +1 -0
  41. package/dist/ssr/astro.d.ts +89 -10
  42. package/dist/ssr/astro.js +115 -30
  43. package/dist/ssr/astro.js.map +1 -1
  44. package/dist/ssr/index.d.ts +44 -5
  45. package/dist/ssr/index.js +6 -7
  46. package/dist/ssr/index.js.map +1 -1
  47. package/dist/ssr/next.d.ts +5 -4
  48. package/dist/ssr/next.js +16 -10
  49. package/dist/ssr/next.js.map +1 -1
  50. package/dist/static/index.d.ts +91 -5
  51. package/dist/static/index.js +49 -3
  52. package/dist/static/index.js.map +1 -0
  53. package/dist/zero/babel.d.ts +7 -108
  54. package/dist/zero/babel.js +45 -17
  55. package/dist/zero/babel.js.map +1 -1
  56. package/dist/zero/index.d.ts +67 -3
  57. package/dist/zero/index.js +1 -2
  58. package/docs/README.md +4 -4
  59. package/docs/adoption.md +5 -3
  60. package/docs/comparison.md +24 -25
  61. package/docs/configuration.md +69 -1
  62. package/docs/debug.md +11 -9
  63. package/docs/design-system.md +22 -10
  64. package/docs/dsl.md +23 -8
  65. package/docs/getting-started.md +10 -10
  66. package/docs/injector.md +43 -27
  67. package/docs/methodology.md +52 -3
  68. package/docs/{PIPELINE.md → pipeline.md} +204 -50
  69. package/docs/{runtime.md → react-api.md} +104 -32
  70. package/docs/ssr.md +139 -81
  71. package/docs/styles.md +14 -0
  72. package/docs/tasty-static.md +14 -2
  73. package/package.json +17 -10
  74. package/dist/_virtual/_rolldown/runtime.js +0 -7
  75. package/dist/chunks/cacheKey.js +0 -77
  76. package/dist/chunks/cacheKey.js.map +0 -1
  77. package/dist/chunks/definitions.d.ts +0 -37
  78. package/dist/chunks/definitions.js +0 -258
  79. package/dist/chunks/definitions.js.map +0 -1
  80. package/dist/chunks/index.d.ts +0 -1
  81. package/dist/chunks/renderChunk.d.ts +0 -1
  82. package/dist/chunks/renderChunk.js +0 -59
  83. package/dist/chunks/renderChunk.js.map +0 -1
  84. package/dist/config.d.ts +0 -366
  85. package/dist/config.js +0 -503
  86. package/dist/config.js.map +0 -1
  87. package/dist/counter-style/index.js +0 -51
  88. package/dist/counter-style/index.js.map +0 -1
  89. package/dist/debug.d.ts +0 -89
  90. package/dist/debug.js +0 -453
  91. package/dist/debug.js.map +0 -1
  92. package/dist/font-face/index.js +0 -63
  93. package/dist/font-face/index.js.map +0 -1
  94. package/dist/hooks/index.d.ts +0 -7
  95. package/dist/hooks/resolve-ssr-collector.js +0 -14
  96. package/dist/hooks/resolve-ssr-collector.js.map +0 -1
  97. package/dist/hooks/useCounterStyle.d.ts +0 -50
  98. package/dist/hooks/useCounterStyle.js +0 -46
  99. package/dist/hooks/useCounterStyle.js.map +0 -1
  100. package/dist/hooks/useFontFace.d.ts +0 -43
  101. package/dist/hooks/useFontFace.js +0 -70
  102. package/dist/hooks/useFontFace.js.map +0 -1
  103. package/dist/hooks/useGlobalStyles.d.ts +0 -30
  104. package/dist/hooks/useGlobalStyles.js +0 -78
  105. package/dist/hooks/useGlobalStyles.js.map +0 -1
  106. package/dist/hooks/useKeyframes.d.ts +0 -56
  107. package/dist/hooks/useKeyframes.js +0 -64
  108. package/dist/hooks/useKeyframes.js.map +0 -1
  109. package/dist/hooks/useProperty.d.ts +0 -79
  110. package/dist/hooks/useProperty.js +0 -109
  111. package/dist/hooks/useProperty.js.map +0 -1
  112. package/dist/hooks/useRawCSS.d.ts +0 -53
  113. package/dist/hooks/useRawCSS.js +0 -35
  114. package/dist/hooks/useRawCSS.js.map +0 -1
  115. package/dist/hooks/useStyles.d.ts +0 -45
  116. package/dist/hooks/useStyles.js +0 -237
  117. package/dist/hooks/useStyles.js.map +0 -1
  118. package/dist/injector/index.d.ts +0 -183
  119. package/dist/injector/index.js +0 -179
  120. package/dist/injector/index.js.map +0 -1
  121. package/dist/injector/injector.d.ts +0 -166
  122. package/dist/injector/injector.js +0 -464
  123. package/dist/injector/injector.js.map +0 -1
  124. package/dist/injector/sheet-manager.d.ts +0 -136
  125. package/dist/injector/sheet-manager.js +0 -733
  126. package/dist/injector/sheet-manager.js.map +0 -1
  127. package/dist/injector/types.d.ts +0 -204
  128. package/dist/keyframes/index.js +0 -206
  129. package/dist/keyframes/index.js.map +0 -1
  130. package/dist/parser/classify.js +0 -319
  131. package/dist/parser/classify.js.map +0 -1
  132. package/dist/parser/const.js +0 -49
  133. package/dist/parser/const.js.map +0 -1
  134. package/dist/parser/lru.js +0 -109
  135. package/dist/parser/lru.js.map +0 -1
  136. package/dist/parser/parser.d.ts +0 -25
  137. package/dist/parser/parser.js +0 -115
  138. package/dist/parser/parser.js.map +0 -1
  139. package/dist/parser/tokenizer.js +0 -69
  140. package/dist/parser/tokenizer.js.map +0 -1
  141. package/dist/parser/types.d.ts +0 -51
  142. package/dist/parser/types.js +0 -46
  143. package/dist/parser/types.js.map +0 -1
  144. package/dist/pipeline/conditions.d.ts +0 -134
  145. package/dist/pipeline/conditions.js +0 -406
  146. package/dist/pipeline/conditions.js.map +0 -1
  147. package/dist/pipeline/exclusive.js +0 -230
  148. package/dist/pipeline/exclusive.js.map +0 -1
  149. package/dist/pipeline/index.d.ts +0 -55
  150. package/dist/pipeline/index.js +0 -708
  151. package/dist/pipeline/index.js.map +0 -1
  152. package/dist/pipeline/materialize.js +0 -1103
  153. package/dist/pipeline/materialize.js.map +0 -1
  154. package/dist/pipeline/parseStateKey.d.ts +0 -15
  155. package/dist/pipeline/parseStateKey.js +0 -446
  156. package/dist/pipeline/parseStateKey.js.map +0 -1
  157. package/dist/pipeline/simplify.js +0 -515
  158. package/dist/pipeline/simplify.js.map +0 -1
  159. package/dist/pipeline/warnings.js +0 -18
  160. package/dist/pipeline/warnings.js.map +0 -1
  161. package/dist/plugins/index.d.ts +0 -2
  162. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  163. package/dist/plugins/okhsl-plugin.js +0 -97
  164. package/dist/plugins/okhsl-plugin.js.map +0 -1
  165. package/dist/plugins/types.d.ts +0 -76
  166. package/dist/properties/index.js +0 -222
  167. package/dist/properties/index.js.map +0 -1
  168. package/dist/properties/property-type-resolver.d.ts +0 -24
  169. package/dist/properties/property-type-resolver.js +0 -90
  170. package/dist/properties/property-type-resolver.js.map +0 -1
  171. package/dist/ssr/async-storage.d.ts +0 -17
  172. package/dist/ssr/async-storage.js.map +0 -1
  173. package/dist/ssr/collect-auto-properties.js +0 -39
  174. package/dist/ssr/collect-auto-properties.js.map +0 -1
  175. package/dist/ssr/collector.js.map +0 -1
  176. package/dist/ssr/context.d.ts +0 -8
  177. package/dist/ssr/context.js +0 -13
  178. package/dist/ssr/context.js.map +0 -1
  179. package/dist/ssr/format-global-rules.js.map +0 -1
  180. package/dist/ssr/format-keyframes.js +0 -69
  181. package/dist/ssr/format-keyframes.js.map +0 -1
  182. package/dist/ssr/format-property.js +0 -49
  183. package/dist/ssr/format-property.js.map +0 -1
  184. package/dist/ssr/format-rules.js +0 -73
  185. package/dist/ssr/format-rules.js.map +0 -1
  186. package/dist/ssr/hydrate.d.ts +0 -22
  187. package/dist/ssr/hydrate.js +0 -49
  188. package/dist/ssr/hydrate.js.map +0 -1
  189. package/dist/ssr/ssr-collector-ref.js +0 -12
  190. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  191. package/dist/states/index.d.ts +0 -49
  192. package/dist/states/index.js +0 -170
  193. package/dist/states/index.js.map +0 -1
  194. package/dist/static/tastyStatic.d.ts +0 -46
  195. package/dist/static/tastyStatic.js +0 -30
  196. package/dist/static/tastyStatic.js.map +0 -1
  197. package/dist/static/types.d.ts +0 -49
  198. package/dist/static/types.js +0 -24
  199. package/dist/static/types.js.map +0 -1
  200. package/dist/styles/align.d.ts +0 -15
  201. package/dist/styles/align.js +0 -14
  202. package/dist/styles/align.js.map +0 -1
  203. package/dist/styles/border.d.ts +0 -25
  204. package/dist/styles/border.js +0 -113
  205. package/dist/styles/border.js.map +0 -1
  206. package/dist/styles/color.d.ts +0 -14
  207. package/dist/styles/color.js +0 -26
  208. package/dist/styles/color.js.map +0 -1
  209. package/dist/styles/createStyle.js +0 -79
  210. package/dist/styles/createStyle.js.map +0 -1
  211. package/dist/styles/dimension.js +0 -96
  212. package/dist/styles/dimension.js.map +0 -1
  213. package/dist/styles/display.d.ts +0 -37
  214. package/dist/styles/display.js +0 -66
  215. package/dist/styles/display.js.map +0 -1
  216. package/dist/styles/fade.d.ts +0 -15
  217. package/dist/styles/fade.js +0 -57
  218. package/dist/styles/fade.js.map +0 -1
  219. package/dist/styles/fill.d.ts +0 -42
  220. package/dist/styles/fill.js +0 -51
  221. package/dist/styles/fill.js.map +0 -1
  222. package/dist/styles/flow.d.ts +0 -16
  223. package/dist/styles/flow.js +0 -12
  224. package/dist/styles/flow.js.map +0 -1
  225. package/dist/styles/gap.d.ts +0 -31
  226. package/dist/styles/gap.js +0 -36
  227. package/dist/styles/gap.js.map +0 -1
  228. package/dist/styles/height.d.ts +0 -17
  229. package/dist/styles/height.js +0 -19
  230. package/dist/styles/height.js.map +0 -1
  231. package/dist/styles/index.d.ts +0 -1
  232. package/dist/styles/index.js +0 -8
  233. package/dist/styles/index.js.map +0 -1
  234. package/dist/styles/inset.d.ts +0 -52
  235. package/dist/styles/inset.js +0 -149
  236. package/dist/styles/inset.js.map +0 -1
  237. package/dist/styles/justify.d.ts +0 -15
  238. package/dist/styles/justify.js +0 -14
  239. package/dist/styles/justify.js.map +0 -1
  240. package/dist/styles/list.d.ts +0 -16
  241. package/dist/styles/list.js +0 -98
  242. package/dist/styles/list.js.map +0 -1
  243. package/dist/styles/margin.d.ts +0 -24
  244. package/dist/styles/margin.js +0 -103
  245. package/dist/styles/margin.js.map +0 -1
  246. package/dist/styles/outline.d.ts +0 -29
  247. package/dist/styles/outline.js +0 -64
  248. package/dist/styles/outline.js.map +0 -1
  249. package/dist/styles/padding.d.ts +0 -24
  250. package/dist/styles/padding.js +0 -103
  251. package/dist/styles/padding.js.map +0 -1
  252. package/dist/styles/predefined.d.ts +0 -71
  253. package/dist/styles/predefined.js +0 -237
  254. package/dist/styles/predefined.js.map +0 -1
  255. package/dist/styles/preset.d.ts +0 -52
  256. package/dist/styles/preset.js +0 -126
  257. package/dist/styles/preset.js.map +0 -1
  258. package/dist/styles/radius.d.ts +0 -12
  259. package/dist/styles/radius.js +0 -71
  260. package/dist/styles/radius.js.map +0 -1
  261. package/dist/styles/scrollbar.d.ts +0 -25
  262. package/dist/styles/scrollbar.js +0 -46
  263. package/dist/styles/scrollbar.js.map +0 -1
  264. package/dist/styles/shadow.d.ts +0 -14
  265. package/dist/styles/shadow.js +0 -23
  266. package/dist/styles/shadow.js.map +0 -1
  267. package/dist/styles/transition.d.ts +0 -14
  268. package/dist/styles/transition.js +0 -157
  269. package/dist/styles/transition.js.map +0 -1
  270. package/dist/styles/types.d.ts +0 -549
  271. package/dist/styles/width.d.ts +0 -17
  272. package/dist/styles/width.js +0 -19
  273. package/dist/styles/width.js.map +0 -1
  274. package/dist/tasty.d.ts +0 -119
  275. package/dist/tasty.js +0 -231
  276. package/dist/tasty.js.map +0 -1
  277. package/dist/types.d.ts +0 -184
  278. package/dist/utils/cache-wrapper.js +0 -21
  279. package/dist/utils/cache-wrapper.js.map +0 -1
  280. package/dist/utils/case-converter.js +0 -8
  281. package/dist/utils/case-converter.js.map +0 -1
  282. package/dist/utils/color-math.d.ts +0 -46
  283. package/dist/utils/color-math.js +0 -749
  284. package/dist/utils/color-math.js.map +0 -1
  285. package/dist/utils/color-space.d.ts +0 -5
  286. package/dist/utils/color-space.js +0 -228
  287. package/dist/utils/color-space.js.map +0 -1
  288. package/dist/utils/colors.d.ts +0 -5
  289. package/dist/utils/colors.js +0 -10
  290. package/dist/utils/colors.js.map +0 -1
  291. package/dist/utils/css-types.d.ts +0 -7
  292. package/dist/utils/dotize.d.ts +0 -26
  293. package/dist/utils/dotize.js +0 -122
  294. package/dist/utils/dotize.js.map +0 -1
  295. package/dist/utils/filter-base-props.d.ts +0 -15
  296. package/dist/utils/filter-base-props.js +0 -45
  297. package/dist/utils/filter-base-props.js.map +0 -1
  298. package/dist/utils/get-display-name.d.ts +0 -7
  299. package/dist/utils/get-display-name.js +0 -10
  300. package/dist/utils/get-display-name.js.map +0 -1
  301. package/dist/utils/has-keys.js +0 -13
  302. package/dist/utils/has-keys.js.map +0 -1
  303. package/dist/utils/is-dev-env.js +0 -19
  304. package/dist/utils/is-dev-env.js.map +0 -1
  305. package/dist/utils/is-valid-element-type.js +0 -15
  306. package/dist/utils/is-valid-element-type.js.map +0 -1
  307. package/dist/utils/merge-styles.js.map +0 -1
  308. package/dist/utils/mod-attrs.d.ts +0 -6
  309. package/dist/utils/mod-attrs.js +0 -20
  310. package/dist/utils/mod-attrs.js.map +0 -1
  311. package/dist/utils/process-tokens.d.ts +0 -21
  312. package/dist/utils/process-tokens.js +0 -90
  313. package/dist/utils/process-tokens.js.map +0 -1
  314. package/dist/utils/resolve-recipes.d.ts +0 -17
  315. package/dist/utils/resolve-recipes.js.map +0 -1
  316. package/dist/utils/selector-transform.js +0 -32
  317. package/dist/utils/selector-transform.js.map +0 -1
  318. package/dist/utils/string.js +0 -8
  319. package/dist/utils/string.js.map +0 -1
  320. package/dist/utils/styles.d.ts +0 -99
  321. package/dist/utils/styles.js +0 -220
  322. package/dist/utils/styles.js.map +0 -1
  323. package/dist/utils/typography.d.ts +0 -47
  324. package/dist/utils/typography.js +0 -51
  325. package/dist/utils/typography.js.map +0 -1
  326. package/dist/utils/warnings.d.ts +0 -16
  327. package/dist/utils/warnings.js +0 -16
  328. package/dist/utils/warnings.js.map +0 -1
  329. package/dist/zero/css-writer.d.ts +0 -45
  330. package/dist/zero/css-writer.js +0 -73
  331. package/dist/zero/css-writer.js.map +0 -1
  332. package/dist/zero/extractor.d.ts +0 -24
  333. package/dist/zero/extractor.js.map +0 -1
  334. /package/dist/{chunks/cacheKey.d.ts → ssr/astro-client.d.ts} +0 -0
@@ -1,19 +0,0 @@
1
- import { dimensionStyle } from "./dimension.js";
2
- //#region src/styles/height.ts
3
- const dimension = dimensionStyle("height");
4
- function heightStyle({ height, minHeight, maxHeight }) {
5
- return dimension({
6
- value: height,
7
- min: minHeight,
8
- max: maxHeight
9
- });
10
- }
11
- heightStyle.__lookupStyles = [
12
- "height",
13
- "minHeight",
14
- "maxHeight"
15
- ];
16
- //#endregion
17
- export { heightStyle };
18
-
19
- //# sourceMappingURL=height.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"height.js","names":[],"sources":["../../src/styles/height.ts"],"sourcesContent":["import { dimensionStyle } from './dimension';\n\nconst dimension = dimensionStyle('height');\n\ninterface HeightStyleProps {\n height?: string | number | boolean;\n minHeight?: string | number | boolean;\n maxHeight?: string | number | boolean;\n}\n\nexport function heightStyle({\n height,\n minHeight,\n maxHeight,\n}: HeightStyleProps) {\n return dimension({ value: height, min: minHeight, max: maxHeight });\n}\n\nheightStyle.__lookupStyles = ['height', 'minHeight', 'maxHeight'];\n"],"mappings":";;AAEA,MAAM,YAAY,eAAe,SAAS;AAQ1C,SAAgB,YAAY,EAC1B,QACA,WACA,aACmB;AACnB,QAAO,UAAU;EAAE,OAAO;EAAQ,KAAK;EAAW,KAAK;EAAW,CAAC;;AAGrE,YAAY,iBAAiB;CAAC;CAAU;CAAa;CAAY"}
@@ -1 +0,0 @@
1
- import { styleHandlers } from "./predefined.js";
@@ -1,8 +0,0 @@
1
- import "./createStyle.js";
2
- import { predefine } from "./predefined.js";
3
- //#region src/styles/index.ts
4
- const { STYLE_HANDLER_MAP, defineCustomStyle, defineStyleAlias } = predefine();
5
- //#endregion
6
- export { STYLE_HANDLER_MAP };
7
-
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/styles/index.ts"],"sourcesContent":["import { predefine, styleHandlers } from './predefined';\n\nconst { STYLE_HANDLER_MAP, defineCustomStyle, defineStyleAlias } = predefine();\n\nexport {\n STYLE_HANDLER_MAP,\n defineCustomStyle,\n defineStyleAlias,\n styleHandlers,\n};\nexport * from './createStyle';\nexport {\n normalizeHandlerDefinition,\n registerHandler,\n resetHandlers,\n validateHandlerResult,\n} from './predefined';\n"],"mappings":";;;AAEA,MAAM,EAAE,mBAAmB,mBAAmB,qBAAqB,WAAW"}
@@ -1,52 +0,0 @@
1
- //#region src/styles/inset.d.ts
2
- /**
3
- * Inset style handler.
4
- *
5
- * IMPORTANT: This handler uses individual CSS properties (top, right, bottom, left)
6
- * when only individual direction props are specified. This allows CSS cascade to work
7
- * correctly when modifiers override only some directions.
8
- *
9
- * Example problem with using `inset` shorthand everywhere:
10
- * styles: {
11
- * top: { '': 0, 'side=bottom': 'initial' },
12
- * right: { '': 0, 'side=left': 'initial' },
13
- * bottom: { '': 0, 'side=top': 'initial' },
14
- * left: { '': 0, 'side=right': 'initial' },
15
- * }
16
- *
17
- * If we output `inset` for both cases:
18
- * - Default: inset: 0 0 0 0
19
- * - side=bottom: inset: initial auto auto auto ← WRONG! Overrides all 4 directions
20
- *
21
- * With individual properties:
22
- * - Default: top: 0; right: 0; bottom: 0; left: 0
23
- * - side=bottom: top: initial ← CORRECT! Only overrides top
24
- *
25
- * The `inset` shorthand is only used when the base `inset` prop is specified
26
- * OR when `insetBlock`/`insetInline` are used (which imply setting pairs).
27
- */
28
- declare function insetStyle({
29
- inset,
30
- insetBlock,
31
- insetInline,
32
- top,
33
- right,
34
- bottom,
35
- left
36
- }: {
37
- inset?: string | number | boolean;
38
- insetBlock?: string | number | boolean;
39
- insetInline?: string | number | boolean;
40
- top?: string | number | boolean;
41
- right?: string | number | boolean;
42
- bottom?: string | number | boolean;
43
- left?: string | number | boolean;
44
- }): Record<string, string> | {
45
- inset: string;
46
- };
47
- declare namespace insetStyle {
48
- var __lookupStyles: string[];
49
- }
50
- //#endregion
51
- export { insetStyle };
52
- //# sourceMappingURL=inset.d.ts.map
@@ -1,149 +0,0 @@
1
- import { DIRECTIONS, filterMods, parseStyle } from "../utils/styles.js";
2
- //#region src/styles/inset.ts
3
- /**
4
- * Parse an inset value and return the first processed value
5
- */
6
- function parseInsetValue(value) {
7
- if (typeof value === "number") return `${value}px`;
8
- if (!value) return null;
9
- if (value === true) value = "0";
10
- const { values } = parseStyle(value).groups[0] ?? { values: [] };
11
- return values[0] || "0";
12
- }
13
- /**
14
- * Extract values and directions from a single parsed group.
15
- */
16
- function extractGroupData(group) {
17
- const { values = [], mods = [] } = group;
18
- return {
19
- values: values.length ? values : ["0"],
20
- directions: filterMods(mods, DIRECTIONS)
21
- };
22
- }
23
- /**
24
- * Apply a single group's values and directions onto a direction map.
25
- */
26
- function applyGroup(dirs, values, directions) {
27
- if (!values.length) return;
28
- if (directions.length === 0) {
29
- dirs.top = values[0];
30
- dirs.right = values[1] || values[0];
31
- dirs.bottom = values[2] || values[0];
32
- dirs.left = values[3] || values[1] || values[0];
33
- } else directions.forEach((dir, i) => {
34
- dirs[dir] = values[i] ?? values[0];
35
- });
36
- }
37
- /**
38
- * Optimize inset output shorthand.
39
- */
40
- function optimizeInset(dirs) {
41
- const { top, right, bottom, left } = dirs;
42
- if (top === right && right === bottom && bottom === left) return { inset: top };
43
- if (top === bottom && left === right) return { inset: `${top} ${left}` };
44
- return { inset: `${top} ${right} ${bottom} ${left}` };
45
- }
46
- /**
47
- * Inset style handler.
48
- *
49
- * IMPORTANT: This handler uses individual CSS properties (top, right, bottom, left)
50
- * when only individual direction props are specified. This allows CSS cascade to work
51
- * correctly when modifiers override only some directions.
52
- *
53
- * Example problem with using `inset` shorthand everywhere:
54
- * styles: {
55
- * top: { '': 0, 'side=bottom': 'initial' },
56
- * right: { '': 0, 'side=left': 'initial' },
57
- * bottom: { '': 0, 'side=top': 'initial' },
58
- * left: { '': 0, 'side=right': 'initial' },
59
- * }
60
- *
61
- * If we output `inset` for both cases:
62
- * - Default: inset: 0 0 0 0
63
- * - side=bottom: inset: initial auto auto auto ← WRONG! Overrides all 4 directions
64
- *
65
- * With individual properties:
66
- * - Default: top: 0; right: 0; bottom: 0; left: 0
67
- * - side=bottom: top: initial ← CORRECT! Only overrides top
68
- *
69
- * The `inset` shorthand is only used when the base `inset` prop is specified
70
- * OR when `insetBlock`/`insetInline` are used (which imply setting pairs).
71
- */
72
- function insetStyle({ inset, insetBlock, insetInline, top, right, bottom, left }) {
73
- if (inset == null && insetBlock == null && insetInline == null && top == null && right == null && bottom == null && left == null) return {};
74
- if (inset == null && insetBlock == null && insetInline == null) {
75
- const result = {};
76
- if (top != null) {
77
- const val = parseInsetValue(top);
78
- if (val) result["top"] = val;
79
- }
80
- if (right != null) {
81
- const val = parseInsetValue(right);
82
- if (val) result["right"] = val;
83
- }
84
- if (bottom != null) {
85
- const val = parseInsetValue(bottom);
86
- if (val) result["bottom"] = val;
87
- }
88
- if (left != null) {
89
- const val = parseInsetValue(left);
90
- if (val) result["left"] = val;
91
- }
92
- return result;
93
- }
94
- const dirs = {
95
- top: "auto",
96
- right: "auto",
97
- bottom: "auto",
98
- left: "auto"
99
- };
100
- if (inset != null) {
101
- if (typeof inset === "number") dirs.top = dirs.right = dirs.bottom = dirs.left = `${inset}px`;
102
- else if (inset === true) inset = "0";
103
- if (typeof inset === "string" && inset) {
104
- const groups = parseStyle(inset).groups ?? [];
105
- for (const group of groups) {
106
- const { values, directions } = extractGroupData(group);
107
- applyGroup(dirs, values, directions);
108
- }
109
- }
110
- }
111
- if (insetBlock != null) {
112
- const val = parseInsetValue(insetBlock);
113
- if (val) dirs.top = dirs.bottom = val;
114
- }
115
- if (insetInline != null) {
116
- const val = parseInsetValue(insetInline);
117
- if (val) dirs.left = dirs.right = val;
118
- }
119
- if (top != null) {
120
- const val = parseInsetValue(top);
121
- if (val) dirs.top = val;
122
- }
123
- if (right != null) {
124
- const val = parseInsetValue(right);
125
- if (val) dirs.right = val;
126
- }
127
- if (bottom != null) {
128
- const val = parseInsetValue(bottom);
129
- if (val) dirs.bottom = val;
130
- }
131
- if (left != null) {
132
- const val = parseInsetValue(left);
133
- if (val) dirs.left = val;
134
- }
135
- return optimizeInset(dirs);
136
- }
137
- insetStyle.__lookupStyles = [
138
- "inset",
139
- "insetBlock",
140
- "insetInline",
141
- "top",
142
- "right",
143
- "bottom",
144
- "left"
145
- ];
146
- //#endregion
147
- export { insetStyle };
148
-
149
- //# sourceMappingURL=inset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inset.js","names":[],"sources":["../../src/styles/inset.ts"],"sourcesContent":["import type { StyleDetails } from '../parser/types';\nimport { DIRECTIONS, filterMods, parseStyle } from '../utils/styles';\n\ntype Direction = (typeof DIRECTIONS)[number];\n\n/**\n * Parse an inset value and return the first processed value\n */\nfunction parseInsetValue(value: string | number | boolean): string | null {\n if (typeof value === 'number') return `${value}px`;\n if (!value) return null;\n if (value === true) value = '0';\n\n const { values } = parseStyle(value).groups[0] ?? { values: [] };\n\n return values[0] || '0';\n}\n\n/**\n * Extract values and directions from a single parsed group.\n */\nfunction extractGroupData(group: StyleDetails): {\n values: string[];\n directions: Direction[];\n} {\n const { values = [], mods = [] } = group;\n return {\n values: values.length ? values : ['0'],\n directions: filterMods(mods, DIRECTIONS) as Direction[],\n };\n}\n\n/**\n * Apply a single group's values and directions onto a direction map.\n */\nfunction applyGroup(\n dirs: Record<Direction, string>,\n values: string[],\n directions: Direction[],\n): void {\n if (!values.length) return;\n\n if (directions.length === 0) {\n dirs.top = values[0];\n dirs.right = values[1] || values[0];\n dirs.bottom = values[2] || values[0];\n dirs.left = values[3] || values[1] || values[0];\n } else {\n directions.forEach((dir, i) => {\n dirs[dir] = values[i] ?? values[0];\n });\n }\n}\n\n/**\n * Optimize inset output shorthand.\n */\nfunction optimizeInset(dirs: Record<Direction, string>): { inset: string } {\n const { top, right, bottom, left } = dirs;\n if (top === right && right === bottom && bottom === left) {\n return { inset: top };\n }\n if (top === bottom && left === right) {\n return { inset: `${top} ${left}` };\n }\n return { inset: `${top} ${right} ${bottom} ${left}` };\n}\n\n/**\n * Inset style handler.\n *\n * IMPORTANT: This handler uses individual CSS properties (top, right, bottom, left)\n * when only individual direction props are specified. This allows CSS cascade to work\n * correctly when modifiers override only some directions.\n *\n * Example problem with using `inset` shorthand everywhere:\n * styles: {\n * top: { '': 0, 'side=bottom': 'initial' },\n * right: { '': 0, 'side=left': 'initial' },\n * bottom: { '': 0, 'side=top': 'initial' },\n * left: { '': 0, 'side=right': 'initial' },\n * }\n *\n * If we output `inset` for both cases:\n * - Default: inset: 0 0 0 0\n * - side=bottom: inset: initial auto auto auto ← WRONG! Overrides all 4 directions\n *\n * With individual properties:\n * - Default: top: 0; right: 0; bottom: 0; left: 0\n * - side=bottom: top: initial ← CORRECT! Only overrides top\n *\n * The `inset` shorthand is only used when the base `inset` prop is specified\n * OR when `insetBlock`/`insetInline` are used (which imply setting pairs).\n */\nexport function insetStyle({\n inset,\n insetBlock,\n insetInline,\n top,\n right,\n bottom,\n left,\n}: {\n inset?: string | number | boolean;\n insetBlock?: string | number | boolean;\n insetInline?: string | number | boolean;\n top?: string | number | boolean;\n right?: string | number | boolean;\n bottom?: string | number | boolean;\n left?: string | number | boolean;\n}) {\n if (\n inset == null &&\n insetBlock == null &&\n insetInline == null &&\n top == null &&\n right == null &&\n bottom == null &&\n left == null\n ) {\n return {};\n }\n\n // When only individual direction props are used (no inset, insetBlock, insetInline),\n // output individual CSS properties to allow proper CSS cascade with modifiers\n const onlyIndividualProps =\n inset == null && insetBlock == null && insetInline == null;\n\n if (onlyIndividualProps) {\n const result: Record<string, string> = {};\n\n if (top != null) {\n const val = parseInsetValue(top);\n if (val) result['top'] = val;\n }\n if (right != null) {\n const val = parseInsetValue(right);\n if (val) result['right'] = val;\n }\n if (bottom != null) {\n const val = parseInsetValue(bottom);\n if (val) result['bottom'] = val;\n }\n if (left != null) {\n const val = parseInsetValue(left);\n if (val) result['left'] = val;\n }\n\n return result;\n }\n\n const dirs: Record<Direction, string> = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n };\n\n // Priority 1 (lowest): inset\n if (inset != null) {\n if (typeof inset === 'number') {\n const v = `${inset}px`;\n dirs.top = dirs.right = dirs.bottom = dirs.left = v;\n } else if (inset === true) {\n inset = '0';\n }\n\n if (typeof inset === 'string' && inset) {\n const processed = parseStyle(inset);\n const groups = processed.groups ?? [];\n\n for (const group of groups) {\n const { values, directions } = extractGroupData(group);\n applyGroup(dirs, values, directions);\n }\n }\n }\n\n // Priority 2 (medium): insetBlock/insetInline\n if (insetBlock != null) {\n const val = parseInsetValue(insetBlock);\n if (val) dirs.top = dirs.bottom = val;\n }\n if (insetInline != null) {\n const val = parseInsetValue(insetInline);\n if (val) dirs.left = dirs.right = val;\n }\n\n // Priority 3 (highest): individual directions\n if (top != null) {\n const val = parseInsetValue(top);\n if (val) dirs.top = val;\n }\n if (right != null) {\n const val = parseInsetValue(right);\n if (val) dirs.right = val;\n }\n if (bottom != null) {\n const val = parseInsetValue(bottom);\n if (val) dirs.bottom = val;\n }\n if (left != null) {\n const val = parseInsetValue(left);\n if (val) dirs.left = val;\n }\n\n return optimizeInset(dirs);\n}\n\ninsetStyle.__lookupStyles = [\n 'inset',\n 'insetBlock',\n 'insetInline',\n 'top',\n 'right',\n 'bottom',\n 'left',\n];\n"],"mappings":";;;;;AAQA,SAAS,gBAAgB,OAAiD;AACxE,KAAI,OAAO,UAAU,SAAU,QAAO,GAAG,MAAM;AAC/C,KAAI,CAAC,MAAO,QAAO;AACnB,KAAI,UAAU,KAAM,SAAQ;CAE5B,MAAM,EAAE,WAAW,WAAW,MAAM,CAAC,OAAO,MAAM,EAAE,QAAQ,EAAE,EAAE;AAEhE,QAAO,OAAO,MAAM;;;;;AAMtB,SAAS,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ACA;CACA;CACD"}
@@ -1,15 +0,0 @@
1
- //#region src/styles/justify.d.ts
2
- declare function justifyStyle({
3
- justify
4
- }: {
5
- justify?: string;
6
- }): {
7
- 'justify-items': string;
8
- 'justify-content': string;
9
- } | undefined;
10
- declare namespace justifyStyle {
11
- var __lookupStyles: string[];
12
- }
13
- //#endregion
14
- export { justifyStyle };
15
- //# sourceMappingURL=justify.d.ts.map
@@ -1,14 +0,0 @@
1
- //#region src/styles/justify.ts
2
- function justifyStyle({ justify }) {
3
- if (typeof justify !== "string") return;
4
- if (!justify) return;
5
- return {
6
- "justify-items": justify,
7
- "justify-content": justify
8
- };
9
- }
10
- justifyStyle.__lookupStyles = ["justify"];
11
- //#endregion
12
- export { justifyStyle };
13
-
14
- //# sourceMappingURL=justify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"justify.js","names":[],"sources":["../../src/styles/justify.ts"],"sourcesContent":["export function justifyStyle({ justify }: { justify?: string }) {\n if (typeof justify !== 'string') return;\n\n if (!justify) return;\n\n return {\n 'justify-items': justify,\n 'justify-content': justify,\n };\n}\n\njustifyStyle.__lookupStyles = ['justify'];\n"],"mappings":";AAAA,SAAgB,aAAa,EAAE,WAAiC;AAC9D,KAAI,OAAO,YAAY,SAAU;AAEjC,KAAI,CAAC,QAAS;AAEd,QAAO;EACL,iBAAiB;EACjB,mBAAmB;EACpB;;AAGH,aAAa,iBAAiB,CAAC,UAAU"}
@@ -1,16 +0,0 @@
1
- //#region src/styles/list.d.ts
2
- declare const BASE_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition"];
3
- declare const POSITION_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position"];
4
- declare const BLOCK_INNER_STYLES: readonly ["padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign"];
5
- declare const BLOCK_OUTER_STYLES: readonly ["border", "radius", "shadow", "outline"];
6
- declare const BLOCK_STYLES: readonly ["padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "border", "radius", "shadow", "outline"];
7
- declare const COLOR_STYLES: readonly ["color", "fill", "fade", "image"];
8
- declare const TEXT_STYLES: readonly ["textTransform", "fontWeight", "fontStyle"];
9
- declare const DIMENSION_STYLES: readonly ["width", "height", "flexBasis", "flexGrow", "flexShrink", "flex"];
10
- declare const FLOW_STYLES: readonly ["flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
11
- declare const CONTAINER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "border", "radius", "shadow", "outline", "flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
12
- declare const OUTER_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "border", "radius", "shadow", "outline"];
13
- declare const INNER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
14
- //#endregion
15
- export { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES };
16
- //# sourceMappingURL=list.d.ts.map
@@ -1,98 +0,0 @@
1
- //#region src/styles/list.ts
2
- const BASE_STYLES = [
3
- "display",
4
- "font",
5
- "preset",
6
- "hide",
7
- "whiteSpace",
8
- "opacity",
9
- "transition"
10
- ];
11
- const POSITION_STYLES = [
12
- "gridArea",
13
- "order",
14
- "gridColumn",
15
- "gridRow",
16
- "placeSelf",
17
- "alignSelf",
18
- "justifySelf",
19
- "zIndex",
20
- "margin",
21
- "inset",
22
- "position"
23
- ];
24
- const BLOCK_INNER_STYLES = [
25
- "padding",
26
- "paddingInline",
27
- "paddingBlock",
28
- "overflow",
29
- "scrollbar",
30
- "textAlign"
31
- ];
32
- const BLOCK_OUTER_STYLES = [
33
- "border",
34
- "radius",
35
- "shadow",
36
- "outline"
37
- ];
38
- const BLOCK_STYLES = [...BLOCK_INNER_STYLES, ...BLOCK_OUTER_STYLES];
39
- const COLOR_STYLES = [
40
- "color",
41
- "fill",
42
- "fade",
43
- "image"
44
- ];
45
- const TEXT_STYLES = [
46
- "textTransform",
47
- "fontWeight",
48
- "fontStyle"
49
- ];
50
- const DIMENSION_STYLES = [
51
- "width",
52
- "height",
53
- "flexBasis",
54
- "flexGrow",
55
- "flexShrink",
56
- "flex"
57
- ];
58
- const FLOW_STYLES = [
59
- "flow",
60
- "placeItems",
61
- "placeContent",
62
- "alignItems",
63
- "alignContent",
64
- "justifyItems",
65
- "justifyContent",
66
- "align",
67
- "justify",
68
- "gap",
69
- "columnGap",
70
- "rowGap",
71
- "gridColumns",
72
- "gridRows",
73
- "gridTemplate",
74
- "gridAreas"
75
- ];
76
- const CONTAINER_STYLES = [
77
- ...BASE_STYLES,
78
- ...COLOR_STYLES,
79
- ...DIMENSION_STYLES,
80
- ...POSITION_STYLES,
81
- ...BLOCK_STYLES,
82
- ...FLOW_STYLES
83
- ];
84
- const OUTER_STYLES = [
85
- ...POSITION_STYLES,
86
- ...DIMENSION_STYLES,
87
- ...BLOCK_OUTER_STYLES
88
- ];
89
- const INNER_STYLES = [
90
- ...BASE_STYLES,
91
- ...COLOR_STYLES,
92
- ...BLOCK_INNER_STYLES,
93
- ...FLOW_STYLES
94
- ];
95
- //#endregion
96
- export { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES };
97
-
98
- //# sourceMappingURL=list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.js","names":[],"sources":["../../src/styles/list.ts"],"sourcesContent":["export const BASE_STYLES = [\n 'display',\n 'font',\n 'preset',\n 'hide',\n 'whiteSpace',\n 'opacity',\n 'transition',\n] as const;\n\nexport const POSITION_STYLES = [\n 'gridArea',\n 'order',\n 'gridColumn',\n 'gridRow',\n 'placeSelf',\n 'alignSelf',\n 'justifySelf',\n 'zIndex',\n 'margin',\n 'inset',\n 'position',\n] as const;\n\nexport const BLOCK_INNER_STYLES = [\n 'padding',\n 'paddingInline',\n 'paddingBlock',\n 'overflow',\n 'scrollbar',\n 'textAlign',\n] as const;\n\nexport const BLOCK_OUTER_STYLES = [\n 'border',\n 'radius',\n 'shadow',\n 'outline',\n] as const;\n\nexport const BLOCK_STYLES = [\n ...BLOCK_INNER_STYLES,\n ...BLOCK_OUTER_STYLES,\n] as const;\n\nexport const COLOR_STYLES = ['color', 'fill', 'fade', 'image'] as const;\n\nexport const TEXT_STYLES = [\n 'textTransform',\n 'fontWeight',\n 'fontStyle',\n] as const;\n\nexport const DIMENSION_STYLES = [\n 'width',\n 'height',\n 'flexBasis',\n 'flexGrow',\n 'flexShrink',\n 'flex',\n] as const;\n\nexport const FLOW_STYLES = [\n 'flow',\n 'placeItems',\n 'placeContent',\n 'alignItems',\n 'alignContent',\n 'justifyItems',\n 'justifyContent',\n 'align',\n 'justify',\n 'gap',\n 'columnGap',\n 'rowGap',\n 'gridColumns',\n 'gridRows',\n 'gridTemplate',\n 'gridAreas',\n] as const;\n\nexport const CONTAINER_STYLES = [\n ...BASE_STYLES,\n ...COLOR_STYLES,\n ...DIMENSION_STYLES,\n ...POSITION_STYLES,\n ...BLOCK_STYLES,\n ...FLOW_STYLES,\n] as const;\n\nexport const OUTER_STYLES = [\n ...POSITION_STYLES,\n ...DIMENSION_STYLES,\n ...BLOCK_OUTER_STYLES,\n] as const;\n\nexport const INNER_STYLES = [\n ...BASE_STYLES,\n ...COLOR_STYLES,\n ...BLOCK_INNER_STYLES,\n ...FLOW_STYLES,\n] as const;\n"],"mappings":";AAAA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACD;AAED,MAAa,eAAe,CAC1B,GAAG,oBACH,GAAG,mBACJ;AAED,MAAa,eAAe;CAAC;CAAS;CAAQ;CAAQ;CAAQ;AAE9D,MAAa,cAAc;CACzB;CACA;CACA;CACD;AAED,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,mBAAmB;CAC9B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACJ;AAED,MAAa,eAAe;CAC1B,GAAG;CACH,GAAG;CACH,GAAG;CACJ;AAED,MAAa,eAAe;CAC1B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACJ"}
@@ -1,24 +0,0 @@
1
- //#region src/styles/margin.d.ts
2
- declare function marginStyle({
3
- margin,
4
- marginBlock,
5
- marginInline,
6
- marginTop,
7
- marginRight,
8
- marginBottom,
9
- marginLeft
10
- }: {
11
- margin?: string | number | boolean;
12
- marginBlock?: string | number | boolean;
13
- marginInline?: string | number | boolean;
14
- marginTop?: string | number | boolean;
15
- marginRight?: string | number | boolean;
16
- marginBottom?: string | number | boolean;
17
- marginLeft?: string | number | boolean;
18
- }): {};
19
- declare namespace marginStyle {
20
- var __lookupStyles: string[];
21
- }
22
- //#endregion
23
- export { marginStyle };
24
- //# sourceMappingURL=margin.d.ts.map
@@ -1,103 +0,0 @@
1
- import { DIRECTIONS, filterMods, parseStyle } from "../utils/styles.js";
2
- //#region src/styles/margin.ts
3
- /**
4
- * Parse a margin value and return the first processed value
5
- */
6
- function parseMarginValue(value) {
7
- if (typeof value === "number") return `${value}px`;
8
- if (!value) return null;
9
- if (value === true) value = "1x";
10
- const { values } = parseStyle(value).groups[0] ?? { values: [] };
11
- return values[0] || "var(--gap)";
12
- }
13
- /**
14
- * Extract values and directions from a single parsed group.
15
- */
16
- function extractGroupData(group) {
17
- const { values = [], mods = [] } = group;
18
- return {
19
- values: values.length ? values : ["var(--gap)"],
20
- directions: filterMods(mods, DIRECTIONS)
21
- };
22
- }
23
- /**
24
- * Apply a single group's values and directions onto a direction map.
25
- */
26
- function applyGroup(dirs, values, directions) {
27
- if (!values.length) return;
28
- if (directions.length === 0) {
29
- dirs.top = values[0];
30
- dirs.right = values[1] || values[0];
31
- dirs.bottom = values[2] || values[0];
32
- dirs.left = values[3] || values[1] || values[0];
33
- } else directions.forEach((dir, i) => {
34
- dirs[dir] = values[i] ?? values[0];
35
- });
36
- }
37
- /**
38
- * Optimize margin output shorthand.
39
- */
40
- function optimizeMargin(dirs) {
41
- const { top, right, bottom, left } = dirs;
42
- if (top === right && right === bottom && bottom === left) return { margin: top };
43
- if (top === bottom && left === right) return { margin: `${top} ${left}` };
44
- return { margin: `${top} ${right} ${bottom} ${left}` };
45
- }
46
- function marginStyle({ margin, marginBlock, marginInline, marginTop, marginRight, marginBottom, marginLeft }) {
47
- if (margin == null && marginBlock == null && marginInline == null && marginTop == null && marginRight == null && marginBottom == null && marginLeft == null) return {};
48
- const dirs = {
49
- top: "0",
50
- right: "0",
51
- bottom: "0",
52
- left: "0"
53
- };
54
- if (margin != null) {
55
- if (typeof margin === "number") dirs.top = dirs.right = dirs.bottom = dirs.left = `${margin}px`;
56
- else if (margin === true) margin = "1x";
57
- if (typeof margin === "string" && margin) {
58
- const groups = parseStyle(margin).groups ?? [];
59
- for (const group of groups) {
60
- const { values, directions } = extractGroupData(group);
61
- applyGroup(dirs, values, directions);
62
- }
63
- }
64
- }
65
- if (marginBlock != null) {
66
- const val = parseMarginValue(marginBlock);
67
- if (val) dirs.top = dirs.bottom = val;
68
- }
69
- if (marginInline != null) {
70
- const val = parseMarginValue(marginInline);
71
- if (val) dirs.left = dirs.right = val;
72
- }
73
- if (marginTop != null) {
74
- const val = parseMarginValue(marginTop);
75
- if (val) dirs.top = val;
76
- }
77
- if (marginRight != null) {
78
- const val = parseMarginValue(marginRight);
79
- if (val) dirs.right = val;
80
- }
81
- if (marginBottom != null) {
82
- const val = parseMarginValue(marginBottom);
83
- if (val) dirs.bottom = val;
84
- }
85
- if (marginLeft != null) {
86
- const val = parseMarginValue(marginLeft);
87
- if (val) dirs.left = val;
88
- }
89
- return optimizeMargin(dirs);
90
- }
91
- marginStyle.__lookupStyles = [
92
- "margin",
93
- "marginTop",
94
- "marginRight",
95
- "marginBottom",
96
- "marginLeft",
97
- "marginBlock",
98
- "marginInline"
99
- ];
100
- //#endregion
101
- export { marginStyle };
102
-
103
- //# sourceMappingURL=margin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"margin.js","names":[],"sources":["../../src/styles/margin.ts"],"sourcesContent":["import type { StyleDetails } from '../parser/types';\nimport { DIRECTIONS, filterMods, parseStyle } from '../utils/styles';\n\ntype Direction = (typeof DIRECTIONS)[number];\n\n/**\n * Parse a margin value and return the first processed value\n */\nfunction parseMarginValue(value: string | number | boolean): string | null {\n if (typeof value === 'number') return `${value}px`;\n if (!value) return null;\n if (value === true) value = '1x';\n\n const { values } = parseStyle(value).groups[0] ?? { values: [] };\n\n return values[0] || 'var(--gap)';\n}\n\n/**\n * Extract values and directions from a single parsed group.\n */\nfunction extractGroupData(group: StyleDetails): {\n values: string[];\n directions: Direction[];\n} {\n const { values = [], mods = [] } = group;\n return {\n values: values.length ? values : ['var(--gap)'],\n directions: filterMods(mods, DIRECTIONS) as Direction[],\n };\n}\n\n/**\n * Apply a single group's values and directions onto a direction map.\n */\nfunction applyGroup(\n dirs: Record<Direction, string>,\n values: string[],\n directions: Direction[],\n): void {\n if (!values.length) return;\n\n if (directions.length === 0) {\n dirs.top = values[0];\n dirs.right = values[1] || values[0];\n dirs.bottom = values[2] || values[0];\n dirs.left = values[3] || values[1] || values[0];\n } else {\n directions.forEach((dir, i) => {\n dirs[dir] = values[i] ?? values[0];\n });\n }\n}\n\n/**\n * Optimize margin output shorthand.\n */\nfunction optimizeMargin(dirs: Record<Direction, string>): {\n margin: string;\n} {\n const { top, right, bottom, left } = dirs;\n if (top === right && right === bottom && bottom === left) {\n return { margin: top };\n }\n if (top === bottom && left === right) {\n return { margin: `${top} ${left}` };\n }\n return { margin: `${top} ${right} ${bottom} ${left}` };\n}\n\nexport function marginStyle({\n margin,\n marginBlock,\n marginInline,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n}: {\n margin?: string | number | boolean;\n marginBlock?: string | number | boolean;\n marginInline?: string | number | boolean;\n marginTop?: string | number | boolean;\n marginRight?: string | number | boolean;\n marginBottom?: string | number | boolean;\n marginLeft?: string | number | boolean;\n}) {\n if (\n margin == null &&\n marginBlock == null &&\n marginInline == null &&\n marginTop == null &&\n marginRight == null &&\n marginBottom == null &&\n marginLeft == null\n ) {\n return {};\n }\n\n const dirs: Record<Direction, string> = {\n top: '0',\n right: '0',\n bottom: '0',\n left: '0',\n };\n\n // Priority 1 (lowest): margin\n if (margin != null) {\n if (typeof margin === 'number') {\n const v = `${margin}px`;\n dirs.top = dirs.right = dirs.bottom = dirs.left = v;\n } else if (margin === true) {\n margin = '1x';\n }\n\n if (typeof margin === 'string' && margin) {\n const processed = parseStyle(margin);\n const groups = processed.groups ?? [];\n\n for (const group of groups) {\n const { values, directions } = extractGroupData(group);\n applyGroup(dirs, values, directions);\n }\n }\n }\n\n // Priority 2 (medium): marginBlock/marginInline\n if (marginBlock != null) {\n const val = parseMarginValue(marginBlock);\n if (val) dirs.top = dirs.bottom = val;\n }\n if (marginInline != null) {\n const val = parseMarginValue(marginInline);\n if (val) dirs.left = dirs.right = val;\n }\n\n // Priority 3 (highest): individual directions\n if (marginTop != null) {\n const val = parseMarginValue(marginTop);\n if (val) dirs.top = val;\n }\n if (marginRight != null) {\n const val = parseMarginValue(marginRight);\n if (val) dirs.right = val;\n }\n if (marginBottom != null) {\n const val = parseMarginValue(marginBottom);\n if (val) dirs.bottom = val;\n }\n if (marginLeft != null) {\n const val = parseMarginValue(marginLeft);\n if (val) dirs.left = val;\n }\n\n return optimizeMargin(dirs);\n}\n\nmarginStyle.__lookupStyles = [\n 'margin',\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'marginBlock',\n 'marginInline',\n];\n"],"mappings":";;;;;AAQA,SAAS,iBAAiB,OAAiD;AACzE,KAAI,OAAO,UAAU,SAAU,QAAO,GAAG,MAAM;AAC/C,KAAI,CAAC,MAAO,QAAO;AACnB,KAAI,UAAU,KAAM,SAAQ;CAE5B,MAAM,EAAE,WAAW,WAAW,MAAM,CAAC,OAAO,MAAM,EAAE,QAAQ,EAAE,EAAE;AAEhE,QAAO,OAAO,MAAM;;;;;AAMtB,SAAS,iBAAiB,OAGxB;CACA,MAAM,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK;AACnC,QAAO;EACL,QAAQ,OAAO,SAAS,SAAS,CAAC,aAAa;EAC/C,YAAY,WAAW,MAAM,W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;EACvB,MAAM,MAAM,iBAAiB,YAAY;AACzC,MAAI,IAAK,MAAK,MAAM,KAAK,SAAS;;AAEpC,KAAI,gBAAgB,MAAM;EACxB,MAAM,MAAM,iBAAiB,aAAa;AAC1C,MAAI,IAAK,MAAK,OAAO,KAAK,QAAQ;;AAIpC,KAAI,aAAa,MAAM;EACrB,MAAM,MAAM,iBAAiB,UAAU;AACvC,MAAI,IAAK,MAAK,MAAM;;AAEtB,KAAI,eAAe,MAAM;EACvB,MAAM,MAAM,iBAAiB,YAAY;AACzC,MAAI,IAAK,MAAK,QAAQ;;AAExB,KAAI,gBAAgB,MAAM;EACxB,MAAM,MAAM,iBAAiB,aAAa;AAC1C,MAAI,IAAK,MAAK,SAAS;;AAEzB,KAAI,cAAc,MAAM;EACtB,MAAM,MAAM,iBAAiB,WAAW;AACxC,MAAI,IAAK,MAAK,OAAO;;AAGvB,QAAO,eAAe,KAAK;;AAG7B,YAAY,iBAAiB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -1,29 +0,0 @@
1
- //#region src/styles/outline.d.ts
2
- interface OutlineStyleProps {
3
- outline?: string | boolean | number;
4
- outlineOffset?: string | number;
5
- }
6
- /**
7
- * Generates CSS for outline property with optional offset.
8
- *
9
- * Syntax:
10
- * - `outline="2px solid #red"` - outline only
11
- * - `outline="2px solid #red / 4px"` - outline with offset (slash separator)
12
- * - `outline="2px / 4px"` - width with offset (simpler form)
13
- * - `outline={true}` - default 1ow solid outline
14
- * - `outlineOffset="4px"` - offset as separate prop (can be combined with outline)
15
- *
16
- * Priority: slash syntax in outline takes precedence over outlineOffset prop
17
- *
18
- * @return CSS properties for outline and optionally outline-offset
19
- */
20
- declare function outlineStyle({
21
- outline,
22
- outlineOffset
23
- }: OutlineStyleProps): Record<string, string> | undefined;
24
- declare namespace outlineStyle {
25
- var __lookupStyles: string[];
26
- }
27
- //#endregion
28
- export { outlineStyle };
29
- //# sourceMappingURL=outline.d.ts.map
@@ -1,64 +0,0 @@
1
- import { filterMods, parseStyle } from "../utils/styles.js";
2
- //#region src/styles/outline.ts
3
- const BORDER_STYLES = [
4
- "none",
5
- "hidden",
6
- "dotted",
7
- "dashed",
8
- "solid",
9
- "double",
10
- "groove",
11
- "ridge",
12
- "inset",
13
- "outset"
14
- ];
15
- /**
16
- * Generates CSS for outline property with optional offset.
17
- *
18
- * Syntax:
19
- * - `outline="2px solid #red"` - outline only
20
- * - `outline="2px solid #red / 4px"` - outline with offset (slash separator)
21
- * - `outline="2px / 4px"` - width with offset (simpler form)
22
- * - `outline={true}` - default 1ow solid outline
23
- * - `outlineOffset="4px"` - offset as separate prop (can be combined with outline)
24
- *
25
- * Priority: slash syntax in outline takes precedence over outlineOffset prop
26
- *
27
- * @return CSS properties for outline and optionally outline-offset
28
- */
29
- function outlineStyle({ outline, outlineOffset }) {
30
- const result = {};
31
- if (outline != null && outline !== false) {
32
- let outlineValue = outline;
33
- if (outline === true) outlineValue = "1ow";
34
- if (outline === 0) outlineValue = "0";
35
- const group = parseStyle(String(outlineValue)).groups[0];
36
- if (group) {
37
- const { parts } = group;
38
- const outlinePart = parts[0] ?? {
39
- values: [],
40
- mods: [],
41
- colors: []
42
- };
43
- const offsetPart = parts[1];
44
- const typeMods = filterMods(outlinePart.mods, BORDER_STYLES);
45
- result["outline"] = [
46
- outlinePart.values[0] || "var(--outline-width)",
47
- typeMods[0] || "solid",
48
- outlinePart.colors[0] || "var(--outline-color)"
49
- ].join(" ");
50
- if (offsetPart?.values[0]) result["outline-offset"] = offsetPart.values[0];
51
- }
52
- }
53
- if (outlineOffset != null && !result["outline-offset"]) {
54
- const offsetValue = typeof outlineOffset === "number" ? `${outlineOffset}px` : outlineOffset;
55
- result["outline-offset"] = parseStyle(offsetValue).groups[0]?.values[0] || offsetValue;
56
- }
57
- if (Object.keys(result).length === 0) return;
58
- return result;
59
- }
60
- outlineStyle.__lookupStyles = ["outline", "outlineOffset"];
61
- //#endregion
62
- export { outlineStyle };
63
-
64
- //# sourceMappingURL=outline.js.map