@jfdevelops/react-layout-adapter-valibot 0.0.0-stage → 0.1.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 +20 -2
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +48 -3
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @jfdevelops/react-layout-adapter-valibot
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Opt-in native valibot schemas for `React.ReactNode` and `React.ReactElement`.
|
|
4
|
+
Install this adapter alongside `valibot` and React:
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
pnpm add @jfdevelops/react-layout-adapter-valibot valibot
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { reactNode, reactElement } from '@jfdevelops/react-layout-adapter-valibot';
|
|
12
|
+
|
|
13
|
+
const content = reactNode();
|
|
14
|
+
const icon = reactElement();
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Both helpers return native valibot schemas, so use the library's normal
|
|
18
|
+
object, array, union, and optional APIs. `reactElement()` accepts element values
|
|
19
|
+
such as `<Icon />`; component functions require their own schema.
|
|
20
|
+
|
|
21
|
+
See the [Standard Schema guide](../../docs/standard-schema.md) for usage with React Layout.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _jfdevelops_react_layout_adapters = require("@jfdevelops/react-layout-adapters");
|
|
3
|
+
let valibot = require("valibot");
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
const { reactNode, reactElement } = (0, _jfdevelops_react_layout_adapters.createAdapter)({
|
|
6
|
+
node: (check) => (0, valibot.custom)(check, "Expected a React node"),
|
|
7
|
+
element: (check) => (0, valibot.custom)(check, "Expected a React element")
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.reactElement = reactElement;
|
|
11
|
+
exports.reactNode = reactNode;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createAdapter } from '@jfdevelops/react-layout-adapters';\nimport { custom } from 'valibot';\nimport type { ReactElement, ReactNode } from 'react';\n\nexport const { reactNode, reactElement } = createAdapter({\n node: (check) => custom<ReactNode>(check, 'Expected a React node'),\n element: (check) => custom<ReactElement>(check, 'Expected a React element'),\n});\n"],"mappings":";;;;AAIA,MAAa,EAAE,WAAW,kBAAA,GAAA,kCAAA,eAA+B;CACvD,OAAO,WAAA,GAAA,QAAA,QAA4B,OAAO,uBAAuB;CACjE,UAAU,WAAA,GAAA,QAAA,QAA+B,OAAO,0BAA0B;AAC5E,CAAC"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
declare const reactNode: () => import("valibot").CustomSchema<ReactNode, import("valibot").ErrorMessage<import("valibot").CustomIssue> | undefined>, reactElement: () => import("valibot").CustomSchema<ReactElement<any, string | import("react").JSXElementConstructor<any>>, import("valibot").ErrorMessage<import("valibot").CustomIssue> | undefined>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { reactElement, reactNode };
|
|
7
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
declare const reactNode: () => import("valibot").CustomSchema<ReactNode, import("valibot").ErrorMessage<import("valibot").CustomIssue> | undefined>, reactElement: () => import("valibot").CustomSchema<ReactElement<any, string | import("react").JSXElementConstructor<any>>, import("valibot").ErrorMessage<import("valibot").CustomIssue> | undefined>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { reactElement, reactNode };
|
|
7
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createAdapter } from "@jfdevelops/react-layout-adapters";
|
|
2
|
+
import { custom } from "valibot";
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
const { reactNode, reactElement } = createAdapter({
|
|
5
|
+
node: (check) => custom(check, "Expected a React node"),
|
|
6
|
+
element: (check) => custom(check, "Expected a React element")
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { reactElement, reactNode };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createAdapter } from '@jfdevelops/react-layout-adapters';\nimport { custom } from 'valibot';\nimport type { ReactElement, ReactNode } from 'react';\n\nexport const { reactNode, reactElement } = createAdapter({\n node: (check) => custom<ReactNode>(check, 'Expected a React node'),\n element: (check) => custom<ReactElement>(check, 'Expected a React element'),\n});\n"],"mappings":";;;AAIA,MAAa,EAAE,WAAW,iBAAiB,cAAc;CACvD,OAAO,UAAU,OAAkB,OAAO,uBAAuB;CACjE,UAAU,UAAU,OAAqB,OAAO,0BAA0B;AAC5E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jfdevelops/react-layout-adapter-valibot",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Native valibot schemas for React nodes and elements in React Layout.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/jfdevelops/react-layout.git",
|
|
8
|
+
"directory": "packages/adapter-valibot"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
|
+
"module": "./dist/index.mjs",
|
|
17
|
+
"types": "./dist/index.d.mts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.mts",
|
|
21
|
+
"import": "./dist/index.mjs",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"valibot": "^1.0.0",
|
|
31
|
+
"react": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"valibot": "^1.5.0",
|
|
35
|
+
"react": "18.3.1",
|
|
36
|
+
"@types/react": "18.3.28",
|
|
37
|
+
"tsdown": "0.22.1",
|
|
38
|
+
"typescript": "6.0.3"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public",
|
|
42
|
+
"provenance": true
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@jfdevelops/react-layout-adapters": "0.1.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsdown",
|
|
49
|
+
"typecheck": "tsc --noEmit"
|
|
50
|
+
}
|
|
6
51
|
}
|