{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toast",
  "type": "registry:ui",
  "title": "Toast",
  "description": "Toast surfaces brief, non-blocking feedback about the result of a user action or system event.",
  "dependencies": [
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/motion.json",
    "https://wideset.co/r/progress-bar.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/toast/Toast.context.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/Toast.context.tsx",
      "content": "'use client';\n\nimport {\n  createContext,\n  useCallback,\n  useContext,\n  useEffect,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport type { MotionProps } from '@/lib/wideset/motion/Motion.types';\nimport type {\n  ToastContextType,\n  ToastItem,\n  ToastPosition,\n  ToastProviderProps,\n  ToastStateContextType,\n} from './Toast.types';\nimport { ToastContainer } from './ToastContainer';\n\ntype ToastBus = {\n  addSubscribers: Set<(toast: ToastItem) => void>;\n  dismissSubscribers: Set<(id: string) => void>;\n  emitAdd: (toast: ToastItem) => void;\n  emitDismiss: (id: string) => void;\n  subscribeAdd: (listener: (toast: ToastItem) => void) => () => void;\n  subscribeDismiss: (listener: (id: string) => void) => () => void;\n};\n\nconst createToastBus = (): ToastBus => {\n  const addSubscribers = new Set<(toast: ToastItem) => void>();\n  const dismissSubscribers = new Set<(id: string) => void>();\n\n  return {\n    addSubscribers,\n    dismissSubscribers,\n    emitAdd: (toast) => {\n      for (const subscriber of addSubscribers) subscriber(toast);\n    },\n    emitDismiss: (id) => {\n      for (const subscriber of dismissSubscribers) subscriber(id);\n    },\n    subscribeAdd: (listener) => {\n      addSubscribers.add(listener);\n      return () => addSubscribers.delete(listener);\n    },\n    subscribeDismiss: (listener) => {\n      dismissSubscribers.add(listener);\n      return () => dismissSubscribers.delete(listener);\n    },\n  };\n};\n\nconst ToastViewport = ({\n  bus,\n  position,\n  defaultMotion,\n}: { bus: ToastBus; position: ToastPosition } & MotionProps) => {\n  const [toasts, setToasts] = useState<ToastItem[]>([]);\n  const [now, setNow] = useState(() => Date.now());\n  const timeoutRefs = useRef<Map<string, ReturnType<typeof setTimeout>>>(new Map());\n\n  const dismissToast = useCallback((id: string) => {\n    const timeout = timeoutRefs.current.get(id);\n    if (timeout) {\n      clearTimeout(timeout);\n      timeoutRefs.current.delete(id);\n    }\n\n    setToasts((prev) =>\n      prev.map((toast) => (toast.id === id ? { ...toast, isExiting: true } : toast)),\n    );\n\n    const exitTimeout = setTimeout(() => {\n      setToasts((prev) => prev.filter((toast) => toast.id !== id));\n      timeoutRefs.current.delete(`${id}-exit`);\n    }, 200);\n\n    timeoutRefs.current.set(`${id}-exit`, exitTimeout);\n  }, []);\n\n  const addToast = useCallback(\n    (toast: ToastItem) => {\n      setToasts((prev) => [...prev, toast]);\n\n      if ((toast.duration ?? 0) > 0) {\n        const autoDismissTimeout = setTimeout(() => {\n          dismissToast(toast.id);\n        }, toast.duration);\n\n        timeoutRefs.current.set(toast.id, autoDismissTimeout);\n      }\n    },\n    [dismissToast],\n  );\n\n  useEffect(() => {\n    const unsubscribeAdd = bus.subscribeAdd(addToast);\n    const unsubscribeDismiss = bus.subscribeDismiss(dismissToast);\n\n    return () => {\n      unsubscribeAdd();\n      unsubscribeDismiss();\n    };\n  }, [addToast, bus, dismissToast]);\n\n  useEffect(() => {\n    const timeouts = timeoutRefs.current;\n\n    return () => {\n      for (const timeout of timeouts.values()) {\n        clearTimeout(timeout);\n      }\n      timeouts.clear();\n    };\n  }, []);\n\n  useLayoutEffect(() => {\n    const hasTimedToasts = toasts.some((toast) => (toast.duration ?? 0) > 0);\n    if (!hasTimedToasts) return undefined;\n\n    let frameId = 0;\n    const tick = () => {\n      setNow(Date.now());\n      frameId = requestAnimationFrame(tick);\n    };\n\n    frameId = requestAnimationFrame(tick);\n\n    return () => cancelAnimationFrame(frameId);\n  }, [toasts]);\n\n  if (typeof document === 'undefined') return null;\n  if (toasts.length === 0) return null;\n\n  return createPortal(\n    <ToastContainer\n      toasts={toasts}\n      onDismiss={dismissToast}\n      position={position}\n      now={now}\n      defaultMotion={defaultMotion}\n    />,\n    document.body,\n  );\n};\n\nexport const ToastContext = createContext<ToastContextType | undefined>(undefined);\n\nexport const useToast = () => {\n  const context = useContext(ToastContext);\n  if (!context) {\n    throw new Error('useToast must be used within a ToastProvider');\n  }\n  return context;\n};\n\nexport const ToastProvider = ({\n  children,\n  position = 'bottom-right',\n  defaultMotion,\n}: ToastProviderProps) => {\n  const busRef = useRef<ToastBus | null>(null);\n  if (!busRef.current) {\n    busRef.current = createToastBus();\n  }\n\n  const dismissToast = useCallback((id: string) => {\n    busRef.current?.emitDismiss(id);\n  }, []);\n\n  const showToast = useCallback<ToastContextType['showToast']>(\n    ({\n      content,\n      action,\n      status = 'neutral',\n      duration = 5000,\n      variant = 'basic',\n      description,\n      footer,\n    }) => {\n      const id = Math.random().toString(36).substring(2, 9);\n      const newToast: ToastItem = {\n        id,\n        content,\n        action,\n        status,\n        duration,\n        createdAt: Date.now(),\n        variant,\n        description,\n        footer,\n      };\n\n      busRef.current?.emitAdd(newToast);\n\n      return id;\n    },\n    [],\n  );\n\n  const value = useMemo(() => ({ showToast, dismissToast }), [showToast, dismissToast]);\n\n  return (\n    <ToastContext.Provider value={value}>\n      {children}\n      <ToastViewport bus={busRef.current} position={position} defaultMotion={defaultMotion} />\n    </ToastContext.Provider>\n  );\n};\n\nexport const ToastStateContext = createContext<ToastStateContextType | undefined>(undefined);\n\nexport const useToastState = () => {\n  const context = useContext(ToastStateContext);\n  if (!context) {\n    throw new Error('useToastState must be used within a Toast');\n  }\n  return context;\n};\n\nexport const ToastStateProvider = ({\n  children,\n  ...props\n}: React.PropsWithChildren<{ state: ToastStateContextType }>) => {\n  return <ToastStateContext.Provider value={props.state}>{children}</ToastStateContext.Provider>;\n};\n"
    },
    {
      "path": "src/components/toast/Toast.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/Toast.tsx",
      "content": "'use client';\n\nimport {\n  RiCheckboxCircleFill,\n  RiCloseLine,\n  RiErrorWarningFill,\n  RiInformationFill,\n} from '@remixicon/react';\nimport React, { forwardRef, isValidElement } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { IconButton } from '../button/IconButton';\nimport { ProgressBar } from '../progress-bar/ProgressBar';\nimport { ToastStateProvider } from './Toast.context';\nimport type {\n  ToastActionProps,\n  ToastDescriptionProps,\n  ToastMessageProps,\n  ToastProps,\n  ToastStatus,\n  ToastWithSubComponents,\n} from './Toast.types';\nimport { toastDismissVariants, toastIconExpandedVariants, toastVariants } from './Toast.variants';\nimport { ToastAction } from './ToastAction';\nimport { ToastDescription } from './ToastDescription';\nimport { ToastIconAction } from './ToastIconAction';\nimport { ToastMessage } from './ToastMessage';\n\nconst iconsMap: Record<ToastStatus, typeof RiCheckboxCircleFill | null> = {\n  error: RiErrorWarningFill,\n  success: RiCheckboxCircleFill,\n  info: RiInformationFill,\n  neutral: null,\n};\n\nconst isToastSlot = (child: React.ReactNode, slot: React.ElementType) =>\n  isValidElement(child) && child.type === slot;\n\n/**\n * True when the node is the slot itself or wraps one — an icon action composed\n * as `DropdownMenu > Trigger asChild > Toast.IconAction` still belongs in the\n * top-right actions cluster.\n */\nconst containsToastSlot = (node: React.ReactNode, slot: React.ElementType): boolean => {\n  if (isToastSlot(node, slot)) return true;\n  if (!isValidElement(node)) return false;\n\n  const nested = (node.props as { children?: React.ReactNode }).children;\n  return React.Children.toArray(nested).some((child) => containsToastSlot(child, slot));\n};\n\nconst Toast = forwardRef<HTMLDivElement, ToastProps>(\n  (\n    {\n      className,\n      status,\n      variant = 'basic',\n      progress,\n      footer,\n      duration,\n      onDismiss,\n      dismissAriaLabel = 'Dismiss',\n      progressAriaLabel = 'Progress',\n      children,\n      ...props\n    },\n    ref,\n  ) => {\n    const IconComponent = iconsMap[status as ToastStatus];\n    const isExpanded = variant === 'expanded';\n    const childArray = React.Children.toArray(children);\n\n    const messageSlot = childArray.find((child) => isToastSlot(child, ToastMessage)) as\n      React.ReactElement<ToastMessageProps> | undefined;\n    const descriptionSlot = childArray.find((child) => isToastSlot(child, ToastDescription)) as\n      React.ReactElement<ToastDescriptionProps> | undefined;\n    const actionSlot = childArray.find((child) => isToastSlot(child, ToastAction)) as\n      React.ReactElement<ToastActionProps> | undefined;\n    const iconActionSlots = childArray.filter((child) => containsToastSlot(child, ToastIconAction));\n\n    const messageContent = messageSlot\n      ? messageSlot.props.children\n      : childArray.filter(\n          (child) =>\n            !isToastSlot(child, ToastMessage) &&\n            !isToastSlot(child, ToastDescription) &&\n            !isToastSlot(child, ToastAction) &&\n            !containsToastSlot(child, ToastIconAction),\n        );\n\n    return (\n      <div\n        ref={ref}\n        data-slot=\"toast\"\n        className={cn(toastVariants({ status, variant }), className)}\n        role={status === 'error' ? 'alert' : 'status'}\n        {...props}\n      >\n        <ToastStateProvider state={{ status, variant }}>\n          {isExpanded ? (\n            <div className=\"flex flex-1 flex-col\">\n              {/* Figma: 16px content inset on every side (root owns\n                  pt-ws-9), icon→text gap 12 — the dismiss X lands 16px from the\n                  top and right corner. */}\n              <div className=\"gap-ws-7 px-ws-9 pb-ws-9 flex items-start\">\n                {IconComponent && (\n                  <IconComponent\n                    aria-hidden=\"true\"\n                    focusable=\"false\"\n                    className={toastIconExpandedVariants({ status })}\n                  />\n                )}\n\n                <div className=\"flex-1\">\n                  <div className=\"gap-ws-7 flex items-start justify-between\">\n                    <div className=\"typography-body-md\">\n                      <div\n                        data-slot=\"toast-message\"\n                        className={cn(\n                          'typography-label-sm text-ws-static-base',\n                          Boolean(descriptionSlot) && 'mb-ws-5',\n                        )}\n                      >\n                        {messageContent}\n                      </div>\n                      {descriptionSlot}\n                    </div>\n\n                    {(iconActionSlots.length > 0 || onDismiss) && (\n                      // Figma's \"Actions\" cluster: icon buttons before the\n                      // dismiss X; each carries ml-ws-3 for the 4px gap.\n                      <div className=\"flex shrink-0 items-start\">\n                        {iconActionSlots}\n                        {onDismiss && (\n                          <IconButton\n                            icon={RiCloseLine}\n                            preset=\"ghost\"\n                            variant=\"secondary\"\n                            size=\"sm\"\n                            aria-label={dismissAriaLabel}\n                            onClick={onDismiss}\n                            className={toastDismissVariants({ status })}\n                          />\n                        )}\n                      </div>\n                    )}\n                  </div>\n\n                  {actionSlot && (\n                    <div className=\"mt-ws-9 gap-ws-7 flex flex-wrap items-center\">{actionSlot}</div>\n                  )}\n                </div>\n              </div>\n\n              {footer && (\n                <div className=\"bg-ws-static-alpha-subtle typography-body-md text-ws-static-subtle px-ws-9 py-ws-7\">\n                  {typeof footer === 'function' ? footer(duration ?? 0) : footer}\n                </div>\n              )}\n\n              {typeof progress === 'number' && (\n                <ProgressBar\n                  className=\"bg-(--ws-dynamic-stroke-secondary-default)\"\n                  value={progress}\n                  aria-label={progressAriaLabel}\n                />\n              )}\n            </div>\n          ) : (\n            <>\n              {IconComponent && (\n                <IconComponent\n                  aria-hidden=\"true\"\n                  focusable=\"false\"\n                  className=\"mr-ws-5 size-ws-11\"\n                />\n              )}\n              <div className=\"gap-ws-7 flex flex-1 items-center justify-between\">\n                <div data-slot=\"toast-message\" className=\"typography-label-strong-sm\">\n                  {messageContent}\n                </div>\n                {actionSlot}\n              </div>\n              <div className=\"ml-auto flex items-center leading-0\">\n                {iconActionSlots}\n                {onDismiss && (\n                  <IconButton\n                    icon={RiCloseLine}\n                    preset=\"ghost\"\n                    variant=\"inverse\"\n                    size=\"sm\"\n                    aria-label={dismissAriaLabel}\n                    onClick={onDismiss}\n                    className={toastDismissVariants({ status, variant })}\n                  />\n                )}\n              </div>\n            </>\n          )}\n        </ToastStateProvider>\n      </div>\n    );\n  },\n) as ToastWithSubComponents;\n\nToast.displayName = 'Toast';\n\nToast.Action = ToastAction;\nToast.IconAction = ToastIconAction;\nToast.Message = ToastMessage;\nToast.Description = ToastDescription;\n\nexport { Toast };\n"
    },
    {
      "path": "src/components/toast/Toast.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/Toast.types.ts",
      "content": "import type { VariantProps } from 'class-variance-authority';\nimport type {\n  ComponentPropsWithoutRef,\n  ComponentType,\n  ForwardRefExoticComponent,\n  HTMLAttributes,\n  PropsWithoutRef,\n  ReactNode,\n  RefAttributes,\n} from 'react';\n\nimport type { MotionProps } from '@/lib/wideset/motion/Motion.types';\nimport type { ButtonProps } from '../button/Button.types';\nimport type { IconButtonProps } from '../button/IconButton.types';\nimport type { toastVariants } from './Toast.variants';\n\nexport type ToastStatus = NonNullable<VariantProps<typeof toastVariants>['status']>;\n\nexport type ToastVariant = 'basic' | 'expanded';\n\ntype ToastFooter = ReactNode | ((duration: number) => ReactNode);\n\ntype ToastShowOptionsBasic = {\n  /** Compact toast layout for short messages and lightweight actions. */\n  variant?: 'basic';\n  /** Additional supporting copy displayed under the main content in the toast API. */\n  description?: string;\n  footer?: never;\n};\n\ntype ToastShowOptionsExpanded = {\n  /** Expanded layout with support for description, footer, and progress. */\n  variant: 'expanded';\n  /** Additional supporting copy displayed under the main content in the toast API. */\n  description?: string;\n  /** Optional footer content rendered below the expanded toast body. */\n  footer?: ToastFooter;\n};\n\nexport type ToastShowOptions = ToastShowOptionsBasic | ToastShowOptionsExpanded;\n\nexport type ToastShowConfig = {\n  /** Main toast content rendered as plain text or custom React nodes. */\n  content: ReactNode;\n  /** Optional inline action rendered beside or below the message. */\n  action?: ReactNode;\n  /** Semantic status used to communicate the meaning of the feedback. */\n  status?: ToastStatus;\n  /** Auto-dismiss duration in milliseconds. Use `0` to keep the toast visible until dismissed. */\n  duration?: number;\n} & ToastShowOptions;\n\nexport type ToastPosition =\n  'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';\n\nexport type ToastItem = {\n  /** Unique toast ID returned by `showToast` and accepted by `dismissToast`. */\n  id: string;\n  /** Main content of the queued toast. */\n  content: ReactNode;\n  /** Optional action rendered beside the message. */\n  action?: ReactNode;\n  /** The visual style status of the toast. */\n  status?: ToastStatus;\n  /** Layout variant for the toast content. `footer` and `progress` are supported only in `expanded` variant. */\n  variant?: ToastVariant;\n  /** Supporting text displayed below the label. */\n  description?: string;\n  /** Optional footer rendered below the expanded toast body. Accepts a React node or a callback that receives the remaining duration. */\n  footer?: ToastFooter;\n  /** Auto-dismiss duration in milliseconds. Use `0` to keep the toast visible until it is dismissed manually. */\n  duration?: number;\n  /** Marks a queued toast as leaving during its exit animation. */\n  isExiting?: boolean;\n  /** Creation timestamp in milliseconds used to track remaining duration. */\n  createdAt: number;\n};\n\nexport type ToastContextType = {\n  /** Adds a toast to the queue and returns the generated toast id. */\n  showToast: (config: ToastShowConfig) => string;\n  /** Dismisses a toast by id. */\n  dismissToast: (id: string) => void;\n};\n\nexport type ToastStateContextType = Pick<ToastProps, 'status' | 'variant'>;\n\ntype ToastPropsBase = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className'> & {\n  /** Additional CSS classes merged with the toast root element. */\n  className?: string;\n  /** Toast content, typically composed from `Toast.Message`, `Toast.Description`, and `Toast.Action`. */\n  children?: ReactNode;\n  /** Called when the dismiss button is pressed. */\n  onDismiss?: () => void;\n  /** Progress value from `0` to `100`. Only applies to the `expanded` variant. */\n  progress?: number;\n  /** Auto-dismiss duration in milliseconds. Use `0` to keep the toast visible until dismissed. */\n  duration?: number;\n  /** Accessible label for the dismiss button. Defaults to `'Dismiss'`. */\n  dismissAriaLabel?: string;\n  /** Accessible label for the progress bar. Defaults to `'Progress'`. */\n  progressAriaLabel?: string;\n} & VariantProps<typeof toastVariants>;\n\ntype ToastPropsBasic = ToastPropsBase & {\n  /** Compact toast layout for short messages and a single inline action. */\n  variant?: 'basic';\n  footer?: never;\n};\n\ntype ToastPropsExpanded = ToastPropsBase & {\n  /** Expanded toast layout with support for description, footer, and progress. */\n  variant: 'expanded';\n  /** Optional footer content rendered below the expanded toast body. */\n  footer?: ToastFooter;\n};\n\n/** A toast notification: `basic` for a short message with one inline action, `expanded` with a footer. */\nexport type ToastProps = ToastPropsBasic | ToastPropsExpanded;\n\n/** An action styled for `Toast`. */\nexport type ToastActionProps = ButtonProps;\n\n/** Icon-only action rendered in the toast's top-right cluster, before the dismiss button. */\nexport type ToastIconActionProps = Omit<IconButtonProps, 'preset' | 'variant' | 'size'>;\n\n/** The message displayed inside the feedback surface. */\nexport type ToastMessageProps = {\n  /** Primary toast message content. */\n  children: ReactNode;\n};\n\n/** Supporting descriptive text. */\nexport type ToastDescriptionProps = ComponentPropsWithoutRef<'span'>;\n\n/** The floating surface or stack containing feedback content. */\nexport type ToastContainerProps = {\n  /** Toasts currently rendered in the viewport. */\n  toasts: ToastItem[];\n  /** Called when a toast should be dismissed from the rendered queue. */\n  onDismiss: (id: string) => void;\n  /** Screen edge where the toast stack is anchored. */\n  position: ToastPosition;\n  /** Current timestamp used to derive time-based toast state. */\n  now: number;\n} & MotionProps;\n\n/** The provider managing feedback state for its descendants. */\nexport type ToastProviderProps = {\n  /** Application subtree that can render and trigger toasts. */\n  children: ReactNode;\n  /** Screen edge where the toast stack should appear. */\n  position?: ToastPosition;\n} & MotionProps;\n\nexport type ToastWithSubComponents = ForwardRefExoticComponent<\n  PropsWithoutRef<ToastProps> & RefAttributes<HTMLDivElement>\n> & {\n  Action: ComponentType<ToastActionProps>;\n  IconAction: ForwardRefExoticComponent<\n    PropsWithoutRef<ToastIconActionProps> & RefAttributes<HTMLButtonElement>\n  >;\n  Message: ComponentType<ToastMessageProps>;\n  Description: ComponentType<ToastDescriptionProps>;\n};\n"
    },
    {
      "path": "src/components/toast/Toast.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/Toast.variants.ts",
      "content": "import { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nexport const toastVariants = cva('inline-flex w-full items-center', {\n  variants: {\n    status: {\n      neutral: '',\n      info: '',\n      success: '',\n      error: '',\n    },\n    variant: {\n      basic: 'rounded-ws-container-md shadow-ws-medium min-h-ws-18 py-ws-5 pr-ws-5 pl-ws-9',\n      expanded:\n        'bg-ws-static-overlay rounded-ws-container-lg shadow-ws-high pt-ws-9 overflow-hidden',\n    },\n  },\n  compoundVariants: [\n    {\n      status: 'neutral',\n      variant: 'basic',\n      className: 'bg-ws-semantic-inverse-neutral text-ws-semantic-on-inverse-neutral',\n    },\n    {\n      status: 'info',\n      variant: 'basic',\n      className: 'bg-ws-semantic-inverse-info text-ws-semantic-on-inverse-info',\n    },\n    {\n      status: 'success',\n      variant: 'basic',\n      className: 'bg-ws-semantic-inverse-positive text-ws-semantic-on-inverse-positive',\n    },\n    {\n      status: 'error',\n      variant: 'basic',\n      className: 'bg-ws-semantic-inverse-negative text-ws-semantic-on-inverse-negative',\n    },\n  ],\n  defaultVariants: {\n    status: 'neutral',\n  },\n});\n\ntype ToastStatus = NonNullable<VariantProps<typeof toastVariants>['status']>;\ntype ToastVariant = NonNullable<VariantProps<typeof toastVariants>['variant']>;\n\ntype ToastButtonVariantConfig = {\n  variants: {\n    status: Record<ToastStatus, string>;\n    variant: Record<ToastVariant, string>;\n  };\n  compoundVariants: Array<{\n    status: ToastStatus;\n    variant: ToastVariant;\n    className: string;\n  }>;\n};\n\nconst toastButtonVariants = {\n  variants: {\n    status: {\n      neutral: '',\n      info: '',\n      success: '',\n      error: '',\n    },\n    variant: {\n      basic: '',\n      expanded: '',\n    },\n  },\n  compoundVariants: (['info', 'success', 'error'] satisfies ToastStatus[]).map((status) => ({\n    status,\n    variant: 'basic',\n    className:\n      'text-ws-semantic-on-inverse-negative hover:text-ws-semantic-on-inverse-negative active:text-ws-semantic-on-inverse-negative',\n  })),\n} satisfies ToastButtonVariantConfig;\n\nexport const toastActionVariants = cva('box-border py-0', toastButtonVariants);\n\nexport const toastDismissVariants = cva('ml-ws-3 size-ws-14 p-0', toastButtonVariants);\n\nexport const toastMotionVariants = cva('', {\n  variants: {\n    enabled: { true: '', false: '' },\n    exiting: { true: '', false: '' },\n  },\n  compoundVariants: [\n    {\n      enabled: true,\n      exiting: false,\n      className:\n        'animate-[ws-toast-in_var(--ws-motion-duration-medium)_var(--ws-motion-ease-smooth-out)_backwards]',\n    },\n    {\n      enabled: true,\n      exiting: true,\n      className:\n        'animate-[ws-toast-out_var(--ws-motion-duration-quick)_var(--ws-motion-ease-smooth-out)_forwards]',\n    },\n  ],\n  defaultVariants: { enabled: true, exiting: false },\n});\n\nexport const toastViewportMotionVariants = cva('', {\n  variants: {\n    enabled: { true: 'group/toasts grid grid-cols-[100%] gap-0', false: '' },\n    stacked: { true: '', false: '' },\n    side: { top: '', bottom: '' },\n  },\n  compoundVariants: [\n    { enabled: true, side: 'bottom', className: 'items-end [--ws-toast-direction:1]' },\n    { enabled: true, side: 'top', className: 'items-start [--ws-toast-direction:-1]' },\n    {\n      enabled: true,\n      stacked: true,\n      className:\n        \"hover:before:absolute hover:before:inset-x-0 hover:before:h-[200%] hover:before:content-['']\",\n    },\n    { enabled: true, stacked: true, side: 'bottom', className: 'hover:before:bottom-full' },\n    { enabled: true, stacked: true, side: 'top', className: 'hover:before:top-full' },\n  ],\n  defaultVariants: { enabled: true, stacked: false, side: 'bottom' },\n});\n\nexport const toastStackItemMotionVariants = cva('', {\n  variants: {\n    enabled: {\n      true: cn(\n        'relative col-start-1 row-start-1',\n        'transition-[translate,scale,opacity] duration-(--ws-motion-duration-medium) ease-(--ws-motion-ease-smooth-out)',\n      ),\n      false: '',\n    },\n    stacked: { true: '', false: '' },\n    side: { top: '', bottom: '' },\n    depth: { 0: '', 1: '', 2: '', 3: '' },\n  },\n  compoundVariants: [\n    { enabled: true, side: 'bottom', className: 'origin-bottom' },\n    { enabled: true, side: 'top', className: 'origin-top' },\n    {\n      enabled: true,\n      stacked: true,\n      depth: 1,\n      className: cn(\n        '-translate-y-[calc(var(--ws-motion-distance-medium)*var(--ws-toast-direction))] scale-94 opacity-60',\n        'group-hover/toasts:-translate-y-[calc((100%+var(--ws-motion-distance-base))*var(--ws-toast-direction))] group-hover/toasts:scale-100 group-hover/toasts:opacity-100',\n      ),\n    },\n    {\n      enabled: true,\n      stacked: true,\n      depth: 2,\n      className: cn(\n        '-translate-y-[calc(var(--ws-motion-distance-medium)*2*var(--ws-toast-direction))] scale-88 opacity-36',\n        'group-hover/toasts:-translate-y-[calc((200%+var(--ws-motion-distance-base)*2)*var(--ws-toast-direction))] group-hover/toasts:scale-100 group-hover/toasts:opacity-100',\n      ),\n    },\n    {\n      enabled: true,\n      stacked: true,\n      depth: 3,\n      className:\n        'pointer-events-none -translate-y-[calc(var(--ws-motion-distance-medium)*3*var(--ws-toast-direction))] scale-82 opacity-0',\n    },\n  ],\n  defaultVariants: { enabled: true, stacked: false, side: 'bottom', depth: 0 },\n});\n\nexport const toastIconExpandedVariants = cva('size-ws-11', {\n  variants: {\n    status: {\n      neutral: '',\n      info: 'text-ws-semantic-info',\n      success: 'text-ws-semantic-positive',\n      error: 'text-ws-semantic-negative',\n    },\n  },\n});\n"
    },
    {
      "path": "src/components/toast/ToastAction.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/ToastAction.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { Button } from '../button/Button';\nimport { useToastState } from './Toast.context';\nimport type { ToastActionProps } from './Toast.types';\nimport { toastActionVariants } from './Toast.variants';\n\nconst ToastAction = ({\n  preset = 'border',\n  variant = 'inverse',\n  size = 'sm',\n  children,\n  className,\n  ...props\n}: ToastActionProps) => {\n  const toastState = useToastState();\n\n  return (\n    <Button\n      data-slot=\"toast-action\"\n      preset={preset}\n      variant={variant}\n      size={size}\n      className={cn(\n        toastActionVariants({ status: toastState.status, variant: toastState.variant }),\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </Button>\n  );\n};\n\nToastAction.displayName = 'Toast.Action';\n\nexport { ToastAction };\n"
    },
    {
      "path": "src/components/toast/ToastContainer.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/ToastContainer.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { MotionProvider, useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport { Toast } from './Toast';\nimport type { ToastContainerProps, ToastItem, ToastPosition } from './Toast.types';\nimport {\n  toastMotionVariants,\n  toastStackItemMotionVariants,\n  toastViewportMotionVariants,\n} from './Toast.variants';\n\nconst getPositionClasses = (position: ToastPosition): string => {\n  const baseClasses = 'fixed z-ws-notification w-full max-w-[24rem] flex flex-col gap-ws-5';\n\n  switch (position) {\n    case 'top-right':\n      return `${baseClasses} top-ws-9 right-ws-9`;\n    case 'top-left':\n      return `${baseClasses} top-ws-9 left-ws-9`;\n    case 'bottom-right':\n      return `${baseClasses} bottom-ws-9 right-ws-9`;\n    case 'bottom-left':\n      return `${baseClasses} bottom-ws-9 left-ws-9`;\n    case 'top-center':\n      return `${baseClasses} top-ws-9 left-1/2 transform -translate-x-1/2`;\n    case 'bottom-center':\n      return `${baseClasses} bottom-ws-9 left-1/2 transform -translate-x-1/2`;\n    default:\n      return `${baseClasses} bottom-ws-9 right-ws-9`;\n  }\n};\n\nconst getToastTiming = (toast: ToastItem, now: number) => {\n  const elapsed = now - toast.createdAt;\n  const duration = Math.max(0, (toast.duration ?? 0) - elapsed);\n  const progress =\n    toast.duration && toast.duration > 0\n      ? Math.min(100, Math.max(0, (elapsed / toast.duration) * 100))\n      : undefined;\n\n  return { duration, progress };\n};\n\nconst ToastContainer = ({\n  toasts,\n  onDismiss,\n  position,\n  now,\n  defaultMotion,\n}: ToastContainerProps) => {\n  const motion = useDefaultMotion(defaultMotion);\n\n  if (toasts.length === 0) return null;\n\n  const stacked = toasts.some((toast) => !toast.isExiting);\n  const side = position.startsWith('top') ? 'top' : 'bottom';\n\n  return (\n    <MotionProvider enabled={motion}>\n      <div\n        data-slot=\"toast-container\"\n        className={cn(\n          getPositionClasses(position),\n          toastViewportMotionVariants({ enabled: motion, stacked, side }),\n        )}\n      >\n        {toasts.map((toast, index) => {\n          const { duration, progress } = getToastTiming(toast, now);\n          const depth = Math.min(toasts.length - 1 - index, 3) as 0 | 1 | 2 | 3;\n          const isHidden = motion && stacked && depth === 3;\n          const isExpanded = toast.variant === 'expanded';\n          const variantProps = isExpanded\n            ? { variant: 'expanded' as const, footer: toast.footer }\n            : { variant: toast.variant };\n\n          return (\n            <div\n              key={toast.id}\n              ref={(node) => {\n                node?.toggleAttribute('inert', isHidden);\n              }}\n              className={toastStackItemMotionVariants({\n                enabled: motion,\n                stacked,\n                side,\n                depth,\n              })}\n            >\n              <Toast\n                className={toastMotionVariants({\n                  enabled: motion,\n                  exiting: Boolean(toast.isExiting),\n                })}\n                status={toast.status}\n                duration={duration}\n                progress={progress}\n                onDismiss={() => onDismiss(toast.id)}\n                {...variantProps}\n              >\n                {typeof toast.content === 'string' ? (\n                  <Toast.Message>{toast.content}</Toast.Message>\n                ) : (\n                  toast.content\n                )}\n                {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n                {toast.action &&\n                  (typeof toast.action === 'string' ? (\n                    <Toast.Action>{toast.action}</Toast.Action>\n                  ) : (\n                    toast.action\n                  ))}\n              </Toast>\n            </div>\n          );\n        })}\n      </div>\n    </MotionProvider>\n  );\n};\n\nToastContainer.displayName = 'Toast.Container';\n\nexport { ToastContainer };\n"
    },
    {
      "path": "src/components/toast/ToastDescription.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/ToastDescription.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { ToastDescriptionProps } from './Toast.types';\n\nconst ToastDescription = ({ className, ...props }: ToastDescriptionProps) => (\n  <span\n    data-slot=\"toast-description\"\n    className={cn('text-ws-static-subtle', className)}\n    {...props}\n  />\n);\n\nToastDescription.displayName = 'Toast.Description';\n\nexport { ToastDescription };\nexport type { ToastDescriptionProps };\n"
    },
    {
      "path": "src/components/toast/ToastIconAction.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/ToastIconAction.tsx",
      "content": "'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { IconButton } from '../button/IconButton';\nimport { useToastState } from './Toast.context';\nimport type { ToastIconActionProps } from './Toast.types';\nimport { toastDismissVariants } from './Toast.variants';\n\n/**\n * Icon-only control for the toast's top-right actions cluster (Figma's\n * \"Actions\" frame — e.g. a \"more options\" trigger rendered before the dismiss\n * X). Styled identically to the dismiss button; forwards its ref and props so\n * it can host `DropdownMenu.Trigger asChild`.\n */\nconst ToastIconAction = forwardRef<HTMLButtonElement, ToastIconActionProps>(\n  ({ className, ...props }, ref) => {\n    const { status, variant } = useToastState();\n\n    return (\n      <IconButton\n        ref={ref}\n        data-slot=\"toast-icon-action\"\n        preset=\"ghost\"\n        variant={variant === 'expanded' ? 'secondary' : 'inverse'}\n        size=\"sm\"\n        className={cn(toastDismissVariants({ status, variant }), className)}\n        {...props}\n      />\n    );\n  },\n);\n\nToastIconAction.displayName = 'Toast.IconAction';\n\nexport { ToastIconAction };\n"
    },
    {
      "path": "src/components/toast/ToastMessage.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/toast/ToastMessage.tsx",
      "content": "'use client';\n\nimport type { ToastMessageProps } from './Toast.types';\n\nconst ToastMessage = ({ children }: ToastMessageProps) => <>{children}</>;\n\nToastMessage.displayName = 'Toast.Message';\n\nexport { ToastMessage };\nexport type { ToastMessageProps };\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
