@samline/forms 2.4.0 → 2.7.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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -8
  3. package/dist/browser/global.d.ts +28 -18
  4. package/dist/browser/global.global.js +477 -66
  5. package/dist/browser/global.global.js.map +1 -1
  6. package/dist/browser/index.cjs +1450 -0
  7. package/dist/browser/index.cjs.map +1 -0
  8. package/dist/browser/index.d.cts +14 -0
  9. package/dist/browser/index.d.ts +14 -0
  10. package/dist/browser/index.js +23 -0
  11. package/dist/browser/index.js.map +1 -0
  12. package/dist/chunk-WGPAVJTK.js +1415 -0
  13. package/dist/chunk-WGPAVJTK.js.map +1 -0
  14. package/dist/index.cjs +296 -40
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +4 -158
  17. package/dist/index.d.ts +4 -158
  18. package/dist/index.js +7 -1148
  19. package/dist/index.js.map +1 -1
  20. package/dist/registry-GzopYPCR.d.cts +164 -0
  21. package/dist/registry-GzopYPCR.d.ts +164 -0
  22. package/docs/api/add-cleanup.md +52 -0
  23. package/docs/api/append.md +96 -0
  24. package/docs/api/auto-submit.md +91 -0
  25. package/docs/api/clear-errors.md +69 -0
  26. package/docs/api/destroy.md +80 -0
  27. package/docs/api/disable-auto-submit.md +65 -0
  28. package/docs/api/element.md +78 -0
  29. package/docs/api/form.md +156 -0
  30. package/docs/api/format.md +270 -0
  31. package/docs/api/get-data.md +90 -0
  32. package/docs/api/get-field.md +87 -0
  33. package/docs/api/get-state.md +111 -0
  34. package/docs/api/get-value.md +114 -0
  35. package/docs/api/index.md +55 -0
  36. package/docs/api/observe.md +126 -0
  37. package/docs/api/on-submit.md +94 -0
  38. package/docs/api/parse-form-data.md +94 -0
  39. package/docs/api/prefill.md +89 -0
  40. package/docs/api/regex.md +155 -0
  41. package/docs/api/reset.md +61 -0
  42. package/docs/api/revalidate.md +52 -0
  43. package/docs/api/set-errors.md +97 -0
  44. package/docs/api/set-value.md +120 -0
  45. package/docs/api/subscribe.md +107 -0
  46. package/docs/api/unwatch.md +74 -0
  47. package/docs/api/validate-field-value.md +144 -0
  48. package/docs/api/validate-values.md +103 -0
  49. package/docs/api/validate.md +102 -0
  50. package/docs/api/watch.md +117 -0
  51. package/docs/browser.md +156 -0
  52. package/docs/css-styling.md +191 -0
  53. package/docs/getting-started.md +222 -0
  54. package/docs/options.md +326 -0
  55. package/docs/recipes.md +530 -0
  56. package/docs/typescript.md +615 -0
  57. package/docs/vanilla.md +12 -0
  58. package/package.json +58 -14
package/package.json CHANGED
@@ -1,10 +1,25 @@
1
1
  {
2
2
  "name": "@samline/forms",
3
- "version": "2.4.0",
4
- "description": "Form controller for vanilla JS and direct browser usage.",
3
+ "version": "2.7.0",
4
+ "description": "TypeScript-first, framework-free form controller with validation, reactive state, serialization, auto-submit, and input formatting.",
5
+ "keywords": [
6
+ "forms",
7
+ "form-validation",
8
+ "form-state",
9
+ "typescript",
10
+ "vanilla-javascript",
11
+ "browser"
12
+ ],
5
13
  "type": "module",
6
14
  "license": "MIT",
7
15
  "homepage": "https://samline.github.io/forms",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/samline/forms.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/samline/forms/issues"
22
+ },
8
23
  "publishConfig": {
9
24
  "access": "public",
10
25
  "tag": "latest"
@@ -12,21 +27,40 @@
12
27
  "engines": {
13
28
  "node": ">=20"
14
29
  },
15
- "sideEffects": false,
30
+ "sideEffects": [
31
+ "./dist/browser/index.js",
32
+ "./dist/browser/index.cjs",
33
+ "./dist/browser/global.global.js"
34
+ ],
16
35
  "files": [
17
- "dist"
36
+ "dist",
37
+ "docs"
18
38
  ],
19
39
  "main": "./dist/index.cjs",
20
40
  "module": "./dist/index.js",
21
41
  "types": "./dist/index.d.ts",
22
42
  "exports": {
23
43
  ".": {
24
- "types": "./dist/index.d.ts",
25
- "import": "./dist/index.js",
26
- "require": "./dist/index.cjs"
44
+ "import": {
45
+ "types": "./dist/index.d.ts",
46
+ "default": "./dist/index.js"
47
+ },
48
+ "require": {
49
+ "types": "./dist/index.d.cts",
50
+ "default": "./dist/index.cjs"
51
+ }
27
52
  },
28
53
  "./browser": {
29
- "types": "./dist/browser/global.d.ts",
54
+ "import": {
55
+ "types": "./dist/browser/index.d.ts",
56
+ "default": "./dist/browser/index.js"
57
+ },
58
+ "require": {
59
+ "types": "./dist/browser/index.d.cts",
60
+ "default": "./dist/browser/index.cjs"
61
+ }
62
+ },
63
+ "./browser/global": {
30
64
  "default": "./dist/browser/global.global.js"
31
65
  }
32
66
  },
@@ -37,8 +71,10 @@
37
71
  "pack:check": "npm pack --dry-run",
38
72
  "typecheck": "tsc --noEmit",
39
73
  "test": "vitest run",
74
+ "test:coverage": "vitest run --coverage",
75
+ "test:package": "node scripts/test-package.mjs && tsc -p tsconfig.package.json",
40
76
  "test:watch": "vitest",
41
- "prepublishOnly": "npm run clean && npm run build && npm run typecheck && npm test"
77
+ "prepublishOnly": "npm run clean && npm run build && npm run typecheck && npm test && npm run test:package && npm run pack:check"
42
78
  },
43
79
  "peerDependencies": {
44
80
  "@samline/formatter": "^2.0.0"
@@ -48,12 +84,20 @@
48
84
  "optional": true
49
85
  }
50
86
  },
87
+ "overrides": {
88
+ "esbuild": "^0.28.1",
89
+ "nanoid": "^3.3.18",
90
+ "postcss": "^8.5.23",
91
+ "vite": "^8.0.0"
92
+ },
51
93
  "devDependencies": {
52
94
  "@samline/formatter": "^2.0.0",
53
- "@types/node": "^24.0.0",
54
- "jsdom": "^26.1.0",
55
- "tsup": "^8.5.0",
56
- "typescript": "^5.8.3",
57
- "vitest": "^3.1.1"
95
+ "@types/node": "^26.6.2",
96
+ "@vitest/coverage-v8": "^5.0.1",
97
+ "jsdom": "^30.1.0",
98
+ "tsup": "^8.5.1",
99
+ "typescript": "^5.9.3",
100
+ "vite": "^8.0.0",
101
+ "vitest": "^5.0.1"
58
102
  }
59
103
  }