@classytic/formkit 1.0.2 → 1.2.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 ADDED
@@ -0,0 +1,78 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.1.0] - 2026-02-24
9
+
10
+ ### Added
11
+
12
+ - **`useFormKit` hook** — Convenience hook that combines schema default extraction with react-hook-form setup. Returns all `useForm` methods plus ready-to-spread `generatorProps` for minimal boilerplate form setup
13
+ - **`extractDefaultValues(schema)`** — Server-safe utility that walks a schema and extracts all `defaultValue` fields into a flat object, respecting `nameSpace` prefixes and group `itemFields`
14
+ - **`buildValidationRules(field)`** — Server-safe utility that generates react-hook-form validation rules from a field's `required`, `min`, `max`, `minLength`, `maxLength`, and `pattern` props with auto-generated error messages
15
+ - **`ref` prop on FormGenerator** — React 19 ref-as-prop support (no `forwardRef` needed). Pass a ref to get access to the root `<div>` element
16
+ - **`fieldState` runtime data** — `FieldComponentProps` now receives real `fieldState` with `invalid`, `isDirty`, `isTouched`, `isValidating`, and `error` from react-hook-form (previously always `undefined`)
17
+ - **Server entry exports** — `extractDefaultValues` and `buildValidationRules` added to `@classytic/formkit/server`
18
+ - New type exports: `UseFormKitOptions`, `UseFormKitReturn`
19
+
20
+ ### Fixed
21
+
22
+ - **Nested path DSL conditions** — `evaluateRule` now correctly resolves both flat keys (`"address.city"` as literal key from `DynamicFieldWrapper`) and nested objects (`{ address: { city: "NYC" } }`)
23
+ - **`useFormState` scoped per-field** — Added `name` parameter to prevent unnecessary re-renders across unrelated fields
24
+ - Removed `process.env.NODE_ENV` guard from missing-control warning — now always warns
25
+
26
+ ### Changed
27
+
28
+ - Requires React Hook Form `^7.54.0` (was `^7.53.2`)
29
+
30
+ ## [1.0.3] - 2024-12-04
31
+
32
+ ### Changed
33
+
34
+ - **Complete TypeScript Migration**: Rewrote entire codebase with strict TypeScript
35
+ - **Improved Type Definitions**: Added comprehensive type exports for better DX
36
+ - **Modern Build System**: Updated tsup configuration for better tree-shaking
37
+ - **Enhanced Types**: Added `FieldOption`, `FieldOptionGroup`, `DefineField` utility types
38
+ - **Better Error Messages**: Improved development warnings with actionable messages
39
+
40
+ ### Added
41
+
42
+ - New type exports: `FieldOption`, `FieldOptionGroup`, `DefineField`, `SchemaFieldNames`, `InferSchemaValues`
43
+ - Subcomponent exports: `SectionRenderer`, `GridRenderer`, `FieldWrapper`
44
+ - Hook exports: `useFieldComponent`, `useLayoutComponent`
45
+ - Support for `gap` property in sections
46
+ - Support for `collapsible` and `defaultCollapsed` section properties
47
+ - `FormElement` type for consistent JSX return types
48
+ - `ClassValue` re-export from utils
49
+
50
+ ### Fixed
51
+
52
+ - Package exports configuration for proper ESM/CJS interop
53
+ - TypeScript strict mode compatibility
54
+ - Proper peer dependency declarations
55
+
56
+ ## [1.0.2] - 2024-12-03
57
+
58
+ ### Added
59
+
60
+ - Initial public release
61
+ - FormGenerator component
62
+ - FormSystemProvider context
63
+ - Schema-driven form generation
64
+ - Variant support for components
65
+ - Conditional field rendering
66
+
67
+ ## [1.0.1] - 2024-12-02
68
+
69
+ ### Fixed
70
+
71
+ - Package configuration fixes
72
+
73
+ ## [1.0.0] - 2024-12-01
74
+
75
+ ### Added
76
+
77
+ - Initial release
78
+