{
  "tag": "ed-alert-dialog",
  "kind": "component",
  "summary": "Alert dialogs interrupt the user with a brief, severity-coded message and at most a confirm/cancel choice.",
  "status": "experimental",
  "level": "molecule",
  "since": "1.0",
  "docs": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/alert-dialog/",
  "usage": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/alert-dialog/usage/",
  "playwright": "getByTestId('…')",
  "dependencies": [
    "ed-dialog",
    "ed-button",
    "ed-icon"
  ],
  "use": [
    "Confirming an irreversible step before it runs — deleting a client record, releasing a payroll run, submitting a tax return",
    "A point where the user must acknowledge or decide before they can continue working",
    "A critical failure or forced logout the user must respond to — a rejected submission, an expired session, restricted-area access",
    "Warning that a consequential action reaches many people at once, such as publishing a pay slip batch to all employees"
  ],
  "notFor": [
    {
      "when": "A harmless, simple message that needs no explanation and offers at most one action, such as Undo",
      "instead": "a [Toast](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/toast-item)"
    },
    {
      "when": "Background events that don't need immediate action",
      "instead": "a [Toast](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/toast-item) or a [Notification](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/notification)"
    },
    {
      "when": "Complex content such as forms, tables, or multi-step flows",
      "instead": "a [Dialog](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/dialog), [Drawer](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/drawer), or full page"
    },
    {
      "when": "Contextual help that doesn't block the workflow",
      "instead": "a [Tooltip](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/tooltip) or [Popover](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/popover)"
    },
    {
      "when": "Form validation errors",
      "instead": "the built-in inline validation messages"
    },
    {
      "when": "Progress feedback such as saving, uploading, or processing",
      "instead": "a [Progress Ring](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/progress-ring) or [Progress Bar](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/progress-bar)"
    },
    {
      "when": "Marketing, upsell, or promotional messages",
      "instead": "a [Notification](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/notification) or dedicated page"
    }
  ],
  "rules": [
    {
      "id": "alert-dialog/rare-interruption",
      "rule": "Use it only when the user genuinely must decide before continuing, and reserve it for interruptions that happen rarely.",
      "why": "Alert dialogs are a high-friction pattern: every unnecessary confirmation dialog trains users to dismiss them without reading, and their protective power is lost when overused."
    },
    {
      "id": "alert-dialog/relevant-now",
      "rule": "Use it only for information directly relevant to what the user is doing right now, never for a general notification."
    },
    {
      "id": "alert-dialog/not-on-page-load",
      "rule": "Never show it in the first seconds of page load — wait for explicit user intent.",
      "check": "error"
    },
    {
      "id": "alert-dialog/specific-title",
      "rule": "Write a specific, descriptive title for every dialog, never a generic one such as \"Warning\", \"Notice\", \"Error\", or \"Information\".",
      "check": "error"
    },
    {
      "id": "alert-dialog/footer-buttons",
      "rule": "When you replace the built-in buttons through the `footer` slot, keep their order and hierarchy: the confirming action first, as the accent button, the cancel `outlined`, and `plain` for anything below it. The built-in `confirm-text` and `cancel-text` buttons already do this. For the accent limit and the explicit appearance see [`button/one-accent-per-scope`](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/button/usage#rule-button-one-accent-per-scope) and [`button/explicit-secondary-appearance`](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/button/usage#rule-button-explicit-secondary-appearance).",
      "check": "error"
    },
    {
      "id": "alert-dialog/destructive-confirmation",
      "rule": "In a destructive confirmation, name the affected resource, state that the action cannot be undone, and let the confirming button name it: \"Delete folder 'Invoices'\", never \"Delete\" or \"OK\"."
    },
    {
      "id": "alert-dialog/cancel-path",
      "rule": "Give a confirmation every way back — a visible Cancel button, the Escape key and `light-dismiss` —, since cancelling is what closing it means. Leave them out only where it asks for a decision between two paths that both lead on, as [Dialog](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/dialog)'s `dialog/way-out` describes.",
      "check": "warning"
    },
    {
      "id": "alert-dialog/async-confirm",
      "rule": "For a confirmed operation that runs asynchronously see [`button/loading-until-resolved`](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/button/usage#rule-button-loading-until-resolved); a dialog it holds open in the loading state shows a failure inline."
    },
    {
      "id": "alert-dialog/no-nested-dialogs",
      "rule": "Never open a second dialog from inside a dialog. The unsaved-changes warning over a form dialog is the only accepted exception.",
      "check": "error"
    }
  ],
  "api": {
    "attributes": [
      {
        "name": "open",
        "property": "open",
        "type": "boolean",
        "default": "false",
        "description": "Indicates whether the alert dialog is open. Toggle this attribute to show or hide the dialog."
      },
      {
        "name": "type",
        "property": "type",
        "type": "'warning' | 'error' | 'info' | 'help'",
        "default": "'info'",
        "description": "The severity. Selects the icon and accent color."
      },
      {
        "name": "label",
        "property": "label",
        "type": "string",
        "default": "''",
        "description": "The heading text. If you need HTML, use the `label` slot. Not `title`: that global attribute shows a browser\ntooltip over the whole dialog."
      },
      {
        "name": "confirm-text",
        "property": "confirmText",
        "type": "string | undefined",
        "description": "If set, renders a primary confirm button with this label."
      },
      {
        "name": "cancel-text",
        "property": "cancelText",
        "type": "string | undefined",
        "description": "If set, renders a secondary cancel button with this label."
      },
      {
        "name": "light-dismiss",
        "property": "lightDismiss",
        "type": "boolean",
        "default": "false",
        "description": "Closes the alert when the user clicks outside it, as [[Escape]] does — a way back, not an answer, so it\nemits `ed-hide` and no `ed-alert-dialog-cancel`. Leave it off where the alert asks for a decision between\ntwo paths that both lead on."
      },
      {
        "name": "dir",
        "property": "dir",
        "type": "string"
      },
      {
        "name": "lang",
        "property": "lang",
        "type": "string"
      }
    ],
    "properties": [],
    "methods": [],
    "events": [
      {
        "name": "ed-show",
        "react": "onEdShow",
        "description": "Emitted when the alert opens. Forwarded from the inner ed-dialog. Cancelable; calling `preventDefault()` keeps it closed."
      },
      {
        "name": "ed-after-show",
        "react": "onEdAfterShow",
        "description": "Emitted after the alert opens and all animations complete. Forwarded from the inner ed-dialog."
      },
      {
        "name": "ed-hide",
        "react": "onEdHide",
        "type": "{ source: Element }",
        "description": "Emitted before the alert closes. Forwarded from the inner ed-dialog; `event.detail.source` names the element that caused the close, and the dialog itself means [[Escape]], a click outside with `light-dismiss`, or a programmatic close. Cancelable; calling `preventDefault()` keeps it open."
      },
      {
        "name": "ed-after-hide",
        "react": "onEdAfterHide",
        "description": "Emitted after the alert closes and all animations complete. Forwarded from the inner ed-dialog."
      },
      {
        "name": "ed-alert-dialog-confirm",
        "react": "onEdAlertDialogConfirm",
        "description": "Emitted when the default-rendered confirm button is clicked. Cancelable; calling `preventDefault()` keeps the dialog open."
      },
      {
        "name": "ed-alert-dialog-cancel",
        "react": "onEdAlertDialogCancel",
        "description": "Emitted when the default-rendered cancel button is clicked. Cancelable; calling `preventDefault()` keeps the dialog open."
      }
    ],
    "slots": [
      {
        "name": "",
        "description": "The message body."
      },
      {
        "name": "label",
        "description": "Override the title (HTML). Its plain text becomes the dialog's accessible name when no `label` attribute is set."
      },
      {
        "name": "icon",
        "description": "Override the default icon (HTML)."
      },
      {
        "name": "footer",
        "description": "Full override of footer buttons. When provided, `confirm-text` and `cancel-text` are ignored."
      }
    ],
    "cssProperties": [],
    "parts": [
      {
        "name": "panel",
        "description": "The dialog's surface, its native `<dialog>` element, forwarded from the inner `<ed-dialog>`. Carries the frame, background and shadow."
      },
      {
        "name": "body",
        "description": "The icon + content grid container."
      },
      {
        "name": "icon",
        "description": "The icon wrapper."
      },
      {
        "name": "content",
        "description": "The title + message wrapper."
      },
      {
        "name": "title",
        "description": "The title element."
      },
      {
        "name": "message",
        "description": "The message wrapper."
      },
      {
        "name": "footer",
        "description": "The footer wrapper."
      }
    ],
    "states": []
  },
  "import": "import '@eurodata/eurodata-ui/dist/components/alert-dialog/alert-dialog.js';",
  "react": {
    "component": "EdAlertDialog",
    "import": "import EdAlertDialog from '@eurodata/eurodata-ui/dist/react/alert-dialog/index.js';"
  }
}
