{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-banner",
  "type": "registry:item",
  "title": "Alert Banner",
  "description": "A message in the page: info, success, warning or danger, with an icon, a heading and text. A danger alert is announced as soon as it appears (role=\"alert\"); the others politely (role=\"status\"). `dismissible` adds a close button, which hides it and fires `close`.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "display"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/alert-banner.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/alert-banner.js",
      "content": "// Generated by zubra from alert-banner.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { emit, hasSlot } from '@zubra/runtime';\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"alert-banner\";\n\nexport default $define(tag, {\n  props: {\n    \"variant\": { attribute: \"variant\", default: \"info\", required: false },\n    \"heading\": { attribute: \"heading\", default: \"\", required: false },\n    \"dismissible\": { attribute: \"dismissible\", default: false, required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [\"actions\", \"default\", \"heading\"],\n  events: [\"beforeclose\", \"close\"],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (alert-banner) to ([data-zb-slotted=\\\"alert-banner\\\"]) {\\n  :scope { display: block; }\\n  .alert-box[hidden] { display: none; }\\n  .alert-box { display: grid; grid-template-columns: auto 1fr auto; gap: 0.25rem 0.75rem; padding: 0.9rem 1rem; border: 1px solid var(--tone-border); border-radius: var(--radius, 0.625rem); background: var(--tone-bg); color: var(--foreground, #18181b); }\\n  .alert-info { --tone: oklch(0.55 0.15 255); }\\n  .alert-success { --tone: oklch(0.55 0.14 150); }\\n  .alert-warning { --tone: oklch(0.6 0.14 70); }\\n  .alert-danger { --tone: var(--destructive, #dc2626); }\\n  .alert-box { --tone-bg: color-mix(in oklab, var(--tone) 9%, var(--background, #fff)); --tone-border: color-mix(in oklab, var(--tone) 35%, var(--background, #fff)); }\\n  .alert-icon { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; margin-top: 0.05rem; border-radius: 50%; background: var(--tone); color: #fff; font-size: 0.8rem; font-weight: 800; }\\n  .alert-warning .alert-icon { color: #1c1917; }\\n  .alert-danger .alert-icon { background: color-mix(in oklab, var(--tone) 78%, #000); }\\n  .alert-content { display: grid; gap: 0.25rem; min-width: 0; }\\n  strong { font-weight: 700; }\\n  strong:empty { display: none; }\\n  .alert-text { color: color-mix(in oklab, var(--foreground, #18181b) 85%, var(--tone)); }\\n  .alert-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }\\n  .alert-close { width: 1.75rem; height: 1.75rem; margin: -0.25rem -0.35rem 0 0; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }\\n  .alert-close:hover { background: color-mix(in oklab, var(--tone) 14%, transparent); }\\n  .alert-close:focus-visible { outline: 2px solid var(--ring, #a1a1aa); outline-offset: 1px; }\\n}\\n}\\n\",\n  template: \"\\n  <div>\\n    <span class=\\\"alert-icon\\\" aria-hidden=\\\"true\\\"></span>\\n    <div class=\\\"alert-content\\\">\\n      <strong><!--[--><!--]--></strong>\\n      <div class=\\\"alert-text\\\"><!--[--><!--]--></div>\\n      <!--[--><!--]-->\\n    </div>\\n    <!--[--><!--]-->\\n  </div>\\n\",\n  setup($p, $emit) {\n    const emit = $emit;\nfunction __zubraAssign(signal, value) { signal.set(value); return value }\nfunction __zubraUpdate(signal, delta, prefix) { const old = signal.get(); signal.set(old + delta); return prefix ? old + delta : old }\n                                                                   \n                                                \n\n  const actions = hasSlot('actions')\n  const closed = __zubraState(false)\n  const icons = { info: \"i\", success: \"✓\", warning: \"!\", danger: \"!\" }\n\n  function close() {\n    if (!emit('beforeclose')) return\n    __zubraAssign(closed, true)\n    emit('close')\n  }\n    return [\n      { path: [0], attribute: \"hidden\", boolean: true, value: () => $r(closed) },\n      { path: [0], attribute: \"class\", value: () => \"alert-box alert-\" + $t($p.variant) },\n      { path: [0], attribute: \"role\", value: () => (($p.variant === \"danger\") ? \"alert\" : \"status\") },\n      { path: [0, 0], text: () => $t(($r(icons)[$p.variant] ?? \"i\")) },\n      { path: [0, 1, 0, 0], slot: \"heading\", fallback: { template: \"<!---->\", parts: () => [{ path: [0], anchor: () => $t($p.heading) }] } },\n      { path: [0, 1, 1, 0], slot: \"default\", fallback: null },\n      { path: [0, 1, 2], when: () => $r(actions), blocks: [{ template: \"<div class=\\\"alert-actions\\\"><!--[--><!--]--></div>\", parts: () => [{ path: [0, 0], slot: \"actions\", fallback: null }] }, null] },\n      { path: [0, 2], when: () => $p.dismissible, blocks: [{ template: \"<button type=\\\"button\\\" class=\\\"alert-close\\\" aria-label=\\\"Dismiss\\\">×</button>\", parts: () => [{ path: [0], on: \"click\", handler: () => $r(close) }] }, null] },\n    ];\n  },\n});\n"
    }
  ]
}
