@page-speed/forms 0.5.7 → 0.5.9

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 (53) hide show
  1. package/dist/FormContext-089h0j0Q.d.ts +153 -0
  2. package/dist/FormContext-iHzBALZa.d.cts +153 -0
  3. package/dist/{chunk-A7R6GEMA.js → chunk-455PI4LV.js} +84 -3
  4. package/dist/chunk-455PI4LV.js.map +1 -0
  5. package/dist/{chunk-5WWMVS2I.js → chunk-4ROWNTY6.js} +334 -415
  6. package/dist/chunk-4ROWNTY6.js.map +1 -0
  7. package/dist/{chunk-FIDKDYT7.cjs → chunk-ED4UK63G.cjs} +439 -521
  8. package/dist/chunk-ED4UK63G.cjs.map +1 -0
  9. package/dist/{chunk-Q7VR374Y.js → chunk-MJYEXJ3U.js} +3 -3
  10. package/dist/{chunk-Q7VR374Y.js.map → chunk-MJYEXJ3U.js.map} +1 -1
  11. package/dist/{chunk-KPHMVGTU.cjs → chunk-MUBEMXI7.cjs} +6 -6
  12. package/dist/{chunk-KPHMVGTU.cjs.map → chunk-MUBEMXI7.cjs.map} +1 -1
  13. package/dist/chunk-OF6ZYT7A.cjs +287 -0
  14. package/dist/chunk-OF6ZYT7A.cjs.map +1 -0
  15. package/dist/{chunk-QQSBW6N3.cjs → chunk-QRI5TMES.cjs} +85 -2
  16. package/dist/chunk-QRI5TMES.cjs.map +1 -0
  17. package/dist/chunk-TOPOO33Z.js +263 -0
  18. package/dist/chunk-TOPOO33Z.js.map +1 -0
  19. package/dist/core.cjs +13 -9
  20. package/dist/core.d.cts +66 -141
  21. package/dist/core.d.ts +66 -141
  22. package/dist/core.js +3 -3
  23. package/dist/index.cjs +14 -14
  24. package/dist/index.d.cts +2 -2
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.js +3 -3
  27. package/dist/inputs.cjs +16 -16
  28. package/dist/inputs.d.cts +1 -1
  29. package/dist/inputs.d.ts +1 -1
  30. package/dist/inputs.js +2 -2
  31. package/dist/integration.cjs +17 -17
  32. package/dist/integration.d.cts +1 -1
  33. package/dist/integration.d.ts +1 -1
  34. package/dist/integration.js +3 -3
  35. package/dist/{types-CnOCn7b3.d.ts → types-BemGfSPA.d.cts} +27 -1
  36. package/dist/{types-CnOCn7b3.d.cts → types-BemGfSPA.d.ts} +27 -1
  37. package/dist/validation-rules.d.cts +1 -1
  38. package/dist/validation-rules.d.ts +1 -1
  39. package/dist/validation-utils.d.cts +1 -1
  40. package/dist/validation-utils.d.ts +1 -1
  41. package/dist/validation-valibot.d.cts +1 -1
  42. package/dist/validation-valibot.d.ts +1 -1
  43. package/dist/validation.d.cts +1 -1
  44. package/dist/validation.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/dist/chunk-5WWMVS2I.js.map +0 -1
  47. package/dist/chunk-A7R6GEMA.js.map +0 -1
  48. package/dist/chunk-FIDKDYT7.cjs.map +0 -1
  49. package/dist/chunk-N2HOVRRN.js +0 -150
  50. package/dist/chunk-N2HOVRRN.js.map +0 -1
  51. package/dist/chunk-O4ZLR7AN.cjs +0 -173
  52. package/dist/chunk-O4ZLR7AN.cjs.map +0 -1
  53. package/dist/chunk-QQSBW6N3.cjs.map +0 -1
@@ -340,6 +340,27 @@ interface FormRenderConfig {
340
340
  * Optional submission behavior configuration.
341
341
  */
342
342
  submissionConfig?: FormSubmissionConfig;
343
+ /**
344
+ * Optional layout configuration. If button-group, the form will be rendered with an input field and submit button.
345
+ * "button-group" is most commonly used for newsletter type forms.
346
+ * @default "standard"
347
+ */
348
+ formLayout?: "standard" | "button-group";
349
+ /**
350
+ * Size for button-group layout (only applies when formLayout is "button-group")
351
+ * @default "default"
352
+ */
353
+ buttonGroupSize?: "xs" | "sm" | "default" | "lg";
354
+ /**
355
+ * Submit button label for button-group layout
356
+ * @default "Submit"
357
+ */
358
+ submitLabel?: React.ReactNode;
359
+ /**
360
+ * Submit button variant for button-group layout
361
+ * @default "default"
362
+ */
363
+ submitVariant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost";
343
364
  }
344
365
  /**
345
366
  * Form component props
@@ -352,7 +373,12 @@ interface FormProps<T extends FormValues = FormValues> {
352
373
  /**
353
374
  * Form children
354
375
  */
355
- children: ReactNode;
376
+ children?: ReactNode;
377
+ /**
378
+ * Optional form fields for button-group layout rendering
379
+ * Required when using formLayout="button-group"
380
+ */
381
+ fields?: any[];
356
382
  /**
357
383
  * Additional className
358
384
  */
@@ -1,4 +1,4 @@
1
- import { F as FieldValidator } from './types-CnOCn7b3.cjs';
1
+ import { F as FieldValidator } from './types-BemGfSPA.cjs';
2
2
  import 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FieldValidator } from './types-CnOCn7b3.js';
1
+ import { F as FieldValidator } from './types-BemGfSPA.js';
2
2
  import 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FieldValidator, b as FormValues } from './types-CnOCn7b3.cjs';
1
+ import { F as FieldValidator, b as FormValues } from './types-BemGfSPA.cjs';
2
2
  import 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FieldValidator, b as FormValues } from './types-CnOCn7b3.js';
1
+ import { F as FieldValidator, b as FormValues } from './types-BemGfSPA.js';
2
2
  import 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { b as FormValues, V as ValidationSchema, F as FieldValidator } from './types-CnOCn7b3.cjs';
1
+ import { b as FormValues, V as ValidationSchema, F as FieldValidator } from './types-BemGfSPA.cjs';
2
2
  import 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { b as FormValues, V as ValidationSchema, F as FieldValidator } from './types-CnOCn7b3.js';
1
+ import { b as FormValues, V as ValidationSchema, F as FieldValidator } from './types-BemGfSPA.js';
2
2
  import 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-CnOCn7b3.cjs';
1
+ export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-BemGfSPA.cjs';
2
2
  export { ErrorMessageFn, ValidationRuleOptions, alpha, alphanumeric, compose, creditCard, email, integer, matches, max, maxLength, min, minLength, numeric, oneOf, pattern, phone, postalCode, required, url } from './validation-rules.cjs';
3
3
  export { DebounceOptions, ErrorMessages, MessageTemplate, asyncValidator, crossFieldValidator, debounce, defaultMessages, getErrorMessage, messageRegistry, resetErrorMessages, setErrorMessages, when, withRaceConditionPrevention } from './validation-utils.cjs';
4
4
  import 'react';
@@ -1,4 +1,4 @@
1
- export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-CnOCn7b3.js';
1
+ export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-BemGfSPA.js';
2
2
  export { ErrorMessageFn, ValidationRuleOptions, alpha, alphanumeric, compose, creditCard, email, integer, matches, max, maxLength, min, minLength, numeric, oneOf, pattern, phone, postalCode, required, url } from './validation-rules.js';
3
3
  export { DebounceOptions, ErrorMessages, MessageTemplate, asyncValidator, crossFieldValidator, debounce, defaultMessages, getErrorMessage, messageRegistry, resetErrorMessages, setErrorMessages, when, withRaceConditionPrevention } from './validation-utils.js';
4
4
  import 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@page-speed/forms",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "Ultra-high-performance React form library with field-level reactivity and tree-shakable architecture",
5
5
  "keywords": [
6
6
  "react",