{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"size-picker","type":"registry:component","title":"Size picker","description":"Pulls a tee over a body outline so you see the fit before you pick the size.","author":"Yash Bavadiya <https://xevrion.dev>","dependencies":["motion"],"registryDependencies":["utils"],"files":[{"path":"components/size-picker.tsx","type":"registry:component","content":"\"use client\";\n\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport {\n  animate,\n  AnimatePresence,\n  motion,\n  useMotionValue,\n  useTransform,\n} from \"motion/react\";\nimport { useReducedMotion } from \"@/hooks/use-reduced-motion\";\nimport { cn } from \"@/lib/utils\";\n\nexport type GarmentSize = {\n  label: string;\n  // Garment measurements in cm: chest is the full circumference, length runs\n  // from the high point of the shoulder to the hem.\n  chest: number;\n  length: number;\n  sleeve: number;\n  inStock: boolean;\n};\n\ntype Unit = \"cm\" | \"in\";\n\n// The morph is the explanation here: you watch the tee grow over the body,\n// so it runs a little longer than a 300ms UI change. A spring keeps its\n// velocity when you tap through sizes quickly.\nconst MORPH = { type: \"spring\", duration: 0.5, bounce: 0.12 } as const;\nconst EASE_OUT = [0.23, 1, 0.32, 1] as const;\nconst ROLL = { type: \"spring\", duration: 0.35, bounce: 0 } as const;\n\n// Drawing scale: viewBox px per cm of garment.\nconst K = 1.6;\nconst CX = 120;\n// High point of the shoulder, where the collar sits.\nconst NECK_Y = 60;\nconst SHOULDER_Y = 67;\n// Sleeves hang out at about 28 degrees from vertical, a little wider than\n// the arms, the way a tee sits on a shoulder.\nconst SLEEVE_DIR = { x: 0.47, y: 0.883 };\n// Garment colour, a physical material: the \"Bone\" colourway.\nconst BONE = \"oklch(0.94 0.018 85)\";\nconst SEAM = \"oklch(0.62 0.03 75)\";\n\nfunction teePath(chest: number, length: number, sleeve: number) {\n  const ch = (chest / 4) * K;\n  const sh = ch + 5;\n  const armpitY = SHOULDER_Y + 32;\n  const hh = ch + 2;\n  const hemY = NECK_Y + length * K;\n  const sl = sleeve * K;\n  const ox = sh + SLEEVE_DIR.x * sl;\n  const oy = SHOULDER_Y + SLEEVE_DIR.y * sl;\n  // Wider tees get wider sleeve openings.\n  const open = 17 + (chest - 96) * 0.12;\n  const ix = ox - SLEEVE_DIR.y * open;\n  const iy = oy + SLEEVE_DIR.x * open;\n  const p = (x: number, y: number) => `${(CX + x).toFixed(2)} ${y.toFixed(2)}`;\n  return [\n    `M${p(-12, NECK_Y)}`,\n    `Q${p(0, NECK_Y + 15)} ${p(12, NECK_Y)}`,\n    `L${p(sh, SHOULDER_Y)}`,\n    `L${p(ox, oy)}`,\n    `L${p(ix, iy)}`,\n    `L${p(ch, armpitY)}`,\n    `L${p(hh, hemY)}`,\n    `Q${p(0, hemY + 4)} ${p(-hh, hemY)}`,\n    `L${p(-ch, armpitY)}`,\n    `L${p(-ix, iy)}`,\n    `L${p(-ox, oy)}`,\n    `L${p(-sh, SHOULDER_Y)}`,\n    \"Z\",\n  ].join(\" \");\n}\n\n// The stitching that makes the outline read as a garment: the rib around\n// the collar, the sleeve hems and the bottom hem, each inset a few px from\n// the edge it finishes. Same maths as teePath, so it morphs in lockstep.\nfunction teeSeams(chest: number, length: number, sleeve: number) {\n  const ch = (chest / 4) * K;\n  const sh = ch + 5;\n  const hh = ch + 2;\n  const hemY = NECK_Y + length * K;\n  const sl = sleeve * K;\n  const ox = sh + SLEEVE_DIR.x * sl;\n  const oy = SHOULDER_Y + SLEEVE_DIR.y * sl;\n  const open = 17 + (chest - 96) * 0.12;\n  const ix = ox - SLEEVE_DIR.y * open;\n  const iy = oy + SLEEVE_DIR.x * open;\n  // Sleeve hem sits 4px up the sleeve from its opening.\n  const bx = SLEEVE_DIR.x * 4;\n  const by = SLEEVE_DIR.y * 4;\n  const p = (x: number, y: number) => `${(CX + x).toFixed(2)} ${y.toFixed(2)}`;\n  return [\n    `M${p(-15, NECK_Y + 0.5)} Q${p(0, NECK_Y + 20)} ${p(15, NECK_Y + 0.5)}`,\n    `M${p(ox - bx, oy - by)} L${p(ix - bx, iy - by)}`,\n    `M${p(-(ox - bx), oy - by)} L${p(-(ix - bx), iy - by)}`,\n    `M${p(-hh + 1, hemY - 5)} Q${p(0, hemY - 1)} ${p(hh - 1, hemY - 5)}`,\n  ].join(\" \");\n}\n\n// One side of the body outline, mirrored for the other, scaled so the\n// torso's half width at chest height is bodyChest / 4 * K.\nfunction bodyPath(chest: number) {\n  const w = (chest / 4) * K;\n  const side = (s: 1 | -1) => {\n    const p = (x: number, y: number) => `${CX + s * x} ${y}`;\n    return [\n      `M${p(7, 47)} L${p(7, 55)}`,\n      `C${p(16, 60)} ${p(w - 2, 59)} ${p(w + 7, 67)}`,\n      `C${p(w + 13, 73)} ${p(w + 15, 84)} ${p(w + 18, 98)}`,\n      `L${p(w + 36, 178)}`,\n      `Q${p(w + 34, 190)} ${p(w + 25, 181)}`,\n      `L${p(w + 7, 112)}`,\n      `C${p(w + 5, 106)} ${p(w + 2, 104)} ${p(w, 106)}`,\n      `C${p(w - 1.5, 130)} ${p(w - 4, 146)} ${p(w - 4, 162)}`,\n      `C${p(w - 3.5, 184)} ${p(w + 1.5, 198)} ${p(w + 1.5, 214)}`,\n      `L${p(w, 250)}`,\n    ].join(\" \");\n  };\n  return `${side(-1)} ${side(1)}`;\n}\n\nfunction fitFor(ease: number) {\n  if (ease < 0) return \"Too snug, pulls across the chest\";\n  if (ease < 4) return \"Fitted, close to the body\";\n  if (ease < 11) return \"Regular, easy through the chest\";\n  if (ease < 19) return \"Relaxed through the chest\";\n  return \"Oversized, drops past the shoulder\";\n}\n\nconst toUnit = (cm: number, unit: Unit) =>\n  unit === \"cm\" ? Math.round(cm) : Math.round(cm / 2.54);\n\nexport function SizePicker({\n  name,\n  price,\n  sizes,\n  bodyChest,\n  defaultSize,\n  onAdd,\n  className,\n}: {\n  name: string;\n  price: string;\n  sizes: GarmentSize[];\n  // The shopper's chest circumference in cm; the outline is drawn for it.\n  bodyChest: number;\n  defaultSize?: string;\n  onAdd?: (size: string) => void;\n  className?: string;\n}) {\n  const reduceMotion = useReducedMotion();\n  const labelId = useId();\n  // The first size with 4 to 11cm of room (a regular fit) is our pick.\n  const suggested =\n    sizes.find((s) => s.chest - bodyChest >= 4 && s.chest - bodyChest < 11)\n      ?.label ?? sizes[0].label;\n  const [selected, setSelected] = useState(defaultSize ?? suggested);\n  const [unit, setUnit] = useState<Unit>(\"cm\");\n  const [notified, setNotified] = useState<string[]>([]);\n  const [added, setAdded] = useState<string | null>(null);\n  const buttons = useRef<(HTMLButtonElement | null)[]>([]);\n\n  const index = Math.max(\n    0,\n    sizes.findIndex((s) => s.label === selected),\n  );\n  const size = sizes[index];\n  const ease = size.chest - bodyChest;\n  const fit = fitFor(ease);\n  const tight = ease < 0;\n\n  // One fractional size index drives the whole silhouette, so an interrupted\n  // morph carries on from wherever it is.\n  const at = useMotionValue(index);\n  useEffect(() => {\n    if (reduceMotion) {\n      at.jump(index);\n      return;\n    }\n    const run = animate(at, index, MORPH);\n    return () => run.stop();\n  }, [at, index, reduceMotion]);\n\n  const measure = (v: number) => {\n    // The spring overshoots a little past the ends; clamp so it never\n    // reads outside the size table.\n    const i = Math.max(0, Math.min(sizes.length - 1, v));\n    const a = sizes[Math.floor(i)];\n    const b = sizes[Math.ceil(i)];\n    const t = i - Math.floor(i);\n    const mix = (k: \"chest\" | \"length\" | \"sleeve\") => a[k] + (b[k] - a[k]) * t;\n    return [mix(\"chest\"), mix(\"length\"), mix(\"sleeve\")] as const;\n  };\n  const d = useTransform(at, (v) => teePath(...measure(v)));\n  const seams = useTransform(at, (v) => teeSeams(...measure(v)));\n\n  const choose = (i: number) => {\n    setSelected(sizes[i].label);\n    setAdded(null);\n  };\n\n  const onKeyDown = (e: React.KeyboardEvent) => {\n    const keys: Record<string, number> = {\n      ArrowRight: index + 1,\n      ArrowDown: index + 1,\n      ArrowLeft: index - 1,\n      ArrowUp: index - 1,\n      Home: 0,\n      End: sizes.length - 1,\n    };\n    if (!(e.key in keys)) return;\n    e.preventDefault();\n    const next = (keys[e.key] + sizes.length) % sizes.length;\n    choose(next);\n    buttons.current[next]?.focus();\n  };\n\n  const isNotified = notified.includes(size.label);\n  const done = size.inStock ? added === size.label : isNotified;\n  const cta = size.inStock\n    ? done\n      ? `Added ${size.label} to bag`\n      : `Add ${size.label} to bag`\n    : done\n      ? `We'll email you when ${size.label} is back`\n      : `Notify me when ${size.label} is back`;\n\n  return (\n    <div\n      className={cn(\n        \"w-[min(460px,100%)] rounded-3xl bg-background p-5 shadow-raised\",\n        className,\n      )}\n    >\n      <div className=\"flex items-baseline justify-between gap-3\">\n        <h3 className=\"text-[15px] font-medium text-foreground\">{name}</h3>\n        <p className=\"text-[15px] text-muted-foreground tabular-nums\">{price}</p>\n      </div>\n\n      <div className=\"mt-3 grid grid-cols-[minmax(0,132px)_minmax(0,1fr)] gap-4 sm:grid-cols-[minmax(0,196px)_minmax(0,1fr)]\">\n        <svg\n          // Cropped to the figure: hands reach x 42 to 198, the head tops out at 18.\n          viewBox=\"30 10 180 240\"\n          className=\"aspect-[180/240] w-full rounded-2xl bg-muted\"\n          role=\"img\"\n          aria-label={`Size ${size.label} tee drawn over a ${bodyChest} cm chest: ${fit.toLowerCase()}`}\n        >\n          {/* The tee is the product, so it wears its real colour in both\n              themes: bone cotton with a slightly darker edge and seams. */}\n          <motion.path\n            d={d}\n            strokeLinejoin=\"round\"\n            strokeWidth={1.5}\n            style={{ fill: BONE }}\n            className={cn(\n              \"transition-[stroke] duration-200 ease-out\",\n              tight ? \"stroke-destructive\" : \"stroke-[oklch(0.5_0.03_70)]\",\n            )}\n          />\n          <motion.path\n            d={seams}\n            fill=\"none\"\n            strokeWidth={0.9}\n            strokeDasharray=\"2 1.6\"\n            strokeLinecap=\"round\"\n            style={{ stroke: SEAM }}\n          />\n          {/* The body sits over the tee, dashed, so the gap between the two\n              lines is the room you get. Where the tee is too small, the body\n              pokes out past it. */}\n          <g\n            className=\"fill-none stroke-muted-foreground\"\n            strokeWidth={1.25}\n            strokeDasharray=\"3 3\"\n            strokeLinecap=\"round\"\n          >\n            <circle cx={CX} cy={32} r={14} />\n            <path d={bodyPath(bodyChest)} />\n          </g>\n        </svg>\n\n        <div className=\"flex min-w-0 flex-col\">\n          <p className=\"text-[13px] text-muted-foreground\">Fits like</p>\n          {/* Tall enough for the longest note (three lines on a phone, two\n              from sm up), so nothing below shifts with the copy. */}\n          <div className=\"relative mt-0.5 h-[60px] sm:h-[42px]\">\n            <AnimatePresence initial={false} mode=\"popLayout\">\n              <motion.p\n                key={fit}\n                initial={\n                  reduceMotion\n                    ? { opacity: 0 }\n                    : { opacity: 0, y: 6, filter: \"blur(4px)\" }\n                }\n                animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n                exit={\n                  reduceMotion\n                    ? { opacity: 0, transition: { duration: 0.12 } }\n                    : {\n                        opacity: 0,\n                        y: -4,\n                        filter: \"blur(2px)\",\n                        transition: { duration: 0.15, ease: EASE_OUT },\n                      }\n                }\n                transition={{ duration: 0.25, ease: EASE_OUT }}\n                className={cn(\n                  \"absolute inset-x-0 top-0 text-[14px] leading-5 sm:text-[15px] sm:leading-[21px] font-medium text-balance\",\n                  tight ? \"text-destructive\" : \"text-foreground\",\n                )}\n              >\n                {fit}\n              </motion.p>\n            </AnimatePresence>\n          </div>\n\n          <dl className=\"mt-2 flex flex-col divide-y divide-border border-y border-border text-sm\">\n            <Row label=\"Chest\" value={toUnit(size.chest, unit)} unit={unit} />\n            <Row label=\"Length\" value={toUnit(size.length, unit)} unit={unit} />\n            <Row\n              label=\"Room\"\n              value={toUnit(Math.abs(ease), unit)}\n              unit={unit}\n              sign={tight ? \"-\" : \"+\"}\n              danger={tight}\n            />\n          </dl>\n\n          <div className=\"mt-auto flex items-center justify-between gap-2 pt-2\">\n            <p className=\"text-[13px] text-muted-foreground\">\n              You: {toUnit(bodyChest, unit)} {unit}\n            </p>\n            <div\n              role=\"group\"\n              aria-label=\"Units\"\n              className=\"flex h-8 shrink-0 rounded-full bg-muted p-0.5\"\n            >\n              {([\"cm\", \"in\"] as const).map((u) => (\n                <button\n                  key={u}\n                  type=\"button\"\n                  aria-pressed={unit === u}\n                  aria-label={u === \"cm\" ? \"Centimetres\" : \"Inches\"}\n                  onClick={() => setUnit(u)}\n                  className={cn(\n                    \"relative h-7 w-9 touch-manipulation rounded-full text-[13px] font-medium outline-hidden transition-[scale,color] duration-150 ease-out select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-foreground active:scale-[0.96]\",\n                    unit === u ? \"text-foreground\" : \"text-muted-foreground\",\n                  )}\n                >\n                  {unit === u && (\n                    <motion.span\n                      layoutId={`${labelId}-unit`}\n                      transition={\n                        reduceMotion\n                          ? { duration: 0 }\n                          : { type: \"spring\", duration: 0.3, bounce: 0 }\n                      }\n                      className=\"absolute inset-0 rounded-full bg-background shadow-raised\"\n                    />\n                  )}\n                  <span className=\"relative\">{u}</span>\n                </button>\n              ))}\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <p id={labelId} className=\"mt-4 text-[13px] text-muted-foreground\">\n        Size <span className=\"text-foreground\">{size.label}</span>\n        {size.label === suggested ? \", our pick for you\" : null}\n        {!size.inStock ? \", sold out\" : null}\n      </p>\n      <div\n        role=\"radiogroup\"\n        aria-labelledby={labelId}\n        onKeyDown={onKeyDown}\n        className=\"mt-2 grid grid-cols-6 gap-1.5\"\n      >\n        {sizes.map((s, i) => {\n          const on = i === index;\n          return (\n            <button\n              key={s.label}\n              ref={(el) => {\n                buttons.current[i] = el;\n              }}\n              type=\"button\"\n              role=\"radio\"\n              aria-checked={on}\n              aria-label={`${s.label}${s.inStock ? \"\" : \", sold out\"}${s.label === suggested ? \", recommended\" : \"\"}`}\n              tabIndex={on ? 0 : -1}\n              onClick={() => choose(i)}\n              className=\"relative h-11 touch-manipulation rounded-xl bg-muted text-sm font-medium outline-hidden transition-[scale] duration-150 ease-out select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-foreground active:scale-[0.96]\"\n            >\n              {on && (\n                <motion.span\n                  layoutId={`${labelId}-size`}\n                  transition={\n                    reduceMotion\n                      ? { duration: 0 }\n                      : { type: \"spring\", duration: 0.3, bounce: 0 }\n                  }\n                  className=\"absolute inset-0 rounded-xl bg-foreground\"\n                />\n              )}\n              <span\n                className={cn(\n                  \"relative transition-[color] duration-150 ease-out\",\n                  on\n                    ? \"text-background\"\n                    : s.inStock\n                      ? \"text-foreground\"\n                      : \"text-muted-foreground\",\n                  !s.inStock && \"line-through\",\n                )}\n              >\n                {s.label}\n              </span>\n              {s.label === suggested && (\n                <span\n                  aria-hidden\n                  className={cn(\n                    \"absolute bottom-1.5 left-1/2 size-1 -translate-x-1/2 rounded-full transition-[background-color] duration-150 ease-out\",\n                    on ? \"bg-background\" : \"bg-foreground\",\n                  )}\n                />\n              )}\n            </button>\n          );\n        })}\n      </div>\n\n      <button\n        type=\"button\"\n        onClick={() => {\n          if (size.inStock) {\n            setAdded(size.label);\n            onAdd?.(size.label);\n          } else {\n            setNotified((n) => [...n, size.label]);\n          }\n        }}\n        aria-disabled={done || undefined}\n        className={cn(\n          \"mt-3 flex h-11 w-full touch-manipulation items-center justify-center overflow-hidden rounded-xl text-sm font-medium outline-hidden transition-[scale,background-color,color,box-shadow] duration-150 ease-out select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-foreground active:scale-[0.96] aria-disabled:pointer-events-none\",\n          size.inStock\n            ? \"bg-foreground text-background\"\n            : \"bg-background text-foreground shadow-raised\",\n        )}\n      >\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          <motion.span\n            key={cta}\n            initial={{ opacity: 0, filter: \"blur(4px)\" }}\n            animate={{ opacity: 1, filter: \"blur(0px)\" }}\n            exit={{\n              opacity: 0,\n              filter: \"blur(2px)\",\n              transition: { duration: 0.12, ease: EASE_OUT },\n            }}\n            transition={{ duration: 0.2, ease: EASE_OUT }}\n            className=\"flex items-center gap-2\"\n          >\n            {done && <Check />}\n            {cta}\n          </motion.span>\n        </AnimatePresence>\n      </button>\n\n      <p className=\"sr-only\" aria-live=\"polite\">\n        {`Size ${size.label}: ${fit}. Chest ${toUnit(size.chest, unit)} ${unit}, length ${toUnit(size.length, unit)} ${unit}.${size.inStock ? \"\" : \" Sold out.\"}`}\n      </p>\n    </div>\n  );\n}\n\nfunction Check() {\n  return (\n    <svg\n      aria-hidden\n      viewBox=\"0 0 16 16\"\n      className=\"size-4\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={2}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <path d=\"M3.5 8.5l3 3 6-7\" />\n    </svg>\n  );\n}\n\nfunction Row({\n  label,\n  value,\n  unit,\n  sign,\n  danger,\n}: {\n  label: string;\n  value: number;\n  unit: Unit;\n  sign?: \"+\" | \"-\";\n  danger?: boolean;\n}) {\n  return (\n    <div className=\"flex h-10 items-center justify-between gap-2\">\n      <dt className=\"text-muted-foreground\">{label}</dt>\n      <dd\n        className={cn(\n          \"flex items-baseline gap-1 tabular-nums transition-[color] duration-200 ease-out\",\n          danger ? \"text-destructive\" : \"text-foreground\",\n        )}\n      >\n        <span className=\"sr-only\">{`${sign === \"-\" ? \"minus \" : \"\"}${value} ${unit}`}</span>\n        <span aria-hidden className=\"inline-flex\">\n          {sign && <span>{sign === \"-\" ? \"−\" : \"+\"}</span>}\n          <RollingNumber value={value} />\n        </span>\n        <span aria-hidden className=\"text-[13px] text-muted-foreground\">\n          {unit}\n        </span>\n      </dd>\n    </div>\n  );\n}\n\nfunction RollingNumber({ value }: { value: number }) {\n  const [previous, setPrevious] = useState(value);\n  const [direction, setDirection] = useState(1);\n  if (value !== previous) {\n    setPrevious(value);\n    setDirection(value > previous ? 1 : -1);\n  }\n  const chars = [...String(value)];\n  return (\n    <span aria-hidden className=\"inline-flex\">\n      {chars.map((char, i) => (\n        // Keyed by place from the right, so 99 to 104 keeps the ones column.\n        <Digit key={chars.length - i} char={char} direction={direction} />\n      ))}\n    </span>\n  );\n}\n\nfunction Digit({ char, direction }: { char: string; direction: number }) {\n  const reduceMotion = useReducedMotion();\n  // Bigger numbers roll up from below, smaller ones drop in from above.\n  const offset = (d: number) => (reduceMotion ? \"0%\" : `${d * 100}%`);\n  return (\n    <span className=\"inline-grid overflow-hidden\">\n      <AnimatePresence initial={false} custom={direction}>\n        <motion.span\n          key={char}\n          custom={direction}\n          variants={{\n            enter: (d: number) => ({ y: offset(d), opacity: 0 }),\n            center: { y: \"0%\", opacity: 1 },\n            exit: (d: number) => ({ y: offset(-d), opacity: 0 }),\n          }}\n          initial=\"enter\"\n          animate=\"center\"\n          exit=\"exit\"\n          transition={ROLL}\n          className=\"col-start-1 row-start-1\"\n        >\n          {char}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n\nconst SIZES: GarmentSize[] = [\n  { label: \"XS\", chest: 90, length: 66, sleeve: 18, inStock: false },\n  { label: \"S\", chest: 97, length: 69, sleeve: 19, inStock: true },\n  { label: \"M\", chest: 104, length: 71, sleeve: 20, inStock: true },\n  { label: \"L\", chest: 111, length: 73, sleeve: 21, inStock: true },\n  { label: \"XL\", chest: 118, length: 75, sleeve: 22, inStock: true },\n  { label: \"XXL\", chest: 126, length: 77, sleeve: 23, inStock: false },\n];\n\nexport default function SizePickerDemo() {\n  return (\n    <SizePicker\n      name=\"Heavyweight Tee, Bone\"\n      price=\"$48\"\n      sizes={SIZES}\n      bodyChest={96}\n      defaultSize=\"L\"\n    />\n  );\n}\n"},{"path":"hooks/use-reduced-motion.ts","type":"registry:hook","target":"hooks/use-reduced-motion.ts","content":"\"use client\";\n\nimport { useSyncExternalStore } from \"react\";\n\n// Motion's useReducedMotion reads the media query on the very first client\n// render, but the server can't know it, so every component that renders\n// differently under reduced motion broke hydration for those users. This\n// reports false during hydration, matching the server HTML, then the real\n// preference straight after, and follows it if it changes.\nconst query = \"(prefers-reduced-motion: reduce)\";\n\nfunction subscribe(onChange: () => void) {\n  const media = window.matchMedia(query);\n  media.addEventListener(\"change\", onChange);\n  return () => media.removeEventListener(\"change\", onChange);\n}\n\nexport function useReducedMotion() {\n  return useSyncExternalStore(\n    subscribe,\n    () => window.matchMedia(query).matches,\n    () => false,\n  );\n}\n"}],"cssVars":{"light":{"shadow-raised":"0 0 0 1px oklch(0 0 0 / 0.06), 0 1px 2px oklch(0 0 0 / 0.06), 0 6px 16px -6px oklch(0 0 0 / 0.12)"},"dark":{"shadow-raised":"0 0 0 1px oklch(1 0 0 / 0.08), 0 1px 2px oklch(0 0 0 / 0.4), 0 6px 16px -6px oklch(0 0 0 / 0.6)"},"theme":{"shadow-raised":"var(--shadow-raised)"}},"categories":["inputs"],"docs":"From ui lab: https://lab.xevrion.dev/lab/size-picker"}