@reformer/cdk 1.0.0-beta.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +96 -0
  3. package/dist/FormArray-CBT-1kKN.js +120 -0
  4. package/dist/FormWizard-DLDm4FJM.js +311 -0
  5. package/dist/Slot-YDt2BEtP.js +27 -0
  6. package/dist/components/form-array/FormArray.d.ts +223 -0
  7. package/dist/components/form-array/FormArrayAddButton.d.ts +6 -0
  8. package/dist/components/form-array/FormArrayContext.d.ts +137 -0
  9. package/dist/components/form-array/FormArrayCount.d.ts +17 -0
  10. package/dist/components/form-array/FormArrayEmpty.d.ts +22 -0
  11. package/dist/components/form-array/FormArrayItemIndex.d.ts +24 -0
  12. package/dist/components/form-array/FormArrayList.d.ts +26 -0
  13. package/dist/components/form-array/FormArrayRemoveButton.d.ts +26 -0
  14. package/dist/components/form-array/index.d.ts +13 -0
  15. package/dist/components/form-array/types.d.ts +77 -0
  16. package/dist/components/form-array/useFormArray.d.ts +95 -0
  17. package/dist/components/form-field/FormField.d.ts +107 -0
  18. package/dist/components/form-field/FormFieldContext.d.ts +56 -0
  19. package/dist/components/form-field/FormFieldControl.d.ts +35 -0
  20. package/dist/components/form-field/FormFieldDescription.d.ts +30 -0
  21. package/dist/components/form-field/FormFieldError.d.ts +36 -0
  22. package/dist/components/form-field/FormFieldLabel.d.ts +35 -0
  23. package/dist/components/form-field/FormFieldRoot.d.ts +32 -0
  24. package/dist/components/form-field/index.d.ts +10 -0
  25. package/dist/components/form-field/types.d.ts +114 -0
  26. package/dist/components/form-field/useFormField.d.ts +111 -0
  27. package/dist/components/form-wizard/FormWizard.d.ts +47 -0
  28. package/dist/components/form-wizard/FormWizardActions.d.ts +98 -0
  29. package/dist/components/form-wizard/FormWizardContext.d.ts +84 -0
  30. package/dist/components/form-wizard/FormWizardIndicator.d.ts +118 -0
  31. package/dist/components/form-wizard/FormWizardNext.d.ts +35 -0
  32. package/dist/components/form-wizard/FormWizardPrev.d.ts +35 -0
  33. package/dist/components/form-wizard/FormWizardProgress.d.ts +83 -0
  34. package/dist/components/form-wizard/FormWizardStep.d.ts +55 -0
  35. package/dist/components/form-wizard/FormWizardSubmit.d.ts +43 -0
  36. package/dist/components/form-wizard/Slot.d.ts +20 -0
  37. package/dist/components/form-wizard/Step.d.ts +24 -0
  38. package/dist/components/form-wizard/index.d.ts +21 -0
  39. package/dist/components/form-wizard/types.d.ts +108 -0
  40. package/dist/form-array.d.ts +2 -0
  41. package/dist/form-array.js +15 -0
  42. package/dist/form-field.d.ts +2 -0
  43. package/dist/form-field.js +12 -0
  44. package/dist/form-wizard.d.ts +2 -0
  45. package/dist/form-wizard.js +22 -0
  46. package/dist/index.d.ts +6 -0
  47. package/dist/index.js +33 -0
  48. package/dist/useFormField-DV396Bxa.js +232 -0
  49. package/llms.txt +3294 -0
  50. package/package.json +90 -0
@@ -0,0 +1,98 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * Props for a navigation button (prev/next)
4
+ */
5
+ export interface FormWizardButtonProps {
6
+ /** Click handler */
7
+ onClick: () => void;
8
+ /** Whether the button is disabled */
9
+ disabled: boolean;
10
+ }
11
+ /**
12
+ * Props for the submit button
13
+ */
14
+ export interface FormWizardSubmitProps extends FormWizardButtonProps {
15
+ /** Whether form is currently submitting */
16
+ isSubmitting: boolean;
17
+ }
18
+ /**
19
+ * Render props passed to children function
20
+ */
21
+ export interface FormWizardActionsRenderProps {
22
+ /** Props for the "Previous" button */
23
+ prev: FormWizardButtonProps;
24
+ /** Props for the "Next" button */
25
+ next: FormWizardButtonProps;
26
+ /** Props for the "Submit" button */
27
+ submit: FormWizardSubmitProps;
28
+ /** Whether current step is the first step */
29
+ isFirstStep: boolean;
30
+ /** Whether current step is the last step */
31
+ isLastStep: boolean;
32
+ /** Whether validation is in progress */
33
+ isValidating: boolean;
34
+ /** Whether form is submitting */
35
+ isSubmitting: boolean;
36
+ }
37
+ /**
38
+ * Render function type for headless mode
39
+ */
40
+ type RenderFunction = (props: FormWizardActionsRenderProps) => ReactNode;
41
+ /**
42
+ * Props for FormWizard.Actions component
43
+ */
44
+ export interface FormWizardActionsProps {
45
+ /** Submit handler (called on last step) */
46
+ onSubmit?: () => void | Promise<void>;
47
+ /** Children: render function (headless) or ReactNode (compound components) */
48
+ children: ReactNode | RenderFunction;
49
+ /** Optional className for wrapper (compound mode only) */
50
+ className?: string;
51
+ /** Optional style for wrapper (compound mode only) */
52
+ style?: CSSProperties;
53
+ }
54
+ interface FormWizardActionsContextValue {
55
+ onSubmit?: () => void | Promise<void>;
56
+ }
57
+ /**
58
+ * Hook to access Actions context (onSubmit handler)
59
+ *
60
+ * Must be used within FormWizard.Actions component.
61
+ * Used internally by FormWizard.Submit.
62
+ */
63
+ export declare function useFormWizardActions(): FormWizardActionsContextValue;
64
+ /**
65
+ * `FormWizard.Actions` — контейнер кнопок навигации мастера. Поддерживает два режима:
66
+ * compound-children (`FormWizard.Prev`/`Next`/`Submit`) и render-props.
67
+ *
68
+ * Render-props получают: `prev`, `next`, `submit` (все с `onClick`/`disabled`),
69
+ * `isFirstStep`, `isLastStep`, `isValidating`, `isSubmitting`.
70
+ *
71
+ * @example Compound mode
72
+ * ```tsx
73
+ * <FormWizard.Actions onSubmit={handleSubmit}>
74
+ * <FormWizard.Prev>Back</FormWizard.Prev>
75
+ * <FormWizard.Next>Next</FormWizard.Next>
76
+ * <FormWizard.Submit loadingText="Submitting...">Submit</FormWizard.Submit>
77
+ * </FormWizard.Actions>
78
+ * ```
79
+ *
80
+ * @example Render-props mode
81
+ * ```tsx
82
+ * <FormWizard.Actions onSubmit={handleSubmit}>
83
+ * {({ prev, next, submit, isFirstStep, isLastStep }) => (
84
+ * <div className="flex justify-between">
85
+ * {!isFirstStep && <button onClick={prev.onClick} disabled={prev.disabled}>Back</button>}
86
+ * {isLastStep
87
+ * ? <button onClick={submit.onClick} disabled={submit.disabled}>{submit.isSubmitting ? '…' : 'Submit'}</button>
88
+ * : <button onClick={next.onClick} disabled={next.disabled}>Next</button>}
89
+ * </div>
90
+ * )}
91
+ * </FormWizard.Actions>
92
+ * ```
93
+ */
94
+ export declare function FormWizardActions({ onSubmit, children, className, style, }: FormWizardActionsProps): import("react/jsx-runtime").JSX.Element;
95
+ export declare namespace FormWizardActions {
96
+ var displayName: string;
97
+ }
98
+ export {};
@@ -0,0 +1,84 @@
1
+ import { FormProxy } from '@reformer/core';
2
+ /**
3
+ * Context value for FormWizard
4
+ * Shares navigation state and methods with child components
5
+ */
6
+ export interface FormWizardContextValue<T extends Record<string, any>> {
7
+ /** Current step (1-based) */
8
+ currentStep: number;
9
+ /** Total number of steps */
10
+ totalSteps: number;
11
+ /** Completed steps */
12
+ completedSteps: number[];
13
+ /** Is this the first step */
14
+ isFirstStep: boolean;
15
+ /** Is this the last step */
16
+ isLastStep: boolean;
17
+ /** Is validation in progress */
18
+ isValidating: boolean;
19
+ /** Is form submitting */
20
+ isSubmitting: boolean;
21
+ /** Form instance */
22
+ form: FormProxy<T>;
23
+ /** Go to next step (with validation) */
24
+ goToNextStep: () => Promise<boolean>;
25
+ /** Go to previous step */
26
+ goToPreviousStep: () => void;
27
+ /** Go to specific step */
28
+ goToStep: (step: number) => boolean;
29
+ }
30
+ /**
31
+ * React context, который снабжает дочерние компоненты `FormWizard` (Step,
32
+ * Actions, Indicator, Progress) текущим состоянием мастера. Создаётся
33
+ * `FormWizard`. Читать через `useFormWizard()`.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * import { FormWizardContext } from '@reformer/cdk/form-wizard';
38
+ *
39
+ * function CurrentStep() {
40
+ * const ctx = useContext(FormWizardContext);
41
+ * return <span>step {ctx?.currentStep}</span>;
42
+ * }
43
+ * ```
44
+ */
45
+ export declare const FormWizardContext: import('react').Context<FormWizardContextValue<any> | null>;
46
+ /**
47
+ * Хук для доступа к контексту {@link FormWizard} из любого потомка.
48
+ *
49
+ * Возвращает текущее состояние мастера (`currentStep`, `totalSteps`,
50
+ * `completedSteps`, `isFirstStep`, `isLastStep`, `isValidating`, `isSubmitting`,
51
+ * `form`) и методы навигации (`goToNextStep`, `goToPreviousStep`, `goToStep`).
52
+ * Бросает исключение, если вызван вне `<FormWizard>`.
53
+ *
54
+ * Для внешнего управления (вне дерева Wizard) используйте
55
+ * {@link FormWizardHandle} через `useRef`.
56
+ *
57
+ * @typeParam T - Тип корневой формы (`FormProxy<T>`).
58
+ * @returns Текущий {@link FormWizardContextValue}.
59
+ * @throws Error если используется вне `<FormWizard>`.
60
+ *
61
+ * @example Минимальное использование внутри custom-step
62
+ * ```tsx
63
+ * function MyStepComponent() {
64
+ * const { currentStep, isLastStep } = useFormWizard();
65
+ * return <p>Шаг {currentStep}{isLastStep && ' — последний'}</p>;
66
+ * }
67
+ * ```
68
+ *
69
+ * @example Условный рендер кнопки на основе isValidating + completedSteps
70
+ * ```tsx
71
+ * function ProgressBadge() {
72
+ * const { currentStep, totalSteps, completedSteps, isValidating } =
73
+ * useFormWizard<CreditApplication>();
74
+ *
75
+ * if (isValidating) return <span>Проверяем шаг {currentStep}...</span>;
76
+ * return (
77
+ * <span>
78
+ * Завершено {completedSteps.length} из {totalSteps}
79
+ * </span>
80
+ * );
81
+ * }
82
+ * ```
83
+ */
84
+ export declare function useFormWizard<T extends Record<string, any>>(): FormWizardContextValue<T>;
@@ -0,0 +1,118 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { FormProxy } from '@reformer/core';
3
+ /**
4
+ * Step definition for the indicator
5
+ */
6
+ export interface FormWizardIndicatorStep {
7
+ /** Step number (1-based) */
8
+ number: number;
9
+ /** Step title/label */
10
+ title: string;
11
+ /** Optional icon */
12
+ icon?: string;
13
+ /** Component to render for this step, or a ReactNode (pre-rendered element) */
14
+ component?: ComponentType<{
15
+ control: FormProxy<unknown>;
16
+ } & Record<string, unknown>> | ReactNode;
17
+ }
18
+ /**
19
+ * Enriched step with state information
20
+ */
21
+ export interface FormWizardIndicatorStepWithState extends FormWizardIndicatorStep {
22
+ /** Whether this is the current step */
23
+ isCurrent: boolean;
24
+ /** Whether this step is completed */
25
+ isCompleted: boolean;
26
+ /** Whether user can navigate to this step */
27
+ canNavigate: boolean;
28
+ }
29
+ /**
30
+ * Render props passed to children function
31
+ */
32
+ export interface FormWizardIndicatorRenderProps {
33
+ /** Steps with their current state */
34
+ steps: FormWizardIndicatorStepWithState[];
35
+ /** Navigate to a specific step */
36
+ goToStep: (step: number) => boolean;
37
+ /** Current step number */
38
+ currentStep: number;
39
+ /** Total number of steps */
40
+ totalSteps: number;
41
+ /** Completed step numbers */
42
+ completedSteps: number[];
43
+ }
44
+ /**
45
+ * Props for FormWizard.Indicator component
46
+ */
47
+ export interface FormWizardIndicatorProps {
48
+ /** Step definitions */
49
+ steps: FormWizardIndicatorStep[];
50
+ /** Render function for custom UI */
51
+ children: (props: FormWizardIndicatorRenderProps) => ReactNode;
52
+ }
53
+ /**
54
+ * FormWizard.Indicator - Headless component for step indicator
55
+ *
56
+ * Provides step data with state for building custom step indicators.
57
+ * No default UI - you build exactly what you need.
58
+ *
59
+ * ## Render Props
60
+ * - `steps` - array of steps with state (`isCurrent`, `isCompleted`, `canNavigate`)
61
+ * - `goToStep` - function to navigate to a step
62
+ * - `currentStep` - current step number
63
+ * - `totalSteps` - total number of steps
64
+ * - `completedSteps` - array of completed step numbers
65
+ *
66
+ * @example Basic stepper
67
+ * ```tsx
68
+ * <FormWizard.Indicator steps={STEPS}>
69
+ * {({ steps, goToStep }) => (
70
+ * <nav className="flex gap-2">
71
+ * {steps.map((step) => (
72
+ * <button
73
+ * key={step.number}
74
+ * onClick={() => goToStep(step.number)}
75
+ * disabled={!step.canNavigate}
76
+ * className={cn(
77
+ * 'px-4 py-2 rounded',
78
+ * step.isCurrent && 'bg-blue-500 text-white',
79
+ * step.isCompleted && 'bg-green-100',
80
+ * !step.canNavigate && 'opacity-50 cursor-not-allowed'
81
+ * )}
82
+ * >
83
+ * {step.icon} {step.title}
84
+ * </button>
85
+ * ))}
86
+ * </nav>
87
+ * )}
88
+ * </FormWizard.Indicator>
89
+ * ```
90
+ *
91
+ * @example With progress line
92
+ * ```tsx
93
+ * <FormWizard.Indicator steps={STEPS}>
94
+ * {({ steps, goToStep }) => (
95
+ * <div className="flex items-center">
96
+ * {steps.map((step, index) => (
97
+ * <Fragment key={step.number}>
98
+ * <StepCircle
99
+ * active={step.isCurrent}
100
+ * completed={step.isCompleted}
101
+ * onClick={() => step.canNavigate && goToStep(step.number)}
102
+ * >
103
+ * {step.isCompleted ? '✓' : step.number}
104
+ * </StepCircle>
105
+ * {index < steps.length - 1 && (
106
+ * <StepLine completed={step.isCompleted} />
107
+ * )}
108
+ * </Fragment>
109
+ * ))}
110
+ * </div>
111
+ * )}
112
+ * </FormWizard.Indicator>
113
+ * ```
114
+ */
115
+ export declare function FormWizardIndicator({ steps, children }: FormWizardIndicatorProps): import("react/jsx-runtime").JSX.Element;
116
+ export declare namespace FormWizardIndicator {
117
+ var displayName: string;
118
+ }
@@ -0,0 +1,35 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * Props for FormWizard.Next component
4
+ */
5
+ export interface FormWizardNextProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
6
+ /** Button content */
7
+ children: ReactNode;
8
+ /** Render as child element (merge props into child) */
9
+ asChild?: boolean;
10
+ /** Additional disabled state (merged with automatic via OR) */
11
+ disabled?: boolean;
12
+ }
13
+ /**
14
+ * FormWizard.Next - Next step button component
15
+ *
16
+ * Renders a button that validates current step and navigates to the next.
17
+ * Automatically disabled on the last step, during validation, or during submission.
18
+ *
19
+ * @example Basic usage
20
+ * ```tsx
21
+ * <FormWizard.Actions>
22
+ * <FormWizard.Next>Continue</FormWizard.Next>
23
+ * </FormWizard.Actions>
24
+ * ```
25
+ *
26
+ * @example With custom button (asChild)
27
+ * ```tsx
28
+ * <FormWizard.Next asChild>
29
+ * <MyButton variant="primary">
30
+ * Next <ArrowRight />
31
+ * </MyButton>
32
+ * </FormWizard.Next>
33
+ * ```
34
+ */
35
+ export declare const FormWizardNext: import('react').ForwardRefExoticComponent<FormWizardNextProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,35 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * Props for FormWizard.Prev component
4
+ */
5
+ export interface FormWizardPrevProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
6
+ /** Button content */
7
+ children: ReactNode;
8
+ /** Render as child element (merge props into child) */
9
+ asChild?: boolean;
10
+ /** Additional disabled state (merged with automatic via OR) */
11
+ disabled?: boolean;
12
+ }
13
+ /**
14
+ * FormWizard.Prev - Previous step button component
15
+ *
16
+ * Renders a button that navigates to the previous step.
17
+ * Automatically disabled on the first step, during validation, or during submission.
18
+ *
19
+ * @example Basic usage
20
+ * ```tsx
21
+ * <FormWizard.Actions>
22
+ * <FormWizard.Prev>Back</FormWizard.Prev>
23
+ * </FormWizard.Actions>
24
+ * ```
25
+ *
26
+ * @example With custom button (asChild)
27
+ * ```tsx
28
+ * <FormWizard.Prev asChild>
29
+ * <MyButton variant="ghost">
30
+ * <ArrowLeft /> Back
31
+ * </MyButton>
32
+ * </FormWizard.Prev>
33
+ * ```
34
+ */
35
+ export declare const FormWizardPrev: import('react').ForwardRefExoticComponent<FormWizardPrevProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,83 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Render props passed to children function
4
+ */
5
+ export interface FormWizardProgressRenderProps {
6
+ /** Current step number (1-based) */
7
+ current: number;
8
+ /** Total number of steps */
9
+ total: number;
10
+ /** Completion percentage (0-100) */
11
+ percent: number;
12
+ /** Number of completed steps */
13
+ completedCount: number;
14
+ /** Whether on first step */
15
+ isFirstStep: boolean;
16
+ /** Whether on last step */
17
+ isLastStep: boolean;
18
+ }
19
+ /**
20
+ * Props for FormWizard.Progress component
21
+ */
22
+ export interface FormWizardProgressProps {
23
+ /** Render function for custom UI */
24
+ children: (props: FormWizardProgressRenderProps) => ReactNode;
25
+ }
26
+ /**
27
+ * FormWizard.Progress - Headless component for progress display
28
+ *
29
+ * Provides progress data for building custom progress indicators.
30
+ * No default UI - you build exactly what you need.
31
+ *
32
+ * ## Render Props
33
+ * - `current` - current step number
34
+ * - `total` - total number of steps
35
+ * - `percent` - completion percentage (0-100)
36
+ * - `completedCount` - number of completed steps
37
+ * - `isFirstStep` - whether on first step
38
+ * - `isLastStep` - whether on last step
39
+ *
40
+ * @example Simple text progress
41
+ * ```tsx
42
+ * <FormWizard.Progress>
43
+ * {({ current, total, percent }) => (
44
+ * <div className="text-sm text-gray-600">
45
+ * Step {current} of {total} ({percent}% complete)
46
+ * </div>
47
+ * )}
48
+ * </FormWizard.Progress>
49
+ * ```
50
+ *
51
+ * @example Progress bar
52
+ * ```tsx
53
+ * <FormWizard.Progress>
54
+ * {({ percent, current, total }) => (
55
+ * <div className="space-y-2">
56
+ * <div className="flex justify-between text-sm">
57
+ * <span>Step {current}/{total}</span>
58
+ * <span>{percent}%</span>
59
+ * </div>
60
+ * <div className="h-2 bg-gray-200 rounded-full overflow-hidden">
61
+ * <div
62
+ * className="h-full bg-blue-500 transition-all"
63
+ * style={{ width: `${percent}%` }}
64
+ * />
65
+ * </div>
66
+ * </div>
67
+ * )}
68
+ * </FormWizard.Progress>
69
+ * ```
70
+ *
71
+ * @example Circular progress
72
+ * ```tsx
73
+ * <FormWizard.Progress>
74
+ * {({ percent }) => (
75
+ * <CircularProgress value={percent} />
76
+ * )}
77
+ * </FormWizard.Progress>
78
+ * ```
79
+ */
80
+ export declare function FormWizardProgress({ children }: FormWizardProgressProps): import("react/jsx-runtime").JSX.Element;
81
+ export declare namespace FormWizardProgress {
82
+ var displayName: string;
83
+ }
@@ -0,0 +1,55 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { FormProxy } from '@reformer/core';
3
+ /**
4
+ * Props for FormWizard.Step component
5
+ *
6
+ * Supports two usage patterns:
7
+ * 1. Component-based: `<FormWizard.Step component={Step1} control={form} />`
8
+ * 2. Children-based: `<FormWizard.Step>{children}</FormWizard.Step>`
9
+ */
10
+ export interface FormWizardStepProps<T extends Record<string, any>> {
11
+ /** Component to render for this step (legacy API) */
12
+ component?: ComponentType<{
13
+ control: FormProxy<T>;
14
+ } & Record<string, unknown>>;
15
+ /** Form control to pass to the component (legacy API) */
16
+ control?: FormProxy<T>;
17
+ /** Children to render (new API - for use with selector-based wizard) */
18
+ children?: ReactNode;
19
+ /** Any additional props to pass to the component */
20
+ [key: string]: unknown;
21
+ }
22
+ /**
23
+ * Internal props that include the step index (set by parent FormWizard)
24
+ */
25
+ export interface FormWizardStepInternalProps<T extends Record<string, any>> extends FormWizardStepProps<T> {
26
+ /** Step index (1-based), set internally by FormWizard */
27
+ _stepIndex?: number;
28
+ }
29
+ /**
30
+ * FormWizard.Step - renders a step component when it's the current step
31
+ *
32
+ * @example Component-based (legacy)
33
+ * ```tsx
34
+ * <FormWizard ref={navRef} form={form} config={config}>
35
+ * <FormWizard.Step component={Step1} control={form} />
36
+ * <FormWizard.Step component={Step2} control={form} extraProp="value" />
37
+ * </FormWizard>
38
+ * ```
39
+ *
40
+ * @example Children-based (new)
41
+ * ```tsx
42
+ * <FormWizard form={form} config={config}>
43
+ * <FormWizard.Step>
44
+ * <RenderNodeComponent node={step1Content} ... />
45
+ * </FormWizard.Step>
46
+ * <FormWizard.Step>
47
+ * <RenderNodeComponent node={step2Content} ... />
48
+ * </FormWizard.Step>
49
+ * </FormWizard>
50
+ * ```
51
+ */
52
+ export declare function FormWizardStep<T extends Record<string, any>>({ component: Component, control, children, _stepIndex, ...restProps }: FormWizardStepInternalProps<T>): import("react/jsx-runtime").JSX.Element | null;
53
+ export declare namespace FormWizardStep {
54
+ var displayName: string;
55
+ }
@@ -0,0 +1,43 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * Props for FormWizard.Submit component
4
+ */
5
+ export interface FormWizardSubmitProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
6
+ /** Button content */
7
+ children: ReactNode;
8
+ /** Render as child element (merge props into child) */
9
+ asChild?: boolean;
10
+ /** Additional disabled state (merged with automatic via OR) */
11
+ disabled?: boolean;
12
+ /** Content to show during submission (replaces children) */
13
+ loadingText?: ReactNode;
14
+ }
15
+ /**
16
+ * FormWizard.Submit - Form submission button component
17
+ *
18
+ * Renders a button that submits the form on the last step.
19
+ * Automatically disabled when not on the last step, during validation, or during submission.
20
+ * Shows `loadingText` content during submission if provided.
21
+ *
22
+ * @example Basic usage
23
+ * ```tsx
24
+ * <FormWizard.Actions onSubmit={handleSubmit}>
25
+ * <FormWizard.Submit>Submit</FormWizard.Submit>
26
+ * </FormWizard.Actions>
27
+ * ```
28
+ *
29
+ * @example With loading text
30
+ * ```tsx
31
+ * <FormWizard.Submit loadingText="Submitting...">
32
+ * Submit Application
33
+ * </FormWizard.Submit>
34
+ * ```
35
+ *
36
+ * @example With custom button (asChild)
37
+ * ```tsx
38
+ * <FormWizard.Submit asChild loadingText={<Spinner />}>
39
+ * <MyButton variant="success">Complete</MyButton>
40
+ * </FormWizard.Submit>
41
+ * ```
42
+ */
43
+ export declare const FormWizardSubmit: import('react').ForwardRefExoticComponent<FormWizardSubmitProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,20 @@
1
+ import { ReactNode, HTMLAttributes } from 'react';
2
+ export interface SlotProps extends HTMLAttributes<HTMLElement> {
3
+ children?: ReactNode;
4
+ }
5
+ /**
6
+ * Slot component for asChild pattern.
7
+ *
8
+ * Renders its child element and merges props from the Slot into the child.
9
+ * Used to allow custom components to be rendered in place of default elements.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * // Instead of rendering a button, renders MyButton with merged props
14
+ * <Slot onClick={handleClick} disabled={true}>
15
+ * <MyButton className="custom">Click me</MyButton>
16
+ * </Slot>
17
+ * // Result: <MyButton onClick={handleClick} disabled={true} className="custom">Click me</MyButton>
18
+ * ```
19
+ */
20
+ export declare const Slot: import('react').ForwardRefExoticComponent<SlotProps & import('react').RefAttributes<HTMLElement>>;
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Props для Step компонента
4
+ */
5
+ export interface StepProps {
6
+ /** Заголовок шага (отображается в индикаторе) */
7
+ title: string;
8
+ /** Иконка шага (emoji или текст) */
9
+ icon?: string;
10
+ /** CSS класс */
11
+ className?: string;
12
+ /** Дочерние элементы */
13
+ children?: ReactNode;
14
+ }
15
+ /**
16
+ * Step - маркер-компонент для wizard-схемы
17
+ *
18
+ * Компонент просто рендерит children. Метаданные (title, icon) извлекаются
19
+ * wizard-компонентом из componentProps через useFormWizardSelectors.
20
+ */
21
+ export declare function Step({ children }: StepProps): ReactNode;
22
+ export declare namespace Step {
23
+ var displayName: string;
24
+ }
@@ -0,0 +1,21 @@
1
+ export { FormWizard } from './FormWizard';
2
+ export { Step, type StepProps } from './Step';
3
+ export { FormWizardStep } from './FormWizardStep';
4
+ export { FormWizardIndicator } from './FormWizardIndicator';
5
+ export { FormWizardActions, useFormWizardActions } from './FormWizardActions';
6
+ export { FormWizardProgress } from './FormWizardProgress';
7
+ export { FormWizardPrev } from './FormWizardPrev';
8
+ export { FormWizardNext } from './FormWizardNext';
9
+ export { FormWizardSubmit } from './FormWizardSubmit';
10
+ export { Slot } from './Slot';
11
+ export type { SlotProps } from './Slot';
12
+ export { useFormWizard, FormWizardContext } from './FormWizardContext';
13
+ export type { FormWizardHandle, FormWizardProps, FormWizardConfig } from './types';
14
+ export type { FormWizardStepProps } from './FormWizardStep';
15
+ export type { FormWizardContextValue } from './FormWizardContext';
16
+ export type { FormWizardIndicatorProps, FormWizardIndicatorStep, FormWizardIndicatorStepWithState, FormWizardIndicatorRenderProps, } from './FormWizardIndicator';
17
+ export type { FormWizardActionsProps, FormWizardActionsRenderProps, FormWizardButtonProps, FormWizardSubmitProps as FormWizardSubmitRenderProps, } from './FormWizardActions';
18
+ export type { FormWizardPrevProps } from './FormWizardPrev';
19
+ export type { FormWizardNextProps } from './FormWizardNext';
20
+ export type { FormWizardSubmitProps } from './FormWizardSubmit';
21
+ export type { FormWizardProgressProps, FormWizardProgressRenderProps } from './FormWizardProgress';