# Was previously modeled as its own "chunk" node kind, with a bespoke
# data.code shape (inline {code, language} or referenced {src, language}).
# Both turned out to duplicate things this spec already has: inline code
# is exactly common/showcase.schema.yaml's `code` variant
# (metadata.preview would use it), and a reference to an external file is
# exactly a `refs` entry (rel: file) - the same trick a token uses to
# point at its DTCG file. What's left - `refs` (rel: composes, since this
# is built from other components), a status, and some sections - is just a
# pattern.
id: confirmation-dialog
kind: entry
name: Confirmation Dialog
description: A pre-composed destructive-action confirmation, built from Dialog, Button, and Icon.

metadata:
  status: {status: stable}
refs:
  - to: dialog
    rel: composes
  - to: button
    rel: composes
  - to: icon
    rel: composes
  - href: ./chunks/confirmation-dialog.tsx
    rel: file
    role: React implementation

sections:
  - kind: guidelines
    for: all
    framing: when-to-use
    title: When to use
    items:
      - statement: Confirming a destructive, hard-to-reverse action (delete, revoke access).
        level: should
      - statement: Confirming a routine save or submit action.
        level: should-not
        refs:
          - to: button
            rel: alternative-to
            note: A routine action doesn't need an interruption; a plain button keeps the flow moving.
