{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "motion",
  "title": "Motion",
  "description": "Shared spring and easing tokens so all animations in the app move the same way.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "registry/lib/motion.ts",
      "content": "import * as React from \"react\"\nimport type { Transition } from \"motion/react\"\n\n/**\n * Motion tokens. The single source for every spring and curve in the app:\n * components never hand-write their own. The CSS mirrors (--ease-*) live in\n * the theme, so Tailwind classes and motion/react stay in sync.\n */\n\n/** ζ≈0.94, no overshoot, settles in ~230ms. Pills, morphs, enter/exit, numbers. */\nexport const SPRING: Transition = { type: \"spring\", stiffness: 350, damping: 35 }\n\n/** ζ≈0.75, ~3% overshoot. Icons only, so they feel a little alive. */\nexport const ICON_SPRING: Transition = { type: \"spring\", stiffness: 350, damping: 28 }\n\n/** ζ≈1, no overshoot, ~30% quicker than SPRING. Rows and panels closing: exits run faster than entries. */\nexport const SPRING_EXIT: Transition = { type: \"spring\", stiffness: 520, damping: 46 }\n\n/** The reduced-motion branch. */\nexport const INSTANT: Transition = { duration: 0 }\n\n/** Seconds between items that animate in sequence (connectors, segments). Keep runs under ~0.3s in total. */\nexport const STAGGER = 0.06\n\n/** Things entering or leaving the screen. */\nexport const EASE_OUT = [0.23, 1, 0.32, 1] as const\n/** Things that move or change shape on screen. */\nexport const EASE_IN_OUT = [0.77, 0, 0.175, 1] as const\n/** Overlays that grow out of their trigger (dialogs, popovers). */\nexport const EASE_REVEAL = [0.33, 1, 0.68, 1] as const\n/** Sheets, drawers, sidebars. */\nexport const EASE_DRAWER = [0.32, 0.72, 0, 1] as const\n\nexport const springOrInstant = (reduce: boolean | null): Transition => (reduce ? INSTANT : SPRING)\n\nconst reducedQuery = \"(prefers-reduced-motion: reduce)\"\nconst subscribeReduced = (onChange: () => void) => {\n  const media = window.matchMedia(reducedQuery)\n  media.addEventListener(\"change\", onChange)\n  return () => media.removeEventListener(\"change\", onChange)\n}\n\n/**\n * The reduced-motion setting, followed live: unlike motion/react's `useReducedMotion`, it\n * re-renders when the setting changes while the page is open. False on the server.\n */\nexport function usePrefersReducedMotion() {\n  return React.useSyncExternalStore(subscribeReduced, () => window.matchMedia(reducedQuery).matches, () => false)\n}\n\n/** Fade timings for content that appears inside an expanding container. */\nexport const FADE_IN: Transition = { duration: 0.15, ease: EASE_OUT }\nexport const FADE_OUT: Transition = { duration: 0.1, ease: EASE_OUT }\n\n/**\n * Dynamic-island morphs only (IslandToaster): springs with bounce, set per transition, more\n * bounce for a smaller target. Nothing else in the app bounces; exits stay on SPRING_EXIT.\n */\nexport const ISLAND_SPRING = {\n  /** From beyond the edge into a small pill. */\n  enter: { type: \"spring\", duration: 0.5, bounce: 0.35 },\n  /** Pill to the open card: a large target, the least bounce. */\n  open: { type: \"spring\", duration: 0.5, bounce: 0.2 },\n  /** Open card back to the pill: a small target, more bounce. */\n  fold: { type: \"spring\", duration: 0.45, bounce: 0.3 },\n  /** Layers shifting in the stack, the list opening and closing. */\n  stack: { type: \"spring\", duration: 0.4, bounce: 0.15 },\n  /** Back into place after a swipe that did not dismiss: the drag applied force. */\n  release: { type: \"spring\", duration: 0.35, bounce: 0.25 },\n} satisfies Record<string, Transition>\n",
      "type": "registry:lib",
      "target": "@lib/motion.ts"
    }
  ],
  "docs": "https://builders.ikas.com/tr/docs/app-development/ui-kit/motion",
  "categories": [
    "motion",
    "utilities"
  ],
  "type": "registry:lib"
}