{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shift","title":"Shift","description":"One card for where your visitors come from, three ways to read it. Switch between List, Bars and Change and every bar, icon and number moves to its new place instead of redrawing, so you never lose the source you were looking at.","type":"registry:component","author":"Detent","dependencies":["motion"],"registryDependencies":["https://detentui.com/r/theme.json"],"files":[{"path":"components/detent/components/shift/Shift.tsx","target":"components/detent/components/shift/Shift.tsx","type":"registry:component","content":"'use client'\n\nimport { memo, useId, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport type { CSSProperties, KeyboardEvent, PointerEvent as ReactPointerEvent, ReactNode } from 'react'\nimport { LayoutGroup, MotionConfig, motion, useReducedMotion } from 'motion/react'\nimport { RollingText } from '@/components/detent/ui/RollingText'\n\nexport type ShiftItem = { id: string; label: string; value: number; delta?: number; icon: ReactNode }\nexport type ShiftView = 'list' | 'bars' | 'change'\n\nconst VIEWS: { id: ShiftView; label: string }[] = [\n  { id: 'list', label: 'List' },\n  { id: 'bars', label: 'Bars' },\n  { id: 'change', label: 'Change' },\n]\n\nconst MOVE = { type: 'spring', stiffness: 250, damping: 30, mass: 0.9 } as const\nconst FILL = 'bg-[light-dark(#f1f1f3,#2e2e33)]'\nconst FILL_LEAD = 'bg-[light-dark(#e2e2e7,#3c3c42)]'\nconst FILL_ON = 'group-data-[on]:bg-[light-dark(#d6d6dc,#4a4a51)]'\nconst UP = 'text-[light-dark(#16a34a,#4ade80)]'\nconst DOWN = 'text-[light-dark(#dc2626,#f87171)]'\nconst ROW = 33\nconst GAP = 5\n\nconst count = (n: number) => n.toLocaleString('en-US')\nconst lag = (i: number) => ({ ...MOVE, delay: i * 0.03 })\nconst signed = (d: number) => `${d > 0 ? '+' : d < 0 ? '−' : ''}${Math.abs(d).toFixed(1)}%`\n\ntype Focus = { get: () => string | null; set: (id: string | null) => void; leave: (id: string) => void; sub: (fn: () => void) => () => void }\n\nfunction makeFocus(): Focus {\n  let id: string | null = null\n  let t: ReturnType<typeof setTimeout> | undefined\n  const fns = new Set<() => void>()\n  const set = (next: string | null) => {\n    clearTimeout(t)\n    if (next === id) return\n    id = next\n    fns.forEach((fn) => fn())\n  }\n  return {\n    get: () => id,\n    set,\n    leave: (from) => {\n      clearTimeout(t)\n      t = setTimeout(() => id === from && set(null), 120)\n    },\n    sub: (fn) => (fns.add(fn), () => void fns.delete(fn)),\n  }\n}\n\nconst useFocused = (focus: Focus) => useSyncExternalStore(focus.sub, focus.get, () => null)\n\nconst Other = () => (\n  <svg viewBox=\"0 0 16 16\" aria-hidden fill=\"light-dark(#71717a,#a1a1aa)\">\n    <circle cx=\"3.5\" cy=\"8\" r=\"1.5\" />\n    <circle cx=\"8\" cy=\"8\" r=\"1.5\" />\n    <circle cx=\"12.5\" cy=\"8\" r=\"1.5\" />\n  </svg>\n)\n\nexport function Shift({\n  title,\n  items,\n  period,\n  unit = 'visitors',\n  delta,\n  limit = 6,\n  view: controlled,\n  defaultView = 'list',\n  onViewChange,\n  format = count,\n}: {\n  title: string\n  items: ShiftItem[]\n  period?: string\n  unit?: string\n  delta?: number\n  limit?: number\n  view?: ShiftView\n  defaultView?: ShiftView\n  onViewChange?: (view: ShiftView) => void\n  format?: (n: number) => string\n}) {\n  const [own, setOwn] = useState<ShiftView>(defaultView)\n  const view = controlled ?? own\n  const [focus] = useState(makeFocus)\n  const reduce = !!useReducedMotion()\n  const scope = useId()\n\n  const data = useMemo(() => {\n    const sorted = items.filter((i) => i.value > 0).sort((a, b) => b.value - a.value)\n    const keep = Math.max(2, limit)\n    const rows =\n      sorted.length > keep\n        ? [...sorted.slice(0, keep - 1), { id: '__other', label: `${sorted.length - keep + 1} more`, value: sorted.slice(keep - 1).reduce((s, i) => s + i.value, 0), icon: <Other /> }]\n        : sorted\n    const sum = rows.reduce((s, i) => s + i.value, 0)\n    return { rows, sum, total: sum || 1, max: rows[0]?.value || 1 }\n  }, [items, limit])\n\n  const pct = useMemo(() => (v: number) => `${((v / data.total) * 100).toFixed(v / data.total < 0.1 ? 1 : 0)}%`, [data.total])\n  const area = Math.max(180, data.rows.length * (ROW + GAP) - GAP)\n  const ctx = useMemo(() => ({ items: data.rows, scope, max: data.max, total: data.total, pct, format, focus, area, reduce }), [data, scope, pct, format, focus, area, reduce])\n\n  const set = (v: ShiftView) => {\n    focus.set(null)\n    if (!controlled) setOwn(v)\n    onViewChange?.(v)\n  }\n\n  return (\n    <MotionConfig transition={reduce ? { duration: 0 } : MOVE}>\n      <div className=\"w-full max-w-[380px] rounded-[22px] bg-[light-dark(#f4f4f5,#1c1c1f)] p-1.5 shadow-[0_0_0_1px_light-dark(rgb(0_0_0/.06),rgb(255_255_255/.06))]\">\n        <div className=\"flex items-center justify-between gap-3 py-1 pl-3 pr-0.5\">\n          <h3 className=\"truncate text-[13px] font-medium text-ink\">{title}</h3>\n          <Switch view={view} set={set} scope={scope} />\n        </div>\n        <div className=\"rounded-[16px] bg-surface px-4 pb-4 pt-3.5 shadow-[0_0_0_0.5px_light-dark(rgb(0_0_0/.09),rgb(255_255_255/.08)),0_1px_2px_rgb(0_0_0/.04),0_8px_24px_-12px_rgb(0_0_0/.12)] max-[360px]:px-3\">\n          <Head focus={focus} items={data.rows} total={data.sum} unit={unit} period={period} delta={delta} pct={pct} format={format} still={reduce} />\n          {data.rows.length === 0 ? (\n            <div className=\"grid place-items-center text-[12.5px] text-ink-3\" style={{ height: area }}>\n              No {unit} yet\n            </div>\n          ) : (\n            <LayoutGroup id={scope}>\n              <div role=\"group\" aria-label={`${title}, ${view} view`} className=\"relative\" style={{ height: area }}>\n                {view === 'list' && <List {...ctx} />}\n                {view === 'bars' && <Bars {...ctx} />}\n                {view === 'change' && <Change {...ctx} />}\n              </div>\n            </LayoutGroup>\n          )}\n        </div>\n      </div>\n    </MotionConfig>\n  )\n}\n\nfunction Head({ focus, items, total, unit, period, delta, pct, format, still }: { focus: Focus; items: ShiftItem[]; total: number; unit: string; period?: string; delta?: number; pct: (v: number) => string; format: (n: number) => string; still: boolean }) {\n  const id = useFocused(focus)\n  const on = items.find((i) => i.id === id)\n  const shown = on ? on.delta : delta\n  return (\n    <div className=\"mb-4 flex items-end justify-between gap-3\">\n      <p className=\"flex min-w-0 items-baseline gap-1.5\">\n        <span className=\"text-[26px] font-semibold leading-none tracking-[-0.03em] text-ink\">\n          <RollingText text={format(on ? on.value : total)} proportional still={still} />\n        </span>\n        <span className=\"truncate text-[12.5px] text-ink-3\">{on ? `from ${on.label}` : unit}</span>\n      </p>\n      <p className=\"flex shrink-0 items-center gap-2 pb-0.5 text-[12px]\">\n        {shown !== undefined && <span className={shown >= 0 ? UP : DOWN}>{signed(shown)}</span>}\n        <span className=\"text-ink-3 max-[360px]:hidden\">{on ? `${pct(on.value)} of ${unit}` : period}</span>\n      </p>\n    </div>\n  )\n}\n\ntype Ctx = { items: ShiftItem[]; scope: string; max: number; total: number; pct: (v: number) => string; format: (n: number) => string; focus: Focus; area: number; reduce: boolean }\n\nfunction Hit({ focus, item, pct, format, className, style, children }: { focus: Focus; item: ShiftItem; pct: (v: number) => string; format: (n: number) => string; className: string; style?: CSSProperties; children: ReactNode }) {\n  const on = useFocused(focus) === item.id\n  const touch = useRef(false)\n  const step = (e: KeyboardEvent<HTMLButtonElement>) => {\n    const keys: Record<string, number> = { ArrowDown: 1, ArrowRight: 1, ArrowUp: -1, ArrowLeft: -1 }\n    if (!(e.key in keys)) return\n    e.preventDefault()\n    const all = [...(e.currentTarget.closest('[role=group]')?.querySelectorAll<HTMLButtonElement>('[data-hit]') ?? [])]\n    all[(all.indexOf(e.currentTarget) + keys[e.key] + all.length) % all.length]?.focus()\n  }\n  return (\n    <button\n      type=\"button\"\n      data-hit\n      data-on={on || undefined}\n      aria-pressed={on}\n      aria-label={`${item.label}, ${format(item.value)}, ${pct(item.value)}`}\n      onPointerEnter={(e: ReactPointerEvent) => e.pointerType === 'mouse' && focus.set(item.id)}\n      onPointerLeave={(e: ReactPointerEvent) => e.pointerType === 'mouse' && focus.get() === item.id && focus.leave(item.id)}\n      onPointerDown={(e: ReactPointerEvent) => (touch.current = e.pointerType !== 'mouse')}\n      onClick={() => focus.set(touch.current && on ? null : item.id)}\n      onFocus={(e) => e.currentTarget.matches(':focus-visible') && focus.set(item.id)}\n      onBlur={() => focus.get() === item.id && focus.set(null)}\n      onKeyDown={step}\n      className={`group cursor-default text-left outline-none [-webkit-tap-highlight-color:transparent] ${className}`}\n      style={style}\n    >\n      {children}\n    </button>\n  )\n}\n\nfunction Shape({ id, i, scope, className, style }: { id: string; i: number; scope: string; className: string; style?: CSSProperties }) {\n  return <motion.span layoutId={`${scope}-shape-${id}`} transition={lag(i)} className={`absolute ${className}`} style={{ borderRadius: 8, ...style }} />\n}\n\nfunction Ring({ radius = 8 }: { radius?: number }) {\n  return <span aria-hidden className=\"pointer-events-none absolute inset-0 opacity-0 shadow-[inset_0_0_0_1px_light-dark(rgb(0_0_0/.1),rgb(255_255_255/.12))] transition-opacity ease-detent duration-150 group-focus-visible:opacity-100 group-focus-visible:shadow-[inset_0_0_0_2px_var(--dt-accent,#3b82f6)]\" style={{ borderRadius: radius }} />\n}\n\nfunction Icon({ item, i, scope }: { item: ShiftItem; i: number; scope: string }) {\n  return (\n    <motion.span\n      layout=\"position\"\n      layoutId={`${scope}-icon-${item.id}`}\n      transition={lag(i)}\n      aria-hidden\n      className=\"relative grid size-[22px] shrink-0 place-items-center rounded-[6px] bg-[light-dark(#fff,#2a2a2e)] shadow-[0_0_0_0.5px_light-dark(rgb(0_0_0/.12),rgb(255_255_255/.1)),0_1px_1.5px_rgb(0_0_0/.06)] [&_svg]:size-[13px]\"\n    >\n      {item.icon}\n    </motion.span>\n  )\n}\n\nfunction Label({ item, i, scope, className = '' }: { item: ShiftItem; i: number; scope: string; className?: string }) {\n  return (\n    <motion.span layout=\"position\" layoutId={`${scope}-label-${item.id}`} transition={lag(i)} initial={{ opacity: 0 }} animate={{ opacity: 1 }} aria-hidden className={`relative min-w-0 truncate text-[13px] text-ink ${className}`}>\n      {item.label}\n    </motion.span>\n  )\n}\n\nfunction Value({ item, i, scope, text, still, className = '', style }: { item: ShiftItem; i: number; scope: string; text: string; still: boolean; className?: string; style?: CSSProperties }) {\n  return (\n    <motion.span layout=\"position\" layoutId={`${scope}-value-${item.id}`} transition={lag(i)} aria-hidden style={style} className={`relative flex shrink-0 items-center whitespace-nowrap text-[13px] leading-none text-ink ${className}`}>\n      <RollingText text={text} proportional still={still} />\n    </motion.span>\n  )\n}\n\nconst List = memo(function List({ items, scope, max, format, pct, focus, reduce }: Ctx) {\n  return (\n    <div className=\"flex h-full flex-col\" style={{ gap: GAP }}>\n      {items.map((item, i) => (\n        <Hit key={item.id} focus={focus} item={item} pct={pct} format={format} className=\"relative flex shrink-0 items-center gap-2.5 px-1.5\" style={{ height: ROW }}>\n          <Shape id={item.id} i={i} scope={scope} className={`inset-y-0 left-0 transition-colors ease-detent duration-150 ${i === 0 ? FILL_LEAD : FILL} ${FILL_ON}`} style={{ width: `${Math.max(12, (item.value / max) * 100)}%` }} />\n          <Ring />\n          <Icon item={item} i={i} scope={scope} />\n          <Label item={item} i={i} scope={scope} />\n          <span className=\"flex-1\" />\n          {item.delta !== undefined && (\n            <motion.span aria-hidden initial={{ opacity: 0 }} animate={{ opacity: 1, transition: { delay: reduce ? 0 : 0.18 + i * 0.03 } }} className={`relative shrink-0 text-[11.5px] tabular-nums max-[340px]:hidden ${item.delta >= 0 ? UP : DOWN}`}>\n              {signed(item.delta)}\n            </motion.span>\n          )}\n          <Value item={item} i={i} scope={scope} text={format(item.value)} still={reduce} className=\"min-w-[46px] justify-end\" />\n        </Hit>\n      ))}\n    </div>\n  )\n})\n\nconst Bars = memo(function Bars({ items, scope, max, pct, format, focus, area, reduce }: Ctx) {\n  const tall = area - 58\n  return (\n    <div className=\"flex h-full items-end gap-2 max-[360px]:gap-1.5\">\n      {items.map((item, i) => (\n        <Hit key={item.id} focus={focus} item={item} pct={pct} format={format} className=\"relative flex h-full min-w-0 flex-1 flex-col items-center justify-end gap-2\">\n          <Value item={item} i={i} scope={scope} text={pct(item.value)} still={reduce} className=\"text-[12px] text-ink-2\" />\n          <span className=\"relative block w-full\" style={{ height: Math.max(8, (item.value / max) * tall) }}>\n            <Shape id={item.id} i={i} scope={scope} className={`inset-0 transition-colors ease-detent duration-150 ${i === 0 ? FILL_LEAD : FILL} ${FILL_ON}`} />\n            <Ring />\n          </span>\n          <Icon item={item} i={i} scope={scope} />\n        </Hit>\n      ))}\n    </div>\n  )\n})\n\nconst GROW = 'bg-[light-dark(oklch(0.93_0.07_150),oklch(0.5_0.1_150/.32))]'\nconst SHRINK = 'bg-[light-dark(oklch(0.93_0.05_25),oklch(0.5_0.12_25/.32))]'\n\nconst Change = memo(function Change({ items, scope, pct, format, focus, reduce }: Ctx) {\n  const rows = [...items].sort((a, b) => (b.delta ?? 0) - (a.delta ?? 0))\n  const up = Math.max(0, ...rows.map((r) => r.delta ?? 0))\n  const down = Math.max(0, ...rows.map((r) => -(r.delta ?? 0)))\n  const room = 0.24\n  const axis = down ? 0.36 : 0\n  const scale = Math.max(up / (1 - axis - room), down ? down / (axis - room) : 0, 1)\n  return (\n    <div className=\"flex h-full flex-col\" style={{ gap: GAP }}>\n      {rows.map((item, i) => {\n        const d = item.delta ?? 0\n        const w = (Math.abs(d) / scale) * 100\n        const pos = d >= 0\n        return (\n          <Hit key={item.id} focus={focus} item={item} pct={pct} format={format} className=\"relative flex shrink-0 items-center gap-2.5 px-1.5\" style={{ height: ROW }}>\n            <Icon item={item} i={i} scope={scope} />\n            <span className=\"relative h-full min-w-0 flex-1\">\n              <span aria-hidden className=\"absolute inset-y-[-3px] w-px bg-[light-dark(rgb(0_0_0/.12),rgb(255_255_255/.14))]\" style={{ left: `${axis * 100}%` }} />\n              <span className=\"absolute inset-y-[5px]\" style={pos ? { left: `${axis * 100}%`, width: `${Math.max(w, 1.5)}%` } : { right: `${(1 - axis) * 100}%`, width: `${Math.max(w, 1.5)}%` }}>\n                <Shape id={item.id} i={i} scope={scope} className={`inset-0 transition-[filter] ease-detent duration-150 group-data-[on]:brightness-95 ${pos ? GROW : SHRINK}`} style={{ borderRadius: 6 }} />\n                <Ring radius={6} />\n              </span>\n              <span className=\"absolute inset-y-0 flex items-center\" style={pos ? { left: `calc(${axis * 100 + Math.max(w, 1.5)}% + 6px)` } : { right: `calc(${(1 - axis) * 100 + Math.max(w, 1.5)}% + 6px)` }}>\n                <Value item={item} i={i} scope={scope} text={item.delta === undefined ? '–' : signed(d)} still={reduce} className=\"text-[12px] font-medium tabular-nums\" style={{ color: item.delta === undefined ? 'var(--color-ink-3)' : pos ? 'light-dark(#16a34a,#4ade80)' : 'light-dark(#dc2626,#f87171)' }} />\n              </span>\n            </span>\n          </Hit>\n        )\n      })}\n    </div>\n  )\n})\n\nfunction Switch({ view, set, scope }: { view: ShiftView; set: (v: ShiftView) => void; scope: string }) {\n  const keys = (e: KeyboardEvent<HTMLButtonElement>) => {\n    const d = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? 1 : e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? -1 : 0\n    if (!d) return\n    e.preventDefault()\n    const next = VIEWS[(VIEWS.findIndex((v) => v.id === view) + d + VIEWS.length) % VIEWS.length]\n    set(next.id)\n    ;(e.currentTarget.parentElement?.querySelector(`[data-view=${next.id}]`) as HTMLElement | null)?.focus()\n  }\n  return (\n    <div role=\"radiogroup\" aria-label=\"View\" className=\"flex shrink-0 gap-0.5 rounded-[10px] p-0.5\">\n      {VIEWS.map((v) => {\n        const on = v.id === view\n        return (\n          <motion.button\n            key={v.id}\n            type=\"button\"\n            role=\"radio\"\n            data-view={v.id}\n            aria-checked={on}\n            aria-label={v.label}\n            tabIndex={on ? 0 : -1}\n            title={v.label}\n            onClick={() => set(v.id)}\n            onKeyDown={keys}\n            whileTap={{ scale: 0.92 }}\n            transition={{ duration: 0.1 }}\n            className={`ring-focus relative grid size-7 place-items-center rounded-[8px] transition-colors ease-detent duration-150 [-webkit-tap-highlight-color:transparent] ${on ? 'text-ink' : 'text-ink-3 hover:text-ink-2'}`}\n          >\n            {on && <motion.span layoutId={`${scope}-switch`} transition={{ type: 'spring', stiffness: 520, damping: 40 }} className=\"absolute inset-0 rounded-[8px] bg-surface shadow-[0_0_0_0.5px_light-dark(rgb(0_0_0/.1),rgb(255_255_255/.1)),0_1px_2px_rgb(0_0_0/.08)]\" />}\n            <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden className=\"relative\" fill=\"currentColor\">\n              {v.id === 'list' && (\n                <>\n                  <rect x=\"2\" y=\"3\" width=\"12\" height=\"2.2\" rx=\"1.1\" />\n                  <rect x=\"2\" y=\"6.9\" width=\"8.5\" height=\"2.2\" rx=\"1.1\" opacity=\".75\" />\n                  <rect x=\"2\" y=\"10.8\" width=\"5\" height=\"2.2\" rx=\"1.1\" opacity=\".5\" />\n                </>\n              )}\n              {v.id === 'bars' && (\n                <>\n                  <rect x=\"2.5\" y=\"2.5\" width=\"2.6\" height=\"11\" rx=\"1.1\" />\n                  <rect x=\"6.7\" y=\"6\" width=\"2.6\" height=\"7.5\" rx=\"1.1\" opacity=\".75\" />\n                  <rect x=\"10.9\" y=\"9.5\" width=\"2.6\" height=\"4\" rx=\"1.1\" opacity=\".5\" />\n                </>\n              )}\n              {v.id === 'change' && (\n                <>\n                  <rect x=\"5.4\" y=\"1.5\" width=\"1.2\" height=\"13\" rx=\".6\" opacity=\".5\" />\n                  <rect x=\"6.6\" y=\"3\" width=\"7.4\" height=\"2.4\" rx=\"1.1\" />\n                  <rect x=\"6.6\" y=\"6.8\" width=\"4.6\" height=\"2.4\" rx=\"1.1\" opacity=\".75\" />\n                  <rect x=\"2\" y=\"10.6\" width=\"3.4\" height=\"2.4\" rx=\"1.1\" opacity=\".5\" />\n                </>\n              )}\n            </svg>\n          </motion.button>\n        )\n      })}\n    </div>\n  )\n}\n"},{"path":"components/detent/ui/RollingText.tsx","target":"components/detent/ui/RollingText.tsx","type":"registry:component","content":"'use client'\n\nimport { useLayoutEffect, useRef, useState } from 'react'\nimport { animate, motion, useMotionValue } from 'motion/react'\n\nconst roll = { type: 'spring', stiffness: 380, damping: 34, mass: 0.8 } as const\n\nexport function RollingText({ text, className = '', proportional = false, still = false }: { text: string; className?: string; proportional?: boolean; still?: boolean }) {\n  const chars = [...text]\n  const probe = useRef<HTMLSpanElement>(null)\n  const [widths, setWidths] = useState<number[] | null>(null)\n\n  useLayoutEffect(() => {\n    if (!proportional || !probe.current) return\n    const read = () => {\n      const box = probe.current!\n      const z = box.offsetWidth ? box.getBoundingClientRect().width / box.offsetWidth : 1\n      const em = parseFloat(getComputedStyle(box).fontSize) || 16\n      setWidths([...box.children].map((c) => (c as HTMLElement).getBoundingClientRect().width / z / em))\n    }\n    read()\n    document.fonts?.ready.then(read)\n  }, [proportional])\n\n  return (\n    <span className={`relative inline-flex ${proportional ? '' : 'tnum'} ${className}`} style={{ lineHeight: '1.25em', height: '1.25em' }}>\n      <span className=\"sr-only\">{text}</span>\n      {proportional && (\n        <span aria-hidden className=\"pointer-events-none absolute left-0 top-0 size-0 overflow-hidden\">\n          <span ref={probe} className=\"invisible flex w-max whitespace-pre\">\n            {Array.from({ length: 10 }, (_, n) => (\n              <span key={n}>{n}</span>\n            ))}\n          </span>\n        </span>\n      )}\n      {chars.map((c, i) => {\n        const key = chars.length - i\n        return /\\d/.test(c) ? (\n          <Digit key={key} d={+c} width={proportional && widths ? widths[+c] : undefined} still={still} />\n        ) : (\n          <span key={`${key}${c}`} aria-hidden className=\"whitespace-pre\">\n            {c}\n          </span>\n        )\n      })}\n    </span>\n  )\n}\n\nfunction Digit({ d, width, still }: { d: number; width?: number; still: boolean }) {\n  const w = useMotionValue<string>(width === undefined ? '1ch' : `${width}em`)\n  const had = useRef(width !== undefined)\n  useLayoutEffect(() => {\n    if (width === undefined) return\n    if (!had.current) {\n      had.current = true\n      w.set(`${width}em`)\n      return\n    }\n    const ctl = animate(w, `${width}em`, roll)\n    return () => ctl.stop()\n  }, [width, w])\n\n  return (\n    <motion.span aria-hidden className=\"relative inline-block overflow-hidden\" style={{ height: '1.25em', width: w }}>\n      <motion.span className=\"absolute inset-x-0 top-0 flex flex-col items-center\" initial={false} animate={{ y: `${-d * 10}%` }} transition={still ? { duration: 0 } : roll}>\n        {Array.from({ length: 10 }, (_, n) => (\n          <span key={n} className=\"block\" style={{ height: '1.25em' }}>\n            {n}\n          </span>\n        ))}\n      </motion.span>\n    </motion.span>\n  )\n}\n"}]}