import { fn } from '@storybook/test';
import { RejectFeedbackDialog } from './reject-feedback-dialog.js';
const meta = {
    title: 'Composed/RejectFeedbackDialog',
    component: RejectFeedbackDialog,
    tags: ['autodocs'],
    parameters: {
        layout: 'centered',
    },
    args: {
        open: true,
        onOpenChange: fn().mockName('onOpenChange'),
        onConfirm: fn().mockName('onConfirm'),
        isSubmitting: false,
    },
};
export default meta;
/** Default — dialog open with empty feedback; confirm button disabled. */
export const Default = {};
/** With feedback entered — confirm button enabled. */
export const WithFeedback = {
    play: async ({ canvasElement }) => {
        // Type feedback into the textarea to show enabled state
        const textarea = canvasElement.ownerDocument.querySelector('textarea[aria-label="Rejection feedback"]');
        if (textarea) {
            // Simulate React-compatible input
            const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value')?.set;
            nativeInputValueSetter?.call(textarea, 'The requirements are missing error handling for edge cases. Please add validation for empty inputs.');
            textarea.dispatchEvent(new Event('input', { bubbles: true }));
            textarea.dispatchEvent(new Event('change', { bubbles: true }));
        }
    },
};
/** Submitting state — spinner shown, buttons disabled. */
export const Submitting = {
    args: {
        isSubmitting: true,
    },
};
/** Custom title and description for tech decisions context. */
export const CustomTitle = {
    args: {
        title: 'Reject Plan',
        description: 'Provide feedback on the technical plan for the agent to revise. Be specific about which decisions need changes.',
    },
};
