{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "glow-highlight",
  "title": "GlowHighlight",
  "description": "Traces soft, layered candy-colored rings around the words that matter.",
  "dependencies": [],
  "files": [
    {
      "path": "registry/vue/kida/glow-highlight.vue",
      "content": "<script setup lang=\"ts\">\nimport './glow-highlight.css'\n/*\n * AI agent notes: GlowHighlight\n *\n * Change the look with props only; the component has no runtime controls. Do not edit the\n * motion engine or glow-highlight.css to restyle one usage: they apply to every instance.\n *\n * Settings and defaults:\n *   finish    'glow' | 'sticker' | 'halo'                    default 'glow'\n *   palette   'candy' | 'sorbet' | 'berry' | 'after-dark'    default 'candy'\n *   spread    ring size multiplier, clamped 0–3              default 1\n *   duration  ms to grow or fold away                        default 600\n *   trigger   'view' | 'hover' | 'manual'                    default 'view'\n *   once      view: stay lit after the first entry           default true\n *   amount    view: visible fraction (0–1) needed to start   default 0.6\n *   active    manual: whether the glow is on                 default false\n *\n * To reproduce a docs look exactly, copy finish, palette, spread, duration, and trigger.\n * Any setting left out falls back to its default.\n *   Playful     <GlowHighlight>Playful</GlowHighlight>\n *   Sticker     <GlowHighlight finish=\"sticker\" :spread=\"0.8\">Sticker</GlowHighlight>\n *   Halo        <GlowHighlight finish=\"halo\" :spread=\"1.2\" :duration=\"900\">Halo</GlowHighlight>\n *   After dark  <GlowHighlight finish=\"sticker\" palette=\"after-dark\">after dark</GlowHighlight>\n *               Use on a dark surface with light text.\n *\n * Colors beyond the palettes: set --kida-glow-core, --kida-glow-rim, --kida-glow-band, and\n * --kida-glow-fringe in `style` on the component. A class loaded before this component's\n * CSS does not override them.\n *\n * The slot renders twice: once as the traced copy and once as the readable text. Keep it on\n * the same line as its tags, because surrounding line breaks become spaces in both copies.\n * `hover` follows the nearest link, button, label, summary, or [tabindex] element, including\n * the highlight itself, so keyboard focus lights it too. Keep it to a word or short phrase:\n * every growing instance redraws its filter each frame. Reduced motion is handled inside;\n * do not add your own checks.\n */\nimport { type GlowHighlightControls, glowHighlight } from './glow-highlight.motion.js'\nimport { shallowRef, watch } from 'vue'\nimport type { GlowHighlightProps } from './glow-highlight.types.js'\n\ndefineOptions({ name: 'KidaGlowHighlight', inheritAttrs: false })\nconst props = withDefaults(defineProps<GlowHighlightProps>(), {\n  finish: 'glow',\n  palette: 'candy',\n  spread: 1,\n  duration: 600,\n  trigger: 'view',\n  once: true,\n  amount: 0.6,\n  active: false,\n})\nconst element = shallowRef<HTMLSpanElement | null>(null)\nlet controls: GlowHighlightControls | null = null\ndefineExpose({ element })\n\n// Visual options and the manual state update the live controller; only these restart it.\nwatch(\n  [() => element.value, () => props.trigger, () => props.once, () => props.amount],\n  (_, __, onCleanup) => {\n    const node = element.value\n    if (!node) return\n    const created = glowHighlight(node, { ...props })\n    controls = created\n    onCleanup(() => {\n      created.destroy()\n      if (controls === created) controls = null\n    })\n  },\n  { flush: 'post' },\n)\n\nwatch(\n  [() => props.finish, () => props.spread, () => props.duration],\n  () => controls?.update({ finish: props.finish, spread: props.spread, duration: props.duration }),\n  { flush: 'post' },\n)\n\nwatch(\n  [() => props.active, () => props.trigger],\n  () => {\n    if (props.trigger === 'manual') controls?.setActive(props.active)\n  },\n  { flush: 'post' },\n)\n</script>\n\n<template>\n  <!-- The traced copy is aria-hidden and made inert by the engine, so content is read once. -->\n  <span v-bind=\"$attrs\" ref=\"element\" data-kida-glow=\"\" :data-finish=\"props.finish\" :data-palette=\"props.palette\" data-state=\"off\">\n    <span data-kida-glow-layer=\"\" aria-hidden=\"true\"><slot /></span>\n    <span data-kida-glow-content=\"\"><slot /></span>\n    <svg data-kida-glow-defs=\"\" aria-hidden=\"true\" focusable=\"false\" />\n  </span>\n</template>\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/vue/kida/glow-highlight.types.ts",
      "content": "import type { GlowHighlightOptions, GlowHighlightPalette } from './glow-highlight.motion.js';\n\nexport type { GlowHighlightFinish, GlowHighlightPalette, GlowHighlightTrigger } from './glow-highlight.motion.js';\n\nexport interface GlowHighlightProps extends GlowHighlightOptions {\n    /** Named color set. Inline --kida-glow-* values override it. @default 'candy' */\n    palette?: GlowHighlightPalette;\n}\n\n/** Vue component refs expose the root DOM element, null when presence removes it. */\nexport interface KidaElement {\n    element: HTMLElement | null;\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/vue/kida/glow-highlight.css",
      "content": "/*\n * GlowHighlight. Every colour is a custom property, so palettes are compositions, not props.\n * Defaults: a Cherry core with a blush rim, then butter and tangerine bands. Ink on Cherry is\n * about 4.75:1.\n */\n[data-kida-glow] {\n  --kida-glow-core: #e94f86;\n  --kida-glow-rim: #ffe1ec;\n  --kida-glow-band: #ffd76a;\n  --kida-glow-fringe: #ff8a3d;\n  --kida-glow-shadow: rgb(33 28 36 / 0.2);\n\n  /* Breathing room so the outer band does not paint over neighbouring letters. */\n  --kida-glow-gap: 0.1em;\n\n  position: relative;\n  display: inline-block;\n  margin-inline: var(--kida-glow-gap);\n  isolation: isolate;\n}\n\n[data-kida-glow] [data-kida-glow-layer] {\n  position: absolute;\n  z-index: -1;\n  /* Exactly the text's box, so wrapped lines trace identically. The engine's filter region\n     paints the rings outside it without adding to the page's scrollable area. */\n  inset: 0;\n  /* Only alpha is read. If a browser drops the filter, an opaque copy exactly under the text\n     is the least visible failure. */\n  color: #000;\n  pointer-events: none;\n  user-select: none;\n  /* Hidden until the engine runs, so server markup never shows a raw copy. */\n  visibility: hidden;\n}\n\n[data-kida-glow] [data-kida-glow-content] {\n  position: relative;\n}\n\n[data-kida-glow] [data-kida-glow-defs] {\n  position: absolute;\n  width: 0;\n  height: 0;\n  overflow: hidden;\n}\n\n/* Named palettes, selected with `palette` (data-palette). Candy is the default above. Inline\n   --kida-glow-* values still override any palette. Mirrored by GLOW_PALETTES in the motion\n   package; a test keeps the two identical. */\n[data-kida-glow][data-palette=\"sorbet\"] {\n  --kida-glow-core: #ffb07a;\n  --kida-glow-rim: #fff0e4;\n  --kida-glow-band: #ffd76a;\n  --kida-glow-fringe: #e94f86;\n}\n\n[data-kida-glow][data-palette=\"berry\"] {\n  --kida-glow-core: #cdbdff;\n  --kida-glow-rim: #f6f1ff;\n  --kida-glow-band: #f9a8c9;\n  --kida-glow-fringe: #e94f86;\n}\n\n/* For dark surfaces: a deeper core keeps light text readable. */\n[data-kida-glow][data-palette=\"after-dark\"] {\n  --kida-glow-core: #8f2350;\n  --kida-glow-rim: #c23a6e;\n  --kida-glow-band: #ffd76a;\n  --kida-glow-fringe: #ff8a3d;\n}\n\n/* System colours replace the palette; the decoration would only fight them. */\n@media (forced-colors: active) {\n  [data-kida-glow] [data-kida-glow-layer] {\n    display: none;\n  }\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/vue/kida/glow-highlight.motion.ts",
      "content": "/**\n * GlowHighlight engine. Framework-agnostic; adapters render the markup contract and forward\n * options.\n *\n *   <span data-kida-glow>\n *     <span data-kida-glow-layer aria-hidden>text</span>         ← filtered copy, behind\n *     <span data-kida-glow-content>text</span>                   ← the real, readable text\n *     <svg data-kida-glow-defs aria-hidden></svg>                ← the engine fills this\n *   </span>\n *\n * The rings are an SVG filter on the hidden copy, built from its alpha, so any text, font\n * or size works and late-loading fonts re-trace for free. Motion is one progress value per\n * instance driven by an on-demand rAF loop that stops when settled. At rest the layer is\n * `visibility: hidden` when off, so an idle highlight costs no filter work.\n */\nimport {\n  GLOW_CLOSING,\n  type GlowHighlightFinish,\n  type GlowRingPx,\n  glowRingsPx,\n  ringFrame,\n  stepProgress,\n} from './glow-highlight-math.motion.js'\nimport { prefersReducedMotion, watchReducedMotion } from './reduced-motion.motion.js'\n\nexport {\n  GLOW_PALETTES,\n  type GlowHighlightFinish,\n  type GlowHighlightPalette,\n  type GlowPaletteColors,\n} from './glow-highlight-math.motion.js'\n\nexport type GlowHighlightTrigger = 'view' | 'hover' | 'manual'\n\nexport interface GlowHighlightOptions {\n  /** Ring treatment. @default 'glow' */\n  finish?: GlowHighlightFinish\n  /** Multiplier on ring size, from 0 to 3. @default 1 */\n  spread?: number\n  /** Time to fully grow or collapse, in ms. @default 600 */\n  duration?: number\n  /** What turns the glow on. @default 'view' */\n  trigger?: GlowHighlightTrigger\n  /** For `view`: glow once and stay lit. @default true */\n  once?: boolean\n  /** For `view`: visible fraction needed to start, from 0 to 1. @default 0.6 */\n  amount?: number\n  /** For `manual`: the initial state, applied without animation. @default false */\n  active?: boolean\n}\n\nexport interface GlowHighlightControls {\n  /** Animate toward on or off. Interrupts and reverses any motion in progress. */\n  setActive(active: boolean): void\n  /** Apply new visual options without restarting or losing the current state. */\n  update(options: Pick<GlowHighlightOptions, 'finish' | 'spread' | 'duration'>): void\n  destroy(): void\n}\n\nconst SVG = 'http://www.w3.org/2000/svg'\n/**\n * Corner-rounding blur as a fraction of the ring radius. Thresholding the blur at 50% turns\n * feMorphology's square corners round and fills small counters (the bowls of P, a, e).\n */\nconst ROUNDING = 0.65\nlet nextId = 0\n\ninterface RingNodes {\n  spec: GlowRingPx\n  morph: SVGFEMorphologyElement\n  close: SVGFEMorphologyElement\n  smooth: SVGFEGaussianBlurElement\n  round: SVGFEGaussianBlurElement\n  flood: SVGFEFloodElement\n}\n\nfunction el<K extends keyof SVGElementTagNameMap>(\n  name: K,\n  attrs: Record<string, string | number>,\n): SVGElementTagNameMap[K] {\n  const node = document.createElementNS(SVG, name)\n  for (const [key, value] of Object.entries(attrs)) node.setAttribute(key, String(value))\n  return node\n}\n\nconst px = (value: number) => Math.round(value * 100) / 100\n\nconst finite = (value: number | undefined, fallback: number, min: number, max: number) =>\n  value !== undefined && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : fallback\n\nexport function glowHighlight(\n  root: HTMLElement,\n  options: GlowHighlightOptions = {},\n): GlowHighlightControls {\n  const foundLayer = root.querySelector<HTMLElement>('[data-kida-glow-layer]')\n  const defs = root.querySelector<SVGSVGElement>('[data-kida-glow-defs]')\n  if (!foundLayer || !defs) throw new Error('glowHighlight: missing layer or defs markup')\n  const layer: HTMLElement = foundLayer\n\n  let finish: GlowHighlightFinish = options.finish ?? 'glow'\n  let spread = finite(options.spread, 1, 0, 3)\n  let duration = finite(options.duration, 600, 0, Number.POSITIVE_INFINITY)\n  const trigger = options.trigger ?? 'view'\n\n  const id = `kida-glow-${++nextId}`\n  // The region is set in pixels around the layer's box (see fitRegion). The rings paint\n  // outside the text without enlarging any box, so they never cause page overflow.\n  const filter = el('filter', {\n    id,\n    filterUnits: 'userSpaceOnUse',\n    'color-interpolation-filters': 'sRGB',\n  })\n  defs.append(filter)\n  layer.style.filter = `url(#${id})`\n  // Links or buttons inside the copy must not be focused twice. Set here rather than in markup\n  // because React 18 and 19 serialize `inert` differently; until now the copy was\n  // `visibility: hidden`, which also keeps it out of the tab order.\n  layer.inert = true\n\n  let rings: RingNodes[] = []\n  let fontSize = 0\n  let progress = trigger === 'manual' && options.active ? 1 : 0\n  let target = progress\n  let frame = 0\n  let last = 0\n\n  function build() {\n    filter.replaceChildren()\n    rings = []\n    const specs = glowRingsPx(finish, fontSize, spread)\n    const merge = el('feMerge', {})\n    specs.forEach((spec, i) => {\n      // Grow past the ring, round the square corners feMorphology leaves (blur, then a steep\n      // threshold at 50%), and only then shrink back. Rounding while oversized keeps the\n      // bridges that close counters, word spaces and line gaps; rounding after the shrink\n      // would cut them again.\n      const morph = el('feMorphology', { in: 'SourceAlpha', operator: 'dilate', radius: 0 })\n      morph.setAttribute('result', `m${i}`)\n      const round = el('feGaussianBlur', { in: `m${i}`, stdDeviation: 0, result: `r${i}` })\n      const threshold = el('feComponentTransfer', { in: `r${i}`, result: `t${i}` })\n      threshold.append(el('feFuncA', { type: 'linear', slope: 24, intercept: -11.5 }))\n      const close = el('feMorphology', { in: `t${i}`, operator: 'erode', radius: 0 })\n      close.setAttribute('result', `e${i}`)\n      // The square erode kernel leaves boxy notches; a light second rounding removes them\n      // without cutting the much wider bridges.\n      const smooth = el('feGaussianBlur', { in: `e${i}`, stdDeviation: 0, result: `b${i}` })\n      const edge = el('feComponentTransfer', { in: `b${i}`, result: `n${i}` })\n      edge.append(el('feFuncA', { type: 'linear', slope: 24, intercept: -11.5 }))\n      filter.append(morph, round, threshold, close, smooth, edge)\n\n      let shape = `n${i}`\n      if (spec.soft > 0) {\n        filter.append(\n          el('feGaussianBlur', { in: shape, stdDeviation: px(spec.soft), result: `s${i}` }),\n        )\n        shape = `s${i}`\n      }\n      if (spec.dy) {\n        filter.append(el('feOffset', { in: shape, dy: px(spec.dy), result: `o${i}` }))\n        shape = `o${i}`\n      }\n      const flood = el('feFlood', { 'flood-opacity': 0, result: `f${i}` })\n      flood.style.setProperty('flood-color', `var(${spec.color})`)\n      filter.append(\n        flood,\n        el('feComposite', { in: `f${i}`, in2: shape, operator: 'in', result: `c${i}` }),\n      )\n      rings.push({ spec, morph, close, round, smooth, flood })\n    })\n    // Outermost ring underneath, core on top.\n    for (let i = specs.length - 1; i >= 0; i--) merge.append(el('feMergeNode', { in: `c${i}` }))\n    filter.append(merge)\n  }\n\n  function render() {\n    layer.style.visibility = progress > 0 ? 'visible' : 'hidden'\n    if (progress <= 0) return\n    rings.forEach(({ spec, ...nodes }, i) => {\n      const { grow, alpha } = ringFrame(progress, i, rings.length)\n      const radius = spec.radius * grow\n      const em = fontSize * Math.min(1, grow)\n      const cx = GLOW_CLOSING.x * em\n      const cy = GLOW_CLOSING.y * em\n      nodes.morph.setAttribute('radius', `${px(radius + cx)} ${px(radius + cy)}`)\n      nodes.close.setAttribute('radius', `${px(cx)} ${px(cy)}`)\n      nodes.smooth.setAttribute('stdDeviation', String(px(Math.max(0.3, cx * 0.4))))\n      nodes.round.setAttribute('stdDeviation', String(px(Math.max(0.3, radius * ROUNDING))))\n      nodes.flood.setAttribute('flood-opacity', String(px(spec.opacity * alpha)))\n    })\n  }\n\n  function settleState() {\n    root.dataset.state =\n      progress === target ? (target === 1 ? 'on' : 'off') : target === 1 ? 'entering' : 'leaving'\n  }\n\n  function tick(now: number) {\n    // A hidden tab pauses rAF; clamp so returning does not count the whole absence twice.\n    const elapsed = Math.min(now - last, 100)\n    last = now\n    progress = stepProgress(progress, target, elapsed, duration)\n    render()\n    settleState()\n    frame = progress === target ? 0 : requestAnimationFrame(tick)\n  }\n\n  function jump() {\n    cancelAnimationFrame(frame)\n    frame = 0\n    progress = target\n    render()\n    settleState()\n  }\n\n  function setActive(active: boolean) {\n    target = active ? 1 : 0\n    if (prefersReducedMotion() || duration <= 0) {\n      jump()\n      return\n    }\n    if (!frame && progress !== target) {\n      last = performance.now()\n      frame = requestAnimationFrame(tick)\n    }\n    settleState()\n  }\n\n  /**\n   * Sizes the filter region to the furthest ring plus the closing grow, which happens before\n   * the shrink and would be clipped by a tighter region. Smaller than a percentage region on\n   * long phrases, so there are fewer pixels to filter.\n   */\n  function fitRegion() {\n    const reach =\n      Math.max(0, ...rings.map(({ spec }) => spec.radius + spec.soft * 3 + Math.abs(spec.dy))) +\n      (Math.max(GLOW_CLOSING.x, GLOW_CLOSING.y) + 0.1) * fontSize +\n      4\n    filter.setAttribute('x', String(px(-reach)))\n    filter.setAttribute('y', String(px(-reach)))\n    filter.setAttribute('width', String(px(layer.offsetWidth + reach * 2)))\n    filter.setAttribute('height', String(px(layer.offsetHeight + reach * 2)))\n  }\n\n  function measure() {\n    const next = Number.parseFloat(getComputedStyle(root).fontSize)\n    if (next !== fontSize) {\n      fontSize = next\n      build()\n      render()\n    }\n    fitRegion()\n  }\n\n  measure()\n  settleState()\n\n  // Font size can change with the viewport (clamp(), container queries), and wrapping changes\n  // the box the region surrounds; either way the root resizes.\n  const resize = new ResizeObserver(measure)\n  resize.observe(root)\n\n  // Turning reduced motion on mid-flight settles immediately instead of finishing the growth.\n  const cleanups: Array<() => void> = [\n    () => resize.disconnect(),\n    watchReducedMotion((reduced) => {\n      if (reduced && frame) jump()\n    }),\n  ]\n\n  if (trigger === 'view') {\n    const once = options.once ?? true\n    const io = new IntersectionObserver(\n      (entries) => {\n        if (entries.some((entry) => entry.isIntersecting)) {\n          setActive(true)\n          if (once) io.disconnect()\n        } else if (!once) {\n          setActive(false)\n        }\n      },\n      { threshold: finite(options.amount, 0.6, 0, 1) },\n    )\n    io.observe(root)\n    cleanups.push(() => io.disconnect())\n  }\n\n  if (trigger === 'hover') {\n    // Highlights inside links and buttons respond to the control, not just the word.\n    const host = root.closest<HTMLElement>('a, button, label, summary, [tabindex]') ?? root\n    let hovered = false\n    let focused = false\n    const sync = () => setActive(hovered || focused)\n    const enter = () => {\n      hovered = true\n      sync()\n    }\n    const leave = () => {\n      hovered = false\n      sync()\n    }\n    const focus = () => {\n      focused = true\n      sync()\n    }\n    const blur = () => {\n      focused = false\n      sync()\n    }\n    host.addEventListener('pointerenter', enter)\n    host.addEventListener('pointerleave', leave)\n    host.addEventListener('focusin', focus)\n    host.addEventListener('focusout', blur)\n    cleanups.push(() => {\n      host.removeEventListener('pointerenter', enter)\n      host.removeEventListener('pointerleave', leave)\n      host.removeEventListener('focusin', focus)\n      host.removeEventListener('focusout', blur)\n    })\n  }\n\n  return {\n    setActive,\n    update(next) {\n      const nextFinish = next.finish ?? finish\n      const nextSpread = finite(next.spread, spread, 0, 3)\n      const rebuild = nextFinish !== finish || nextSpread !== spread\n      finish = nextFinish\n      spread = nextSpread\n      duration = finite(next.duration, duration, 0, Number.POSITIVE_INFINITY)\n      if (rebuild) {\n        build()\n        render()\n        fitRegion()\n      }\n    },\n    destroy() {\n      cancelAnimationFrame(frame)\n      frame = 0\n      for (const cleanup of cleanups) cleanup()\n      filter.remove()\n      layer.style.removeProperty('filter')\n      layer.style.removeProperty('visibility')\n      layer.inert = false\n      root.dataset.state = 'off'\n    },\n  }\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/vue/kida/glow-highlight-math.motion.ts",
      "content": "/**\n * Pure geometry and timing for GlowHighlight. No DOM, so it is unit-testable.\n *\n * A glow is a stack of rings traced around the glyphs. Each ring is the text's alpha grown\n * outward by `radius`, rounded, then softened by `soft`. Lengths are in em so the effect\n * follows the font size; the engine converts them to CSS pixels for the SVG filter.\n */\n\nexport type GlowHighlightFinish = 'glow' | 'sticker' | 'halo'\n\nexport type GlowHighlightPalette = 'candy' | 'sorbet' | 'berry' | 'after-dark'\n\nexport interface GlowPaletteColors {\n  core: string\n  rim: string\n  band: string\n  fringe: string\n}\n\n/**\n * Named colour sets. The stylesheet applies them through `data-palette`; these values mirror\n * it for tooling and docs, and a test keeps the two identical. Candy is the default.\n */\nexport const GLOW_PALETTES: Record<GlowHighlightPalette, GlowPaletteColors> = {\n  candy: { core: '#e94f86', rim: '#ffe1ec', band: '#ffd76a', fringe: '#ff8a3d' },\n  sorbet: { core: '#ffb07a', rim: '#fff0e4', band: '#ffd76a', fringe: '#e94f86' },\n  berry: { core: '#cdbdff', rim: '#f6f1ff', band: '#f9a8c9', fringe: '#e94f86' },\n  // Deeper core so light text keeps its contrast on dark surfaces.\n  'after-dark': { core: '#8f2350', rim: '#c23a6e', band: '#ffd76a', fringe: '#ff8a3d' },\n}\n\nexport interface GlowRing {\n  /** Custom property that supplies the ring colour. */\n  color: string\n  /** Distance grown outward from the glyph edge, in em. */\n  radius: number\n  /** Edge blur, in em. `0` keeps a crisp, die-cut edge. */\n  soft: number\n  /** Peak opacity of the ring. */\n  opacity: number\n  /** Vertical offset, in em. Used for the sticker's paper shadow. */\n  dy?: number\n}\n\n/** Rings from the innermost (drawn on top) to the outermost (drawn underneath). */\nexport const GLOW_RINGS: Record<GlowHighlightFinish, readonly GlowRing[]> = {\n  // Closest to the reference: a filled core, a pale rim, then warmer bands that soften outward.\n  glow: [\n    { color: '--kida-glow-core', radius: 0.075, soft: 0.005, opacity: 1 },\n    { color: '--kida-glow-rim', radius: 0.11, soft: 0.006, opacity: 1 },\n    { color: '--kida-glow-band', radius: 0.17, soft: 0.014, opacity: 1 },\n    { color: '--kida-glow-fringe', radius: 0.225, soft: 0.045, opacity: 0.95 },\n  ],\n  // Cut-paper: crisp edges and a small, hard shadow instead of an ambient glow.\n  sticker: [\n    { color: '--kida-glow-core', radius: 0.07, soft: 0, opacity: 1 },\n    { color: '--kida-glow-rim', radius: 0.11, soft: 0, opacity: 1 },\n    { color: '--kida-glow-fringe', radius: 0.145, soft: 0, opacity: 1 },\n    { color: '--kida-glow-shadow', radius: 0.145, soft: 0.006, opacity: 1, dy: 0.045 },\n  ],\n  // No fill behind the letters: a quiet light that stays legible inside body copy.\n  halo: [\n    { color: '--kida-glow-rim', radius: 0.05, soft: 0.05, opacity: 0.95 },\n    { color: '--kida-glow-band', radius: 0.11, soft: 0.08, opacity: 0.8 },\n    { color: '--kida-glow-fringe', radius: 0.18, soft: 0.12, opacity: 0.55 },\n  ],\n}\n\n/**\n * Extra grow-then-shrink, in em, so the core reads as one shape. Horizontally it closes\n * counters and word spaces but keeps the notches that make the outline follow the letters.\n * Vertically it is larger to bridge the line gap of wrapped text; otherwise the core joins\n * only where ascenders and descenders reach across and the rim shows through as holes.\n */\nexport const GLOW_CLOSING = { x: 0.14, y: 0.3 } as const\n\n/** The ring furthest from the glyphs, including blur. Used to size the filter region. */\nexport function glowExtent(finish: GlowHighlightFinish, spread = 1): number {\n  return Math.max(\n    ...GLOW_RINGS[finish].map((ring) => ring.radius * spread + ring.soft * 3 + (ring.dy ?? 0)),\n  )\n}\n\nexport interface GlowRingPx {\n  color: string\n  radius: number\n  soft: number\n  opacity: number\n  dy: number\n}\n\n/** Converts the em-based rings to CSS pixels for a font size and spread multiplier. */\nexport function glowRingsPx(\n  finish: GlowHighlightFinish,\n  fontSize: number,\n  spread = 1,\n): GlowRingPx[] {\n  return GLOW_RINGS[finish].map((ring) => ({\n    color: ring.color,\n    radius: ring.radius * spread * fontSize,\n    soft: ring.soft * Math.sqrt(spread) * fontSize,\n    opacity: ring.opacity,\n    dy: (ring.dy ?? 0) * fontSize,\n  }))\n}\n\nexport const clamp01 = (value: number) => Math.min(1, Math.max(0, value))\n\n/** Ease-out with a small overshoot. `overshoot` 1.2 peaks at roughly 5%. */\nexport function easeOutBack(x: number, overshoot = 1.2): number {\n  const t = x - 1\n  return 1 + (overshoot + 1) * t * t * t + overshoot * t * t\n}\n\nconst easeOutCubic = (x: number) => 1 - (1 - x) ** 3\n\n/** Fraction of the timeline between one ring starting and the next. */\nexport const GLOW_STAGGER = 0.14\n\n/** The slice of the 0..1 timeline in which ring `index` grows. Inner rings lead. */\nexport function ringWindow(index: number, count: number, stagger = GLOW_STAGGER) {\n  const length = 1 - stagger * Math.max(0, count - 1)\n  const start = stagger * index\n  return { start, end: start + length }\n}\n\nexport interface RingFrame {\n  /** Multiplier on the ring radius. Overshoots slightly past 1 while growing. */\n  grow: number\n  /** Multiplier on the ring opacity, 0..1. */\n  alpha: number\n}\n\n/**\n * The state of one ring at timeline position `progress`.\n *\n * The mapping is a pure function of progress, so reversing mid-flight is just moving progress\n * the other way: the outer rings collapse first and the glow folds back into the letters.\n */\nexport function ringFrame(progress: number, index: number, count: number): RingFrame {\n  const { start, end } = ringWindow(index, count)\n  const local = clamp01((progress - start) / (end - start))\n  return {\n    grow: local === 0 ? 0 : easeOutBack(local),\n    alpha: easeOutCubic(clamp01(local / 0.55)),\n  }\n}\n\n/** Advances progress linearly toward `target` at a rate set by `duration` (ms). */\nexport function stepProgress(\n  progress: number,\n  target: number,\n  elapsed: number,\n  duration: number,\n): number {\n  if (duration <= 0) return target\n  const delta = elapsed / duration\n  return target > progress ? Math.min(target, progress + delta) : Math.max(target, progress - delta)\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/vue/kida/reduced-motion.motion.ts",
      "content": "const QUERY = '(prefers-reduced-motion: reduce)'\n\n/**\n * Whether the user has asked for reduced motion.\n *\n * SSR-safe: returns `false` when there is no `window`, matching the CSS default\n * (the `prefers-reduced-motion` media query in `@kida-ui/styles` is the real guard;\n * this is for the JS-driven paths that CSS cannot express).\n */\nexport function prefersReducedMotion(): boolean {\n  if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false\n  return window.matchMedia(QUERY).matches\n}\n\n/**\n * Subscribe to changes of the reduced-motion preference.\n * Returns an unsubscribe function. No-op (and immediately unsubscribable) on the server.\n */\nexport function watchReducedMotion(onChange: (reduced: boolean) => void): () => void {\n  if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return () => {}\n\n  const list = window.matchMedia(QUERY)\n  const handler = (event: MediaQueryListEvent) => onChange(event.matches)\n  list.addEventListener('change', handler)\n  return () => list.removeEventListener('change', handler)\n}\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "kida": {
      "package": {
        "name": "@kida-ui/vue",
        "exportName": "GlowHighlight",
        "styleImports": [
          "@kida-ui/styles/components/glow-highlight.css"
        ]
      },
      "framework": "vue"
    }
  },
  "categories": [
    "decorative"
  ],
  "type": "registry:ui"
}
