stillwind 0.6.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.
- package/css/builtin-variants/sw-conditional.css +10 -1
- package/dist/{class-object-D7ZGJOf_.d.ts → class-object-BaK8uudd.d.ts} +2 -2
- package/dist/class-object-DNcjzcfH.js +6 -0
- package/dist/{class-object-D24FFYqO.js.map → class-object-DNcjzcfH.js.map} +1 -1
- package/dist/{class-string-CQHnc9GN.d.ts → class-string-C5YFtXQn.d.ts} +2 -2
- package/dist/class-string-KnYInbiw.js +6 -0
- package/dist/{class-string-Db8-oI4q.js.map → class-string-KnYInbiw.js.map} +1 -1
- package/dist/{cva-BwX07CFw.js → formats-Ctf2WFc-.js} +87 -2
- package/dist/formats-Ctf2WFc-.js.map +1 -0
- package/dist/formats-aeLCNAXl.d.ts +73 -0
- package/dist/frameworks/alpine.d.ts +3 -3
- package/dist/frameworks/alpine.js +1 -1
- package/dist/frameworks/alpine.js.map +1 -1
- package/dist/frameworks/astro.d.ts +3 -3
- package/dist/frameworks/astro.js +1 -1
- package/dist/frameworks/lit.d.ts +3 -3
- package/dist/frameworks/lit.js +1 -1
- package/dist/frameworks/lit.js.map +1 -1
- package/dist/frameworks/preact.d.ts +3 -3
- package/dist/frameworks/preact.js +1 -1
- package/dist/frameworks/qwik.d.ts +3 -3
- package/dist/frameworks/qwik.js +1 -1
- package/dist/frameworks/react.d.ts +2 -2
- package/dist/frameworks/react.js +1 -1
- package/dist/frameworks/solid.d.ts +3 -3
- package/dist/frameworks/solid.js +1 -1
- package/dist/frameworks/svelte.d.ts +3 -3
- package/dist/frameworks/svelte.js +1 -1
- package/dist/frameworks/vanilla.d.ts +3 -3
- package/dist/frameworks/vanilla.js +1 -1
- package/dist/frameworks/vue.d.ts +3 -3
- package/dist/frameworks/vue.js +1 -1
- package/dist/{index-RwVFpxhE.d.ts → index-DBpgaaD7.d.ts} +54 -5
- package/dist/macro/index.d.ts +2 -2
- package/dist/macro/index.js +1 -1
- package/dist/runtime/development.d.ts +47 -0
- package/dist/{development-J-JCSIm0.js → runtime/development.js} +41 -5
- package/dist/runtime/development.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/{style-fTQbsVWZ.js → style-BE8vuLiO.js} +4 -1
- package/dist/style-BE8vuLiO.js.map +1 -0
- package/docs/at-rules/apply.md +1 -1
- package/docs/at-rules/custom-variant.md +2 -2
- package/docs/at-rules/plugin.md +7 -0
- package/docs/at-rules/slot.md +1 -1
- package/docs/at-rules/stillwind-css-template.md +2 -2
- package/docs/at-rules/stillwind-property.md +1 -1
- package/docs/at-rules/stillwind-registry.md +1 -1
- package/docs/at-rules/stillwind-require-properties.md +1 -1
- package/docs/at-rules/stillwind-undef-arbitrary-property.md +1 -1
- package/docs/at-rules/stillwind-undef-utility.md +1 -1
- package/docs/at-rules/stillwind-undef-variant.md +1 -1
- package/docs/at-rules/theme.md +5 -5
- package/docs/at-rules/utility.md +4 -4
- package/docs/at-rules/variant.md +1 -1
- package/docs/cli.md +4 -1
- package/docs/concepts/css-ordering.md +4 -4
- package/docs/concepts/how-styles-compile.md +3 -3
- package/docs/configuration.md +16 -16
- package/docs/editors.md +2 -1
- package/docs/errors/SW10004.md +2 -1
- package/docs/guides/reusable-styles.md +5 -0
- package/docs/guides/style.md +32 -0
- package/docs/guides/tailwind-compatibility.md +10 -9
- package/docs/lints/ambiguous-style-base-order.md +2 -0
- package/docs/lints/conflicting-utilities.md +43 -1
- package/docs/lints/index.md +1 -0
- package/docs/lints/interfering-imported-style-base.md +21 -3
- package/docs/lints/invalid-stored-variant.md +52 -0
- package/docs/macros/css.md +2 -1
- package/docs/macros/cva.md +5 -4
- package/docs/macros/index.md +1 -0
- package/docs/macros/ref/at.md +1 -1
- package/docs/macros/ref/condition.md +2 -1
- package/docs/macros/ref/in.md +1 -1
- package/docs/macros/ref/index.md +2 -1
- package/docs/macros/style.md +34 -8
- package/docs/macros/view-transition.md +1 -1
- package/docs/macros/when.md +129 -0
- package/index.d.ts +2 -0
- package/package.json +12 -26
- package/dist/class-object-D24FFYqO.js +0 -6
- package/dist/class-string-Db8-oI4q.js +0 -6
- package/dist/cva-BwX07CFw.js.map +0 -1
- package/dist/cva-DSpDNBYi.d.ts +0 -9
- package/dist/development-DttPQc71.d.ts +0 -27
- package/dist/development-J-JCSIm0.js.map +0 -1
- package/dist/runtime/class-name-object-development.d.ts +0 -10
- package/dist/runtime/class-name-object-development.js +0 -18
- package/dist/runtime/class-name-object-development.js.map +0 -1
- package/dist/runtime/class-name-object.d.ts +0 -16
- package/dist/runtime/class-name-object.js +0 -31
- package/dist/runtime/class-name-object.js.map +0 -1
- package/dist/runtime/class-object-development.d.ts +0 -10
- package/dist/runtime/class-object-development.js +0 -18
- package/dist/runtime/class-object-development.js.map +0 -1
- package/dist/runtime/class-object.d.ts +0 -16
- package/dist/runtime/class-object.js +0 -31
- package/dist/runtime/class-object.js.map +0 -1
- package/dist/runtime/class-string-development.d.ts +0 -10
- package/dist/runtime/class-string-development.js +0 -18
- package/dist/runtime/class-string-development.js.map +0 -1
- package/dist/runtime/class-string.d.ts +0 -16
- package/dist/runtime/class-string.js +0 -31
- package/dist/runtime/class-string.js.map +0 -1
- package/dist/shared-B9IQXU6P.d.ts +0 -32
- package/dist/style-fTQbsVWZ.js.map +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a dynamic value into text for a generated CSS declaration.
|
|
3
|
-
*
|
|
4
|
-
* @param value - CSS text, a number, a URL, or a boolean. URLs are quoted and CSS-escaped. True
|
|
5
|
-
* becomes a space and false becomes `initial`.
|
|
6
|
-
* @returns CSS value text. Strings and numbers are converted with `String`.
|
|
7
|
-
*/
|
|
8
|
-
export declare function stillwindCssValue(value: URL | string | number | boolean): string;
|
|
9
|
-
/**
|
|
10
|
-
* Flattens class contributions and joins nonempty values with spaces.
|
|
11
|
-
*
|
|
12
|
-
* @param values - Strings, numbers, bigints, nested arrays, or objects whose truthy values enable
|
|
13
|
-
* their keys. Other values are ignored.
|
|
14
|
-
* @returns Class text in contribution order, without deduplication.
|
|
15
|
-
*/
|
|
16
|
-
export declare function stillwindClsx(...values: readonly unknown[]): string;
|
|
17
|
-
/**
|
|
18
|
-
* Escapes text for use as one CSS identifier.
|
|
19
|
-
*
|
|
20
|
-
* @param value - Unescaped identifier text.
|
|
21
|
-
* @returns `CSS.escape` output when available, otherwise escaped text with NUL replaced by U+FFFD.
|
|
22
|
-
*/
|
|
23
|
-
export declare function stillwindEscapedIdentifier(value: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* Builds a CSS identifier for one keyed view transition.
|
|
26
|
-
*
|
|
27
|
-
* @param value - Nonempty class token or an object whose `v` property contains that token.
|
|
28
|
-
* @param key - Key appended to the token after a hyphen using `String`.
|
|
29
|
-
* @returns The combined token and key escaped as a CSS identifier.
|
|
30
|
-
*/
|
|
31
|
-
export declare function stillwindViewTransitionName(value: unknown, key: string | number): string;
|
|
32
|
-
//# sourceMappingURL=shared-B9IQXU6P.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-fTQbsVWZ.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 } from \"./refs.ts\";\nimport type { StyleViewTransition, StyleViewTransitionDefinition } from \"./view-transition.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 * 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 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":";;;;;;;;;;;AA0QA,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,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"}
|