@atom63/inform 0.2.0-beta.3 → 0.2.0-beta.5
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/dist/{chunk-KT6PQL7E.js → chunk-H7WBGUWP.js} +61 -39
- package/dist/chunk-H7WBGUWP.js.map +1 -0
- package/dist/{flyout-stack-BvsgCm0f.d.ts → flyout-stack-eCgRi6ho.d.ts} +2 -1
- package/dist/index.d.ts +6 -5
- package/dist/{persistence-DkSUn_qI.d.ts → persistence-CoxIFNs9.d.ts} +3 -2
- package/dist/react/index.d.ts +5 -4
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/surfaces/index.d.ts +5 -4
- package/dist/surfaces/index.js +1 -1
- package/dist/{types-7x7Ygbcz.d.ts → types-s7wq_wq9.d.ts} +2 -1
- package/package.json +6 -6
- package/dist/chunk-KT6PQL7E.js.map +0 -1
|
@@ -311,8 +311,9 @@ function InformDialog({
|
|
|
311
311
|
return /* @__PURE__ */ jsx(
|
|
312
312
|
Dialog,
|
|
313
313
|
{
|
|
314
|
+
disablePointerDismissal: !dismissable,
|
|
314
315
|
onOpenChange: (next) => {
|
|
315
|
-
if (!next) onDismiss?.();
|
|
316
|
+
if (!next && dismissable) onDismiss?.();
|
|
316
317
|
},
|
|
317
318
|
open,
|
|
318
319
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -432,6 +433,8 @@ function InformSpotlight({
|
|
|
432
433
|
anchor,
|
|
433
434
|
body,
|
|
434
435
|
className,
|
|
436
|
+
dismissLabel,
|
|
437
|
+
dismissable = true,
|
|
435
438
|
icon,
|
|
436
439
|
onDismiss,
|
|
437
440
|
open,
|
|
@@ -479,7 +482,7 @@ function InformSpotlight({
|
|
|
479
482
|
const onKeyDown = (event) => {
|
|
480
483
|
if (event.key === "Escape") {
|
|
481
484
|
event.preventDefault();
|
|
482
|
-
onDismiss?.();
|
|
485
|
+
if (dismissable) onDismiss?.();
|
|
483
486
|
return;
|
|
484
487
|
}
|
|
485
488
|
if (event.key !== "Tab") return;
|
|
@@ -503,7 +506,7 @@ function InformSpotlight({
|
|
|
503
506
|
restoreBackground();
|
|
504
507
|
restoreRef.current?.focus();
|
|
505
508
|
};
|
|
506
|
-
}, [onDismiss, visible]);
|
|
509
|
+
}, [dismissable, onDismiss, visible]);
|
|
507
510
|
if (!visible || rect === null) return null;
|
|
508
511
|
const placement = placeBubble({
|
|
509
512
|
anchor: rect,
|
|
@@ -511,44 +514,63 @@ function InformSpotlight({
|
|
|
511
514
|
viewport
|
|
512
515
|
});
|
|
513
516
|
return createPortal(
|
|
514
|
-
/*
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
"
|
|
526
|
-
{
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
517
|
+
/*
|
|
518
|
+
The root covers the viewport and is the scrim's hit area. A press that
|
|
519
|
+
lands on it, not on the bubble or the cutout, dismisses: a phone has no
|
|
520
|
+
Escape key, so this and the dismiss button are the touch paths out.
|
|
521
|
+
Escape is the keyboard equivalent, handled in the effect above.
|
|
522
|
+
*/
|
|
523
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- Escape is the keyboard path; the scrim is not a control.
|
|
524
|
+
/* @__PURE__ */ jsxs(
|
|
525
|
+
"div",
|
|
526
|
+
{
|
|
527
|
+
className: "a63-InformSpotlight",
|
|
528
|
+
"data-testid": "inform-spotlight-scrim",
|
|
529
|
+
onClick: (event) => {
|
|
530
|
+
if (dismissable && event.target === event.currentTarget) onDismiss?.();
|
|
531
|
+
},
|
|
532
|
+
ref: rootRef,
|
|
533
|
+
children: [
|
|
534
|
+
/* @__PURE__ */ jsx(
|
|
535
|
+
"div",
|
|
536
|
+
{
|
|
537
|
+
"aria-hidden": true,
|
|
538
|
+
className: "a63-InformSpotlight-cutout",
|
|
539
|
+
"data-testid": "inform-spotlight-cutout",
|
|
540
|
+
style: { top: rect.top, left: rect.left, width: rect.width, height: rect.height }
|
|
541
|
+
}
|
|
542
|
+
),
|
|
543
|
+
/* @__PURE__ */ jsx(
|
|
544
|
+
"div",
|
|
545
|
+
{
|
|
546
|
+
"aria-describedby": title === void 0 ? void 0 : bodyId,
|
|
547
|
+
"aria-labelledby": title === void 0 ? bodyId : titleId,
|
|
548
|
+
"aria-modal": "true",
|
|
549
|
+
className: cn("a63-InformSpotlight-bubble", className),
|
|
550
|
+
"data-severity": severity,
|
|
551
|
+
"data-side": placement.side,
|
|
552
|
+
ref: bubbleRef,
|
|
553
|
+
role: "dialog",
|
|
554
|
+
style: { top: placement.top, left: placement.left },
|
|
555
|
+
tabIndex: -1,
|
|
556
|
+
children: /* @__PURE__ */ jsxs("div", { className: "a63-Inform-row", children: [
|
|
557
|
+
resolvedIcon === null ? null : /* @__PURE__ */ jsx(InformIconSlot, { children: resolvedIcon }),
|
|
558
|
+
/* @__PURE__ */ jsxs("div", { className: "a63-Inform-content", children: [
|
|
559
|
+
title === void 0 ? null : /* @__PURE__ */ jsx("p", { className: cn("a63-Inform-title", SEVERITY_TEXT_CLASS[severity]), id: titleId, children: title }),
|
|
560
|
+
/* @__PURE__ */ jsx("p", { className: "a63-Inform-body", id: bodyId, children: body }),
|
|
561
|
+
actions === void 0 ? null : /* @__PURE__ */ jsx(InformActions, { actions })
|
|
562
|
+
] }),
|
|
563
|
+
dismissable ? /* @__PURE__ */ jsx(InformDismissButton, { label: dismissLabel, onDismiss }) : null
|
|
564
|
+
] })
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
),
|
|
548
570
|
document.body
|
|
549
571
|
);
|
|
550
572
|
}
|
|
551
573
|
|
|
552
574
|
export { InformActions, InformBanner, InformCornerFlyout, InformDialog, InformDismissButton, InformFlyoutStack, InformIconSlot, InformMedia, InformSpotlight, InformThumbnail, SEVERITY_BORDER_CLASS, SEVERITY_TEXT_CLASS, SLOT_SIZE_CLASS, useAnchorRect };
|
|
553
|
-
//# sourceMappingURL=chunk-
|
|
554
|
-
//# sourceMappingURL=chunk-
|
|
575
|
+
//# sourceMappingURL=chunk-H7WBGUWP.js.map
|
|
576
|
+
//# sourceMappingURL=chunk-H7WBGUWP.js.map
|
|
@@ -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,MAAA,EAAuD;AAC3E,EAAA,OAAO,MAAA,CAAO,MAAA,CAAO,OAAO,CAAA,CAAE,KAAK,GAAG,CAAA;AACxC;ACiBO,SAAS,mBAAA,CAAoB;AAAA,EAClC,SAAA;AAAA,EACA,KAAA,GAAQ,SAAA;AAAA,EACR;AACF,CAAA,EAA2C;AACzC,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAY,KAAA;AAAA,MACZ,SAA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,IAAA,EAAK;AAAA,cAClD,QAAA,EAAU,EAAA;AAAA,cAQV,QAAA,kBAAAC,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gBAAA,EACZ,QAAA,EAAA;AAAA,gBAAA,YAAA,KAAiB,IAAA,GAAO,IAAA,mBAAOD,GAAAA,CAAC,kBAAgB,QAAA,EAAA,YAAA,EAAa,CAAA;AAAA,gCAC9DC,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,oBAAA,EACZ,QAAA,EAAA;AAAA,kBAAA,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,kCAEFA,GAAAA,CAAC,GAAA,EAAA,EAAE,WAAU,iBAAA,EAAkB,EAAA,EAAI,QAChC,QAAA,EAAA,IAAA,EACH,CAAA;AAAA,kBACC,YAAY,MAAA,GAAY,IAAA,mBAAOA,GAAAA,CAAC,iBAAc,OAAA,EAAkB;AAAA,iBAAA,EACnE,CAAA;AAAA,gBACC,8BAAcA,GAAAA,CAAC,uBAAoB,KAAA,EAAO,YAAA,EAAc,WAAsB,CAAA,GAAK;AAAA,eAAA,EACtF;AAAA;AAAA;AACF;AAAA;AAAA,KACF;AAAA,IACA,QAAA,CAAS;AAAA,GACX;AACF","file":"chunk-H7WBGUWP.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 // A non-dismissable dialog shows no close button, and Escape and outside\n // presses must not close it either: it leaves only through its actions.\n disablePointerDismissal={!dismissable}\n onOpenChange={next => {\n if (!next && dismissable) 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 { InformDismissButton } from './dismiss-button'\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 * When `dismissable` (the default) it closes from its dismiss button, Escape,\n * or a press on the scrim. With `dismissable={false}` none of those close it,\n * so it must carry an action.\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 dismissLabel,\n dismissable = true,\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 if (dismissable) 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 }, [dismissable, 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 /*\n The root covers the viewport and is the scrim's hit area. A press that\n lands on it, not on the bubble or the cutout, dismisses: a phone has no\n Escape key, so this and the dismiss button are the touch paths out.\n Escape is the keyboard equivalent, handled in the effect above.\n */\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- Escape is the keyboard path; the scrim is not a control.\n <div\n className=\"a63-InformSpotlight\"\n data-testid=\"inform-spotlight-scrim\"\n onClick={event => {\n if (dismissable && event.target === event.currentTarget) onDismiss?.()\n }}\n ref={rootRef}\n >\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 {dismissable ? <InformDismissButton label={dismissLabel} onDismiss={onDismiss} /> : null}\n </div>\n </div>\n </div>,\n document.body\n )\n}\n"]}
|
|
@@ -23,4 +23,5 @@ type InformFlyoutStackProps = {
|
|
|
23
23
|
*/
|
|
24
24
|
declare function InformFlyoutStack({ children, className, offset, placement, }: InformFlyoutStackProps): ReactElement;
|
|
25
25
|
|
|
26
|
-
export {
|
|
26
|
+
export { InformFlyoutStack as a };
|
|
27
|
+
export type { InformFlyoutPlacement as I, InformFlyoutStackProps as b };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as InformMessage, a as InformRegistry, b as InformContext, c as InformResolution } from './types-
|
|
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-
|
|
3
|
-
import { D as DismissalRecord, a as DismissalStore } from './persistence-
|
|
4
|
-
export { I as INFORM_DISMISSAL_STORAGE_KEY, S as StorageScope, c as createMemoryDismissalStore, b as createWebDismissalStore } from './persistence-
|
|
1
|
+
import { I as InformMessage, a as InformRegistry, b as InformContext, c as InformResolution } from './types-s7wq_wq9.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-s7wq_wq9.js';
|
|
3
|
+
import { D as DismissalRecord, a as DismissalStore } from './persistence-CoxIFNs9.js';
|
|
4
|
+
export { I as INFORM_DISMISSAL_STORAGE_KEY, S as StorageScope, c as createMemoryDismissalStore, b as createWebDismissalStore } from './persistence-CoxIFNs9.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
|
7
7
|
declare function dismissalKey(message: Pick<InformMessage, 'id' | 'version'>): string;
|
|
@@ -49,4 +49,5 @@ type InformStore = {
|
|
|
49
49
|
};
|
|
50
50
|
declare function createInformStore(options: InformStoreOptions): InformStore;
|
|
51
51
|
|
|
52
|
-
export {
|
|
52
|
+
export { DismissalRecord, DismissalStore, InformContext, InformMessage, InformRegistry, InformResolution, createInformStore, defineInformRegistry, dismissalKey, resolveInform };
|
|
53
|
+
export type { ArbiterInput, InformStore, InformStoreOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as InformDismissMode } from './types-
|
|
1
|
+
import { i as InformDismissMode } from './types-s7wq_wq9.js';
|
|
2
2
|
|
|
3
3
|
declare const INFORM_DISMISSAL_STORAGE_KEY = "a63.inform.dismissed";
|
|
4
4
|
/** Persistence key (`id:version`) to dismissal timestamp in epoch milliseconds. */
|
|
@@ -15,4 +15,5 @@ type StorageScope = {
|
|
|
15
15
|
};
|
|
16
16
|
declare function createWebDismissalStore(scope?: StorageScope): DismissalStore;
|
|
17
17
|
|
|
18
|
-
export {
|
|
18
|
+
export { INFORM_DISMISSAL_STORAGE_KEY as I, createWebDismissalStore as b, createMemoryDismissalStore as c };
|
|
19
|
+
export type { DismissalRecord as D, StorageScope as S, DismissalStore as a };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { InformSurface, InformRegistry, InformContext, InformResolution } from '../index.js';
|
|
3
|
+
import { InformFlyoutPlacement } from '../surfaces/index.js';
|
|
4
|
+
import { DismissalStore } from '../index.js';
|
|
5
5
|
|
|
6
6
|
type InformOutletProps = {
|
|
7
7
|
/**
|
|
@@ -39,4 +39,5 @@ declare function useInform(): UseInformResult;
|
|
|
39
39
|
*/
|
|
40
40
|
declare function useInformContext(): InformContext;
|
|
41
41
|
|
|
42
|
-
export { InformOutlet,
|
|
42
|
+
export { InformOutlet, InformProvider, useInform, useInformContext };
|
|
43
|
+
export type { InformOutletProps, InformProviderProps, UseInformResult };
|
package/dist/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createInformStore, createWebDismissalStore, INFORM_SURFACES, resolveContent } from '../chunk-OGT26DRQ.js';
|
|
2
|
-
import { InformBanner, InformDialog, InformFlyoutStack, InformCornerFlyout, InformSpotlight } from '../chunk-
|
|
2
|
+
import { InformBanner, InformDialog, InformFlyoutStack, InformCornerFlyout, InformSpotlight } from '../chunk-H7WBGUWP.js';
|
|
3
3
|
import { createContext, useRef, useMemo, useEffect, useContext, useSyncExternalStore, useCallback } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -113,6 +113,7 @@ function InformOutlet({
|
|
|
113
113
|
{
|
|
114
114
|
...contentOf(spotlight),
|
|
115
115
|
anchor: spotlight.anchor,
|
|
116
|
+
dismissable: spotlight.dismiss !== "none",
|
|
116
117
|
onDismiss: () => {
|
|
117
118
|
dismiss(spotlight.id);
|
|
118
119
|
},
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/inform-provider.tsx","../../src/react/use-inform.ts","../../src/react/inform-outlet.tsx"],"names":["jsx"],"mappings":";;;;;AASO,IAAM,kBAAA,GAAqB,cAAkC,IAAI,CAAA;AAOjE,IAAM,kBAAA,GAAqB,cAAoC,IAAI,CAAA;AAU1E,SAAS,yBAAyB,MAAA,EAAyB;AACzD,EAAA,IAAI,OAAO,QAAA,KAAa,WAAA,EAAa,OAAO,KAAA;AAC5C,EAAA,OAAO,QAAA,CAAS,aAAA,CAAc,MAAM,CAAA,KAAM,IAAA;AAC5C;AAEO,SAAS,cAAA,CAAe;AAAA,EAC7B,QAAA;A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KAAW,MAAA,GAAY,uBACtDA,GAAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACE,GAAG,UAAU,SAAS,CAAA;AAAA,QACvB,QAAQ,SAAA,CAAU,MAAA;AAAA,QAClB,WAAW,MAAM;AACf,UAAA,OAAA,CAAQ,UAAU,EAAE,CAAA;AAAA,QACtB,CAAA;AAAA,QACA,IAAA,EAAI,IAAA;AAAA,QACJ,UAAU,SAAA,CAAU;AAAA;AAAA;AACtB,GAAA,EAEJ,CAAA;AAEJ","file":"index.js","sourcesContent":["import { createContext, useEffect, useMemo, useRef } from 'react'\nimport type { ReactElement, ReactNode } from 'react'\n\nimport { createWebDismissalStore } from '../core/persistence'\nimport type { DismissalStore } from '../core/persistence'\nimport { createInformStore } from '../core/store'\nimport type { InformStore } from '../core/store'\nimport type { InformContext, InformRegistry } from '../core/types'\n\nexport const InformStoreContext = createContext<InformStore | null>(null)\n\n/**\n * The context the provider was given. Published separately from the store so\n * outlets can resolve function-valued content without reading the store's\n * mutable context during render.\n */\nexport const InformContextValue = createContext<InformContext | null>(null)\n\nexport type InformProviderProps = {\n registry: InformRegistry\n context: InformContext\n dismissals?: DismissalStore\n isAnchorAvailable?: (anchor: string) => boolean\n children: ReactNode\n}\n\nfunction defaultIsAnchorAvailable(anchor: string): boolean {\n if (typeof document === 'undefined') return false\n return document.querySelector(anchor) !== null\n}\n\nexport function InformProvider({\n children,\n context,\n dismissals,\n isAnchorAvailable = defaultIsAnchorAvailable,\n registry,\n}: InformProviderProps): ReactElement {\n // The store is long-lived: rebuilding it on a context change would discard\n // hydration state, so the current context is pushed in through setContext.\n const latest = useRef({ context, dismissals, isAnchorAvailable })\n latest.current = { context, dismissals, isAnchorAvailable }\n\n const store = useMemo(\n () =>\n createInformStore({\n registry,\n context: latest.current.context,\n dismissals: latest.current.dismissals ?? createWebDismissalStore(),\n isAnchorAvailable: anchor => latest.current.isAnchorAvailable(anchor),\n }),\n [registry]\n )\n\n // Storage is read after mount, never during render: reading it inline would\n // paint a message for one frame and then yank it away.\n useEffect(() => {\n store.hydrate()\n }, [store])\n\n useEffect(() => {\n store.setContext(context)\n }, [store, context])\n\n return (\n <InformStoreContext.Provider value={store}>\n <InformContextValue.Provider value={context}>{children}</InformContextValue.Provider>\n </InformStoreContext.Provider>\n )\n}\n","import { useCallback, useContext, useSyncExternalStore } from 'react'\n\nimport type { InformContext, InformResolution } from '../core/types'\nimport { InformContextValue, InformStoreContext } from './inform-provider'\n\nexport type UseInformResult = {\n resolution: InformResolution\n ready: boolean\n dismiss: (id: string) => void\n}\n\nexport function useInform(): UseInformResult {\n const store = useContext(InformStoreContext)\n if (store === null) {\n throw new Error('useInform must be used inside an <InformProvider>.')\n }\n\n const resolution = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot)\n const dismiss = useCallback(\n (id: string) => {\n store.dismiss(id)\n },\n [store]\n )\n\n return { resolution, ready: store.isReady(), dismiss }\n}\n\n/**\n * The context the nearest provider was given. Safe to read during render: it is\n * a plain React context value, not the store's mutable internal context.\n */\nexport function useInformContext(): InformContext {\n const context = useContext(InformContextValue)\n if (context === null) {\n throw new Error('useInformContext must be used inside an <InformProvider>.')\n }\n return context\n}\n","import type { ReactElement } from 'react'\n\nimport { INFORM_SURFACES, resolveContent } from '../core/types'\nimport type { InformContent, InformMessage, InformSurface } from '../core/types'\nimport { InformBanner } from '../surfaces/inform-banner'\nimport { InformFlyoutStack } from '../surfaces/flyout-stack'\nimport type { InformFlyoutPlacement } from '../surfaces/flyout-stack'\nimport { InformCornerFlyout } from '../surfaces/inform-corner-flyout'\nimport { InformDialog } from '../surfaces/inform-dialog'\nimport { InformSpotlight } from '../surfaces/inform-spotlight'\nimport { useInform, useInformContext } from './use-inform'\n\nexport type InformOutletProps = {\n /**\n * Which surfaces this outlet is responsible for. Defaults to all four. Split\n * them across outlets when surfaces belong in different parts of the tree —\n * an in-flow banner sits in a layout slot, while the overlay surfaces belong\n * at the layout root.\n */\n surfaces?: readonly InformSurface[]\n /** CSS length for the flyout stack's inset on its anchored edge. */\n flyoutOffset?: string\n /** Which corner the flyout stack is anchored to. */\n flyoutPlacement?: InformFlyoutPlacement\n}\n\nexport function InformOutlet({\n flyoutOffset,\n flyoutPlacement,\n surfaces = INFORM_SURFACES,\n}: InformOutletProps): ReactElement {\n const { dismiss, resolution } = useInform()\n const context = useInformContext()\n\n const contentOf = (message: InformMessage): InformContent => resolveContent(message, context)\n\n const pick = (surface: InformSurface): InformMessage | null =>\n surfaces.includes(surface) ? (resolution[surface] as InformMessage | null) : null\n\n const banner = pick('banner')\n const dialog = pick('dialog')\n const spotlight = pick('spotlight')\n const flyouts = surfaces.includes('corner-flyout') ? resolution['corner-flyout'] : []\n\n return (\n <>\n {banner === null ? null : (\n <InformBanner\n {...contentOf(banner)}\n dismissable={banner.dismiss !== 'none'}\n onDismiss={() => {\n dismiss(banner.id)\n }}\n severity={banner.severity}\n />\n )}\n {dialog === null ? null : (\n <InformDialog\n {...contentOf(dialog)}\n dismissable={dialog.dismiss !== 'none'}\n onDismiss={() => {\n dismiss(dialog.id)\n }}\n open\n severity={dialog.severity}\n />\n )}\n {flyouts.length === 0 ? null : (\n <InformFlyoutStack offset={flyoutOffset} placement={flyoutPlacement}>\n {flyouts.map(message => (\n <InformCornerFlyout\n key={message.id}\n {...contentOf(message)}\n dismissable={message.dismiss !== 'none'}\n onDismiss={() => {\n dismiss(message.id)\n }}\n open\n severity={message.severity}\n />\n ))}\n </InformFlyoutStack>\n )}\n {spotlight === null || spotlight.anchor === undefined ? null : (\n <InformSpotlight\n {...contentOf(spotlight)}\n anchor={spotlight.anchor}\n onDismiss={() => {\n dismiss(spotlight.id)\n }}\n open\n severity={spotlight.severity}\n />\n )}\n </>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/react/inform-provider.tsx","../../src/react/use-inform.ts","../../src/react/inform-outlet.tsx"],"names":["jsx"],"mappings":";;;;;AASO,IAAM,kBAAA,GAAqB,cAAkC,IAAI,CAAA;A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AAAA,QACjC,WAAW,MAAM;AACf,UAAA,OAAA,CAAQ,QAAQ,EAAE,CAAA;AAAA,QACpB,CAAA;AAAA,QACA,IAAA,EAAI,IAAA;AAAA,QACJ,UAAU,OAAA,CAAQ;AAAA,OAAA;AAAA,MAPb,OAAA,CAAQ;AAAA,KAShB,CAAA,EACH,CAAA;AAAA,IAED,cAAc,IAAA,IAAQ,SAAA,CAAU,MAAA,KAAW,MAAA,GAAY,uBACtDA,GAAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACE,GAAG,UAAU,SAAS,CAAA;AAAA,QACvB,QAAQ,SAAA,CAAU,MAAA;AAAA,QAClB,WAAA,EAAa,UAAU,OAAA,KAAY,MAAA;AAAA,QACnC,WAAW,MAAM;AACf,UAAA,OAAA,CAAQ,UAAU,EAAE,CAAA;AAAA,QACtB,CAAA;AAAA,QACA,IAAA,EAAI,IAAA;AAAA,QACJ,UAAU,SAAA,CAAU;AAAA;AAAA;AACtB,GAAA,EAEJ,CAAA;AAEJ","file":"index.js","sourcesContent":["import { createContext, useEffect, useMemo, useRef } from 'react'\nimport type { ReactElement, ReactNode } from 'react'\n\nimport { createWebDismissalStore } from '../core/persistence'\nimport type { DismissalStore } from '../core/persistence'\nimport { createInformStore } from '../core/store'\nimport type { InformStore } from '../core/store'\nimport type { InformContext, InformRegistry } from '../core/types'\n\nexport const InformStoreContext = createContext<InformStore | null>(null)\n\n/**\n * The context the provider was given. Published separately from the store so\n * outlets can resolve function-valued content without reading the store's\n * mutable context during render.\n */\nexport const InformContextValue = createContext<InformContext | null>(null)\n\nexport type InformProviderProps = {\n registry: InformRegistry\n context: InformContext\n dismissals?: DismissalStore\n isAnchorAvailable?: (anchor: string) => boolean\n children: ReactNode\n}\n\nfunction defaultIsAnchorAvailable(anchor: string): boolean {\n if (typeof document === 'undefined') return false\n return document.querySelector(anchor) !== null\n}\n\nexport function InformProvider({\n children,\n context,\n dismissals,\n isAnchorAvailable = defaultIsAnchorAvailable,\n registry,\n}: InformProviderProps): ReactElement {\n // The store is long-lived: rebuilding it on a context change would discard\n // hydration state, so the current context is pushed in through setContext.\n const latest = useRef({ context, dismissals, isAnchorAvailable })\n latest.current = { context, dismissals, isAnchorAvailable }\n\n const store = useMemo(\n () =>\n createInformStore({\n registry,\n context: latest.current.context,\n dismissals: latest.current.dismissals ?? createWebDismissalStore(),\n isAnchorAvailable: anchor => latest.current.isAnchorAvailable(anchor),\n }),\n [registry]\n )\n\n // Storage is read after mount, never during render: reading it inline would\n // paint a message for one frame and then yank it away.\n useEffect(() => {\n store.hydrate()\n }, [store])\n\n useEffect(() => {\n store.setContext(context)\n }, [store, context])\n\n return (\n <InformStoreContext.Provider value={store}>\n <InformContextValue.Provider value={context}>{children}</InformContextValue.Provider>\n </InformStoreContext.Provider>\n )\n}\n","import { useCallback, useContext, useSyncExternalStore } from 'react'\n\nimport type { InformContext, InformResolution } from '../core/types'\nimport { InformContextValue, InformStoreContext } from './inform-provider'\n\nexport type UseInformResult = {\n resolution: InformResolution\n ready: boolean\n dismiss: (id: string) => void\n}\n\nexport function useInform(): UseInformResult {\n const store = useContext(InformStoreContext)\n if (store === null) {\n throw new Error('useInform must be used inside an <InformProvider>.')\n }\n\n const resolution = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot)\n const dismiss = useCallback(\n (id: string) => {\n store.dismiss(id)\n },\n [store]\n )\n\n return { resolution, ready: store.isReady(), dismiss }\n}\n\n/**\n * The context the nearest provider was given. Safe to read during render: it is\n * a plain React context value, not the store's mutable internal context.\n */\nexport function useInformContext(): InformContext {\n const context = useContext(InformContextValue)\n if (context === null) {\n throw new Error('useInformContext must be used inside an <InformProvider>.')\n }\n return context\n}\n","import type { ReactElement } from 'react'\n\nimport { INFORM_SURFACES, resolveContent } from '../core/types'\nimport type { InformContent, InformMessage, InformSurface } from '../core/types'\nimport { InformBanner } from '../surfaces/inform-banner'\nimport { InformFlyoutStack } from '../surfaces/flyout-stack'\nimport type { InformFlyoutPlacement } from '../surfaces/flyout-stack'\nimport { InformCornerFlyout } from '../surfaces/inform-corner-flyout'\nimport { InformDialog } from '../surfaces/inform-dialog'\nimport { InformSpotlight } from '../surfaces/inform-spotlight'\nimport { useInform, useInformContext } from './use-inform'\n\nexport type InformOutletProps = {\n /**\n * Which surfaces this outlet is responsible for. Defaults to all four. Split\n * them across outlets when surfaces belong in different parts of the tree —\n * an in-flow banner sits in a layout slot, while the overlay surfaces belong\n * at the layout root.\n */\n surfaces?: readonly InformSurface[]\n /** CSS length for the flyout stack's inset on its anchored edge. */\n flyoutOffset?: string\n /** Which corner the flyout stack is anchored to. */\n flyoutPlacement?: InformFlyoutPlacement\n}\n\nexport function InformOutlet({\n flyoutOffset,\n flyoutPlacement,\n surfaces = INFORM_SURFACES,\n}: InformOutletProps): ReactElement {\n const { dismiss, resolution } = useInform()\n const context = useInformContext()\n\n const contentOf = (message: InformMessage): InformContent => resolveContent(message, context)\n\n const pick = (surface: InformSurface): InformMessage | null =>\n surfaces.includes(surface) ? (resolution[surface] as InformMessage | null) : null\n\n const banner = pick('banner')\n const dialog = pick('dialog')\n const spotlight = pick('spotlight')\n const flyouts = surfaces.includes('corner-flyout') ? resolution['corner-flyout'] : []\n\n return (\n <>\n {banner === null ? null : (\n <InformBanner\n {...contentOf(banner)}\n dismissable={banner.dismiss !== 'none'}\n onDismiss={() => {\n dismiss(banner.id)\n }}\n severity={banner.severity}\n />\n )}\n {dialog === null ? null : (\n <InformDialog\n {...contentOf(dialog)}\n dismissable={dialog.dismiss !== 'none'}\n onDismiss={() => {\n dismiss(dialog.id)\n }}\n open\n severity={dialog.severity}\n />\n )}\n {flyouts.length === 0 ? null : (\n <InformFlyoutStack offset={flyoutOffset} placement={flyoutPlacement}>\n {flyouts.map(message => (\n <InformCornerFlyout\n key={message.id}\n {...contentOf(message)}\n dismissable={message.dismiss !== 'none'}\n onDismiss={() => {\n dismiss(message.id)\n }}\n open\n severity={message.severity}\n />\n ))}\n </InformFlyoutStack>\n )}\n {spotlight === null || spotlight.anchor === undefined ? null : (\n <InformSpotlight\n {...contentOf(spotlight)}\n anchor={spotlight.anchor}\n dismissable={spotlight.dismiss !== 'none'}\n onDismiss={() => {\n dismiss(spotlight.id)\n }}\n open\n severity={spotlight.severity}\n />\n )}\n </>\n )\n}\n"]}
|
package/dist/surfaces/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export { I as InformFlyoutPlacement, a as InformFlyoutStack, b as InformFlyoutStackProps } from '../flyout-stack-
|
|
2
|
+
import { InformAction, InformSeverity } from '../index.js';
|
|
3
|
+
export { I as InformFlyoutPlacement, a as InformFlyoutStack, b as InformFlyoutStackProps } from '../flyout-stack-eCgRi6ho.js';
|
|
4
4
|
|
|
5
5
|
/** One line box. Matches the first line of text the slot sits beside. */
|
|
6
6
|
declare const SLOT_SIZE_CLASS = "a63-Inform-slot";
|
|
@@ -143,7 +143,7 @@ type InformSpotlightProps = InformSurfaceProps & {
|
|
|
143
143
|
/** CSS selector for the element to highlight. */
|
|
144
144
|
anchor: string;
|
|
145
145
|
};
|
|
146
|
-
declare function InformSpotlight({ actions, anchor, body, className, icon, onDismiss, open, severity, title, }: InformSpotlightProps): ReactElement | null;
|
|
146
|
+
declare function InformSpotlight({ actions, anchor, body, className, dismissLabel, dismissable, icon, onDismiss, open, severity, title, }: InformSpotlightProps): ReactElement | null;
|
|
147
147
|
|
|
148
148
|
type AnchorRect = {
|
|
149
149
|
top: number;
|
|
@@ -157,4 +157,5 @@ type AnchorRect = {
|
|
|
157
157
|
*/
|
|
158
158
|
declare function useAnchorRect(anchor: string, active: boolean): AnchorRect | null;
|
|
159
159
|
|
|
160
|
-
export {
|
|
160
|
+
export { InformActions, InformBanner, InformCornerFlyout, InformDialog, InformDismissButton, InformIconSlot, InformMedia, InformSpotlight, InformThumbnail, SEVERITY_BORDER_CLASS, SEVERITY_TEXT_CLASS, SLOT_SIZE_CLASS, useAnchorRect };
|
|
161
|
+
export type { AnchorRect, InformActionsProps, InformCornerFlyoutProps, InformDialogProps, InformDismissButtonProps, InformIconSlotProps, InformMediaProps, InformSpotlightProps, InformSurfaceProps, InformThumbnailProps };
|
package/dist/surfaces/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { InformActions, InformBanner, InformCornerFlyout, InformDialog, InformDismissButton, InformFlyoutStack, InformIconSlot, InformMedia, InformSpotlight, InformThumbnail, SEVERITY_BORDER_CLASS, SEVERITY_TEXT_CLASS, SLOT_SIZE_CLASS, useAnchorRect } from '../chunk-
|
|
1
|
+
export { InformActions, InformBanner, InformCornerFlyout, InformDialog, InformDismissButton, InformFlyoutStack, InformIconSlot, InformMedia, InformSpotlight, InformThumbnail, SEVERITY_BORDER_CLASS, SEVERITY_TEXT_CLASS, SLOT_SIZE_CLASS, useAnchorRect } from '../chunk-H7WBGUWP.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -72,4 +72,5 @@ declare const INFORM_BLOCKING_SURFACES: readonly InformSurface[];
|
|
|
72
72
|
declare const EMPTY_INFORM_RESOLUTION: InformResolution;
|
|
73
73
|
declare function resolveContent(message: InformMessage, ctx: InformContext): InformContent;
|
|
74
74
|
|
|
75
|
-
export { EMPTY_INFORM_RESOLUTION as E,
|
|
75
|
+
export { EMPTY_INFORM_RESOLUTION as E, INFORM_BLOCKING_SURFACES as d, INFORM_FLYOUT_STACK_LIMIT as e, INFORM_SURFACES as f, resolveContent as r };
|
|
76
|
+
export type { InformMessage as I, InformRegistry as a, InformContext as b, InformResolution as c, InformAction as g, InformContent as h, InformDismissMode as i, InformSeverity as j, InformSurface as k };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atom63/inform",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.5",
|
|
4
4
|
"description": "The Atom63 inform pattern: one message model, one arbiter, and the banner, dialog, corner flyout and spotlight surfaces",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"src/**/*.css"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@atom63/ui-react": "0.2.0-beta.
|
|
56
|
+
"@atom63/ui-react": "0.2.0-beta.14"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": "^19.1.0",
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
"@vitejs/plugin-react": "^6.3.0",
|
|
71
71
|
"axe-core": "^4.14.0",
|
|
72
72
|
"eslint": "10.14.0",
|
|
73
|
-
"jsdom": "
|
|
73
|
+
"jsdom": "31.0.1",
|
|
74
74
|
"react": "^19.3.1",
|
|
75
75
|
"react-dom": "^19.3.1",
|
|
76
76
|
"storybook": "^10.6.6",
|
|
77
|
-
"tsup": "^
|
|
78
|
-
"typescript": "~
|
|
79
|
-
"vitest": "
|
|
77
|
+
"tsup": "^9.0.0",
|
|
78
|
+
"typescript": "~6.0.3",
|
|
79
|
+
"vitest": "5.1.1",
|
|
80
80
|
"vitest-axe": "^0.1.0",
|
|
81
81
|
"@atom63/eslint-config": "0.1.0",
|
|
82
82
|
"@atom63/tsconfig": "0.1.0"
|
|
@@ -1 +0,0 @@
|
|
|
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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A,EAAK,IAAA,EAAM,UAAU,IAAA,EAAK;AAAA,UAClD,QAAA,EAAU,EAAA;AAAA,UAQV,QAAA,kBAAAC,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"]}
|