stillwind 0.7.0 → 0.8.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 (104) hide show
  1. package/css/builtin-variants/sw-conditional.css +10 -1
  2. package/dist/{class-object-D7ZGJOf_.d.ts → class-object-BaK8uudd.d.ts} +2 -2
  3. package/dist/class-object-DNcjzcfH.js +6 -0
  4. package/dist/{class-object-D24FFYqO.js.map → class-object-DNcjzcfH.js.map} +1 -1
  5. package/dist/{class-string-CQHnc9GN.d.ts → class-string-C5YFtXQn.d.ts} +2 -2
  6. package/dist/class-string-KnYInbiw.js +6 -0
  7. package/dist/{class-string-Db8-oI4q.js.map → class-string-KnYInbiw.js.map} +1 -1
  8. package/dist/{cva-BwX07CFw.js → formats-Ctf2WFc-.js} +87 -2
  9. package/dist/formats-Ctf2WFc-.js.map +1 -0
  10. package/dist/formats-aeLCNAXl.d.ts +73 -0
  11. package/dist/frameworks/alpine.d.ts +3 -3
  12. package/dist/frameworks/alpine.js +1 -1
  13. package/dist/frameworks/alpine.js.map +1 -1
  14. package/dist/frameworks/astro.d.ts +3 -3
  15. package/dist/frameworks/astro.js +1 -1
  16. package/dist/frameworks/lit.d.ts +3 -3
  17. package/dist/frameworks/lit.js +1 -1
  18. package/dist/frameworks/lit.js.map +1 -1
  19. package/dist/frameworks/preact.d.ts +3 -3
  20. package/dist/frameworks/preact.js +1 -1
  21. package/dist/frameworks/qwik.d.ts +3 -3
  22. package/dist/frameworks/qwik.js +1 -1
  23. package/dist/frameworks/react.d.ts +2 -2
  24. package/dist/frameworks/react.js +1 -1
  25. package/dist/frameworks/solid.d.ts +3 -3
  26. package/dist/frameworks/solid.js +1 -1
  27. package/dist/frameworks/svelte.d.ts +3 -3
  28. package/dist/frameworks/svelte.js +1 -1
  29. package/dist/frameworks/vanilla.d.ts +3 -3
  30. package/dist/frameworks/vanilla.js +1 -1
  31. package/dist/frameworks/vue.d.ts +3 -3
  32. package/dist/frameworks/vue.js +1 -1
  33. package/dist/{index-RwVFpxhE.d.ts → index-DBpgaaD7.d.ts} +54 -5
  34. package/dist/macro/index.d.ts +2 -2
  35. package/dist/macro/index.js +1 -1
  36. package/dist/runtime/development.d.ts +47 -0
  37. package/dist/{development-J-JCSIm0.js → runtime/development.js} +41 -5
  38. package/dist/runtime/development.js.map +1 -0
  39. package/dist/runtime/index.d.ts +2 -0
  40. package/dist/runtime/index.js +1 -0
  41. package/dist/{style-fTQbsVWZ.js → style-BE8vuLiO.js} +4 -1
  42. package/dist/style-BE8vuLiO.js.map +1 -0
  43. package/docs/at-rules/apply.md +1 -1
  44. package/docs/at-rules/custom-variant.md +1 -1
  45. package/docs/at-rules/slot.md +1 -1
  46. package/docs/at-rules/stillwind-property.md +1 -1
  47. package/docs/at-rules/stillwind-registry.md +1 -1
  48. package/docs/at-rules/stillwind-require-properties.md +1 -1
  49. package/docs/at-rules/stillwind-undef-arbitrary-property.md +1 -1
  50. package/docs/at-rules/stillwind-undef-utility.md +1 -1
  51. package/docs/at-rules/stillwind-undef-variant.md +1 -1
  52. package/docs/at-rules/theme.md +5 -5
  53. package/docs/at-rules/utility.md +4 -4
  54. package/docs/at-rules/variant.md +1 -1
  55. package/docs/cli.md +4 -1
  56. package/docs/concepts/css-ordering.md +4 -4
  57. package/docs/concepts/how-styles-compile.md +3 -3
  58. package/docs/configuration.md +16 -16
  59. package/docs/editors.md +2 -1
  60. package/docs/errors/SW10004.md +2 -1
  61. package/docs/guides/reusable-styles.md +5 -0
  62. package/docs/guides/style.md +32 -0
  63. package/docs/guides/tailwind-compatibility.md +10 -9
  64. package/docs/lints/ambiguous-style-base-order.md +2 -0
  65. package/docs/lints/conflicting-utilities.md +43 -1
  66. package/docs/lints/index.md +1 -0
  67. package/docs/lints/interfering-imported-style-base.md +21 -3
  68. package/docs/lints/invalid-stored-variant.md +52 -0
  69. package/docs/macros/cva.md +5 -4
  70. package/docs/macros/index.md +1 -0
  71. package/docs/macros/ref/at.md +1 -1
  72. package/docs/macros/ref/condition.md +2 -1
  73. package/docs/macros/ref/in.md +1 -1
  74. package/docs/macros/ref/index.md +2 -1
  75. package/docs/macros/style.md +34 -8
  76. package/docs/macros/view-transition.md +1 -1
  77. package/docs/macros/when.md +129 -0
  78. package/package.json +10 -26
  79. package/dist/class-object-D24FFYqO.js +0 -6
  80. package/dist/class-string-Db8-oI4q.js +0 -6
  81. package/dist/cva-BwX07CFw.js.map +0 -1
  82. package/dist/cva-DSpDNBYi.d.ts +0 -9
  83. package/dist/development-DttPQc71.d.ts +0 -27
  84. package/dist/development-J-JCSIm0.js.map +0 -1
  85. package/dist/runtime/class-name-object-development.d.ts +0 -10
  86. package/dist/runtime/class-name-object-development.js +0 -18
  87. package/dist/runtime/class-name-object-development.js.map +0 -1
  88. package/dist/runtime/class-name-object.d.ts +0 -16
  89. package/dist/runtime/class-name-object.js +0 -31
  90. package/dist/runtime/class-name-object.js.map +0 -1
  91. package/dist/runtime/class-object-development.d.ts +0 -10
  92. package/dist/runtime/class-object-development.js +0 -18
  93. package/dist/runtime/class-object-development.js.map +0 -1
  94. package/dist/runtime/class-object.d.ts +0 -16
  95. package/dist/runtime/class-object.js +0 -31
  96. package/dist/runtime/class-object.js.map +0 -1
  97. package/dist/runtime/class-string-development.d.ts +0 -10
  98. package/dist/runtime/class-string-development.js +0 -18
  99. package/dist/runtime/class-string-development.js.map +0 -1
  100. package/dist/runtime/class-string.d.ts +0 -16
  101. package/dist/runtime/class-string.js +0 -31
  102. package/dist/runtime/class-string.js.map +0 -1
  103. package/dist/shared-B9IQXU6P.d.ts +0 -32
  104. package/dist/style-fTQbsVWZ.js.map +0 -1
@@ -254,7 +254,11 @@ export type StyleRef<RefId extends string = string> = {
254
254
  * `RefId` preserves the possible declaration identities of the scope operand.
255
255
  */
256
256
  export type RefScope<RefId extends string = string> = StyleRef<RefId> | RefVariant<RefId>;
257
- type StyleVariantKey = string & {
257
+ /**
258
+ * A variant that `style()` accepts as a computed key or a utility template
259
+ * substitution, such as a ref variant or a stored variant.
260
+ */
261
+ export type StyleVariantKey = string & {
258
262
  readonly [refProjection]: true;
259
263
  readonly at: never;
260
264
  };
@@ -264,7 +268,8 @@ type StyleVariantKey = string & {
264
268
  * Without `.in()`, the referenced element must be an ancestor of the styled target.
265
269
  * Use the complete call, tag, or `.in()` chain directly as a computed variant key or a
266
270
  * variant segment followed by `:` in a utility template inside `style()`.
267
- * This syntax cannot be stored, exported, passed, or returned for later use.
271
+ * This syntax cannot be stored, exported, passed, or returned for later use. Wrap it
272
+ * in `style.when()` to reuse it.
268
273
  * `RefId` preserves the possible identities of the referenced element.
269
274
  */
270
275
  export type RefVariant<RefId extends string = string> = StyleVariantKey & {
@@ -295,7 +300,8 @@ export type RefVariant<RefId extends string = string> = StyleVariantKey & {
295
300
  * times. Use the complete chain directly as a computed key or a variant segment
296
301
  * followed by `:` in a utility template inside `style()`.
297
302
  *
298
- * This syntax cannot be stored, exported, passed, or returned for later use.
303
+ * This syntax cannot be stored, exported, passed, or returned for later use. Wrap it
304
+ * in `style.when()` to reuse it.
299
305
  * `RefId` preserves the referenced identities. `ScopeIds` preserves each scope's
300
306
  * possible identities in the order of the `.in()` calls.
301
307
  */
@@ -327,7 +333,8 @@ export type ScopedRefVariant<RefId extends string = string, ScopeIds extends rea
327
333
  *
328
334
  * Use the call or tag directly as a computed key or a variant segment followed by
329
335
  * `:` in a utility template inside `style()`. This syntax cannot be stored,
330
- * exported, passed, or returned for later use. It accepts no further macro methods.
336
+ * exported, passed, or returned for later use. Wrap it in `style.when()` to reuse it.
337
+ * It accepts no further macro methods.
331
338
  * `RefId` preserves the possible identities of the container provider.
332
339
  */
333
340
  export type ContainerVariant<RefId extends string = string> = StyleVariantKey & {
@@ -594,6 +601,21 @@ export type CvaConfig<Variants extends CvaVariants> = {
594
601
  export type CvaResult<Props> = Pick<Props, Extract<keyof Props, "class" | "className" | "style">>;
595
602
  /** Extracts variant choices from a CVA factory, excluding external class inputs. */
596
603
  export type VariantProps<Factory extends (...args: never[]) => unknown> = Omit<Exclude<Parameters<Factory>[0], undefined>, "class" | "className">;
604
+ declare const storedVariantIdentity: unique symbol;
605
+ /**
606
+ * A variant sequence stored by `style.when()`.
607
+ *
608
+ * Use the value as a computed variant key in `style()`, as a variant segment followed
609
+ * by `:` in a utility template inside `style()`, or in the argument of another
610
+ * `style.when()`. Each use means the same as writing the stored sequence at that
611
+ * position. The value may be stored, exported, imported, and passed through bindings
612
+ * that the compiler can resolve to one declaration. At runtime the value is
613
+ * `undefined`. `Id` carries compiler identity and should be inferred by the checker.
614
+ */
615
+ export type StyleStoredVariant<Id extends string = string> = StyleVariantKey & {
616
+ /** @internal */
617
+ readonly [storedVariantIdentity]: Id;
618
+ };
597
619
  /**
598
620
  * Internal use only. The compiler inserts this identity argument in source used by the
599
621
  * TypeScript checker. Application code must not construct or pass it.
@@ -730,6 +752,33 @@ export type StyleMacro<Props = object> = {
730
752
  * @internal
731
753
  */
732
754
  viewTransition<const Id extends string>(definition: StyleViewTransitionDefinition, identity: StillwindDeclarationIdentity<Id>): StyleViewTransition<Id>;
755
+ /**
756
+ * Stores variant sequences in a binding initializer for later use in `style()`.
757
+ *
758
+ * Use the result as a computed variant key, as a variant segment followed by `:` in
759
+ * a utility template, or in the argument of another `style.when()`. Each use means
760
+ * the same as writing the sequence directly at that position, so the sequence obeys
761
+ * the same rules as a variant key written in `style()`. A use must resolve to one
762
+ * declaration. The compiler replaces the call with `undefined`.
763
+ *
764
+ * With several arguments, the stored variant matches when any argument matches. A
765
+ * use means the same as writing the use once for each argument, in argument order.
766
+ *
767
+ * @param variants - Static variant sequences. Each one is a string literal such as
768
+ * `"hover:md"`, a ref variant call or tag with optional `.in()` calls, a container
769
+ * variant, another stored variant, or a template literal whose substitutions are
770
+ * complete variant segments. The final `:` is optional. Invalid sequences produce
771
+ * lint findings.
772
+ * @returns A stored variant that may be stored, exported, imported, and passed.
773
+ */
774
+ when(...variants: [string | StyleVariantKey, ...(string | StyleVariantKey)[]]): StyleStoredVariant;
775
+ /**
776
+ * Internal use only. The checker supplies identity for a stored variant declaration.
777
+ * Application code must use `when(...variants)` without the identity argument.
778
+ *
779
+ * @internal
780
+ */
781
+ when<const Id extends string>(...variants: [string | StyleVariantKey, ...(string | StyleVariantKey)[], StillwindDeclarationIdentity<Id>]): StyleStoredVariant<Id>;
733
782
  /**
734
783
  * Adds anchor-scope without requiring a ref marker on the element.
735
784
  *
@@ -812,4 +861,4 @@ export type StyleMacro<Props = object> = {
812
861
  */
813
862
  export declare function createStyleMacro<Props>(): StyleMacro<Props>;
814
863
  export {};
815
- //# sourceMappingURL=index-RwVFpxhE.d.ts.map
864
+ //# sourceMappingURL=index-DBpgaaD7.d.ts.map
@@ -1,2 +1,2 @@
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, StyleMacro, StyleRef, StyleRefProjection, StyleResult, StyleVariant, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-RwVFpxhE.js";
2
- 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 StyleRef, type StyleRefProjection, type StyleResult, type StyleVariant, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, createStyleMacro };
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, StyleMacro, StyleRef, StyleRefProjection, StyleResult, StyleStoredVariant, StyleVariant, StyleVariantKey, StyleVariantObject, StyleVariantValue, StyleViewTransition, StyleViewTransitionDefinition, StyleViewTransitionUse, VariantProps, createStyleMacro } from "../index-DBpgaaD7.js";
2
+ 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 StyleRef, type StyleRefProjection, type StyleResult, type StyleStoredVariant, type StyleVariant, type StyleVariantKey, type StyleVariantObject, type StyleVariantValue, type StyleViewTransition, type StyleViewTransitionDefinition, type StyleViewTransitionUse, type VariantProps, createStyleMacro };
@@ -1 +1 @@
1
- export { createStyleMacro } from "../style-fTQbsVWZ.js";
1
+ export { createStyleMacro } from "../style-BE8vuLiO.js";
@@ -0,0 +1,47 @@
1
+ import { CompiledCvaConfig, CvaValue, stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindCssValue, stillwindEscapedIdentifier } from "../formats-aeLCNAXl.js";
2
+ /**
3
+ * Reads a compiled ref's class token once.
4
+ *
5
+ * @param value - A ref record whose `.c` property contains a nonempty string.
6
+ * @returns The class token.
7
+ * @throws TypeError if the record or token is missing, or the token is empty or not a string.
8
+ */
9
+ export declare function stillwindRefClassChecked(value: unknown): string;
10
+ /**
11
+ * Validates external class inputs before concatenating them.
12
+ *
13
+ * @param values - Strings, numbers, bigints, nested arrays, or objects whose truthy entries enable their keys.
14
+ * Booleans, null, and undefined add no text.
15
+ * @returns Class text in contribution order without deduplication.
16
+ * @throws TypeError when an input or nested array contains a function or symbol.
17
+ */
18
+ declare function stillwindClsxChecked(...values: readonly unknown[]): string;
19
+ /**
20
+ * Names a keyed view transition after reading its token once.
21
+ *
22
+ * @param value - A nonempty class token or a record whose `.v` contains that token.
23
+ * @param key - A key appended after a hyphen using `String`.
24
+ * @returns The token and key escaped as one CSS identifier.
25
+ * @throws TypeError when the token is missing, empty, or not a string.
26
+ */
27
+ declare function stillwindViewTransitionNameChecked(value: unknown, key: string | number): string;
28
+ /** Checks fragment ownership and class contributions before materializing `class` and object styles. */
29
+ declare function stillwindClassObjectMergeChecked(...values: readonly unknown[]): Record<string, unknown>;
30
+ /** Rejects nonobjects before converting either class prop to a class-only fragment. */
31
+ declare function stillwindClassObjectToFragmentChecked(value: unknown): Record<PropertyKey, unknown>;
32
+ /** Checks external classes and selected fragments before materializing CVA props with `class` and object styles. */
33
+ declare function stillwindClassObjectCvaChecked(base?: CvaValue, config?: CompiledCvaConfig): (props?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
34
+ /** Checks fragment ownership and class contributions before materializing `class` and string styles. */
35
+ declare function stillwindClassStringMergeChecked(...values: readonly unknown[]): Record<string, unknown>;
36
+ /** Rejects nonobjects before converting either class prop to a class-only fragment. */
37
+ declare function stillwindClassStringToFragmentChecked(value: unknown): Record<PropertyKey, unknown>;
38
+ /** Checks external classes and selected fragments before materializing CVA props with `class` and string styles. */
39
+ declare function stillwindClassStringCvaChecked(base?: CvaValue, config?: CompiledCvaConfig): (props?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
40
+ /** Checks fragment ownership and class contributions before materializing `className` and object styles. */
41
+ declare function stillwindClassNameObjectMergeChecked(...values: readonly unknown[]): Record<string, unknown>;
42
+ /** Rejects nonobjects before converting either class prop to a class-only fragment. */
43
+ declare function stillwindClassNameObjectToFragmentChecked(value: unknown): Record<PropertyKey, unknown>;
44
+ /** Checks external classes and selected fragments before materializing CVA props with `className` and object styles. */
45
+ declare function stillwindClassNameObjectCvaChecked(base?: CvaValue, config?: CompiledCvaConfig): (props?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
46
+ export { stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectCvaChecked as stillwindClassNameObjectCva, stillwindClassNameObjectMergeChecked as stillwindClassNameObjectMerge, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragmentChecked as stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectCvaChecked as stillwindClassObjectCva, stillwindClassObjectMergeChecked as stillwindClassObjectMerge, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragmentChecked as stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringCvaChecked as stillwindClassStringCva, stillwindClassStringMergeChecked as stillwindClassStringMerge, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragmentChecked as stillwindClassStringToFragment, stillwindClsxChecked as stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionNameChecked as stillwindViewTransitionName };
47
+ //# sourceMappingURL=development.d.ts.map
@@ -1,5 +1,5 @@
1
- import { createCva, isObject, mergeFragments, stillwindClsx, stillwindViewTransitionName, toFragment } from "./cva-BwX07CFw.js";
2
- // src/runtime/development.ts
1
+ import { classNameObjectOptions, classObjectOptions, classStringOptions, createCva, isObject, mergeFragments, stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionName, toFragment } from "../formats-Ctf2WFc-.js";
2
+ // src/runtime/checked.ts
3
3
  /** Runtime validation selected explicitly by development compilations. */
4
4
  /**
5
5
  * Reads a compiled ref's class token once.
@@ -74,7 +74,7 @@ function mergeFragmentsChecked(options, values) {
74
74
  if (!isObject(value)) return;
75
75
  const symbols = Object.getOwnPropertySymbols(value);
76
76
  if (symbols.some((key) => !keys.includes(key))) throw new TypeError("Stillwind received a fragment from a different runtime instance.");
77
- if (!symbols.some((key) => keys.includes(key)) && (Object.hasOwn(value, "class") || Object.hasOwn(value, "className"))) throw new TypeError("Stillwind received a materialized props object; convert it with stillwindToFragment() first.");
77
+ if (!symbols.some((key) => keys.includes(key)) && (Object.hasOwn(value, "class") || Object.hasOwn(value, "className"))) throw new TypeError("Stillwind received a materialized props object; convert it with the ToFragment helper of its output format first.");
78
78
  const classes = value[stillwindClassKey];
79
79
  if (classes != null && typeof classes !== "string") throw new TypeError("Stillwind received a fragment with a non-string class value.");
80
80
  }
@@ -106,6 +106,42 @@ function stillwindViewTransitionNameChecked(value, key) {
106
106
  if (typeof token !== "string" || !token) throw new TypeError("Stillwind received a view transition without a class token.");
107
107
  return stillwindViewTransitionName(token, key);
108
108
  }
109
- export { createCvaChecked, mergeFragmentsChecked, stillwindClsxChecked, stillwindRefClassChecked, stillwindViewTransitionNameChecked, toFragmentChecked };
109
+ /** Checks fragment ownership and class contributions before materializing `class` and object styles. */
110
+ function stillwindClassObjectMergeChecked(...values) {
111
+ return mergeFragmentsChecked(classObjectOptions, values);
112
+ }
113
+ /** Rejects nonobjects before converting either class prop to a class-only fragment. */
114
+ function stillwindClassObjectToFragmentChecked(value) {
115
+ return toFragmentChecked(classObjectOptions, value);
116
+ }
117
+ /** Checks external classes and selected fragments before materializing CVA props with `class` and object styles. */
118
+ function stillwindClassObjectCvaChecked(base, config) {
119
+ return createCvaChecked(classObjectOptions, base, config);
120
+ }
121
+ /** Checks fragment ownership and class contributions before materializing `class` and string styles. */
122
+ function stillwindClassStringMergeChecked(...values) {
123
+ return mergeFragmentsChecked(classStringOptions, values);
124
+ }
125
+ /** Rejects nonobjects before converting either class prop to a class-only fragment. */
126
+ function stillwindClassStringToFragmentChecked(value) {
127
+ return toFragmentChecked(classStringOptions, value);
128
+ }
129
+ /** Checks external classes and selected fragments before materializing CVA props with `class` and string styles. */
130
+ function stillwindClassStringCvaChecked(base, config) {
131
+ return createCvaChecked(classStringOptions, base, config);
132
+ }
133
+ /** Checks fragment ownership and class contributions before materializing `className` and object styles. */
134
+ function stillwindClassNameObjectMergeChecked(...values) {
135
+ return mergeFragmentsChecked(classNameObjectOptions, values);
136
+ }
137
+ /** Rejects nonobjects before converting either class prop to a class-only fragment. */
138
+ function stillwindClassNameObjectToFragmentChecked(value) {
139
+ return toFragmentChecked(classNameObjectOptions, value);
140
+ }
141
+ /** Checks external classes and selected fragments before materializing CVA props with `className` and object styles. */
142
+ function stillwindClassNameObjectCvaChecked(base, config) {
143
+ return createCvaChecked(classNameObjectOptions, base, config);
144
+ }
145
+ export { stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectCvaChecked as stillwindClassNameObjectCva, stillwindClassNameObjectMergeChecked as stillwindClassNameObjectMerge, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragmentChecked as stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectCvaChecked as stillwindClassObjectCva, stillwindClassObjectMergeChecked as stillwindClassObjectMerge, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragmentChecked as stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringCvaChecked as stillwindClassStringCva, stillwindClassStringMergeChecked as stillwindClassStringMerge, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragmentChecked as stillwindClassStringToFragment, stillwindClsxChecked as stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindRefClassChecked, stillwindViewTransitionNameChecked as stillwindViewTransitionName };
110
146
 
111
- //# sourceMappingURL=development-J-JCSIm0.js.map
147
+ //# sourceMappingURL=development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"development.js","names":[],"sources":["../../src/runtime/checked.ts"],"sourcesContent":["/** Runtime validation selected explicitly by development compilations. */\n\nimport { createCva, type CompiledCvaConfig, type CvaValue } from \"./cva.ts\";\nimport { classNameObjectOptions, classObjectOptions, classStringOptions } from \"./formats.ts\";\nimport { isObject, mergeFragments, toFragment, type FragmentRuntimeOptions } from \"./fragment.ts\";\nimport { stillwindClsx, stillwindViewTransitionName } from \"./shared.ts\";\n\n/**\n * Reads a compiled ref's class token once.\n *\n * @param value - A ref record whose `.c` property contains a nonempty string.\n * @returns The class token.\n * @throws TypeError if the record or token is missing, or the token is empty or not a string.\n */\nexport function stillwindRefClassChecked(value: unknown): string {\n const token = isObject(value) ? value.c : undefined;\n if (typeof token !== \"string\" || !token) {\n throw new TypeError(\"Stillwind received a ref without a class token in .c.\");\n }\n return token;\n}\n\n/**\n * Validates external class inputs before concatenating them.\n *\n * @param values - Strings, numbers, bigints, nested arrays, or objects whose truthy entries enable their keys.\n * Booleans, null, and undefined add no text.\n * @returns Class text in contribution order without deduplication.\n * @throws TypeError when an input or nested array contains a function or symbol.\n */\nexport function stillwindClsxChecked(...values: readonly unknown[]): string {\n function check(value: unknown): void {\n if (value == null || [\"string\", \"number\", \"bigint\", \"boolean\"].includes(typeof value)) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach(check);\n return;\n }\n if (isObject(value)) {\n return;\n }\n throw new TypeError(`Stillwind received an unsupported class value: ${typeof value}.`);\n }\n values.forEach(check);\n return stillwindClsx(...values);\n}\n\n/**\n * Creates a CVA selector that validates external classes and selected fragment channels.\n * The selector throws TypeError for inputs rejected by `stillwindClsxChecked` or `mergeFragmentsChecked`.\n *\n * @param options - Framework conventions and the keys of the runtime that created the fragments.\n * @param base - Compiled styles included in every selection.\n * @param config - Immutable compiled option maps, defaults, and compound conditions.\n * @returns A selector with the same selection and props behavior as `createCva`.\n */\nexport function createCvaChecked(\n options: FragmentRuntimeOptions,\n base?: CvaValue,\n config?: CompiledCvaConfig,\n) {\n return createCva(options, base, config, stillwindClsxChecked, mergeFragmentsChecked);\n}\n\n/**\n * Validates fragment channels before materializing framework props.\n *\n * @param options - The receiving framework's conventions and distinct fragment keys.\n * @param values - Inputs accepted by `mergeFragments`.\n * @returns The same props as `mergeFragments` for valid inputs.\n * @throws TypeError for foreign symbol keys, unconverted class props, or a non-null class channel that is not a string.\n */\nexport function mergeFragmentsChecked(\n options: FragmentRuntimeOptions,\n values: readonly unknown[],\n): Record<string, unknown> {\n const [, , stillwindClassKey, stillwindStyleKey, stillwindCustomPropertiesKey] = options;\n const keys = [stillwindClassKey, stillwindStyleKey, stillwindCustomPropertiesKey];\n\n function check(value: unknown): void {\n if (Array.isArray(value)) {\n value.forEach(check);\n return;\n }\n if (!isObject(value)) {\n return;\n }\n const symbols = Object.getOwnPropertySymbols(value);\n if (symbols.some((key) => !keys.includes(key))) {\n throw new TypeError(\"Stillwind received a fragment from a different runtime instance.\");\n }\n if (\n !symbols.some((key) => keys.includes(key)) &&\n (Object.hasOwn(value, \"class\") || Object.hasOwn(value, \"className\"))\n ) {\n throw new TypeError(\n \"Stillwind received a materialized props object; convert it with the ToFragment helper of its output format first.\",\n );\n }\n const classes = value[stillwindClassKey];\n if (classes != null && typeof classes !== \"string\") {\n throw new TypeError(\"Stillwind received a fragment with a non-string class value.\");\n }\n }\n\n values.forEach(check);\n return mergeFragments(options, values);\n}\n\n/**\n * Validates a composition base before converting it to a class-only fragment.\n *\n * @param options - The receiving framework's conventions and distinct fragment keys.\n * @param value - A non-null props object or a fragment belonging to this runtime.\n * @returns The result of `toFragment` for the object.\n * @throws TypeError when the value is null or is not an object.\n */\nexport function toFragmentChecked(\n options: FragmentRuntimeOptions,\n value: unknown,\n): Record<PropertyKey, unknown> {\n if (!isObject(value)) {\n throw new TypeError(\"Stillwind expected a materialized props object.\");\n }\n return toFragment(options, value);\n}\n\n/**\n * Names a keyed view transition after reading its token once.\n *\n * @param value - A nonempty class token or a record whose `.v` contains that token.\n * @param key - A key appended after a hyphen using `String`.\n * @returns The token and key escaped as one CSS identifier.\n * @throws TypeError when the token is missing, empty, or not a string.\n */\nexport function stillwindViewTransitionNameChecked(value: unknown, key: string | number): string {\n const token = typeof value === \"string\" ? value : isObject(value) ? value.v : undefined;\n if (typeof token !== \"string\" || !token) {\n throw new TypeError(\"Stillwind received a view transition without a class token.\");\n }\n return stillwindViewTransitionName(token, key);\n}\n\n/** Checks fragment ownership and class contributions before materializing `class` and object styles. */\nexport function stillwindClassObjectMergeChecked(\n ...values: readonly unknown[]\n): Record<string, unknown> {\n return mergeFragmentsChecked(classObjectOptions, values);\n}\n\n/** Rejects nonobjects before converting either class prop to a class-only fragment. */\nexport function stillwindClassObjectToFragmentChecked(\n value: unknown,\n): Record<PropertyKey, unknown> {\n return toFragmentChecked(classObjectOptions, value);\n}\n\n/** Checks external classes and selected fragments before materializing CVA props with `class` and object styles. */\nexport function stillwindClassObjectCvaChecked(base?: CvaValue, config?: CompiledCvaConfig) {\n return createCvaChecked(classObjectOptions, base, config);\n}\n\n/** Checks fragment ownership and class contributions before materializing `class` and string styles. */\nexport function stillwindClassStringMergeChecked(\n ...values: readonly unknown[]\n): Record<string, unknown> {\n return mergeFragmentsChecked(classStringOptions, values);\n}\n\n/** Rejects nonobjects before converting either class prop to a class-only fragment. */\nexport function stillwindClassStringToFragmentChecked(\n value: unknown,\n): Record<PropertyKey, unknown> {\n return toFragmentChecked(classStringOptions, value);\n}\n\n/** Checks external classes and selected fragments before materializing CVA props with `class` and string styles. */\nexport function stillwindClassStringCvaChecked(base?: CvaValue, config?: CompiledCvaConfig) {\n return createCvaChecked(classStringOptions, base, config);\n}\n\n/** Checks fragment ownership and class contributions before materializing `className` and object styles. */\nexport function stillwindClassNameObjectMergeChecked(\n ...values: readonly unknown[]\n): Record<string, unknown> {\n return mergeFragmentsChecked(classNameObjectOptions, values);\n}\n\n/** Rejects nonobjects before converting either class prop to a class-only fragment. */\nexport function stillwindClassNameObjectToFragmentChecked(\n value: unknown,\n): Record<PropertyKey, unknown> {\n return toFragmentChecked(classNameObjectOptions, value);\n}\n\n/** Checks external classes and selected fragments before materializing CVA props with `className` and object styles. */\nexport function stillwindClassNameObjectCvaChecked(base?: CvaValue, config?: CompiledCvaConfig) {\n return createCvaChecked(classNameObjectOptions, base, config);\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,yBAAyB,OAAwB;CAC/D,MAAM,QAAQ,SAAS,KAAK,IAAI,MAAM,IAAI,KAAA;CAC1C,IAAI,OAAO,UAAU,YAAY,CAAC,OAChC,MAAM,IAAI,UAAU,uDAAuD;CAE7E,OAAO;AACT;;;;;;;;;AAUA,SAAgB,qBAAqB,GAAG,QAAoC;CAC1E,SAAS,MAAM,OAAsB;EACnC,IAAI,SAAS,QAAQ;GAAC;GAAU;GAAU;GAAU;EAAS,CAAC,CAAC,SAAS,OAAO,KAAK,GAClF;EAEF,IAAI,MAAM,QAAQ,KAAK,GAAG;GACxB,MAAM,QAAQ,KAAK;GACnB;EACF;EACA,IAAI,SAAS,KAAK,GAChB;EAEF,MAAM,IAAI,UAAU,kDAAkD,OAAO,MAAM,EAAE;CACvF;CACA,OAAO,QAAQ,KAAK;CACpB,OAAO,cAAc,GAAG,MAAM;AAChC;;;;;;;;;;AAWA,SAAgB,iBACd,SACA,MACA,QACA;CACA,OAAO,UAAU,SAAS,MAAM,QAAQ,sBAAsB,qBAAqB;AACrF;;;;;;;;;AAUA,SAAgB,sBACd,SACA,QACyB;CACzB,MAAM,KAAK,mBAAmB,mBAAmB,gCAAgC;CACjF,MAAM,OAAO;EAAC;EAAmB;EAAmB;CAA4B;CAEhF,SAAS,MAAM,OAAsB;EACnC,IAAI,MAAM,QAAQ,KAAK,GAAG;GACxB,MAAM,QAAQ,KAAK;GACnB;EACF;EACA,IAAI,CAAC,SAAS,KAAK,GACjB;EAEF,MAAM,UAAU,OAAO,sBAAsB,KAAK;EAClD,IAAI,QAAQ,MAAM,QAAQ,CAAC,KAAK,SAAS,GAAG,CAAC,GAC3C,MAAM,IAAI,UAAU,kEAAkE;EAExF,IACE,CAAC,QAAQ,MAAM,QAAQ,KAAK,SAAS,GAAG,CAAC,MACxC,OAAO,OAAO,OAAO,OAAO,KAAK,OAAO,OAAO,OAAO,WAAW,IAElE,MAAM,IAAI,UACR,mHACF;EAEF,MAAM,UAAU,MAAM;EACtB,IAAI,WAAW,QAAQ,OAAO,YAAY,UACxC,MAAM,IAAI,UAAU,8DAA8D;CAEtF;CAEA,OAAO,QAAQ,KAAK;CACpB,OAAO,eAAe,SAAS,MAAM;AACvC;;;;;;;;;AAUA,SAAgB,kBACd,SACA,OAC8B;CAC9B,IAAI,CAAC,SAAS,KAAK,GACjB,MAAM,IAAI,UAAU,iDAAiD;CAEvE,OAAO,WAAW,SAAS,KAAK;AAClC;;;;;;;;;AAUA,SAAgB,mCAAmC,OAAgB,KAA8B;CAC/F,MAAM,QAAQ,OAAO,UAAU,WAAW,QAAQ,SAAS,KAAK,IAAI,MAAM,IAAI,KAAA;CAC9E,IAAI,OAAO,UAAU,YAAY,CAAC,OAChC,MAAM,IAAI,UAAU,6DAA6D;CAEnF,OAAO,4BAA4B,OAAO,GAAG;AAC/C;;AAGA,SAAgB,iCACd,GAAG,QACsB;CACzB,OAAO,sBAAsB,oBAAoB,MAAM;AACzD;;AAGA,SAAgB,sCACd,OAC8B;CAC9B,OAAO,kBAAkB,oBAAoB,KAAK;AACpD;;AAGA,SAAgB,+BAA+B,MAAiB,QAA4B;CAC1F,OAAO,iBAAiB,oBAAoB,MAAM,MAAM;AAC1D;;AAGA,SAAgB,iCACd,GAAG,QACsB;CACzB,OAAO,sBAAsB,oBAAoB,MAAM;AACzD;;AAGA,SAAgB,sCACd,OAC8B;CAC9B,OAAO,kBAAkB,oBAAoB,KAAK;AACpD;;AAGA,SAAgB,+BAA+B,MAAiB,QAA4B;CAC1F,OAAO,iBAAiB,oBAAoB,MAAM,MAAM;AAC1D;;AAGA,SAAgB,qCACd,GAAG,QACsB;CACzB,OAAO,sBAAsB,wBAAwB,MAAM;AAC7D;;AAGA,SAAgB,0CACd,OAC8B;CAC9B,OAAO,kBAAkB,wBAAwB,KAAK;AACxD;;AAGA,SAAgB,mCAAmC,MAAiB,QAA4B;CAC9F,OAAO,iBAAiB,wBAAwB,MAAM,MAAM;AAC9D"}
@@ -0,0 +1,2 @@
1
+ import { 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 } from "../formats-aeLCNAXl.js";
2
+ export { 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 };
@@ -0,0 +1 @@
1
+ export { 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 } from "../formats-Ctf2WFc-.js";
@@ -25,6 +25,9 @@ function createStyleMacro() {
25
25
  viewTransition() {
26
26
  throw new Error("Stillwind style.viewTransition() is a compile-time macro.");
27
27
  },
28
+ when() {
29
+ throw new Error("Stillwind style.when() is a compile-time macro.");
30
+ },
28
31
  cva() {
29
32
  throw new Error("Stillwind style.cva() is a compile-time macro.");
30
33
  },
@@ -38,4 +41,4 @@ function createStyleMacro() {
38
41
  }
39
42
  export { createStyleMacro };
40
43
 
41
- //# sourceMappingURL=style-fTQbsVWZ.js.map
44
+ //# sourceMappingURL=style-BE8vuLiO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-BE8vuLiO.js","names":[],"sources":["../src/macro/style.ts"],"sourcesContent":["/** Framework macros and the placeholders that the compiler replaces. */\n\nimport type { StyleCssInput, StyleCssOptions } from \"./css.ts\";\nimport type {\n CvaClassProps,\n CvaConfig,\n CvaInput,\n CvaResult,\n CvaSelection,\n CvaVariants,\n} from \"./cva.ts\";\nimport type { CheckedStyleInputs, StyleArgument } from \"./input.ts\";\nimport type { StyleKeyframes, StyleKeyframesDefinition } from \"./keyframes.ts\";\nimport type { StyleOutput, StyleResult } from \"./output.ts\";\nimport type { StyleRefProjection } from \"./projection.ts\";\nimport type { AnchorScope, StyleRef, StyleVariantKey } from \"./refs.ts\";\nimport type { StyleViewTransition, StyleViewTransitionDefinition } from \"./view-transition.ts\";\nimport type { StyleStoredVariant } from \"./when.ts\";\n\n/**\n * Internal use only. The compiler inserts this identity argument in source used by the\n * TypeScript checker. Application code must not construct or pass it.\n *\n * @internal\n */\nexport type StillwindDeclarationIdentity<Id extends string> = {\n readonly __stillwindDeclarationIdentity: Id;\n};\n\n/**\n * Compile-time UI declarations with pure value expressions.\n *\n * Only completed style calls and declaration macros produce reusable values.\n * Projections require their supported style input positions. Ref variants require\n * computed variant keys or utility template substitutions.\n *\n * Each argument expression must return an equivalent value for the same inputs and must\n * not mutate shared data or perform observable effects, including through callees,\n * getters, or value conversion. Calls need no PURE annotation. Functions may mutate\n * fresh local data used only to compute their result.\n *\n * Evaluation order and count are not API guarantees: unused expressions may be omitted\n * and class/value conversions may be combined. Do not rely on exceptions from unused\n * expressions. Read time/randomness and perform I/O, state updates, Hooks, await/yield,\n * imports, JSX, and class initialization outside the macro. Pass their resulting\n * values. Reactive reads stay in the current computation scope and must not be used\n * only to establish a subscription.\n *\n * Names, utility definitions, animation options, and selector/query arguments are\n * static declarations. Dynamic identity selectors and view-transition keys obey the\n * same value-expression contract. Declaration-identity overloads are internal checker\n * metadata.\n */\nexport type StyleMacro<Props = object> = {\n /**\n * Internal use only. The checker supplies the final identity argument to track the\n * completed props value. Application code must use the overload without it.\n *\n * @param inputs - Style inputs followed by the declaration identity inserted by the compiler.\n * The public overload validates authored inputs. This overload adds identity tracking for the checker.\n * @returns The composed style props with the supplied declaration identity.\n * @internal\n */\n <Inputs extends readonly StyleArgument[], Id extends string>(\n ...inputs: [...Inputs, StillwindDeclarationIdentity<Id>]\n ): StyleResult<Id, StyleOutput<Props, Inputs>>;\n\n /**\n * Compiles static utility branches and combines them with inline custom\n * properties, external classes, and completed style props.\n *\n * Value expressions must obey the purity contract of {@link StyleMacro}. Projection\n * and animation-use calls must appear directly at supported input positions. Ref\n * variants require computed keys or utility template substitutions.\n *\n * @param inputs - Rule and class inputs in composition order. Custom properties\n * replace earlier values, and classes are concatenated. Utility construction must be\n * static, and invalid utilities or unsupported syntax cause compilation errors.\n * @returns Framework props that may be stored, exported, passed, returned, or spread\n * onto an element. Store this result before passing it to another `style()` call.\n * Direct nested calls are rejected. The class prop is optional. The optional style\n * prop is present in the type when inputs include custom properties, participant\n * naming, or composed props that may contain inline style. CSS is emitted at build\n * time.\n */\n <Inputs extends readonly StyleArgument[]>(\n ...inputs: Inputs & CheckedStyleInputs<Inputs>\n ): StyleResult<string, StyleOutput<Props, Inputs>>;\n\n /**\n * Declares an unlabeled DOM identity in a binding initializer.\n * Passing the declaration to `style()` attaches its marker to that element.\n *\n * @returns A reusable ref declaration that may be stored, exported, passed, returned,\n * or conditionally selected. Its identity belongs to the declaration site. Repeated\n * evaluation does not allocate new CSS identities.\n */\n ref(): StyleRef;\n\n /**\n * Declares a labeled DOM identity in a binding initializer.\n * Passing the declaration to `style()` attaches its marker to that element.\n *\n * @param label - A string literal used in generated names. Empty text omits the\n * label. Labels do not determine declaration identity.\n * @returns A reusable ref declaration that may be stored, exported, passed, returned,\n * or conditionally selected. Repeated evaluation keeps its identity.\n */\n ref(label: string): StyleRef;\n\n /**\n * Internal use only. The checker supplies identity for an unlabeled ref declaration.\n * Application code must use `ref()` without this argument.\n *\n * @internal\n */\n ref<const Id extends string>(identity: StillwindDeclarationIdentity<Id>): StyleRef<Id>;\n\n /**\n * Internal use only. The checker supplies identity for a labeled ref declaration.\n * Application code must use `ref(label)` without the identity argument.\n *\n * @internal\n */\n ref<const Id extends string>(\n label: string,\n identity: StillwindDeclarationIdentity<Id>,\n ): StyleRef<Id>;\n\n /**\n * Declares a local animation in a binding initializer and assigns its CSS name.\n *\n * Apply it by calling the returned declaration with literal options directly inside\n * `style()`. The animation use cannot be stored for later consumption.\n *\n * @param definition - A direct static object with frame utility strings, optional\n * media/supports replacement bodies, and an optional literal label. Invalid frame\n * syntax or utilities cause compilation errors.\n * @returns A reusable keyframes declaration that may be stored, exported, passed,\n * returned, or conditionally selected. Its identity belongs to the declaration site.\n */\n keyframes(definition: StyleKeyframesDefinition): StyleKeyframes;\n\n /**\n * Internal use only. The checker supplies identity for a keyframes declaration.\n * Application code must use `keyframes(definition)` without the identity argument.\n *\n * @internal\n */\n keyframes<const Id extends string>(\n definition: StyleKeyframesDefinition,\n identity: StillwindDeclarationIdentity<Id>,\n ): StyleKeyframes<Id>;\n\n /**\n * Declares view transition phases in a binding initializer and assigns their class.\n *\n * Pass the declaration to `style()` to mark participants, or call `.for(key)`\n * directly inside `style()` to also name them. The naming use cannot be stored.\n *\n * @param definition - A direct static object with at least one literal phase\n * string and an optional literal label. Invalid phases, utilities, or condition\n * variants cause compilation errors.\n * @returns A reusable transition declaration that may be stored, exported, passed,\n * returned, or conditionally selected. Its identity belongs to the declaration site.\n */\n viewTransition(definition: StyleViewTransitionDefinition): StyleViewTransition;\n\n /**\n * Internal use only. The checker supplies identity for a view transition declaration.\n * Application code must use `viewTransition(definition)` without the identity argument.\n *\n * @internal\n */\n viewTransition<const Id extends string>(\n definition: StyleViewTransitionDefinition,\n identity: StillwindDeclarationIdentity<Id>,\n ): StyleViewTransition<Id>;\n\n /**\n * Stores variant sequences in a binding initializer for later use in `style()`.\n *\n * Use the result as a computed variant key, as a variant segment followed by `:` in\n * a utility template, or in the argument of another `style.when()`. Each use means\n * the same as writing the sequence directly at that position, so the sequence obeys\n * the same rules as a variant key written in `style()`. A use must resolve to one\n * declaration. The compiler replaces the call with `undefined`.\n *\n * With several arguments, the stored variant matches when any argument matches. A\n * use means the same as writing the use once for each argument, in argument order.\n *\n * @param variants - Static variant sequences. Each one is a string literal such as\n * `\"hover:md\"`, a ref variant call or tag with optional `.in()` calls, a container\n * variant, another stored variant, or a template literal whose substitutions are\n * complete variant segments. The final `:` is optional. Invalid sequences produce\n * lint findings.\n * @returns A stored variant that may be stored, exported, imported, and passed.\n */\n when(\n ...variants: [string | StyleVariantKey, ...(string | StyleVariantKey)[]]\n ): StyleStoredVariant;\n\n /**\n * Internal use only. The checker supplies identity for a stored variant declaration.\n * Application code must use `when(...variants)` without the identity argument.\n *\n * @internal\n */\n when<const Id extends string>(\n ...variants: [\n string | StyleVariantKey,\n ...(string | StyleVariantKey)[],\n StillwindDeclarationIdentity<Id>,\n ]\n ): StyleStoredVariant<Id>;\n\n /**\n * Adds anchor-scope without requiring a ref marker on the element.\n *\n * Use this call directly in a style input. The argument follows the same literal\n * keyword or array rules as `ref.asAnchor`. An empty array emits no declaration.\n * The returned projection cannot be stored, exported, passed, or returned for later\n * consumption.\n *\n * @param scope - A literal `\"all\"`, `\"none\"`, or array of refs. All possible\n * identities of each entry are included. Empty arrays and duplicate identities\n * produce lint findings.\n * @returns Rule input that supplies anchor-scope when consumed by `style()`.\n */\n anchorScope(scope: AnchorScope): StyleRefProjection;\n\n /**\n * Returns the media query list of variants, such as for `window.matchMedia()`.\n *\n * The compiler replaces the call with a string, so the result can be stored, exported,\n * and passed. The string has no `@media` or braces. Write the call outside other macro\n * calls.\n *\n * @param variants - String literals of variants whose definitions contain only media\n * conditions, with an optional final `:`. The variants of one argument must all hold,\n * and the arguments are alternatives: `media(\"sm:motion-reduce\", \"print\")` matches a\n * wide screen with reduced motion, or print. An argument that does not resolve or that\n * contains another kind of condition, such as `hover`, matches nothing and produces a\n * lint finding.\n * @returns A media query list. It is `\"not all\"` when no argument can match.\n */\n media(...variants: [string, ...string[]]): string;\n\n /**\n * Returns a stylesheet built from utilities, such as for a shadow root.\n *\n * The compiler replaces the call with a string, so the result can be stored,\n * exported, and passed, for example to `CSSStyleSheet.replaceSync()`. The call adds\n * nothing to the document stylesheet. The string contains the rules and the theme\n * values, keyframes, and custom-property support that they need, placed by the\n * selected `@stillwind-css-template`. It never contains preflight.\n *\n * A selector-replacing variant, such as `host:`, `[:host]:`, or `[button]:`, selects\n * the element that a utility styles. Utilities without one need the `selector`\n * option, or are omitted with a lint finding. Write the call outside other macro\n * calls.\n *\n * @param inputs - Static utility strings, arrays, and variant groups. A final\n * object whose keys are only `template` and `selector` is the options.\n * @returns Stylesheet text.\n */\n css(...inputs: StyleCssInput[]): string;\n\n /**\n * Returns a stylesheet built from utilities, with the options in the last argument.\n *\n * @param inputs - Static utility inputs followed by the options object.\n * @returns Stylesheet text.\n */\n css(...inputs: [...StyleCssInput[], StyleCssOptions]): string;\n\n /**\n * Compiles a CVA definition and returns a function that selects element props.\n * Write the configuration and utility inputs directly in the call. Utility inputs\n * cannot contain `&&` or ternary expressions. Pass runtime conditions as variant\n * selections. Custom properties remain inline and value expressions obey this\n * macro's purity contract.\n *\n * @param base - Optional styles included in every selection.\n * @param config - Static variants, defaults, and compound conditions.\n * @returns A reusable factory returning fresh framework class and style props.\n * Its results cannot be passed to style() for composition.\n */\n cva<Variants extends CvaVariants = Record<never, never>>(\n base?: CvaInput,\n config?: CvaConfig<Variants>,\n ): (props?: CvaSelection<Variants> & CvaClassProps) => CvaResult<Props>;\n};\n\n/**\n * Internal use only. Builds the placeholder exported by each framework entrypoint.\n * The compiler replaces supported macro calls before the application runs.\n *\n * @returns A fresh callable object with declaration and scope methods. Calling the\n * object or any of these methods throws an Error about missing integration. Creating\n * the placeholder itself does not execute any macro or generate CSS.\n *\n * @internal\n */\nexport function createStyleMacro<Props>(): StyleMacro<Props> {\n return Object.assign(\n (): never => {\n throw new Error(\n \"Stillwind style() is a compile-time macro. Configure the Stillwind integration for your build tool.\",\n );\n },\n {\n anchorScope(): never {\n throw new Error(\"Stillwind style.anchorScope() is a compile-time macro.\");\n },\n ref(): never {\n throw new Error(\"Stillwind style.ref() is a compile-time macro.\");\n },\n keyframes(): never {\n throw new Error(\"Stillwind style.keyframes() is a compile-time macro.\");\n },\n viewTransition(): never {\n throw new Error(\"Stillwind style.viewTransition() is a compile-time macro.\");\n },\n when(): never {\n throw new Error(\"Stillwind style.when() is a compile-time macro.\");\n },\n cva(): never {\n throw new Error(\"Stillwind style.cva() is a compile-time macro.\");\n },\n media(): never {\n throw new Error(\"Stillwind style.media() is a compile-time macro.\");\n },\n css(): never {\n throw new Error(\"Stillwind style.css() is a compile-time macro.\");\n },\n },\n );\n}\n"],"mappings":";;;;;;;;;;;AAgTA,SAAgB,mBAA6C;CAC3D,OAAO,OAAO,aACC;EACX,MAAM,IAAI,MACR,qGACF;CACF,GACA;EACE,cAAqB;GACnB,MAAM,IAAI,MAAM,wDAAwD;EAC1E;EACA,MAAa;GACX,MAAM,IAAI,MAAM,gDAAgD;EAClE;EACA,YAAmB;GACjB,MAAM,IAAI,MAAM,sDAAsD;EACxE;EACA,iBAAwB;GACtB,MAAM,IAAI,MAAM,2DAA2D;EAC7E;EACA,OAAc;GACZ,MAAM,IAAI,MAAM,iDAAiD;EACnE;EACA,MAAa;GACX,MAAM,IAAI,MAAM,gDAAgD;EAClE;EACA,QAAe;GACb,MAAM,IAAI,MAAM,kDAAkD;EACpE;EACA,MAAa;GACX,MAAM,IAAI,MAAM,gDAAgD;EAClE;CACF,CACF;AACF"}
@@ -27,7 +27,7 @@ inside a style rule or a utility definition. Whitespace separates the utilities.
27
27
  ### Generated stylesheet without preflight
28
28
 
29
29
  ```css
30
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
30
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
31
31
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
32
32
  @layer properties, theme, base, components, utilities;
33
33
 
@@ -54,7 +54,7 @@ export const link = {className:"sw_r7v8w"};
54
54
  ### Generated stylesheet without preflight
55
55
 
56
56
  ```css
57
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
57
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
58
58
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
59
59
  @layer properties, theme, base, components, utilities;
60
60
 
@@ -42,7 +42,7 @@ export const link = {className:"sw_4x5c3"};
42
42
  ### Generated stylesheet without preflight
43
43
 
44
44
  ```css
45
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
45
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
46
46
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
47
47
  @layer properties, theme, base, components, utilities;
48
48
 
@@ -52,7 +52,7 @@ export const icon = {className:"sw_7ic77"};
52
52
  ### Generated stylesheet without preflight
53
53
 
54
54
  ```css
55
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
55
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
56
56
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
57
57
  @layer properties, theme, base, components, utilities;
58
58
 
@@ -62,7 +62,7 @@ export const panel = {className:"sw_2wahw"};
62
62
  ### Generated stylesheet without preflight
63
63
 
64
64
  ```css
65
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
65
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
66
66
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
67
67
  @layer properties, theme, base, components, utilities;
68
68
 
@@ -54,7 +54,7 @@ export const icon = {className:"sw_7ic77"};
54
54
  ### Generated stylesheet without preflight
55
55
 
56
56
  ```css
57
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
57
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
58
58
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
59
59
  @layer properties, theme, base, components, utilities;
60
60
 
@@ -45,7 +45,7 @@ export const accepted = {className:"sw_obysi"};
45
45
  ### Generated stylesheet without preflight
46
46
 
47
47
  ```css
48
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
48
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
49
49
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
50
50
  @layer properties, theme, base, components, utilities;
51
51
 
@@ -48,7 +48,7 @@ export const replaced = {className:"sw_vofby"};
48
48
  ### Generated stylesheet without preflight
49
49
 
50
50
  ```css
51
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
51
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
52
52
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
53
53
  @layer properties, theme, base, components, utilities;
54
54
 
@@ -42,7 +42,7 @@ export const toolbar = {};
42
42
  ### Generated stylesheet without preflight
43
43
 
44
44
  ```css
45
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
45
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
46
46
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
47
47
  @layer properties, theme, base, components, utilities;
48
48
  ```
@@ -44,7 +44,7 @@ export const card = {className:"sw_j7rat"};
44
44
  ### Generated stylesheet without preflight
45
45
 
46
46
  ```css
47
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
47
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
48
48
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
49
49
  @layer properties, theme, base, components, utilities;
50
50
 
@@ -110,7 +110,7 @@ export const label = {className:"sw_4zrwj"};
110
110
  ### Generated stylesheet without preflight
111
111
 
112
112
  ```css
113
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
113
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
114
114
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
115
115
  @layer properties, theme, base, components, utilities;
116
116
 
@@ -163,7 +163,7 @@ export const title = {className:"sw_mjcfr"};
163
163
  ### Generated stylesheet without preflight
164
164
 
165
165
  ```css
166
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
166
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
167
167
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
168
168
  @layer properties, theme, base, components, utilities;
169
169
 
@@ -216,7 +216,7 @@ export const done = {className:"sw_j94hj"};
216
216
  ### Generated stylesheet without preflight
217
217
 
218
218
  ```css
219
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
219
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
220
220
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
221
221
  @layer properties, theme, base, components, utilities;
222
222
 
@@ -269,7 +269,7 @@ export const page = {className:"sw_rjnyv"};
269
269
  ### Generated stylesheet without preflight
270
270
 
271
271
  ```css
272
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
272
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
273
273
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
274
274
  @layer properties, theme, base, components, utilities;
275
275
 
@@ -51,7 +51,7 @@ export const list = {className:"sw_70m3s"};
51
51
  ### Generated stylesheet without preflight
52
52
 
53
53
  ```css
54
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
54
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
55
55
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
56
56
  @layer properties, theme, base, components, utilities;
57
57
 
@@ -116,7 +116,7 @@ export const code = {className:"sw_9jkuo"};
116
116
  ### Generated stylesheet without preflight
117
117
 
118
118
  ```css
119
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
119
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
120
120
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
121
121
  @layer properties, theme, base, components, utilities;
122
122
 
@@ -172,7 +172,7 @@ export const page = {className:"sw_5yksj"};
172
172
  ### Generated stylesheet without preflight
173
173
 
174
174
  ```css
175
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
175
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
176
176
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
177
177
  @layer properties, theme, base, components, utilities;
178
178
 
@@ -268,7 +268,7 @@ export const icon = {className:"sw_smxmp"};
268
268
  ### Generated stylesheet without preflight
269
269
 
270
270
  ```css
271
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
271
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
272
272
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
273
273
  @layer properties, theme, base, components, utilities;
274
274
 
@@ -39,7 +39,7 @@ body, that element is the one that uses the utility.
39
39
  ### Generated stylesheet without preflight
40
40
 
41
41
  ```css
42
- /*! stillwind v0.7.0 | MIT License | https://stillwind.dev */
42
+ /*! stillwind v0.8.0 | MIT License | https://stillwind.dev */
43
43
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
44
44
  @layer properties, theme, base, components, utilities;
45
45
 
package/docs/cli.md CHANGED
@@ -64,7 +64,10 @@ vp exec stillwind lint --max-warnings 0
64
64
  ```
65
65
 
66
66
  `lint` reports findings and saves no files. Text output shows a `help:` message when
67
- a finding has a suggested edit. Not every suggested edit is an automatic fix.
67
+ a finding has a suggested edit. Not every suggested edit is an automatic fix. A
68
+ `docs:` line gives the page that explains the rule or error. It is the page in the
69
+ installed `stillwind` package when the package has one, and otherwise the page on
70
+ this website.
68
71
 
69
72
  | Option | Effect |
70
73
  | -------------------- | --------------------------------------------------------------------- |
@@ -63,11 +63,11 @@ export const danger = style(base, "bg-red-600");
63
63
  ### Compiled code
64
64
 
65
65
  ```ts
66
- import { stillwindClassKey, stillwindClsx, stillwindMerge, stillwindToFragment } from "stillwind/runtime/class-name-object";
66
+ import { stillwindClsx, stillwindClassNameObjectClassKey, stillwindClassNameObjectMerge, stillwindClassNameObjectToFragment } from "stillwind/runtime";
67
67
 
68
68
  declare const active: boolean;
69
69
  const base = {className:stillwindClsx("sw_fnaqw",(active) && ("sw_numny"))};
70
- export const danger = stillwindMerge({[stillwindClassKey]:"sw_r65in"},stillwindToFragment((base)));
70
+ export const danger = stillwindClassNameObjectMerge({[stillwindClassNameObjectClassKey]:"sw_r65in"},stillwindClassNameObjectToFragment((base)));
71
71
  ```
72
72
 
73
73
  ### Generated CSS
@@ -183,10 +183,10 @@ export const danger = style(base, "bg-red-600");
183
183
  ### Compiled code
184
184
 
185
185
  ```ts
186
- import { stillwindClassKey, stillwindMerge, stillwindToFragment } from "stillwind/runtime/class-name-object";
186
+ import { stillwindClassNameObjectClassKey, stillwindClassNameObjectMerge, stillwindClassNameObjectToFragment } from "stillwind/runtime";
187
187
 
188
188
  const base = {className:"sw_221vg"};
189
- export const danger = stillwindMerge({[stillwindClassKey]:"sw_crw5t"},stillwindToFragment((base)));
189
+ export const danger = stillwindClassNameObjectMerge({[stillwindClassNameObjectClassKey]:"sw_crw5t"},stillwindClassNameObjectToFragment((base)));
190
190
  ```
191
191
 
192
192
  ### Generated CSS
@@ -71,7 +71,7 @@ export const props = style("p-4", active && "bg-blue-500", { "--progress": progr
71
71
  ### Compiled code
72
72
 
73
73
  ```ts
74
- import { stillwindClsx, stillwindCssValue } from "stillwind/runtime/class-name-object";
74
+ import { stillwindClsx, stillwindCssValue } from "stillwind/runtime";
75
75
 
76
76
  declare const active: boolean;
77
77
  declare const progress: number;
@@ -107,8 +107,8 @@ chooses class names and sets property values.
107
107
  | [`style.css()`](../macros/css.md) | A CSS string that you place yourself |
108
108
 
109
109
  Development builds import checked versions of the helpers from
110
- `stillwind/runtime/class-name-object-development`. These versions report invalid values
111
- while you develop. Production builds use the unchecked helpers.
110
+ `stillwind/runtime/development`. These versions report invalid values while you
111
+ develop. Production builds import the unchecked helpers from `stillwind/runtime`.
112
112
 
113
113
  ## The generated stylesheet
114
114