@csszyx/runtime 0.10.7 → 0.10.8
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/index.d.cts +10 -3
- package/dist/index.d.mts +10 -3
- package/dist/lite.d.cts +16 -7
- package/dist/lite.d.mts +16 -7
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -11,11 +11,18 @@ export { __szColorVar } from '@csszyx/compiler/color-var';
|
|
|
11
11
|
*
|
|
12
12
|
* @module @csszyx/runtime/concatenate
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
/**
|
|
16
|
-
* Type for sz input
|
|
15
|
+
* Type for sz input — a pre-compiled class string, an sz object, a recursive
|
|
16
|
+
* array of those, or a falsy guard (skipped).
|
|
17
|
+
*
|
|
18
|
+
* The object member is the broad `object` rather than `SzObject` so that a
|
|
19
|
+
* precise `SzProps` / `SzPropValue` value (the type the JSX augmentation gives
|
|
20
|
+
* `sz` on a host element) forwards into the runtime helpers without a cast: a
|
|
21
|
+
* named type with specific keys is assignable to `object`, but not to
|
|
22
|
+
* `SzObject`'s `{ [k: string]: SzValue }` index signature. The runtime lowers the
|
|
23
|
+
* keys it recognizes and ignores the rest, so the looser input type is sound.
|
|
17
24
|
*/
|
|
18
|
-
type SzInput = string |
|
|
25
|
+
type SzInput = string | object | SzInput[] | null | undefined | false;
|
|
19
26
|
/**
|
|
20
27
|
* Zero-overhead className passthrough/concatenation helper.
|
|
21
28
|
*
|
package/dist/index.d.mts
CHANGED
|
@@ -11,11 +11,18 @@ export { __szColorVar } from '@csszyx/compiler/color-var';
|
|
|
11
11
|
*
|
|
12
12
|
* @module @csszyx/runtime/concatenate
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
/**
|
|
16
|
-
* Type for sz input
|
|
15
|
+
* Type for sz input — a pre-compiled class string, an sz object, a recursive
|
|
16
|
+
* array of those, or a falsy guard (skipped).
|
|
17
|
+
*
|
|
18
|
+
* The object member is the broad `object` rather than `SzObject` so that a
|
|
19
|
+
* precise `SzProps` / `SzPropValue` value (the type the JSX augmentation gives
|
|
20
|
+
* `sz` on a host element) forwards into the runtime helpers without a cast: a
|
|
21
|
+
* named type with specific keys is assignable to `object`, but not to
|
|
22
|
+
* `SzObject`'s `{ [k: string]: SzValue }` index signature. The runtime lowers the
|
|
23
|
+
* keys it recognizes and ignores the rest, so the looser input type is sound.
|
|
17
24
|
*/
|
|
18
|
-
type SzInput = string |
|
|
25
|
+
type SzInput = string | object | SzInput[] | null | undefined | false;
|
|
19
26
|
/**
|
|
20
27
|
* Zero-overhead className passthrough/concatenation helper.
|
|
21
28
|
*
|
package/dist/lite.d.cts
CHANGED
|
@@ -16,13 +16,22 @@ export { __szColorVar } from '@csszyx/compiler/color-var';
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Input to the lite runtime helpers: a pre-compiled class string or a falsy
|
|
20
|
+
* guard (skipped). The lite path has no compiler, so it never accepts objects —
|
|
21
|
+
* unlike the full `SzInput` from `@csszyx/runtime`, which also takes sz objects.
|
|
22
|
+
* Named distinctly so the two do not look interchangeable.
|
|
20
23
|
*/
|
|
21
|
-
type
|
|
24
|
+
type SzStringInput = string | null | undefined | false;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Renamed to {@link SzStringInput} — the lite helpers accept only
|
|
27
|
+
* pre-compiled class strings, and the bare name collided with the object-accepting
|
|
28
|
+
* `SzInput` from `@csszyx/runtime`. This alias is kept for back-compat.
|
|
29
|
+
*/
|
|
30
|
+
type SzInput = SzStringInput;
|
|
22
31
|
/**
|
|
23
32
|
* Zero-overhead className passthrough/concatenation.
|
|
24
33
|
*
|
|
25
|
-
* @param {...
|
|
34
|
+
* @param {...SzStringInput[]} classes - Class names to concatenate
|
|
26
35
|
* @returns {string} Combined className string
|
|
27
36
|
*
|
|
28
37
|
* @example
|
|
@@ -31,7 +40,7 @@ type SzInput = string | null | undefined | false;
|
|
|
31
40
|
* _sz('base', isActive && 'active') // conditional
|
|
32
41
|
* ```
|
|
33
42
|
*/
|
|
34
|
-
declare function _sz(...classes:
|
|
43
|
+
declare function _sz(...classes: SzStringInput[]): string;
|
|
35
44
|
/**
|
|
36
45
|
* Merges className strings from compiled array sz props, deduplicating tokens.
|
|
37
46
|
*
|
|
@@ -39,10 +48,10 @@ declare function _sz(...classes: SzInput[]): string;
|
|
|
39
48
|
* element is a runtime conditional. All arguments must be pre-compiled strings
|
|
40
49
|
* (the compiler resolves each element to a string before passing it here).
|
|
41
50
|
*
|
|
42
|
-
* @param {...
|
|
51
|
+
* @param {...SzStringInput[]} classes - Pre-compiled class strings to merge
|
|
43
52
|
* @returns {string} Merged className string with duplicate tokens removed
|
|
44
53
|
*/
|
|
45
|
-
declare function _szMerge(...classes:
|
|
54
|
+
declare function _szMerge(...classes: SzStringInput[]): string;
|
|
46
55
|
/**
|
|
47
56
|
* Two-argument optimized concatenation.
|
|
48
57
|
* @param a - first class string
|
|
@@ -52,4 +61,4 @@ declare function _szMerge(...classes: SzInput[]): string;
|
|
|
52
61
|
declare function _sz2(a: string, b: string): string;
|
|
53
62
|
|
|
54
63
|
export { _sz, _sz2, _szMerge };
|
|
55
|
-
export type { SzInput };
|
|
64
|
+
export type { SzInput, SzStringInput };
|
package/dist/lite.d.mts
CHANGED
|
@@ -16,13 +16,22 @@ export { __szColorVar } from '@csszyx/compiler/color-var';
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Input to the lite runtime helpers: a pre-compiled class string or a falsy
|
|
20
|
+
* guard (skipped). The lite path has no compiler, so it never accepts objects —
|
|
21
|
+
* unlike the full `SzInput` from `@csszyx/runtime`, which also takes sz objects.
|
|
22
|
+
* Named distinctly so the two do not look interchangeable.
|
|
20
23
|
*/
|
|
21
|
-
type
|
|
24
|
+
type SzStringInput = string | null | undefined | false;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Renamed to {@link SzStringInput} — the lite helpers accept only
|
|
27
|
+
* pre-compiled class strings, and the bare name collided with the object-accepting
|
|
28
|
+
* `SzInput` from `@csszyx/runtime`. This alias is kept for back-compat.
|
|
29
|
+
*/
|
|
30
|
+
type SzInput = SzStringInput;
|
|
22
31
|
/**
|
|
23
32
|
* Zero-overhead className passthrough/concatenation.
|
|
24
33
|
*
|
|
25
|
-
* @param {...
|
|
34
|
+
* @param {...SzStringInput[]} classes - Class names to concatenate
|
|
26
35
|
* @returns {string} Combined className string
|
|
27
36
|
*
|
|
28
37
|
* @example
|
|
@@ -31,7 +40,7 @@ type SzInput = string | null | undefined | false;
|
|
|
31
40
|
* _sz('base', isActive && 'active') // conditional
|
|
32
41
|
* ```
|
|
33
42
|
*/
|
|
34
|
-
declare function _sz(...classes:
|
|
43
|
+
declare function _sz(...classes: SzStringInput[]): string;
|
|
35
44
|
/**
|
|
36
45
|
* Merges className strings from compiled array sz props, deduplicating tokens.
|
|
37
46
|
*
|
|
@@ -39,10 +48,10 @@ declare function _sz(...classes: SzInput[]): string;
|
|
|
39
48
|
* element is a runtime conditional. All arguments must be pre-compiled strings
|
|
40
49
|
* (the compiler resolves each element to a string before passing it here).
|
|
41
50
|
*
|
|
42
|
-
* @param {...
|
|
51
|
+
* @param {...SzStringInput[]} classes - Pre-compiled class strings to merge
|
|
43
52
|
* @returns {string} Merged className string with duplicate tokens removed
|
|
44
53
|
*/
|
|
45
|
-
declare function _szMerge(...classes:
|
|
54
|
+
declare function _szMerge(...classes: SzStringInput[]): string;
|
|
46
55
|
/**
|
|
47
56
|
* Two-argument optimized concatenation.
|
|
48
57
|
* @param a - first class string
|
|
@@ -52,4 +61,4 @@ declare function _szMerge(...classes: SzInput[]): string;
|
|
|
52
61
|
declare function _sz2(a: string, b: string): string;
|
|
53
62
|
|
|
54
63
|
export { _sz, _sz2, _szMerge };
|
|
55
|
-
export type { SzInput };
|
|
64
|
+
export type { SzInput, SzStringInput };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/runtime",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.8",
|
|
4
4
|
"description": "Runtime helpers and hydration guards for csszyx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"csszyx",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"dist"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@csszyx/compiler": "0.10.
|
|
53
|
-
"@csszyx/core": "0.10.
|
|
52
|
+
"@csszyx/compiler": "0.10.8",
|
|
53
|
+
"@csszyx/core": "0.10.8"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^20.11.0",
|