Files

32 lines
3.2 KiB
TypeScript

/** Shared motion contract for centered dialogs and modals. */
export const MODAL_OVERLAY_MOTION_CLASS =
"bg-black/35 backdrop-blur-[4px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:duration-300 data-[state=closed]:duration-200 ease-out motion-reduce:animate-none";
export const MODAL_CONTENT_MOTION_CLASS =
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-[0.98] data-[state=closed]:zoom-out-[0.98] data-[state=open]:slide-in-from-bottom-1 data-[state=closed]:slide-out-to-bottom-1 data-[state=open]:duration-300 data-[state=closed]:duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-[transform,opacity] motion-reduce:animate-none";
/** Right-side drawers keep their spatial origin instead of using centered-dialog motion. */
export const DRAWER_CONTENT_MOTION_CLASS =
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right data-[state=open]:duration-[360ms] data-[state=closed]:duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-[transform,opacity] motion-reduce:animate-none";
/** Direction-agnostic drawer motion for the legacy Sheet primitive. */
export const SHEET_CONTENT_MOTION_CLASS =
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:duration-[360ms] data-[state=closed]:duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-[transform,opacity] motion-reduce:animate-none";
/** Workflow picker variant with an explicit 105%-wide journey from off-screen right. */
export const DRAWER_CONTENT_FULL_FROM_RIGHT_MOTION_CLASS = "hg-drawer-full-from-right will-change-transform";
/** Animates only backdrop properties so nested drawer content never inherits an opacity fade. */
export const DRAWER_OVERLAY_MOTION_CLASS = "hg-drawer-backdrop bg-black/35 backdrop-blur-[4px]";
/** Headless UI exposes transition phases via data attributes. */
export const HEADLESS_MODAL_OVERLAY_MOTION_CLASS =
"bg-black/35 backdrop-blur-[4px] transition-[opacity,backdrop-filter] duration-300 ease-out data-[closed]:opacity-0 data-[closed]:backdrop-blur-none data-[leave]:duration-200 data-[leave]:ease-in motion-reduce:transition-none";
export const HEADLESS_MODAL_CONTENT_MOTION_CLASS =
"transition-[opacity,transform] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] data-[closed]:translate-y-1 data-[closed]:scale-[0.98] data-[closed]:opacity-0 data-[leave]:duration-200 data-[leave]:ease-in will-change-[transform,opacity] motion-reduce:transform-none motion-reduce:transition-none";
/** Overlay plus its direct panel for dialogs rendered through a boolean branch. */
export const MOUNTED_MODAL_SHELL_MOTION_CLASS =
"bg-black/35 backdrop-blur-[4px] animate-in fade-in-0 duration-300 ease-out motion-reduce:animate-none [&>*]:animate-in [&>*]:fade-in-0 [&>*]:zoom-in-[0.98] [&>*]:slide-in-from-bottom-1 [&>*]:duration-300 [&>*]:ease-[cubic-bezier(0.22,1,0.36,1)] [&>*]:will-change-[transform,opacity] motion-reduce:[&>*]:animate-none";