@atom63/inform 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/README.md +25 -0
- package/dist/chunk-KT6PQL7E.js +554 -0
- package/dist/chunk-KT6PQL7E.js.map +1 -0
- package/dist/chunk-OGT26DRQ.js +222 -0
- package/dist/chunk-OGT26DRQ.js.map +1 -0
- package/dist/flyout-stack-BvsgCm0f.d.ts +26 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/persistence-DkSUn_qI.d.ts +18 -0
- package/dist/react/index.d.ts +42 -0
- package/dist/react/index.js +128 -0
- package/dist/react/index.js.map +1 -0
- package/dist/surfaces/index.d.ts +160 -0
- package/dist/surfaces/index.js +3 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/types-7x7Ygbcz.d.ts +75 -0
- package/package.json +92 -0
- package/src/styles.css +17 -0
- package/src/surfaces/inform-banner.css +28 -0
- package/src/surfaces/inform-corner-flyout.css +73 -0
- package/src/surfaces/inform-dialog.css +24 -0
- package/src/surfaces/inform-parts.css +176 -0
- package/src/surfaces/inform-spotlight.css +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/surfaces/control-slot.ts","../src/lib/cn.ts","../src/surfaces/dismiss-button.tsx","../src/surfaces/icon-slot.tsx","../src/surfaces/inform-actions.tsx","../src/surfaces/severity.ts","../src/surfaces/severity-icon.tsx","../src/surfaces/inform-banner.tsx","../src/surfaces/flyout-stack.tsx","../src/surfaces/media-slot.tsx","../src/surfaces/inform-corner-flyout.tsx","../src/surfaces/inform-dialog.tsx","../src/surfaces/use-anchor-rect.ts","../src/surfaces/place-bubble.ts","../src/surfaces/inform-spotlight.tsx"],"names":["jsx","jsxs","useState","useRef","useEffect","useLayoutEffect"],"mappings":";;;;;;AAgBO,IAAM,eAAA,GAAkB;;;ACfxB,SAAS,MAAM,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IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,QAAA,EAAA;AAAA,YAAA,YAAA,KAAiB,IAAA,GAAO,IAAA,mBAAOD,GAAAA,CAAC,kBAAgB,QAAA,EAAA,YAAA,EAAa,CAAA;AAAA,4BAC9DC,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,oBAAA,EACZ,QAAA,EAAA;AAAA,cAAA,KAAA,KAAU,MAAA,GAAY,IAAA,mBACrBD,GAAAA,CAAC,OAAE,SAAA,EAAW,EAAA,CAAG,kBAAA,EAAoB,mBAAA,CAAoB,QAAQ,CAAC,CAAA,EAAG,EAAA,EAAI,SACtE,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,8BAEFA,GAAAA,CAAC,GAAA,EAAA,EAAE,WAAU,iBAAA,EAAkB,EAAA,EAAI,QAChC,QAAA,EAAA,IAAA,EACH,CAAA;AAAA,cACC,YAAY,MAAA,GAAY,IAAA,mBAAOA,GAAAA,CAAC,iBAAc,OAAA,EAAkB;AAAA,aAAA,EACnE;AAAA,WAAA,EACF;AAAA;AAAA;AACF,KAAA,EACF,CAAA;AAAA,IACA,QAAA,CAAS;AAAA,GACX;AACF","file":"chunk-KT6PQL7E.js","sourcesContent":["/*\n * Geometry shared by everything that sits in a message row's gutters — the\n * leading icon and the trailing dismiss control.\n *\n * Both slots are exactly one line tall. That is the whole trick: give the\n * gutters the same height as the first line of text and, laid out from the\n * top, their optical centres coincide with it for free. No magic offset, and\n * it holds whether the message is one line or a title plus three.\n *\n * The slot class carries the matching typography as well as the size: `1lh`\n * resolves against the SLOT's own line-height, not the text beside it, and\n * inheriting it silently produced the wrong height in the flyout, where the\n * slot sits outside the styled text block. See `inform-parts.css`.\n */\n\n/** One line box. Matches the first line of text the slot sits beside. */\nexport const SLOT_SIZE_CLASS = 'a63-Inform-slot'\n","/** Joins class names, skipping empty ones. The package has no utility classes to merge. */\nexport function cn(...inputs: (string | false | null | undefined)[]): string {\n return inputs.filter(Boolean).join(' ')\n}\n","import type { ReactElement } from 'react'\n\nimport { cn } from '../lib/cn'\nimport { SLOT_SIZE_CLASS } from './control-slot'\n\nexport type InformDismissButtonProps = {\n label?: string\n onDismiss?: () => void\n className?: string\n}\n\n/**\n * Dismiss control for a message row's trailing gutter.\n *\n * Its layout box is one line tall so it aligns with the first line of text the\n * same way the leading icon does; the 24px WCAG target is an invisible\n * expansion that costs no layout. Sizing the box itself to the target is what\n * previously pushed the icon below the text and needed a per-surface offset to\n * undo.\n */\nexport function InformDismissButton({\n className,\n label = 'Dismiss',\n onDismiss,\n}: InformDismissButtonProps): ReactElement {\n return (\n <button\n aria-label={label}\n className={cn(SLOT_SIZE_CLASS, 'a63-InformDismissButton', className)}\n onClick={onDismiss}\n type=\"button\"\n >\n <svg\n aria-hidden\n fill=\"none\"\n height=\"14\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeWidth=\"1.5\"\n viewBox=\"0 0 16 16\"\n width=\"14\"\n >\n <path d=\"M4 4l8 8M12 4l-8 8\" />\n </svg>\n </button>\n )\n}\n","import type { ReactElement, ReactNode } from 'react'\n\nimport { cn } from '../lib/cn'\nimport { SLOT_SIZE_CLASS } from './control-slot'\n\nexport type InformIconSlotProps = {\n children: ReactNode\n className?: string\n}\n\n/**\n * Fixed-footprint holder for a leading icon.\n *\n * The box is one line tall regardless of what is passed, so a 14px glyph and a\n * 20px glyph produce the same layout and the glyph lands on the optical centre\n * of the first line beside it. Being decorative, it owes no touch target.\n *\n * Severity must be carried by the message text, not the glyph, so anything\n * passed here should be `aria-hidden`.\n */\nexport function InformIconSlot({ children, className }: InformIconSlotProps): ReactElement {\n return (\n <span className={cn(SLOT_SIZE_CLASS, 'a63-InformIconSlot', className)} data-slot=\"inform-icon\">\n {children}\n </span>\n )\n}\n","import { Button } from '@atom63/ui-react'\nimport type { ReactElement } from 'react'\n\nimport type { InformAction } from '../core/types'\nimport { cn } from '../lib/cn'\n\nexport type InformActionsProps = {\n actions: readonly InformAction[]\n className?: string\n}\n\nexport function InformActions({ actions, className }: InformActionsProps): ReactElement | null {\n if (actions.length === 0) return null\n\n return (\n <div className={cn('a63-InformActions', className)}>\n {actions.map(action => (\n <Button\n key={action.id}\n onClick={action.onSelect}\n size=\"sm\"\n type=\"button\"\n variant={action.variant === 'primary' ? 'primary' : 'outline'}\n >\n {action.label}\n </Button>\n ))}\n </div>\n )\n}\n","import type { InformSeverity } from '../core/types'\n\n/*\n * `info` is deliberately neutral: it is the default editorial voice of the\n * system and must render exactly like the site's existing notice. Only the\n * louder severities spend color. The classes are defined in `inform-parts.css`.\n */\nexport const SEVERITY_BORDER_CLASS: Record<InformSeverity, string> = {\n info: 'a63-Inform-border-info',\n success: 'a63-Inform-border-success',\n warning: 'a63-Inform-border-warning',\n danger: 'a63-Inform-border-danger',\n}\n\nexport const SEVERITY_TEXT_CLASS: Record<InformSeverity, string> = {\n info: 'a63-Inform-text-info',\n success: 'a63-Inform-text-success',\n warning: 'a63-Inform-text-warning',\n danger: 'a63-Inform-text-danger',\n}\n","import type { ReactElement, ReactNode } from 'react'\n\nimport type { InformSeverity } from '../core/types'\n\n/*\n * Hand-drawn rather than pulled from an icon library: the package ships with no\n * icon dependency, and four glyphs is not worth one. They share a 24px viewBox,\n * a 1.5 stroke, and round caps so they sit consistently in the icon slot.\n *\n * Decorative by contract — `aria-hidden` is set here, not left to the caller.\n * Severity is carried by the message text; a glyph with an accessible name only\n * adds noise to the surface's `role=\"status\"` announcement.\n */\nconst PATHS: Record<InformSeverity, ReactElement> = {\n info: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 11v5M12 7.5h.01\" strokeLinecap=\"round\" />\n </>\n ),\n success: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"m8.5 12.2 2.4 2.4 4.6-4.9\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </>\n ),\n warning: (\n <>\n <path d=\"M12 4.5 21 19.5H3L12 4.5Z\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M12 10v4M12 17h.01\" strokeLinecap=\"round\" />\n </>\n ),\n danger: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"m9.2 9.2 5.6 5.6M14.8 9.2l-5.6 5.6\" strokeLinecap=\"round\" />\n </>\n ),\n}\n\nexport type InformSeverityIconProps = {\n severity: InformSeverity\n}\n\nexport function InformSeverityIcon({ severity }: InformSeverityIconProps): ReactElement {\n return (\n <svg aria-hidden fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" viewBox=\"0 0 24 24\">\n {PATHS[severity]}\n </svg>\n )\n}\n\n/**\n * Resolves the icon slot's contents.\n *\n * Omitting `icon` gets the severity's default glyph — a status message should\n * look like one without every call site restating it. Passing `null` opts out\n * explicitly, which is the escape hatch for surfaces that carry their meaning\n * some other way.\n */\nexport function resolveInformIcon(\n icon: ReactNode | undefined,\n severity: InformSeverity\n): ReactNode {\n if (icon === undefined) return <InformSeverityIcon severity={severity} />\n return icon\n}\n","import type { ReactElement } from 'react'\n\nimport { cn } from '../lib/cn'\nimport { InformDismissButton } from './dismiss-button'\nimport { InformIconSlot } from './icon-slot'\nimport { resolveInformIcon } from './severity-icon'\nimport { InformActions } from './inform-actions'\nimport { SEVERITY_BORDER_CLASS, SEVERITY_TEXT_CLASS } from './severity'\nimport type { InformSurfaceProps } from './types'\n\n/**\n * In-flow, non-interrupting notice. Stays in document flow so it scrolls away\n * with the page rather than competing with the sticky header.\n *\n * Text is start aligned. Both gutter slots are exactly one line tall, so laying\n * the row out from the top puts them on the first line's optical centre — which\n * is the same thing as the banner's centre when the message is a single line,\n * and stays anchored to the title when it is not.\n *\n * Padding is equal on both axes: the row's height now follows the text rather\n * than a 24px touch target, so equal padding reads as an equal well.\n */\nexport function InformBanner({\n actions,\n body,\n icon,\n className,\n dismissLabel,\n dismissable = false,\n onDismiss,\n severity = 'info',\n title,\n}: InformSurfaceProps): ReactElement {\n const resolvedIcon = resolveInformIcon(icon, severity)\n\n return (\n <div\n aria-live=\"polite\"\n className={cn('a63-InformBanner', SEVERITY_BORDER_CLASS[severity], className)}\n data-severity={severity}\n role=\"status\"\n >\n {resolvedIcon === null ? null : <InformIconSlot>{resolvedIcon}</InformIconSlot>}\n {/*\n Title and body carry no margins of their own, so their line boxes would\n otherwise touch and leave only the leading (~2.5px) between them. One\n space unit reads as a grouped pair rather than a run-on.\n */}\n <div className=\"a63-Inform-content\">\n {title === undefined ? null : (\n <p className={cn('a63-Inform-title', SEVERITY_TEXT_CLASS[severity])}>{title}</p>\n )}\n <p className=\"a63-Inform-body\">{body}</p>\n {actions === undefined ? null : <InformActions actions={actions} />}\n </div>\n {dismissable ? <InformDismissButton label={dismissLabel} onDismiss={onDismiss} /> : null}\n </div>\n )\n}\n","import { Children, useCallback, useLayoutEffect, useRef, useState } from 'react'\nimport type { CSSProperties, ReactElement, ReactNode } from 'react'\n\nimport { cn } from '../lib/cn'\n\nexport type InformFlyoutPlacement = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n\nexport type InformFlyoutStackProps = {\n children: ReactNode\n placement?: InformFlyoutPlacement\n /** CSS length for the inset on the anchored edge. Pass app chrome clearance here. */\n offset?: string\n className?: string\n}\n\n/** How much of each card behind the front one stays visible when collapsed. */\nconst PEEK_PX = 14\n\n/** How much narrower each card behind the front one looks. */\nconst SCALE_STEP = 0.05\n\n/** Gap between cards once the stack is expanded. */\nconst EXPANDED_GAP_PX = 8\n\nfunction isTopAnchored(placement: InformFlyoutPlacement): boolean {\n return placement.startsWith('top')\n}\n\n/**\n * Positioned container for the corner flyout stack.\n *\n * Collapsed, it behaves the way a toast stack does: the front card is fully\n * visible and the ones behind it peek out, each a little narrower, so three\n * messages read as one stack rather than three loose cards. Hover — or focus\n * anywhere inside, which is what keeps a keyboard able to reach the back cards\n * — expands it into the full list.\n *\n * The offsets have to be measured rather than expressed in CSS: each card sits\n * relative to the height of the ones in front of it, and those heights depend\n * on their content.\n */\nexport function InformFlyoutStack({\n children,\n className,\n offset = '1rem',\n placement = 'bottom-right',\n}: InformFlyoutStackProps): ReactElement {\n const items = Children.toArray(children)\n const count = items.length\n const top = isTopAnchored(placement)\n\n const [expanded, setExpanded] = useState(false)\n const [heights, setHeights] = useState<number[]>([])\n const itemRefs = useRef<(HTMLDivElement | null)[]>([])\n\n const measure = useCallback(() => {\n /*\n * Measure the WRAPPER, and with `offsetHeight`.\n *\n * The wrapper because it survives: cards are keyed by message id, so\n * dismissing one swaps every card node below it while the wrappers stay\n * put. An observer bound to the card was left watching a detached node, so\n * heights went stale the moment the set changed — visible as a gap of 26px\n * where 8px belonged, after two dismissals in a row.\n *\n * `offsetHeight` because a collapsed card is scaled down and a bounding\n * rect reports the SCALED height, which placed every expanded card short.\n */\n const next = itemRefs.current.slice(0, count).map(element => element?.offsetHeight ?? 0)\n setHeights(previous =>\n previous.length === next.length && previous.every((value, index) => value === next[index])\n ? previous\n : next\n )\n }, [count])\n\n // Measure before paint, then keep watching: a card's height changes with a\n // late font, a longer translation, or content that arrives after mount.\n useLayoutEffect(() => {\n measure()\n if (typeof ResizeObserver === 'undefined') return\n\n const observer = new ResizeObserver(measure)\n for (const element of itemRefs.current.slice(0, count)) {\n if (element != null) observer.observe(element)\n }\n return () => {\n observer.disconnect()\n }\n }, [measure, count, expanded])\n\n const heightOf = (index: number): number => heights[index] ?? 0\n\n const offsetFor = (index: number): number => {\n if (!expanded) return index * PEEK_PX\n let total = 0\n for (let i = 0; i < index; i += 1) total += heightOf(i) + EXPANDED_GAP_PX\n return total\n }\n\n const totalHeight = items.reduce<number>((sum, _item, index) => sum + heightOf(index), 0)\n const containerHeight = expanded\n ? totalHeight + (count - 1) * EXPANDED_GAP_PX\n : heightOf(0) + (count - 1) * PEEK_PX\n\n const itemStyle = (index: number): CSSProperties => ({\n position: 'absolute',\n insetInline: 0,\n [top ? 'top' : 'bottom']: 0,\n // Cards in front must paint over the ones behind them.\n zIndex: count - index,\n transform: `translateY(${(top ? 1 : -1) * offsetFor(index)}px) scale(${\n expanded ? 1 : 1 - index * SCALE_STEP\n })`,\n transformOrigin: top ? 'top center' : 'bottom center',\n })\n\n return (\n <div\n // The corner's inline edge and the pointer handling live in the\n // stylesheet: the container ignores the pointer and the cards take it\n // back, so the page stays clickable through the gaps between them.\n className={cn('a63-InformFlyoutStack', className)}\n data-expanded={expanded ? '' : undefined}\n data-placement={placement}\n data-slot=\"inform-flyout-stack\"\n data-testid=\"inform-flyout-stack\"\n onBlur={event => {\n if (!event.currentTarget.contains(event.relatedTarget)) setExpanded(false)\n }}\n onFocus={() => {\n setExpanded(true)\n }}\n onMouseEnter={() => {\n setExpanded(true)\n }}\n onMouseLeave={() => {\n setExpanded(false)\n }}\n style={{\n [top ? 'top' : 'bottom']: offset,\n height: containerHeight === 0 ? undefined : containerHeight,\n }}\n >\n {items.map((item, index) => (\n <div\n className=\"a63-InformFlyoutStack-item\"\n data-slot=\"inform-flyout-item\"\n key={index}\n ref={element => {\n itemRefs.current[index] = element\n }}\n style={itemStyle(index)}\n >\n {item}\n </div>\n ))}\n </div>\n )\n}\n","import type { ReactElement, ReactNode } from 'react'\n\nimport { cn } from '../lib/cn'\n\nexport type InformThumbnailProps = {\n children: ReactNode\n className?: string\n}\n\n/**\n * Bounded leading thumbnail, for surfaces whose height is load-bearing.\n *\n * A flyout's height feeds the stack's offsets, and three cards have to fit a\n * phone: full-width 16:9 media would add ~198px per card at this width, so\n * three would overflow a laptop viewport, never mind a phone. A fixed square\n * keeps the card's height within a few pixels of its text.\n */\nexport function InformThumbnail({ children, className }: InformThumbnailProps): ReactElement {\n return (\n <span className={cn('a63-InformThumbnail', className)} data-slot=\"inform-thumbnail\">\n {children}\n </span>\n )\n}\n\nexport type InformMediaProps = {\n children: ReactNode\n className?: string\n}\n\n/**\n * Full-width media, for surfaces that can afford the height.\n *\n * The aspect ratio is fixed so the surface does not resize when the image\n * finally decodes — in a dialog that would shift the text under the pointer.\n */\nexport function InformMedia({ children, className }: InformMediaProps): ReactElement {\n return (\n <div className={cn('a63-InformMedia', className)} data-slot=\"inform-media\">\n {children}\n </div>\n )\n}\n","import { useEffect, useRef, useState } from 'react'\nimport type { ReactElement } from 'react'\n\nimport { cn } from '../lib/cn'\nimport { InformDismissButton } from './dismiss-button'\nimport { InformIconSlot } from './icon-slot'\nimport { InformThumbnail } from './media-slot'\nimport { resolveInformIcon } from './severity-icon'\nimport { InformActions } from './inform-actions'\nimport { SEVERITY_TEXT_CLASS } from './severity'\nimport type { InformSurfaceProps } from './types'\n\nexport type InformCornerFlyoutProps = InformSurfaceProps & {\n open: boolean\n}\n\n/**\n * Kept in step with the exit transition in `inform-corner-flyout.css`\n * (`--a63-control-feedback-duration`, 150ms), so the card is gone once it lands.\n */\nconst LEAVE_DURATION_MS = 150\n\n/**\n * Persistent, non-blocking card. Unlike a toast it has a registry identity,\n * holds rich content, and waits to be dismissed instead of expiring on a timer.\n *\n * Placement belongs to `InformFlyoutStack`, not here: several cards share one\n * anchor point and have to reflow together as they are dismissed.\n */\nexport function InformCornerFlyout({\n actions,\n body,\n className,\n dismissLabel,\n dismissable = true,\n icon,\n media,\n onDismiss,\n open,\n severity = 'info',\n title,\n}: InformCornerFlyoutProps): ReactElement | null {\n const resolvedIcon = resolveInformIcon(icon, severity)\n const [entered, setEntered] = useState(false)\n const [leaving, setLeaving] = useState(false)\n const leaveTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(\n () => () => {\n if (leaveTimer.current !== null) clearTimeout(leaveTimer.current)\n },\n []\n )\n\n /*\n * The card animates itself out and only then reports the dismissal, because\n * the moment it reports one the store drops the message and unmounts it —\n * there would be nothing left to animate. Doing it here rather than through\n * presence machinery in the stack keeps the exit next to the entrance.\n */\n const requestDismiss = (): void => {\n if (leaving) return\n\n const reduced =\n typeof window !== 'undefined' &&\n window.matchMedia?.('(prefers-reduced-motion: reduce)').matches === true\n\n if (reduced) {\n onDismiss?.()\n return\n }\n\n setLeaving(true)\n leaveTimer.current = setTimeout(() => {\n onDismiss?.()\n }, LEAVE_DURATION_MS)\n }\n\n useEffect(() => {\n if (!open) {\n setEntered(false)\n return\n }\n\n // One frame at the initial transform so the transition has something to\n // animate from; without it React paints the final state directly.\n const frame = requestAnimationFrame(() => {\n setEntered(true)\n })\n return () => {\n cancelAnimationFrame(frame)\n }\n }, [open])\n\n if (!open) return null\n\n return (\n <div\n aria-live=\"polite\"\n className={cn('a63-InformCornerFlyout', className)}\n data-leaving={leaving ? '' : undefined}\n data-severity={severity}\n data-state={entered ? 'entered' : 'entering'}\n role=\"status\"\n >\n <div className=\"a63-Inform-row\">\n {/*\n Media stands in for the icon rather than joining it: they are both the\n leading visual, and a card carrying a thumbnail AND a severity glyph\n reads as two competing subjects.\n */}\n {media !== undefined ? (\n <InformThumbnail>{media}</InformThumbnail>\n ) : resolvedIcon === null ? null : (\n <InformIconSlot>{resolvedIcon}</InformIconSlot>\n )}\n <div className=\"a63-Inform-content\">\n {title === undefined ? null : (\n <p className={cn('a63-Inform-title', SEVERITY_TEXT_CLASS[severity])}>{title}</p>\n )}\n <p className=\"a63-Inform-body\">{body}</p>\n {actions === undefined ? null : <InformActions actions={actions} />}\n </div>\n {dismissable ? (\n <InformDismissButton label={dismissLabel} onDismiss={requestDismiss} />\n ) : null}\n </div>\n </div>\n )\n}\n","import {\n Dialog,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogTitle,\n} from '@atom63/ui-react'\nimport type { ReactElement } from 'react'\n\nimport { cn } from '../lib/cn'\nimport { InformIconSlot } from './icon-slot'\nimport { InformMedia } from './media-slot'\nimport { resolveInformIcon } from './severity-icon'\nimport { InformActions } from './inform-actions'\nimport { SEVERITY_TEXT_CLASS } from './severity'\nimport type { InformSurfaceProps } from './types'\n\nexport type InformDialogProps = InformSurfaceProps & {\n open: boolean\n}\n\n/**\n * Blocking notice. Focus trapping, Escape, scroll locking, and background\n * inerting come from the Base UI dialog underneath — do not reimplement them.\n * `DialogPopup` already renders its own portal, backdrop, and close button.\n */\nexport function InformDialog({\n actions,\n body,\n className,\n dismissable = true,\n icon,\n media,\n onDismiss,\n open,\n severity = 'info',\n title,\n}: InformDialogProps): ReactElement {\n const resolvedIcon = resolveInformIcon(icon, severity)\n\n return (\n <Dialog\n onOpenChange={next => {\n if (!next) onDismiss?.()\n }}\n open={open}\n >\n <DialogPopup\n className={cn('a63-InformDialog', className)}\n data-severity={severity}\n showCloseButton={dismissable}\n >\n <DialogHeader>\n {media === undefined ? null : <InformMedia>{media}</InformMedia>}\n {/*\n Same row structure as the other surfaces: the icon is a sibling of\n the text, not a child of the title. Nesting it inside the title\n indents only that line, leaving the body aligned with the icon\n rather than with the words above it.\n\n Inside DialogHeader, not around it: the header owns the dialog's\n padding, so a row wrapped around it would strand the icon outside\n the padded area.\n */}\n <div className=\"a63-InformDialog-row\">\n {resolvedIcon === null ? null : <InformIconSlot>{resolvedIcon}</InformIconSlot>}\n {/*\n Vertical rhythm stays the dialog's own. It is a larger surface\n than the banner or the flyout and the design system already sets\n its title-to-description gap; overriding it here would make an\n inform dialog sit differently from every other dialog in the app.\n */}\n <div className=\"a63-InformDialog-text\">\n {title === undefined ? null : (\n <DialogTitle className={SEVERITY_TEXT_CLASS[severity]}>{title}</DialogTitle>\n )}\n <DialogDescription>{body}</DialogDescription>\n </div>\n </div>\n </DialogHeader>\n {actions === undefined ? null : (\n <DialogFooter>\n <InformActions actions={actions} />\n </DialogFooter>\n )}\n </DialogPopup>\n </Dialog>\n )\n}\n","import { useEffect, useState } from 'react'\n\nexport type AnchorRect = {\n top: number\n left: number\n width: number\n height: number\n}\n\nfunction readRect(anchor: string): AnchorRect | null {\n if (typeof document === 'undefined') return null\n\n const element = document.querySelector(anchor)\n if (element === null) return null\n\n const rect = element.getBoundingClientRect()\n // A zero-area rect means the anchor is hidden or collapsed. Treat it as\n // absent so the caller skips the message instead of cutting a hole over\n // nothing.\n if (rect.width === 0 || rect.height === 0) return null\n\n return { top: rect.top, left: rect.left, width: rect.width, height: rect.height }\n}\n\n/**\n * Tracks an anchor's viewport rect while `active`. Returns null when the anchor\n * is absent or has no area — callers must render nothing in that case.\n */\nexport function useAnchorRect(anchor: string, active: boolean): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(null)\n\n useEffect(() => {\n if (!active) {\n setRect(null)\n return\n }\n\n const update = (): void => {\n setRect(readRect(anchor))\n }\n update()\n\n const element = typeof document === 'undefined' ? null : document.querySelector(anchor)\n const observer =\n element === null || typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(update)\n if (element !== null) observer?.observe(element)\n\n window.addEventListener('resize', update)\n // Capture phase so the rect follows anchors inside scroll containers too.\n window.addEventListener('scroll', update, true)\n\n return () => {\n observer?.disconnect()\n window.removeEventListener('resize', update)\n window.removeEventListener('scroll', update, true)\n }\n }, [anchor, active])\n\n return rect\n}\n\nfunction readViewport(): { width: number; height: number } {\n if (typeof window === 'undefined') return { width: 0, height: 0 }\n return { width: window.innerWidth, height: window.innerHeight }\n}\n\n/**\n * Tracks the viewport size while `active`. Structurally typed so it stays free\n * of an import cycle with the placement module.\n */\nexport function useViewportSize(active: boolean): { width: number; height: number } {\n const [size, setSize] = useState(readViewport)\n\n useEffect(() => {\n if (!active) return\n\n const update = (): void => {\n setSize(readViewport())\n }\n update()\n\n window.addEventListener('resize', update)\n return () => {\n window.removeEventListener('resize', update)\n }\n }, [active])\n\n return size\n}\n","import type { AnchorRect } from './use-anchor-rect'\n\n/** Distance between the anchor and the bubble. */\nexport const BUBBLE_GAP = 12\n\n/** Minimum distance the bubble keeps from every viewport edge. */\nexport const BUBBLE_MARGIN = 8\n\nexport type BubbleSize = {\n width: number\n height: number\n}\n\nexport type Viewport = {\n width: number\n height: number\n}\n\nexport type BubblePlacement = {\n top: number\n left: number\n side: 'top' | 'bottom'\n}\n\nexport type PlaceBubbleInput = {\n anchor: AnchorRect\n bubble: BubbleSize\n viewport: Viewport\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n // When max < min the range is degenerate (the bubble is larger than the\n // viewport). Preferring min keeps the bubble's start on screen, which is\n // where its title and first line of copy live.\n if (max < min) return min\n return Math.min(Math.max(value, min), max)\n}\n\n/**\n * Decides where a spotlight bubble goes, given the anchor it explains and the\n * room available around it.\n *\n * Pure by design: jsdom has no layout engine, so a component test cannot\n * meaningfully exercise flipping or clamping. Keeping the decision here is what\n * makes this behavior testable at all.\n */\nexport function placeBubble({ anchor, bubble, viewport }: PlaceBubbleInput): BubblePlacement {\n const anchorBottom = anchor.top + anchor.height\n const needed = bubble.height + BUBBLE_GAP + BUBBLE_MARGIN\n\n const roomBelow = viewport.height - anchorBottom\n const roomAbove = anchor.top\n\n const side: BubblePlacement['side'] =\n roomBelow >= needed || roomBelow >= roomAbove ? 'bottom' : 'top'\n\n const preferredTop =\n side === 'bottom' ? anchorBottom + BUBBLE_GAP : anchor.top - bubble.height - BUBBLE_GAP\n\n return {\n side,\n top: clamp(preferredTop, BUBBLE_MARGIN, viewport.height - bubble.height - BUBBLE_MARGIN),\n left: clamp(anchor.left, BUBBLE_MARGIN, viewport.width - bubble.width - BUBBLE_MARGIN),\n }\n}\n","import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react'\nimport type { ReactElement } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { cn } from '../lib/cn'\nimport { InformIconSlot } from './icon-slot'\nimport { resolveInformIcon } from './severity-icon'\nimport { InformActions } from './inform-actions'\nimport { placeBubble } from './place-bubble'\nimport type { BubbleSize } from './place-bubble'\nimport { SEVERITY_TEXT_CLASS } from './severity'\nimport type { InformSurfaceProps } from './types'\nimport { useAnchorRect, useViewportSize } from './use-anchor-rect'\n\nexport type InformSpotlightProps = InformSurfaceProps & {\n open: boolean\n /** CSS selector for the element to highlight. */\n anchor: string\n}\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\n/*\n * Before the bubble has been measured we assume zero height, which places it\n * directly below the anchor — the same spot the old implementation always used.\n * The layout effect corrects it before paint, so the guess is never visible.\n */\nconst UNMEASURED: BubbleSize = { width: 0, height: 0 }\n\n/**\n * Blocking guide step: a scrim with a cutout over the anchor plus a bubble.\n * There is no primitive underneath, so focus trapping, Escape, focus\n * restoration, and scroll locking are implemented here.\n */\n/**\n * Takes the rest of the page out of the accessibility tree while the spotlight\n * is open, and puts back exactly what it changed.\n *\n * `aria-modal` alone is not enough — several assistive technologies still let a\n * virtual cursor walk background content — and elements that were already inert\n * must stay inert afterwards, so only the ones this call marked are restored.\n */\nfunction inertBackground(except: HTMLElement | null): () => void {\n if (typeof document === 'undefined') return () => undefined\n\n const marked: HTMLElement[] = []\n for (const child of document.body.children) {\n if (!(child instanceof HTMLElement)) continue\n if (except !== null && child.contains(except)) continue\n if (child.hasAttribute('inert')) continue\n\n child.setAttribute('inert', '')\n marked.push(child)\n }\n\n return () => {\n for (const element of marked) element.removeAttribute('inert')\n }\n}\n\nexport function InformSpotlight({\n actions,\n anchor,\n body,\n className,\n icon,\n onDismiss,\n open,\n severity = 'info',\n title,\n}: InformSpotlightProps): ReactElement | null {\n const resolvedIcon = resolveInformIcon(icon, severity)\n const rect = useAnchorRect(anchor, open)\n const viewport = useViewportSize(open)\n const [bubbleSize, setBubbleSize] = useState<BubbleSize | null>(null)\n const bubbleRef = useRef<HTMLDivElement | null>(null)\n // A dialog needs an accessible name: the title, or the body when there is none.\n const titleId = useId()\n const bodyId = useId()\n const rootRef = useRef<HTMLDivElement | null>(null)\n const restoreRef = useRef<HTMLElement | null>(null)\n const visible = open && rect !== null\n\n /*\n * Measure before paint, then keep watching. A ResizeObserver catches the\n * changes a render-time measurement misses — a late font, async content, a\n * longer translation. The equality guard means a re-measure that finds the\n * same box does not re-render.\n */\n useLayoutEffect(() => {\n if (!visible) {\n setBubbleSize(null)\n return\n }\n\n const element = bubbleRef.current\n if (element === null) return\n\n const measure = (): void => {\n const measured = element.getBoundingClientRect()\n setBubbleSize(previous =>\n previous !== null &&\n previous.width === measured.width &&\n previous.height === measured.height\n ? previous\n : { width: measured.width, height: measured.height }\n )\n }\n measure()\n\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(measure)\n observer.observe(element)\n return () => {\n observer.disconnect()\n }\n }, [visible, rect])\n\n useEffect(() => {\n if (!visible) return\n\n restoreRef.current =\n document.activeElement instanceof HTMLElement ? document.activeElement : null\n const previousOverflow = document.body.style.overflow\n document.body.style.overflow = 'hidden'\n const restoreBackground = inertBackground(rootRef.current)\n bubbleRef.current?.focus()\n\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n event.preventDefault()\n onDismiss?.()\n return\n }\n if (event.key !== 'Tab') return\n\n const bubble = bubbleRef.current\n if (bubble === null) return\n\n const focusable = [...bubble.querySelectorAll<HTMLElement>(FOCUSABLE)]\n const first = focusable[0] ?? bubble\n const last = focusable.at(-1) ?? bubble\n\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n document.addEventListener('keydown', onKeyDown)\n\n return () => {\n document.removeEventListener('keydown', onKeyDown)\n document.body.style.overflow = previousOverflow\n restoreBackground()\n restoreRef.current?.focus()\n }\n }, [onDismiss, visible])\n\n if (!visible || rect === null) return null\n\n const placement = placeBubble({\n anchor: rect,\n bubble: bubbleSize ?? UNMEASURED,\n viewport,\n })\n\n /*\n * Portalled to <body> for two reasons: `position: fixed` is relative to a\n * transformed ancestor rather than the viewport, and the inert walk below\n * can only isolate the page if the overlay is a sibling of it rather than\n * living inside it.\n */\n return createPortal(\n <div className=\"a63-InformSpotlight\" ref={rootRef}>\n {/*\n The cutout is an empty box over the anchor carrying a huge shadow\n spread: visually identical to a clip-path hole, without the polygon\n math, and the hole keeps a token-driven radius.\n */}\n <div\n aria-hidden\n className=\"a63-InformSpotlight-cutout\"\n data-testid=\"inform-spotlight-cutout\"\n style={{ top: rect.top, left: rect.left, width: rect.width, height: rect.height }}\n />\n <div\n aria-describedby={title === undefined ? undefined : bodyId}\n aria-labelledby={title === undefined ? bodyId : titleId}\n aria-modal=\"true\"\n className={cn('a63-InformSpotlight-bubble', className)}\n data-severity={severity}\n data-side={placement.side}\n ref={bubbleRef}\n role=\"dialog\"\n style={{ top: placement.top, left: placement.left }}\n tabIndex={-1}\n >\n {/*\n Same row structure as the banner and the flyout: the icon is a sibling\n of the text block, not a child of the title. Nesting it inside the\n title indents only that line, so the body ends up aligned with the\n icon instead of with the words above it.\n */}\n <div className=\"a63-Inform-row\">\n {resolvedIcon === null ? null : <InformIconSlot>{resolvedIcon}</InformIconSlot>}\n <div className=\"a63-Inform-content\">\n {title === undefined ? null : (\n <p className={cn('a63-Inform-title', SEVERITY_TEXT_CLASS[severity])} id={titleId}>\n {title}\n </p>\n )}\n <p className=\"a63-Inform-body\" id={bodyId}>\n {body}\n </p>\n {actions === undefined ? null : <InformActions actions={actions} />}\n </div>\n </div>\n </div>\n </div>,\n document.body\n )\n}\n"]}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// src/core/registry.ts
|
|
2
|
+
function dismissalKey(message) {
|
|
3
|
+
return `${message.id}:${message.version ?? 1}`;
|
|
4
|
+
}
|
|
5
|
+
function assertValidDate(value, field, id) {
|
|
6
|
+
if (value === void 0) return void 0;
|
|
7
|
+
const parsed = Date.parse(value);
|
|
8
|
+
if (Number.isNaN(parsed)) {
|
|
9
|
+
throw new Error(`Inform message "${id}" has an invalid "${field}": ${value}`);
|
|
10
|
+
}
|
|
11
|
+
return parsed;
|
|
12
|
+
}
|
|
13
|
+
function defineInformRegistry(messages) {
|
|
14
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15
|
+
for (const message of messages) {
|
|
16
|
+
if (seen.has(message.id)) {
|
|
17
|
+
throw new Error(`Duplicate inform message id "${message.id}".`);
|
|
18
|
+
}
|
|
19
|
+
seen.add(message.id);
|
|
20
|
+
if (!Number.isFinite(message.priority)) {
|
|
21
|
+
throw new Error(`Inform message "${message.id}" needs a finite "priority".`);
|
|
22
|
+
}
|
|
23
|
+
if (message.surface === "spotlight") {
|
|
24
|
+
if (message.anchor === void 0 || message.anchor.trim() === "") {
|
|
25
|
+
throw new Error(`Inform message "${message.id}" requires an "anchor" to spotlight.`);
|
|
26
|
+
}
|
|
27
|
+
} else if (message.anchor !== void 0) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Inform message "${message.id}" sets "anchor", which is only valid on the "spotlight" surface.`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const startsAt = assertValidDate(message.startsAt, "startsAt", message.id);
|
|
33
|
+
const endsAt = assertValidDate(message.endsAt, "endsAt", message.id);
|
|
34
|
+
if (startsAt !== void 0 && endsAt !== void 0 && endsAt <= startsAt) {
|
|
35
|
+
throw new Error(`Inform message "${message.id}": "endsAt" must come after "startsAt".`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { messages: [...messages] };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/core/types.ts
|
|
42
|
+
var INFORM_FLYOUT_STACK_LIMIT = 3;
|
|
43
|
+
var INFORM_SURFACES = [
|
|
44
|
+
"banner",
|
|
45
|
+
"dialog",
|
|
46
|
+
"corner-flyout",
|
|
47
|
+
"spotlight"
|
|
48
|
+
];
|
|
49
|
+
var INFORM_BLOCKING_SURFACES = ["dialog", "spotlight"];
|
|
50
|
+
var EMPTY_INFORM_RESOLUTION = Object.freeze({
|
|
51
|
+
banner: null,
|
|
52
|
+
dialog: null,
|
|
53
|
+
"corner-flyout": [],
|
|
54
|
+
spotlight: null
|
|
55
|
+
});
|
|
56
|
+
function resolveContent(message, ctx) {
|
|
57
|
+
return typeof message.content === "function" ? message.content(ctx) : message.content;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/core/persistence.ts
|
|
61
|
+
var INFORM_DISMISSAL_STORAGE_KEY = "a63.inform.dismissed";
|
|
62
|
+
function createMemoryDismissalStore(seed = {}) {
|
|
63
|
+
let record = { ...seed };
|
|
64
|
+
return {
|
|
65
|
+
read: () => ({ ...record }),
|
|
66
|
+
write: (key, mode, at) => {
|
|
67
|
+
if (mode === "none") return;
|
|
68
|
+
record = { ...record, [key]: at };
|
|
69
|
+
},
|
|
70
|
+
clear: (key) => {
|
|
71
|
+
if (key === void 0) {
|
|
72
|
+
record = {};
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const { [key]: _removed, ...rest } = record;
|
|
76
|
+
record = rest;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function readStorage(storage) {
|
|
81
|
+
try {
|
|
82
|
+
const raw = storage.getItem(INFORM_DISMISSAL_STORAGE_KEY);
|
|
83
|
+
if (raw === null) return {};
|
|
84
|
+
const parsed = JSON.parse(raw);
|
|
85
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return {};
|
|
86
|
+
const record = {};
|
|
87
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
88
|
+
if (typeof value === "number" && Number.isFinite(value)) record[key] = value;
|
|
89
|
+
}
|
|
90
|
+
return record;
|
|
91
|
+
} catch {
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function writeStorage(storage, next) {
|
|
96
|
+
try {
|
|
97
|
+
storage.setItem(INFORM_DISMISSAL_STORAGE_KEY, JSON.stringify(next));
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function resolveScope(scope) {
|
|
102
|
+
if (scope !== void 0) return scope;
|
|
103
|
+
if (typeof window === "undefined") return void 0;
|
|
104
|
+
return { localStorage: window.localStorage, sessionStorage: window.sessionStorage };
|
|
105
|
+
}
|
|
106
|
+
function createWebDismissalStore(scope) {
|
|
107
|
+
const resolved = resolveScope(scope);
|
|
108
|
+
if (resolved === void 0) return createMemoryDismissalStore();
|
|
109
|
+
const storageFor = (mode) => {
|
|
110
|
+
if (mode === "persistent") return resolved.localStorage;
|
|
111
|
+
if (mode === "session") return resolved.sessionStorage;
|
|
112
|
+
return void 0;
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
read: () => ({
|
|
116
|
+
...readStorage(resolved.localStorage),
|
|
117
|
+
...readStorage(resolved.sessionStorage)
|
|
118
|
+
}),
|
|
119
|
+
write: (key, mode, at) => {
|
|
120
|
+
const storage = storageFor(mode);
|
|
121
|
+
if (storage === void 0) return;
|
|
122
|
+
writeStorage(storage, { ...readStorage(storage), [key]: at });
|
|
123
|
+
},
|
|
124
|
+
clear: (key) => {
|
|
125
|
+
for (const storage of [resolved.localStorage, resolved.sessionStorage]) {
|
|
126
|
+
if (key === void 0) {
|
|
127
|
+
writeStorage(storage, {});
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const { [key]: _removed, ...rest } = readStorage(storage);
|
|
131
|
+
writeStorage(storage, rest);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// src/core/arbiter.ts
|
|
138
|
+
function isEligible(message, input) {
|
|
139
|
+
if (input.dismissals[dismissalKey(message)] !== void 0) return false;
|
|
140
|
+
const now = input.ctx.now.getTime();
|
|
141
|
+
if (message.startsAt !== void 0 && now < Date.parse(message.startsAt)) return false;
|
|
142
|
+
if (message.endsAt !== void 0 && now > Date.parse(message.endsAt)) return false;
|
|
143
|
+
if (message.when !== void 0 && !message.when(input.ctx)) return false;
|
|
144
|
+
if (message.surface === "spotlight" && message.anchor !== void 0) {
|
|
145
|
+
if (input.isAnchorAvailable?.(message.anchor) !== true) return false;
|
|
146
|
+
}
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
function resolveInform(input) {
|
|
150
|
+
const eligible = input.registry.messages.filter((message) => isEligible(message, input));
|
|
151
|
+
const ranked = (surface) => eligible.filter((message) => message.surface === surface).sort((a, b) => b.priority - a.priority);
|
|
152
|
+
const head = (surface) => ranked(surface)[0] ?? null;
|
|
153
|
+
const blockingResolutions = /* @__PURE__ */ new Map();
|
|
154
|
+
let blocking = null;
|
|
155
|
+
for (const surface of INFORM_BLOCKING_SURFACES) {
|
|
156
|
+
const candidate = blocking === null ? head(surface) : null;
|
|
157
|
+
blockingResolutions.set(surface, candidate);
|
|
158
|
+
blocking = blocking ?? candidate;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
banner: head("banner"),
|
|
162
|
+
dialog: blockingResolutions.get("dialog") ?? null,
|
|
163
|
+
spotlight: blockingResolutions.get("spotlight") ?? null,
|
|
164
|
+
// The only stacking surface, and bounded: the rest wait their turn.
|
|
165
|
+
"corner-flyout": blocking === null ? ranked("corner-flyout").slice(0, INFORM_FLYOUT_STACK_LIMIT) : []
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// src/core/store.ts
|
|
170
|
+
function createInformStore(options) {
|
|
171
|
+
const now = options.now ?? (() => Date.now());
|
|
172
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
173
|
+
let context = options.context;
|
|
174
|
+
let dismissals = {};
|
|
175
|
+
let ready = false;
|
|
176
|
+
let snapshot = EMPTY_INFORM_RESOLUTION;
|
|
177
|
+
const emit = () => {
|
|
178
|
+
for (const listener of listeners) listener();
|
|
179
|
+
};
|
|
180
|
+
const recompute = () => {
|
|
181
|
+
snapshot = ready ? resolveInform({
|
|
182
|
+
registry: options.registry,
|
|
183
|
+
ctx: context,
|
|
184
|
+
dismissals,
|
|
185
|
+
isAnchorAvailable: options.isAnchorAvailable
|
|
186
|
+
}) : EMPTY_INFORM_RESOLUTION;
|
|
187
|
+
emit();
|
|
188
|
+
};
|
|
189
|
+
return {
|
|
190
|
+
subscribe: (listener) => {
|
|
191
|
+
listeners.add(listener);
|
|
192
|
+
return () => {
|
|
193
|
+
listeners.delete(listener);
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
getSnapshot: () => snapshot,
|
|
197
|
+
isReady: () => ready,
|
|
198
|
+
hydrate: () => {
|
|
199
|
+
dismissals = options.dismissals.read();
|
|
200
|
+
ready = true;
|
|
201
|
+
recompute();
|
|
202
|
+
},
|
|
203
|
+
setContext: (next) => {
|
|
204
|
+
context = next;
|
|
205
|
+
recompute();
|
|
206
|
+
},
|
|
207
|
+
dismiss: (id) => {
|
|
208
|
+
const message = options.registry.messages.find((entry) => entry.id === id);
|
|
209
|
+
if (message === void 0) return;
|
|
210
|
+
const key = dismissalKey(message);
|
|
211
|
+
const at = now();
|
|
212
|
+
options.dismissals.write(key, message.dismiss, at);
|
|
213
|
+
dismissals = { ...dismissals, [key]: at };
|
|
214
|
+
recompute();
|
|
215
|
+
},
|
|
216
|
+
refresh: recompute
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { EMPTY_INFORM_RESOLUTION, INFORM_BLOCKING_SURFACES, INFORM_DISMISSAL_STORAGE_KEY, INFORM_FLYOUT_STACK_LIMIT, INFORM_SURFACES, createInformStore, createMemoryDismissalStore, createWebDismissalStore, defineInformRegistry, dismissalKey, resolveContent, resolveInform };
|
|
221
|
+
//# sourceMappingURL=chunk-OGT26DRQ.js.map
|
|
222
|
+
//# sourceMappingURL=chunk-OGT26DRQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/registry.ts","../src/core/types.ts","../src/core/persistence.ts","../src/core/arbiter.ts","../src/core/store.ts"],"names":[],"mappings":";AAEO,SAAS,aAAa,OAAA,EAAwD;AACnF,EAAA,OAAO,GAAG,OAAA,CAAQ,EAAE,CAAA,CAAA,EAAI,OAAA,CAAQ,WAAW,CAAC,CAAA,CAAA;AAC9C;AAEA,SAAS,eAAA,CAAgB,KAAA,EAA2B,KAAA,EAAe,EAAA,EAAgC;AACjG,EAAA,IAAI,KAAA,KAAU,QAAW,OAAO,MAAA;AAEhC,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,KAAA,CAAM,KA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AAK,GAAA,EAAI;AACf,MAAA,OAAA,CAAQ,UAAA,CAAW,KAAA,CAAM,GAAA,EAAK,OAAA,CAAQ,SAAS,EAAE,CAAA;AACjD,MAAA,UAAA,GAAa,EAAE,GAAG,UAAA,EAAY,CAAC,GAAG,GAAG,EAAA,EAAG;AACxC,MAAA,SAAA,EAAU;AAAA,IACZ,CAAA;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AACF","file":"chunk-OGT26DRQ.js","sourcesContent":["import type { InformMessage, InformRegistry } from './types'\n\nexport function dismissalKey(message: Pick<InformMessage, 'id' | 'version'>): string {\n return `${message.id}:${message.version ?? 1}`\n}\n\nfunction assertValidDate(value: string | undefined, field: string, id: string): number | undefined {\n if (value === undefined) return undefined\n\n const parsed = Date.parse(value)\n if (Number.isNaN(parsed)) {\n throw new Error(`Inform message \"${id}\" has an invalid \"${field}\": ${value}`)\n }\n return parsed\n}\n\n/**\n * Validates a registry at module load. A malformed message is a build-time\n * authoring mistake, so it throws rather than being skipped at render.\n */\nexport function defineInformRegistry(messages: readonly InformMessage[]): InformRegistry {\n const seen = new Set<string>()\n\n for (const message of messages) {\n if (seen.has(message.id)) {\n throw new Error(`Duplicate inform message id \"${message.id}\".`)\n }\n seen.add(message.id)\n\n if (!Number.isFinite(message.priority)) {\n throw new Error(`Inform message \"${message.id}\" needs a finite \"priority\".`)\n }\n\n if (message.surface === 'spotlight') {\n if (message.anchor === undefined || message.anchor.trim() === '') {\n throw new Error(`Inform message \"${message.id}\" requires an \"anchor\" to spotlight.`)\n }\n } else if (message.anchor !== undefined) {\n throw new Error(\n `Inform message \"${message.id}\" sets \"anchor\", which is only valid on the \"spotlight\" surface.`\n )\n }\n\n const startsAt = assertValidDate(message.startsAt, 'startsAt', message.id)\n const endsAt = assertValidDate(message.endsAt, 'endsAt', message.id)\n if (startsAt !== undefined && endsAt !== undefined && endsAt <= startsAt) {\n throw new Error(`Inform message \"${message.id}\": \"endsAt\" must come after \"startsAt\".`)\n }\n }\n\n return { messages: [...messages] }\n}\n","import type { ReactNode } from 'react'\n\n/** Where a message is shown. One at a time, except the corner flyout, which stacks. */\nexport type InformSurface = 'banner' | 'dialog' | 'corner-flyout' | 'spotlight'\n\nexport type InformSeverity = 'info' | 'success' | 'warning' | 'danger'\n\n/**\n * `none` renders no dismiss affordance and never persists — for standing notices.\n * `session` clears when the tab closes; `persistent` survives it.\n */\nexport type InformDismissMode = 'none' | 'session' | 'persistent'\n\nexport type InformAction = {\n id: string\n label: ReactNode\n onSelect: () => void\n variant?: 'primary' | 'secondary'\n}\n\nexport type InformContent = {\n /** Decorative leading glyph. Severity must still be carried by the text. */\n icon?: ReactNode\n /**\n * Optional media. Only the flyout and the dialog render it, and they render\n * it differently — see the surface docs.\n */\n media?: ReactNode\n title?: ReactNode\n body: ReactNode\n actions?: readonly InformAction[]\n}\n\n/** Everything the arbiter is allowed to know about the visitor's situation. */\nexport type InformContext = {\n pathname: string\n locale: string\n now: Date\n}\n\nexport type InformMessage = {\n /** Stable identity and persistence key. */\n id: string\n surface: InformSurface\n severity: InformSeverity\n /** Higher wins. Ties break by declaration order in the registry. */\n priority: number\n content: InformContent | ((ctx: InformContext) => InformContent)\n dismiss: InformDismissMode\n /** Bump to re-show a message to visitors who dismissed the previous revision. Defaults to 1. */\n version?: number\n /** ISO 8601. */\n startsAt?: string\n /** ISO 8601. */\n endsAt?: string\n when?: (ctx: InformContext) => boolean\n /** CSS selector. Required on `spotlight`, forbidden elsewhere. */\n anchor?: string\n}\n\nexport type InformRegistry = {\n messages: readonly InformMessage[]\n}\n\n/**\n * What each surface should show. The corner flyout is the one surface that\n * stacks, so it resolves to an ordered list rather than a single message —\n * highest priority first, which is both the visual and the reading order.\n */\nexport type InformResolution = {\n banner: InformMessage | null\n dialog: InformMessage | null\n spotlight: InformMessage | null\n 'corner-flyout': readonly InformMessage[]\n}\n\n/*\n * How many flyouts may be visible at once. Bounded on purpose: a persistent\n * card has no timer to drain it, so an uncapped stack would only grow. Anything\n * beyond this waits and is promoted as visible cards are dismissed.\n */\nexport const INFORM_FLYOUT_STACK_LIMIT = 3\n\nexport const INFORM_SURFACES: readonly InformSurface[] = [\n 'banner',\n 'dialog',\n 'corner-flyout',\n 'spotlight',\n]\n\n/** Surfaces that take over the visitor's attention. At most one may resolve. */\nexport const INFORM_BLOCKING_SURFACES: readonly InformSurface[] = ['dialog', 'spotlight']\n\nexport const EMPTY_INFORM_RESOLUTION: InformResolution = Object.freeze({\n banner: null,\n dialog: null,\n 'corner-flyout': [],\n spotlight: null,\n})\n\nexport function resolveContent(message: InformMessage, ctx: InformContext): InformContent {\n return typeof message.content === 'function' ? message.content(ctx) : message.content\n}\n","import type { InformDismissMode } from './types'\n\nexport const INFORM_DISMISSAL_STORAGE_KEY = 'a63.inform.dismissed'\n\n/** Persistence key (`id:version`) to dismissal timestamp in epoch milliseconds. */\nexport type DismissalRecord = Record<string, number>\n\nexport interface DismissalStore {\n read(): DismissalRecord\n write(key: string, mode: InformDismissMode, at: number): void\n clear(key?: string): void\n}\n\nexport function createMemoryDismissalStore(seed: DismissalRecord = {}): DismissalStore {\n let record: DismissalRecord = { ...seed }\n\n return {\n read: () => ({ ...record }),\n write: (key, mode, at) => {\n if (mode === 'none') return\n record = { ...record, [key]: at }\n },\n clear: key => {\n if (key === undefined) {\n record = {}\n return\n }\n const { [key]: _removed, ...rest } = record\n record = rest\n },\n }\n}\n\nexport type StorageScope = {\n localStorage: Storage\n sessionStorage: Storage\n}\n\nfunction readStorage(storage: Storage): DismissalRecord {\n try {\n const raw = storage.getItem(INFORM_DISMISSAL_STORAGE_KEY)\n if (raw === null) return {}\n\n const parsed: unknown = JSON.parse(raw)\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) return {}\n\n const record: DismissalRecord = {}\n for (const [key, value] of Object.entries(parsed)) {\n if (typeof value === 'number' && Number.isFinite(value)) record[key] = value\n }\n return record\n } catch {\n // Corrupt or unavailable storage must degrade to \"nothing dismissed\",\n // never break the page that mounted the provider.\n return {}\n }\n}\n\nfunction writeStorage(storage: Storage, next: DismissalRecord): void {\n try {\n storage.setItem(INFORM_DISMISSAL_STORAGE_KEY, JSON.stringify(next))\n } catch {\n // Private-mode and quota failures are not worth surfacing to the visitor.\n }\n}\n\nfunction resolveScope(scope: StorageScope | undefined): StorageScope | undefined {\n if (scope !== undefined) return scope\n if (typeof window === 'undefined') return undefined\n\n return { localStorage: window.localStorage, sessionStorage: window.sessionStorage }\n}\n\nexport function createWebDismissalStore(scope?: StorageScope): DismissalStore {\n const resolved = resolveScope(scope)\n if (resolved === undefined) return createMemoryDismissalStore()\n\n const storageFor = (mode: InformDismissMode): Storage | undefined => {\n if (mode === 'persistent') return resolved.localStorage\n if (mode === 'session') return resolved.sessionStorage\n return undefined\n }\n\n return {\n read: () => ({\n ...readStorage(resolved.localStorage),\n ...readStorage(resolved.sessionStorage),\n }),\n write: (key, mode, at) => {\n const storage = storageFor(mode)\n if (storage === undefined) return\n writeStorage(storage, { ...readStorage(storage), [key]: at })\n },\n clear: key => {\n for (const storage of [resolved.localStorage, resolved.sessionStorage]) {\n if (key === undefined) {\n writeStorage(storage, {})\n continue\n }\n const { [key]: _removed, ...rest } = readStorage(storage)\n writeStorage(storage, rest)\n }\n },\n }\n}\n","import type { DismissalRecord } from './persistence'\nimport { dismissalKey } from './registry'\nimport { INFORM_BLOCKING_SURFACES, INFORM_FLYOUT_STACK_LIMIT } from './types'\nimport type {\n InformContext,\n InformMessage,\n InformRegistry,\n InformResolution,\n InformSurface,\n} from './types'\n\nexport type ArbiterInput = {\n registry: InformRegistry\n ctx: InformContext\n dismissals: DismissalRecord\n /**\n * Whether a spotlight anchor currently exists. Injected so the arbiter stays\n * pure and testable; the React layer passes a DOM-backed implementation.\n */\n isAnchorAvailable?: (anchor: string) => boolean\n}\n\nfunction isEligible(message: InformMessage, input: ArbiterInput): boolean {\n if (input.dismissals[dismissalKey(message)] !== undefined) return false\n\n const now = input.ctx.now.getTime()\n if (message.startsAt !== undefined && now < Date.parse(message.startsAt)) return false\n if (message.endsAt !== undefined && now > Date.parse(message.endsAt)) return false\n\n if (message.when !== undefined && !message.when(input.ctx)) return false\n\n if (message.surface === 'spotlight' && message.anchor !== undefined) {\n // A spotlight with no anchor would cut its hole over nothing. Skipping the\n // message entirely is always better than rendering a misaligned overlay.\n if (input.isAnchorAvailable?.(message.anchor) !== true) return false\n }\n\n return true\n}\n\n/**\n * Filter, group, rank, then apply exclusion. Pure: all timing, storage, and DOM\n * access is supplied by the caller through `ctx`, `dismissals`, and\n * `isAnchorAvailable`.\n */\nexport function resolveInform(input: ArbiterInput): InformResolution {\n const eligible = input.registry.messages.filter(message => isEligible(message, input))\n\n // Declaration order already holds, and Array#sort is stable, so ranking by\n // descending priority breaks ties by declaration order for free.\n const ranked = (surface: InformSurface): InformMessage[] =>\n eligible.filter(message => message.surface === surface).sort((a, b) => b.priority - a.priority)\n\n const head = (surface: InformSurface): InformMessage | null => ranked(surface)[0] ?? null\n\n // Walk the blocking surfaces in precedence order: the first with a candidate\n // takes the single blocking slot and the rest stay empty. Driving this from\n // INFORM_BLOCKING_SURFACES keeps the precedence in one place, so adding or\n // reordering a blocking surface is an edit to that list alone.\n const blockingResolutions = new Map<InformSurface, InformMessage | null>()\n let blocking: InformMessage | null = null\n for (const surface of INFORM_BLOCKING_SURFACES) {\n const candidate: InformMessage | null = blocking === null ? head(surface) : null\n blockingResolutions.set(surface, candidate)\n blocking = blocking ?? candidate\n }\n\n return {\n banner: head('banner'),\n dialog: blockingResolutions.get('dialog') ?? null,\n spotlight: blockingResolutions.get('spotlight') ?? null,\n // The only stacking surface, and bounded: the rest wait their turn.\n 'corner-flyout':\n blocking === null ? ranked('corner-flyout').slice(0, INFORM_FLYOUT_STACK_LIMIT) : [],\n }\n}\n","import { resolveInform } from './arbiter'\nimport type { DismissalRecord, DismissalStore } from './persistence'\nimport { dismissalKey } from './registry'\nimport { EMPTY_INFORM_RESOLUTION } from './types'\nimport type { InformContext, InformRegistry, InformResolution } from './types'\n\nexport type InformStoreOptions = {\n registry: InformRegistry\n context: InformContext\n dismissals: DismissalStore\n isAnchorAvailable?: (anchor: string) => boolean\n /** Injectable clock so dismissal timestamps are deterministic in tests. */\n now?: () => number\n}\n\nexport type InformStore = {\n subscribe: (listener: () => void) => () => void\n getSnapshot: () => InformResolution\n isReady: () => boolean\n /** Read persisted dismissals and begin resolving. Call from an effect, never during render. */\n hydrate: () => void\n setContext: (context: InformContext) => void\n dismiss: (id: string) => void\n /** Re-run arbitration, e.g. after a spotlight anchor mounts. */\n refresh: () => void\n}\n\nexport function createInformStore(options: InformStoreOptions): InformStore {\n const now = options.now ?? (() => Date.now())\n const listeners = new Set<() => void>()\n\n let context = options.context\n let dismissals: DismissalRecord = {}\n let ready = false\n // Cached so getSnapshot is referentially stable; useSyncExternalStore loops\n // forever if the snapshot identity changes on every read.\n let snapshot: InformResolution = EMPTY_INFORM_RESOLUTION\n\n const emit = (): void => {\n for (const listener of listeners) listener()\n }\n\n const recompute = (): void => {\n snapshot = ready\n ? resolveInform({\n registry: options.registry,\n ctx: context,\n dismissals,\n isAnchorAvailable: options.isAnchorAvailable,\n })\n : EMPTY_INFORM_RESOLUTION\n emit()\n }\n\n return {\n subscribe: listener => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n getSnapshot: () => snapshot,\n isReady: () => ready,\n hydrate: () => {\n dismissals = options.dismissals.read()\n ready = true\n recompute()\n },\n setContext: next => {\n context = next\n recompute()\n },\n dismiss: id => {\n const message = options.registry.messages.find(entry => entry.id === id)\n if (message === undefined) return\n\n const key = dismissalKey(message)\n const at = now()\n options.dismissals.write(key, message.dismiss, at)\n dismissals = { ...dismissals, [key]: at }\n recompute()\n },\n refresh: recompute,\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
type InformFlyoutPlacement = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
4
|
+
type InformFlyoutStackProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
placement?: InformFlyoutPlacement;
|
|
7
|
+
/** CSS length for the inset on the anchored edge. Pass app chrome clearance here. */
|
|
8
|
+
offset?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Positioned container for the corner flyout stack.
|
|
13
|
+
*
|
|
14
|
+
* Collapsed, it behaves the way a toast stack does: the front card is fully
|
|
15
|
+
* visible and the ones behind it peek out, each a little narrower, so three
|
|
16
|
+
* messages read as one stack rather than three loose cards. Hover — or focus
|
|
17
|
+
* anywhere inside, which is what keeps a keyboard able to reach the back cards
|
|
18
|
+
* — expands it into the full list.
|
|
19
|
+
*
|
|
20
|
+
* The offsets have to be measured rather than expressed in CSS: each card sits
|
|
21
|
+
* relative to the height of the ones in front of it, and those heights depend
|
|
22
|
+
* on their content.
|
|
23
|
+
*/
|
|
24
|
+
declare function InformFlyoutStack({ children, className, offset, placement, }: InformFlyoutStackProps): ReactElement;
|
|
25
|
+
|
|
26
|
+
export { type InformFlyoutPlacement as I, InformFlyoutStack as a, type InformFlyoutStackProps as b };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { I as InformMessage, a as InformRegistry, b as InformContext, c as InformResolution } from './types-7x7Ygbcz.js';
|
|
2
|
+
export { E as EMPTY_INFORM_RESOLUTION, d as INFORM_BLOCKING_SURFACES, e as INFORM_FLYOUT_STACK_LIMIT, f as INFORM_SURFACES, g as InformAction, h as InformContent, i as InformDismissMode, j as InformSeverity, k as InformSurface, r as resolveContent } from './types-7x7Ygbcz.js';
|
|
3
|
+
import { D as DismissalRecord, a as DismissalStore } from './persistence-DkSUn_qI.js';
|
|
4
|
+
export { I as INFORM_DISMISSAL_STORAGE_KEY, S as StorageScope, c as createMemoryDismissalStore, b as createWebDismissalStore } from './persistence-DkSUn_qI.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
declare function dismissalKey(message: Pick<InformMessage, 'id' | 'version'>): string;
|
|
8
|
+
/**
|
|
9
|
+
* Validates a registry at module load. A malformed message is a build-time
|
|
10
|
+
* authoring mistake, so it throws rather than being skipped at render.
|
|
11
|
+
*/
|
|
12
|
+
declare function defineInformRegistry(messages: readonly InformMessage[]): InformRegistry;
|
|
13
|
+
|
|
14
|
+
type ArbiterInput = {
|
|
15
|
+
registry: InformRegistry;
|
|
16
|
+
ctx: InformContext;
|
|
17
|
+
dismissals: DismissalRecord;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a spotlight anchor currently exists. Injected so the arbiter stays
|
|
20
|
+
* pure and testable; the React layer passes a DOM-backed implementation.
|
|
21
|
+
*/
|
|
22
|
+
isAnchorAvailable?: (anchor: string) => boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Filter, group, rank, then apply exclusion. Pure: all timing, storage, and DOM
|
|
26
|
+
* access is supplied by the caller through `ctx`, `dismissals`, and
|
|
27
|
+
* `isAnchorAvailable`.
|
|
28
|
+
*/
|
|
29
|
+
declare function resolveInform(input: ArbiterInput): InformResolution;
|
|
30
|
+
|
|
31
|
+
type InformStoreOptions = {
|
|
32
|
+
registry: InformRegistry;
|
|
33
|
+
context: InformContext;
|
|
34
|
+
dismissals: DismissalStore;
|
|
35
|
+
isAnchorAvailable?: (anchor: string) => boolean;
|
|
36
|
+
/** Injectable clock so dismissal timestamps are deterministic in tests. */
|
|
37
|
+
now?: () => number;
|
|
38
|
+
};
|
|
39
|
+
type InformStore = {
|
|
40
|
+
subscribe: (listener: () => void) => () => void;
|
|
41
|
+
getSnapshot: () => InformResolution;
|
|
42
|
+
isReady: () => boolean;
|
|
43
|
+
/** Read persisted dismissals and begin resolving. Call from an effect, never during render. */
|
|
44
|
+
hydrate: () => void;
|
|
45
|
+
setContext: (context: InformContext) => void;
|
|
46
|
+
dismiss: (id: string) => void;
|
|
47
|
+
/** Re-run arbitration, e.g. after a spotlight anchor mounts. */
|
|
48
|
+
refresh: () => void;
|
|
49
|
+
};
|
|
50
|
+
declare function createInformStore(options: InformStoreOptions): InformStore;
|
|
51
|
+
|
|
52
|
+
export { type ArbiterInput, DismissalRecord, DismissalStore, InformContext, InformMessage, InformRegistry, InformResolution, type InformStore, type InformStoreOptions, createInformStore, defineInformRegistry, dismissalKey, resolveInform };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { EMPTY_INFORM_RESOLUTION, INFORM_BLOCKING_SURFACES, INFORM_DISMISSAL_STORAGE_KEY, INFORM_FLYOUT_STACK_LIMIT, INFORM_SURFACES, createInformStore, createMemoryDismissalStore, createWebDismissalStore, defineInformRegistry, dismissalKey, resolveContent, resolveInform } from './chunk-OGT26DRQ.js';
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { i as InformDismissMode } from './types-7x7Ygbcz.js';
|
|
2
|
+
|
|
3
|
+
declare const INFORM_DISMISSAL_STORAGE_KEY = "a63.inform.dismissed";
|
|
4
|
+
/** Persistence key (`id:version`) to dismissal timestamp in epoch milliseconds. */
|
|
5
|
+
type DismissalRecord = Record<string, number>;
|
|
6
|
+
interface DismissalStore {
|
|
7
|
+
read(): DismissalRecord;
|
|
8
|
+
write(key: string, mode: InformDismissMode, at: number): void;
|
|
9
|
+
clear(key?: string): void;
|
|
10
|
+
}
|
|
11
|
+
declare function createMemoryDismissalStore(seed?: DismissalRecord): DismissalStore;
|
|
12
|
+
type StorageScope = {
|
|
13
|
+
localStorage: Storage;
|
|
14
|
+
sessionStorage: Storage;
|
|
15
|
+
};
|
|
16
|
+
declare function createWebDismissalStore(scope?: StorageScope): DismissalStore;
|
|
17
|
+
|
|
18
|
+
export { type DismissalRecord as D, INFORM_DISMISSAL_STORAGE_KEY as I, type StorageScope as S, type DismissalStore as a, createWebDismissalStore as b, createMemoryDismissalStore as c };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { k as InformSurface, a as InformRegistry, b as InformContext, c as InformResolution } from '../types-7x7Ygbcz.js';
|
|
3
|
+
import { I as InformFlyoutPlacement } from '../flyout-stack-BvsgCm0f.js';
|
|
4
|
+
import { a as DismissalStore } from '../persistence-DkSUn_qI.js';
|
|
5
|
+
|
|
6
|
+
type InformOutletProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Which surfaces this outlet is responsible for. Defaults to all four. Split
|
|
9
|
+
* them across outlets when surfaces belong in different parts of the tree —
|
|
10
|
+
* an in-flow banner sits in a layout slot, while the overlay surfaces belong
|
|
11
|
+
* at the layout root.
|
|
12
|
+
*/
|
|
13
|
+
surfaces?: readonly InformSurface[];
|
|
14
|
+
/** CSS length for the flyout stack's inset on its anchored edge. */
|
|
15
|
+
flyoutOffset?: string;
|
|
16
|
+
/** Which corner the flyout stack is anchored to. */
|
|
17
|
+
flyoutPlacement?: InformFlyoutPlacement;
|
|
18
|
+
};
|
|
19
|
+
declare function InformOutlet({ flyoutOffset, flyoutPlacement, surfaces, }: InformOutletProps): ReactElement;
|
|
20
|
+
|
|
21
|
+
type InformProviderProps = {
|
|
22
|
+
registry: InformRegistry;
|
|
23
|
+
context: InformContext;
|
|
24
|
+
dismissals?: DismissalStore;
|
|
25
|
+
isAnchorAvailable?: (anchor: string) => boolean;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
declare function InformProvider({ children, context, dismissals, isAnchorAvailable, registry, }: InformProviderProps): ReactElement;
|
|
29
|
+
|
|
30
|
+
type UseInformResult = {
|
|
31
|
+
resolution: InformResolution;
|
|
32
|
+
ready: boolean;
|
|
33
|
+
dismiss: (id: string) => void;
|
|
34
|
+
};
|
|
35
|
+
declare function useInform(): UseInformResult;
|
|
36
|
+
/**
|
|
37
|
+
* The context the nearest provider was given. Safe to read during render: it is
|
|
38
|
+
* a plain React context value, not the store's mutable internal context.
|
|
39
|
+
*/
|
|
40
|
+
declare function useInformContext(): InformContext;
|
|
41
|
+
|
|
42
|
+
export { InformOutlet, type InformOutletProps, InformProvider, type InformProviderProps, type UseInformResult, useInform, useInformContext };
|