@privaty/ui-forms 0.4.0 → 0.4.1

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 (2) hide show
  1. package/README.md +8 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -113,8 +113,14 @@ category: v.pipe(v.optional(v.string(), ""), v.picklist(categories, "required"))
113
113
  // the schema boundary — the designed seam for exactly this.
114
114
  categoryId: v.optional(v.pipe(v.string(), v.transform((value) => value || undefined))),
115
115
 
116
- // Month inputs submit "YYYY-MM"; empty submits "".
117
- availableFrom: v.pipe(v.string(), v.nonEmpty("required"), v.regex(/^\d{4}-\d{2}$/, "invalid-month")),
116
+ // Month inputs submit "YYYY-MM"; empty submits "". Two v.check actions,
117
+ // not nonEmpty+regex: valibot pipes run every action even after a failure,
118
+ // so an empty value would show BOTH messages stacked.
119
+ availableFrom: v.pipe(
120
+ v.string(),
121
+ v.check((value) => value.length > 0, "required"),
122
+ v.check((value) => value === "" || /^\d{4}-\d{2}$/.test(value), "invalid-month"),
123
+ ),
118
124
  ```
119
125
 
120
126
  ## Rules learned the hard way
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privaty/ui-forms",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "access": "public"
40
40
  },
41
41
  "peerDependencies": {
42
- "@privaty/ui": "^0.4.0",
42
+ "@privaty/ui": "^0.4.1",
43
43
  "@sveltejs/kit": "^3.0.0-next.0",
44
44
  "svelte": "^5.29.0"
45
45
  },
@@ -50,7 +50,7 @@
50
50
  "devDependencies": {
51
51
  "@config/eslint": "0.0.0",
52
52
  "@config/typescript": "0.0.0",
53
- "@privaty/ui": "0.4.0",
53
+ "@privaty/ui": "0.4.1",
54
54
  "@sveltejs/kit": "3.0.0-next.25",
55
55
  "@sveltejs/package": "^2.5.8",
56
56
  "eslint": "^10.9.1",