@css-hooks/preact 4.0.0-next.3 → 4.0.0-next.31
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/README.md +5 -5
- package/cjs/index.js +4 -5
- package/cjs/package.json +1 -0
- package/esm/index.js +2 -4
- package/package.json +8 -7
- package/types/css-property-conflicts.d.ts +5 -1
- package/types/index.d.ts +2 -0
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.
|
|
2
|
+
<a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.31/.github/logomark.svg" height="128" /></a><br/><br/>
|
|
3
3
|
<div id="wordmark">
|
|
4
|
-
<a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.
|
|
4
|
+
<a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.31/.github/wordmark-dark.svg" width="256"></a>
|
|
5
5
|
</div>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
<br/>
|
|
9
9
|
|
|
10
10
|
<div align="center" id="badges">
|
|
11
|
-
<a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.
|
|
12
|
-
<a href="https://www.npmjs.com/package/@css-hooks/preact/v/4.0.0-next.
|
|
13
|
-
<a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.
|
|
11
|
+
<a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.31"><img src="https://img.shields.io/badge/tag-v4.0.0--next.31-ffd700" alt="tag v4.0.0-next.31"></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@css-hooks/preact/v/4.0.0-next.31"><img src="https://img.shields.io/badge/npm-v4.0.0--next.31-ffd700" alt="npm version"></a>
|
|
13
|
+
<a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.31/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
---
|
package/cjs/index.js
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.createHooks = void 0;
|
|
8
|
+
exports.createHooks = exports.mergeStyles = void 0;
|
|
9
9
|
exports._stringifyValue = _stringifyValue;
|
|
10
10
|
const core_1 = require("@css-hooks/core");
|
|
11
|
+
var core_2 = require("@css-hooks/core");
|
|
12
|
+
Object.defineProperty(exports, "mergeStyles", { enumerable: true, get: function () { return core_2.mergeStyles; } });
|
|
11
13
|
const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
12
14
|
/**
|
|
13
15
|
* A {@link @css-hooks/core#CreateHooksFn} configured to use Preact's
|
|
@@ -22,10 +24,7 @@ function _stringifyValue(value, propertyName) {
|
|
|
22
24
|
case "string":
|
|
23
25
|
return value;
|
|
24
26
|
case "number":
|
|
25
|
-
return `${value}${
|
|
26
|
-
IS_NON_DIMENSIONAL.test(propertyName)
|
|
27
|
-
? ""
|
|
28
|
-
: "px"}`;
|
|
27
|
+
return `${value}${propertyName.startsWith("--") || IS_NON_DIMENSIONAL.test(propertyName) ? "" : "px"}`;
|
|
29
28
|
default:
|
|
30
29
|
return null;
|
|
31
30
|
}
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
package/esm/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
import { buildHooksSystem } from "@css-hooks/core";
|
|
7
|
+
export { mergeStyles } from "@css-hooks/core";
|
|
7
8
|
const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
8
9
|
/**
|
|
9
10
|
* A {@link @css-hooks/core#CreateHooksFn} configured to use Preact's
|
|
@@ -18,10 +19,7 @@ export function _stringifyValue(value, propertyName) {
|
|
|
18
19
|
case "string":
|
|
19
20
|
return value;
|
|
20
21
|
case "number":
|
|
21
|
-
return `${value}${
|
|
22
|
-
IS_NON_DIMENSIONAL.test(propertyName)
|
|
23
|
-
? ""
|
|
24
|
-
: "px"}`;
|
|
22
|
+
return `${value}${propertyName.startsWith("--") || IS_NON_DIMENSIONAL.test(propertyName) ? "" : "px"}`;
|
|
25
23
|
default:
|
|
26
24
|
return null;
|
|
27
25
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@css-hooks/preact",
|
|
3
3
|
"description": "CSS Hooks for Preact",
|
|
4
|
-
"version": "4.0.0-next.
|
|
4
|
+
"version": "4.0.0-next.31",
|
|
5
5
|
"author": "Nick Saunders",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@css-hooks/core": "4.0.0-next.
|
|
7
|
+
"@css-hooks/core": "4.0.0-next.31"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"preact": "
|
|
10
|
+
"preact": "^11.0.0-0",
|
|
11
11
|
"remeda": "^2.45.0"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
"!**/*.test.*"
|
|
19
19
|
],
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"main": "cjs",
|
|
22
|
-
"module": "esm",
|
|
21
|
+
"main": "./cjs/index.js",
|
|
22
|
+
"module": "./esm/index.js",
|
|
23
23
|
"type": "module",
|
|
24
|
+
"sideEffects": false,
|
|
24
25
|
"peerDependencies": {
|
|
25
|
-
"preact": "
|
|
26
|
+
"preact": "^10.27.2 || ^11.0.0-0"
|
|
26
27
|
},
|
|
27
28
|
"peerDependenciesMeta": {
|
|
28
29
|
"preact": {
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
]
|
|
50
51
|
},
|
|
51
52
|
"build": {
|
|
52
|
-
"command": "tsc && tsc --project tsconfig.cjs.json",
|
|
53
|
+
"command": "tsc && tsc --project tsconfig.cjs.json && node -e \"require('node:fs').writeFileSync('cjs/package.json', JSON.stringify({type:'commonjs'}))\"",
|
|
53
54
|
"dependencies": [
|
|
54
55
|
"../core:build"
|
|
55
56
|
]
|
package/types/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { CreateHooksFn } from "@css-hooks/core";
|
|
|
7
7
|
import type { CSSProperties } from "preact";
|
|
8
8
|
import type { CSSPropertyConflicts } from "./css-property-conflicts.ts";
|
|
9
9
|
export type * from "@css-hooks/core";
|
|
10
|
+
export { mergeStyles } from "@css-hooks/core";
|
|
11
|
+
export type { CSSPropertyConflicts } from "./css-property-conflicts.ts";
|
|
10
12
|
/**
|
|
11
13
|
* A {@link @css-hooks/core#CreateHooksFn} configured to use Preact's
|
|
12
14
|
* `CSSProperties` type and logic for converting CSS values into strings
|