nuclo 0.3.20 → 0.3.22
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/dist/nuclo.cjs +1 -1
- package/dist/nuclo.cjs.map +1 -1
- package/dist/nuclo.mjs +1 -1
- package/dist/nuclo.mjs.map +1 -1
- package/package.json +1 -1
- package/types/features/style.d.ts +6 -2
- package/types/index.d.ts +3 -1
- package/types/style.d.ts +10 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuclo",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.22",
|
|
5
5
|
"description": "Lightweight, type-safe DOM library with plain mutable state and explicit updates — global tag builders, SSR, hydration, and typed CSS, no virtual DOM, no compiler.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Danilo Celestino de Castro (https://github.com/dan2dev)",
|
|
@@ -60,10 +60,14 @@ declare global {
|
|
|
60
60
|
*/
|
|
61
61
|
function createCss<const T extends ThemeConfig>(theme?: T): CssInstance<T>;
|
|
62
62
|
|
|
63
|
-
/** Themeless css() — full property/variant typing, no tokens or screens. */
|
|
64
|
-
function css(style: Style<object>): StyleResult;
|
|
65
63
|
/** Themeless css() under a readable, stable class name: `css("app-root", { … })` → `.app-root`. */
|
|
66
64
|
function css(name: string, style: Style<object>): StyleResult;
|
|
65
|
+
/**
|
|
66
|
+
* Themeless css() — full property/variant typing, no tokens or screens.
|
|
67
|
+
* Declared last so `Parameters<typeof css>[0]` is the style object:
|
|
68
|
+
* `Parameters` resolves against the final overload.
|
|
69
|
+
*/
|
|
70
|
+
function css(style: Style<object>): StyleResult;
|
|
67
71
|
/** Compose class lists with last-wins conflict resolution. */
|
|
68
72
|
function cx(...inputs: ClassInput[]): StyleResult;
|
|
69
73
|
/** Themeless variants() recipe helper. */
|
package/types/index.d.ts
CHANGED
|
@@ -73,8 +73,10 @@ export function on<K extends string, E extends Event = Event, TTagName extends E
|
|
|
73
73
|
|
|
74
74
|
// Styling (themeless default instance + themed factory)
|
|
75
75
|
export function createCss<const T extends ThemeConfig>(theme?: T): CssInstance<T>;
|
|
76
|
-
|
|
76
|
+
// The single-argument form is declared last so `Parameters<typeof css>[0]` is
|
|
77
|
+
// the style object: `Parameters` resolves against the final overload.
|
|
77
78
|
export function css(name: string, style: Style<object>): StyleResult;
|
|
79
|
+
export function css(style: Style<object>): StyleResult;
|
|
78
80
|
export function cx(...inputs: ClassInput[]): StyleResult;
|
|
79
81
|
export function variants<const V extends VariantDefinitions<object>>(
|
|
80
82
|
config: VariantsConfig<object, V>,
|
package/types/style.d.ts
CHANGED
|
@@ -378,12 +378,6 @@ export type ClassInput = StyleResult | string | false | null | undefined | reado
|
|
|
378
378
|
|
|
379
379
|
/** A themed styling instance returned by createCss(). */
|
|
380
380
|
export interface CssInstance<T extends ThemeConfig = ThemeConfig> {
|
|
381
|
-
/**
|
|
382
|
-
* Compile a style object into CSS classes — one per selector context
|
|
383
|
-
* (base, each pseudo-selector, each media query) it touches.
|
|
384
|
-
* Returns `{ className }` — usable directly as a nuclo attributes object.
|
|
385
|
-
*/
|
|
386
|
-
css(style: Style<T>): StyleResult;
|
|
387
381
|
/**
|
|
388
382
|
* Compile a style object under a readable, stable class name:
|
|
389
383
|
* `css("app-root", { minHeight: "100vh" })` → `.app-root`.
|
|
@@ -392,6 +386,16 @@ export interface CssInstance<T extends ThemeConfig = ThemeConfig> {
|
|
|
392
386
|
* as well as content, so they never share a class with an unrelated style.
|
|
393
387
|
*/
|
|
394
388
|
css(name: string, style: Style<T>): StyleResult;
|
|
389
|
+
/**
|
|
390
|
+
* Compile a style object into CSS classes — one per selector context
|
|
391
|
+
* (base, each pseudo-selector, each media query) it touches.
|
|
392
|
+
* Returns `{ className }` — usable directly as a nuclo attributes object.
|
|
393
|
+
*
|
|
394
|
+
* Declared after the named form so `Parameters<typeof css>[0]` is the style
|
|
395
|
+
* object — `Parameters` resolves against the last overload, which makes the
|
|
396
|
+
* declaration order part of the public API.
|
|
397
|
+
*/
|
|
398
|
+
css(style: Style<T>): StyleResult;
|
|
395
399
|
/**
|
|
396
400
|
* Compose class lists with exact conflict resolution: when two inputs
|
|
397
401
|
* style the same (query, selector, property), the last one wins.
|