@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.
- package/dist/FormContext-089h0j0Q.d.ts +153 -0
- package/dist/FormContext-iHzBALZa.d.cts +153 -0
- package/dist/{chunk-A7R6GEMA.js → chunk-455PI4LV.js} +84 -3
- package/dist/chunk-455PI4LV.js.map +1 -0
- package/dist/{chunk-5WWMVS2I.js → chunk-4ROWNTY6.js} +334 -415
- package/dist/chunk-4ROWNTY6.js.map +1 -0
- package/dist/{chunk-FIDKDYT7.cjs → chunk-ED4UK63G.cjs} +439 -521
- package/dist/chunk-ED4UK63G.cjs.map +1 -0
- package/dist/{chunk-Q7VR374Y.js → chunk-MJYEXJ3U.js} +3 -3
- package/dist/{chunk-Q7VR374Y.js.map → chunk-MJYEXJ3U.js.map} +1 -1
- package/dist/{chunk-KPHMVGTU.cjs → chunk-MUBEMXI7.cjs} +6 -6
- package/dist/{chunk-KPHMVGTU.cjs.map → chunk-MUBEMXI7.cjs.map} +1 -1
- package/dist/chunk-OF6ZYT7A.cjs +287 -0
- package/dist/chunk-OF6ZYT7A.cjs.map +1 -0
- package/dist/{chunk-QQSBW6N3.cjs → chunk-QRI5TMES.cjs} +85 -2
- package/dist/chunk-QRI5TMES.cjs.map +1 -0
- package/dist/chunk-TOPOO33Z.js +263 -0
- package/dist/chunk-TOPOO33Z.js.map +1 -0
- package/dist/core.cjs +13 -9
- package/dist/core.d.cts +66 -141
- package/dist/core.d.ts +66 -141
- package/dist/core.js +3 -3
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/inputs.cjs +16 -16
- package/dist/inputs.d.cts +1 -1
- package/dist/inputs.d.ts +1 -1
- package/dist/inputs.js +2 -2
- package/dist/integration.cjs +17 -17
- package/dist/integration.d.cts +1 -1
- package/dist/integration.d.ts +1 -1
- package/dist/integration.js +3 -3
- package/dist/{types-CnOCn7b3.d.ts → types-BemGfSPA.d.cts} +27 -1
- package/dist/{types-CnOCn7b3.d.cts → types-BemGfSPA.d.ts} +27 -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
- package/dist/chunk-5WWMVS2I.js.map +0 -1
- package/dist/chunk-A7R6GEMA.js.map +0 -1
- package/dist/chunk-FIDKDYT7.cjs.map +0 -1
- package/dist/chunk-N2HOVRRN.js +0 -150
- package/dist/chunk-N2HOVRRN.js.map +0 -1
- package/dist/chunk-O4ZLR7AN.cjs +0 -173
- package/dist/chunk-O4ZLR7AN.cjs.map +0 -1
- package/dist/chunk-QQSBW6N3.cjs.map +0 -1
package/dist/core.d.ts
CHANGED
|
@@ -1,154 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
export { E as ErrorHandler, n as FieldInputProps, o as FieldMeta, F as FieldValidator, l as FormActions, c as FormErrors, i as FormHelpers, f as FormNotificationConfig, h as FormRenderConfig, k as FormState, g as FormStyleConfig, d as FormSubmissionBehavior, e as FormSubmissionConfig, I as InputProps, N as NewFormSubmissionActionConfig, S as SubmissionStatus, j as SubmitHandler, T as TouchedFields, a as ValidationMode, V as ValidationSchema } from './types-CnOCn7b3.js';
|
|
1
|
+
export { b as Field, F as Form, d as FormContext, c as FormFeedback, e as FormFeedbackProps, a as useField, u as useForm } from './FormContext-089h0j0Q.js';
|
|
3
2
|
import * as React from 'react';
|
|
3
|
+
import { I as InputProps } from './types-BemGfSPA.js';
|
|
4
|
+
export { E as ErrorHandler, n as FieldInputProps, o as FieldMeta, s as FieldProps, F as FieldValidator, l as FormActions, c as FormErrors, i as FormHelpers, f as FormNotificationConfig, r as FormProps, h as FormRenderConfig, k as FormState, g as FormStyleConfig, d as FormSubmissionBehavior, e as FormSubmissionConfig, b as FormValues, N as NewFormSubmissionActionConfig, S as SubmissionStatus, j as SubmitHandler, T as TouchedFields, p as UseFieldOptions, q as UseFieldReturn, U as UseFormOptions, m as UseFormReturn, a as ValidationMode, V as ValidationSchema } from './types-BemGfSPA.js';
|
|
4
5
|
|
|
6
|
+
type ButtonGroupFormSize = "xs" | "sm" | "default" | "lg";
|
|
7
|
+
type ButtonGroupFormProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Field name
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional label above the input
|
|
14
|
+
*/
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Placeholder text for the input
|
|
18
|
+
*/
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Input props from form field
|
|
22
|
+
*/
|
|
23
|
+
inputProps: InputProps<string> & {
|
|
24
|
+
type?: "text" | "email" | "password" | "url" | "tel" | "search";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Submit button label
|
|
28
|
+
*/
|
|
29
|
+
submitLabel?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Submit button size
|
|
32
|
+
*/
|
|
33
|
+
size?: ButtonGroupFormSize;
|
|
34
|
+
/**
|
|
35
|
+
* Submit button variant
|
|
36
|
+
*/
|
|
37
|
+
submitVariant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Whether form is submitting
|
|
40
|
+
*/
|
|
41
|
+
isSubmitting?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Additional className for the container
|
|
44
|
+
*/
|
|
45
|
+
className?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Additional className for the label
|
|
48
|
+
*/
|
|
49
|
+
labelClassName?: string;
|
|
50
|
+
};
|
|
5
51
|
/**
|
|
6
|
-
*
|
|
52
|
+
* ButtonGroupForm - Inline form layout with input and submit button grouped together
|
|
7
53
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* - Observable-based state: ~1 re-render per change vs ~10 for traditional hooks
|
|
11
|
-
* - Tree-shakable: Only bundle what you use
|
|
54
|
+
* Commonly used for newsletter signups and other simple single-field forms.
|
|
55
|
+
* The input and button automatically adjust sizing together.
|
|
12
56
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* await login(values);
|
|
19
|
-
* },
|
|
20
|
-
* validationSchema: {
|
|
21
|
-
* email: (value) => !value ? 'Required' : undefined,
|
|
22
|
-
* password: (value) => value.length < 8 ? 'Too short' : undefined,
|
|
23
|
-
* },
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* return (
|
|
27
|
-
* <form onSubmit={form.handleSubmit}>
|
|
28
|
-
* <input {...form.getFieldProps('email')} />
|
|
29
|
-
* {form.errors.email && <span>{form.errors.email}</span>}
|
|
30
|
-
* </form>
|
|
31
|
-
* );
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @see https://opensite.ai/developers/page-speed/forms/use-form
|
|
35
|
-
*/
|
|
36
|
-
declare function useForm<T extends FormValues = FormValues>(options: UseFormOptions<T>): UseFormReturn<T>;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* useField - Field-level reactive hook for form inputs
|
|
40
|
-
*
|
|
41
|
-
* Provides isolated reactivity for individual form fields.
|
|
42
|
-
* Only re-renders when the specific field changes, not when other fields update.
|
|
43
|
-
*
|
|
44
|
-
* Must be used within a FormContext (inside <Form> component).
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```tsx
|
|
48
|
-
* function EmailInput() {
|
|
49
|
-
* const { field, meta, helpers } = useField({ name: 'email' });
|
|
50
|
-
*
|
|
51
|
-
* return (
|
|
52
|
-
* <div>
|
|
53
|
-
* <input {...field} type="email" />
|
|
54
|
-
* {meta.touched && meta.error && <span>{meta.error}</span>}
|
|
55
|
-
* </div>
|
|
56
|
-
* );
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* @see https://opensite.ai/developers/page-speed/forms/use-field
|
|
61
|
-
*/
|
|
62
|
-
declare function useField<T = any>(options: UseFieldOptions<T>): UseFieldReturn<T>;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Form - Progressive enhancement form component
|
|
66
|
-
*
|
|
67
|
-
* Provides form context to child components and handles form submission.
|
|
68
|
-
* Supports progressive enhancement with server-side fallback.
|
|
69
|
-
*
|
|
70
|
-
* Features:
|
|
71
|
-
* - Provides FormContext for useField hook
|
|
72
|
-
* - Handles form submission with validation
|
|
73
|
-
* - Progressive enhancement support (works without JavaScript)
|
|
74
|
-
* - Accessible form semantics
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```tsx
|
|
78
|
-
* const form = useForm({
|
|
79
|
-
* initialValues: { email: '' },
|
|
80
|
-
* onSubmit: async (values) => {
|
|
81
|
-
* await submitForm(values);
|
|
82
|
-
* },
|
|
83
|
-
* });
|
|
84
|
-
*
|
|
85
|
-
* return (
|
|
86
|
-
* <Form form={form} action="/api/submit" method="post">
|
|
87
|
-
* <input {...form.getFieldProps('email')} />
|
|
88
|
-
* <button type="submit">Submit</button>
|
|
89
|
-
* </Form>
|
|
90
|
-
* );
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
* @see https://opensite.ai/developers/page-speed/forms/form
|
|
94
|
-
*/
|
|
95
|
-
declare function Form<T extends FormValues = FormValues>({ form, children, className, action, method, noValidate, submissionConfig, successMessage, submissionError, successMessageClassName, errorMessageClassName, onNewSubmission, notificationConfig, styleConfig, formConfig, ...props }: FormProps<T> & React.FormHTMLAttributes<HTMLFormElement>): React.JSX.Element;
|
|
96
|
-
declare namespace Form {
|
|
97
|
-
var displayName: string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Field - Field wrapper component with label, description, and error display
|
|
102
|
-
*
|
|
103
|
-
* Provides a complete field UI with automatic error handling and accessibility.
|
|
104
|
-
* Uses useField hook internally for field-level reactivity.
|
|
105
|
-
*
|
|
106
|
-
* Features:
|
|
107
|
-
* - Automatic label association
|
|
108
|
-
* - Error display with accessibility
|
|
109
|
-
* - Optional description text
|
|
110
|
-
* - Render prop pattern for flexibility
|
|
111
|
-
* - Full accessibility support
|
|
57
|
+
* Size mappings:
|
|
58
|
+
* - xs: h-8 text-xs
|
|
59
|
+
* - sm: h-9 text-sm
|
|
60
|
+
* - default: h-10 text-sm
|
|
61
|
+
* - lg: h-12 text-base
|
|
112
62
|
*
|
|
113
63
|
* @example
|
|
114
64
|
* ```tsx
|
|
115
|
-
* <
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* )}
|
|
123
|
-
* </Field>
|
|
65
|
+
* <ButtonGroupForm
|
|
66
|
+
* name="email"
|
|
67
|
+
* placeholder="Enter your email"
|
|
68
|
+
* inputProps={form.getFieldProps('email')}
|
|
69
|
+
* submitLabel="Subscribe"
|
|
70
|
+
* size="default"
|
|
71
|
+
* />
|
|
124
72
|
* ```
|
|
125
|
-
*
|
|
126
|
-
* @see https://opensite.ai/developers/page-speed/forms/field
|
|
127
73
|
*/
|
|
128
|
-
declare function
|
|
129
|
-
declare namespace
|
|
130
|
-
var displayName: string;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
interface FormFeedbackProps {
|
|
134
|
-
successMessage?: React.ReactNode;
|
|
135
|
-
submissionError?: React.ReactNode;
|
|
136
|
-
successMessageClassName?: string;
|
|
137
|
-
errorMessageClassName?: string;
|
|
138
|
-
}
|
|
139
|
-
declare function FormFeedback({ successMessage, submissionError, successMessageClassName, errorMessageClassName, }: FormFeedbackProps): React.JSX.Element | null;
|
|
140
|
-
declare namespace FormFeedback {
|
|
74
|
+
declare function ButtonGroupForm({ name, label, inputProps, submitLabel, submitVariant, size, isSubmitting, className, labelClassName, }: ButtonGroupFormProps): React.JSX.Element;
|
|
75
|
+
declare namespace ButtonGroupForm {
|
|
141
76
|
var displayName: string;
|
|
142
77
|
}
|
|
143
78
|
|
|
144
|
-
|
|
145
|
-
* FormContext - React context for providing form state to child components
|
|
146
|
-
*
|
|
147
|
-
* Allows useField hook to access form state without prop drilling.
|
|
148
|
-
* Automatically provided by the <Form> component.
|
|
149
|
-
*
|
|
150
|
-
* @internal
|
|
151
|
-
*/
|
|
152
|
-
declare const FormContext: React.Context<UseFormReturn<any> | null>;
|
|
153
|
-
|
|
154
|
-
export { Field, FieldProps, Form, FormContext, FormFeedback, type FormFeedbackProps, FormProps, FormValues, UseFieldOptions, UseFieldReturn, UseFormOptions, UseFormReturn, useField, useForm };
|
|
79
|
+
export { ButtonGroupForm, type ButtonGroupFormProps, type ButtonGroupFormSize, InputProps };
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Form, FormFeedback } from './chunk-
|
|
2
|
-
export { Field, FormContext, useField, useForm } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { ButtonGroupForm, Form, FormFeedback } from './chunk-TOPOO33Z.js';
|
|
2
|
+
export { Field, FormContext, useField, useForm } from './chunk-MJYEXJ3U.js';
|
|
3
|
+
import './chunk-455PI4LV.js';
|
|
4
4
|
//# sourceMappingURL=core.js.map
|
|
5
5
|
//# sourceMappingURL=core.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkOF6ZYT7A_cjs = require('./chunk-OF6ZYT7A.cjs');
|
|
4
|
+
var chunkMUBEMXI7_cjs = require('./chunk-MUBEMXI7.cjs');
|
|
5
|
+
var chunkQRI5TMES_cjs = require('./chunk-QRI5TMES.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "Form", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkOF6ZYT7A_cjs.Form; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "FormFeedback", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkOF6ZYT7A_cjs.FormFeedback; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "Field", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkMUBEMXI7_cjs.Field; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "FormContext", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkMUBEMXI7_cjs.FormContext; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "useField", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkMUBEMXI7_cjs.useField; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "useForm", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkMUBEMXI7_cjs.useForm; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "FieldDescription", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkQRI5TMES_cjs.FieldDescription; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "FieldError", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkQRI5TMES_cjs.FieldError; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "FieldGroup", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkQRI5TMES_cjs.FieldGroup; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "FieldWrapper", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkQRI5TMES_cjs.Field; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "FormFieldLabel", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkQRI5TMES_cjs.FieldLabel; }
|
|
52
52
|
});
|
|
53
53
|
//# sourceMappingURL=index.cjs.map
|
|
54
54
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Field, Form, FormContext, FormFeedback, FormFeedbackProps, useField, useForm } from './
|
|
2
|
-
export { E as ErrorHandler, n as FieldInputProps, o as FieldMeta, s as FieldProps, F as FieldValidator, l as FormActions, c as FormErrors, i as FormHelpers, f as FormNotificationConfig, r as FormProps, h as FormRenderConfig, k as FormState, g as FormStyleConfig, d as FormSubmissionBehavior, e as FormSubmissionConfig, b as FormValues, I as InputProps, N as NewFormSubmissionActionConfig, S as SubmissionStatus, j as SubmitHandler, T as TouchedFields, p as UseFieldOptions, q as UseFieldReturn, U as UseFormOptions, m as UseFormReturn, a as ValidationMode, V as ValidationSchema } from './types-
|
|
1
|
+
export { b as Field, F as Form, d as FormContext, c as FormFeedback, e as FormFeedbackProps, a as useField, u as useForm } from './FormContext-iHzBALZa.cjs';
|
|
2
|
+
export { E as ErrorHandler, n as FieldInputProps, o as FieldMeta, s as FieldProps, F as FieldValidator, l as FormActions, c as FormErrors, i as FormHelpers, f as FormNotificationConfig, r as FormProps, h as FormRenderConfig, k as FormState, g as FormStyleConfig, d as FormSubmissionBehavior, e as FormSubmissionConfig, b as FormValues, I as InputProps, N as NewFormSubmissionActionConfig, S as SubmissionStatus, j as SubmitHandler, T as TouchedFields, p as UseFieldOptions, q as UseFieldReturn, U as UseFormOptions, m as UseFormReturn, a as ValidationMode, V as ValidationSchema } from './types-BemGfSPA.cjs';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
type FieldOrientation = "vertical" | "horizontal";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Field, Form, FormContext, FormFeedback, FormFeedbackProps, useField, useForm } from './
|
|
2
|
-
export { E as ErrorHandler, n as FieldInputProps, o as FieldMeta, s as FieldProps, F as FieldValidator, l as FormActions, c as FormErrors, i as FormHelpers, f as FormNotificationConfig, r as FormProps, h as FormRenderConfig, k as FormState, g as FormStyleConfig, d as FormSubmissionBehavior, e as FormSubmissionConfig, b as FormValues, I as InputProps, N as NewFormSubmissionActionConfig, S as SubmissionStatus, j as SubmitHandler, T as TouchedFields, p as UseFieldOptions, q as UseFieldReturn, U as UseFormOptions, m as UseFormReturn, a as ValidationMode, V as ValidationSchema } from './types-
|
|
1
|
+
export { b as Field, F as Form, d as FormContext, c as FormFeedback, e as FormFeedbackProps, a as useField, u as useForm } from './FormContext-089h0j0Q.js';
|
|
2
|
+
export { E as ErrorHandler, n as FieldInputProps, o as FieldMeta, s as FieldProps, F as FieldValidator, l as FormActions, c as FormErrors, i as FormHelpers, f as FormNotificationConfig, r as FormProps, h as FormRenderConfig, k as FormState, g as FormStyleConfig, d as FormSubmissionBehavior, e as FormSubmissionConfig, b as FormValues, I as InputProps, N as NewFormSubmissionActionConfig, S as SubmissionStatus, j as SubmitHandler, T as TouchedFields, p as UseFieldOptions, q as UseFieldReturn, U as UseFormOptions, m as UseFormReturn, a as ValidationMode, V as ValidationSchema } from './types-BemGfSPA.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
type FieldOrientation = "vertical" | "horizontal";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Form, FormFeedback } from './chunk-
|
|
2
|
-
export { Field, FormContext, useField, useForm } from './chunk-
|
|
3
|
-
export { FieldDescription, FieldError, FieldGroup, Field as FieldWrapper, FieldLabel as FormFieldLabel } from './chunk-
|
|
1
|
+
export { Form, FormFeedback } from './chunk-TOPOO33Z.js';
|
|
2
|
+
export { Field, FormContext, useField, useForm } from './chunk-MJYEXJ3U.js';
|
|
3
|
+
export { FieldDescription, FieldError, FieldGroup, Field as FieldWrapper, FieldLabel as FormFieldLabel } from './chunk-455PI4LV.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/inputs.cjs
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkED4UK63G_cjs = require('./chunk-ED4UK63G.cjs');
|
|
4
|
+
var chunkQRI5TMES_cjs = require('./chunk-QRI5TMES.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Checkbox", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkED4UK63G_cjs.Checkbox; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CheckboxGroup", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkED4UK63G_cjs.CheckboxGroup; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "DatePicker", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkED4UK63G_cjs.DatePicker; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "DateRangePicker", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkED4UK63G_cjs.DateRangePicker; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "FileInput", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkED4UK63G_cjs.FileInput; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "MultiSelect", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkED4UK63G_cjs.MultiSelect; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "Radio", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkED4UK63G_cjs.Radio; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "Select", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkED4UK63G_cjs.Select; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "Switch", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkED4UK63G_cjs.Switch; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "TextArea", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkED4UK63G_cjs.TextArea; }
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "TimePicker", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkED4UK63G_cjs.TimePicker; }
|
|
51
51
|
});
|
|
52
|
-
Object.defineProperty(exports, "
|
|
52
|
+
Object.defineProperty(exports, "TextInput", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkQRI5TMES_cjs.TextInput; }
|
|
55
55
|
});
|
|
56
56
|
//# sourceMappingURL=inputs.cjs.map
|
|
57
57
|
//# sourceMappingURL=inputs.cjs.map
|
package/dist/inputs.d.cts
CHANGED
package/dist/inputs.d.ts
CHANGED
package/dist/inputs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileInput, MultiSelect, Radio, Select, Switch, TextArea,
|
|
2
|
-
|
|
1
|
+
export { Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileInput, MultiSelect, Radio, Select, Switch, TextArea, TimePicker } from './chunk-4ROWNTY6.js';
|
|
2
|
+
export { TextInput } from './chunk-455PI4LV.js';
|
|
3
3
|
//# sourceMappingURL=inputs.js.map
|
|
4
4
|
//# sourceMappingURL=inputs.js.map
|
package/dist/integration.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkMUBEMXI7_cjs = require('./chunk-MUBEMXI7.cjs');
|
|
4
|
+
var chunkED4UK63G_cjs = require('./chunk-ED4UK63G.cjs');
|
|
5
|
+
var chunkQRI5TMES_cjs = require('./chunk-QRI5TMES.cjs');
|
|
6
6
|
var React2 = require('react');
|
|
7
7
|
|
|
8
8
|
function _interopNamespace(e) {
|
|
@@ -565,7 +565,7 @@ function useContactForm(options) {
|
|
|
565
565
|
window.location.assign(destination);
|
|
566
566
|
}, 150);
|
|
567
567
|
}, [navigate, redirectUrl]);
|
|
568
|
-
const form =
|
|
568
|
+
const form = chunkMUBEMXI7_cjs.useForm({
|
|
569
569
|
initialValues: React2.useMemo(
|
|
570
570
|
() => generateInitialValues(formFields),
|
|
571
571
|
[formFields]
|
|
@@ -643,7 +643,7 @@ function DynamicFormField({
|
|
|
643
643
|
const usesInlineCheckboxLabel = field.type === "checkbox";
|
|
644
644
|
const shouldRenderFieldLabel = renderLabel && !usesGroupLegend && !usesInlineCheckboxLabel;
|
|
645
645
|
return /* @__PURE__ */ React2__namespace.createElement(
|
|
646
|
-
|
|
646
|
+
chunkMUBEMXI7_cjs.Field,
|
|
647
647
|
{
|
|
648
648
|
name: field.name,
|
|
649
649
|
label: shouldRenderFieldLabel ? field.label : void 0,
|
|
@@ -652,7 +652,7 @@ function DynamicFormField({
|
|
|
652
652
|
className
|
|
653
653
|
},
|
|
654
654
|
({ field: formField, meta }) => /* @__PURE__ */ React2__namespace.createElement("div", null, (field.type === "text" || field.type === "email" || field.type === "tel" || field.type === "search" || field.type === "password" || field.type === "url") && /* @__PURE__ */ React2__namespace.createElement(
|
|
655
|
-
|
|
655
|
+
chunkQRI5TMES_cjs.TextInput,
|
|
656
656
|
{
|
|
657
657
|
...formField,
|
|
658
658
|
id: fieldId,
|
|
@@ -663,7 +663,7 @@ function DynamicFormField({
|
|
|
663
663
|
"aria-label": field.label
|
|
664
664
|
}
|
|
665
665
|
), field.type === "number" && /* @__PURE__ */ React2__namespace.createElement(
|
|
666
|
-
|
|
666
|
+
chunkQRI5TMES_cjs.TextInput,
|
|
667
667
|
{
|
|
668
668
|
...formField,
|
|
669
669
|
id: fieldId,
|
|
@@ -674,7 +674,7 @@ function DynamicFormField({
|
|
|
674
674
|
"aria-label": field.label
|
|
675
675
|
}
|
|
676
676
|
), field.type === "textarea" && /* @__PURE__ */ React2__namespace.createElement(
|
|
677
|
-
|
|
677
|
+
chunkED4UK63G_cjs.TextArea,
|
|
678
678
|
{
|
|
679
679
|
...formField,
|
|
680
680
|
id: fieldId,
|
|
@@ -685,7 +685,7 @@ function DynamicFormField({
|
|
|
685
685
|
"aria-label": field.label
|
|
686
686
|
}
|
|
687
687
|
), field.type === "select" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
688
|
-
|
|
688
|
+
chunkED4UK63G_cjs.Select,
|
|
689
689
|
{
|
|
690
690
|
...formField,
|
|
691
691
|
id: fieldId,
|
|
@@ -696,7 +696,7 @@ function DynamicFormField({
|
|
|
696
696
|
"aria-label": field.label
|
|
697
697
|
}
|
|
698
698
|
), field.type === "multi-select" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
699
|
-
|
|
699
|
+
chunkED4UK63G_cjs.MultiSelect,
|
|
700
700
|
{
|
|
701
701
|
...formField,
|
|
702
702
|
id: fieldId,
|
|
@@ -707,7 +707,7 @@ function DynamicFormField({
|
|
|
707
707
|
"aria-label": field.label
|
|
708
708
|
}
|
|
709
709
|
), field.type === "radio" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
710
|
-
|
|
710
|
+
chunkED4UK63G_cjs.Radio,
|
|
711
711
|
{
|
|
712
712
|
...formField,
|
|
713
713
|
id: fieldId,
|
|
@@ -721,7 +721,7 @@ function DynamicFormField({
|
|
|
721
721
|
"aria-label": field.label
|
|
722
722
|
}
|
|
723
723
|
), field.type === "checkbox" && /* @__PURE__ */ React2__namespace.createElement(
|
|
724
|
-
|
|
724
|
+
chunkED4UK63G_cjs.Checkbox,
|
|
725
725
|
{
|
|
726
726
|
...formField,
|
|
727
727
|
id: fieldId,
|
|
@@ -735,7 +735,7 @@ function DynamicFormField({
|
|
|
735
735
|
"aria-label": field.label
|
|
736
736
|
}
|
|
737
737
|
), field.type === "checkbox-group" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
738
|
-
|
|
738
|
+
chunkED4UK63G_cjs.CheckboxGroup,
|
|
739
739
|
{
|
|
740
740
|
...formField,
|
|
741
741
|
id: fieldId,
|
|
@@ -749,7 +749,7 @@ function DynamicFormField({
|
|
|
749
749
|
"aria-label": field.label
|
|
750
750
|
}
|
|
751
751
|
), (field.type === "date-picker" || field.type === "date") && /* @__PURE__ */ React2__namespace.createElement(
|
|
752
|
-
|
|
752
|
+
chunkED4UK63G_cjs.DatePicker,
|
|
753
753
|
{
|
|
754
754
|
...formField,
|
|
755
755
|
id: fieldId,
|
|
@@ -759,7 +759,7 @@ function DynamicFormField({
|
|
|
759
759
|
"aria-label": field.label
|
|
760
760
|
}
|
|
761
761
|
), field.type === "date-range" && /* @__PURE__ */ React2__namespace.createElement(
|
|
762
|
-
|
|
762
|
+
chunkED4UK63G_cjs.DateRangePicker,
|
|
763
763
|
{
|
|
764
764
|
...formField,
|
|
765
765
|
id: fieldId,
|
|
@@ -769,7 +769,7 @@ function DynamicFormField({
|
|
|
769
769
|
"aria-label": field.label
|
|
770
770
|
}
|
|
771
771
|
), field.type === "time" && /* @__PURE__ */ React2__namespace.createElement(
|
|
772
|
-
|
|
772
|
+
chunkED4UK63G_cjs.TimePicker,
|
|
773
773
|
{
|
|
774
774
|
...formField,
|
|
775
775
|
id: fieldId,
|
|
@@ -779,7 +779,7 @@ function DynamicFormField({
|
|
|
779
779
|
"aria-label": field.label
|
|
780
780
|
}
|
|
781
781
|
), field.type === "file" && /* @__PURE__ */ React2__namespace.createElement(
|
|
782
|
-
|
|
782
|
+
chunkED4UK63G_cjs.FileInput,
|
|
783
783
|
{
|
|
784
784
|
...formField,
|
|
785
785
|
id: fieldId,
|
package/dist/integration.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-
|
|
3
|
+
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-BemGfSPA.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @page-speed/forms - Rails API Serializer
|
package/dist/integration.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-
|
|
3
|
+
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-BemGfSPA.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @page-speed/forms - Rails API Serializer
|
package/dist/integration.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useForm, Field } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { useForm, Field } from './chunk-MJYEXJ3U.js';
|
|
2
|
+
import { TextArea, Select, MultiSelect, Radio, Checkbox, CheckboxGroup, DatePicker, DateRangePicker, TimePicker, FileInput } from './chunk-4ROWNTY6.js';
|
|
3
|
+
import { TextInput } from './chunk-455PI4LV.js';
|
|
4
4
|
import * as React2 from 'react';
|
|
5
5
|
import { useState, useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
@@ -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
|
|
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
|
*/
|