{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "word-rotate",
  "type": "registry:item",
  "title": "Word Rotate",
  "description": "One word at a time from `words`, each sliding out as the next slides in every `interval` ms. Screen readers hear the whole list once, it pauses on hover, and reduced motion shows the first word only.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "motion"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/word-rotate.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/word-rotate.js",
      "content": "// Generated by zubra from word-rotate.zb. Do not edit.\nimport * as $motion from \"@zubra/runtime/motion\";\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { onMount } from '@zubra/runtime';\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"word-rotate\";\n\nexport default $define(tag, {\n  props: {\n    \"words\": { attribute: \"words\", default: [], required: false },\n    \"interval\": { attribute: \"interval\", default: 2500, required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [],\n  events: [],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (word-rotate) to ([data-zb-slotted=\\\"word-rotate\\\"]) {\\n  :scope { display: inline-block; }\\n  .rotate-stage { position: relative; display: inline-grid; vertical-align: bottom; overflow: clip; overflow-clip-margin: 0.2em; }\\n  .rotate-word { grid-area: 1 / 1; color: var(--rotate-color, inherit); transition: opacity var(--duration-slow, 400ms) var(--ease-out, ease-out), translate var(--duration-slow, 400ms) var(--ease-spring, ease-out), filter var(--duration-slow, 400ms) var(--ease-out, ease-out); }\\n  @starting-style { .rotate-word { opacity: 0; translate: 0 0.6em; filter: blur(4px); } }\\n  .rotate-word[data-leaving] { opacity: 0; translate: 0 -0.6em; filter: blur(4px); }\\n  .rotate-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\\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  <span class=\\\"rotate-label\\\"></span>\\n  <span class=\\\"rotate-stage\\\" aria-hidden=\\\"true\\\">\\n    \\n    <!--[--><!--]-->\\n  </span>\\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  const index = __zubraState(0)\n  const paused = __zubraState(false)\n  const list = __zubraComputed(() => (Array.isArray($p.words) ? $p.words.map(String) : []))\n  const current = __zubraComputed(() => (list.get().length ? [{ at: index.get() % list.get().length, word: list.get()[index.get() % list.get().length] }] : []))\n  const spoken = __zubraComputed(() => (list.get().join(\", \")))\n\n  onMount(() => {\n    if (globalThis.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return\n    const timer = setInterval(() => {\n      if (!paused.get() && list.get().length > 1 && !document.hidden) __zubraAssign(index, (index.get() + 1) % list.get().length)\n    }, Math.max(800, $p.interval))\n    return () => clearInterval(timer)\n  })\n    return [\n      { path: [0], text: () => $t($r(spoken)) },\n      { path: [1], on: \"mouseenter\", handler: () => (() => (__zubraAssign(paused, true))) },\n      { path: [1], on: \"mouseleave\", handler: () => (() => (__zubraAssign(paused, false))) },\n      { path: [1, 0], each: () => $r(current), key: (item, $index) => $r(item).at, block: { template: \"\\n      <span class=\\\"rotate-word\\\"></span>\\n    \", parts: (item, $index) => [{ path: [0], text: () => $t($r(item).word) }] }, animate: $motion },\n    ];\n  },\n});\n"
    }
  ]
}
