stillwind 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/css/builtin-variants/sw-conditional.css +10 -1
  3. package/css/builtin-variants/tw-relationship.css +4 -4
  4. package/css/builtins.css +1 -1
  5. package/dist/{class-object-D7ZGJOf_.d.ts → class-object-BaK8uudd.d.ts} +2 -2
  6. package/dist/class-object-DNcjzcfH.js +6 -0
  7. package/dist/{class-object-D24FFYqO.js.map → class-object-DNcjzcfH.js.map} +1 -1
  8. package/dist/{class-string-CQHnc9GN.d.ts → class-string-C5YFtXQn.d.ts} +2 -2
  9. package/dist/class-string-KnYInbiw.js +6 -0
  10. package/dist/{class-string-Db8-oI4q.js.map → class-string-KnYInbiw.js.map} +1 -1
  11. package/dist/{cva-BwX07CFw.js → formats-Ctf2WFc-.js} +87 -2
  12. package/dist/formats-Ctf2WFc-.js.map +1 -0
  13. package/dist/formats-aeLCNAXl.d.ts +73 -0
  14. package/dist/frameworks/alpine.d.ts +3 -3
  15. package/dist/frameworks/alpine.js +1 -1
  16. package/dist/frameworks/alpine.js.map +1 -1
  17. package/dist/frameworks/astro.d.ts +3 -3
  18. package/dist/frameworks/astro.js +1 -1
  19. package/dist/frameworks/lit.d.ts +3 -3
  20. package/dist/frameworks/lit.js +1 -1
  21. package/dist/frameworks/lit.js.map +1 -1
  22. package/dist/frameworks/preact.d.ts +3 -3
  23. package/dist/frameworks/preact.js +1 -1
  24. package/dist/frameworks/qwik.d.ts +3 -3
  25. package/dist/frameworks/qwik.js +1 -1
  26. package/dist/frameworks/react.d.ts +2 -2
  27. package/dist/frameworks/react.js +1 -1
  28. package/dist/frameworks/solid.d.ts +3 -3
  29. package/dist/frameworks/solid.js +1 -1
  30. package/dist/frameworks/svelte.d.ts +3 -3
  31. package/dist/frameworks/svelte.js +1 -1
  32. package/dist/frameworks/vanilla.d.ts +3 -3
  33. package/dist/frameworks/vanilla.js +1 -1
  34. package/dist/frameworks/vue.d.ts +3 -3
  35. package/dist/frameworks/vue.js +1 -1
  36. package/dist/{index-RwVFpxhE.d.ts → index-DBpgaaD7.d.ts} +54 -5
  37. package/dist/macro/index.d.ts +2 -2
  38. package/dist/macro/index.js +1 -1
  39. package/dist/runtime/development.d.ts +47 -0
  40. package/dist/{development-J-JCSIm0.js → runtime/development.js} +41 -5
  41. package/dist/runtime/development.js.map +1 -0
  42. package/dist/runtime/index.d.ts +2 -0
  43. package/dist/runtime/index.js +1 -0
  44. package/dist/{style-fTQbsVWZ.js → style-BE8vuLiO.js} +4 -1
  45. package/dist/style-BE8vuLiO.js.map +1 -0
  46. package/docs/at-rules/apply.md +5 -5
  47. package/docs/at-rules/custom-variant.md +12 -12
  48. package/docs/at-rules/index.md +19 -19
  49. package/docs/at-rules/plugin.md +7 -7
  50. package/docs/at-rules/registry-directives.md +9 -9
  51. package/docs/at-rules/slot.md +6 -6
  52. package/docs/at-rules/stillwind-css-template.md +7 -7
  53. package/docs/at-rules/stillwind-property.md +10 -10
  54. package/docs/at-rules/stillwind-registry.md +18 -18
  55. package/docs/at-rules/stillwind-require-properties.md +9 -9
  56. package/docs/at-rules/stillwind-slot.md +6 -6
  57. package/docs/at-rules/stillwind-undef-arbitrary-property.md +9 -9
  58. package/docs/at-rules/stillwind-undef-utility.md +10 -10
  59. package/docs/at-rules/stillwind-undef-variant.md +6 -6
  60. package/docs/at-rules/theme.md +23 -23
  61. package/docs/at-rules/utility.md +30 -30
  62. package/docs/at-rules/variant.md +6 -6
  63. package/docs/cli.md +11 -8
  64. package/docs/concepts/css-ordering.md +19 -19
  65. package/docs/concepts/how-styles-compile.md +17 -17
  66. package/docs/concepts/stylesheets.md +4 -4
  67. package/docs/configuration.md +34 -34
  68. package/docs/editors.md +9 -8
  69. package/docs/errors/SW01003.md +1 -1
  70. package/docs/errors/SW10001.md +1 -1
  71. package/docs/errors/SW10002.md +1 -1
  72. package/docs/errors/SW10004.md +7 -6
  73. package/docs/errors/SW10005.md +1 -1
  74. package/docs/errors/SW11001.md +1 -1
  75. package/docs/errors/SW11003.md +1 -1
  76. package/docs/errors/SW12001.md +2 -2
  77. package/docs/errors/SW12002.md +1 -1
  78. package/docs/errors/SW13001.md +1 -1
  79. package/docs/errors/SW13003.md +2 -2
  80. package/docs/errors/SW14001.md +1 -1
  81. package/docs/errors/SW14003.md +4 -4
  82. package/docs/errors/SW14004.md +2 -2
  83. package/docs/errors/SW14005.md +1 -1
  84. package/docs/errors/SW14006.md +1 -1
  85. package/docs/errors/SW14007.md +2 -2
  86. package/docs/errors/SW14008.md +1 -1
  87. package/docs/errors/SW30001.md +1 -1
  88. package/docs/errors/SW31001.md +1 -1
  89. package/docs/errors/SW31004.md +1 -1
  90. package/docs/errors/SW33005.md +1 -1
  91. package/docs/errors/SW34002.md +1 -1
  92. package/docs/errors/SW90001.md +1 -1
  93. package/docs/errors/SW90005.md +1 -1
  94. package/docs/errors/SW90006.md +1 -1
  95. package/docs/errors/index.md +72 -72
  96. package/docs/formatters.md +5 -5
  97. package/docs/guides/animations.md +7 -8
  98. package/docs/guides/design-systems.md +7 -7
  99. package/docs/guides/element-relationships.md +15 -19
  100. package/docs/guides/lint-adoption.md +5 -5
  101. package/docs/guides/migrating-from-css.md +11 -11
  102. package/docs/guides/migrating-from-tailwind.md +16 -16
  103. package/docs/guides/recommended-practices.md +18 -18
  104. package/docs/guides/responsive-styles.md +7 -7
  105. package/docs/guides/reusable-styles.md +10 -5
  106. package/docs/guides/runtime-conditions.md +6 -6
  107. package/docs/guides/style.md +42 -10
  108. package/docs/guides/tailwind-compatibility.md +23 -22
  109. package/docs/guides/view-transitions.md +9 -11
  110. package/docs/guides/web-components.md +4 -4
  111. package/docs/index.md +14 -12
  112. package/docs/integrations.md +3 -3
  113. package/docs/lints/ambiguous-style-base-order.md +4 -2
  114. package/docs/lints/bypassed-undefinition.md +3 -3
  115. package/docs/lints/clamped-value.md +1 -1
  116. package/docs/lints/conflicting-provider-properties.md +2 -2
  117. package/docs/lints/conflicting-utilities.md +45 -3
  118. package/docs/lints/document-scoped-selector.md +1 -1
  119. package/docs/lints/duplicate-definition.md +3 -3
  120. package/docs/lints/duplicate-utility.md +2 -2
  121. package/docs/lints/duplicate-view-transition-name.md +3 -3
  122. package/docs/lints/ignored-definition-condition.md +2 -2
  123. package/docs/lints/ignored-tailwind-feature.md +3 -3
  124. package/docs/lints/implicit-nesting-selector.md +2 -2
  125. package/docs/lints/incompatible-property-value.md +3 -3
  126. package/docs/lints/incompatible-theme-value.md +1 -1
  127. package/docs/lints/index.md +74 -73
  128. package/docs/lints/ineffective-anchor-scope.md +2 -2
  129. package/docs/lints/interfering-imported-style-base.md +22 -4
  130. package/docs/lints/invalid-animation-option.md +3 -3
  131. package/docs/lints/invalid-css-directive.md +3 -3
  132. package/docs/lints/invalid-css-import.md +2 -2
  133. package/docs/lints/invalid-css-input.md +4 -4
  134. package/docs/lints/invalid-cva-config.md +2 -2
  135. package/docs/lints/invalid-cva-input.md +4 -4
  136. package/docs/lints/invalid-keyframes-definition.md +2 -2
  137. package/docs/lints/invalid-keyframes-use.md +2 -2
  138. package/docs/lints/invalid-keyframes-variant.md +4 -4
  139. package/docs/lints/invalid-lint-suppression.md +3 -3
  140. package/docs/lints/invalid-marker-use.md +2 -2
  141. package/docs/lints/invalid-media-query.md +4 -4
  142. package/docs/lints/invalid-ref-input.md +4 -4
  143. package/docs/lints/invalid-rule-group-input.md +2 -2
  144. package/docs/lints/invalid-runtime-condition.md +3 -3
  145. package/docs/lints/invalid-stored-variant.md +52 -0
  146. package/docs/lints/invalid-style-composition.md +2 -2
  147. package/docs/lints/invalid-style-input.md +2 -2
  148. package/docs/lints/invalid-theme-reference.md +3 -3
  149. package/docs/lints/invalid-utility.md +3 -3
  150. package/docs/lints/invalid-variant.md +2 -2
  151. package/docs/lints/invalid-view-transition-definition.md +2 -2
  152. package/docs/lints/invalid-view-transition-use.md +2 -2
  153. package/docs/lints/invalid-view-transition-variant.md +3 -3
  154. package/docs/lints/mismatched-framework-import.md +3 -3
  155. package/docs/lints/missing-document-target.md +2 -2
  156. package/docs/lints/missing-ref-attachment.md +4 -4
  157. package/docs/lints/missing-view-transition-name.md +3 -3
  158. package/docs/lints/mutating-macro-argument.md +2 -2
  159. package/docs/lints/no-arbitrary-breakpoints.md +2 -2
  160. package/docs/lints/no-arbitrary-colors.md +2 -2
  161. package/docs/lints/no-arbitrary-spacing.md +1 -1
  162. package/docs/lints/no-class-property.md +3 -3
  163. package/docs/lints/no-important.md +2 -2
  164. package/docs/lints/no-restricted-declarations.md +1 -1
  165. package/docs/lints/no-restricted-length-units.md +1 -1
  166. package/docs/lints/no-restricted-theme-tokens.md +1 -1
  167. package/docs/lints/no-restricted-utilities.md +2 -2
  168. package/docs/lints/prefer-canonical-utilities.md +2 -2
  169. package/docs/lints/prefer-direct-styling.md +3 -3
  170. package/docs/lints/prefer-logical-properties.md +3 -3
  171. package/docs/lints/prefer-sorted-utilities.md +2 -2
  172. package/docs/lints/prefer-typed-relationships.md +3 -3
  173. package/docs/lints/prefer-typed-variables.md +1 -1
  174. package/docs/lints/prefer-variant-directive.md +3 -3
  175. package/docs/lints/redundant-variant.md +2 -2
  176. package/docs/lints/repeated-nesting-selector.md +2 -2
  177. package/docs/lints/runtime-condition-requires-css-if.md +3 -3
  178. package/docs/lints/split-view-transition-class.md +3 -3
  179. package/docs/lints/suspending-macro-argument.md +2 -2
  180. package/docs/lints/unknown-utility.md +4 -4
  181. package/docs/lints/unknown-variant.md +2 -2
  182. package/docs/lints/unmatched-host-selector.md +2 -2
  183. package/docs/lints/unsatisfiable-variants.md +1 -1
  184. package/docs/lints/unused-lint-suppression.md +1 -1
  185. package/docs/lints/unverified-style-base.md +2 -2
  186. package/docs/macros/anchor-scope.md +13 -13
  187. package/docs/macros/css.md +7 -7
  188. package/docs/macros/cva.md +17 -16
  189. package/docs/macros/index.md +10 -9
  190. package/docs/macros/keyframes.md +9 -9
  191. package/docs/macros/media.md +2 -2
  192. package/docs/macros/ref/as-anchor.md +11 -11
  193. package/docs/macros/ref/as-container.md +8 -8
  194. package/docs/macros/ref/at.md +10 -10
  195. package/docs/macros/ref/condition.md +9 -8
  196. package/docs/macros/ref/in.md +11 -11
  197. package/docs/macros/ref/index.md +17 -16
  198. package/docs/macros/ref/position-anchor.md +9 -9
  199. package/docs/macros/style.md +53 -27
  200. package/docs/macros/view-transition.md +17 -17
  201. package/docs/macros/when.md +129 -0
  202. package/docs/plugins/iconify.md +5 -5
  203. package/docs/plugins/index.md +4 -4
  204. package/docs/utilities-and-variants.md +6 -6
  205. package/docs/why.md +13 -15
  206. package/package.json +14 -28
  207. package/dist/class-object-D24FFYqO.js +0 -6
  208. package/dist/class-string-Db8-oI4q.js +0 -6
  209. package/dist/cva-BwX07CFw.js.map +0 -1
  210. package/dist/cva-DSpDNBYi.d.ts +0 -9
  211. package/dist/development-DttPQc71.d.ts +0 -27
  212. package/dist/development-J-JCSIm0.js.map +0 -1
  213. package/dist/runtime/class-name-object-development.d.ts +0 -10
  214. package/dist/runtime/class-name-object-development.js +0 -18
  215. package/dist/runtime/class-name-object-development.js.map +0 -1
  216. package/dist/runtime/class-name-object.d.ts +0 -16
  217. package/dist/runtime/class-name-object.js +0 -31
  218. package/dist/runtime/class-name-object.js.map +0 -1
  219. package/dist/runtime/class-object-development.d.ts +0 -10
  220. package/dist/runtime/class-object-development.js +0 -18
  221. package/dist/runtime/class-object-development.js.map +0 -1
  222. package/dist/runtime/class-object.d.ts +0 -16
  223. package/dist/runtime/class-object.js +0 -31
  224. package/dist/runtime/class-object.js.map +0 -1
  225. package/dist/runtime/class-string-development.d.ts +0 -10
  226. package/dist/runtime/class-string-development.js +0 -18
  227. package/dist/runtime/class-string-development.js.map +0 -1
  228. package/dist/runtime/class-string.d.ts +0 -16
  229. package/dist/runtime/class-string.js +0 -31
  230. package/dist/runtime/class-string.js.map +0 -1
  231. package/dist/shared-B9IQXU6P.d.ts +0 -32
  232. package/dist/style-fTQbsVWZ.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,193 @@
1
+ # stillwind
2
+
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Astro components are now converted to TSX for analysis with `@astrojs/astro2tsx`, the converter that the Astro language server uses, instead of `@astrojs/compiler`. For Astro support, install `@astrojs/astro2tsx` `^0.1.4`. Stillwind no longer uses `@astrojs/compiler`.
8
+
9
+ Analysis now finds frontmatter in the same places as the Astro 7 build. A `---` fence that follows template text, such as an HTML comment, is template text and does not start frontmatter.
10
+
11
+ - Type facts now come from [tsrs](https://github.com/oxc-project/tsrs), a Rust port of the TypeScript 7.1 beta checker, instead of TypeScript 7.0. Edits that need type information finish faster. Stillwind no longer installs `typescript` 7.
12
+
13
+ ### Patch Changes
14
+
15
+ - Update Tailwind CSS compatibility to 4.3.5, preserve empty variable fallbacks, and improve group and peer selectors and Safari property fallbacks.
16
+
17
+ - Documentation examples now declare component-specific refs, keyframes, and view transitions inside the component that uses them.
18
+
19
+ - Each published npm package and the VS Code extension now include `CHANGELOG.md`, so you can read the release notes of the installed version in `node_modules` or on the extension page.
20
+
21
+ - Updated dependencies:
22
+ - @stillwind/config@0.9.0
23
+ - @stillwind/native@0.9.0
24
+ - @stillwind/projection@0.9.0
25
+
26
+ ## 0.8.0
27
+
28
+ ### Minor Changes
29
+
30
+ - `conflicting-utilities` findings now explain the overlap. When the utilities are a shorthand and a longhand that it covers, such as `m-0 mb-4`, a note names the `allowShorthandOverrides` option. When a physical and a logical property overlap only in some writing modes, such as `px-2 pt-2`, a note names their logical group.
31
+
32
+ - When a physical utility conflicts with a logical utility, the `conflicting-utilities` finding shows how to use logical properties for both: it names a logical utility from your design system that writes the same value, such as `ms-4` for `ml-4` in `mx-auto ml-4`. When `writingModes` includes a vertical writing mode, as in the `stylistic` preset, it also names `pbs-2` for `pt-2` in `px-2 pt-2`. The suggestion uses the sides of horizontal left-to-right writing modes, appears only when `writingModes` includes `horizontal-tb`, and does not recommend logical properties over physical ones.
33
+
34
+ - Compiled code now imports its helpers from `stillwind/runtime`, or from `stillwind/runtime/development` in development builds. A module that uses several frameworks' macros imports each shared helper once. The `stillwind/runtime/class-object`, `stillwind/runtime/class-string`, `stillwind/runtime/class-name-object`, and matching `-development` entrypoints are removed. Recompile code that was compiled with an earlier version, because it imports these removed entrypoints.
35
+
36
+ - Add `style.when(variants)`, which stores a variant sequence such as `card("hover").in(list)`, `card.at("width >= 40rem")`, or `"hover:md"` in a variable. Use the variable as a computed key in `style()`, as a variant segment in a utility template, or in another `style.when()`, so several elements can share a ref condition without repeating it. Stored variants can be exported and imported. The new `invalid-stored-variant` lint rule reports an argument that is not a variant sequence and a use that can refer to several stored variants.
37
+
38
+ - Add the `or(...)` variant, which applies a utility when any of its comma-separated variant sequences matches. `or(hover,md:focus):p-4` means `hover:p-4 md:focus:p-4`, so each sequence keeps its own CSS order and lint findings. It works in utility strings, object keys of `style()` and `style.css()`, ref conditions such as `card("or(hover,focus-within)")`, and view-transition definitions. Design systems can declare the same behavior under another name with `@stillwind-variant name\(*\) (value: [variant-list]) { @stillwind-intrinsic builtin-or-variant; }`. `style.when()` now accepts several arguments and stores them as alternatives, which can include ref conditions and container queries, such as `style.when("hover", card("focus-within"))`.
39
+
40
+ - Export `StyleResultOf` from each framework entrypoint, such as `stillwind/react`. TypeScript can now emit declaration files for modules that export a `style()` result, for example with `declaration: true` or the `dts` option of `vp pack`. Before, this failed with TS2883 because the type of the result could not be named from a public entrypoint.
41
+
42
+ - `conflicting-utilities` has a `writingModes` option that lists the writing modes in which a physical utility and a logical utility are compared: `horizontal-tb`, `vertical-rl`, and `vertical-lr`. The default is `["horizontal-tb"]`, so `px-2 pt-2` is no longer reported, because the two utilities set different sides in horizontal text. `mx-auto ml-4` is still reported. The `stylistic` preset lists all three writing modes. Add `vertical-rl` or `vertical-lr` if your pages use vertical text.
43
+
44
+ ### Patch Changes
45
+
46
+ - `conflicting-utilities` no longer reports a font size utility together with a `leading-*` utility, such as `text-sm leading-relaxed`. The font size utility reads the line height that the `leading-*` utility sets, so the result does not depend on their order.
47
+
48
+ - `ambiguous-style-base-order` and `interfering-imported-style-base` findings now include a note that reordering the `style()` arguments does not change which declaration wins. Fix these findings by building the overriding style on the other style or by removing the property from one of them.
49
+
50
+ - `conflicting-utilities` no longer reports a side utility together with a style utility that sets its style, such as `border-t border-dashed` or `divide-y divide-dashed`. The result of these pairs does not depend on their order.
51
+
52
+ - Updated dependencies:
53
+ - @stillwind/config@0.8.0
54
+ - @stillwind/native@0.8.0
55
+ - @stillwind/projection@0.8.0
56
+
57
+ ## 0.7.0
58
+
59
+ ### Minor Changes
60
+
61
+ - `style.css()` now returns a minified stylesheet without the Stillwind and Tailwind license comments, so the strings in your bundle are smaller. The string still applies the same styles.
62
+
63
+ ### Patch Changes
64
+
65
+ - Rules that a Tailwind CSS JavaScript plugin nests inside `@scope` within a selector, such as `@scope (&)`, now stay inside the `@scope` block, as the same rules in a CSS `@utility` do. Previously, each nested selector moved into the `@scope` prelude, so a selector that used `:scope` matched the document root instead of the scoping root and the rule never applied. For example, daisyUI's `join` lost the radius of its outer corners.
66
+
67
+ A plugin that passes `addUtilities()` or `addComponents()` an `@scope` rule outside any selector, such as `{ "@scope (.theme)": { ".item": { … } } }`, now fails with an error. Previously, Stillwind generated CSS that styled other elements than Tailwind CSS does, without a diagnostic.
68
+
69
+ - Astro components whose frontmatter ends with a `//` line comment now pass `stillwind lint` and the build. Previously, such components failed with SW31005 ("Astro frontmatter coordinates do not match source"), so a trailing comment such as `// TODO` or a tool directive could fail the whole site build.
70
+
71
+ - The npm package page now shows that each package includes TypeScript declarations. Packages without a root JavaScript entry declare an empty root module, so TypeScript setups that ignore `exports` report a missing export instead of resolving unrelated types.
72
+
73
+ - Updated dependencies:
74
+ - @stillwind/config@0.7.0
75
+ - @stillwind/native@0.7.0
76
+ - @stillwind/projection@0.7.0
77
+
78
+ ## 0.6.0
79
+
80
+ ### Minor Changes
81
+
82
+ - An `@import` inside a style rule, or inside a `@layer`, `@supports`, `@media`, or other conditional group, now inlines the imported stylesheet in place, as Tailwind CSS v4 does. For example, `.widget { @import "stillwind/preflight.css"; }` applies the reset only to the descendants of `.widget`. Previously, the compiled CSS kept the raw `@import`, and browsers ignored it. Only plain CSS can be imported inside a style rule: when the imported file or its imports contain a definition, `@stillwind-slot`, or a `@layer` statement, such as `stillwind` itself, the import is left out. `invalid-css-import` reports that import and an unresolved nested import at their source locations.
83
+
84
+ A definition such as `@utility` or `@theme`, a Tailwind statement such as `@plugin`, or a `@layer` statement written inside a style rule is now ignored and reported by `invalid-css-directive`. Previously, a nested `@utility` was registered while a nested `@theme` was not, the raw at-rules stayed in the compiled CSS, and a nested `@layer` statement failed the build with a parse error.
85
+
86
+ ### Patch Changes
87
+
88
+ - The migration guides now describe how to check a migration: compare the computed styles of the migrated components in the old and new builds with a browser console function. The `migrate-to-stillwind` skill now asks agents to run this comparison for each theme and breakpoint and to report each difference.
89
+
90
+ - A `@variant` block in the body of a `@utility` now applies its variants, as it does in a style rule. Directly in the body, the variants apply to the element that uses the utility. Inside a nested rule, they apply to that rule's selector. Previously, the compiled CSS kept the raw `@variant` rule, and browsers ignored those styles. `prefer-variant-directive` now also reports conditions in `@utility` bodies that a variant can replace.
91
+
92
+ - The packages now have npm keywords, so the npm search, the Astro integrations library, and other directories that read `keywords` can find them by the frameworks, build tools, and editors that they support. Each package description now states what the package does and which tools it supports.
93
+
94
+ - Updated dependencies:
95
+ - @stillwind/config@0.6.0
96
+ - @stillwind/native@0.6.0
97
+ - @stillwind/projection@0.6.0
98
+
99
+ ## 0.5.0
100
+
101
+ ### Patch Changes
102
+
103
+ - Updated dependencies:
104
+ - @stillwind/config@0.5.0
105
+ - @stillwind/native@0.5.0
106
+ - @stillwind/projection@0.5.0
107
+
108
+ ## 0.4.1
109
+
110
+ ### Patch Changes
111
+
112
+ - This release publishes the changes listed for 0.4.0. Version 0.4.0 was not published to npm or the VS Code extension marketplaces.
113
+
114
+ - Updated dependencies:
115
+ - @stillwind/config@0.4.1
116
+ - @stillwind/native@0.4.1
117
+ - @stillwind/projection@0.4.1
118
+
119
+ ## 0.4.0
120
+
121
+ ### Patch Changes
122
+
123
+ - Arbitrary properties that use `--if()`, such as `[color:--if(--on,red,blue)]`, no longer report `incompatible-property-value` when the property accepts both branches. The rule still reports a branch that the property rejects.
124
+
125
+ - `if()` variants now work in `style.css()`. The returned string no longer contains an internal at-rule that kept browsers from applying the conditional rule.
126
+
127
+ - Variants that test a shadow host now match. `host:hover:`, `hover:` with `selector: ":host"`, and `@apply hover:flex` inside `:host` generate `:host()` forms that browsers accept. The new `unmatched-host-selector` rule reports variants such as `host:in-[.page]:`, which read elements outside the shadow tree and cannot match.
128
+
129
+ - Arbitrary properties whose name is not a CSS property name, such as `[&:focus]`, `[:focus]`, and `[1:2]`, now report `invalid-utility` and emit no CSS. Add a utility after a variant, as in `[&:focus]:flex`, to style with a selector.
130
+
131
+ - The license comment at the start of generated CSS now shows the installed Stillwind version.
132
+
133
+ - The bundled `docs/utilities.md` page is now `docs/utilities-and-variants.md`, and the website page moved to `/docs/utilities-and-variants`. The lookup on the website page now also finds variants by name or by part of their CSS, such as `:hover` or `media hover`.
134
+
135
+ - Updated dependencies:
136
+ - @stillwind/config@0.4.0
137
+ - @stillwind/native@0.4.0
138
+ - @stillwind/projection@0.4.0
139
+
140
+ ## 0.3.0
141
+
142
+ ### Minor Changes
143
+
144
+ - The `recommended` preset now reports `unknown-utility` and `unknown-variant` as errors, so `stillwind lint` fails on a misspelled utility or variant. Set a rule to `warn` in `lint.rules` to keep the previous severity.
145
+
146
+ `prefer-explicit-nesting-selector` is now `implicit-nesting-selector`, and its category changes from `style` to `hazard`. Update the rule name in `lint.rules` and in `swlint-*` comments.
147
+
148
+ ### Patch Changes
149
+
150
+ - Updated dependencies:
151
+ - @stillwind/config@0.3.0
152
+ - @stillwind/native@0.3.0
153
+ - @stillwind/projection@0.3.0
154
+
155
+ ## 0.2.0
156
+
157
+ ### Minor Changes
158
+
159
+ - The editor now finds the nearest `stillwind.config.*` from each opened file, so a monorepo works without a configuration file at its root.
160
+
161
+ - Reference configuration files, directories, and globs from `projects`, so each package in a monorepo can keep its own `stillwind.config.ts`.
162
+
163
+ - Import a file from `stillwind/logical/` after `stillwind` to make built-in axis utilities follow the writing direction, as `px-*` and `py-*` do. `overflow.css`, `overscroll.css`, `divide.css`, `snap.css`, and `resize.css` cover `overflow-x-*`, `overflow-y-*`, `overscroll-x-*`, `overscroll-y-*`, `divide-y-*`, `snap-x`, `snap-y`, `resize-x`, and `resize-y`. `prefer-logical-properties` no longer reports the `overflow`, `overscroll`, and `divide` utilities that these files change.
164
+
165
+ ### Patch Changes
166
+
167
+ - `prefer-canonical-utilities` no longer replaces one theme token with another that only has the same value, such as `w-96` with `w-sm`. Fixed values now prefer spacing multiples, such as `w-112` for `w-[448px]`, and stay as written when several unrelated named tokens match.
168
+
169
+ - `prefer-logical-properties` no longer reports a shorthand that gives both axes the same value, such as `overflow-hidden` or `truncate`, and it no longer reports `sr-only` or `not-sr-only`, whose declarations you cannot change. `no-restricted-length-units` also skips `sr-only` by default.
170
+
171
+ - The Linux native bindings now load on glibc 2.17 and later. They previously failed to load on systems older than glibc 2.35, such as Debian 11 and Red Hat Enterprise Linux 9.
172
+
173
+ - `prefer-logical-properties` now reports physical declarations that it previously missed: shorthands for some sides with any value, such as `[border-top:var(--border)]` and `[border-left-radius:1px]`, and shorthands with different values for each side, such as `[padding:var(--a)_1rem]` and `[size:10px_20px]`.
174
+
175
+ - The editor now shows a configuration error on the configuration file instead of on every open document.
176
+
177
+ - `prefer-canonical-utilities` no longer rewrites an arbitrary value that starts and ends with separate function calls, such as `grid-cols-[var(--sidebar)_minmax(0,1fr)]`, into broken classes. `stillwind lint --fix` now keeps these values as written.
178
+
179
+ - Updated dependencies:
180
+ - @stillwind/config@0.2.0
181
+ - @stillwind/native@0.2.0
182
+ - @stillwind/projection@0.2.0
183
+
184
+ ## 0.1.0
185
+
186
+ ### Patch Changes
187
+
188
+ - Release the first version of Stillwind.
189
+
190
+ - Updated dependencies:
191
+ - @stillwind/config@0.1.0
192
+ - @stillwind/native@0.1.0
193
+ - @stillwind/projection@0.1.0
@@ -1,5 +1,14 @@
1
- /* Built-in Stillwind conditional variant. */
1
+ /* Built-in Stillwind conditional variants. */
2
2
 
3
3
  @stillwind-variant if\(*\) (value: [if-condition]) {
4
4
  @stillwind-intrinsic builtin-if-variant;
5
5
  }
6
+
7
+ /*
8
+ `or(a,b)` holds when any of its variant sequences holds. The compiler expands a
9
+ candidate into one candidate for each sequence before it resolves variants, so each
10
+ sequence keeps its own position in the stylesheet.
11
+ */
12
+ @stillwind-variant or\(*\) (value: [variant-list]) {
13
+ @stillwind-intrinsic builtin-or-variant;
14
+ }
@@ -17,25 +17,25 @@
17
17
  }
18
18
 
19
19
  @stillwind-variant group-* (value: [variant]) {
20
- &:is(:where(.group):--value() *) {
20
+ :is(:where(.group):--value() &) {
21
21
  @slot;
22
22
  }
23
23
  }
24
24
 
25
25
  @stillwind-variant group-* (value: [variant], modifier: [class-identifier]) {
26
- &:is(:where(:--modifier(".group\/{modifier}")):--value() *) {
26
+ :is(:where(:--modifier(".group\/{modifier}")):--value() &) {
27
27
  @slot;
28
28
  }
29
29
  }
30
30
 
31
31
  @stillwind-variant peer-* (value: [variant]) {
32
- &:is(:where(.peer):--value() ~ *) {
32
+ :is(:where(.peer):--value() ~ &) {
33
33
  @slot;
34
34
  }
35
35
  }
36
36
 
37
37
  @stillwind-variant peer-* (value: [variant], modifier: [class-identifier]) {
38
- &:is(:where(:--modifier(".peer\/{modifier}")):--value() ~ *) {
38
+ :is(:where(:--modifier(".peer\/{modifier}")):--value() ~ &) {
39
39
  @slot;
40
40
  }
41
41
  }
package/css/builtins.css CHANGED
@@ -90,7 +90,7 @@ reach descendants. Keep this declaration slot inside the selector rule.
90
90
  */
91
91
 
92
92
  @layer properties {
93
- @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or
93
+ @supports (((-webkit-hyphens: none)) and (not (margin-trim: block))) or
94
94
  ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
95
95
  *,
96
96
  ::before,
@@ -1,4 +1,4 @@
1
- import { StyleMacro as StyleMacro$1, StyleResult as StyleResult$1 } from "./index-RwVFpxhE.js";
1
+ import { StyleMacro as StyleMacro$1, StyleResult as StyleResult$1 } from "./index-DBpgaaD7.js";
2
2
  export type StyleProps = {
3
3
  class?: string;
4
4
  style?: Record<string, string>;
@@ -6,4 +6,4 @@ export type StyleProps = {
6
6
  export type StyleResult<Id extends string = string> = StyleResult$1<Id, StyleProps>;
7
7
  export type StyleMacro = StyleMacro$1<StyleProps>;
8
8
  export declare const style: StyleMacro;
9
- //# sourceMappingURL=class-object-D7ZGJOf_.d.ts.map
9
+ //# sourceMappingURL=class-object-BaK8uudd.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { createStyleMacro } from "./style-BE8vuLiO.js";
2
+ // src/outputs/class-object.ts
3
+ const style = createStyleMacro();
4
+ export { style };
5
+
6
+ //# sourceMappingURL=class-object-DNcjzcfH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"class-object-D24FFYqO.js","names":[],"sources":["../src/outputs/class-object.ts"],"sourcesContent":["import type { StyleResult as Result } from \"../macro/output.ts\";\nimport { createStyleMacro } from \"../macro/style.ts\";\nimport type { StyleMacro as Macro } from \"../macro/style.ts\";\n\nexport type StyleProps = {\n class?: string;\n style?: Record<string, string>;\n};\n\nexport type StyleResult<Id extends string = string> = Result<Id, StyleProps>;\n\nexport type StyleMacro = Macro<StyleProps>;\n\nexport const style: StyleMacro = createStyleMacro<StyleProps>();\n"],"mappings":";;AAaA,MAAa,QAAoB,iBAA6B"}
1
+ {"version":3,"file":"class-object-DNcjzcfH.js","names":[],"sources":["../src/outputs/class-object.ts"],"sourcesContent":["import type { StyleResult as Result } from \"../macro/output.ts\";\nimport { createStyleMacro } from \"../macro/style.ts\";\nimport type { StyleMacro as Macro } from \"../macro/style.ts\";\n\nexport type StyleProps = {\n class?: string;\n style?: Record<string, string>;\n};\n\nexport type StyleResult<Id extends string = string> = Result<Id, StyleProps>;\n\nexport type StyleMacro = Macro<StyleProps>;\n\nexport const style: StyleMacro = createStyleMacro<StyleProps>();\n"],"mappings":";;AAaA,MAAa,QAAoB,iBAA6B"}
@@ -1,4 +1,4 @@
1
- import { StyleMacro as StyleMacro$1, StyleResult as StyleResult$1 } from "./index-RwVFpxhE.js";
1
+ import { StyleMacro as StyleMacro$1, StyleResult as StyleResult$1 } from "./index-DBpgaaD7.js";
2
2
  export type StyleProps = {
3
3
  class?: string;
4
4
  style?: string;
@@ -6,4 +6,4 @@ export type StyleProps = {
6
6
  export type StyleResult<Id extends string = string> = StyleResult$1<Id, StyleProps>;
7
7
  export type StyleMacro = StyleMacro$1<StyleProps>;
8
8
  export declare const style: StyleMacro;
9
- //# sourceMappingURL=class-string-CQHnc9GN.d.ts.map
9
+ //# sourceMappingURL=class-string-C5YFtXQn.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { createStyleMacro } from "./style-BE8vuLiO.js";
2
+ // src/outputs/class-string.ts
3
+ const style = createStyleMacro();
4
+ export { style };
5
+
6
+ //# sourceMappingURL=class-string-KnYInbiw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"class-string-Db8-oI4q.js","names":[],"sources":["../src/outputs/class-string.ts"],"sourcesContent":["import type { StyleResult as Result } from \"../macro/output.ts\";\nimport type { StyleMacro as Macro } from \"../macro/style.ts\";\nimport { createStyleMacro } from \"../macro/style.ts\";\n\nexport type StyleProps = {\n class?: string;\n style?: string;\n};\nexport type StyleResult<Id extends string = string> = Result<Id, StyleProps>;\nexport type StyleMacro = Macro<StyleProps>;\nexport const style: StyleMacro = createStyleMacro<StyleProps>();\n"],"mappings":";;AAUA,MAAa,QAAoB,iBAA6B"}
1
+ {"version":3,"file":"class-string-KnYInbiw.js","names":[],"sources":["../src/outputs/class-string.ts"],"sourcesContent":["import type { StyleResult as Result } from \"../macro/output.ts\";\nimport type { StyleMacro as Macro } from \"../macro/style.ts\";\nimport { createStyleMacro } from \"../macro/style.ts\";\n\nexport type StyleProps = {\n class?: string;\n style?: string;\n};\nexport type StyleResult<Id extends string = string> = Result<Id, StyleProps>;\nexport type StyleMacro = Macro<StyleProps>;\nexport const style: StyleMacro = createStyleMacro<StyleProps>();\n"],"mappings":";;AAUA,MAAa,QAAoB,iBAA6B"}
@@ -199,6 +199,91 @@ function createCva(options, base, config = {}, classes = stillwindClsx, merge =
199
199
  return merge(options, values);
200
200
  };
201
201
  }
202
- export { createCva, isObject, mergeFragments, serializeStyle, stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionName, toFragment };
202
+ // src/runtime/formats.ts
203
+ /**
204
+ * Fragment keys and production operations for each output format.
205
+ *
206
+ * Each format owns distinct symbol keys, so a fragment must be materialized by the format that
207
+ * created it. Export names start with the format name because all formats share one entrypoint.
208
+ */
209
+ const stillwindClassObjectClassKey = /* @__PURE__ */ Symbol("stillwind.class-object.class");
210
+ const stillwindClassObjectStyleKey = /* @__PURE__ */ Symbol("stillwind.class-object.style");
211
+ const stillwindClassObjectCustomPropertiesKey = /* @__PURE__ */ Symbol("stillwind.class-object.custom-properties");
212
+ const classObjectOptions = [
213
+ "class",
214
+ "object",
215
+ stillwindClassObjectClassKey,
216
+ stillwindClassObjectStyleKey,
217
+ stillwindClassObjectCustomPropertiesKey
218
+ ];
219
+ /** Materializes ordered fragments with `class` and object styles. */
220
+ function stillwindClassObjectMerge(...values) {
221
+ return mergeFragments(classObjectOptions, values);
222
+ }
223
+ /** Converts either class prop of a composition base to a class-only fragment. */
224
+ function stillwindClassObjectToFragment(value) {
225
+ return toFragment(classObjectOptions, value);
226
+ }
227
+ /** Returns the supplied style payload, or undefined for null or undefined. */
228
+ function stillwindClassObjectStyleValue(value) {
229
+ return value == null ? void 0 : serializeStyle(value, "object");
230
+ }
231
+ /** Selects compiled CVA values and returns fresh props with `class` and object styles. */
232
+ function stillwindClassObjectCva(base, config) {
233
+ return createCva(classObjectOptions, base, config);
234
+ }
235
+ const stillwindClassStringClassKey = /* @__PURE__ */ Symbol("stillwind.class-string.class");
236
+ const stillwindClassStringStyleKey = /* @__PURE__ */ Symbol("stillwind.class-string.style");
237
+ const stillwindClassStringCustomPropertiesKey = /* @__PURE__ */ Symbol("stillwind.class-string.custom-properties");
238
+ const classStringOptions = [
239
+ "class",
240
+ "string",
241
+ stillwindClassStringClassKey,
242
+ stillwindClassStringStyleKey,
243
+ stillwindClassStringCustomPropertiesKey
244
+ ];
245
+ /** Materializes ordered fragments with `class` and string styles. */
246
+ function stillwindClassStringMerge(...values) {
247
+ return mergeFragments(classStringOptions, values);
248
+ }
249
+ /** Converts either class prop of a composition base to a class-only fragment. */
250
+ function stillwindClassStringToFragment(value) {
251
+ return toFragment(classStringOptions, value);
252
+ }
253
+ /** Serializes object style declarations or preserves a string. Other inputs omit style. */
254
+ function stillwindClassStringStyleValue(value) {
255
+ return value == null ? void 0 : serializeStyle(value, "string");
256
+ }
257
+ /** Selects compiled CVA values and returns fresh props with `class` and string styles. */
258
+ function stillwindClassStringCva(base, config) {
259
+ return createCva(classStringOptions, base, config);
260
+ }
261
+ const stillwindClassNameObjectClassKey = /* @__PURE__ */ Symbol("stillwind.class-name-object.class");
262
+ const stillwindClassNameObjectStyleKey = /* @__PURE__ */ Symbol("stillwind.class-name-object.style");
263
+ const stillwindClassNameObjectCustomPropertiesKey = /* @__PURE__ */ Symbol("stillwind.class-name-object.custom-properties");
264
+ const classNameObjectOptions = [
265
+ "className",
266
+ "object",
267
+ stillwindClassNameObjectClassKey,
268
+ stillwindClassNameObjectStyleKey,
269
+ stillwindClassNameObjectCustomPropertiesKey
270
+ ];
271
+ /** Materializes ordered fragments with `className` and object styles. */
272
+ function stillwindClassNameObjectMerge(...values) {
273
+ return mergeFragments(classNameObjectOptions, values);
274
+ }
275
+ /** Converts either class prop of a composition base to a class-only fragment. */
276
+ function stillwindClassNameObjectToFragment(value) {
277
+ return toFragment(classNameObjectOptions, value);
278
+ }
279
+ /** Returns the supplied style payload, or undefined for null or undefined. */
280
+ function stillwindClassNameObjectStyleValue(value) {
281
+ return value == null ? void 0 : serializeStyle(value, "object");
282
+ }
283
+ /** Selects compiled CVA values and returns fresh props with `className` and object styles. */
284
+ function stillwindClassNameObjectCva(base, config) {
285
+ return createCva(classNameObjectOptions, base, config);
286
+ }
287
+ export { classNameObjectOptions, classObjectOptions, classStringOptions, createCva, isObject, mergeFragments, stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectCva, stillwindClassNameObjectMerge, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectCva, stillwindClassObjectMerge, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringCva, stillwindClassStringMerge, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragment, stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionName, toFragment };
203
288
 
204
- //# sourceMappingURL=cva-BwX07CFw.js.map
289
+ //# sourceMappingURL=formats-Ctf2WFc-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats-Ctf2WFc-.js","names":[],"sources":["../src/runtime/fragment.ts","../src/runtime/shared.ts","../src/runtime/cva.ts","../src/runtime/formats.ts"],"sourcesContent":["/**\n * Framework conventions and private channels used to materialize fragments.\n * The three keys must be distinct and belong to the runtime that created the fragments.\n */\nexport type FragmentRuntimeOptions = readonly [\n /** Element prop that receives the combined class text. */\n classProperty: \"class\" | \"className\",\n /** Whether style records become objects or semicolon-separated declaration text. */\n styleFormat: \"object\" | \"string\",\n /** Own fragment property containing class text. */\n stillwindClassKey: symbol,\n /** Own fragment property containing the last authored style payload. */\n stillwindStyleKey: symbol,\n /** Own fragment property containing generated custom properties applied last. */\n stillwindCustomPropertiesKey: symbol,\n];\n\nexport function isObject(value: unknown): value is Record<PropertyKey, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\n/**\n * Converts a style payload using the framework's style convention.\n *\n * @param payload - Arbitrary payload. String mode accepts text and objects whose entries become declarations.\n * @param styleFormat - Object mode returns the payload unchanged; string mode serializes object entries in order.\n * @returns The payload, declaration text, or undefined for an unsupported string-mode payload.\n */\nexport function serializeStyle(payload: unknown, styleFormat: \"object\" | \"string\"): unknown {\n if (styleFormat === \"string\") {\n if (typeof payload === \"string\") {\n return payload;\n }\n if (isObject(payload)) {\n return Object.entries(payload)\n .map(([name, value]) => `${name}:${String(value)}`)\n .join(\";\");\n }\n return undefined;\n }\n return payload;\n}\n\n/**\n * Materializes class and style fragments without mutating the inputs.\n *\n * @param options - Framework conventions and the keys of the runtime that created the fragments.\n * @param values - Fragments or nested arrays.\n * Nonobjects are ignored. Materialized bases must first be converted with `toFragment`.\n * @returns Props with classes joined in traversal order. The last non-null fragment\n * style supplies inline style, and generated custom properties are combined and applied\n * last. Fragment symbol channels do not appear in the result.\n */\nexport function mergeFragments(\n options: FragmentRuntimeOptions,\n values: readonly unknown[],\n): Record<string, unknown> {\n const [\n classProperty,\n styleFormat,\n stillwindClassKey,\n stillwindStyleKey,\n stillwindCustomPropertiesKey,\n ] = options;\n const classes: string[] = [];\n const customProperties: Record<string, string> = {};\n let style: unknown;\n let hasStyle = false;\n\n const collect = (value: unknown): void => {\n if (!value) {\n return;\n }\n if (Array.isArray(value)) {\n for (const element of value) {\n collect(element);\n }\n return;\n }\n if (!isObject(value)) {\n return;\n }\n const fragment =\n Object.hasOwn(value, stillwindClassKey) ||\n Object.hasOwn(value, stillwindStyleKey) ||\n Object.hasOwn(value, stillwindCustomPropertiesKey);\n if (fragment) {\n const custom = value[stillwindCustomPropertiesKey];\n if (isObject(custom)) {\n Object.assign(customProperties, custom);\n }\n const contribution = value[stillwindClassKey];\n if (typeof contribution === \"string\" && contribution.length > 0) {\n classes.push(contribution);\n }\n if (Object.hasOwn(value, stillwindStyleKey)) {\n const payload = value[stillwindStyleKey];\n if (payload !== undefined && payload !== null) {\n style = payload;\n hasStyle = true;\n }\n }\n }\n };\n\n for (const value of values) {\n collect(value);\n }\n\n const result: Record<string, unknown> = {};\n if (classes.length > 0) {\n result[classProperty] = classes.join(\" \");\n }\n if (hasStyle) {\n const materialized = serializeStyle(style, styleFormat);\n if (materialized !== undefined) {\n result.style = materialized;\n }\n }\n if (Object.keys(customProperties).length > 0) {\n result.style =\n styleFormat === \"string\"\n ? [serializeStyle(result.style, styleFormat), serializeStyle(customProperties, styleFormat)]\n .filter(Boolean)\n .join(\";\")\n : { ...(isObject(result.style) ? result.style : {}), ...customProperties };\n }\n return result;\n}\n\n/**\n * Converts a composition base to a fragment that contributes only its class.\n *\n * A base contributes either `class` or `className`, or the class channel of a fragment\n * from this runtime. The receiving output's prop takes precedence unless it is null or\n * undefined. Style payloads and custom properties are ignored.\n *\n * @param options - The receiving framework's prop conventions and fragment keys.\n * @param value - A non-null object containing materialized props or this runtime's\n * fragment channels.\n * @returns A new fragment whose class channel holds the base's class value.\n */\nexport function toFragment(\n options: FragmentRuntimeOptions,\n value: Record<PropertyKey, unknown>,\n): Record<PropertyKey, unknown> {\n const [classProperty, , stillwindClassKey] = options;\n return {\n [stillwindClassKey]: Object.hasOwn(value, stillwindClassKey)\n ? value[stillwindClassKey]\n : (value[classProperty] ?? value[classProperty === \"class\" ? \"className\" : \"class\"]),\n };\n}\n","/**\n * Converts a dynamic value into text for a generated CSS declaration.\n *\n * @param value - CSS text, a number, a URL, or a boolean. URLs are quoted and CSS-escaped. True\n * becomes a space and false becomes `initial`.\n * @returns CSS value text. Strings and numbers are converted with `String`.\n */\nexport function stillwindCssValue(value: URL | string | number | boolean): string {\n if (typeof value === \"boolean\") {\n return value ? \" \" : \"initial\";\n }\n if (value instanceof URL) {\n const escaped = value.href.replace(\n /[\"\\\\\\n\\r\\f]/g,\n (character) => `\\\\${character.codePointAt(0)!.toString(16)} `,\n );\n return `url(\"${escaped}\")`;\n }\n return String(value);\n}\n\n/**\n * Flattens class contributions and joins nonempty values with spaces.\n *\n * @param values - Strings, numbers, bigints, nested arrays, or objects whose truthy values enable\n * their keys. Other values are ignored.\n * @returns Class text in contribution order, without deduplication.\n */\nexport function stillwindClsx(...values: readonly unknown[]): string {\n return values.flatMap(flatten).filter(Boolean).join(\" \");\n}\n\n/**\n * Escapes text for use as one CSS identifier.\n *\n * @param value - Unescaped identifier text.\n * @returns `CSS.escape` output when available, otherwise escaped text with NUL replaced by U+FFFD.\n */\nexport function stillwindEscapedIdentifier(value: string): string {\n if (typeof CSS !== \"undefined\" && typeof CSS.escape === \"function\") {\n return CSS.escape(value);\n }\n const characters = Array.from(value);\n let escaped = \"\";\n for (const [index, character] of characters.entries()) {\n const code = character.codePointAt(0)!;\n const isDigit = code >= 48 && code <= 57;\n const isControl = (code >= 1 && code <= 31) || code === 127;\n if (code === 0) {\n escaped += \"\\uFFFD\";\n } else if (isControl) {\n escaped += `\\\\${code.toString(16)} `;\n } else if (index === 0 && isDigit) {\n escaped += `\\\\${code.toString(16)} `;\n } else if (index === 0 && character === \"-\" && characters.length === 1) {\n escaped += \"\\\\-\";\n } else if (index === 1 && isDigit && characters[0] === \"-\") {\n escaped += `\\\\${code.toString(16)} `;\n } else if (\n isDigit ||\n (code >= 65 && code <= 90) ||\n (code >= 97 && code <= 122) ||\n code === 45 ||\n code === 95 ||\n code >= 128\n ) {\n escaped += character;\n } else {\n escaped += `\\\\${character}`;\n }\n }\n return escaped;\n}\n\n/**\n * Builds a CSS identifier for one keyed view transition.\n *\n * @param value - Nonempty class token or an object whose `v` property contains that token.\n * @param key - Key appended to the token after a hyphen using `String`.\n * @returns The combined token and key escaped as a CSS identifier.\n */\nexport function stillwindViewTransitionName(value: unknown, key: string | number): string {\n const token = typeof value === \"string\" ? value : (value as { v: string }).v;\n return stillwindEscapedIdentifier(`${token}-${String(key)}`);\n}\n\n/**\n * Expands one class contribution into strings without splitting class text.\n *\n * @param value - Class text, a number, a bigint, a nested array, or an object with enabled class\n * keys.\n * @returns Strings in traversal or object-entry order. Unsupported values produce an empty list.\n */\nfunction flatten(value: unknown): string[] {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"bigint\") {\n return [String(value)];\n }\n if (Array.isArray(value)) {\n return value.flatMap(flatten);\n }\n if (value && typeof value === \"object\") {\n return Object.entries(value as Record<string, unknown>)\n .filter(([, enabled]) => Boolean(enabled))\n .map(([name]) => name);\n }\n return [];\n}\n","import { mergeFragments, type FragmentRuntimeOptions } from \"./fragment.ts\";\nimport { stillwindClsx } from \"./shared.ts\";\n\n/** Compiler-produced class text, fragment channels, or nested fragment arrays. */\nexport type CvaValue = string | boolean | null | undefined | object;\n\n/** Compiled configuration whose structure is immutable after factory creation. */\nexport interface CompiledCvaConfig {\n readonly variants?: Readonly<Record<string, Readonly<Record<string, CvaValue>>>>;\n readonly defaultVariants?: Readonly<Record<string, string | number | boolean | null | undefined>>;\n readonly compoundVariants?: readonly Readonly<Record<string, unknown>>[];\n}\n\nfunction optionKey(value: unknown): unknown {\n return typeof value === \"boolean\" ? String(value) : value === 0 ? \"0\" : value;\n}\n\n/**\n * Creates a selector over compiler-produced values using the supplied framework channels.\n * Values are captured at creation. Each call returns fresh props without mutating inputs.\n * Undefined selections keep defaults; null suppresses an option. Matching compounds\n * contribute in array order, followed by external class and className inputs.\n *\n * @param options - Framework conventions and the keys used by compiled fragments.\n * @param base - Compiled styles included in every selection.\n * @param config - Immutable compiled option maps, defaults, and compound conditions.\n * @param classes - Concatenates external class inputs. Development calls supply validation.\n * @param merge - Materializes selected fragments. Development calls supply validation.\n * @returns A selector that materializes class and optional style props without private symbols.\n */\nexport function createCva(\n options: FragmentRuntimeOptions,\n base: CvaValue,\n config: CompiledCvaConfig = {},\n classes: typeof stillwindClsx = stillwindClsx,\n merge: typeof mergeFragments = mergeFragments,\n): (props?: Readonly<Record<string, unknown>>) => Record<string, unknown> {\n const axes = Object.keys(config.variants ?? {});\n const compounds = (config.compoundVariants ?? []).map((compound) => ({\n conditions: Object.entries(compound).filter(([key]) => key !== \"class\" && key !== \"className\"),\n class: compound.class as CvaValue,\n className: compound.className as CvaValue,\n }));\n const fragment = (value: CvaValue): unknown =>\n typeof value === \"string\" ? { [options[2]]: value } : value;\n\n return (props = {}) => {\n const values: unknown[] = [fragment(base)];\n const variants = config.variants;\n if (variants) {\n for (const axis of axes) {\n const supplied = props[axis];\n if (supplied === null) {\n continue;\n }\n const key = optionKey(supplied) || optionKey(config.defaultVariants?.[axis]);\n const choices = variants[axis]!;\n if ((typeof key === \"string\" || typeof key === \"number\") && Object.hasOwn(choices, key)) {\n values.push(fragment(choices[key]));\n }\n }\n const resolved = {\n ...config.defaultVariants,\n ...Object.fromEntries(Object.entries(props).filter(([, value]) => value !== undefined)),\n };\n for (const compound of compounds) {\n if (\n compound.conditions.every(([key, expected]) =>\n Array.isArray(expected) ? expected.includes(resolved[key]) : expected === resolved[key],\n )\n ) {\n values.push(fragment(compound.class), fragment(compound.className));\n }\n }\n }\n values.push({ [options[2]]: classes(props.class, props.className) });\n return merge(options, values);\n };\n}\n","/**\n * Fragment keys and production operations for each output format.\n *\n * Each format owns distinct symbol keys, so a fragment must be materialized by the format that\n * created it. Export names start with the format name because all formats share one entrypoint.\n */\n\nimport { createCva, type CompiledCvaConfig, type CvaValue } from \"./cva.ts\";\nimport {\n mergeFragments,\n serializeStyle,\n toFragment,\n type FragmentRuntimeOptions,\n} from \"./fragment.ts\";\n\nexport const stillwindClassObjectClassKey = /* @__PURE__ */ Symbol(\"stillwind.class-object.class\");\n\nexport const stillwindClassObjectStyleKey = /* @__PURE__ */ Symbol(\"stillwind.class-object.style\");\n\nexport const stillwindClassObjectCustomPropertiesKey = /* @__PURE__ */ Symbol(\n \"stillwind.class-object.custom-properties\",\n);\n\nexport const classObjectOptions: FragmentRuntimeOptions = [\n \"class\",\n \"object\",\n stillwindClassObjectClassKey,\n stillwindClassObjectStyleKey,\n stillwindClassObjectCustomPropertiesKey,\n];\n\n/** Materializes ordered fragments with `class` and object styles. */\nexport function stillwindClassObjectMerge(...values: readonly unknown[]): Record<string, unknown> {\n return mergeFragments(classObjectOptions, values);\n}\n\n/** Converts either class prop of a composition base to a class-only fragment. */\nexport function stillwindClassObjectToFragment(\n value: Record<PropertyKey, unknown>,\n): Record<PropertyKey, unknown> {\n return toFragment(classObjectOptions, value);\n}\n\n/** Returns the supplied style payload, or undefined for null or undefined. */\nexport function stillwindClassObjectStyleValue(value: unknown): unknown {\n return value == null ? undefined : serializeStyle(value, \"object\");\n}\n\n/** Selects compiled CVA values and returns fresh props with `class` and object styles. */\nexport function stillwindClassObjectCva(base?: CvaValue, config?: CompiledCvaConfig) {\n return createCva(classObjectOptions, base, config);\n}\n\nexport const stillwindClassStringClassKey = /* @__PURE__ */ Symbol(\"stillwind.class-string.class\");\n\nexport const stillwindClassStringStyleKey = /* @__PURE__ */ Symbol(\"stillwind.class-string.style\");\n\nexport const stillwindClassStringCustomPropertiesKey = /* @__PURE__ */ Symbol(\n \"stillwind.class-string.custom-properties\",\n);\n\nexport const classStringOptions: FragmentRuntimeOptions = [\n \"class\",\n \"string\",\n stillwindClassStringClassKey,\n stillwindClassStringStyleKey,\n stillwindClassStringCustomPropertiesKey,\n];\n\n/** Materializes ordered fragments with `class` and string styles. */\nexport function stillwindClassStringMerge(...values: readonly unknown[]): Record<string, unknown> {\n return mergeFragments(classStringOptions, values);\n}\n\n/** Converts either class prop of a composition base to a class-only fragment. */\nexport function stillwindClassStringToFragment(\n value: Record<PropertyKey, unknown>,\n): Record<PropertyKey, unknown> {\n return toFragment(classStringOptions, value);\n}\n\n/** Serializes object style declarations or preserves a string. Other inputs omit style. */\nexport function stillwindClassStringStyleValue(value: unknown): unknown {\n return value == null ? undefined : serializeStyle(value, \"string\");\n}\n\n/** Selects compiled CVA values and returns fresh props with `class` and string styles. */\nexport function stillwindClassStringCva(base?: CvaValue, config?: CompiledCvaConfig) {\n return createCva(classStringOptions, base, config);\n}\n\nexport const stillwindClassNameObjectClassKey = /* @__PURE__ */ Symbol(\n \"stillwind.class-name-object.class\",\n);\n\nexport const stillwindClassNameObjectStyleKey = /* @__PURE__ */ Symbol(\n \"stillwind.class-name-object.style\",\n);\n\nexport const stillwindClassNameObjectCustomPropertiesKey = /* @__PURE__ */ Symbol(\n \"stillwind.class-name-object.custom-properties\",\n);\n\nexport const classNameObjectOptions: FragmentRuntimeOptions = [\n \"className\",\n \"object\",\n stillwindClassNameObjectClassKey,\n stillwindClassNameObjectStyleKey,\n stillwindClassNameObjectCustomPropertiesKey,\n];\n\n/** Materializes ordered fragments with `className` and object styles. */\nexport function stillwindClassNameObjectMerge(\n ...values: readonly unknown[]\n): Record<string, unknown> {\n return mergeFragments(classNameObjectOptions, values);\n}\n\n/** Converts either class prop of a composition base to a class-only fragment. */\nexport function stillwindClassNameObjectToFragment(\n value: Record<PropertyKey, unknown>,\n): Record<PropertyKey, unknown> {\n return toFragment(classNameObjectOptions, value);\n}\n\n/** Returns the supplied style payload, or undefined for null or undefined. */\nexport function stillwindClassNameObjectStyleValue(value: unknown): unknown {\n return value == null ? undefined : serializeStyle(value, \"object\");\n}\n\n/** Selects compiled CVA values and returns fresh props with `className` and object styles. */\nexport function stillwindClassNameObjectCva(base?: CvaValue, config?: CompiledCvaConfig) {\n return createCva(classNameObjectOptions, base, config);\n}\n"],"mappings":";AAiBA,SAAgB,SAAS,OAAuD;CAC9E,OAAO,OAAO,UAAU,YAAY,UAAU;AAChD;;;;;;;;AASA,SAAgB,eAAe,SAAkB,aAA2C;CAC1F,IAAI,gBAAgB,UAAU;EAC5B,IAAI,OAAO,YAAY,UACrB,OAAO;EAET,IAAI,SAAS,OAAO,GAClB,OAAO,OAAO,QAAQ,OAAO,CAAC,CAC3B,KAAK,CAAC,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,KAAK,G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S declaration.
3
+ *
4
+ * @param value - CSS text, a number, a URL, or a boolean. URLs are quoted and CSS-escaped. True
5
+ * becomes a space and false becomes `initial`.
6
+ * @returns CSS value text. Strings and numbers are converted with `String`.
7
+ */
8
+ export declare function stillwindCssValue(value: URL | string | number | boolean): string;
9
+ /**
10
+ * Flattens class contributions and joins nonempty values with spaces.
11
+ *
12
+ * @param values - Strings, numbers, bigints, nested arrays, or objects whose truthy values enable
13
+ * their keys. Other values are ignored.
14
+ * @returns Class text in contribution order, without deduplication.
15
+ */
16
+ export declare function stillwindClsx(...values: readonly unknown[]): string;
17
+ /**
18
+ * Escapes text for use as one CSS identifier.
19
+ *
20
+ * @param value - Unescaped identifier text.
21
+ * @returns `CSS.escape` output when available, otherwise escaped text with NUL replaced by U+FFFD.
22
+ */
23
+ export declare function stillwindEscapedIdentifier(value: string): string;
24
+ /**
25
+ * Builds a CSS identifier for one keyed view transition.
26
+ *
27
+ * @param value - Nonempty class token or an object whose `v` property contains that token.
28
+ * @param key - Key appended to the token after a hyphen using `String`.
29
+ * @returns The combined token and key escaped as a CSS identifier.
30
+ */
31
+ export declare function stillwindViewTransitionName(value: unknown, key: string | number): string;
32
+ /** Compiler-produced class text, fragment channels, or nested fragment arrays. */
33
+ export type CvaValue = string | boolean | null | undefined | object;
34
+ /** Compiled configuration whose structure is immutable after factory creation. */
35
+ export interface CompiledCvaConfig {
36
+ readonly variants?: Readonly<Record<string, Readonly<Record<string, CvaValue>>>>;
37
+ readonly defaultVariants?: Readonly<Record<string, string | number | boolean | null | undefined>>;
38
+ readonly compoundVariants?: readonly Readonly<Record<string, unknown>>[];
39
+ }
40
+ export declare const stillwindClassObjectClassKey: unique symbol;
41
+ export declare const stillwindClassObjectStyleKey: unique symbol;
42
+ export declare const stillwindClassObjectCustomPropertiesKey: unique symbol;
43
+ /** Materializes ordered fragments with `class` and object styles. */
44
+ export declare function stillwindClassObjectMerge(...values: readonly unknown[]): Record<string, unknown>;
45
+ /** Converts either class prop of a composition base to a class-only fragment. */
46
+ export declare function stillwindClassObjectToFragment(value: Record<PropertyKey, unknown>): Record<PropertyKey, unknown>;
47
+ /** Returns the supplied style payload, or undefined for null or undefined. */
48
+ export declare function stillwindClassObjectStyleValue(value: unknown): unknown;
49
+ /** Selects compiled CVA values and returns fresh props with `class` and object styles. */
50
+ export declare function stillwindClassObjectCva(base?: CvaValue, config?: CompiledCvaConfig): (props?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
51
+ export declare const stillwindClassStringClassKey: unique symbol;
52
+ export declare const stillwindClassStringStyleKey: unique symbol;
53
+ export declare const stillwindClassStringCustomPropertiesKey: unique symbol;
54
+ /** Materializes ordered fragments with `class` and string styles. */
55
+ export declare function stillwindClassStringMerge(...values: readonly unknown[]): Record<string, unknown>;
56
+ /** Converts either class prop of a composition base to a class-only fragment. */
57
+ export declare function stillwindClassStringToFragment(value: Record<PropertyKey, unknown>): Record<PropertyKey, unknown>;
58
+ /** Serializes object style declarations or preserves a string. Other inputs omit style. */
59
+ export declare function stillwindClassStringStyleValue(value: unknown): unknown;
60
+ /** Selects compiled CVA values and returns fresh props with `class` and string styles. */
61
+ export declare function stillwindClassStringCva(base?: CvaValue, config?: CompiledCvaConfig): (props?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
62
+ export declare const stillwindClassNameObjectClassKey: unique symbol;
63
+ export declare const stillwindClassNameObjectStyleKey: unique symbol;
64
+ export declare const stillwindClassNameObjectCustomPropertiesKey: unique symbol;
65
+ /** Materializes ordered fragments with `className` and object styles. */
66
+ export declare function stillwindClassNameObjectMerge(...values: readonly unknown[]): Record<string, unknown>;
67
+ /** Converts either class prop of a composition base to a class-only fragment. */
68
+ export declare function stillwindClassNameObjectToFragment(value: Record<PropertyKey, unknown>): Record<PropertyKey, unknown>;
69
+ /** Returns the supplied style payload, or undefined for null or undefined. */
70
+ export declare function stillwindClassNameObjectStyleValue(value: unknown): unknown;
71
+ /** Selects compiled CVA values and returns fresh props with `className` and object styles. */
72
+ export declare function stillwindClassNameObjectCva(base?: CvaValue, config?: CompiledCvaConfig): (props?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
73
+ //# sourceMappingURL=formats-aeLCNAXl.d.ts.map
@@ -1,5 +1,5 @@
1
- import { AnchorScope, ContainerType, ContainerVariant, CssWideKeyword, CvaClassProps, CvaCompound, CvaConfig, CvaInput, CvaResult, CvaRuleInput, CvaSelection, CvaVariants, RefScope, RefVariant, ScopedRefVariant, StillwindClassValue, StillwindDeclarationIdentity, StyleArgument, StyleCssGroup, StyleCssInput, StyleCssOptions, StyleCustomProperties, StyleCustomPropertyValue, StyleKeyframes, StyleKeyframesDefinition, StyleKeyframesFrames, StyleKeyframesUse, StyleRef, StyleRefProjection, StyleVariant, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-RwVFpxhE.js";
2
- import { StyleMacro, StyleProps, StyleResult, style } from "../class-object-D7ZGJOf_.js";
1
+ import { StyleMacro, StyleProps, StyleResult, style } from "../class-object-BaK8uudd.js";
2
+ import { AnchorScope, ContainerType, ContainerVariant, CssWideKeyword, CvaClassProps, CvaCompound, CvaConfig, CvaInput, CvaResult, CvaRuleInput, CvaSelection, CvaVariants, RefScope, RefVariant, ScopedRefVariant, StillwindClassValue, StillwindDeclarationIdentity, StyleArgument, StyleCssGroup, StyleCssInput, StyleCssOptions, StyleCustomProperties, StyleCustomPropertyValue, StyleKeyframes, StyleKeyframesDefinition, StyleKeyframesFrames, StyleKeyframesUse, StyleRef, StyleRefProjection, StyleResult as StyleResult$1, StyleStoredVariant, StyleVariant, StyleVariantKey, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-DBpgaaD7.js";
3
3
  type Alpine = {
4
4
  directive(name: string, handler: (element: HTMLElement, directive: {
5
5
  expression: string;
@@ -16,5 +16,5 @@ type Alpine = {
16
16
  * Updates replace the directive's contribution, and directive removal clears it.
17
17
  */
18
18
  export declare function stillwind(alpine: Alpine): void;
19
- export { type AnchorScope, type ContainerType, type ContainerVariant, type CssWideKeyword, type CvaClassProps, type CvaCompound, type CvaConfig, type CvaInput, type CvaResult, type CvaRuleInput, type CvaSelection, type CvaVariants, type RefScope, type RefVariant, type ScopedRefVariant, type StillwindClassValue, type StillwindDeclarationIdentity, type StyleArgument, type StyleCssGroup, type StyleCssInput, type StyleCssOptions, type StyleCustomProperties, type StyleCustomPropertyValue, type StyleKeyframes, type StyleKeyframesDefinition, type StyleKeyframesFrames, type StyleKeyframesUse, type StyleMacro, type StyleProps, type StyleRef, type StyleRefProjection, type StyleResult, type StyleVariant, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, type createStyleMacro, style };
19
+ export { type AnchorScope, type ContainerType, type ContainerVariant, type CssWideKeyword, type CvaClassProps, type CvaCompound, type CvaConfig, type CvaInput, type CvaResult, type CvaRuleInput, type CvaSelection, type CvaVariants, type RefScope, type RefVariant, type ScopedRefVariant, type StillwindClassValue, type StillwindDeclarationIdentity, type StyleArgument, type StyleCssGroup, type StyleCssInput, type StyleCssOptions, type StyleCustomProperties, type StyleCustomPropertyValue, type StyleKeyframes, type StyleKeyframesDefinition, type StyleKeyframesFrames, type StyleKeyframesUse, type StyleMacro, type StyleProps, type StyleRef, type StyleRefProjection, type StyleResult, type StyleResult$1 as StyleResultOf, type StyleStoredVariant, type StyleVariant, type StyleVariantKey, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, type createStyleMacro, style };
20
20
  //# sourceMappingURL=alpine.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { applyStyle, clearStyle } from "../style-BV4ctkni.js";
2
- import { style } from "../class-object-D24FFYqO.js";
2
+ import { style } from "../class-object-DNcjzcfH.js";
3
3
  // src/frameworks/alpine.ts
4
4
  /**
5
5
  * Registers `x-sw` for reactive compiled props. Install with `Alpine.plugin(stillwind)`
@@ -1 +1 @@
1
- {"version":3,"file":"alpine.js","names":[],"sources":["../../src/frameworks/alpine.ts"],"sourcesContent":["import { applyStyle, clearStyle } from \"../dom/style.ts\";\nimport type { StyleProps } from \"../outputs/class-object.ts\";\n\nexport type * from \"../macro/index.ts\";\nexport { style } from \"../outputs/class-object.ts\";\nexport type { StyleMacro, StyleProps, StyleResult } from \"../outputs/class-object.ts\";\n\ntype Alpine = {\n directive(\n name: string,\n handler: (\n element: HTMLElement,\n directive: {\n expression: string;\n },\n utilities: {\n evaluateLater(expression: string): (receive: (props: Readonly<StyleProps>) => void) => void;\n effect(callback: () => void): void;\n cleanup(callback: () => void): void;\n },\n ) => void,\n ): unknown;\n mutateDom<T>(callback: () => T): T;\n};\n\n/**\n * Registers `x-sw` for reactive compiled props. Install with `Alpine.plugin(stillwind)`\n * before `Alpine.start()`. The expression must return a Stillwind props object.\n * Updates replace the directive's contribution, and directive removal clears it.\n */\nexport function stillwind(alpine: Alpine): void {\n alpine.directive(\"sw\", (element, { expression }, utilities) => {\n const evaluate = utilities.evaluateLater(expression);\n utilities.effect(() => evaluate((props) => alpine.mutateDom(() => applyStyle(element, props))));\n utilities.cleanup(() => alpine.mutateDom(() => clearStyle(element)));\n });\n}\n"],"mappings":";;;;;;;;AA8BA,SAAgB,UAAU,QAAsB;CAC9C,OAAO,UAAU,OAAO,SAAS,EAAE,cAAc,cAAc;EAC7D,MAAM,WAAW,UAAU,cAAc,UAAU;EACnD,UAAU,aAAa,UAAU,UAAU,OAAO,gBAAgB,WAAW,SAAS,KAAK,CAAC,CAAC,CAAC;EAC9F,UAAU,cAAc,OAAO,gBAAgB,WAAW,OAAO,CAAC,CAAC;CACrE,CAAC;AACH"}
1
+ {"version":3,"file":"alpine.js","names":[],"sources":["../../src/frameworks/alpine.ts"],"sourcesContent":["import { applyStyle, clearStyle } from \"../dom/style.ts\";\nimport type { StyleProps } from \"../outputs/class-object.ts\";\n\nexport type * from \"../macro/index.ts\";\nexport { style } from \"../outputs/class-object.ts\";\nexport type { StyleMacro, StyleProps, StyleResult } from \"../outputs/class-object.ts\";\nexport type { StyleResult as StyleResultOf } from \"../macro/output.ts\";\n\ntype Alpine = {\n directive(\n name: string,\n handler: (\n element: HTMLElement,\n directive: {\n expression: string;\n },\n utilities: {\n evaluateLater(expression: string): (receive: (props: Readonly<StyleProps>) => void) => void;\n effect(callback: () => void): void;\n cleanup(callback: () => void): void;\n },\n ) => void,\n ): unknown;\n mutateDom<T>(callback: () => T): T;\n};\n\n/**\n * Registers `x-sw` for reactive compiled props. Install with `Alpine.plugin(stillwind)`\n * before `Alpine.start()`. The expression must return a Stillwind props object.\n * Updates replace the directive's contribution, and directive removal clears it.\n */\nexport function stillwind(alpine: Alpine): void {\n alpine.directive(\"sw\", (element, { expression }, utilities) => {\n const evaluate = utilities.evaluateLater(expression);\n utilities.effect(() => evaluate((props) => alpine.mutateDom(() => applyStyle(element, props))));\n utilities.cleanup(() => alpine.mutateDom(() => clearStyle(element)));\n });\n}\n"],"mappings":";;;;;;;;AA+BA,SAAgB,UAAU,QAAsB;CAC9C,OAAO,UAAU,OAAO,SAAS,EAAE,cAAc,cAAc;EAC7D,MAAM,WAAW,UAAU,cAAc,UAAU;EACnD,UAAU,aAAa,UAAU,UAAU,OAAO,gBAAgB,WAAW,SAAS,KAAK,CAAC,CAAC,CAAC;EAC9F,UAAU,cAAc,OAAO,gBAAgB,WAAW,OAAO,CAAC,CAAC;CACrE,CAAC;AACH"}
@@ -1,3 +1,3 @@
1
- import { AnchorScope, ContainerType, ContainerVariant, CssWideKeyword, CvaClassProps, CvaCompound, CvaConfig, CvaInput, CvaResult, CvaRuleInput, CvaSelection, CvaVariants, RefScope, RefVariant, ScopedRefVariant, StillwindClassValue, StillwindDeclarationIdentity, StyleArgument, StyleCssGroup, StyleCssInput, StyleCssOptions, StyleCustomProperties, StyleCustomPropertyValue, StyleKeyframes, StyleKeyframesDefinition, StyleKeyframesFrames, StyleKeyframesUse, StyleRef, StyleRefProjection, StyleVariant, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-RwVFpxhE.js";
2
- import { StyleMacro, StyleProps, StyleResult, style } from "../class-string-CQHnc9GN.js";
3
- export { type AnchorScope, type ContainerType, type ContainerVariant, type CssWideKeyword, type CvaClassProps, type CvaCompound, type CvaConfig, type CvaInput, type CvaResult, type CvaRuleInput, type CvaSelection, type CvaVariants, type RefScope, type RefVariant, type ScopedRefVariant, type StillwindClassValue, type StillwindDeclarationIdentity, type StyleArgument, type StyleCssGroup, type StyleCssInput, type StyleCssOptions, type StyleCustomProperties, type StyleCustomPropertyValue, type StyleKeyframes, type StyleKeyframesDefinition, type StyleKeyframesFrames, type StyleKeyframesUse, type StyleMacro, type StyleProps, type StyleRef, type StyleRefProjection, type StyleResult, type StyleVariant, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, type createStyleMacro, style };
1
+ import { StyleMacro, StyleProps, StyleResult, style } from "../class-string-C5YFtXQn.js";
2
+ import { AnchorScope, ContainerType, ContainerVariant, CssWideKeyword, CvaClassProps, CvaCompound, CvaConfig, CvaInput, CvaResult, CvaRuleInput, CvaSelection, CvaVariants, RefScope, RefVariant, ScopedRefVariant, StillwindClassValue, StillwindDeclarationIdentity, StyleArgument, StyleCssGroup, StyleCssInput, StyleCssOptions, StyleCustomProperties, StyleCustomPropertyValue, StyleKeyframes, StyleKeyframesDefinition, StyleKeyframesFrames, StyleKeyframesUse, StyleRef, StyleRefProjection, StyleResult as StyleResult$1, StyleStoredVariant, StyleVariant, StyleVariantKey, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-DBpgaaD7.js";
3
+ export { type AnchorScope, type ContainerType, type ContainerVariant, type CssWideKeyword, type CvaClassProps, type CvaCompound, type CvaConfig, type CvaInput, type CvaResult, type CvaRuleInput, type CvaSelection, type CvaVariants, type RefScope, type RefVariant, type ScopedRefVariant, type StillwindClassValue, type StillwindDeclarationIdentity, type StyleArgument, type StyleCssGroup, type StyleCssInput, type StyleCssOptions, type StyleCustomProperties, type StyleCustomPropertyValue, type StyleKeyframes, type StyleKeyframesDefinition, type StyleKeyframesFrames, type StyleKeyframesUse, type StyleMacro, type StyleProps, type StyleRef, type StyleRefProjection, type StyleResult, type StyleResult$1 as StyleResultOf, type StyleStoredVariant, type StyleVariant, type StyleVariantKey, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, type createStyleMacro, style };
@@ -1 +1 @@
1
- export { style } from "../class-string-Db8-oI4q.js";
1
+ export { style } from "../class-string-KnYInbiw.js";
@@ -1,5 +1,5 @@
1
- import { AnchorScope, ContainerType, ContainerVariant, CssWideKeyword, CvaClassProps, CvaCompound, CvaConfig, CvaInput, CvaResult, CvaRuleInput, CvaSelection, CvaVariants, RefScope, RefVariant, ScopedRefVariant, StillwindClassValue, StillwindDeclarationIdentity, StyleArgument, StyleCssGroup, StyleCssInput, StyleCssOptions, StyleCustomProperties, StyleCustomPropertyValue, StyleKeyframes, StyleKeyframesDefinition, StyleKeyframesFrames, StyleKeyframesUse, StyleRef, StyleRefProjection, StyleVariant, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-RwVFpxhE.js";
2
- import { StyleMacro, StyleProps, StyleResult, style } from "../class-object-D7ZGJOf_.js";
1
+ import { StyleMacro, StyleProps, StyleResult, style } from "../class-object-BaK8uudd.js";
2
+ import { AnchorScope, ContainerType, ContainerVariant, CssWideKeyword, CvaClassProps, CvaCompound, CvaConfig, CvaInput, CvaResult, CvaRuleInput, CvaSelection, CvaVariants, RefScope, RefVariant, ScopedRefVariant, StillwindClassValue, StillwindDeclarationIdentity, StyleArgument, StyleCssGroup, StyleCssInput, StyleCssOptions, StyleCustomProperties, StyleCustomPropertyValue, StyleKeyframes, StyleKeyframesDefinition, StyleKeyframesFrames, StyleKeyframesUse, StyleRef, StyleRefProjection, StyleResult as StyleResult$1, StyleStoredVariant, StyleVariant, StyleVariantKey, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-DBpgaaD7.js";
3
3
  import { nothing } from "lit";
4
4
  import { AsyncDirective } from "lit/async-directive.js";
5
5
  import { ElementPart, PartInfo } from "lit/directive.js";
@@ -17,5 +17,5 @@ declare class StyleDirective extends AsyncDirective {
17
17
  * the latest props. Server rendering of this directive is unsupported.
18
18
  */
19
19
  export declare const applyStyle: (_props: Readonly<StyleProps>) => import("lit/async-directive.js").DirectiveResult<typeof StyleDirective>;
20
- export { type AnchorScope, type ContainerType, type ContainerVariant, type CssWideKeyword, type CvaClassProps, type CvaCompound, type CvaConfig, type CvaInput, type CvaResult, type CvaRuleInput, type CvaSelection, type CvaVariants, type RefScope, type RefVariant, type ScopedRefVariant, type StillwindClassValue, type StillwindDeclarationIdentity, type StyleArgument, type StyleCssGroup, type StyleCssInput, type StyleCssOptions, type StyleCustomProperties, type StyleCustomPropertyValue, type StyleKeyframes, type StyleKeyframesDefinition, type StyleKeyframesFrames, type StyleKeyframesUse, type StyleMacro, type StyleProps, type StyleRef, type StyleRefProjection, type StyleResult, type StyleVariant, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, type createStyleMacro, style };
20
+ export { type AnchorScope, type ContainerType, type ContainerVariant, type CssWideKeyword, type CvaClassProps, type CvaCompound, type CvaConfig, type CvaInput, type CvaResult, type CvaRuleInput, type CvaSelection, type CvaVariants, type RefScope, type RefVariant, type ScopedRefVariant, type StillwindClassValue, type StillwindDeclarationIdentity, type StyleArgument, type StyleCssGroup, type StyleCssInput, type StyleCssOptions, type StyleCustomProperties, type StyleCustomPropertyValue, type StyleKeyframes, type StyleKeyframesDefinition, type StyleKeyframesFrames, type StyleKeyframesUse, type StyleMacro, type StyleProps, type StyleRef, type StyleRefProjection, type StyleResult, type StyleResult$1 as StyleResultOf, type StyleStoredVariant, type StyleVariant, type StyleVariantKey, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, type createStyleMacro, style };
21
21
  //# sourceMappingURL=lit.d.ts.map