@css-hooks/preact 4.0.0-next.2 → 4.0.0-next.20
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 +2 -6
- package/esm/index.js +2 -6
- package/package.json +4 -4
- package/types/css-property-conflicts.d.ts +5 -1
- package/types/index.d.ts +2 -1
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.20/.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.20/.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.20"><img src="https://img.shields.io/badge/tag-v4.0.0--next.20-ffd700" alt="tag v4.0.0-next.20"></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@css-hooks/preact/v/4.0.0-next.20"><img src="https://img.shields.io/badge/npm-v4.0.0--next.20-ffd700" alt="npm version"></a>
|
|
13
|
+
<a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.20/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
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.createHooks = void 0;
|
|
9
9
|
exports._stringifyValue = _stringifyValue;
|
|
10
10
|
const core_1 = require("@css-hooks/core");
|
|
11
|
-
const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
12
11
|
/**
|
|
13
12
|
* A {@link @css-hooks/core#CreateHooksFn} configured to use Preact's
|
|
14
13
|
* `CSSProperties` type and logic for converting CSS values into strings
|
|
@@ -17,15 +16,12 @@ const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zo
|
|
|
17
16
|
*/
|
|
18
17
|
exports.createHooks = (0, core_1.buildHooksSystem)(_stringifyValue);
|
|
19
18
|
/** @internal */
|
|
20
|
-
function _stringifyValue(value,
|
|
19
|
+
function _stringifyValue(value, _propertyName) {
|
|
21
20
|
switch (typeof value) {
|
|
22
21
|
case "string":
|
|
23
22
|
return value;
|
|
24
23
|
case "number":
|
|
25
|
-
return
|
|
26
|
-
IS_NON_DIMENSIONAL.test(propertyName)
|
|
27
|
-
? ""
|
|
28
|
-
: "px"}`;
|
|
24
|
+
return String(value);
|
|
29
25
|
default:
|
|
30
26
|
return null;
|
|
31
27
|
}
|
package/esm/index.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
import { buildHooksSystem } from "@css-hooks/core";
|
|
7
|
-
const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
8
7
|
/**
|
|
9
8
|
* A {@link @css-hooks/core#CreateHooksFn} configured to use Preact's
|
|
10
9
|
* `CSSProperties` type and logic for converting CSS values into strings
|
|
@@ -13,15 +12,12 @@ const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zo
|
|
|
13
12
|
*/
|
|
14
13
|
export const createHooks = buildHooksSystem(_stringifyValue);
|
|
15
14
|
/** @internal */
|
|
16
|
-
export function _stringifyValue(value,
|
|
15
|
+
export function _stringifyValue(value, _propertyName) {
|
|
17
16
|
switch (typeof value) {
|
|
18
17
|
case "string":
|
|
19
18
|
return value;
|
|
20
19
|
case "number":
|
|
21
|
-
return
|
|
22
|
-
IS_NON_DIMENSIONAL.test(propertyName)
|
|
23
|
-
? ""
|
|
24
|
-
: "px"}`;
|
|
20
|
+
return String(value);
|
|
25
21
|
default:
|
|
26
22
|
return null;
|
|
27
23
|
}
|
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.20",
|
|
5
5
|
"author": "Nick Saunders",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@css-hooks/core": "4.0.0-next.
|
|
7
|
+
"@css-hooks/core": "4.0.0-next.20"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"preact": "
|
|
10
|
+
"preact": "^11.0.0-0",
|
|
11
11
|
"remeda": "^2.45.0"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"module": "esm",
|
|
23
23
|
"type": "module",
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"preact": "
|
|
25
|
+
"preact": "^10.27.2 || ^11.0.0-0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependenciesMeta": {
|
|
28
28
|
"preact": {
|
package/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ 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 type { CSSPropertyConflicts } from "./css-property-conflicts.ts";
|
|
10
11
|
/**
|
|
11
12
|
* A {@link @css-hooks/core#CreateHooksFn} configured to use Preact's
|
|
12
13
|
* `CSSProperties` type and logic for converting CSS values into strings
|
|
@@ -15,4 +16,4 @@ export type * from "@css-hooks/core";
|
|
|
15
16
|
*/
|
|
16
17
|
export declare const createHooks: CreateHooksFn<CSSProperties, CSSPropertyConflicts>;
|
|
17
18
|
/** @internal */
|
|
18
|
-
export declare function _stringifyValue(value: unknown,
|
|
19
|
+
export declare function _stringifyValue(value: unknown, _propertyName: string): string | null;
|