{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "icon-core",
  "type": "registry:ui",
  "title": "Icon Core",
  "description": "The shared trigger, timing and speed core behind every animated icon.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/prequelui/motion.tsx",
      "type": "registry:lib",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n  MotionConfig,\n  useInView as useMotionInView,\n  type Transition,\n} from \"motion/react\";\nimport { useHydratedReducedMotion } from \"@/lib/use-reduced-motion\";\nimport { cn } from \"@/lib/utils\";\n\nconst TempoContext = React.createContext(1);\n\nexport function PrequelMotionProvider({\n  tempo = 1,\n  children,\n}: {\n  tempo?: number;\n  children: React.ReactNode;\n}) {\n  const value = React.useMemo(() => Math.max(0.4, tempo), [tempo]);\n  return (\n    <TempoContext.Provider value={value}>\n      <MotionConfig reducedMotion=\"user\">{children}</MotionConfig>\n    </TempoContext.Provider>\n  );\n}\n\nexport function useTempo() {\n  return React.useContext(TempoContext);\n}\n\nconst TIME_KEYS = [\n  \"duration\",\n  \"visualDuration\",\n  \"delay\",\n  \"repeatDelay\",\n  \"delayChildren\",\n] as const;\n\nfunction scaleValue(transition: Transition, tempo: number): Transition {\n  if (tempo === 1 || !transition || typeof transition !== \"object\") {\n    return transition;\n  }\n  const next: Record<string, unknown> = {};\n  for (const [key, value] of Object.entries(transition)) {\n    if (typeof value === \"number\" && (TIME_KEYS as readonly string[]).includes(key)) {\n      next[key] = value * tempo;\n    } else if (typeof value === \"number\" && key === \"stiffness\") {\n      next[key] = value / (tempo * tempo);\n    } else if (typeof value === \"number\" && key === \"damping\") {\n      next[key] = value / tempo;\n    } else if (value && typeof value === \"object\" && !Array.isArray(value)) {\n      next[key] = scaleValue(value as Transition, tempo);\n    } else {\n      next[key] = value;\n    }\n  }\n  return next as Transition;\n}\n\nexport function useTempoTransition(transition: Transition) {\n  const tempo = useTempo();\n  return React.useMemo(\n    () => scaleValue(transition, tempo),\n    [tempo, JSON.stringify(transition)],\n  );\n}\n\nexport function useReduceMotion() {\n  return useHydratedReducedMotion();\n}\n\nexport function usePageVisible() {\n  const [visible, setVisible] = React.useState(true);\n  React.useEffect(() => {\n    const update = () => setVisible(!document.hidden);\n    update();\n    document.addEventListener(\"visibilitychange\", update);\n    return () => document.removeEventListener(\"visibilitychange\", update);\n  }, []);\n  return visible;\n}\n\nexport function useMounted() {\n  return React.useSyncExternalStore(\n    () => () => {},\n    () => true,\n    () => false,\n  );\n}\n\nexport function useSeen(\n  ref: React.RefObject<Element | null>,\n  enabled = true,\n  once = true,\n) {\n  const inView = useMotionInView(ref, { once, amount: 0.35 });\n  return enabled ? inView : true;\n}\n\ntype SlotProps = React.HTMLAttributes<HTMLElement> & {\n  children?: React.ReactNode;\n  ref?: React.Ref<HTMLElement>;\n};\n\nexport function Slot({ children, ...props }: SlotProps) {\n  if (!React.isValidElement<Record<string, unknown>>(children)) {\n    return null;\n  }\n  const child = children as React.ReactElement<Record<string, unknown>>;\n  const childProps = child.props;\n  return React.cloneElement(child, {\n    ...props,\n    ...childProps,\n    className: cn(\n      String(props.className ?? \"\"),\n      String(childProps.className ?? \"\"),\n    ),\n    style: {\n      ...((props.style as React.CSSProperties) ?? {}),\n      ...((childProps.style as React.CSSProperties) ?? {}),\n    },\n  } as Record<string, unknown>);\n}\n\nexport function srOnlyStyle(): React.CSSProperties {\n  return {\n    position: \"absolute\",\n    width: 1,\n    height: 1,\n    padding: 0,\n    margin: -1,\n    overflow: \"hidden\",\n    clip: \"rect(0, 0, 0, 0)\",\n    whiteSpace: \"nowrap\",\n    borderWidth: 0,\n  };\n}\n\nlet segmenter: Intl.Segmenter | null | undefined;\n\nexport function splitGraphemes(text: string): string[] {\n  if (segmenter === undefined) {\n    segmenter =\n      typeof Intl !== \"undefined\" && typeof Intl.Segmenter === \"function\"\n        ? new Intl.Segmenter(undefined, { granularity: \"grapheme\" })\n        : null;\n  }\n  if (!segmenter) return Array.from(text);\n  return Array.from(segmenter.segment(text), (entry) => entry.segment);\n}\n\nexport const easeOut = [0.23, 1, 0.32, 1] as const;\nexport const easeSoft = [0.215, 0.61, 0.355, 1] as const;\nexport const easeInOut = [0.77, 0, 0.175, 1] as const;\nexport const easeEnter = [0.25, 0.1, 0.35, 1] as const;\nexport const easeLeave = [0, 0, 0.58, 1] as const;\nexport const easeResize = [0.4, 0, 0.1, 1] as const;\nexport const easeAway = [0.33, 0.17, 0.67, 0.5] as const;\n\nexport const pressSpring: Transition = {\n  type: \"spring\",\n  stiffness: 550,\n  damping: 30,\n  restSpeed: 10,\n};\n\nexport const selectionSpring: Transition = {\n  type: \"spring\",\n  stiffness: 300,\n  damping: 30,\n};\n\nexport const highlightSpring: Transition = {\n  type: \"spring\",\n  stiffness: 500,\n  damping: 40,\n};\n\nexport const popSpring: Transition = {\n  type: \"spring\",\n  stiffness: 400,\n  damping: 29,\n};\n\nexport const tooltipSpring: Transition = {\n  type: \"spring\",\n  stiffness: 400,\n  damping: 31,\n};\n\nexport const dialogSpring: Transition = {\n  type: \"spring\",\n  stiffness: 150,\n  damping: 25,\n};\n\nexport const toastSpring: Transition = {\n  type: \"spring\",\n  stiffness: 280,\n  damping: 24,\n};\n\nexport const heightSpring: Transition = {\n  type: \"spring\",\n  stiffness: 300,\n  damping: 30,\n  bounce: 0,\n  restDelta: 0.01,\n};\n\nexport const progressSpring: Transition = {\n  type: \"spring\",\n  stiffness: 300,\n  damping: 35,\n  restDelta: 0.01,\n  restSpeed: 0.1,\n};\n\nexport const scrollSpring: Transition = {\n  type: \"spring\",\n  stiffness: 250,\n  damping: 40,\n  bounce: 0,\n};\n\nexport const avatarSpring: Transition = {\n  type: \"spring\",\n  stiffness: 300,\n  damping: 17,\n};\n\nexport const pinnedSpring: Transition = {\n  type: \"spring\",\n  stiffness: 320,\n  damping: 25,\n  mass: 0.8,\n};\n\nexport const thumbSpring: Transition = {\n  type: \"spring\",\n  stiffness: 300,\n  damping: 25,\n};\n\nexport const checkSpring: Transition = {\n  type: \"spring\",\n  stiffness: 500,\n  damping: 24,\n};\n\nexport const cursorEntry: Transition = {\n  type: \"spring\",\n  stiffness: 550,\n  damping: 30,\n  restSpeed: 10,\n};\n\nexport const cursorExit: Transition = {\n  type: \"spring\",\n  stiffness: 550,\n  damping: 46.9,\n  restSpeed: 10,\n};\n\nexport const cursorLabel: Transition = {\n  type: \"spring\",\n  stiffness: 500,\n  damping: 50,\n  bounce: 0,\n};\n\nexport const swapTween: Transition = {\n  duration: 0.15,\n  ease: easeOut,\n};\n\nexport const overlayTween: Transition = {\n  duration: 0.4,\n  ease: easeSoft,\n};\n\nexport const disclosureTween: Transition = {\n  duration: 0.35,\n  ease: easeSoft,\n};\n\nexport const menuTween: Transition = {\n  duration: 0.22,\n  ease: easeSoft,\n};\n\nexport const panelOutTween: Transition = {\n  duration: 0.15,\n  ease: easeLeave,\n};\n\nexport const panelInTween: Transition = {\n  duration: 0.3,\n  ease: easeEnter,\n};\n\nexport const panelHeightTween: Transition = {\n  duration: 0.45,\n  ease: easeResize,\n};\n\nexport const exitTween: Transition = {\n  duration: 0.2,\n  ease: easeAway,\n};\n\nexport const faceSpring: Transition = {\n  type: \"spring\",\n  stiffness: 280,\n  damping: 20,\n};\n\nexport const blurIcon = \"blur(2px)\";\n\nexport function flipTransform(side: \"top\" | \"bottom\" | \"left\" | \"right\") {\n  const rotate =\n    side === \"top\"\n      ? \"rotateX(-20deg)\"\n      : side === \"bottom\"\n        ? \"rotateX(20deg)\"\n        : side === \"left\"\n          ? \"rotateY(20deg)\"\n          : \"rotateY(-20deg)\";\n  return `perspective(500px) ${rotate} scale(0.8)`;\n}\n\nexport function uprightTransform(side: \"top\" | \"bottom\" | \"left\" | \"right\") {\n  const rotate = side === \"left\" || side === \"right\" ? \"rotateY(0deg)\" : \"rotateX(0deg)\";\n  return `perspective(500px) ${rotate} scale(1)`;\n}\n",
      "target": "components/prequelui/motion.tsx"
    },
    {
      "path": "lib/use-reduced-motion.ts",
      "type": "registry:lib",
      "content": "\"use client\";\n\nimport { useReducedMotion } from \"motion/react\";\nimport { useSyncExternalStore } from \"react\";\n\nconst subscribe = () => () => {};\n\nexport function useHydratedReducedMotion() {\n  const reduce = useReducedMotion() ?? false;\n  const mounted = useSyncExternalStore(\n    subscribe,\n    () => true,\n    () => false,\n  );\n  return mounted ? reduce : false;\n}\n",
      "target": "lib/use-reduced-motion.ts"
    },
    {
      "path": "lib/utils.ts",
      "type": "registry:lib",
      "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport function slugToTitle(slug: string) {\n  return slug\n    .split(\"-\")\n    .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n    .join(\" \");\n}\n\nexport function formatDate(date: Date) {\n  return new Intl.DateTimeFormat(\"en-US\", {\n    month: \"2-digit\",\n    day: \"2-digit\",\n    year: \"numeric\",\n  }).format(date);\n}\n",
      "target": "lib/utils.ts"
    },
    {
      "path": "components/prequelui/icons/core.tsx",
      "type": "registry:lib",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n  useAnimationControls,\n  useInView,\n  type TargetAndTransition,\n  type Transition,\n  type Variants,\n} from \"motion/react\";\nimport { Slot, useReduceMotion, useTempo } from \"../motion\";\nimport {\n  IconStyleProvider,\n  type IconVariant,\n  type IconWeight,\n} from \"./style\";\n\nexport type IconAnimationSet = Record<string, Record<string, Variants>>;\nexport type IconTrigger = boolean | string;\nexport type IconControls = ReturnType<typeof useAnimationControls>;\n\ntype IconContextValue = {\n  controls: IconControls;\n  animation: string;\n  speed: number;\n};\n\nconst IconContext = React.createContext<IconContextValue | null>(null);\n\nexport function useAnimatedIconContext() {\n  return React.useContext(IconContext);\n}\n\nconst TIME_KEYS = new Set([\n  \"duration\",\n  \"delay\",\n  \"repeatDelay\",\n  \"delayChildren\",\n  \"staggerChildren\",\n]);\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n  return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction scaleTransition(transition: Transition, factor: number): Transition {\n  if (factor === 1) return transition;\n  const next: Record<string, unknown> = {};\n  for (const [key, value] of Object.entries(transition)) {\n    if (typeof value === \"number\" && TIME_KEYS.has(key)) next[key] = value * factor;\n    else if (typeof value === \"number\" && key === \"stiffness\")\n      next[key] = value / (factor * factor);\n    else if (typeof value === \"number\" && key === \"damping\") next[key] = value / factor;\n    else if (isPlainObject(value)) next[key] = scaleTransition(value as Transition, factor);\n    else next[key] = value;\n  }\n  return next as Transition;\n}\n\nfunction scaleTarget(\n  target: TargetAndTransition,\n  factor: number,\n): TargetAndTransition {\n  if (!isPlainObject(target)) return target;\n  const next: Record<string, unknown> = { ...target };\n  if (isPlainObject(next.transition)) {\n    next.transition = scaleTransition(next.transition as Transition, factor);\n  }\n  return next as TargetAndTransition;\n}\n\nfunction scalePart(part: Variants, factor: number): Variants {\n  if (factor === 1) return part;\n  const next: Record<string, unknown> = {};\n  for (const [key, value] of Object.entries(part)) {\n    if (key === \"transition\" && isPlainObject(value)) {\n      next[key] = scaleTransition(value as Transition, factor);\n    } else {\n      next[key] = scaleTarget(value as TargetAndTransition, factor);\n    }\n  }\n  return next as Variants;\n}\n\nexport function useIconVariants(animations: IconAnimationSet): Record<string, Variants> {\n  const context = React.useContext(IconContext);\n  const tempo = useTempo();\n  const animation = context?.animation ?? \"default\";\n  const speed = context?.speed ?? 1;\n  const factor = tempo / Math.max(0.05, speed);\n  const set =\n    animations[animation] ??\n    animations.default ??\n    animations.hover ??\n    Object.values(animations)[0] ??\n    {};\n\n  return React.useMemo(() => {\n    if (factor === 1) return set;\n    const next: Record<string, Variants> = {};\n    for (const [part, variants] of Object.entries(set)) {\n      next[part] = scalePart(variants, factor);\n    }\n    return next;\n  }, [factor, set]);\n}\n\nexport type AnimatedIconProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n  children: React.ReactNode;\n  animate?: IconTrigger;\n  animateOnHover?: IconTrigger;\n  animateOnTap?: IconTrigger;\n  animateOnView?: IconTrigger;\n  animateOnViewOnce?: boolean;\n  animateOnViewMargin?: string;\n  animation?: string;\n  loop?: boolean;\n  loopDelay?: number;\n  delay?: number;\n  speed?: number;\n  variant?: IconVariant;\n  weight?: IconWeight;\n  asChild?: boolean;\n};\n\nexport function AnimatedIcon({\n  children,\n  animate = false,\n  animateOnHover = false,\n  animateOnTap = false,\n  animateOnView = false,\n  animateOnViewOnce = true,\n  animateOnViewMargin = \"0px\",\n  animation = \"default\",\n  loop = false,\n  loopDelay = 0,\n  delay = 0,\n  speed = 1,\n  variant,\n  weight,\n  asChild = false,\n  className,\n  onPointerEnter,\n  onPointerLeave,\n  onPointerDown,\n  onPointerUp,\n  onPointerCancel,\n  ...props\n}: AnimatedIconProps) {\n  const controls = useAnimationControls();\n  const reduce = useReduceMotion();\n  const ref = React.useRef<HTMLSpanElement>(null);\n  const [active, setActive] = React.useState(false);\n  const [currentAnimation, setCurrentAnimation] = React.useState(animation);\n  const pending = React.useRef<number | undefined>(undefined);\n  const [mounted, setMounted] = React.useState(false);\n  const alive = React.useRef(true);\n\n  React.useEffect(() => setMounted(true), []);\n\n  /* The animation effects clean up passively, after paint. A frame scheduled\n     just before an unmount could therefore still reach the controls after\n     motion has detached them. The layout cleanup runs synchronously, so the\n     callbacks below can bail out before touching a dead controller. */\n  React.useLayoutEffect(() => {\n    alive.current = true;\n    return () => {\n      alive.current = false;\n    };\n  }, []);\n\n  const inView = useInView(ref, {\n    once: animateOnViewOnce,\n    amount: 0.5,\n    margin: animateOnViewMargin as `${number}px`,\n  });\n\n  const clearPending = React.useCallback(() => {\n    if (pending.current !== undefined) {\n      window.clearTimeout(pending.current);\n      pending.current = undefined;\n    }\n  }, []);\n\n  const start = React.useCallback(\n    (trigger: IconTrigger) => {\n      if (!trigger || reduce) return;\n      clearPending();\n      const next = typeof trigger === \"string\" ? trigger : animation;\n      setCurrentAnimation(next);\n      if (delay > 0) {\n        pending.current = window.setTimeout(() => setActive(true), delay);\n      } else {\n        setActive(true);\n      }\n    },\n    [animation, clearPending, delay, reduce],\n  );\n\n  const stop = React.useCallback(() => {\n    clearPending();\n    setActive(false);\n  }, [clearPending]);\n\n  React.useEffect(() => {\n    if (animate) start(animate);\n    else stop();\n  }, [animate, start, stop]);\n\n  React.useEffect(() => {\n    setCurrentAnimation(typeof animate === \"string\" ? animate : animation);\n  }, [animate, animation]);\n\n  React.useEffect(() => {\n    if (!animateOnView) return;\n    if (inView) start(animateOnView);\n    else stop();\n  }, [animateOnView, inView, start, stop]);\n\n  React.useEffect(() => {\n    if (!mounted) return;\n\n    let cancelled = false;\n    let frame = 0;\n    let timer: number | undefined;\n\n    const run = async () => {\n      if (cancelled || !alive.current) return;\n      await controls.start(\"animate\");\n      if (cancelled || !alive.current) return;\n      if (loop) {\n        timer = window.setTimeout(run, Math.max(0, loopDelay));\n      } else {\n        setActive(false);\n      }\n    };\n\n    frame = window.requestAnimationFrame(() => {\n      if (cancelled || !alive.current) return;\n      if (!active || reduce) {\n        void controls.start(\"initial\");\n        return;\n      }\n      void run();\n    });\n\n    return () => {\n      cancelled = true;\n      window.cancelAnimationFrame(frame);\n      if (timer !== undefined) window.clearTimeout(timer);\n    };\n  }, [active, controls, currentAnimation, loop, loopDelay, mounted, reduce]);\n\n  React.useEffect(() => {\n    return () => {\n      if (pending.current !== undefined) window.clearTimeout(pending.current);\n    };\n  }, []);\n\n  const Component = (asChild ? Slot : \"span\") as React.ElementType;\n\n  return (\n    <IconContext.Provider\n      value={{ controls, animation: currentAnimation, speed }}\n    >\n      <IconStyleProvider variant={variant} weight={weight}>\n        <Component\n          ref={ref}\n          data-slot=\"animated-icon\"\n          className={className}\n          onPointerEnter={(event: React.PointerEvent<HTMLElement>) => {\n            onPointerEnter?.(event as React.PointerEvent<HTMLSpanElement>);\n            if (animateOnHover && event.pointerType !== \"touch\") start(animateOnHover);\n          }}\n          onPointerLeave={(event: React.PointerEvent<HTMLElement>) => {\n            onPointerLeave?.(event as React.PointerEvent<HTMLSpanElement>);\n            if (animateOnHover || animateOnTap) stop();\n          }}\n          onPointerDown={(event: React.PointerEvent<HTMLElement>) => {\n            onPointerDown?.(event as React.PointerEvent<HTMLSpanElement>);\n            if (animateOnTap) start(animateOnTap);\n          }}\n          onPointerUp={(event: React.PointerEvent<HTMLElement>) => {\n            onPointerUp?.(event as React.PointerEvent<HTMLSpanElement>);\n            if (animateOnTap) stop();\n          }}\n          onPointerCancel={(event: React.PointerEvent<HTMLElement>) => {\n            onPointerCancel?.(event as React.PointerEvent<HTMLSpanElement>);\n            if (animateOnTap) stop();\n          }}\n          {...props}\n        >\n          {children}\n        </Component>\n      </IconStyleProvider>\n    </IconContext.Provider>\n  );\n}\n\nexport type AnimatedSvgProps = React.ComponentProps<\"svg\"> & {\n  size?: number;\n  children: React.ReactNode;\n};\n",
      "target": "components/prequelui/icons/core.tsx"
    },
    {
      "path": "components/prequelui/icons/style.tsx",
      "type": "registry:lib",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport type { IconVariant, IconWeight, IconRole } from \"@/lib/icon-styles\";\n\nexport type { IconVariant, IconWeight, IconRole } from \"@/lib/icon-styles\";\nexport {\n  ICON_VARIANTS,\n  ICON_VARIANT_LABELS,\n  ICON_VARIANT_SUFFIX,\n  isIconVariant,\n} from \"@/lib/icon-styles\";\n\nexport type IconPalette = {\n  primary: string;\n  primaryDark: string;\n  accent: string;\n  accentDark: string;\n};\n\nexport type IconEmojiPalette = {\n  primary: string;\n  secondary: string;\n  accent: string;\n};\n\nexport type IconPaletteBundle = {\n  color: IconPalette;\n  emoji: IconEmojiPalette;\n};\n\ntype IconPaintStyle = React.CSSProperties;\n\nexport type IconPaintApi = {\n  variant: IconVariant;\n  weight: IconWeight;\n  part: (\n    role: IconRole,\n    closed: boolean,\n    draw?: boolean,\n    inside?: boolean,\n  ) => IconPaintStyle;\n  halo: (role: IconRole) => IconPaintStyle;\n  flash: () => IconPaintStyle;\n  sticker: () => IconPaintStyle;\n  highlight: () => IconPaintStyle;\n};\n\ntype IconStyleContextValue = {\n  variant?: IconVariant;\n  weight?: IconWeight;\n};\n\nconst IconStyleContext = React.createContext<IconStyleContextValue>({});\n\nexport function IconStyleProvider({\n  variant,\n  weight,\n  children,\n}: {\n  variant?: IconVariant;\n  weight?: IconWeight;\n  children: React.ReactNode;\n}) {\n  const value = React.useMemo(() => ({ variant, weight }), [variant, weight]);\n  return (\n    <IconStyleContext.Provider value={value}>{children}</IconStyleContext.Provider>\n  );\n}\n\nexport function useIconStyle() {\n  return React.useContext(IconStyleContext);\n}\n\nfunction lightDark(light: string, dark: string) {\n  return `light-dark(${light}, ${dark})`;\n}\n\nconst INK = \"light-dark(oklch(0.28 0.02 80 / 0.7), oklch(0.92 0.02 80 / 0.55))\";\n\nconst OUTLINE_WIDTH: Record<IconWeight, number> = {\n  light: 1.75,\n  regular: 2,\n  bold: 2.6,\n};\n\nconst SOLID_WIDTH: Record<IconWeight, number> = {\n  light: 2.4,\n  regular: 2.8,\n  bold: 3.2,\n};\n\nconst EMOJI_WIDTH: Record<IconWeight, number> = {\n  light: 2.3,\n  regular: 2.6,\n  bold: 3,\n};\n\nexport function useIconPaint(\n  palette?: IconPaletteBundle,\n  localVariant?: IconVariant,\n  localWeight?: IconWeight,\n): IconPaintApi {\n  const context = React.useContext(IconStyleContext);\n  const variant = context.variant ?? localVariant ?? \"outline\";\n  const weight = context.weight ?? localWeight ?? \"regular\";\n\n  return React.useMemo(() => {\n    const stroke = OUTLINE_WIDTH[weight];\n    const solidOpen = SOLID_WIDTH[weight];\n    const emojiStroke = EMOJI_WIDTH[weight];\n\n    const primary = palette\n      ? lightDark(palette.color.primary, palette.color.primaryDark)\n      : \"currentColor\";\n    const accent = palette\n      ? lightDark(palette.color.accent, palette.color.accentDark)\n      : \"currentColor\";\n    const tint = `color-mix(in oklab, ${primary} var(--pi-tint, 22%), transparent)`;\n    const emoji = palette?.emoji;\n    const emojiPrimary = emoji?.primary ?? \"currentColor\";\n    const emojiSecondary = emoji?.secondary ?? \"currentColor\";\n    const emojiAccent = emoji?.accent ?? \"currentColor\";\n\n    function part(\n      role: IconRole,\n      closed: boolean,\n      draw = false,\n      isInside = false,\n    ): IconPaintStyle {\n      if (variant === \"solid\") {\n        if (isInside) {\n          const cutout =\n            \"var(--pi-cutout, light-dark(oklch(1 0 0), oklch(0.145 0 0)))\";\n          return closed\n            ? { fill: cutout, stroke: cutout, strokeWidth: draw ? stroke : 1 }\n            : { fill: \"none\", stroke: cutout, strokeWidth: stroke };\n        }\n        if (closed) {\n          return {\n            fill: \"currentColor\",\n            fillRule: \"evenodd\",\n            stroke: \"currentColor\",\n            strokeWidth: draw ? stroke : 1,\n          };\n        }\n        return { fill: \"none\", stroke: \"currentColor\", strokeWidth: solidOpen };\n      }\n\n      if (variant === \"duotone\") {\n        if (closed) {\n          return {\n            fill: \"currentColor\",\n            fillOpacity: \"var(--pi-secondary, 0.2)\",\n            fillRule: \"evenodd\",\n            stroke: \"currentColor\",\n            strokeWidth: stroke,\n          };\n        }\n        return { fill: \"none\", stroke: \"currentColor\", strokeWidth: stroke };\n      }\n\n      if (variant === \"color\") {\n        const tone = role === \"accent\" ? accent : primary;\n        return {\n          fill: closed ? tint : \"none\",\n          fillRule: \"evenodd\",\n          stroke: tone,\n          strokeWidth: stroke,\n        };\n      }\n\n      if (variant === \"emoji\") {\n        if (closed) {\n          return {\n            fill: role === \"accent\" ? emojiAccent : emojiPrimary,\n            fillRule: \"evenodd\",\n            stroke: INK,\n            strokeWidth: emojiStroke,\n          };\n        }\n        return {\n          fill: \"none\",\n          stroke: role === \"accent\" ? emojiAccent : emojiPrimary,\n          strokeWidth: emojiStroke,\n        };\n      }\n\n      return { fill: \"none\", stroke: \"currentColor\", strokeWidth: stroke };\n    }\n\n    function halo(role: IconRole): IconPaintStyle {\n      if (variant === \"emoji\") {\n        return {\n          fill: \"none\",\n          stroke: INK,\n          strokeWidth: emojiStroke + 1.6,\n        };\n      }\n      if (variant === \"duotone\") {\n        return {\n          fill: \"none\",\n          stroke: role === \"accent\" ? accent : primary,\n          strokeOpacity: \"var(--pi-secondary, 0.2)\",\n          strokeWidth: stroke + 4,\n        };\n      }\n      return { display: \"none\" };\n    }\n\n    function flash(): IconPaintStyle {\n      if (variant === \"color\") return { fill: primary };\n      if (variant === \"emoji\") return { fill: emojiPrimary };\n      if (variant === \"duotone\") {\n        return {\n          fill: \"currentColor\",\n          fillOpacity: \"var(--pi-secondary, 0.2)\",\n        };\n      }\n      return { fill: \"currentColor\" };\n    }\n\n    function sticker(): IconPaintStyle {\n      if (!emoji) return { display: \"none\" };\n      return {\n        fill: emojiSecondary,\n        fillOpacity: 0.26,\n        stroke: INK,\n        strokeOpacity: 0.22,\n        strokeWidth: 1.2,\n      };\n    }\n\n    function highlight(): IconPaintStyle {\n      return {\n        fill: \"oklch(1 0 0)\",\n        fillOpacity: \"var(--pi-highlight, 0.22)\",\n        stroke: \"none\",\n      };\n    }\n\n    return {\n      variant,\n      weight,\n      part,\n      halo,\n      flash,\n      sticker,\n      highlight,\n    };\n  }, [palette, variant, weight]);\n}\n",
      "target": "components/prequelui/icons/style.tsx"
    },
    {
      "path": "lib/icon-styles.ts",
      "type": "registry:lib",
      "content": "export type IconVariant = \"outline\" | \"solid\" | \"duotone\" | \"color\" | \"emoji\";\nexport type IconWeight = \"light\" | \"regular\" | \"bold\";\nexport type IconRole = \"primary\" | \"secondary\" | \"accent\";\n\nexport const ICON_VARIANTS: IconVariant[] = [\n  \"outline\",\n  \"solid\",\n  \"duotone\",\n  \"color\",\n  \"emoji\",\n];\n\nexport const ICON_VARIANT_LABELS: Record<IconVariant, string> = {\n  outline: \"Outline\",\n  solid: \"Solid\",\n  duotone: \"Duotone\",\n  color: \"Color\",\n  emoji: \"Emoji\",\n};\n\nexport const ICON_VARIANT_SUFFIX: Record<IconVariant, string> = {\n  outline: \"\",\n  solid: \"-solid\",\n  duotone: \"-duotone\",\n  color: \"-color\",\n  emoji: \"-emoji\",\n};\n\nexport function isIconVariant(\n  value: string | null | undefined,\n): value is IconVariant {\n  return !!value && (ICON_VARIANTS as string[]).includes(value);\n}\n",
      "target": "lib/icon-styles.ts"
    }
  ]
}
