@page-speed/forms 0.5.0 → 0.5.2
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 +30 -2
- package/dist/core.cjs +189 -97
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +3 -3
- package/dist/core.d.ts +3 -3
- package/dist/core.js +175 -83
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +189 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +175 -83
- package/dist/index.js.map +1 -1
- package/dist/inputs.cjs +2720 -1371
- package/dist/inputs.cjs.map +1 -1
- package/dist/inputs.d.cts +10 -259
- package/dist/inputs.d.ts +10 -259
- package/dist/inputs.js +2721 -1371
- package/dist/inputs.js.map +1 -1
- package/dist/integration.cjs +5168 -9
- package/dist/integration.cjs.map +1 -1
- package/dist/integration.d.cts +298 -1
- package/dist/integration.d.ts +298 -1
- package/dist/integration.js +5160 -9
- package/dist/integration.js.map +1 -1
- package/dist/{types-DuX3q6A4.d.cts → types-CnOCn7b3.d.cts} +51 -1
- package/dist/{types-DuX3q6A4.d.ts → types-CnOCn7b3.d.ts} +51 -1
- package/dist/validation-rules.d.cts +1 -1
- package/dist/validation-rules.d.ts +1 -1
- package/dist/validation-utils.d.cts +1 -1
- package/dist/validation-utils.d.ts +1 -1
- package/dist/validation-valibot.d.cts +1 -1
- package/dist/validation-valibot.d.ts +1 -1
- package/dist/validation.d.cts +1 -1
- package/dist/validation.d.ts +1 -1
- package/package.json +1 -1
|
@@ -303,6 +303,44 @@ interface FormSubmissionConfig {
|
|
|
303
303
|
*/
|
|
304
304
|
newFormSubmissionAction?: NewFormSubmissionActionConfig;
|
|
305
305
|
}
|
|
306
|
+
interface FormNotificationConfig {
|
|
307
|
+
/**
|
|
308
|
+
* Optional success message shown after successful submission.
|
|
309
|
+
*/
|
|
310
|
+
successMessage?: ReactNode;
|
|
311
|
+
/**
|
|
312
|
+
* Optional submission error shown below the form actions.
|
|
313
|
+
*/
|
|
314
|
+
submissionError?: ReactNode;
|
|
315
|
+
}
|
|
316
|
+
interface FormStyleConfig {
|
|
317
|
+
/**
|
|
318
|
+
* Optional className for the <form> element.
|
|
319
|
+
*/
|
|
320
|
+
formClassName?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Additional className for success feedback.
|
|
323
|
+
*/
|
|
324
|
+
successMessageClassName?: string;
|
|
325
|
+
/**
|
|
326
|
+
* Additional className for error feedback.
|
|
327
|
+
*/
|
|
328
|
+
errorMessageClassName?: string;
|
|
329
|
+
}
|
|
330
|
+
interface FormRenderConfig {
|
|
331
|
+
/**
|
|
332
|
+
* Form action URL (for progressive enhancement).
|
|
333
|
+
*/
|
|
334
|
+
endpoint?: string;
|
|
335
|
+
/**
|
|
336
|
+
* Form method (for progressive enhancement).
|
|
337
|
+
*/
|
|
338
|
+
method?: "get" | "post";
|
|
339
|
+
/**
|
|
340
|
+
* Optional submission behavior configuration.
|
|
341
|
+
*/
|
|
342
|
+
submissionConfig?: FormSubmissionConfig;
|
|
343
|
+
}
|
|
306
344
|
/**
|
|
307
345
|
* Form component props
|
|
308
346
|
*/
|
|
@@ -356,6 +394,18 @@ interface FormProps<T extends FormValues = FormValues> {
|
|
|
356
394
|
* Optional callback invoked when the user starts a new submission.
|
|
357
395
|
*/
|
|
358
396
|
onNewSubmission?: () => void;
|
|
397
|
+
/**
|
|
398
|
+
* Grouped success/error message configuration.
|
|
399
|
+
*/
|
|
400
|
+
notificationConfig?: FormNotificationConfig;
|
|
401
|
+
/**
|
|
402
|
+
* Grouped styling configuration for form feedback and form element class.
|
|
403
|
+
*/
|
|
404
|
+
styleConfig?: FormStyleConfig;
|
|
405
|
+
/**
|
|
406
|
+
* Grouped progressive enhancement and submission UI configuration.
|
|
407
|
+
*/
|
|
408
|
+
formConfig?: FormRenderConfig;
|
|
359
409
|
}
|
|
360
410
|
/**
|
|
361
411
|
* Field component props
|
|
@@ -452,4 +502,4 @@ interface InputProps<T = string> {
|
|
|
452
502
|
"aria-required"?: boolean;
|
|
453
503
|
}
|
|
454
504
|
|
|
455
|
-
export type { ErrorHandler as E, FieldValidator as F, InputProps as I, NewFormSubmissionActionConfig as N, SubmissionStatus as S, TouchedFields as T, UseFormOptions as U, ValidationSchema as V, ValidationMode as a, FormValues as b, FormErrors as c, FormSubmissionBehavior as d, FormSubmissionConfig as e,
|
|
505
|
+
export type { ErrorHandler as E, FieldValidator as F, InputProps as I, NewFormSubmissionActionConfig as N, SubmissionStatus as S, TouchedFields as T, UseFormOptions as U, ValidationSchema as V, ValidationMode as a, FormValues as b, FormErrors as c, FormSubmissionBehavior as d, FormSubmissionConfig as e, FormNotificationConfig as f, FormStyleConfig as g, FormRenderConfig as h, FormHelpers as i, SubmitHandler as j, FormState as k, FormActions as l, UseFormReturn as m, FieldInputProps as n, FieldMeta as o, UseFieldOptions as p, UseFieldReturn as q, FormProps as r, FieldProps as s };
|
|
@@ -303,6 +303,44 @@ interface FormSubmissionConfig {
|
|
|
303
303
|
*/
|
|
304
304
|
newFormSubmissionAction?: NewFormSubmissionActionConfig;
|
|
305
305
|
}
|
|
306
|
+
interface FormNotificationConfig {
|
|
307
|
+
/**
|
|
308
|
+
* Optional success message shown after successful submission.
|
|
309
|
+
*/
|
|
310
|
+
successMessage?: ReactNode;
|
|
311
|
+
/**
|
|
312
|
+
* Optional submission error shown below the form actions.
|
|
313
|
+
*/
|
|
314
|
+
submissionError?: ReactNode;
|
|
315
|
+
}
|
|
316
|
+
interface FormStyleConfig {
|
|
317
|
+
/**
|
|
318
|
+
* Optional className for the <form> element.
|
|
319
|
+
*/
|
|
320
|
+
formClassName?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Additional className for success feedback.
|
|
323
|
+
*/
|
|
324
|
+
successMessageClassName?: string;
|
|
325
|
+
/**
|
|
326
|
+
* Additional className for error feedback.
|
|
327
|
+
*/
|
|
328
|
+
errorMessageClassName?: string;
|
|
329
|
+
}
|
|
330
|
+
interface FormRenderConfig {
|
|
331
|
+
/**
|
|
332
|
+
* Form action URL (for progressive enhancement).
|
|
333
|
+
*/
|
|
334
|
+
endpoint?: string;
|
|
335
|
+
/**
|
|
336
|
+
* Form method (for progressive enhancement).
|
|
337
|
+
*/
|
|
338
|
+
method?: "get" | "post";
|
|
339
|
+
/**
|
|
340
|
+
* Optional submission behavior configuration.
|
|
341
|
+
*/
|
|
342
|
+
submissionConfig?: FormSubmissionConfig;
|
|
343
|
+
}
|
|
306
344
|
/**
|
|
307
345
|
* Form component props
|
|
308
346
|
*/
|
|
@@ -356,6 +394,18 @@ interface FormProps<T extends FormValues = FormValues> {
|
|
|
356
394
|
* Optional callback invoked when the user starts a new submission.
|
|
357
395
|
*/
|
|
358
396
|
onNewSubmission?: () => void;
|
|
397
|
+
/**
|
|
398
|
+
* Grouped success/error message configuration.
|
|
399
|
+
*/
|
|
400
|
+
notificationConfig?: FormNotificationConfig;
|
|
401
|
+
/**
|
|
402
|
+
* Grouped styling configuration for form feedback and form element class.
|
|
403
|
+
*/
|
|
404
|
+
styleConfig?: FormStyleConfig;
|
|
405
|
+
/**
|
|
406
|
+
* Grouped progressive enhancement and submission UI configuration.
|
|
407
|
+
*/
|
|
408
|
+
formConfig?: FormRenderConfig;
|
|
359
409
|
}
|
|
360
410
|
/**
|
|
361
411
|
* Field component props
|
|
@@ -452,4 +502,4 @@ interface InputProps<T = string> {
|
|
|
452
502
|
"aria-required"?: boolean;
|
|
453
503
|
}
|
|
454
504
|
|
|
455
|
-
export type { ErrorHandler as E, FieldValidator as F, InputProps as I, NewFormSubmissionActionConfig as N, SubmissionStatus as S, TouchedFields as T, UseFormOptions as U, ValidationSchema as V, ValidationMode as a, FormValues as b, FormErrors as c, FormSubmissionBehavior as d, FormSubmissionConfig as e,
|
|
505
|
+
export type { ErrorHandler as E, FieldValidator as F, InputProps as I, NewFormSubmissionActionConfig as N, SubmissionStatus as S, TouchedFields as T, UseFormOptions as U, ValidationSchema as V, ValidationMode as a, FormValues as b, FormErrors as c, FormSubmissionBehavior as d, FormSubmissionConfig as e, FormNotificationConfig as f, FormStyleConfig as g, FormRenderConfig as h, FormHelpers as i, SubmitHandler as j, FormState as k, FormActions as l, UseFormReturn as m, FieldInputProps as n, FieldMeta as o, UseFieldOptions as p, UseFieldReturn as q, FormProps as r, FieldProps as s };
|
package/dist/validation.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-
|
|
1
|
+
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-CnOCn7b3.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';
|
package/dist/validation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-
|
|
1
|
+
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-CnOCn7b3.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';
|