{"version":3,"file":"ConfirmDialog.cjs","names":[],"sources":["../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["/**\n * @tempest-limits props-count — a confirmation is a question (title, description),\n * two buttons whose copy the app must own (confirmLabel, cancelLabel), a\n * destructive-or-not tone (variant), and the async state of the answer (loading,\n * onConfirm, onCancel, open). Fewer props means the app writes the dialog again\n * around a Modal.\n */\nimport type { ReactNode } from \"react\";\nimport { Button } from \"@/components/Button\";\nimport { Modal } from \"@/components/Modal\";\n\nexport interface ConfirmDialogProps {\n    open: boolean;\n    title: ReactNode;\n    description?: ReactNode;\n    confirmLabel?: string;\n    cancelLabel?: string;\n    variant?: \"primary\" | \"danger\";\n    loading?: boolean;\n    onConfirm: () => void | Promise<void>;\n    onCancel: () => void;\n}\n\n/**\n * Quick confirmation prompt built on top of {@link Modal}. Use for destructive\n * actions with `variant=\"danger\"`.\n */\nexport function ConfirmDialog({\n    open,\n    title,\n    description,\n    confirmLabel = \"Confirmar\",\n    cancelLabel = \"Cancelar\",\n    variant = \"primary\",\n    loading = false,\n    onConfirm,\n    onCancel,\n}: ConfirmDialogProps) {\n    return (\n        <Modal\n            open={open}\n            onClose={onCancel}\n            title={title}\n            size=\"sm\"\n            footer={\n                <>\n                    <Button variant=\"secondary\" onClick={onCancel} disabled={loading}>\n                        {cancelLabel}\n                    </Button>\n                    <Button variant={variant} loading={loading} onClick={() => void onConfirm()}>\n                        {confirmLabel}\n                    </Button>\n                </>\n            }\n        >\n            {description}\n        </Modal>\n    );\n}\n"],"mappings":"2GA2BA,SAAgB,EAAc,CAC1B,OACA,QACA,cACA,eAAe,YACf,cAAc,WACd,UAAU,UACV,UAAU,GACV,YACA,YACmB,CACnB,OACI,EAAA,EAAA,IAAA,CAAC,EAAA,MAAD,CACU,OACN,QAAS,EACF,QACP,KAAK,KACL,QACI,EAAA,EAAA,KAAA,CAAA,EAAA,SAAA,CAAA,SAAA,EACI,EAAA,EAAA,IAAA,CAAC,EAAA,OAAD,CAAQ,QAAQ,YAAY,QAAS,EAAU,SAAU,EACpD,SAAA,CACG,CAAA,GACR,EAAA,EAAA,IAAA,CAAC,EAAA,OAAD,CAAiB,UAAkB,UAAS,YAAe,KAAK,EAAU,EACrE,SAAA,CACG,CAAA,CACV,CAAA,CAAA,EAGL,SAAA,CACE,CAAA,CAEf"}