import { ActionItemConfig, ActionItemType } from "./types.js"; import { DialogType } from "../dialog/Dialog.types.js"; //#region src/components/actions/actionHelpers.d.ts interface StepContext { currentStep?: number; isLastStep?: boolean; } interface SubmitLabelEvaluationContext { formMethods?: { getValues?: () => any; }; stepContext?: StepContext; wizardConfig?: WizardConfig; } interface WizardConfig { steps?: { submitLabel?: ((values: any) => string) | string; }[]; submitLabel?: ((values: any) => string) | string; } interface WizardActionsConfig { formMethods?: any; isFirst: boolean; isLast: boolean; isSubmitting?: boolean; onClose?: () => void; onNext?: () => void; onPrevious?: () => void; onSubmit?: () => void; submitLabel?: ((values: any) => string) | string; } interface StepActionsConfig { formMethods?: any; isFirst: boolean; isLast: boolean; isSubmitting?: boolean; onClose?: () => void; onNext?: () => void; onPrevious?: () => void; submitLabel?: ((values: any) => string) | string; } /** * Action creation utilities for common dialog and form patterns. * * These helpers provide a consistent way to create action configurations * while maintaining type safety and reducing boilerplate. * * @example * ```tsx * const { cancel, submit, back, next } = createActionHelpers(); * * const actions = [ * cancel(handleClose), * submit(handleSubmit, "Save", isSubmitting), * back(handlePrevious), * next(handleNext) * ]; * ``` */ declare function createActionHelpers(): { /** * Creates a back button action for navigation */ back: (onClick?: () => void, label?: string, disabled?: boolean) => ActionItemConfig; /** * Creates a custom button action */ button: (onClick?: () => void, label?: string, disabled?: boolean) => ActionItemConfig; /** * Creates a cancel action that closes dialogs or cancels operations */ cancel: (onClick?: () => void, label?: string) => ActionItemConfig; /** * Creates a custom action with specific type */ custom: (type: ActionItemType, onClick?: () => void, label?: string, options?: Partial) => ActionItemConfig; /** * Creates a next button action for navigation */ next: (onClick?: () => void, label?: string) => ActionItemConfig; /** * Creates a retry action for retrying the current step */ retry: (onClick?: () => void, label?: string) => ActionItemConfig; /** * Creates a submit action for form submissions */ submit: (onClick?: () => void, label?: string, isSubmitting?: boolean) => ActionItemConfig; }; /** * Creates standard dialog actions (Cancel + Submit/Continue) */ declare function createDialogActions(config: { cancelLabel?: string; confirmLabel?: string; isSubmitting?: boolean; onCancel?: () => void; onConfirm?: () => void; type?: DialogType; }): ActionItemConfig[]; /** * Creates form-specific actions with optional cancel button */ declare function createFormActions(config: { cancelLabel?: string; isSubmitting?: boolean; onCancel?: () => void; onSubmit?: () => void; showCancel?: boolean; submitLabel?: string; }): ActionItemConfig[]; /** * Creates wizard-specific actions with conditional Back/Next/Submit buttons */ declare function createWizardActions(config: WizardActionsConfig): ActionItemConfig[]; /** * Creates step-specific actions with Previous and Next buttons */ declare function createStepActions(config: StepActionsConfig): ActionItemConfig[]; /** * Evaluates dynamic submit label if it's a function, otherwise returns static label * Enhanced to handle wizard step-specific labels */ declare function evaluateSubmitLabel(submitLabel: ((values: any) => string) | string | undefined, context?: SubmitLabelEvaluationContext): string | undefined; //#endregion export { StepActionsConfig, SubmitLabelEvaluationContext, WizardActionsConfig, createActionHelpers, createDialogActions, createFormActions, createStepActions, createWizardActions, evaluateSubmitLabel }; //# sourceMappingURL=actionHelpers.d.ts.map