@rachelallyson/hero-hook-form 2.2.1 → 2.4.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/CHANGELOG.md +54 -0
- package/dist/index.d.ts +827 -45
- package/dist/index.js +310 -206
- package/dist/react/index.d.ts +827 -46
- package/dist/react/index.js +316 -211
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [2.4.0] - 2026-01-13
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Switch Field Description Support**: Added optional `description` parameter to `FormFieldHelpers.switch()` and `BasicFormBuilder.switch()`
|
|
10
|
+
- Allows adding help text to switch fields for better UX
|
|
11
|
+
- Description is rendered below the switch component
|
|
12
|
+
- Backward compatible - existing code without description continues to work
|
|
13
|
+
- Example: `FormFieldHelpers.switch("notifications", "Enable notifications", "Receive email notifications")`
|
|
14
|
+
|
|
15
|
+
- **Conditional Field Helper**: Added `FormFieldHelpers.conditional()` helper function for creating conditional fields
|
|
16
|
+
- Simplifies creating fields that show/hide based on form data
|
|
17
|
+
- Works seamlessly with all form types
|
|
18
|
+
- Example: `FormFieldHelpers.conditional("phone", (values) => values.hasPhone === true, FormFieldHelpers.input("phone", "Phone Number", "tel"))`
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **AdvancedFormBuilder Switch Field**: Fixed bug in `AdvancedFormBuilder.switchField()` where:
|
|
23
|
+
- `description` parameter was accepted but not included in the returned config
|
|
24
|
+
- `isDisabled` was incorrectly placed in `switchProps.disabled` instead of at the top level
|
|
25
|
+
- Both properties are now correctly placed at the top level of the field config
|
|
26
|
+
|
|
27
|
+
### Testing
|
|
28
|
+
|
|
29
|
+
- Added comprehensive test coverage for switch field description functionality
|
|
30
|
+
- Added tests for `FormFieldHelpers.switch()` with and without description
|
|
31
|
+
- Added tests for `BasicFormBuilder.switch()` with description
|
|
32
|
+
- All tests passing (8/8 tests in SwitchField.cy.tsx)
|
|
33
|
+
|
|
34
|
+
## [2.3.0] - 2026-01-13
|
|
35
|
+
|
|
36
|
+
### Removed
|
|
37
|
+
|
|
38
|
+
- **Breaking Change**: Removed `render` prop from `ZodForm` and `ZodFormConfig`
|
|
39
|
+
- The `render` prop was rarely used and added unnecessary complexity
|
|
40
|
+
- Use `content` field type instead for adding headers, questions, or custom content between fields
|
|
41
|
+
- This simplifies the API and makes it more consistent
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **Type Safety**: Removed all `any` types from `ContentFieldConfig` and `FormFieldHelpers.content()`
|
|
46
|
+
- Replaced with type-safe approach using minimal type assertion
|
|
47
|
+
- Maintains full type safety while allowing compatibility with any form type
|
|
48
|
+
- No breaking changes - all existing code continues to work
|
|
49
|
+
|
|
50
|
+
## [2.2.2] - 2026-01-13
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- **Type Safety**: Removed all `any` types from `ContentFieldConfig` and `FormFieldHelpers.content()`
|
|
55
|
+
- Replaced with type-safe approach using minimal type assertion
|
|
56
|
+
- Maintains full type safety while allowing compatibility with any form type
|
|
57
|
+
- No breaking changes - all existing code continues to work
|
|
58
|
+
|
|
5
59
|
## [2.2.1] - 2026-01-13
|
|
6
60
|
|
|
7
61
|
### Fixed
|