@cedarjs/forms 9.0.0-canary.1784 → 9.0.0-canary.3124

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.
Files changed (42) hide show
  1. package/dist/CheckboxField.d.ts +1 -1
  2. package/dist/CheckboxField.d.ts.map +1 -1
  3. package/dist/CheckboxField.js +9 -43
  4. package/dist/FieldError.js +7 -41
  5. package/dist/FieldProps.d.ts +1 -1
  6. package/dist/FieldProps.d.ts.map +1 -1
  7. package/dist/FieldProps.js +0 -16
  8. package/dist/Form.d.ts.map +1 -1
  9. package/dist/Form.js +17 -46
  10. package/dist/FormError.d.ts +10 -2
  11. package/dist/FormError.d.ts.map +1 -1
  12. package/dist/FormError.js +21 -44
  13. package/dist/InputComponents.d.ts +1 -1
  14. package/dist/InputComponents.d.ts.map +1 -1
  15. package/dist/InputComponents.js +11 -66
  16. package/dist/Label.d.ts +1 -1
  17. package/dist/Label.d.ts.map +1 -1
  18. package/dist/Label.js +6 -40
  19. package/dist/SelectField.d.ts +1 -1
  20. package/dist/SelectField.d.ts.map +1 -1
  21. package/dist/SelectField.js +9 -43
  22. package/dist/ServerErrorsContext.d.ts.map +1 -1
  23. package/dist/ServerErrorsContext.js +4 -40
  24. package/dist/Submit.d.ts +1 -3
  25. package/dist/Submit.d.ts.map +1 -1
  26. package/dist/Submit.js +4 -38
  27. package/dist/TextAreaField.d.ts +1 -1
  28. package/dist/TextAreaField.d.ts.map +1 -1
  29. package/dist/TextAreaField.js +9 -43
  30. package/dist/coercion.d.ts.map +1 -1
  31. package/dist/coercion.js +2 -26
  32. package/dist/index.d.ts +16 -15
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +40 -87
  35. package/dist/useErrorStyles.d.ts +1 -1
  36. package/dist/useErrorStyles.d.ts.map +1 -1
  37. package/dist/useErrorStyles.js +9 -43
  38. package/dist/useRegister.d.ts +3 -3
  39. package/dist/useRegister.d.ts.map +1 -1
  40. package/dist/useRegister.js +6 -30
  41. package/package.json +25 -25
  42. package/LICENSE +0 -21
@@ -1,36 +1,13 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useRegister_exports = {};
20
- __export(useRegister_exports, {
21
- useRegister: () => useRegister
22
- });
23
- module.exports = __toCommonJS(useRegister_exports);
24
- var import_react_hook_form = require("react-hook-form");
25
- var import_coercion = require("./coercion");
1
+ import { useFormContext } from "react-hook-form";
2
+ import { setCoercion } from "./coercion.js";
26
3
  const useRegister = (props, ref, emptyAs) => {
27
- const { register } = (0, import_react_hook_form.useFormContext)();
4
+ const { register } = useFormContext();
28
5
  const { name } = props;
29
6
  if (!name) {
30
7
  throw Error("`name` prop must be provided");
31
8
  }
32
9
  const validation = props.validation || { required: false };
33
- (0, import_coercion.setCoercion)(validation, {
10
+ setCoercion(validation, {
34
11
  type: props.type,
35
12
  name,
36
13
  emptyAs
@@ -63,7 +40,6 @@ const useRegister = (props, ref, emptyAs) => {
63
40
  onChange
64
41
  };
65
42
  };
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
43
+ export {
68
44
  useRegister
69
- });
45
+ };
package/package.json CHANGED
@@ -1,19 +1,17 @@
1
1
  {
2
2
  "name": "@cedarjs/forms",
3
- "version": "9.0.0-canary.1784+baa47810a",
3
+ "version": "9.0.0-canary.3124",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
7
7
  "directory": "packages/forms"
8
8
  },
9
9
  "license": "MIT",
10
- "type": "commonjs",
10
+ "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
- "default": {
14
- "types": "./dist/index.d.ts",
15
- "default": "./dist/index.js"
16
- }
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
17
15
  }
18
16
  },
19
17
  "main": "./dist/index.js",
@@ -22,44 +20,46 @@
22
20
  "dist"
23
21
  ],
24
22
  "scripts": {
25
- "build": "tsx ./build.mts && yarn build:types",
23
+ "build": "node ./build.mts",
26
24
  "build:pack": "yarn pack -o cedarjs-forms.tgz",
27
25
  "build:types": "tsc --build --verbose ./tsconfig.build.json",
28
26
  "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
29
- "check:attw": "yarn rw-fwtools-attw",
27
+ "check:attw": "yarn cedar-fwtools-attw",
30
28
  "check:package": "concurrently npm:check:attw yarn:publint",
31
29
  "prepublishOnly": "NODE_ENV=production yarn build",
32
30
  "test": "vitest run",
33
31
  "test:watch": "vitest watch"
34
32
  },
35
33
  "dependencies": {
36
- "graphql": "16.12.0",
34
+ "graphql": "16.14.2",
37
35
  "pascalcase": "1.0.0",
38
- "react-hook-form": "7.71.1"
36
+ "react-hook-form": "7.87.0"
39
37
  },
40
38
  "devDependencies": {
41
- "@cedarjs/framework-tools": "9.0.0-canary.1784",
42
- "@testing-library/dom": "9.3.4",
39
+ "@cedarjs/framework-tools": "9.0.0-canary.3124",
40
+ "@testing-library/dom": "10.4.1",
43
41
  "@testing-library/jest-dom": "6.9.1",
44
- "@testing-library/react": "14.3.1",
45
- "@testing-library/user-event": "14.6.1",
42
+ "@testing-library/react": "16.3.3",
43
+ "@testing-library/user-event": "14.6.7",
46
44
  "@types/pascalcase": "1.0.3",
47
- "@types/react": "^18.2.55",
48
- "@types/react-dom": "^18.2.19",
49
- "concurrently": "9.2.1",
50
- "nodemon": "3.1.11",
51
- "publint": "0.3.17",
52
- "react": "19.2.3",
53
- "react-dom": "19.2.3",
54
- "tsx": "4.21.0",
45
+ "@types/react": "^19.2.0",
46
+ "@types/react-dom": "^19.2.0",
47
+ "concurrently": "9.2.4",
48
+ "nodemon": "3.1.14",
49
+ "publint": "0.3.24",
50
+ "react": "19.2.8",
51
+ "react-dom": "19.2.8",
55
52
  "typescript": "5.9.3",
56
- "vitest": "3.2.4"
53
+ "vitest": "4.1.11"
57
54
  },
58
55
  "peerDependencies": {
59
- "react": "19.2.3"
56
+ "react": "19.2.8"
57
+ },
58
+ "engines": {
59
+ "node": ">=24"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "baa47810a7defb73de27fdf513b815d679509b5e"
64
+ "gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
65
65
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Cedar
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.