stillwind 0.12.0 → 0.14.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 (94) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +1 -1
  3. package/css/builtin-utilities/tw-borders.css +59 -59
  4. package/css/builtin-utilities/tw-effects.css +53 -53
  5. package/css/builtin-utilities/tw-typography.css +13 -13
  6. package/dist/class-object-C87DR3v2.js +6 -0
  7. package/dist/class-object-C87DR3v2.js.map +1 -0
  8. package/dist/class-object-CR0QHoF9.d.ts +10 -0
  9. package/dist/{class-string-DQmH4PZX.d.ts → class-string-BlClX8JK.d.ts} +2 -2
  10. package/dist/class-string-CiNTVHYm.js +6 -0
  11. package/dist/{class-string-CrQnTRvI.js.map → class-string-CiNTVHYm.js.map} +1 -1
  12. package/dist/{formats-Ctf2WFc-.js → formats-DP9B9SG6.js} +228 -113
  13. package/dist/formats-DP9B9SG6.js.map +1 -0
  14. package/dist/{formats-aeLCNAXl.d.ts → formats-NBNjMP5R.d.ts} +34 -12
  15. package/dist/frameworks/alpine.d.ts +5 -3
  16. package/dist/frameworks/alpine.js +3 -1
  17. package/dist/frameworks/alpine.js.map +1 -1
  18. package/dist/frameworks/astro.d.ts +3 -3
  19. package/dist/frameworks/astro.js +1 -1
  20. package/dist/frameworks/lit.d.ts +5 -3
  21. package/dist/frameworks/lit.js +3 -1
  22. package/dist/frameworks/lit.js.map +1 -1
  23. package/dist/frameworks/preact.d.ts +3 -3
  24. package/dist/frameworks/preact.js +1 -1
  25. package/dist/frameworks/qwik.d.ts +3 -3
  26. package/dist/frameworks/qwik.js +1 -1
  27. package/dist/frameworks/react.d.ts +2 -2
  28. package/dist/frameworks/react.js +1 -1
  29. package/dist/frameworks/solid.d.ts +3 -3
  30. package/dist/frameworks/solid.js +1 -1
  31. package/dist/frameworks/svelte.d.ts +3 -3
  32. package/dist/frameworks/svelte.js +1 -1
  33. package/dist/frameworks/vanilla.d.ts +5 -3
  34. package/dist/frameworks/vanilla.js +6 -1
  35. package/dist/frameworks/vanilla.js.map +1 -0
  36. package/dist/frameworks/vue.d.ts +3 -3
  37. package/dist/frameworks/vue.js +1 -1
  38. package/dist/{index-uw1R9t_P.d.ts → index-DpaDcczW.d.ts} +150 -50
  39. package/dist/macro/index.d.ts +2 -2
  40. package/dist/macro/index.js +1 -1
  41. package/dist/runtime/development.d.ts +16 -8
  42. package/dist/runtime/development.js +57 -21
  43. package/dist/runtime/development.js.map +1 -1
  44. package/dist/runtime/index.d.ts +2 -2
  45. package/dist/runtime/index.js +1 -1
  46. package/dist/{style-Bzuux32Y.js → style-dMBm8aX_.js} +6 -3
  47. package/dist/style-dMBm8aX_.js.map +1 -0
  48. package/docs/at-rules/apply.md +1 -1
  49. package/docs/at-rules/custom-variant.md +1 -1
  50. package/docs/at-rules/slot.md +1 -1
  51. package/docs/at-rules/stillwind-property.md +1 -1
  52. package/docs/at-rules/stillwind-registry.md +7 -7
  53. package/docs/at-rules/stillwind-require-properties.md +1 -1
  54. package/docs/at-rules/stillwind-undef-arbitrary-property.md +1 -1
  55. package/docs/at-rules/stillwind-undef-utility.md +1 -1
  56. package/docs/at-rules/stillwind-undef-variant.md +1 -1
  57. package/docs/at-rules/theme.md +5 -5
  58. package/docs/at-rules/utility.md +43 -4
  59. package/docs/at-rules/variant.md +1 -1
  60. package/docs/concepts/css-ordering.md +47 -7
  61. package/docs/concepts/how-styles-compile.md +8 -8
  62. package/docs/errors/SW10006.md +34 -0
  63. package/docs/errors/SW11001.md +4 -2
  64. package/docs/errors/index.md +1 -1
  65. package/docs/guides/migrating-from-tailwind.md +52 -9
  66. package/docs/guides/reusable-styles.md +2 -2
  67. package/docs/guides/style.md +1 -4
  68. package/docs/integrations.md +20 -1
  69. package/docs/lints/ambiguous-style-base-order.md +3 -1
  70. package/docs/lints/conflicting-provider-properties.md +3 -0
  71. package/docs/lints/conflicting-utilities.md +9 -0
  72. package/docs/lints/cyclic-style-order.md +68 -0
  73. package/docs/lints/index.md +14 -10
  74. package/docs/lints/interfering-imported-style-base.md +13 -22
  75. package/docs/lints/{invalid-cva-config.md → invalid-recipe-config.md} +8 -8
  76. package/docs/lints/{invalid-cva-input.md → invalid-recipe-input.md} +9 -9
  77. package/docs/lints/multiple-style-forwards.md +59 -0
  78. package/docs/lints/partial-utility-override.md +77 -0
  79. package/docs/lints/utility-class-selector.md +72 -0
  80. package/docs/llms.txt +8 -4
  81. package/docs/macros/index.md +1 -1
  82. package/docs/macros/recipe.md +246 -0
  83. package/docs/macros/style.md +62 -0
  84. package/docs/macros/when.md +1 -1
  85. package/package.json +7 -7
  86. package/skills/stillwind/SKILL.md +1 -1
  87. package/dist/class-object-CXvJOi2z.d.ts +0 -9
  88. package/dist/class-object-CzD1oMD_.js +0 -6
  89. package/dist/class-object-CzD1oMD_.js.map +0 -1
  90. package/dist/class-string-CrQnTRvI.js +0 -6
  91. package/dist/formats-Ctf2WFc-.js.map +0 -1
  92. package/dist/style-Bzuux32Y.js.map +0 -1
  93. package/docs/errors/SW11002.md +0 -65
  94. package/docs/macros/cva.md +0 -155
@@ -1,4 +1,4 @@
1
- import { CompiledCvaConfig, CvaValue, stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindCssValue, stillwindEscapedIdentifier } from "../formats-aeLCNAXl.js";
1
+ import { CompiledRecipeConfig, RecipeSelector, RecipeValue, stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindCssValue, stillwindEscapedIdentifier } from "../formats-NBNjMP5R.js";
2
2
  /**
3
3
  * Reads a compiled ref's class token once.
4
4
  *
@@ -29,19 +29,27 @@ declare function stillwindViewTransitionNameChecked(value: unknown, key: string
29
29
  declare function stillwindClassObjectMergeChecked(...values: readonly unknown[]): Record<string, unknown>;
30
30
  /** Rejects nonobjects before converting either class prop to a class-only fragment. */
31
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>;
32
+ /** Checks forwarded class and style values for a framework without style arrays. */
33
+ declare function stillwindClassObjectForwardChecked(value: unknown): Record<PropertyKey, unknown>;
34
+ /** Checks forwarded class and style values for a framework that accepts style arrays. */
35
+ declare function stillwindClassObjectForwardArraysChecked(value: unknown): Record<PropertyKey, unknown>;
36
+ /** Checks external classes and selected fragments before materializing recipe props with `class` and object styles. */
37
+ declare function stillwindClassObjectRecipeChecked(base?: RecipeValue, config?: CompiledRecipeConfig): RecipeSelector;
34
38
  /** Checks fragment ownership and class contributions before materializing `class` and string styles. */
35
39
  declare function stillwindClassStringMergeChecked(...values: readonly unknown[]): Record<string, unknown>;
36
40
  /** Rejects nonobjects before converting either class prop to a class-only fragment. */
37
41
  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>;
42
+ /** Checks forwarded class and style values for a framework without style arrays. */
43
+ declare function stillwindClassStringForwardChecked(value: unknown): Record<PropertyKey, unknown>;
44
+ /** Checks external classes and selected fragments before materializing recipe props with `class` and string styles. */
45
+ declare function stillwindClassStringRecipeChecked(base?: RecipeValue, config?: CompiledRecipeConfig): RecipeSelector;
40
46
  /** Checks fragment ownership and class contributions before materializing `className` and object styles. */
41
47
  declare function stillwindClassNameObjectMergeChecked(...values: readonly unknown[]): Record<string, unknown>;
42
48
  /** Rejects nonobjects before converting either class prop to a class-only fragment. */
43
49
  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 };
50
+ /** Checks forwarded class and style values for a framework without style arrays. */
51
+ declare function stillwindClassNameObjectForwardChecked(value: unknown): Record<PropertyKey, unknown>;
52
+ /** Checks external classes and selected fragments before materializing recipe props with `className` and object styles. */
53
+ declare function stillwindClassNameObjectRecipeChecked(base?: RecipeValue, config?: CompiledRecipeConfig): RecipeSelector;
54
+ export { stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectForwardChecked as stillwindClassNameObjectForward, stillwindClassNameObjectMergeChecked as stillwindClassNameObjectMerge, stillwindClassNameObjectRecipeChecked as stillwindClassNameObjectRecipe, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragmentChecked as stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectForwardChecked as stillwindClassObjectForward, stillwindClassObjectForwardArraysChecked as stillwindClassObjectForwardArrays, stillwindClassObjectMergeChecked as stillwindClassObjectMerge, stillwindClassObjectRecipeChecked as stillwindClassObjectRecipe, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragmentChecked as stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringForwardChecked as stillwindClassStringForward, stillwindClassStringMergeChecked as stillwindClassStringMerge, stillwindClassStringRecipeChecked as stillwindClassStringRecipe, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragmentChecked as stillwindClassStringToFragment, stillwindClsxChecked as stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionNameChecked as stillwindViewTransitionName };
47
55
  //# sourceMappingURL=development.d.ts.map
@@ -1,4 +1,4 @@
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";
1
+ import { classNameObjectOptions, classObjectOptions, classStringOptions, createRecipe, forwardFragment, isObject, mergeFragments, stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionName, toFragment } from "../formats-DP9B9SG6.js";
2
2
  // src/runtime/checked.ts
3
3
  /** Runtime validation selected explicitly by development compilations. */
4
4
  /**
@@ -40,16 +40,16 @@ function stillwindClsxChecked(...values) {
40
40
  return stillwindClsx(...values);
41
41
  }
42
42
  /**
43
- * Creates a CVA selector that validates external classes and selected fragment channels.
43
+ * Creates a recipe selector that validates external classes and selected fragment channels.
44
44
  * The selector throws TypeError for inputs rejected by `stillwindClsxChecked` or `mergeFragmentsChecked`.
45
45
  *
46
46
  * @param options - Framework conventions and the keys of the runtime that created the fragments.
47
47
  * @param base - Compiled styles included in every selection.
48
48
  * @param config - Immutable compiled option maps, defaults, and compound conditions.
49
- * @returns A selector with the same selection and props behavior as `createCva`.
49
+ * @returns A selector with the same selection and props behavior as `createRecipe`.
50
50
  */
51
- function createCvaChecked(options, base, config) {
52
- return createCva(options, base, config, stillwindClsxChecked, mergeFragmentsChecked);
51
+ function createRecipeChecked(options, base, config) {
52
+ return createRecipe(options, base, config, stillwindClsxChecked, mergeFragmentsChecked);
53
53
  }
54
54
  /**
55
55
  * Validates fragment channels before materializing framework props.
@@ -60,12 +60,13 @@ function createCvaChecked(options, base, config) {
60
60
  * @throws TypeError for foreign symbol keys, unconverted class props, or a non-null class channel that is not a string.
61
61
  */
62
62
  function mergeFragmentsChecked(options, values) {
63
- const [, , stillwindClassKey, stillwindStyleKey, stillwindCustomPropertiesKey] = options;
64
- const keys = [
63
+ const [, , stillwindClassKey, stillwindStyleKey, stillwindCustomPropertiesKey, stillwindForwardKey] = options;
64
+ const keys = /* @__PURE__ */ new Set([
65
65
  stillwindClassKey,
66
66
  stillwindStyleKey,
67
- stillwindCustomPropertiesKey
68
- ];
67
+ stillwindCustomPropertiesKey,
68
+ stillwindForwardKey
69
+ ]);
69
70
  function check(value) {
70
71
  if (Array.isArray(value)) {
71
72
  value.forEach(check);
@@ -73,8 +74,8 @@ function mergeFragmentsChecked(options, values) {
73
74
  }
74
75
  if (!isObject(value)) return;
75
76
  const symbols = Object.getOwnPropertySymbols(value);
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 the ToFragment helper of its output format first.");
77
+ if (symbols.some((key) => !keys.has(key))) throw new TypeError("Stillwind received a fragment from a different runtime instance.");
78
+ if (!symbols.some((key) => keys.has(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
79
  const classes = value[stillwindClassKey];
79
80
  if (classes != null && typeof classes !== "string") throw new TypeError("Stillwind received a fragment with a non-string class value.");
80
81
  }
@@ -94,6 +95,25 @@ function toFragmentChecked(options, value) {
94
95
  return toFragment(options, value);
95
96
  }
96
97
  /**
98
+ * Validates forwarded props before converting them to a forwarded fragment.
99
+ *
100
+ * @param options - The receiving framework's conventions and distinct fragment keys.
101
+ * @param value - Received props, or null or undefined for no forwarded props.
102
+ * @param styleArrays - Whether the framework accepts an array of style values.
103
+ * @returns The result of `forwardFragment` for valid props.
104
+ * @throws TypeError when the value is neither an object nor null or undefined, when a class
105
+ * value is rejected by `stillwindClsxChecked`, or when the style is not a string, an object,
106
+ * or, with `styleArrays`, an array.
107
+ */
108
+ function forwardFragmentChecked(options, value, styleArrays) {
109
+ if (value == null) return {};
110
+ if (!isObject(value)) throw new TypeError("Stillwind expected forwarded props as an object.");
111
+ stillwindClsxChecked(value.class, value.className);
112
+ const style = value.style;
113
+ if (style != null && typeof style !== "string" && !(isObject(style) && (!Array.isArray(style) || styleArrays))) throw new TypeError(styleArrays ? "Stillwind expected a forwarded style as a string, an object, or an array." : "Stillwind expected a forwarded style as a string or an object.");
114
+ return forwardFragment(options, value, styleArrays);
115
+ }
116
+ /**
97
117
  * Names a keyed view transition after reading its token once.
98
118
  *
99
119
  * @param value - A nonempty class token or a record whose `.v` contains that token.
@@ -114,9 +134,17 @@ function stillwindClassObjectMergeChecked(...values) {
114
134
  function stillwindClassObjectToFragmentChecked(value) {
115
135
  return toFragmentChecked(classObjectOptions, value);
116
136
  }
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);
137
+ /** Checks forwarded class and style values for a framework without style arrays. */
138
+ function stillwindClassObjectForwardChecked(value) {
139
+ return forwardFragmentChecked(classObjectOptions, value, false);
140
+ }
141
+ /** Checks forwarded class and style values for a framework that accepts style arrays. */
142
+ function stillwindClassObjectForwardArraysChecked(value) {
143
+ return forwardFragmentChecked(classObjectOptions, value, true);
144
+ }
145
+ /** Checks external classes and selected fragments before materializing recipe props with `class` and object styles. */
146
+ function stillwindClassObjectRecipeChecked(base, config) {
147
+ return createRecipeChecked(classObjectOptions, base, config);
120
148
  }
121
149
  /** Checks fragment ownership and class contributions before materializing `class` and string styles. */
122
150
  function stillwindClassStringMergeChecked(...values) {
@@ -126,9 +154,13 @@ function stillwindClassStringMergeChecked(...values) {
126
154
  function stillwindClassStringToFragmentChecked(value) {
127
155
  return toFragmentChecked(classStringOptions, value);
128
156
  }
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);
157
+ /** Checks forwarded class and style values for a framework without style arrays. */
158
+ function stillwindClassStringForwardChecked(value) {
159
+ return forwardFragmentChecked(classStringOptions, value, false);
160
+ }
161
+ /** Checks external classes and selected fragments before materializing recipe props with `class` and string styles. */
162
+ function stillwindClassStringRecipeChecked(base, config) {
163
+ return createRecipeChecked(classStringOptions, base, config);
132
164
  }
133
165
  /** Checks fragment ownership and class contributions before materializing `className` and object styles. */
134
166
  function stillwindClassNameObjectMergeChecked(...values) {
@@ -138,10 +170,14 @@ function stillwindClassNameObjectMergeChecked(...values) {
138
170
  function stillwindClassNameObjectToFragmentChecked(value) {
139
171
  return toFragmentChecked(classNameObjectOptions, value);
140
172
  }
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);
173
+ /** Checks forwarded class and style values for a framework without style arrays. */
174
+ function stillwindClassNameObjectForwardChecked(value) {
175
+ return forwardFragmentChecked(classNameObjectOptions, value, false);
176
+ }
177
+ /** Checks external classes and selected fragments before materializing recipe props with `className` and object styles. */
178
+ function stillwindClassNameObjectRecipeChecked(base, config) {
179
+ return createRecipeChecked(classNameObjectOptions, base, config);
144
180
  }
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 };
181
+ export { stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectForwardChecked as stillwindClassNameObjectForward, stillwindClassNameObjectMergeChecked as stillwindClassNameObjectMerge, stillwindClassNameObjectRecipeChecked as stillwindClassNameObjectRecipe, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragmentChecked as stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectForwardChecked as stillwindClassObjectForward, stillwindClassObjectForwardArraysChecked as stillwindClassObjectForwardArrays, stillwindClassObjectMergeChecked as stillwindClassObjectMerge, stillwindClassObjectRecipeChecked as stillwindClassObjectRecipe, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragmentChecked as stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringForwardChecked as stillwindClassStringForward, stillwindClassStringMergeChecked as stillwindClassStringMerge, stillwindClassStringRecipeChecked as stillwindClassStringRecipe, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragmentChecked as stillwindClassStringToFragment, stillwindClsxChecked as stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindRefClassChecked, stillwindViewTransitionNameChecked as stillwindViewTransitionName };
146
182
 
147
183
  //# sourceMappingURL=development.js.map
@@ -1 +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":"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"}
1
+ {"version":3,"file":"development.js","names":[],"sources":["../../src/runtime/checked.ts"],"sourcesContent":["/** Runtime validation selected explicitly by development compilations. */\n\nimport { classNameObjectOptions, classObjectOptions, classStringOptions } from \"./formats.ts\";\nimport {\n forwardFragment,\n isObject,\n mergeFragments,\n toFragment,\n type FragmentRuntimeOptions,\n} from \"./fragment.ts\";\nimport { createRecipe, type CompiledRecipeConfig, type RecipeValue } from \"./recipe.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 recipe 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 `createRecipe`.\n */\nexport function createRecipeChecked(\n options: FragmentRuntimeOptions,\n base?: RecipeValue,\n config?: CompiledRecipeConfig,\n) {\n return createRecipe(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 [\n ,\n ,\n stillwindClassKey,\n stillwindStyleKey,\n stillwindCustomPropertiesKey,\n stillwindForwardKey,\n ] = options;\n const keys = new Set([\n stillwindClassKey,\n stillwindStyleKey,\n stillwindCustomPropertiesKey,\n stillwindForwardKey,\n ]);\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.has(key))) {\n throw new TypeError(\"Stillwind received a fragment from a different runtime instance.\");\n }\n if (\n !symbols.some((key) => keys.has(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 * Validates forwarded props before converting them to a forwarded fragment.\n *\n * @param options - The receiving framework's conventions and distinct fragment keys.\n * @param value - Received props, or null or undefined for no forwarded props.\n * @param styleArrays - Whether the framework accepts an array of style values.\n * @returns The result of `forwardFragment` for valid props.\n * @throws TypeError when the value is neither an object nor null or undefined, when a class\n * value is rejected by `stillwindClsxChecked`, or when the style is not a string, an object,\n * or, with `styleArrays`, an array.\n */\nexport function forwardFragmentChecked(\n options: FragmentRuntimeOptions,\n value: unknown,\n styleArrays: boolean,\n): Record<PropertyKey, unknown> {\n if (value == null) {\n return {};\n }\n if (!isObject(value)) {\n throw new TypeError(\"Stillwind expected forwarded props as an object.\");\n }\n stillwindClsxChecked(value.class, value.className);\n const style = value.style;\n if (\n style != null &&\n typeof style !== \"string\" &&\n !(isObject(style) && (!Array.isArray(style) || styleArrays))\n ) {\n throw new TypeError(\n styleArrays\n ? \"Stillwind expected a forwarded style as a string, an object, or an array.\"\n : \"Stillwind expected a forwarded style as a string or an object.\",\n );\n }\n return forwardFragment(options, value, styleArrays);\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 forwarded class and style values for a framework without style arrays. */\nexport function stillwindClassObjectForwardChecked(value: unknown): Record<PropertyKey, unknown> {\n return forwardFragmentChecked(classObjectOptions, value, false);\n}\n\n/** Checks forwarded class and style values for a framework that accepts style arrays. */\nexport function stillwindClassObjectForwardArraysChecked(\n value: unknown,\n): Record<PropertyKey, unknown> {\n return forwardFragmentChecked(classObjectOptions, value, true);\n}\n\n/** Checks external classes and selected fragments before materializing recipe props with `class` and object styles. */\nexport function stillwindClassObjectRecipeChecked(\n base?: RecipeValue,\n config?: CompiledRecipeConfig,\n) {\n return createRecipeChecked(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 forwarded class and style values for a framework without style arrays. */\nexport function stillwindClassStringForwardChecked(value: unknown): Record<PropertyKey, unknown> {\n return forwardFragmentChecked(classStringOptions, value, false);\n}\n\n/** Checks external classes and selected fragments before materializing recipe props with `class` and string styles. */\nexport function stillwindClassStringRecipeChecked(\n base?: RecipeValue,\n config?: CompiledRecipeConfig,\n) {\n return createRecipeChecked(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 forwarded class and style values for a framework without style arrays. */\nexport function stillwindClassNameObjectForwardChecked(\n value: unknown,\n): Record<PropertyKey, unknown> {\n return forwardFragmentChecked(classNameObjectOptions, value, false);\n}\n\n/** Checks external classes and selected fragments before materializing recipe props with `className` and object styles. */\nexport function stillwindClassNameObjectRecipeChecked(\n base?: RecipeValue,\n config?: CompiledRecipeConfig,\n) {\n return createRecipeChecked(classNameObjectOptions, base, config);\n}\n"],"mappings":"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"}
@@ -1,2 +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 };
1
+ import { stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectForward, stillwindClassNameObjectMerge, stillwindClassNameObjectRecipe, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectForward, stillwindClassObjectForwardArrays, stillwindClassObjectMerge, stillwindClassObjectRecipe, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringForward, stillwindClassStringMerge, stillwindClassStringRecipe, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragment, stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionName } from "../formats-NBNjMP5R.js";
2
+ export { stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectForward, stillwindClassNameObjectMerge, stillwindClassNameObjectRecipe, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectForward, stillwindClassObjectForwardArrays, stillwindClassObjectMerge, stillwindClassObjectRecipe, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringForward, stillwindClassStringMerge, stillwindClassStringRecipe, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragment, stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionName };
@@ -1 +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";
1
+ export { stillwindClassNameObjectClassKey, stillwindClassNameObjectCustomPropertiesKey, stillwindClassNameObjectForward, stillwindClassNameObjectMerge, stillwindClassNameObjectRecipe, stillwindClassNameObjectStyleKey, stillwindClassNameObjectStyleValue, stillwindClassNameObjectToFragment, stillwindClassObjectClassKey, stillwindClassObjectCustomPropertiesKey, stillwindClassObjectForward, stillwindClassObjectForwardArrays, stillwindClassObjectMerge, stillwindClassObjectRecipe, stillwindClassObjectStyleKey, stillwindClassObjectStyleValue, stillwindClassObjectToFragment, stillwindClassStringClassKey, stillwindClassStringCustomPropertiesKey, stillwindClassStringForward, stillwindClassStringMerge, stillwindClassStringRecipe, stillwindClassStringStyleKey, stillwindClassStringStyleValue, stillwindClassStringToFragment, stillwindClsx, stillwindCssValue, stillwindEscapedIdentifier, stillwindViewTransitionName } from "../formats-DP9B9SG6.js";
@@ -31,17 +31,20 @@ function createStyleMacro() {
31
31
  when() {
32
32
  throw uncompiledMacroError("style.when");
33
33
  },
34
- cva() {
35
- throw uncompiledMacroError("style.cva");
34
+ recipe() {
35
+ throw uncompiledMacroError("style.recipe");
36
36
  },
37
37
  media() {
38
38
  throw uncompiledMacroError("style.media");
39
39
  },
40
40
  css() {
41
41
  throw uncompiledMacroError("style.css");
42
+ },
43
+ forward() {
44
+ throw uncompiledMacroError("style.forward");
42
45
  }
43
46
  });
44
47
  }
45
48
  export { createStyleMacro };
46
49
 
47
- //# sourceMappingURL=style-Bzuux32Y.js.map
50
+ //# sourceMappingURL=style-dMBm8aX_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-dMBm8aX_.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 { StyleForward, StyleForwardProps } from \"./forward.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 {\n RecipeClassProps,\n RecipeConfig,\n RecipeInput,\n RecipeResult,\n RecipeSelection,\n RecipeSlotConfig,\n RecipeSlotName,\n RecipeSlots,\n RecipeSlotVariantsOf,\n RecipeVariants,\n} from \"./recipe.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> = StyleMacroWithoutForward<Props> & {\n /**\n * Passes the class and style props that a component received to one of its `style()`\n * calls, so the caller's styles override the component's own styles.\n *\n * Write the call directly as an argument of `style()` or as the second argument of a\n * `style.recipe()` factory. The forwarded classes come after the call's classes, and the\n * forwarded style applies after the call's style and custom properties, whatever the\n * argument position. Several forwarded values apply their styles in argument order, and\n * CSS order, not argument order, decides which of their classes wins. In the CSS, the\n * caller's module follows the module that declares the component.\n *\n * @param props - The received props, such as `{ className, style }` or the whole props\n * object. Null and undefined forward nothing. When the whole props object is passed, do\n * not spread the same props onto the element after the result, because they would\n * replace its class and style.\n * @returns A value that only `style()` and `style.recipe()` factories accept.\n */\n forward(props: StyleForwardProps | null | undefined): StyleForward;\n};\n\n/**\n * The `style` macro of an entrypoint whose framework has no component props, such as\n * Lit, Alpine, and vanilla DOM code. It has every member of {@link StyleMacro} except\n * `forward()`.\n */\nexport type StyleMacroWithoutForward<Props = object> = {\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 * 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 * 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 recipe definition with slots and returns a function that selects props for each\n * slot. The first argument adds styles to the `base` slot. Calling the factory returns one\n * function for each slot in `slots` and for `base`. The classes and the `style.forward()`\n * value passed to the factory apply to the `base` slot. A slot function accepts variant\n * choices that replace the factory's choices, its own classes, and its own `style.forward()`\n * value.\n *\n * @param base - Styles included in the `base` slot of every selection.\n * @param config - Static slots, variants, defaults, compound variants, and compound slots.\n * @returns A reusable factory returning an object of slot functions.\n */\n recipe<\n Slots extends RecipeSlots,\n Variants extends RecipeSlotVariantsOf<Slots> = Record<never, never>,\n >(\n base: RecipeInput,\n config: RecipeSlotConfig<Slots, Variants>,\n ): (\n props?: RecipeSelection<Variants> & RecipeClassProps,\n forwarded?: StyleForward,\n ) => {\n readonly [Slot in RecipeSlotName<Slots>]: (\n props?: RecipeSelection<Variants> & RecipeClassProps,\n forwarded?: StyleForward,\n ) => RecipeResult<Props>;\n };\n\n /**\n * Compiles a recipe 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. The factory's optional\n * second argument is a `style.forward()` value, which applies after the selected\n * styles.\n */\n recipe<Variants extends RecipeVariants = Record<never, never>>(\n base?: RecipeInput,\n config?: RecipeConfig<Variants>,\n ): (\n props?: RecipeSelection<Variants> & RecipeClassProps,\n forwarded?: StyleForward,\n ) => RecipeResult<Props>;\n};\n\nfunction uncompiledMacroError(name: string): Error {\n return new Error(\n `Stillwind ${name}() is a compile-time macro and cannot run uncompiled. ` +\n \"Configure the Stillwind build integration (placed before JSX transforms) or test runner plugin. \" +\n \"See node_modules/stillwind/docs/integrations.md.\",\n );\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 uncompiledMacroError(\"style\");\n },\n {\n anchorScope(): never {\n throw uncompiledMacroError(\"style.anchorScope\");\n },\n ref(): never {\n throw uncompiledMacroError(\"style.ref\");\n },\n keyframes(): never {\n throw uncompiledMacroError(\"style.keyframes\");\n },\n viewTransition(): never {\n throw uncompiledMacroError(\"style.viewTransition\");\n },\n when(): never {\n throw uncompiledMacroError(\"style.when\");\n },\n recipe(): never {\n throw uncompiledMacroError(\"style.recipe\");\n },\n media(): never {\n throw uncompiledMacroError(\"style.media\");\n },\n css(): never {\n throw uncompiledMacroError(\"style.css\");\n },\n forward(): never {\n throw uncompiledMacroError(\"style.forward\");\n },\n },\n );\n}\n"],"mappings":";AAsWA,SAAS,qBAAqB,MAAqB;CACjD,uBAAO,IAAI,MACT,aAAa,KAAK,uMAGpB;AACF;;;;;;;;;;;AAYA,SAAgB,mBAA6C;CAC3D,OAAO,OAAO,aACC;EACX,MAAM,qBAAqB,OAAO;CACpC,GACA;EACE,cAAqB;GACnB,MAAM,qBAAqB,mBAAmB;EAChD;EACA,MAAa;GACX,MAAM,qBAAqB,WAAW;EACxC;EACA,YAAmB;GACjB,MAAM,qBAAqB,iBAAiB;EAC9C;EACA,iBAAwB;GACtB,MAAM,qBAAqB,sBAAsB;EACnD;EACA,OAAc;GACZ,MAAM,qBAAqB,YAAY;EACzC;EACA,SAAgB;GACd,MAAM,qBAAqB,cAAc;EAC3C;EACA,QAAe;GACb,MAAM,qBAAqB,aAAa;EAC1C;EACA,MAAa;GACX,MAAM,qBAAqB,WAAW;EACxC;EACA,UAAiB;GACf,MAAM,qBAAqB,eAAe;EAC5C;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.12.0 | MIT License | https://stillwind.dev */
30
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
31
31
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
32
32
  @layer properties, theme, base, components, utilities;
33
33
 
@@ -54,7 +54,7 @@ export const link = {className:"sw_77cu9"};
54
54
  ### Generated stylesheet without preflight
55
55
 
56
56
  ```css
57
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
57
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
58
58
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
59
59
  @layer properties, theme, base, components, utilities;
60
60
 
@@ -42,7 +42,7 @@ export const link = {className:"sw_77qpw"};
42
42
  ### Generated stylesheet without preflight
43
43
 
44
44
  ```css
45
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
45
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
46
46
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
47
47
  @layer properties, theme, base, components, utilities;
48
48
 
@@ -52,7 +52,7 @@ export const icon = {className:"sw_wou1b"};
52
52
  ### Generated stylesheet without preflight
53
53
 
54
54
  ```css
55
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
55
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
56
56
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
57
57
  @layer properties, theme, base, components, utilities;
58
58
 
@@ -16,12 +16,12 @@ definitions, called a registry. `@stillwind-registry` selects the registries
16
16
  that the definitions inside the block change. Write it at the top level of the
17
17
  stylesheet, or inside another `@stillwind-registry` block.
18
18
 
19
- | Registry | Resolves the utilities of |
20
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
21
- | `default` | [`style()`](https://stillwind.dev/docs/macros/style), [`style.cva()`](https://stillwind.dev/docs/macros/cva), [`style.css()`](https://stillwind.dev/docs/macros/css), and [`@apply`](https://stillwind.dev/docs/at-rules/apply) |
22
- | `keyframe` | The frames of [`style.keyframes()`](https://stillwind.dev/docs/macros/keyframes) |
23
- | `animation` | The options of a keyframes use, such as `enter("both")` |
24
- | `view-transition` | The `group`, `old`, `new`, and `imagePair` fields of [`style.viewTransition()`](https://stillwind.dev/docs/macros/view-transition) |
19
+ | Registry | Resolves the utilities of |
20
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | `default` | [`style()`](https://stillwind.dev/docs/macros/style), [`style.recipe()`](https://stillwind.dev/docs/macros/recipe), [`style.css()`](https://stillwind.dev/docs/macros/css), and [`@apply`](https://stillwind.dev/docs/at-rules/apply) |
22
+ | `keyframe` | The frames of [`style.keyframes()`](https://stillwind.dev/docs/macros/keyframes) |
23
+ | `animation` | The options of a keyframes use, such as `enter("both")` |
24
+ | `view-transition` | The `group`, `old`, `new`, and `imagePair` fields of [`style.viewTransition()`](https://stillwind.dev/docs/macros/view-transition) |
25
25
 
26
26
  A definition outside every block changes `default`, `keyframe`, and
27
27
  `view-transition`. `animation` starts empty and changes only through blocks that
@@ -62,7 +62,7 @@ export const panel = {className:"sw_fd678"};
62
62
  ### Generated stylesheet without preflight
63
63
 
64
64
  ```css
65
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
65
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
66
66
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
67
67
  @layer properties, theme, base, components, utilities;
68
68
 
@@ -54,7 +54,7 @@ export const icon = {className:"sw_wou1b"};
54
54
  ### Generated stylesheet without preflight
55
55
 
56
56
  ```css
57
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
57
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
58
58
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
59
59
  @layer properties, theme, base, components, utilities;
60
60
 
@@ -45,7 +45,7 @@ export const accepted = {className:"sw_a2es4"};
45
45
  ### Generated stylesheet without preflight
46
46
 
47
47
  ```css
48
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
48
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
49
49
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
50
50
  @layer properties, theme, base, components, utilities;
51
51
 
@@ -48,7 +48,7 @@ export const replaced = {className:"sw_vtxcq"};
48
48
  ### Generated stylesheet without preflight
49
49
 
50
50
  ```css
51
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
51
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
52
52
  /*! tailwindcss v4.3.5 | 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.12.0 | MIT License | https://stillwind.dev */
45
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
46
46
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
47
47
  @layer properties, theme, base, components, utilities;
48
48
  ```
@@ -44,7 +44,7 @@ export const card = {className:"sw_4rosj"};
44
44
  ### Generated stylesheet without preflight
45
45
 
46
46
  ```css
47
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
47
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
48
48
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
49
49
  @layer properties, theme, base, components, utilities;
50
50
 
@@ -110,7 +110,7 @@ export const label = {className:"sw_cum60"};
110
110
  ### Generated stylesheet without preflight
111
111
 
112
112
  ```css
113
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
113
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
114
114
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
115
115
  @layer properties, theme, base, components, utilities;
116
116
 
@@ -163,7 +163,7 @@ export const title = {className:"sw_suzvk"};
163
163
  ### Generated stylesheet without preflight
164
164
 
165
165
  ```css
166
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
166
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
167
167
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
168
168
  @layer properties, theme, base, components, utilities;
169
169
 
@@ -216,7 +216,7 @@ export const done = {className:"sw_wpj78"};
216
216
  ### Generated stylesheet without preflight
217
217
 
218
218
  ```css
219
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
219
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
220
220
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
221
221
  @layer properties, theme, base, components, utilities;
222
222
 
@@ -269,7 +269,7 @@ export const page = {className:"sw_6kn82"};
269
269
  ### Generated stylesheet without preflight
270
270
 
271
271
  ```css
272
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
272
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
273
273
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
274
274
  @layer properties, theme, base, components, utilities;
275
275
 
@@ -9,12 +9,22 @@ description: "Define a utility, or add declarations to a built-in utility with t
9
9
  @utility name { ... }
10
10
  @utility name-* { ... }
11
11
  @utility name (implementation) { ... }
12
+ @utility name-* (exclusive) { ... }
12
13
  ```
13
14
 
14
15
  `@utility` defines a utility for [`style()`](https://stillwind.dev/docs/macros/style),
15
16
  [`@apply`](https://stillwind.dev/docs/at-rules/apply), and the other places that accept utilities.
16
17
  Write it at the top level of the stylesheet.
17
18
 
19
+ ## Contents
20
+
21
+ - [Static and functional utilities](#static-and-functional-utilities)
22
+ - [Values and modifiers](#values-and-modifiers)
23
+ - [Definitions with the same name](#definitions-with-the-same-name)
24
+ - [Body](#body)
25
+ - [The implementation descriptor](#the-implementation-descriptor)
26
+ - [Conditions](#conditions)
27
+
18
28
  ## Static and functional utilities
19
29
 
20
30
  A name without `*` defines a static utility. A name that ends in `-*` defines a
@@ -51,7 +61,7 @@ export const list = {className:"sw_l0qhr"};
51
61
  ### Generated stylesheet without preflight
52
62
 
53
63
  ```css
54
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
64
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
55
65
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
56
66
  @layer properties, theme, base, components, utilities;
57
67
 
@@ -116,7 +126,7 @@ export const code = {className:"sw_vqs03"};
116
126
  ### Generated stylesheet without preflight
117
127
 
118
128
  ```css
119
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
129
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
120
130
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
121
131
  @layer properties, theme, base, components, utilities;
122
132
 
@@ -172,7 +182,7 @@ export const page = {className:"sw_z5acf"};
172
182
  ### Generated stylesheet without preflight
173
183
 
174
184
  ```css
175
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
185
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
176
186
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
177
187
  @layer properties, theme, base, components, utilities;
178
188
 
@@ -209,6 +219,35 @@ A static definition replaces a functional one for its exact name:
209
219
  only. To remove built-in definitions, use
210
220
  [`@stillwind-undef-utility`](https://stillwind.dev/docs/at-rules/stillwind-undef-utility).
211
221
 
222
+ ### Read a value from one source
223
+
224
+ By default, every definition that accepts a named value contributes, even when
225
+ the definitions read the value from different theme namespaces. Add
226
+ `(exclusive)` to definitions that must read a named value from one source, as one
227
+ Tailwind utility does. The first `(exclusive)` definition, in source order, whose
228
+ `--value()` accepts the value decides the source. Other `(exclusive)` definitions
229
+ apply only when they read the value from the same source.
230
+
231
+ ```css
232
+ @theme {
233
+ --size-wide: 40rem;
234
+ --color-wide: oklch(0.9 0.02 250);
235
+ }
236
+
237
+ @utility box-* (exclusive) {
238
+ width: --value(--size-*);
239
+ }
240
+
241
+ @utility box-* (exclusive) {
242
+ background-color: --value(--color-*);
243
+ }
244
+ ```
245
+
246
+ `box-wide` sets only `width`. Without `(exclusive)`, it also sets
247
+ `background-color`. The descriptor does not change how arbitrary values and
248
+ variables select definitions. The built-in utilities that read a size and a
249
+ color, such as `shadow-*`, `text-*`, and `border-*`, use this descriptor.
250
+
212
251
  ## Body
213
252
 
214
253
  A body can contain nested rules, [`@apply`](https://stillwind.dev/docs/at-rules/apply),
@@ -268,7 +307,7 @@ export const icon = {className:"sw_xg0pi"};
268
307
  ### Generated stylesheet without preflight
269
308
 
270
309
  ```css
271
- /*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
310
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
272
311
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
273
312
  @layer properties, theme, base, components, utilities;
274
313
 
@@ -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.12.0 | MIT License | https://stillwind.dev */
42
+ /*! stillwind v0.14.0 | MIT License | https://stillwind.dev */
43
43
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
44
44
  @layer properties, theme, base, components, utilities;
45
45