{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "side-sheet",
  "type": "registry:item",
  "title": "Side Sheet",
  "description": "A panel that slides in from the edge of the screen (`side`: right, left or bottom), on the native <dialog>: the page behind is inert, focus moves in and back, and Escape, the close button or a click outside closes it. For filters, a cart, settings, or a menu on a phone. `open` is two-way.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "navigation"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/side-sheet.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/side-sheet.js",
      "content": "// Generated by zubra from side-sheet.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { effect, hasSlot, id } from '@zubra/runtime';\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"side-sheet\";\n\nexport default $define(tag, {\n  props: {\n    \"open\": { attribute: \"open\", default: false, required: false, model: true },\n    \"side\": { attribute: \"side\", default: \"right\", required: false },\n    \"label\": { attribute: \"label\", default: \"Panel\", required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [\"actions\", \"default\", \"heading\"],\n  events: [\"openchange\"],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (side-sheet) to ([data-zb-slotted=\\\"side-sheet\\\"]) {\\n  dialog { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(26rem, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--border, #e4e4e7); background: var(--background, #fff); color: var(--foreground, #18181b); box-shadow: -12px 0 40px #0000001f; }\\n  .sheet-left { inset: 0 auto 0 0; border-left: 0; border-right: 1px solid var(--border, #e4e4e7); }\\n  .sheet-bottom { inset: auto 0 0 0; width: 100vw; height: auto; max-height: 85dvh; border-left: 0; border-top: 1px solid var(--border, #e4e4e7); border-radius: calc(var(--radius, 0.625rem) * 1.6) calc(var(--radius, 0.625rem) * 1.6) 0 0; }\\n  /* Slides in from its side, and back out to it. */\\n  dialog { translate: 100% 0; transition: translate var(--duration-slow, 400ms) var(--ease-out, ease-out), overlay var(--duration-slow, 400ms) allow-discrete, display var(--duration-slow, 400ms) allow-discrete; }\\n  .sheet-left { translate: -100% 0; }\\n  .sheet-bottom { translate: 0 100%; }\\n  dialog[open] { translate: 0 0; }\\n  @starting-style { dialog[open] { translate: 100% 0; } .sheet-left[open] { translate: -100% 0; } .sheet-bottom[open] { translate: 0 100%; } }\\n  dialog::backdrop { background: #0d122000; transition: background-color var(--duration-slow, 400ms) var(--ease-out, ease-out), overlay var(--duration-slow, 400ms) allow-discrete, display var(--duration-slow, 400ms) allow-discrete; }\\n  dialog[open]::backdrop { background: #0d122059; }\\n  @starting-style { dialog[open]::backdrop { background: #0d122000; } }\\n  .sheet-panel { display: flex; flex-direction: column; height: 100%; max-height: inherit; }\\n  header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border, #e4e4e7); }\\n  h2 { flex: 1; margin: 0; font-size: 1.05rem; }\\n  .sheet-close { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }\\n  .sheet-close:hover { background: var(--accent, #f4f4f5); }\\n  .sheet-close:focus-visible { outline: 2px solid var(--ring, #a1a1aa); outline-offset: 2px; }\\n  .sheet-body { flex: 1; overflow: auto; padding: 1rem 1.25rem; }\\n  footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.9rem 1.25rem; border-top: 1px solid var(--border, #e4e4e7); }\\n  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; } }\\n}\\n}\\n\",\n  template: \"\\n  <dialog>\\n    <div class=\\\"sheet-panel\\\">\\n      <header>\\n        <h2><!--[--><!--]--></h2>\\n        <button type=\\\"button\\\" class=\\\"sheet-close\\\" aria-label=\\\"Close\\\">×</button>\\n      </header>\\n      <div class=\\\"sheet-body\\\"><!--[--><!--]--></div>\\n      <!--[--><!--]-->\\n    </div>\\n  </dialog>\\n\",\n  setup($p, $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 headingId = id()\n  const hasActions = hasSlot('actions')\n  const dialog = __zubraState(null)\n  const pressedOutside = __zubraState(false)\n\n  effect(() => {\n    if (!dialog.get()) return\n    if ($p.open && !dialog.get().open) dialog.get().showModal()\n    else if (!$p.open && dialog.get().open) dialog.get().close()\n  })\n    return [\n      { path: [0], ref: () => (($el) => (__zubraAssign(dialog, $el))) },\n      { path: [0], attribute: \"class\", value: () => \"sheet-\" + $t($p.side) },\n      { path: [0], attribute: \"aria-labelledby\", value: () => $r(headingId) },\n      { path: [0], on: \"close\", handler: () => (() => ($p.open = false)) },\n      { path: [0], on: \"pointerdown\", handler: () => ((event) => (__zubraAssign(pressedOutside, event.target === dialog.get()))) },\n      { path: [0], on: \"click\", handler: () => (() => pressedOutside.get() && ($p.open = false)), modifiers: { self: true } },\n      { path: [0, 0, 0, 0], attribute: \"id\", value: () => $r(headingId) },\n      { path: [0, 0, 0, 0, 0], slot: \"heading\", fallback: { template: \"<!---->\", parts: () => [{ path: [0], anchor: () => $t($p.label) }] } },\n      { path: [0, 0, 0, 1], on: \"click\", handler: () => (() => ($p.open = false)) },\n      { path: [0, 0, 1, 0], slot: \"default\", fallback: null },\n      { path: [0, 0, 2], when: () => $r(hasActions), blocks: [{ template: \"<footer><!--[--><!--]--></footer>\", parts: () => [{ path: [0], on: \"click\", handler: () => ((event) => event.target.closest?.(\"[data-close]\") && ($p.open = false)) }, { path: [0, 0], slot: \"actions\", fallback: null }] }, null] },\n    ];\n  },\n});\n"
    }
  ]
}
