{
  "element": "nve-dialog",
  "entrypoint": "@nvidia-elements/core/dialog/dialog.examples.json",
  "items": [
    {
      "id": "dialog",
      "name": "Default",
      "template": "<nve-button popovertarget=\"dialog\">button</nve-button>\n<nve-dialog id=\"dialog\" modal closable>\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n</nve-dialog>\n",
      "summary": "Basic modal dialog for focused user interactions. Use dialogs for confirmations, simple forms, or important information that requires user attention before continuing, creating a modal overlay that blocks interaction with the underlying page until dismissed.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "dialog-invoker-command",
      "name": "InvokerCommand",
      "template": "<nve-button commandfor=\"dialog\" command=\"toggle-popover\">toggle popover</nve-button>\n<nve-dialog id=\"dialog\" modal closable>\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n</nve-dialog>\n",
      "summary": "Use the `commandfor` and `command` attributes to trigger custom Invoker Commands, such as toggling a dialog.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "dialog-events",
      "name": "Events",
      "template": "<nve-dialog id=\"dialog\" modal closable>\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n</nve-dialog>\n<nve-button popovertarget=\"dialog\">button</nve-button>\n<script type=\"module\">\n  const dialog = document.querySelector(\"nve-dialog\");\n  dialog.addEventListener(\"beforetoggle\", () => console.log(\"beforetoggle\"));\n  dialog.addEventListener(\"toggle\", () => console.log(\"toggle\"));\n  dialog.addEventListener(\"open\", () => console.log(\"open\"));\n  dialog.addEventListener(\"close\", () => console.log(\"close\"));\n</script>\n",
      "summary": "Dialog with event listeners for state change tracking. Use dialog events (beforetoggle, toggle, open, close) to trigger side effects like loading data on open, cleaning up resources on close, or preventing closure based on validation state.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-visual",
      "name": "Visual",
      "template": "<nve-dialog closable>\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n  <nve-dialog-footer>\n    <nve-button>button</nve-button>\n  </nve-dialog-footer>\n</nve-dialog>\n",
      "summary": "Dialog with header, content, and footer structure for complete user interactions. Use the footer for action buttons, organizing the dialog into clear sections that guide users through the information hierarchy and toward decision-making.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "dialog-content",
      "name": "Content",
      "template": "<nve-dialog closable>\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n  <nve-dialog-footer>\n    <nve-button>cancel</nve-button>\n    <nve-button interaction=\"emphasis\">action</nve-button>\n  </nve-dialog-footer>\n</nve-dialog>\n",
      "summary": "Dialog with primary and secondary actions in footer. Use cancel + emphasized action pattern for confirmations or decisions where you need to present a choice, with emphasis on the primary action guiding users toward the preferred or expected path.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-small",
      "name": "Small",
      "template": "<nve-dialog size=\"sm\" closable>\n  <h3 nve-text=\"heading\">Small</h3>\n  <p nve-text=\"body\">some text content in a small dialog</p>\n</nve-dialog>\n",
      "summary": "Small dialog size for brief confirmations or single-field inputs. Use size=\"sm\" for simple yes/no confirmations, quick edits, or minimal interactions that don't require significant screen space, keeping the interface uncluttered.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-medium",
      "name": "Medium",
      "template": "<nve-dialog size=\"md\" closable>\n  <h3 nve-text=\"heading\">Medium</h3>\n  <p nve-text=\"body\">some text content in a medium dialog</p>\n</nve-dialog>\n",
      "summary": "Medium dialog size (default) for standard forms and content. Use size=\"md\" for typical dialogs containing short forms (3-5 fields), moderate content, or standard user interactions that need balanced space without overwhelming the interface.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-large",
      "name": "Large",
      "template": "<nve-dialog size=\"lg\" closable>\n  <h3 nve-text=\"heading\">Large</h3>\n  <p nve-text=\"body\">some text content in a large dialog</p>\n</nve-dialog>\n",
      "summary": "Large dialog size for complex forms or extensive content. Use size=\"lg\" for multi-section forms, detailed settings panels, or content-rich interactions where users need more space to work comfortably, but consider using a drawer for large content areas.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-text-wrap",
      "name": "TextWrap",
      "template": "<nve-dialog closable>\n  <h3 nve-text=\"heading\">Text Wrap</h3>\n  <p nve-text=\"body\">\n    Some text wrapped content in a small dialog. Some text wrapped content in a small dialog. Some text wrapped content\n    in a small dialog. Some text wrapped content in a small dialog. Some text wrapped content in a small dialog. Some\n    text wrapped content in a small dialog. Some text wrapped content in a small dialog. Some text wrapped content in a\n    small dialog. Some text wrapped content in a small dialog. Some text wrapped content in a small dialog. Some text\n    wrapped content in a small dialog. Some text wrapped content in a small dialog.\n  </p>\n</nve-dialog>\n",
      "summary": "Dialog with text wrapping behavior, where content adapts to dialog constraints and maintains readability in limited space.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-non-closable",
      "name": "NonClosable",
      "template": "<nve-button popovertarget=\"dialog\">open</nve-button>\n<nve-dialog id=\"dialog\" modal>\n  <h3 nve-text=\"heading\">Non-Closable Dialog</h3>\n  <p nve-text=\"body\">Clicking the background to dismiss will not work here</p>\n  <nve-dialog-footer>\n    <nve-button popovertarget=\"dialog\" popovertargetaction=\"hide\">cancel</nve-button>\n  </nve-dialog-footer>\n</nve-dialog>\n",
      "summary": "Non-closable dialog requiring explicit action through buttons. Use non-closable dialogs sparingly for critical decisions (like irreversible deletions) or required acknowledgments where you must ensure users make a conscious choice rather than accidentally dismissing the dialog.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-alignment",
      "name": "Alignment",
      "template": "<nve-dialog>center</nve-dialog>\n<nve-dialog position=\"top\">top center</nve-dialog>\n<nve-dialog position=\"top\" alignment=\"start\">top start</nve-dialog>\n<nve-dialog position=\"top\">top center</nve-dialog>\n<nve-dialog position=\"top\" alignment=\"end\">top end</nve-dialog>\n<nve-dialog position=\"right\" alignment=\"start\">right start</nve-dialog>\n<nve-dialog position=\"right\">right center</nve-dialog>\n<nve-dialog position=\"right\" alignment=\"end\">right end</nve-dialog>\n<nve-dialog position=\"bottom\" alignment=\"start\">bottom start</nve-dialog>\n<nve-dialog position=\"bottom\">bottom center</nve-dialog>\n<nve-dialog position=\"bottom\" alignment=\"end\">bottom end</nve-dialog>\n<nve-dialog position=\"left\" alignment=\"start\">left start</nve-dialog>\n<nve-dialog position=\"left\">left center</nve-dialog>\n<nve-dialog position=\"left\" alignment=\"end\">left end</nve-dialog>\n",
      "summary": "Dialog positioning and alignment options for contextual placement. While center positioning is standard, use edge positioning (top/bottom/left/right) for contextually relevant dialogs that relate to specific interface regions or when working with limited vertical space.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-position",
      "name": "Position",
      "template": "<style>\n  body {\n    min-height: 200vh;\n  }\n</style>\n<nve-dialog size=\"sm\" position=\"bottom\" alignment=\"end\" closable>\n  <h3 nve-text=\"heading\">Position</h3>\n  <p nve-text=\"body\">some text content in a small dialog</p>\n</nve-dialog>\n",
      "summary": "Specific dialog positioning example, with placement in optimal locations for user interaction and visual hierarchy.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-legacy-trigger",
      "name": "LegacyTrigger",
      "template": "<nve-button id=\"dialog-btn\">open</nve-button>\n<nve-dialog trigger=\"dialog-btn\" closable modal hidden>\n  <h3 nve-text=\"heading\">Title</h3>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n  <nve-accordion behavior-expand>\n    <nve-accordion-header>\n      <h2 nve-text=\"heading xs medium\" slot=\"prefix\">Heading</h2>\n    </nve-accordion-header>\n    <nve-accordion-content\n      >Adjust workspace preferences including theme, notification settings, and default project configurations to\n      customize your experience.</nve-accordion-content\n    >\n  </nve-accordion>\n</nve-dialog>\n<script type=\"module\">\n  const dialog = document.querySelector(\"nve-dialog\");\n  dialog.addEventListener(\"open\", (e) => {\n    console.log(e);\n    dialog.hidden = false;\n  });\n  dialog.addEventListener(\"close\", (e) => {\n    console.log(e);\n    dialog.hidden = true;\n  });\n</script>\n",
      "summary": "Legacy trigger mechanism for dialog opening, with backward compatibility and alternative interaction patterns for dialog activation.",
      "description": "",
      "deprecated": true,
      "composition": true,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-legacy-behavior-trigger",
      "name": "LegacyBehaviorTrigger",
      "template": "<nve-button id=\"dialog-btn\">open</nve-button>\n<nve-dialog trigger=\"dialog-btn\" behavior-trigger closable modal hidden>\n  <h3 nve-text=\"heading\">Title</h3>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n  <nve-accordion behavior-expand>\n    <nve-accordion-header>\n      <h2 nve-text=\"heading xs medium\" slot=\"prefix\">Heading</h2>\n    </nve-accordion-header>\n    <nve-accordion-content\n      >Adjust workspace preferences including theme, notification settings, and default project configurations to\n      customize your experience.</nve-accordion-content\n    >\n  </nve-accordion>\n</nve-dialog>\n",
      "summary": "Legacy behavior trigger for dialog management, showing traditional dialog control patterns and event handling for dialog lifecycle.",
      "description": "",
      "deprecated": true,
      "composition": true,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-shadow-root",
      "name": "ShadowRoot",
      "template": "<dialog-test-shadow-root>\n  <template shadowrootmode=\"open\">\n    <style>\n      :host {\n        box-sizing: border-box;\n        display: block;\n        margin: 25vh auto;\n        width: 400px;\n        height: 400px;\n        background: red;\n        visibility: visible !important;\n      }\n    </style>\n    <nve-dialog size=\"sm\">center</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"top\">top center</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"top\" alignment=\"start\">top start</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"top\" alignment=\"end\">top end</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"right\" alignment=\"start\">right start</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"right\">right center</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"right\" alignment=\"end\">right end</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"bottom\" alignment=\"start\">bottom start</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"bottom\">bottom center</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"bottom\" alignment=\"end\">bottom end</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"left\" alignment=\"start\">left start</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"left\">left center</nve-dialog>\n    <nve-dialog size=\"sm\" position=\"left\" alignment=\"end\">left end</nve-dialog>\n  </template>\n</dialog-test-shadow-root>\n",
      "summary": "Dialog functionality within shadow DOM, with proper dialog behavior in encapsulated component environments and custom elements.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-scroll-content",
      "name": "ScrollContent",
      "template": "<nve-dialog id=\"dialog\" modal closable style=\"height: 400px\">\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\" style=\"height: 600px\">some tall content</p>\n  <p nve-text=\"body\">some overflow content</p>\n  <nve-dialog-footer>\n    <nve-button id=\"cancel-btn\">cancel</nve-button>\n  </nve-dialog-footer>\n</nve-dialog>\n",
      "summary": "Dialog with scrollable content while keeping header and footer fixed. Use scrollable content areas for dialogs with variable or lengthy content (like terms of service or detailed descriptions) while keeping action buttons always visible, ensuring users can complete the task without scrolling to find buttons.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-inert-modal",
      "name": "InertModal",
      "template": "<style>\n  body {\n    display: block !important;\n    padding: 24px;\n  }\n</style>\n<div>\n  <button popovertarget=\"popover\">btn</button>\n  <div>\n    <button popovertarget=\"popover\">btn</button>\n    <nve-dialog id=\"popover\" modal>\n      <nve-dialog-header>\n        <h3 nve-text=\"heading semibold\">title</h3>\n      </nve-dialog-header>\n      <button popovertarget=\"dropdown\">button</button>\n      <nve-dropdown id=\"dropdown\">\n        dropdown content\n        <button>btn</button>\n      </nve-dropdown>\n      <p nve-text=\"body\">some text content in a closable dialog</p>\n      <button>btn</button>\n      <button>btn</button>\n    </nve-dialog>\n  </div>\n</div>\n<button popovertarget=\"popover\">btn</button><br />\n<button popovertarget=\"popover\">btn</button>\n<div>\n  <button popovertarget=\"popover\">btn</button>\n  <div>\n    <button popovertarget=\"popover\">btn</button>\n    <div>\n      <button popovertarget=\"popover\">btn</button>\n    </div>\n  </div>\n</div>\n",
      "summary": "Modal dialog with inert behavior, including proper focus management and accessibility compliance for modal overlays and user interaction.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-container-styles",
      "name": "ContainerStyles",
      "template": "<nve-dialog id=\"slots-dialog\" closable popover=\"manual\" position=\"top\">\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">default</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">default dialog with header and footer components</p>\n  <nve-dialog-footer>\n    <nve-button>button</nve-button>\n  </nve-dialog-footer>\n</nve-dialog>\n<nve-dialog id=\"content-dialog\" closable popover=\"manual\" position=\"right\">\n  <h3 nve-text=\"heading semibold\">title</h3>\n  <p nve-text=\"body\">dialog with only content and no header or footer components</p>\n  <nve-button>button</nve-button>\n</nve-dialog>\n<nve-dialog id=\"custom-dialog\" closable style=\"--padding: 0\" position=\"bottom\">\n  <h3 nve-text=\"heading semibold\">title</h3>\n  <p nve-text=\"body\">dialog with only content and no header or footer components and --padding set to 0</p>\n  <nve-button>button</nve-button>\n</nve-dialog>\n<nve-dialog id=\"custom-slots\" closable style=\"--padding: 48px\" position=\"left\">\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">dialog with header and footer components with --padding set to 48px</p>\n  <nve-dialog-footer>\n    <nve-button>button</nve-button>\n  </nve-dialog-footer>\n</nve-dialog>\n",
      "summary": "Dialog with different container styles, including custom padding and layout options.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-max-height",
      "name": "MaxHeight",
      "template": "<nve-dialog id=\"dialog\" modal closable>\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">some overflow content</p>\n  <p nve-text=\"body\" style=\"min-height: 1000px\">some overflow content</p>\n  <nve-button>button</nve-button>\n  <nve-dialog-footer>\n    <nve-button id=\"cancel-btn\">cancel</nve-button>\n  </nve-dialog-footer>\n</nve-dialog>\n",
      "summary": "Dialog with overflow content, including max-height constraints and a scrollable content area.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-legacy-dom-creation",
      "name": "LegacyDOMCreation",
      "template": "<nve-button id=\"dialog-btn\">button</nve-button>\n<script type=\"module\">\n  import \"@nvidia-elements/core/dialog/define.js\";\n  import \"@nvidia-elements/core/button/define.js\";\n  document.querySelector(\"#dialog-btn\").addEventListener(\"click\", () => {\n    const dialog = document.createElement(\"nve-dialog\");\n    dialog.id = \"dialog-dom-creation\";\n    dialog.modal = true;\n    dialog.closable = true;\n\n    dialog.addEventListener(\n      \"close\",\n      () => {\n        document.body.removeChild(dialog);\n      },\n      { once: true },\n    );\n    document.body.appendChild(dialog);\n  });\n</script>\n",
      "summary": "Legacy DOM Creation",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "dialog-center-alignment",
      "name": "CenterAlignment",
      "template": "<style>\n  body {\n    min-height: 200vh;\n  }\n</style>\n<nve-button popovertarget=\"dialog\">button</nve-button>\n<nve-dialog id=\"dialog\" closable>\n  <nve-dialog-header>\n    <h3 nve-text=\"heading semibold\">title</h3>\n  </nve-dialog-header>\n  <p nve-text=\"body\">some text content in a closable dialog</p>\n  <nve-select>\n    <select aria-label=\"select\">\n      <option>one</option>\n      <option>two</option>\n      <option>three</option>\n    </select>\n  </nve-select>\n</nve-dialog>\n",
      "summary": "Center alignment with anchor body",
      "description": "",
      "composition": true,
      "tags": [
        "test-case"
      ]
    }
  ]
}