carconnect-gatherleads-ui-lib 2.2.0 → 2.2.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.
package/README.md CHANGED
@@ -128,7 +128,7 @@ El layout por defecto, apila campos uno debajo del otro.
128
128
  - ❌ Todas las demás propiedades de layout se ignoran
129
129
 
130
130
  ```tsx
131
- const verticalExample = {
131
+ const verticalExample: GatherFormBuilderProps['config'] = {
132
132
  layout: 'vertical', // o sin especificar (default)
133
133
 
134
134
  // PROPIEDADES QUE FUNCIONAN:
@@ -164,7 +164,7 @@ Dispone los campos en línea horizontal con flexbox.
164
164
  - ❌ Propiedades de grid se ignoran
165
165
 
166
166
  ```tsx
167
- const horizontalExample = {
167
+ const horizontalExample: GatherFormBuilderProps['config'] = {
168
168
  layout: 'horizontal',
169
169
 
170
170
  // PROPIEDADES QUE FUNCIONAN:
@@ -200,7 +200,7 @@ const horizontalExample = {
200
200
  **Ejemplo con `noWrap`:**
201
201
 
202
202
  ```tsx
203
- const horizontalNoWrap = {
203
+ const horizontalNoWrap: GatherFormBuilderProps['config'] = {
204
204
  layout: 'horizontal',
205
205
  noWrap: true, // NO permite que los elementos pasen a nueva línea
206
206
  alignment: 'start', // justify-start: alineados a la izquierda
@@ -236,7 +236,7 @@ Organiza campos en una cuadrícula con sistema de columnas.
236
236
  - ❌ Propiedades de flex se ignoran
237
237
 
238
238
  ```tsx
239
- const gridResponsive = {
239
+ const gridResponsive: GatherFormBuilderProps['config'] = {
240
240
  layout: 'grid',
241
241
 
242
242
  // PROPIEDADES QUE FUNCIONAN:
@@ -278,7 +278,7 @@ const gridResponsive = {
278
278
  **Ejemplo con `autoFit`:**
279
279
 
280
280
  ```tsx
281
- const gridAutoFit = {
281
+ const gridAutoFit: GatherFormBuilderProps['config'] = {
282
282
  layout: 'grid',
283
283
  autoFit: true, // ACTIVA el auto-ajuste (min 250px por columna)
284
284
  gap: 'gap-4',
@@ -311,7 +311,7 @@ Similar a Pinterest, para campos de diferentes alturas.
311
311
  - ❌ Otras propiedades de grid/flex se ignoran
312
312
 
313
313
  ```tsx
314
- const masonryExample = {
314
+ const masonryExample: GatherFormBuilderProps['config'] = {
315
315
  layout: 'masonry',
316
316
 
317
317
  // PROPIEDADES QUE FUNCIONAN:
@@ -362,7 +362,7 @@ Campos en línea con wrap automático, centrados verticalmente.
362
362
  - ❌ Todas las demás propiedades se ignoran
363
363
 
364
364
  ```tsx
365
- const inlineExample = {
365
+ const inlineExample: GatherFormBuilderProps['config'] = {
366
366
  layout: 'inline',
367
367
 
368
368
  // PROPIEDADES QUE FUNCIONAN:
@@ -406,7 +406,7 @@ Vertical con opciones especiales de espaciado y divisores.
406
406
  - ❌ Propiedades de grid/flex se ignoran
407
407
 
408
408
  ```tsx
409
- const stackExample = {
409
+ const stackExample: GatherFormBuilderProps['config'] = {
410
410
  layout: 'stack',
411
411
 
412
412
  // PROPIEDADES QUE FUNCIONAN:
@@ -470,7 +470,7 @@ const stackExample = {
470
470
  ## 🎯 Ejemplo Completo Combinando Propiedades
471
471
 
472
472
  ```tsx
473
- const complexFormConfig = {
473
+ const complexFormConfig: GatherFormBuilderProps['config'] = {
474
474
  title: 'Formulario Complejo',
475
475
  layout: 'grid',
476
476
 
@@ -1743,7 +1743,7 @@ actionButton: {
1743
1743
  const FormularioConValidaciones = () => {
1744
1744
  const [isLoading, setIsLoading] = useState(false);
1745
1745
 
1746
- const config: FormConfig = {
1746
+ const config: GatherFormBuilderProps['config'] = {
1747
1747
  title: 'Registro con Validaciones',
1748
1748
  layout: 'grid',
1749
1749
  gridCols: 2,
@@ -485,6 +485,48 @@ export declare interface GatherDateFieldConfig extends BaseFieldConfig {
485
485
  size?: 'sm' | 'md' | 'lg';
486
486
  }
487
487
 
488
+ /**
489
+ * Componente que construye un formulario dinámico en base a una configuración declarativa.
490
+ *
491
+ * @component
492
+ * @param {GatherFormBuilderProps} props - Propiedades para configurar el formulario.
493
+ *
494
+ * @property {Object} config - Configuración del formulario (campos, botones, layout, título, etc).
495
+ * @property {Function} onSubmit - Función asíncrona que se ejecuta al enviar el formulario.
496
+ * @property {Function} [onAction] - Función que se ejecuta al presionar el botón de acción (ej: limpiar).
497
+ * @property {boolean} [resetData=true] - Si `true`, resetea los datos después de enviar el formulario exitosamente.
498
+ * @property {Object} [defaultValues={}] - Valores iniciales para los campos del formulario.
499
+ * @property {boolean} [isLoading=false] - Indica si el formulario está en estado de carga.
500
+ * @property {string} [className=""] - Clases adicionales para el contenedor principal.
501
+ * @property {'onBlur' | 'onChange' | 'onSubmit' | 'onTouched' | 'all'} [validationMode='onChange'] - Modo de validación usado por React Hook Form.
502
+ *
503
+ * @example
504
+ * ```tsx
505
+ * <GatherFormBuilder
506
+ * config={{
507
+ * title: "Registro",
508
+ * description: "Completa los siguientes campos",
509
+ * layout: "grid",
510
+ * fields: [
511
+ * { name: "nombre", label: "Nombre", type: "text", required: true },
512
+ * { name: "email", label: "Correo", type: "email", required: true },
513
+ * { name: "mensaje", label: "Mensaje", type: "textarea" },
514
+ * ],
515
+ * submitButton: {
516
+ * text: "Enviar",
517
+ * variant: "gather-primary",
518
+ * },
519
+ * actionButton: {
520
+ * text: "Limpiar",
521
+ * variant: "gather-outline",
522
+ * }
523
+ * }}
524
+ * onSubmit={(data) => console.log("Datos enviados:", data)}
525
+ * />
526
+ * ```
527
+ */
528
+ export declare const GatherFormBuilder: default_2.FC<GatherFormBuilderProps>;
529
+
488
530
  /**
489
531
  * Props principales del componente GatherFormBuilder
490
532
  * @interface GatherFormBuilderProps