@css-hooks/solid 2.0.3 → 3.0.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/README.md +44 -33
- package/cjs/index.js +16 -7
- package/esm/index.js +11 -3
- package/package.json +13 -23
- package/tsdoc-metadata.json +11 -0
- package/types/index.d.ts +1 -4
package/README.md
CHANGED
|
@@ -27,18 +27,18 @@ experience without runtime style injection or build steps.
|
|
|
27
27
|
|
|
28
28
|
```jsx
|
|
29
29
|
<button
|
|
30
|
-
style={
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
style={pipe(
|
|
31
|
+
{
|
|
32
|
+
background: "#004982",
|
|
33
|
+
color: "#eeeff0",
|
|
34
|
+
},
|
|
35
|
+
on("&:hover", {
|
|
36
|
+
background: "#1b659c",
|
|
37
|
+
}),
|
|
38
|
+
on("&:active", {
|
|
39
|
+
background: "#9f3131",
|
|
40
|
+
}),
|
|
41
|
+
)}
|
|
42
42
|
>
|
|
43
43
|
Save changes
|
|
44
44
|
</button>
|
|
@@ -50,13 +50,12 @@ experience without runtime style injection or build steps.
|
|
|
50
50
|
<label>
|
|
51
51
|
<input type="checkbox" checked />
|
|
52
52
|
<span
|
|
53
|
-
style={
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})}
|
|
53
|
+
style={pipe(
|
|
54
|
+
{},
|
|
55
|
+
on(":checked + &", {
|
|
56
|
+
textDecoration: "line-through",
|
|
57
|
+
}),
|
|
58
|
+
)}
|
|
60
59
|
>
|
|
61
60
|
Simplify CSS architecture
|
|
62
61
|
</span>
|
|
@@ -68,30 +67,42 @@ experience without runtime style injection or build steps.
|
|
|
68
67
|
```jsx
|
|
69
68
|
<>
|
|
70
69
|
<span
|
|
71
|
-
style={
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})}
|
|
70
|
+
style={pipe(
|
|
71
|
+
{},
|
|
72
|
+
on(not("@container (width < 400px)"), {
|
|
73
|
+
display: "none",
|
|
74
|
+
}),
|
|
75
|
+
)}
|
|
78
76
|
>
|
|
79
77
|
sm
|
|
80
78
|
</span>
|
|
81
79
|
<span
|
|
82
|
-
style={
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})}
|
|
80
|
+
style={pipe(
|
|
81
|
+
{},
|
|
82
|
+
on("@container (width < 400px)", {
|
|
83
|
+
display: "none",
|
|
84
|
+
}),
|
|
85
|
+
)}
|
|
89
86
|
>
|
|
90
87
|
lg
|
|
91
88
|
</span>
|
|
92
89
|
</>
|
|
93
90
|
```
|
|
94
91
|
|
|
92
|
+
## Compatibility
|
|
93
|
+
|
|
94
|
+
### Framework integrations
|
|
95
|
+
|
|
96
|
+
| <img src="https://github.com/reactjs.png" alt="React" style="width: 24px; height: 24px" /><br/>React | <img src="https://github.com/preactjs.png" alt="Preact" style="width: 24px; height: 24px" /><br/>Preact | <img src="https://github.com/solidjs.png" alt="Solid" style="width: 24px; height: 24px" /><br/>Solid | <img src="https://github.com/qwikdev.png" alt="Qwik" style="width: 24px; height: 24px" /><br/>Qwik |
|
|
97
|
+
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| <div align="center"><a href="https://www.npmjs.com/package/@css-hooks/react">✅</a></div> | <div align="center"><a href="https://www.npmjs.com/package/@css-hooks/preact">✅</a></div> | <div align="center"><a href="https://www.npmjs.com/package/@css-hooks/solid">✅</a></div> | <div align="center"><a href="https://www.npmjs.com/package/@css-hooks/qwik">✅</a></div> |
|
|
99
|
+
|
|
100
|
+
### Browser support
|
|
101
|
+
|
|
102
|
+
| <img src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/74.1.0/chrome/chrome_24x24.png" alt="Chrome" /><br/>Chrome | <img src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/74.1.0/edge/edge_24x24.png" alt="Edge" /><br/>Edge | <img src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/74.1.0/safari/safari_24x24.png" alt="Safari" /><br/>Safari | <img src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/74.1.0/firefox/firefox_24x24.png" alt="Firefox" /><br/>Firefox | <img src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/74.1.0/opera/opera_24x24.png" alt="Opera" /><br/>Opera |
|
|
103
|
+
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
104
|
+
| <div align="center">49+</div> | <div align="center">16+</div> | <div align="center">10+</div> | <div align="center">31+</div> | <div align="center">36+</div> |
|
|
105
|
+
|
|
95
106
|
## Documentation
|
|
96
107
|
|
|
97
108
|
Please visit [css-hooks.com](https://css-hooks.com) to get started.
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CSS Hooks for {@link https://www.solidjs.com/ | Solid}
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.createHooks = void 0;
|
|
9
|
+
const core_1 = require("@css-hooks/core");
|
|
10
|
+
/**
|
|
11
|
+
* A {@link @css-hooks/core#CreateHooksFn} configured to use Solid's
|
|
12
|
+
* `JSX.CSSProperties` type and logic for converting CSS values into strings.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
exports.createHooks = (0, core_1.buildHooksSystem)();
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* CSS Hooks for {@link https://www.solidjs.com/ | Solid}
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
3
6
|
import { buildHooksSystem } from "@css-hooks/core";
|
|
4
|
-
|
|
7
|
+
/**
|
|
8
|
+
* A {@link @css-hooks/core#CreateHooksFn} configured to use Solid's
|
|
9
|
+
* `JSX.CSSProperties` type and logic for converting CSS values into strings.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
5
13
|
export const createHooks = buildHooksSystem();
|
package/package.json
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@css-hooks/solid",
|
|
3
3
|
"description": "CSS Hooks for Solid",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"author": "Nick Saunders",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@css-hooks/core": "
|
|
8
|
-
"ts-toolbelt": "^9.6.0"
|
|
7
|
+
"@css-hooks/core": "3.0.0"
|
|
9
8
|
},
|
|
10
9
|
"devDependencies": {
|
|
11
10
|
"@microsoft/api-extractor": "^7.39.4",
|
|
12
|
-
"@tsconfig/strictest": "^2.0.1",
|
|
13
|
-
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
14
|
-
"@typescript-eslint/parser": "^7.0.0",
|
|
15
|
-
"ascjs": "^6.0.3",
|
|
16
|
-
"eslint": "^8.47.0",
|
|
17
|
-
"eslint-plugin-compat": "^4.2.0",
|
|
18
11
|
"rimraf": "^5.0.1",
|
|
19
12
|
"solid-js": "^1.7.11",
|
|
20
|
-
"
|
|
21
|
-
"typescript": "
|
|
13
|
+
"tsx": "^4.19.1",
|
|
14
|
+
"typescript": "=5.4.2"
|
|
22
15
|
},
|
|
23
16
|
"files": [
|
|
24
17
|
"cjs",
|
|
25
18
|
"esm",
|
|
26
19
|
"types",
|
|
27
|
-
"tsdoc-metadata.json"
|
|
20
|
+
"tsdoc-metadata.json",
|
|
21
|
+
"!**/*.test.*"
|
|
28
22
|
],
|
|
29
23
|
"license": "MIT",
|
|
30
24
|
"main": "cjs",
|
|
@@ -38,19 +32,11 @@
|
|
|
38
32
|
"url": "https://github.com/css-hooks/css-hooks.git",
|
|
39
33
|
"directory": "packages/solid"
|
|
40
34
|
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"api": "node -e \"var path=require('path').resolve,fs=require('fs'),cp=fs.cpSync;cp(path('src', 'index.d.ts'),path('types','index.d.ts'))\" && api-extractor run",
|
|
43
|
-
"clean": "rimraf cjs esm out types",
|
|
44
|
-
"lint": "eslint src .*.*js *.*js",
|
|
45
|
-
"postversion": "npm install @css-hooks/core@^$npm_package_version --force",
|
|
46
|
-
"prepublishOnly": "node -e \"var path=require('path').resolve,fs=require('fs'),cp=fs.cpSync,mkdir=fs.mkdirSync;cp(path('src', 'index.d.ts'),path('types','index.d.ts'));cp(path('src','index.js'),path('esm','index.js'));mkdir(path('cjs'),{recursive:true})\" && ascjs src/index.js cjs/index.js",
|
|
47
|
-
"test": "tsc && node --test",
|
|
48
|
-
"test.watch": "tsc-watch --onSuccess 'node --test'"
|
|
49
|
-
},
|
|
50
35
|
"type": "module",
|
|
51
36
|
"types": "types",
|
|
52
37
|
"exports": {
|
|
53
38
|
".": {
|
|
39
|
+
"@css-hooks/source": "./src/index.ts",
|
|
54
40
|
"import": "./esm/index.js",
|
|
55
41
|
"require": "./cjs/index.js",
|
|
56
42
|
"types": "./types/index.d.ts"
|
|
@@ -58,5 +44,9 @@
|
|
|
58
44
|
},
|
|
59
45
|
"browserslist": [
|
|
60
46
|
"supports css-variables"
|
|
61
|
-
]
|
|
62
|
-
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"clean": "rimraf cjs esm types",
|
|
50
|
+
"test": "node --import tsx --conditions @css-hooks/source --test src/index.test.ts"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.43.1"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
import type { JSX } from "solid-js";
|
|
8
|
-
import type { CreateHooksFn } from "@css-hooks/core";
|
|
9
|
-
|
|
10
7
|
/**
|
|
11
8
|
* A {@link @css-hooks/core#CreateHooksFn} configured to use Solid's
|
|
12
9
|
* `JSX.CSSProperties` type and logic for converting CSS values into strings.
|
|
13
10
|
*
|
|
14
11
|
* @public
|
|
15
12
|
*/
|
|
16
|
-
export const createHooks: CreateHooksFn<JSX.CSSProperties>;
|
|
13
|
+
export declare const createHooks: import("@css-hooks/core").CreateHooksFn<JSX.CSSProperties>;
|