@sio-group/form-react 0.4.1 → 0.4.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - minor bugfix
8
+
9
+ ## 0.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Removed buttons and replace with ui-core-package
14
+
3
15
  ## 0.4.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -4,11 +4,6 @@
4
4
  ![npm](https://img.shields.io/npm/v/@sio-group/form-react)
5
5
  ![TypeScript](https://img.shields.io/badge/types-Yes-brightgreen)
6
6
 
7
- <!--
8
- [![npm version](https://img.shields.io/npm/v/@sio-group/form-validation.svg)](https://www.npmjs.com/package/@sio-group/form-validation)
9
- [![npm downloads](https://img.shields.io/npm/dm/@sio-group/form-validation.svg)](https://www.npmjs.com/package/@sio-group/form-validation)
10
- -->
11
-
12
7
  A powerful, type-safe React form framework. This package provides ready-to-use form components with built-in validation, layout management, and extensive customization options. This package is designed to work seamlessly with `@sio-group/form-builder` and `@sio-group/form-validation`, but can be used independently.
13
8
 
14
9
  Part of the SIO Form ecosystem, it consumes form definitions from `@sio-group/form-builder` and renders them with full type safety and accessibility in mind.
@@ -187,7 +182,7 @@ const layout = [
187
182
 
188
183
  ### Button Configuration
189
184
 
190
- Buttons can be configured as an array:
185
+ Buttons can be configured as an array using the props from `@sio-group/ui-core`.
191
186
 
192
187
  ```tsx
193
188
  const buttons = [
@@ -207,7 +202,6 @@ const buttons = [
207
202
  },
208
203
  {
209
204
  type: 'link',
210
- variant: 'link',
211
205
  color: 'info',
212
206
  label: 'Help',
213
207
  href: '/help'
@@ -215,15 +209,14 @@ const buttons = [
215
209
  ];
216
210
  ```
217
211
 
218
- **Button Props:**
219
- - `type: 'button' | 'link'`
220
- - `variant: 'primary' | 'secondary' | 'link'`
221
- - `color: 'default' | 'success' | 'warning' | 'error' | 'info'`
222
- - `label: string`
223
- - `onClick?: () => void` (for buttons)
224
- - `href?: string` (for links)
225
- - `loading?: boolean`
226
- - `disabled?: boolean`
212
+ Button and link properties are inherited from the UI components:
213
+
214
+ - `Button` from `@sio-group/ui-core`
215
+ - `Link` from `@sio-group/ui-core`
216
+
217
+ Refer to their documentation for all available props.
218
+
219
+ [@sio-group/ui-core](https://github.com/SiO-group/UI-React/tree/main/packages/ui-core)
227
220
 
228
221
  ---
229
222
 
@@ -489,7 +482,8 @@ All standard HTML input types are supported:
489
482
  You can use the `useForm` hook to control how you use the form, centrally managing state, validation, and submission. This also demonstrates conditional rendering and error automation.
490
483
 
491
484
  ```javascript
492
- import { useForm, Input, Button } from '@sio-group/form-react';
485
+ import { useForm, Input } from '@sio-group/form-react';
486
+ import { Button } from '@sio-group/ui-core';
493
487
 
494
488
  function FormWithHook() {
495
489
  const { register, getValue, isValid, isBusy, submit } = useForm();
@@ -536,7 +530,8 @@ All field components and buttons can also be used independently. You can keep an
536
530
 
537
531
  ```javascript
538
532
  import { useState } from 'react';
539
- import { Input, Button } from '@sio-group/form-react';
533
+ import { Input } from '@sio-group/form-react';
534
+ import { Button } from '@sio-group/ui-core';
540
535
 
541
536
  function SimpleForm() {
542
537
  const [value, setValue] = useState('');
@@ -591,34 +586,6 @@ function SimpleForm() {
591
586
  }
592
587
  ```
593
588
 
594
- ### Button Props
595
- | Prop | Type | Default | Description |
596
- |------------|------------------------------------------------------------|-------------|-------------------------|
597
- | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | Button type |
598
- | `label` | `string` | - | Label of the Link |
599
- | `onClick` | `(e: React.MouseEvent) => void` | - | Custom onClick function |
600
- | `variant` | `'primary' \| 'secondary' \| 'link'` | `'primary'` | Visual variant |
601
- | `color` | `'default' \| 'error' \| 'success' \| 'warning' \| 'info'` | `'default'` | Color theme |
602
- | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
603
- | `block` | `boolean` | `false` | Full width |
604
- | `loading` | `boolean` | `false` | Loading state |
605
- | `disabled` | `boolean` | `false` | Disabled state |
606
-
607
- ### Link Props
608
- | Prop | Type | Default | Description |
609
- |------------|------------------------------------------------------------|-------------|--------------------------|
610
- | `label` | `string` | - | Label of the Link |
611
- | `to` | `string` | `'#'` | URL or pad |
612
- | `onClick` | `(e: React.MouseEvent) => void` | - | Custom onClick function |
613
- | `color` | `'default' \| 'error' \| 'success' \| 'warning' \| 'info'` | `'default'` | Color theme |
614
- | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
615
- | `block` | `boolean` | `false` | Full width |
616
- | `loading` | `boolean` | `false` | Loading state |
617
- | `disabled` | `boolean` | `false` | Disabled state |
618
- | `navigate` | `() => void` | - | Custom navigate function |
619
- | `external` | `boolean` | `false` | Force external link |
620
-
621
-
622
589
  ---
623
590
 
624
591
  ## Styling
@@ -683,6 +650,7 @@ Example with Tailwind CSS:
683
650
  import { Form } from '@sio-group/form-react';
684
651
  import { formBuilder } from '@sio-group/form-builder';
685
652
  import '@sio-group/form-react/sio-form-style.css';
653
+ import '@sio-group/ui-core/sio-core-style.css';
686
654
 
687
655
  function RegistrationForm() {
688
656
  const fields = formBuilder()