@jfdevelops/react-layout-adapter-arktype 0.0.0-stub.0 → 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 +21 -4
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +51 -21
- package/index.js +0 -1
package/README.md
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
# @jfdevelops/react-layout-adapter-arktype
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
# @jfdevelops/react-layout-adapter-arktype
|
|
2
|
+
|
|
3
|
+
Opt-in native arktype schemas for `React.ReactNode` and `React.ReactElement`.
|
|
4
|
+
Install this adapter alongside `arktype` and React:
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
pnpm add @jfdevelops/react-layout-adapter-arktype arktype
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { reactNode, reactElement } from '@jfdevelops/react-layout-adapter-arktype';
|
|
12
|
+
|
|
13
|
+
const content = reactNode();
|
|
14
|
+
const icon = reactElement();
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Both helpers return native arktype 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 arktype = require("arktype");
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
const { reactNode, reactElement } = (0, _jfdevelops_react_layout_adapters.createAdapter)({
|
|
6
|
+
node: (check) => (0, arktype.type)("unknown").narrow(check),
|
|
7
|
+
element: (check) => (0, arktype.type)("unknown").narrow(check)
|
|
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 { type } from 'arktype';\n\nexport const { reactNode, reactElement } = createAdapter({\n node: (check) => type('unknown').narrow(check),\n element: (check) => type('unknown').narrow(check),\n});\n"],"mappings":";;;;AAGA,MAAa,EAAE,WAAW,kBAAA,GAAA,kCAAA,eAA+B;CACvD,OAAO,WAAA,GAAA,QAAA,MAAe,SAAS,EAAE,OAAO,KAAK;CAC7C,UAAU,WAAA,GAAA,QAAA,MAAe,SAAS,EAAE,OAAO,KAAK;AAClD,CAAC"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare const reactNode: () => import("arktype").BaseType<import("react").ReactNode, {}>, reactElement: () => import("arktype/internal/variants/object.ts").ObjectType<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, {}>;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { reactElement, reactNode };
|
|
5
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare const reactNode: () => import("arktype").BaseType<import("react").ReactNode, {}>, reactElement: () => import("arktype/internal/variants/object.ts").ObjectType<import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, {}>;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { reactElement, reactNode };
|
|
5
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createAdapter } from "@jfdevelops/react-layout-adapters";
|
|
2
|
+
import { type } from "arktype";
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
const { reactNode, reactElement } = createAdapter({
|
|
5
|
+
node: (check) => type("unknown").narrow(check),
|
|
6
|
+
element: (check) => type("unknown").narrow(check)
|
|
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 { type } from 'arktype';\n\nexport const { reactNode, reactElement } = createAdapter({\n node: (check) => type('unknown').narrow(check),\n element: (check) => type('unknown').narrow(check),\n});\n"],"mappings":";;;AAGA,MAAa,EAAE,WAAW,iBAAiB,cAAc;CACvD,OAAO,UAAU,KAAK,SAAS,EAAE,OAAO,KAAK;CAC7C,UAAU,UAAU,KAAK,SAAS,EAAE,OAAO,KAAK;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@jfdevelops/react-layout-adapter-arktype",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@jfdevelops/react-layout-adapter-arktype",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Native arktype 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-arktype"
|
|
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
|
+
"arktype": "^2.2.8",
|
|
31
|
+
"react": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"arktype": "2.2.8",
|
|
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
|
+
}
|
|
51
|
+
}
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
throw new Error("@jfdevelops/react-layout-adapter-arktype is a placeholder package. The implementation has not been released yet.");
|