{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"notification-center","type":"registry:block","title":"Notification center","description":"A home for updates with read state, grouped information, and animated disclosure.","categories":["blocks"],"dependencies":["@radix-ui/react-popover","lucide-react","motion"],"registryDependencies":["https://uiarc.dev/r/arc-motion-tokens.json","https://uiarc.dev/r/avatar.json"],"files":[{"path":"registry/components/notification-center/notification-center.tsx","type":"registry:component","target":"@components/arc/notification-center/notification-center.tsx","content":"\"use client\";\n\nimport { useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport { AnimatePresence, animate, motion, useIsPresent, useMotionValue, useReducedMotion, type AnimationPlaybackControls, type HTMLMotionProps, type TargetAndTransition, type Transition, type Variants } from \"motion/react\";\nimport { Bell, Check, CheckCheck, CircleCheck, CircleDot, MessageCircle, TriangleAlert, X } from \"lucide-react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { Avatar } from \"../avatar/avatar\";\nimport { motionTokens } from \"../lib/motion-tokens\";\nimport styles from \"./notification-center.module.css\";\n\nexport interface NotificationItem {\n  id: string;\n  title: string;\n  description?: string;\n  time: string;\n  read?: boolean;\n  tone?: \"info\" | \"success\" | \"warning\";\n  /** A local portrait asset for person-generated updates. */\n  actor?: { name: string; photo: string };\n}\n\nexport interface NotificationCenterProps {\n  notifications: NotificationItem[];\n  label?: string;\n  onReadChange?: (notification: NotificationItem, read: boolean) => void;\n  onDismiss?: (notification: NotificationItem) => void;\n  open?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  avoidCollisions?: boolean;\n}\n\ntype View = \"all\" | \"unread\";\n\nconst enter: Transition = { duration: motionTokens.duration.standard, ease: [...motionTokens.ease.enter] };\nconst exitFast: Transition = { duration: motionTokens.duration.exit, ease: [...motionTokens.ease.standard] };\nconst instant: Transition = { duration: 0 };\nconst textIn: TargetAndTransition = { opacity: 0, y: \"0.3em\", filter: `blur(${motionTokens.blur.soft}px)` };\nconst textOut: TargetAndTransition = { opacity: 0, y: \"-0.3em\", filter: `blur(${motionTokens.blur.subtle}px)`, transition: exitFast };\nconst iconIn: TargetAndTransition = { opacity: 0, scale: .6, filter: `blur(${motionTokens.blur.subtle}px)` };\nconst shown: TargetAndTransition = { opacity: 1, y: \"0em\", scale: 1, filter: \"blur(0px)\" };\nconst fadeOut: TargetAndTransition = { opacity: 0, transition: { duration: motionTokens.duration.instant } };\n/** Bulk actions cascade down the list, capped so the whole sweep stays under a quarter second. */\nconst cascade = (index: number) => Math.min(index * motionTokens.stagger.item, motionTokens.duration.standard);\n\n/** Outgoing copies are hidden from assistive tech while they fade, so live text reads only the current value. */\nfunction Swap(props: HTMLMotionProps<\"span\">) {\n  const present = useIsPresent();\n  return <motion.span {...props} aria-hidden={present ? props[\"aria-hidden\"] : true} />;\n}\n\nfunction SwapText({ children, reduce }: { children: string; reduce: boolean | null }) {\n  return <span className={styles.swap}><AnimatePresence mode=\"popLayout\" initial={false}><Swap key={children} className={styles.swapLine} initial={reduce ? { opacity: 0 } : textIn} animate={shown} exit={reduce ? fadeOut : textOut} transition={reduce ? instant : enter}>{children}</Swap></AnimatePresence></span>;\n}\n\nconst rollVariants: Variants = {\n  enter: (direction: number) => ({ opacity: 0, y: direction >= 0 ? \"0.7em\" : \"-0.7em\", filter: `blur(${motionTokens.blur.subtle}px)` }),\n  center: { opacity: 1, y: \"0em\", filter: \"blur(0px)\" },\n  exit: (direction: number) => ({ opacity: 0, y: direction >= 0 ? \"-0.7em\" : \"0.7em\", filter: `blur(${motionTokens.blur.subtle}px)`, transition: exitFast }),\n};\n\n/** Counts roll like an odometer: a higher number rises from below, a lower one drops from above. */\nfunction RollingCount({ value, display = String(value), reduce }: { value: number; display?: string; reduce: boolean | null }) {\n  const [previous, setPrevious] = useState(value);\n  const [direction, setDirection] = useState(0);\n  if (value !== previous) { setDirection(value > previous ? 1 : -1); setPrevious(value); }\n  return <span className={styles.roll}><AnimatePresence mode=\"popLayout\" initial={false} custom={direction}>\n    <Swap key={display} className={styles.rollValue} custom={direction} variants={reduce ? undefined : rollVariants} initial={reduce ? { opacity: 0 } : \"enter\"} animate={reduce ? { opacity: 1 } : \"center\"} exit={reduce ? fadeOut : \"exit\"} transition={reduce ? instant : { y: motionTokens.spring.snappy, opacity: exitFast, filter: exitFast }}>{display}</Swap>\n  </AnimatePresence></span>;\n}\n\n/** Follows the width of its content. After `morphKey` changes the width springs from the old size to the new one, then returns to auto, so a longer label grows the control instead of snapping it. */\nfunction MorphWidth({ reduce, morphKey, children }: { reduce: boolean | null; morphKey: string; children: ReactNode }) {\n  const frame = useRef<HTMLSpanElement>(null);\n  const content = useRef<HTMLSpanElement>(null);\n  const width = useMotionValue<number | \"auto\">(\"auto\");\n  const changedAt = useRef(0);\n  useLayoutEffect(() => { changedAt.current = performance.now(); }, [morphKey]);\n  useEffect(() => {\n    const node = content.current;\n    if (!node || typeof ResizeObserver === \"undefined\") return;\n    let last: number | undefined;\n    let controls: AnimationPlaybackControls | undefined;\n    const settle = () => { width.jump(\"auto\"); if (frame.current) frame.current.style.width = \"auto\"; };\n    const observer = new ResizeObserver(([entry]) => {\n      if (!entry) return;\n      const next = entry.borderBoxSize?.[0]?.inlineSize ?? node.offsetWidth;\n      const current = width.get();\n      const from = typeof current === \"number\" ? current : last;\n      last = next;\n      controls?.stop();\n      if (reduce || from === undefined || from === next || performance.now() - changedAt.current > 120) return settle();\n      // Pin the old width before this frame paints, then spring to the new one.\n      if (frame.current) frame.current.style.width = `${from}px`;\n      controls = animate(width, [from, next], { ...motionTokens.spring.morph, onComplete: settle });\n    });\n    observer.observe(node);\n    return () => { observer.disconnect(); controls?.stop(); };\n  }, [width, reduce]);\n  return <motion.span ref={frame} className={styles.morph} style={{ width }}><span ref={content} className={styles.morphContent}>{children}</span></motion.span>;\n}\n\nfunction NotificationVisual({ item }: { item: NotificationItem }) {\n  if (item.actor) return <Avatar name={item.actor.name} src={item.actor.photo} size=\"md\" />;\n  return <span className={[styles.eventIcon, styles[item.tone ?? \"info\"]].join(\" \")} aria-hidden=\"true\">\n    {item.tone === \"warning\" ? <TriangleAlert size={18} strokeWidth={1.7} /> : item.tone === \"success\" ? <CircleCheck size={18} strokeWidth={1.7} /> : <MessageCircle size={18} strokeWidth={1.7} />}\n  </span>;\n}\n\nexport function NotificationCenter({ notifications: initial, label = \"Notifications\", onReadChange, onDismiss, open, onOpenChange, avoidCollisions = true }: NotificationCenterProps) {\n  const reduce = useReducedMotion();\n  const layoutId = useId();\n  const [internalOpen, setInternalOpen] = useState(false);\n  const [items, setItems] = useState(initial);\n  const [view, setView] = useState<View>(\"all\");\n  const [expandedId, setExpandedId] = useState<string | null>(null);\n  const [bulk, setBulk] = useState(false);\n  const itemRefs = useRef(new Map<string, HTMLButtonElement>());\n  const allTabRef = useRef<HTMLButtonElement>(null);\n  const unreadTabRef = useRef<HTMLButtonElement>(null);\n  const isOpen = open ?? internalOpen;\n  const unreadCount = useMemo(() => items.filter((item) => !item.read).length, [items]);\n  const readCount = items.length - unreadCount;\n  const visible = view === \"unread\" ? items.filter((item) => !item.read) : items;\n  const summary = unreadCount ? `${unreadCount} update${unreadCount === 1 ? \"\" : \"s\"} waiting for you` : \"You’re all caught up\";\n\n  function setOpen(next: boolean) {\n    if (open === undefined) setInternalOpen(next);\n    onOpenChange?.(next);\n  }\n\n  function toggleRead(item: NotificationItem) {\n    const next = !item.read;\n    if (next && view === \"unread\") {\n      const index = visible.findIndex((entry) => entry.id === item.id);\n      const nextId = visible[index + 1]?.id ?? visible[index - 1]?.id;\n      requestAnimationFrame(() => nextId ? itemRefs.current.get(nextId)?.focus() : unreadTabRef.current?.focus());\n    }\n    setBulk(false);\n    setItems((current) => current.map((entry) => entry.id === item.id ? { ...entry, read: next } : entry));\n    if (next && view === \"unread\") setExpandedId(null);\n    onReadChange?.(item, next);\n  }\n\n  function markAllRead() {\n    items.filter((item) => !item.read).forEach((item) => onReadChange?.(item, true));\n    setBulk(true);\n    setItems((current) => current.map((item) => ({ ...item, read: true })));\n    setExpandedId(null);\n    requestAnimationFrame(() => (view === \"unread\" ? unreadTabRef : allTabRef).current?.focus());\n  }\n\n  function dismiss(item: NotificationItem) {\n    const index = visible.findIndex((entry) => entry.id === item.id);\n    const nextId = visible[index + 1]?.id ?? visible[index - 1]?.id;\n    requestAnimationFrame(() => nextId ? itemRefs.current.get(nextId)?.focus() : unreadTabRef.current?.focus());\n    setBulk(false);\n    setItems((current) => current.filter((entry) => entry.id !== item.id));\n    if (expandedId === item.id) setExpandedId(null);\n    onDismiss?.(item);\n  }\n\n  function clearRead() {\n    items.filter((item) => item.read).forEach((item) => onDismiss?.(item));\n    setBulk(true);\n    setItems((current) => current.filter((item) => !item.read));\n    requestAnimationFrame(() => allTabRef.current?.focus());\n  }\n\n  const height: Transition = reduce ? instant : { height: motionTokens.spring.smooth, opacity: enter };\n\n  return <PopoverPrimitive.Root open={isOpen} onOpenChange={setOpen}>\n    <PopoverPrimitive.Trigger asChild>\n      {/* The trigger anchors the panel, so it gives press feedback with color only; scaling it would shift the panel. */}\n      <button className={styles.trigger} type=\"button\" aria-label={`${label}${unreadCount ? `, ${unreadCount} unread` : \"\"}`}>\n        <motion.span animate={{ rotate: isOpen && !reduce ? -12 : 0 }} transition={reduce ? instant : motionTokens.spring.snappy}><Bell size={19} strokeWidth={1.75} aria-hidden=\"true\" /></motion.span>\n        <AnimatePresence initial={false}>{unreadCount > 0 && <motion.span key=\"badge\" className={styles.badge} aria-hidden=\"true\" initial={reduce ? { opacity: 0 } : { opacity: 0, scale: .6 }} animate={{ opacity: 1, scale: 1 }} exit={reduce ? fadeOut : { opacity: 0, scale: .6, transition: exitFast }} transition={reduce ? instant : motionTokens.spring.snappy}><RollingCount value={unreadCount} display={unreadCount > 9 ? \"9+\" : String(unreadCount)} reduce={reduce} /></motion.span>}</AnimatePresence>\n      </button>\n    </PopoverPrimitive.Trigger>\n    <PopoverPrimitive.Portal>\n      <PopoverPrimitive.Content className={styles.panel} align=\"center\" side=\"bottom\" sideOffset={12} collisionPadding={12} avoidCollisions={avoidCollisions} aria-label={label}>\n        <div className={styles.header}>\n          <div><div className={styles.heading}><h2>{label}</h2><span className={styles.count}><RollingCount value={unreadCount} reduce={reduce} /></span></div><p aria-live=\"polite\"><SwapText reduce={reduce}>{summary}</SwapText></p></div>\n          <PopoverPrimitive.Close className={styles.close} aria-label=\"Close notifications\"><X size={17} strokeWidth={1.75} aria-hidden=\"true\" /></PopoverPrimitive.Close>\n        </div>\n\n        <div className={styles.toolbar}>\n          <div className={styles.viewSwitch} role=\"group\" aria-label=\"Show notifications\">\n            {([\"all\", \"unread\"] as const).map((next) => <button key={next} ref={next === \"unread\" ? unreadTabRef : allTabRef} type=\"button\" className={view === next ? styles.viewActive : undefined} aria-pressed={view === next} onClick={() => { setBulk(false); setView(next); setExpandedId(null); }}>{view === next && <motion.span className={styles.viewHighlight} layoutId={`${layoutId}-view`} transition={reduce ? instant : motionTokens.spring.morph} />}<span>{next === \"all\" ? \"All\" : \"Unread\"}</span></button>)}\n          </div>\n          <AnimatePresence initial={false}>{unreadCount > 0 && <motion.button key=\"mark-all\" type=\"button\" className={styles.markAll} onClick={markAllRead} initial={reduce ? { opacity: 0 } : { opacity: 0, filter: `blur(${motionTokens.blur.subtle}px)` }} animate={{ opacity: 1, filter: \"blur(0px)\" }} exit={reduce ? fadeOut : { opacity: 0, filter: `blur(${motionTokens.blur.subtle}px)`, transition: exitFast }} transition={reduce ? instant : enter}><CheckCheck size={15} strokeWidth={1.75} aria-hidden=\"true\" /><span>Mark all read</span></motion.button>}</AnimatePresence>\n        </div>\n\n        {/* Rows collapse their own height on the way out, so the list and the panel close the gap together. */}\n        <div className={styles.list} role=\"list\" aria-label={view === \"all\" ? \"All notifications\" : \"Unread notifications\"}>\n          <AnimatePresence initial={false} custom={bulk}>\n            {visible.map((item, index) => <motion.div key={item.id} role=\"listitem\" className={styles.row} custom={bulk}\n              variants={{ exit: (isBulk: boolean) => reduce ? fadeOut : { height: 0, opacity: 0, transition: { height: { ...motionTokens.spring.smooth, delay: isBulk ? cascade(index) : 0 }, opacity: { ...exitFast, delay: isBulk ? cascade(index) : 0 } } } }}\n              initial={reduce ? { opacity: 0 } : { height: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit=\"exit\" transition={height}>\n              <article className={[styles.item, item.read ? styles.itemRead : \"\", expandedId === item.id ? styles.itemExpanded : \"\"].filter(Boolean).join(\" \")} style={{ \"--index\": Math.min(index, 7) } as CSSProperties}>\n                <div className={styles.itemMain}>\n                  <NotificationVisual item={item} />\n                  <button ref={(node) => { if (node) itemRefs.current.set(item.id, node); else itemRefs.current.delete(item.id); }} type=\"button\" className={styles.itemToggle} aria-expanded={expandedId === item.id} aria-label={`${item.title}${item.read ? \"\" : \", unread\"}. ${expandedId === item.id ? \"Hide details\" : \"Show details\"}`} onClick={() => setExpandedId((current) => current === item.id ? null : item.id)}>\n                    <span className={styles.itemTitle}><strong>{item.title}</strong>\n                      <AnimatePresence initial={false} custom={bulk}>{!item.read && <motion.span key=\"dot\" className={styles.unreadDot} aria-hidden=\"true\" custom={bulk}\n                        variants={{ exit: (isBulk: boolean) => reduce ? fadeOut : { opacity: 0, scale: .7, transition: { ...exitFast, delay: isBulk ? cascade(index) : 0 } } }}\n                        initial={reduce ? { opacity: 0 } : { opacity: 0, scale: .7 }} animate={{ opacity: 1, scale: 1 }} exit=\"exit\" transition={reduce ? instant : motionTokens.spring.snappy} />}</AnimatePresence>\n                    </span>\n                    <span className={styles.itemPreview}>{item.description ?? (item.actor ? `From ${item.actor.name}` : \"View update details\")}</span>\n                  </button>\n                  <time className={styles.time}>{item.time}</time>\n                </div>\n                <AnimatePresence initial={false}>\n                  {expandedId === item.id && <motion.div className={styles.details} initial={reduce ? { opacity: 0 } : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? fadeOut : { height: 0, opacity: 0, transition: { height: motionTokens.spring.smooth, opacity: exitFast } }} transition={height}>\n                    <p>{item.description ?? (item.actor ? `${item.actor.name} shared an update with you.` : \"This update is ready to review.\")}</p>\n                    <div className={styles.itemActions}>\n                      <button type=\"button\" onClick={() => toggleRead(item)}><MorphWidth reduce={reduce} morphKey={item.read ? \"read\" : \"unread\"}>\n                        <span className={styles.actionIcon}><AnimatePresence mode=\"popLayout\" initial={false}><Swap key={item.read ? \"unread\" : \"read\"} className={styles.actionGlyph} initial={reduce ? { opacity: 0 } : iconIn} animate={shown} exit={reduce ? fadeOut : { ...iconIn, transition: exitFast }} transition={reduce ? instant : motionTokens.spring.snappy}>{item.read ? <CircleDot size={14} strokeWidth={1.75} aria-hidden=\"true\" /> : <Check size={14} strokeWidth={1.75} aria-hidden=\"true\" />}</Swap></AnimatePresence></span>\n                        <SwapText reduce={reduce}>{item.read ? \"Mark unread\" : \"Mark read\"}</SwapText>\n                      </MorphWidth></button>\n                      <button type=\"button\" onClick={() => dismiss(item)}><X size={14} strokeWidth={1.75} aria-hidden=\"true\" />Dismiss</button>\n                    </div>\n                  </motion.div>}\n                </AnimatePresence>\n              </article>\n            </motion.div>)}\n            {/* The empty state opens its height on the same spring the rows close on, so the panel morphs between them instead of stacking both. After a bulk action it waits for the cascade to get going, so the panel never grows before it shrinks. */}\n            {visible.length === 0 && <motion.div key=\"empty\" className={styles.emptyFrame} initial={reduce ? { opacity: 0 } : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? fadeOut : { height: 0, opacity: 0, transition: { height: motionTokens.spring.smooth, opacity: exitFast } }} transition={reduce ? instant : { height: { ...motionTokens.spring.smooth, delay: bulk ? cascade(3) : 0 }, opacity: { ...enter, delay: motionTokens.duration.fast } }}>\n              <motion.div className={styles.empty} initial={reduce ? false : { y: 6 }} animate={{ y: 0 }} transition={reduce ? instant : { ...enter, delay: motionTokens.duration.fast }}><CircleCheck size={24} strokeWidth={1.5} aria-hidden=\"true\" /><strong><SwapText reduce={reduce}>{view === \"unread\" ? \"Nothing unread\" : \"All clear\"}</SwapText></strong><p><SwapText reduce={reduce}>{view === \"unread\" ? \"You’ve seen every update.\" : \"New updates will appear here.\"}</SwapText></p>{view === \"unread\" && items.length > 0 && <button type=\"button\" onClick={() => { setBulk(false); setView(\"all\"); }}>View all updates</button>}</motion.div>\n            </motion.div>}\n          </AnimatePresence>\n        </div>\n\n        <AnimatePresence initial={false}>{readCount > 0 && <motion.div key=\"footer\" className={styles.footerFrame} initial={reduce ? { opacity: 0 } : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? fadeOut : { height: 0, opacity: 0, transition: { height: motionTokens.spring.smooth, opacity: exitFast } }} transition={height}>\n          <div className={styles.footer}><span><RollingCount value={readCount} reduce={reduce} /> read</span><button type=\"button\" onClick={clearRead}>Clear read</button></div>\n        </motion.div>}</AnimatePresence>\n      </PopoverPrimitive.Content>\n    </PopoverPrimitive.Portal>\n  </PopoverPrimitive.Root>;\n}\n\nexport default NotificationCenter;\n"},{"path":"registry/components/notification-center/notification-center.module.css","type":"registry:component","target":"@components/arc/notification-center/notification-center.module.css","content":".trigger { position: relative; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--foreground); cursor: pointer; transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard); }\n.trigger[data-state=\"open\"], .trigger:active { border-color: var(--border-strong); background: var(--surface-muted); }\n@media (hover: hover) and (pointer: fine) { .trigger:hover { border-color: var(--border-strong); background: var(--surface-muted); } }\n.trigger > span:first-child { display: grid; place-items: center; }\n.badge { position: absolute; top: -6px; right: -6px; display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; overflow: hidden; border: 2px solid var(--surface); border-radius: var(--radius-pill); background: var(--foreground); color: var(--background); font-size: var(--text-xs); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }\n.panel { z-index: 90; display: flex; flex-direction: column; width: min(424px, calc(100vw - 24px)); max-height: min(590px, calc(100vh - 24px)); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface-raised); color: var(--foreground); box-shadow: var(--shadow-floating); font-family: var(--font-body); letter-spacing: var(--tracking-body); transform-origin: var(--radix-popover-content-transform-origin); }\n/* The panel grows out of the bell: it starts a few pixels toward the trigger on whichever side Radix placed it, and leaves faster than it arrives. */\n.panel { --panel-x: 0px; --panel-y: -6px; }\n.panel[data-side=\"top\"] { --panel-y: 6px; }\n.panel[data-side=\"left\"] { --panel-x: 6px; --panel-y: 0px; }\n.panel[data-side=\"right\"] { --panel-x: -6px; --panel-y: 0px; }\n.panel[data-state=\"open\"] { animation: panel-open var(--duration-standard) var(--ease-enter) both; }\n.panel[data-state=\"closed\"] { animation: panel-close var(--duration-instant) var(--ease-standard) both; }\n.header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 23px 24px 18px; }\n.heading { display: flex; align-items: center; gap: var(--space-2); }\n.heading h2 { margin: 0; font-size: var(--text-xl); font-weight: 500; letter-spacing: var(--tracking-body); line-height: 1.2; }\n.count { display: grid; min-width: 21px; height: 21px; padding: 0 5px; place-items: center; overflow: hidden; border-radius: 7px; background: var(--surface-muted); color: var(--text-secondary); font-size: var(--text-xs); line-height: 1; font-variant-numeric: tabular-nums; }\n.header p { position: relative; margin: 4px 0 0; color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); }\n.close { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; transition: transform var(--duration-spring) var(--ease-spring), color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard); }\n.close:active { transform: scale(.96); }\n.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 17px 13px 20px; border-bottom: 1px solid var(--border-subtle); }\n.viewSwitch { display: inline-flex; align-items: center; gap: 3px; }\n.viewSwitch button { position: relative; isolation: isolate; min-width: 61px; height: 31px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--text-xs); cursor: pointer; transition: color var(--duration-fast) var(--ease-standard); }\n.viewSwitch .viewActive { color: var(--foreground); }\n.viewSwitch button > span:last-child { position: relative; z-index: 1; }\n.viewHighlight { position: absolute; z-index: -1; inset: 0; border-radius: 9px; background: var(--surface-muted); }\n.markAll { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--text-xs); white-space: nowrap; cursor: pointer; transition: transform var(--duration-spring) var(--ease-spring), color var(--duration-fast) var(--ease-standard); }\n.markAll:active { transform: scale(.97); }\n.list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 9px 11px 10px; scrollbar-width: none; }\n.list::-webkit-scrollbar { display: none; }\n.row { overflow: hidden; }\n/* Rows settle in with a short cascade when the panel opens or a view adds them. */\n.item { position: relative; padding: 10px; border-radius: calc(var(--radius-panel) - 12px); transition: background var(--duration-fast) var(--ease-standard); animation: item-in var(--duration-standard) var(--ease-enter) calc(var(--index, 0) * 35ms) both; }\n.itemExpanded { background: var(--surface-muted); }\n.itemRead .itemTitle strong { color: var(--text-secondary); }\n.itemMain { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }\n.eventIcon { display: grid; width: 36px; height: 36px; flex: none; place-items: center; color: var(--accent); }\n.eventIcon.success { color: var(--success); }\n.eventIcon.warning { color: var(--warning); }\n.itemToggle { display: grid; min-width: 0; flex: 1; gap: 4px; padding: 2px 0 0; border: 0; background: transparent; color: var(--foreground); text-align: left; font: inherit; cursor: pointer; }\n.itemTitle { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 20px; }\n.itemTitle strong { overflow: hidden; font-size: var(--text-sm); font-weight: 500; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }\n.unreadDot { display: block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--foreground); }\n.itemPreview { overflow: hidden; color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); text-overflow: ellipsis; white-space: nowrap; }\n.time { flex: none; padding-top: 4px; color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); font-variant-numeric: tabular-nums; white-space: nowrap; }\n.details { overflow: hidden; padding-left: 47px; }\n.details p { margin: 12px 0; color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); }\n.itemActions { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 5px; }\n.itemActions button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; overflow: clip; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--foreground); font: inherit; font-size: var(--text-xs); line-height: 1; white-space: nowrap; cursor: pointer; transition: transform var(--duration-spring) var(--ease-spring), border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard); }\n.itemActions button:active { transform: scale(.97); }\n/* Quick press, spring release: the resting transition above carries the spring back. */\n.close:active, .markAll:active, .itemActions button:active, .footer button:active { transition-duration: var(--duration-instant); transition-timing-function: var(--ease-standard); }\n.morph { display: inline-flex; align-items: center; }\n.morphContent { position: relative; display: inline-flex; width: max-content; align-items: center; gap: 5px; }\n.actionIcon, .actionGlyph { position: relative; display: grid; place-items: center; }\n.swap { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }\n.swapLine { display: block; }\n.roll { position: relative; display: inline-grid; vertical-align: top; }\n.rollValue { display: block; }\n.emptyFrame { overflow: hidden; }\n.empty { display: grid; justify-items: center; align-content: center; min-height: 190px; padding: 22px 12px; text-align: center; }\n.empty > svg { margin-bottom: 13px; color: var(--text-muted); }\n.empty strong { font-size: var(--text-sm); font-weight: 500; }\n.empty p { margin: 4px 0 0; color: var(--text-secondary); font-size: var(--text-xs); }\n.empty button { margin-top: 16px; padding: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: var(--text-xs); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }\n.footerFrame { flex: none; overflow: hidden; }\n.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 22px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: var(--text-xs); }\n.footer button { padding: 4px 0; border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--text-xs); cursor: pointer; transition: transform var(--duration-spring) var(--ease-spring), color var(--duration-fast) var(--ease-standard); }\n.footer button:active { transform: scale(.97); }\n@media (hover: hover) and (pointer: fine) {\n  .close:hover, .item:hover { background: var(--surface-muted); }\n  .close:hover, .viewSwitch button:hover, .markAll:hover, .footer button:hover { color: var(--foreground); }\n  .itemActions button:hover { border-color: var(--border-strong); background: var(--surface); }\n}\n@keyframes panel-open { from { opacity: 0; transform: translate(var(--panel-x), var(--panel-y)) scale(.97); } }\n@keyframes panel-close { to { opacity: 0; transform: translate(calc(var(--panel-x) / 2), calc(var(--panel-y) / 2)) scale(.98); } }\n@keyframes item-in { from { opacity: 0; transform: translateY(4px); } }\n@media (max-width: 380px) { .header { padding: 20px 16px 16px; } .heading h2 { font-size: var(--text-lg); } .toolbar { align-items: flex-start; padding: 0 12px 12px; } .list { padding: 8px 5px; } .item { padding-inline: 7px; } .itemMain { gap: 7px; } .details { padding-left: 43px; } .itemActions { gap: 5px; } .itemActions button { padding-inline: 7px; } .markAll span { display: none; } .footer { padding-inline: 16px; } }\n@media (prefers-reduced-motion: reduce) { .panel[data-state], .trigger, .close, .viewSwitch button, .markAll, .item, .itemActions button, .footer button { animation: none; transition-duration: 0ms; } .close:active, .markAll:active, .itemActions button:active, .footer button:active { transform: none; } }\n"}],"docs":"Use it when updates need a persistent home instead of a brief toast. Connect read state to your data store.","meta":{"tier":"free","kind":"block","builtFrom":["Popover","Badge","Action list"],"docs":"https://uiarc.dev/components/blocks/notification-center"}}